@vaadin/grid 23.3.0-alpha2 → 24.0.0-alpha1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/grid",
3
- "version": "23.3.0-alpha2",
3
+ "version": "24.0.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -45,17 +45,17 @@
45
45
  "dependencies": {
46
46
  "@open-wc/dedupe-mixin": "^1.3.0",
47
47
  "@polymer/polymer": "^3.0.0",
48
- "@vaadin/checkbox": "23.3.0-alpha2",
49
- "@vaadin/component-base": "23.3.0-alpha2",
50
- "@vaadin/lit-renderer": "23.3.0-alpha2",
51
- "@vaadin/text-field": "23.3.0-alpha2",
52
- "@vaadin/vaadin-lumo-styles": "23.3.0-alpha2",
53
- "@vaadin/vaadin-material-styles": "23.3.0-alpha2",
54
- "@vaadin/vaadin-themable-mixin": "23.3.0-alpha2"
48
+ "@vaadin/checkbox": "24.0.0-alpha1",
49
+ "@vaadin/component-base": "24.0.0-alpha1",
50
+ "@vaadin/lit-renderer": "24.0.0-alpha1",
51
+ "@vaadin/text-field": "24.0.0-alpha1",
52
+ "@vaadin/vaadin-lumo-styles": "24.0.0-alpha1",
53
+ "@vaadin/vaadin-material-styles": "24.0.0-alpha1",
54
+ "@vaadin/vaadin-themable-mixin": "24.0.0-alpha1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@esm-bundle/chai": "^4.3.4",
58
- "@vaadin/polymer-legacy-adapter": "23.3.0-alpha2",
58
+ "@vaadin/polymer-legacy-adapter": "24.0.0-alpha1",
59
59
  "@vaadin/testing-helpers": "^0.3.2",
60
60
  "lit": "^2.0.0",
61
61
  "sinon": "^13.0.2"
@@ -64,5 +64,5 @@
64
64
  "web-types.json",
65
65
  "web-types.lit.json"
66
66
  ],
67
- "gitHead": "ae61027c62ffa7f7d70cfc50e43f333addfc74b6"
67
+ "gitHead": "427527c27c4b27822d61fd41d38d7b170134770b"
68
68
  }
@@ -5,7 +5,8 @@
5
5
  */
6
6
  import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
7
7
  import { PolymerElement } from '@polymer/polymer/polymer-element.js';
8
- import { microTask } from '@vaadin/component-base/src/async.js';
8
+ import { animationFrame, microTask } from '@vaadin/component-base/src/async.js';
9
+ import { Debouncer } from '@vaadin/component-base/src/debounce.js';
9
10
  import { ColumnBaseMixin } from './vaadin-grid-column.js';
10
11
  import { updateColumnOrders } from './vaadin-grid-helpers.js';
11
12
 
@@ -236,6 +237,42 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
236
237
  this._setFlexGrow(Array.prototype.reduce.call(this._visibleChildColumns, (prev, curr) => prev + curr.flexGrow, 0));
237
238
  }
238
239
 
240
+ /**
241
+ * This method is called before the group's frozen value is being propagated to the child columns.
242
+ * In case some of the child columns are frozen, while others are not, the non-frozen ones
243
+ * will get automatically frozen as well. As this may sometimes be unintended, this method
244
+ * shows a warning in the console in such cases.
245
+ * @private
246
+ */
247
+ __scheduleAutoFreezeWarning(columns, frozenProp) {
248
+ if (this._grid) {
249
+ // Derive the attribute name from the property name
250
+ const frozenAttr = frozenProp.replace(/([A-Z])/g, '-$1').toLowerCase();
251
+
252
+ // Check if all the columns have the same frozen value
253
+ const firstColumnFrozen = columns[0][frozenProp] || columns[0].hasAttribute(frozenAttr);
254
+ const allSameFrozen = columns.every((column) => {
255
+ return (column[frozenProp] || column.hasAttribute(frozenAttr)) === firstColumnFrozen;
256
+ });
257
+
258
+ if (!allSameFrozen) {
259
+ // Some of the child columns are frozen, some are not. Show a warning.
260
+ this._grid.__autoFreezeWarningDebouncer = Debouncer.debounce(
261
+ this._grid.__autoFreezeWarningDebouncer,
262
+ animationFrame,
263
+ () => {
264
+ console.warn(
265
+ `WARNING: Joining ${frozenProp} and non-${frozenProp} Grid columns inside the same column group! ` +
266
+ `This will automatically freeze all the joined columns to avoid rendering issues. ` +
267
+ `If this was intentional, consider marking each joined column explicitly as ${frozenProp}. ` +
268
+ `Otherwise, exclude the ${frozenProp} columns from the joined group.`,
269
+ );
270
+ },
271
+ );
272
+ }
273
+ }
274
+ }
275
+
239
276
  /** @private */
