@vaadin/grid 24.0.0-alpha1 → 24.0.0-alpha11
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/all-imports.d.ts +10 -0
- package/all-imports.js +11 -0
- package/package.json +11 -10
- package/src/all-imports.js +1 -1
- package/src/array-data-provider.js +1 -1
- package/src/lit/column-renderer-directives.d.ts +1 -1
- package/src/lit/column-renderer-directives.js +1 -1
- package/src/lit/renderer-directives.d.ts +1 -1
- package/src/lit/renderer-directives.js +1 -1
- package/src/vaadin-grid-a11y-mixin.js +12 -9
- package/src/vaadin-grid-active-item-mixin.d.ts +1 -1
- package/src/vaadin-grid-active-item-mixin.js +10 -5
- package/src/vaadin-grid-array-data-provider-mixin.d.ts +1 -1
- package/src/vaadin-grid-array-data-provider-mixin.js +1 -1
- package/src/vaadin-grid-column-group.d.ts +1 -1
- package/src/vaadin-grid-column-group.js +17 -17
- package/src/vaadin-grid-column-reordering-mixin.d.ts +1 -1
- package/src/vaadin-grid-column-reordering-mixin.js +8 -10
- package/src/vaadin-grid-column-resizing-mixin.js +6 -5
- package/src/vaadin-grid-column.d.ts +1 -1
- package/src/vaadin-grid-column.js +54 -40
- package/src/vaadin-grid-data-provider-mixin.d.ts +1 -1
- package/src/vaadin-grid-data-provider-mixin.js +34 -7
- package/src/vaadin-grid-drag-and-drop-mixin.d.ts +1 -1
- package/src/vaadin-grid-drag-and-drop-mixin.js +23 -18
- package/src/vaadin-grid-dynamic-columns-mixin.js +5 -4
- package/src/vaadin-grid-event-context-mixin.d.ts +1 -1
- package/src/vaadin-grid-event-context-mixin.js +1 -1
- package/src/vaadin-grid-filter-column.d.ts +1 -1
- package/src/vaadin-grid-filter-column.js +1 -2
- package/src/vaadin-grid-filter-mixin.js +1 -1
- package/src/vaadin-grid-filter.d.ts +3 -2
- package/src/vaadin-grid-filter.js +27 -22
- package/src/vaadin-grid-helpers.js +104 -1
- package/src/vaadin-grid-keyboard-navigation-mixin.js +48 -35
- package/src/vaadin-grid-row-details-mixin.d.ts +2 -6
- package/src/vaadin-grid-row-details-mixin.js +5 -4
- package/src/vaadin-grid-scroll-mixin.d.ts +1 -1
- package/src/vaadin-grid-scroll-mixin.js +18 -10
- package/src/vaadin-grid-selection-column.d.ts +1 -1
- package/src/vaadin-grid-selection-column.js +1 -1
- package/src/vaadin-grid-selection-mixin.d.ts +1 -1
- package/src/vaadin-grid-selection-mixin.js +1 -1
- package/src/vaadin-grid-sort-column.d.ts +1 -1
- package/src/vaadin-grid-sort-column.js +1 -1
- package/src/vaadin-grid-sort-mixin.d.ts +10 -1
- package/src/vaadin-grid-sort-mixin.js +22 -6
- package/src/vaadin-grid-sorter.d.ts +7 -2
- package/src/vaadin-grid-sorter.js +18 -2
- package/src/vaadin-grid-styles.js +5 -1
- package/src/vaadin-grid-styling-mixin.d.ts +38 -2
- package/src/vaadin-grid-styling-mixin.js +78 -6
- package/src/vaadin-grid-tree-column.d.ts +1 -8
- package/src/vaadin-grid-tree-column.js +2 -25
- package/src/vaadin-grid-tree-toggle.d.ts +1 -1
- package/src/vaadin-grid-tree-toggle.js +2 -2
- package/src/vaadin-grid.d.ts +100 -50
- package/src/vaadin-grid.js +198 -105
- package/theme/lumo/vaadin-grid-styles.js +14 -14
- package/theme/lumo/vaadin-grid.js +0 -7
- package/theme/material/vaadin-grid-styles.js +1 -1
- package/web-types.json +33 -26
- package/web-types.lit.json +18 -11
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { iterateChildren, updatePart } from './vaadin-grid-helpers.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @polymerMixin
|
|
@@ -28,34 +29,83 @@ export const StylingMixin = (superClass) =>
|
|
|
28
29
|
* - `model.selected` Selected state.
|
|
29
30
|
*
|
|
30
31
|
* @type {GridCellClassNameGenerator | null | undefined}
|
|
32
|
+
* @deprecated Use `cellPartNameGenerator` instead.
|
|
31
33
|
*/
|
|
32
34
|
cellClassNameGenerator: Function,
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A function that allows generating CSS `part` names for grid cells in Shadow DOM based
|
|
38
|
+
* on their row and column, for styling from outside using the `::part()` selector.
|
|
39
|
+
*
|
|
40
|
+
* The return value should be the generated part name as a string, or multiple part names
|
|
41
|
+
* separated by whitespace characters.
|
|
42
|
+
*
|
|
43
|
+
* Receives two arguments:
|
|
44
|
+
* - `column` The `<vaadin-grid-column>` element (`undefined` for details-cell).
|
|
45
|
+
* - `model` The object with the properties related with
|
|
46
|
+
* the rendered item, contains:
|
|
47
|
+
* - `model.index` The index of the item.
|
|
48
|
+
* - `model.item` The item.
|
|
49
|
+
* - `model.expanded` Sublevel toggle state.
|
|
50
|
+
* - `model.level` Level of the tree represented with a horizontal offset of the toggle button.
|
|
51
|
+
* - `model.selected` Selected state.
|
|
52
|
+
*
|
|
53
|
+
* @type {GridCellPartNameGenerator | null | undefined}
|
|
54
|
+
*/
|
|
55
|
+
cellPartNameGenerator: Function,
|
|
33
56
|
};
|
|
34
57
|
}
|
|
35
58
|
|
|
36
59
|
static get observers() {
|
|
37
|
-
return [
|
|
60
|
+
return [
|
|
61
|
+
'__cellClassNameGeneratorChanged(cellClassNameGenerator)',
|
|
62
|
+
'__cellPartNameGeneratorChanged(cellPartNameGenerator)',
|
|
63
|
+
];
|
|
38
64
|
}
|
|
39
65
|
|
|
66
|
+
/** @private */
|
|
40
67
|
__cellClassNameGeneratorChanged() {
|
|
41
68
|
this.generateCellClassNames();
|
|
42
69
|
}
|
|
43
70
|
|
|
71
|
+
/** @private */
|
|
72
|
+
__cellPartNameGeneratorChanged() {
|
|
73
|
+
this.generateCellPartNames();
|
|
74
|
+
}
|
|
75
|
+
|
|
44
76
|
/**
|
|
45
77
|
* Runs the `cellClassNameGenerator` for the visible cells.
|
|
46
78
|
* If the generator depends on varying conditions, you need to
|
|
47
79
|
* call this function manually in order to update the styles when
|
|
48
80
|
* the conditions change.
|
|
81
|
+
*
|
|
82
|
+
* @deprecated Use `cellPartNameGenerator` and `generateCellPartNames()` instead.
|
|
49
83
|
*/
|
|
50
84
|
generateCellClassNames() {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
85
|
+
iterateChildren(this.$.items, (row) => {
|
|
86
|
+
if (!row.hidden && !row.hasAttribute('loading')) {
|
|
87
|
+
this._generateCellClassNames(row, this.__getRowModel(row));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Runs the `cellPartNameGenerator` for the visible cells.
|
|
94
|
+
* If the generator depends on varying conditions, you need to
|
|
95
|
+
* call this function manually in order to update the styles when
|
|
96
|
+
* the conditions change.
|
|
97
|
+
*/
|
|
98
|
+
generateCellPartNames() {
|
|
99
|
+
iterateChildren(this.$.items, (row) => {
|
|
100
|
+
if (!row.hidden && !row.hasAttribute('loading')) {
|
|
101
|
+
this._generateCellPartNames(row, this.__getRowModel(row));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
54
104
|
}
|
|
55
105
|
|
|
56
106
|
/** @private */
|
|
57
107
|
_generateCellClassNames(row, model) {
|
|
58
|
-
|
|
108
|
+
iterateChildren(row, (cell) => {
|
|
59
109
|
if (cell.__generatedClasses) {
|
|
60
110
|
cell.__generatedClasses.forEach((className) => cell.classList.remove(className));
|
|
61
111
|
}
|
|
@@ -68,4 +118,26 @@ export const StylingMixin = (superClass) =>
|
|
|
68
118
|
}
|
|
69
119
|
});
|
|
70
120
|
}
|
|
121
|
+
|
|
122
|
+
/** @private */
|
|
123
|
+
_generateCellPartNames(row, model) {
|
|
124
|
+
iterateChildren(row, (cell) => {
|
|
125
|
+
if (cell.__generatedParts) {
|
|
126
|
+
cell.__generatedParts.forEach((partName) => {
|
|
127
|
+
// Remove previously generated part names
|
|
128
|
+
updatePart(cell, null, partName);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
if (this.cellPartNameGenerator) {
|
|
132
|
+
const result = this.cellPartNameGenerator(cell._column, model);
|
|
133
|
+
cell.__generatedParts = result && result.split(' ').filter((partName) => partName.length > 0);
|
|
134
|
+
if (cell.__generatedParts) {
|
|
135
|
+
cell.__generatedParts.forEach((partName) => {
|
|
136
|
+
// Add the newly generated names to part
|
|
137
|
+
updatePart(cell, true, partName);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
71
143
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { GridDefaultItem } from './vaadin-grid.js';
|
|
@@ -24,13 +24,6 @@ declare class GridTreeColumn<TItem = GridDefaultItem> extends GridColumn<TItem>
|
|
|
24
24
|
* JS Path of the property in the item used as text content for the tree toggle.
|
|
25
25
|
*/
|
|
26
26
|
path: string | null | undefined;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* JS Path of the property in the item that indicates whether the item has child items.
|
|
30
|
-
* @attr {string} item-has-children-path
|
|
31
|
-
* @deprecated Use `grid.itemHasChildrenPath` instead.
|
|
32
|
-
*/
|
|
33
|
-
itemHasChildrenPath: string | null | undefined;
|
|
34
27
|
}
|
|
35
28
|
|
|
36
29
|
declare global {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-grid-tree-toggle.js';
|
|
@@ -30,21 +30,11 @@ class GridTreeColumn extends GridColumn {
|
|
|
30
30
|
* JS Path of the property in the item used as text content for the tree toggle.
|
|
31
31
|
*/
|
|
32
32
|
path: String,
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* JS Path of the property in the item that indicates whether the item has child items.
|
|
36
|
-
* @attr {string} item-has-children-path
|
|
37
|
-
* @deprecated Use `grid.itemHasChildrenPath` instead.
|
|
38
|
-
*/
|
|
39
|
-
itemHasChildrenPath: {
|
|
40
|
-
type: String,
|
|
41
|
-
observer: '_itemHasChildrenPathChanged',
|
|
42
|
-
},
|
|
43
33
|
};
|
|
44
34
|
}
|
|
45
35
|
|
|
46
36
|
static get observers() {
|
|
47
|
-
return ['_onRendererOrBindingChanged(_renderer, _cells, _cells.*, path
|
|
37
|
+
return ['_onRendererOrBindingChanged(_renderer, _cells, _cells.*, path)'];
|
|
48
38
|
}
|
|
49
39
|
|
|
50
40
|
constructor() {
|
|
@@ -85,19 +75,6 @@ class GridTreeColumn extends GridColumn {
|
|
|
85
75
|
return this.__defaultRenderer;
|
|
86
76
|
}
|
|
87
77
|
|
|
88
|
-
/** @private */
|
|
89
|
-
_itemHasChildrenPathChanged(itemHasChildrenPath) {
|
|
90
|
-
if (itemHasChildrenPath) {
|
|
91
|
-
console.warn(
|
|
92
|
-
`WARNING: Since Vaadin 23, itemHasChildrenPath on <vaadin-grid-tree-column> is deprecated. Please set this property on the <vaadin-grid> instead.`,
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
if (this._grid) {
|
|
96
|
-
this._grid.itemHasChildrenPath = itemHasChildrenPath;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
78
|
/**
|
|
102
79
|
* Expands or collapses the row once the tree toggle is switched.
|
|
103
80
|
* The listener handles only user-fired events.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -192,7 +192,7 @@ class GridTreeToggle extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
192
192
|
if (this.leaf) {
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
if (isFocusable(e.target)) {
|
|
195
|
+
if (isFocusable(e.target) || e.target instanceof HTMLLabelElement) {
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
198
|
|
package/src/vaadin-grid.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
|
|
@@ -30,12 +30,16 @@ import { GridRowDetailsRenderer } from './vaadin-grid-row-details-mixin.js';
|
|
|
30
30
|
import type { ScrollMixinClass } from './vaadin-grid-scroll-mixin.js';
|
|
31
31
|
import type { SelectionMixinClass } from './vaadin-grid-selection-mixin.js';
|
|
32
32
|
import type { SortMixinClass } from './vaadin-grid-sort-mixin.js';
|
|
33
|
-
import type {
|
|
34
|
-
|
|
33
|
+
import type {
|
|
34
|
+
GridCellClassNameGenerator,
|
|
35
|
+
GridCellPartNameGenerator,
|
|
36
|
+
StylingMixinClass,
|
|
37
|
+
} from './vaadin-grid-styling-mixin.js';
|
|
35
38
|
|
|
36
39
|
export {
|
|
37
40
|
GridBodyRenderer,
|
|
38
41
|
GridCellClassNameGenerator,
|
|
42
|
+
GridCellPartNameGenerator,
|
|
39
43
|
GridDataProvider,
|
|
40
44
|
GridDataProviderCallback,
|
|
41
45
|
GridDataProviderParams,
|
|
@@ -86,6 +90,11 @@ export type GridColumnReorderEvent<TItem> = CustomEvent<{ columns: Array<GridCol
|
|
|
86
90
|
*/
|
|
87
91
|
export type GridColumnResizeEvent<TItem> = CustomEvent<{ resizedColumn: GridColumn<TItem> }>;
|
|
88
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Fired when the `dataProvider` property changes.
|
|
95
|
+
*/
|
|
96
|
+
export type GridDataProviderChangedEvent<TItem> = CustomEvent<{ value: GridDataProvider<TItem> }>;
|
|
97
|
+
|
|
89
98
|
/**
|
|
90
99
|
* Fired when the `expandedItems` property changes.
|
|
91
100
|
*/
|
|
@@ -119,6 +128,11 @@ export type GridLoadingChangedEvent = CustomEvent<{ value: boolean }>;
|
|
|
119
128
|
*/
|
|
120
129
|
export type GridSelectedItemsChangedEvent<TItem> = CustomEvent<{ value: TItem[] }>;
|
|
121
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Fired when the `size` property changes.
|
|
133
|
+
*/
|
|
134
|
+
export type GridSizeChangedEvent = CustomEvent<{ value: number }>;
|
|
135
|
+
|
|
122
136
|
export interface GridCustomEventMap<TItem> {
|
|
123
137
|
'active-item-changed': GridActiveItemChangedEvent<TItem>;
|
|
124
138
|
|
|
@@ -130,6 +144,8 @@ export interface GridCustomEventMap<TItem> {
|
|
|
130
144
|
|
|
131
145
|
'column-resize': GridColumnResizeEvent<TItem>;
|
|
132
146
|
|
|
147
|
+
'data-provider-changed': GridDataProviderChangedEvent<TItem>;
|
|
148
|
+
|
|
133
149
|
'expanded-items-changed': GridExpandedItemsChangedEvent<TItem>;
|
|
134
150
|
|
|
135
151
|
'grid-dragstart': GridDragStartEvent<TItem>;
|
|
@@ -141,6 +157,8 @@ export interface GridCustomEventMap<TItem> {
|
|
|
141
157
|
'loading-changed': GridLoadingChangedEvent;
|
|
142
158
|
|
|
143
159
|
'selected-items-changed': GridSelectedItemsChangedEvent<TItem>;
|
|
160
|
+
|
|
161
|
+
'size-changed': GridSizeChangedEvent;
|
|
144
162
|
}
|
|
145
163
|
|
|
146
164
|
export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEventMap<TItem> {}
|
|
@@ -285,45 +303,86 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
|
|
|
285
303
|
*
|
|
286
304
|
* The following shadow DOM parts are available for styling:
|
|
287
305
|
*
|
|
288
|
-
* Part name
|
|
289
|
-
*
|
|
290
|
-
* `row`
|
|
291
|
-
* `
|
|
292
|
-
* `
|
|
293
|
-
* `
|
|
294
|
-
* `
|
|
295
|
-
* `
|
|
296
|
-
* `
|
|
297
|
-
* `
|
|
298
|
-
* `
|
|
306
|
+
* Part name | Description
|
|
307
|
+
* ---------------------------|----------------
|
|
308
|
+
* `row` | Row in the internal table
|
|
309
|
+
* `expanded-row` | Expanded row
|
|
310
|
+
* `selected-row` | Selected row
|
|
311
|
+
* `details-opened-row` | Row with details open
|
|
312
|
+
* `odd-row` | Odd row
|
|
313
|
+
* `even-row` | Even row
|
|
314
|
+
* `first-row` | The first body row
|
|
315
|
+
* `last-row` | The last body row
|
|
316
|
+
* `dragstart-row` | Set on the row for one frame when drag is starting.
|
|
317
|
+
* `dragover-above-row` | Set on the row when the a row is dragged over above
|
|
318
|
+
* `dragover-below-row` | Set on the row when the a row is dragged over below
|
|
319
|
+
* `dragover-on-top-row` | Set on the row when the a row is dragged over on top
|
|
320
|
+
* `drag-disabled-row` | Set to a row that isn't available for dragging
|
|
321
|
+
* `drop-disabled-row` | Set to a row that can't be dropped on top of
|
|
322
|
+
* `cell` | Cell in the internal table
|
|
323
|
+
* `header-cell` | Header cell in the internal table
|
|
324
|
+
* `body-cell` | Body cell in the internal table
|
|
325
|
+
* `footer-cell` | Footer cell in the internal table
|
|
326
|
+
* `details-cell` | Row details cell in the internal table
|
|
327
|
+
* `focused-cell` | Focused cell in the internal table
|
|
328
|
+
* `odd-row-cell` | Cell in an odd row
|
|
329
|
+
* `even-row-cell` | Cell in an even row
|
|
330
|
+
* `first-row-cell` | Cell in the first body row
|
|
331
|
+
* `last-row-cell` | Cell in the last body row
|
|
332
|
+
* `first-header-row-cell` | Cell in the first header row
|
|
333
|
+
* `first-footer-row-cell` | Cell in the first footer row
|
|
334
|
+
* `last-header-row-cell` | Cell in the last header row
|
|
335
|
+
* `last-footer-row-cell` | Cell in the last footer row
|
|
336
|
+
* `loading-row-cell` | Cell in a row that is waiting for data from data provider
|
|
337
|
+
* `selected-row-cell` | Cell in a selected row
|
|
338
|
+
* `expanded-row-cell` | Cell in an expanded row
|
|
339
|
+
* `details-opened-row-cell` | Cell in an row with details open
|
|
340
|
+
* `dragstart-row-cell` | Cell in a row that user started to drag (set for one frame)
|
|
341
|
+
* `dragover-above-row-cell` | Cell in a row that has another row dragged over above
|
|
342
|
+
* `dragover-below-row-cell` | Cell in a row that has another row dragged over below
|
|
343
|
+
* `dragover-on-top-row-cell` | Cell in a row that has another row dragged over on top
|
|
344
|
+
* `drag-disabled-row-cell` | Cell in a row that isn't available for dragging
|
|
345
|
+
* `drop-disabled-row-cell` | Cell in a row that can't be dropped on top of
|
|
346
|
+
* `frozen-cell` | Frozen cell in the internal table
|
|
347
|
+
* `frozen-to-end-cell` | Frozen to end cell in the internal table
|
|
348
|
+
* `last-frozen-cell` | Last frozen cell
|
|
349
|
+
* `first-frozen-to-end-cell` | First cell frozen to end
|
|
350
|
+
* `first-column-cell` | First visible cell on a row
|
|
351
|
+
* `last-column-cell` | Last visible cell on a row
|
|
352
|
+
* `reorder-allowed-cell` | Cell in a column where another column can be reordered
|
|
353
|
+
* `reorder-dragging-cell` | Cell in a column currently being reordered
|
|
354
|
+
* `resize-handle` | Handle for resizing the columns
|
|
355
|
+
* `reorder-ghost` | Ghost element of the header cell being dragged
|
|
299
356
|
*
|
|
300
357
|
* The following state attributes are available for styling:
|
|
301
358
|
*
|
|
302
|
-
* Attribute
|
|
303
|
-
*
|
|
304
|
-
* `loading`
|
|
305
|
-
* `interacting`
|
|
306
|
-
* `navigating`
|
|
307
|
-
* `overflow`
|
|
308
|
-
* `reordering`
|
|
309
|
-
* `dragover`
|
|
310
|
-
* `dragging-rows`
|
|
311
|
-
* `reorder-status`
|
|
312
|
-
* `frozen`
|
|
313
|
-
* `
|
|
314
|
-
* `
|
|
315
|
-
* `
|
|
316
|
-
* `
|
|
317
|
-
* `
|
|
318
|
-
* `
|
|
319
|
-
* `
|
|
320
|
-
* `
|
|
321
|
-
* `
|
|
322
|
-
* `
|
|
323
|
-
* `
|
|
324
|
-
* `
|
|
325
|
-
* `
|
|
326
|
-
* `
|
|
359
|
+
* Attribute | Description | Part name
|
|
360
|
+
* -----------------------|---------------------------------------------------------------------------------------------------|-----------
|
|
361
|
+
* `loading` | Set when the grid is loading data from data provider | :host
|
|
362
|
+
* `interacting` | Keyboard navigation in interaction mode | :host
|
|
363
|
+
* `navigating` | Keyboard navigation in navigation mode | :host
|
|
364
|
+
* `overflow` | Set when rows are overflowing the grid viewport. Possible values: `top`, `bottom`, `start`, `end` | :host
|
|
365
|
+
* `reordering` | Set when the grid's columns are being reordered | :host
|
|
366
|
+
* `dragover` | Set when the grid (not a specific row) is dragged over | :host
|
|
367
|
+
* `dragging-rows` | Set when grid rows are dragged | :host
|
|
368
|
+
* `reorder-status` | Reflects the status of a cell while columns are being reordered | cell
|
|
369
|
+
* `frozen` | Frozen cell | cell
|
|
370
|
+
* `frozen-to-end` | Cell frozen to end | cell
|
|
371
|
+
* `last-frozen` | Last frozen cell | cell
|
|
372
|
+
* `first-frozen-to-end` | First cell frozen to end | cell
|
|
373
|
+
* `first-column` | First visible cell on a row | cell
|
|
374
|
+
* `last-column` | Last visible cell on a row | cell
|
|
375
|
+
* `selected` | Selected row | row
|
|
376
|
+
* `expanded` | Expanded row | row
|
|
377
|
+
* `details-opened` | Row with details open | row
|
|
378
|
+
* `loading` | Row that is waiting for data from data provider | row
|
|
379
|
+
* `odd` | Odd row | row
|
|
380
|
+
* `first` | The first body row | row
|
|
381
|
+
* `last` | The last body row | row
|
|
382
|
+
* `dragstart` | Set for one frame when starting to drag a row. The value is a number when dragging multiple rows | row
|
|
383
|
+
* `dragover` | Set when the row is dragged over | row
|
|
384
|
+
* `drag-disabled` | Set to a row that isn't available for dragging | row
|
|
385
|
+
* `drop-disabled` | Set to a row that can't be dropped on top of | row
|
|
327
386
|
*
|
|
328
387
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
|
|
329
388
|
*
|
|
@@ -332,12 +391,14 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
|
|
|
332
391
|
* @fires {CustomEvent} cell-focus - Fired when a cell is focused with click or keyboard navigation.
|
|
333
392
|
* @fires {CustomEvent} column-reorder - Fired when the columns in the grid are reordered.
|
|
334
393
|
* @fires {CustomEvent} column-resize - Fired when the grid column resize is finished.
|
|
394
|
+
* @fires {CustomEvent} data-provider-changed - Fired when the `dataProvider` property changes.
|
|
335
395
|
* @fires {CustomEvent} expanded-items-changed - Fired when the `expandedItems` property changes.
|
|
336
396
|
* @fires {CustomEvent} grid-dragstart - Fired when starting to drag grid rows.
|
|
337
397
|
* @fires {CustomEvent} grid-dragend - Fired when the dragging of the rows ends.
|
|
338
398
|
* @fires {CustomEvent} grid-drop - Fired when a drop occurs on top of the grid.
|
|
339
399
|
* @fires {CustomEvent} loading-changed - Fired when the `loading` property changes.
|
|
340
400
|
* @fires {CustomEvent} selected-items-changed - Fired when the `selectedItems` property changes.
|
|
401
|
+
* @fires {CustomEvent} size-changed - Fired when the `size` property changes.
|
|
341
402
|
*/
|
|
342
403
|
declare class Grid<TItem = GridDefaultItem> extends HTMLElement {
|
|
343
404
|
/**
|
|
@@ -367,17 +428,6 @@ declare class Grid<TItem = GridDefaultItem> extends HTMLElement {
|
|
|
367
428
|
*/
|
|
368
429
|
requestContentUpdate(): void;
|
|
369
430
|
|
|
370
|
-
/**
|
|
371
|
-
* Updates the computed metrics and positioning of internal grid parts
|
|
372
|
-
* (row/details cell positioning etc). Needs to be invoked whenever the sizing of grid
|
|
373
|
-
* content changes asynchronously to ensure consistent appearance (e.g. when a
|
|
374
|
-
* contained image whose bounds aren't known beforehand finishes loading).
|
|
375
|
-
*
|
|
376
|
-
* @deprecated Since Vaadin 22, `notifyResize()` is deprecated. The component uses a
|
|
377
|
-
* ResizeObserver internally and doesn't need to be explicitly notified of resizes.
|
|
378
|
-
*/
|
|
379
|
-
notifyResize(): void;
|
|
380
|
-
|
|
381
431
|
addEventListener<K extends keyof GridEventMap<TItem>>(
|
|
382
432
|
type: K,
|
|
383
433
|
listener: (this: Grid<TItem>, ev: GridEventMap<TItem>[K]) => void,
|