@visactor/vtable 1.22.0 → 1.22.2

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 (121) hide show
  1. package/cjs/ListTable.d.ts +1 -0
  2. package/cjs/ListTable.js +26 -6
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/core/BaseTable.d.ts +4 -0
  5. package/cjs/core/BaseTable.js +23 -1
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/core/utils/get-cell-position.d.ts +2 -0
  8. package/cjs/core/utils/get-cell-position.js +29 -2
  9. package/cjs/core/utils/get-cell-position.js.map +1 -1
  10. package/cjs/event/event.d.ts +1 -1
  11. package/cjs/event/event.js +5 -4
  12. package/cjs/event/event.js.map +1 -1
  13. package/cjs/event/helper.js +3 -1
  14. package/cjs/event/helper.js.map +1 -1
  15. package/cjs/event/listener/container-dom.js +3 -3
  16. package/cjs/event/listener/container-dom.js.map +1 -1
  17. package/cjs/event/listener/table-group.js +1 -1
  18. package/cjs/event/listener/table-group.js.map +1 -1
  19. package/cjs/event/scroll.d.ts +1 -1
  20. package/cjs/event/scroll.js +4 -4
  21. package/cjs/event/scroll.js.map +1 -1
  22. package/cjs/index.d.ts +1 -1
  23. package/cjs/index.js +1 -1
  24. package/cjs/index.js.map +1 -1
  25. package/cjs/layout/row-height-map.d.ts +2 -2
  26. package/cjs/layout/row-height-map.js +27 -28
  27. package/cjs/layout/row-height-map.js.map +1 -1
  28. package/cjs/layout/simple-header-layout.js +18 -7
  29. package/cjs/layout/simple-header-layout.js.map +1 -1
  30. package/cjs/plugins/custom-cell-style.js +1 -1
  31. package/cjs/scenegraph/component/cell-mover.js +3 -3
  32. package/cjs/scenegraph/component/cell-mover.js.map +1 -1
  33. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +4 -4
  34. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  35. package/cjs/scenegraph/layout/compute-col-width.js +5 -2
  36. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  37. package/cjs/scenegraph/scenegraph.js +5 -3
  38. package/cjs/scenegraph/scenegraph.js.map +1 -1
  39. package/cjs/state/cell-move/index.d.ts +1 -1
  40. package/cjs/state/cell-move/index.js +24 -15
  41. package/cjs/state/cell-move/index.js.map +1 -1
  42. package/cjs/state/resize/update-resize-column.js +6 -1
  43. package/cjs/state/resize/update-resize-column.js.map +1 -1
  44. package/cjs/state/resize/update-resize-row.js +6 -1
  45. package/cjs/state/resize/update-resize-row.js.map +1 -1
  46. package/cjs/state/state.d.ts +2 -1
  47. package/cjs/state/state.js +7 -5
  48. package/cjs/state/state.js.map +1 -1
  49. package/cjs/tools/debounce.js +3 -3
  50. package/cjs/tools/debounce.js.map +1 -1
  51. package/cjs/tools/helper.d.ts +2 -1
  52. package/cjs/tools/helper.js.map +1 -1
  53. package/cjs/ts-types/base-table.d.ts +5 -1
  54. package/cjs/ts-types/base-table.js.map +1 -1
  55. package/cjs/ts-types/events.d.ts +4 -0
  56. package/cjs/ts-types/events.js.map +1 -1
  57. package/cjs/ts-types/table-engine.d.ts +1 -0
  58. package/cjs/ts-types/table-engine.js.map +1 -1
  59. package/cjs/vrender.js.map +1 -1
  60. package/dist/vtable.js +296 -128
  61. package/dist/vtable.min.js +2 -2
  62. package/es/ListTable.d.ts +1 -0
  63. package/es/ListTable.js +26 -6
  64. package/es/ListTable.js.map +1 -1
  65. package/es/core/BaseTable.d.ts +4 -0
  66. package/es/core/BaseTable.js +24 -2
  67. package/es/core/BaseTable.js.map +1 -1
  68. package/es/core/utils/get-cell-position.d.ts +2 -0
  69. package/es/core/utils/get-cell-position.js +26 -0
  70. package/es/core/utils/get-cell-position.js.map +1 -1
  71. package/es/event/event.d.ts +1 -1
  72. package/es/event/event.js +5 -4
  73. package/es/event/event.js.map +1 -1
  74. package/es/event/helper.js +3 -1
  75. package/es/event/helper.js.map +1 -1
  76. package/es/event/listener/container-dom.js +3 -3
  77. package/es/event/listener/container-dom.js.map +1 -1
  78. package/es/event/listener/table-group.js +1 -1
  79. package/es/event/listener/table-group.js.map +1 -1
  80. package/es/event/scroll.d.ts +1 -1
  81. package/es/event/scroll.js +5 -3
  82. package/es/event/scroll.js.map +1 -1
  83. package/es/index.d.ts +1 -1
  84. package/es/index.js +1 -1
  85. package/es/index.js.map +1 -1
  86. package/es/layout/row-height-map.d.ts +2 -2
  87. package/es/layout/row-height-map.js +27 -28
  88. package/es/layout/row-height-map.js.map +1 -1
  89. package/es/layout/simple-header-layout.js +18 -7
  90. package/es/layout/simple-header-layout.js.map +1 -1
  91. package/es/plugins/custom-cell-style.js +1 -1
  92. package/es/scenegraph/component/cell-mover.js +3 -3
  93. package/es/scenegraph/component/cell-mover.js.map +1 -1
  94. package/es/scenegraph/graphic/contributions/chart-render-helper.js +5 -5
  95. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  96. package/es/scenegraph/layout/compute-col-width.js +5 -2
  97. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  98. package/es/scenegraph/scenegraph.js +5 -3
  99. package/es/scenegraph/scenegraph.js.map +1 -1
  100. package/es/state/cell-move/index.d.ts +1 -1
  101. package/es/state/cell-move/index.js +24 -15
  102. package/es/state/cell-move/index.js.map +1 -1
  103. package/es/state/resize/update-resize-column.js +6 -1
  104. package/es/state/resize/update-resize-column.js.map +1 -1
  105. package/es/state/resize/update-resize-row.js +6 -1
  106. package/es/state/resize/update-resize-row.js.map +1 -1
  107. package/es/state/state.d.ts +2 -1
  108. package/es/state/state.js +7 -5
  109. package/es/state/state.js.map +1 -1
  110. package/es/tools/debounce.js +4 -2
  111. package/es/tools/debounce.js.map +1 -1
  112. package/es/tools/helper.d.ts +2 -1
  113. package/es/tools/helper.js.map +1 -1
  114. package/es/ts-types/base-table.d.ts +5 -1
  115. package/es/ts-types/base-table.js.map +1 -1
  116. package/es/ts-types/events.d.ts +4 -0
  117. package/es/ts-types/events.js.map +1 -1
  118. package/es/ts-types/table-engine.d.ts +1 -0
  119. package/es/ts-types/table-engine.js.map +1 -1
  120. package/es/vrender.js.map +1 -1
  121. package/package.json +8 -8