240
277
  _groupFrozenChanged(frozen, rootColumns) {
241
278
  if (rootColumns === undefined || frozen === undefined) {
@@ -244,6 +281,8 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
244
281
 
245
282
  // Don’t propagate the default `false` value.
246
283
  if (frozen !== false) {
284
+ this.__scheduleAutoFreezeWarning(rootColumns, 'frozen');
285
+
247
286
  Array.from(rootColumns).forEach((col) => {
248
287
  col.frozen = frozen;
249
288
  });
@@ -258,6 +297,8 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
258
297
 
259
298
  // Don’t propagate the default `false` value.
260
299
  if (frozenToEnd !== false) {
300
+ this.__scheduleAutoFreezeWarning(rootColumns, 'frozenToEnd');
301
+
261
302
  Array.from(rootColumns).forEach((col) => {
262
303
  col.frozenToEnd = frozenToEnd;
263
304
  });
@@ -822,6 +822,19 @@ class GridColumn extends ColumnBaseMixin(DirMixin(PolymerElement)) {
822
822
  value: false,
823
823
  },
824
824
 
825
+ /**
826
+ * When true, wraps the cell's slot into an element with role="button", and sets
827
+ * the tabindex attribute on the button element, instead of the cell itself.
828
+ * This is needed to keep focus in sync with VoiceOver cursor when navigating
829
+ * with Control + Option + arrow keys: focusing the `<td>` element does not fire
830
+ * a focus event, but focusing an element with role="button" inside a cell fires it.
831
+ * @protected
832
+ */
833
+ _focusButtonMode: {
834
+ type: Boolean,
835
+ value: false,
836
+ },
837
+
825
838
  /**
826
839
  * @type {Array<!HTMLElement>}
827
840
  * @protected
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2016 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { addValueToAttribute, removeValueFromAttribute } from '@vaadin/component-base/src/dom-utils.js';
6
7
  import { isKeyboardActive } from '@vaadin/component-base/src/focus-utils.js';
7
8
 
8
9
  /**
@@ -48,6 +49,12 @@ export const KeyboardNavigationMixin = (superClass) =>
48
49
  /** @private */
49
50
  _focusedColumnOrder: Number,
50
51
 
52
+ /** @private */
53
+ _focusedCell: {
54
+ type: Object,
55
+ observer: '_focusedCellChanged',
56
+ },
57
+
51
58
  /**
52
59
  * Indicates whether the grid is currently in interaction mode.
53
60
  * In interaction mode the user is currently interacting with a control,
@@ -109,11 +116,21 @@ export const KeyboardNavigationMixin = (superClass) =>
109
116
  }
110
117
 
111
118
  set __rowFocusMode(value) {
112
- ['_itemsFocusable', '_footerFocusable', '_headerFocusable'].forEach((focusable) => {
113
- if (value && this.__isCell(this[focusable])) {
114
- this[focusable] = this[focusable].parentElement;
115
- } else if (!value && this.__isRow(this[focusable])) {
116
- this[focusable] = this[focusable].firstElementChild;
119
+ ['_itemsFocusable', '_footerFocusable', '_headerFocusable'].forEach((prop) => {
120
+ const focusable = this[prop];
121
+ if (value) {
122
+ const parent = focusable && focusable.parentElement;
123
+ if (this.__isCell(focusable)) {
124
+ // Cell itself focusable (default)
125
+ this[prop] = parent;
126
+ } else if (this.__isCell(parent)) {
127
+ // Focus button mode is enabled for the column,
128
+ // button element inside the cell is focusable.
129
+ this[prop] = parent.parentElement;
130
+ }
131
+ } else if (!value && this.__isRow(focusable)) {
132
+ const cell = focusable.firstElementChild;
133
+ this[prop] = cell._focusButton || cell;
117
134
  }
118
135
  });
119
136
  }
@@ -128,6 +145,17 @@ export const KeyboardNavigationMixin = (superClass) =>
128
145
  }
129
146
  }
130
147
 
148
+ /** @private */
149
+ _focusedCellChanged(focusedCell, oldFocusedCell) {
150
+ if (oldFocusedCell) {
151
+ removeValueFromAttribute(oldFocusedCell, 'part', 'focused-cell');
152
+ }
153
+
154
+ if (focusedCell) {
155
+ addValueToAttribute(focusedCell, 'part', 'focused-cell');
156
+ }
157
+ }
158
+
131
159
  /** @private */
132
160
  _interactingChanged() {
133
161
  // Update focus targets when entering / exiting interaction mode
@@ -154,10 +182,22 @@ export const KeyboardNavigationMixin = (superClass) =>
154
182
  if (this.__rowFocusMode) {
155
183
  // Row focus mode
156
184
  this._itemsFocusable = row;
157
- } else if (this._itemsFocusable.parentElement) {
185
+ } else {
158
186
  // Cell focus mode
159
- const cellIndex = [...this._itemsFocusable.parentElement.children].indexOf(this._itemsFocusable);
160
- this._itemsFocusable = row.children[cellIndex];
187
+ let parent = this._itemsFocusable.parentElement;
188
+ let cell = this._itemsFocusable;
189
+
190
+ if (parent) {
191
+ // Focus button mode is enabled for the column,
192
+ // button element inside the cell is focusable.
193
+ if (this.__isCell(parent)) {
194
+ cell = parent;
195
+ parent = parent.parentElement;
196
+ }
197
+
198
+ const cellIndex = [...parent.children].indexOf(cell);
199
+ this._itemsFocusable = this.__getFocusable(row, row.children[cellIndex]);
200
+ }
161
201
  }
162
202
  }
163
203
  });
@@ -587,7 +627,7 @@ export const KeyboardNavigationMixin = (superClass) =>
587
627
  }
588
628
 
589
629
  if (key === 'Escape') {
590
- this._hideTooltip();
630
+ this._hideTooltip(true);
591
631
  }
592
632
  }
