@vaadin/grid 22.0.1 → 23.0.0-alpha3

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 (54) hide show
  1. package/package.json +9 -9
  2. package/src/all-imports.js +1 -1
  3. package/src/array-data-provider.js +2 -3
  4. package/src/vaadin-grid-a11y-mixin.js +1 -1
  5. package/src/vaadin-grid-active-item-mixin.d.ts +1 -1
  6. package/src/vaadin-grid-active-item-mixin.js +1 -1
  7. package/src/vaadin-grid-array-data-provider-mixin.d.ts +1 -1
  8. package/src/vaadin-grid-array-data-provider-mixin.js +1 -1
  9. package/src/vaadin-grid-column-group.d.ts +1 -1
  10. package/src/vaadin-grid-column-group.js +2 -2
  11. package/src/vaadin-grid-column-reordering-mixin.d.ts +1 -1
  12. package/src/vaadin-grid-column-reordering-mixin.js +5 -8
  13. package/src/vaadin-grid-column-resizing-mixin.js +3 -4
  14. package/src/vaadin-grid-column.d.ts +1 -1
  15. package/src/vaadin-grid-column.js +21 -14
  16. package/src/vaadin-grid-data-provider-mixin.d.ts +1 -1
  17. package/src/vaadin-grid-data-provider-mixin.js +4 -6
  18. package/src/vaadin-grid-drag-and-drop-mixin.d.ts +1 -1
  19. package/src/vaadin-grid-drag-and-drop-mixin.js +1 -1
  20. package/src/vaadin-grid-dynamic-columns-mixin.js +6 -9
  21. package/src/vaadin-grid-event-context-mixin.d.ts +1 -1
  22. package/src/vaadin-grid-event-context-mixin.js +1 -1
  23. package/src/vaadin-grid-filter-column.d.ts +1 -1
  24. package/src/vaadin-grid-filter-column.js +1 -1
  25. package/src/vaadin-grid-filter-mixin.js +1 -1
  26. package/src/vaadin-grid-filter.d.ts +1 -1
  27. package/src/vaadin-grid-filter.js +1 -1
  28. package/src/vaadin-grid-helpers.js +3 -3
  29. package/src/vaadin-grid-keyboard-navigation-mixin.js +77 -70
  30. package/src/vaadin-grid-row-details-mixin.d.ts +1 -1
  31. package/src/vaadin-grid-row-details-mixin.js +1 -2
  32. package/src/vaadin-grid-scroll-mixin.d.ts +1 -1
  33. package/src/vaadin-grid-scroll-mixin.js +6 -6
  34. package/src/vaadin-grid-selection-column.d.ts +1 -1
  35. package/src/vaadin-grid-selection-column.js +2 -2
  36. package/src/vaadin-grid-selection-mixin.d.ts +1 -1
  37. package/src/vaadin-grid-selection-mixin.js +1 -1
  38. package/src/vaadin-grid-sort-column.d.ts +1 -1
  39. package/src/vaadin-grid-sort-column.js +1 -1
  40. package/src/vaadin-grid-sort-mixin.d.ts +1 -1
  41. package/src/vaadin-grid-sort-mixin.js +8 -10
  42. package/src/vaadin-grid-sorter.d.ts +1 -1
  43. package/src/vaadin-grid-sorter.js +1 -1
  44. package/src/vaadin-grid-styles.js +1 -1
  45. package/src/vaadin-grid-styling-mixin.d.ts +1 -1
  46. package/src/vaadin-grid-styling-mixin.js +1 -1
  47. package/src/vaadin-grid-tree-column.d.ts +1 -1
  48. package/src/vaadin-grid-tree-column.js +1 -1
  49. package/src/vaadin-grid-tree-toggle.d.ts +1 -1
  50. package/src/vaadin-grid-tree-toggle.js +1 -1
  51. package/src/vaadin-grid.d.ts +3 -2
  52. package/src/vaadin-grid.js +15 -10
  53. package/theme/lumo/vaadin-grid-styles.js +4 -0
  54. 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.1",
