@vaadin/grid 24.8.0-alpha9 → 25.0.0-alpha2

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 (129) hide show
  1. package/README.md +0 -36
  2. package/package.json +12 -14
  3. package/src/vaadin-grid-column-auto-width-mixin.js +36 -5
  4. package/src/vaadin-grid-column-group.js +3 -3
  5. package/src/vaadin-grid-column-mixin.js +0 -8
  6. package/src/vaadin-grid-column.js +3 -2
  7. package/src/vaadin-grid-data-provider-mixin.js +5 -1
  8. package/src/vaadin-grid-filter-column.d.ts +1 -1
  9. package/src/vaadin-grid-filter-column.js +1 -1
  10. package/src/vaadin-grid-filter-element-mixin.d.ts +1 -2
  11. package/src/vaadin-grid-filter-element-mixin.js +1 -4
  12. package/src/vaadin-grid-filter.js +8 -6
  13. package/src/vaadin-grid-helpers.js +1 -1
  14. package/src/vaadin-grid-mixin.js +0 -3
  15. package/src/vaadin-grid-selection-column.d.ts +1 -1
  16. package/src/vaadin-grid-selection-column.js +1 -1
  17. package/src/vaadin-grid-sort-column.d.ts +1 -1
  18. package/src/vaadin-grid-sort-column.js +1 -1
  19. package/src/vaadin-grid-sorter.js +11 -9
  20. package/src/vaadin-grid-tree-column.d.ts +1 -2
  21. package/src/vaadin-grid-tree-column.js +1 -1
  22. package/src/vaadin-grid-tree-toggle.js +5 -3
  23. package/src/vaadin-grid.d.ts +0 -2
  24. package/src/vaadin-grid.js +27 -18
  25. package/web-types.json +7 -7
  26. package/web-types.lit.json +7 -7
  27. package/src/lit-all-imports.js +0 -14
  28. package/src/vaadin-lit-grid-column-group.js +0 -28
  29. package/src/vaadin-lit-grid-column.js +0 -30
  30. package/src/vaadin-lit-grid-filter-column.js +0 -28
  31. package/src/vaadin-lit-grid-filter.js +0 -35
  32. package/src/vaadin-lit-grid-selection-column.js +0 -28
  33. package/src/vaadin-lit-grid-sort-column.js +0 -28
  34. package/src/vaadin-lit-grid-sorter.js +0 -42
  35. package/src/vaadin-lit-grid-tree-column.js +0 -28
  36. package/src/vaadin-lit-grid-tree-toggle.js +0 -39
  37. package/src/vaadin-lit-grid.js +0 -78
  38. package/theme/lumo/lit-all-imports.d.ts +0 -11
  39. package/theme/lumo/lit-all-imports.js +0 -11
  40. package/theme/lumo/vaadin-lit-grid-column-group.d.ts +0 -1
  41. package/theme/lumo/vaadin-lit-grid-column-group.js +0 -1
  42. package/theme/lumo/vaadin-lit-grid-column.d.ts +0 -1
  43. package/theme/lumo/vaadin-lit-grid-column.js +0 -1
  44. package/theme/lumo/vaadin-lit-grid-filter-column.d.ts +0 -2
  45. package/theme/lumo/vaadin-lit-grid-filter-column.js +0 -2
  46. package/theme/lumo/vaadin-lit-grid-filter.d.ts +0 -2
  47. package/theme/lumo/vaadin-lit-grid-filter.js +0 -2
  48. package/theme/lumo/vaadin-lit-grid-selection-column.d.ts +0 -2
  49. package/theme/lumo/vaadin-lit-grid-selection-column.js +0 -2
  50. package/theme/lumo/vaadin-lit-grid-sort-column.d.ts +0 -2
  51. package/theme/lumo/vaadin-lit-grid-sort-column.js +0 -2
  52. package/theme/lumo/vaadin-lit-grid-sorter.d.ts +0 -2
  53. package/theme/lumo/vaadin-lit-grid-sorter.js +0 -2
  54. package/theme/lumo/vaadin-lit-grid-tree-column.d.ts +0 -2
  55. package/theme/lumo/vaadin-lit-grid-tree-column.js +0 -2
  56. package/theme/lumo/vaadin-lit-grid-tree-toggle.d.ts +0 -2
  57. package/theme/lumo/vaadin-lit-grid-tree-toggle.js +0 -2
  58. package/theme/lumo/vaadin-lit-grid.d.ts +0 -2
  59. package/theme/lumo/vaadin-lit-grid.js +0 -2
  60. package/theme/material/all-imports.d.ts +0 -11
  61. package/theme/material/all-imports.js +0 -11
  62. package/theme/material/lit-all-imports.d.ts +0 -11
  63. package/theme/material/lit-all-imports.js +0 -11
  64. package/theme/material/vaadin-grid-column-group.d.ts +0 -1
  65. package/theme/material/vaadin-grid-column-group.js +0 -1
  66. package/theme/material/vaadin-grid-column.d.ts +0 -1
  67. package/theme/material/vaadin-grid-column.js +0 -1
  68. package/theme/material/vaadin-grid-filter-column.d.ts +0 -2
  69. package/theme/material/vaadin-grid-filter-column.js +0 -2
  70. package/theme/material/vaadin-grid-filter.d.ts +0 -2
  71. package/theme/material/vaadin-grid-filter.js +0 -2
  72. package/theme/material/vaadin-grid-selection-column.d.ts +0 -2
  73. package/theme/material/vaadin-grid-selection-column.js +0 -2
  74. package/theme/material/vaadin-grid-sort-column.d.ts +0 -2
  75. package/theme/material/vaadin-grid-sort-column.js +0 -2
  76. package/theme/material/vaadin-grid-sorter-styles.d.ts +0 -2
  77. package/theme/material/vaadin-grid-sorter-styles.js +0 -73
  78. package/theme/material/vaadin-grid-sorter.d.ts +0 -2
  79. package/theme/material/vaadin-grid-sorter.js +0 -2
  80. package/theme/material/vaadin-grid-styles.d.ts +0 -2
  81. package/theme/material/vaadin-grid-styles.js +0 -266
  82. package/theme/material/vaadin-grid-tree-column.d.ts +0 -2
  83. package/theme/material/vaadin-grid-tree-column.js +0 -2
  84. package/theme/material/vaadin-grid-tree-toggle-styles.d.ts +0 -3
  85. package/theme/material/vaadin-grid-tree-toggle-styles.js +0 -42
  86. package/theme/material/vaadin-grid-tree-toggle.d.ts +0 -2
  87. package/theme/material/vaadin-grid-tree-toggle.js +0 -2
  88. package/theme/material/vaadin-grid.d.ts +0 -2
  89. package/theme/material/vaadin-grid.js +0 -2
  90. package/theme/material/vaadin-lit-grid-column-group.d.ts +0 -1
  91. package/theme/material/vaadin-lit-grid-column-group.js +0 -1
  92. package/theme/material/vaadin-lit-grid-column.d.ts +0 -1
  93. package/theme/material/vaadin-lit-grid-column.js +0 -1
  94. package/theme/material/vaadin-lit-grid-filter-column.d.ts +0 -2
  95. package/theme/material/vaadin-lit-grid-filter-column.js +0 -2
  96. package/theme/material/vaadin-lit-grid-filter.d.ts +0 -2
  97. package/theme/material/vaadin-lit-grid-filter.js +0 -2
  98. package/theme/material/vaadin-lit-grid-selection-column.d.ts +0 -2
  99. package/theme/material/vaadin-lit-grid-selection-column.js +0 -2
  100. package/theme/material/vaadin-lit-grid-sort-column.d.ts +0 -2
  101. package/theme/material/vaadin-lit-grid-sort-column.js +0 -2
  102. package/theme/material/vaadin-lit-grid-sorter.d.ts +0 -2
  103. package/theme/material/vaadin-lit-grid-sorter.js +0 -2
  104. package/theme/material/vaadin-lit-grid-tree-column.d.ts +0 -2
  105. package/theme/material/vaadin-lit-grid-tree-column.js +0 -2
  106. package/theme/material/vaadin-lit-grid-tree-toggle.d.ts +0 -2
  107. package/theme/material/vaadin-lit-grid-tree-toggle.js +0 -2
  108. package/theme/material/vaadin-lit-grid.d.ts +0 -2
  109. package/theme/material/vaadin-lit-grid.js +0 -2
  110. package/vaadin-lit-grid-column-group.d.ts +0 -1
  111. package/vaadin-lit-grid-column-group.js +0 -3
  112. package/vaadin-lit-grid-column.d.ts +0 -1
  113. package/vaadin-lit-grid-column.js +0 -3
  114. package/vaadin-lit-grid-filter-column.d.ts +0 -1
  115. package/vaadin-lit-grid-filter-column.js +0 -3
  116. package/vaadin-lit-grid-filter.d.ts +0 -1
  117. package/vaadin-lit-grid-filter.js +0 -3
  118. package/vaadin-lit-grid-selection-column.d.ts +0 -1
  119. package/vaadin-lit-grid-selection-column.js +0 -3
  120. package/vaadin-lit-grid-sort-column.d.ts +0 -1
  121. package/vaadin-lit-grid-sort-column.js +0 -3
  122. package/vaadin-lit-grid-sorter.d.ts +0 -1
  123. package/vaadin-lit-grid-sorter.js +0 -3
  124. package/vaadin-lit-grid-tree-column.d.ts +0 -1
  125. package/vaadin-lit-grid-tree-column.js +0 -3
  126. package/vaadin-lit-grid-tree-toggle.d.ts +0 -1
  127. package/vaadin-lit-grid-tree-toggle.js +0 -3
  128. package/vaadin-lit-grid.d.ts +0 -1
  129. package/vaadin-lit-grid.js +0 -3