593
633
 
@@ -727,6 +767,7 @@ export const KeyboardNavigationMixin = (superClass) =>
727
767
  this.toggleAttribute('navigating', false);
728
768
  this._detectInteracting(e);
729
769
  this._hideTooltip();
770
+ this._focusedCell = null;
730
771
  }
731
772
 
732
773
  /** @private */
@@ -737,27 +778,43 @@ export const KeyboardNavigationMixin = (superClass) =>
737
778
  if (section && (cell || row)) {
738
779
  this._activeRowGroup = section;
739
780
  if (this.$.header === section) {
740
- this._headerFocusable = this.__rowFocusMode ? row : cell;
781
+ this._headerFocusable = this.__getFocusable(row, cell);
741
782
  } else if (this.$.items === section) {
742
- this._itemsFocusable = this.__rowFocusMode ? row : cell;
783
+ this._itemsFocusable = this.__getFocusable(row, cell);
743
784
  } else if (this.$.footer === section) {
744
- this._footerFocusable = this.__rowFocusMode ? row : cell;
785
+ this._footerFocusable = this.__getFocusable(row, cell);
745
786
  }
746
787
 
747
788
  if (cell) {
748
789
  // Fire a public event for cell.
749
790
  const context = this.getEventContext(e);
750
791
  cell.dispatchEvent(new CustomEvent('cell-focus', { bubbles: true, composed: true, detail: { context } }));
792
+ this._focusedCell = cell._focusButton || cell;
751
793
 
752
794
  if (isKeyboardActive() && e.target === cell) {
753
795
  this._showTooltip(e);
754
796
  }
797
+ } else {
798
+ this._focusedCell = null;
755
799
  }
756
800
  }
757
801
 
758
802
  this._detectFocusedItemIndex(e);
759
803
  }
760
804
 