3
+ "version": "23.0.0-alpha3",
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.1",
44
- "@vaadin/component-base": "^22.0.1",
45
- "@vaadin/text-field": "^22.0.1",
46
- "@vaadin/vaadin-lumo-styles": "^22.0.1",
47
- "@vaadin/vaadin-material-styles": "^22.0.1",
48
- "@vaadin/vaadin-themable-mixin": "^22.0.1"
43
+ "@vaadin/checkbox": "23.0.0-alpha3",
44
+ "@vaadin/component-base": "23.0.0-alpha3",
45
+ "@vaadin/text-field": "23.0.0-alpha3",
46
+ "@vaadin/vaadin-lumo-styles": "23.0.0-alpha3",
47
+ "@vaadin/vaadin-material-styles": "23.0.0-alpha3",
48
+ "@vaadin/vaadin-themable-mixin": "23.0.0-alpha3"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@esm-bundle/chai": "^4.3.4",
52
- "@vaadin/polymer-legacy-adapter": "^22.0.1",
52
+ "@vaadin/polymer-legacy-adapter": "23.0.0-alpha3",
53
53
  "@vaadin/testing-helpers": "^0.3.2",
54
54
  "lit": "^2.0.0",
55
55
  "sinon": "^9.2.0"
56
56
  },
