@vaadin/grid 22.0.0-rc1 → 22.0.3

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 (53) hide show
  1. package/package.json +9 -9
  2. package/src/all-imports.js +1 -1
  3. package/src/vaadin-grid-a11y-mixin.js +1 -1
  4. package/src/vaadin-grid-active-item-mixin.d.ts +1 -1
  5. package/src/vaadin-grid-active-item-mixin.js +1 -1
  6. package/src/vaadin-grid-array-data-provider-mixin.d.ts +1 -1
  7. package/src/vaadin-grid-array-data-provider-mixin.js +1 -1
  8. package/src/vaadin-grid-column-group.d.ts +1 -1
  9. package/src/vaadin-grid-column-group.js +1 -1
  10. package/src/vaadin-grid-column-reordering-mixin.d.ts +1 -1
  11. package/src/vaadin-grid-column-reordering-mixin.js +1 -1
  12. package/src/vaadin-grid-column-resizing-mixin.js +1 -1
  13. package/src/vaadin-grid-column.d.ts +1 -1
  14. package/src/vaadin-grid-column.js +5 -1
  15. package/src/vaadin-grid-data-provider-mixin.d.ts +1 -1
  16. package/src/vaadin-grid-data-provider-mixin.js +1 -1
  17. package/src/vaadin-grid-drag-and-drop-mixin.d.ts +1 -1
  18. package/src/vaadin-grid-drag-and-drop-mixin.js +1 -1
  19. package/src/vaadin-grid-dynamic-columns-mixin.js +1 -1
  20. package/src/vaadin-grid-event-context-mixin.d.ts +1 -1
  21. package/src/vaadin-grid-event-context-mixin.js +1 -1
  22. package/src/vaadin-grid-filter-column.d.ts +1 -1
  23. package/src/vaadin-grid-filter-column.js +1 -1
  24. package/src/vaadin-grid-filter-mixin.js +1 -1
  25. package/src/vaadin-grid-filter.d.ts +1 -1
  26. package/src/vaadin-grid-filter.js +1 -1
  27. package/src/vaadin-grid-helpers.js +1 -1
  28. package/src/vaadin-grid-keyboard-navigation-mixin.js +1 -1
  29. package/src/vaadin-grid-row-details-mixin.d.ts +1 -1
  30. package/src/vaadin-grid-row-details-mixin.js +1 -1
  31. package/src/vaadin-grid-scroll-mixin.d.ts +1 -1
  32. package/src/vaadin-grid-scroll-mixin.js +1 -1
  33. package/src/vaadin-grid-selection-column.d.ts +1 -1
  34. package/src/vaadin-grid-selection-column.js +1 -1
  35. package/src/vaadin-grid-selection-mixin.d.ts +1 -1
  36. package/src/vaadin-grid-selection-mixin.js +1 -1
  37. package/src/vaadin-grid-sort-column.d.ts +1 -1
  38. package/src/vaadin-grid-sort-column.js +1 -1
  39. package/src/vaadin-grid-sort-mixin.d.ts +1 -1
  40. package/src/vaadin-grid-sort-mixin.js +1 -1
  41. package/src/vaadin-grid-sorter.d.ts +1 -1
  42. package/src/vaadin-grid-sorter.js +1 -1
  43. package/src/vaadin-grid-styles.js +1 -1
  44. package/src/vaadin-grid-styling-mixin.d.ts +1 -1
  45. package/src/vaadin-grid-styling-mixin.js +1 -1
  46. package/src/vaadin-grid-tree-column.d.ts +1 -1
  47. package/src/vaadin-grid-tree-column.js +1 -1
  48. package/src/vaadin-grid-tree-toggle.d.ts +1 -1
  49. package/src/vaadin-grid-tree-toggle.js +1 -1
  50. package/src/vaadin-grid.d.ts +19 -27
  51. package/src/vaadin-grid.js +25 -28
  52. package/theme/lumo/vaadin-grid-styles.js +4 -0
  53. package/theme/material/vaadin-grid-styles.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/grid",
