ids-enterprise-wc 1.15.9-patch.6 → 1.15.9-patch.8

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 (38) hide show
  1. package/chunks/ids-chunk-4MSGTAOV-full.js +12 -0
  2. package/chunks/ids-chunk-4MSGTAOV-full.js.map +7 -0
  3. package/chunks/{ids-chunk-LZU34NYE-full.js → ids-chunk-CSOF2USI-full.js} +12 -2
  4. package/chunks/{ids-chunk-LZU34NYE-full.js.map → ids-chunk-CSOF2USI-full.js.map} +2 -2
  5. package/chunks/{ids-chunk-FW4DOBQU-full.js → ids-chunk-FPEINRXY-full.js} +6 -10
  6. package/chunks/ids-chunk-FPEINRXY-full.js.map +7 -0
  7. package/chunks/{ids-chunk-YAFKETSU-full.js → ids-chunk-KL2N6T26-full.js} +366 -38
  8. package/chunks/ids-chunk-KL2N6T26-full.js.map +7 -0
  9. package/chunks/{ids-chunk-HGKIZXDQ-full.js → ids-chunk-RLOOHWYV-full.js} +2 -2
  10. package/components/ids-accordion/ids-accordion.css +9 -93
  11. package/components/ids-button/ids-button.css +392 -43
  12. package/components/ids-card/ids-card.css +4 -344
  13. package/components/ids-data-grid/ids-data-grid-cell.js +1 -1
  14. package/components/ids-data-grid/ids-data-grid-column.d.ts +1 -0
  15. package/components/ids-data-grid/ids-data-grid-column.js +7 -0
  16. package/components/ids-data-grid/ids-data-grid-filters.js +2 -2
  17. package/components/ids-data-grid/ids-data-grid-row.d.ts +6 -0
  18. package/components/ids-data-grid/ids-data-grid-row.js +2 -2
  19. package/components/ids-data-grid/ids-data-grid.d.ts +18 -1
  20. package/components/ids-data-grid/ids-data-grid.js +5 -4
  21. package/components/ids-hyperlink/ids-hyperlink.css +188 -15
  22. package/components/ids-layout-grid/ids-layout-grid.css +10 -21300
  23. package/components/ids-list-view/ids-list-view.css +112 -15
  24. package/components/ids-menu/ids-menu.css +11 -17
  25. package/components/ids-module-nav/ids-module-nav.css +1 -1814
  26. package/components/ids-pager/ids-pager.css +37 -3
  27. package/components/ids-swappable/ids-swappable.css +84 -19
  28. package/components/ids-tabs/ids-tabs.css +4 -342
  29. package/components/ids-toolbar/ids-toolbar.css +122 -12
  30. package/custom-elements.json +606 -414
  31. package/enterprise-wc.all.iife.js +377 -43
  32. package/enterprise-wc.all.iife.js.map +3 -3
  33. package/enterprise-wc.js +5 -4
  34. package/package.json +1 -1
  35. package/vscode.html-custom-data.json +1 -1
  36. package/chunks/ids-chunk-FW4DOBQU-full.js.map +0 -7
  37. package/chunks/ids-chunk-YAFKETSU-full.js.map +0 -7
  38. /package/chunks/{ids-chunk-HGKIZXDQ-full.js.map → ids-chunk-RLOOHWYV-full.js.map} +0 -0
