@vaadin/grid 25.0.0-alpha3 → 25.0.0-alpha4

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.
Files changed (33) hide show
  1. package/package.json +13 -11
  2. package/src/array-data-provider.js +6 -0
  3. package/src/lit/column-renderer-directives.d.ts +0 -1
  4. package/src/styles/vaadin-grid-base-styles.d.ts +8 -0
  5. package/src/styles/vaadin-grid-base-styles.js +505 -0
  6. package/src/styles/vaadin-grid-core-styles.d.ts +8 -0
  7. package/src/{vaadin-grid-styles.js → styles/vaadin-grid-core-styles.js} +2 -1
  8. package/src/styles/vaadin-grid-filter-base-styles.d.ts +8 -0
  9. package/src/styles/vaadin-grid-filter-base-styles.js +20 -0
  10. package/src/styles/vaadin-grid-filter-core-styles.d.ts +8 -0
  11. package/src/styles/vaadin-grid-filter-core-styles.js +18 -0
  12. package/src/styles/vaadin-grid-sorter-base-styles.d.ts +8 -0
  13. package/src/styles/vaadin-grid-sorter-base-styles.js +65 -0
  14. package/src/styles/vaadin-grid-sorter-core-styles.d.ts +8 -0
  15. package/src/styles/vaadin-grid-sorter-core-styles.js +61 -0
  16. package/src/styles/vaadin-grid-tree-toggle-base-styles.d.ts +8 -0
  17. package/src/styles/vaadin-grid-tree-toggle-base-styles.js +78 -0
  18. package/src/styles/vaadin-grid-tree-toggle-core-styles.d.ts +8 -0
  19. package/src/styles/vaadin-grid-tree-toggle-core-styles.js +78 -0
  20. package/src/vaadin-grid-data-provider-mixin.js +0 -29
  21. package/src/vaadin-grid-drag-and-drop-mixin.js +3 -0
  22. package/src/vaadin-grid-filter-element-mixin.js +0 -17
  23. package/src/vaadin-grid-filter.js +5 -0
  24. package/src/vaadin-grid-mixin.js +5 -17
  25. package/src/vaadin-grid-scroll-mixin.js +20 -4
  26. package/src/vaadin-grid-sorter-mixin.js +0 -60
  27. package/src/vaadin-grid-sorter.js +5 -0
  28. package/src/vaadin-grid-tree-toggle-mixin.js +0 -77
  29. package/src/vaadin-grid-tree-toggle.js +5 -0
  30. package/src/vaadin-grid.js +1 -1
  31. package/theme/lumo/vaadin-grid-styles.js +1 -1
  32. package/web-types.json +4 -4
  33. package/web-types.lit.json +4 -4