package/README.md CHANGED
@@ -49,42 +49,6 @@ import '@vaadin/grid/vaadin-grid-sort-column.js';
49
49
  import '@vaadin/grid/vaadin-grid-tree-column.js';
50
50
  ```
51
51
 
52
- ## Themes
53
-
54
- Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
55
- The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/grid/vaadin-grid.js) of the package uses the Lumo theme.
56
-
57
- To use the Material theme, import the components from the `theme/material` folder:
58
-
59
- ```js
60
- import '@vaadin/grid/theme/material/vaadin-grid.js';
61
- import '@vaadin/grid/theme/material/vaadin-grid-filter-column.js';
62
- import '@vaadin/grid/theme/material/vaadin-grid-selection-column.js';
63
- import '@vaadin/grid/theme/material/vaadin-grid-sort-column.js';
64
- import '@vaadin/grid/theme/material/vaadin-grid-tree-column.js';
65
- ```
66
-
67
- You can also import the Lumo version of the components explicitly:
68
-
69
- ```js
70
- import '@vaadin/grid/theme/lumo/vaadin-grid.js';
71
- import '@vaadin/grid/theme/lumo/vaadin-grid-filter-column.js';
72
- import '@vaadin/grid/theme/lumo/vaadin-grid-selection-column.js';
73
- import '@vaadin/grid/theme/lumo/vaadin-grid-sort-column.js';
74
- import '@vaadin/grid/theme/lumo/vaadin-grid-tree-column.js';
75
- ```
76
-
77
- Finally, you can import the un-themed components from the `src` folder to get a minimal starting point:
78
-
79
- ```js
80
- import '@vaadin/grid/src/vaadin-grid.js';
81
- import '@vaadin/grid/src/vaadin-grid-column-group.js';
82
- import '@vaadin/grid/src/vaadin-grid-filter-column.js';
83
- import '@vaadin/grid/src/vaadin-grid-selection-column.js';
84
- import '@vaadin/grid/src/vaadin-grid-sort-column.js';
85
- import '@vaadin/grid/src/vaadin-grid-tree-column.js';
86
- ```
87
-
88
52
  ## Contributing
89
53
 
90
54
  Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/grid",
3
- "version": "24.8.0-alpha9",
3
+ "version": "25.0.0-alpha2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -45,26 +45,24 @@
45
45
  ],
46
46
  "dependencies": {
47
47
  "@open-wc/dedupe-mixin": "^1.3.0",
48
- "@polymer/polymer": "^3.0.0",
49
- "@vaadin/a11y-base": "24.8.0-alpha9",
50
- "@vaadin/checkbox": "24.8.0-alpha9",
51
- "@vaadin/component-base": "24.8.0-alpha9",
52
- "@vaadin/lit-renderer": "24.8.0-alpha9",
53
- "@vaadin/text-field": "24.8.0-alpha9",
54
- "@vaadin/vaadin-lumo-styles": "24.8.0-alpha9",
55
- "@vaadin/vaadin-material-styles": "24.8.0-alpha9",
56
- "@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
48
+ "@vaadin/a11y-base": "25.0.0-alpha2",
49
+ "@vaadin/checkbox": "25.0.0-alpha2",
50
+ "@vaadin/component-base": "25.0.0-alpha2",
51
+ "@vaadin/lit-renderer": "25.0.0-alpha2",
52
+ "@vaadin/text-field": "25.0.0-alpha2",
53
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
54
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
57
55
  "lit": "^3.0.0"
58
56
  },
59
57
  "devDependencies": {
60
- "@vaadin/chai-plugins": "24.8.0-alpha9",
61
- "@vaadin/test-runner-commands": "24.8.0-alpha9",
62
- "@vaadin/testing-helpers": "^1.1.0",
58
+ "@vaadin/chai-plugins": "25.0.0-alpha2",
59
+ "@vaadin/test-runner-commands": "25.0.0-alpha2",
60
+ "@vaadin/testing-helpers": "^2.0.0",
63
61
  "sinon": "^18.0.0"
64
62
  },
65
63
  "web-types": [
66
64
  "web-types.json",
67
65
  "web-types.lit.json"
68
66
  ],
69
- "gitHead": "4de3809275ddfd733b0d13fd02af8faf73eb6770"
67
+ "gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
70
68
  }
@@ -100,7 +100,7 @@ export const ColumnAutoWidthMixin = (superClass) =>
100
100
 
101
101
  const columnWidth = Math.max(
102
102
  this.__getIntrinsicWidth(col),
103
- this.__getDistributedWidth((col.assignedSlot || col).parentElement, col),
103
+ this.__getDistributedWidth(this.__getParentColumnGroup(col), col),
104
104
  );
105
105
 
106
106
  // We're processing a regular grid-column and not a grid-column-group
@@ -144,7 +144,8 @@ export const ColumnAutoWidthMixin = (superClass) =>
144
144
  }
145
145
  });
146
146
 
147
- this.__hasHadRenderedRowsForColumnWidthCalculation ||= this._getRenderedRows().length > 0;
147
+ this.__hasHadRenderedRowsForColumnWidthCalculation =
148
+ this.__hasHadRenderedRowsForColumnWidthCalculation || this._getRenderedRows().length > 0;
148
149
 
149
150
  this.__intrinsicWidthCache = new Map();
150
151
  // Cache the viewport rows to avoid unnecessary reflows while measuring the column widths
@@ -152,13 +153,38 @@ export const ColumnAutoWidthMixin = (superClass) =>
152
153
  const lvi = this._lastVisibleIndex;
153
154
  this.__viewportRowsCache = this._getRenderedRows().filter((row) => row.index >= fvi && row.index <= lvi);
154
155
 
155
- // Pre-cache the intrinsic width of each column
156
+ // Get columns with autoWidth
156
157
  const cols = this.__getAutoWidthColumns();
157
- this.__calculateAndCacheIntrinsicWidths(cols);
158
+
159
+ // Get all ancestor groups of the columns
160
+ const ancestorColumnGroups = new Set();
161
+ for (const col of cols) {
162
+ let parent = this.__getParentColumnGroup(col);
163
+ while (parent && !ancestorColumnGroups.has(parent)) {
164
+ ancestorColumnGroups.add(parent);
165
+ parent = this.__getParentColumnGroup(parent);
166
+ }
167
+ }
168
+
169
+ // Pre-cache the intrinsic width of each column and ancestor group
170
+ this.__calculateAndCacheIntrinsicWidths([...cols, ...ancestorColumnGroups]);
158
171
 
159
172
  cols.forEach((col) => {
160
173
  col.width = `${this.__getDistributedWidth(col)}px`;
161
174
  });
175
+
176
+ // Clear the column-width cache to avoid a memory leak
177
+ this.__intrinsicWidthCache.clear();
178
+ }
179
+
180
+ /**
181
+ * Returns the parent column group of the given column.
182
+ *
183
+ * @private
184
+ */
185
+ __getParentColumnGroup(col) {
186
+ const parent = (col.assignedSlot || col).parentElement;
187
+ return parent && parent !== this ? parent : null;
162
188
  }
163
189
 
164
190
  /**
@@ -296,12 +322,17 @@ export const ColumnAutoWidthMixin = (superClass) =>
296
322
  const debouncingUpdateFrozenColumn =
297
323
  this.__debounceUpdateFrozenColumn && this.__debounceUpdateFrozenColumn.isActive();
298
324
 
325
+ // When using a percentage-based height, the grid's effective height may
326
+ // be 0 until the resize observer in grid-mixin calculates a min-height.
327
+ const hasHeight = this.clientHeight > 0;
328
+
299
329
  return (
300
330
  !this._dataProviderController.isLoading() &&
301
331
  !hasRowsWithUndefinedIndex &&
302
332
  !isElementHidden(this) &&
303
333
  !debouncingHiddenChanged &&
304
- !debouncingUpdateFrozenColumn
334
+ !debouncingUpdateFrozenColumn &&
335
+ hasHeight
305
336
  );
306
337
  }
307
338
  };
@@ -3,9 +3,9 @@
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
-
7
- import { PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { LitElement } from 'lit';
8
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
9
  import { GridColumnGroupMixin } from './vaadin-grid-column-group-mixin.js';
10
10
  export * from './vaadin-grid-column-group-mixin.js';
11
11
 
@@ -42,7 +42,7 @@ export * from './vaadin-grid-column-group-mixin.js';
42
42
  * @extends HTMLElement
43
43
  * @mixes GridColumnGroupMixin
44
44
  */
45
- class GridColumnGroup extends GridColumnGroupMixin(PolymerElement) {
45
+ class GridColumnGroup extends GridColumnGroupMixin(PolylitMixin(LitElement)) {
46
46
  static get is() {
47
47
  return 'vaadin-grid-column-group';
48
48
  }
@@ -7,7 +7,6 @@ import { animationFrame } from '@vaadin/component-base/src/async.js';
7
7
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { get } from '@vaadin/component-base/src/path-utils.js';
10
- import { processTemplates } from '@vaadin/component-base/src/templates.js';
11
10
  import { updateCellState } from './vaadin-grid-helpers.js';
12
11
 
13
12
  /**
@@ -354,13 +353,6 @@ export const ColumnBaseMixin = (superClass) =>
354
353
  this._gridValue = undefined;
355
354
  }
356
355
 
357
- /** @protected */
358
- ready() {
359
- super.ready();
360
-
361
- processTemplates(this);
362
- }
363
-
364
356
  /**
365
357
  * @return {!Grid | undefined}
366
358
  * @protected
@@ -3,8 +3,9 @@
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 { PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
8
9
  import { GridColumnMixin } from './vaadin-grid-column-mixin.js';
9
10
 
10
11
  /**
@@ -18,7 +19,7 @@ import { GridColumnMixin } from './vaadin-grid-column-mixin.js';
18
19
  * @extends HTMLElement
19
20
  * @mixes GridColumnMixin
20
21
  */
21
- class GridColumn extends GridColumnMixin(PolymerElement) {
22
+ class GridColumn extends GridColumnMixin(PolylitMixin(LitElement)) {
22
23
  static get is() {
23
24
  return 'vaadin-grid-column';
24
25
  }
@@ -483,6 +483,10 @@ export const DataProviderMixin = (superClass) =>
483
483
  * @param indexes {...number} Row indexes to scroll to
484
484
  */
485
485
  scrollToIndex(...indexes) {
486
+ if (!this.__virtualizer || !this.clientHeight || !this._columnTree) {
487
+ this.__pendingScrollToIndexes = indexes;
488
+ return;
489
+ }
486
490
  // Synchronous data provider may cause changes to the cache on scroll without
487
491
  // ending up in a loading state. Try scrolling to the index until the target
488
492
  // index stabilizes.
@@ -491,7 +495,7 @@ export const DataProviderMixin = (superClass) =>
491
495
  this._scrollToFlatIndex(targetIndex);
492
496
  }
493
497
 
494
- if (this._dataProviderController.isLoading() || !this.clientHeight || !this._columnTree) {
498
+ if (this._dataProviderController.isLoading()) {
495
499
  this.__pendingScrollToIndexes = indexes;
496
500
  }
497
501
  }
@@ -15,7 +15,7 @@ export * from './vaadin-grid-filter-column-mixin.js';
15
15
  *
16
16
  * #### Example:
17
17
  * ```html
