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

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 +1 -1
  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 +1 -1
  19. package/src/vaadin-grid-column-mixin.js +9 -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 +18 -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 +1 -1
  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-rc1",
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-rc1",
50
+ "@vaadin/checkbox": "24.4.0-rc1",
51
+ "@vaadin/component-base": "24.4.0-rc1",
52
+ "@vaadin/lit-renderer": "24.4.0-rc1",
53
+ "@vaadin/text-field": "24.4.0-rc1",
54
+ "@vaadin/vaadin-lumo-styles": "24.4.0-rc1",
55
+ "@vaadin/vaadin-material-styles": "24.4.0-rc1",
56
+ "@vaadin/vaadin-themable-mixin": "24.4.0-rc1",
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": "a81e3b927d44c56613fa4e1307494a2acc81005f"
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
 
@@ -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';
@@ -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
 
@@ -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);
@@ -325,8 +321,18 @@ export const DataProviderMixin = (superClass) =>
325
321
 
326
322
  /** @protected */
327
323
  _onDataProviderPageReceived() {
328
- // With the new items added, update the cache size and the grid's effective size
329
- this._flatSize = this._dataProviderController.flatSize;
324
+ // If the page response affected the flat size
325
+ if (this._flatSize !== this._dataProviderController.flatSize) {
326
+ // Schedule an update of all rendered rows by _debouncerApplyCachedData,
327
+ // to ensure that all pages associated with the rendered rows are loaded.
328
+ this._shouldUpdateAllRenderedRowsAfterPageLoad = true;
329
+
330
+ // TODO: Updating the flat size property can still result in a synchonous virtualizer update
331
+ // if the size change requires the virtualizer to increase the amount of physical elements
332
+ // to display new items e.g. the viewport fits 10 items and the size changes from 1 to 10.
333
+ // This is something to be optimized in the future.
334
+ this._flatSize = this._dataProviderController.flatSize;
335
+ }
330
336
 
331
337
  // After updating the cache, check if some of the expanded items should have sub-caches loaded
332
338
  this._getRenderedRows().forEach((row) => {
@@ -342,9 +348,12 @@ export const DataProviderMixin = (superClass) =>
342
348
  this._debouncerApplyCachedData = Debouncer.debounce(this._debouncerApplyCachedData, timeOut.after(0), () => {
343
349
  this._setLoading(false);
344
350
 
351
+ const shouldUpdateAllRenderedRowsAfterPageLoad = this._shouldUpdateAllRenderedRowsAfterPageLoad;
352
+ this._shouldUpdateAllRenderedRowsAfterPageLoad = false;
353
+
345
354
  this._getRenderedRows().forEach((row) => {
346
355
  const { item } = this._dataProviderController.getFlatIndexContext(row.index);
347
- if (item) {
356
+ if (item || shouldUpdateAllRenderedRowsAfterPageLoad) {
348
357
  this._getItem(row.index, row);
349
358
  }
350
359
  });
@@ -374,7 +383,7 @@ export const DataProviderMixin = (superClass) =>
374
383
  this._hasData = false;
375
384
  this.__updateVisibleRows();
376
385
 
377
- if (!this.__virtualizer.size) {
386
+ if (!this.__virtualizer || !this.__virtualizer.size) {
378
387
  this._dataProviderController.loadFirstPage();
379
388
  }
380
389
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 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';
@@ -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 { timeOut } from '@vaadin/component-base/src/async.js';
@@ -69,12 +69,8 @@ export const GridFilterElementMixin = (superClass) =>
69
69
 
70
70
  this._filterController = new SlotController(this, '', 'vaadin-text-field', {
71
71
  initializer: (field) => {
72
- field.addEventListener('value-changed', (e) => {
73
- if (field.__previousValue === undefined && e.detail.value === '') {
74
- field.__previousValue = e.detail.value;
75
- return;
76
- }
77
- this.value = e.detail.value;
72
+ field.addEventListener('input', (e) => {
73
+ this.value = e.target.value;
78
74
  });
79
75
 
80
76
  this._textField = field;
@@ -88,12 +84,8 @@ export const GridFilterElementMixin = (superClass) =>
88
84
  if (path === undefined || value === undefined || !textField) {
89
85
  return;
90
86
  }
91
- if (this._previousValue === undefined && value === '') {
92
- return;
93
- }
94
87
 
95
88
  textField.value = value;
96
- this._previousValue = value;
97
89
 
98
90
  this._debouncerFilterChanged = Debouncer.debounce(this._debouncerFilterChanged, timeOut.after(200), () => {
99
91
  this.dispatchEvent(new CustomEvent('filter-changed', { bubbles: true }));
@@ -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
 
@@ -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/text-field/src/vaadin-text-field.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 { microTask } from '@vaadin/component-base/src/async.js';