package/dist/vtable.js CHANGED
@@ -24496,12 +24496,12 @@
24496
24496
  const parsedParams = this.parseParams(params, isTimeline);
24497
24497
  return animate = isTimeline ? this.executeTimelineItem(parsedParams, graphic, index, count) : this.executeTypeConfigItem(parsedParams, graphic, index, count), animate && this._trackAnimation(animate), animate;
24498
24498
  }
24499
- stop(type) {
24499
+ stop(type, callEnd = !0) {
24500
24500
  for (; this._animates.length > 0;) {
24501
24501
  const animate = this._animates.pop();
24502
- null == animate || animate.stop(type);
24502
+ !1 === callEnd && (animate.status = AnimateStatus.END), null == animate || animate.stop(type);
24503
24503
  }
24504
- this._animates = [], this._activeCount = 0, this._started && (this._started = !1, this.onEnd());
24504
+ this._animates = [], this._activeCount = 0, this._started && (this._started = !1, callEnd && this.onEnd());
24505
24505
  }
24506
24506
  }
24507
24507
  AnimateExecutor.builtInAnimateMap = {};
@@ -24561,7 +24561,7 @@
24561
24561
  executor: new AnimateExecutor(this.graphic)
24562
24562
  });
24563
24563
  }), shouldStopState.forEach(state => {
24564
- state.executor.stop();
24564
+ state.executor.stop(null, !1);
24565
24565
  }), shouldApplyState.length) {
24566
24566
  shouldApplyState[0].executor.execute(shouldApplyState[0].animationConfig);
24567
24567
  for (let i = 0; i < shouldApplyState.length; i++) {
@@ -24612,7 +24612,7 @@
24612
24612
  clearState() {
24613
24613
  var _a;
24614
24614
  null === (_a = this.stateList) || void 0 === _a || _a.forEach(state => {
24615
- state.executor.stop();
24615
+ state.executor.stop(null, !1);
24616
24616
  }), this.stateList = null;
24617
24617
  }
24618
24618
  reApplyState(state) {
@@ -36386,7 +36386,7 @@
36386
36386
  let maxing = false;
36387
36387
  let leading = false;
36388
36388
  let trailing = true;
36389
- const useRAF = !wait && wait !== 0 && typeof requestAnimationFrame === 'function';
36389
+ const useRAF = !wait && wait !== 0 && typeof vglobal.getRequestAnimationFrame() === 'function';
36390
36390
  if (typeof func !== 'function') {
36391
36391
  throw new TypeError('Expected a function');
36392
36392
  }
@@ -36410,7 +36410,7 @@
36410
36410
  }
36411
36411
  function startTimer(pendingFunc, wait) {
36412
36412
  if (useRAF) {
36413
- return requestAnimationFrame(pendingFunc);
36413
+ return vglobal.getRequestAnimationFrame()(pendingFunc);
36414
36414
  }
36415
36415
  return setTimeout(pendingFunc, wait);
36416
36416
  }
@@ -47543,7 +47543,8 @@
47543
47543
  let symbolY = 0;
47544
47544
  let symbolRotate = Math.PI;
47545
47545
  const linePoints = [];
47546
- if (cellLocation === 'columnHeader') {
47546
+ const movingColumnOrRow = this.table.stateManager.columnMove.movingColumnOrRow;
47547
+ if ((cellLocation === 'columnHeader' && movingColumnOrRow === undefined) || movingColumnOrRow === 'column') {
47547
47548
  rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos;
47548
47549
  rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1);
47549
47550
  rectHeight = this.table.tableNoFrameHeight;
@@ -47560,7 +47561,8 @@
47560
47561
  linePoints.push({ x: 0, y: this.table.tableNoFrameHeight });
47561
47562
  }
47562
47563
  else if (cellLocation === 'rowHeader' ||
47563
- this.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) {
47564
+ this.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) ||
47565
+ movingColumnOrRow === 'row') {
47564
47566
  rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos;
47565
47567
  rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1);
47566
47568
  rectWidth = this.table.tableNoFrameWidth;
@@ -49014,7 +49016,7 @@
49014
49016
  chartRenderKeys = [];
49015
49017
  chartRenderQueueList = [];
49016
49018
  isHandlingChartQueue = false;
49017
- cancelAnimationFrame(requestAnimationFrameId);
49019
+ vglobal.getCancelAnimationFrame()(requestAnimationFrameId);
49018
49020
  }
49019
49021
  function IsHandlingChartQueue() {
49020
49022
  return isHandlingChartQueue;
@@ -49083,6 +49085,7 @@
49083
49085
  });
49084
49086
  table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
49085
49087
  if (typeof dataId === 'string') {
49088
+ chartInstance.getChart().setLayoutTag(true);
49086
49089
  chartInstance.updateDataSync(dataId, data ?? []);
49087
49090
  }
49088
49091
  else {
@@ -49107,6 +49110,7 @@
49107
49110
  : data ?? []);
49108
49111
  }
49109
49112
  }
49113
+ chartInstance.getChart().setLayoutTag(true);
49110
49114
  chartInstance.updateFullDataSync?.(dataBatch);
49111
49115
  }
49112
49116
  }
