@vaadin/grid 25.2.0-alpha1 → 25.2.0-alpha10

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.
@@ -4016,6 +4016,20 @@
4016
4016
  "module": "src/vaadin-grid-row-details-mixin.js"
4017
4017
  }
4018
4018
  },
4019
+ {
4020
+ "kind": "field",
4021
+ "name": "disabled",
4022
+ "privacy": "public",
4023
+ "type": {
4024
+ "text": "boolean"
4025
+ },
4026
+ "description": "If true, the user cannot interact with this element.",
4027
+ "attribute": "disabled",
4028
+ "inheritedFrom": {
4029
+ "name": "DisabledMixin",
4030
+ "package": "@vaadin/a11y-base/src/disabled-mixin.js"
4031
+ }
4032
+ },
4019
4033
  {
4020
4034
  "kind": "field",
4021
4035
  "name": "dragFilter",
@@ -4519,6 +4533,18 @@
4519
4533
  "module": "src/vaadin-grid-data-provider-mixin.js"
4520
4534
  }
4521
4535
  },
4536
+ {
4537
+ "name": "disabled",
4538
+ "type": {
4539
+ "text": "boolean"
4540
+ },
4541
+ "description": "If true, the user cannot interact with this element.",
4542
+ "fieldName": "disabled",
4543
+ "inheritedFrom": {
4544
+ "name": "DisabledMixin",
4545
+ "package": "@vaadin/a11y-base/src/disabled-mixin.js"
4546
+ }
4547
+ },
4522
4548
  {
4523
4549
  "name": "drag-filter",
4524
4550
  "type": {
@@ -7764,6 +7790,20 @@
7764
7790
  "module": "src/vaadin-grid-row-details-mixin.js"
7765
7791
  }
7766
7792
  },
7793
+ {
7794
+ "kind": "field",
7795
+ "name": "disabled",
7796
+ "privacy": "public",
7797
+ "type": {
7798
+ "text": "boolean"
7799
+ },
7800
+ "description": "If true, the user cannot interact with this element.",
7801
+ "attribute": "disabled",
7802
+ "inheritedFrom": {
7803
+ "name": "DisabledMixin",
7804
+ "package": "@vaadin/a11y-base/src/disabled-mixin.js"
7805
+ }
7806
+ },
7767
7807
  {
7768
7808
  "kind": "field",
7769
7809
  "name": "dragFilter",
@@ -8213,7 +8253,7 @@
8213
8253
  "type": {
8214
8254
  "text": "CustomEvent"
8215
8255
  },
8216
- "description": "Fired when a cell is focused with click or keyboard navigation.",
8256
+ "description": "Fired when a cell is focused with click or keyboard navigation. Use the `context` property to read event details.",
8217
8257
  "name": "cell-focus"
8218
8258
  },
8219
8259
  {
@@ -8415,6 +8455,18 @@
8415
8455
  "module": "src/vaadin-grid-data-provider-mixin.js"
8416
8456
  }
8417
8457
  },
8458
+ {
8459
+ "name": "disabled",
8460
+ "type": {
8461
+ "text": "boolean"
8462
+ },
8463
+ "description": "If true, the user cannot interact with this element.",
8464
+ "fieldName": "disabled",
8465
+ "inheritedFrom": {
8466
+ "name": "DisabledMixin",
8467
+ "package": "@vaadin/a11y-base/src/disabled-mixin.js"
8468
+ }
8469
+ },
8418
8470
  {
8419
8471
  "name": "drag-filter",
8420
8472
  "type": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/grid",
3
- "version": "25.2.0-alpha1",
3
+ "version": "25.2.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -45,20 +45,20 @@
45
45
  ],