3
- "version": "22.0.0-rc1",
3
+ "version": "22.0.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -40,19 +40,19 @@
40
40
  "dependencies": {
41
41
  "@open-wc/dedupe-mixin": "^1.3.0",
42
42
  "@polymer/polymer": "^3.0.0",
43
- "@vaadin/checkbox": "22.0.0-rc1",
44
- "@vaadin/component-base": "22.0.0-rc1",
45
- "@vaadin/text-field": "22.0.0-rc1",
46
- "@vaadin/vaadin-lumo-styles": "22.0.0-rc1",
47
- "@vaadin/vaadin-material-styles": "22.0.0-rc1",
48
- "@vaadin/vaadin-themable-mixin": "22.0.0-rc1"
43
+ "@vaadin/checkbox": "^22.0.3",
44
+ "@vaadin/component-base": "^22.0.3",
45
+ "@vaadin/text-field": "^22.0.3",
46
+ "@vaadin/vaadin-lumo-styles": "^22.0.3",
47
+ "@vaadin/vaadin-material-styles": "^22.0.3",
48
+ "@vaadin/vaadin-themable-mixin": "^22.0.3"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@esm-bundle/chai": "^4.3.4",
52
- "@vaadin/polymer-legacy-adapter": "22.0.0-rc1",
52
+ "@vaadin/polymer-legacy-adapter": "^22.0.3",
53
53
  "@vaadin/testing-helpers": "^0.3.2",
54
54
  "lit": "^2.0.0",
55
55
  "sinon": "^9.2.0"
56
56
  },
57
- "gitHead": "7b6f44bcd2c0fd415028ace666feeb0fedb1d540"
57
+ "gitHead": "935ad1ea65a79b0f9ecb10d767689479b36c4e07"
58
58
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { GridDefaultItem } from './vaadin-grid.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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';
@@ -448,6 +448,10 @@ export const ColumnBaseMixin = (superClass) =>
448
448
  }
449
449
 