@@ -49117,7 +49121,7 @@
49117
49121
  function startRenderChartQueue(table) {
49118
49122
  isHandlingChartQueue = true;
49119
49123
  if (chartRenderQueueList.length > 0) {
49120
- requestAnimationFrameId = requestAnimationFrame(() => {
49124
+ requestAnimationFrameId = vglobal.getRequestAnimationFrame()(() => {
49121
49125
  const chartsToRender = chartRenderQueueList.splice(0, batchRenderChartCount);
49122
49126
  chartRenderKeys.splice(0, batchRenderChartCount);
49123
49127
  chartsToRender.forEach(chart => {
@@ -50744,15 +50748,20 @@
50744
50748
  let actualWidth = 0;
50745
50749
  for (let col = 0; col < table.colCount; col++) {
50746
50750
  const colWidth = update ? newWidths[col] ?? table.getColWidth(col) : table.getColWidth(col);
50747
- if (col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount ||
50748
- (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)) {
50751
+ if (table.widthAdaptiveMode === 'only-body' &&
50752
+ (col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount ||
50753
+ (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount))) {
50749
50754
  actualHeaderWidth += colWidth;
50750
50755
  }
50751
50756
  actualWidth += colWidth;
50752
50757
  }
50753
50758
  if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
50754
- const startCol = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount;
50755
- const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
50759
+ let startCol = 0;
50760
+ let endCol = table.colCount;
50761
+ if (table.widthAdaptiveMode === 'only-body') {
50762
+ startCol = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount;
50763
+ endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
50764
+ }
50756
50765
  getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);
50757
50766
  }
50758
50767
  }
@@ -57215,15 +57224,20 @@
57215
57224
  let actualWidth = 0;
57216
57225
  for (let col = 0; col < table.colCount; col++) {
57217
57226
  const colWidth = table.getColWidth(col);
57218
- if (col < table.rowHeaderLevelCount ||
57219
- (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)) {
57227
+ if (table.widthAdaptiveMode === 'only-body' &&
57228
+ (col < table.rowHeaderLevelCount ||
57229
+ (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount))) {
57220
57230
  actualHeaderWidth += colWidth;
57221
57231
  }
57222
57232
  actualWidth += colWidth;
57223
57233
  }
57224
57234
  if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
57225
- const startCol = table.rowHeaderLevelCount;
57226
- const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
57235
+ let startCol = 0;
57236
+ let endCol = table.colCount;
57237
+ if (table.widthAdaptiveMode === 'only-body') {
57238
+ startCol = table.rowHeaderLevelCount;
57239
+ endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
57240
+ }
57227
57241
  getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, false, [], table, true);
57228
57242
  }
57229
57243
  }
@@ -58719,10 +58733,11 @@
58719
58733
  return target;
58720
58734
  }
58721
58735
 
58722
- function startMoveCol(col, row, x, y, state, event) {
58736
+ function startMoveCol(col, row, x, y, state, event, dragColumnOrRow) {
58723
58737
  if (!('canMoveHeaderPosition' in state.table.internalProps.layoutMap)) {
58724
58738
  return;
58725
58739
  }
58740
+ state.columnMove.movingColumnOrRow = dragColumnOrRow;
58726
58741
  state.columnMove.moving = true;
58727
58742
  state.columnMove.colSource = col;
58728
58743
  state.columnMove.rowSource = row;
@@ -58734,13 +58749,23 @@
58734
58749
  }
58735
58750
  state.columnMove.x = x - state.table.tableX;
58736
58751
  state.columnMove.y = y - state.table.tableY;
58737
- const cellLocation = state.table.getCellLocation(col, row);
58738
- const delta = cellLocation === 'columnHeader'
58739
- ? state.columnMove.x
58740
- : cellLocation === 'rowHeader' ||
58741
- state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)
58742
- ? state.columnMove.y
58743
- : 0;
58752
+ let delta;
58753
+ if (dragColumnOrRow === 'column') {
58754
+ delta = state.columnMove.x;
58755
+ }
58756
+ else if (dragColumnOrRow === 'row') {
58757
+ delta = state.columnMove.y;
58758
+ }
58759
+ else {
58760
+ const cellLocation = state.table.getCellLocation(col, row);
58761
+ delta =
58762
+ cellLocation === 'columnHeader'
58763
+ ? state.columnMove.x
58764
+ : cellLocation === 'rowHeader' ||
58765
+ state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)
58766
+ ? state.columnMove.y
58767
+ : 0;
58768
+ }
58744
58769
  const { backX, lineX, backY, lineY } = state.table.scenegraph.component.showMoveCol(col, row, delta);
58745
58770
  state.table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START, {
58746
58771
  col,
@@ -58751,7 +58776,8 @@
58751
58776
  lineX,
58752
58777
  backY,
58753
58778
  lineY,
58754
- event
58779
+ event,
58780
+ movingColumnOrRow: dragColumnOrRow
58755
58781
  });
58756
58782
  const isHasSelected = !!state.select.ranges?.length;
58757
58783
  state.table.stateManager.updateSelectPos(-1, -1);
@@ -58806,7 +58832,8 @@
58806
58832
  }
58807
58833
  }
58808
58834
  else if (cellLocation === 'rowHeader' ||
58809
- state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) {
58835
+ state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) ||
58836
+ state.columnMove.movingColumnOrRow === 'row') {
58810
58837
  backY = state.columnMove.y;
58811
58838
  if (state.table.isFrozenRow(row)) {
58812
58839
  lineY =
@@ -58836,7 +58863,8 @@
58836
58863
  lineX,
58837
58864
  backY,
58838
58865
  lineY,
58839
- event
58866
+ event,
58867
+ movingColumnOrRow: state.columnMove.movingColumnOrRow
58840
58868
  });
58841
58869
  state.table.scenegraph.updateNextFrame();
58842
58870
  }
@@ -58845,10 +58873,10 @@
58845
58873
  let moveColResult = false;
