@vaadin/grid 24.4.0-dev.b3e1d14600 → 24.4.0-rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +0 -1
  2. package/package.json +10 -10
  3. package/src/all-imports.js +1 -1
  4. package/src/lit/column-renderer-directives.d.ts +1 -1
  5. package/src/lit/column-renderer-directives.js +1 -1
  6. package/src/lit/renderer-directives.d.ts +1 -1
  7. package/src/lit/renderer-directives.js +1 -1
  8. package/src/lit-all-imports.js +1 -1
  9. package/src/vaadin-grid-a11y-mixin.js +4 -2
  10. package/src/vaadin-grid-active-item-mixin.d.ts +1 -1
  11. package/src/vaadin-grid-active-item-mixin.js +27 -16
  12. package/src/vaadin-grid-array-data-provider-mixin.d.ts +1 -1
  13. package/src/vaadin-grid-array-data-provider-mixin.js +1 -1
  14. package/src/vaadin-grid-column-group-mixin.d.ts +1 -1
  15. package/src/vaadin-grid-column-group-mixin.js +1 -1
  16. package/src/vaadin-grid-column-group.d.ts +1 -1
  17. package/src/vaadin-grid-column-group.js +1 -1
  18. package/src/vaadin-grid-column-mixin.d.ts +6 -1
  19. package/src/vaadin-grid-column-mixin.js +14 -5
  20. package/src/vaadin-grid-column-reordering-mixin.d.ts +1 -1
  21. package/src/vaadin-grid-column-reordering-mixin.js +18 -5
  22. package/src/vaadin-grid-column-resizing-mixin.js +1 -1
  23. package/src/vaadin-grid-column.d.ts +1 -1
  24. package/src/vaadin-grid-column.js +1 -1
  25. package/src/vaadin-grid-data-provider-mixin.d.ts +1 -1
  26. package/src/vaadin-grid-data-provider-mixin.js +24 -9
  27. package/src/vaadin-grid-drag-and-drop-mixin.d.ts +1 -1
  28. package/src/vaadin-grid-drag-and-drop-mixin.js +1 -1
  29. package/src/vaadin-grid-dynamic-columns-mixin.js +1 -1
  30. package/src/vaadin-grid-event-context-mixin.d.ts +1 -1
  31. package/src/vaadin-grid-event-context-mixin.js +1 -1
  32. package/src/vaadin-grid-filter-column-mixin.d.ts +1 -1
  33. package/src/vaadin-grid-filter-column-mixin.js +2 -27
  34. package/src/vaadin-grid-filter-column.d.ts +1 -1
  35. package/src/vaadin-grid-filter-column.js +1 -1
  36. package/src/vaadin-grid-filter-element-mixin.d.ts +1 -1
  37. package/src/vaadin-grid-filter-element-mixin.js +3 -11
  38. package/src/vaadin-grid-filter-mixin.js +1 -1
  39. package/src/vaadin-grid-filter.d.ts +1 -1
  40. package/src/vaadin-grid-filter.js +1 -1
  41. package/src/vaadin-grid-helpers.js +1 -1
  42. package/src/vaadin-grid-keyboard-navigation-mixin.js +23 -11
  43. package/src/vaadin-grid-mixin.d.ts +1 -1
  44. package/src/vaadin-grid-mixin.js +54 -16
  45. package/src/vaadin-grid-row-details-mixin.d.ts +1 -1
  46. package/src/vaadin-grid-row-details-mixin.js +1 -1
  47. package/src/vaadin-grid-scroll-mixin.d.ts +3 -1
  48. package/src/vaadin-grid-scroll-mixin.js +21 -9
  49. package/src/vaadin-grid-selection-column-base-mixin.d.ts +1 -1
  50. package/src/vaadin-grid-selection-column-base-mixin.js +19 -1
  51. package/src/vaadin-grid-selection-column-mixin.d.ts +1 -1
  52. package/src/vaadin-grid-selection-column-mixin.js +1 -1
  53. package/src/vaadin-grid-selection-column.d.ts +1 -1
  54. package/src/vaadin-grid-selection-column.js +1 -1
  55. package/src/vaadin-grid-selection-mixin.d.ts +1 -1
  56. package/src/vaadin-grid-selection-mixin.js +1 -1
  57. package/src/vaadin-grid-sort-column-mixin.d.ts +1 -1
  58. package/src/vaadin-grid-sort-column-mixin.js +1 -1
  59. package/src/vaadin-grid-sort-column.d.ts +1 -1
  60. package/src/vaadin-grid-sort-column.js +1 -1
  61. package/src/vaadin-grid-sort-mixin.d.ts +1 -1
  62. package/src/vaadin-grid-sort-mixin.js +1 -1
  63. package/src/vaadin-grid-sorter-mixin.d.ts +1 -1
  64. package/src/vaadin-grid-sorter-mixin.js +1 -1
  65. package/src/vaadin-grid-sorter.d.ts +1 -1
  66. package/src/vaadin-grid-sorter.js +1 -1
  67. package/src/vaadin-grid-styles.js +7 -1
  68. package/src/vaadin-grid-styling-mixin.d.ts +1 -1
  69. package/src/vaadin-grid-styling-mixin.js +5 -5
  70. package/src/vaadin-grid-tree-column-mixin.d.ts +1 -1
  71. package/src/vaadin-grid-tree-column-mixin.js +1 -1
  72. package/src/vaadin-grid-tree-column.d.ts +1 -1
  73. package/src/vaadin-grid-tree-column.js +1 -1
  74. package/src/vaadin-grid-tree-toggle-mixin.d.ts +1 -1
  75. package/src/vaadin-grid-tree-toggle-mixin.js +3 -5
  76. package/src/vaadin-grid-tree-toggle.d.ts +1 -1
  77. package/src/vaadin-grid-tree-toggle.js +1 -1
  78. package/src/vaadin-grid.d.ts +1 -1
  79. package/src/vaadin-grid.js +1 -1
  80. package/src/vaadin-lit-grid-column-group.js +2 -2
  81. package/src/vaadin-lit-grid-column.js +2 -2
  82. package/src/vaadin-lit-grid-filter-column.js +2 -2
  83. package/src/vaadin-lit-grid-filter.js +2 -2
  84. package/src/vaadin-lit-grid-selection-column.js +2 -2
  85. package/src/vaadin-lit-grid-sort-column.js +2 -2
  86. package/src/vaadin-lit-grid-sorter.js +2 -2
  87. package/src/vaadin-lit-grid-tree-column.js +2 -2
  88. package/src/vaadin-lit-grid-tree-toggle.js +2 -2
  89. package/src/vaadin-lit-grid.js +2 -2
  90. package/theme/lumo/all-imports.d.ts +11 -0
  91. package/theme/lumo/lit-all-imports.d.ts +11 -0
  92. package/theme/lumo/vaadin-grid-column-group.d.ts +1 -0
  93. package/theme/lumo/vaadin-grid-column.d.ts +1 -0
  94. package/theme/lumo/vaadin-grid-filter-column.d.ts +2 -0
  95. package/theme/lumo/vaadin-grid-filter.d.ts +2 -0
  96. package/theme/lumo/vaadin-grid-selection-column.d.ts +2 -0
  97. package/theme/lumo/vaadin-grid-sort-column.d.ts +2 -0
  98. package/theme/lumo/vaadin-grid-sorter-styles.d.ts +3 -0
  99. package/theme/lumo/vaadin-grid-sorter.d.ts +2 -0
  100. package/theme/lumo/vaadin-grid-styles.d.ts +6 -0
  101. package/theme/lumo/vaadin-grid-styles.js +0 -1
  102. package/theme/lumo/vaadin-grid-tree-column.d.ts +2 -0
  103. package/theme/lumo/vaadin-grid-tree-toggle-styles.d.ts +3 -0
  104. package/theme/lumo/vaadin-grid-tree-toggle.d.ts +2 -0
  105. package/theme/lumo/vaadin-grid.d.ts +2 -0
  106. package/theme/lumo/vaadin-lit-grid-column-group.d.ts +1 -0
  107. package/theme/lumo/vaadin-lit-grid-column.d.ts +1 -0
  108. package/theme/lumo/vaadin-lit-grid-filter-column.d.ts +2 -0
  109. package/theme/lumo/vaadin-lit-grid-filter.d.ts +2 -0
  110. package/theme/lumo/vaadin-lit-grid-filter.js +1 -2
  111. package/theme/lumo/vaadin-lit-grid-selection-column.d.ts +2 -0
  112. package/theme/lumo/vaadin-lit-grid-selection-column.js +1 -1
  113. package/theme/lumo/vaadin-lit-grid-sort-column.d.ts +2 -0
  114. package/theme/lumo/vaadin-lit-grid-sorter.d.ts +2 -0
  115. package/theme/lumo/vaadin-lit-grid-tree-column.d.ts +2 -0
  116. package/theme/lumo/vaadin-lit-grid-tree-toggle.d.ts +2 -0
  117. package/theme/lumo/vaadin-lit-grid.d.ts +2 -0
  118. package/theme/material/all-imports.d.ts +11 -0
  119. package/theme/material/lit-all-imports.d.ts +11 -0
  120. package/theme/material/vaadin-grid-column-group.d.ts +1 -0
  121. package/theme/material/vaadin-grid-column.d.ts +1 -0
  122. package/theme/material/vaadin-grid-filter-column.d.ts +2 -0
  123. package/theme/material/vaadin-grid-filter.d.ts +2 -0
  124. package/theme/material/vaadin-grid-selection-column.d.ts +2 -0
  125. package/theme/material/vaadin-grid-sort-column.d.ts +2 -0
  126. package/theme/material/vaadin-grid-sorter-styles.d.ts +2 -0
  127. package/theme/material/vaadin-grid-sorter.d.ts +2 -0
  128. package/theme/material/vaadin-grid-styles.d.ts +2 -0
  129. package/theme/material/vaadin-grid-tree-column.d.ts +2 -0
  130. package/theme/material/vaadin-grid-tree-toggle-styles.d.ts +3 -0
  131. package/theme/material/vaadin-grid-tree-toggle.d.ts +2 -0
  132. package/theme/material/vaadin-grid.d.ts +2 -0
  133. package/theme/material/vaadin-lit-grid-column-group.d.ts +1 -0
  134. package/theme/material/vaadin-lit-grid-column.d.ts +1 -0
  135. package/theme/material/vaadin-lit-grid-filter-column.d.ts +2 -0
  136. package/theme/material/vaadin-lit-grid-filter.d.ts +2 -0
  137. package/theme/material/vaadin-lit-grid-filter.js +1 -2
  138. package/theme/material/vaadin-lit-grid-selection-column.d.ts +2 -0
  139. package/theme/material/vaadin-lit-grid-selection-column.js +1 -1
  140. package/theme/material/vaadin-lit-grid-sort-column.d.ts +2 -0
  141. package/theme/material/vaadin-lit-grid-sorter.d.ts +2 -0
  142. package/theme/material/vaadin-lit-grid-tree-column.d.ts +2 -0
  143. package/theme/material/vaadin-lit-grid-tree-toggle.d.ts +2 -0
  144. package/theme/material/vaadin-lit-grid.d.ts +2 -0
  145. package/vaadin-grid.d.ts +0 -1
  146. package/vaadin-grid.js +0 -1
  147. package/vaadin-lit-grid.d.ts +0 -1
  148. package/vaadin-lit-grid.js +0 -1
  149. package/web-types.json +2579 -0
  150. package/web-types.lit.json +1091 -0
