@vaadin/grid 25.3.0-alpha6 → 25.3.0-alpha8
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/custom-elements.json +191 -132
- package/package.json +12 -12
- package/src/directives/cell-content-directive.js +33 -0
- package/src/vaadin-grid-a11y-mixin.js +0 -9
- package/src/vaadin-grid-column-auto-width-mixin.js +1 -5
- package/src/vaadin-grid-column-group-mixin.js +3 -14
- package/src/vaadin-grid-column-mixin.d.ts +3 -3
- package/src/vaadin-grid-column-mixin.js +43 -55
- package/src/vaadin-grid-column-reordering-mixin.js +9 -4
- package/src/vaadin-grid-column-resizing-mixin.js +4 -0
- package/src/vaadin-grid-dynamic-columns-mixin.js +0 -5
- package/src/vaadin-grid-filter.js +1 -0
- package/src/vaadin-grid-header-footer-rendering-mixin.js +296 -0
- package/src/vaadin-grid-mixin.js +20 -158
- package/src/vaadin-grid-sort-column-mixin.js +11 -2
- package/src/vaadin-grid-sorter.js +1 -0
- package/src/vaadin-grid-tree-toggle.js +1 -0
- package/src/vaadin-grid.js +1 -0
- package/web-types.json +20 -94
- package/web-types.lit.json +10 -10
package/src/vaadin-grid-mixin.js
CHANGED
|
@@ -4,9 +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 { TabindexMixin } from '@vaadin/a11y-base/src/tabindex-mixin.js';
|
|
7
|
-
import { microTask } from '@vaadin/component-base/src/async.js';
|
|
8
7
|
import { isAndroid, isIOS, isSafari, isTouch } from '@vaadin/component-base/src/browser-utils.js';
|
|
9
|
-
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
10
8
|
import { setTouchAction } from '@vaadin/component-base/src/gestures.js';
|
|
11
9
|
import { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
|
|
12
10
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
@@ -22,6 +20,7 @@ import { DragAndDropMixin } from './vaadin-grid-drag-and-drop-mixin.js';
|
|
|
22
20
|
import { DynamicColumnsMixin } from './vaadin-grid-dynamic-columns-mixin.js';
|
|
23
21
|
import { EventContextMixin } from './vaadin-grid-event-context-mixin.js';
|
|
24
22
|
import { FilterMixin } from './vaadin-grid-filter-mixin.js';
|
|
23
|
+
import { HeaderFooterRenderingMixin } from './vaadin-grid-header-footer-rendering-mixin.js';
|
|
25
24
|
import {
|
|
26
25
|
getBodyRowCells,
|
|
27
26
|
getClosestCell,
|
|
@@ -48,17 +47,21 @@ export const GridMixin = (superClass) =>
|
|
|
48
47
|
ArrayDataProviderMixin(
|
|
49
48
|
DataProviderMixin(
|
|
50
49
|
DynamicColumnsMixin(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
HeaderFooterRenderingMixin(
|
|
51
|
+
ActiveItemMixin(
|
|
52
|
+
ScrollMixin(
|
|
53
|
+
SelectionMixin(
|
|
54
|
+
SortMixin(
|
|
55
|
+
RowDetailsMixin(
|
|
56
|
+
KeyboardNavigationMixin(
|
|
57
|
+
A11yMixin(
|
|
58
|
+
FilterMixin(
|
|
59
|
+
ColumnReorderingMixin(
|
|
60
|
+
ColumnResizingMixin(
|
|
61
|
+
EventContextMixin(
|
|
62
|
+
DragAndDropMixin(StylingMixin(TabindexMixin(ResizeMixin(superClass)))),
|
|
63
|
+
),
|
|
64
|
+
),
|
|
62
65
|
),
|
|
63
66
|
),
|
|
64
67
|
),
|
|
@@ -351,7 +354,7 @@ export const GridMixin = (superClass) =>
|
|
|
351
354
|
updatePart(row, 'row', true);
|
|
352
355
|
updatePart(row, 'body-row', true);
|
|
353
356
|
if (this._columnTree) {
|
|
354
|
-
this.__initRow(row, this._columnTree[this._columnTree.length - 1], 'body',
|
|
357
|
+
this.__initRow(row, this._columnTree[this._columnTree.length - 1], 'body', true);
|
|
355
358
|
}
|
|
356
359
|
rows.push(row);
|
|
357
360
|
}
|
|
@@ -444,11 +447,10 @@ export const GridMixin = (superClass) =>
|
|
|
444
447
|
* @param {!HTMLTableRowElement} row
|
|
445
448
|
* @param {!Array<!GridColumn>} columns
|
|
446
449
|
* @param {?string} section
|
|
447
|
-
* @param {boolean} isColumnRow
|
|
448
450
|
* @param {boolean} noNotify
|
|
449
451
|
* @private
|
|
450
452
|
*/
|
|
451
|
-
__initRow(row, columns, section = 'body',
|
|
453
|
+
__initRow(row, columns, section = 'body', noNotify = false) {
|
|
452
454
|
const contentsFragment = document.createDocumentFragment();
|
|
453
455
|
|
|
454
456
|
iterateRowCells(row, (cell) => {
|
|
@@ -516,30 +518,6 @@ export const GridMixin = (superClass) =>
|
|
|
516
518
|
if (!noNotify) {
|
|
517
519
|
column._cells = [...column._cells];
|
|
518
520
|
}
|
|
519
|
-
} else {
|
|
520
|
-
// Header & footer
|
|
521
|
-
const tagName = section === 'header' ? 'th' : 'td';
|
|
522
|
-
if (isColumnRow || column.localName === 'vaadin-grid-column-group') {
|
|
523
|
-
cell = column[`_${section}Cell`];
|
|
524
|
-
if (!cell) {
|
|
525
|
-
cell = this._createCell(tagName);
|
|
526
|
-
}
|
|
527
|
-
cell._column = column;
|
|
528
|
-
row.appendChild(cell);
|
|
529
|
-
column[`_${section}Cell`] = cell;
|
|
530
|
-
} else {
|
|
531
|
-
if (!column._emptyCells) {
|
|
532
|
-
column._emptyCells = [];
|
|
533
|
-
}
|
|
534
|
-
cell = column._emptyCells.find((cell) => cell._vacant) || this._createCell(tagName);
|
|
535
|
-
cell._column = column;
|
|
536
|
-
row.appendChild(cell);
|
|
537
|
-
if (column._emptyCells.indexOf(cell) === -1) {
|
|
538
|
-
column._emptyCells.push(cell);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
updatePart(cell, 'cell', true);
|
|
542
|
-
updatePart(cell, `${section}-cell`, true);
|
|
543
521
|
}
|
|
544
522
|
|
|
545
523
|
if (!cell._content.parentElement) {
|
|
@@ -549,10 +527,6 @@ export const GridMixin = (superClass) =>
|
|
|
549
527
|
cell._column = column;
|
|
550
528
|
});
|
|
551
529
|
|
|
552
|
-
if (section !== 'body') {
|
|
553
|
-
this.__debounceUpdateHeaderFooterRowVisibility(row);
|
|
554
|
-
}
|
|
555
|
-
|
|
556
530
|
// Might be empty if only cache was used
|
|
557
531
|
this.appendChild(contentsFragment);
|
|
558
532
|
|
|
@@ -560,75 +534,6 @@ export const GridMixin = (superClass) =>
|
|
|
560
534
|
this._updateFirstAndLastColumnForRow(row);
|
|
561
535
|
}
|
|
562
536
|
|
|
563
|
-
/**
|
|
564
|
-
* @param {HTMLTableRowElement} row
|
|
565
|
-
* @protected
|
|
566
|
-
*/
|
|
567
|
-
__debounceUpdateHeaderFooterRowVisibility(row) {
|
|
568
|
-
row.__debounceUpdateHeaderFooterRowVisibility = Debouncer.debounce(
|
|
569
|
-
row.__debounceUpdateHeaderFooterRowVisibility,
|
|
570
|
-
microTask,
|
|
571
|
-
() => this.__updateHeaderFooterRowVisibility(row),
|
|
572
|
-
);
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
* @param {HTMLTableRowElement} row
|
|
577
|
-
* @protected
|
|
578
|
-
*/
|
|
579
|
-
__updateHeaderFooterRowVisibility(row) {
|
|
580
|
-
if (!row) {
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
const visibleRowCells = Array.from(row.children).filter((cell) => {
|
|
585
|
-
const column = cell._column;
|
|
586
|
-
if (column._emptyCells && column._emptyCells.indexOf(cell) > -1) {
|
|
587
|
-
// The cell is an "empty cell" -> doesn't block hiding the row
|
|
588
|
-
return false;
|
|
589
|
-
}
|
|
590
|
-
if (row.parentElement === this.$.header) {
|
|
591
|
-
if (column.headerRenderer) {
|
|
592
|
-
// The cell is the header cell of a column that has a header renderer
|
|
593
|
-
// -> row should be visible
|
|
594
|
-
return true;
|
|
595
|
-
}
|
|
596
|
-
if (column.header === null) {
|
|
597
|
-
// The column header is explicilty set to null -> doesn't block hiding the row
|
|
598
|
-
return false;
|
|
599
|
-
}
|
|
600
|
-
if (column.path || column.header !== undefined) {
|
|
601
|
-
// The column has an explicit non-null header or a path that generates a header
|
|
602
|
-
// -> row should be visible
|
|
603
|
-
return true;
|
|
604
|
-
}
|
|
605
|
-
} else if (column.footerRenderer) {
|
|
606
|
-
// The cell is the footer cell of a column that has a footer renderer
|
|
607
|
-
// -> row should be visible
|
|
608
|
-
return true;
|
|
609
|
-
}
|
|
610
|
-
return false;
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
if (row.hidden !== !visibleRowCells.length) {
|
|
614
|
-
row.hidden = !visibleRowCells.length;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
if (row.parentElement === this.$.header) {
|
|
618
|
-
this.$.table.toggleAttribute('has-header', this.$.header.querySelector('tr:not([hidden])'));
|
|
619
|
-
this.__updateHeaderFooterRowParts('header');
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
if (row.parentElement === this.$.footer) {
|
|
623
|
-
this.$.table.toggleAttribute('has-footer', this.$.footer.querySelector('tr:not([hidden])'));
|
|
624
|
-
this.__updateHeaderFooterRowParts('footer');
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
// Make sure the section has a tabbable element
|
|
628
|
-
this._resetKeyboardNavigation();
|
|
629
|
-
this.__a11yUpdateGridSize(this.size, this._columnTree, this.__emptyState);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
537
|
/** @private */
|
|
633
538
|
__updateVirtualizerElement(row, index) {
|
|
634
539
|
this._preventScrollerRotatingCellFocus(row, index);
|
|
@@ -681,46 +586,17 @@ export const GridMixin = (superClass) =>
|
|
|
681
586
|
*/
|
|
682
587
|
_renderColumnTree(columnTree) {
|
|
683
588
|
iterateChildren(this.$.items, (row) => {
|
|
684
|
-
this.__initRow(row, columnTree[columnTree.length - 1], 'body',
|
|
589
|
+
this.__initRow(row, columnTree[columnTree.length - 1], 'body', true);
|
|
685
590
|
this.__updateRow(row);
|
|
686
591
|
});
|
|
687
592
|
|
|
688
|
-
|
|
689
|
-
const headerRow = document.createElement('tr');
|
|
690
|
-
headerRow.setAttribute('role', 'row');
|
|
691
|
-
headerRow.setAttribute('tabindex', '-1');
|
|
692
|
-
updatePart(headerRow, 'row', true);
|
|
693
|
-
updatePart(headerRow, 'header-row', true);
|
|
694
|
-
this.$.header.appendChild(headerRow);
|
|
695
|
-
|
|
696
|
-
const footerRow = document.createElement('tr');
|
|
697
|
-
footerRow.setAttribute('role', 'row');
|
|
698
|
-
footerRow.setAttribute('tabindex', '-1');
|
|
699
|
-
updatePart(footerRow, 'row', true);
|
|
700
|
-
updatePart(footerRow, 'footer-row', true);
|
|
701
|
-
this.$.footer.appendChild(footerRow);
|
|
702
|
-
}
|
|
703
|
-
while (this.$.header.children.length > columnTree.length) {
|
|
704
|
-
this.$.header.removeChild(this.$.header.firstElementChild);
|
|
705
|
-
this.$.footer.removeChild(this.$.footer.firstElementChild);
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
iterateChildren(this.$.header, (headerRow, index) => {
|
|
709
|
-
this.__initRow(headerRow, columnTree[index], 'header', index === columnTree.length - 1);
|
|
710
|
-
});
|
|
711
|
-
|
|
712
|
-
iterateChildren(this.$.footer, (footerRow, index) => {
|
|
713
|
-
this.__initRow(footerRow, columnTree[columnTree.length - 1 - index], 'footer', index === 0);
|
|
714
|
-
});
|
|
593
|
+
this.__renderHeaderFooter();
|
|
715
594
|
|
|
716
595
|
// Sizer rows
|
|
717
596
|
this.__initRow(this.$.sizer, columnTree[columnTree.length - 1]);
|
|
718
597
|
|
|
719
|
-
this.__updateHeaderFooterRowParts('header');
|
|
720
|
-
this.__updateHeaderFooterRowParts('footer');
|
|
721
598
|
this._resizeHandler();
|
|
722
599
|
this._frozenCellsChanged();
|
|
723
|
-
this._updateFirstAndLastColumn();
|
|
724
600
|
this._resetKeyboardNavigation();
|
|
725
601
|
this.__a11yUpdateHeaderRows();
|
|
726
602
|
this.__a11yUpdateFooterRows();
|
|
@@ -728,20 +604,6 @@ export const GridMixin = (superClass) =>
|
|
|
728
604
|
this.__updateHeaderAndFooter();
|
|
729
605
|
}
|
|
730
606
|
|
|
731
|
-
/** @private */
|
|
732
|
-
__updateHeaderFooterRowParts(section) {
|
|
733
|
-
const visibleRows = [...this.$[section].querySelectorAll('tr:not([hidden])')];
|
|
734
|
-
[...this.$[section].children].forEach((row) => {
|
|
735
|
-
updatePart(row, `first-${section}-row`, row === visibleRows.at(0));
|
|
736
|
-
updatePart(row, `last-${section}-row`, row === visibleRows.at(-1));
|
|
737
|
-
|
|
738
|
-
getBodyRowCells(row).forEach((cell) => {
|
|
739
|
-
updatePart(cell, `first-${section}-row-cell`, row === visibleRows.at(0));
|
|
740
|
-
updatePart(cell, `last-${section}-row-cell`, row === visibleRows.at(-1));
|
|
741
|
-
});
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
|
|
745
607
|
/**
|
|
746
608
|
* @param {!HTMLElement} row
|
|
747
609
|
* @param {boolean} loading
|
|
@@ -46,16 +46,25 @@ export const GridSortColumnMixin = (superClass) =>
|
|
|
46
46
|
*/
|
|
47
47
|
_defaultHeaderRenderer(root, _column) {
|
|
48
48
|
let sorter = root.firstElementChild;
|
|
49
|
-
|
|
49
|
+
const isNewSorter = !sorter;
|
|
50
|
+
if (isNewSorter) {
|
|
50
51
|
sorter = document.createElement('vaadin-grid-sorter');
|
|
51
52
|
sorter.addEventListener('direction-changed', this.__boundOnDirectionChanged);
|
|
52
|
-
root.appendChild(sorter);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
sorter.path = this.path;
|
|
56
56
|
sorter.__rendererDirection = this.direction;
|
|
57
57
|
sorter.direction = this.direction;
|
|
58
58
|
sorter.textContent = this.__getHeader(this.header, this.path);
|
|
59
|
+
|
|
60
|
+
// Append the sorter only after its direction has been set. If the cell
|
|
61
|
+
// content is already connected (as with the declarative header rendering),
|
|
62
|
+
// appending an unconfigured sorter makes it notify its default `null`
|
|
63
|
+
// direction before `__rendererDirection` is set, which would reset the
|
|
64
|
+
// column's direction. See __onDirectionChanged.
|
|
65
|
+
if (isNewSorter) {
|
|
66
|
+
root.appendChild(sorter);
|
|
67
|
+
}
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
/**
|
|
@@ -51,6 +51,7 @@ import { GridSorterMixin } from './vaadin-grid-sorter-mixin.js';
|
|
|
51
51
|
* @fires {CustomEvent} direction-changed - Fired when the `direction` property changes.
|
|
52
52
|
* @fires {CustomEvent} sorter-changed - Fired when the `path` or `direction` property changes.
|
|
53
53
|
*
|
|
54
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
54
55
|
* @customElement vaadin-grid-sorter
|
|
55
56
|
* @extends HTMLElement
|
|
56
57
|
*/
|
|
@@ -59,6 +59,7 @@ import { GridTreeToggleMixin } from './vaadin-grid-tree-toggle-mixin.js';
|
|
|
59
59
|
*
|
|
60
60
|
* @fires {CustomEvent} expanded-changed - Fired when the `expanded` property changes.
|
|
61
61
|
*
|
|
62
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
62
63
|
* @customElement vaadin-grid-tree-toggle
|
|
63
64
|
* @extends HTMLElement
|
|
64
65
|
*/
|
package/src/vaadin-grid.js
CHANGED
|
@@ -274,6 +274,7 @@ const DEFAULT_I18N = {
|
|
|
274
274
|
* @fires {CustomEvent} size-changed - Fired when the `size` property changes.
|
|
275
275
|
* @fires {CustomEvent} item-toggle - Fired when the user selects or deselects an item through the selection column.
|
|
276
276
|
*
|
|
277
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
277
278
|
* @customElement vaadin-grid
|
|
278
279
|
* @extends HTMLElement
|
|
279
280
|
*/
|
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-alpha8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -84,23 +84,12 @@
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"name": "text-align",
|
|
87
|
-
"description": "Aligns the columns cell content horizontally
|
|
87
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
88
88
|
"value": {
|
|
89
89
|
"type": [
|
|
90
90
|
"string"
|
|
91
91
|
]
|
|
92
92
|
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"name": "theme",
|
|
96
|
-
"description": "The theme variants to apply to the component.",
|
|
97
|
-
"value": {
|
|
98
|
-
"type": [
|
|
99
|
-
"string",
|
|
100
|
-
"null",
|
|
101
|
-
"undefined"
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
93
|
}
|
|
105
94
|
],
|
|
106
95
|
"js": {
|
|
@@ -201,7 +190,7 @@
|
|
|
201
190
|
},
|
|
202
191
|
{
|
|
203
192
|
"name": "textAlign",
|
|
204
|
-
"description": "Aligns the columns cell content horizontally
|
|
193
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
205
194
|
"value": {
|
|
206
195
|
"type": [
|
|
207
196
|
"string"
|
|
@@ -214,7 +203,7 @@
|
|
|
214
203
|
},
|
|
215
204
|
{
|
|
216
205
|
"name": "vaadin-grid-column",
|
|
217
|
-
"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-alpha8/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
|
|
218
207
|
"attributes": [
|
|
219
208
|
{
|
|
220
209
|
"name": "auto-width",
|
|
@@ -317,24 +306,13 @@
|
|
|
317
306
|
},
|
|
318
307
|
{
|
|
319
308
|
"name": "text-align",
|
|
320
|
-
"description": "Aligns the columns cell content horizontally
|
|
309
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
321
310
|
"value": {
|
|
322
311
|
"type": [
|
|
323
312
|
"string"
|
|
324
313
|
]
|
|
325
314
|
}
|
|
326
315
|
},
|
|
327
|
-
{
|
|
328
|
-
"name": "theme",
|
|
329
|
-
"description": "The theme variants to apply to the component.",
|
|
330
|
-
"value": {
|
|
331
|
-
"type": [
|
|
332
|
-
"string",
|
|
333
|
-
"null",
|
|
334
|
-
"undefined"
|
|
335
|
-
]
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
316
|
{
|
|
339
317
|
"name": "width",
|
|
340
318
|
"description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
|
|
@@ -481,7 +459,7 @@
|
|
|
481
459
|
},
|
|
482
460
|
{
|
|
483
461
|
"name": "textAlign",
|
|
484
|
-
"description": "Aligns the columns cell content horizontally
|
|
462
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
485
463
|
"value": {
|
|
486
464
|
"type": [
|
|
487
465
|
"string"
|
|
@@ -606,24 +584,13 @@
|
|
|
606
584
|
},
|
|
607
585
|
{
|
|
608
586
|
"name": "text-align",
|
|
609
|
-
"description": "Aligns the columns cell content horizontally
|
|
587
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
610
588
|
"value": {
|
|
611
589
|
"type": [
|
|
612
590
|
"string"
|
|
613
591
|
]
|
|
614
592
|
}
|
|
615
593
|
},
|
|
616
|
-
{
|
|
617
|
-
"name": "theme",
|
|
618
|
-
"description": "The theme variants to apply to the component.",
|
|
619
|
-
"value": {
|
|
620
|
-
"type": [
|
|
621
|
-
"string",
|
|
622
|
-
"null",
|
|
623
|
-
"undefined"
|
|
624
|
-
]
|
|
625
|
-
}
|
|
626
|
-
},
|
|
627
594
|
{
|
|
628
595
|
"name": "width",
|
|
629
596
|
"description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
|
|
@@ -770,7 +737,7 @@
|
|
|
770
737
|
},
|
|
771
738
|
{
|
|
772
739
|
"name": "textAlign",
|
|
773
|
-
"description": "Aligns the columns cell content horizontally
|
|
740
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
774
741
|
"value": {
|
|
775
742
|
"type": [
|
|
776
743
|
"string"
|
|
@@ -808,9 +775,7 @@
|
|
|
808
775
|
"description": "The theme variants to apply to the component.",
|
|
809
776
|
"value": {
|
|
810
777
|
"type": [
|
|
811
|
-
"string"
|
|
812
|
-
"null",
|
|
813
|
-
"undefined"
|
|
778
|
+
"string"
|
|
814
779
|
]
|
|
815
780
|
}
|
|
816
781
|
},
|
|
@@ -855,7 +820,7 @@
|
|
|
855
820
|
},
|
|
856
821
|
{
|
|
857
822
|
"name": "vaadin-grid-selection-column",
|
|
858
|
-
"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-alpha8/#/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__",
|
|
859
824
|
"attributes": [
|
|
860
825
|
{
|
|
861
826
|
"name": "auto-select",
|
|
@@ -985,24 +950,13 @@
|
|
|
985
950
|
},
|
|
986
951
|
{
|
|
987
952
|
"name": "text-align",
|
|
988
|
-
"description": "Aligns the columns cell content horizontally
|
|
953
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
989
954
|
"value": {
|
|
990
955
|
"type": [
|
|
991
956
|
"string"
|
|
992
957
|
]
|
|
993
958
|
}
|
|
994
959
|
},
|
|
995
|
-
{
|
|
996
|
-
"name": "theme",
|
|
997
|
-
"description": "The theme variants to apply to the component.",
|
|
998
|
-
"value": {
|
|
999
|
-
"type": [
|
|
1000
|
-
"string",
|
|
1001
|
-
"null",
|
|
1002
|
-
"undefined"
|
|
1003
|
-
]
|
|
1004
|
-
}
|
|
1005
|
-
},
|
|
1006
960
|
{
|
|
1007
961
|
"name": "width",
|
|
1008
962
|
"description": "Width of the cells for this column.",
|
|
@@ -1176,7 +1130,7 @@
|
|
|
1176
1130
|
},
|
|
1177
1131
|
{
|
|
1178
1132
|
"name": "textAlign",
|
|
1179
|
-
"description": "Aligns the columns cell content horizontally
|
|
1133
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
1180
1134
|
"value": {
|
|
1181
1135
|
"type": [
|
|
1182
1136
|
"string"
|
|
@@ -1315,24 +1269,13 @@
|
|
|
1315
1269
|
},
|
|
1316
1270
|
{
|
|
1317
1271
|
"name": "text-align",
|
|
1318
|
-
"description": "Aligns the columns cell content horizontally
|
|
1272
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
1319
1273
|
"value": {
|
|
1320
1274
|
"type": [
|
|
1321
1275
|
"string"
|
|
1322
1276
|
]
|
|
1323
1277
|
}
|
|
1324
1278
|
},
|
|
1325
|
-
{
|
|
1326
|
-
"name": "theme",
|
|
1327
|
-
"description": "The theme variants to apply to the component.",
|
|
1328
|
-
"value": {
|
|
1329
|
-
"type": [
|
|
1330
|
-
"string",
|
|
1331
|
-
"null",
|
|
1332
|
-
"undefined"
|
|
1333
|
-
]
|
|
1334
|
-
}
|
|
1335
|
-
},
|
|
1336
1279
|
{
|
|
1337
1280
|
"name": "width",
|
|
1338
1281
|
"description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
|
|
@@ -1488,7 +1431,7 @@
|
|
|
1488
1431
|
},
|
|
1489
1432
|
{
|
|
1490
1433
|
"name": "textAlign",
|
|
1491
|
-
"description": "Aligns the columns cell content horizontally
|
|
1434
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
1492
1435
|
"value": {
|
|
1493
1436
|
"type": [
|
|
1494
1437
|
"string"
|
|
@@ -1540,9 +1483,7 @@
|
|
|
1540
1483
|
"description": "The theme variants to apply to the component.",
|
|
1541
1484
|
"value": {
|
|
1542
1485
|
"type": [
|
|
1543
|
-
"string"
|
|
1544
|
-
"null",
|
|
1545
|
-
"undefined"
|
|
1486
|
+
"string"
|
|
1546
1487
|
]
|
|
1547
1488
|
}
|
|
1548
1489
|
}
|
|
@@ -1685,24 +1626,13 @@
|
|
|
1685
1626
|
},
|
|
1686
1627
|
{
|
|
1687
1628
|
"name": "text-align",
|
|
1688
|
-
"description": "Aligns the columns cell content horizontally
|
|
1629
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
1689
1630
|
"value": {
|
|
1690
1631
|
"type": [
|
|
1691
1632
|
"string"
|
|
1692
1633
|
]
|
|
1693
1634
|
}
|
|
1694
1635
|
},
|
|
1695
|
-
{
|
|
1696
|
-
"name": "theme",
|
|
1697
|
-
"description": "The theme variants to apply to the component.",
|
|
1698
|
-
"value": {
|
|
1699
|
-
"type": [
|
|
1700
|
-
"string",
|
|
1701
|
-
"null",
|
|
1702
|
-
"undefined"
|
|
1703
|
-
]
|
|
1704
|
-
}
|
|
1705
|
-
},
|
|
1706
1636
|
{
|
|
1707
1637
|
"name": "width",
|
|
1708
1638
|
"description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
|
|
@@ -1849,7 +1779,7 @@
|
|
|
1849
1779
|
},
|
|
1850
1780
|
{
|
|
1851
1781
|
"name": "textAlign",
|
|
1852
|
-
"description": "Aligns the columns cell content horizontally
|
|
1782
|
+
"description": "Aligns the columns cell content horizontally.",
|
|
1853
1783
|
"value": {
|
|
1854
1784
|
"type": [
|
|
1855
1785
|
"string"
|
|
@@ -1905,9 +1835,7 @@
|
|
|
1905
1835
|
"description": "The theme variants to apply to the component.",
|
|
1906
1836
|
"value": {
|
|
1907
1837
|
"type": [
|
|
1908
|
-
"string"
|
|
1909
|
-
"null",
|
|
1910
|
-
"undefined"
|
|
1838
|
+
"string"
|
|
1911
1839
|
]
|
|
1912
1840
|
}
|
|
1913
1841
|
}
|
|
@@ -1952,7 +1880,7 @@
|
|
|
1952
1880
|
},
|
|
1953
1881
|
{
|
|
1954
1882
|
"name": "vaadin-grid",
|
|
1955
|
-
"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-alpha6/#/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-alpha6/#/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-alpha6/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha6/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha6/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha6/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha6/#/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-alpha6/#/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-alpha6/#/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-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.",
|
|
1956
1884
|
"attributes": [
|
|
1957
1885
|
{
|
|
1958
1886
|
"name": "accessible-name",
|
|
@@ -2085,9 +2013,7 @@
|
|
|
2085
2013
|
"description": "The theme variants to apply to the component.",
|
|
2086
2014
|
"value": {
|
|
2087
2015
|
"type": [
|
|
2088
|
-
"string"
|
|
2089
|
-
"null",
|
|
2090
|
-
"undefined"
|
|
2016
|
+
"string"
|
|
2091
2017
|
]
|
|
2092
2018
|
}
|
|
2093
2019
|
}
|