58846
58874
  if ('canMoveHeaderPosition' in state.table.internalProps.layoutMap &&
58847
58875
  state.columnMove.moving &&
58848
- state.columnMove.colSource >= 0 &&
58849
- state.columnMove.rowSource >= 0 &&
58850
- state.columnMove.colTarget >= 0 &&
58851
- state.columnMove.rowTarget >= 0 &&
58876
+ (state.columnMove.colSource >= 0 || state.columnMove.movingColumnOrRow === 'row') &&
58877
+ (state.columnMove.rowSource >= 0 || state.columnMove.movingColumnOrRow === 'column') &&
58878
+ (state.columnMove.colTarget >= 0 || state.columnMove.movingColumnOrRow === 'row') &&
58879
+ (state.columnMove.rowTarget >= 0 || state.columnMove.movingColumnOrRow === 'column') &&
58852
58880
  state.table.options.customConfig?.notUpdateInColumnRowMove !== true) {
58853
58881
  const oldSourceMergeInfo = state.table.getCellRange(state.columnMove.colSource, state.columnMove.rowSource);
58854
58882
  const oldTargetMergeInfo = state.table.getCellRange(state.columnMove.colTarget, state.columnMove.rowTarget);
@@ -58872,7 +58900,8 @@
58872
58900
  }
58873
58901
  }
58874
58902
  if (!state.table.transpose &&
58875
- state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource)) {
58903
+ (state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) ||
58904
+ state.columnMove.movingColumnOrRow === 'row')) {
58876
58905
  state.table.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex);
58877
58906
  state.changeCheckboxAndRadioOrder(moveContext.sourceIndex, moveContext.targetIndex);
58878
58907
  }
@@ -58883,7 +58912,8 @@
58883
58912
  clearWidthsAndHeightsCache(0, -1, rowMin, rowMax, state.table);
58884
58913
  }
58885
58914
  state.table.clearCellStyleCache();
58886
- if (state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource)) {
58915
+ if (state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) ||
58916
+ state.columnMove.movingColumnOrRow === 'row') {
58887
58917
  state.table.scenegraph.updateHeaderPosition(state.table.scenegraph.proxy.colStart, state.table.scenegraph.proxy.colEnd, state.table.scenegraph.proxy.rowStart, state.table.scenegraph.proxy.rowEnd, moveContext.moveType);
58888
58918
  }
58889
58919
  else if (moveContext.moveType === 'column') {
@@ -58919,10 +58949,13 @@
58919
58949
  else {
58920
58950
  state.updateCursor();
58921
58951
  state.columnMove.moving = false;
58922
- delete state.columnMove.colSource;
58923
- delete state.columnMove.rowSource;
58924
- delete state.columnMove.colTarget;
58925
- delete state.columnMove.rowTarget;
58952
+ setTimeout(() => {
58953
+ delete state.columnMove.colSource;
58954
+ delete state.columnMove.rowSource;
58955
+ delete state.columnMove.colTarget;
58956
+ delete state.columnMove.rowTarget;
58957
+ state.columnMove.movingColumnOrRow = undefined;
58958
+ }, 0);
58926
58959
  state.table.scenegraph.component.hideMoveCol();
58927
58960
  state.table.scenegraph.updateNextFrame();
58928
58961
  return false;
@@ -58934,6 +58967,7 @@
58934
58967
  delete state.columnMove.rowSource;
58935
58968
  delete state.columnMove.colTarget;
58936
58969
  delete state.columnMove.rowTarget;
58970
+ state.columnMove.movingColumnOrRow = undefined;
58937
58971
  }, 0);
58938
58972
  state.table.scenegraph.component.hideMoveCol();
58939
58973
  if (state.columnResize.col < state.table.frozenColCount &&
@@ -59077,6 +59111,15 @@
59077
59111
  state.columnResize.x = xInTable;
59078
59112
  state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen);
59079
59113
  state.table._updateSize();
59114
+ state.table.internalProps.legends?.forEach(legend => {
59115
+ legend?.resize();
59116
+ });
59117
+ if (state.table.internalProps.title) {
59118
+ state.table.internalProps.title.resize();
59119
+ }
59120
+ if (state.table.internalProps.emptyTip) {
59121
+ state.table.internalProps.emptyTip.resize();
59122
+ }
59080
59123
  if (state.columnResize.col < state.table.frozenColCount &&
59081
59124
  !state.table.isPivotTable() &&
59082
59125
  !state.table.transpose) {
@@ -59736,6 +59779,15 @@
59736
59779
  state.rowResize.y = yInTable;
59737
59780
  state.table.scenegraph.component.updateResizeRow(state.rowResize.row, xInTable, state.rowResize.isBottomFrozen);
59738
59781
  state.table._updateSize();
59782
+ state.table.internalProps.legends?.forEach(legend => {
59783
+ legend?.resize();
59784
+ });
59785
+ if (state.table.internalProps.title) {
59786
+ state.table.internalProps.title.resize();
59787
+ }
59788
+ if (state.table.internalProps.emptyTip) {
59789
+ state.table.internalProps.emptyTip.resize();
59790
+ }
59739
59791
  state.table.scenegraph.updateNextFrame();
59740
59792
  }
59741
59793
  function updateResizeColForRow(detaY, state) {
@@ -60020,7 +60072,8 @@
60020
60072
  rowTargetSize: 0,
60021
60073
  x: 0,
60022
60074
  y: 0,
60023
- moving: false
60075
+ moving: false,
60076
+ movingColumnOrRow: undefined
60024
60077
  };
60025
60078
  this.menu = {
60026
60079
  x: -1,
@@ -60102,7 +60155,8 @@
60102
60155
  rowTargetSize: 0,
60103
60156
  x: 0,
60104
60157
  y: 0,
60105
- moving: false
60158
+ moving: false,
60159
+ movingColumnOrRow: undefined
60106
60160
  };
60107
60161
  this.menu = {
60108
60162
  x: -1,
@@ -60392,7 +60446,8 @@
60392
60446
  }
60393
60447
  const currentRange = this.select.ranges[this.select.ranges.length - 1];
60394
60448
  if (!this.table.isSeriesNumber(this.select.cellPos.col, this.select.cellPos.row) &&
60395
- !this.table.isHeader(this.select.cellPos.col, this.select.cellPos.row)) {
60449
+ !this.table.isHeader(this.select.cellPos.col, this.select.cellPos.row) &&
60450
+ !this.table.isSeriesNumberInBody(currentRange.start.col, currentRange.start.row)) {
60396
60451
  expendCellRange(currentRange, this.table);
60397
60452
  }
60398
60453
  let isSame = false;
@@ -60501,8 +60556,8 @@
60501
60556
  this.fillHandle.beforeFillMinCol = undefined;