18
- * <vaadin-grid items="[[items]]">
18
+ * <vaadin-grid>
19
19
  * <vaadin-grid-filter-column path="name.first"></vaadin-grid-filter-column>
20
20
  *
21
21
  * <vaadin-grid-column>
@@ -14,7 +14,7 @@ import { GridFilterColumnMixin } from './vaadin-grid-filter-column-mixin.js';
14
14
  *
15
15
  * #### Example:
16
16
  * ```html
17
- * <vaadin-grid items="[[items]]">
17
+ * <vaadin-grid>
18
18
  * <vaadin-grid-filter-column path="name.first"></vaadin-grid-filter-column>
19
19
  *
20
20
  * <vaadin-grid-column>
@@ -4,7 +4,6 @@
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';
7
- import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
8
7
 
9
8
  /**
10
9
  * Fired when the `value` property changes.
@@ -19,7 +18,7 @@ export interface GridFilterEventMap extends HTMLElementEventMap, GridFilterCusto
19
18
 
20
19
  export declare function GridFilterElementMixin<T extends Constructor<HTMLElement>>(
21
20
  base: T,
22
- ): Constructor<ControllerMixinClass> & Constructor<GridFilterElementMixinClass> & T;
21
+ ): Constructor<GridFilterElementMixinClass> & T;
23
22
 
24
23
  declare class GridFilterElementMixinClass {
25
24
  /**
@@ -4,7 +4,6 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { timeOut } from '@vaadin/component-base/src/async.js';
7
- import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
8
7
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
9
8
  import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
10
9
  import { css, registerStyles } from '@vaadin/vaadin-themable-mixin';
@@ -27,11 +26,9 @@ registerStyles(
27
26
 
28
27
  /**
29
28
  * @polymerMixin
30
- *
31
- * @mixes ControllerMixin
32
29
  */
33
30
  export const GridFilterElementMixin = (superClass) =>
34
- class extends ControllerMixin(superClass) {
31
+ class extends superClass {
35
32
  static get properties() {
36
33
  return {
37
34
  /**
@@ -4,8 +4,9 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@vaadin/text-field/src/vaadin-text-field.js';
7
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
+ import { html, LitElement } from 'lit';
8
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
10
11
  import { GridFilterElementMixin } from './vaadin-grid-filter-element-mixin.js';
11
12
 
@@ -38,14 +39,15 @@ import { GridFilterElementMixin } from './vaadin-grid-filter-element-mixin.js';
38
39
  * @extends HTMLElement
39
40
  * @mixes GridFilterElementMixin
40
41
  */
41
- class GridFilter extends GridFilterElementMixin(ThemableMixin(PolymerElement)) {
42
- static get template() {
43
- return html`<slot></slot>`;
44
- }
45
-
42
+ class GridFilter extends GridFilterElementMixin(ThemableMixin(PolylitMixin(LitElement))) {
46
43
  static get is() {
47
44
  return 'vaadin-grid-filter';
48
45
  }
46
+
47
+ /** @protected */
48
+ render() {
49
+ return html`<slot></slot>`;
50
+ }
49
51
  }
50
52
 
51
53
  defineCustomElement(GridFilter);
@@ -215,7 +215,7 @@ export class ColumnObserver {
215
215
  __onMutation() {
216
216
  // Detect if this is the initial call
217
217
  const initialCall = !this.__currentColumns;
218
- this.__currentColumns ||= [];
218
+ this.__currentColumns = this.__currentColumns || [];
219
219
 
220
220
  // Detect added and removed columns or if the columns order has changed
221
221
  const columns = ColumnObserver.getColumns(this.__host);
@@ -17,7 +17,6 @@ import {
17
17
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
18
18
  import { getClosestElement } from '@vaadin/component-base/src/dom-utils.js';
19
19
  import { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
20
- import { processTemplates } from '@vaadin/component-base/src/templates.js';
21
20
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
22
21
  import { Virtualizer } from '@vaadin/component-base/src/virtualizer.js';
23
22
  import { A11yMixin } from './vaadin-grid-a11y-mixin.js';
@@ -282,8 +281,6 @@ export const GridMixin = (superClass) =>
282
281
  minHeightObserver.observe(this.$.items);
283
282
  minHeightObserver.observe(this.$.footer);
284
283
 
285
- processTemplates(this);
286
-
287
284
  this._tooltipController = new TooltipController(this);
288
285
  this.addController(this._tooltipController);
289
286
  this._tooltipController.setManual(true);
@@ -19,7 +19,7 @@ export * from './vaadin-grid-selection-column-mixin.js';
19
19
  *
20
20
  * #### Example:
21
21
  * ```html
