ids-enterprise-wc 1.15.9-patch.5 → 1.15.9-patch.7

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 (41) 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-7URDZKCS-full.js → ids-chunk-7IP7SLQZ-full.js} +28 -2
  4. package/chunks/ids-chunk-7IP7SLQZ-full.js.map +7 -0
  5. package/chunks/{ids-chunk-LZU34NYE-full.js → ids-chunk-CSOF2USI-full.js} +12 -2
  6. package/chunks/{ids-chunk-LZU34NYE-full.js.map → ids-chunk-CSOF2USI-full.js.map} +2 -2
  7. package/chunks/{ids-chunk-FW4DOBQU-full.js → ids-chunk-FPEINRXY-full.js} +6 -10
  8. package/chunks/ids-chunk-FPEINRXY-full.js.map +7 -0
  9. package/chunks/{ids-chunk-UEVOEMEM-full.js → ids-chunk-HZO4QUAW-full.js} +358 -34
  10. package/chunks/ids-chunk-HZO4QUAW-full.js.map +7 -0
  11. package/chunks/{ids-chunk-HGKIZXDQ-full.js → ids-chunk-RLOOHWYV-full.js} +2 -2
  12. package/components/ids-button/ids-button.css +392 -43
  13. package/components/ids-checkbox/ids-checkbox.css +7 -580
  14. package/components/ids-data-grid/ids-data-grid-cell.js +1 -1
  15. package/components/ids-data-grid/ids-data-grid-column.d.ts +1 -0
  16. package/components/ids-data-grid/ids-data-grid-column.js +7 -0
  17. package/components/ids-data-grid/ids-data-grid-filters.js +2 -2
  18. package/components/ids-data-grid/ids-data-grid-header.d.ts +6 -2
  19. package/components/ids-data-grid/ids-data-grid-header.js +1 -1
  20. package/components/ids-data-grid/ids-data-grid-row.d.ts +6 -0
  21. package/components/ids-data-grid/ids-data-grid-row.js +2 -2
  22. package/components/ids-data-grid/ids-data-grid.d.ts +18 -1
  23. package/components/ids-data-grid/ids-data-grid.js +6 -5
  24. package/components/ids-date-picker/ids-date-picker.css +31 -389
  25. package/components/ids-layout-grid/ids-layout-grid.css +10 -21300
  26. package/components/ids-list-box/ids-list-box.css +66 -98
  27. package/components/ids-menu/ids-menu.css +335 -11
  28. package/components/ids-module-nav/ids-module-nav.css +24 -2465
  29. package/components/ids-tag/ids-tag.css +8 -152
  30. package/components/ids-toolbar/ids-toolbar.css +12 -122
  31. package/components/ids-trigger-field/ids-trigger-field.css +1681 -1165
  32. package/custom-elements.json +2090 -1869
  33. package/enterprise-wc.all.iife.js +395 -39
  34. package/enterprise-wc.all.iife.js.map +3 -3
  35. package/enterprise-wc.js +6 -5
  36. package/package.json +1 -1
  37. package/vscode.html-custom-data.json +1 -1
  38. package/chunks/ids-chunk-7URDZKCS-full.js.map +0 -7
  39. package/chunks/ids-chunk-FW4DOBQU-full.js.map +0 -7
  40. package/chunks/ids-chunk-UEVOEMEM-full.js.map +0 -7
  41. /package/chunks/{ids-chunk-HGKIZXDQ-full.js.map → ids-chunk-RLOOHWYV-full.js.map} +0 -0
@@ -34,19 +34,22 @@ import {
34
34
  } from "./ids-chunk-3BYETIBG-full.js";
35
35
  import {
36
36
  IdsDataGridFilters
37
- } from "./ids-chunk-HGKIZXDQ-full.js";
37
+ } from "./ids-chunk-RLOOHWYV-full.js";
38
38
  import {
39
39
  IdsDataGridFormatters
40
40
  } from "./ids-chunk-34MMRVVB-full.js";
41
41
  import {
42
42
  IdsDataGridHeader
43
- } from "./ids-chunk-7URDZKCS-full.js";
43
+ } from "./ids-chunk-7IP7SLQZ-full.js";
44
44
  import {
45
45
  IdsDataGridRow
46
- } from "./ids-chunk-LZU34NYE-full.js";
46
+ } from "./ids-chunk-CSOF2USI-full.js";
47
47
  import {
48
48
  IdsDataGridCell
49
- } from "./ids-chunk-FW4DOBQU-full.js";
49
+ } from "./ids-chunk-FPEINRXY-full.js";
50
+ import {
51
+ DEFAULT_COLUMN_MIN_WIDTH
52
+ } from "./ids-chunk-4MSGTAOV-full.js";
50
53
  import {
51
54
  containerArguments,
52
55
  containerTypes
@@ -2688,7 +2691,7 @@ var Base = ids_pager_mixin_default(
2688
2691
  )
2689
2692
  )
