@vaadin/grid 24.4.0-dev.b3e1d14600 → 24.4.0-rc2
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 +27 -16
- 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 +6 -1
- package/src/vaadin-grid-column-mixin.js +14 -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 +24 -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 +5 -5
- 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-rc2",
|
|
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-rc2",
|
|
50
|
+
"@vaadin/checkbox": "24.4.0-rc2",
|
|
51
|
+
"@vaadin/component-base": "24.4.0-rc2",
|
|
52
|
+
"@vaadin/lit-renderer": "24.4.0-rc2",
|
|
53
|
+
"@vaadin/text-field": "24.4.0-rc2",
|
|
54
|
+
"@vaadin/vaadin-lumo-styles": "24.4.0-rc2",
|
|
55
|
+
"@vaadin/vaadin-material-styles": "24.4.0-rc2",
|
|
56
|
+
"@vaadin/vaadin-themable-mixin": "24.4.0-rc2",
|
|
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": "ea3d99e8cf67a337e959d5cab849f80464c7c7e5"
|
|
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
|
|
|
@@ -69,28 +69,39 @@ export const ActiveItemMixin = (superClass) =>
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* yet at the point when tap event is being executed.
|
|
75
|
-
* @param {!MouseEvent} e
|
|
72
|
+
* Checks whether the click event should not activate the cell on which it occurred.
|
|
73
|
+
*
|
|
76
74
|
* @protected
|
|
77
75
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
_shouldPreventCellActivationOnClick(e) {
|
|
77
|
+
const { cell } = this._getGridEventLocation(e);
|
|
78
|
+
return (
|
|
80
79
|
// Something has handled this click already, e. g., <vaadin-grid-sorter>
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
e.defaultPrevented ||
|
|
81
|
+
// No clicked cell available
|
|
82
|
+
!cell ||
|
|
83
|
+
// Cell is a details cell
|
|
84
|
+
cell.getAttribute('part').includes('details-cell') ||
|
|
85
|
+
// Cell content is focused
|
|
86
|
+
cell._content.contains(this.getRootNode().activeElement) ||
|
|
87
|
+
// Clicked on a focusable element
|
|
88
|
+
this._isFocusable(e.target) ||
|
|
89
|
+
// Clicked on a label element
|
|
90
|
+
e.target instanceof HTMLLabelElement
|
|
91
|
+
);
|
|
92
|
+
}
|
|
83
93
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
/**
|
|
95
|
+
* @param {!MouseEvent} e
|
|
96
|
+
* @protected
|
|
97
|
+
*/
|
|
98
|
+
_onClick(e) {
|
|
99
|
+
if (this._shouldPreventCellActivationOnClick(e)) {
|
|
87
100
|
return;
|
|
88
101
|
}
|
|
89
|
-
const cellContent = cell._content;
|
|
90
102
|
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
if (!cellContentHasFocus && !this._isFocusable(e.target) && !(e.target instanceof HTMLLabelElement)) {
|
|
103
|
+
const { cell } = this._getGridEventLocation(e);
|
|
104
|
+
if (cell) {
|
|
94
105
|
this.dispatchEvent(
|
|
95
106
|
new CustomEvent('cell-activate', {
|
|
96
107
|
detail: {
|
|
@@ -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';
|
|
@@ -118,6 +118,11 @@ export declare class GridColumnMixinClass<
|
|
|
118
118
|
> extends ColumnBaseMixinClass<TItem, Column> {
|
|
119
119
|
/**
|
|
120
120
|
* Width of the cells for this column.
|
|
121
|
+
*
|
|
122
|
+
* Please note that using the `em` length unit is discouraged as
|
|
123
|
+
* it might lead to misalignment issues if the header, body, and footer
|
|
124
|
+
* cells have different font sizes. Instead, use `rem` if you need
|
|
125
|
+
* a length unit relative to the font size.
|
|
121
126
|
*/
|
|
122
127
|
width: string | null | undefined;
|
|
123
128
|
|
|
@@ -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
|
|
|
@@ -848,6 +852,11 @@ export const GridColumnMixin = (superClass) =>
|
|
|
848
852
|
return {
|
|
849
853
|
/**
|
|
850
854
|
* Width of the cells for this column.
|
|
855
|
+
*
|
|
856
|
+
* Please note that using the `em` length unit is discouraged as
|
|
857
|
+
* it might lead to misalignment issues if the header, body, and footer
|
|
858
|
+
* cells have different font sizes. Instead, use `rem` if you need
|
|
859
|
+
* a length unit relative to the font size.
|
|
851
860
|
*/
|
|
852
861
|
width: {
|
|
853
862
|
type: String,
|
|
@@ -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);
|
|
@@ -238,6 +234,12 @@ export const DataProviderMixin = (superClass) =>
|
|
|
238
234
|
|
|
239
235
|
// Cells part attribute
|
|
240
236
|
updateCellsPart(cells, 'loading-row-cell', loading);
|
|
237
|
+
|
|
238
|
+
if (loading) {
|
|
239
|
+
// Run style generators for the loading row to have custom names cleared
|
|
240
|
+
this._generateCellClassNames(row);
|
|
241
|
+
this._generateCellPartNames(row);
|
|
242
|
+
}
|
|
241
243
|
}
|
|
242
244
|
|
|
243
245
|
/**
|
|
@@ -325,8 +327,18 @@ export const DataProviderMixin = (superClass) =>
|
|
|
325
327
|
|
|
326
328
|
/** @protected */
|
|
327
329
|
_onDataProviderPageReceived() {
|
|
328
|
-
//
|
|
329
|
-
this._flatSize
|
|
330
|
+
// If the page response affected the flat size
|
|
331
|
+
if (this._flatSize !== this._dataProviderController.flatSize) {
|
|
332
|
+
// Schedule an update of all rendered rows by _debouncerApplyCachedData,
|
|
333
|
+
// to ensure that all pages associated with the rendered rows are loaded.
|
|
334
|
+
this._shouldUpdateAllRenderedRowsAfterPageLoad = true;
|
|
335
|
+
|
|
336
|
+
// TODO: Updating the flat size property can still result in a synchonous virtualizer update
|
|
337
|
+
// if the size change requires the virtualizer to increase the amount of physical elements
|
|
338
|
+
// to display new items e.g. the viewport fits 10 items and the size changes from 1 to 10.
|
|
339
|
+
// This is something to be optimized in the future.
|
|
340
|
+
this._flatSize = this._dataProviderController.flatSize;
|
|
341
|
+
}
|
|
330
342
|
|
|
331
343
|
// After updating the cache, check if some of the expanded items should have sub-caches loaded
|
|
332
344
|
this._getRenderedRows().forEach((row) => {
|
|
@@ -342,9 +354,12 @@ export const DataProviderMixin = (superClass) =>
|
|
|
342
354
|
this._debouncerApplyCachedData = Debouncer.debounce(this._debouncerApplyCachedData, timeOut.after(0), () => {
|
|
343
355
|
this._setLoading(false);
|
|
344
356
|
|
|
357
|
+
const shouldUpdateAllRenderedRowsAfterPageLoad = this._shouldUpdateAllRenderedRowsAfterPageLoad;
|
|
358
|
+
this._shouldUpdateAllRenderedRowsAfterPageLoad = false;
|
|
359
|
+
|
|
345
360
|
this._getRenderedRows().forEach((row) => {
|
|
346
361
|
const { item } = this._dataProviderController.getFlatIndexContext(row.index);
|
|
347
|
-
if (item) {
|
|
362
|
+
if (item || shouldUpdateAllRenderedRowsAfterPageLoad) {
|
|
348
363
|
this._getItem(row.index, row);
|
|
349
364
|
}
|
|
350
365
|
});
|
|
@@ -374,7 +389,7 @@ export const DataProviderMixin = (superClass) =>
|
|
|
374
389
|
this._hasData = false;
|
|
375
390
|
this.__updateVisibleRows();
|
|
376
391
|
|
|
377
|
-
if (!this.__virtualizer.size) {
|
|
392
|
+
if (!this.__virtualizer || !this.__virtualizer.size) {
|
|
378
393
|
this._dataProviderController.loadFirstPage();
|
|
379
394
|
}
|
|
380
395
|
}
|
|
@@ -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';
|