805
+ /**
806
+ * Get the focusable element depending on the current focus mode.
807
+ * It can be a row, a cell, or a focusable div inside a cell.
808
+ *
809
+ * @param {HTMLElement} row
810
+ * @param {HTMLElement} cell
811
+ * @return {HTMLElement}
812
+ * @private
813
+ */
814
+ __getFocusable(row, cell) {
815
+ return this.__rowFocusMode ? row : cell._focusButton || cell;
816
+ }
817
+
761
818
  /**
762
819
  * Enables interaction mode if a cells descendant receives focus or keyboard
763
820
  * input. Disables it if the event is not related to cell content.
@@ -847,7 +904,7 @@ export const KeyboardNavigationMixin = (superClass) =>
847
904
  const firstVisibleRow = [...this.$[section].children].find((row) => row.offsetHeight);
848
905
  const firstVisibleCell = firstVisibleRow ? [...firstVisibleRow.children].find((cell) => !cell.hidden) : null;
849
906
  if (firstVisibleRow && firstVisibleCell) {
850
- this[`_${section}Focusable`] = this.__rowFocusMode ? firstVisibleRow : firstVisibleCell;
907
+ this[`_${section}Focusable`] = this.__getFocusable(firstVisibleRow, firstVisibleCell);
851
908
  }
852
909
  }
853
910
  });
@@ -860,7 +917,7 @@ export const KeyboardNavigationMixin = (superClass) =>
860
917
  if (firstVisibleCell && firstVisibleRow) {
861
918
  // Reset memoized column
862
919
  delete this._focusedColumnOrder;
863
- this._itemsFocusable = this.__rowFocusMode ? firstVisibleRow : firstVisibleCell;
920
+ this._itemsFocusable = this.__getFocusable(firstVisibleRow, firstVisibleCell);
864
921
  }
865
922
  } else {
866
923
  this.__updateItemsFocusable();
@@ -137,6 +137,9 @@ export const ScrollMixin = (superClass) =>
137
137
  if (!this.hasAttribute('reordering')) {
138
138
  this._scheduleScrolling();
139
139
  }
140
+ if (!this.hasAttribute('navigating')) {
141
+ this._hideTooltip(true);
142
+ }
140
143
 
141
144
  this._updateOverflow();
142
145
  }
@@ -142,6 +142,17 @@ registerStyles(
142
142
  white-space: nowrap;
143
143
  }
144
144
 
145
+ [part~='cell'] > [tabindex] {
146
+ display: flex;
147
+ align-items: inherit;
148
+ outline: none;
149
+ position: absolute;
150
+ top: 0;
151
+ bottom: 0;
152
+ left: 0;
153
+ right: 0;
154
+ }
155
+
145
156
  [part~='details-cell'] {
146
157
  position: absolute;
147
158
  bottom: 0;
@@ -293,6 +293,7 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
293
293
  * `body-cell` | Body cell in the internal table
294
294
  * `footer-cell` | Footer cell in the internal table
295
295
  * `details-cell` | Row details cell in the internal table
296
+ * `focused-cell` | Focused cell in the internal table
296
297
  * `resize-handle` | Handle for resizing the columns
297
298
  * `reorder-ghost` | Ghost element of the header cell being dragged
298
299
  *
@@ -180,6 +180,7 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
180
180
  * `body-cell` | Body cell in the internal table
181
181
  * `footer-cell` | Footer cell in the internal table
182
182
  * `details-cell` | Row details cell in the internal table
183
+ * `focused-cell` | Focused cell in the internal table
183
184
  * `resize-handle` | Handle for resizing the columns
184
185
  * `reorder-ghost` | Ghost element of the header cell being dragged
185
186
  *
@@ -400,7 +401,7 @@ class Grid extends ElementMixin(
400
401
  disconnectedCallback() {
401
402
  super.disconnectedCallback();
402
403
  this.isAttached = false;
403
- this._hideTooltip();
404
+ this._hideTooltip(true);
404
405
  }
405
406
 
406
407
  /** @private */
@@ -660,7 +661,7 @@ class Grid extends ElementMixin(
660
661
  }
661
662
 
662
663
  /** @private */