2690
2693
  );
2691
- 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_fn, attachDragSelection_fn, createSelectionBorder_fn, updateSelectionBorder_fn, attachCopyPasteCellHandlers_fn, attachKeyboardListeners_fn, 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;
2694
+ 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_fn, attachDragSelection_fn, createSelectionBorder_fn, updateSelectionBorder_fn, attachCopyPasteCellHandlers_fn, attachKeyboardListeners_fn, 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;
2692
2695
  var IdsDataGrid = class extends Base {
2693
2696
  constructor() {
2694
2697
  super();
@@ -3655,7 +3658,8 @@ var IdsDataGrid = class extends Base {
3655
3658
  if (this.activeCellEditor) {
3656
3659
  const rowIndex = this.activeCell.row;
3657
3660
  const cell = this.activeCell.cell;
3658
- this.updateActiveCellCache(rowIndex, cell, __privateGet(this, _activeCellCache)?.currentValue || "");
3661
+ const activeNode = this.activeCell.node;
3662
+ this.updateActiveCellCache(rowIndex, cell, __privateGet(this, _activeCellCache)?.currentValue || "", activeNode?.isEditing);
3659
3663
  }
3660
3664
  if (__privateGet(this, _activeCellCache)) {
3661
3665
  __privateGet(this, _activeCellCache).shouldReinstateCell = true;
@@ -3665,6 +3669,7 @@ var IdsDataGrid = class extends Base {
3665
3669
  this.resetCache();
3666
3670
  if (this.treeGrid) {
3667
3671
  __privateMethod(this, _IdsDataGrid_instances, recycleAllTreeRows_fn).call(this, Math.floor(this.container.scrollTop / this.virtualScrollSettings.ROW_HEIGHT));
3672
+ __privateMethod(this, _IdsDataGrid_instances, restoreActiveCellAfterScroll_fn).call(this);
3668
3673
  } else {
3669
3674
  __privateMethod(this, _IdsDataGrid_instances, appendMissingRows_fn).call(this);
3670
3675
  }
@@ -3672,6 +3677,82 @@ var IdsDataGrid = class extends Base {
3672
3677
  this.data = this.data.concat(value);
3673
3678
  }
3674
3679
  }
3680
+ /**
3681
+ * Find a cell by logical position, accounting for rowspan
3682
+ * @param {number} rowIndex the row index
3683
+ * @param {number} columnIndex the logical column index
3684
+ * @returns {IdsDataGridCell | null} the cell at the logical position
3685
+ */
3686
+ findCellByLogicalPosition(rowIndex, columnIndex) {
3687
+ if (rowIndex < 0 || rowIndex >= this.data.length) return null;
3688
+ if (columnIndex < 0 || columnIndex >= this.visibleColumns.length) return null;
3689
+ if (this.treeGrid && this.data[rowIndex]?.rowHidden) return null;
3690
+ const row = this.rowByIndex(rowIndex);
3691
+ if (!row) return null;
3692
+ const columnId = this.visibleColumns[columnIndex]?.id;
3693
+ if (!columnId) return null;
3694
+ return row.cellByLogicalIndex?.(columnIndex) ?? row.cellByIndex(columnIndex) ?? null;
3695
+ }
3696
+ /**
3697
+ * Find the next navigable cell in a given direction
3698
+ * @param {IdsDataGridCell} currentCell the current cell
3699
+ * @param {IdsDirection} direction the navigation direction
3700
+ * @returns {IdsDataGridCell | null} the next navigable cell
3701
+ */
3702
+ findNextNavigableCell(currentCell, direction) {
3703
+ const currentRowIndex = currentCell.rowIndex;
3704
+ const currentColumnIndex = currentCell.columnIndex;
3705
+ switch (direction) {
3706
+ case "up" /* Up */: {
3707
+ if (currentRowIndex === 0) return null;
3708
+ for (let targetRowIndex = currentRowIndex - 1; targetRowIndex >= 0; targetRowIndex--) {
3709
+ const cell = this.findCellByLogicalPosition(targetRowIndex, currentColumnIndex);
3710
+ if (cell) return cell;
3711
+ }
3712
+ return null;
3713
+ }
3714
+ case "down" /* Down */: {
3715
+ if (currentRowIndex >= this.data.length - 1) return null;
3716
+ const currentRowData = this.data[currentRowIndex];
3717
+ const columnId = this.visibleColumns[currentColumnIndex]?.id;
3718
+ const currentSpan = currentRowData?.rowspan?.[columnId] || 1;
3719
+ const startRowIndex = currentRowIndex + currentSpan;
3720
+ for (let targetRowIndex = startRowIndex; targetRowIndex < this.data.length; targetRowIndex++) {
3721
+ const cell = this.findCellByLogicalPosition(targetRowIndex, currentColumnIndex);
3722
+ if (cell) return cell;
3723
+ }
3724
+ return null;
3725
+ }
3726
+ case "left" /* Left */: {
3727
+ for (let colIndex = currentColumnIndex - 1; colIndex >= 0; colIndex--) {
3728
+ const cell = this.findCellByLogicalPosition(currentRowIndex, colIndex);
3729
+ if (cell && cell !== currentCell) return cell;
3730
+ }
3731
+ if (currentRowIndex > 0) {
3732
+ for (let colIndex = this.visibleColumns.length - 1; colIndex >= 0; colIndex--) {
3733
+ const cell = this.findCellByLogicalPosition(currentRowIndex - 1, colIndex);
3734
+ if (cell) return cell;
3735
+ }
3736
+ }
3737
+ return null;
3738
+ }
3739
+ case "right" /* Right */: {
3740
+ for (let colIndex = currentColumnIndex + 1; colIndex < this.visibleColumns.length; colIndex++) {
3741
+ const cell = this.findCellByLogicalPosition(currentRowIndex, colIndex);
3742
+ if (cell && cell !== currentCell) return cell;
3743
+ }
3744
+ if (currentRowIndex < this.data.length - 1) {
3745
+ for (let colIndex = 0; colIndex < this.visibleColumns.length; colIndex++) {
3746
+ const cell = this.findCellByLogicalPosition(currentRowIndex + 1, colIndex);
3747
+ if (cell) return cell;
3748
+ }
3749
+ }
3750
+ return null;
3751
+ }
3752
+ default:
3753
+ return null;
3754
+ }
3755
+ }
3675
3756
  /**
3676
3757
  * Set the data of the data grid
3677
3758
  * @param {Array} value The array to use
@@ -4763,7 +4844,11 @@ var IdsDataGrid = class extends Base {
4763
4844
  this.activeCell.cell = Number(cellNumber);
4764
4845
  this.activeCell.row = Number(rowIndex);
4765
4846
  const currentCell = this.cellByIndex(rowIndex, cellNumber);
4766
- this.updateActiveCellCache(rowIndex, cellNumber, currentCell?.value);
4847
+ if (reason === "redraw") {
4848
+ this.clearActiveCellCache();
4849
+ } else {
4850
+ this.updateActiveCellCache(rowIndex, cellNumber, currentCell?.value, true);
4851
+ }
4767
4852
  let rowNode = this.rowByIndex(rowIndex);
4768
4853
  if (!rowNode && this.virtualScroll) {
4769
4854
  const setActiveCellData = {
@@ -5317,15 +5402,20 @@ var IdsDataGrid = class extends Base {
5317
5402
  * @param {number} row - The row index
5318
5403
  * @param {number} cell - The cell index
5319
5404
  * @param {string} cellValue - The current cell value
5405
+ * @param {boolean} isEditing - Whether the cell is currently in edit mode
5320
5406
  */
5321
- updateActiveCellCache(row, cell, cellValue) {
5322
- __privateSet(this, _activeCellCache, {
5407
+ updateActiveCellCache(row, cell, cellValue, isEditing) {
5408
+ const cacheUpdate = {
5323
5409
  rowIndex: row,
5324
5410
  columnIndex: cell,
5325
5411
  currentValue: cellValue,
5326
5412
  hasLeaveViewport: false,
5327
5413
  shouldReinstateCell: true
5328
- });
5414
+ };
5415
+ if (isEditing !== void 0) {
5416
+ cacheUpdate.wasEditing = isEditing;
5417
+ }
5418
+ __privateSet(this, _activeCellCache, cacheUpdate);
5329
5419
  }
5330
5420
  /**
5331
5421
  * Clears the active cell cache, optionally checking if the cached row is within viewport
@@ -5816,7 +5906,13 @@ attachKeyboardListeners_fn = function() {
5816
5906
  if (e.key === "ArrowDown") newRowIndex = 1;
5817
5907
  if (e.key === "ArrowRight") newColIndex = 1;
5818
5908
  if (e.key === "ArrowLeft") newColIndex = -1;
5819
- __privateGet(this, _activeCellCache).rowIndex = Math.max(__privateGet(this, _activeCellCache).rowIndex + newRowIndex, 0);
5909
+ if (this.treeGrid && newRowIndex !== 0) {
5910
+ const direction = newRowIndex === 1 ? "down" /* Down */ : "up" /* Up */;
5911
+ const nextRowIndex = __privateMethod(this, _IdsDataGrid_instances, findNextVisibleRow_fn).call(this, __privateGet(this, _activeCellCache).rowIndex, direction);
5912
+ __privateGet(this, _activeCellCache).rowIndex = nextRowIndex !== -1 ? nextRowIndex : __privateGet(this, _activeCellCache).rowIndex;
5913
+ } else {
5914
+ __privateGet(this, _activeCellCache).rowIndex = Math.max(__privateGet(this, _activeCellCache).rowIndex + newRowIndex, 0);
5915
+ }
5820
5916
  __privateGet(this, _activeCellCache).columnIndex = Math.max(__privateGet(this, _activeCellCache).columnIndex + newColIndex, 0);
5821
5917
  requestAnimationTimeout(() => {
5822
5918
  __privateMethod(this, _IdsDataGrid_instances, restoreActiveCellAfterScroll_fn).call(this);
@@ -5838,26 +5934,60 @@ attachKeyboardListeners_fn = function() {
5838
5934
  e.preventDefault();
5839
5935
  e.stopPropagation();
5840
5936
  const previousActiveRow = Number(activeCell?.rowIndex || 0);
5841
- if (key === "ArrowUp") activeCell = activeCell?.cellAbove ?? null;
5842
- else if (key === "ArrowDown") activeCell = activeCell?.cellBelow ?? null;
5843
- else if (key === "ArrowLeft" && !e.metaKey) activeCell = activeCell?.cellLeft ?? null;
5844
- else if (key === "ArrowRight" && !e.metaKey) activeCell = activeCell?.cellRight ?? null;
5937
+ if (key === "ArrowUp") {
5938
+ if (activeCell?.rowIndex === 0) {
5939
+ const columnIndex = activeCell?.columnIndex ?? 0;
5940
+ const headerCell = this.header?.querySelector(`[aria-colindex="${columnIndex + 1}"][tabindex="0"]`);
5941
+ if (headerCell) {
5942
+ headerCell.setAttribute(attributes.TABINDEX, "0");
5943
+ this.header?.querySelectorAll(".ids-data-grid-header-cell").forEach((cell) => {
5944
+ cell.classList.remove("is-focused");
5945
+ });
5946
+ headerCell.focus();
5947
+ return;
5948
+ }
5949
+ }
5950
+ const prevCell = activeCell;
5951
+ activeCell = this.findNextNavigableCell(activeCell, "up" /* Up */);
5952
+ if (!activeCell && this.virtualScroll && prevCell && prevCell.rowIndex > 0) {
5953
+ const nextRowIndex = __privateMethod(this, _IdsDataGrid_instances, findNextVisibleRow_fn).call(this, prevCell.rowIndex, "up" /* Up */);
5954
+ if (nextRowIndex !== -1) {
5955
+ __privateMethod(this, _IdsDataGrid_instances, scrollToActivateRow_fn).call(this, nextRowIndex, prevCell.columnIndex, "up" /* Up */);
5956
+ return;
5957
+ }
5958
+ }
5959
+ if (this.virtualScroll && activeCell) {
5960
+ __privateMethod(this, _IdsDataGrid_instances, ensureRowInViewport_fn).call(this, activeCell.rowIndex, "up" /* Up */);
5961
+ }
5962
+ } else if (key === "ArrowDown") {
5963
+ const prevCell = activeCell;
5964
+ activeCell = this.findNextNavigableCell(activeCell, "down" /* Down */);
5965
+ if (!activeCell && this.virtualScroll && prevCell && prevCell.rowIndex < this.data.length - 1) {
5966
+ const nextRowIndex = __privateMethod(this, _IdsDataGrid_instances, findNextVisibleRow_fn).call(this, prevCell.rowIndex, "down" /* Down */);
5967
+ if (nextRowIndex !== -1) {
5968
+ __privateMethod(this, _IdsDataGrid_instances, scrollToActivateRow_fn).call(this, nextRowIndex, prevCell.columnIndex, "down" /* Down */);
5969
+ return;
5970
+ }
5971
+ }
5972
+ if (this.virtualScroll && activeCell) {
5973
+ __privateMethod(this, _IdsDataGrid_instances, ensureRowInViewport_fn).call(this, activeCell.rowIndex, "down" /* Down */);
5974
+ }
5975
+ } else if (key === "ArrowLeft" && !e.metaKey) activeCell = this.findNextNavigableCell(activeCell, "left" /* Left */);
5976
+ else if (key === "ArrowRight" && !e.metaKey) activeCell = this.findNextNavigableCell(activeCell, "right" /* Right */);
5845
5977
  else if (key === "PageUp") {
5846
- const firstRow = this.rowByIndex(0);
5847
5978
  const columnIndex = activeCell?.columnIndex ?? 0;
5848
- activeCell = firstRow?.cellByIndex(columnIndex) ?? null;
5979
+ activeCell = this.findCellByLogicalPosition(0, columnIndex);
5849
5980
  } else if (key === "PageDown") {
5850
5981
  const lastRowIndex = this.data.length - 1;
5851
- const lastRow = this.rowByIndex(lastRowIndex);
5852
5982
  const columnIndex = activeCell?.columnIndex ?? 0;
5853
- activeCell = lastRow?.cellByIndex(columnIndex) ?? null;
5983
+ activeCell = this.findCellByLogicalPosition(lastRowIndex, columnIndex);
5854
5984
  } else if (key === "Home" || key === "ArrowLeft" && e.metaKey) {
5855
- const currentRow = this.rowByIndex(activeCell?.rowIndex ?? 0);
5856
- activeCell = currentRow?.cellByIndex(0) ?? null;
5985
+ const currentRowIndex = activeCell?.rowIndex ?? 0;
5986
+ activeCell = this.findCellByLogicalPosition(currentRowIndex, 0);
5857
5987
  } else if (key === "End" || key === "ArrowRight" && e.metaKey) {
5858
- const currentRow = this.rowByIndex(activeCell?.rowIndex ?? 0);
5859
- const lastColumnIndex = this.columns.length - 1;
5860
- activeCell = currentRow?.cellByIndex(lastColumnIndex) ?? null;
5988
+ const currentRowIndex = activeCell?.rowIndex ?? 0;
5989
+ const lastColumnIndex = this.visibleColumns.length - 1;
5990
+ activeCell = this.findCellByLogicalPosition(currentRowIndex, lastColumnIndex);
5861
5991
  }
5862
5992
  const activeRowIndex = activeCell?.rowIndex ?? previousActiveRow;
5863
5993
  activeCell?.focus?.();
@@ -5963,8 +6093,44 @@ attachKeyboardListeners_fn = function() {
5963
6093
  if (!this.isEditable) {
5964
6094
  return;
5965
6095
  }
5966
- const nextCell = e.shiftKey ? this.activeCell?.node?.cellLeftEditable : this.activeCell?.node?.cellRightEditable;
6096
+ let nextCell = e.shiftKey ? this.activeCell?.node?.cellLeftEditable : this.activeCell?.node?.cellRightEditable;
6097
+ while (nextCell && nextCell.hasAttribute?.("hidden")) {
6098
+ nextCell = e.shiftKey ? nextCell?.cellLeftEditable : nextCell?.cellRightEditable;
6099
+ }
5967
6100
  if (!nextCell) {
6101
+ if (!e.shiftKey && this.addNewAtEnd && this.activeCell?.node) {
6102
+ const currentRowIndex = this.activeCell.node.rowIndex;
6103
+ const isLastRow = currentRowIndex === this.data.length - 1;
6104
+ if (isLastRow) {
6105
+ e.stopImmediatePropagation();
6106
+ e.stopPropagation();
6107
+ e.preventDefault();
6108
+ const newRowData = {};
6109
+ this.visibleColumns.forEach((column) => {
6110
+ if (column.field && column.field !== "selectionCheckbox" && column.field !== "selectionRadio") {
6111
+ newRowData[column.field] = "";
6112
+ }
6113
+ });
6114
+ this.addRow(newRowData);
6115
+ requestAnimationFrame(() => {
6116
+ const newRowIndex = this.data.length - 1;
6117
+ const newRow = this.rowByIndex(newRowIndex);
6118
+ if (newRow) {
6119
+ const firstEditableCell = newRow.querySelector(".is-editable:not(.is-readonly):not(.is-disabled)");
6120
+ if (firstEditableCell) {
6121
+ const columnIndex = firstEditableCell.columnIndex;
6122
+ this.setActiveCell(columnIndex, newRowIndex, false, "keyboard");
6123
+ if (this.editNextOnEnterPress) {
6124
+ firstEditableCell.startCellEdit?.();
6125
+ } else {
6126
+ firstEditableCell.focus?.();
6127
+ }
6128
+ }
6129
+ }
6130
+ });
6131
+ return;
6132
+ }
6133
+ }
5968
6134
  return;
5969
6135
  }
5970
6136
  e.stopImmediatePropagation();
@@ -5996,7 +6162,98 @@ attachKeyboardListeners_fn = function() {
5996
6162
  }
5997
6163
  });
5998
6164
  this.offEvent("keydown.body", this.header);
5999
- this.onEvent("keydown.body", this.header, () => {
6165
+ this.onEvent("keydown.body", this.header, (e) => {
6166
+ if (e.key === "ArrowUp") {
6167
+ e.preventDefault();
6168
+ e.stopPropagation();
6169
+ return;
6170
+ }
6171
+ if (e.key === "ArrowDown") {
6172
+ e.preventDefault();
6173
+ e.stopPropagation();
6174
+ const focusedHeaderCell = e.target;
6175
+ const columnIndexAttr = focusedHeaderCell.getAttribute("aria-colindex");
6176
+ if (columnIndexAttr) {
6177
+ const columnIndex = parseInt(columnIndexAttr) - 1;
6178
+ const firstRow = this.rowByIndex(0);
6179
+ if (firstRow) {
6180
+ const targetCell = firstRow.cellByIndex(columnIndex);
6181
+ if (targetCell) {
6182
+ this.setActiveCell(columnIndex, 0, false, "keyboard");
6183
+ targetCell.focus();
6184
+ return;
6185
+ }
6186
+ }
6187
+ }
6188
+ }
6189
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
6190
+ const focusedHeaderCell = e.target;
6191
+ const columnIndexAttr = focusedHeaderCell.getAttribute("aria-colindex");
6192
+ if (e.shiftKey && columnIndexAttr) {
6193
+ e.preventDefault();
6194
+ e.stopPropagation();
6195
+ const columnId = focusedHeaderCell.getAttribute("column-id");
6196
+ if (columnId) {
6197
+ const column = this.columnDataById(columnId);
6198
+ if (column && column.resizable) {
6199
+ const RESIZE_INCREMENT = 5;
6200
+ const DEFAULT_COLUMNSIZE = 110;
6201
+ const currentWidth = typeof column.width === "number" ? column.width : DEFAULT_COLUMNSIZE;
6202
+ const proposedWidth = e.key === "ArrowRight" ? currentWidth + RESIZE_INCREMENT : currentWidth - RESIZE_INCREMENT;
6203
+ const minWidth = column.minWidth || DEFAULT_COLUMN_MIN_WIDTH;
6204
+ const maxWidth = column.maxWidth || Number.MAX_SAFE_INTEGER;
6205
+ const newWidth = Math.max(minWidth, Math.min(maxWidth, proposedWidth));
6206
+ if (newWidth !== currentWidth) {
6207
+ this.setColumnWidth(columnId, newWidth);
6208
+ let columnText = this.localeAPI?.translate("ColumnResizeAria");
6209
+ columnText = columnText.replace("{0}", column.name).replace("{1}", newWidth);
6210
+ focusedHeaderCell.setAttribute("aria-label", columnText);
6211
+ }
6212
+ }
6213
+ }
6214
+ return;
6215
+ }
6216
+ e.preventDefault();
6217
+ e.stopPropagation();
6218
+ if (columnIndexAttr) {
6219
+ const currentColumnIndex = parseInt(columnIndexAttr) - 1;
6220
+ const nextColumnIndex = e.key === "ArrowRight" ? currentColumnIndex + 1 : currentColumnIndex - 1;
6221
+ if (nextColumnIndex >= 0 && nextColumnIndex < this.visibleColumns.length) {
6222
+ const nextHeaderCell = this.header?.querySelector(`[aria-colindex="${nextColumnIndex + 1}"][tabindex="0"]`);
6223
+ if (nextHeaderCell) {
6224
+ nextHeaderCell.focus();
6225
+ return;
6226
+ }
6227
+ }
6228
+ }
6229
+ }
6230
+ if (e.key === " " || e.key === "Space") {
6231
+ const focusedHeaderCell = e.target;
6232
+ if (focusedHeaderCell.hasAttribute("tabindex") && focusedHeaderCell.classList.contains("ids-data-grid-header-cell")) {
6233
+ e.preventDefault();
6234
+ e.stopPropagation();
6235
+ const headerCheckbox = focusedHeaderCell.querySelector(".ids-data-grid-checkbox");
6236
+ if (headerCheckbox) {
6237
+ if (headerCheckbox.classList.contains("checked") || headerCheckbox.classList.contains("indeterminate")) {
6238
+ this.deSelectAllRows();
6239
+ } else {
6240
+ this.selectAllRows();
6241
+ }
6242
+ }
6243
+ const columnCheckbox = focusedHeaderCell.querySelector(".ids-checkbox input");
6244
+ if (columnCheckbox) {
6245
+ const checkbox = columnCheckbox;
6246
+ checkbox.checked = !checkbox.checked;
6247
+ const columnIndex = parseInt(focusedHeaderCell.getAttribute("aria-colindex") || "1") - 1;
6248
+ if (checkbox.checked) {
6249
+ this.selectColumn(columnIndex);
6250
+ } else {
6251
+ this.deSelectColumn(columnIndex);
6252
+ }
6253
+ }
6254
+ return;
6255
+ }
6256
+ }
6000
6257
  this.activeCell = {};
6001
6258
  });
6002
6259
  this.offEvent("keydown.body", this);
@@ -6540,6 +6797,73 @@ scrollRowIntoView_fn = function(rowIndex, doScroll = true) {
6540
6797
  __privateMethod(this, _IdsDataGrid_instances, restoreEditedCellsAfterScroll_fn).call(this);
6541
6798
  }
6542
6799
  };
6800
+ /**
6801
+ * Convert data row index to visible row index for tree grids
6802
+ * @param {number} rowIndex - The data row index
6803
+ * @returns {number} The visible row index, or -1 if row is hidden
6804
+ * @private
6805
+ */
6806
+ getVisibleRowIndex_fn = function(rowIndex) {
6807
+ if (!this.treeGrid) return rowIndex;
6808
+ return this.virtualRows.findIndex((row) => row === this.data[rowIndex]);
6809
+ };
6810
+ /**
6811
+ * Find the next non-hidden row index in the specified direction
6812
+ * @param {number} startRowIndex - The starting data row index
6813
+ * @param {IdsDirection} direction - The navigation direction (Up or Down)
6814
+ * @returns {number} The next non-hidden row index, or -1 if none found
6815
+ * @private
6816
+ */
6817
+ findNextVisibleRow_fn = function(startRowIndex, direction) {
6818
+ const step = direction === "down" /* Down */ ? 1 : -1;
6819
+ let nextRowIndex = startRowIndex + step;
6820
+ while (nextRowIndex >= 0 && nextRowIndex < this.data.length && this.treeGrid && this.data[nextRowIndex]?.rowHidden) {
6821
+ nextRowIndex += step;
6822
+ }
6823
+ return nextRowIndex >= 0 && nextRowIndex < this.data.length ? nextRowIndex : -1;
6824
+ };
6825
+ /**
6826
+ * Scroll to bring a row into view and activate its cell
6827
+ * @param {number} nextRowIndex - The data row index to bring into view
6828
+ * @param {number} columnIndex - The column index of the cell to activate
6829
+ * @param {IdsDirection} direction - The navigation direction (Up or Down)
6830
+ * @private
6831
+ */
6832
+ scrollToActivateRow_fn = function(nextRowIndex, columnIndex, direction) {
6833
+ if (nextRowIndex < 0 || nextRowIndex >= this.data.length) return;
6834
+ const visibleRowIndex = __privateMethod(this, _IdsDataGrid_instances, getVisibleRowIndex_fn).call(this, nextRowIndex);
6835
+ if (visibleRowIndex === -1) return;
6836
+ const { ROW_HEIGHT } = this.virtualScrollSettings;
6837
+ const containerHeight = this.container.clientHeight;
6838
+ const headerHeight = this.header?.clientHeight ?? 0;
6839
+ const targetScrollTop = direction === "down" /* Down */ ? (visibleRowIndex + 1) * ROW_HEIGHT - containerHeight + headerHeight : visibleRowIndex * ROW_HEIGHT;
6840
+ this.container.scrollTop = Math.max(targetScrollTop, 0);
6841
+ requestAnimationFrame(() => {
6842
+ const activeCell = this.findCellByLogicalPosition(nextRowIndex, columnIndex);
6843
+ if (activeCell) {
6844
+ activeCell.focus();
6845
+ this.setActiveCell(activeCell.columnIndex, activeCell.rowIndex, false, "keyboard");
6846
+ }
6847
+ });
6848
+ };
6849
+ ensureRowInViewport_fn = function(rowIndex, direction) {
6850
+ if (!this.virtualScroll || !this.container) return;
6851
+ const { ROW_HEIGHT } = this.virtualScrollSettings;
6852
+ const containerHeight = this.container.clientHeight;
6853
+ const headerHeight = this.header?.clientHeight ?? 0;
6854
+ const scrollTop = this.container.scrollTop;
6855
+ const viewportTop = scrollTop;
6856
+ const viewportBottom = scrollTop + containerHeight - headerHeight;
6857
+ const effectiveRowIndex = __privateMethod(this, _IdsDataGrid_instances, getVisibleRowIndex_fn).call(this, rowIndex);
6858
+ if (effectiveRowIndex === -1) return;
6859
+ const rowTop = effectiveRowIndex * ROW_HEIGHT;
6860
+ const rowBottom = rowTop + ROW_HEIGHT;
6861
+ if (direction === "up" /* Up */ && rowTop < viewportTop) {
6862
+ this.container.scrollTop = rowTop;
6863
+ } else if (direction === "down" /* Down */ && rowBottom > viewportBottom) {
6864
+ this.container.scrollTop = rowBottom - containerHeight + headerHeight;
6865
+ }
6866
+ };
6543
6867
  setVirtualScrollPaddingBottom_fn = function(settings, totalRows, offsetTop) {
6544
6868
  const maxHeight = totalRows * settings.ROW_HEIGHT;
6545
6869
  const paddingBottom = maxHeight - settings.MAX_ROWS_IN_DOM * settings.ROW_HEIGHT - offsetTop;
@@ -6909,7 +7233,7 @@ saveEditedCellsBeforeScroll_fn = function() {
6909
7233
  editedCells.push(this.activeCell?.node);
6910
7234
  const activeCell = this.activeCell.node;
6911
7235
  const currentValue = activeCell.editor?.input?.value || "";
6912
- this.updateActiveCellCache(this.activeCell.row, this.activeCell.cell, currentValue);
7236
+ this.updateActiveCellCache(this.activeCell.row, this.activeCell.cell, currentValue, true);
6913
7237
  __privateGet(this, _activeCellCache).shouldReinstateCell = true;
6914
7238
  this.commitCellEdit();
6915
7239
  }
@@ -6948,7 +7272,8 @@ restoreActiveCellAfterScroll_fn = function() {
6948
7272
  const {
6949
7273
  rowIndex,
6950
7274
  columnIndex,
6951
- currentValue
7275
+ currentValue,
7276
+ wasEditing
6952
7277
  } = __privateGet(this, _activeCellCache);
6953
7278
  if (rowIndex < 0 || rowIndex >= this.data.length || columnIndex < 0 || columnIndex >= this.visibleColumns.length) {
6954
7279
  return;
@@ -6960,7 +7285,9 @@ restoreActiveCellAfterScroll_fn = function() {
6960
7285
  const scrollTop = this.container?.scrollTop || 0;
6961
7286
  const containerHeight = this.container?.clientHeight || 0;
6962
7287
  const rowHeight = this.virtualScrollSettings.ROW_HEIGHT;
6963
- const rowTop = rowIndex * rowHeight;
7288
+ const effectiveRowIndex = __privateMethod(this, _IdsDataGrid_instances, getVisibleRowIndex_fn).call(this, rowIndex);
7289
+ if (effectiveRowIndex === -1) return;
7290
+ const rowTop = effectiveRowIndex * rowHeight;
6964
7291
  const rowBottom = rowTop + rowHeight;
6965
7292
  const viewportTop = scrollTop;
6966
7293
  const viewportBottom = scrollTop + containerHeight;
@@ -6969,15 +7296,12 @@ restoreActiveCellAfterScroll_fn = function() {
6969
7296
  __privateGet(this, _activeCellCache).hasLeaveViewport = true;
6970
7297
  return;
6971
7298
  }
6972
- if (!__privateGet(this, _activeCellCache).hasLeaveViewport) {
6973
- return;
6974
- }
6975
7299
  const cellElement = this.cellByIndex(rowIndex, columnIndex);
6976
7300
  if (!cellElement) {
6977
7301
  return;
6978
7302
  }
6979
7303
  this.setActiveCell(columnIndex, rowIndex, false, "internal");
6980
- if (cellElement.column?.editor) {
7304
+ if (wasEditing === true && cellElement.column?.editor) {
6981
7305
  cellElement.startCellEdit();
6982
7306
  if (cellElement.editor?.input) {
6983
7307
  cellElement.editor.input.value = currentValue;
@@ -7038,4 +7362,4 @@ IdsDataGrid = __decorateClass([
7038
7362
  export {
7039
7363
  IdsDataGrid
7040
7364
  };
7041
- //# sourceMappingURL=ids-chunk-UEVOEMEM-full.js.map
7365
+ //# sourceMappingURL=ids-chunk-HZO4QUAW-full.js.map