60502
60557
  this.fillHandle.beforeFillMinRow = undefined;
60503
60558
  }
60504
- startMoveCol(col, row, x, y, event) {
60505
- startMoveCol(col, row, x, y, this, event);
60559
+ startMoveCol(col, row, x, y, event, dragColumnOrRow) {
60560
+ startMoveCol(col, row, x, y, this, event, dragColumnOrRow);
60506
60561
  }
60507
60562
  updateMoveCol(col, row, x, y, event) {
60508
60563
  updateMoveCol(col, row, x, y, this, event);
@@ -61501,7 +61556,7 @@
61501
61556
  this.speedY = speedY;
61502
61557
  this.friction = friction;
61503
61558
  if (!this.runingId) {
61504
- this.runingId = requestAnimationFrame(this.inertia.bind(this));
61559
+ this.runingId = vglobal.getRequestAnimationFrame()(this.inertia.bind(this));
61505
61560
  }
61506
61561
  }
61507
61562
  inertia() {
@@ -61529,10 +61584,10 @@
61529
61584
  this.lastTime = now;
61530
61585
  this.speedX = newSpeedX;
61531
61586
  this.speedY = newSpeedY;
61532
- this.runingId = requestAnimationFrame(this.inertia.bind(this));
61587
+ this.runingId = vglobal.getRequestAnimationFrame()(this.inertia.bind(this));
61533
61588
  }
61534
61589
  endInertia() {
61535
- cancelAnimationFrame(this.runingId);
61590
+ vglobal.getCancelAnimationFrame()(this.runingId);
61536
61591
  this.runingId = null;
61537
61592
  }
61538
61593
  isInertiaScrolling() {
@@ -61547,7 +61602,7 @@
61547
61602
  table.stateManager.columnMove?.colTarget !== -1 &&
61548
61603
  table.stateManager.columnMove?.rowTarget !== -1) {
61549
61604
  if (table.hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {
61550
- const { colSource, rowSource, colTarget, rowTarget } = table.stateManager.columnMove;
61605
+ const { colSource, rowSource, colTarget, rowTarget, movingColumnOrRow } = table.stateManager.columnMove;
61551
61606
  const rowSourceSize = table.stateManager.columnMove.rowSourceSize ?? 0;
61552
61607
  const rowTargetSize = table.stateManager.columnMove.rowTargetSize ?? 0;
61553
61608
  table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {
@@ -61556,6 +61611,7 @@
61556
61611
  col: colSource,
61557
61612
  row: rowSource
61558
61613
  },
61614
+ movingColumnOrRow,
61559
61615
  event: e
61560
61616
  });
61561
61617
  }
@@ -61573,6 +61629,7 @@
61573
61629
  col: table.stateManager.columnMove.colSource,
61574
61630
  row: table.stateManager.columnMove.rowSource
61575
61631
  },
61632
+ movingColumnOrRow: table.stateManager.columnMove.movingColumnOrRow,
61576
61633
  event: e
61577
61634
  });
61578
61635
  }
@@ -61605,9 +61662,7 @@
61605
61662
  if (stateManager.interactionState === InteractionState.grabing) {
61606
61663
  if (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1) {
61607
61664
  if (stateManager.isResizeCol() || stateManager.isResizeRow()) ;
61608
- else if (stateManager.isMoveCol()) {
61609
- eventManager.dealColumnMover(eventArgsSet);
61610
- }
61665
+ else if (stateManager.isMoveCol()) ;
61611
61666
  else if (stateManager.isFillHandle()) {
61612
61667
  eventManager.dealFillSelect(eventArgsSet, true);
61613
61668
  }
@@ -62814,7 +62869,10 @@
62814
62869
  if (e.width === 0 && e.height === 0) {
62815
62870
  return;
62816
62871
  }
62817
- if (table.autoFillWidth || table.autoFillHeight) {
62872
+ if (table.autoFillWidth ||
62873
+ table.autoFillHeight ||
62874
+ table.widthMode === 'adaptive' ||
62875
+ table.heightMode === 'adaptive') {
62818
62876
  table.editorManager?.completeEdit();
62819
62877
  }
62820
62878
  if (!isValid$3(table.options.pixelRatio)) {
@@ -62960,6 +63018,9 @@
62960
63018
  });
62961
63019
  }
62962
63020
  }
63021
+ else if (stateManager.isMoveCol()) {
63022
+ eventManager.dealColumnMover(x, y, e);
63023
+ }
62963
63024
  }
62964
63025
  const isSelecting = table.stateManager.isSelecting();
62965
63026
  if (eventManager._enableTableScroll &&
@@ -63993,10 +64054,17 @@
63993
64054
  }
63994
64055
  return false;
63995
64056
  }