57
- "gitHead": "2b0a2bff0369d6020f7cc33ad35506aa2d1f6f68"
57
+ "gitHead": "490037919a9e054cc002c1b3be0c94a1603e1a44"
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';
@@ -22,7 +22,7 @@ function checkPaths(arrayToCheck, action, items) {
22
22
 
23
23
  let result = true;
24
24
 
25
- for (let i in arrayToCheck) {
25
+ for (const i in arrayToCheck) {
26
26
  const path = arrayToCheck[i].path;
27
27
 
28
28
  // skip simple paths
@@ -73,9 +73,8 @@ function normalizeEmptyValue(value) {
73
73
  return '';
74
74
  } else if (isNaN(value)) {
75
75
  return value.toString();
76
- } else {
77
- return value;
78
76
  }
77
+ return value;
79
78
  }
80
79
 
81
80
  /**
@@ -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';
@@ -162,7 +162,7 @@ class GridColumnGroup extends ColumnBaseMixin(PolymerElement) {
162
162
  const childCountDigits = ~~(Math.log(rootColumns.length) / Math.LN10) + 1;
163
163
 
164
164
  // Final scope for the child columns needs to mind both factors.
165
- const scope = Math.pow(10, trailingZeros - childCountDigits);
165
+ const scope = 10 ** (trailingZeros - childCountDigits);
166
166
 
167
167
  if (_rootColumns[0] && _rootColumns[0]._order) {
168
168
  _rootColumns.sort((a, b) => a._order - b._order);
@@ -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,17 +1,16 @@
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
- import { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';
7
- import { addListener } from '@polymer/polymer/lib/utils/gestures.js';
6
+ import { addListener } from '@vaadin/component-base/src/gestures.js';
8
7
  import { updateColumnOrders } from './vaadin-grid-helpers.js';
9
8
 
10
9
  /**
11
10
  * @polymerMixin
12
11
  */
13
12
  export const ColumnReorderingMixin = (superClass) =>
14
- class ColumnReorderingMixin extends GestureEventListeners(superClass) {
13
+ class ColumnReorderingMixin extends superClass {
15
14
  static get properties() {
16
15
  return {
17
16
  /**
@@ -339,9 +338,8 @@ export const ColumnReorderingMixin = (superClass) =>
339
338
  const targetRect = targetCell.getBoundingClientRect();
340
339
  if (targetRect.left > sourceCellRect.left) {
341
340
  return clientX > targetRect.right - sourceCellRect.width;
342
- } else {
343
- return clientX < targetRect.left + sourceCellRect.width;
344
341
  }
342
+ return clientX < targetRect.left + sourceCellRect.width;
345
343
  }
346
344
 
347
345
  /**
@@ -371,9 +369,8 @@ export const ColumnReorderingMixin = (superClass) =>
371
369
  }
372
370
  if (candidate.parentElement === draggedColumn.parentElement) {
373
371
  return candidate;
374
- } else {
375
- return targetCell._column;
376
372
  }
373
+ return targetCell._column;
377
374
  }
378
375
  }
379
376
 
@@ -1,16 +1,15 @@
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
- import { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';
7
- import { addListener } from '@polymer/polymer/lib/utils/gestures.js';
6
+ import { addListener } from '@vaadin/component-base/src/gestures.js';
8
7
 
9
8
  /**
10
9
  * @polymerMixin
11
10
  */
12
11
  export const ColumnResizingMixin = (superClass) =>
13
- class ColumnResizingMixin extends GestureEventListeners(superClass) {
12
+ class ColumnResizingMixin extends superClass {
14
13
  ready() {
15
14
  super.ready();
16
15
  const scroller = this.$.scroller;
@@ -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';
@@ -30,9 +30,8 @@ export const ColumnBaseMixin = (superClass) =>
30
30
  const parent = this.parentNode;
31
31
  if (parent && parent.localName === 'vaadin-grid-column-group') {
32
32
  return parent.resizable || false;
33
- } else {
34
- return false;
35
33
  }
34
+ return false;
36
35
  }
37
36
  },
38
37
 
@@ -197,7 +196,9 @@ export const ColumnBaseMixin = (superClass) =>
197
196
  // Adds the column cells to the grid after the column is attached
198
197
  requestAnimationFrame(() => {
199
198
  // Skip if the column has been detached
200
- if (!this._grid) return;
199
+ if (!this._grid) {
200
+ return;
201
+ }
201
202
 
202
203
  this._allCells.forEach((cell) => {
203
204
  if (!cell._content.parentNode) {
@@ -214,7 +215,9 @@ export const ColumnBaseMixin = (superClass) =>
214
215
  // Removes the column cells from the grid after the column is detached
215
216
  requestAnimationFrame(() => {
216
217
  // Skip if the column has been attached again
217
- if (this._grid) return;
218
+ if (this._grid) {
219
+ return;
220
+ }
218
221
 
219
222
  this._allCells.forEach((cell) => {
220
223
  if (cell._content.parentNode) {
@@ -380,12 +383,10 @@ export const ColumnBaseMixin = (superClass) =>
380
383
  } else if (textAlign === 'end') {
381
384
  textAlignFallback = 'right';
382
385
  }
383
- } else {
384
- if (textAlign === 'start') {
385
- textAlignFallback = 'right';
386
- } else if (textAlign === 'end') {
387
- textAlignFallback = 'left';
388
- }
386
+ } else if (textAlign === 'start') {
387
+ textAlignFallback = 'right';
388
+ } else if (textAlign === 'end') {
389
+ textAlignFallback = 'left';
389
390
  }
390
391
 
391
392
  this._allCells.forEach((cell) => {
@@ -450,7 +451,9 @@ export const ColumnBaseMixin = (superClass) =>
450
451
  cells.forEach((cell) => {
451
452
  const model = this._grid.__getRowModel(cell.parentElement);
452
453
 
453
- if (!renderer) return;
454
+ if (!renderer) {
455
+ return;
456
+ }
454
457
 
455
458
  if (cell._renderer !== renderer) {
456
459
  this._clearCellContent(cell);
@@ -558,7 +561,9 @@ export const ColumnBaseMixin = (superClass) =>
558
561
  * @protected
559
562
  */
560
563
  _defaultHeaderRenderer() {
561
- if (!this.path) return;
564
+ if (!this.path) {
565
+ return;
566
+ }
562
567
 
563
568
  this.__setTextContent(this._headerCell._content, this._generateHeader(this.path));
564
569
  }
@@ -570,7 +575,9 @@ export const ColumnBaseMixin = (superClass) =>
570
575
  * @protected
571
576
  */
572
577
  _defaultRenderer(root, _owner, { item }) {
573
- if (!this.path) return;
578
+ if (!this.path) {
579
+ return;
580
+ }
574
581
 
575
582
  this.__setTextContent(root, this.get(this.path, item));
576
583
  }
@@ -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';
@@ -324,7 +324,7 @@ export const DataProviderMixin = (superClass) =>
324
324
  let level = 0;
325
325
  while (cache.parentCache) {
326
326
  cache = cache.parentCache;
327
- level++;
327
+ level += 1;
328
328
  }
329
329
  return level;
330
330
  }
@@ -350,10 +350,8 @@ export const DataProviderMixin = (superClass) =>
350
350
  this.dataProvider(params, (items, size) => {
351
351
  if (size !== undefined) {
352
352
  cache.size = size;
353
- } else {
354
- if (params.parentItem) {
355
- cache.size = items.length;
356
- }
353
+ } else if (params.parentItem) {
354
+ cache.size = items.length;
357
355
  }
358
356
 
359
357
  const currentItems = Array.from(this.$.items.children).map((row) => row._item);
@@ -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';
@@ -54,9 +54,8 @@ export const DynamicColumnsMixin = (superClass) =>
54
54
  .map((col) => {
55
55
  if (col.localName === 'vaadin-grid-column-group') {
56
56
  return this._getChildColumns(col);
57
- } else {
58
- return [col];
59
57
  }
58
+ return [col];
60
59
  })
61
60
  .reduce((prev, curr) => {
62
61
  return prev.concat(curr);
@@ -66,14 +65,12 @@ export const DynamicColumnsMixin = (superClass) =>
66
65
  /** @private */
67
66
  _getColumnTree() {
68
67
  const rootColumns = FlattenedNodesObserver.getFlattenedNodes(this).filter(this._isColumnElement);
69
- const columnTree = [];
68
+ const columnTree = [rootColumns];
70
69
 
71
- for (let c = rootColumns; ; ) {
72
- columnTree.push(c);
73
- if (!this._hasColumnGroups(c)) {
74
- break;
75
- }
70
+ let c = rootColumns;
71
+ while (this._hasColumnGroups(c)) {
76
72
  c = this._flattenColumnGroups(c);
73
+ columnTree.push(c);
77
74
  }
78
75
 
79
76
  return columnTree;
@@ -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
 
@@ -15,9 +15,9 @@ export function updateColumnOrders(columns, scope, baseOrder) {
15
15
  // avoid multiples of 10 because they introduce and extra zero and
16
16
  // causes the underlying calculations for child order goes wrong
17
17
  if (c % 10 === 0) {
18
- c++;
18
+ c += 1;
19
19
  }
20
20
  column._order = baseOrder + c * scope;
21
- c++;
21
+ c += 1;
22
22
  });
23
23
  }
@@ -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
 
@@ -160,6 +160,8 @@ export const KeyboardNavigationMixin = (superClass) =>
160
160
  case ' ':
161
161
  keyGroup = 'Space';
162
162
  break;
163
+ default:
164
+ break;
163
165
  }
164
166
 
165
167
  this._detectInteracting(e);
@@ -240,28 +242,24 @@ export const KeyboardNavigationMixin = (superClass) =>
240
242
  if (this.__rowFocusMode) {
241
243
  // "If focus is on a row, moves focus to the first row. If focus is in the first row, focus does not move."
242
244
  dy = -Infinity;
245
+ } else if (e.ctrlKey) {
246
+ // "If focus is on a cell, moves focus to the first cell in the column. If focus is in the first row, focus does not move."
247
+ dy = -Infinity;
243
248
  } else {
244
- if (e.ctrlKey) {
245
- // "If focus is on a cell, moves focus to the first cell in the column. If focus is in the first row, focus does not move."
246
- dy = -Infinity;
247
- } else {
248
- // "If focus is on a cell, moves focus to the first cell in the row. If focus is in the first cell of the row, focus does not move."
249
- dx = -Infinity;
250
- }
249
+ // "If focus is on a cell, moves focus to the first cell in the row. If focus is in the first cell of the row, focus does not move."
250
+ dx = -Infinity;
251
251
  }
252
252
  break;
253
253
  case 'End':
254
254
  if (this.__rowFocusMode) {
255
255
  // "If focus is on a row, moves focus to the last row. If focus is in the last row, focus does not move."
256
256
  dy = Infinity;
257
+ } else if (e.ctrlKey) {
258
+ // "If focus is on a cell, moves focus to the last cell in the column. If focus is in the last row, focus does not move."
259
+ dy = Infinity;
257
260
  } else {
258
- if (e.ctrlKey) {
259
- // "If focus is on a cell, moves focus to the last cell in the column. If focus is in the last row, focus does not move."
260
- dy = Infinity;
261
- } else {
262
- // "If focus is on a cell, moves focus to the last cell in the row. If focus is in the last cell of the row, focus does not move."
263
- dx = Infinity;
264
- }
261
+ // "If focus is on a cell, moves focus to the last cell in the row. If focus is in the last cell of the row, focus does not move."
262
+ dx = Infinity;
265
263
  }
266
264
  break;
267
265
  case 'ArrowDown':
@@ -276,6 +274,8 @@ export const KeyboardNavigationMixin = (superClass) =>
276
274
  case 'PageUp':
277
275
  dy = -visibleItemsCount;
278
276
  break;
277
+ default:
278
+ break;
279
279
  }
280
280
 
281
281
  const activeRow = e.composedPath().find((el) => this.__isRow(el));
@@ -296,13 +296,12 @@ export const KeyboardNavigationMixin = (superClass) =>
296
296
  // "If focus is on a collapsed row, expands the row."
297
297
  this.expandItem(activeRow._item);
298
298
  return;
299
- } else {
300
- // "If focus is on an expanded row or is on a row that does not have child rows,
301
- // moves focus to the first cell in the row."
302
- this.__rowFocusMode = false;
303
- this._onCellNavigation(activeRow.firstElementChild, 0, 0);
304
- return;
305
299
  }
300
+ // "If focus is on an expanded row or is on a row that does not have child rows,
301
+ // moves focus to the first cell in the row."
302
+ this.__rowFocusMode = false;
303
+ this._onCellNavigation(activeRow.firstElementChild, 0, 0);
304
+ return;
306
305
  }
307
306
  } else if (key === backwardsKey) {
308
307
  // "Left Arrow:"
@@ -354,14 +353,13 @@ export const KeyboardNavigationMixin = (superClass) =>
354
353
  // Body rows have index property, otherwise DOM child index of the row is used.
355
354
  if (rowGroup === this.$.items) {
356
355
  return bodyFallbackIndex !== undefined ? bodyFallbackIndex : row.index;
357
- } else {
358
- return this.__getIndexOfChildElement(row);
359
356
  }
357
+ return this.__getIndexOfChildElement(row);
360
358
  }
361
359
 
362
360
  /**
363
361
  * Returns the target row after navigating by the given dy offset.
364
- * Also returns infromation whether the details cell should be the target on the target row.
362
+ * Also returns information whether the details cell should be the target on the target row.
365
363
  * If the row is not in the viewport, it is first scrolled to.
366
364
  * @private
367
365
  **/
@@ -381,62 +379,58 @@ export const KeyboardNavigationMixin = (superClass) =>
381
379
  // in vertical keyboard navigation.
382
380
  if (dstRowIndex > currentRowIndex) {
383
381
  while (dstRowIndex < maxRowIndex && activeRowGroup.children[dstRowIndex].hidden) {
384
- dstRowIndex++;
382
+ dstRowIndex += 1;
385
383
  }
386
384
  } else if (dstRowIndex < currentRowIndex) {
387
385
  while (dstRowIndex > 0 && activeRowGroup.children[dstRowIndex].hidden) {
388
- dstRowIndex--;
386
+ dstRowIndex -= 1;
389
387
  }
390
388
  }
391
389
 
392
390
  this.toggleAttribute('navigating', true);
393
391
 
394
392
  return { dstRow: activeRowGroup.children[dstRowIndex] };
395
- } else {
396
- // Navigating body rows
397
-
398
- let dstIsRowDetails = false;
399
- if (activeCell) {
400
- const isRowDetails = this.__isDetailsCell(activeCell);
401
- // Row details navigation logic
402
- if (activeRowGroup === this.$.items) {
403
- const item = activeRow._item;
404
- const dstItem = this._cache.getItemForIndex(dstRowIndex);
405
- // Should we navigate to row details?
406
- if (isRowDetails) {
407
- dstIsRowDetails = dy === 0;
408
- } else {
409
- dstIsRowDetails =
410
- (dy === 1 && this._isDetailsOpened(item)) ||
411
- (dy === -1 && dstRowIndex !== currentRowIndex && this._isDetailsOpened(dstItem));
412
- }
413
- // Should we navigate between details and regular cells of the same row?
414
- if (
415
- dstIsRowDetails !== isRowDetails &&
416
- ((dy === 1 && dstIsRowDetails) || (dy === -1 && !dstIsRowDetails))
417
- ) {
418
- dstRowIndex = currentRowIndex;
419
- }
393
+ }
394
+ // Navigating body rows
395
+
396
+ let dstIsRowDetails = false;
397
+ if (activeCell) {
398
+ const isRowDetails = this.__isDetailsCell(activeCell);
399
+ // Row details navigation logic
400
+ if (activeRowGroup === this.$.items) {
401
+ const item = activeRow._item;
402
+ const dstItem = this._cache.getItemForIndex(dstRowIndex);
403
+ // Should we navigate to row details?
404
+ if (isRowDetails) {
405
+ dstIsRowDetails = dy === 0;
406
+ } else {
407
+ dstIsRowDetails =
408
+ (dy === 1 && this._isDetailsOpened(item)) ||
409
+ (dy === -1 && dstRowIndex !== currentRowIndex && this._isDetailsOpened(dstItem));
410
+ }
411
+ // Should we navigate between details and regular cells of the same row?
412
+ if (dstIsRowDetails !== isRowDetails && ((dy === 1 && dstIsRowDetails) || (dy === -1 && !dstIsRowDetails))) {
413
+ dstRowIndex = currentRowIndex;
420
414
  }
421
415
  }
416
+ }
422
417
 
423
- // Ensure correct vertical scroll position, destination row is visible
424
- this._ensureScrolledToIndex(dstRowIndex);
418
+ // Ensure correct vertical scroll position, destination row is visible
419
+ this._ensureScrolledToIndex(dstRowIndex);
425
420
 
426
- // When scrolling with repeated keydown, sometimes FocusEvent listeners
427
- // are too late to update _focusedItemIndex. Ensure next keydown
428
- // listener invocation gets updated _focusedItemIndex value.
429
- this._focusedItemIndex = dstRowIndex;
421
+ // When scrolling with repeated keydown, sometimes FocusEvent listeners
422
+ // are too late to update _focusedItemIndex. Ensure next keydown
423
+ // listener invocation gets updated _focusedItemIndex value.
424
+ this._focusedItemIndex = dstRowIndex;
430
425
 
431
- // This has to be set after scrolling, otherwise it can be removed by
432
- // `_preventScrollerRotatingCellFocus(row, index)` during scrolling.
433
- this.toggleAttribute('navigating', true);
426
+ // This has to be set after scrolling, otherwise it can be removed by
427
+ // `_preventScrollerRotatingCellFocus(row, index)` during scrolling.
428
+ this.toggleAttribute('navigating', true);
434
429
 
435
- return {
436
- dstRow: [...activeRowGroup.children].find((el) => !el.hidden && el.index === dstRowIndex),
437
- dstIsRowDetails
438
- };
439
- }
430
+ return {
431
+ dstRow: [...activeRowGroup.children].find((el) => !el.hidden && el.index === dstRowIndex),
432
+ dstIsRowDetails
433
+ };
440
434
  }
441
435
 
442
436
  /**
@@ -499,7 +493,10 @@ export const KeyboardNavigationMixin = (superClass) =>
499
493
  this._focusedColumnOrder = undefined;
500
494
  }
501
495
 
502
- const columnIndexByOrder = dstColumns.reduce((acc, col, i) => ((acc[col._order] = i), acc), {});
496
+ const columnIndexByOrder = dstColumns.reduce((acc, col, i) => {
497
+ acc[col._order] = i;
498
+ return acc;
499
+ }, {});
503
500
  const dstColumnIndex = columnIndexByOrder[dstSortedColumnOrders[dstOrderedColumnIndex]];
504
501
  const dstCell = dstRow.children[dstColumnIndex];
505
502
 
@@ -526,6 +523,8 @@ export const KeyboardNavigationMixin = (superClass) =>
526
523
  case 'F2':
527
524
  wantInteracting = !this.interacting;
528
525
  break;
526
+ default:
527
+ break;
529
528
  }
530
529
 
531
530
  const { cell } = this._getGridEventLocation(e);
@@ -730,7 +729,9 @@ export const KeyboardNavigationMixin = (superClass) =>
730
729
  * @param {HTMLElement} focusTarget
731
730
  */
732
731
  _updateGridSectionFocusTarget(focusTarget) {
733
- if (!focusTarget) return;
732
+ if (!focusTarget) {
733
+ return;
734
+ }
734
735
 
735
736
  const section = this._getGridSectionFromFocusTarget(focusTarget);
736
737
  const isInteractingWithinActiveSection = this.interacting && section === this._activeRowGroup;
@@ -888,9 +889,15 @@ export const KeyboardNavigationMixin = (superClass) =>
888
889
  * @private
889
890
  */
890
891
  _getGridSectionFromFocusTarget(focusTarget) {
891
- if (focusTarget === this._headerFocusable) return this.$.header;
892
- if (focusTarget === this._itemsFocusable) return this.$.items;
893
- if (focusTarget === this._footerFocusable) return this.$.footer;
892
+ if (focusTarget === this._headerFocusable) {
893
+ return this.$.header;
894
+ }
895
+ if (focusTarget === this._itemsFocusable) {
896
+ return this.$.items;
897
+ }
898
+ if (focusTarget === this._footerFocusable) {
899
+ return this.$.footer;
900
+ }
894
901
  return null;
895
902
  }
896
903
 
@@ -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
 
@@ -106,7 +106,6 @@ export const RowDetailsMixin = (superClass) =>
106
106
  // Re-renders the row to open the details when a row details renderer is provided.
107
107
  if (rowDetailsRenderer && this._isDetailsOpened(row._item)) {
108
108
  this._updateItem(row, row._item);
109
- return;
110
109
  }
111
110
  });
112
111
  }
@@ -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';
@@ -31,6 +31,11 @@ export const ScrollMixin = (superClass) =>
31
31
  };
32
32
  }
33
33
 
34
+ /** @private */
35
+ get _scrollTop() {
36
+ return this.$.table.scrollTop;
37
+ }
38
+
34
39
  /**
35
40
  * Override (from iron-scroll-target-behavior) to avoid document scroll
36
41
  * @private
@@ -39,11 +44,6 @@ export const ScrollMixin = (superClass) =>
39
44
  this.$.table.scrollTop = top;
40
45
  }
41
46
 
42
- /** @private */
43
- get _scrollTop() {
44
- return this.$.table.scrollTop;
45
- }
46
-
47
47
  /** @private */
48
48
  get _scrollLeft() {
49
49
  return this.$.table.scrollLeft;
@@ -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';
@@ -235,7 +235,7 @@ class GridSelectionColumn extends GridColumn {
235
235
  }
236
236
 
237
237
  /**
238
- * iOS needs indeterminated + checked at the same time
238
+ * iOS needs indeterminate + checked at the same time
239
239
  * @private
240
240
  */
241
241
  __isChecked(selectAll, indeterminate) {
@@ -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
 
@@ -88,15 +88,13 @@ export const SortMixin = (superClass) =>
88
88
  this._sorters.unshift(sorter);
89
89
  }
90
90
  this.__updateSortOrders();
91
- } else {
92
- if (sorter.direction) {
93
- const otherSorters = this._sorters.filter((s) => s != sorter);
94
- this._sorters = [sorter];
95
- otherSorters.forEach((sorter) => {
96
- sorter._order = null;
97
- sorter.direction = null;
98
- });
99
- }
91
+ } else if (sorter.direction) {
92
+ const otherSorters = this._sorters.filter((s) => s != sorter);
93
+ this._sorters = [sorter];
94
+ otherSorters.forEach((sorter) => {
95
+ sorter._order = null;
96
+ sorter.direction = null;
97
+ });
100
98
  }
101
99
  }
102
100
 
@@ -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';
@@ -308,7 +308,7 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
308
308
  * `reorder-status` | Reflects the status of a cell while columns are being reordered | cell
309
309
  * `frozen` | Frozen cell | cell
310
310
  * `last-frozen` | Last frozen cell | cell
311
- * * `first-column` | First visible cell on a row | cell
311
+ * `first-column` | First visible cell on a row | cell
312
312
  * `last-column` | Last visible cell on a row | cell
313
313
  * `selected` | Selected row | row
314
314
  * `expanded` | Expanded row | row
@@ -316,6 +316,7 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
316
316
  * `loading` | Row that is waiting for data from data provider | row
317
317
  * `odd` | Odd row | row
318
318
  * `first` | The first body row | row
319
+ * `last` | The last body row | row
319
320
  * `dragstart` | Set for one frame when drag of a row is starting. The value is a number when multiple rows are dragged | row
320
321
  * `dragover` | Set when the row is dragged over | row
321
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';
@@ -194,7 +194,7 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
194
194
  * `reorder-status` | Reflects the status of a cell while columns are being reordered | cell
195
195
  * `frozen` | Frozen cell | cell
196
196
  * `last-frozen` | Last frozen cell | cell
197
- * * `first-column` | First visible cell on a row | cell
197
+ * `first-column` | First visible cell on a row | cell
198
198
  * `last-column` | Last visible cell on a row | cell
199
199
  * `selected` | Selected row | row
200
200
  * `expanded` | Expanded row | row
@@ -202,6 +202,7 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
202
202
  * `loading` | Row that is waiting for data from data provider | row
203
203
  * `odd` | Odd row | row
204
204
  * `first` | The first body row | row
205
+ * `last` | The last body row | row
205
206
  * `dragstart` | Set for one frame when drag of a row is starting. The value is a number when multiple rows are dragged | row
206
207
  * `dragover` | Set when the row is dragged over | row
207
208
  * `drag-disabled` | Set to a row that isn't available for dragging | row
@@ -279,7 +280,7 @@ class Grid extends ElementMixin(
279
280
  loading$="[[loading]]"
280
281
  column-reordering-allowed$="[[columnReorderingAllowed]]"
281
282
  >
282
- <table id="table" role="grid" aria-multiselectable="true" tabindex="0">
283
+ <table id="table" role="treegrid" aria-multiselectable="true" tabindex="0">
283
284
  <caption id="sizer" part="row"></caption>
284
285
  <thead id="header" role="rowgroup"></thead>
285
286
  <tbody id="items" role="rowgroup"></tbody>
@@ -489,6 +490,7 @@ class Grid extends ElementMixin(
489
490
  const cellCoordinates = this.__getBodyCellCoordinates(cell);
490
491
 
491
492
  virtualizer.size = effectiveSize;
493
+ virtualizer.update();
492
494
  virtualizer.flush();
493
495
 
494
496
  // If the focused cell's parent row got hidden by the size change, focus the corresponding new cell
@@ -543,7 +545,9 @@ class Grid extends ElementMixin(
543
545
 
544
546
  /** @private */
545
547
  __getDistributedWidth(col, innerColumn) {
546
- if (col == null || col === this) return 0;
548
+ if (col == null || col === this) {
549
+ return 0;
550
+ }
547
551
 
548
552
  const columnWidth = Math.max(this.__getIntrinsicWidth(col), this.__getDistributedWidth(col.parentElement, col));
549
553
 
@@ -685,6 +689,7 @@ class Grid extends ElementMixin(
685
689
  * @param {boolean} noNotify
686
690
  * @protected
687
691
  */
692
+ // eslint-disable-next-line max-params
688
693
  _updateRow(row, columns, section, isColumnRow, noNotify) {
689
694
  section = section || 'body';
690
695
 
@@ -793,13 +798,12 @@ class Grid extends ElementMixin(
793
798
  // -> row should be visible
794
799
  return true;
795
800
  }
796
- } else {
797
- if (column.footerRenderer) {
798
- // The cell is the footer cell of a column that has a footer renderer
799
- // -> row should be visible
800
- return true;
801
- }
801
+ } else if (column.footerRenderer) {
802
+ // The cell is the footer cell of a column that has a footer renderer
803
+ // -> row should be visible
804
+ return true;
802
805
  }
806
+ return false;
803
807
  });
804
808
 
805
809
  if (row.hidden !== !visibleRowCells.length) {
@@ -819,6 +823,7 @@ class Grid extends ElementMixin(
819
823
  }
820
824
 
821
825
  row.toggleAttribute('first', index === 0);
826
+ row.toggleAttribute('last', index === this._effectiveSize - 1);
822
827
  row.toggleAttribute('odd', index % 2);
823
828
  this._a11yUpdateRowRowindex(row, index);
824
829
  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
  }