@vaadin/grid 23.2.0-alpha2 → 23.2.0-alpha5
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 +17 -11
- package/src/array-data-provider.js +3 -5
- package/src/lit/column-renderer-directives.d.ts +7 -6
- package/src/lit/renderer-directives.d.ts +3 -3
- package/src/vaadin-grid-active-item-mixin.d.ts +2 -2
- package/src/vaadin-grid-array-data-provider-mixin.d.ts +2 -2
- package/src/vaadin-grid-column-group.d.ts +2 -2
- package/src/vaadin-grid-column-group.js +22 -7
- package/src/vaadin-grid-column-reordering-mixin.d.ts +2 -2
- package/src/vaadin-grid-column-reordering-mixin.js +9 -3
- package/src/vaadin-grid-column.d.ts +4 -4
- package/src/vaadin-grid-column.js +9 -3
- package/src/vaadin-grid-data-provider-mixin.d.ts +2 -2
- package/src/vaadin-grid-drag-and-drop-mixin.d.ts +5 -5
- package/src/vaadin-grid-drag-and-drop-mixin.js +3 -1
- package/src/vaadin-grid-event-context-mixin.d.ts +4 -4
- package/src/vaadin-grid-filter-column.d.ts +1 -1
- package/src/vaadin-grid-filter.d.ts +2 -2
- package/src/vaadin-grid-keyboard-navigation-mixin.js +10 -6
- package/src/vaadin-grid-row-details-mixin.d.ts +3 -3
- package/src/vaadin-grid-scroll-mixin.d.ts +2 -2
- package/src/vaadin-grid-scroll-mixin.js +3 -1
- package/src/vaadin-grid-selection-column.d.ts +3 -3
- package/src/vaadin-grid-selection-column.js +10 -3
- package/src/vaadin-grid-selection-mixin.d.ts +2 -2
- package/src/vaadin-grid-sort-column.d.ts +4 -4
- package/src/vaadin-grid-sort-mixin.d.ts +18 -2
- package/src/vaadin-grid-sort-mixin.js +47 -5
- package/src/vaadin-grid-sorter.d.ts +2 -2
- package/src/vaadin-grid-sorter.js +7 -3
- package/src/vaadin-grid-styling-mixin.d.ts +4 -4
- package/src/vaadin-grid-tree-column.d.ts +1 -1
- package/src/vaadin-grid-tree-toggle.d.ts +2 -2
- package/src/vaadin-grid-tree-toggle.js +3 -3
- package/src/vaadin-grid.d.ts +25 -23
- package/src/vaadin-grid.js +4 -2
- package/theme/lumo/vaadin-grid-styles.js +0 -10
- package/web-types.json +2152 -0
- package/web-types.lit.json +930 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "23.2.0-
|
|
3
|
+
"version": "23.2.0-alpha5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
"src",
|
|
27
27
|
"theme",
|
|
28
28
|
"vaadin-*.d.ts",
|
|
29
|
-
"vaadin-*.js"
|
|
29
|
+
"vaadin-*.js",
|
|
30
|
+
"web-types.json",
|
|
31
|
+
"web-types.lit.json"
|
|
30
32
|
],
|
|
31
33
|
"keywords": [
|
|
32
34
|
"vaadin",
|
|
@@ -43,20 +45,24 @@
|
|
|
43
45
|
"dependencies": {
|
|
44
46
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
45
47
|
"@polymer/polymer": "^3.0.0",
|
|
46
|
-
"@vaadin/checkbox": "23.2.0-
|
|
47
|
-
"@vaadin/component-base": "23.2.0-
|
|
48
|
-
"@vaadin/lit-renderer": "23.2.0-
|
|
49
|
-
"@vaadin/text-field": "23.2.0-
|
|
50
|
-
"@vaadin/vaadin-lumo-styles": "23.2.0-
|
|
51
|
-
"@vaadin/vaadin-material-styles": "23.2.0-
|
|
52
|
-
"@vaadin/vaadin-themable-mixin": "23.2.0-
|
|
48
|
+
"@vaadin/checkbox": "23.2.0-alpha5",
|
|
49
|
+
"@vaadin/component-base": "23.2.0-alpha5",
|
|
50
|
+
"@vaadin/lit-renderer": "23.2.0-alpha5",
|
|
51
|
+
"@vaadin/text-field": "23.2.0-alpha5",
|
|
52
|
+
"@vaadin/vaadin-lumo-styles": "23.2.0-alpha5",
|
|
53
|
+
"@vaadin/vaadin-material-styles": "23.2.0-alpha5",
|
|
54
|
+
"@vaadin/vaadin-themable-mixin": "23.2.0-alpha5"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
55
57
|
"@esm-bundle/chai": "^4.3.4",
|
|
56
|
-
"@vaadin/polymer-legacy-adapter": "23.2.0-
|
|
58
|
+
"@vaadin/polymer-legacy-adapter": "23.2.0-alpha5",
|
|
57
59
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
58
60
|
"lit": "^2.0.0",
|
|
59
61
|
"sinon": "^13.0.2"
|
|
60
62
|
},
|
|
61
|
-
"
|
|
63
|
+
"web-types": [
|
|
64
|
+
"web-types.json",
|
|
65
|
+
"web-types.lit.json"
|
|
66
|
+
],
|
|
67
|
+
"gitHead": "c6247fd741d61096d75a71feda4a1faf88b6f0ce"
|
|
62
68
|
}
|
|
@@ -22,12 +22,10 @@ function checkPaths(arrayToCheck, action, items) {
|
|
|
22
22
|
|
|
23
23
|
let result = true;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
const path = arrayToCheck[i].path;
|
|
27
|
-
|
|
25
|
+
arrayToCheck.forEach(({ path }) => {
|
|
28
26
|
// Skip simple paths
|
|
29
27
|
if (!path || path.indexOf('.') === -1) {
|
|
30
|
-
|
|
28
|
+
return;
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
const parentProperty = path.replace(/\.[^.]*$/, ''); // A.b.c -> a.b
|
|
@@ -35,7 +33,7 @@ function checkPaths(arrayToCheck, action, items) {
|
|
|
35
33
|
console.warn(`Path "${path}" used for ${action} does not exist in all of the items, ${action} is disabled.`);
|
|
36
34
|
result = false;
|
|
37
35
|
}
|
|
38
|
-
}
|
|
36
|
+
});
|
|
39
37
|
|
|
40
38
|
return result;
|
|
41
39
|
}
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
/* eslint-disable max-classes-per-file */
|
|
7
|
-
import { TemplateResult } from 'lit';
|
|
8
|
-
import { DirectiveResult } from 'lit/directive';
|
|
9
|
-
import { LitRenderer
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import type { TemplateResult } from 'lit';
|
|
8
|
+
import type { DirectiveResult } from 'lit/directive';
|
|
9
|
+
import type { LitRenderer } from '@vaadin/lit-renderer';
|
|
10
|
+
import { LitRendererDirective } from '@vaadin/lit-renderer';
|
|
11
|
+
import type { GridItemModel } from '../vaadin-grid.js';
|
|
12
|
+
import type { GridColumn } from '../vaadin-grid-column.js';
|
|
12
13
|
|
|
13
14
|
export type GridColumnBodyLitRenderer<TItem> = (
|
|
14
15
|
item: TItem,
|
|
@@ -26,7 +27,7 @@ declare abstract class AbstractGridColumnRendererDirective<R extends LitRenderer
|
|
|
26
27
|
/**
|
|
27
28
|
* A property to that the renderer callback will be assigned.
|
|
28
29
|
*/
|
|
29
|
-
abstract rendererProperty: '
|
|
30
|
+
abstract rendererProperty: 'footerRenderer' | 'headerRenderer' | 'renderer';
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Adds the renderer callback to the grid column.
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { TemplateResult } from 'lit';
|
|
7
|
-
import { DirectiveResult } from 'lit/directive';
|
|
6
|
+
import type { TemplateResult } from 'lit';
|
|
7
|
+
import type { DirectiveResult } from 'lit/directive';
|
|
8
8
|
import { LitRendererDirective } from '@vaadin/lit-renderer';
|
|
9
|
-
import { Grid, GridItemModel } from '../vaadin-grid.js';
|
|
9
|
+
import type { Grid, GridItemModel } from '../vaadin-grid.js';
|
|
10
10
|
|
|
11
11
|
export type GridRowDetailsLitRenderer<TItem> = (item: TItem, model: GridItemModel<TItem>, grid: Grid) => TemplateResult;
|
|
12
12
|
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
7
|
|
|
8
8
|
export declare function ActiveItemMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
9
9
|
base: T,
|
|
10
|
-
):
|
|
10
|
+
): Constructor<ActiveItemMixinClass<TItem>> & T;
|
|
11
11
|
|
|
12
12
|
export declare class ActiveItemMixinClass<TItem> {
|
|
13
13
|
/**
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
7
|
|
|
8
8
|
export declare function ArrayDataProviderMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
9
9
|
base: T,
|
|
10
|
-
):
|
|
10
|
+
): Constructor<ArrayDataProviderMixinClass<TItem>> & T;
|
|
11
11
|
|
|
12
12
|
export declare class ArrayDataProviderMixinClass<TItem> {
|
|
13
13
|
/**
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { GridDefaultItem } from './vaadin-grid.js';
|
|
7
|
-
import { ColumnBaseMixinClass } from './vaadin-grid-column.js';
|
|
6
|
+
import type { GridDefaultItem } from './vaadin-grid.js';
|
|
7
|
+
import type { ColumnBaseMixinClass } from './vaadin-grid-column.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A `<vaadin-grid-column-group>` is used to make groups of columns in `<vaadin-grid>` and
|
|
@@ -156,7 +156,9 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
|
|
|
156
156
|
const _rootColumns = rootColumns.slice(0);
|
|
157
157
|
|
|
158
158
|
if (!order) {
|
|
159
|
-
_rootColumns.forEach((column) =>
|
|
159
|
+
_rootColumns.forEach((column) => {
|
|
160
|
+
column._order = 0;
|
|
161
|
+
});
|
|
160
162
|
return;
|
|
161
163
|
}
|
|
162
164
|
// The parent column order number cascades downwards to it's children
|
|
@@ -190,7 +192,9 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
|
|
|
190
192
|
return;
|
|
191
193
|
}
|
|
192
194
|
|
|
193
|
-
rootColumns.forEach((column) =>
|
|
195
|
+
rootColumns.forEach((column) => {
|
|
196
|
+
column._reorderStatus = reorderStatus;
|
|
197
|
+
});
|
|
194
198
|
}
|
|
195
199
|
|
|
196
200
|
/** @private */
|
|
@@ -199,7 +203,9 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
|
|
|
199
203
|
return;
|
|
200
204
|
}
|
|
201
205
|
|
|
202
|
-
rootColumns.forEach((column) =>
|
|
206
|
+
rootColumns.forEach((column) => {
|
|
207
|
+
column.resizable = resizable;
|
|
208
|
+
});
|
|
203
209
|
}
|
|
204
210
|
|
|
205
211
|
/** @private */
|
|
@@ -217,7 +223,10 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
|
|
|
217
223
|
|
|
218
224
|
if (this._visibleChildColumns.length > 0) {
|
|
219
225
|
const width = this._visibleChildColumns
|
|
220
|
-
.reduce((prev, curr) =>
|
|
226
|
+
.reduce((prev, curr) => {
|
|
227
|
+
prev += ` + ${(curr.width || '0px').replace('calc', '')}`;
|
|
228
|
+
return prev;
|
|
229
|
+
}, '')
|
|
221
230
|
.substring(3);
|
|
222
231
|
this._setWidth(`calc(${width})`);
|
|
223
232
|
} else {
|
|
@@ -235,7 +244,9 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
|
|
|
235
244
|
|
|
236
245
|
// Don’t propagate the default `false` value.
|
|
237
246
|
if (frozen !== false) {
|
|
238
|
-
Array.from(rootColumns).forEach((col) =>
|
|
247
|
+
Array.from(rootColumns).forEach((col) => {
|
|
248
|
+
col.frozen = frozen;
|
|
249
|
+
});
|
|
239
250
|
}
|
|
240
251
|
}
|
|
241
252
|
|
|
@@ -247,7 +258,9 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
|
|
|
247
258
|
|
|
248
259
|
// Don’t propagate the default `false` value.
|
|
249
260
|
if (frozenToEnd !== false) {
|
|
250
|
-
Array.from(rootColumns).forEach((col) =>
|
|
261
|
+
Array.from(rootColumns).forEach((col) => {
|
|
262
|
+
col.frozenToEnd = frozenToEnd;
|
|
263
|
+
});
|
|
251
264
|
}
|
|
252
265
|
}
|
|
253
266
|
|
|
@@ -276,7 +289,9 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
|
|
|
276
289
|
/** @private */
|
|
277
290
|
_synchronizeHidden() {
|
|
278
291
|
if (this._childColumns && !this._preventHiddenSynchronization) {
|
|
279
|
-
this._childColumns.forEach((column) =>
|
|
292
|
+
this._childColumns.forEach((column) => {
|
|
293
|
+
column.hidden = this.hidden;
|
|
294
|
+
});
|
|
280
295
|
}
|
|
281
296
|
}
|
|
282
297
|
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
7
|
|
|
8
8
|
export declare function ColumnReorderingMixin<T extends Constructor<HTMLElement>>(
|
|
9
9
|
base: T,
|
|
10
|
-
):
|
|
10
|
+
): Constructor<ColumnReorderingMixinClass> & T;
|
|
11
11
|
|
|
12
12
|
export declare class ColumnReorderingMixinClass {
|
|
13
13
|
/**
|
|
@@ -263,7 +263,9 @@ export const ColumnReorderingMixin = (superClass) =>
|
|
|
263
263
|
'border',
|
|
264
264
|
'flex-direction',
|
|
265
265
|
'overflow',
|
|
266
|
-
].forEach((propertyName) =>
|
|
266
|
+
].forEach((propertyName) => {
|
|
267
|
+
ghost.style[propertyName] = style[propertyName];
|
|
268
|
+
});
|
|
267
269
|
return ghost;
|
|
268
270
|
}
|
|
269
271
|
|
|
@@ -274,7 +276,9 @@ export const ColumnReorderingMixin = (superClass) =>
|
|
|
274
276
|
}
|
|
275
277
|
|
|
276
278
|
// Reset all column orders
|
|
277
|
-
columnTree[0].forEach((column) =>
|
|
279
|
+
columnTree[0].forEach((column) => {
|
|
280
|
+
column._order = 0;
|
|
281
|
+
});
|
|
278
282
|
// Set order numbers to top-level columns
|
|
279
283
|
updateColumnOrders(columnTree[0], this._orderBaseScope, 0);
|
|
280
284
|
}
|
|
@@ -287,7 +291,9 @@ export const ColumnReorderingMixin = (superClass) =>
|
|
|
287
291
|
_setSiblingsReorderStatus(column, status) {
|
|
288
292
|
Array.from(column.parentNode.children)
|
|
289
293
|
.filter((child) => /column/.test(child.localName) && this._isSwapAllowed(child, column))
|
|
290
|
-
.forEach((sibling) =>
|
|
294
|
+
.forEach((sibling) => {
|
|
295
|
+
sibling._reorderStatus = status;
|
|
296
|
+
});
|
|
291
297
|
}
|
|
292
298
|
|
|
293
299
|
/** @protected */
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
-
import { GridDefaultItem, GridItemModel } from './vaadin-grid.js';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
import type { GridDefaultItem, GridItemModel } from './vaadin-grid.js';
|
|
8
8
|
|
|
9
9
|
export type GridBodyRenderer<TItem> = (
|
|
10
10
|
root: HTMLElement,
|
|
@@ -12,13 +12,13 @@ export type GridBodyRenderer<TItem> = (
|
|
|
12
12
|
model: GridItemModel<TItem>,
|
|
13
13
|
) => void;
|
|
14
14
|
|
|
15
|
-
export type GridColumnTextAlign = '
|
|
15
|
+
export type GridColumnTextAlign = 'center' | 'end' | 'start' | null;
|
|
16
16
|
|
|
17
17
|
export type GridHeaderFooterRenderer<TItem> = (root: HTMLElement, column: GridColumn<TItem>) => void;
|
|
18
18
|
|
|
19
19
|
export declare function ColumnBaseMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
20
20
|
base: T,
|
|
21
|
-
):
|
|
21
|
+
): Constructor<ColumnBaseMixinClass<TItem>> & T;
|
|
22
22
|
|
|
23
23
|
export declare class ColumnBaseMixinClass<TItem> {
|
|
24
24
|
/**
|
|
@@ -312,12 +312,16 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
312
312
|
this.parentElement._columnPropChanged('flexGrow');
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
this._allCells.forEach((cell) =>
|
|
315
|
+
this._allCells.forEach((cell) => {
|
|
316
|
+
cell.style.flexGrow = flexGrow;
|
|
317
|
+
});
|
|
316
318
|
}
|
|
317
319
|
|
|
318
320
|
/** @private */
|
|
319
321
|
_orderChanged(order) {
|
|
320
|
-
this._allCells.forEach((cell) =>
|
|
322
|
+
this._allCells.forEach((cell) => {
|
|
323
|
+
cell.style.order = order;
|
|
324
|
+
});
|
|
321
325
|
}
|
|
322
326
|
|
|
323
327
|
/** @private */
|
|
@@ -326,7 +330,9 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
326
330
|
this.parentElement._columnPropChanged('width');
|
|
327
331
|
}
|
|
328
332
|
|
|
329
|
-
this._allCells.forEach((cell) =>
|
|
333
|
+
this._allCells.forEach((cell) => {
|
|
334
|
+
cell.style.width = width;
|
|
335
|
+
});
|
|
330
336
|
}
|
|
331
337
|
|
|
332
338
|
/** @private */
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
7
|
import { GridSorterDirection } from './vaadin-grid-sorter.js';
|
|
8
8
|
|
|
9
9
|
export { GridSorterDirection };
|
|
@@ -58,7 +58,7 @@ export declare class ItemCache<TItem> {
|
|
|
58
58
|
|
|
59
59
|
export declare function DataProviderMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
60
60
|
base: T,
|
|
61
|
-
):
|
|
61
|
+
): Constructor<DataProviderMixinClass<TItem>> & T;
|
|
62
62
|
|
|
63
63
|
export declare class DataProviderMixinClass<TItem> {
|
|
64
64
|
/**
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
-
import { GridItemModel } from './vaadin-grid.js';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
import type { GridItemModel } from './vaadin-grid.js';
|
|
8
8
|
|
|
9
9
|
export type GridDragAndDropFilter<TItem> = (model: GridItemModel<TItem>) => boolean;
|
|
10
10
|
|
|
11
|
-
export type GridDropLocation = 'above' | '
|
|
11
|
+
export type GridDropLocation = 'above' | 'below' | 'empty' | 'on-top';
|
|
12
12
|
|
|
13
|
-
export type GridDropMode = 'between' | 'on-
|
|
13
|
+
export type GridDropMode = 'between' | 'on-grid' | 'on-top-or-between' | 'on-top';
|
|
14
14
|
|
|
15
15
|
export declare function DragAndDropMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
16
16
|
base: T,
|
|
17
|
-
):
|
|
17
|
+
): Constructor<DragAndDropMixinClass<TItem>> & T;
|
|
18
18
|
|
|
19
19
|
export declare class DragAndDropMixinClass<TItem> {
|
|
20
20
|
/**
|
|
@@ -280,7 +280,9 @@ export const DragAndDropMixin = (superClass) =>
|
|
|
280
280
|
if (scrollTopChanged) {
|
|
281
281
|
this.__dndAutoScrolling = true;
|
|
282
282
|
// Disallow more auto-scrolls within 20ms
|
|
283
|
-
setTimeout(() =>
|
|
283
|
+
setTimeout(() => {
|
|
284
|
+
this.__dndAutoScrolling = false;
|
|
285
|
+
}, 20);
|
|
284
286
|
return true;
|
|
285
287
|
}
|
|
286
288
|
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
-
import { GridColumn } from './vaadin-grid-column.js';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
import type { GridColumn } from './vaadin-grid-column.js';
|
|
8
8
|
|
|
9
9
|
export interface GridEventContext<TItem> {
|
|
10
|
-
section?: 'body' | '
|
|
10
|
+
section?: 'body' | 'details' | 'footer' | 'header';
|
|
11
11
|
item?: TItem;
|
|
12
12
|
column?: GridColumn<TItem>;
|
|
13
13
|
index?: number;
|
|
@@ -19,7 +19,7 @@ export interface GridEventContext<TItem> {
|
|
|
19
19
|
|
|
20
20
|
export declare function EventContextMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
21
21
|
base: T,
|
|
22
|
-
):
|
|
22
|
+
): Constructor<EventContextMixinClass<TItem>> & T;
|
|
23
23
|
|
|
24
24
|
export declare class EventContextMixinClass<TItem> {
|
|
25
25
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { GridDefaultItem } from './vaadin-grid.js';
|
|
6
|
+
import type { GridDefaultItem } from './vaadin-grid.js';
|
|
7
7
|
import { GridColumn } from './vaadin-grid-column.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -54,13 +54,13 @@ declare class GridFilter extends HTMLElement {
|
|
|
54
54
|
addEventListener<K extends keyof GridFilterEventMap>(
|
|
55
55
|
type: K,
|
|
56
56
|
listener: (this: GridFilter, ev: GridFilterEventMap[K]) => void,
|
|
57
|
-
options?:
|
|
57
|
+
options?: AddEventListenerOptions | boolean,
|
|
58
58
|
): void;
|
|
59
59
|
|
|
60
60
|
removeEventListener<K extends keyof GridFilterEventMap>(
|
|
61
61
|
type: K,
|
|
62
62
|
listener: (this: GridFilter, ev: GridFilterEventMap[K]) => void,
|
|
63
|
-
options?:
|
|
63
|
+
options?: EventListenerOptions | boolean,
|
|
64
64
|
): void;
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -95,7 +95,9 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
95
95
|
// Reset stored order when moving focus with mouse.
|
|
96
96
|
this._focusedColumnOrder = undefined;
|
|
97
97
|
});
|
|
98
|
-
this.addEventListener('mouseup', () =>
|
|
98
|
+
this.addEventListener('mouseup', () => {
|
|
99
|
+
this._isMousedown = false;
|
|
100
|
+
});
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
/** @private */
|
|
@@ -370,7 +372,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
370
372
|
* Focuses the target row after navigating by the given dy offset.
|
|
371
373
|
* If the row is not in the viewport, it is first scrolled to.
|
|
372
374
|
* @private
|
|
373
|
-
|
|
375
|
+
*/
|
|
374
376
|
_onRowNavigation(activeRow, dy) {
|
|
375
377
|
const { dstRow } = this.__navigateRows(dy, activeRow);
|
|
376
378
|
|
|
@@ -394,7 +396,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
394
396
|
* Also returns information whether the details cell should be the target on the target row.
|
|
395
397
|
* If the row is not in the viewport, it is first scrolled to.
|
|
396
398
|
* @private
|
|
397
|
-
|
|
399
|
+
*/
|
|
398
400
|
__navigateRows(dy, activeRow, activeCell) {
|
|
399
401
|
const currentRowIndex = this.__getIndexInGroup(activeRow, this._focusedItemIndex);
|
|
400
402
|
const activeRowGroup = activeRow.parentNode;
|
|
@@ -469,7 +471,7 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
469
471
|
* Focuses the target cell after navigating by the given dx and dy offset.
|
|
470
472
|
* If the cell is not in the viewport, it is first scrolled to.
|
|
471
473
|
* @private
|
|
472
|
-
|
|
474
|
+
*/
|
|
473
475
|
_onCellNavigation(activeCell, dx, dy) {
|
|
474
476
|
const activeRow = activeCell.parentNode;
|
|
475
477
|
const { dstRow, dstIsRowDetails } = this.__navigateRows(dy, activeRow, activeCell);
|
|
@@ -746,10 +748,11 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
746
748
|
this._detectFocusedItemIndex(e);
|
|
747
749
|
}
|
|
748
750
|
|
|
749
|
-
/**
|
|
751
|
+
/**
|
|
750
752
|
* Enables interaction mode if a cells descendant receives focus or keyboard
|
|
751
753
|
* input. Disables it if the event is not related to cell content.
|
|
752
754
|
* @param {!KeyboardEvent|!FocusEvent} e
|
|
755
|
+
* @private
|
|
753
756
|
*/
|
|
754
757
|
_detectInteracting(e) {
|
|
755
758
|
const isInteracting = e.composedPath().some((el) => el.localName === 'vaadin-grid-cell-content');
|
|
@@ -765,11 +768,12 @@ export const KeyboardNavigationMixin = (superClass) =>
|
|
|
765
768
|
}
|
|
766
769
|
}
|
|
767
770
|
|
|
768
|
-
/**
|
|
771
|
+
/**
|
|
769
772
|
* Enables or disables the focus target of the containing section of the
|
|
770
773
|
* grid from receiving focus, based on whether the user is interacting with
|
|
771
774
|
* that section of the grid.
|
|
772
775
|
* @param {HTMLElement} focusTarget
|
|
776
|
+
* @private
|
|
773
777
|
*/
|
|
774
778
|
_updateGridSectionFocusTarget(focusTarget) {
|
|
775
779
|
if (!focusTarget) {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
-
import { Grid, GridItemModel } from './vaadin-grid.js';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
import type { Grid, GridItemModel } from './vaadin-grid.js';
|
|
8
8
|
|
|
9
9
|
export type GridRowDetailsRenderer<TItem> = (
|
|
10
10
|
root: HTMLElement,
|
|
@@ -14,7 +14,7 @@ export type GridRowDetailsRenderer<TItem> = (
|
|
|
14
14
|
|
|
15
15
|
export declare function RowDetailsMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
16
16
|
base: T,
|
|
17
|
-
):
|
|
17
|
+
): Constructor<RowDetailsMixinClass<TItem>> & T;
|
|
18
18
|
|
|
19
19
|
export declare class RowDetailsMixinClass<TItem> {
|
|
20
20
|
/**
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
7
|
|
|
8
|
-
export declare function ScrollMixin<T extends Constructor<HTMLElement>>(base: T):
|
|
8
|
+
export declare function ScrollMixin<T extends Constructor<HTMLElement>>(base: T): Constructor<ScrollMixinClass> & T;
|
|
9
9
|
|
|
10
10
|
export declare class ScrollMixinClass {
|
|
11
11
|
/**
|
|
@@ -69,7 +69,9 @@ export const ScrollMixin = (superClass) =>
|
|
|
69
69
|
const itemsIndex = e.composedPath().indexOf(this.$.items);
|
|
70
70
|
this._rowWithFocusedElement = e.composedPath()[itemsIndex - 1];
|
|
71
71
|
});
|
|
72
|
-
this.$.items.addEventListener('focusout', () =>
|
|
72
|
+
this.$.items.addEventListener('focusout', () => {
|
|
73
|
+
this._rowWithFocusedElement = undefined;
|
|
74
|
+
});
|
|
73
75
|
|
|
74
76
|
this.$.table.addEventListener('scroll', () => this._afterScroll());
|
|
75
77
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { GridDefaultItem } from './vaadin-grid.js';
|
|
6
|
+
import type { GridDefaultItem } from './vaadin-grid.js';
|
|
7
7
|
import { GridColumn } from './vaadin-grid-column.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -57,13 +57,13 @@ declare class GridSelectionColumn<TItem = GridDefaultItem> extends GridColumn<TI
|
|
|
57
57
|
addEventListener<K extends keyof GridSelectionColumnEventMap>(
|
|
58
58
|
type: K,
|
|
59
59
|
listener: (this: GridSelectionColumn<TItem>, ev: GridSelectionColumnEventMap[K]) => void,
|
|
60
|
-
options?:
|
|
60
|
+
options?: AddEventListenerOptions | boolean,
|
|
61
61
|
): void;
|
|
62
62
|
|
|
63
63
|
removeEventListener<K extends keyof GridSelectionColumnEventMap>(
|
|
64
64
|
type: K,
|
|
65
65
|
listener: (this: GridSelectionColumn<TItem>, ev: GridSelectionColumnEventMap[K]) => void,
|
|
66
|
-
options?:
|
|
66
|
+
options?: EventListenerOptions | boolean,
|
|
67
67
|
): void;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -184,8 +184,10 @@ class GridSelectionColumn extends GridColumn {
|
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
if (selectAll &&
|
|
188
|
-
this.__withFilteredItemsArray((items) =>
|
|
187
|
+
if (selectAll && this.__hasArrayDataProvider()) {
|
|
188
|
+
this.__withFilteredItemsArray((items) => {
|
|
189
|
+
this._grid.selectedItems = items;
|
|
190
|
+
});
|
|
189
191
|
} else {
|
|
190
192
|
this._grid.selectedItems = [];
|
|
191
193
|
}
|
|
@@ -254,10 +256,15 @@ class GridSelectionColumn extends GridColumn {
|
|
|
254
256
|
this.__previousActiveItem = activeItem;
|
|
255
257
|
}
|
|
256
258
|
|
|
259
|
+
/** @private */
|
|
260
|
+
__hasArrayDataProvider() {
|
|
261
|
+
return Array.isArray(this._grid.items) && !!this._grid.dataProvider;
|
|
262
|
+
}
|
|
263
|
+
|
|
257
264
|
/** @private */
|
|
258
265
|
__onSelectedItemsChanged() {
|
|
259
266
|
this._selectAllChangeLock = true;
|
|
260
|
-
if (
|
|
267
|
+
if (this.__hasArrayDataProvider()) {
|
|
261
268
|
this.__withFilteredItemsArray((items) => {
|
|
262
269
|
if (!this._grid.selectedItems.length) {
|
|
263
270
|
this.selectAll = false;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
7
|
|
|
8
8
|
export declare function SelectionMixin<TItem, T extends Constructor<HTMLElement>>(
|
|
9
9
|
base: T,
|
|
10
|
-
):
|
|
10
|
+
): Constructor<SelectionMixinClass<TItem>> & T;
|
|
11
11
|
|
|
12
12
|
export declare class SelectionMixinClass<TItem> {
|
|
13
13
|
/**
|