@vaadin/grid 23.1.0-alpha3 → 23.1.0-beta2
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/lit.d.ts +2 -0
- package/lit.js +2 -0
- package/package.json +12 -9
- package/src/array-data-provider.js +2 -2
- package/src/lit/column-renderer-directives.d.ts +152 -0
- package/src/lit/column-renderer-directives.js +149 -0
- package/src/lit/renderer-directives.d.ts +62 -0
- package/src/lit/renderer-directives.js +70 -0
- package/src/vaadin-grid-a11y-mixin.js +5 -5
- package/src/vaadin-grid-active-item-mixin.d.ts +1 -1
- package/src/vaadin-grid-active-item-mixin.js +8 -8
- package/src/vaadin-grid-array-data-provider-mixin.d.ts +1 -1
- package/src/vaadin-grid-array-data-provider-mixin.js +4 -4
- package/src/vaadin-grid-column-group.js +57 -53
- package/src/vaadin-grid-column-reordering-mixin.d.ts +1 -1
- package/src/vaadin-grid-column-reordering-mixin.js +12 -12
- package/src/vaadin-grid-column-resizing-mixin.js +12 -18
- package/src/vaadin-grid-column.d.ts +2 -2
- package/src/vaadin-grid-column.js +39 -28
- package/src/vaadin-grid-data-provider-mixin.d.ts +2 -2
- package/src/vaadin-grid-data-provider-mixin.js +18 -18
- package/src/vaadin-grid-drag-and-drop-mixin.d.ts +1 -1
- package/src/vaadin-grid-drag-and-drop-mixin.js +9 -9
- package/src/vaadin-grid-dynamic-columns-mixin.js +23 -24
- 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.js +1 -1
- package/src/vaadin-grid-filter-mixin.js +4 -6
- package/src/vaadin-grid-filter.d.ts +2 -2
- package/src/vaadin-grid-filter.js +2 -2
- package/src/vaadin-grid-helpers.js +1 -1
- package/src/vaadin-grid-keyboard-navigation-mixin.js +20 -17
- package/src/vaadin-grid-row-details-mixin.d.ts +2 -2
- package/src/vaadin-grid-row-details-mixin.js +4 -6
- package/src/vaadin-grid-scroll-mixin.js +7 -10
- package/src/vaadin-grid-selection-column.d.ts +2 -2
- package/src/vaadin-grid-selection-column.js +8 -8
- package/src/vaadin-grid-selection-mixin.d.ts +1 -1
- package/src/vaadin-grid-selection-mixin.js +2 -2
- package/src/vaadin-grid-sort-column.d.ts +2 -2
- package/src/vaadin-grid-sort-column.js +2 -2
- package/src/vaadin-grid-sort-mixin.js +7 -11
- package/src/vaadin-grid-sorter.d.ts +2 -2
- package/src/vaadin-grid-sorter.js +4 -4
- package/src/vaadin-grid-styles.js +1 -1
- package/src/vaadin-grid-styling-mixin.d.ts +1 -1
- package/src/vaadin-grid-styling-mixin.js +2 -2
- package/src/vaadin-grid-tree-column.js +3 -3
- package/src/vaadin-grid-tree-toggle.d.ts +2 -2
- package/src/vaadin-grid-tree-toggle.js +4 -4
- package/src/vaadin-grid.d.ts +7 -7
- package/src/vaadin-grid.js +50 -45
- package/theme/lumo/vaadin-grid-sorter-styles.js +1 -1
- package/theme/lumo/vaadin-grid-styles.js +2 -2
- package/theme/lumo/vaadin-grid-tree-toggle-styles.js +1 -1
- package/theme/material/vaadin-grid-sorter-styles.js +1 -1
- package/theme/material/vaadin-grid-styles.js +1 -1
- package/theme/material/vaadin-grid-tree-toggle-styles.js +1 -1
|
@@ -42,7 +42,7 @@ class GridSelectionColumn extends GridColumn {
|
|
|
42
42
|
*/
|
|
43
43
|
width: {
|
|
44
44
|
type: String,
|
|
45
|
-
value: '58px'
|
|
45
|
+
value: '58px',
|
|
46
46
|
},
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -52,7 +52,7 @@ class GridSelectionColumn extends GridColumn {
|
|
|
52
52
|
*/
|
|
53
53
|
flexGrow: {
|
|
54
54
|
type: Number,
|
|
55
|
-
value: 0
|
|
55
|
+
value: 0,
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -63,7 +63,7 @@ class GridSelectionColumn extends GridColumn {
|
|
|
63
63
|
selectAll: {
|
|
64
64
|
type: Boolean,
|
|
65
65
|
value: false,
|
|
66
|
-
notify: true
|
|
66
|
+
notify: true,
|
|
67
67
|
},
|
|
68
68
|
|
|
69
69
|
/**
|
|
@@ -73,7 +73,7 @@ class GridSelectionColumn extends GridColumn {
|
|
|
73
73
|
*/
|
|
74
74
|
autoSelect: {
|
|
75
75
|
type: Boolean,
|
|
76
|
-
value: false
|
|
76
|
+
value: false,
|
|
77
77
|
},
|
|
78
78
|
|
|
79
79
|
/** @private */
|
|
@@ -87,14 +87,14 @@ class GridSelectionColumn extends GridColumn {
|
|
|
87
87
|
__previousActiveItem: Object,
|
|
88
88
|
|
|
89
89
|
/** @private */
|
|
90
|
-
__selectAllHidden: Boolean
|
|
90
|
+
__selectAllHidden: Boolean,
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
static get observers() {
|
|
95
95
|
return [
|
|
96
96
|
'__onSelectAllChanged(selectAll)',
|
|
97
|
-
'_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, selectAll, __indeterminate, __selectAllHidden)'
|
|
97
|
+
'_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, selectAll, __indeterminate, __selectAllHidden)',
|
|
98
98
|
];
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -235,7 +235,7 @@ class GridSelectionColumn extends GridColumn {
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
|
-
*
|
|
238
|
+
* IOS needs indeterminate + checked at the same time
|
|
239
239
|
* @private
|
|
240
240
|
*/
|
|
241
241
|
__isChecked(selectAll, indeterminate) {
|
|
@@ -290,7 +290,7 @@ class GridSelectionColumn extends GridColumn {
|
|
|
290
290
|
page: 0,
|
|
291
291
|
pageSize: Infinity,
|
|
292
292
|
sortOrders: [],
|
|
293
|
-
filters: this._grid._mapFilters()
|
|
293
|
+
filters: this._grid._mapFilters(),
|
|
294
294
|
};
|
|
295
295
|
this._grid.dataProvider(params, (items) => callback(items));
|
|
296
296
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
7
|
|
|
8
8
|
export declare function SelectionMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
9
|
-
base: T
|
|
9
|
+
base: T,
|
|
10
10
|
): T & Constructor<SelectionMixinClass<TItem>>;
|
|
11
11
|
|
|
12
12
|
export declare class SelectionMixinClass<TItem> {
|
|
@@ -49,13 +49,13 @@ declare class GridSortColumn<TItem = GridDefaultItem> extends GridColumn<TItem>
|
|
|
49
49
|
addEventListener<K extends keyof GridSortColumnEventMap>(
|
|
50
50
|
type: K,
|
|
51
51
|
listener: (this: GridSortColumn<TItem>, ev: GridSortColumnEventMap[K]) => void,
|
|
52
|
-
options?: boolean | AddEventListenerOptions
|
|
52
|
+
options?: boolean | AddEventListenerOptions,
|
|
53
53
|
): void;
|
|
54
54
|
|
|
55
55
|
removeEventListener<K extends keyof GridSortColumnEventMap>(
|
|
56
56
|
type: K,
|
|
57
57
|
listener: (this: GridSortColumn<TItem>, ev: GridSortColumnEventMap[K]) => void,
|
|
58
|
-
options?: boolean | EventListenerOptions
|
|
58
|
+
options?: boolean | EventListenerOptions,
|
|
59
59
|
): void;
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -18,7 +18,7 @@ export const SortMixin = (superClass) =>
|
|
|
18
18
|
*/
|
|
19
19
|
multiSort: {
|
|
20
20
|
type: Boolean,
|
|
21
|
-
value: false
|
|
21
|
+
value: false,
|
|
22
22
|
},
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -27,18 +27,14 @@ export const SortMixin = (superClass) =>
|
|
|
27
27
|
*/
|
|
28
28
|
_sorters: {
|
|
29
29
|
type: Array,
|
|
30
|
-
value:
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
30
|
+
value: () => [],
|
|
33
31
|
},
|
|
34
32
|
|
|
35
33
|
/** @private */
|
|
36
34
|
_previousSorters: {
|
|
37
35
|
type: Array,
|
|
38
|
-
value:
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
}
|
|
36
|
+
value: () => [],
|
|
37
|
+
},
|
|
42
38
|
};
|
|
43
39
|
}
|
|
44
40
|
|
|
@@ -58,7 +54,7 @@ export const SortMixin = (superClass) =>
|
|
|
58
54
|
|
|
59
55
|
/** @private */
|
|
60
56
|
__removeSorters(sortersToRemove) {
|
|
61
|
-
if (sortersToRemove.length
|
|
57
|
+
if (sortersToRemove.length === 0) {
|
|
62
58
|
return;
|
|
63
59
|
}
|
|
64
60
|
|
|
@@ -89,7 +85,7 @@ export const SortMixin = (superClass) =>
|
|
|
89
85
|
}
|
|
90
86
|
this.__updateSortOrders();
|
|
91
87
|
} else if (sorter.direction) {
|
|
92
|
-
const otherSorters = this._sorters.filter((s) => s
|
|
88
|
+
const otherSorters = this._sorters.filter((s) => s !== sorter);
|
|
93
89
|
this._sorters = [sorter];
|
|
94
90
|
otherSorters.forEach((sorter) => {
|
|
95
91
|
sorter._order = null;
|
|
@@ -122,7 +118,7 @@ export const SortMixin = (superClass) =>
|
|
|
122
118
|
return this._sorters.map((sorter) => {
|
|
123
119
|
return {
|
|
124
120
|
path: sorter.path,
|
|
125
|
-
direction: sorter.direction
|
|
121
|
+
direction: sorter.direction,
|
|
126
122
|
};
|
|
127
123
|
});
|
|
128
124
|
}
|
|
@@ -76,13 +76,13 @@ declare class GridSorter extends ThemableMixin(DirMixin(HTMLElement)) {
|
|
|
76
76
|
addEventListener<K extends keyof GridSorterEventMap>(
|
|
77
77
|
type: K,
|
|
78
78
|
listener: (this: GridSorter, ev: GridSorterEventMap[K]) => void,
|
|
79
|
-
options?: boolean | AddEventListenerOptions
|
|
79
|
+
options?: boolean | AddEventListenerOptions,
|
|
80
80
|
): void;
|
|
81
81
|
|
|
82
82
|
removeEventListener<K extends keyof GridSorterEventMap>(
|
|
83
83
|
type: K,
|
|
84
84
|
listener: (this: GridSorter, ev: GridSorterEventMap[K]) => void,
|
|
85
|
-
options?: boolean | EventListenerOptions
|
|
85
|
+
options?: boolean | EventListenerOptions,
|
|
86
86
|
): void;
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -136,7 +136,7 @@ class GridSorter extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
136
136
|
type: String,
|
|
137
137
|
reflectToAttribute: true,
|
|
138
138
|
notify: true,
|
|
139
|
-
value: null
|
|
139
|
+
value: null,
|
|
140
140
|
},
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -145,14 +145,14 @@ class GridSorter extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
145
145
|
*/
|
|
146
146
|
_order: {
|
|
147
147
|
type: Number,
|
|
148
|
-
value: null
|
|
148
|
+
value: null,
|
|
149
149
|
},
|
|
150
150
|
|
|
151
151
|
/** @private */
|
|
152
152
|
_isConnected: {
|
|
153
153
|
type: Boolean,
|
|
154
|
-
observer: '__isConnectedChanged'
|
|
155
|
-
}
|
|
154
|
+
observer: '__isConnectedChanged',
|
|
155
|
+
},
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -10,7 +10,7 @@ import { GridColumn } from './vaadin-grid-column.js';
|
|
|
10
10
|
export type GridCellClassNameGenerator<TItem> = (column: GridColumn<TItem>, model: GridItemModel<TItem>) => string;
|
|
11
11
|
|
|
12
12
|
export declare function StylingMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
13
|
-
base: T
|
|
13
|
+
base: T,
|
|
14
14
|
): T & Constructor<StylingMixinClass<TItem>>;
|
|
15
15
|
|
|
16
16
|
export declare class StylingMixinClass<TItem> {
|
|
@@ -29,7 +29,7 @@ export const StylingMixin = (superClass) =>
|
|
|
29
29
|
*
|
|
30
30
|
* @type {GridCellClassNameGenerator | null | undefined}
|
|
31
31
|
*/
|
|
32
|
-
cellClassNameGenerator: Function
|
|
32
|
+
cellClassNameGenerator: Function,
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -49,7 +49,7 @@ export const StylingMixin = (superClass) =>
|
|
|
49
49
|
*/
|
|
50
50
|
generateCellClassNames() {
|
|
51
51
|
Array.from(this.$.items.children)
|
|
52
|
-
.filter((row) => !row.hidden)
|
|
52
|
+
.filter((row) => !row.hidden && !row.hasAttribute('loading'))
|
|
53
53
|
.forEach((row) => this._generateCellClassNames(row, this.__getRowModel(row)));
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -38,8 +38,8 @@ class GridTreeColumn extends GridColumn {
|
|
|
38
38
|
*/
|
|
39
39
|
itemHasChildrenPath: {
|
|
40
40
|
type: String,
|
|
41
|
-
observer: '_itemHasChildrenPathChanged'
|
|
42
|
-
}
|
|
41
|
+
observer: '_itemHasChildrenPathChanged',
|
|
42
|
+
},
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -89,7 +89,7 @@ class GridTreeColumn extends GridColumn {
|
|
|
89
89
|
_itemHasChildrenPathChanged(itemHasChildrenPath) {
|
|
90
90
|
if (itemHasChildrenPath) {
|
|
91
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
|
|
92
|
+
`WARNING: Since Vaadin 23, itemHasChildrenPath on <vaadin-grid-tree-column> is deprecated. Please set this property on the <vaadin-grid> instead.`,
|
|
93
93
|
);
|
|
94
94
|
|
|
95
95
|
if (this._grid) {
|
|
@@ -85,13 +85,13 @@ declare class GridTreeToggle extends ThemableMixin(DirMixin(HTMLElement)) {
|
|
|
85
85
|
addEventListener<K extends keyof GridTreeToggleEventMap>(
|
|
86
86
|
type: K,
|
|
87
87
|
listener: (this: GridTreeToggle, ev: GridTreeToggleEventMap[K]) => void,
|
|
88
|
-
options?: boolean | AddEventListenerOptions
|
|
88
|
+
options?: boolean | AddEventListenerOptions,
|
|
89
89
|
): void;
|
|
90
90
|
|
|
91
91
|
removeEventListener<K extends keyof GridTreeToggleEventMap>(
|
|
92
92
|
type: K,
|
|
93
93
|
listener: (this: GridTreeToggle, ev: GridTreeToggleEventMap[K]) => void,
|
|
94
|
-
options?: boolean | EventListenerOptions
|
|
94
|
+
options?: boolean | EventListenerOptions,
|
|
95
95
|
): void;
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -154,7 +154,7 @@ class GridTreeToggle extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
154
154
|
level: {
|
|
155
155
|
type: Number,
|
|
156
156
|
value: 0,
|
|
157
|
-
observer: '_levelChanged'
|
|
157
|
+
observer: '_levelChanged',
|
|
158
158
|
},
|
|
159
159
|
|
|
160
160
|
/**
|
|
@@ -164,7 +164,7 @@ class GridTreeToggle extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
164
164
|
leaf: {
|
|
165
165
|
type: Boolean,
|
|
166
166
|
value: false,
|
|
167
|
-
reflectToAttribute: true
|
|
167
|
+
reflectToAttribute: true,
|
|
168
168
|
},
|
|
169
169
|
|
|
170
170
|
/**
|
|
@@ -175,8 +175,8 @@ class GridTreeToggle extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
175
175
|
type: Boolean,
|
|
176
176
|
value: false,
|
|
177
177
|
reflectToAttribute: true,
|
|
178
|
-
notify: true
|
|
179
|
-
}
|
|
178
|
+
notify: true,
|
|
179
|
+
},
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
182
|
|
package/src/vaadin-grid.d.ts
CHANGED
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
GridDataProviderParams,
|
|
18
18
|
GridFilterDefinition,
|
|
19
19
|
GridSorterDefinition,
|
|
20
|
-
GridSorterDirection
|
|
20
|
+
GridSorterDirection,
|
|
21
21
|
} from './vaadin-grid-data-provider-mixin.js';
|
|
22
22
|
import {
|
|
23
23
|
DragAndDropMixinClass,
|
|
24
24
|
GridDragAndDropFilter,
|
|
25
25
|
GridDropLocation,
|
|
26
|
-
GridDropMode
|
|
26
|
+
GridDropMode,
|
|
27
27
|
} from './vaadin-grid-drag-and-drop-mixin.js';
|
|
28
28
|
import { EventContextMixinClass, GridEventContext } from './vaadin-grid-event-context-mixin.js';
|
|
29
29
|
import { GridRowDetailsRenderer, RowDetailsMixinClass } from './vaadin-grid-row-details-mixin.js';
|
|
@@ -46,7 +46,7 @@ export {
|
|
|
46
46
|
GridHeaderFooterRenderer,
|
|
47
47
|
GridRowDetailsRenderer,
|
|
48
48
|
GridSorterDefinition,
|
|
49
|
-
GridSorterDirection
|
|
49
|
+
GridSorterDirection,
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
export type GridDefaultItem = any;
|
|
@@ -95,8 +95,8 @@ export type GridExpandedItemsChangedEvent<TItem> = CustomEvent<{ value: TItem[]
|
|
|
95
95
|
*/
|
|
96
96
|
export type GridDragStartEvent<TItem> = CustomEvent<{
|
|
97
97
|
draggedItems: TItem[];
|
|
98
|
-
setDraggedItemsCount
|
|
99
|
-
setDragData
|
|
98
|
+
setDraggedItemsCount(count: number): void;
|
|
99
|
+
setDragData(type: string, data: string): void;
|
|
100
100
|
}>;
|
|
101
101
|
|
|
102
102
|
/**
|
|
@@ -379,13 +379,13 @@ declare class Grid<TItem = GridDefaultItem> extends HTMLElement {
|
|
|
379
379
|
addEventListener<K extends keyof GridEventMap<TItem>>(
|
|
380
380
|
type: K,
|
|
381
381
|
listener: (this: Grid<TItem>, ev: GridEventMap<TItem>[K]) => void,
|
|
382
|
-
options?: boolean | AddEventListenerOptions
|
|
382
|
+
options?: boolean | AddEventListenerOptions,
|
|
383
383
|
): void;
|
|
384
384
|
|
|
385
385
|
removeEventListener<K extends keyof GridEventMap<TItem>>(
|
|
386
386
|
type: K,
|
|
387
387
|
listener: (this: Grid<TItem>, ev: GridEventMap<TItem>[K]) => void,
|
|
388
|
-
options?: boolean | EventListenerOptions
|
|
388
|
+
options?: boolean | EventListenerOptions,
|
|
389
389
|
): void;
|
|
390
390
|
}
|
|
391
391
|
|
package/src/vaadin-grid.js
CHANGED
|
@@ -258,21 +258,21 @@ class Grid extends ElementMixin(
|
|
|
258
258
|
FilterMixin(
|
|
259
259
|
ColumnReorderingMixin(
|
|
260
260
|
ColumnResizingMixin(
|
|
261
|
-
EventContextMixin(DragAndDropMixin(StylingMixin(TabindexMixin(PolymerElement))))
|
|
262
|
-
)
|
|
263
|
-
)
|
|
264
|
-
)
|
|
265
|
-
)
|
|
266
|
-
)
|
|
267
|
-
)
|
|
268
|
-
)
|
|
269
|
-
)
|
|
270
|
-
)
|
|
271
|
-
)
|
|
272
|
-
)
|
|
273
|
-
)
|
|
274
|
-
)
|
|
275
|
-
)
|
|
261
|
+
EventContextMixin(DragAndDropMixin(StylingMixin(TabindexMixin(PolymerElement)))),
|
|
262
|
+
),
|
|
263
|
+
),
|
|
264
|
+
),
|
|
265
|
+
),
|
|
266
|
+
),
|
|
267
|
+
),
|
|
268
|
+
),
|
|
269
|
+
),
|
|
270
|
+
),
|
|
271
|
+
),
|
|
272
|
+
),
|
|
273
|
+
),
|
|
274
|
+
),
|
|
275
|
+
),
|
|
276
276
|
) {
|
|
277
277
|
static get template() {
|
|
278
278
|
return html`
|
|
@@ -304,7 +304,7 @@ class Grid extends ElementMixin(
|
|
|
304
304
|
static get observers() {
|
|
305
305
|
return [
|
|
306
306
|
'_columnTreeChanged(_columnTree, _columnTree.*)',
|
|
307
|
-
'_effectiveSizeChanged(_effectiveSize, __virtualizer, _hasData, _columnTree)'
|
|
307
|
+
'_effectiveSizeChanged(_effectiveSize, __virtualizer, _hasData, _columnTree)',
|
|
308
308
|
];
|
|
309
309
|
}
|
|
310
310
|
|
|
@@ -313,31 +313,31 @@ class Grid extends ElementMixin(
|
|
|
313
313
|
/** @private */
|
|
314
314
|
_safari: {
|
|
315
315
|
type: Boolean,
|
|
316
|
-
value: isSafari
|
|
316
|
+
value: isSafari,
|
|
317
317
|
},
|
|
318
318
|
|
|
319
319
|
/** @private */
|
|
320
320
|
_ios: {
|
|
321
321
|
type: Boolean,
|
|
322
|
-
value: isIOS
|
|
322
|
+
value: isIOS,
|
|
323
323
|
},
|
|
324
324
|
|
|
325
325
|
/** @private */
|
|
326
326
|
_firefox: {
|
|
327
327
|
type: Boolean,
|
|
328
|
-
value: isFirefox
|
|
328
|
+
value: isFirefox,
|
|
329
329
|
},
|
|
330
330
|
|
|
331
331
|
/** @private */
|
|
332
332
|
_android: {
|
|
333
333
|
type: Boolean,
|
|
334
|
-
value: isAndroid
|
|
334
|
+
value: isAndroid,
|
|
335
335
|
},
|
|
336
336
|
|
|
337
337
|
/** @private */
|
|
338
338
|
_touchDevice: {
|
|
339
339
|
type: Boolean,
|
|
340
|
-
value: isTouch
|
|
340
|
+
value: isTouch,
|
|
341
341
|
},
|
|
342
342
|
|
|
343
343
|
/**
|
|
@@ -351,18 +351,18 @@ class Grid extends ElementMixin(
|
|
|
351
351
|
allRowsVisible: {
|
|
352
352
|
type: Boolean,
|
|
353
353
|
value: false,
|
|
354
|
-
reflectToAttribute: true
|
|
354
|
+
reflectToAttribute: true,
|
|
355
355
|
},
|
|
356
356
|
|
|
357
357
|
/** @private */
|
|
358
358
|
_recalculateColumnWidthOnceLoadingFinished: {
|
|
359
359
|
type: Boolean,
|
|
360
|
-
value: true
|
|
360
|
+
value: true,
|
|
361
361
|
},
|
|
362
362
|
|
|
363
363
|
/** @private */
|
|
364
364
|
isAttached: {
|
|
365
|
-
value: false
|
|
365
|
+
value: false,
|
|
366
366
|
},
|
|
367
367
|
|
|
368
368
|
/**
|
|
@@ -373,8 +373,8 @@ class Grid extends ElementMixin(
|
|
|
373
373
|
*/
|
|
374
374
|
__gridElement: {
|
|
375
375
|
type: Boolean,
|
|
376
|
-
value: true
|
|
377
|
-
}
|
|
376
|
+
value: true,
|
|
377
|
+
},
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
380
|
|
|
@@ -447,7 +447,7 @@ class Grid extends ElementMixin(
|
|
|
447
447
|
updateElement: this._updateScrollerItem.bind(this),
|
|
448
448
|
scrollContainer: this.$.items,
|
|
449
449
|
scrollTarget: this.$.table,
|
|
450
|
-
reorderElements: true
|
|
450
|
+
reorderElements: true,
|
|
451
451
|
});
|
|
452
452
|
|
|
453
453
|
new ResizeObserver(() => setTimeout(() => this.__updateFooterPositioning())).observe(this.$.footer);
|
|
@@ -473,7 +473,7 @@ class Grid extends ElementMixin(
|
|
|
473
473
|
if (this.$.items.contains(cell) && cell.localName === 'td') {
|
|
474
474
|
return {
|
|
475
475
|
item: cell.parentElement._item,
|
|
476
|
-
column: cell._column
|
|
476
|
+
column: cell._column,
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
479
|
}
|
|
@@ -482,7 +482,9 @@ class Grid extends ElementMixin(
|
|
|
482
482
|
__focusBodyCell({ item, column }) {
|
|
483
483
|
const row = this._getVisibleRows().find((row) => row._item === item);
|
|
484
484
|
const cell = row && [...row.children].find((cell) => cell._column === column);
|
|
485
|
-
|
|
485
|
+
if (cell) {
|
|
486
|
+
cell.focus();
|
|
487
|
+
}
|
|
486
488
|
}
|
|
487
489
|
|
|
488
490
|
/** @private */
|
|
@@ -497,7 +499,9 @@ class Grid extends ElementMixin(
|
|
|
497
499
|
virtualizer.flush();
|
|
498
500
|
|
|
499
501
|
// If the focused cell's parent row got hidden by the size change, focus the corresponding new cell
|
|
500
|
-
cellCoordinates && cell.parentElement.hidden
|
|
502
|
+
if (cellCoordinates && cell.parentElement.hidden) {
|
|
503
|
+
this.__focusBodyCell(cellCoordinates);
|
|
504
|
+
}
|
|
501
505
|
|
|
502
506
|
// Make sure the body has a tabbable element
|
|
503
507
|
this._resetKeyboardNavigation();
|
|
@@ -554,7 +558,7 @@ class Grid extends ElementMixin(
|
|
|
554
558
|
|
|
555
559
|
const columnWidth = Math.max(this.__getIntrinsicWidth(col), this.__getDistributedWidth(col.parentElement, col));
|
|
556
560
|
|
|
557
|
-
//
|
|
561
|
+
// We're processing a regular grid-column and not a grid-column-group
|
|
558
562
|
if (!innerColumn) {
|
|
559
563
|
return columnWidth;
|
|
560
564
|
}
|
|
@@ -626,7 +630,7 @@ class Grid extends ElementMixin(
|
|
|
626
630
|
|
|
627
631
|
if (this._columnTree) {
|
|
628
632
|
this._columnTree[this._columnTree.length - 1].forEach(
|
|
629
|
-
(c) => c.isConnected && c.notifyPath && c.notifyPath('_cells.*', c._cells)
|
|
633
|
+
(c) => c.isConnected && c.notifyPath && c.notifyPath('_cells.*', c._cells),
|
|
630
634
|
);
|
|
631
635
|
}
|
|
632
636
|
|
|
@@ -642,7 +646,7 @@ class Grid extends ElementMixin(
|
|
|
642
646
|
/** @private */
|
|
643
647
|
_createCell(tagName) {
|
|
644
648
|
const contentId = (this._contentIndex = this._contentIndex + 1 || 0);
|
|
645
|
-
const slotName =
|
|
649
|
+
const slotName = `vaadin-grid-cell-content-${contentId}`;
|
|
646
650
|
|
|
647
651
|
const cellContent = document.createElement('vaadin-grid-cell-content');
|
|
648
652
|
cellContent.setAttribute('slot', slotName);
|
|
@@ -669,7 +673,7 @@ class Grid extends ElementMixin(
|
|
|
669
673
|
// If focus is on element within the cell content — respect it, do not change
|
|
670
674
|
const contentContainsFocusedElement = cellContent.contains(this.getRootNode().activeElement);
|
|
671
675
|
// Only focus if mouse is released on cell content itself
|
|
672
|
-
const mouseUpWithinCell =
|
|
676
|
+
const mouseUpWithinCell = event.composedPath().includes(cellContent);
|
|
673
677
|
if (!contentContainsFocusedElement && mouseUpWithinCell) {
|
|
674
678
|
cell.focus();
|
|
675
679
|
}
|
|
@@ -850,7 +854,7 @@ class Grid extends ElementMixin(
|
|
|
850
854
|
*/
|
|
851
855
|
_renderColumnTree(columnTree) {
|
|
852
856
|
Array.from(this.$.items.children).forEach((row) =>
|
|
853
|
-
this._updateRow(row, columnTree[columnTree.length - 1], null, false, true)
|
|
857
|
+
this._updateRow(row, columnTree[columnTree.length - 1], null, false, true),
|
|
854
858
|
);
|
|
855
859
|
|
|
856
860
|
while (this.$.header.children.length < columnTree.length) {
|
|
@@ -872,11 +876,11 @@ class Grid extends ElementMixin(
|
|
|
872
876
|
}
|
|
873
877
|
|
|
874
878
|
Array.from(this.$.header.children).forEach((headerRow, index) =>
|
|
875
|
-
this._updateRow(headerRow, columnTree[index], 'header', index === columnTree.length - 1)
|
|
879
|
+
this._updateRow(headerRow, columnTree[index], 'header', index === columnTree.length - 1),
|
|
876
880
|
);
|
|
877
881
|
|
|
878
882
|
Array.from(this.$.footer.children).forEach((footerRow, index) =>
|
|
879
|
-
this._updateRow(footerRow, columnTree[columnTree.length - 1 - index], 'footer', index === 0)
|
|
883
|
+
this._updateRow(footerRow, columnTree[columnTree.length - 1 - index], 'footer', index === 0),
|
|
880
884
|
);
|
|
881
885
|
|
|
882
886
|
// Sizer rows
|
|
@@ -893,7 +897,8 @@ class Grid extends ElementMixin(
|
|
|
893
897
|
}
|
|
894
898
|
|
|
895
899
|
__updateFooterPositioning() {
|
|
896
|
-
|
|
900
|
+
// TODO: fixed in Firefox 99, remove when we can drop Firefox ESR 91 support
|
|
901
|
+
if (this._firefox && parseFloat(navigator.userAgent.match(/Firefox\/(\d{2,3}.\d)/)[1]) < 99) {
|
|
897
902
|
// Sticky (or translated) footer in a flexbox host doesn't get included in
|
|
898
903
|
// the scroll height calculation on FF. This is a workaround for the issue.
|
|
899
904
|
this.$.items.style.paddingBottom = 0;
|
|
@@ -952,8 +957,6 @@ class Grid extends ElementMixin(
|
|
|
952
957
|
|
|
953
958
|
requestAnimationFrame(() => {
|
|
954
959
|
this.__scrollToPendingIndex();
|
|
955
|
-
// This needs to be set programmatically in order to avoid an iOS 10 bug (disappearing grid)
|
|
956
|
-
this.$.table.style.webkitOverflowScrolling = 'touch';
|
|
957
960
|
});
|
|
958
961
|
}
|
|
959
962
|
}
|
|
@@ -970,7 +973,7 @@ class Grid extends ElementMixin(
|
|
|
970
973
|
level: this._getIndexLevel(row.index),
|
|
971
974
|
expanded: this._isExpanded(row._item),
|
|
972
975
|
selected: this._isSelected(row._item),
|
|
973
|
-
detailsOpened: !!this.rowDetailsRenderer && this._isDetailsOpened(row._item)
|
|
976
|
+
detailsOpened: !!this.rowDetailsRenderer && this._isDetailsOpened(row._item),
|
|
974
977
|
};
|
|
975
978
|
}
|
|
976
979
|
|
|
@@ -987,21 +990,23 @@ class Grid extends ElementMixin(
|
|
|
987
990
|
*/
|
|
988
991
|
requestContentUpdate() {
|
|
989
992
|
if (this._columnTree) {
|
|
990
|
-
//
|
|
993
|
+
// Header and footer renderers
|
|
991
994
|
this._columnTree.forEach((level) => {
|
|
992
995
|
level.forEach((column) => {
|
|
993
996
|
column._renderHeaderAndFooter();
|
|
994
997
|
});
|
|
995
998
|
});
|
|
996
999
|
|
|
997
|
-
//
|
|
1000
|
+
// Body and row details renderers
|
|
998
1001
|
this.__updateVisibleRows();
|
|
999
1002
|
}
|
|
1000
1003
|
}
|
|
1001
1004
|
|
|
1002
1005
|
/** @protected */
|
|
1003
1006
|
__updateVisibleRows(start, end) {
|
|
1004
|
-
|
|
1007
|
+
if (this.__virtualizer) {
|
|
1008
|
+
this.__virtualizer.update(start, end);
|
|
1009
|
+
}
|
|
1005
1010
|
}
|
|
1006
1011
|
|
|
1007
1012
|
/**
|
|
@@ -1015,7 +1020,7 @@ class Grid extends ElementMixin(
|
|
|
1015
1020
|
*/
|
|
1016
1021
|
notifyResize() {
|
|
1017
1022
|
console.warn(
|
|
1018
|
-
`WARNING: Since Vaadin 22, notifyResize() is deprecated. The component uses a ResizeObserver internally and doesn't need to be explicitly notified of resizes
|
|
1023
|
+
`WARNING: Since Vaadin 22, notifyResize() is deprecated. The component uses a ResizeObserver internally and doesn't need to be explicitly notified of resizes.`,
|
|
1019
1024
|
);
|
|
1020
1025
|
}
|
|
1021
1026
|
}
|
|
@@ -393,7 +393,7 @@ registerStyles(
|
|
|
393
393
|
border-right-color: var(--_lumo-grid-border-color);
|
|
394
394
|
}
|
|
395
395
|
`,
|
|
396
|
-
{ moduleId: 'lumo-grid' }
|
|
396
|
+
{ moduleId: 'lumo-grid' },
|
|
397
397
|
);
|
|
398
398
|
|
|
399
399
|
registerStyles(
|
|
@@ -403,5 +403,5 @@ registerStyles(
|
|
|
403
403
|
font-size: var(--lumo-font-size-m);
|
|
404
404
|
}
|
|
405
405
|
`,
|
|
406
|
-
{ moduleId: 'vaadin-grid-select-all-checkbox-lumo' }
|
|
406
|
+
{ moduleId: 'vaadin-grid-select-all-checkbox-lumo' },
|
|
407
407
|
);
|