@@ -78111,32 +78111,28 @@ ids-trigger-button[slot=trigger-end] {
78111
78111
  * @returns {IdsDataGridCell | null} the cell above this cell
78112
78112
  */
78113
78113
  get cellAbove() {
78114
- return this.rowAbove?.cellByIndex(this.columnIndex) ?? null;
78114
+ return this.dataGrid?.findNextNavigableCell(this, "up" /* Up */) ?? null;
78115
78115
  }
78116
78116
  /**
78117
78117
  * Get the cell below this cell
78118
78118
  * @returns {IdsDataGridCell | null} the cell below this cell
78119
78119
  */
78120
78120
  get cellBelow() {
78121
- return this.rowBelow?.cellByIndex(this.columnIndex) ?? null;
78121
+ return this.dataGrid?.findNextNavigableCell(this, "down" /* Down */) ?? null;
78122
78122
  }
78123
78123
  /**
78124
78124
  * Get the cell to the left of this cell
78125
78125
  * @returns {IdsDataGridCell | null} the cell to the left of this cell
78126
78126
  */
78127
78127
  get cellLeft() {
78128
- const cellLeft = this.dataGrid?.rowByIndex(this.rowIndex)?.cellByIndex(this.columnIndex - 1);
78129
- if (cellLeft && cellLeft !== this) return cellLeft;
78130
- return this.rowAbove?.cellByIndex(this.dataGrid?.columns.length ?? 0) ?? null;
78128
+ return this.dataGrid?.findNextNavigableCell(this, "left" /* Left */) ?? null;
78131
78129
  }
78132
78130
  /**
78133
78131
  * Get the cell to the right of this cell
78134
78132
  * @returns {IdsDataGridCell | null} the cell to the right of this cell
78135
78133
  */
78136
78134
  get cellRight() {
78137
- const cellRight = this.dataGrid?.rowByIndex(this.rowIndex)?.cellByIndex(this.columnIndex + 1) ?? null;
78138
- if (cellRight && cellRight !== this) return cellRight;
78139
- return this.rowBelow?.cellByIndex(0) ?? null;
78135
+ return this.dataGrid?.findNextNavigableCell(this, "right" /* Right */) ?? null;
78140
78136
  }
78141
78137
  /**
78142
78138
  * Get the next editable cell to the left of this cell
@@ -78750,7 +78746,7 @@ ids-trigger-button[slot=trigger-end] {
78750
78746
  });
78751
78747
  }
78752
78748
  this.onEvent("keyup", this.editor?.input, () => {
78753
- this.dataGrid.updateActiveCellCache(this.row, this.columnIndex, this.editor?.input?.value || "");
78749
+ this.dataGrid.updateActiveCellCache(this.row, this.columnIndex, this.editor?.input?.value || "", true);
78754
78750
  });
78755
78751
  this.onEvent("keydown", this.editor?.input, (e) => {
78756
78752
  if (e.key === "Enter") {
@@ -80516,6 +80512,9 @@ ids-trigger-button[slot=trigger-end] {
80516
80512
  }
80517
80513
  }
80518
80514
 
80515
+ // src/components/ids-data-grid/ids-data-grid-column.ts
80516
+ var DEFAULT_COLUMN_MIN_WIDTH = 12;
80517
+
80519
80518
  // src/components/ids-data-grid/ids-data-grid-empty-message.ts
80520
80519
  function emptyMessageDefaults() {
80521
80520
  return {
@@ -84257,6 +84256,16 @@ ids-loading-indicator[stopped] {
84257
84256
  columnIndex = Math.min(columnIndex, maxColumnIndex);
84258
84257
  return cells[columnIndex] ?? null;
84259
84258
  }
84259
+ /**
84260
+ * Get the cell HTMLElement by logical column index (accounting for rowspan)
84261
+ * @param {number} logicalColumnIndex the zero-based logical column index
84262
+ * @returns {IdsDataGridCell} html element for cell
84263
+ */
84264
+ cellByLogicalIndex(logicalColumnIndex) {
84265
+ const columnId = this.dataGrid.visibleColumns[logicalColumnIndex]?.id;
84266
+ if (!columnId) return null;
84267
+ return this.querySelector(`ids-data-grid-cell[aria-colindex="${logicalColumnIndex + 1}"]`) ?? null;
84268
+ }
84260
84269
  /**
84261
84270
  * Is this row currently expanded
84262
84271
  * @returns {boolean} true if expanded
@@ -87928,7 +87937,7 @@ ids-icon {
87928
87937
  )
87929
87938
  )
87930
87939
  );
87931
- var _activeCellCache, _editedCellsCache, _startSelectionCell, _endSelectionCell, _currentScroll, _afterSetActiveCellFn, _header, _IdsDataGrid_instances, redrawBodyTemplate_fn, _lastSelectedRow, _initiallySelectedRow, _lastShiftedRow, resetLastSelectedRow_fn, resetInitiallySelectedRow_fn, resetLastShiftedRow_fn, toggleShiftSelectionInBetween_fn, getSelection_fn, attachEventHandlers_fn41, attachDragSelection_fn, createSelectionBorder_fn, updateSelectionBorder_fn, attachCopyPasteCellHandlers_fn, attachKeyboardListeners_fn9, setColumnWidths_fn, setFrozenColumnWidth_fn, calcMaxContentWidth_fn, reapplyDirtyStates_fn, setColumnGroupsWidth_fn, appendMissingRows_fn, _virtualScrollMaxRowsInDom, attachScrollEvents_fn, attachVirtualScrollEvent_fn, calculateColumnsOnscreen_fn, detachScrollEvents_fn, syncTreeHiddenStates_fn, handleTreeRowExpandCollapse_fn, recycleAllTreeRows_fn, handleVirtualScroll_fn, _customScrollEventCache, triggerCustomScrollEvent_fn, positionVirtualScrollWindow_fn, restoreScrollPosition_fn, scrollTo_fn, scrollToTreeRow_fn, scrollRowIntoView_fn, setVirtualScrollPaddingBottom_fn, scrollTreeRowIntoView_fn, recycleTreeRowsDown_fn, recycleTreeRowsUp_fn, recycleAllRows_fn, recycleTopRowsDown_fn, recycleBottomRowsUp_fn, saveCellOriginalValue_fn, updateCellDirtyState_fn, findParentRow_fn, findRootRow_fn, updateRowCount_fn, applyAutoFit_fn, removeAttachedMenus_fn, filterColumnList_fn, handleCopy_fn, handlePaste_fn, saveEditedCellsBeforeScroll_fn, restoreActiveCellAfterScroll_fn, restoreEditedCellsAfterScroll_fn;
87940
+ var _activeCellCache, _editedCellsCache, _startSelectionCell, _endSelectionCell, _currentScroll, _afterSetActiveCellFn, _header, _IdsDataGrid_instances, redrawBodyTemplate_fn, _lastSelectedRow, _initiallySelectedRow, _lastShiftedRow, resetLastSelectedRow_fn, resetInitiallySelectedRow_fn, resetLastShiftedRow_fn, toggleShiftSelectionInBetween_fn, getSelection_fn, attachEventHandlers_fn41, attachDragSelection_fn, createSelectionBorder_fn, updateSelectionBorder_fn, attachCopyPasteCellHandlers_fn, attachKeyboardListeners_fn9, setColumnWidths_fn, setFrozenColumnWidth_fn, calcMaxContentWidth_fn, reapplyDirtyStates_fn, setColumnGroupsWidth_fn, appendMissingRows_fn, _virtualScrollMaxRowsInDom, attachScrollEvents_fn, attachVirtualScrollEvent_fn, calculateColumnsOnscreen_fn, detachScrollEvents_fn, syncTreeHiddenStates_fn, handleTreeRowExpandCollapse_fn, recycleAllTreeRows_fn, handleVirtualScroll_fn, _customScrollEventCache, triggerCustomScrollEvent_fn, positionVirtualScrollWindow_fn, restoreScrollPosition_fn, scrollTo_fn, scrollToTreeRow_fn, scrollRowIntoView_fn, getVisibleRowIndex_fn, findNextVisibleRow_fn, scrollToActivateRow_fn, ensureRowInViewport_fn, setVirtualScrollPaddingBottom_fn, scrollTreeRowIntoView_fn, recycleTreeRowsDown_fn, recycleTreeRowsUp_fn, recycleAllRows_fn, recycleTopRowsDown_fn, recycleBottomRowsUp_fn, saveCellOriginalValue_fn, updateCellDirtyState_fn, findParentRow_fn, findRootRow_fn, updateRowCount_fn, applyAutoFit_fn, removeAttachedMenus_fn, filterColumnList_fn, handleCopy_fn, handlePaste_fn, saveEditedCellsBeforeScroll_fn, restoreActiveCellAfterScroll_fn, restoreEditedCellsAfterScroll_fn;
87932
87941
  var IdsDataGrid = class extends Base68 {
87933
87942
  constructor() {
87934
87943
  super();
@@ -88895,7 +88904,8 @@ ids-icon {
88895
88904
  if (this.activeCellEditor) {
88896
88905
  const rowIndex = this.activeCell.row;
88897
88906
  const cell = this.activeCell.cell;
88898
- this.updateActiveCellCache(rowIndex, cell, __privateGet(this, _activeCellCache)?.currentValue || "");
88907
+ const activeNode = this.activeCell.node;
88908
+ this.updateActiveCellCache(rowIndex, cell, __privateGet(this, _activeCellCache)?.currentValue || "", activeNode?.isEditing);
88899
88909
  }
88900
88910
  if (__privateGet(this, _activeCellCache)) {
88901
88911
  __privateGet(this, _activeCellCache).shouldReinstateCell = true;
@@ -88905,6 +88915,7 @@ ids-icon {
88905
88915
  this.resetCache();
88906
88916
  if (this.treeGrid) {
88907
88917
  __privateMethod(this, _IdsDataGrid_instances, recycleAllTreeRows_fn).call(this, Math.floor(this.container.scrollTop / this.virtualScrollSettings.ROW_HEIGHT));
88918
+ __privateMethod(this, _IdsDataGrid_instances, restoreActiveCellAfterScroll_fn).call(this);
88908
88919
  } else {
88909
88920
  __privateMethod(this, _IdsDataGrid_instances, appendMissingRows_fn).call(this);
88910
88921
  }
@@ -88912,6 +88923,82 @@ ids-icon {
88912
88923
  this.data = this.data.concat(value);
88913
88924
  }
88914
88925
  }
88926
+ /**
88927
+ * Find a cell by logical position, accounting for rowspan
88928
+ * @param {number} rowIndex the row index
88929
+ * @param {number} columnIndex the logical column index
88930
+ * @returns {IdsDataGridCell | null} the cell at the logical position
88931
+ */
88932
+ findCellByLogicalPosition(rowIndex, columnIndex) {
88933
+ if (rowIndex < 0 || rowIndex >= this.data.length) return null;
88934
+ if (columnIndex < 0 || columnIndex >= this.visibleColumns.length) return null;
88935
+ if (this.treeGrid && this.data[rowIndex]?.rowHidden) return null;
88936
+ const row = this.rowByIndex(rowIndex);
88937
+ if (!row) return null;
88938
+ const columnId = this.visibleColumns[columnIndex]?.id;
88939
+ if (!columnId) return null;
88940
+ return row.cellByLogicalIndex?.(columnIndex) ?? row.cellByIndex(columnIndex) ?? null;
88941
+ }
88942
+ /**
88943
+ * Find the next navigable cell in a given direction
88944
+ * @param {IdsDataGridCell} currentCell the current cell
88945
+ * @param {IdsDirection} direction the navigation direction
88946
+ * @returns {IdsDataGridCell | null} the next navigable cell
88947
+ */
88948
+ findNextNavigableCell(currentCell, direction) {
88949
+ const currentRowIndex = currentCell.rowIndex;
88950
+ const currentColumnIndex = currentCell.columnIndex;
88951
+ switch (direction) {
88952
+ case "up" /* Up */: {
88953
+ if (currentRowIndex === 0) return null;
88954
+ for (let targetRowIndex = currentRowIndex - 1; targetRowIndex >= 0; targetRowIndex--) {
88955
+ const cell = this.findCellByLogicalPosition(targetRowIndex, currentColumnIndex);
88956
+ if (cell) return cell;
88957
+ }
88958
+ return null;
88959
+ }
88960
+ case "down" /* Down */: {
88961
+ if (currentRowIndex >= this.data.length - 1) return null;
88962
+ const currentRowData = this.data[currentRowIndex];
88963
+ const columnId = this.visibleColumns[currentColumnIndex]?.id;
88964
+ const currentSpan = currentRowData?.rowspan?.[columnId] || 1;
88965
+ const startRowIndex = currentRowIndex + currentSpan;
88966
+ for (let targetRowIndex = startRowIndex; targetRowIndex < this.data.length; targetRowIndex++) {
88967
+ const cell = this.findCellByLogicalPosition(targetRowIndex, currentColumnIndex);
88968
+ if (cell) return cell;
88969
+ }
88970
+ return null;
88971
+ }
88972
+ case "left" /* Left */: {
88973
+ for (let colIndex = currentColumnIndex - 1; colIndex >= 0; colIndex--) {
88974
+ const cell = this.findCellByLogicalPosition(currentRowIndex, colIndex);
88975
+ if (cell && cell !== currentCell) return cell;
88976
+ }
88977
+ if (currentRowIndex > 0) {
88978
+ for (let colIndex = this.visibleColumns.length - 1; colIndex >= 0; colIndex--) {
88979
+ const cell = this.findCellByLogicalPosition(currentRowIndex - 1, colIndex);
88980
+ if (cell) return cell;
88981
+ }
88982
+ }
88983
+ return null;
88984
+ }
88985
+ case "right" /* Right */: {
88986
+ for (let colIndex = currentColumnIndex + 1; colIndex < this.visibleColumns.length; colIndex++) {
88987
+ const cell = this.findCellByLogicalPosition(currentRowIndex, colIndex);
88988
+ if (cell && cell !== currentCell) return cell;
88989
+ }
88990
+ if (currentRowIndex < this.data.length - 1) {
88991
+ for (let colIndex = 0; colIndex < this.visibleColumns.length; colIndex++) {
88992
+ const cell = this.findCellByLogicalPosition(currentRowIndex + 1, colIndex);
88993
+ if (cell) return cell;
88994
+ }
88995
+ }
88996
+ return null;
88997
+ }
88998
+ default:
88999
+ return null;
89000
+ }
89001
+ }
88915
89002
  /**
88916
89003
  * Set the data of the data grid
88917
89004
  * @param {Array} value The array to use
@@ -90006,7 +90093,7 @@ ids-icon {
90006
90093
  if (reason === "redraw") {
90007
90094
  this.clearActiveCellCache();
90008
90095
  } else {
90009
- this.updateActiveCellCache(rowIndex, cellNumber, currentCell?.value);
90096
+ this.updateActiveCellCache(rowIndex, cellNumber, currentCell?.value, true);
90010
90097
  }
90011
90098
  let rowNode = this.rowByIndex(rowIndex);
90012
90099
  if (!rowNode && this.virtualScroll) {
@@ -90561,15 +90648,20 @@ ids-icon {
90561
90648
  * @param {number} row - The row index
90562
90649
  * @param {number} cell - The cell index
90563
90650
  * @param {string} cellValue - The current cell value
90651
+ * @param {boolean} isEditing - Whether the cell is currently in edit mode
90564
90652
  */
90565
- updateActiveCellCache(row, cell, cellValue) {
90566
- __privateSet(this, _activeCellCache, {
90653
+ updateActiveCellCache(row, cell, cellValue, isEditing) {
90654
+ const cacheUpdate = {
90567
90655
  rowIndex: row,
90568
90656
  columnIndex: cell,
90569
90657
  currentValue: cellValue,
90570
90658
  hasLeaveViewport: false,
90571
90659
  shouldReinstateCell: true
90572
- });
90660
+ };
90661
+ if (isEditing !== void 0) {
90662
+ cacheUpdate.wasEditing = isEditing;
90663
+ }
90664
+ __privateSet(this, _activeCellCache, cacheUpdate);
90573
90665
  }
90574
90666
  /**
90575
90667
  * Clears the active cell cache, optionally checking if the cached row is within viewport
@@ -91060,7 +91152,13 @@ ids-icon {
91060
91152
  if (e.key === "ArrowDown") newRowIndex = 1;
91061
91153
  if (e.key === "ArrowRight") newColIndex = 1;
91062
91154
  if (e.key === "ArrowLeft") newColIndex = -1;
91063
- __privateGet(this, _activeCellCache).rowIndex = Math.max(__privateGet(this, _activeCellCache).rowIndex + newRowIndex, 0);
91155
+ if (this.treeGrid && newRowIndex !== 0) {
91156
+ const direction = newRowIndex === 1 ? "down" /* Down */ : "up" /* Up */;
91157
+ const nextRowIndex = __privateMethod(this, _IdsDataGrid_instances, findNextVisibleRow_fn).call(this, __privateGet(this, _activeCellCache).rowIndex, direction);
91158
+ __privateGet(this, _activeCellCache).rowIndex = nextRowIndex !== -1 ? nextRowIndex : __privateGet(this, _activeCellCache).rowIndex;
91159
+ } else {
91160
+ __privateGet(this, _activeCellCache).rowIndex = Math.max(__privateGet(this, _activeCellCache).rowIndex + newRowIndex, 0);
91161
+ }
91064
91162
  __privateGet(this, _activeCellCache).columnIndex = Math.max(__privateGet(this, _activeCellCache).columnIndex + newColIndex, 0);
91065
91163
  requestAnimationTimeout(() => {
91066
91164
  __privateMethod(this, _IdsDataGrid_instances, restoreActiveCellAfterScroll_fn).call(this);
@@ -91076,32 +91174,68 @@ ids-icon {
91076
91174
  if (!activeCell) {
91077
91175
  const firstRow = this.rowByIndex(0);
91078
91176
  activeCell = firstRow?.cellByIndex(0) ?? null;
91079
- activeCell.activate(false, "keyboard");
91177
+ activeCell?.activate(false, "keyboard");
91080
91178
  }
91081
91179
  if (activeCell?.isEditing) return;
91082
91180
  e.preventDefault();
91083
91181
  e.stopPropagation();
91084
91182
  const previousActiveRow = Number(activeCell?.rowIndex || 0);
91085
- if (key === "ArrowUp") activeCell = activeCell?.cellAbove ?? null;
91086
- else if (key === "ArrowDown") activeCell = activeCell?.cellBelow ?? null;
91087
- else if (key === "ArrowLeft" && !e.metaKey) activeCell = activeCell?.cellLeft ?? null;
91088
- else if (key === "ArrowRight" && !e.metaKey) activeCell = activeCell?.cellRight ?? null;
91089
- else if (key === "PageUp") {
91090
- const firstRow = this.rowByIndex(0);
91183
+ if (key === "ArrowUp") {
91184
+ if (activeCell?.rowIndex === 0) {
91185
+ const columnIndex = activeCell?.columnIndex ?? 0;
91186
+ const headerCell = this.header?.querySelector(`[aria-colindex="${columnIndex + 1}"][tabindex="0"]`);
91187
+ if (headerCell) {
91188
+ headerCell.setAttribute(attributes.TABINDEX, "0");
91189
+ this.header?.querySelectorAll(".ids-data-grid-header-cell").forEach((cell) => {
91190
+ cell.classList.remove("is-focused");
91191
+ });
91192
+ headerCell.focus();
91193
+ return;
91194
+ }
91195
+ }
91196
+ const prevCell = activeCell;
91197
+ activeCell = this.findNextNavigableCell(activeCell, "up" /* Up */);
91198
+ if (!activeCell && this.virtualScroll && prevCell && prevCell.rowIndex > 0) {
91199
+ const nextRowIndex = __privateMethod(this, _IdsDataGrid_instances, findNextVisibleRow_fn).call(this, prevCell.rowIndex, "up" /* Up */);
91200
+ if (nextRowIndex !== -1) {
91201
+ __privateMethod(this, _IdsDataGrid_instances, scrollToActivateRow_fn).call(this, nextRowIndex, prevCell.columnIndex, "up" /* Up */);
91202
+ return;
91203
+ }
91204
+ }
91205
+ if (this.virtualScroll && activeCell) {
91206
+ __privateMethod(this, _IdsDataGrid_instances, ensureRowInViewport_fn).call(this, activeCell.rowIndex, "up" /* Up */);
91207
+ }
91208
+ } else if (key === "ArrowDown") {
91209
+ const prevCell = activeCell;
91210
+ activeCell = this.findNextNavigableCell(activeCell, "down" /* Down */);
91211
+ if (!activeCell && this.virtualScroll && prevCell && prevCell.rowIndex < this.data.length - 1) {
91212
+ const nextRowIndex = __privateMethod(this, _IdsDataGrid_instances, findNextVisibleRow_fn).call(this, prevCell.rowIndex, "down" /* Down */);
91213
+ if (nextRowIndex !== -1) {
91214
+ __privateMethod(this, _IdsDataGrid_instances, scrollToActivateRow_fn).call(this, nextRowIndex, prevCell.columnIndex, "down" /* Down */);
91215
+ return;
91216
+ }
91217
+ }
91218
+ if (this.virtualScroll && activeCell) {
91219
+ __privateMethod(this, _IdsDataGrid_instances, ensureRowInViewport_fn).call(this, activeCell.rowIndex, "down" /* Down */);
91220
+ }
91221
+ } else if (key === "ArrowLeft" && !e.metaKey) {
91222
+ activeCell = this.findNextNavigableCell(activeCell, "left" /* Left */);
91223
+ } else if (key === "ArrowRight" && !e.metaKey) {
91224
+ activeCell = this.findNextNavigableCell(activeCell, "right" /* Right */);
91225
+ } else if (key === "PageUp") {
91091
91226
  const columnIndex = activeCell?.columnIndex ?? 0;
91092
- activeCell = firstRow?.cellByIndex(columnIndex) ?? null;
91227
+ activeCell = this.findCellByLogicalPosition(0, columnIndex);
91093
91228
  } else if (key === "PageDown") {
91094
91229
  const lastRowIndex = this.data.length - 1;
91095
- const lastRow = this.rowByIndex(lastRowIndex);
91096
91230
  const columnIndex = activeCell?.columnIndex ?? 0;
91097
- activeCell = lastRow?.cellByIndex(columnIndex) ?? null;
91231
+ activeCell = this.findCellByLogicalPosition(lastRowIndex, columnIndex);
91098
91232
  } else if (key === "Home" || key === "ArrowLeft" && e.metaKey) {
91099
- const currentRow = this.rowByIndex(activeCell?.rowIndex ?? 0);
91100
- activeCell = currentRow?.cellByIndex(0) ?? null;
91233
+ const currentRowIndex = activeCell?.rowIndex ?? 0;
91234
+ activeCell = this.findCellByLogicalPosition(currentRowIndex, 0);
91101
91235
  } else if (key === "End" || key === "ArrowRight" && e.metaKey) {
91102
- const currentRow = this.rowByIndex(activeCell?.rowIndex ?? 0);
91103
- const lastColumnIndex = this.columns.length - 1;
91104
- activeCell = currentRow?.cellByIndex(lastColumnIndex) ?? null;
91236
+ const currentRowIndex = activeCell?.rowIndex ?? 0;
91237
+ const lastColumnIndex = this.visibleColumns.length - 1;
91238
+ activeCell = this.findCellByLogicalPosition(currentRowIndex, lastColumnIndex);
91105
91239
  }
91106
91240
  const activeRowIndex = activeCell?.rowIndex ?? previousActiveRow;
91107
91241
  activeCell?.focus?.();
@@ -91145,7 +91279,7 @@ ids-icon {
91145
91279
  if (this.openMenu) return;
91146
91280
  if (activeCell.isEditing) return;
91147
91281
  if (!activeCell.canClose()) return;
91148
- const row = this.rowByIndex(activeCell.row);
91282
+ const row = this.rowByIndex(activeCell.rowIndex);
91149
91283
  if (!row || row.disabled) return;
91150
91284
  const button = activeCell.querySelector("ids-button");
91151
91285
  if (button) {
@@ -91207,8 +91341,44 @@ ids-icon {
91207
91341
  if (!this.isEditable) {
91208
91342
  return;
91209
91343
  }
91210
- const nextCell = e.shiftKey ? this.activeCell?.node?.cellLeftEditable : this.activeCell?.node?.cellRightEditable;
91344
+ let nextCell = e.shiftKey ? this.activeCell?.node?.cellLeftEditable : this.activeCell?.node?.cellRightEditable;
91345
+ while (nextCell && nextCell.hasAttribute?.("hidden")) {
91346
+ nextCell = e.shiftKey ? nextCell?.cellLeftEditable : nextCell?.cellRightEditable;
91347
+ }
91211
91348
  if (!nextCell) {
91349
+ if (!e.shiftKey && this.addNewAtEnd && this.activeCell?.node) {
91350
+ const currentRowIndex = this.activeCell.node.rowIndex;
91351
+ const isLastRow = currentRowIndex === this.data.length - 1;
91352
+ if (isLastRow) {
91353
+ e.stopImmediatePropagation();
91354
+ e.stopPropagation();
91355
+ e.preventDefault();
91356
+ const newRowData = {};
91357
+ this.visibleColumns.forEach((column) => {
91358
+ if (column.field && column.field !== "selectionCheckbox" && column.field !== "selectionRadio") {
91359
+ newRowData[column.field] = "";
91360
+ }
91361
+ });
91362
+ this.addRow(newRowData);
91363
+ requestAnimationFrame(() => {
91364
+ const newRowIndex = this.data.length - 1;
91365
+ const newRow = this.rowByIndex(newRowIndex);
91366
+ if (newRow) {
91367
+ const firstEditableCell = newRow.querySelector(".is-editable:not(.is-readonly):not(.is-disabled)");
91368
+ if (firstEditableCell) {
91369
+ const columnIndex = firstEditableCell.columnIndex;
91370
+ this.setActiveCell(columnIndex, newRowIndex, false, "keyboard");
91371
+ if (this.editNextOnEnterPress) {
91372
+ firstEditableCell.startCellEdit?.();
91373
+ } else {
91374
+ firstEditableCell.focus?.();
91375
+ }
91376
+ }
91377
+ }
91378
+ });
91379
+ return;
91380
+ }
91381
+ }
91212
91382
  return;
91213
91383
  }
91214
91384
  e.stopImmediatePropagation();
@@ -91240,7 +91410,105 @@ ids-icon {
91240
91410
  }
91241
91411
  });
91242
91412
  this.offEvent("keydown.body", this.header);
91243
- this.onEvent("keydown.body", this.header, () => {
91413
+ this.onEvent("keydown.body", this.header, (e) => {
91414
+ const path = eventPath(e);
91415
+ const inFilter = findInPath(path, ".ids-data-grid-header-cell-filter-wrapper");
91416
+ const target = e.target;
91417
+ const isEditable = inFilter || target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target?.isContentEditable || findInPath(path, "ids-input");
91418
+ if (isEditable) {
91419
+ return;
91420
+ }
91421
+ if (e.key === "ArrowUp") {
91422
+ e.preventDefault();
91423
+ e.stopPropagation();
91424
+ return;
91425
+ }
91426
+ if (e.key === "ArrowDown") {
91427
+ e.preventDefault();
91428
+ e.stopPropagation();
91429
+ const focusedHeaderCell = e.target;
91430
+ const columnIndexAttr = focusedHeaderCell.getAttribute("aria-colindex");
91431
+ if (columnIndexAttr) {
91432
+ const columnIndex = parseInt(columnIndexAttr) - 1;
91433
+ const firstRow = this.rowByIndex(0);
91434
+ if (firstRow) {
91435
+ const targetCell = firstRow.cellByIndex(columnIndex);
91436
+ if (targetCell) {
91437
+ this.setActiveCell(columnIndex, 0, false, "keyboard");
91438
+ targetCell.focus();
91439
+ return;
91440
+ }
91441
+ }
91442
+ }
91443
+ }
91444
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
91445
+ const focusedHeaderCell = e.target;
91446
+ const columnIndexAttr = focusedHeaderCell.getAttribute("aria-colindex");
91447
+ if (e.shiftKey && columnIndexAttr) {
91448
+ e.preventDefault();
91449
+ e.stopPropagation();
91450
+ const columnId = focusedHeaderCell.getAttribute("column-id");
91451
+ if (columnId) {
91452
+ const column = this.columnDataById(columnId);
91453
+ if (column && column.resizable) {
91454
+ const RESIZE_INCREMENT = 5;
91455
+ const DEFAULT_COLUMNSIZE = 110;
91456
+ const currentWidth = typeof column.width === "number" ? column.width : DEFAULT_COLUMNSIZE;
91457
+ const proposedWidth = e.key === "ArrowRight" ? currentWidth + RESIZE_INCREMENT : currentWidth - RESIZE_INCREMENT;
91458
+ const minWidth = column.minWidth || DEFAULT_COLUMN_MIN_WIDTH;
91459
+ const maxWidth = column.maxWidth || Number.MAX_SAFE_INTEGER;
91460
+ const newWidth = Math.max(minWidth, Math.min(maxWidth, proposedWidth));
91461
+ if (newWidth !== currentWidth) {
91462
+ this.setColumnWidth(columnId, newWidth);
91463
+ let columnText = this.localeAPI?.translate("ColumnResizeAria");
91464
+ columnText = columnText.replace("{0}", column.name).replace("{1}", newWidth);
91465
+ focusedHeaderCell.setAttribute("aria-label", columnText);
91466
+ }
91467
+ }
91468
+ }
91469
+ return;
91470
+ }
91471
+ e.preventDefault();
91472
+ e.stopPropagation();
91473
+ if (columnIndexAttr) {
91474
+ const currentColumnIndex = parseInt(columnIndexAttr) - 1;
91475
+ const nextColumnIndex = e.key === "ArrowRight" ? currentColumnIndex + 1 : currentColumnIndex - 1;
91476
+ if (nextColumnIndex >= 0 && nextColumnIndex < this.visibleColumns.length) {
91477
+ const nextHeaderCell = this.header?.querySelector(`[aria-colindex="${nextColumnIndex + 1}"][tabindex="0"]`);
91478
+ if (nextHeaderCell) {
91479
+ nextHeaderCell.focus();
91480
+ return;
91481
+ }
91482
+ }
91483
+ }
91484
+ }
91485
+ if (e.key === " " || e.key === "Space") {
91486
+ const focusedHeaderCell = e.target;
91487
+ if (focusedHeaderCell.hasAttribute("tabindex") && focusedHeaderCell.classList.contains("ids-data-grid-header-cell")) {
91488
+ e.preventDefault();
91489
+ e.stopPropagation();
91490
+ const headerCheckbox = focusedHeaderCell.querySelector(".ids-data-grid-checkbox");
91491
+ if (headerCheckbox) {
91492
+ if (headerCheckbox.classList.contains("checked") || headerCheckbox.classList.contains("indeterminate")) {
91493
+ this.deSelectAllRows();
91494
+ } else {
91495
+ this.selectAllRows();
91496
+ }
91497
+ }
91498
+ const columnCheckbox = focusedHeaderCell.querySelector(".ids-checkbox input");
91499
+ if (columnCheckbox) {
91500
+ const checkbox = columnCheckbox;
91501
+ checkbox.checked = !checkbox.checked;
91502
+ const columnIndex = parseInt(focusedHeaderCell.getAttribute("aria-colindex") || "1") - 1;
91503
+ if (checkbox.checked) {
91504
+ this.selectColumn(columnIndex);
91505
+ } else {
91506
+ this.deSelectColumn(columnIndex);
91507
+ }
91508
+ }
91509
+ return;
91510
+ }
91511
+ }
91244
91512
  this.activeCell = {};
91245
91513
  });
91246
91514
  this.offEvent("keydown.body", this);
@@ -91784,6 +92052,73 @@ ids-icon {
91784
92052
  __privateMethod(this, _IdsDataGrid_instances, restoreEditedCellsAfterScroll_fn).call(this);
91785
92053
  }
91786
92054
  };
92055
+ /**
92056
+ * Convert data row index to visible row index for tree grids
92057
+ * @param {number} rowIndex - The data row index
92058
+ * @returns {number} The visible row index, or -1 if row is hidden
92059
+ * @private
92060
+ */
92061
+ getVisibleRowIndex_fn = function(rowIndex) {
92062
+ if (!this.treeGrid) return rowIndex;
92063
+ return this.virtualRows.findIndex((row) => row === this.data[rowIndex]);
92064
+ };
92065
+ /**
92066
+ * Find the next non-hidden row index in the specified direction
92067
+ * @param {number} startRowIndex - The starting data row index
92068
+ * @param {IdsDirection} direction - The navigation direction (Up or Down)
92069
+ * @returns {number} The next non-hidden row index, or -1 if none found
92070
+ * @private
92071
+ */
92072
+ findNextVisibleRow_fn = function(startRowIndex, direction) {
92073
+ const step = direction === "down" /* Down */ ? 1 : -1;
92074
+ let nextRowIndex = startRowIndex + step;
92075
+ while (nextRowIndex >= 0 && nextRowIndex < this.data.length && this.treeGrid && this.data[nextRowIndex]?.rowHidden) {
92076
+ nextRowIndex += step;
92077
+ }
92078
+ return nextRowIndex >= 0 && nextRowIndex < this.data.length ? nextRowIndex : -1;
92079
+ };
92080
+ /**
92081
+ * Scroll to bring a row into view and activate its cell
92082
+ * @param {number} nextRowIndex - The data row index to bring into view
92083
+ * @param {number} columnIndex - The column index of the cell to activate
92084
+ * @param {IdsDirection} direction - The navigation direction (Up or Down)
92085
+ * @private
92086
+ */
92087
+ scrollToActivateRow_fn = function(nextRowIndex, columnIndex, direction) {
92088
+ if (nextRowIndex < 0 || nextRowIndex >= this.data.length) return;
92089
+ const visibleRowIndex = __privateMethod(this, _IdsDataGrid_instances, getVisibleRowIndex_fn).call(this, nextRowIndex);
92090
+ if (visibleRowIndex === -1) return;
92091
+ const { ROW_HEIGHT } = this.virtualScrollSettings;
92092
+ const containerHeight = this.container.clientHeight;
92093
+ const headerHeight = this.header?.clientHeight ?? 0;
92094
+ const targetScrollTop = direction === "down" /* Down */ ? (visibleRowIndex + 1) * ROW_HEIGHT - containerHeight + headerHeight : visibleRowIndex * ROW_HEIGHT;
92095
+ this.container.scrollTop = Math.max(targetScrollTop, 0);
92096
+ requestAnimationFrame(() => {
92097
+ const activeCell = this.findCellByLogicalPosition(nextRowIndex, columnIndex);
92098
+ if (activeCell) {
92099
+ activeCell.focus();
92100
+ this.setActiveCell(activeCell.columnIndex, activeCell.rowIndex, false, "keyboard");
92101
+ }
92102
+ });
92103
+ };
92104
+ ensureRowInViewport_fn = function(rowIndex, direction) {
92105
+ if (!this.virtualScroll || !this.container) return;
92106
+ const { ROW_HEIGHT } = this.virtualScrollSettings;
92107
+ const containerHeight = this.container.clientHeight;
92108
+ const headerHeight = this.header?.clientHeight ?? 0;
92109
+ const scrollTop = this.container.scrollTop;
92110
+ const viewportTop = scrollTop;
92111
+ const viewportBottom = scrollTop + containerHeight - headerHeight;
92112
+ const effectiveRowIndex = __privateMethod(this, _IdsDataGrid_instances, getVisibleRowIndex_fn).call(this, rowIndex);
92113
+ if (effectiveRowIndex === -1) return;
92114
+ const rowTop = effectiveRowIndex * ROW_HEIGHT;
92115
+ const rowBottom = rowTop + ROW_HEIGHT;
92116
+ if (direction === "up" /* Up */ && rowTop < viewportTop) {
92117
+ this.container.scrollTop = rowTop;
92118
+ } else if (direction === "down" /* Down */ && rowBottom > viewportBottom) {
92119
+ this.container.scrollTop = rowBottom - containerHeight + headerHeight;
92120
+ }
92121
+ };
91787
92122
  setVirtualScrollPaddingBottom_fn = function(settings, totalRows, offsetTop) {
91788
92123
  const maxHeight = totalRows * settings.ROW_HEIGHT;
91789
92124
  const paddingBottom = maxHeight - settings.MAX_ROWS_IN_DOM * settings.ROW_HEIGHT - offsetTop;
@@ -92153,7 +92488,7 @@ ids-icon {
92153
92488
  editedCells.push(this.activeCell?.node);
92154
92489
  const activeCell = this.activeCell.node;
92155
92490
  const currentValue = activeCell.editor?.input?.value || "";
92156
- this.updateActiveCellCache(this.activeCell.row, this.activeCell.cell, currentValue);
92491
+ this.updateActiveCellCache(this.activeCell.row, this.activeCell.cell, currentValue, true);
92157
92492
  __privateGet(this, _activeCellCache).shouldReinstateCell = true;
92158
92493
  this.commitCellEdit();
92159
92494
  }
@@ -92186,14 +92521,14 @@ ids-icon {
92186
92521
  * @private
92187
92522
  */
92188
92523
  restoreActiveCellAfterScroll_fn = function() {
92189
- const isHeaderActive = this.header && this.header.activeColumn >= 0;
92190
- if (!__privateGet(this, _activeCellCache) || !__privateGet(this, _activeCellCache)?.shouldReinstateCell || isHeaderActive) {
92524
+ if (!__privateGet(this, _activeCellCache) || !__privateGet(this, _activeCellCache)?.shouldReinstateCell) {
92191
92525
  return;
92192
92526
  }
92193
92527
  const {
92194
92528
  rowIndex,
92195
92529
  columnIndex,
92196
- currentValue
92530
+ currentValue,
92531
+ wasEditing
92197
92532
  } = __privateGet(this, _activeCellCache);
92198
92533
  if (rowIndex < 0 || rowIndex >= this.data.length || columnIndex < 0 || columnIndex >= this.visibleColumns.length) {
92199
92534
  return;
@@ -92205,7 +92540,9 @@ ids-icon {
92205
92540
  const scrollTop = this.container?.scrollTop || 0;
92206
92541
  const containerHeight = this.container?.clientHeight || 0;
92207
92542
  const rowHeight = this.virtualScrollSettings.ROW_HEIGHT;
92208
- const rowTop = rowIndex * rowHeight;
92543
+ const effectiveRowIndex = __privateMethod(this, _IdsDataGrid_instances, getVisibleRowIndex_fn).call(this, rowIndex);
92544
+ if (effectiveRowIndex === -1) return;
92545
+ const rowTop = effectiveRowIndex * rowHeight;
92209
92546
  const rowBottom = rowTop + rowHeight;
92210
92547
  const viewportTop = scrollTop;
92211
92548
  const viewportBottom = scrollTop + containerHeight;
@@ -92214,15 +92551,12 @@ ids-icon {
92214
92551
  __privateGet(this, _activeCellCache).hasLeaveViewport = true;
92215
92552
  return;
92216
92553
  }
92217
- if (!__privateGet(this, _activeCellCache).hasLeaveViewport) {
92218
- return;
92219
- }
92220
92554
  const cellElement = this.cellByIndex(rowIndex, columnIndex);
92221
92555
  if (!cellElement) {
92222
92556
  return;
92223
92557
  }
92224
92558
  this.setActiveCell(columnIndex, rowIndex, false, "internal");
92225
- if (cellElement.column?.editor) {
92559
+ if (wasEditing === true && cellElement.column?.editor) {
92226
92560
  cellElement.startCellEdit();
92227
92561
  if (cellElement.editor?.input) {
92228
92562
  cellElement.editor.input.value = currentValue;