@vaadin/grid 25.0.0-alpha19 → 25.0.0-alpha20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -11
- package/src/styles/vaadin-grid-base-styles.js +243 -84
- package/src/styles/vaadin-grid-sorter-base-styles.js +1 -0
- package/src/vaadin-grid-a11y-mixin.js +11 -1
- package/src/vaadin-grid-column-mixin.js +0 -16
- package/src/vaadin-grid-helpers.js +9 -0
- package/src/vaadin-grid-mixin.js +6 -3
- package/src/vaadin-grid-selection-column-base-mixin.d.ts +1 -1
- package/src/vaadin-grid-selection-column-base-mixin.js +1 -1
- package/src/vaadin-grid-selection-column.d.ts +2 -0
- package/src/vaadin-grid-selection-column.js +2 -1
- package/src/vaadin-grid-sort-column.d.ts +2 -0
- package/src/vaadin-grid.js +1 -0
- package/web-types.json +6 -6
- package/web-types.lit.json +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,24 +44,24 @@
|
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
47
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
48
|
-
"@vaadin/checkbox": "25.0.0-
|
|
49
|
-
"@vaadin/component-base": "25.0.0-
|
|
50
|
-
"@vaadin/lit-renderer": "25.0.0-
|
|
51
|
-
"@vaadin/text-field": "25.0.0-
|
|
52
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
47
|
+
"@vaadin/a11y-base": "25.0.0-alpha20",
|
|
48
|
+
"@vaadin/checkbox": "25.0.0-alpha20",
|
|
49
|
+
"@vaadin/component-base": "25.0.0-alpha20",
|
|
50
|
+
"@vaadin/lit-renderer": "25.0.0-alpha20",
|
|
51
|
+
"@vaadin/text-field": "25.0.0-alpha20",
|
|
52
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha20",
|
|
53
53
|
"lit": "^3.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
57
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
56
|
+
"@vaadin/chai-plugins": "25.0.0-alpha20",
|
|
57
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha20",
|
|
58
58
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
59
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
59
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha20",
|
|
60
60
|
"sinon": "^21.0.0"
|
|
61
61
|
},
|
|
62
62
|
"web-types": [
|
|
63
63
|
"web-types.json",
|
|
64
64
|
"web-types.lit.json"
|
|
65
65
|
],
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "c948aae591a30b432f3784000d4677674cae56e0"
|
|
67
67
|
}
|
|
@@ -25,13 +25,12 @@ export const gridStyles = css`
|
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
-webkit-tap-highlight-color: transparent;
|
|
27
27
|
background: var(--vaadin-grid-background, var(--vaadin-background-color));
|
|
28
|
-
border: var(--_border-width) solid var(--
|
|
28
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
29
29
|
cursor: default;
|
|
30
|
+
--_border-color: var(--vaadin-grid-border-color, var(--vaadin-border-color-secondary));
|
|
30
31
|
--_border-width: 0;
|
|
31
|
-
--_row-border-width: var(--vaadin-grid-
|
|
32
|
-
--_column-border-width: var(--vaadin-grid-
|
|
33
|
-
--_cell-padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
|
|
34
|
-
--_selection-background-image: none;
|
|
32
|
+
--_row-border-width: var(--vaadin-grid-row-border-width, 1px);
|
|
33
|
+
--_column-border-width: var(--vaadin-grid-column-border-width, 0px);
|
|
35
34
|
border-radius: var(--_border-radius);
|
|
36
35
|
--_border-radius: 0;
|
|
37
36
|
}
|
|
@@ -79,6 +78,7 @@ export const gridStyles = css`
|
|
|
79
78
|
width: 100%;
|
|
80
79
|
left: 0;
|
|
81
80
|
min-height: 1px;
|
|
81
|
+
z-index: 1;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
#table {
|
|
@@ -102,7 +102,14 @@ export const gridStyles = css`
|
|
|
102
102
|
position: sticky;
|
|
103
103
|
left: 0;
|
|
104
104
|
width: 100%;
|
|
105
|
-
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:host([overflow~='top']) #header,
|
|
108
|
+
:host([overflow~='bottom']) #footer,
|
|
109
|
+
:host([navigating]) #header:has(tr:last-child:focus-within),
|
|
110
|
+
:host([navigating]) #footer:has(tr:first-child:focus-within),
|
|
111
|
+
[empty-state] #header {
|
|
112
|
+
z-index: 2;
|
|
106
113
|
}
|
|
107
114
|
|
|
108
115
|
:host([dir='rtl']) #items,
|
|
@@ -127,7 +134,7 @@ export const gridStyles = css`
|
|
|
127
134
|
[part~='reorder-ghost'] {
|
|
128
135
|
font-size: var(--vaadin-grid-header-font-size, 1em);
|
|
129
136
|
font-weight: var(--vaadin-grid-header-font-weight, 500);
|
|
130
|
-
color: var(--vaadin-grid-header-color, var(--vaadin-color));
|
|
137
|
+
color: var(--vaadin-grid-header-color, var(--vaadin-text-color));
|
|
131
138
|
}
|
|
132
139
|
|
|
133
140
|
[part~='row'] {
|
|
@@ -153,111 +160,185 @@ export const gridStyles = css`
|
|
|
153
160
|
[part~='cell'] {
|
|
154
161
|
padding: 0;
|
|
155
162
|
box-sizing: border-box;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
background: var(--vaadin-grid-cell-background, var(--vaadin-background-color));
|
|
164
|
+
border-block: var(--_row-border-width) solid var(--_border-color);
|
|
165
|
+
margin-top: calc(var(--_row-border-width) * -1);
|
|
166
|
+
|
|
167
|
+
/*
|
|
168
|
+
Box-shadows are used to create a "fake" border at the end of the cell/row, which is visible when a row/cell ends
|
|
169
|
+
before the edge of the grid viewport, as well as frozen columns and rows (header and footer).
|
|
170
|
+
If there are frozen columns, we'll make the "fake box-shadow border" on the header and footer opaque by rendering
|
|
171
|
+
both the border color and cell background color, so that a semi-transparent border color doesn't "stack" when
|
|
172
|
+
scrolling horizontally.
|
|
173
|
+
*/
|
|
174
|
+
--_fake-border:
|
|
175
|
+
0 calc(var(--_top, 0) * var(--_row-border-width) * -1) 0 0 var(--_border-color),
|
|
176
|
+
0 calc(var(--_top-opaque, 0) * var(--_row-border-width) * -1) 0 0
|
|
177
|
+
var(--vaadin-grid-cell-background-color, var(--vaadin-background-color)),
|
|
178
|
+
0 calc(var(--_bottom, 0) * var(--_row-border-width)) 0 0 var(--_border-color),
|
|
179
|
+
0 calc(var(--_bottom-opaque, 0) * var(--_row-border-width)) 0 0
|
|
180
|
+
var(--vaadin-grid-cell-background-color, var(--vaadin-background-color)),
|
|
181
|
+
calc(var(--_start, 0) * var(--_column-border-width) * -1) 0 0 0 var(--_border-color),
|
|
182
|
+
calc(var(--_end, 0) * var(--_column-border-width)) 0 0 0 var(--_border-color),
|
|
183
|
+
calc(var(--_end-opaque, 0) * var(--_column-border-width)) 0 0 0
|
|
184
|
+
var(--vaadin-grid-cell-background-color, var(--vaadin-background-color));
|
|
185
|
+
box-shadow: var(--_fake-border);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
[part~='cell']:where(:not([part~='details-cell'])) {
|
|
167
189
|
flex-shrink: 0;
|
|
168
190
|
flex-grow: 1;
|
|
169
|
-
box-sizing: border-box;
|
|
170
191
|
display: flex;
|
|
171
192
|
width: 100%;
|
|
172
193
|
position: relative;
|
|
173
194
|
align-items: center;
|
|
174
195
|
white-space: nowrap;
|
|
196
|
+
border-inline-start: var(--_column-border-width) solid var(--_border-color);
|
|
175
197
|
}
|
|
176
198
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
180
|
-
outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
|
|
199
|
+
[part~='first-column-cell'] {
|
|
200
|
+
border-inline-start: 0;
|
|
181
201
|
}
|
|
182
202
|
|
|
183
|
-
[part~='row']
|
|
184
|
-
|
|
203
|
+
[part~='first-header-row-cell'],
|
|
204
|
+
[part~='first-footer-row-cell'],
|
|
205
|
+
[part~='first-row-cell'] {
|
|
206
|
+
margin-top: 0;
|
|
207
|
+
border-top: 0;
|
|
185
208
|
}
|
|
186
209
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
content: '';
|
|
190
|
-
position: absolute;
|
|
191
|
-
inset: calc(var(--_row-border-width) * -1) 0;
|
|
192
|
-
z-index: 3;
|
|
193
|
-
transform: translateX(var(--_grid-horizontal-scroll-position));
|
|
194
|
-
pointer-events: none;
|
|
195
|
-
visibility: hidden;
|
|
210
|
+
table:has(#header > tr:not([hidden])) [part~='first-row-cell'] {
|
|
211
|
+
border-top: var(--_row-border-width) solid var(--_border-color);
|
|
196
212
|
}
|
|
197
213
|
|
|
198
|
-
[part~='
|
|
199
|
-
|
|
214
|
+
[part~='last-column-cell'] {
|
|
215
|
+
--_end: 1;
|
|
200
216
|
}
|
|
201
217
|
|
|
202
|
-
|
|
218
|
+
[part~='last-column-cell']:is([part~='header-cell'], [part~='footer-cell']) {
|
|
219
|
+
--_end-opaque: 1;
|
|
220
|
+
}
|
|
203
221
|
|
|
204
|
-
|
|
205
|
-
|
|
222
|
+
[part~='last-row-cell']:where(:not([part~='details-opened-row-cell'])),
|
|
223
|
+
[part~='last-footer-row-cell'] {
|
|
224
|
+
border-bottom: 0;
|
|
225
|
+
--_bottom: 1;
|
|
206
226
|
}
|
|
207
227
|
|
|
208
|
-
|
|
228
|
+
[part~='last-frozen-cell'] {
|
|
229
|
+
--_end: 1;
|
|
230
|
+
}
|
|
209
231
|
|
|
210
|
-
|
|
211
|
-
|
|
232
|
+
[part~='last-frozen-cell'] + [part~='cell'] {
|
|
233
|
+
border-inline-start-color: transparent;
|
|
212
234
|
}
|
|
213
235
|
|
|
214
|
-
|
|
215
|
-
|
|
236
|
+
[part~='first-frozen-to-end-cell'] {
|
|
237
|
+
border-inline-start: 0;
|
|
238
|
+
--_start: 1;
|
|
216
239
|
}
|
|
217
240
|
|
|
218
|
-
[part~='
|
|
219
|
-
border-
|
|
220
|
-
var(--vaadin-grid-cell-border-color, var(--vaadin-border-color-subtle));
|
|
241
|
+
[part~='last-header-row-cell'] {
|
|
242
|
+
border-bottom: 0;
|
|
221
243
|
}
|
|
222
244
|
|
|
223
|
-
|
|
224
|
-
|
|
245
|
+
:host([overflow~='top']) [part~='last-header-row-cell'],
|
|
246
|
+
[empty-state] [part~='last-header-row-cell'] {
|
|
247
|
+
--_bottom: 1;
|
|
225
248
|
}
|
|
226
249
|
|
|
227
|
-
[part~='
|
|
228
|
-
|
|
250
|
+
#header:has(:is([frozen], [frozen-to-end])) [part~='last-header-row-cell'] {
|
|
251
|
+
--_bottom-opaque: 1;
|
|
229
252
|
}
|
|
230
253
|
|
|
231
|
-
[part~='
|
|
232
|
-
|
|
233
|
-
|
|
254
|
+
:host([overflow~='bottom']) [part~='first-footer-row-cell'],
|
|
255
|
+
[empty-state] [part~='first-footer-row-cell'] {
|
|
256
|
+
--_top: 1;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
#footer:has(:is([frozen], [frozen-to-end])) [part~='first-footer-row-cell'] {
|
|
260
|
+
--_top-opaque: 1;
|
|
234
261
|
}
|
|
235
262
|
|
|
236
|
-
[part~='
|
|
237
|
-
border-
|
|
238
|
-
|
|
263
|
+
table:has(#footer > tr:not([hidden])) [part~='last-row-cell']:not([part~='details-opened-row-cell']) {
|
|
264
|
+
border-bottom: var(--_row-border-width) solid var(--_border-color);
|
|
265
|
+
--_bottom: 0;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
[part~='body-cell']:where(:not([part~='details-cell'])) {
|
|
269
|
+
--_highlight-background-color: var(--vaadin-grid-row-highlight-background-color, transparent);
|
|
270
|
+
--_highlight-background-image: linear-gradient(
|
|
271
|
+
var(--_highlight-background-color),
|
|
272
|
+
var(--_highlight-background-color)
|
|
273
|
+
);
|
|
274
|
+
background:
|
|
275
|
+
var(--_hover-background-image, none), var(--_selected-background-image, none), var(--_highlight-background-image),
|
|
276
|
+
var(--vaadin-grid-cell-background-color, var(--vaadin-background-color));
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* Variant: wrap cell contents */
|
|
280
|
+
|
|
281
|
+
:host([theme~='wrap-cell-content']) [part~='cell']:not([part~='details-cell']) {
|
|
282
|
+
white-space: normal;
|
|
239
283
|
}
|
|
240
284
|
|
|
241
285
|
/* Variant: row stripes */
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
286
|
+
[part~='odd-row'] {
|
|
287
|
+
--vaadin-grid-cell-background-color: var(--vaadin-grid-row-odd-background-color, var(--vaadin-background-color));
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
:host([theme~='row-stripes']) [part~='odd-row'] {
|
|
291
|
+
--vaadin-grid-cell-background-color: var(
|
|
292
|
+
--vaadin-grid-row-odd-background-color,
|
|
293
|
+
color-mix(in srgb, var(--vaadin-text-color) 4%, var(--vaadin-background-color))
|
|
247
294
|
);
|
|
248
295
|
}
|
|
249
296
|
|
|
297
|
+
/* Raise highlighted rows above others */
|
|
298
|
+
|
|
299
|
+
[part~='row']:focus,
|
|
300
|
+
[part~='row']:focus-within,
|
|
301
|
+
[part~='body-row']:where([selected]) {
|
|
302
|
+
z-index: 3;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
@container style(--vaadin-grid-row-odd-background-color) {
|
|
306
|
+
[part~='odd-row'] {
|
|
307
|
+
z-index: 1;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* Row hover */
|
|
312
|
+
@media (any-hover: hover) {
|
|
313
|
+
@container style(--vaadin-grid-row-hover-background-color) {
|
|
314
|
+
[part~='body-row']:hover {
|
|
315
|
+
z-index: 2;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
[part~='body-row']:hover [part~='cell']:where(:not([part~='details-cell'])) {
|
|
320
|
+
--_hover-background-color: var(--vaadin-grid-row-hover-background-color, transparent);
|
|
321
|
+
--_hover-background-image: linear-gradient(var(--_hover-background-color), var(--_hover-background-color));
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
250
325
|
[part~='details-cell'] {
|
|
251
326
|
position: absolute;
|
|
252
327
|
bottom: 0;
|
|
253
328
|
width: 100%;
|
|
329
|
+
margin-top: 0;
|
|
330
|
+
border-top: 0;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
[part~='last-row-cell'] + [part~='details-cell'] {
|
|
334
|
+
border-bottom: 0;
|
|
254
335
|
}
|
|
255
336
|
|
|
256
337
|
[part~='cell'] ::slotted(vaadin-grid-cell-content) {
|
|
257
338
|
display: block;
|
|
258
339
|
overflow: hidden;
|
|
259
340
|
text-overflow: ellipsis;
|
|
260
|
-
padding: var(--
|
|
341
|
+
padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
|
|
261
342
|
flex: 1;
|
|
262
343
|
min-width: 0;
|
|
263
344
|
}
|
|
@@ -269,12 +350,12 @@ export const gridStyles = css`
|
|
|
269
350
|
}
|
|
270
351
|
|
|
271
352
|
/* Selected row */
|
|
272
|
-
[part~='row'][selected]
|
|
273
|
-
--
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
linear-gradient(var(--_color), var(--_color))
|
|
353
|
+
[part~='body-row'][selected] {
|
|
354
|
+
--_selected-background-color: var(
|
|
355
|
+
--vaadin-grid-row-selected-background-color,
|
|
356
|
+
color-mix(in srgb, currentColor 8%, transparent)
|
|
277
357
|
);
|
|
358
|
+
--_selected-background-image: linear-gradient(var(--_selected-background-color), var(--_selected-background-color));
|
|
278
359
|
}
|
|
279
360
|
|
|
280
361
|
/* Empty state */
|
|
@@ -289,6 +370,7 @@ export const gridStyles = css`
|
|
|
289
370
|
inset: 0;
|
|
290
371
|
flex: 1;
|
|
291
372
|
overflow: hidden;
|
|
373
|
+
margin-top: calc(var(--_row-border-width) * -1);
|
|
292
374
|
}
|
|
293
375
|
|
|
294
376
|
#emptystaterow {
|
|
@@ -300,7 +382,14 @@ export const gridStyles = css`
|
|
|
300
382
|
display: block;
|
|
301
383
|
flex: 1;
|
|
302
384
|
overflow: auto;
|
|
303
|
-
padding: var(--
|
|
385
|
+
padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
|
|
386
|
+
border-top: var(--_row-border-width) solid transparent;
|
|
387
|
+
outline: none;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
#emptystatecell:focus-visible {
|
|
391
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
392
|
+
outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
|
|
304
393
|
}
|
|
305
394
|
|
|
306
395
|
/* Reordering styles */
|
|
@@ -317,7 +406,7 @@ export const gridStyles = css`
|
|
|
317
406
|
box-shadow:
|
|
318
407
|
0 0 0 1px hsla(0deg, 0%, 0%, 0.2),
|
|
319
408
|
0 8px 24px -2px hsla(0deg, 0%, 0%, 0.2);
|
|
320
|
-
padding: var(--
|
|
409
|
+
padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container)) !important;
|
|
321
410
|
border-radius: 3px;
|
|
322
411
|
|
|
323
412
|
/* Prevent overflowing the grid in Firefox */
|
|
@@ -404,13 +493,12 @@ export const gridStyles = css`
|
|
|
404
493
|
inset-inline: 0 auto;
|
|
405
494
|
}
|
|
406
495
|
|
|
407
|
-
[
|
|
408
|
-
|
|
496
|
+
[frozen-to-end] [part~='resize-handle'] {
|
|
497
|
+
translate: calc(var(--_column-border-width) * -1);
|
|
409
498
|
}
|
|
410
499
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
display: none;
|
|
500
|
+
[first-frozen-to-end] {
|
|
501
|
+
margin-inline-start: auto;
|
|
414
502
|
}
|
|
415
503
|
|
|
416
504
|
#scroller:is([column-resizing], [range-selecting]) {
|
|
@@ -418,6 +506,64 @@ export const gridStyles = css`
|
|
|
418
506
|
user-select: none;
|
|
419
507
|
}
|
|
420
508
|
|
|
509
|
+
/* Focus outline element, also used for d'n'd indication */
|
|
510
|
+
:is([part~='row'], [part~='cell'])::after {
|
|
511
|
+
position: absolute;
|
|
512
|
+
inset: calc(var(--_row-border-width) * -1) calc(var(--_column-border-width) * -1);
|
|
513
|
+
z-index: 3;
|
|
514
|
+
pointer-events: none;
|
|
515
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
516
|
+
outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
[part~='first-column-cell']::after {
|
|
520
|
+
inset-inline-start: 0;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
[part~='last-column-cell']::after {
|
|
524
|
+
inset-inline-end: 0;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
#header [part~='row']:first-child::after,
|
|
528
|
+
[part~='first-header-row-cell']::after,
|
|
529
|
+
[part*='first-row']::after {
|
|
530
|
+
top: 0;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
table:has(#header > tr:not([hidden])) [part~='first-row-cell']::after {
|
|
534
|
+
top: calc(var(--_row-border-width) * -1);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
#footer [part~='row']:last-child::after,
|
|
538
|
+
[part~='last-footer-row-cell']::after,
|
|
539
|
+
[part~='last-row']::after,
|
|
540
|
+
[part~='last-row-cell']::after {
|
|
541
|
+
bottom: 0;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
#header [part~='row']:last-child::after,
|
|
545
|
+
table:has(#footer > tr:not([hidden])) [part*='last-row']::after {
|
|
546
|
+
bottom: calc(var(--_row-border-width) * -1);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
:host([navigating]) [part~='row']:focus,
|
|
550
|
+
:host([navigating]) [part~='cell']:focus {
|
|
551
|
+
outline: 0;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
[part~='row']::after {
|
|
555
|
+
transform: translateX(var(--_grid-horizontal-scroll-position));
|
|
556
|
+
inset-inline: 0;
|
|
557
|
+
bottom: 0;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
[part~='row']:focus-visible::after,
|
|
561
|
+
[part~='cell']:focus-visible::after,
|
|
562
|
+
:host([navigating]) [part~='row']:focus::after,
|
|
563
|
+
:host([navigating]) [part~='cell']:focus::after {
|
|
564
|
+
content: '';
|
|
565
|
+
}
|
|
566
|
+
|
|
421
567
|
/* Drag'n'drop styles */
|
|
422
568
|
:host([dragover]) {
|
|
423
569
|
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
@@ -429,31 +575,32 @@ export const gridStyles = css`
|
|
|
429
575
|
}
|
|
430
576
|
|
|
431
577
|
[part~='row'][dragover]::after {
|
|
432
|
-
|
|
578
|
+
content: '';
|
|
433
579
|
}
|
|
434
580
|
|
|
435
581
|
[part~='row'][dragover='above']::after {
|
|
436
582
|
outline: 0;
|
|
437
583
|
border-top: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
[part~='row']:not([part*='first-row'])[dragover='above']::after,
|
|
587
|
+
table:has(#header > tr:not([hidden])) [part*='first-row'][dragover='above']::after {
|
|
438
588
|
top: calc(var(--vaadin-focus-ring-width) / -2);
|
|
439
589
|
}
|
|
440
590
|
|
|
441
591
|
[part~='row'][dragover='below']::after {
|
|
442
592
|
outline: 0;
|
|
443
593
|
border-bottom: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
444
|
-
bottom: calc(var(--vaadin-focus-ring-width) / -2);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
:is([part~='row']:first-child, [part~='first-row'])::after {
|
|
448
|
-
top: 0;
|
|
449
594
|
}
|
|
450
595
|
|
|
451
|
-
|
|
452
|
-
|
|
596
|
+
[part~='row']:not([part*='last-row'])[dragover='below']::after,
|
|
597
|
+
table:has(#footer > tr:not([hidden])) [part*='last-row'][dragover='below']::after {
|
|
598
|
+
bottom: calc(var(--vaadin-focus-ring-width) / -2);
|
|
453
599
|
}
|
|
454
600
|
|
|
455
601
|
[part~='row'][dragstart] [part~='cell'] {
|
|
456
|
-
border-
|
|
602
|
+
border-block-color: transparent !important;
|
|
603
|
+
box-shadow: none;
|
|
457
604
|
}
|
|
458
605
|
|
|
459
606
|
[part~='row'][dragstart] [part~='cell'][last-column] {
|
|
@@ -509,4 +656,16 @@ export const gridStyles = css`
|
|
|
509
656
|
#sizer [part~='cell']::before {
|
|
510
657
|
content: '-';
|
|
511
658
|
}
|
|
659
|
+
|
|
660
|
+
@media (forced-colors: active) {
|
|
661
|
+
:host([overflow~='top']) [part~='last-header-row-cell'] {
|
|
662
|
+
border-bottom: var(--_row-border-width) solid;
|
|
663
|
+
margin-bottom: calc(var(--_row-border-width) * -1);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
:host([overflow~='bottom']) [part~='first-footer-row-cell'] {
|
|
667
|
+
border-top: var(--_row-border-width) solid;
|
|
668
|
+
margin-top: calc(var(--_row-border-width) * -1);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
512
671
|
`;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { iterateChildren, iterateRowCells } from './vaadin-grid-helpers.js';
|
|
6
|
+
import { findTreeToggleCell, iterateChildren, iterateRowCells } from './vaadin-grid-helpers.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @polymerMixin
|
|
@@ -101,12 +101,22 @@ export const A11yMixin = (superClass) =>
|
|
|
101
101
|
* @protected
|
|
102
102
|
*/
|
|
103
103
|
_a11yUpdateRowExpanded(row) {
|
|
104
|
+
const toggleCell = findTreeToggleCell(row);
|
|
104
105
|
if (this.__isRowExpandable(row)) {
|
|
105
106
|
row.setAttribute('aria-expanded', 'false');
|
|
107
|
+
if (toggleCell) {
|
|
108
|
+
toggleCell.setAttribute('aria-expanded', 'false');
|
|
109
|
+
}
|
|
106
110
|
} else if (this.__isRowCollapsible(row)) {
|
|
107
111
|
row.setAttribute('aria-expanded', 'true');
|
|
112
|
+
if (toggleCell) {
|
|
113
|
+
toggleCell.setAttribute('aria-expanded', 'true');
|
|
114
|
+
}
|
|
108
115
|
} else {
|
|
109
116
|
row.removeAttribute('aria-expanded');
|
|
117
|
+
if (toggleCell) {
|
|
118
|
+
toggleCell.removeAttribute('aria-expanded');
|
|
119
|
+
}
|
|
110
120
|
}
|
|
111
121
|
}
|
|
112
122
|
|
|
@@ -536,24 +536,8 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
538
538
|
|
|
539
|
-
let textAlignFallback;
|
|
540
|
-
if (getComputedStyle(this._grid).direction === 'ltr') {
|
|
541
|
-
if (textAlign === 'start') {
|
|
542
|
-
textAlignFallback = 'left';
|
|
543
|
-
} else if (textAlign === 'end') {
|
|
544
|
-
textAlignFallback = 'right';
|
|
545
|
-
}
|
|
546
|
-
} else if (textAlign === 'start') {
|
|
547
|
-
textAlignFallback = 'right';
|
|
548
|
-
} else if (textAlign === 'end') {
|
|
549
|
-
textAlignFallback = 'left';
|
|
550
|
-
}
|
|
551
|
-
|
|
552
539
|
this._allCells.forEach((cell) => {
|
|
553
540
|
cell._content.style.textAlign = textAlign;
|
|
554
|
-
if (getComputedStyle(cell._content).textAlign !== textAlign) {
|
|
555
|
-
cell._content.style.textAlign = textAlignFallback;
|
|
556
|
-
}
|
|
557
541
|
});
|
|
558
542
|
}
|
|
559
543
|
|
|
@@ -173,6 +173,15 @@ export function updateCellState(cell, attribute, value, part, oldPart) {
|
|
|
173
173
|
updatePart(cell, value, part || `${attribute}-cell`);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Finds the cell containing the tree toggle element
|
|
178
|
+
* @param {!HTMLElement} row
|
|
179
|
+
* @return {HTMLElement | null}
|
|
180
|
+
*/
|
|
181
|
+
export function findTreeToggleCell(row) {
|
|
182
|
+
return getBodyRowCells(row).find((cell) => cell._content.querySelector('vaadin-grid-tree-toggle'));
|
|
183
|
+
}
|
|
184
|
+
|
|
176
185
|
/**
|
|
177
186
|
* A helper for observing flattened child column list of an element.
|
|
178
187
|
*/
|
package/src/vaadin-grid-mixin.js
CHANGED
|
@@ -263,11 +263,14 @@ export const GridMixin = (superClass) =>
|
|
|
263
263
|
__disableHeightPlaceholder: true,
|
|
264
264
|
});
|
|
265
265
|
|
|
266
|
-
new ResizeObserver(() =>
|
|
266
|
+
new ResizeObserver(() => {
|
|
267
267
|
setTimeout(() => {
|
|
268
268
|
this.__updateColumnsBodyContentHidden();
|
|
269
|
-
})
|
|
270
|
-
|
|
269
|
+
});
|
|
270
|
+
// Updating data can change the visibility of the scroll bar. Therefore,
|
|
271
|
+
// the scroll position has to be recalculated.
|
|
272
|
+
this.__updateHorizontalScrollPosition();
|
|
273
|
+
}).observe(this.$.table);
|
|
271
274
|
|
|
272
275
|
const minHeightObserver = new ResizeObserver(() =>
|
|
273
276
|
setTimeout(() => {
|
|
@@ -28,7 +28,7 @@ export declare class GridSelectionColumnBaseMixinClass<TItem> {
|
|
|
28
28
|
selectAll: boolean;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* When true, the active gets automatically selected.
|
|
31
|
+
* When true, the active item gets automatically selected.
|
|
32
32
|
* @attr {boolean} auto-select
|
|
33
33
|
*/
|
|
34
34
|
autoSelect: boolean;
|
|
@@ -34,6 +34,8 @@ export * from './vaadin-grid-selection-column-mixin.js';
|
|
|
34
34
|
* selection for all the items at once.
|
|
35
35
|
*
|
|
36
36
|
* __The default content can also be overridden__
|
|
37
|
+
*
|
|
38
|
+
* @fires {CustomEvent} select-all-changed - Fired when the `selectAll` property changes.
|
|
37
39
|
*/
|
|
38
40
|
declare class GridSelectionColumn<TItem = GridDefaultItem> extends HTMLElement {}
|
|
39
41
|
|
|
@@ -30,8 +30,9 @@ import { GridSelectionColumnMixin } from './vaadin-grid-selection-column-mixin.j
|
|
|
30
30
|
*
|
|
31
31
|
* __The default content can also be overridden__
|
|
32
32
|
*
|
|
33
|
-
* @customElement
|
|
34
33
|
* @fires {CustomEvent} select-all-changed - Fired when the `selectAll` property changes.
|
|
34
|
+
*
|
|
35
|
+
* @customElement
|
|
35
36
|
* @extends GridColumn
|
|
36
37
|
* @mixes GridSelectionColumnMixin
|
|
37
38
|
*/
|
|
@@ -21,6 +21,8 @@ export * from './vaadin-grid-sort-column-mixin.js';
|
|
|
21
21
|
* <vaadin-grid-column>
|
|
22
22
|
* ...
|
|
23
23
|
* ```
|
|
24
|
+
*
|
|
25
|
+
* @fires {CustomEvent} direction-changed - Fired when the `direction` property changes.
|
|
24
26
|
*/
|
|
25
27
|
declare class GridSortColumn<TItem = GridDefaultItem> extends HTMLElement {}
|
|
26
28
|
|
package/src/vaadin-grid.js
CHANGED
|
@@ -257,6 +257,7 @@ import { GridMixin } from './vaadin-grid-mixin.js';
|
|
|
257
257
|
* @fires {CustomEvent} loading-changed - Fired when the `loading` property changes.
|
|
258
258
|
* @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
|
|
259
259
|
* @fires {CustomEvent} size-changed - Fired when the `size` property changes.
|
|
260
|
+
* @fires {CustomEvent} item-toggle - Fired when the user selects or deselects an item through the selection column.
|
|
260
261
|
*
|
|
261
262
|
* @customElement
|
|
262
263
|
* @extends HTMLElement
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/grid",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha20",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
},
|
|
239
239
|
{
|
|
240
240
|
"name": "vaadin-grid-column",
|
|
241
|
-
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
241
|
+
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
|
|
242
242
|
"attributes": [
|
|
243
243
|
{
|
|
244
244
|
"name": "resizable",
|
|
@@ -951,7 +951,7 @@
|
|
|
951
951
|
},
|
|
952
952
|
{
|
|
953
953
|
"name": "vaadin-grid-selection-column",
|
|
954
|
-
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>\n\n <vaadin-grid-column>\n ...\n```\n\nBy default the selection column displays `<vaadin-checkbox>` elements in the\ncolumn cells. The checkboxes in the body rows toggle selection of the corresponding row items.\n\nWhen the grid data is provided as an array of [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
954
|
+
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>\n\n <vaadin-grid-column>\n ...\n```\n\nBy default the selection column displays `<vaadin-checkbox>` elements in the\ncolumn cells. The checkboxes in the body rows toggle selection of the corresponding row items.\n\nWhen the grid data is provided as an array of [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid#property-items),\nthe column header gets an additional checkbox that can be used for toggling\nselection for all the items at once.\n\n__The default content can also be overridden__",
|
|
955
955
|
"attributes": [
|
|
956
956
|
{
|
|
957
957
|
"name": "resizable",
|
|
@@ -1099,7 +1099,7 @@
|
|
|
1099
1099
|
},
|
|
1100
1100
|
{
|
|
1101
1101
|
"name": "auto-select",
|
|
1102
|
-
"description": "When true, the active gets automatically selected.",
|
|
1102
|
+
"description": "When true, the active item gets automatically selected.",
|
|
1103
1103
|
"value": {
|
|
1104
1104
|
"type": [
|
|
1105
1105
|
"boolean"
|
|
@@ -1308,7 +1308,7 @@
|
|
|
1308
1308
|
},
|
|
1309
1309
|
{
|
|
1310
1310
|
"name": "autoSelect",
|
|
1311
|
-
"description": "When true, the active gets automatically selected.",
|
|
1311
|
+
"description": "When true, the active item gets automatically selected.",
|
|
1312
1312
|
"value": {
|
|
1313
1313
|
"type": [
|
|
1314
1314
|
"boolean"
|
|
@@ -2152,7 +2152,7 @@
|
|
|
2152
2152
|
},
|
|
2153
2153
|
{
|
|
2154
2154
|
"name": "vaadin-grid",
|
|
2155
|
-
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n`hasChildren` | Boolean | True if the item has children\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.js` entrypoint.\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively\nprovide the `<vaadin-grid>` data through the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`nonselectable-row` | Row that the user may not select or deselect\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`last-row` | The last body row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`nonselectable-row-cell` | Cell in a row that the user may not select or deselect\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
2155
|
+
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n`hasChildren` | Boolean | True if the item has children\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.js` entrypoint.\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively\nprovide the `<vaadin-grid>` data through the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`nonselectable-row` | Row that the user may not select or deselect\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`last-row` | The last body row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`nonselectable-row-cell` | Cell in a row that the user may not select or deselect\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
2156
2156
|
"attributes": [
|
|
2157
2157
|
{
|
|
2158
2158
|
"name": "accessible-name",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/grid",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha20",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "vaadin-grid-column",
|
|
103
|
-
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
103
|
+
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
|
|
104
104
|
"extension": true,
|
|
105
105
|
"attributes": [
|
|
106
106
|
{
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
},
|
|
367
367
|
{
|
|
368
368
|
"name": "vaadin-grid-selection-column",
|
|
369
|
-
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>\n\n <vaadin-grid-column>\n ...\n```\n\nBy default the selection column displays `<vaadin-checkbox>` elements in the\ncolumn cells. The checkboxes in the body rows toggle selection of the corresponding row items.\n\nWhen the grid data is provided as an array of [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
369
|
+
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>\n\n <vaadin-grid-column>\n ...\n```\n\nBy default the selection column displays `<vaadin-checkbox>` elements in the\ncolumn cells. The checkboxes in the body rows toggle selection of the corresponding row items.\n\nWhen the grid data is provided as an array of [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid#property-items),\nthe column header gets an additional checkbox that can be used for toggling\nselection for all the items at once.\n\n__The default content can also be overridden__",
|
|
370
370
|
"extension": true,
|
|
371
371
|
"attributes": [
|
|
372
372
|
{
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
},
|
|
421
421
|
{
|
|
422
422
|
"name": "?autoSelect",
|
|
423
|
-
"description": "When true, the active gets automatically selected.",
|
|
423
|
+
"description": "When true, the active item gets automatically selected.",
|
|
424
424
|
"value": {
|
|
425
425
|
"kind": "expression"
|
|
426
426
|
}
|
|
@@ -828,7 +828,7 @@
|
|
|
828
828
|
},
|
|
829
829
|
{
|
|
830
830
|
"name": "vaadin-grid",
|
|
831
|
-
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n`hasChildren` | Boolean | True if the item has children\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.js` entrypoint.\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively\nprovide the `<vaadin-grid>` data through the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha19/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`nonselectable-row` | Row that the user may not select or deselect\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`last-row` | The last body row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`nonselectable-row-cell` | Cell in a row that the user may not select or deselect\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
831
|
+
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n`hasChildren` | Boolean | True if the item has children\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.js` entrypoint.\n\n### Lazy Loading with Function Data Provider\n\nIn addition to assigning an array to the items property, you can alternatively\nprovide the `<vaadin-grid>` data through the\n[`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`nonselectable-row` | Row that the user may not select or deselect\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`last-row` | The last body row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`nonselectable-row-cell` | Cell in a row that the user may not select or deselect\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
832
832
|
"extension": true,
|
|
833
833
|
"attributes": [
|
|
834
834
|
{
|