@vaadin/grid 24.5.0-rc2 → 24.5.1
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": "24.5.
|
|
3
|
+
"version": "24.5.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
48
48
|
"@polymer/polymer": "^3.0.0",
|
|
49
|
-
"@vaadin/a11y-base": "24.5.
|
|
50
|
-
"@vaadin/checkbox": "24.5.
|
|
51
|
-
"@vaadin/component-base": "24.5.
|
|
52
|
-
"@vaadin/lit-renderer": "24.5.
|
|
53
|
-
"@vaadin/text-field": "24.5.
|
|
54
|
-
"@vaadin/vaadin-lumo-styles": "24.5.
|
|
55
|
-
"@vaadin/vaadin-material-styles": "24.5.
|
|
56
|
-
"@vaadin/vaadin-themable-mixin": "24.5.
|
|
49
|
+
"@vaadin/a11y-base": "~24.5.1",
|
|
50
|
+
"@vaadin/checkbox": "~24.5.1",
|
|
51
|
+
"@vaadin/component-base": "~24.5.1",
|
|
52
|
+
"@vaadin/lit-renderer": "~24.5.1",
|
|
53
|
+
"@vaadin/text-field": "~24.5.1",
|
|
54
|
+
"@vaadin/vaadin-lumo-styles": "~24.5.1",
|
|
55
|
+
"@vaadin/vaadin-material-styles": "~24.5.1",
|
|
56
|
+
"@vaadin/vaadin-themable-mixin": "~24.5.1",
|
|
57
57
|
"lit": "^3.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@vaadin/chai-plugins": "24.5.
|
|
60
|
+
"@vaadin/chai-plugins": "~24.5.1",
|
|
61
61
|
"@vaadin/testing-helpers": "^1.0.0",
|
|
62
62
|
"sinon": "^18.0.0"
|
|
63
63
|
},
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"web-types.json",
|
|
66
66
|
"web-types.lit.json"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "0cf89edf4f22ee6f71925b86ea38d22f118638c3"
|
|
69
69
|
}
|
|
@@ -4,9 +4,23 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
7
|
+
import { animationFrame } from '@vaadin/component-base/src/async.js';
|
|
8
|
+
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
7
9
|
import { addValueToAttribute, removeValueFromAttribute } from '@vaadin/component-base/src/dom-utils.js';
|
|
8
10
|
import { get } from '@vaadin/component-base/src/path-utils.js';
|
|
9
11
|
|
|
12
|
+
function isRow(element) {
|
|
13
|
+
return element instanceof HTMLTableRowElement;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function isCell(element) {
|
|
17
|
+
return element instanceof HTMLTableCellElement;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function isDetailsCell(element) {
|
|
21
|
+
return element.matches('[part~="details-cell"]');
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
/**
|
|
11
25
|
* @polymerMixin
|
|
12
26
|
*/
|
|
@@ -84,9 +98,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
84
98
|
|
|
85
99
|
/** @private */
|
|
86
100
|
get __rowFocusMode() {
|
|
87
|
-
return (
|
|
88
|
-
this.__isRow(this._itemsFocusable) || this.__isRow(this._headerFocusable) || this.__isRow(this._footerFocusable)
|
|
89
|
-
);
|
|
101
|
+
return [this._headerFocusable, this._itemsFocusable, this._footerFocusable].some(isRow);
|
|
90
102
|
}
|
|
91
103
|
|
|
92
104
|
set __rowFocusMode(value) {
|
|
@@ -94,15 +106,15 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
94
106
|
const focusable = this[prop];
|
|
95
107
|
if (value) {
|
|
96
108
|
const parent = focusable && focusable.parentElement;
|
|
97
|
-
if (
|
|
109
|
+
if (isCell(focusable)) {
|
|
98
110
|
// Cell itself focusable (default)
|
|
99
111
|
this[prop] = parent;
|
|
100
|
-
} else if (
|
|
112
|
+
} else if (isCell(parent)) {
|
|
101
113
|
// Focus button mode is enabled for the column,
|
|
102
114
|
// button element inside the cell is focusable.
|
|
103
115
|
this[prop] = parent.parentElement;
|
|
104
116
|
}
|
|
105
|
-
} else if (!value &&
|
|
117
|
+
} else if (!value && isRow(focusable)) {
|
|
106
118
|
const cell = focusable.firstElementChild;
|
|
107
119
|
this[prop] = cell._focusButton || cell;
|
|
108
120
|
}
|
|
@@ -200,7 +212,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
200
212
|
if (parent) {
|
|
201
213
|
// Focus button mode is enabled for the column,
|
|
202
214
|
// button element inside the cell is focusable.
|
|
203
|
-
if (
|
|
215
|
+
if (isCell(parent)) {
|
|
204
216
|
cell = parent;
|
|
205
217
|
parent = parent.parentElement;
|
|
206
218
|
}
|
|
@@ -263,10 +275,10 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
263
275
|
}
|
|
264
276
|
|
|
265
277
|
/** @private */
|
|
266
|
-
|
|
278
|
+
__ensureFlatIndexInViewport(index) {
|
|
267
279
|
const targetRowInDom = [...this.$.items.children].find((child) => child.index === index);
|
|
268
280
|
if (!targetRowInDom) {
|
|
269
|
-
this.
|
|
281
|
+
this._scrollToFlatIndex(index);
|
|
270
282
|
} else {
|
|
271
283
|
this.__scrollIntoViewport(index);
|
|
272
284
|
}
|
|
@@ -285,33 +297,13 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
285
297
|
return this._isExpanded(row._item);
|
|
286
298
|
}
|
|
287
299
|
|
|
288
|
-
/** @private */
|
|
289
|
-
__isDetailsCell(element) {
|
|
290
|
-
return element.matches('[part~="details-cell"]');
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/** @private */
|
|
294
|
-
__isCell(element) {
|
|
295
|
-
return element instanceof HTMLTableCellElement;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/** @private */
|
|
299
|
-
__isRow(element) {
|
|
300
|
-
return element instanceof HTMLTableRowElement;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/** @private */
|
|
304
|
-
__getIndexOfChildElement(el) {
|
|
305
|
-
return Array.prototype.indexOf.call(el.parentNode.children, el);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
300
|
/** @private */
|
|
309
301
|
_onNavigationKeyDown(e, key) {
|
|
310
302
|
e.preventDefault();
|
|
311
303
|
|
|
312
304
|
const isRTL = this.__isRTL;
|
|
313
|
-
const activeRow = e.composedPath().find(
|
|
314
|
-
const activeCell = e.composedPath().find(
|
|
305
|
+
const activeRow = e.composedPath().find(isRow);
|
|
306
|
+
const activeCell = e.composedPath().find(isCell);
|
|
315
307
|
|
|
316
308
|
// Handle keyboard interaction as defined in:
|
|
317
309
|
// https://w3c.github.io/aria-practices/#keyboard-interaction-24
|
|
@@ -406,7 +398,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
406
398
|
} else {
|
|
407
399
|
// In cell focus mode
|
|
408
400
|
const activeRowCells = [...activeRow.children].sort((a, b) => a._order - b._order);
|
|
409
|
-
if (activeCell === activeRowCells[0] ||
|
|
401
|
+
if (activeCell === activeRowCells[0] || isDetailsCell(activeCell)) {
|
|
410
402
|
// "If focus is on the first cell in a row and row focus is supported, moves focus to the row."
|
|
411
403
|
this.__rowFocusMode = true;
|
|
412
404
|
this._onRowNavigation(activeRow, 0);
|
|
@@ -445,7 +437,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
445
437
|
if (rowGroup === this.$.items) {
|
|
446
438
|
return bodyFallbackIndex !== undefined ? bodyFallbackIndex : row.index;
|
|
447
439
|
}
|
|
448
|
-
return
|
|
440
|
+
return [...rowGroup.children].indexOf(row);
|
|
449
441
|
}
|
|
450
442
|
|
|
451
443
|
/**
|
|
@@ -486,7 +478,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
486
478
|
|
|
487
479
|
let dstIsRowDetails = false;
|
|
488
480
|
if (activeCell) {
|
|
489
|
-
const isRowDetails =
|
|
481
|
+
const isRowDetails = isDetailsCell(activeCell);
|
|
490
482
|
// Row details navigation logic
|
|
491
483
|
if (activeRowGroup === this.$.items) {
|
|
492
484
|
const item = activeRow._item;
|
|
@@ -507,15 +499,15 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
507
499
|
}
|
|
508
500
|
|
|
509
501
|
// Ensure correct vertical scroll position, destination row is visible
|
|
510
|
-
this.
|
|
502
|
+
this.__ensureFlatIndexInViewport(dstRowIndex);
|
|
511
503
|
|
|
512
504
|
// When scrolling with repeated keydown, sometimes FocusEvent listeners
|
|
513
505
|
// are too late to update _focusedItemIndex. Ensure next keydown
|
|
514
506
|
// listener invocation gets updated _focusedItemIndex value.
|
|
515
507
|
this._focusedItemIndex = dstRowIndex;
|
|
516
508
|
|
|
517
|
-
//
|
|
518
|
-
//
|
|
509
|
+
// Reapply navigating state in case it was removed due to previous item
|
|
510
|
+
// being focused with the mouse.
|
|
519
511
|
this.toggleAttribute('navigating', true);
|
|
520
512
|
|
|
521
513
|
return {
|
|
@@ -536,13 +528,13 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
536
528
|
return;
|
|
537
529
|
}
|
|
538
530
|
|
|
539
|
-
let columnIndex =
|
|
531
|
+
let columnIndex = [...activeRow.children].indexOf(activeCell);
|
|
540
532
|
if (this.$.items.contains(activeCell)) {
|
|
541
533
|
// lazy column rendering may be enabled, so we need use the always visible sizer cells to find the column index
|
|
542
534
|
columnIndex = [...this.$.sizer.children].findIndex((sizerCell) => sizerCell._column === activeCell._column);
|
|
543
535
|
}
|
|
544
536
|
|
|
545
|
-
const isCurrentCellRowDetails =
|
|
537
|
+
const isCurrentCellRowDetails = isDetailsCell(activeCell);
|
|
546
538
|
const activeRowGroup = activeRow.parentNode;
|
|
547
539
|
const currentRowIndex = this.__getIndexInGroup(activeRow, this._focusedItemIndex);
|
|
548
540
|
|
|
@@ -560,7 +552,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
560
552
|
|
|
561
553
|
if (dstIsRowDetails) {
|
|
562
554
|
// Focusing a row details cell on the destination row
|
|
563
|
-
const dstCell = [...dstRow.children].find(
|
|
555
|
+
const dstCell = [...dstRow.children].find(isDetailsCell);
|
|
564
556
|
dstCell.focus();
|
|
565
557
|
} else {
|
|
566
558
|
// Focusing a regular cell on the destination row
|
|
@@ -737,23 +729,14 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
737
729
|
// The focus is about to exit the grid to the bottom.
|
|
738
730
|
this.$.focusexit.focus();
|
|
739
731
|
} else if (focusTarget === this._itemsFocusable) {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
// scrolling. Focus the row for the stored focused item index instead.
|
|
747
|
-
const columnIndex = Array.from(targetRow.children).indexOf(this._itemsFocusable);
|
|
748
|
-
const focusedItemRow = Array.from(this.$.items.children).find(
|
|
749
|
-
(row) => !row.hidden && row.index === this._focusedItemIndex,
|
|
750
|
-
);
|
|
751
|
-
if (focusedItemRow) {
|
|
752
|
-
itemsFocusTarget = focusedItemRow.children[columnIndex];
|
|
753
|
-
}
|
|
754
|
-
}
|
|
732
|
+
this.__ensureFlatIndexInViewport(this._focusedItemIndex);
|
|
733
|
+
|
|
734
|
+
// Ensure the correct element is set as focusable after scrolling.
|
|
735
|
+
// The virtualizer may use a different element to render the item.
|
|
736
|
+
this.__updateItemsFocusable();
|
|
737
|
+
|
|
755
738
|
e.preventDefault();
|
|
756
|
-
|
|
739
|
+
this._itemsFocusable.focus();
|
|
757
740
|
} else {
|
|
758
741
|
e.preventDefault();
|
|
759
742
|
focusTarget.focus();
|
|
@@ -767,12 +750,12 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
767
750
|
e.preventDefault();
|
|
768
751
|
|
|
769
752
|
const element = e.composedPath()[0];
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
753
|
+
const isElementRow = isRow(element);
|
|
754
|
+
if (isElementRow || !element._content || !element._content.firstElementChild) {
|
|
772
755
|
this.dispatchEvent(
|
|
773
|
-
new CustomEvent(
|
|
756
|
+
new CustomEvent(isElementRow ? 'row-activate' : 'cell-activate', {
|
|
774
757
|
detail: {
|
|
775
|
-
model: this.__getRowModel(
|
|
758
|
+
model: this.__getRowModel(isElementRow ? element : element.parentElement),
|
|
776
759
|
},
|
|
777
760
|
}),
|
|
778
761
|
);
|
|
@@ -849,11 +832,13 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
849
832
|
|
|
850
833
|
if (section && (cell || row)) {
|
|
851
834
|
this._activeRowGroup = section;
|
|
852
|
-
|
|
835
|
+
|
|
836
|
+
if (section === this.$.header) {
|
|
853
837
|
this._headerFocusable = this.__getFocusable(row, cell);
|
|
854
|
-
} else if (this.$.items
|
|
838
|
+
} else if (section === this.$.items) {
|
|
855
839
|
this._itemsFocusable = this.__getFocusable(row, cell);
|
|
856
|
-
|
|
840
|
+
this._focusedItemIndex = row.index;
|
|
841
|
+
} else if (section === this.$.footer) {
|
|
857
842
|
this._footerFocusable = this.__getFocusable(row, cell);
|
|
858
843
|
}
|
|
859
844
|
|
|
@@ -873,8 +858,6 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
873
858
|
this._focusedCell = null;
|
|
874
859
|
}
|
|
875
860
|
}
|
|
876
|
-
|
|
877
|
-
this._detectFocusedItemIndex(e);
|
|
878
861
|
}
|
|
879
862
|
|
|
880
863
|
/**
|
|
@@ -912,14 +895,6 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
912
895
|
this.__updateHorizontalScrollPosition();
|
|
913
896
|
}
|
|
914
897
|
|
|
915
|
-
/** @private */
|
|
916
|
-
_detectFocusedItemIndex(e) {
|
|
917
|
-
const { section, row } = this._getGridEventLocation(e);
|
|
918
|
-
if (section === this.$.items) {
|
|
919
|
-
this._focusedItemIndex = row.index;
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
|
|
923
898
|
/**
|
|
924
899
|
* Enables or disables the focus target of the containing section of the
|
|
925
900
|
* grid from receiving focus, based on whether the user is interacting with
|
|
@@ -938,26 +913,45 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
938
913
|
focusTarget.tabIndex = isInteractingWithinActiveSection ? -1 : 0;
|
|
939
914
|
}
|
|
940
915
|
|
|
941
|
-
/**
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
*/
|
|
946
|
-
_preventScrollerRotatingCellFocus(row, index) {
|
|
947
|
-
if (
|
|
948
|
-
row.index === this._focusedItemIndex &&
|
|
949
|
-
this.hasAttribute('navigating') &&
|
|
950
|
-
this._activeRowGroup === this.$.items
|
|
951
|
-
) {
|
|
952
|
-
// Focused item has went, hide navigation mode
|
|
953
|
-
this._navigatingIsHidden = true;
|
|
954
|
-
this.toggleAttribute('navigating', false);
|
|
955
|
-
}
|
|
956
|
-
if (index === this._focusedItemIndex && this._navigatingIsHidden) {
|
|
957
|
-
// Focused item is back, restore navigation mode
|
|
958
|
-
this._navigatingIsHidden = false;
|
|
959
|
-
this.toggleAttribute('navigating', true);
|
|
916
|
+
/** @protected */
|
|
917
|
+
_preventScrollerRotatingCellFocus() {
|
|
918
|
+
if (this._activeRowGroup !== this.$.items) {
|
|
919
|
+
return;
|
|
960
920
|
}
|
|
921
|
+
|
|
922
|
+
this.__preventScrollerRotatingCellFocusDebouncer = Debouncer.debounce(
|
|
923
|
+
this.__preventScrollerRotatingCellFocusDebouncer,
|
|
924
|
+
animationFrame,
|
|
925
|
+
() => {
|
|
926
|
+
const isItemsRowGroupActive = this._activeRowGroup === this.$.items;
|
|
927
|
+
const isFocusedItemRendered = this._getRenderedRows().some((row) => row.index === this._focusedItemIndex);
|
|
928
|
+
if (isFocusedItemRendered) {
|
|
929
|
+
// Ensure the correct element is focused, as the virtualizer
|
|
930
|
+
// may use different elements when re-rendering visible items.
|
|
931
|
+
this.__updateItemsFocusable();
|
|
932
|
+
|
|
933
|
+
// The focused item is visible, so restore the cell focus outline
|
|
934
|
+
// and navigation mode.
|
|
935
|
+
if (isItemsRowGroupActive && !this.__rowFocusMode) {
|
|
936
|
+
this._focusedCell = this._itemsFocusable;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
if (this._navigatingIsHidden) {
|
|
940
|
+
this.toggleAttribute('navigating', true);
|
|
941
|
+
this._navigatingIsHidden = false;
|
|
942
|
+
}
|
|
943
|
+
} else if (isItemsRowGroupActive) {
|
|
944
|
+
// The focused item was scrolled out of view and focus is still inside body,
|
|
945
|
+
// so remove the cell focus outline and hide navigation mode.
|
|
946
|
+
this._focusedCell = null;
|
|
947
|
+
|
|
948
|
+
if (this.hasAttribute('navigating')) {
|
|
949
|
+
this._navigatingIsHidden = true;
|
|
950
|
+
this.toggleAttribute('navigating', false);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
);
|
|
961
955
|
}
|
|
962
956
|
|
|
963
957
|
/**
|
|
@@ -1017,7 +1011,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
1017
1011
|
* @protected
|
|
1018
1012
|
*/
|
|
1019
1013
|
_scrollHorizontallyToCell(dstCell) {
|
|
1020
|
-
if (dstCell.hasAttribute('frozen') || dstCell.hasAttribute('frozen-to-end') ||
|
|
1014
|
+
if (dstCell.hasAttribute('frozen') || dstCell.hasAttribute('frozen-to-end') || isDetailsCell(dstCell)) {
|
|
1021
1015
|
// These cells are, by design, always visible, no need to scroll.
|
|
1022
1016
|
return;
|
|
1023
1017
|
}
|
|
@@ -1030,7 +1024,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
1030
1024
|
rightBoundary = tableRect.right;
|
|
1031
1025
|
for (let i = dstCellIndex - 1; i >= 0; i--) {
|
|
1032
1026
|
const cell = dstRow.children[i];
|
|
1033
|
-
if (cell.hasAttribute('hidden') ||
|
|
1027
|
+
if (cell.hasAttribute('hidden') || isDetailsCell(cell)) {
|
|
1034
1028
|
continue;
|
|
1035
1029
|
}
|
|
1036
1030
|
if (cell.hasAttribute('frozen') || cell.hasAttribute('frozen-to-end')) {
|
|
@@ -1040,7 +1034,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
1040
1034
|
}
|
|
1041
1035
|
for (let i = dstCellIndex + 1; i < dstRow.children.length; i++) {
|
|
1042
1036
|
const cell = dstRow.children[i];
|
|
1043
|
-
if (cell.hasAttribute('hidden') ||
|
|
1037
|
+
if (cell.hasAttribute('hidden') || isDetailsCell(cell)) {
|
|
1044
1038
|
continue;
|
|
1045
1039
|
}
|
|
1046
1040
|
if (cell.hasAttribute('frozen') || cell.hasAttribute('frozen-to-end')) {
|
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": "24.5.
|
|
4
|
+
"version": "24.5.1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
},
|
|
239
239
|
{
|
|
240
240
|
"name": "vaadin-grid-column",
|
|
241
|
-
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/24.5.
|
|
241
|
+
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
|
|
242
242
|
"attributes": [
|
|
243
243
|
{
|
|
244
244
|
"name": "resizable",
|
|
@@ -951,7 +951,7 @@
|
|
|
951
951
|
},
|
|
952
952
|
{
|
|
953
953
|
"name": "vaadin-grid-selection-column",
|
|
954
|
-
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid 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.5.
|
|
954
|
+
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid 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.5.1/#/elements/vaadin-grid#property-items),\nthe column header gets an additional checkbox that can be used for toggling\nselection for all the items at once.\n\n__The default content can also be overridden__",
|
|
955
955
|
"attributes": [
|
|
956
956
|
{
|
|
957
957
|
"name": "resizable",
|
|
@@ -2152,7 +2152,7 @@
|
|
|
2152
2152
|
},
|
|
2153
2153
|
{
|
|
2154
2154
|
"name": "vaadin-grid",
|
|
2155
|
-
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/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.5.0-rc2/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/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.5.0-rc2/#/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.5.0-rc2/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`last-row` | The last body row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
2155
|
+
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/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.5.1/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/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.5.1/#/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.5.1/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`last-row` | The last body row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
2156
2156
|
"attributes": [
|
|
2157
2157
|
{
|
|
2158
2158
|
"name": "size",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/grid",
|
|
4
|
-
"version": "24.5.
|
|
4
|
+
"version": "24.5.1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "vaadin-grid-column",
|
|
103
|
-
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/24.5.
|
|
103
|
+
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
|
|
104
104
|
"extension": true,
|
|
105
105
|
"attributes": [
|
|
106
106
|
{
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
},
|
|
367
367
|
{
|
|
368
368
|
"name": "vaadin-grid-selection-column",
|
|
369
|
-
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid 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.5.
|
|
369
|
+
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid 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.5.1/#/elements/vaadin-grid#property-items),\nthe column header gets an additional checkbox that can be used for toggling\nselection for all the items at once.\n\n__The default content can also be overridden__",
|
|
370
370
|
"extension": true,
|
|
371
371
|
"attributes": [
|
|
372
372
|
{
|
|
@@ -828,7 +828,7 @@
|
|
|
828
828
|
},
|
|
829
829
|
{
|
|
830
830
|
"name": "vaadin-grid",
|
|
831
|
-
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/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.5.0-rc2/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-rc2/#/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.5.0-rc2/#/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.5.0-rc2/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`last-row` | The last body row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
831
|
+
"description": "`<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the\nthe grid can be populated by using renderer callback function.\n\n### Quick Start\n\nStart with an assigning an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/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.5.1/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/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.5.1/#/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.5.1/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`collapsed-row` | Collapsed row\n`expanded-row` | Expanded row\n`selected-row` | Selected row\n`details-opened-row` | Row with details open\n`odd-row` | Odd row\n`even-row` | Even row\n`first-row` | The first body row\n`last-row` | The last body row\n`dragstart-row` | Set on the row for one frame when drag is starting.\n`dragover-above-row` | Set on the row when the a row is dragged over above\n`dragover-below-row` | Set on the row when the a row is dragged over below\n`dragover-on-top-row` | Set on the row when the a row is dragged over on top\n`drag-disabled-row` | Set to a row that isn't available for dragging\n`drop-disabled-row` | Set to a row that can't be dropped on top of\n`cell` | Cell in the internal table\n`header-cell` | Header cell in the internal table\n`body-cell` | Body cell in the internal table\n`footer-cell` | Footer cell in the internal table\n`details-cell` | Row details cell in the internal table\n`focused-cell` | Focused cell in the internal table\n`odd-row-cell` | Cell in an odd row\n`even-row-cell` | Cell in an even row\n`first-row-cell` | Cell in the first body row\n`last-row-cell` | Cell in the last body row\n`first-header-row-cell` | Cell in the first header row\n`first-footer-row-cell` | Cell in the first footer row\n`last-header-row-cell` | Cell in the last header row\n`last-footer-row-cell` | Cell in the last footer row\n`loading-row-cell` | Cell in a row that is waiting for data from data provider\n`selected-row-cell` | Cell in a selected row\n`collapsed-row-cell` | Cell in a collapsed row\n`expanded-row-cell` | Cell in an expanded row\n`details-opened-row-cell` | Cell in an row with details open\n`dragstart-row-cell` | Cell in the ghost image row, but not in a source row\n`drag-source-row-cell` | Cell in a source row, but not in the ghost image\n`dragover-above-row-cell` | Cell in a row that has another row dragged over above\n`dragover-below-row-cell` | Cell in a row that has another row dragged over below\n`dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top\n`drag-disabled-row-cell` | Cell in a row that isn't available for dragging\n`drop-disabled-row-cell` | Cell in a row that can't be dropped on top of\n`frozen-cell` | Frozen cell in the internal table\n`frozen-to-end-cell` | Frozen to end cell in the internal table\n`last-frozen-cell` | Last frozen cell\n`first-frozen-to-end-cell` | First cell frozen to end\n`first-column-cell` | First visible cell on a row\n`last-column-cell` | Last visible cell on a row\n`reorder-allowed-cell` | Cell in a column where another column can be reordered\n`reorder-dragging-cell` | Cell in a column currently being reordered\n`resize-handle` | Handle for resizing the columns\n`empty-state` | The container for the content to be displayed when there are no body rows to show\n`reorder-ghost` | Ghost element of the header cell being dragged\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n----------------------|---------------------------------------------------------------------------------------------------|-----------\n`loading` | Set when the grid is loading data from data provider | :host\n`interacting` | Keyboard navigation in interaction mode | :host\n`navigating` | Keyboard navigation in navigation mode | :host\n`overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host\n`reordering` | Set when the grid's columns are being reordered | :host\n`dragover` | Set when the grid (not a specific row) is dragged over | :host\n`dragging-rows` | Set when grid rows are dragged | :host\n`reorder-status` | Reflects the status of a cell while columns are being reordered | cell\n`frozen` | Frozen cell | cell\n`frozen-to-end` | Cell frozen to end | cell\n`last-frozen` | Last frozen cell | cell\n`first-frozen-to-end` | First cell frozen to end | cell\n`first-column` | First visible cell on a row | cell\n`last-column` | Last visible cell on a row | cell\n`selected` | Selected row | row\n`expanded` | Expanded row | row\n`details-opened` | Row with details open | row\n`loading` | Row that is waiting for data from data provider | row\n`odd` | Odd row | row\n`first` | The first body row | row\n`last` | The last body row | row\n`dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row\n`dragover` | Set when the row is dragged over | row\n`drag-disabled` | Set to a row that isn't available for dragging | row\n`drop-disabled` | Set to a row that can't be dropped on top of | row\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
832
832
|
"extension": true,
|
|
833
833
|
"attributes": [
|
|
834
834
|
{
|