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.
- package/chunks/ids-chunk-4MSGTAOV-full.js +12 -0
- package/chunks/ids-chunk-4MSGTAOV-full.js.map +7 -0
- package/chunks/{ids-chunk-LZU34NYE-full.js → ids-chunk-CSOF2USI-full.js} +12 -2
- package/chunks/{ids-chunk-LZU34NYE-full.js.map → ids-chunk-CSOF2USI-full.js.map} +2 -2
- package/chunks/{ids-chunk-FW4DOBQU-full.js → ids-chunk-FPEINRXY-full.js} +6 -10
- package/chunks/ids-chunk-FPEINRXY-full.js.map +7 -0
- package/chunks/{ids-chunk-YAFKETSU-full.js → ids-chunk-KL2N6T26-full.js} +366 -38
- package/chunks/ids-chunk-KL2N6T26-full.js.map +7 -0
- package/chunks/{ids-chunk-HGKIZXDQ-full.js → ids-chunk-RLOOHWYV-full.js} +2 -2
- package/components/ids-accordion/ids-accordion.css +9 -93
- package/components/ids-button/ids-button.css +392 -43
- package/components/ids-card/ids-card.css +4 -344
- package/components/ids-data-grid/ids-data-grid-cell.js +1 -1
- package/components/ids-data-grid/ids-data-grid-column.d.ts +1 -0
- package/components/ids-data-grid/ids-data-grid-column.js +7 -0
- package/components/ids-data-grid/ids-data-grid-filters.js +2 -2
- package/components/ids-data-grid/ids-data-grid-row.d.ts +6 -0
- package/components/ids-data-grid/ids-data-grid-row.js +2 -2
- package/components/ids-data-grid/ids-data-grid.d.ts +18 -1
- package/components/ids-data-grid/ids-data-grid.js +5 -4
- package/components/ids-hyperlink/ids-hyperlink.css +188 -15
- package/components/ids-layout-grid/ids-layout-grid.css +10 -21300
- package/components/ids-list-view/ids-list-view.css +112 -15
- package/components/ids-menu/ids-menu.css +11 -17
- package/components/ids-module-nav/ids-module-nav.css +1 -1814
- package/components/ids-pager/ids-pager.css +37 -3
- package/components/ids-swappable/ids-swappable.css +84 -19
- package/components/ids-tabs/ids-tabs.css +4 -342
- package/components/ids-toolbar/ids-toolbar.css +122 -12
- package/custom-elements.json +606 -414
- package/enterprise-wc.all.iife.js +377 -43
- package/enterprise-wc.all.iife.js.map +3 -3
- package/enterprise-wc.js +5 -4
- package/package.json +1 -1
- package/vscode.html-custom-data.json +1 -1
- package/chunks/ids-chunk-FW4DOBQU-full.js.map +0 -7
- package/chunks/ids-chunk-YAFKETSU-full.js.map +0 -7
- /package/chunks/{ids-chunk-HGKIZXDQ-full.js.map → ids-chunk-RLOOHWYV-full.js.map} +0 -0
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./ids-chunk-3BYETIBG-full.js";
|
|
35
35
|
import {
|
|
36
36
|
IdsDataGridFilters
|
|
37
|
-
} from "./ids-chunk-
|
|
37
|
+
} from "./ids-chunk-RLOOHWYV-full.js";
|
|
38
38
|
import {
|
|
39
39
|
IdsDataGridFormatters
|
|
40
40
|
} from "./ids-chunk-34MMRVVB-full.js";
|
|
@@ -43,10 +43,13 @@ import {
|
|
|
43
43
|
} from "./ids-chunk-7IP7SLQZ-full.js";
|
|
44
44
|
import {
|
|
45
45
|
IdsDataGridRow
|
|
46
|
-
} from "./ids-chunk-
|
|
46
|
+
} from "./ids-chunk-CSOF2USI-full.js";
|
|
47
47
|
import {
|
|
48
48
|
IdsDataGridCell
|
|
49
|
-
} from "./ids-chunk-
|
|
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
|
-
|
|
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
|
|
@@ -4766,7 +4847,7 @@ var IdsDataGrid = class extends Base {
|
|
|
4766
4847
|
if (reason === "redraw") {
|
|
4767
4848
|
this.clearActiveCellCache();
|
|
4768
4849
|
} else {
|
|
4769
|
-
this.updateActiveCellCache(rowIndex, cellNumber, currentCell?.value);
|
|
4850
|
+
this.updateActiveCellCache(rowIndex, cellNumber, currentCell?.value, true);
|
|
4770
4851
|
}
|
|
4771
4852
|
let rowNode = this.rowByIndex(rowIndex);
|
|
4772
4853
|
if (!rowNode && this.virtualScroll) {
|
|
@@ -5321,15 +5402,20 @@ var IdsDataGrid = class extends Base {
|
|
|
5321
5402
|
* @param {number} row - The row index
|
|
5322
5403
|
* @param {number} cell - The cell index
|
|
5323
5404
|
* @param {string} cellValue - The current cell value
|
|
5405
|
+
* @param {boolean} isEditing - Whether the cell is currently in edit mode
|
|
5324
5406
|
*/
|
|
5325
|
-
updateActiveCellCache(row, cell, cellValue) {
|
|
5326
|
-
|
|
5407
|
+
updateActiveCellCache(row, cell, cellValue, isEditing) {
|
|
5408
|
+
const cacheUpdate = {
|
|
5327
5409
|
rowIndex: row,
|
|
5328
5410
|
columnIndex: cell,
|
|
5329
5411
|
currentValue: cellValue,
|
|
5330
5412
|
hasLeaveViewport: false,
|
|
5331
5413
|
shouldReinstateCell: true
|
|
5332
|
-
}
|
|
5414
|
+
};
|
|
5415
|
+
if (isEditing !== void 0) {
|
|
5416
|
+
cacheUpdate.wasEditing = isEditing;
|
|
5417
|
+
}
|
|
5418
|
+
__privateSet(this, _activeCellCache, cacheUpdate);
|
|
5333
5419
|
}
|
|
5334
5420
|
/**
|
|
5335
5421
|
* Clears the active cell cache, optionally checking if the cached row is within viewport
|
|
@@ -5820,7 +5906,13 @@ attachKeyboardListeners_fn = function() {
|
|
|
5820
5906
|
if (e.key === "ArrowDown") newRowIndex = 1;
|
|
5821
5907
|
if (e.key === "ArrowRight") newColIndex = 1;
|
|
5822
5908
|
if (e.key === "ArrowLeft") newColIndex = -1;
|
|
5823
|
-
|
|
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
|
+
}
|
|
5824
5916
|
__privateGet(this, _activeCellCache).columnIndex = Math.max(__privateGet(this, _activeCellCache).columnIndex + newColIndex, 0);
|
|
5825
5917
|
requestAnimationTimeout(() => {
|
|
5826
5918
|
__privateMethod(this, _IdsDataGrid_instances, restoreActiveCellAfterScroll_fn).call(this);
|
|
@@ -5836,32 +5928,68 @@ attachKeyboardListeners_fn = function() {
|
|
|
5836
5928
|
if (!activeCell) {
|
|
5837
5929
|
const firstRow = this.rowByIndex(0);
|
|
5838
5930
|
activeCell = firstRow?.cellByIndex(0) ?? null;
|
|
5839
|
-
activeCell
|
|
5931
|
+
activeCell?.activate(false, "keyboard");
|
|
5840
5932
|
}
|
|
5841
5933
|
if (activeCell?.isEditing) return;
|
|
5842
5934
|
e.preventDefault();
|
|
5843
5935
|
e.stopPropagation();
|
|
5844
5936
|
const previousActiveRow = Number(activeCell?.rowIndex || 0);
|
|
5845
|
-
if (key === "ArrowUp")
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
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) {
|
|
5976
|
+
activeCell = this.findNextNavigableCell(activeCell, "left" /* Left */);
|
|
5977
|
+
} else if (key === "ArrowRight" && !e.metaKey) {
|
|
5978
|
+
activeCell = this.findNextNavigableCell(activeCell, "right" /* Right */);
|
|
5979
|
+
} else if (key === "PageUp") {
|
|
5851
5980
|
const columnIndex = activeCell?.columnIndex ?? 0;
|
|
5852
|
-
activeCell =
|
|
5981
|
+
activeCell = this.findCellByLogicalPosition(0, columnIndex);
|
|
5853
5982
|
} else if (key === "PageDown") {
|
|
5854
5983
|
const lastRowIndex = this.data.length - 1;
|
|
5855
|
-
const lastRow = this.rowByIndex(lastRowIndex);
|
|
5856
5984
|
const columnIndex = activeCell?.columnIndex ?? 0;
|
|
5857
|
-
activeCell =
|
|
5985
|
+
activeCell = this.findCellByLogicalPosition(lastRowIndex, columnIndex);
|
|
5858
5986
|
} else if (key === "Home" || key === "ArrowLeft" && e.metaKey) {
|
|
5859
|
-
const
|
|
5860
|
-
activeCell =
|
|
5987
|
+
const currentRowIndex = activeCell?.rowIndex ?? 0;
|
|
5988
|
+
activeCell = this.findCellByLogicalPosition(currentRowIndex, 0);
|
|
5861
5989
|
} else if (key === "End" || key === "ArrowRight" && e.metaKey) {
|
|
5862
|
-
const
|
|
5863
|
-
const lastColumnIndex = this.
|
|
5864
|
-
activeCell =
|
|
5990
|
+
const currentRowIndex = activeCell?.rowIndex ?? 0;
|
|
5991
|
+
const lastColumnIndex = this.visibleColumns.length - 1;
|
|
5992
|
+
activeCell = this.findCellByLogicalPosition(currentRowIndex, lastColumnIndex);
|
|
5865
5993
|
}
|
|
5866
5994
|
const activeRowIndex = activeCell?.rowIndex ?? previousActiveRow;
|
|
5867
5995
|
activeCell?.focus?.();
|
|
@@ -5905,7 +6033,7 @@ attachKeyboardListeners_fn = function() {
|
|
|
5905
6033
|
if (this.openMenu) return;
|
|
5906
6034
|
if (activeCell.isEditing) return;
|
|
5907
6035
|
if (!activeCell.canClose()) return;
|
|
5908
|
-
const row = this.rowByIndex(activeCell.
|
|
6036
|
+
const row = this.rowByIndex(activeCell.rowIndex);
|
|
5909
6037
|
if (!row || row.disabled) return;
|
|
5910
6038
|
const button = activeCell.querySelector("ids-button");
|
|
5911
6039
|
if (button) {
|
|
@@ -5967,8 +6095,44 @@ attachKeyboardListeners_fn = function() {
|
|
|
5967
6095
|
if (!this.isEditable) {
|
|
5968
6096
|
return;
|
|
5969
6097
|
}
|
|
5970
|
-
|
|
6098
|
+
let nextCell = e.shiftKey ? this.activeCell?.node?.cellLeftEditable : this.activeCell?.node?.cellRightEditable;
|
|
6099
|
+
while (nextCell && nextCell.hasAttribute?.("hidden")) {
|
|
6100
|
+
nextCell = e.shiftKey ? nextCell?.cellLeftEditable : nextCell?.cellRightEditable;
|
|
6101
|
+
}
|
|
5971
6102
|
if (!nextCell) {
|
|
6103
|
+
if (!e.shiftKey && this.addNewAtEnd && this.activeCell?.node) {
|
|
6104
|
+
const currentRowIndex = this.activeCell.node.rowIndex;
|
|
6105
|
+
const isLastRow = currentRowIndex === this.data.length - 1;
|
|
6106
|
+
if (isLastRow) {
|
|
6107
|
+
e.stopImmediatePropagation();
|
|
6108
|
+
e.stopPropagation();
|
|
6109
|
+
e.preventDefault();
|
|
6110
|
+
const newRowData = {};
|
|
6111
|
+
this.visibleColumns.forEach((column) => {
|
|
6112
|
+
if (column.field && column.field !== "selectionCheckbox" && column.field !== "selectionRadio") {
|
|
6113
|
+
newRowData[column.field] = "";
|
|
6114
|
+
}
|
|
6115
|
+
});
|
|
6116
|
+
this.addRow(newRowData);
|
|
6117
|
+
requestAnimationFrame(() => {
|
|
6118
|
+
const newRowIndex = this.data.length - 1;
|
|
6119
|
+
const newRow = this.rowByIndex(newRowIndex);
|
|
6120
|
+
if (newRow) {
|
|
6121
|
+
const firstEditableCell = newRow.querySelector(".is-editable:not(.is-readonly):not(.is-disabled)");
|
|
6122
|
+
if (firstEditableCell) {
|
|
6123
|
+
const columnIndex = firstEditableCell.columnIndex;
|
|
6124
|
+
this.setActiveCell(columnIndex, newRowIndex, false, "keyboard");
|
|
6125
|
+
if (this.editNextOnEnterPress) {
|
|
6126
|
+
firstEditableCell.startCellEdit?.();
|
|
6127
|
+
} else {
|
|
6128
|
+
firstEditableCell.focus?.();
|
|
6129
|
+
}
|
|
6130
|
+
}
|
|
6131
|
+
}
|
|
6132
|
+
});
|
|
6133
|
+
return;
|
|
6134
|
+
}
|
|
6135
|
+
}
|
|
5972
6136
|
return;
|
|
5973
6137
|
}
|
|
5974
6138
|
e.stopImmediatePropagation();
|
|
@@ -6000,7 +6164,105 @@ attachKeyboardListeners_fn = function() {
|
|
|
6000
6164
|
}
|
|
6001
6165
|
});
|
|
6002
6166
|
this.offEvent("keydown.body", this.header);
|
|
6003
|
-
this.onEvent("keydown.body", this.header, () => {
|
|
6167
|
+
this.onEvent("keydown.body", this.header, (e) => {
|
|
6168
|
+
const path = eventPath(e);
|
|
6169
|
+
const inFilter = findInPath(path, ".ids-data-grid-header-cell-filter-wrapper");
|
|
6170
|
+
const target = e.target;
|
|
6171
|
+
const isEditable = inFilter || target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target?.isContentEditable || findInPath(path, "ids-input");
|
|
6172
|
+
if (isEditable) {
|
|
6173
|
+
return;
|
|
6174
|
+
}
|
|
6175
|
+
if (e.key === "ArrowUp") {
|
|
6176
|
+
e.preventDefault();
|
|
6177
|
+
e.stopPropagation();
|
|
6178
|
+
return;
|
|
6179
|
+
}
|
|
6180
|
+
if (e.key === "ArrowDown") {
|
|
6181
|
+
e.preventDefault();
|
|
6182
|
+
e.stopPropagation();
|
|
6183
|
+
const focusedHeaderCell = e.target;
|
|
6184
|
+
const columnIndexAttr = focusedHeaderCell.getAttribute("aria-colindex");
|
|
6185
|
+
if (columnIndexAttr) {
|
|
6186
|
+
const columnIndex = parseInt(columnIndexAttr) - 1;
|
|
6187
|
+
const firstRow = this.rowByIndex(0);
|
|
6188
|
+
if (firstRow) {
|
|
6189
|
+
const targetCell = firstRow.cellByIndex(columnIndex);
|
|
6190
|
+
if (targetCell) {
|
|
6191
|
+
this.setActiveCell(columnIndex, 0, false, "keyboard");
|
|
6192
|
+
targetCell.focus();
|
|
6193
|
+
return;
|
|
6194
|
+
}
|
|
6195
|
+
}
|
|
6196
|
+
}
|
|
6197
|
+
}
|
|
6198
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
6199
|
+
const focusedHeaderCell = e.target;
|
|
6200
|
+
const columnIndexAttr = focusedHeaderCell.getAttribute("aria-colindex");
|
|
6201
|
+
if (e.shiftKey && columnIndexAttr) {
|
|
6202
|
+
e.preventDefault();
|
|
6203
|
+
e.stopPropagation();
|
|
6204
|
+
const columnId = focusedHeaderCell.getAttribute("column-id");
|
|
6205
|
+
if (columnId) {
|
|
6206
|
+
const column = this.columnDataById(columnId);
|
|
6207
|
+
if (column && column.resizable) {
|
|
6208
|
+
const RESIZE_INCREMENT = 5;
|
|
6209
|
+
const DEFAULT_COLUMNSIZE = 110;
|
|
6210
|
+
const currentWidth = typeof column.width === "number" ? column.width : DEFAULT_COLUMNSIZE;
|
|
6211
|
+
const proposedWidth = e.key === "ArrowRight" ? currentWidth + RESIZE_INCREMENT : currentWidth - RESIZE_INCREMENT;
|
|
6212
|
+
const minWidth = column.minWidth || DEFAULT_COLUMN_MIN_WIDTH;
|
|
6213
|
+
const maxWidth = column.maxWidth || Number.MAX_SAFE_INTEGER;
|
|
6214
|
+
const newWidth = Math.max(minWidth, Math.min(maxWidth, proposedWidth));
|
|
6215
|
+
if (newWidth !== currentWidth) {
|
|
6216
|
+
this.setColumnWidth(columnId, newWidth);
|
|
6217
|
+
let columnText = this.localeAPI?.translate("ColumnResizeAria");
|
|
6218
|
+
columnText = columnText.replace("{0}", column.name).replace("{1}", newWidth);
|
|
6219
|
+
focusedHeaderCell.setAttribute("aria-label", columnText);
|
|
6220
|
+
}
|
|
6221
|
+
}
|
|
6222
|
+
}
|
|
6223
|
+
return;
|
|
6224
|
+
}
|
|
6225
|
+
e.preventDefault();
|
|
6226
|
+
e.stopPropagation();
|
|
6227
|
+
if (columnIndexAttr) {
|
|
6228
|
+
const currentColumnIndex = parseInt(columnIndexAttr) - 1;
|
|
6229
|
+
const nextColumnIndex = e.key === "ArrowRight" ? currentColumnIndex + 1 : currentColumnIndex - 1;
|
|
6230
|
+
if (nextColumnIndex >= 0 && nextColumnIndex < this.visibleColumns.length) {
|
|
6231
|
+
const nextHeaderCell = this.header?.querySelector(`[aria-colindex="${nextColumnIndex + 1}"][tabindex="0"]`);
|
|
6232
|
+
if (nextHeaderCell) {
|
|
6233
|
+
nextHeaderCell.focus();
|
|
6234
|
+
return;
|
|
6235
|
+
}
|
|
6236
|
+
}
|
|
6237
|
+
}
|
|
6238
|
+
}
|
|
6239
|
+
if (e.key === " " || e.key === "Space") {
|
|
6240
|
+
const focusedHeaderCell = e.target;
|
|
6241
|
+
if (focusedHeaderCell.hasAttribute("tabindex") && focusedHeaderCell.classList.contains("ids-data-grid-header-cell")) {
|
|
6242
|
+
e.preventDefault();
|
|
6243
|
+
e.stopPropagation();
|
|
6244
|
+
const headerCheckbox = focusedHeaderCell.querySelector(".ids-data-grid-checkbox");
|
|
6245
|
+
if (headerCheckbox) {
|
|
6246
|
+
if (headerCheckbox.classList.contains("checked") || headerCheckbox.classList.contains("indeterminate")) {
|
|
6247
|
+
this.deSelectAllRows();
|
|
6248
|
+
} else {
|
|
6249
|
+
this.selectAllRows();
|
|
6250
|
+
}
|
|
6251
|
+
}
|
|
6252
|
+
const columnCheckbox = focusedHeaderCell.querySelector(".ids-checkbox input");
|
|
6253
|
+
if (columnCheckbox) {
|
|
6254
|
+
const checkbox = columnCheckbox;
|
|
6255
|
+
checkbox.checked = !checkbox.checked;
|
|
6256
|
+
const columnIndex = parseInt(focusedHeaderCell.getAttribute("aria-colindex") || "1") - 1;
|
|
6257
|
+
if (checkbox.checked) {
|
|
6258
|
+
this.selectColumn(columnIndex);
|
|
6259
|
+
} else {
|
|
6260
|
+
this.deSelectColumn(columnIndex);
|
|
6261
|
+
}
|
|
6262
|
+
}
|
|
6263
|
+
return;
|
|
6264
|
+
}
|
|
6265
|
+
}
|
|
6004
6266
|
this.activeCell = {};
|
|
6005
6267
|
});
|
|
6006
6268
|
this.offEvent("keydown.body", this);
|
|
@@ -6544,6 +6806,73 @@ scrollRowIntoView_fn = function(rowIndex, doScroll = true) {
|
|
|
6544
6806
|
__privateMethod(this, _IdsDataGrid_instances, restoreEditedCellsAfterScroll_fn).call(this);
|
|
6545
6807
|
}
|
|
6546
6808
|
};
|
|
6809
|
+
/**
|
|
6810
|
+
* Convert data row index to visible row index for tree grids
|
|
6811
|
+
* @param {number} rowIndex - The data row index
|
|
6812
|
+
* @returns {number} The visible row index, or -1 if row is hidden
|
|
6813
|
+
* @private
|
|
6814
|
+
*/
|
|
6815
|
+
getVisibleRowIndex_fn = function(rowIndex) {
|
|
6816
|
+
if (!this.treeGrid) return rowIndex;
|
|
6817
|
+
return this.virtualRows.findIndex((row) => row === this.data[rowIndex]);
|
|
6818
|
+
};
|
|
6819
|
+
/**
|
|
6820
|
+
* Find the next non-hidden row index in the specified direction
|
|
6821
|
+
* @param {number} startRowIndex - The starting data row index
|
|
6822
|
+
* @param {IdsDirection} direction - The navigation direction (Up or Down)
|
|
6823
|
+
* @returns {number} The next non-hidden row index, or -1 if none found
|
|
6824
|
+
* @private
|
|
6825
|
+
*/
|
|
6826
|
+
findNextVisibleRow_fn = function(startRowIndex, direction) {
|
|
6827
|
+
const step = direction === "down" /* Down */ ? 1 : -1;
|
|
6828
|
+
let nextRowIndex = startRowIndex + step;
|
|
6829
|
+
while (nextRowIndex >= 0 && nextRowIndex < this.data.length && this.treeGrid && this.data[nextRowIndex]?.rowHidden) {
|
|
6830
|
+
nextRowIndex += step;
|
|
6831
|
+
}
|
|
6832
|
+
return nextRowIndex >= 0 && nextRowIndex < this.data.length ? nextRowIndex : -1;
|
|
6833
|
+
};
|
|
6834
|
+
/**
|
|
6835
|
+
* Scroll to bring a row into view and activate its cell
|
|
6836
|
+
* @param {number} nextRowIndex - The data row index to bring into view
|
|
6837
|
+
* @param {number} columnIndex - The column index of the cell to activate
|
|
6838
|
+
* @param {IdsDirection} direction - The navigation direction (Up or Down)
|
|
6839
|
+
* @private
|
|
6840
|
+
*/
|
|
6841
|
+
scrollToActivateRow_fn = function(nextRowIndex, columnIndex, direction) {
|
|
6842
|
+
if (nextRowIndex < 0 || nextRowIndex >= this.data.length) return;
|
|
6843
|
+
const visibleRowIndex = __privateMethod(this, _IdsDataGrid_instances, getVisibleRowIndex_fn).call(this, nextRowIndex);
|
|
6844
|
+
if (visibleRowIndex === -1) return;
|
|
6845
|
+
const { ROW_HEIGHT } = this.virtualScrollSettings;
|
|
6846
|
+
const containerHeight = this.container.clientHeight;
|
|
6847
|
+
const headerHeight = this.header?.clientHeight ?? 0;
|
|
6848
|
+
const targetScrollTop = direction === "down" /* Down */ ? (visibleRowIndex + 1) * ROW_HEIGHT - containerHeight + headerHeight : visibleRowIndex * ROW_HEIGHT;
|
|
6849
|
+
this.container.scrollTop = Math.max(targetScrollTop, 0);
|
|
6850
|
+
requestAnimationFrame(() => {
|
|
6851
|
+
const activeCell = this.findCellByLogicalPosition(nextRowIndex, columnIndex);
|
|
6852
|
+
if (activeCell) {
|
|
6853
|
+
activeCell.focus();
|
|
6854
|
+
this.setActiveCell(activeCell.columnIndex, activeCell.rowIndex, false, "keyboard");
|
|
6855
|
+
}
|
|
6856
|
+
});
|
|
6857
|
+
};
|
|
6858
|
+
ensureRowInViewport_fn = function(rowIndex, direction) {
|
|
6859
|
+
if (!this.virtualScroll || !this.container) return;
|
|
6860
|
+
const { ROW_HEIGHT } = this.virtualScrollSettings;
|
|
6861
|
+
const containerHeight = this.container.clientHeight;
|
|
6862
|
+
const headerHeight = this.header?.clientHeight ?? 0;
|
|
6863
|
+
const scrollTop = this.container.scrollTop;
|
|
6864
|
+
const viewportTop = scrollTop;
|
|
6865
|
+
const viewportBottom = scrollTop + containerHeight - headerHeight;
|
|
6866
|
+
const effectiveRowIndex = __privateMethod(this, _IdsDataGrid_instances, getVisibleRowIndex_fn).call(this, rowIndex);
|
|
6867
|
+
if (effectiveRowIndex === -1) return;
|
|
6868
|
+
const rowTop = effectiveRowIndex * ROW_HEIGHT;
|
|
6869
|
+
const rowBottom = rowTop + ROW_HEIGHT;
|
|
6870
|
+
if (direction === "up" /* Up */ && rowTop < viewportTop) {
|
|
6871
|
+
this.container.scrollTop = rowTop;
|
|
6872
|
+
} else if (direction === "down" /* Down */ && rowBottom > viewportBottom) {
|
|
6873
|
+
this.container.scrollTop = rowBottom - containerHeight + headerHeight;
|
|
6874
|
+
}
|
|
6875
|
+
};
|
|
6547
6876
|
setVirtualScrollPaddingBottom_fn = function(settings, totalRows, offsetTop) {
|
|
6548
6877
|
const maxHeight = totalRows * settings.ROW_HEIGHT;
|
|
6549
6878
|
const paddingBottom = maxHeight - settings.MAX_ROWS_IN_DOM * settings.ROW_HEIGHT - offsetTop;
|
|
@@ -6913,7 +7242,7 @@ saveEditedCellsBeforeScroll_fn = function() {
|
|
|
6913
7242
|
editedCells.push(this.activeCell?.node);
|
|
6914
7243
|
const activeCell = this.activeCell.node;
|
|
6915
7244
|
const currentValue = activeCell.editor?.input?.value || "";
|
|
6916
|
-
this.updateActiveCellCache(this.activeCell.row, this.activeCell.cell, currentValue);
|
|
7245
|
+
this.updateActiveCellCache(this.activeCell.row, this.activeCell.cell, currentValue, true);
|
|
6917
7246
|
__privateGet(this, _activeCellCache).shouldReinstateCell = true;
|
|
6918
7247
|
this.commitCellEdit();
|
|
6919
7248
|
}
|
|
@@ -6946,14 +7275,14 @@ saveEditedCellsBeforeScroll_fn = function() {
|
|
|
6946
7275
|
* @private
|
|
6947
7276
|
*/
|
|
6948
7277
|
restoreActiveCellAfterScroll_fn = function() {
|
|
6949
|
-
|
|
6950
|
-
if (!__privateGet(this, _activeCellCache) || !__privateGet(this, _activeCellCache)?.shouldReinstateCell || isHeaderActive) {
|
|
7278
|
+
if (!__privateGet(this, _activeCellCache) || !__privateGet(this, _activeCellCache)?.shouldReinstateCell) {
|
|
6951
7279
|
return;
|
|
6952
7280
|
}
|
|
6953
7281
|
const {
|
|
6954
7282
|
rowIndex,
|
|
6955
7283
|
columnIndex,
|
|
6956
|
-
currentValue
|
|
7284
|
+
currentValue,
|
|
7285
|
+
wasEditing
|
|
6957
7286
|
} = __privateGet(this, _activeCellCache);
|
|
6958
7287
|
if (rowIndex < 0 || rowIndex >= this.data.length || columnIndex < 0 || columnIndex >= this.visibleColumns.length) {
|
|
6959
7288
|
return;
|
|
@@ -6965,7 +7294,9 @@ restoreActiveCellAfterScroll_fn = function() {
|
|
|
6965
7294
|
const scrollTop = this.container?.scrollTop || 0;
|
|
6966
7295
|
const containerHeight = this.container?.clientHeight || 0;
|
|
6967
7296
|
const rowHeight = this.virtualScrollSettings.ROW_HEIGHT;
|
|
6968
|
-
const
|
|
7297
|
+
const effectiveRowIndex = __privateMethod(this, _IdsDataGrid_instances, getVisibleRowIndex_fn).call(this, rowIndex);
|
|
7298
|
+
if (effectiveRowIndex === -1) return;
|
|
7299
|
+
const rowTop = effectiveRowIndex * rowHeight;
|
|
6969
7300
|
const rowBottom = rowTop + rowHeight;
|
|
6970
7301
|
const viewportTop = scrollTop;
|
|
6971
7302
|
const viewportBottom = scrollTop + containerHeight;
|
|
@@ -6974,15 +7305,12 @@ restoreActiveCellAfterScroll_fn = function() {
|
|
|
6974
7305
|
__privateGet(this, _activeCellCache).hasLeaveViewport = true;
|
|
6975
7306
|
return;
|
|
6976
7307
|
}
|
|
6977
|
-
if (!__privateGet(this, _activeCellCache).hasLeaveViewport) {
|
|
6978
|
-
return;
|
|
6979
|
-
}
|
|
6980
7308
|
const cellElement = this.cellByIndex(rowIndex, columnIndex);
|
|
6981
7309
|
if (!cellElement) {
|
|
6982
7310
|
return;
|
|
6983
7311
|
}
|
|
6984
7312
|
this.setActiveCell(columnIndex, rowIndex, false, "internal");
|
|
6985
|
-
if (cellElement.column?.editor) {
|
|
7313
|
+
if (wasEditing === true && cellElement.column?.editor) {
|
|
6986
7314
|
cellElement.startCellEdit();
|
|
6987
7315
|
if (cellElement.editor?.input) {
|
|
6988
7316
|
cellElement.editor.input.value = currentValue;
|
|
@@ -7043,4 +7371,4 @@ IdsDataGrid = __decorateClass([
|
|
|
7043
7371
|
export {
|
|
7044
7372
|
IdsDataGrid
|
|
7045
7373
|
};
|
|
7046
|
-
//# sourceMappingURL=ids-chunk-
|
|
7374
|
+
//# sourceMappingURL=ids-chunk-KL2N6T26-full.js.map
|