46
46
  "dependencies": {
47
47
  "@open-wc/dedupe-mixin": "^1.3.0",
48
- "@vaadin/a11y-base": "25.2.0-alpha1",
49
- "@vaadin/checkbox": "25.2.0-alpha1",
50
- "@vaadin/component-base": "25.2.0-alpha1",
51
- "@vaadin/lit-renderer": "25.2.0-alpha1",
52
- "@vaadin/text-field": "25.2.0-alpha1",
53
- "@vaadin/vaadin-themable-mixin": "25.2.0-alpha1",
48
+ "@vaadin/a11y-base": "25.2.0-alpha10",
49
+ "@vaadin/checkbox": "25.2.0-alpha10",
50
+ "@vaadin/component-base": "25.2.0-alpha10",
51
+ "@vaadin/lit-renderer": "25.2.0-alpha10",
52
+ "@vaadin/text-field": "25.2.0-alpha10",
53
+ "@vaadin/vaadin-themable-mixin": "25.2.0-alpha10",
54
54
  "lit": "^3.0.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@vaadin/aura": "25.2.0-alpha1",
58
- "@vaadin/chai-plugins": "25.2.0-alpha1",
59
- "@vaadin/test-runner-commands": "25.2.0-alpha1",
57
+ "@vaadin/aura": "25.2.0-alpha10",
58
+ "@vaadin/chai-plugins": "25.2.0-alpha10",
59
+ "@vaadin/test-runner-commands": "25.2.0-alpha10",
60
60
  "@vaadin/testing-helpers": "^2.0.0",
61
- "@vaadin/vaadin-lumo-styles": "25.2.0-alpha1",
61
+ "@vaadin/vaadin-lumo-styles": "25.2.0-alpha10",
62
62
  "sinon": "^21.0.2"
63
63
  },
64
64
  "customElements": "custom-elements.json",
@@ -66,5 +66,5 @@
66
66
  "web-types.json",
67
67
  "web-types.lit.json"
68
68
  ],
69
- "gitHead": "866f813f89655a351cbd25328eba1fcb317e267d"
69
+ "gitHead": "1303b6a3eeecb44a9d26f2b53cb56d9e906febdf"
70
70
  }
@@ -54,7 +54,7 @@ export const A11yMixin = (superClass) =>
54
54
 
55
55
  // If no header and footer rows while the empty state is active, count as one column
56
56
  // Otherwise, use the number of body columns, if present
57
- const columnsCount = emptyState ? 1 : (rowsCount && bodyColumns && bodyColumns.length) || 0;
57
+ const columnsCount = emptyState ? 1 : (rowsCount && bodyColumns?.length) || 0;
58
58
  this.$.table.setAttribute('aria-colcount', columnsCount);
59
59
 
60
60
  this.__a11yUpdateHeaderRows();
@@ -164,7 +164,7 @@ export const A11yMixin = (superClass) =>
164
164
  while (cellContent && cellContent.localName !== 'vaadin-grid-cell-content') {
165
165
  cellContent = cellContent.parentNode;
166
166
  }
167
- if (cellContent && cellContent.assignedSlot) {
167
+ if (cellContent?.assignedSlot) {
168
168
  const cell = cellContent.assignedSlot.parentNode;
169
169
  cell.setAttribute(
170
170
  'aria-sort',
@@ -116,16 +116,4 @@ export const ActiveItemMixin = (superClass) =>
116
116
  _isFocusable(target) {
117
117
  return isFocusable(target);
118
118
  }
119
-
120
- /**
121
- * Fired when the `activeItem` property changes.
122
- *
123
- * @event active-item-changed
124
- */
125
-
126
- /**
127
- * Fired when the cell is activated with click or keyboard.
128
- *
129
- * @event cell-activate
130
- */
131
119
  };
@@ -145,8 +145,7 @@ export const ColumnAutoWidthMixin = (superClass) =>
145
145
  }
146
146
  });
147
147
 
148
- this.__hasHadRenderedRowsForColumnWidthCalculation =
149
- this.__hasHadRenderedRowsForColumnWidthCalculation || this._getRenderedRows().length > 0;
148
+ this.__hasHadRenderedRowsForColumnWidthCalculation ||= this._getRenderedRows().length > 0;
150
149
 
151
150
  this.__intrinsicWidthCache = new Map();
152
151
  // Cache the viewport rows to avoid unnecessary reflows while measuring the column widths
@@ -36,7 +36,9 @@ export * from './vaadin-grid-column-group-mixin.js';
36
36
  * column2.renderer = (root, column, model) => { ... };