22
- * <vaadin-grid items="[[items]]">
22
+ * <vaadin-grid>
23
23
  * <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>
24
24
  *
25
25
  * <vaadin-grid-column>
@@ -14,7 +14,7 @@ import { GridSelectionColumnMixin } from './vaadin-grid-selection-column-mixin.j
14
14
  *
15
15
  * #### Example:
16
16
  * ```html
17
- * <vaadin-grid items="[[items]]">
17
+ * <vaadin-grid>
18
18
  * <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>
19
19
  *
20
20
  * <vaadin-grid-column>
@@ -15,7 +15,7 @@ export * from './vaadin-grid-sort-column-mixin.js';
15
15
  *
16
16
  * #### Example:
17
17
  * ```html
18
- * <vaadin-grid items="[[items]]">
18
+ * <vaadin-grid>
19
19
  * <vaadin-grid-sort-column path="name.first" direction="asc"></vaadin-grid-sort-column>
20
20
  *
21
21
  * <vaadin-grid-column>
@@ -14,7 +14,7 @@ import { GridSortColumnMixin } from './vaadin-grid-sort-column-mixin.js';
14
14
  *
15
15
  * #### Example:
16
16
  * ```html
17
- * <vaadin-grid items="[[items]]">
17
+ * <vaadin-grid>
18
18
  * <vaadin-grid-sort-column path="name.first" direction="asc"></vaadin-grid-sort-column>
19
19
  *
20
20
  * <vaadin-grid-column>
@@ -3,10 +3,11 @@
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 { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
10
11
  import { GridSorterMixin } from './vaadin-grid-sorter-mixin.js';
11
12
 
12
13
  /**
@@ -54,21 +55,22 @@ import { GridSorterMixin } from './vaadin-grid-sorter-mixin.js';
54
55
  * @mixes ThemableMixin
55
56
  * @mixes DirMixin
56
57
  */
57
- class GridSorter extends GridSorterMixin(ThemableMixin(DirMixin(PolymerElement))) {
58
- static get template() {
58
+ class GridSorter extends GridSorterMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
59
+ static get is() {
60
+ return 'vaadin-grid-sorter';
61
+ }
62
+
63
+ /** @protected */
64
+ render() {
59
65
  return html`