63996
- dealColumnMover(eventArgsSet) {
63997
- const { eventArgs } = eventArgsSet;
63998
- if (isValid$3(eventArgs.col) && isValid$3(eventArgs.row)) {
63999
- this.table.stateManager.updateMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgs?.event?.nativeEvent);
64057
+ dealColumnMover(x, y, event) {
64058
+ let col = this.table.getColAtRelativePosition(x);
64059
+ let row = this.table.getRowAtRelativePosition(y);
64060
+ if (col === -1 && this.table.stateManager.columnMove.movingColumnOrRow === 'row') {
64061
+ col = 0;
64062
+ }
64063
+ if (row === -1 && this.table.stateManager.columnMove.movingColumnOrRow === 'column') {
64064
+ row = 0;
64065
+ }
64066
+ if (isValid$3(col) && isValid$3(row)) {
64067
+ this.table.stateManager.updateMoveCol(col, row, x, y, event);
64000
64068
  }
64001
64069
  }
64002
64070
  startColumnResize(eventArgsSet) {
@@ -66267,7 +66335,7 @@
66267
66335
  this.cumulativeSum.clear();
66268
66336
  this.difference.clear();
66269
66337
  }
66270
- add(position, value) {
66338
+ _add(position, value) {
66271
66339
  if (!isValid$3(value)) {
66272
66340
  return;
66273
66341
  }
@@ -66280,7 +66348,7 @@
66280
66348
  this.totalSum += value;
66281
66349
  this.updateDifference(position, value - defaultValue);
66282
66350
  }
66283
- remove(position) {
66351
+ _remove(position) {
66284
66352
  if (this.data.has(position)) {
66285
66353
  const value = this.data.get(position);
66286
66354
  this.data.delete(position);
@@ -66308,7 +66376,7 @@
66308
66376
  this.updateDifference(position, difference);
66309
66377
  }
66310
66378
  else {
66311
- this.add(position, newValue);
66379
+ this._add(position, newValue);
66312
66380
  }
66313
66381
  }
66314
66382
  get(position) {
@@ -66418,10 +66486,19 @@
66418
66486
  this.cumulativeSum.delete(i);
66419
66487
  }
66420
66488
  const lastIndex = this.getLastIndex() + 1;
66421
- this.adjustOrder(position, position + 1, lastIndex - position);
66489
+ const values = [];
66490
+ for (let i = position; i <= lastIndex; i++) {
66491
+ if (this.has(i)) {
66492
+ values.push({ position: i, value: this.get(i) });
66493
+ this._remove(i);
66494
+ }
66495
+ }
66422
66496
  if (isValid$3(value)) {
66423
66497
  this.put(position, value);
66424
66498
  }
66499
+ for (const { position, value } of values) {
66500
+ this.put(position + 1, value);
66501
+ }
66425
66502
  }
66426
66503
  getLastIndex() {
66427
66504
  this._sort();
@@ -66429,18 +66506,26 @@
66429
66506
  }
66430
66507
  delLast() {
66431
66508
  const lastIndex = this.getLastIndex();
66432
- this.remove(lastIndex);
66509
+ this._remove(lastIndex);
66433
66510
  }
66434
66511
  delete(position) {
66435
- if (!this.has(position)) {
66436
- return;
66437
- }
66438
66512
  for (let i = position; i <= this.getLastIndex(); i++) {
66439
66513
  this.cumulativeSum.delete(i);
66440
66514
  }
66441
66515
  const lastIndex = this.getLastIndex();
66442
- this.adjustOrder(position + 1, position, lastIndex - position);
66443
- this.delLast();
66516
+ if (this.has(position)) {
66517
+ this._remove(position);
66518
+ }
66519
+ const values = [];
66520
+ for (let i = position + 1; i <= lastIndex; i++) {
66521
+ if (this.has(i)) {
66522
+ values.push({ position: i, value: this.get(i) });
66523
+ }
66524
+ }
66525
+ for (const { position, value } of values) {
66526
+ this._remove(position);
66527
+ this._add(position - 1, value);
66528
+ }
66444
66529
  }
66445
66530
  adjustOrder(sourceIndex, targetIndex, moveCount) {
66446
66531
  this.clearRange();
@@ -66485,56 +66570,13 @@
66485
66570
  }
66486
66571
  }
66487
66572
  exchangeOrder(sourceIndex, sourceCount, targetIndex, targetCount, insertIndex) {
66488
- const { _keys: keys } = this;
66489
- if (!this._sorted) {
66490
- keys.sort((a, b) => {
66491
- if (a < b) {
66492
- return -1;
66493
- }
66494
- if (a > b) {
66495
- return 1;
66496
- }
66497
- return 0;
66498
- });
66499
- this._sorted = true;
66500
- }
66501
- if (sourceIndex > targetIndex) {
66502
- const targetVals = [];
66503
- const sourceVals = [];
66504
- for (let i = indexFirst(keys, targetIndex); i < indexFirst(keys, sourceIndex) + sourceCount; i++) {
66505
- const key = keys[i];
66506
- if (key >= sourceIndex && key < sourceIndex + sourceCount) {
66507
- sourceVals.push(this.get(key));
66508
- }
66509
- else {
66510
- targetVals.push(this.get(key));
66511
- }
66512
- }
66513
- for (let i = 0; i < sourceCount; i++) {
66514
- this.put(insertIndex + i, sourceVals[i]);
66515
- }
66516
- for (let i = 0; i < targetVals.length; i++) {
66517
- this.put(insertIndex + sourceCount + i, targetVals[i]);
66518
- }
66573
+ const values = [];
66574
+ for (let i = sourceIndex + sourceCount - 1; i >= sourceIndex; i--) {
66575
+ values.push({ position: i, value: this.get(i) });
66576
+ this.delete(i);
66519
66577
  }
66520
- else {
66521
- const targetVals = [];
66522
- const sourceVals = [];
66523
- for (let i = indexFirst(keys, sourceIndex); i < indexFirst(keys, targetIndex) + targetCount; i++) {
66524
- const key = keys[i];
66525
- if (key >= sourceIndex && key < sourceIndex + sourceCount) {
66526
- sourceVals.push(this.get(key));
66527
- }
66528
- else {
66529
- targetVals.push(this.get(key));
66530
- }
66531
- }
66532
- for (let i = 0; i < sourceCount; i++) {
66533
- this.put(insertIndex + i, sourceVals[i]);
66534
- }
66535
- for (let i = 0; i < targetVals.length; i++) {
66536
- this.put(sourceIndex + i, targetVals[i]);
66537
- }
66578
+ for (let i = 0; i < sourceCount; i++) {
66579
+ this.insert(insertIndex, values[i].value);
66538
66580
  }
66539
66581
  }
66540
66582
  }
@@ -66553,7 +66595,11 @@
66553
66595
  low = i + 1;
66554
66596
  }
66555
66597
  }
66556
- return high < 0 ? 0 : high;
66598
+ const tempI = high < 0 ? 0 : high;
66599
+ if (arr[tempI] === elm) {
66600
+ return tempI;
66601
+ }
66602
+ return -1;
66557
66603
  }
66558
66604
 
66559
66605
  class RowSeriesNumberHelper {
@@ -67736,6 +67782,44 @@
67736
67782
  }
67737
67783
  return { col: -1, row: -1 };
67738
67784
  }