@@ -0,0 +1,65 @@
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
+ @layer base {
11
+ :host {
12
+ display: inline-flex;
13
+ align-items: center;
14
+ cursor: pointer;
15
+ max-width: 100%;
16
+ gap: var(--_vaadin-gap-container-inline);
17
+ -webkit-user-select: none;
18
+ user-select: none;
19
+ -webkit-tap-highlight-color: transparent;
20
+ }
21
+
22
+ [part='content'] {
23
+ flex: 1 1 auto;
24
+ overflow: hidden;
25
+ text-overflow: ellipsis;
26
+ }
27
+
28
+ [part='indicators'] {
29
+ position: relative;
30
+ flex: none;
31
+ }
32
+
33
+ [part='order'] {
34
+ display: inline;
35
+ vertical-align: super;
36
+ font-size: 0.75em;
37
+ line-height: 1;
38
+ }
39
+
40
+ [part='indicators']::before {
41
+ content: '';
42
+ display: inline-block;
43
+ height: 12px;
44
+ width: 8px;
45
+ mask-image: var(--_vaadin-icon-sort);
46
+ background: currentColor;
47
+ }
48
+
49
+ :host([direction]) [part='indicators']::before {
50
+ padding-bottom: 6px;
51
+ height: 6px;
52
+ mask-clip: content-box;
53
+ }
54
+
55
+ :host([direction='desc']) [part='indicators']::before {
56
+ padding-block: 6px 0;
57
+ }
58
+
59
+ @media (forced-colors: active) {
60
+ [part='indicators']::before {
61
+ background: CanvasText;
62
+ }
63
+ }
64
+ }
65
+ `;
@@ -0,0 +1,8 @@
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 type { CSSResult } from 'lit';
7
+
8
+ export const gridSorterStyles: CSSResult;
@@ -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,8 @@
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 type { CSSResult } from 'lit';
7
+
8
+ export const gridTreeToggleStyles: CSSResult;
@@ -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 '@vaadin/component-base/src/style-props.js';
7
+ import { css } from 'lit';
8
+
9
+ export const gridTreeToggleStyles = css`
10
+ @layer base {
11
+ :host {
12
+ display: flex;
13
+ max-width: 100%;
14
+ pointer-events: none;
15
+ }
16
+
17
+ /* Don't expand/collapse when clicking #level-spacer */
18
+ [part] {
19
+ pointer-events: auto;
20
+ }
21
+
22
+ :host([hidden]) {
23
+ display: none !important;
24
+ }
25
+
26
+ :host(:not([leaf])) {
27
+ cursor: var(--vaadin-clickable-cursor);
28
+ }
29
+
30
+ #level-spacer,
31
+ [part='toggle'] {
32
+ flex: none;
33
+ }
34
+
35
+ #level-spacer {
36
+ width: calc(var(--_level, 0) * var(--vaadin-grid-tree-toggle-level-offset, 1em));
37
+ }
38
+
39
+ [part='toggle'] {
40
+ margin-inline-end: var(--_vaadin-gap-container-inline);
41
+ }
42
+
43
+ [part='toggle']::before {
44
+ content: '';
45
+ display: block;
46
+ width: var(--vaadin-icon-size, 1lh);
47
+ height: var(--vaadin-icon-size, 1lh);
48
+ background: currentColor;
49
+ mask-image: var(--_vaadin-icon-chevron-down);
50
+ }
51
+
52
+ :host(:not([expanded])) [part='toggle']::before {
53
+ rotate: -90deg;
54
+ }
55
+
56
+ @media (prefers-reduced-motion: no-preference) {
57
+ [part='toggle']::before {
58
+ transition: rotate 120ms;
59
+ }
60
+ }
61
+
62
+ :host([leaf]) [part='toggle'] {
63
+ visibility: hidden;
64
+ }
65
+
66
+ slot {
67
+ display: block;
68
+ overflow: hidden;
69
+ text-overflow: ellipsis;
70
+ }
71
+
72
+ @media (forced-colors: active) {
73
+ [part='toggle']::before {
74
+ background: CanvasText;
75
+ }
76
+ }
77
+ }
78
+ `;
@@ -0,0 +1,8 @@
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 type { CSSResult } from 'lit';
7
+
8
+ export const gridTreeToggleStyles: CSSResult;
@@ -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
+ `;
@@ -166,24 +166,6 @@ export const DataProviderMixin = (superClass) =>
166
166
  this._dataProviderController.addEventListener('page-loaded', this._onDataProviderPageLoaded.bind(this));
167
167
  }
168
168
 
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
169
  /** @private */
188
170
  _sizeChanged(size) {
189
171
  this._dataProviderController.rootCache.size = size;
@@ -309,17 +291,6 @@ export const DataProviderMixin = (superClass) =>
309
291
  return level;
310
292
  }
311
293
 
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
294
  /** @protected */