37
37
  * ```
38
38
  */
39
- declare class GridColumnGroup extends HTMLElement {}
39
+ declare class GridColumnGroup extends HTMLElement {
40
+ hidden: boolean;
41
+ }
40
42
 
41
43
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
42
44
  interface GridColumnGroup<TItem = GridDefaultItem> extends GridColumnGroupMixin<TItem, GridColumnGroup<TItem>> {}
@@ -29,7 +29,7 @@ export const ColumnBaseMixin = (superClass) =>
29
29
  }
30
30
 
31
31
  const parent = this.parentNode;
32
- if (parent && parent.localName === 'vaadin-grid-column-group') {
32
+ if (parent?.localName === 'vaadin-grid-column-group') {
33
33
  return parent.resizable || false;
34
34
  }
35
35
  return false;
@@ -563,7 +563,7 @@ export const ColumnBaseMixin = (superClass) =>
563
563
 
564
564
  /** @protected */
565
565
  _runRenderer(renderer, cell, model) {
566
- const isVisibleBodyCell = model && model.item && !cell.parentElement.hidden;
566
+ const isVisibleBodyCell = model?.item && !cell.parentElement.hidden;
567
567
  const shouldRender = isVisibleBodyCell || renderer === this._headerRenderer || renderer === this._footerRenderer;
568
568
  if (!shouldRender) {
569
569
  return;
@@ -147,8 +147,8 @@ export const ColumnReorderingMixin = (superClass) =>
147
147
  }
148
148
 
149
149
  // Cancel reordering if there are draggable nodes on the event path following this element
150
- const path = e.composedPath && e.composedPath();
151
- if (path && path.slice(0, Math.max(0, path.indexOf(this))).some((node) => node.draggable)) {
150
+ const path = e.composedPath?.();
151
+ if (path?.slice(0, Math.max(0, path.indexOf(this))).some((node) => node.draggable)) {
152
152
  return;
153
153
  }
154
154
 
@@ -271,7 +271,7 @@ export const ColumnReorderingMixin = (superClass) =>
271
271
  }
272
272
  // Check if element is the cell of a focus button mode column
273
273
  const { parentElement } = element;
274
- if (parentElement && parentElement._focusButton === element) {
274
+ if (parentElement?._focusButton === element) {
275
275
  return parentElement;
276
276
  }
277
277
  }
@@ -337,6 +337,36 @@ export const ColumnReorderingMixin = (superClass) =>
337
337
  updateColumnOrders(columnTree[0], this._orderBaseScope, 0);
338
338
  }
339
339
 
340
+ /**
341
+ * Resets the visual column order so that cells in every row reflect the
342
+ * current DOM order of `<vaadin-grid-column>` elements.
343
+ *
344
+ * Intended to be called by Vaadin Flow's `GridColumnOrderHelper` (via
345
+ * `executeJs`) to realign cell order with the column DOM order after an
346
+ * earlier drag reorder, even when the column DOM order itself has not
347
+ * changed (in which case the `_columnTree` observer does not fire and
348
+ * `_renderColumnTree` does not re-render the rows).
349
+ *
350
+ * @private
351
+ */
352
+ _resetColumnOrder() {
353
+ if (this._columnTree === undefined) {
354
+ return;
355
+ }
356
+
357
+ // Each `_columnTree[level]` array is already in DOM order. If every
358
+ // level's `_order` values are monotonically non-decreasing along that
359
+ // array, cells are already in sync with DOM order and no work is needed.
360
+ const alreadyInDomOrder = this._columnTree.every((level) =>
361
+ level.every((column, i) => i === 0 || column._order >= level[i - 1]._order),
362
+ );
363
+ if (alreadyInDomOrder) {
364
+ return;
365
+ }
366
+
367
+ this._columnTree = this._getColumnTree();
368
+ }
369
+
340
370
  /**
341
371
  * @param {!GridColumn} column
342
372
  * @param {string} status
@@ -451,12 +481,4 @@ export const ColumnReorderingMixin = (superClass) =>
451
481
  return targetCell._column;
452
482
  }
453
483
  }
454
-
455
- /**
456
- * Fired when the columns in the grid are reordered.
457
- *
458
- * @event column-reorder
459
- * @param {Object} detail
460
- * @param {Object} detail.columns the columns in the new order
461
- */
462
484
  };
@@ -126,12 +126,4 @@ export const ColumnResizingMixin = (superClass) =>
126
126
  this._resizeHandler();
127
127
  }
128
128
  }
129
-
130
- /**
131
- * Fired when a column in the grid is resized by the user.
132
- *
133
- * @event column-resize
134
- * @param {Object} detail
135
- * @param {Object} detail.resizedColumn the column that was resized
136
- */
137
129
  };
@@ -22,9 +22,12 @@ export type GridHeaderFooterRenderer<TItem = GridDefaultItem> = GridMixinHeaderF
22
22
  * See [`<vaadin-grid>`](#/elements/vaadin-grid) documentation for instructions on how
23
23
  * to configure the `<vaadin-grid-column>`.
24
24
  */
25
- declare class GridColumn<TItem = GridDefaultItem> extends HTMLElement {}
25
+ declare class GridColumn<TItem = GridDefaultItem> extends HTMLElement {
26
+ hidden: boolean;
27
+ }
26
28
 
27
- interface GridColumn<TItem = GridDefaultItem> extends GridColumnMixin<TItem, GridColumn<TItem>>, HTMLElement {}
29
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
30
+ interface GridColumn<TItem = GridDefaultItem> extends GridColumnMixin<TItem, GridColumn<TItem>> {}
28
31
 
29
32
  declare global {
30
33
  interface HTMLElementTagNameMap {
@@ -397,22 +397,6 @@ export const DataProviderMixin = (superClass) =>
397
397
  return this.getItemId(item1) === this.getItemId(item2);
398
398
  }
399
399
 
400
- /**
401
- * @param {!GridItem} item
402
- * @param {!Array<!GridItem>} array
403
- * @return {number}
404
- * @protected
405
- */
406
- _getItemIndexInArray(item, array) {
407
- let result = -1;
408
- array.forEach((i, idx) => {
409
- if (this._itemsEqual(i, item)) {
410
- result = idx;
411
- }
412
- });
413
- return result;
414
- }
415
-
416
400
  /**
417
401
  * Scroll to a specific row index in the virtual list. Note that the row index is
418
402
  * not always the same for any particular item. For example, sorting or filtering
@@ -454,16 +438,4 @@ export const DataProviderMixin = (superClass) =>
454
438
  this.scrollToIndex(...indexes);
455
439
  }
456
440
  }
457
-
458
- /**
459
- * Fired when the `expandedItems` property changes.
460
- *
461
- * @event expanded-items-changed
462
- */
463
-
464
- /**
465
- * Fired when the `loading` property changes.
466
- *
467
- * @event loading-changed
468
- */
469
441
  };
@@ -286,7 +286,7 @@ export const DragAndDropMixin = (superClass) =>
286
286
  }
287
287
  }
288
288
 
289
- if (row && row.hasAttribute('drop-disabled')) {
289
+ if (row?.hasAttribute('drop-disabled')) {
290
290
  this._dropLocation = undefined;
291
291
  return;
292
292
  }
@@ -497,44 +497,4 @@ export const DragAndDropMixin = (superClass) =>
497
497
  'drop-disabled': !!dropDisabled,
498
498
  });
499
499
  }
500
-
501
- /**
502
- * Fired when starting to drag grid rows.
503
- *
504
- * @event grid-dragstart
505
- * @param {Object} originalEvent The native dragstart event
506
- * @param {Object} detail
507
- * @param {Object} detail.draggedItems the items in the visible viewport that are dragged
508
- * @param {Function} detail.setDraggedItemsCount Overrides the default number shown in the drag image on multi row drag.
509
- * Parameter is of type number.
510
- * @param {Function} detail.setDragData Sets dataTransfer data for the drag operation.
511
- * Note that "text" is the only data type supported by all the browsers the grid currently supports (including IE11).
512
- * The function takes two parameters:
513
- * - type:string The type of the data
514
- * - data:string The data
515
- */
516
-
517
- /**
518
- * Fired when the dragging of the rows ends.
519
- *
520
- * @event grid-dragend
521
- * @param {Object} originalEvent The native dragend event
522
- */
523
-
524
- /**
525
- * Fired when a drop occurs on top of the grid.
526
- *
527
- * @event grid-drop
528
- * @param {Object} originalEvent The native drop event
529
- * @param {Object} detail
530
- * @param {Object} detail.dropTargetItem The item of the grid row on which the drop occurred.
531
- * @param {string} detail.dropLocation The position at which the drop event took place relative to a row.
532
- * Depending on the dropMode value, the drop location can be one of the following
533
- * - `on-top`: when the drop occurred on top of the row
534
- * - `above`: when the drop occurred above the row
535
- * - `below`: when the drop occurred below the row
536
- * - `empty`: when the drop occurred over the grid, not relative to any specific row
537
- * @param {string} detail.dragData An array of items with the payload as a string representation as the
538
- * `data` property and the type of the data as `type` property.
539
- */
540
500
  };
@@ -112,7 +112,7 @@ export const DynamicColumnsMixin = (superClass) =>
112
112
  this._observer = new ColumnObserver(this, (_addedColumns, removedColumns) => {
113
113
  const allRemovedCells = removedColumns.flatMap((c) => c._allCells);
114
114
  const filterNotConnected = (element) =>
115
- allRemovedCells.filter((cell) => cell && cell._content.contains(element)).length;
115
+ allRemovedCells.filter((cell) => cell?._content.contains(element)).length;
116
116
 
117
117
  this.__removeSorters(this._sorters.filter(filterNotConnected));
118
118
  this.__removeFilters(this._filters.filter(filterNotConnected));
@@ -49,7 +49,7 @@ export const EventContextMixin = (superClass) =>
49
49
  }
50
50
 
51
51
  if (context.section === 'body' || context.section === 'details') {
52
- Object.assign(context, this.__getRowModel(cell.parentElement));
52
+ Object.assign(context, this.__getRowModel(cell.__parentRow));
53
53
  }
54
54
 
55
55
  return context;
@@ -22,7 +22,9 @@ export * from './vaadin-grid-filter-column-mixin.js';
22
22
  * ...
23
23
  * ```