67785
+ function getColAtRelativePosition(x, _this) {
67786
+ x -= _this.tableX;
67787
+ let leftFrozen = false;
67788
+ if (x > 0 && x < _this.getFrozenColsWidth()) {
67789
+ leftFrozen = true;
67790
+ }
67791
+ let rightFrozen = false;
67792
+ if (x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() &&
67793
+ x < _this.tableNoFrameWidth &&
67794
+ x <= _this.getAllColsWidth()) {
67795
+ rightFrozen = true;
67796
+ }
67797
+ const colInfo = getTargetColAtConsiderRightFrozen((leftFrozen || rightFrozen ? x : x + _this.scrollLeft) + _this.tableX, rightFrozen, _this);
67798
+ if (colInfo) {
67799
+ const { col } = colInfo;
67800
+ return col;
67801
+ }
67802
+ return -1;
67803
+ }
67804
+ function getRowAtRelativePosition(y, _this) {
67805
+ y -= _this.tableY;
67806
+ let topFrozen = false;
67807
+ if (y > 0 && y < _this.getFrozenRowsHeight()) {
67808
+ topFrozen = true;
67809
+ }
67810
+ let bottomFrozen = false;
67811
+ if (y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() &&
67812
+ y < _this.tableNoFrameHeight &&
67813
+ y <= _this.getAllRowsHeight()) {
67814
+ bottomFrozen = true;
67815
+ }
67816
+ const rowInfo = getTargetRowAtConsiderBottomFrozen((topFrozen || bottomFrozen ? y : y + _this.scrollTop) + _this.tableY, bottomFrozen, _this);
67817
+ if (rowInfo) {
67818
+ const { row } = rowInfo;
67819
+ return row;
67820
+ }
67821
+ return -1;
67822
+ }
67739
67823
 
67740
67824
  function isValidAlignDomain(domain) {
67741
67825
  return domain.length === 2 && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -69175,7 +69259,7 @@
69175
69259
  return TABLE_EVENT_TYPE;
69176
69260
  }
69177
69261
  options;
69178
- version = "1.22.0";
69262
+ version = "1.22.2";
69179
69263
  pagination;
69180
69264
  id = `VTable${Date.now()}`;
69181
69265
  headerStyleCache;
@@ -70533,6 +70617,12 @@
70533
70617
  getCellAtRelativePosition(relativeX, relativeY) {
70534
70618
  return getCellAtRelativePosition(relativeX, relativeY, this);
70535
70619
  }
70620
+ getColAtRelativePosition(relativeX) {
70621
+ return getColAtRelativePosition(relativeX, this);
70622
+ }
70623
+ getRowAtRelativePosition(relativeY) {
70624
+ return getRowAtRelativePosition(relativeY, this);
70625
+ }
70536
70626
  _checkRowCol(col, row) {
70537
70627
  if (col >= 0 && col < this.colCount && row >= 0 && row < this.rowCount) {
70538
70628
  return true;
@@ -72375,6 +72465,32 @@
72375
72465
  this._containerFit = { width: false, height: false };
72376
72466
  }
72377
72467
  }
72468
+ isColumnSelected(col) {
72469
+ const selectRange = this.stateManager.select.ranges;
72470
+ for (let i = 0; i <= selectRange.length - 1; i++) {
72471
+ const range = selectRange[i];
72472
+ if (range.start.col <= col &&
72473
+ range.end.col >= col &&
72474
+ range.start.row === 0 &&
72475
+ range.end.row === this.rowCount - 1) {
72476
+ return true;
72477
+ }
72478
+ }
72479
+ return false;
72480
+ }
72481
+ isRowSelected(row) {
72482
+ const selectRange = this.stateManager.select.ranges;
72483
+ for (let i = 0; i <= selectRange.length - 1; i++) {
72484
+ const range = selectRange[i];
72485
+ if (range.start.row <= row &&
72486
+ range.end.row >= row &&
72487
+ range.start.col === 0 &&
72488
+ range.end.col === this.colCount - 1) {
72489
+ return true;
72490
+ }
72491
+ }
72492
+ return false;
72493
+ }
72378
72494
  }
72379
72495
 
72380
72496
  var core = /*#__PURE__*/Object.freeze({
@@ -75347,20 +75463,21 @@
75347
75463
  return undefined;
75348
75464
  }
75349
75465
  canMoveHeaderPosition(source, target) {
75466
+ const dragColumnOrRow = this._table.stateManager.columnMove.movingColumnOrRow;
75350
75467
  if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) {
75351
75468
  return false;
75352
75469
  }
75353
75470
  else if (!this.transpose &&
75354
- this.isSeriesNumberInBody(target.col, target.row) &&
75355
- this.isSeriesNumberInBody(source.col, source.row)) {
75471
+ ((this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row)) ||
75472
+ dragColumnOrRow === 'row')) {
75356
75473
  const sourceIndex = this.getRecordShowIndexByCell(0, source.row);
75357
75474
  const targetIndex = this.getRecordShowIndexByCell(0, target.row);
75358
75475
  const canMove = this._table.dataSource.canChangeOrder(sourceIndex, targetIndex);
75359
75476
  return canMove;
75360
75477
  }
75361
75478
  else if (this.transpose &&
75362
- this.isSeriesNumberInBody(target.col, target.row) &&
75363
- this.isSeriesNumberInBody(source.col, source.row)) {
75479
+ ((this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row)) ||
75480
+ dragColumnOrRow === 'row')) {
75364
75481
  if (this.getBody(source.col + this.leftRowSeriesNumberColumnCount, source.row).isChildNode &&
75365
75482
  this.getBody(target.col + this.leftRowSeriesNumberColumnCount, target.row).isChildNode) {
75366
75483
  source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1;
@@ -75415,10 +75532,33 @@
75415
75532
  sourceIds.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0);
75416
75533
  Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
75417
75534
  }
75535
+ if (this._table.options.dragOrder?.maintainArrayDataOrder) {
75536
+ for (let j = 0; j < this._table.dataSource.dataSourceObj?.records.length; j++) {
75537
+ const rowRecords = this._table.dataSource.dataSourceObj?.records[j];
75538
+ if (Array.isArray(rowRecords)) {
75539
+ if (rowRecords.length - 1 < targetIndex) {
75540
+ rowRecords.push(...Array(targetIndex - rowRecords.length + 1).fill(undefined));
75541
+ }
75542
+ const sourceData = rowRecords.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
75543
+ sourceData.unshift((targetIndex - this.leftRowSeriesNumberColumnCount), 0);
75544
+ Array.prototype.splice.apply(rowRecords, sourceData);
75545
+ }
75546
+ }
75547
+ }
75418
75548
  const sourceColumns = this._columns.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