60
66
  <div part="content">
61
67
  <slot></slot>
62
68
  </div>
63
69
  <div part="indicators">
64
- <span part="order">[[_getDisplayOrder(_order)]]</span>
70
+ <span part="order">${this._getDisplayOrder(this._order)}</span>
65
71
  </div>
66
72
  `;
67
73
  }
68
-
69
- static get is() {
70
- return 'vaadin-grid-sorter';
71
- }
72
74
  }
73
75
 
74
76
  defineCustomElement(GridSorter);
@@ -13,14 +13,13 @@ import type { GridTreeColumnMixinClass } from './vaadin-grid-tree-column-mixin.j
13
13
  *
14
14
  * #### Example:
15
15
  * ```html
16
- * <vaadin-grid items="[[items]]">
16
+ * <vaadin-grid>
17
17
  * <vaadin-grid-tree-column path="name.first"></vaadin-grid-tree-column>
18
18
  *
19
19
  * <vaadin-grid-column>
20
20
  * ...
21
21
  * ```
22
22
  */
23
-
24
23
  declare class GridTreeColumn<TItem = GridDefaultItem> extends HTMLElement {}
25
24
 
26
25
  interface GridTreeColumn<TItem = GridDefaultItem>
@@ -14,7 +14,7 @@ import { GridTreeColumnMixin } from './vaadin-grid-tree-column-mixin.js';
14
14
  *
15
15
  * #### Example:
16
16
  * ```html