package/README.md CHANGED
@@ -5,7 +5,6 @@ A web component for showing tabular data.
5
5
  [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/grid)
6
6
 
7
7
  [![npm version](https://badgen.net/npm/v/@vaadin/grid)](https://www.npmjs.com/package/@vaadin/grid)
8
- [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
9
8
 
10
9
  ```html
11
10
  <vaadin-grid theme="row-dividers" column-reordering-allowed multi-sort>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/grid",
3
- "version": "24.4.0-dev.b3e1d14600",
3
+ "version": "24.4.0-rc2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -46,14 +46,14 @@
46
46
  "dependencies": {
47
47
  "@open-wc/dedupe-mixin": "^1.3.0",
48
48
  "@polymer/polymer": "^3.0.0",
49
- "@vaadin/a11y-base": "24.4.0-dev.b3e1d14600",
50
- "@vaadin/checkbox": "24.4.0-dev.b3e1d14600",
51
- "@vaadin/component-base": "24.4.0-dev.b3e1d14600",
52
- "@vaadin/lit-renderer": "24.4.0-dev.b3e1d14600",
53
- "@vaadin/text-field": "24.4.0-dev.b3e1d14600",
54
- "@vaadin/vaadin-lumo-styles": "24.4.0-dev.b3e1d14600",
55
- "@vaadin/vaadin-material-styles": "24.4.0-dev.b3e1d14600",
56
- "@vaadin/vaadin-themable-mixin": "24.4.0-dev.b3e1d14600",
49
+ "@vaadin/a11y-base": "24.4.0-rc2",
50
+ "@vaadin/checkbox": "24.4.0-rc2",
51
+ "@vaadin/component-base": "24.4.0-rc2",
52
+ "@vaadin/lit-renderer": "24.4.0-rc2",
53
+ "@vaadin/text-field": "24.4.0-rc2",
54
+ "@vaadin/vaadin-lumo-styles": "24.4.0-rc2",
55
+ "@vaadin/vaadin-material-styles": "24.4.0-rc2",
56
+ "@vaadin/vaadin-themable-mixin": "24.4.0-rc2",
57
57
  "lit": "^3.0.0"
58
58
  },
59
59
  "devDependencies": {
@@ -65,5 +65,5 @@
65
65
  "web-types.json",
66
66
  "web-types.lit.json"
67
67
  ],
68
- "gitHead": "502d4f5b03f770a83d270d98078cde230254dd0e"
68
+ "gitHead": "ea3d99e8cf67a337e959d5cab849f80464c7c7e5"
69
69
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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 './vaadin-grid.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 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
  /* eslint-disable max-classes-per-file */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 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
  /* eslint-disable max-classes-per-file */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 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 { DirectiveResult } from 'lit/directive';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 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 { directive } from 'lit/directive.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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 './vaadin-lit-grid.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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) => level.some((col) => col.headerRenderer || col.path || col.header)).length;
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
 
@@ -69,28 +69,39 @@ export const ActiveItemMixin = (superClass) =>
69
69
  }
70
70
 
71
71
  /**
72
- * We need to listen to click instead of tap because on mobile safari, the
73
- * document.activeElement has not been updated (focus has not been shifted)
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
- _onClick(e) {
79
- if (e.defaultPrevented) {
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
- return;
82
- }
80
+ e.defaultPrevented ||
81
+ // No clicked cell available
82
+ !cell ||
83
+ // Cell is a details cell
84
+ cell.getAttribute('part').includes('details-cell') ||
85
+ // Cell content is focused
86
+ cell._content.contains(this.getRootNode().activeElement) ||
87
+ // Clicked on a focusable element
88
+ this._isFocusable(e.target) ||
89
+ // Clicked on a label element
90
+ e.target instanceof HTMLLabelElement
91
+ );
92
+ }
83
93
 
84
- const path = e.composedPath();
85
- const cell = path[path.indexOf(this.$.table) - 3];
86
- if (!cell || cell.getAttribute('part').indexOf('details-cell') > -1) {
94
+ /**
95
+ * @param {!MouseEvent} e
96
+ * @protected
97
+ */
98
+ _onClick(e) {
99
+ if (this._shouldPreventCellActivationOnClick(e)) {
87
100
  return;
88
101
  }
89
- const cellContent = cell._content;
90
102
 
91
- const activeElement = this.getRootNode().activeElement;
92
- const cellContentHasFocus = cellContent.contains(activeElement);
93
- if (!cellContentHasFocus && !this._isFocusable(e.target) && !(e.target instanceof HTMLLabelElement)) {
103
+ const { cell } = this._getGridEventLocation(e);
104
+ if (cell) {
94
105
  this.dispatchEvent(
95
106
  new CustomEvent('cell-activate', {
96
107
  detail: {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 (model && model.item) {
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
- if (model.item || renderer === this._headerRenderer || renderer === this._footerRenderer) {
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 cell = this.shadowRoot.elementFromPoint(x, y);
240
+ const elementFromPoint = this.shadowRoot.elementFromPoint(x, y);
241
241
  this.$.scroller.toggleAttribute('no-content-pointer-events', false);
242
242
 
243
- // Make sure the element is actually a cell
244
- if (cell && cell._column) {
245
- return cell;
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { microTask, timeOut } from '@vaadin/component-base/src/async.js';
@@ -206,10 +206,6 @@ export const DataProviderMixin = (superClass) =>
206
206
  * @protected
207
207
  */
208
208
  _getItem(index, el) {
209
- if (index >= this._flatSize) {
210
- return;
211
- }
212
-
213
209
  el.index = index;
214
210
 
215
211
  const { item } = this._dataProviderController.getFlatIndexContext(index);
@@ -238,6 +234,12 @@ export const DataProviderMixin = (superClass) =>
238
234
 
239
235
  // Cells part attribute
240
236
  updateCellsPart(cells, 'loading-row-cell', loading);
237
+
238
+ if (loading) {
239
+ // Run style generators for the loading row to have custom names cleared
240
+ this._generateCellClassNames(row);
241
+ this._generateCellPartNames(row);
242
+ }
241
243
  }
242
244
 
243
245
  /**
@@ -325,8 +327,18 @@ export const DataProviderMixin = (superClass) =>
325
327
 
326
328
  /** @protected */
327
329
  _onDataProviderPageReceived() {
328
- // With the new items added, update the cache size and the grid's effective size
329
- this._flatSize = this._dataProviderController.flatSize;
330
+ // If the page response affected the flat size
331
+ if (this._flatSize !== this._dataProviderController.flatSize) {
332
+ // Schedule an update of all rendered rows by _debouncerApplyCachedData,
333
+ // to ensure that all pages associated with the rendered rows are loaded.
334
+ this._shouldUpdateAllRenderedRowsAfterPageLoad = true;
335
+
336
+ // TODO: Updating the flat size property can still result in a synchonous virtualizer update
337
+ // if the size change requires the virtualizer to increase the amount of physical elements
338
+ // to display new items e.g. the viewport fits 10 items and the size changes from 1 to 10.
339
+ // This is something to be optimized in the future.
340
+ this._flatSize = this._dataProviderController.flatSize;
341
+ }
330
342
 
331
343
  // After updating the cache, check if some of the expanded items should have sub-caches loaded
332
344
  this._getRenderedRows().forEach((row) => {
@@ -342,9 +354,12 @@ export const DataProviderMixin = (superClass) =>
342
354
  this._debouncerApplyCachedData = Debouncer.debounce(this._debouncerApplyCachedData, timeOut.after(0), () => {
343
355
  this._setLoading(false);
344
356
 
357
+ const shouldUpdateAllRenderedRowsAfterPageLoad = this._shouldUpdateAllRenderedRowsAfterPageLoad;
358
+ this._shouldUpdateAllRenderedRowsAfterPageLoad = false;
359
+
345
360
  this._getRenderedRows().forEach((row) => {
346
361
  const { item } = this._dataProviderController.getFlatIndexContext(row.index);
347
- if (item) {
362
+ if (item || shouldUpdateAllRenderedRowsAfterPageLoad) {
348
363
  this._getItem(row.index, row);
349
364
  }
350
365
  });
@@ -374,7 +389,7 @@ export const DataProviderMixin = (superClass) =>
374
389
  this._hasData = false;
375
390
  this.__updateVisibleRows();
376
391
 
377
- if (!this.__virtualizer.size) {
392
+ if (!this.__virtualizer || !this.__virtualizer.size) {
378
393
  this._dataProviderController.loadFirstPage();
379
394
  }
380
395
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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, _filterValue)'];
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 - 2023 Vaadin Ltd.
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 - 2023 Vaadin Ltd.
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 './vaadin-grid-filter.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2023 Vaadin Ltd.
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';