75419
75549
  sourceColumns.unshift((targetIndex - this.leftRowSeriesNumberColumnCount), 0);
75420
75550
  Array.prototype.splice.apply(this._columns, sourceColumns);
75551
+ if (this._table.options.dragOrder?.maintainArrayDataOrder) {
75552
+ for (let i = 0; i < this._columns.length; i++) {
75553
+ this._columns[i].field = i;
75554
+ }
75555
+ }
75421
75556
  this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, targetIndex - this.leftRowSeriesNumberColumnCount);
75557
+ if (this._table.options.dragOrder?.maintainArrayDataOrder) {
75558
+ for (let i = 0; i < this.columnTree.tree.children.length; i++) {
75559
+ this.columnTree.tree.children[i].field = i;
75560
+ }
75561
+ }
75422
75562
  this.columnTree.reset(this.columnTree.tree.children);
75423
75563
  this._cellRangeMap = new Map();
75424
75564
  return {
@@ -75465,7 +75605,8 @@
75465
75605
  moveType: 'row'
75466
75606
  };
75467
75607
  }
75468
- else if (this.isSeriesNumberInBody(source.col, source.row)) {
75608
+ else if (this.isSeriesNumberInBody(source.col, source.row) ||
75609
+ this._table.stateManager.columnMove.movingColumnOrRow === 'row') {
75469
75610
  return {
75470
75611
  sourceIndex: source.row,
75471
75612
  targetIndex: target.row,
@@ -76918,7 +77059,10 @@
76918
77059
  get recordsCount() {
76919
77060
  return this.dataSource.records.length;
76920
77061
  }
76921
- updateColumns(columns, options) {
77062
+ updateColumns(columns, options = {
77063
+ clearColWidthCache: false,
77064
+ clearRowHeightCache: true
77065
+ }) {
76922
77066
  this.scenegraph.clearCells();
76923
77067
  const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
76924
77068
  this.internalProps.columns = cloneDeepSpec(columns, ['children']);
@@ -76938,7 +77082,7 @@
76938
77082
  this.headerStyleCache = new Map();
76939
77083
  this.bodyStyleCache = new Map();
76940
77084
  this.bodyBottomStyleCache = new Map();
76941
- this.scenegraph.createSceneGraph();
77085
+ this.scenegraph.createSceneGraph(!!!options?.clearRowHeightCache);
76942
77086
  this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
76943
77087
  this.renderAsync();
76944
77088
  this.eventManager.updateEventBinder();
@@ -76970,6 +77114,17 @@
76970
77114
  else {
76971
77115
  columns.splice(colIndex, 0, ...toAddColumns);
76972
77116
  }
77117
+ for (let i = 0; i < toAddColumns.length; i++) {
77118
+ this.colWidthsMap.addAndReorder(colIndex + i, toAddColumns[i].width ?? this.internalProps.defaultColWidth);
77119
+ }
77120
+ this.internalProps._colRangeWidthsMap.clear();
77121
+ const resizedColIndexs = Array.from(this.internalProps._widthResizedColMap.keys());
77122
+ for (let i = 0; i < resizedColIndexs.length; i++) {
77123
+ if (resizedColIndexs[i] >= colIndex) {
77124
+ this.internalProps._widthResizedColMap.delete(resizedColIndexs[i]);
77125
+ this.internalProps._widthResizedColMap.add(resizedColIndexs[i] + toAddColumns.length);
77126
+ }
77127
+ }
76973
77128
  if (isMaintainArrayData) {
76974
77129
  for (let i = 0; i < columns.length; i++) {
76975
77130
  columns[i].field = i;
@@ -76981,7 +77136,7 @@
76981
77136
  }
76982
77137
  }
76983
77138
  }
76984
- this.updateColumns(columns);
77139
+ this.updateColumns(columns, { clearRowHeightCache: false });
76985
77140
  this.fireListeners(TABLE_EVENT_TYPE.ADD_COLUMN, {
76986
77141
  columnIndex: colIndex,
76987
77142
  columnCount: toAddColumns.length,
@@ -76993,6 +77148,8 @@
76993
77148
  deleteColIndexs.sort((a, b) => b - a);
76994
77149
  for (let i = 0; i < deleteColIndexs.length; i++) {
76995
77150
  columns.splice(deleteColIndexs[i], 1);
77151
+ this.colWidthsMap.delAndReorder(deleteColIndexs[i]);
77152
+ this.internalProps._widthResizedColMap.delete(deleteColIndexs[i]);
76996
77153
  if (isMaintainArrayData) {
76997
77154
  for (let j = 0; j < this.records.length; j++) {
76998
77155
  const record = this.records[j];
@@ -77002,12 +77159,23 @@
77002
77159
  }
77003
77160
  }
77004
77161
  }
77162
+ this.internalProps._colRangeWidthsMap.clear();
77163
+ const resizedColIndexs = Array.from(this.internalProps._widthResizedColMap.keys());
77164
+ for (let i = 0; i < resizedColIndexs.length; i++) {
77165
+ for (let j = 0; j < deleteColIndexs.length; j++) {
77166
+ if (resizedColIndexs[i] > deleteColIndexs[j]) {
77167
+ this.internalProps._widthResizedColMap.delete(resizedColIndexs[i]);
77168
+ this.internalProps._widthResizedColMap.add(resizedColIndexs[i] - (deleteColIndexs.length - j));
77169
+ break;
77170
+ }
77171
+ }
77172
+ }
77005
77173
  if (isMaintainArrayData) {
77006
77174
  for (let i = 0; i < columns.length; i++) {
77007
77175
  columns[i].field = i;
77008
77176
  }
77009
77177
  }
77010
- this.updateColumns(columns);
77178
+ this.updateColumns(columns, { clearRowHeightCache: false });
77011
77179
  this.fireListeners(TABLE_EVENT_TYPE.DELETE_COLUMN, {
77012
77180
  deleteColIndexs: deleteColIndexs,
77013
77181
  columns
@@ -93570,7 +93738,7 @@
93570
93738
  }
93571
93739
 
93572
93740
  registerForVrender();
93573
- const version = "1.22.0";
93741
+ const version = "1.22.2";
93574
93742
  function getIcons() {
93575
93743
  return get$2();
93576
93744
  }