-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrid.css
219 lines (186 loc) · 3.92 KB
/
grid.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/*
* Flex table with scrollable tbody:
* https://jsfiddle.net/bakgx0yz/1/
*/
table.grid-table {
display: flex;
flex-flow: column nowrap;
border-spacing: 0;
height: 100%;
width: 100%;
}
table.grid-table thead th .grid-col-filter {
width: 100%;
box-sizing: border-box;
border: 1px solid rgb(212, 212, 212);
padding: 0 2px;
font-weight: normal !important;
}
table.grid-table thead {
display: block;
flex: 0 0 auto;
overflow-y: scroll;
overflow-x: hidden;
}
/* we always enable vertical scrollbar to perfeclty align headers with body
but we dont actually want to see it - dont know of an analog for other
browsers */
table.grid-table thead::-webkit-scrollbar {
visibility: hidden;
}
table.grid-table tbody {
display: block;
flex: 1 1 auto;
overflow: scroll;
/* tbody is focusable using tabindex, so make sure to disable outline */
outline: none;
}
table.grid-table tr {
width: 100%;
}
table.grid-table thead tr,
table.grid-table tbody tr {
display: table;
table-layout: fixed;
}
table.grid-table tbody td {
height: 30px;
}
/*
* borders
*/
table.grid-table th,
table.grid-table td {
border-right: 1px solid rgb(212, 212, 212);
padding: .4rem;
box-sizing: border-box;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
table.grid-table th:first-child,
table.grid-table td:first-child {
border-left: 1px solid rgb(212, 212, 212);
}
table.grid-table th {
border-top: 1px solid rgb(212, 212, 212);
border-bottom: 1px solid rgb(212, 212, 212);
height: 4rem;
background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(rgb(238, 238, 238)), to(rgb(255, 255, 255))) padding-box;
text-align: left;
vertical-align: top;
}
/*
* zebra
*/
table.grid-table tbody tr:nth-child(odd) {
background-color: rgb(243, 243, 243);
}
table.grid-table tbody tr:nth-child(even) {
background-color: rgb(253, 253, 253);
}
/*
* virtual scroll
*/
table.grid-table tbody x-rowgroup {
display: block;
}
/*
* filters
*/
table.grid-table .grid-col-filter-clear-btn {
position: absolute;
right: 0;
padding-left: 0.5rem;
padding-right: 0.3rem;
line-height: 1.5em;
cursor: pointer;
color: #888;
}
table.grid-table .grid-col-filter-clear-btn:before {
content: "\2a09";
}
/*
* sorting
*/
table.grid-table .grid-col-sort-icon {
margin-left: 0.5em;
}
table.grid-table .grid-col-sort-icon-asc:before {
content: "\25be";
}
table.grid-table .grid-col-sort-icon-desc:before {
content: "\25b4";
}
table.grid-table .grid-col-title {
cursor: default;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
table.grid-table .grid-col-title-sort {
cursor: pointer;
}
/*
* row selection
*/
table.grid-table tbody tr.grid-row-selected td {
background-color: rgb(201, 221, 225);
}
/*
* menu
*/
.grid-menu-toggle {
position: absolute;
top: 0;
right: 0;
padding: 0.5rem;
border: 1px solid rgb(212, 212, 212);
background-color: #eee;
font-weight: bold;
z-index: 10;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.grid-menu-toggle:before {
content: " \2630";
}
.grid-menu {
position: absolute;
top: 2em;
right: 1em;
display: none;
border: 1px solid rgb(212, 212, 212);
background-color: #eee;
}
.grid-menu-open {
display: block !important;
z-index: 100;
box-shadow: 3px 3px 3px #888;
}
.grid-menu .grid-menu-list {
padding: 0;
margin: 0;
}
.grid-menu .grid-menu-list li {
list-style-type: none;
border-bottom: 1px solid rgb(212, 212, 212);
padding: 0.5em 1em;
cursor: pointer;
}
.grid-menu .grid-menu-list li:hover {
background-color: #ddd;
}
.grid-menu .grid-menu-col-visible:before {
content: "\2611\00a0"; /* ticked checkbox */
}
.grid-menu .grid-menu-col-hidden:before {
content: "\2610\00a0"; /* empty checkbox */
}