@vaadin/grid 25.0.0-alpha1 → 25.0.0-alpha10
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 +14 -12
- package/src/array-data-provider.js +6 -0
- package/src/lit/column-renderer-directives.d.ts +0 -1
- package/src/styles/vaadin-grid-base-styles.d.ts +8 -0
- package/src/styles/vaadin-grid-base-styles.js +510 -0
- package/src/styles/vaadin-grid-core-styles.d.ts +8 -0
- package/src/{vaadin-grid-styles.js → styles/vaadin-grid-core-styles.js} +2 -3
- package/src/styles/vaadin-grid-filter-base-styles.d.ts +8 -0
- package/src/styles/vaadin-grid-filter-base-styles.js +18 -0
- package/src/styles/vaadin-grid-filter-core-styles.d.ts +8 -0
- package/src/styles/vaadin-grid-filter-core-styles.js +18 -0
- package/src/styles/vaadin-grid-sorter-base-styles.d.ts +8 -0
- package/src/styles/vaadin-grid-sorter-base-styles.js +63 -0
- package/src/styles/vaadin-grid-sorter-core-styles.d.ts +8 -0
- package/src/styles/vaadin-grid-sorter-core-styles.js +61 -0
- package/src/styles/vaadin-grid-tree-toggle-base-styles.d.ts +8 -0
- package/src/styles/vaadin-grid-tree-toggle-base-styles.js +76 -0
- package/src/styles/vaadin-grid-tree-toggle-core-styles.d.ts +8 -0
- package/src/styles/vaadin-grid-tree-toggle-core-styles.js +78 -0
- package/src/vaadin-grid-column-auto-width-mixin.js +8 -2
- package/src/vaadin-grid-data-provider-mixin.js +19 -76
- package/src/vaadin-grid-drag-and-drop-mixin.js +3 -0
- package/src/vaadin-grid-filter-element-mixin.js +0 -17
- package/src/vaadin-grid-filter.js +7 -1
- package/src/vaadin-grid-keyboard-navigation-mixin.js +1 -1
- package/src/vaadin-grid-mixin.js +50 -28
- package/src/vaadin-grid-row-details-mixin.js +4 -4
- package/src/vaadin-grid-scroll-mixin.js +52 -21
- package/src/vaadin-grid-sorter-mixin.js +0 -60
- package/src/vaadin-grid-sorter.js +7 -1
- package/src/vaadin-grid-tree-toggle-mixin.js +0 -77
- package/src/vaadin-grid-tree-toggle.js +9 -1
- package/src/vaadin-grid.d.ts +1 -1
- package/src/vaadin-grid.js +4 -3
- package/theme/lumo/vaadin-grid-styles.js +1 -1
- package/web-types.json +4 -4
- package/web-types.lit.json +4 -4
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const gridSorterStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
max-width: 100%;
|
|
15
|
+
gap: var(--vaadin-gap-container-inline);
|
|
16
|
+
-webkit-user-select: none;
|
|
17
|
+
user-select: none;
|
|
18
|
+
-webkit-tap-highlight-color: transparent;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[part='content'] {
|
|
22
|
+
flex: 1 1 auto;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[part='indicators'] {
|
|
28
|
+
position: relative;
|
|
29
|
+
flex: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[part='order'] {
|
|
33
|
+
display: inline;
|
|
34
|
+
vertical-align: super;
|
|
35
|
+
font-size: 0.75em;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[part='indicators']::before {
|
|
40
|
+
content: '';
|
|
41
|
+
display: inline-block;
|
|
42
|
+
height: 12px;
|
|
43
|
+
width: 8px;
|
|
44
|
+
mask-image: var(--_vaadin-icon-sort);
|
|
45
|
+
background: currentColor;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host([direction]) [part='indicators']::before {
|
|
49
|
+
padding-bottom: 6px;
|
|
50
|
+
height: 6px;
|
|
51
|
+
mask-clip: content-box;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([direction='desc']) [part='indicators']::before {
|
|
55
|
+
padding-block: 6px 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@media (forced-colors: active) {
|
|
59
|
+
[part='indicators']::before {
|
|
60
|
+
background: CanvasText;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
|
|
8
|
+
const template = document.createElement('template');
|
|
9
|
+
|
|
10
|
+
template.innerHTML = `
|
|
11
|
+
<style>
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: 'vaadin-grid-sorter-icons';
|
|
14
|
+
src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAQwAA0AAAAABuwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAEFAAAABkAAAAcfep+mUdERUYAAAP4AAAAHAAAAB4AJwAOT1MvMgAAAZgAAAA/AAAAYA8TBPpjbWFwAAAB7AAAAFUAAAFeF1fZ4mdhc3AAAAPwAAAACAAAAAgAAAAQZ2x5ZgAAAlgAAABcAAAAnMvguMloZWFkAAABMAAAAC8AAAA2C5Ap72hoZWEAAAFgAAAAHQAAACQGbQPHaG10eAAAAdgAAAAUAAAAHAoAAABsb2NhAAACRAAAABIAAAASAIwAYG1heHAAAAGAAAAAFgAAACAACwAKbmFtZQAAArQAAAECAAACZxWCgKhwb3N0AAADuAAAADUAAABZCrApUXicY2BkYGAA4rDECVrx/DZfGbhZGEDgyqNPOxH0/wNMq5kPALkcDEwgUQBWRA0dAHicY2BkYGA+8P8AAwMLAwgwrWZgZEAFbABY4QM8AAAAeJxjYGRgYOAAQiYGEICQSAAAAi8AFgAAeJxjYGY6yziBgZWBgWkm0xkGBoZ+CM34msGYkZMBFTAKoAkwODAwvmRiPvD/AIMDMxCD1CDJKjAwAgBktQsXAHicY2GAAMZQCM0EwqshbAALxAEKeJxjYGBgZoBgGQZGBhCIAPIYwXwWBhsgzcXAwcAEhIwMCi+Z/v/9/x+sSuElA4T9/4k4K1gHFwMMMILMY2QDYmaoABOQYGJABUA7WBiGNwAAJd4NIQAAAAAAAAAACAAIABAAGAAmAEAATgAAeJyNjLENgDAMBP9tIURJwQCMQccSZgk2i5fIYBDAidJjycXr7x5EPwE2wY8si7jmyBNXGo/bNBerxJNrpxhbO3/fEFpx8ZICpV+ghxJ74fAMe+h7Ox14AbrsHB14nK2QQWrDMBRER4mTkhQK3ZRQKOgCNk7oGQqhhEIX2WSlWEI1BAlkJ5CDdNsj5Ey9Rncdi38ES+jzNJo/HwTgATcoDEthhY3wBHc4CE+pfwsX5F/hGe7Vo/AcK/UhvMSz+mGXKhZU6pww8ISz3oWn1BvhgnwTnuEJf8Jz1OpFeIlX9YULDLdFi4ASHolkSR0iuYdjLak1vAequBhj21D61Nqyi6l3qWybGPjySbPHGScGJl6dP58MYcQRI0bts7mjebBqrFENH7t3qWtj0OuqHnXcW7b0HOTZFnKryRGW2hFX1m0O2vEM3opNMfTau+CS6Z3Vx6veNnEXY6jwDxhsc2gAAHicY2BiwA84GBgYmRiYGJkZmBlZGFkZ2djScyoLMgzZS/MyDQwMwLSrpYEBlIbxjQDrzgsuAAAAAAEAAf//AA94nGNgZGBg4AFiMSBmYmAEQnYgZgHzGAAD6wA2eJxjYGBgZACCKyoz1cD0o087YTQATOcIewAAAA==) format('woff');
|
|
15
|
+
font-weight: normal;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
document.head.appendChild(template.content);
|
|
22
|
+
|
|
23
|
+
export const gridSorterStyles = css`
|
|
24
|
+
:host {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[part='content'] {
|
|
31
|
+
flex: 1 1 auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[part='indicators'] {
|
|
35
|
+
position: relative;
|
|
36
|
+
align-self: center;
|
|
37
|
+
flex: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[part='order'] {
|
|
41
|
+
display: inline;
|
|
42
|
+
vertical-align: super;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[part='indicators']::before {
|
|
46
|
+
font-family: 'vaadin-grid-sorter-icons';
|
|
47
|
+
display: inline-block;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host(:not([direction])) [part='indicators']::before {
|
|
51
|
+
content: '\\e901';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([direction='asc']) [part='indicators']::before {
|
|
55
|
+
content: '\\e900';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([direction='desc']) [part='indicators']::before {
|
|
59
|
+
content: '\\e902';
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const gridTreeToggleStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: flex;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Don't expand/collapse when clicking #level-spacer */
|
|
17
|
+
[part] {
|
|
18
|
+
pointer-events: auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([hidden]) {
|
|
22
|
+
display: none !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host(:not([leaf])) {
|
|
26
|
+
cursor: var(--vaadin-clickable-cursor);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#level-spacer,
|
|
30
|
+
[part='toggle'] {
|
|
31
|
+
flex: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#level-spacer {
|
|
35
|
+
width: calc(var(--_level, 0) * var(--vaadin-grid-tree-toggle-level-offset, 16px));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[part='toggle'] {
|
|
39
|
+
margin-inline-end: var(--vaadin-gap-container-inline);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[part='toggle']::before {
|
|
43
|
+
content: '';
|
|
44
|
+
display: block;
|
|
45
|
+
width: var(--vaadin-icon-size, 1lh);
|
|
46
|
+
height: var(--vaadin-icon-size, 1lh);
|
|
47
|
+
background: currentColor;
|
|
48
|
+
mask-image: var(--_vaadin-icon-chevron-down);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host(:not([expanded])) [part='toggle']::before {
|
|
52
|
+
rotate: -90deg;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
56
|
+
[part='toggle']::before {
|
|
57
|
+
transition: rotate 120ms;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([leaf]) [part='toggle'] {
|
|
62
|
+
visibility: hidden;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
slot {
|
|
66
|
+
display: block;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (forced-colors: active) {
|
|
72
|
+
[part='toggle']::before {
|
|
73
|
+
background: CanvasText;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
|
|
8
|
+
const template = document.createElement('template');
|
|
9
|
+
|
|
10
|
+
template.innerHTML = `
|
|
11
|
+
<style>
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: "vaadin-grid-tree-icons";
|
|
14
|
+
src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAQkAA0AAAAABrwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAECAAAABoAAAAcgHwa6EdERUYAAAPsAAAAHAAAAB4AJwAOT1MvMgAAAZQAAAA/AAAAYA8TBIJjbWFwAAAB8AAAAFUAAAFeGJvXWmdhc3AAAAPkAAAACAAAAAgAAAAQZ2x5ZgAAAlwAAABLAAAAhIrPOhFoZWFkAAABMAAAACsAAAA2DsJI02hoZWEAAAFcAAAAHQAAACQHAgPHaG10eAAAAdQAAAAZAAAAHAxVAgBsb2NhAAACSAAAABIAAAASAIAAVG1heHAAAAF8AAAAGAAAACAACgAFbmFtZQAAAqgAAAECAAACTwflzbdwb3N0AAADrAAAADYAAABZQ7Ajh3icY2BkYGAA4twv3Vfi+W2+MnCzMIDANSOmbGSa2YEZRHEwMIEoAAoiB6sAeJxjYGRgYD7w/wADAwsDCDA7MDAyoAI2AFEEAtIAAAB4nGNgZGBg4GBgZgDRDAxMDGgAAAGbABB4nGNgZp7JOIGBlYGBaSbTGQYGhn4IzfiawZiRkwEVMAqgCTA4MDA+38d84P8BBgdmIAapQZJVYGAEAGc/C54AeJxjYYAAxlAIzQTELAwMBxgZGB0ACy0BYwAAAHicY2BgYGaAYBkGRgYQiADyGMF8FgYbIM3FwMHABISMDArP9/3/+/8/WJXC8z0Q9v8nEp5gHVwMMMAIMo+RDYiZoQJMQIKJARUA7WBhGN4AACFKDtoAAAAAAAAAAAgACAAQABgAJgA0AEIAAHichYvBEYBADAKBVHBjBT4swl9KS2k05o0XHd/yW1hAfBFwCv9sIlJu3nZaNS3PXAaXXHI8Lge7DlzF7C1RgXc7xkK6+gvcD2URmQB4nK2RQWoCMRiFX3RUqtCli65yADModOMBLLgQSqHddRFnQghIAnEUvEA3vUUP0LP0Fj1G+yb8R5iEhO9/ef/7FwFwj28o9EthiVp4hBlehcfUP4Ur8o/wBAv8CU+xVFvhOR7UB7tUdUdlVRJ6HnHWTnhM/V24In8JT5j/KzzFSi2E53hUz7jCcrcIiDDwyKSW1JEct2HdIPH1DFytbUM0PofWdNk5E5oUqb/Q6HHBiVGZpfOXkyUMEj5IyBuNmYZQjBobfsuassvnkKLe1OuBBj0VQ8cRni2xjLWsHaM0jrjx3peYA0/vrdmUYqe9iy7bzrX6eNP7Jh1SijX+AaUVbB8AAHicY2BiwA84GBgYmRiYGJkZmBlZGFkZ2djScyoLMgzZS/MyDQwMwLSruZMzlHaB0q4A76kLlwAAAAEAAf//AA94nGNgZGBg4AFiMSBmYmAEQnYgZgHzGAAD6wA2eJxjYGBgZACCKxJigiD6mhFTNowGACmcA/8AAA==) format('woff');
|
|
15
|
+
font-weight: normal;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
document.head.appendChild(template.content);
|
|
22
|
+
|
|
23
|
+
export const gridTreeToggleStyles = css`
|
|
24
|
+
:host {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: baseline;
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
|
|
29
|
+
/* CSS API for :host */
|
|
30
|
+
--vaadin-grid-tree-toggle-level-offset: 1em;
|
|
31
|
+
--_collapsed-icon: '\\e7be\\00a0';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([dir='rtl']) {
|
|
35
|
+
--_collapsed-icon: '\\e7bd\\00a0';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([hidden]) {
|
|
39
|
+
display: none !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host(:not([leaf])) {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#level-spacer,
|
|
47
|
+
[part='toggle'] {
|
|
48
|
+
flex: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#level-spacer {
|
|
52
|
+
display: inline-block;
|
|
53
|
+
width: calc(var(--_level, '0') * var(--vaadin-grid-tree-toggle-level-offset));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[part='toggle']::before {
|
|
57
|
+
font-family: 'vaadin-grid-tree-icons';
|
|
58
|
+
line-height: 1em; /* make icon font metrics not affect baseline */
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host(:not([expanded])) [part='toggle']::before {
|
|
62
|
+
content: var(--_collapsed-icon);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host([expanded]) [part='toggle']::before {
|
|
66
|
+
content: '\\e7bc\\00a0'; /* icon glyph + single non-breaking space */
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:host([leaf]) [part='toggle'] {
|
|
70
|
+
visibility: hidden;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
slot {
|
|
74
|
+
display: block;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
text-overflow: ellipsis;
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
@@ -59,9 +59,15 @@ export const ColumnAutoWidthMixin = (superClass) =>
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/** @private */
|
|
62
|
-
__flatSizeChangedAutoWidth() {
|
|
62
|
+
__flatSizeChangedAutoWidth(flatSize) {
|
|
63
63
|
// Flat size changed, recalculate column widths if pending (asynchronously, to allow grid to render row elements first)
|
|
64
|
-
requestAnimationFrame(() =>
|
|
64
|
+
requestAnimationFrame(() => {
|
|
65
|
+
if (!!flatSize && !this.__hasHadRenderedRowsForColumnWidthCalculation) {
|
|
66
|
+
this.recalculateColumnWidths();
|
|
67
|
+
} else {
|
|
68
|
+
this.__tryToRecalculateColumnWidthsIfPending();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
/**
|
|
@@ -7,7 +7,6 @@ import { microTask, timeOut } from '@vaadin/component-base/src/async.js';
|
|
|
7
7
|
import { DataProviderController } from '@vaadin/component-base/src/data-provider-controller/data-provider-controller.js';
|
|
8
8
|
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
9
9
|
import { get } from '@vaadin/component-base/src/path-utils.js';
|
|
10
|
-
import { getBodyRowCells, updateCellsPart, updateState } from './vaadin-grid-helpers.js';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* @polymerMixin
|
|
@@ -166,24 +165,6 @@ export const DataProviderMixin = (superClass) =>
|
|
|
166
165
|
this._dataProviderController.addEventListener('page-loaded', this._onDataProviderPageLoaded.bind(this));
|
|
167
166
|
}
|
|
168
167
|
|
|
169
|
-
/**
|
|
170
|
-
* @protected
|
|
171
|
-
* @deprecated since 24.3 and will be removed in Vaadin 25.
|
|
172
|
-
*/
|
|
173
|
-
get _cache() {
|
|
174
|
-
console.warn('<vaadin-grid> The `_cache` property is deprecated and will be removed in Vaadin 25.');
|
|
175
|
-
return this._dataProviderController.rootCache;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* @protected
|
|
180
|
-
* @deprecated since 24.3 and will be removed in Vaadin 25.
|
|
181
|
-
*/
|
|
182
|
-
get _effectiveSize() {
|
|
183
|
-
console.warn('<vaadin-grid> The `_effectiveSize` property is deprecated and will be removed in Vaadin 25.');
|
|
184
|
-
return this._flatSize;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
168
|
/** @private */
|
|
188
169
|
_sizeChanged(size) {
|
|
189
170
|
this._dataProviderController.rootCache.size = size;
|
|
@@ -200,46 +181,20 @@ export const DataProviderMixin = (superClass) =>
|
|
|
200
181
|
this.requestContentUpdate();
|
|
201
182
|
}
|
|
202
183
|
|
|
203
|
-
/**
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
*/
|
|
208
|
-
_getItem(index, el) {
|
|
209
|
-
el.index = index;
|
|
210
|
-
|
|
211
|
-
const { item } = this._dataProviderController.getFlatIndexContext(index);
|
|
212
|
-
if (item) {
|
|
213
|
-
this.__updateLoading(el, false);
|
|
214
|
-
this._updateItem(el, item);
|
|
215
|
-
if (this._isExpanded(item)) {
|
|
216
|
-
this._dataProviderController.ensureFlatIndexHierarchy(index);
|
|
217
|
-
}
|
|
218
|
-
} else {
|
|
219
|
-
this.__updateLoading(el, true);
|
|
220
|
-
this._dataProviderController.ensureFlatIndexLoaded(index);
|
|
221
|
-
}
|
|
184
|
+
/** @private */
|
|
185
|
+
__getRowItem(row) {
|
|
186
|
+
const { item } = this._dataProviderController.getFlatIndexContext(row.index);
|
|
187
|
+
return item;
|
|
222
188
|
}
|
|
223
189
|
|
|
224
|
-
/**
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
*/
|
|
229
|
-
__updateLoading(row, loading) {
|
|
230
|
-
const cells = getBodyRowCells(row);
|
|
231
|
-
|
|
232
|
-
// Row state attribute
|
|
233
|
-
updateState(row, 'loading', loading);
|
|
234
|
-
|
|
235
|
-
// Cells part attribute
|
|
236
|
-
updateCellsPart(cells, 'loading-row-cell', loading);
|
|
190
|
+
/** @private */
|
|
191
|
+
__ensureRowItem(row) {
|
|
192
|
+
this._dataProviderController.ensureFlatIndexLoaded(row.index);
|
|
193
|
+
}
|
|
237
194
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
this._generateCellPartNames(row);
|
|
242
|
-
}
|
|
195
|
+
/** @private */
|
|
196
|
+
__ensureRowHierarchy(row) {
|
|
197
|
+
this._dataProviderController.ensureFlatIndexHierarchy(row.index);
|
|
243
198
|
}
|
|
244
199
|
|
|
245
200
|
/**
|
|
@@ -309,17 +264,6 @@ export const DataProviderMixin = (superClass) =>
|
|
|
309
264
|
return level;
|
|
310
265
|
}
|
|
311
266
|
|
|
312
|
-
/**
|
|
313
|
-
* @param {number} page
|
|
314
|
-
* @param {ItemCache} cache
|
|
315
|
-
* @protected
|
|
316
|
-
* @deprecated since 24.3 and will be removed in Vaadin 25.
|
|
317
|
-
*/
|
|
318
|
-
_loadPage(page, cache) {
|
|
319
|
-
console.warn('<vaadin-grid> The `_loadPage` method is deprecated and will be removed in Vaadin 25.');
|
|
320
|
-
this._dataProviderController.__loadCachePage(cache, page);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
267
|
/** @protected */
|
|
324
268
|
_onDataProviderPageRequested() {
|
|
325
269
|
this._setLoading(true);
|
|
@@ -331,7 +275,7 @@ export const DataProviderMixin = (superClass) =>
|
|
|
331
275
|
if (this._flatSize !== this._dataProviderController.flatSize) {
|
|
332
276
|
// Schedule an update of all rendered rows by _debouncerApplyCachedData,
|
|
333
277
|
// to ensure that all pages associated with the rendered rows are loaded.
|
|
334
|
-
this.
|
|
278
|
+
this._shouldLoadAllRenderedRowsAfterPageLoad = true;
|
|
335
279
|
|
|
336
280
|
// TODO: Updating the flat size property can still result in a synchonous virtualizer update
|
|
337
281
|
// if the size change requires the virtualizer to increase the amount of physical elements
|
|
@@ -341,9 +285,7 @@ export const DataProviderMixin = (superClass) =>
|
|
|
341
285
|
}
|
|
342
286
|
|
|
343
287
|
// After updating the cache, check if some of the expanded items should have sub-caches loaded
|
|
344
|
-
this._getRenderedRows().forEach((row) =>
|
|
345
|
-
this._dataProviderController.ensureFlatIndexHierarchy(row.index);
|
|
346
|
-
});
|
|
288
|
+
this._getRenderedRows().forEach((row) => this.__ensureRowHierarchy(row));
|
|
347
289
|
|
|
348
290
|
this._hasData = true;
|
|
349
291
|
}
|
|
@@ -354,13 +296,14 @@ export const DataProviderMixin = (superClass) =>
|
|
|
354
296
|
this._debouncerApplyCachedData = Debouncer.debounce(this._debouncerApplyCachedData, timeOut.after(0), () => {
|
|
355
297
|
this._setLoading(false);
|
|
356
298
|
|
|
357
|
-
const
|
|
358
|
-
this.
|
|
299
|
+
const shouldLoadAllRenderedRowsAfterPageLoad = this._shouldLoadAllRenderedRowsAfterPageLoad;
|
|
300
|
+
this._shouldLoadAllRenderedRowsAfterPageLoad = false;
|
|
359
301
|
|
|
360
302
|
this._getRenderedRows().forEach((row) => {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
303
|
+
this.__updateRow(row);
|
|
304
|
+
|
|
305
|
+
if (shouldLoadAllRenderedRowsAfterPageLoad) {
|
|
306
|
+
this.__ensureRowItem(row);
|
|
364
307
|
}
|
|
365
308
|
});
|
|
366
309
|
|
|
@@ -247,6 +247,9 @@ export const DragAndDropMixin = (superClass) =>
|
|
|
247
247
|
|
|
248
248
|
let row = e.composedPath().find((node) => node.localName === 'tr');
|
|
249
249
|
|
|
250
|
+
// Update the horizontal scroll position property of the row being dragged over
|
|
251
|
+
this.__updateRowScrollPositionProperty(row);
|
|
252
|
+
|
|
250
253
|
if (!this._flatSize || this.dropMode === DropMode.ON_GRID) {
|
|
251
254
|
// The grid is empty or "on-grid" drop mode was used, always default to "empty"
|
|
252
255
|
this._dropLocation = DropLocation.EMPTY;
|
|
@@ -6,23 +6,6 @@
|
|
|
6
6
|
import { timeOut } from '@vaadin/component-base/src/async.js';
|
|
7
7
|
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
8
8
|
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
9
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin';
|
|
10
|
-
|
|
11
|
-
registerStyles(
|
|
12
|
-
'vaadin-grid-filter',
|
|
13
|
-
css`
|
|
14
|
-
:host {
|
|
15
|
-
display: inline-flex;
|
|
16
|
-
max-width: 100%;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
::slotted(*) {
|
|
20
|
-
width: 100%;
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
}
|
|
23
|
-
`,
|
|
24
|
-
{ moduleId: 'vaadin-grid-filter-styles' },
|
|
25
|
-
);
|
|
26
9
|
|
|
27
10
|
/**
|
|
28
11
|
* @polymerMixin
|
|
@@ -8,6 +8,8 @@ import { html, LitElement } from 'lit';
|
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
10
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
|
+
import { gridFilterStyles } from './styles/vaadin-grid-filter-core-styles.js';
|
|
11
13
|
import { GridFilterElementMixin } from './vaadin-grid-filter-element-mixin.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
@@ -39,11 +41,15 @@ import { GridFilterElementMixin } from './vaadin-grid-filter-element-mixin.js';
|
|
|
39
41
|
* @extends HTMLElement
|
|
40
42
|
* @mixes GridFilterElementMixin
|
|
41
43
|
*/
|
|
42
|
-
class GridFilter extends GridFilterElementMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
44
|
+
class GridFilter extends GridFilterElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))) {
|
|
43
45
|
static get is() {
|
|
44
46
|
return 'vaadin-grid-filter';
|
|
45
47
|
}
|
|
46
48
|
|
|
49
|
+
static get styles() {
|
|
50
|
+
return gridFilterStyles;
|
|
51
|
+
}
|
|
52
|
+
|
|
47
53
|
/** @protected */
|
|
48
54
|
render() {
|
|
49
55
|
return html`<slot></slot>`;
|