663
- _createCell(tagName) {
664
+ _createCell(tagName, column) {
664
665
  const contentId = (this._contentIndex = this._contentIndex + 1 || 0);
665
666
  const slotName = `vaadin-grid-cell-content-${contentId}`;
666
667
 
@@ -669,13 +670,14 @@ class Grid extends ElementMixin(
669
670
 
670
671
  const cell = document.createElement(tagName);
671
672
  cell.id = slotName.replace('-content-', '-');
672
- cell.setAttribute('tabindex', '-1');
673
673
  cell.setAttribute('role', tagName === 'td' ? 'gridcell' : 'columnheader');
674
674
 
675
675
  // For now we only support tooltip on desktop
676
676
  if (!isAndroid && !isIOS) {
677
677
  cell.addEventListener('mouseenter', (event) => {
678
- this._showTooltip(event);
678
+ if (!this.$.scroller.hasAttribute('scrolling')) {
679
+ this._showTooltip(event);
680
+ }
679
681
  });
680
682
 
681
683
  cell.addEventListener('mouseleave', () => {
@@ -683,14 +685,30 @@ class Grid extends ElementMixin(
683
685
  });
684
686
 
685
687
  cell.addEventListener('mousedown', () => {
686
- this._hideTooltip();
688
+ this._hideTooltip(true);
687
689
  });
688
690
  }
689
691
 
690
692
  const slot = document.createElement('slot');
691
693
  slot.setAttribute('name', slotName);
692
694
 
693
- cell.appendChild(slot);
695
+ if (column && column._focusButtonMode) {
696
+ const div = document.createElement('div');
697
+ div.setAttribute('role', 'button');
698
+ div.setAttribute('tabindex', '-1');
699
+ cell.appendChild(div);
700
+
701
+ // Patch `focus()` to use the button
702
+ cell._focusButton = div;
703
+ cell.focus = function () {
704
+ cell._focusButton.focus();
705
+ };
706
+
707
+ div.appendChild(slot);
708
+ } else {
709
+ cell.setAttribute('tabindex', '-1');
710
+ cell.appendChild(slot);
711
+ }
694
712
 
695
713
  cell._content = cellContent;
696
714
 
@@ -754,7 +772,7 @@ class Grid extends ElementMixin(
754
772
  column._cells = column._cells || [];
755
773
  cell = column._cells.find((cell) => cell._vacant);
756
774
  if (!cell) {
757
- cell = this._createCell('td');
775
+ cell = this._createCell('td', column);
758
776
  column._cells.push(cell);
759
777
  }
760
778
  cell.setAttribute('part', 'cell body-cell');
@@ -1016,16 +1034,25 @@ class Grid extends ElementMixin(
1016
1034
  */
1017
1035
  _showTooltip(event) {
1018
1036
  // Check if there is a slotted vaadin-tooltip element.
1019
- if (this._tooltipController.node && this._tooltipController.node.isConnected) {
1037
+ const tooltip = this._tooltipController.node;
1038
+ if (tooltip && tooltip.isConnected) {
1020
1039
  this._tooltipController.setTarget(event.target);
1021
1040
  this._tooltipController.setContext(this.getEventContext(event));
1022
- this._tooltipController.setOpened(true);
1041
+
1042
+ // Trigger opening using the corresponding delay.
1043
+ tooltip._stateController.open({
1044
+ focus: event.type === 'focusin',
1045
+ hover: event.type === 'mouseenter',
1046
+ });
1023
1047
  }
1024
1048
  }
1025
1049
 
1026
1050
  /** @protected */
1027
- _hideTooltip() {
1028
- this._tooltipController.setOpened(false);
1051
+ _hideTooltip(immediate) {
1052
+ const tooltip = this._tooltipController.node;
1053
+ if (tooltip) {
1054
+ tooltip._stateController.close(immediate);
1055
+ }
1029
1056
  }
1030
1057
 
1031
1058
  /**
@@ -69,12 +69,12 @@ registerStyles(
69
69
  }
70
70
 
71
71
  [part~='row']:focus,
72
- [part~='cell']:focus {
72
+ [part~='focused-cell']:focus {
73
73
  outline: none;
74
74
  }
75
75
 
76
76
  :host([navigating]) [part~='row']:focus::before,
77
- :host([navigating]) [part~='cell']:focus::before {
77
+ :host([navigating]) [part~='focused-cell']:focus::before {
78
78
  content: '';
79
79
  position: absolute;
80
80
  top: 0;
@@ -10,7 +10,7 @@ registerStyles(
10
10
  --vaadin-grid-tree-toggle-level-offset: 2em;
11
11
  align-items: center;
12
12
  vertical-align: middle;
13
- margin-left: calc(var(--lumo-space-s) * -1);
13
+ transform: translateX(calc(var(--lumo-space-s) * -1));
14
14
  -webkit-tap-highlight-color: transparent;
15
15
  }
16
16
 
@@ -131,12 +131,12 @@ registerStyles(
131
131
  }
132
132
 
133
133
  [part~='row']:focus,
134
- [part~='cell']:focus {
134
+ [part~='focused-cell']:focus {
135
135
  outline: none;
136
136
  }
137
137
 
138
138
  :host([navigating]) [part~='row']:focus::before,
139
- :host([navigating]) [part~='cell']:focus {
139
+ :host([navigating]) [part~='focused-cell']:focus {
140
140
  box-shadow: inset 0 0 0 2px var(--material-primary-color);
141
141
  }
142
142
 
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/grid",
4
- "version": "23.3.0-alpha2",
4
+ "version": "24.0.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-grid-column",
11
- "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/23.3.0-alpha2/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
11
+ "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/24.0.0-alpha1/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "resizable",
@@ -765,7 +765,7 @@
765
765
  },
766
766
  {
767
767
  "name": "vaadin-grid-selection-column",
768
- "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 items=\"[[items]]\">\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/23.3.0-alpha2/#/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__",
768
+ "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 items=\"[[items]]\">\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/24.0.0-alpha1/#/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__",
769
769
  "attributes": [
770
770
  {
771
771
  "name": "resizable",
@@ -1780,7 +1780,7 @@
1780
1780
  },
1781
1781
  {
1782
1782
  "name": "vaadin-grid",
1783
- "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/23.3.0-alpha2/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/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\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/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.html` bundle.\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/23.3.0-alpha2/#/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/23.3.0-alpha2/#/elements/vaadin-grid#property-dataProvider) in\nthe API reference below for the detailed data provider arguments description,\nand the “Assigning Data” page in the demos.\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`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`resize-handle` | Handle for resizing the columns\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`last-frozen` | Last frozen cell | 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 drag of a row is starting. The value is a number when multiple rows are dragged | 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/custom-theme/styling-components) documentation.",
1783
+ "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/24.0.0-alpha1/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/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\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/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.html` bundle.\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/24.0.0-alpha1/#/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/24.0.0-alpha1/#/elements/vaadin-grid#property-dataProvider) in\nthe API reference below for the detailed data provider arguments description,\nand the “Assigning Data” page in the demos.\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`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`resize-handle` | Handle for resizing the columns\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`last-frozen` | Last frozen cell | 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 drag of a row is starting. The value is a number when multiple rows are dragged | 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/custom-theme/styling-components) documentation.",
1784
1784
  "attributes": [
1785
1785
  {
1786
1786
  "name": "size",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/grid",
4
- "version": "23.3.0-alpha2",
4
+ "version": "24.0.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-grid-column",
19
- "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/23.3.0-alpha2/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
19
+ "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/24.0.0-alpha1/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -303,7 +303,7 @@
303
303
  },
304
304
  {
305
305
  "name": "vaadin-grid-selection-column",
306
- "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 items=\"[[items]]\">\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/23.3.0-alpha2/#/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__",
306
+ "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 items=\"[[items]]\">\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/24.0.0-alpha1/#/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__",
307
307
  "extension": true,
308
308
  "attributes": [
309
309
  {
@@ -702,7 +702,7 @@
702
702
  },
703
703
  {
704
704
  "name": "vaadin-grid",
705
- "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/23.3.0-alpha2/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/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\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/23.3.0-alpha2/#/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.html` bundle.\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/23.3.0-alpha2/#/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/23.3.0-alpha2/#/elements/vaadin-grid#property-dataProvider) in\nthe API reference below for the detailed data provider arguments description,\nand the “Assigning Data” page in the demos.\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`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`resize-handle` | Handle for resizing the columns\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`last-frozen` | Last frozen cell | 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 drag of a row is starting. The value is a number when multiple rows are dragged | 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/custom-theme/styling-components) documentation.",
705
+ "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/24.0.0-alpha1/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/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\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha1/#/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.html` bundle.\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/24.0.0-alpha1/#/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/24.0.0-alpha1/#/elements/vaadin-grid#property-dataProvider) in\nthe API reference below for the detailed data provider arguments description,\nand the “Assigning Data” page in the demos.\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`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`resize-handle` | Handle for resizing the columns\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`last-frozen` | Last frozen cell | 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 drag of a row is starting. The value is a number when multiple rows are dragged | 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/custom-theme/styling-components) documentation.",
706
706
  "extension": true,
707
707
  "attributes": [
708
708
  {