450
450
  cells.forEach((cell) => {
451
+ if (!cell.parentElement) {
452
+ return;
453
+ }
454
+
451
455
  const model = this._grid.__getRowModel(cell.parentElement);
452
456
 
453
457
  if (!renderer) return;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  const DropMode = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { GridDefaultItem } from './vaadin-grid.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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, microTask, timeOut } from '@vaadin/component-base/src/async.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { GridDefaultItem } from './vaadin-grid.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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/checkbox/src/vaadin-checkbox.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { GridDefaultItem } from './vaadin-grid.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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-sorter.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { GridDefaultItem } from './vaadin-grid.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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-tree-toggle.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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 { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
@@ -253,20 +253,16 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
253
253
  * in the second argument of the data provider callback:__
254
254
  *
255
255
  * ```javascript
256
- * grid.dataProvider = function(params, callback) {
257
- * const url = 'https://api.example/data' +
258
- * '?page=' + params.page + // the requested page index
259
- * '&per_page=' + params.pageSize; // number of items on the page
260
- * const xhr = new XMLHttpRequest();
261
- * xhr.onload = function() {
262
- * const response = JSON.parse(xhr.responseText);
263
- * callback(
264
- * response.employees, // requested page of items
265
- * response.totalSize // total number of items
266
- * );
267
- * };
268
- * xhr.open('GET', url, true);
269
- * xhr.send();
256
+ * grid.dataProvider = ({page, pageSize}, callback) => {
257
+ * // page: the requested page index
258
+ * // pageSize: number of items on one page
259
+ * const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;
260
+ *
261
+ * fetch(url)
262
+ * .then((res) => res.json())
263
+ * .then(({ employees, totalSize }) => {
264
+ * callback(employees, totalSize);
265
+ * });
270
266
  * };
271
267
  * ```
272
268
  *
@@ -274,17 +270,12 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
274
270
  *
275
271
  * ```javascript
276
272
  * grid.size = 200; // The total number of items
277
- * grid.dataProvider = function(params, callback) {
278
- * const url = 'https://api.example/data' +
279
- * '?page=' + params.page + // the requested page index
280
- * '&per_page=' + params.pageSize; // number of items on the page
281
- * const xhr = new XMLHttpRequest();
282
- * xhr.onload = function() {
283
- * const response = JSON.parse(xhr.responseText);
284
- * callback(response.employees);
285
- * };
286
- * xhr.open('GET', url, true);
287
- * xhr.send();
273
+ * grid.dataProvider = ({page, pageSize}, callback) => {
274
+ * const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;
275
+ *
276
+ * fetch(url)
277
+ * .then((res) => res.json())
278
+ * .then((resJson) => callback(resJson.employees));
288
279
  * };
289
280
  * ```
290
281
  *
@@ -317,7 +308,7 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
317
308
  * `reorder-status` | Reflects the status of a cell while columns are being reordered | cell
318
309
  * `frozen` | Frozen cell | cell
319
310
  * `last-frozen` | Last frozen cell | cell
320
- * * `first-column` | First visible cell on a row | cell
311
+ * `first-column` | First visible cell on a row | cell
321
312
  * `last-column` | Last visible cell on a row | cell
322
313
  * `selected` | Selected row | row
323
314
  * `expanded` | Expanded row | row
@@ -325,6 +316,7 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
325
316
  * `loading` | Row that is waiting for data from data provider | row
326
317
  * `odd` | Odd row | row
327
318
  * `first` | The first body row | row
319
+ * `last` | The last body row | row
328
320
  * `dragstart` | Set for one frame when drag of a row is starting. The value is a number when multiple rows are dragged | row
329
321
  * `dragover` | Set when the row is dragged over | row
330
322
  * `drag-disabled` | Set to a row that isn't available for dragging | row
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2022 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-column.js';
@@ -139,20 +139,16 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
139
139
  * in the second argument of the data provider callback:__
140
140
  *
141
141
  * ```javascript
142
- * grid.dataProvider = function(params, callback) {
143
- * const url = 'https://api.example/data' +
144
- * '?page=' + params.page + // the requested page index
145
- * '&per_page=' + params.pageSize; // number of items on the page
146
- * const xhr = new XMLHttpRequest();
147
- * xhr.onload = function() {
148
- * const response = JSON.parse(xhr.responseText);
149
- * callback(
150
- * response.employees, // requested page of items
151
- * response.totalSize // total number of items
152
- * );
153
- * };
154
- * xhr.open('GET', url, true);
155
- * xhr.send();
142
+ * grid.dataProvider = ({page, pageSize}, callback) => {
143
+ * // page: the requested page index
144
+ * // pageSize: number of items on one page
145
+ * const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;
146
+ *
147
+ * fetch(url)
148
+ * .then((res) => res.json())
149
+ * .then(({ employees, totalSize }) => {
150
+ * callback(employees, totalSize);
151
+ * });
156
152
  * };
157
153
  * ```
158
154
  *
@@ -160,17 +156,12 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
160
156
  *
161
157
  * ```javascript
162
158
  * grid.size = 200; // The total number of items
163
- * grid.dataProvider = function(params, callback) {
164
- * const url = 'https://api.example/data' +
165
- * '?page=' + params.page + // the requested page index
166
- * '&per_page=' + params.pageSize; // number of items on the page
167
- * const xhr = new XMLHttpRequest();
168
- * xhr.onload = function() {
169
- * const response = JSON.parse(xhr.responseText);
170
- * callback(response.employees);
171
- * };
172
- * xhr.open('GET', url, true);
173
- * xhr.send();
159
+ * grid.dataProvider = ({page, pageSize}, callback) => {
160
+ * const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;
161
+ *
162
+ * fetch(url)
163
+ * .then((res) => res.json())
164
+ * .then((resJson) => callback(resJson.employees));
174
165
  * };
175
166
  * ```
176
167
  *
@@ -203,7 +194,7 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
203
194
  * `reorder-status` | Reflects the status of a cell while columns are being reordered | cell
204
195
  * `frozen` | Frozen cell | cell
205
196
  * `last-frozen` | Last frozen cell | cell
206
- * * `first-column` | First visible cell on a row | cell
197
+ * `first-column` | First visible cell on a row | cell
207
198
  * `last-column` | Last visible cell on a row | cell
208
199
  * `selected` | Selected row | row
209
200
  * `expanded` | Expanded row | row
@@ -211,6 +202,7 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
211
202
  * `loading` | Row that is waiting for data from data provider | row
212
203
  * `odd` | Odd row | row
213
204
  * `first` | The first body row | row
205
+ * `last` | The last body row | row
214
206
  * `dragstart` | Set for one frame when drag of a row is starting. The value is a number when multiple rows are dragged | row
215
207
  * `dragover` | Set when the row is dragged over | row
216
208
  * `drag-disabled` | Set to a row that isn't available for dragging | row
@@ -288,7 +280,7 @@ class Grid extends ElementMixin(
288
280
  loading$="[[loading]]"
289
281
  column-reordering-allowed$="[[columnReorderingAllowed]]"
290
282
  >
291
- <table id="table" role="grid" aria-multiselectable="true" tabindex="0">
283
+ <table id="table" role="treegrid" aria-multiselectable="true" tabindex="0">
292
284
  <caption id="sizer" part="row"></caption>
293
285
  <thead id="header" role="rowgroup"></thead>
294
286
  <tbody id="items" role="rowgroup"></tbody>
@@ -498,6 +490,7 @@ class Grid extends ElementMixin(
498
490
  const cellCoordinates = this.__getBodyCellCoordinates(cell);
499
491
 
500
492
  virtualizer.size = effectiveSize;
493
+ virtualizer.update();
501
494
  virtualizer.flush();
502
495
 
503
496
  // If the focused cell's parent row got hidden by the size change, focus the corresponding new cell
@@ -589,6 +582,9 @@ class Grid extends ElementMixin(
589
582
  * @private
590
583
  */
591
584
  _recalculateColumnWidths(cols) {
585
+ // Flush to make sure DOM is up-to-date when measuring the column widths
586
+ this.__virtualizer.flush();
587
+
592
588
  cols.forEach((col) => {
593
589
  col.width = `${this.__getDistributedWidth(col)}px`;
594
590
  });
@@ -828,6 +824,7 @@ class Grid extends ElementMixin(
828
824
  }
829
825
 
830
826
  row.toggleAttribute('first', index === 0);
827
+ row.toggleAttribute('last', index === this._effectiveSize - 1);
831
828
  row.toggleAttribute('odd', index % 2);
832
829
  this._a11yUpdateRowRowindex(row, index);
833
830
  this._getItem(index, row);
@@ -133,6 +133,10 @@ registerStyles(
133
133
  margin-top: -1px;
134
134
  }
135
135
 
136
+ :host([all-rows-visible]) [part~='row'][last][dragover='below'] [part~='cell']::after {
137
+ height: 1px;
138
+ }
139
+
136
140
  [part~='row'][dragover='above'] [part~='cell']::after {
137
141
  top: auto;
138
142
  bottom: 100%;
@@ -183,6 +183,10 @@ registerStyles(
183
183
  margin-top: -1px;
184
184
  }
185
185
 
186
+ :host([all-rows-visible]) [part~='row'][last][dragover='below'] [part~='cell']::after {
187
+ height: 1px;
188
+ }
189
+
186
190
  [part~='row'][dragover='above'] [part~='cell']::after {
187
191
  top: auto;
188
192
  bottom: 100%;
@@ -200,8 +204,6 @@ registerStyles(
200
204
  }
201
205
 
202
206
  [part~='row'][dragstart] {
203
- /* Add bottom-space to the row so the drag number doesn't get clipped. Needed for IE/Edge */
204
- border-bottom: 100px solid transparent;
205
207
  z-index: 100 !important;
206
208
  opacity: 0.9;
207
209
  }