@vaadin/grid 24.4.0-dev.b3e1d14600 → 24.5.0-alpha1
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 +4 -5
- 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 +29 -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 +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 +2 -5
- 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 +30 -16
- package/src/vaadin-grid-mixin.d.ts +1 -1
- package/src/vaadin-grid-mixin.js +77 -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 +33 -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 +2 -1
- package/src/vaadin-grid.js +10 -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 +10 -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 +10 -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-styles.js +6 -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,14 +5,13 @@ 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
|
-
<vaadin-grid
|
|
10
|
+
<vaadin-grid column-reordering-allowed multi-sort>
|
|
12
11
|
<vaadin-grid-selection-column auto-select frozen></vaadin-grid-selection-column>
|
|
13
|
-
<vaadin-grid-sort-column width="
|
|
14
|
-
<vaadin-grid-sort-column width="
|
|
15
|
-
<vaadin-grid-column id="address" width="
|
|
12
|
+
<vaadin-grid-sort-column width="9rem" path="firstName"></vaadin-grid-sort-column>
|
|
13
|
+
<vaadin-grid-sort-column width="9rem" path="lastName"></vaadin-grid-sort-column>
|
|
14
|
+
<vaadin-grid-column id="address" width="15rem" flex-grow="2" header="Address"></vaadin-grid-column>
|
|
16
15
|
</vaadin-grid>
|
|
17
16
|
|
|
18
17
|
<script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.5.0-alpha1",
|
|
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.
|
|
50
|
-
"@vaadin/checkbox": "24.
|
|
51
|
-
"@vaadin/component-base": "24.
|
|
52
|
-
"@vaadin/lit-renderer": "24.
|
|
53
|
-
"@vaadin/text-field": "24.
|
|
54
|
-
"@vaadin/vaadin-lumo-styles": "24.
|
|
55
|
-
"@vaadin/vaadin-material-styles": "24.
|
|
56
|
-
"@vaadin/vaadin-themable-mixin": "24.
|
|
49
|
+
"@vaadin/a11y-base": "24.5.0-alpha1",
|
|
50
|
+
"@vaadin/checkbox": "24.5.0-alpha1",
|
|
51
|
+
"@vaadin/component-base": "24.5.0-alpha1",
|
|
52
|
+
"@vaadin/lit-renderer": "24.5.0-alpha1",
|
|
53
|
+
"@vaadin/text-field": "24.5.0-alpha1",
|
|
54
|
+
"@vaadin/vaadin-lumo-styles": "24.5.0-alpha1",
|
|
55
|
+
"@vaadin/vaadin-material-styles": "24.5.0-alpha1",
|
|
56
|
+
"@vaadin/vaadin-themable-mixin": "24.5.0-alpha1",
|
|
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": "57806caac5468532a3b4e3dbdda730cd0fca193a"
|
|
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,41 @@ 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 is the empty state cell
|
|
86
|
+
cell === this.$.emptystatecell ||
|
|
87
|
+
// Cell content is focused
|
|
88
|
+
cell._content.contains(this.getRootNode().activeElement) ||
|
|
89
|
+
// Clicked on a focusable element
|
|
90
|
+
this._isFocusable(e.target) ||
|
|
91
|
+
// Clicked on a label element
|
|
92
|
+
e.target instanceof HTMLLabelElement
|
|
93
|
+
);
|
|
94
|
+
}
|
|
83
95
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
/**
|
|
97
|
+
* @param {!MouseEvent} e
|
|
98
|
+
* @protected
|
|
99
|
+
*/
|
|
100
|
+
_onClick(e) {
|
|
101
|
+
if (this._shouldPreventCellActivationOnClick(e)) {
|
|
87
102
|
return;
|
|
88
103
|
}
|
|
89
|
-
const cellContent = cell._content;
|
|
90
104
|
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
if (!cellContentHasFocus && !this._isFocusable(e.target) && !(e.target instanceof HTMLLabelElement)) {
|
|
105
|
+
const { cell } = this._getGridEventLocation(e);
|
|
106
|
+
if (cell) {
|
|
94
107
|
this.dispatchEvent(
|
|
95
108
|
new CustomEvent('cell-activate', {
|
|
96
109
|
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);
|
|
@@ -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
|
|
|
@@ -33,10 +33,7 @@ export const EventContextMixin = (superClass) =>
|
|
|
33
33
|
getEventContext(event) {
|
|
34
34
|
const context = {};
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
// to avoid problem when accessing it after a timeout on iOS
|
|
38
|
-
const path = event.__composedPath || event.composedPath();
|
|
39
|
-
const cell = path[path.indexOf(this.$.table) - 3];
|
|
36
|
+
const { cell } = this._getGridEventLocation(event);
|
|
40
37
|
|
|
41
38
|
if (!cell) {
|
|
42
39
|
return context;
|
|
@@ -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';
|