@vaadin/grid 23.1.0-alpha1 → 23.1.0-alpha4
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 -10
- 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 +22 -21
- package/src/vaadin-grid-column-reordering-mixin.d.ts +1 -1
- package/src/vaadin-grid-column-reordering-mixin.js +10 -10
- 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 +38 -27
- package/src/vaadin-grid-data-provider-mixin.d.ts +2 -2
- package/src/vaadin-grid-data-provider-mixin.js +15 -15
- 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 -4
- package/src/vaadin-grid-filter.d.ts +2 -2
- package/src/vaadin-grid-filter.js +2 -2
- package/src/vaadin-grid-keyboard-navigation-mixin.js +15 -15
- package/src/vaadin-grid-row-details-mixin.d.ts +2 -2
- package/src/vaadin-grid-row-details-mixin.js +4 -4
- package/src/vaadin-grid-scroll-mixin.js +7 -7
- package/src/vaadin-grid-selection-column.d.ts +2 -2
- package/src/vaadin-grid-selection-column.js +7 -7
- 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 -7
- 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 +1 -1
- 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 +5 -5
- package/src/vaadin-grid.js +45 -63
- 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
|
@@ -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
|
/**
|
|
@@ -29,7 +29,7 @@ export const SortMixin = (superClass) =>
|
|
|
29
29
|
type: Array,
|
|
30
30
|
value: function () {
|
|
31
31
|
return [];
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
/** @private */
|
|
@@ -37,8 +37,8 @@ export const SortMixin = (superClass) =>
|
|
|
37
37
|
type: Array,
|
|
38
38
|
value: function () {
|
|
39
39
|
return [];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -58,7 +58,7 @@ export const SortMixin = (superClass) =>
|
|
|
58
58
|
|
|
59
59
|
/** @private */
|
|
60
60
|
__removeSorters(sortersToRemove) {
|
|
61
|
-
if (sortersToRemove.length
|
|
61
|
+
if (sortersToRemove.length === 0) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -89,7 +89,7 @@ export const SortMixin = (superClass) =>
|
|
|
89
89
|
}
|
|
90
90
|
this.__updateSortOrders();
|
|
91
91
|
} else if (sorter.direction) {
|
|
92
|
-
const otherSorters = this._sorters.filter((s) => s
|
|
92
|
+
const otherSorters = this._sorters.filter((s) => s !== sorter);
|
|
93
93
|
this._sorters = [sorter];
|
|
94
94
|
otherSorters.forEach((sorter) => {
|
|
95
95
|
sorter._order = null;
|
|
@@ -122,7 +122,7 @@ export const SortMixin = (superClass) =>
|
|
|
122
122
|
return this._sorters.map((sorter) => {
|
|
123
123
|
return {
|
|
124
124
|
path: sorter.path,
|
|
125
|
-
direction: sorter.direction
|
|
125
|
+
direction: sorter.direction,
|
|
126
126
|
};
|
|
127
127
|
});
|
|
128
128
|
}
|
|
@@ -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> {
|
|
@@ -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;
|
|
@@ -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,36 +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
|
|
341
|
-
},
|
|
342
|
-
|
|
343
|
-
/** @protected */
|
|
344
|
-
tabindex: {
|
|
345
|
-
value: undefined
|
|
340
|
+
value: isTouch,
|
|
346
341
|
},
|
|
347
342
|
|
|
348
343
|
/**
|
|
@@ -356,18 +351,18 @@ class Grid extends ElementMixin(
|
|
|
356
351
|
allRowsVisible: {
|
|
357
352
|
type: Boolean,
|
|
358
353
|
value: false,
|
|
359
|
-
reflectToAttribute: true
|
|
354
|
+
reflectToAttribute: true,
|
|
360
355
|
},
|
|
361
356
|
|
|
362
357
|
/** @private */
|
|
363
358
|
_recalculateColumnWidthOnceLoadingFinished: {
|
|
364
359
|
type: Boolean,
|
|
365
|
-
value: true
|
|
360
|
+
value: true,
|
|
366
361
|
},
|
|
367
362
|
|
|
368
363
|
/** @private */
|
|
369
364
|
isAttached: {
|
|
370
|
-
value: false
|
|
365
|
+
value: false,
|
|
371
366
|
},
|
|
372
367
|
|
|
373
368
|
/**
|
|
@@ -378,8 +373,8 @@ class Grid extends ElementMixin(
|
|
|
378
373
|
*/
|
|
379
374
|
__gridElement: {
|
|
380
375
|
type: Boolean,
|
|
381
|
-
value: true
|
|
382
|
-
}
|
|
376
|
+
value: true,
|
|
377
|
+
},
|
|
383
378
|
};
|
|
384
379
|
}
|
|
385
380
|
|
|
@@ -452,7 +447,7 @@ class Grid extends ElementMixin(
|
|
|
452
447
|
updateElement: this._updateScrollerItem.bind(this),
|
|
453
448
|
scrollContainer: this.$.items,
|
|
454
449
|
scrollTarget: this.$.table,
|
|
455
|
-
reorderElements: true
|
|
450
|
+
reorderElements: true,
|
|
456
451
|
});
|
|
457
452
|
|
|
458
453
|
new ResizeObserver(() => setTimeout(() => this.__updateFooterPositioning())).observe(this.$.footer);
|
|
@@ -473,29 +468,12 @@ class Grid extends ElementMixin(
|
|
|
473
468
|
}
|
|
474
469
|
}
|
|
475
470
|
|
|
476
|
-
/**
|
|
477
|
-
* Override an observer from `DisabledMixin` to not
|
|
478
|
-
* set `tabindex` on the grid when it is re-enabled.
|
|
479
|
-
*
|
|
480
|
-
* @param {boolean} disabled
|
|
481
|
-
* @param {boolean} oldDisabled
|
|
482
|
-
* @protected
|
|
483
|
-
* @override
|
|
484
|
-
*/
|
|
485
|
-
_disabledChanged(disabled, oldDisabled) {
|
|
486
|
-
super._disabledChanged(disabled, oldDisabled);
|
|
487
|
-
|
|
488
|
-
if (oldDisabled) {
|
|
489
|
-
this.removeAttribute('tabindex');
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
471
|
/** @private */
|
|
494
472
|
__getBodyCellCoordinates(cell) {
|
|
495
473
|
if (this.$.items.contains(cell) && cell.localName === 'td') {
|
|
496
474
|
return {
|
|
497
475
|
item: cell.parentElement._item,
|
|
498
|
-
column: cell._column
|
|
476
|
+
column: cell._column,
|
|
499
477
|
};
|
|
500
478
|
}
|
|
501
479
|
}
|
|
@@ -504,7 +482,9 @@ class Grid extends ElementMixin(
|
|
|
504
482
|
__focusBodyCell({ item, column }) {
|
|
505
483
|
const row = this._getVisibleRows().find((row) => row._item === item);
|
|
506
484
|
const cell = row && [...row.children].find((cell) => cell._column === column);
|
|
507
|
-
|
|
485
|
+
if (cell) {
|
|
486
|
+
cell.focus();
|
|
487
|
+
}
|
|
508
488
|
}
|
|
509
489
|
|
|
510
490
|
/** @private */
|
|
@@ -519,7 +499,9 @@ class Grid extends ElementMixin(
|
|
|
519
499
|
virtualizer.flush();
|
|
520
500
|
|
|
521
501
|
// If the focused cell's parent row got hidden by the size change, focus the corresponding new cell
|
|
522
|
-
cellCoordinates && cell.parentElement.hidden
|
|
502
|
+
if (cellCoordinates && cell.parentElement.hidden) {
|
|
503
|
+
this.__focusBodyCell(cellCoordinates);
|
|
504
|
+
}
|
|
523
505
|
|
|
524
506
|
// Make sure the body has a tabbable element
|
|
525
507
|
this._resetKeyboardNavigation();
|
|
@@ -648,7 +630,7 @@ class Grid extends ElementMixin(
|
|
|
648
630
|
|
|
649
631
|
if (this._columnTree) {
|
|
650
632
|
this._columnTree[this._columnTree.length - 1].forEach(
|
|
651
|
-
(c) => c.isConnected && c.notifyPath && c.notifyPath('_cells.*', c._cells)
|
|
633
|
+
(c) => c.isConnected && c.notifyPath && c.notifyPath('_cells.*', c._cells),
|
|
652
634
|
);
|
|
653
635
|
}
|
|
654
636
|
|
|
@@ -664,7 +646,7 @@ class Grid extends ElementMixin(
|
|
|
664
646
|
/** @private */
|
|
665
647
|
_createCell(tagName) {
|
|
666
648
|
const contentId = (this._contentIndex = this._contentIndex + 1 || 0);
|
|
667
|
-
const slotName =
|
|
649
|
+
const slotName = `vaadin-grid-cell-content-${contentId}`;
|
|
668
650
|
|
|
669
651
|
const cellContent = document.createElement('vaadin-grid-cell-content');
|
|
670
652
|
cellContent.setAttribute('slot', slotName);
|
|
@@ -691,7 +673,7 @@ class Grid extends ElementMixin(
|
|
|
691
673
|
// If focus is on element within the cell content — respect it, do not change
|
|
692
674
|
const contentContainsFocusedElement = cellContent.contains(this.getRootNode().activeElement);
|
|
693
675
|
// Only focus if mouse is released on cell content itself
|
|
694
|
-
const mouseUpWithinCell =
|
|
676
|
+
const mouseUpWithinCell = event.composedPath().includes(cellContent);
|
|
695
677
|
if (!contentContainsFocusedElement && mouseUpWithinCell) {
|
|
696
678
|
cell.focus();
|
|
697
679
|
}
|
|
@@ -872,7 +854,7 @@ class Grid extends ElementMixin(
|
|
|
872
854
|
*/
|
|
873
855
|
_renderColumnTree(columnTree) {
|
|
874
856
|
Array.from(this.$.items.children).forEach((row) =>
|
|
875
|
-
this._updateRow(row, columnTree[columnTree.length - 1], null, false, true)
|
|
857
|
+
this._updateRow(row, columnTree[columnTree.length - 1], null, false, true),
|
|
876
858
|
);
|
|
877
859
|
|
|
878
860
|
while (this.$.header.children.length < columnTree.length) {
|
|
@@ -894,11 +876,11 @@ class Grid extends ElementMixin(
|
|
|
894
876
|
}
|
|
895
877
|
|
|
896
878
|
Array.from(this.$.header.children).forEach((headerRow, index) =>
|
|
897
|
-
this._updateRow(headerRow, columnTree[index], 'header', index === columnTree.length - 1)
|
|
879
|
+
this._updateRow(headerRow, columnTree[index], 'header', index === columnTree.length - 1),
|
|
898
880
|
);
|
|
899
881
|
|
|
900
882
|
Array.from(this.$.footer.children).forEach((footerRow, index) =>
|
|
901
|
-
this._updateRow(footerRow, columnTree[columnTree.length - 1 - index], 'footer', index === 0)
|
|
883
|
+
this._updateRow(footerRow, columnTree[columnTree.length - 1 - index], 'footer', index === 0),
|
|
902
884
|
);
|
|
903
885
|
|
|
904
886
|
// Sizer rows
|
|
@@ -974,8 +956,6 @@ class Grid extends ElementMixin(
|
|
|
974
956
|
|
|
975
957
|
requestAnimationFrame(() => {
|
|
976
958
|
this.__scrollToPendingIndex();
|
|
977
|
-
// This needs to be set programmatically in order to avoid an iOS 10 bug (disappearing grid)
|
|
978
|
-
this.$.table.style.webkitOverflowScrolling = 'touch';
|
|
979
959
|
});
|
|
980
960
|
}
|
|
981
961
|
}
|
|
@@ -992,7 +972,7 @@ class Grid extends ElementMixin(
|
|
|
992
972
|
level: this._getIndexLevel(row.index),
|
|
993
973
|
expanded: this._isExpanded(row._item),
|
|
994
974
|
selected: this._isSelected(row._item),
|
|
995
|
-
detailsOpened: !!this.rowDetailsRenderer && this._isDetailsOpened(row._item)
|
|
975
|
+
detailsOpened: !!this.rowDetailsRenderer && this._isDetailsOpened(row._item),
|
|
996
976
|
};
|
|
997
977
|
}
|
|
998
978
|
|
|
@@ -1023,7 +1003,9 @@ class Grid extends ElementMixin(
|
|
|
1023
1003
|
|
|
1024
1004
|
/** @protected */
|
|
1025
1005
|
__updateVisibleRows(start, end) {
|
|
1026
|
-
|
|
1006
|
+
if (this.__virtualizer) {
|
|
1007
|
+
this.__virtualizer.update(start, end);
|
|
1008
|
+
}
|
|
1027
1009
|
}
|
|
1028
1010
|
|
|
1029
1011
|
/**
|
|
@@ -1037,7 +1019,7 @@ class Grid extends ElementMixin(
|
|
|
1037
1019
|
*/
|
|
1038
1020
|
notifyResize() {
|
|
1039
1021
|
console.warn(
|
|
1040
|
-
`WARNING: Since Vaadin 22, notifyResize() is deprecated. The component uses a ResizeObserver internally and doesn't need to be explicitly notified of resizes
|
|
1022
|
+
`WARNING: Since Vaadin 22, notifyResize() is deprecated. The component uses a ResizeObserver internally and doesn't need to be explicitly notified of resizes.`,
|
|
1041
1023
|
);
|
|
1042
1024
|
}
|
|
1043
1025
|
}
|
|
@@ -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
|
);
|