24
24
  */
25
- declare class GridFilterColumn<TItem = GridDefaultItem> extends HTMLElement {}
25
+ declare class GridFilterColumn<TItem = GridDefaultItem> extends HTMLElement {
26
+ hidden: boolean;
27
+ }
26
28
 
27
29
  interface GridFilterColumn<TItem = GridDefaultItem>
28
30
  extends GridFilterColumnMixinClass, GridColumnMixin<TItem, GridColumn<TItem>>, GridColumn<TItem> {}
@@ -221,7 +221,7 @@ export class ColumnObserver {
221
221
  __onMutation() {
222
222
  // Detect if this is the initial call
223
223
  const initialCall = !this.__currentColumns;
224
- this.__currentColumns = this.__currentColumns || [];
224
+ this.__currentColumns ||= [];
225
225
 
226
226
  // Detect added and removed columns or if the columns order has changed
227
227
  const columns = ColumnObserver.getColumns(this.__host);
@@ -103,7 +103,7 @@ export const KeyboardNavigationMixin = (superClass) =>
103
103
  ['_itemsFocusable', '_footerFocusable', '_headerFocusable'].forEach((prop) => {
104
104
  const focusable = this[prop];
105
105
  if (value) {
106
- const parent = focusable && focusable.parentElement;
106
+ const parent = focusable?.parentElement;
107
107
  if (isCell(focusable)) {
108
108
  // Cell itself focusable (default)
109
109
  this[prop] = parent;
@@ -1097,12 +1097,4 @@ export const KeyboardNavigationMixin = (superClass) =>
1097
1097
  }
1098
1098
  return null;
1099
1099
  }
1100
-
1101
- /**
1102
- * Fired when a cell is focused with click or keyboard navigation.
1103
- *
1104
- * Use context property of @see {@link GridCellFocusEvent} to get detail information about the event.
1105
- *
1106
- * @event cell-focus
1107
- */
1108
1100
  };
@@ -417,7 +417,7 @@ export const GridMixin = (superClass) =>
417
417
  const slot = document.createElement('slot');
418
418
  slot.setAttribute('name', slotName);
419
419
 
420
- if (column && column._focusButtonMode) {
420
+ if (column?._focusButtonMode) {
421
421
  const div = document.createElement('div');
422
422
  div.setAttribute('role', 'button');
423
423
  div.setAttribute('tabindex', '-1');
@@ -536,6 +536,7 @@ export const GridMixin = (superClass) =>
536
536
  contentsFragment.appendChild(detailsCell._content);
537
537
  }
538
538
  this._configureDetailsCell(detailsCell);
539
+ detailsCell.__parentRow = row;
539
540
  row.appendChild(detailsCell);
540
541
  // Cache the details cell reference
541
542
  row.__detailsCell = detailsCell;
@@ -870,7 +871,7 @@ export const GridMixin = (superClass) =>
870
871
  _showTooltip(event) {
871
872
  // Check if there is a slotted vaadin-tooltip element.
872
873
  const tooltip = this._tooltipController.node;
873
- if (tooltip && tooltip.isConnected) {
874
+ if (tooltip?.isConnected) {
874
875
  const target = event.target;
875
876
 
876
877
  if (!this.__isCellFullyVisible(target)) {
@@ -881,7 +882,7 @@ export const GridMixin = (superClass) =>
881
882
  this._tooltipController.setContext(this.getEventContext(event));
882
883
 
883
884
  // Trigger opening using the corresponding delay.
884
- tooltip._stateController.open({
885
+ this._tooltipController.open({
885
886
  focus: event.type === 'focusin',
886
887
  hover: event.type === 'mouseenter',
887
888
  });
@@ -917,10 +918,7 @@ export const GridMixin = (superClass) =>
917
918
 
918
919
  /** @protected */
919
920
  _hideTooltip(immediate) {
920
- const tooltip = this._tooltipController && this._tooltipController.node;
921
- if (tooltip) {
922
- tooltip._stateController.close(immediate);
923
- }
921
+ this._tooltipController.close(immediate);
924
922
  }
925
923
 
926
924
  /**
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2016 - 2026 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { iterateChildren, updatePart } from './vaadin-grid-helpers.js';
6
+ import { updatePart } from './vaadin-grid-helpers.js';
7
7
 
8
8
  /**
9
9
  * @polymerMixin
@@ -50,6 +50,15 @@ export const RowDetailsMixin = (superClass) =>
50
50
  _detailsCells: {
51
51
  type: Array,
52
52
  },
53
+
54
+ /**
55
+ * Set of opened details item ids
56
+ * @private
57
+ */
58
+ __detailsOpenedKeys: {
59
+ type: Object,
60
+ computed: '__computeDetailsOpenedKeys(itemIdPath, detailsOpenedItems)',
61
+ },
53
62
  };
54
63
  }
55
64
 
@@ -79,10 +88,15 @@ export const RowDetailsMixin = (superClass) =>
79
88
 
80
89
  if (this._columnTree) {
81
90
  // Only update the rows if the column tree has already been initialized
82
- iterateChildren(this.$.items, (row) => {
91
+ this._getRenderedRows().forEach((row) => {
83
92
  if (!row.querySelector('[part~=details-cell]')) {
84
93
  this.__initRow(row, this._columnTree[this._columnTree.length - 1]);
85
94
  this.__updateRow(row);
95
+ return;
96
+ }
97
+
98
+ if (row.hasAttribute('details-opened')) {
99
+ this.__updateRow(row);
86
100
  }
87
101
  });
88
102
  }
@@ -90,15 +104,8 @@ export const RowDetailsMixin = (superClass) =>
90
104
 
91
105
  /** @private */
92
106
  _detailsOpenedItemsChanged(_detailsOpenedItems, rowDetailsRenderer) {
93
- iterateChildren(this.$.items, (row) => {
94
- // Re-renders the row to possibly close the previously opened details.
95
- if (row.hasAttribute('details-opened')) {
96
- this.__updateRow(row);
97
- return;
98
- }
99
-
100
- // Re-renders the row to open the details when a row details renderer is provided.
101
- if (rowDetailsRenderer && this._isDetailsOpened(row._item)) {
107
+ this._getRenderedRows().forEach((row) => {
108
+ if (row.hasAttribute('details-opened') !== !!(rowDetailsRenderer && this._isDetailsOpened(row._item))) {
102
109
  this.__updateRow(row);
103
110
  }
104
111
  });
@@ -165,7 +172,7 @@ export const RowDetailsMixin = (superClass) =>
165
172
 
166
173
  /** @protected */
167
174
  _updateDetailsCellHeights() {
168
- iterateChildren(this.$.items, (row) => {
175
+ this._getRenderedRows().forEach((row) => {
169
176
  this._updateDetailsCellHeight(row);
170
177
  });
171
178
  }
@@ -176,7 +183,17 @@ export const RowDetailsMixin = (superClass) =>
176
183
  * @protected
177
184
  */
178
185
  _isDetailsOpened(item) {
179
- return this.detailsOpenedItems && this._getItemIndexInArray(item, this.detailsOpenedItems) !== -1;
186
+ return this.__detailsOpenedKeys && this.__detailsOpenedKeys.has(this.getItemId(item));
187
+ }
188
+
189
+ /** @private */
190
+ __computeDetailsOpenedKeys(_itemIdPath, detailsOpenedItems) {
191
+ const items = detailsOpenedItems || [];
192
+ const keys = new Set();
193
+ items.forEach((item) => {
194
+ keys.add(this.getItemId(item));
195
+ });
196
+ return keys;
180
197
  }
181
198
 
182
199
  /**
@@ -37,7 +37,9 @@ export * from './vaadin-grid-selection-column-mixin.js';
37
37
  *
38
38
  * @fires {CustomEvent} select-all-changed - Fired when the `selectAll` property changes.
39
39
  */
40
- declare class GridSelectionColumn<TItem = GridDefaultItem> extends HTMLElement {}
40
+ declare class GridSelectionColumn<TItem = GridDefaultItem> extends HTMLElement {
41
+ hidden: boolean;
42
+ }
41
43
 
42
44
  interface GridSelectionColumn<TItem = GridDefaultItem>
43
45
  extends GridSelectionColumnMixinClass<TItem>, GridColumnMixin<TItem, GridColumn<TItem>>, GridColumn<TItem> {
@@ -111,7 +111,14 @@ export const SelectionMixin = (superClass) =>
111
111
 
112
112
  /** @private */
113
113
  __selectedItemsChanged() {
114
- this.requestContentUpdate();
114
+ this._getRenderedRows().forEach((row) => {
115
+ if (
116
+ row.hasAttribute('selected') !== this._isSelected(row._item) ||
117
+ row.hasAttribute('nonselectable') !== !this.__isItemSelectable(row._item)
118
+ ) {
119
+ this.__updateRow(row);
120
+ }
121
+ });
115
122
  }
116
123
 
117
124
  /** @private */
@@ -124,20 +131,4 @@ export const SelectionMixin = (superClass) =>
124
131
 
125
132
  return selectedKeys;
126
133
  }
127
-
128
- /**
129
- * Fired when the `selectedItems` property changes.
130
- *
131
- * @event selected-items-changed
132
- */
133
-
134
- /**
135
- * Fired when the user selects or deselects an item through the selection column.
136
- *
137
- * @event item-toggle
138
- * @param {Object} detail
139
- * @param {GridItem} detail.item the item that was selected or deselected
140
- * @param {boolean} detail.selected true if the item was selected
141
- * @param {boolean} detail.shiftKey true if the shift key was pressed
142
- */
143
134
  };
@@ -24,7 +24,9 @@ export * from './vaadin-grid-sort-column-mixin.js';
24
24
  *
25
25
  * @fires {CustomEvent} direction-changed - Fired when the `direction` property changes.
26
26
  */
27
- declare class GridSortColumn<TItem = GridDefaultItem> extends HTMLElement {}
27
+ declare class GridSortColumn<TItem = GridDefaultItem> extends HTMLElement {
28
+ hidden: boolean;
29
+ }
28
30
 
29
31
  interface GridSortColumn<TItem = GridDefaultItem>
30
32
  extends GridSortColumnMixinClass, GridColumnMixin<TItem, GridColumn<TItem>>, GridColumn<TItem> {