324
295
  _onDataProviderPageRequested() {
325
296
  this._setLoading(true);
@@ -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,7 @@ 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 { gridFilterStyles } from './styles/vaadin-grid-filter-core-styles.js';
11
12
  import { GridFilterElementMixin } from './vaadin-grid-filter-element-mixin.js';
12
13
 
13
14
  /**
@@ -44,6 +45,10 @@ class GridFilter extends GridFilterElementMixin(ThemableMixin(PolylitMixin(LitEl
44
45
  return 'vaadin-grid-filter';
45
46
  }
46
47
 
48
+ static get styles() {
49
+ return gridFilterStyles;
50
+ }
51
+
47
52
  /** @protected */
48
53
  render() {
49
54
  return html`<slot></slot>`;
@@ -5,15 +5,7 @@
5
5
  */
6
6
  import { TabindexMixin } from '@vaadin/a11y-base/src/tabindex-mixin.js';
7
7
  import { animationFrame, microTask } from '@vaadin/component-base/src/async.js';
8
- import {
9
- isAndroid,
10
- isChrome,
11
- isFirefox,
12
- isIOS,
13
- isSafari,
14
- isTouch,
15
- supportsAdoptingStyleSheets,
16
- } from '@vaadin/component-base/src/browser-utils.js';
8
+ import { isAndroid, isChrome, isFirefox, isIOS, isSafari, isTouch } from '@vaadin/component-base/src/browser-utils.js';
17
9
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
18
10
  import { getClosestElement } from '@vaadin/component-base/src/dom-utils.js';
19
11
  import { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
@@ -929,15 +921,11 @@ export const GridMixin = (superClass) =>
929
921
 
930
922
  // The style is set to host instead of the scroller so that the value can be overridden by the user with "grid { min-height: 0 }"
931
923
  // Prefer setting style in adopted style sheet to avoid the need to add a confusing inline style on the host element
932
- // If adopted style sheets are not supported, the style is set inline
933
- if (!this.__minHeightStyleSheet && supportsAdoptingStyleSheets) {
924
+ if (!this.__minHeightStyleSheet) {
934
925
  this.__minHeightStyleSheet = new CSSStyleSheet();
935
- this.shadowRoot.adoptedStyleSheets = [...this.shadowRoot.adoptedStyleSheets, this.__minHeightStyleSheet];
936
- }
937
- if (this.__minHeightStyleSheet) {
938
- this.__minHeightStyleSheet.replaceSync(`:host { --_grid-min-height: ${minHeight}px; }`);
939
- } else {
940
- this.style.setProperty('--_grid-min-height', `${minHeight}px`);
926
+ this.shadowRoot.adoptedStyleSheets.push(this.__minHeightStyleSheet);
941
927
  }
928
+
929
+ this.__minHeightStyleSheet.replaceSync(`:host { --_grid-min-height: ${minHeight}px; }`);
942
930
  }
943
931
  };
@@ -476,6 +476,7 @@ export const ScrollMixin = (superClass) =>
476
476
 
477
477
  // Position frozen cells
478
478
  const x = this.__isRTL ? normalizedScrollLeft + clientWidth - scrollWidth : scrollLeft;
479
+ this.__horizontalScrollPosition = x;
479
480
  const transformFrozen = `translate(${x}px, 0)`;
480
481
  this._frozenCells.forEach((cell) => {
481
482
  cell.style.transform = transformFrozen;
@@ -511,10 +512,25 @@ export const ScrollMixin = (superClass) =>
511
512
  }
512
513
  });
513
514
 
514
- // Only update the --_grid-horizontal-scroll-position custom property when navigating
515
- // on row focus mode to avoid performance issues.
516
- if (this.hasAttribute('navigating') && this.__rowFocusMode) {
517
- this.$.table.style.setProperty('--_grid-horizontal-scroll-position', `${-x}px`);
515
+ const focusedRow = this.shadowRoot.querySelector("[part~='row']:focus");
516
+ if (focusedRow) {
517
+ // Update the horizontal scroll position property of the focused row
518
+ this.__updateRowScrollPositionProperty(focusedRow);
519
+ }
520
+ }
521
+
522
+ /**
523
+ * Synchronizes the internal `--_grid-horizontal-scroll-position` CSS property
524
+ * of the given row with the current horizontal scroll position of the grid.
525
+ * @private
526
+ */
527
+ __updateRowScrollPositionProperty(row) {
528
+ if (row instanceof HTMLTableRowElement === false) {
529
+ return;
530
+ }
531
+ const newValue = `${this.__horizontalScrollPosition}px`;
532
+ if (row.style.getPropertyValue('--_grid-horizontal-scroll-position') !== newValue) {
533
+ row.style.setProperty('--_grid-horizontal-scroll-position', newValue);
518
534
  }
519
535
  }
520
536
 
@@ -3,66 +3,6 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
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
- registerStyles(
24
- 'vaadin-grid-sorter',
25
- css`
26
- :host {
27
- display: inline-flex;
28
- cursor: pointer;
29
- max-width: 100%;
30
- }
31
-
32
- [part='content'] {
33
- flex: 1 1 auto;
34
- }
35
-
36
- [part='indicators'] {
37
- position: relative;
38
- align-self: center;
39
- flex: none;
40
- }
41
-
42
- [part='order'] {
43
- display: inline;
44
- vertical-align: super;
45
- }
46
-
47
- [part='indicators']::before {
48
- font-family: 'vaadin-grid-sorter-icons';
49
- display: inline-block;
50
- }
51
-
52
- :host(:not([direction])) [part='indicators']::before {
53
- content: '\\e901';
54
- }
55
-
56
- :host([direction='asc']) [part='indicators']::before {
57
- content: '\\e900';
58
- }
59
-
60
- :host([direction='desc']) [part='indicators']::before {
61
- content: '\\e902';
62
- }
63
- `,
64
- { moduleId: 'vaadin-grid-sorter-styles' },
65
- );
66
6
 
67
7
  /**
68
8
  * A mixin providing common sorter functionality.
@@ -8,6 +8,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
11
+ import { gridSorterStyles } from './styles/vaadin-grid-sorter-core-styles.js';
11
12
  import { GridSorterMixin } from './vaadin-grid-sorter-mixin.js';
12
13
 
13
14
  /**
@@ -60,6 +61,10 @@ class GridSorter extends GridSorterMixin(ThemableMixin(DirMixin(PolylitMixin(Lit
60
61
  return 'vaadin-grid-sorter';
61
62
  }
62
63
 
64
+ static get styles() {
65
+ return gridSorterStyles;
66
+ }
67
+
63
68
  /** @protected */
64
69
  render() {
65
70
  return html`
@@ -3,85 +3,8 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
7
6
  import { isFocusable } from './vaadin-grid-active-item-mixin.js';
8
7
 
9
- const template = document.createElement('template');
10
-
11
- template.innerHTML = `
12
- <style>
13
- @font-face {
14
- font-family: "vaadin-grid-tree-icons";
15
- 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');
16
- font-weight: normal;
17
- font-style: normal;
18
- }
19
- </style>
20
- `;
21
-
22
- document.head.appendChild(template.content);
23
-
24
- registerStyles(
25
- 'vaadin-grid-tree-toggle',
26
- css`
27
- :host {
28
- display: inline-flex;
29
- align-items: baseline;
30
- max-width: 100%;
31
-
32
- /* CSS API for :host */
33
- --vaadin-grid-tree-toggle-level-offset: 1em;
34
- --_collapsed-icon: '\\e7be\\00a0';
35
- }
36
-
37
- :host([dir='rtl']) {
38
- --_collapsed-icon: '\\e7bd\\00a0';
39
- }
40
-
41
- :host([hidden]) {
42
- display: none !important;
43
- }
44
-
45
- :host(:not([leaf])) {
46
- cursor: pointer;
47
- }
48
-
49
- #level-spacer,
50
- [part='toggle'] {
51
- flex: none;
52
- }
53
-
54
- #level-spacer {
55
- display: inline-block;
56
- width: calc(var(--_level, '0') * var(--vaadin-grid-tree-toggle-level-offset));
57
- }
58
-
59
- [part='toggle']::before {
60
- font-family: 'vaadin-grid-tree-icons';
61
- line-height: 1em; /* make icon font metrics not affect baseline */
62
- }
63
-
64
- :host(:not([expanded])) [part='toggle']::before {
65
- content: var(--_collapsed-icon);
66
- }
67
-
68
- :host([expanded]) [part='toggle']::before {
69
- content: '\\e7bc\\00a0'; /* icon glyph + single non-breaking space */
70
- }
71
-
72
- :host([leaf]) [part='toggle'] {
73
- visibility: hidden;
74
- }
75
-
76
- slot {
77
- display: block;
78
- overflow: hidden;
79
- text-overflow: ellipsis;
80
- }
81
- `,
82
- { moduleId: 'vaadin-grid-tree-toggle-styles' },
83
- );
84
-
85
8
  /**
86
9
  * @polymerMixin
87
10
  */
@@ -8,6 +8,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
11
+ import { gridTreeToggleStyles } from './styles/vaadin-grid-tree-toggle-core-styles.js';
11
12
  import { GridTreeToggleMixin } from './vaadin-grid-tree-toggle-mixin.js';
12
13
 
13
14
  /**
@@ -69,6 +70,10 @@ class GridTreeToggle extends GridTreeToggleMixin(ThemableMixin(DirMixin(PolylitM
69
70
  return 'vaadin-grid-tree-toggle';
70
71
  }
71
72
 
73
+ static get styles() {
74
+ return gridTreeToggleStyles;
75
+ }
76
+
72
77
  /** @protected */
73
78
  render() {
74
79
  return html`