@vaadin/grid 24.4.0-dev.b3e1d14600 → 24.4.0-rc1
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/README.md +0 -1
- package/package.json +10 -10
- package/src/all-imports.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/lit-all-imports.js +1 -1
- package/src/vaadin-grid-a11y-mixin.js +4 -2
- package/src/vaadin-grid-active-item-mixin.d.ts +1 -1
- package/src/vaadin-grid-active-item-mixin.js +1 -1
- 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-mixin.d.ts +1 -1
- package/src/vaadin-grid-column-group-mixin.js +1 -1
- package/src/vaadin-grid-column-group.d.ts +1 -1
- package/src/vaadin-grid-column-group.js +1 -1
- package/src/vaadin-grid-column-mixin.d.ts +1 -1
- package/src/vaadin-grid-column-mixin.js +9 -5
- package/src/vaadin-grid-column-reordering-mixin.d.ts +1 -1
- package/src/vaadin-grid-column-reordering-mixin.js +18 -5
- package/src/vaadin-grid-column-resizing-mixin.js +1 -1
- package/src/vaadin-grid-column.d.ts +1 -1
- package/src/vaadin-grid-column.js +1 -1
- package/src/vaadin-grid-data-provider-mixin.d.ts +1 -1
- package/src/vaadin-grid-data-provider-mixin.js +18 -9
- package/src/vaadin-grid-drag-and-drop-mixin.d.ts +1 -1
- package/src/vaadin-grid-drag-and-drop-mixin.js +1 -1
- package/src/vaadin-grid-dynamic-columns-mixin.js +1 -1
- 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-mixin.d.ts +1 -1
- package/src/vaadin-grid-filter-column-mixin.js +2 -27
- package/src/vaadin-grid-filter-column.d.ts +1 -1
- package/src/vaadin-grid-filter-column.js +1 -1
- package/src/vaadin-grid-filter-element-mixin.d.ts +1 -1
- package/src/vaadin-grid-filter-element-mixin.js +3 -11
- package/src/vaadin-grid-filter-mixin.js +1 -1
- package/src/vaadin-grid-filter.d.ts +1 -1
- package/src/vaadin-grid-filter.js +1 -1
- package/src/vaadin-grid-helpers.js +1 -1
- package/src/vaadin-grid-keyboard-navigation-mixin.js +23 -11
- package/src/vaadin-grid-mixin.d.ts +1 -1
- package/src/vaadin-grid-mixin.js +54 -16
- package/src/vaadin-grid-row-details-mixin.d.ts +1 -1
- package/src/vaadin-grid-row-details-mixin.js +1 -1
- package/src/vaadin-grid-scroll-mixin.d.ts +3 -1
- package/src/vaadin-grid-scroll-mixin.js +21 -9
- package/src/vaadin-grid-selection-column-base-mixin.d.ts +1 -1
- package/src/vaadin-grid-selection-column-base-mixin.js +19 -1
- package/src/vaadin-grid-selection-column-mixin.d.ts +1 -1
- package/src/vaadin-grid-selection-column-mixin.js +1 -1
- 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-mixin.d.ts +1 -1
- package/src/vaadin-grid-sort-column-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 +1 -1
- package/src/vaadin-grid-sort-mixin.js +1 -1
- package/src/vaadin-grid-sorter-mixin.d.ts +1 -1
- package/src/vaadin-grid-sorter-mixin.js +1 -1
- package/src/vaadin-grid-sorter.d.ts +1 -1
- package/src/vaadin-grid-sorter.js +1 -1
- package/src/vaadin-grid-styles.js +7 -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-mixin.d.ts +1 -1
- package/src/vaadin-grid-tree-column-mixin.js +1 -1
- package/src/vaadin-grid-tree-column.d.ts +1 -1
- package/src/vaadin-grid-tree-column.js +1 -1
- package/src/vaadin-grid-tree-toggle-mixin.d.ts +1 -1
- package/src/vaadin-grid-tree-toggle-mixin.js +3 -5
- package/src/vaadin-grid-tree-toggle.d.ts +1 -1
- package/src/vaadin-grid-tree-toggle.js +1 -1
- package/src/vaadin-grid.d.ts +1 -1
- package/src/vaadin-grid.js +1 -1
- package/src/vaadin-lit-grid-column-group.js +2 -2
- package/src/vaadin-lit-grid-column.js +2 -2
- package/src/vaadin-lit-grid-filter-column.js +2 -2
- package/src/vaadin-lit-grid-filter.js +2 -2
- package/src/vaadin-lit-grid-selection-column.js +2 -2
- package/src/vaadin-lit-grid-sort-column.js +2 -2
- package/src/vaadin-lit-grid-sorter.js +2 -2
- package/src/vaadin-lit-grid-tree-column.js +2 -2
- package/src/vaadin-lit-grid-tree-toggle.js +2 -2
- package/src/vaadin-lit-grid.js +2 -2
- package/theme/lumo/all-imports.d.ts +11 -0
- package/theme/lumo/lit-all-imports.d.ts +11 -0
- package/theme/lumo/vaadin-grid-column-group.d.ts +1 -0
- package/theme/lumo/vaadin-grid-column.d.ts +1 -0
- package/theme/lumo/vaadin-grid-filter-column.d.ts +2 -0
- package/theme/lumo/vaadin-grid-filter.d.ts +2 -0
- package/theme/lumo/vaadin-grid-selection-column.d.ts +2 -0
- package/theme/lumo/vaadin-grid-sort-column.d.ts +2 -0
- package/theme/lumo/vaadin-grid-sorter-styles.d.ts +3 -0
- package/theme/lumo/vaadin-grid-sorter.d.ts +2 -0
- package/theme/lumo/vaadin-grid-styles.d.ts +6 -0
- package/theme/lumo/vaadin-grid-styles.js +0 -1
- package/theme/lumo/vaadin-grid-tree-column.d.ts +2 -0
- package/theme/lumo/vaadin-grid-tree-toggle-styles.d.ts +3 -0
- package/theme/lumo/vaadin-grid-tree-toggle.d.ts +2 -0
- package/theme/lumo/vaadin-grid.d.ts +2 -0
- package/theme/lumo/vaadin-lit-grid-column-group.d.ts +1 -0
- package/theme/lumo/vaadin-lit-grid-column.d.ts +1 -0
- package/theme/lumo/vaadin-lit-grid-filter-column.d.ts +2 -0
- package/theme/lumo/vaadin-lit-grid-filter.d.ts +2 -0
- package/theme/lumo/vaadin-lit-grid-filter.js +1 -2
- package/theme/lumo/vaadin-lit-grid-selection-column.d.ts +2 -0
- package/theme/lumo/vaadin-lit-grid-selection-column.js +1 -1
- package/theme/lumo/vaadin-lit-grid-sort-column.d.ts +2 -0
- package/theme/lumo/vaadin-lit-grid-sorter.d.ts +2 -0
- package/theme/lumo/vaadin-lit-grid-tree-column.d.ts +2 -0
- package/theme/lumo/vaadin-lit-grid-tree-toggle.d.ts +2 -0
- package/theme/lumo/vaadin-lit-grid.d.ts +2 -0
- package/theme/material/all-imports.d.ts +11 -0
- package/theme/material/lit-all-imports.d.ts +11 -0
- package/theme/material/vaadin-grid-column-group.d.ts +1 -0
- package/theme/material/vaadin-grid-column.d.ts +1 -0
- package/theme/material/vaadin-grid-filter-column.d.ts +2 -0
- package/theme/material/vaadin-grid-filter.d.ts +2 -0
- package/theme/material/vaadin-grid-selection-column.d.ts +2 -0
- package/theme/material/vaadin-grid-sort-column.d.ts +2 -0
- package/theme/material/vaadin-grid-sorter-styles.d.ts +2 -0
- package/theme/material/vaadin-grid-sorter.d.ts +2 -0
- package/theme/material/vaadin-grid-styles.d.ts +2 -0
- package/theme/material/vaadin-grid-tree-column.d.ts +2 -0
- package/theme/material/vaadin-grid-tree-toggle-styles.d.ts +3 -0
- package/theme/material/vaadin-grid-tree-toggle.d.ts +2 -0
- package/theme/material/vaadin-grid.d.ts +2 -0
- package/theme/material/vaadin-lit-grid-column-group.d.ts +1 -0
- package/theme/material/vaadin-lit-grid-column.d.ts +1 -0
- package/theme/material/vaadin-lit-grid-filter-column.d.ts +2 -0
- package/theme/material/vaadin-lit-grid-filter.d.ts +2 -0
- package/theme/material/vaadin-lit-grid-filter.js +1 -2
- package/theme/material/vaadin-lit-grid-selection-column.d.ts +2 -0
- package/theme/material/vaadin-lit-grid-selection-column.js +1 -1
- package/theme/material/vaadin-lit-grid-sort-column.d.ts +2 -0
- package/theme/material/vaadin-lit-grid-sorter.d.ts +2 -0
- package/theme/material/vaadin-lit-grid-tree-column.d.ts +2 -0
- package/theme/material/vaadin-lit-grid-tree-toggle.d.ts +2 -0
- package/theme/material/vaadin-lit-grid.d.ts +2 -0
- package/vaadin-grid.d.ts +0 -1
- package/vaadin-grid.js +0 -1
- package/vaadin-lit-grid.d.ts +0 -1
- package/vaadin-lit-grid.js +0 -1
- package/web-types.json +2579 -0
- package/web-types.lit.json +1091 -0
package/README.md
CHANGED
|
@@ -5,7 +5,6 @@ A web component for showing tabular data.
|
|
|
5
5
|
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/grid)
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@vaadin/grid)
|
|
8
|
-
[](https://discord.gg/PHmkCKC)
|
|
9
8
|
|
|
10
9
|
```html
|
|
11
10
|
<vaadin-grid theme="row-dividers" column-reordering-allowed multi-sort>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "24.4.0-
|
|
3
|
+
"version": "24.4.0-rc1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
48
48
|
"@polymer/polymer": "^3.0.0",
|
|
49
|
-
"@vaadin/a11y-base": "24.4.0-
|
|
50
|
-
"@vaadin/checkbox": "24.4.0-
|
|
51
|
-
"@vaadin/component-base": "24.4.0-
|
|
52
|
-
"@vaadin/lit-renderer": "24.4.0-
|
|
53
|
-
"@vaadin/text-field": "24.4.0-
|
|
54
|
-
"@vaadin/vaadin-lumo-styles": "24.4.0-
|
|
55
|
-
"@vaadin/vaadin-material-styles": "24.4.0-
|
|
56
|
-
"@vaadin/vaadin-themable-mixin": "24.4.0-
|
|
49
|
+
"@vaadin/a11y-base": "24.4.0-rc1",
|
|
50
|
+
"@vaadin/checkbox": "24.4.0-rc1",
|
|
51
|
+
"@vaadin/component-base": "24.4.0-rc1",
|
|
52
|
+
"@vaadin/lit-renderer": "24.4.0-rc1",
|
|
53
|
+
"@vaadin/text-field": "24.4.0-rc1",
|
|
54
|
+
"@vaadin/vaadin-lumo-styles": "24.4.0-rc1",
|
|
55
|
+
"@vaadin/vaadin-material-styles": "24.4.0-rc1",
|
|
56
|
+
"@vaadin/vaadin-themable-mixin": "24.4.0-rc1",
|
|
57
57
|
"lit": "^3.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"web-types.json",
|
|
66
66
|
"web-types.lit.json"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "a81e3b927d44c56613fa4e1307494a2acc81005f"
|
|
69
69
|
}
|
package/src/all-imports.js
CHANGED
package/src/lit-all-imports.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { iterateChildren, iterateRowCells } from './vaadin-grid-helpers.js';
|
|
@@ -16,7 +16,9 @@ export const A11yMixin = (superClass) =>
|
|
|
16
16
|
|
|
17
17
|
/** @private */
|
|
18
18
|
_a11yGetHeaderRowCount(_columnTree) {
|
|
19
|
-
return _columnTree.filter((level) =>
|
|
19
|
+
return _columnTree.filter((level) =>
|
|
20
|
+
level.some((col) => col.headerRenderer || (col.path && col.header !== null) || col.header),
|
|
21
|
+
).length;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
/** @private */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { createArrayDataProvider } from './array-data-provider.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { ColumnBaseMixinClass } from './vaadin-grid-column.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { animationFrame } from '@vaadin/component-base/src/async.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { animationFrame } from '@vaadin/component-base/src/async.js';
|
|
@@ -598,8 +598,14 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
598
598
|
|
|
599
599
|
/** @protected */
|
|
600
600
|
_runRenderer(renderer, cell, model) {
|
|
601
|
+
const isVisibleBodyCell = model && model.item && !cell.parentElement.hidden;
|
|
602
|
+
const shouldRender = isVisibleBodyCell || renderer === this._headerRenderer || renderer === this._footerRenderer;
|
|
603
|
+
if (!shouldRender) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
|
|
601
607
|
const args = [cell._content, this];
|
|
602
|
-
if (
|
|
608
|
+
if (isVisibleBodyCell) {
|
|
603
609
|
args.push(model);
|
|
604
610
|
}
|
|
605
611
|
|
|
@@ -634,9 +640,7 @@ export const ColumnBaseMixin = (superClass) =>
|
|
|
634
640
|
|
|
635
641
|
cell._renderer = renderer;
|
|
636
642
|
|
|
637
|
-
|
|
638
|
-
this._runRenderer(renderer, cell, model);
|
|
639
|
-
}
|
|
643
|
+
this._runRenderer(renderer, cell, model);
|
|
640
644
|
});
|
|
641
645
|
}
|
|
642
646
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { isTouch } from '@vaadin/component-base/src/browser-utils.js';
|
|
@@ -237,13 +237,26 @@ export const ColumnReorderingMixin = (superClass) =>
|
|
|
237
237
|
if (!this._draggedColumn) {
|
|
238
238
|
this.$.scroller.toggleAttribute('no-content-pointer-events', true);
|
|
239
239
|
}
|
|
240
|
-
const
|
|
240
|
+
const elementFromPoint = this.shadowRoot.elementFromPoint(x, y);
|
|
241
241
|
this.$.scroller.toggleAttribute('no-content-pointer-events', false);
|
|
242
242
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
return this._getCellFromElement(elementFromPoint);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** @private */
|
|
247
|
+
_getCellFromElement(element) {
|
|
248
|
+
if (element) {
|
|
249
|
+
// Check if element is a cell
|
|
250
|
+
if (element._column) {
|
|
251
|
+
return element;
|
|
252
|
+
}
|
|
253
|
+
// Check if element is the cell of a focus button mode column
|
|
254
|
+
const { parentElement } = element;
|
|
255
|
+
if (parentElement && parentElement._focusButton === element) {
|
|
256
|
+
return parentElement;
|
|
257
|
+
}
|
|
246
258
|
}
|
|
259
|
+
return null;
|
|
247
260
|
}
|
|
248
261
|
|
|
249
262
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { addListener } from '@vaadin/component-base/src/gestures.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { microTask, timeOut } from '@vaadin/component-base/src/async.js';
|
|
@@ -206,10 +206,6 @@ export const DataProviderMixin = (superClass) =>
|
|
|
206
206
|
* @protected
|
|
207
207
|
*/
|
|
208
208
|
_getItem(index, el) {
|
|
209
|
-
if (index >= this._flatSize) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
209
|
el.index = index;
|
|
214
210
|
|
|
215
211
|
const { item } = this._dataProviderController.getFlatIndexContext(index);
|
|
@@ -325,8 +321,18 @@ export const DataProviderMixin = (superClass) =>
|
|
|
325
321
|
|
|
326
322
|
/** @protected */
|
|
327
323
|
_onDataProviderPageReceived() {
|
|
328
|
-
//
|
|
329
|
-
this._flatSize
|
|
324
|
+
// If the page response affected the flat size
|
|
325
|
+
if (this._flatSize !== this._dataProviderController.flatSize) {
|
|
326
|
+
// Schedule an update of all rendered rows by _debouncerApplyCachedData,
|
|
327
|
+
// to ensure that all pages associated with the rendered rows are loaded.
|
|
328
|
+
this._shouldUpdateAllRenderedRowsAfterPageLoad = true;
|
|
329
|
+
|
|
330
|
+
// TODO: Updating the flat size property can still result in a synchonous virtualizer update
|
|
331
|
+
// if the size change requires the virtualizer to increase the amount of physical elements
|
|
332
|
+
// to display new items e.g. the viewport fits 10 items and the size changes from 1 to 10.
|
|
333
|
+
// This is something to be optimized in the future.
|
|
334
|
+
this._flatSize = this._dataProviderController.flatSize;
|
|
335
|
+
}
|
|
330
336
|
|
|
331
337
|
// After updating the cache, check if some of the expanded items should have sub-caches loaded
|
|
332
338
|
this._getRenderedRows().forEach((row) => {
|
|
@@ -342,9 +348,12 @@ export const DataProviderMixin = (superClass) =>
|
|
|
342
348
|
this._debouncerApplyCachedData = Debouncer.debounce(this._debouncerApplyCachedData, timeOut.after(0), () => {
|
|
343
349
|
this._setLoading(false);
|
|
344
350
|
|
|
351
|
+
const shouldUpdateAllRenderedRowsAfterPageLoad = this._shouldUpdateAllRenderedRowsAfterPageLoad;
|
|
352
|
+
this._shouldUpdateAllRenderedRowsAfterPageLoad = false;
|
|
353
|
+
|
|
345
354
|
this._getRenderedRows().forEach((row) => {
|
|
346
355
|
const { item } = this._dataProviderController.getFlatIndexContext(row.index);
|
|
347
|
-
if (item) {
|
|
356
|
+
if (item || shouldUpdateAllRenderedRowsAfterPageLoad) {
|
|
348
357
|
this._getItem(row.index, row);
|
|
349
358
|
}
|
|
350
359
|
});
|
|
@@ -374,7 +383,7 @@ export const DataProviderMixin = (superClass) =>
|
|
|
374
383
|
this._hasData = false;
|
|
375
384
|
this.__updateVisibleRows();
|
|
376
385
|
|
|
377
|
-
if (!this.__virtualizer.size) {
|
|
386
|
+
if (!this.__virtualizer || !this.__virtualizer.size) {
|
|
378
387
|
this._dataProviderController.loadFirstPage();
|
|
379
388
|
}
|
|
380
389
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { microTask, timeOut } from '@vaadin/component-base/src/async.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -30,13 +30,7 @@ export const GridFilterColumnMixin = (superClass) =>
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
static get observers() {
|
|
33
|
-
return ['_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
constructor() {
|
|
37
|
-
super();
|
|
38
|
-
|
|
39
|
-
this.__boundOnFilterValueChanged = this.__onFilterValueChanged.bind(this);
|
|
33
|
+
return ['_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header)'];
|
|
40
34
|
}
|
|
41
35
|
|
|
42
36
|
/**
|
|
@@ -54,16 +48,12 @@ export const GridFilterColumnMixin = (superClass) =>
|
|
|
54
48
|
textField.setAttribute('theme', 'small');
|
|
55
49
|
textField.setAttribute('style', 'max-width: 100%;');
|
|
56
50
|
textField.setAttribute('focus-target', '');
|
|
57
|
-
textField.addEventListener('value-changed', this.__boundOnFilterValueChanged);
|
|
58
51
|
filter.appendChild(textField);
|
|
59
52
|
root.appendChild(filter);
|
|
60
53
|
}
|
|
61
54
|
|
|
62
55
|
filter.path = this.path;
|
|
63
|
-
filter.value = this._filterValue;
|
|
64
56
|
|
|
65
|
-
textField.__rendererValue = this._filterValue;
|
|
66
|
-
textField.value = this._filterValue;
|
|
67
57
|
textField.label = this.__getHeader(this.header, this.path);
|
|
68
58
|
}
|
|
69
59
|
|
|
@@ -78,21 +68,6 @@ export const GridFilterColumnMixin = (superClass) =>
|
|
|
78
68
|
return this._defaultHeaderRenderer;
|
|
79
69
|
}
|
|
80
70
|
|
|
81
|
-
/**
|
|
82
|
-
* Updates the internal filter value once the filter text field is changed.
|
|
83
|
-
* The listener handles only user-fired events.
|
|
84
|
-
*
|
|
85
|
-
* @private
|
|
86
|
-
*/
|
|
87
|
-
__onFilterValueChanged(e) {
|
|
88
|
-
// Skip if the value is changed by the renderer.
|
|
89
|
-
if (e.detail.value === e.target.__rendererValue) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
this._filterValue = e.detail.value;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
71
|
/** @private */
|
|
97
72
|
__getHeader(header, path) {
|
|
98
73
|
if (header) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { timeOut } from '@vaadin/component-base/src/async.js';
|
|
@@ -69,12 +69,8 @@ export const GridFilterElementMixin = (superClass) =>
|
|
|
69
69
|
|
|
70
70
|
this._filterController = new SlotController(this, '', 'vaadin-text-field', {
|
|
71
71
|
initializer: (field) => {
|
|
72
|
-
field.addEventListener('
|
|
73
|
-
|
|
74
|
-
field.__previousValue = e.detail.value;
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
this.value = e.detail.value;
|
|
72
|
+
field.addEventListener('input', (e) => {
|
|
73
|
+
this.value = e.target.value;
|
|
78
74
|
});
|
|
79
75
|
|
|
80
76
|
this._textField = field;
|
|
@@ -88,12 +84,8 @@ export const GridFilterElementMixin = (superClass) =>
|
|
|
88
84
|
if (path === undefined || value === undefined || !textField) {
|
|
89
85
|
return;
|
|
90
86
|
}
|
|
91
|
-
if (this._previousValue === undefined && value === '') {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
87
|
|
|
95
88
|
textField.value = value;
|
|
96
|
-
this._previousValue = value;
|
|
97
89
|
|
|
98
90
|
this._debouncerFilterChanged = Debouncer.debounce(this._debouncerFilterChanged, timeOut.after(200), () => {
|
|
99
91
|
this.dispatchEvent(new CustomEvent('filter-changed', { bubbles: true }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2016 -
|
|
3
|
+
* Copyright (c) 2016 - 2024 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 { microTask } from '@vaadin/component-base/src/async.js';
|