@vaadin/grid 25.3.0-alpha8 → 25.3.0-beta1
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 +12 -12
- package/src/vaadin-grid-a11y-mixin.js +15 -19
- package/src/vaadin-grid-active-item-mixin.js +1 -1
- package/src/vaadin-grid-column-auto-width-mixin.js +3 -8
- package/src/vaadin-grid-column-group-mixin.js +2 -6
- package/src/vaadin-grid-column-mixin.js +19 -59
- package/src/vaadin-grid-column-reordering-mixin.js +1 -1
- package/src/vaadin-grid-data-provider-mixin.js +1 -1
- package/src/vaadin-grid-drag-and-drop-mixin.js +2 -5
- package/src/vaadin-grid-filter-column-mixin.js +1 -1
- package/src/vaadin-grid-filter-element-mixin.js +1 -3
- package/src/vaadin-grid-header-footer-rendering-mixin.js +1 -1
- package/src/vaadin-grid-keyboard-navigation-mixin.js +3 -7
- package/src/vaadin-grid-mixin.js +3 -27
- package/src/vaadin-grid-row-details-mixin.js +1 -1
- package/src/vaadin-grid-scroll-mixin.js +3 -30
- package/src/vaadin-grid-selection-column-base-mixin.js +3 -3
- package/src/vaadin-grid-sorter-mixin.js +3 -7
- package/web-types.json +4 -4
- package/web-types.lit.json +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "25.3.0-
|
|
3
|
+
"version": "25.3.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
48
|
-
"@vaadin/a11y-base": "25.3.0-
|
|
49
|
-
"@vaadin/checkbox": "25.3.0-
|
|
50
|
-
"@vaadin/component-base": "25.3.0-
|
|
51
|
-
"@vaadin/lit-renderer": "25.3.0-
|
|
52
|
-
"@vaadin/text-field": "25.3.0-
|
|
53
|
-
"@vaadin/vaadin-themable-mixin": "25.3.0-
|
|
48
|
+
"@vaadin/a11y-base": "25.3.0-beta1",
|
|
49
|
+
"@vaadin/checkbox": "25.3.0-beta1",
|
|
50
|
+
"@vaadin/component-base": "25.3.0-beta1",
|
|
51
|
+
"@vaadin/lit-renderer": "25.3.0-beta1",
|
|
52
|
+
"@vaadin/text-field": "25.3.0-beta1",
|
|
53
|
+
"@vaadin/vaadin-themable-mixin": "25.3.0-beta1",
|
|
54
54
|
"lit": "^3.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@vaadin/aura": "25.3.0-
|
|
58
|
-
"@vaadin/chai-plugins": "25.3.0-
|
|
59
|
-
"@vaadin/test-runner-commands": "25.3.0-
|
|
57
|
+
"@vaadin/aura": "25.3.0-beta1",
|
|
58
|
+
"@vaadin/chai-plugins": "25.3.0-beta1",
|
|
59
|
+
"@vaadin/test-runner-commands": "25.3.0-beta1",
|
|
60
60
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
61
|
-
"@vaadin/vaadin-lumo-styles": "25.3.0-
|
|
61
|
+
"@vaadin/vaadin-lumo-styles": "25.3.0-beta1",
|
|
62
62
|
"sinon": "^22.0.0"
|
|
63
63
|
},
|
|
64
64
|
"customElements": "custom-elements.json",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"web-types.json",
|
|
67
67
|
"web-types.lit.json"
|
|
68
68
|
],
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "295432e44a6967e1aff36462b2e3e1d0e64eb8cc"
|
|
70
70
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
|
|
6
7
|
import { findTreeToggleCell, getClosestCell, iterateChildren, iterateRowCells } from './vaadin-grid-helpers.js';
|
|
7
8
|
|
|
8
9
|
export const A11yMixin = (superClass) =>
|
|
@@ -19,7 +20,7 @@ export const A11yMixin = (superClass) =>
|
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
static get observers() {
|
|
22
|
-
return ['__a11yUpdateGridSize(
|
|
23
|
+
return ['__a11yUpdateGridSize(_flatSize, _columnTree, __emptyState)', '__a11yI18nChanged(__effectiveI18n)'];
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/** @private */
|
|
@@ -43,14 +44,14 @@ export const A11yMixin = (superClass) =>
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
/** @private */
|
|
46
|
-
__a11yUpdateGridSize(
|
|
47
|
-
if (
|
|
47
|
+
__a11yUpdateGridSize(flatSize, _columnTree, emptyState) {
|
|
48
|
+
if (flatSize === undefined || _columnTree === undefined) {
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
const headerRowsCount = this.__a11yGetHeaderRowCount(_columnTree);
|
|
52
53
|
const footerRowsCount = this.__a11yGetFooterRowCount(_columnTree);
|
|
53
|
-
const bodyRowsCount = emptyState ? 1 :
|
|
54
|
+
const bodyRowsCount = emptyState ? 1 : flatSize;
|
|
54
55
|
const rowsCount = bodyRowsCount + headerRowsCount + footerRowsCount;
|
|
55
56
|
|
|
56
57
|
this.$.table.setAttribute('aria-rowcount', rowsCount);
|
|
@@ -75,8 +76,12 @@ export const A11yMixin = (superClass) =>
|
|
|
75
76
|
|
|
76
77
|
/** @private */
|
|
77
78
|
__a11yUpdateFooterRows() {
|
|
79
|
+
const bodyRowCount = this._flatSize || 0;
|
|
78
80
|
iterateChildren(this.$.footer, (footerRow, index) => {
|
|
79
|
-
footerRow.setAttribute(
|
|
81
|
+
footerRow.setAttribute(
|
|
82
|
+
'aria-rowindex',
|
|
83
|
+
this.__a11yGetHeaderRowCount(this._columnTree) + bodyRowCount + index + 1,
|
|
84
|
+
);
|
|
80
85
|
});
|
|
81
86
|
}
|
|
82
87
|
|
|
@@ -110,19 +115,13 @@ export const A11yMixin = (superClass) =>
|
|
|
110
115
|
const toggleCell = findTreeToggleCell(row);
|
|
111
116
|
if (this.__isRowExpandable(row)) {
|
|
112
117
|
row.setAttribute('aria-expanded', 'false');
|
|
113
|
-
|
|
114
|
-
toggleCell.setAttribute('aria-expanded', 'false');
|
|
115
|
-
}
|
|
118
|
+
toggleCell?.setAttribute('aria-expanded', 'false');
|
|
116
119
|
} else if (this.__isRowCollapsible(row)) {
|
|
117
120
|
row.setAttribute('aria-expanded', 'true');
|
|
118
|
-
|
|
119
|
-
toggleCell.setAttribute('aria-expanded', 'true');
|
|
120
|
-
}
|
|
121
|
+
toggleCell?.setAttribute('aria-expanded', 'true');
|
|
121
122
|
} else {
|
|
122
123
|
row.removeAttribute('aria-expanded');
|
|
123
|
-
|
|
124
|
-
toggleCell.removeAttribute('aria-expanded');
|
|
125
|
-
}
|
|
124
|
+
toggleCell?.removeAttribute('aria-expanded');
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
127
|
|
|
@@ -133,11 +132,8 @@ export const A11yMixin = (superClass) =>
|
|
|
133
132
|
*/
|
|
134
133
|
__a11yUpdateRowLevel(row, level) {
|
|
135
134
|
// Set level for the expandable rows itself, and all the nested rows.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
} else {
|
|
139
|
-
row.removeAttribute('aria-level');
|
|
140
|
-
}
|
|
135
|
+
const hasLevel = level > 0 || this.__isRowCollapsible(row) || this.__isRowExpandable(row);
|
|
136
|
+
setOrRemoveAttribute(row, 'aria-level', hasLevel && level + 1);
|
|
141
137
|
}
|
|
142
138
|
|
|
143
139
|
/**
|
|
@@ -76,7 +76,7 @@ export const ActiveItemMixin = (superClass) =>
|
|
|
76
76
|
// Cell is the empty state cell
|
|
77
77
|
cell === this.$.emptystatecell ||
|
|
78
78
|
// Cell content is focused
|
|
79
|
-
cell._content.
|
|
79
|
+
cell._content.matches(':focus-within') ||
|
|
80
80
|
// Clicked on a focusable element
|
|
81
81
|
this._isFocusable(e.target) ||
|
|
82
82
|
// Clicked on a label element
|
|
@@ -214,11 +214,7 @@ export const ColumnAutoWidthMixin = (superClass) =>
|
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
|
|
217
|
-
|
|
218
|
-
this.$.scroller.setAttribute('measuring-auto-width', '');
|
|
219
|
-
} else {
|
|
220
|
-
this.$.scroller.removeAttribute('measuring-auto-width');
|
|
221
|
-
}
|
|
217
|
+
this.$.scroller.toggleAttribute('measuring-auto-width', autoWidth);
|
|
222
218
|
}
|
|
223
219
|
|
|
224
220
|
/**
|
|
@@ -311,10 +307,9 @@ export const ColumnAutoWidthMixin = (superClass) =>
|
|
|
311
307
|
// of the virtualizer update loop, ensuring the grid eventually reaches a stable state.
|
|
312
308
|
const hasRowsWithUndefinedIndex = [...this.$.items.children].some((row) => row.index === undefined);
|
|
313
309
|
|
|
314
|
-
const debouncingHiddenChanged = this._debouncerHiddenChanged
|
|
310
|
+
const debouncingHiddenChanged = this._debouncerHiddenChanged?.isActive();
|
|
315
311
|
|
|
316
|
-
const debouncingUpdateFrozenColumn =
|
|
317
|
-
this.__debounceUpdateFrozenColumn && this.__debounceUpdateFrozenColumn.isActive();
|
|
312
|
+
const debouncingUpdateFrozenColumn = this.__debounceUpdateFrozenColumn?.isActive();
|
|
318
313
|
|
|
319
314
|
// When using a percentage-based height, the grid's effective height may
|
|
320
315
|
// be 0 until the resize observer in grid-mixin calculates a min-height.
|
|
@@ -74,9 +74,7 @@ export const GridColumnGroupMixin = (superClass) =>
|
|
|
74
74
|
/** @protected */
|
|
75
75
|
disconnectedCallback() {
|
|
76
76
|
super.disconnectedCallback();
|
|
77
|
-
|
|
78
|
-
this._observer.disconnect();
|
|
79
|
-
}
|
|
77
|
+
this._observer?.disconnect();
|
|
80
78
|
}
|
|
81
79
|
|
|
82
80
|
/**
|
|
@@ -333,9 +331,7 @@ export const GridColumnGroupMixin = (superClass) =>
|
|
|
333
331
|
this._preventHiddenSynchronization = false;
|
|
334
332
|
|
|
335
333
|
// Update the column tree
|
|
336
|
-
|
|
337
|
-
this._grid._debounceUpdateColumnTree();
|
|
338
|
-
}
|
|
334
|
+
this._grid?._debounceUpdateColumnTree?.();
|
|
339
335
|
});
|
|
340
336
|
this._observer.flush();
|
|
341
337
|
}
|
|
@@ -245,17 +245,6 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
245
245
|
type: Function,
|
|
246
246
|
computed: '_computeFooterRenderer(footerRenderer, __initialized)',
|
|
247
247
|
},
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* An internal property that is mainly used by `vaadin-template-renderer`
|
|
251
|
-
* to identify grid column elements.
|
|
252
|
-
*
|
|
253
|
-
* @private
|
|
254
|
-
*/
|
|
255
|
-
__gridColumnElement: {
|
|
256
|
-
type: Boolean,
|
|
257
|
-
value: true,
|
|
258
|
-
},
|
|
259
248
|
};
|
|
260
249
|
}
|
|
261
250
|
|
|
@@ -347,9 +336,7 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
347
336
|
}
|
|
348
337
|
|
|
349
338
|
this._cells?.forEach((cell) => {
|
|
350
|
-
|
|
351
|
-
cell._content.parentNode.removeChild(cell._content);
|
|
352
|
-
}
|
|
339
|
+
cell._content.parentNode?.removeChild(cell._content);
|
|
353
340
|
});
|
|
354
341
|
});
|
|
355
342
|
|
|
@@ -378,9 +365,7 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
378
365
|
|
|
379
366
|
/** @private */
|
|
380
367
|
_flexGrowChanged(flexGrow) {
|
|
381
|
-
|
|
382
|
-
this.parentElement._columnPropChanged('flexGrow');
|
|
383
|
-
}
|
|
368
|
+
this.parentElement?._columnPropChanged?.('flexGrow');
|
|
384
369
|
|
|
385
370
|
this._grid?.__scheduleRenderHeaderFooter?.();
|
|
386
371
|
|
|
@@ -391,9 +376,7 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
391
376
|
|
|
392
377
|
/** @private */
|
|
393
378
|
_widthChanged(width) {
|
|
394
|
-
|
|
395
|
-
this.parentElement._columnPropChanged('width');
|
|
396
|
-
}
|
|
379
|
+
this.parentElement?._columnPropChanged?.('width');
|
|
397
380
|
|
|
398
381
|
this._grid?.__scheduleRenderHeaderFooter?.();
|
|
399
382
|
|
|
@@ -404,24 +387,18 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
404
387
|
|
|
405
388
|
/** @private */
|
|
406
389
|
_frozenChanged(frozen) {
|
|
407
|
-
|
|
408
|
-
this.parentElement._columnPropChanged('frozen', frozen);
|
|
409
|
-
}
|
|
390
|
+
this.parentElement?._columnPropChanged?.('frozen', frozen);
|
|
410
391
|
|
|
411
392
|
this._allCells.forEach((cell) => {
|
|
412
393
|
updateCellState(cell, 'frozen', frozen);
|
|
413
394
|
});
|
|
414
395
|
|
|
415
|
-
|
|
416
|
-
this._grid._frozenCellsChanged();
|
|
417
|
-
}
|
|
396
|
+
this._grid?._frozenCellsChanged?.();
|
|
418
397
|
}
|
|
419
398
|
|
|
420
399
|
/** @private */
|
|
421
400
|
_frozenToEndChanged(frozenToEnd) {
|
|
422
|
-
|
|
423
|
-
this.parentElement._columnPropChanged('frozenToEnd', frozenToEnd);
|
|
424
|
-
}
|
|
401
|
+
this.parentElement?._columnPropChanged?.('frozenToEnd', frozenToEnd);
|
|
425
402
|
|
|
426
403
|
this._allCells.forEach((cell) => {
|
|
427
404
|
// Skip sizer cells to keep correct scrollWidth.
|
|
@@ -432,9 +409,7 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
432
409
|
updateCellState(cell, 'frozen-to-end', frozenToEnd);
|
|
433
410
|
});
|
|
434
411
|
|
|
435
|
-
|
|
436
|
-
this._grid._frozenCellsChanged();
|
|
437
|
-
}
|
|
412
|
+
this._grid?._frozenCellsChanged?.();
|
|
438
413
|
}
|
|
439
414
|
|
|
440
415
|
/** @private */
|
|
@@ -466,11 +441,7 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
466
441
|
|
|
467
442
|
/** @private */
|
|
468
443
|
_rowHeaderChanged(rowHeader, cells) {
|
|
469
|
-
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
cells.forEach((cell) => {
|
|
444
|
+
cells?.forEach((cell) => {
|
|
474
445
|
cell.setAttribute('role', rowHeader ? 'rowheader' : 'gridcell');
|
|
475
446
|
});
|
|
476
447
|
}
|
|
@@ -504,20 +475,20 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
504
475
|
|
|
505
476
|
/** @private */
|
|
506
477
|
_resizableChanged(resizable) {
|
|
507
|
-
if (resizable === undefined
|
|
478
|
+
if (resizable === undefined) {
|
|
508
479
|
return;
|
|
509
480
|
}
|
|
510
481
|
|
|
511
|
-
this._grid
|
|
482
|
+
this._grid?.__scheduleRenderHeaderFooter?.();
|
|
512
483
|
}
|
|
513
484
|
|
|
514
485
|
/** @private */
|
|
515
486
|
_textAlignChanged(textAlign) {
|
|
516
|
-
if (textAlign === undefined
|
|
487
|
+
if (textAlign === undefined) {
|
|
517
488
|
return;
|
|
518
489
|
}
|
|
519
490
|
|
|
520
|
-
this._grid
|
|
491
|
+
this._grid?.__scheduleRenderHeaderFooter?.();
|
|
521
492
|
|
|
522
493
|
this._cells?.forEach((cell) => {
|
|
523
494
|
cell._content.style.textAlign = textAlign;
|
|
@@ -526,35 +497,24 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
526
497
|
|
|
527
498
|
/** @private */
|
|
528
499
|
_hiddenChanged(hidden) {
|
|
529
|
-
|
|
530
|
-
this.parentElement._columnPropChanged('hidden', hidden);
|
|
531
|
-
}
|
|
500
|
+
this.parentElement?._columnPropChanged?.('hidden', hidden);
|
|
532
501
|
|
|
533
502
|
if (!!hidden !== !!this._previousHidden && this._grid) {
|
|
534
503
|
if (hidden === true) {
|
|
535
504
|
this._cells?.forEach((cell) => {
|
|
536
|
-
|
|
537
|
-
cell._content.parentNode.removeChild(cell._content);
|
|
538
|
-
}
|
|
505
|
+
cell._content.parentNode?.removeChild(cell._content);
|
|
539
506
|
});
|
|
540
507
|
}
|
|
541
508
|
this._grid._debouncerHiddenChanged = Debouncer.debounce(
|
|
542
509
|
this._grid._debouncerHiddenChanged,
|
|
543
510
|
animationFrame,
|
|
544
511
|
() => {
|
|
545
|
-
|
|
546
|
-
this._grid._renderColumnTree(this._grid._columnTree);
|
|
547
|
-
}
|
|
512
|
+
this._grid?._renderColumnTree?.(this._grid._columnTree);
|
|
548
513
|
},
|
|
549
514
|
);
|
|
550
515
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
if (this._grid._resetKeyboardNavigation) {
|
|
556
|
-
this._grid._resetKeyboardNavigation();
|
|
557
|
-
}
|
|
516
|
+
this._grid._debounceUpdateFrozenColumn?.();
|
|
517
|
+
this._grid._resetKeyboardNavigation?.();
|
|
558
518
|
}
|
|
559
519
|
this._previousHidden = hidden;
|
|
560
520
|
}
|
|
@@ -634,7 +594,7 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
634
594
|
|
|
635
595
|
this.__renderCellsContent(headerRenderer, [headerCell]);
|
|
636
596
|
|
|
637
|
-
this._grid?.__scheduleRenderHeaderFooter();
|
|
597
|
+
this._grid?.__scheduleRenderHeaderFooter?.();
|
|
638
598
|
}
|
|
639
599
|
|
|
640
600
|
/** @protected */
|
|
@@ -679,7 +639,7 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
679
639
|
|
|
680
640
|
this.__renderCellsContent(footerRenderer, [footerCell]);
|
|
681
641
|
|
|
682
|
-
this._grid?.__scheduleRenderHeaderFooter();
|
|
642
|
+
this._grid?.__scheduleRenderHeaderFooter?.();
|
|
683
643
|
}
|
|
684
644
|
|
|
685
645
|
/** @protected */
|
|
@@ -116,7 +116,7 @@ export const ColumnReorderingMixin = (superClass) =>
|
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
if (headerCell._content.
|
|
119
|
+
if (headerCell._content.matches(':focus-within')) {
|
|
120
120
|
// Something was focused inside the cell
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
@@ -214,7 +214,7 @@ export const DataProviderMixin = (superClass) =>
|
|
|
214
214
|
* @protected
|
|
215
215
|
*/
|
|
216
216
|
_isExpanded(item) {
|
|
217
|
-
return this.__expandedKeys
|
|
217
|
+
return this.__expandedKeys?.has(this.getItemId(item));
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
/**
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { isChrome, isSafari } from '@vaadin/component-base/src/browser-utils.js';
|
|
7
|
+
import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
|
|
7
8
|
import {
|
|
8
9
|
getBodyRowCells,
|
|
9
10
|
iterateChildren,
|
|
@@ -494,11 +495,7 @@ export const DragAndDropMixin = (superClass) =>
|
|
|
494
495
|
const draggableAttribute = isChrome ? 'draggable-source' : 'draggable';
|
|
495
496
|
|
|
496
497
|
iterateRowCells(row, (cell) => {
|
|
497
|
-
|
|
498
|
-
cell._content.removeAttribute(draggableAttribute);
|
|
499
|
-
} else {
|
|
500
|
-
cell._content.setAttribute(draggableAttribute, true);
|
|
501
|
-
}
|
|
498
|
+
setOrRemoveAttribute(cell._content, draggableAttribute, !dragDisabled);
|
|
502
499
|
});
|
|
503
500
|
|
|
504
501
|
updateBooleanRowStates(row, {
|
|
@@ -37,7 +37,7 @@ export const GridFilterColumnMixin = (superClass) =>
|
|
|
37
37
|
*/
|
|
38
38
|
_defaultHeaderRenderer(root, _column) {
|
|
39
39
|
let filter = root.firstElementChild;
|
|
40
|
-
let textField = filter
|
|
40
|
+
let textField = filter?.firstElementChild;
|
|
41
41
|
|
|
42
42
|
if (!filter) {
|
|
43
43
|
filter = document.createElement('vaadin-grid-filter');
|
|
@@ -90,7 +90,7 @@ export const HeaderFooterRenderingMixin = (superClass) =>
|
|
|
90
90
|
this.#renderFooter(sortedColumnTree);
|
|
91
91
|
|
|
92
92
|
this._resetKeyboardNavigation();
|
|
93
|
-
this.__a11yUpdateGridSize(this.
|
|
93
|
+
this.__a11yUpdateGridSize(this._flatSize, this._columnTree, this.__emptyState);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
#renderHeader(columnTree) {
|
|
@@ -154,9 +154,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
154
154
|
|
|
155
155
|
/** @private */
|
|
156
156
|
_focusableChanged(focusable, oldFocusable) {
|
|
157
|
-
|
|
158
|
-
oldFocusable.setAttribute('tabindex', '-1');
|
|
159
|
-
}
|
|
157
|
+
oldFocusable?.setAttribute('tabindex', '-1');
|
|
160
158
|
if (focusable) {
|
|
161
159
|
this._updateGridSectionFocusTarget(focusable);
|
|
162
160
|
}
|
|
@@ -415,9 +413,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
415
413
|
_onRowNavigation(activeRow, dy) {
|
|
416
414
|
const { dstRow } = this.__navigateRows(dy, activeRow);
|
|
417
415
|
|
|
418
|
-
|
|
419
|
-
dstRow.focus();
|
|
420
|
-
}
|
|
416
|
+
dstRow?.focus();
|
|
421
417
|
}
|
|
422
418
|
|
|
423
419
|
/** @private */
|
|
@@ -765,7 +761,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
765
761
|
// When clicking a cell with only text nodes, skip activating the cell
|
|
766
762
|
// on click, since that is already handled on keydown.
|
|
767
763
|
const cell = e.composedPath()[0];
|
|
768
|
-
const target =
|
|
764
|
+
const target = cell._content?.firstElementChild || cell;
|
|
769
765
|
const wasNavigating = this.hasAttribute('navigating');
|
|
770
766
|
const clickEvent = new MouseEvent('click', {
|
|
771
767
|
shiftKey: e.shiftKey,
|
package/src/vaadin-grid-mixin.js
CHANGED
|
@@ -124,17 +124,6 @@ export const GridMixin = (superClass) =>
|
|
|
124
124
|
value: false,
|
|
125
125
|
},
|
|
126
126
|
|
|
127
|
-
/**
|
|
128
|
-
* An internal property that is mainly used by `vaadin-template-renderer`
|
|
129
|
-
* to identify grid elements.
|
|
130
|
-
*
|
|
131
|
-
* @private
|
|
132
|
-
*/
|
|
133
|
-
__gridElement: {
|
|
134
|
-
type: Boolean,
|
|
135
|
-
value: true,
|
|
136
|
-
},
|
|
137
|
-
|
|
138
127
|
/** @private */
|
|
139
128
|
__hasEmptyStateContent: {
|
|
140
129
|
type: Boolean,
|
|
@@ -152,13 +141,13 @@ export const GridMixin = (superClass) =>
|
|
|
152
141
|
/** @private */
|
|
153
142
|
get _firstVisibleIndex() {
|
|
154
143
|
const firstVisibleItem = this.__getFirstVisibleItem();
|
|
155
|
-
return firstVisibleItem
|
|
144
|
+
return firstVisibleItem?.index;
|
|
156
145
|
}
|
|
157
146
|
|
|
158
147
|
/** @private */
|
|
159
148
|
get _lastVisibleIndex() {
|
|
160
149
|
const lastVisibleItem = this.__getLastVisibleItem();
|
|
161
|
-
return lastVisibleItem
|
|
150
|
+
return lastVisibleItem?.index;
|
|
162
151
|
}
|
|
163
152
|
|
|
164
153
|
constructor() {
|
|
@@ -247,13 +236,6 @@ export const GridMixin = (superClass) =>
|
|
|
247
236
|
// otherwise be triggered by this logic because it reads the row height
|
|
248
237
|
// right after updating the rows' content.
|
|
249
238
|
__disableHeightPlaceholder: true,
|
|
250
|
-
// The virtualizer amortizes scroller height updates to avoid reflows while
|
|
251
|
-
// scrolling. In `allRowsVisible` mode the grid has no scrolling and its
|
|
252
|
-
// height must track the content exactly, so tell the virtualizer to always
|
|
253
|
-
// apply the scroller height. Otherwise the items container can be left at a
|
|
254
|
-
// stale, too-small height and clip rows when the grid grows (e.g. when
|
|
255
|
-
// expanding a tree grid from a small size).
|
|
256
|
-
__alwaysUpdateScrollerSize: () => this.allRowsVisible,
|
|
257
239
|
});
|
|
258
240
|
|
|
259
241
|
this._tooltipController = new TooltipController(this);
|
|
@@ -305,9 +287,7 @@ export const GridMixin = (superClass) =>
|
|
|
305
287
|
__focusBodyCell({ item, column }) {
|
|
306
288
|
const row = this._getRenderedRows().find((row) => row._item === item);
|
|
307
289
|
const cell = row && [...row.children].find((cell) => cell._column === column);
|
|
308
|
-
|
|
309
|
-
cell.focus();
|
|
310
|
-
}
|
|
290
|
+
cell?.focus();
|
|
311
291
|
}
|
|
312
292
|
|
|
313
293
|
/** @protected */
|
|
@@ -530,7 +510,6 @@ export const GridMixin = (superClass) =>
|
|
|
530
510
|
// Might be empty if only cache was used
|
|
531
511
|
this.appendChild(contentsFragment);
|
|
532
512
|
|
|
533
|
-
this._frozenCellsChanged();
|
|
534
513
|
this._updateFirstAndLastColumnForRow(row);
|
|
535
514
|
}
|
|
536
515
|
|
|
@@ -596,11 +575,8 @@ export const GridMixin = (superClass) =>
|
|
|
596
575
|
this.__initRow(this.$.sizer, columnTree[columnTree.length - 1]);
|
|
597
576
|
|
|
598
577
|
this._resizeHandler();
|
|
599
|
-
this._frozenCellsChanged();
|
|
600
|
-
this._resetKeyboardNavigation();
|
|
601
578
|
this.__a11yUpdateHeaderRows();
|
|
602
579
|
this.__a11yUpdateFooterRows();
|
|
603
|
-
this.generateCellPartNames();
|
|
604
580
|
this.__updateHeaderAndFooter();
|
|
605
581
|
}
|
|
606
582
|
|
|
@@ -180,7 +180,7 @@ export const RowDetailsMixin = (superClass) =>
|
|
|
180
180
|
* @protected
|
|
181
181
|
*/
|
|
182
182
|
_isDetailsOpened(item) {
|
|
183
|
-
return this.__detailsOpenedKeys
|
|
183
|
+
return this.__detailsOpenedKeys?.has(this.getItemId(item));
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
/** @private */
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { microTask, timeOut } from '@vaadin/component-base/src/async.js';
|
|
7
7
|
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
8
8
|
import { getNormalizedScrollLeft } from '@vaadin/component-base/src/dir-utils.js';
|
|
9
|
+
import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
|
|
9
10
|
import { OverflowController } from '@vaadin/component-base/src/overflow-controller.js';
|
|
10
11
|
|
|
11
12
|
const timeouts = {
|
|
@@ -88,19 +89,6 @@ export const ScrollMixin = (superClass) =>
|
|
|
88
89
|
return this.$.table.scrollLeft;
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
/** @private */
|
|
92
|
-
get _scrollTop() {
|
|
93
|
-
return this.$.table.scrollTop;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Override (from iron-scroll-target-behavior) to avoid document scroll
|
|
98
|
-
* @private
|
|
99
|
-
*/
|
|
100
|
-
set _scrollTop(top) {
|
|
101
|
-
this.$.table.scrollTop = top;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
92
|
/** @protected */
|
|
105
93
|
get _lazyColumns() {
|
|
106
94
|
return this.columnRendering === 'lazy';
|
|
@@ -135,12 +123,6 @@ export const ScrollMixin = (superClass) =>
|
|
|
135
123
|
|
|
136
124
|
this.__scrollIntoViewport(scrollTarget);
|
|
137
125
|
}
|
|
138
|
-
|
|
139
|
-
if (!this.$.table.contains(e.relatedTarget)) {
|
|
140
|
-
// Virtualizer can't catch the event because if orginates from the light DOM.
|
|
141
|
-
// Dispatch a virtualizer-element-focused event for virtualizer to catch.
|
|
142
|
-
this.$.table.dispatchEvent(new CustomEvent('virtualizer-element-focused', { detail: { element: row } }));
|
|
143
|
-
}
|
|
144
126
|
}
|
|
145
127
|
});
|
|
146
128
|
|
|
@@ -244,13 +226,8 @@ export const ScrollMixin = (superClass) =>
|
|
|
244
226
|
|
|
245
227
|
/** @private */
|
|
246
228
|
_scheduleScrolling() {
|
|
247
|
-
|
|
248
|
-
// Defer setting state attributes to avoid Edge hiccups
|
|
249
|
-
this._scrollingFrame = requestAnimationFrame(() => this.$.scroller.toggleAttribute('scrolling', true));
|
|
250
|
-
}
|
|
229
|
+
this.$.scroller.toggleAttribute('scrolling', true);
|
|
251
230
|
this._debounceScrolling = Debouncer.debounce(this._debounceScrolling, timeOut.after(timeouts.SCROLLING), () => {
|
|
252
|
-
cancelAnimationFrame(this._scrollingFrame);
|
|
253
|
-
delete this._scrollingFrame;
|
|
254
231
|
this.$.scroller.toggleAttribute('scrolling', false);
|
|
255
232
|
});
|
|
256
233
|
}
|
|
@@ -377,11 +354,7 @@ export const ScrollMixin = (superClass) =>
|
|
|
377
354
|
|
|
378
355
|
/** @private */
|
|
379
356
|
__columnRenderingChanged(_columnTree, columnRendering) {
|
|
380
|
-
|
|
381
|
-
this.$.scroller.removeAttribute('column-rendering');
|
|
382
|
-
} else {
|
|
383
|
-
this.$.scroller.setAttribute('column-rendering', columnRendering);
|
|
384
|
-
}
|
|
357
|
+
setOrRemoveAttribute(this.$.scroller, 'column-rendering', columnRendering !== 'eager' && columnRendering);
|
|
385
358
|
|
|
386
359
|
this.__updateColumnsBodyContentHidden();
|
|
387
360
|
}
|
|
@@ -174,8 +174,8 @@ export const GridSelectionColumnBaseMixin = (superClass) =>
|
|
|
174
174
|
this._headerCell.appendChild(label);
|
|
175
175
|
}
|
|
176
176
|
label.textContent = selectAllUnavailable;
|
|
177
|
-
} else
|
|
178
|
-
label
|
|
177
|
+
} else {
|
|
178
|
+
label?.remove();
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
@@ -383,7 +383,7 @@ export const GridSelectionColumnBaseMixin = (superClass) =>
|
|
|
383
383
|
|
|
384
384
|
// Get the index of the row being hovered over or the first/last
|
|
385
385
|
// visible row if hovering outside the grid
|
|
386
|
-
let hoveredIndex = hoveredRow
|
|
386
|
+
let hoveredIndex = hoveredRow?.index;
|
|
387
387
|
const scrollableArea = this.__getScrollableArea();
|
|
388
388
|
if (this.__dragCurrentY < scrollableArea.top) {
|
|
389
389
|
hoveredIndex = this._grid._firstVisibleIndex;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
|
|
6
7
|
import { getClosestCell } from './vaadin-grid-helpers.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -97,11 +98,7 @@ export const GridSorterMixin = (superClass) =>
|
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
const ariaLabel = grid.__effectiveI18n.sorter?.replace('{column}', this.textContent.trim());
|
|
100
|
-
|
|
101
|
-
this.setAttribute('aria-label', ariaLabel);
|
|
102
|
-
} else {
|
|
103
|
-
this.removeAttribute('aria-label');
|
|
104
|
-
}
|
|
101
|
+
setOrRemoveAttribute(this, 'aria-label', ariaLabel);
|
|
105
102
|
}
|
|
106
103
|
|
|
107
104
|
/** @private */
|
|
@@ -134,8 +131,7 @@ export const GridSorterMixin = (superClass) =>
|
|
|
134
131
|
return;
|
|
135
132
|
}
|
|
136
133
|
|
|
137
|
-
|
|
138
|
-
if (this !== activeElement && this.contains(activeElement)) {
|
|
134
|
+
if (this.matches(':focus-within') && !this.matches(':focus')) {
|
|
139
135
|
// Some focusable content inside the sorter was clicked, do nothing.
|
|
140
136
|
return;
|
|
141
137
|
}
|
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.3.0-
|
|
4
|
+
"version": "25.3.0-beta1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
205
|
"name": "vaadin-grid-column",
|
|
206
|
-
"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.3.0-
|
|
206
|
+
"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.3.0-beta1/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
|
|
207
207
|
"attributes": [
|
|
208
208
|
{
|
|
209
209
|
"name": "auto-width",
|
|
@@ -820,7 +820,7 @@
|
|
|
820
820
|
},
|
|
821
821
|
{
|
|
822
822
|
"name": "vaadin-grid-selection-column",
|
|
823
|
-
"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.3.0-
|
|
823
|
+
"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.3.0-beta1/#/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__",
|
|
824
824
|
"attributes": [
|
|
825
825
|
{
|
|
826
826
|
"name": "auto-select",
|
|
@@ -1880,7 +1880,7 @@
|
|
|
1880
1880
|
},
|
|
1881
1881
|
{
|
|
1882
1882
|
"name": "vaadin-grid",
|
|
1883
|
-
"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.3.0-alpha8/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/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.3.0-alpha8/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/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.3.0-alpha8/#/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.3.0-alpha8/#/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`header-row` | Header row in the internal table\n`footer-row` | Footer 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`first-header-row` | The first header row\n`first-footer-row` | The first footer row\n`last-row` | The last body row\n`last-header-row` | The last header row\n`last-footer-row` | The last footer 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.",
|
|
1883
|
+
"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.3.0-beta1/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/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.3.0-beta1/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/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.3.0-beta1/#/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.3.0-beta1/#/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`header-row` | Header row in the internal table\n`footer-row` | Footer 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`first-header-row` | The first header row\n`first-footer-row` | The first footer row\n`last-row` | The last body row\n`last-header-row` | The last header row\n`last-footer-row` | The last footer 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.",
|
|
1884
1884
|
"attributes": [
|
|
1885
1885
|
{
|
|
1886
1886
|
"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.3.0-
|
|
4
|
+
"version": "25.3.0-beta1",
|
|
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.3.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.3.0-beta1/#/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.3.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.3.0-beta1/#/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
|
{
|
|
@@ -835,7 +835,7 @@
|
|
|
835
835
|
},
|
|
836
836
|
{
|
|
837
837
|
"name": "vaadin-grid",
|
|
838
|
-
"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.3.0-alpha8/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/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.3.0-alpha8/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha8/#/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.3.0-alpha8/#/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.3.0-alpha8/#/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`header-row` | Header row in the internal table\n`footer-row` | Footer 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`first-header-row` | The first header row\n`first-footer-row` | The first footer row\n`last-row` | The last body row\n`last-header-row` | The last header row\n`last-footer-row` | The last footer 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.",
|
|
838
|
+
"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.3.0-beta1/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/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.3.0-beta1/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/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.3.0-beta1/#/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.3.0-beta1/#/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`header-row` | Header row in the internal table\n`footer-row` | Footer 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`first-header-row` | The first header row\n`first-footer-row` | The first footer row\n`last-row` | The last body row\n`last-header-row` | The last header row\n`last-footer-row` | The last footer 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.",
|
|
839
839
|
"extension": true,
|
|
840
840
|
"attributes": [
|
|
841
841
|
{
|