@vaadin/grid 24.3.0-alpha8 → 24.3.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -22
- package/src/lit-all-imports.js +14 -0
- package/src/vaadin-grid-data-provider-mixin.js +4 -1
- package/src/vaadin-grid-keyboard-navigation-mixin.js +1 -1
- package/src/vaadin-grid-mixin.js +15 -4
- package/src/vaadin-grid-row-details-mixin.js +7 -0
- package/src/vaadin-grid-scroll-mixin.js +7 -2
- package/src/vaadin-grid.d.ts +1 -0
- package/src/vaadin-grid.js +1 -0
- package/src/vaadin-lit-grid-column-group.js +28 -0
- package/src/vaadin-lit-grid-column.js +30 -0
- package/src/vaadin-lit-grid-filter-column.js +28 -0
- package/src/vaadin-lit-grid-filter.js +35 -0
- package/src/vaadin-lit-grid-selection-column.js +28 -0
- package/src/vaadin-lit-grid-sort-column.js +28 -0
- package/src/vaadin-lit-grid-sorter.js +42 -0
- package/src/vaadin-lit-grid-tree-column.js +28 -0
- package/src/vaadin-lit-grid-tree-toggle.js +39 -0
- package/src/vaadin-lit-grid.js +63 -0
- package/theme/lumo/lit-all-imports.js +11 -0
- package/theme/lumo/vaadin-grid-styles.js +1 -1
- package/theme/lumo/vaadin-lit-grid-column-group.js +1 -0
- package/theme/lumo/vaadin-lit-grid-column.js +1 -0
- package/theme/lumo/vaadin-lit-grid-filter-column.js +2 -0
- package/theme/lumo/vaadin-lit-grid-filter.js +3 -0
- package/theme/lumo/vaadin-lit-grid-selection-column.js +2 -0
- package/theme/lumo/vaadin-lit-grid-sort-column.js +2 -0
- package/theme/lumo/vaadin-lit-grid-sorter.js +2 -0
- package/theme/lumo/vaadin-lit-grid-tree-column.js +2 -0
- package/theme/lumo/vaadin-lit-grid-tree-toggle.js +2 -0
- package/theme/lumo/vaadin-lit-grid.js +2 -0
- package/theme/material/lit-all-imports.js +11 -0
- package/theme/material/vaadin-grid-styles.js +10 -7
- package/theme/material/vaadin-lit-grid-column-group.js +1 -0
- package/theme/material/vaadin-lit-grid-column.js +1 -0
- package/theme/material/vaadin-lit-grid-filter-column.js +2 -0
- package/theme/material/vaadin-lit-grid-filter.js +3 -0
- package/theme/material/vaadin-lit-grid-selection-column.js +2 -0
- package/theme/material/vaadin-lit-grid-sort-column.js +2 -0
- package/theme/material/vaadin-lit-grid-sorter.js +2 -0
- package/theme/material/vaadin-lit-grid-tree-column.js +2 -0
- package/theme/material/vaadin-lit-grid-tree-toggle.js +2 -0
- package/theme/material/vaadin-lit-grid.js +2 -0
- package/vaadin-lit-grid-column-group.d.ts +1 -0
- package/vaadin-lit-grid-column-group.js +3 -0
- package/vaadin-lit-grid-column.d.ts +1 -0
- package/vaadin-lit-grid-column.js +3 -0
- package/vaadin-lit-grid-filter-column.d.ts +1 -0
- package/vaadin-lit-grid-filter-column.js +3 -0
- package/vaadin-lit-grid-filter.d.ts +1 -0
- package/vaadin-lit-grid-filter.js +3 -0
- package/vaadin-lit-grid-selection-column.d.ts +1 -0
- package/vaadin-lit-grid-selection-column.js +3 -0
- package/vaadin-lit-grid-sort-column.d.ts +1 -0
- package/vaadin-lit-grid-sort-column.js +3 -0
- package/vaadin-lit-grid-sorter.d.ts +1 -0
- package/vaadin-lit-grid-sorter.js +3 -0
- package/vaadin-lit-grid-tree-column.d.ts +1 -0
- package/vaadin-lit-grid-tree-column.js +3 -0
- package/vaadin-lit-grid-tree-toggle.d.ts +1 -0
- package/vaadin-lit-grid-tree-toggle.js +3 -0
- package/vaadin-lit-grid.d.ts +2 -0
- package/vaadin-lit-grid.js +4 -0
- package/web-types.json +4 -4
- package/web-types.lit.json +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "24.3.0-
|
|
3
|
+
"version": "24.3.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,19 +25,7 @@
|
|
|
25
25
|
"lit.d.ts",
|
|
26
26
|
"lit.js",
|
|
27
27
|
"src",
|
|
28
|
-
"!src/lit-all-imports.js",
|
|
29
|
-
"!src/vaadin-lit-grid-column-group.js",
|
|
30
|
-
"!src/vaadin-lit-grid-column.js",
|
|
31
|
-
"!src/vaadin-lit-grid-filter-column.js",
|
|
32
|
-
"!src/vaadin-lit-grid-filter.js",
|
|
33
|
-
"!src/vaadin-lit-grid-selection-column.js",
|
|
34
|
-
"!src/vaadin-lit-grid-sort-column.js",
|
|
35
|
-
"!src/vaadin-lit-grid-sorter.js",
|
|
36
|
-
"!src/vaadin-lit-grid-tree-column.js",
|
|
37
|
-
"!src/vaadin-lit-grid-tree-toggle.js",
|
|
38
|
-
"!src/vaadin-lit-grid.js",
|
|
39
28
|
"theme",
|
|
40
|
-
"!theme/lumo/lit-all-imports.js",
|
|
41
29
|
"vaadin-*.d.ts",
|
|
42
30
|
"vaadin-*.js",
|
|
43
31
|
"web-types.json",
|
|
@@ -58,14 +46,14 @@
|
|
|
58
46
|
"dependencies": {
|
|
59
47
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
60
48
|
"@polymer/polymer": "^3.0.0",
|
|
61
|
-
"@vaadin/a11y-base": "24.3.0-
|
|
62
|
-
"@vaadin/checkbox": "24.3.0-
|
|
63
|
-
"@vaadin/component-base": "24.3.0-
|
|
64
|
-
"@vaadin/lit-renderer": "24.3.0-
|
|
65
|
-
"@vaadin/text-field": "24.3.0-
|
|
66
|
-
"@vaadin/vaadin-lumo-styles": "24.3.0-
|
|
67
|
-
"@vaadin/vaadin-material-styles": "24.3.0-
|
|
68
|
-
"@vaadin/vaadin-themable-mixin": "24.3.0-
|
|
49
|
+
"@vaadin/a11y-base": "24.3.0-beta1",
|
|
50
|
+
"@vaadin/checkbox": "24.3.0-beta1",
|
|
51
|
+
"@vaadin/component-base": "24.3.0-beta1",
|
|
52
|
+
"@vaadin/lit-renderer": "24.3.0-beta1",
|
|
53
|
+
"@vaadin/text-field": "24.3.0-beta1",
|
|
54
|
+
"@vaadin/vaadin-lumo-styles": "24.3.0-beta1",
|
|
55
|
+
"@vaadin/vaadin-material-styles": "24.3.0-beta1",
|
|
56
|
+
"@vaadin/vaadin-themable-mixin": "24.3.0-beta1"
|
|
69
57
|
},
|
|
70
58
|
"devDependencies": {
|
|
71
59
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -77,5 +65,5 @@
|
|
|
77
65
|
"web-types.json",
|
|
78
66
|
"web-types.lit.json"
|
|
79
67
|
],
|
|
80
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "a197041861e1bbf8d3e966d893648f5dd462b036"
|
|
81
69
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import './vaadin-lit-grid.js';
|
|
7
|
+
import './vaadin-lit-grid-column-group.js';
|
|
8
|
+
import './vaadin-lit-grid-filter.js';
|
|
9
|
+
import './vaadin-lit-grid-filter-column.js';
|
|
10
|
+
import './vaadin-lit-grid-sorter.js';
|
|
11
|
+
import './vaadin-lit-grid-sort-column.js';
|
|
12
|
+
import './vaadin-lit-grid-selection-column.js';
|
|
13
|
+
import './vaadin-lit-grid-tree-toggle.js';
|
|
14
|
+
import './vaadin-lit-grid-tree-column.js';
|
|
@@ -186,7 +186,8 @@ export const DataProviderMixin = (superClass) =>
|
|
|
186
186
|
|
|
187
187
|
/** @private */
|
|
188
188
|
_sizeChanged(size) {
|
|
189
|
-
this._dataProviderController.
|
|
189
|
+
this._dataProviderController.rootCache.size = size;
|
|
190
|
+
this._dataProviderController.recalculateFlatSize();
|
|
190
191
|
this._flatSize = this._dataProviderController.flatSize;
|
|
191
192
|
}
|
|
192
193
|
|
|
@@ -363,6 +364,8 @@ export const DataProviderMixin = (superClass) =>
|
|
|
363
364
|
*/
|
|
364
365
|
clearCache() {
|
|
365
366
|
this._dataProviderController.clearCache();
|
|
367
|
+
this._dataProviderController.rootCache.size = this.size;
|
|
368
|
+
this._dataProviderController.recalculateFlatSize();
|
|
366
369
|
this._hasData = false;
|
|
367
370
|
this.__updateVisibleRows();
|
|
368
371
|
|
|
@@ -691,7 +691,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
691
691
|
// If the target focusable is tied to a column that is not visible,
|
|
692
692
|
// find the first visible column and update the target in order to
|
|
693
693
|
// prevent scrolling to the start of the row.
|
|
694
|
-
if (focusStepTarget &&
|
|
694
|
+
if (focusStepTarget && !this.__isHorizontallyInViewport(focusStepTarget)) {
|
|
695
695
|
const firstVisibleColumn = this._getColumnsInOrder().find((column) => this.__isColumnInViewport(column));
|
|
696
696
|
if (firstVisibleColumn) {
|
|
697
697
|
if (focusStepTarget === this._headerFocusable) {
|
package/src/vaadin-grid-mixin.js
CHANGED
|
@@ -418,8 +418,19 @@ export const GridMixin = (superClass) =>
|
|
|
418
418
|
})
|
|
419
419
|
.forEach((cell) => {
|
|
420
420
|
cell.__measuringAutoWidth = autoWidth;
|
|
421
|
-
|
|
422
|
-
cell.
|
|
421
|
+
|
|
422
|
+
if (cell.__measuringAutoWidth) {
|
|
423
|
+
// Store the original inline width of the cell to restore it later
|
|
424
|
+
cell.__originalWidth = cell.style.width;
|
|
425
|
+
// Prepare the cell for having its intrinsic width measured
|
|
426
|
+
cell.style.width = 'auto';
|
|
427
|
+
cell.style.position = 'absolute';
|
|
428
|
+
} else {
|
|
429
|
+
// Restore the original width
|
|
430
|
+
cell.style.width = cell.__originalWidth;
|
|
431
|
+
delete cell.__originalWidth;
|
|
432
|
+
cell.style.position = '';
|
|
433
|
+
}
|
|
423
434
|
});
|
|
424
435
|
}
|
|
425
436
|
|
|
@@ -433,7 +444,7 @@ export const GridMixin = (superClass) =>
|
|
|
433
444
|
// Note: _allCells only contains cells which are currently rendered in DOM
|
|
434
445
|
return col._allCells.reduce((width, cell) => {
|
|
435
446
|
// Add 1px buffer to the offset width to avoid too narrow columns (sub-pixel rendering)
|
|
436
|
-
return cell.__measuringAutoWidth ? Math.max(width, cell.
|
|
447
|
+
return cell.__measuringAutoWidth ? Math.max(width, cell.offsetWidth + 1) : width;
|
|
437
448
|
}, 0);
|
|
438
449
|
}
|
|
439
450
|
|
|
@@ -497,7 +508,7 @@ export const GridMixin = (superClass) =>
|
|
|
497
508
|
const rows = [];
|
|
498
509
|
for (let i = 0; i < count; i++) {
|
|
499
510
|
const row = document.createElement('tr');
|
|
500
|
-
row.setAttribute('part', 'row');
|
|
511
|
+
row.setAttribute('part', 'row body-row');
|
|
501
512
|
row.setAttribute('role', 'row');
|
|
502
513
|
row.setAttribute('tabindex', '-1');
|
|
503
514
|
if (this._columnTree) {
|
|
@@ -153,6 +153,13 @@ export const RowDetailsMixin = (superClass) =>
|
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
this.__updateDetailsRowPadding(row, cell);
|
|
157
|
+
// Ensure the row has correct padding after frame (the resize observer might miss it)
|
|
158
|
+
requestAnimationFrame(() => this.__updateDetailsRowPadding(row, cell));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** @private */
|
|
162
|
+
__updateDetailsRowPadding(row, cell) {
|
|
156
163
|
if (cell.hidden) {
|
|
157
164
|
row.style.removeProperty('padding-bottom');
|
|
158
165
|
} else {
|
|
@@ -321,9 +321,14 @@ export const ScrollMixin = (superClass) =>
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
// Check if the column's sizer cell is inside the viewport
|
|
324
|
+
return this.__isHorizontallyInViewport(column._sizerCell);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/** @private */
|
|
328
|
+
__isHorizontallyInViewport(element) {
|
|
324
329
|
return (
|
|
325
|
-
|
|
326
|
-
|
|
330
|
+
element.offsetLeft + element.offsetWidth >= this._scrollLeft &&
|
|
331
|
+
element.offsetLeft <= this._scrollLeft + this.clientWidth
|
|
327
332
|
);
|
|
328
333
|
}
|
|
329
334
|
|
package/src/vaadin-grid.d.ts
CHANGED
|
@@ -156,6 +156,7 @@ export type GridDefaultItem = any;
|
|
|
156
156
|
* Part name | Description
|
|
157
157
|
* ---------------------------|----------------
|
|
158
158
|
* `row` | Row in the internal table
|
|
159
|
+
* `body-row` | Body row in the internal table
|
|
159
160
|
* `collapsed-row` | Collapsed row
|
|
160
161
|
* `expanded-row` | Expanded row
|
|
161
162
|
* `selected-row` | Selected row
|
package/src/vaadin-grid.js
CHANGED
|
@@ -156,6 +156,7 @@ registerStyles('vaadin-grid', gridStyles, { moduleId: 'vaadin-grid-styles' });
|
|
|
156
156
|
* Part name | Description
|
|
157
157
|
* ---------------------------|----------------
|
|
158
158
|
* `row` | Row in the internal table
|
|
159
|
+
* `body-row` | Body row in the internal table
|
|
159
160
|
* `collapsed-row` | Collapsed row
|
|
160
161
|
* `expanded-row` | Expanded row
|
|
161
162
|
* `selected-row` | Selected row
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
|
+
import { GridColumnGroupMixin } from './vaadin-grid-column-group-mixin.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-column-group>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridColumnGroup extends GridColumnGroupMixin(PolylitMixin(LitElement)) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-column-group';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridColumnGroup);
|
|
27
|
+
|
|
28
|
+
export { GridColumnGroup };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
|
+
import { GridColumnMixin } from './vaadin-grid-column-mixin.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridColumn extends GridColumnMixin(PolylitMixin(LitElement)) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridColumn);
|
|
27
|
+
|
|
28
|
+
export { GridColumn };
|
|
29
|
+
|
|
30
|
+
export { ColumnBaseMixin } from './vaadin-grid-column-mixin.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import './vaadin-lit-grid-filter.js';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { GridFilterColumnMixin } from './vaadin-grid-filter-column-mixin.js';
|
|
9
|
+
import { GridColumn } from './vaadin-lit-grid-column.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-filter-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridFilterColumn extends GridFilterColumnMixin(GridColumn) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-filter-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridFilterColumn);
|
|
27
|
+
|
|
28
|
+
export { GridFilterColumn };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/text-field/src/vaadin-lit-text-field.js';
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
|
|
11
|
+
import { GridFilterElementMixin } from './vaadin-grid-filter-element-mixin.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* LitElement based version of `<vaadin-grid-filter>` web component.
|
|
15
|
+
*
|
|
16
|
+
* ## Disclaimer
|
|
17
|
+
*
|
|
18
|
+
* This component is an experiment not intended for publishing to npm.
|
|
19
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
20
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
21
|
+
*/
|
|
22
|
+
class GridFilter extends GridFilterElementMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
23
|
+
static get is() {
|
|
24
|
+
return 'vaadin-grid-filter';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** @protected */
|
|
28
|
+
render() {
|
|
29
|
+
return html`<slot></slot>`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
defineCustomElement(GridFilter);
|
|
34
|
+
|
|
35
|
+
export { GridFilter };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/checkbox/src/vaadin-lit-checkbox.js';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { GridSelectionColumnMixin } from './vaadin-grid-selection-column-mixin.js';
|
|
9
|
+
import { GridColumn } from './vaadin-lit-grid-column.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-selection-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridSelectionColumn extends GridSelectionColumnMixin(GridColumn) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-selection-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridSelectionColumn);
|
|
27
|
+
|
|
28
|
+
export { GridSelectionColumn };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import './vaadin-lit-grid-sorter.js';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { GridSortColumnMixin } from './vaadin-grid-sort-column-mixin.js';
|
|
9
|
+
import { GridColumn } from './vaadin-lit-grid-column.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-sort-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridSortColumn extends GridSortColumnMixin(GridColumn) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-sort-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridSortColumn);
|
|
27
|
+
|
|
28
|
+
export { GridSortColumn };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
|
|
11
|
+
import { GridSorterMixin } from './vaadin-grid-sorter-mixin.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* LitElement based version of `<vaadin-grid-sorter>` web component.
|
|
15
|
+
*
|
|
16
|
+
* ## Disclaimer
|
|
17
|
+
*
|
|
18
|
+
* This component is an experiment not intended for publishing to npm.
|
|
19
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
20
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
21
|
+
*/
|
|
22
|
+
class GridSorter extends GridSorterMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
23
|
+
static get is() {
|
|
24
|
+
return 'vaadin-grid-sorter';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** @protected */
|
|
28
|
+
render() {
|
|
29
|
+
return html`
|
|
30
|
+
<div part="content">
|
|
31
|
+
<slot></slot>
|
|
32
|
+
</div>
|
|
33
|
+
<div part="indicators">
|
|
34
|
+
<span part="order">${this._getDisplayOrder(this._order)}</span>
|
|
35
|
+
</div>
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
defineCustomElement(GridSorter);
|
|
41
|
+
|
|
42
|
+
export { GridSorter };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import './vaadin-lit-grid-tree-toggle.js';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { GridTreeColumnMixin } from './vaadin-grid-tree-column-mixin.js';
|
|
9
|
+
import { GridColumn } from './vaadin-lit-grid-column.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* LitElement based version of `<vaadin-grid-tree-column>` web component.
|
|
13
|
+
*
|
|
14
|
+
* ## Disclaimer
|
|
15
|
+
*
|
|
16
|
+
* This component is an experiment not intended for publishing to npm.
|
|
17
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
18
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
19
|
+
*/
|
|
20
|
+
class GridTreeColumn extends GridTreeColumnMixin(GridColumn) {
|
|
21
|
+
static get is() {
|
|
22
|
+
return 'vaadin-grid-tree-column';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defineCustomElement(GridTreeColumn);
|
|
27
|
+
|
|
28
|
+
export { GridTreeColumn };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
|
|
11
|
+
import { GridTreeToggleMixin } from './vaadin-grid-tree-toggle-mixin.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* LitElement based version of `<vaadin-grid-tree-toggle>` web component.
|
|
15
|
+
*
|
|
16
|
+
* ## Disclaimer
|
|
17
|
+
*
|
|
18
|
+
* This component is an experiment not intended for publishing to npm.
|
|
19
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
20
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
21
|
+
*/
|
|
22
|
+
class GridTreeToggle extends GridTreeToggleMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
23
|
+
static get is() {
|
|
24
|
+
return 'vaadin-grid-tree-toggle';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** @protected */
|
|
28
|
+
render() {
|
|
29
|
+
return html`
|
|
30
|
+
<span id="level-spacer"></span>
|
|
31
|
+
<span part="toggle"></span>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
defineCustomElement(GridTreeToggle);
|
|
38
|
+
|
|
39
|
+
export { GridTreeToggle };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import './vaadin-lit-grid-column.js';
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { isIOS, isSafari } from '@vaadin/component-base/src/browser-utils.js';
|
|
9
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
|
+
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { GridMixin } from './vaadin-grid-mixin.js';
|
|
14
|
+
import { gridStyles } from './vaadin-grid-styles.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* LitElement based version of `<vaadin-grid>` web component.
|
|
18
|
+
*
|
|
19
|
+
* ## Disclaimer
|
|
20
|
+
*
|
|
21
|
+
* This component is an experiment not intended for publishing to npm.
|
|
22
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
23
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
24
|
+
*/
|
|
25
|
+
class Grid extends GridMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
26
|
+
static get is() {
|
|
27
|
+
return 'vaadin-grid';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static get styles() {
|
|
31
|
+
return gridStyles;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** @protected */
|
|
35
|
+
render() {
|
|
36
|
+
return html`
|
|
37
|
+
<div
|
|
38
|
+
id="scroller"
|
|
39
|
+
safari="${isSafari}"
|
|
40
|
+
ios="${isIOS}"
|
|
41
|
+
?loading="${this.loading}"
|
|
42
|
+
column-reordering-allowed="${this.columnReorderingAllowed}"
|
|
43
|
+
>
|
|
44
|
+
<table id="table" role="treegrid" aria-multiselectable="true" tabindex="0">
|
|
45
|
+
<caption id="sizer" part="row"></caption>
|
|
46
|
+
<thead id="header" role="rowgroup"></thead>
|
|
47
|
+
<tbody id="items" role="rowgroup"></tbody>
|
|
48
|
+
<tfoot id="footer" role="rowgroup"></tfoot>
|
|
49
|
+
</table>
|
|
50
|
+
|
|
51
|
+
<div part="reorder-ghost"></div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<slot name="tooltip"></slot>
|
|
55
|
+
|
|
56
|
+
<div id="focusexit" tabindex="0"></div>
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
defineCustomElement(Grid);
|
|
62
|
+
|
|
63
|
+
export { Grid };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import './vaadin-lit-grid-column-group.js';
|
|
2
|
+
import './vaadin-lit-grid-column.js';
|
|
3
|
+
import './vaadin-lit-grid-filter.js';
|
|
4
|
+
import './vaadin-lit-grid-filter-column.js';
|
|
5
|
+
import './vaadin-lit-grid-selection-column.js';
|
|
6
|
+
import './vaadin-lit-grid-sorter.js';
|
|
7
|
+
import './vaadin-lit-grid-sort-column.js';
|
|
8
|
+
import './vaadin-lit-grid-tree-toggle.js';
|
|
9
|
+
import './vaadin-lit-grid-tree-column.js';
|
|
10
|
+
import './vaadin-lit-grid.js';
|
|
11
|
+
import '../../src/lit-all-imports.js';
|
|
@@ -44,7 +44,7 @@ registerStyles(
|
|
|
44
44
|
|
|
45
45
|
[part~='cell'] {
|
|
46
46
|
min-height: var(--lumo-size-m);
|
|
47
|
-
background-color: var(--lumo-base-color);
|
|
47
|
+
background-color: var(--vaadin-grid-cell-background, var(--lumo-base-color));
|
|
48
48
|
cursor: default;
|
|
49
49
|
--_cell-padding: var(--vaadin-grid-cell-padding, var(--_cell-default-padding));
|
|
50
50
|
--_cell-default-padding: var(--lumo-space-xs) var(--lumo-space-m);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../../src/vaadin-lit-grid-column-group.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../../src/vaadin-lit-grid-column.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import './vaadin-lit-grid-column-group.js';
|
|
2
|
+
import './vaadin-lit-grid-column.js';
|
|
3
|
+
import './vaadin-lit-grid-filter.js';
|
|
4
|
+
import './vaadin-lit-grid-filter-column.js';
|
|
5
|
+
import './vaadin-lit-grid-selection-column.js';
|
|
6
|
+
import './vaadin-lit-grid-sorter.js';
|
|
7
|
+
import './vaadin-lit-grid-sort-column.js';
|
|
8
|
+
import './vaadin-lit-grid-tree-toggle.js';
|
|
9
|
+
import './vaadin-lit-grid-tree-column.js';
|
|
10
|
+
import './vaadin-lit-grid.js';
|
|
11
|
+
import '../../src/lit-all-imports.js';
|
|
@@ -34,7 +34,7 @@ registerStyles(
|
|
|
34
34
|
|
|
35
35
|
[part~='header-cell'],
|
|
36
36
|
[part~='footer-cell'] {
|
|
37
|
-
background-color: var(--material-background-color);
|
|
37
|
+
background-color: var(--vaadin-grid-cell-background, var(--material-background-color));
|
|
38
38
|
color: var(--material-secondary-text-color);
|
|
39
39
|
font-size: var(--material-caption-font-size);
|
|
40
40
|
font-weight: 500;
|
|
@@ -55,15 +55,18 @@ registerStyles(
|
|
|
55
55
|
/* Body rows/cells */
|
|
56
56
|
|
|
57
57
|
[part~='body-cell'] {
|
|
58
|
-
background-color: var(--material-background-color);
|
|
58
|
+
background-color: var(--vaadin-grid-cell-background, var(--material-background-color));
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
[part~='row']:hover > [part~='body-cell'] {
|
|
62
|
-
background:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
background: var(
|
|
63
|
+
--vaadin-grid-cell-background,
|
|
64
|
+
linear-gradient(
|
|
65
|
+
var(--_material-grid-row-hover-background-color, rgba(0, 0, 0, 0.04)),
|
|
66
|
+
var(--_material-grid-row-hover-background-color, rgba(0, 0, 0, 0.04))
|
|
67
|
+
)
|
|
68
|
+
var(--material-background-color)
|
|
69
|
+
);
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
@media (hover: none) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../../src/vaadin-lit-grid-column-group.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../../src/vaadin-lit-grid-column.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-lit-grid-column-group.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-grid-column.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-grid-filter-column.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-grid-filter.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-grid-selection-column.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-grid-sort-column.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-grid-sorter.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-grid-tree-column.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-grid-tree-toggle.js';
|
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.3.0-
|
|
4
|
+
"version": "24.3.0-beta1",
|
|
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.3.0-
|
|
241
|
+
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/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.3.0-
|
|
954
|
+
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid 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.3.0-beta1/#/elements/vaadin-grid#property-items),\nthe column header gets an additional checkbox that can be used for toggling\nselection for all the items at once.\n\n__The default content can also be overridden__",
|
|
955
955
|
"attributes": [
|
|
956
956
|
{
|
|
957
957
|
"name": "resizable",
|
|
@@ -2089,7 +2089,7 @@
|
|
|
2089
2089
|
},
|
|
2090
2090
|
{
|
|
2091
2091
|
"name": "vaadin-grid",
|
|
2092
|
-
"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.3.0-alpha8/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.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.3.0-alpha8/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`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 a row that user started to drag (set for one frame)\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`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.",
|
|
2092
|
+
"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.3.0-beta1/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.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.3.0-beta1/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`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 a row that user started to drag (set for one frame)\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`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.",
|
|
2093
2093
|
"attributes": [
|
|
2094
2094
|
{
|
|
2095
2095
|
"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.3.0-
|
|
4
|
+
"version": "24.3.0-beta1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "vaadin-grid-column",
|
|
103
|
-
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-
|
|
103
|
+
"description": "A `<vaadin-grid-column>` is used to configure how a column in `<vaadin-grid>`\nshould look like.\n\nSee [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid) documentation for instructions on how\nto configure the `<vaadin-grid-column>`.",
|
|
104
104
|
"extension": true,
|
|
105
105
|
"attributes": [
|
|
106
106
|
{
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
},
|
|
367
367
|
{
|
|
368
368
|
"name": "vaadin-grid-selection-column",
|
|
369
|
-
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid 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.3.0-
|
|
369
|
+
"description": "`<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`\nthat provides default renderers and functionality for item selection.\n\n#### Example:\n```html\n<vaadin-grid 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.3.0-beta1/#/elements/vaadin-grid#property-items),\nthe column header gets an additional checkbox that can be used for toggling\nselection for all the items at once.\n\n__The default content can also be overridden__",
|
|
370
370
|
"extension": true,
|
|
371
371
|
"attributes": [
|
|
372
372
|
{
|
|
@@ -800,7 +800,7 @@
|
|
|
800
800
|
},
|
|
801
801
|
{
|
|
802
802
|
"name": "vaadin-grid",
|
|
803
|
-
"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.3.0-alpha8/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.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.3.0-alpha8/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-alpha8/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`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 a row that user started to drag (set for one frame)\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`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.",
|
|
803
|
+
"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.3.0-beta1/#/elements/vaadin-grid#property-items) property to visualize your data.\n\nUse the [`<vaadin-grid-column>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-column) element to configure the grid columns. Set `path` and `header`\nshorthand properties for the columns to define what gets rendered in the cells of the column.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column path=\"name.first\" header=\"First name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"name.last\" header=\"Last name\"></vaadin-grid-column>\n <vaadin-grid-column path=\"email\"></vaadin-grid-column>\n</vaadin-grid>\n```\n\nFor custom content `vaadin-grid-column` element provides you with three types of `renderer` callback functions: `headerRenderer`,\n`renderer` and `footerRenderer`.\n\nEach of those renderer functions provides `root`, `column`, `model` arguments when applicable.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `column`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\nRenderers are called on initialization of new column cells and each time the\nrelated row model is updated. DOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n#### Example:\n```html\n<vaadin-grid>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n <vaadin-grid-column></vaadin-grid-column>\n</vaadin-grid>\n```\n```js\nconst grid = document.querySelector('vaadin-grid');\ngrid.items = [{'name': 'John', 'surname': 'Lennon', 'role': 'singer'},\n {'name': 'Ringo', 'surname': 'Starr', 'role': 'drums'}];\n\nconst columns = grid.querySelectorAll('vaadin-grid-column');\n\ncolumns[0].headerRenderer = function(root) {\n root.textContent = 'Name';\n};\ncolumns[0].renderer = function(root, column, model) {\n root.textContent = model.item.name;\n};\n\ncolumns[1].headerRenderer = function(root) {\n root.textContent = 'Surname';\n};\ncolumns[1].renderer = function(root, column, model) {\n root.textContent = model.item.surname;\n};\n\ncolumns[2].headerRenderer = function(root) {\n root.textContent = 'Role';\n};\ncolumns[2].renderer = function(root, column, model) {\n root.textContent = model.item.role;\n};\n```\n\nThe following properties are available in the `model` argument:\n\nProperty name | Type | Description\n--------------|------|------------\n`index`| Number | The index of the item.\n`item` | String or Object | The item.\n`level` | Number | Number of the item's tree sublevel, starts from 0.\n`expanded` | Boolean | True if the item's tree sublevel is expanded.\n`selected` | Boolean | True if the item is selected.\n`detailsOpened` | Boolean | True if the item's row details are open.\n\nThe following helper elements can be used for further customization:\n- [`<vaadin-grid-column-group>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-column-group)\n- [`<vaadin-grid-filter>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-filter)\n- [`<vaadin-grid-sorter>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-sorter)\n- [`<vaadin-grid-selection-column>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-selection-column)\n- [`<vaadin-grid-tree-toggle>`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid-tree-toggle)\n\n__Note that the helper elements must be explicitly imported.__\nIf you want to import everything at once you can use the `all-imports.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.3.0-beta1/#/elements/vaadin-grid#property-dataProvider) function property.\nThe `<vaadin-grid>` calls this function lazily, only when it needs more data\nto be displayed.\n\nSee the [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/24.3.0-beta1/#/elements/vaadin-grid#property-dataProvider) property\ndocumentation for the detailed data provider arguments description.\n\n__Note that expanding the tree grid's item will trigger a call to the `dataProvider`.__\n\n__Also, note that when using function data providers, the total number of items\nneeds to be set manually. The total number of items can be returned\nin the second argument of the data provider callback:__\n\n```javascript\ngrid.dataProvider = ({page, pageSize}, callback) => {\n // page: the requested page index\n // pageSize: number of items on one page\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then(({ employees, totalSize }) => {\n callback(employees, totalSize);\n });\n};\n```\n\n__Alternatively, you can use the `size` property to set the total number of items:__\n\n```javascript\ngrid.size = 200; // The total number of items\ngrid.dataProvider = ({page, pageSize}, callback) => {\n const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;\n\n fetch(url)\n .then((res) => res.json())\n .then((resJson) => callback(resJson.employees));\n};\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------------|----------------\n`row` | Row in the internal table\n`body-row` | Body row in the internal table\n`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 a row that user started to drag (set for one frame)\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`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.",
|
|
804
804
|
"extension": true,
|
|
805
805
|
"attributes": [
|
|
806
806
|
{
|