17
- * <vaadin-grid items="[[items]]">
17
+ * <vaadin-grid>
18
18
  * <vaadin-grid-tree-column path="name.first"></vaadin-grid-tree-column>
19
19
  *
20
20
  * <vaadin-grid-column>
@@ -3,9 +3,10 @@
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 { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
10
11
  import { GridTreeToggleMixin } from './vaadin-grid-tree-toggle-mixin.js';
11
12
 
@@ -63,12 +64,13 @@ import { GridTreeToggleMixin } from './vaadin-grid-tree-toggle-mixin.js';
63
64
  * @mixes DirMixin
64
65
  * @mixes GridTreeToggleMixin
65
66
  */
66
- class GridTreeToggle extends GridTreeToggleMixin(ThemableMixin(DirMixin(PolymerElement))) {
67
+ class GridTreeToggle extends GridTreeToggleMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
67
68
  static get is() {
68
69
  return 'vaadin-grid-tree-toggle';
69
70
  }
70
71
 
71
- static get template() {
72
+ /** @protected */
73
+ render() {
72
74
  return html`
73
75
  <span id="level-spacer"></span>
74
76
  <span part="toggle"></span>
@@ -4,7 +4,6 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
7
- import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
8
7
  import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
9
8
  import type { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
9
  import type { ThemePropertyMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
@@ -277,7 +276,6 @@ interface Grid<TItem = GridDefaultItem>
277
276
  ElementMixinClass,
278
277
  ThemableMixinClass,
279
278
  ThemePropertyMixinClass,
280
- ControllerMixinClass,
281
279
  GridMixinClass<TItem> {}
282
280
 
283
281
  declare global {
@@ -4,16 +4,15 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-grid-column.js';
7
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
- import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
7
+ import { html, LitElement } from 'lit';
8
+ import { ifDefined } from 'lit/directives/if-defined.js';
9
9
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
- import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
13
  import { GridMixin } from './vaadin-grid-mixin.js';
13
14
  import { gridStyles } from './vaadin-grid-styles.js';
14
15
 
15
- registerStyles('vaadin-grid', gridStyles, { moduleId: 'vaadin-grid-styles' });
16
-
17
16
  /**
18
17
  * `<vaadin-grid>` is a free, high quality data grid / data table Web Component. The content of the
19
18
  * the grid can be populated by using renderer callback function.
@@ -261,20 +260,34 @@ registerStyles('vaadin-grid', gridStyles, { moduleId: 'vaadin-grid-styles' });
261
260
  * @extends HTMLElement
262
261
  * @mixes GridMixin
263
262
  * @mixes ThemableMixin
264
- * @mixes ControllerMixin
265
263
  */
266
- class Grid extends GridMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement)))) {
267
- static get template() {
264
+ class Grid extends GridMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
265
+ static get is() {
266
+ return 'vaadin-grid';
267
+ }
268
+
269
+ static get styles() {
270
+ return gridStyles;
271
+ }
272
+
273
+ /** @protected */
274
+ render() {
268
275
  return html`
269
276
  <div
270
277
  id="scroller"
271
- safari$="[[_safari]]"
272
- ios$="[[_ios]]"
273
- loading$="[[loading]]"
274
- column-reordering-allowed$="[[columnReorderingAllowed]]"
275
- empty-state$="[[__emptyState]]"
278
+ ?safari="${this._safari}"
279
+ ?ios="${this._ios}"
280
+ ?loading="${this.loading}"
281
+ ?column-reordering-allowed="${this.columnReorderingAllowed}"
282
+ ?empty-state="${this.__emptyState}"
276
283
  >
277
- <table id="table" role="treegrid" aria-multiselectable="true" tabindex="0" aria-label$="[[accessibleName]]">
284
+ <table
285
+ id="table"
286
+ role="treegrid"
287
+ aria-multiselectable="true"
288
+ tabindex="0"
289
+ aria-label="${ifDefined(this.accessibleName)}"
290
+ >
278
291
  <caption id="sizer" part="row"></caption>
279
292
  <thead id="header" role="rowgroup"></thead>
280
293
  <tbody id="items" role="rowgroup"></tbody>
@@ -296,10 +309,6 @@ class Grid extends GridMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerE
296
309
  <div id="focusexit" tabindex="0"></div>
297
310
  `;
298
311
  }
299
-
300
- static get is() {
301
- return 'vaadin-grid';
302
- }
303
312
  }
304
313
 
305
314
  defineCustomElement(Grid);