@visactor/vtable-calendar 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.
@@ -24401,12 +24401,12 @@
24401
24401
  const parsedParams = this.parseParams(params, isTimeline);
24402
24402
  return animate = isTimeline ? this.executeTimelineItem(parsedParams, graphic, index, count) : this.executeTypeConfigItem(parsedParams, graphic, index, count), animate && this._trackAnimation(animate), animate;
24403
24403
  }
24404
- stop(type) {
24404
+ stop(type, callEnd = !0) {
24405
24405
  for (; this._animates.length > 0;) {
24406
24406
  const animate = this._animates.pop();
24407
- null == animate || animate.stop(type);
24407
+ !1 === callEnd && (animate.status = AnimateStatus.END), null == animate || animate.stop(type);
24408
24408
  }
24409
- this._animates = [], this._activeCount = 0, this._started && (this._started = !1, this.onEnd());
24409
+ this._animates = [], this._activeCount = 0, this._started && (this._started = !1, callEnd && this.onEnd());
24410
24410
  }
24411
24411
  }
24412
24412
  AnimateExecutor.builtInAnimateMap = {};
@@ -24466,7 +24466,7 @@
24466
24466
  executor: new AnimateExecutor(this.graphic)
24467
24467
  });
24468
24468
  }), shouldStopState.forEach(state => {
24469
- state.executor.stop();
24469
+ state.executor.stop(null, !1);
24470
24470
  }), shouldApplyState.length) {
24471
24471
  shouldApplyState[0].executor.execute(shouldApplyState[0].animationConfig);
24472
24472
  for (let i = 0; i < shouldApplyState.length; i++) {
@@ -24517,7 +24517,7 @@
24517
24517
  clearState() {
24518
24518
  var _a;
24519
24519
  null === (_a = this.stateList) || void 0 === _a || _a.forEach(state => {
24520
- state.executor.stop();
24520
+ state.executor.stop(null, !1);
24521
24521
  }), this.stateList = null;
24522
24522
  }
24523
24523
  reApplyState(state) {
@@ -34861,7 +34861,7 @@
34861
34861
  maxing = !1,
34862
34862
  leading = !1,
34863
34863
  trailing = !0;
34864
- const useRAF = !wait && 0 !== wait && "function" == typeof requestAnimationFrame;
34864
+ const useRAF = !wait && 0 !== wait && "function" == typeof vglobal.getRequestAnimationFrame();
34865
34865
  if ("function" != typeof func) throw new TypeError("Expected a function");
34866
34866
  function invokeFunc(time) {
34867
34867
  const args = lastArgs,
@@ -34869,7 +34869,7 @@
34869
34869
  return lastThis = void 0, lastArgs = void 0, lastInvokeTime = time, result = func.apply(thisArg, args), result;
34870
34870
  }
34871
34871
  function startTimer(pendingFunc, wait) {
34872
- return useRAF ? requestAnimationFrame(pendingFunc) : setTimeout(pendingFunc, wait);
34872
+ return useRAF ? vglobal.getRequestAnimationFrame()(pendingFunc) : setTimeout(pendingFunc, wait);
34873
34873
  }
34874
34874
  function shouldInvoke(time) {
34875
34875
  const timeSinceLastCall = time - lastCallTime;
@@ -42784,14 +42784,15 @@
42784
42784
  symbolX = 0,
42785
42785
  symbolY = 0,
42786
42786
  symbolRotate = Math.PI;
42787
- const linePoints = [];
42788
- return "columnHeader" === cellLocation ? (rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos, rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1), rectHeight = this.table.tableNoFrameHeight, rectWidth = mergeInfo ? this.table.getColsWidth(mergeInfo.start.col, mergeInfo.end.col) : this.table.getColWidth(col), rectDx = rectX - delta, symbolX = rectX + rectWidth, symbolY = 2, linePoints.push({
42787
+ const linePoints = [],
42788
+ movingColumnOrRow = this.table.stateManager.columnMove.movingColumnOrRow;
42789
+ return "columnHeader" === cellLocation && void 0 === movingColumnOrRow || "column" === movingColumnOrRow ? (rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos, rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1), rectHeight = this.table.tableNoFrameHeight, rectWidth = mergeInfo ? this.table.getColsWidth(mergeInfo.start.col, mergeInfo.end.col) : this.table.getColWidth(col), rectDx = rectX - delta, symbolX = rectX + rectWidth, symbolY = 2, linePoints.push({
42789
42790
  x: 0,
42790
42791
  y: 0
42791
42792
  }), linePoints.push({
42792
42793
  x: 0,
42793
42794
  y: this.table.tableNoFrameHeight
42794
- })) : ("rowHeader" === cellLocation || this.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) && (rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos, rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1), rectWidth = this.table.tableNoFrameWidth, rectHeight = mergeInfo ? this.table.getRowsHeight(mergeInfo.start.row, mergeInfo.end.row) : this.table.getRowHeight(row), rectDy = rectY - delta, symbolX = 2, symbolY = rectY + rectHeight, symbolRotate = Math.PI / 2, linePoints.push({
42795
+ })) : ("rowHeader" === cellLocation || this.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) || "row" === movingColumnOrRow) && (rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos, rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1), rectWidth = this.table.tableNoFrameWidth, rectHeight = mergeInfo ? this.table.getRowsHeight(mergeInfo.start.row, mergeInfo.end.row) : this.table.getRowHeight(row), rectDy = rectY - delta, symbolX = 2, symbolY = rectY + rectHeight, symbolRotate = Math.PI / 2, linePoints.push({
42795
42796
  x: 0,
42796
42797
  y: 0
42797
42798
  }), linePoints.push({
@@ -43775,7 +43776,7 @@
43775
43776
  isValid$3(count) && (batchRenderChartCount = count);
43776
43777
  }
43777
43778
  function clearChartRenderQueue() {
43778
- chartRenderKeys = [], chartRenderQueueList = [], isHandlingChartQueue = !1, cancelAnimationFrame(requestAnimationFrameId);
43779
+ chartRenderKeys = [], chartRenderQueueList = [], isHandlingChartQueue = !1, vglobal.getCancelAnimationFrame()(requestAnimationFrameId);
43779
43780
  }
43780
43781
  function IsHandlingChartQueue() {
43781
43782
  return isHandlingChartQueue;
@@ -43854,7 +43855,7 @@
43854
43855
  tickMode: null === (_e = axis.tick) || void 0 === _e ? void 0 : _e.tickMode
43855
43856
  }
43856
43857
  }, !0);
43857
- }), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, chartInstance), "string" == typeof dataId) chartInstance.updateDataSync(dataId, null != data ? data : []);else {
43858
+ }), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, chartInstance), "string" == typeof dataId) chartInstance.getChart().setLayoutTag(!0), chartInstance.updateDataSync(dataId, null != data ? data : []);else {
43858
43859
  const dataBatch = [];
43859
43860
  for (const dataIdStr in dataId) {
43860
43861
  const dataIdAndField = dataId[dataIdStr],
@@ -43868,7 +43869,7 @@
43868
43869
  fields: null === (_e = null == series ? void 0 : series.data) || void 0 === _e ? void 0 : _e.fields
43869
43870
  }), chartInstance.updateFullDataSync || chartInstance.updateDataSync(dataIdStr, dataIdAndField ? null !== (_f = null == data ? void 0 : data.filter(item => item.hasOwnProperty(dataIdAndField))) && void 0 !== _f ? _f : [] : null != data ? data : []);
43870
43871
  }
43871
- null === (_g = chartInstance.updateFullDataSync) || void 0 === _g || _g.call(chartInstance, dataBatch);
43872
+ chartInstance.getChart().setLayoutTag(!0), null === (_g = chartInstance.updateFullDataSync) || void 0 === _g || _g.call(chartInstance, dataBatch);
43872
43873
  }
43873
43874
  table.fireListeners("before_cache_chart_image", {
43874
43875
  chartInstance: chartInstance
@@ -43876,7 +43877,7 @@
43876
43877
  cacheStageCanvas(chartInstance.getStage(), chart);
43877
43878
  }
43878
43879
  function startRenderChartQueue(table) {
43879
- isHandlingChartQueue = !0, chartRenderQueueList.length > 0 ? requestAnimationFrameId = requestAnimationFrame(() => {
43880
+ isHandlingChartQueue = !0, chartRenderQueueList.length > 0 ? requestAnimationFrameId = vglobal.getRequestAnimationFrame()(() => {
43880
43881
  const chartsToRender = chartRenderQueueList.splice(0, batchRenderChartCount);
43881
43882
  chartRenderKeys.splice(0, batchRenderChartCount), chartsToRender.forEach(chart => {
43882
43883
  renderChart(chart), chart.addUpdateBoundTag();
@@ -44815,10 +44816,12 @@
44815
44816
  actualWidth = 0;
44816
44817
  for (let col = 0; col < table.colCount; col++) {
44817
44818
  const colWidth = update && null !== (_f = newWidths[col]) && void 0 !== _f ? _f : table.getColWidth(col);
44818
- (col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
44819
+ "only-body" === table.widthAdaptiveMode && (col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
44819
44820
  }
44820
44821
  if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
44821
- getAdaptiveWidth(canvasWidth - actualHeaderWidth, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount, update, newWidths, table);
44822
+ let startCol = 0,
44823
+ endCol = table.colCount;
44824
+ "only-body" === table.widthAdaptiveMode && (startCol = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount), getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);
44822
44825
  }
44823
44826
  }
44824
44827
  if (update) {
@@ -48503,12 +48506,12 @@
48503
48506
  actualWidth = 0;
48504
48507
  for (let col = 0; col < table.colCount; col++) {
48505
48508
  const colWidth = table.getColWidth(col);
48506
- (col < table.rowHeaderLevelCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
48509
+ "only-body" === table.widthAdaptiveMode && (col < table.rowHeaderLevelCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth), actualWidth += colWidth;
48507
48510
  }
48508
48511
  if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
48509
- const startCol = table.rowHeaderLevelCount,
48510
- endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
48511
- getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, !1, [], table, !0);
48512
+ let startCol = 0,
48513
+ endCol = table.colCount;
48514
+ "only-body" === table.widthAdaptiveMode && (startCol = table.rowHeaderLevelCount, endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount), getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, !1, [], table, !0);
48512
48515
  }
48513
48516
  }
48514
48517
  let bodyWidth = 0;
@@ -49473,24 +49476,26 @@
49473
49476
  return target;
49474
49477
  }
49475
49478
 
49476
- function startMoveCol(col, row, x, y, state, event) {
49479
+ function startMoveCol(col, row, x, y, state, event, dragColumnOrRow) {
49477
49480
  var _a;
49478
49481
  if (!("canMoveHeaderPosition" in state.table.internalProps.layoutMap)) return;
49479
- if (state.columnMove.moving = !0, state.columnMove.colSource = col, state.columnMove.rowSource = row, state.table.isListTable()) {
49482
+ if (state.columnMove.movingColumnOrRow = dragColumnOrRow, state.columnMove.moving = !0, state.columnMove.colSource = col, state.columnMove.rowSource = row, state.table.isListTable()) {
49480
49483
  const nodeIndex = state.table.getRecordIndexByCell(col, row),
49481
49484
  nodeData = state.table.getRecordByCell(col, row),
49482
49485
  hierarchyState = state.table.getRecordHierarchyState(col, row);
49483
49486
  state.columnMove.rowSourceSize = computeChildrenNodeLength(nodeIndex, hierarchyState, nodeData) + 1;
49484
49487
  }
49485
- state.columnMove.x = x - state.table.tableX, state.columnMove.y = y - state.table.tableY;
49486
- const cellLocation = state.table.getCellLocation(col, row),
49487
- delta = "columnHeader" === cellLocation ? state.columnMove.x : "rowHeader" === cellLocation || state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) ? state.columnMove.y : 0,
49488
- {
49489
- backX: backX,
49490
- lineX: lineX,
49491
- backY: backY,
49492
- lineY: lineY
49493
- } = state.table.scenegraph.component.showMoveCol(col, row, delta);
49488
+ let delta;
49489
+ if (state.columnMove.x = x - state.table.tableX, state.columnMove.y = y - state.table.tableY, "column" === dragColumnOrRow) delta = state.columnMove.x;else if ("row" === dragColumnOrRow) delta = state.columnMove.y;else {
49490
+ const cellLocation = state.table.getCellLocation(col, row);
49491
+ delta = "columnHeader" === cellLocation ? state.columnMove.x : "rowHeader" === cellLocation || state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) ? state.columnMove.y : 0;
49492
+ }
49493
+ const {
49494
+ backX: backX,
49495
+ lineX: lineX,
49496
+ backY: backY,
49497
+ lineY: lineY
49498
+ } = state.table.scenegraph.component.showMoveCol(col, row, delta);
49494
49499
  state.table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START, {
49495
49500
  col: col,
49496
49501
  row: row,
@@ -49500,7 +49505,8 @@
49500
49505
  lineX: lineX,
49501
49506
  backY: backY,
49502
49507
  lineY: lineY,
49503
- event: event
49508
+ event: event,
49509
+ movingColumnOrRow: dragColumnOrRow
49504
49510
  });
49505
49511
  const isHasSelected = !!(null === (_a = state.select.ranges) || void 0 === _a ? void 0 : _a.length);
49506
49512
  state.table.stateManager.updateSelectPos(-1, -1), state.table.stateManager.endSelectCells(!0, isHasSelected), state.table.scenegraph.updateNextFrame();
@@ -49530,7 +49536,7 @@
49530
49536
  let lineX, backX, lineY, backY;
49531
49537
  state.updateCursor("grabbing");
49532
49538
  const cellLocation = state.table.getCellLocation(state.columnMove.colSource, state.columnMove.rowSource);
49533
- "columnHeader" === cellLocation ? (backX = state.columnMove.x, lineX = state.table.isLeftFrozenColumn(col) ? state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1) : state.table.isRightFrozenColumn(col) ? state.table.tableNoFrameWidth - state.table.getColsWidth(targetCell.col + 1, state.table.colCount - 1) : (state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1)) - state.table.stateManager.scroll.horizontalBarPos) : ("rowHeader" === cellLocation || state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) && (backY = state.columnMove.y, lineY = state.table.isFrozenRow(row) ? state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1) : state.table.isBottomFrozenRow(row) ? state.table.tableNoFrameHeight - state.table.getRowsHeight(targetCell.row + 1, state.table.rowCount - 1) : (state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1)) - state.table.stateManager.scroll.verticalBarPos), state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY), state.table.fireListeners(TABLE_EVENT_TYPE.CHANGING_HEADER_POSITION, {
49539
+ "columnHeader" === cellLocation ? (backX = state.columnMove.x, lineX = state.table.isLeftFrozenColumn(col) ? state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1) : state.table.isRightFrozenColumn(col) ? state.table.tableNoFrameWidth - state.table.getColsWidth(targetCell.col + 1, state.table.colCount - 1) : (state.columnMove.colTarget >= state.columnMove.colSource ? state.table.getColsWidth(0, state.columnMove.colTarget) : state.table.getColsWidth(0, state.columnMove.colTarget - 1)) - state.table.stateManager.scroll.horizontalBarPos) : ("rowHeader" === cellLocation || state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) || "row" === state.columnMove.movingColumnOrRow) && (backY = state.columnMove.y, lineY = state.table.isFrozenRow(row) ? state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1) : state.table.isBottomFrozenRow(row) ? state.table.tableNoFrameHeight - state.table.getRowsHeight(targetCell.row + 1, state.table.rowCount - 1) : (state.columnMove.rowTarget >= state.columnMove.rowSource ? state.table.getRowsHeight(0, state.columnMove.rowTarget) : state.table.getRowsHeight(0, state.columnMove.rowTarget - 1)) - state.table.stateManager.scroll.verticalBarPos), state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY), state.table.fireListeners(TABLE_EVENT_TYPE.CHANGING_HEADER_POSITION, {
49534
49540
  col: col,
49535
49541
  row: row,
49536
49542
  x: x,
@@ -49539,14 +49545,15 @@
49539
49545
  lineX: lineX,
49540
49546
  backY: backY,
49541
49547
  lineY: lineY,
49542
- event: event
49548
+ event: event,
49549
+ movingColumnOrRow: state.columnMove.movingColumnOrRow
49543
49550
  }), state.table.scenegraph.updateNextFrame();
49544
49551
  } else state.updateCursor("not-allowed"), state.columnMove.colTarget = state.columnMove.colSource, state.columnMove.rowTarget = state.columnMove.rowSource;
49545
49552
  }
49546
49553
  function endMoveCol(state) {
49547
49554
  var _a, _b;
49548
49555
  let moveColResult = !1;
49549
- if ("canMoveHeaderPosition" in state.table.internalProps.layoutMap && state.columnMove.moving && state.columnMove.colSource >= 0 && state.columnMove.rowSource >= 0 && state.columnMove.colTarget >= 0 && state.columnMove.rowTarget >= 0 && !0 !== (null === (_a = state.table.options.customConfig) || void 0 === _a ? void 0 : _a.notUpdateInColumnRowMove)) {
49556
+ if ("canMoveHeaderPosition" in state.table.internalProps.layoutMap && state.columnMove.moving && (state.columnMove.colSource >= 0 || "row" === state.columnMove.movingColumnOrRow) && (state.columnMove.rowSource >= 0 || "column" === state.columnMove.movingColumnOrRow) && (state.columnMove.colTarget >= 0 || "row" === state.columnMove.movingColumnOrRow) && (state.columnMove.rowTarget >= 0 || "column" === state.columnMove.movingColumnOrRow) && !0 !== (null === (_a = state.table.options.customConfig) || void 0 === _a ? void 0 : _a.notUpdateInColumnRowMove)) {
49550
49557
  const oldSourceMergeInfo = state.table.getCellRange(state.columnMove.colSource, state.columnMove.rowSource),
49551
49558
  oldTargetMergeInfo = state.table.getCellRange(state.columnMove.colTarget, state.columnMove.rowTarget),
49552
49559
  moveContext = state.table._moveHeaderPosition({
@@ -49556,7 +49563,9 @@
49556
49563
  col: state.columnMove.colTarget,
49557
49564
  row: state.columnMove.rowTarget
49558
49565
  });
49559
- if (!moveContext || moveContext.targetIndex === moveContext.sourceIndex) return state.updateCursor(), state.columnMove.moving = !1, delete state.columnMove.colSource, delete state.columnMove.rowSource, delete state.columnMove.colTarget, delete state.columnMove.rowTarget, state.table.scenegraph.component.hideMoveCol(), state.table.scenegraph.updateNextFrame(), !1;
49566
+ if (!moveContext || moveContext.targetIndex === moveContext.sourceIndex) return state.updateCursor(), state.columnMove.moving = !1, setTimeout(() => {
49567
+ delete state.columnMove.colSource, delete state.columnMove.rowSource, delete state.columnMove.colTarget, delete state.columnMove.rowTarget, state.columnMove.movingColumnOrRow = void 0;
49568
+ }, 0), state.table.scenegraph.component.hideMoveCol(), state.table.scenegraph.updateNextFrame(), !1;
49560
49569
  {
49561
49570
  state.table.internalProps.useOneRowHeightFillAll = !1, state.table.internalProps.layoutMap.clearCellRangeMap();
49562
49571
  const sourceMergeInfo = state.table.getCellRange(state.columnMove.colSource, state.columnMove.rowSource),
@@ -49565,11 +49574,11 @@
49565
49574
  colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col),
49566
49575
  rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
49567
49576
  let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
49568
- "row" === moveContext.moveType && "tree" === state.table.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1), !state.table.transpose && state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) && (state.table.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex), state.changeCheckboxAndRadioOrder(moveContext.sourceIndex, moveContext.targetIndex)), "column" === moveContext.moveType ? clearWidthsAndHeightsCache(colMin, colMax, 0, -1, state.table) : clearWidthsAndHeightsCache(0, -1, rowMin, rowMax, state.table), state.table.clearCellStyleCache(), state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) ? 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) : "column" === moveContext.moveType ? state.table.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType) : state.table.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType), "adjustFrozenCount" === state.table.internalProps.frozenColDragHeaderMode && state.table.isListTable() && (state.table.isLeftFrozenColumn(state.columnMove.colTarget) && !state.table.isLeftFrozenColumn(state.columnMove.colSource) ? state.table.frozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : state.table.isLeftFrozenColumn(state.columnMove.colSource) && !state.table.isLeftFrozenColumn(state.columnMove.colTarget) && (state.table.frozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1), state.table.isRightFrozenColumn(state.columnMove.colTarget) && !state.table.isRightFrozenColumn(state.columnMove.colSource) ? state.table.rightFrozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : state.table.isRightFrozenColumn(state.columnMove.colSource) && !state.table.isRightFrozenColumn(state.columnMove.colTarget) && (state.table.rightFrozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1)), moveColResult = !0;
49577
+ "row" === moveContext.moveType && "tree" === state.table.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1), state.table.transpose || !state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) && "row" !== state.columnMove.movingColumnOrRow || (state.table.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex), state.changeCheckboxAndRadioOrder(moveContext.sourceIndex, moveContext.targetIndex)), "column" === moveContext.moveType ? clearWidthsAndHeightsCache(colMin, colMax, 0, -1, state.table) : clearWidthsAndHeightsCache(0, -1, rowMin, rowMax, state.table), state.table.clearCellStyleCache(), state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource) || "row" === state.columnMove.movingColumnOrRow ? 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) : "column" === moveContext.moveType ? state.table.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType) : state.table.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType), "adjustFrozenCount" === state.table.internalProps.frozenColDragHeaderMode && state.table.isListTable() && (state.table.isLeftFrozenColumn(state.columnMove.colTarget) && !state.table.isLeftFrozenColumn(state.columnMove.colSource) ? state.table.frozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : state.table.isLeftFrozenColumn(state.columnMove.colSource) && !state.table.isLeftFrozenColumn(state.columnMove.colTarget) && (state.table.frozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1), state.table.isRightFrozenColumn(state.columnMove.colTarget) && !state.table.isRightFrozenColumn(state.columnMove.colSource) ? state.table.rightFrozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : state.table.isRightFrozenColumn(state.columnMove.colSource) && !state.table.isRightFrozenColumn(state.columnMove.colTarget) && (state.table.rightFrozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1)), moveColResult = !0;
49569
49578
  }
49570
49579
  }
49571
49580
  return state.columnMove.moving = !1, setTimeout(() => {
49572
- delete state.columnMove.colSource, delete state.columnMove.rowSource, delete state.columnMove.colTarget, delete state.columnMove.rowTarget;
49581
+ delete state.columnMove.colSource, delete state.columnMove.rowSource, delete state.columnMove.colTarget, delete state.columnMove.rowTarget, state.columnMove.movingColumnOrRow = void 0;
49573
49582
  }, 0), state.table.scenegraph.component.hideMoveCol(), state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose ? (state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen), state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount)) : state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount && !state.table.isPivotTable() && !state.table.transpose ? state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount) : state.table.options.frozenColCount ? state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1) : state.table.options.rightFrozenColCount && state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount), state.table.scenegraph.updateNextFrame(), !0 === (null === (_b = state.table.options.customConfig) || void 0 === _b ? void 0 : _b.notUpdateInColumnRowMove) || moveColResult;
49574
49583
  }
49575
49584
  function clearWidthsAndHeightsCache(colMin, colMax, rowMin, rowMax, table) {
@@ -49607,6 +49616,7 @@
49607
49616
  }
49608
49617
 
49609
49618
  function updateResizeColumn(xInTable, yInTable, state) {
49619
+ var _a;
49610
49620
  xInTable = Math.ceil(xInTable), yInTable = Math.ceil(yInTable);
49611
49621
  let detaX = state.columnResize.isRightFrozen ? state.columnResize.x - xInTable : xInTable - state.columnResize.x;
49612
49622
  if (Math.abs(detaX) < 1) return;
@@ -49631,7 +49641,9 @@
49631
49641
  }
49632
49642
  rightColWidth - detaX < state.table.internalProps.limitMinWidth && (detaX = rightColWidth - state.table.internalProps.limitMinWidth);
49633
49643
  }
49634
- detaX = Math.ceil(detaX), state.columnResize.col < state.table.rowHeaderLevelCount || state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount ? updateResizeColForColumn(detaX, state) : "indicator" === state.table.internalProps.columnResizeType ? updateResizeColForIndicator$1(detaX, state) : "indicatorGroup" === state.table.internalProps.columnResizeType ? updateResizeColForIndicatorGroup$1(detaX, state) : "all" === state.table.internalProps.columnResizeType ? updateResizeColForAll$1(detaX, state) : updateResizeColForColumn(detaX, state), state.columnResize.x = xInTable, state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen), state.table._updateSize(), state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose ? state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen) : state.table.options.frozenColCount && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1), (state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount && !state.table.isPivotTable() && !state.table.transpose || state.table.options.rightFrozenColCount) && state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount), state.table.scenegraph.updateNextFrame();
49644
+ detaX = Math.ceil(detaX), state.columnResize.col < state.table.rowHeaderLevelCount || state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount ? updateResizeColForColumn(detaX, state) : "indicator" === state.table.internalProps.columnResizeType ? updateResizeColForIndicator$1(detaX, state) : "indicatorGroup" === state.table.internalProps.columnResizeType ? updateResizeColForIndicatorGroup$1(detaX, state) : "all" === state.table.internalProps.columnResizeType ? updateResizeColForAll$1(detaX, state) : updateResizeColForColumn(detaX, state), state.columnResize.x = xInTable, state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen), state.table._updateSize(), null === (_a = state.table.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
49645
+ null == legend || legend.resize();
49646
+ }), state.table.internalProps.title && state.table.internalProps.title.resize(), state.table.internalProps.emptyTip && state.table.internalProps.emptyTip.resize(), state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose ? state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen) : state.table.options.frozenColCount && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1), (state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount && !state.table.isPivotTable() && !state.table.transpose || state.table.options.rightFrozenColCount) && state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount), state.table.scenegraph.updateNextFrame();
49635
49647
  }
49636
49648
  function updateResizeColForColumn(detaX, state) {
49637
49649
  "adaptive" === state.table.widthMode && state.columnResize.col < state.table.colCount - 1 ? (state.table.scenegraph.updateColWidth(state.columnResize.col, detaX), state.table.scenegraph.updateColWidth(state.columnResize.col + 1, -detaX), state.table.internalProps._widthResizedColMap.add(state.columnResize.col), state.table.internalProps._widthResizedColMap.add(state.columnResize.col + 1)) : (state.table.scenegraph.updateColWidth(state.columnResize.col, detaX), state.table.internalProps._widthResizedColMap.add(state.columnResize.col));
@@ -49945,6 +49957,7 @@
49945
49957
  }
49946
49958
 
49947
49959
  function updateResizeRow(xInTable, yInTable, state) {
49960
+ var _a;
49948
49961
  xInTable = Math.ceil(xInTable), yInTable = Math.ceil(yInTable);
49949
49962
  let detaY = state.rowResize.isBottomFrozen ? state.rowResize.y - yInTable : yInTable - state.rowResize.y;
49950
49963
  if (Math.abs(detaY) < 1) return;
@@ -49954,7 +49967,9 @@
49954
49967
  let bottomRowHeight = state.table.getRowHeight(state.rowResize.row + 1);
49955
49968
  bottomRowHeight -= detaY, bottomRowHeight - detaY < state.table.internalProps.limitMinHeight && (detaY = bottomRowHeight - state.table.internalProps.limitMinHeight);
49956
49969
  }
49957
- detaY = Math.ceil(detaY), state.rowResize.row < state.table.columnHeaderLevelCount || state.rowResize.row >= state.table.rowCount - state.table.bottomFrozenRowCount ? updateResizeColForRow(detaY, state) : "indicator" === state.table.internalProps.rowResizeType ? updateResizeColForIndicator(detaY, state) : "indicatorGroup" === state.table.internalProps.rowResizeType ? updateResizeColForIndicatorGroup(detaY, state) : "all" === state.table.internalProps.rowResizeType ? updateResizeColForAll(detaY, state) : updateResizeColForRow(detaY, state), state.rowResize.y = yInTable, state.table.scenegraph.component.updateResizeRow(state.rowResize.row, xInTable, state.rowResize.isBottomFrozen), state.table._updateSize(), state.table.scenegraph.updateNextFrame();
49970
+ detaY = Math.ceil(detaY), state.rowResize.row < state.table.columnHeaderLevelCount || state.rowResize.row >= state.table.rowCount - state.table.bottomFrozenRowCount ? updateResizeColForRow(detaY, state) : "indicator" === state.table.internalProps.rowResizeType ? updateResizeColForIndicator(detaY, state) : "indicatorGroup" === state.table.internalProps.rowResizeType ? updateResizeColForIndicatorGroup(detaY, state) : "all" === state.table.internalProps.rowResizeType ? updateResizeColForAll(detaY, state) : updateResizeColForRow(detaY, state), state.rowResize.y = yInTable, state.table.scenegraph.component.updateResizeRow(state.rowResize.row, xInTable, state.rowResize.isBottomFrozen), state.table._updateSize(), null === (_a = state.table.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
49971
+ null == legend || legend.resize();
49972
+ }), state.table.internalProps.title && state.table.internalProps.title.resize(), state.table.internalProps.emptyTip && state.table.internalProps.emptyTip.resize(), state.table.scenegraph.updateNextFrame();
49958
49973
  }
49959
49974
  function updateResizeColForRow(detaY, state) {
49960
49975
  "adaptive" === state.table.heightMode && state.rowResize.row < state.table.rowCount - 1 ? (state.table.scenegraph.updateRowHeight(state.rowResize.row, detaY), state.table.scenegraph.updateRowHeight(state.rowResize.row + 1, -detaY), state.table.internalProps._heightResizedRowMap.add(state.rowResize.row), state.table.internalProps._heightResizedRowMap.add(state.rowResize.row + 1)) : (state.table.scenegraph.updateRowHeight(state.rowResize.row, detaY), state.table.internalProps._heightResizedRowMap.add(state.rowResize.row));
@@ -50126,7 +50141,8 @@
50126
50141
  rowTargetSize: 0,
50127
50142
  x: 0,
50128
50143
  y: 0,
50129
- moving: !1
50144
+ moving: !1,
50145
+ movingColumnOrRow: void 0
50130
50146
  }, this.menu = {
50131
50147
  x: -1,
50132
50148
  y: -1,
@@ -50193,7 +50209,8 @@
50193
50209
  rowTargetSize: 0,
50194
50210
  x: 0,
50195
50211
  y: 0,
50196
- moving: !1
50212
+ moving: !1,
50213
+ movingColumnOrRow: void 0
50197
50214
  }, this.menu = {
50198
50215
  x: -1,
50199
50216
  y: -1,
@@ -50360,7 +50377,7 @@
50360
50377
  if (this.select.selecting) {
50361
50378
  if (this.select.selecting = !1, 0 === this.select.ranges.length) return;
50362
50379
  const currentRange = this.select.ranges[this.select.ranges.length - 1];
50363
- this.table.isSeriesNumber(this.select.cellPos.col, this.select.cellPos.row) || this.table.isHeader(this.select.cellPos.col, this.select.cellPos.row) || expendCellRange(currentRange, this.table);
50380
+ this.table.isSeriesNumber(this.select.cellPos.col, this.select.cellPos.row) || this.table.isHeader(this.select.cellPos.col, this.select.cellPos.row) || this.table.isSeriesNumberInBody(currentRange.start.col, currentRange.start.row) || expendCellRange(currentRange, this.table);
50364
50381
  let isSame = !1;
50365
50382
  for (let i = 0; i < this.select.ranges.length - 1; i++) {
50366
50383
  const range = this.select.ranges[i];
@@ -50416,8 +50433,8 @@
50416
50433
  direction: this.fillHandle.direction
50417
50434
  }), this.fillHandle.beforeFillMaxCol = void 0, this.fillHandle.beforeFillMaxRow = void 0, this.fillHandle.beforeFillMinCol = void 0, this.fillHandle.beforeFillMinRow = void 0;
50418
50435
  }
50419
- startMoveCol(col, row, x, y, event) {
50420
- startMoveCol(col, row, x, y, this, event);
50436
+ startMoveCol(col, row, x, y, event, dragColumnOrRow) {
50437
+ startMoveCol(col, row, x, y, this, event, dragColumnOrRow);
50421
50438
  }
50422
50439
  updateMoveCol(col, row, x, y, event) {
50423
50440
  updateMoveCol(col, row, x, y, this, event);
@@ -51074,7 +51091,7 @@
51074
51091
  this.scrollHandle = scrollHandle;
51075
51092
  }
51076
51093
  startInertia(speedX, speedY, friction) {
51077
- this.lastTime = Date.now(), this.speedX = speedX, this.speedY = speedY, this.friction = friction, this.runingId || (this.runingId = requestAnimationFrame(this.inertia.bind(this)));
51094
+ this.lastTime = Date.now(), this.speedX = speedX, this.speedY = speedY, this.friction = friction, this.runingId || (this.runingId = vglobal.getRequestAnimationFrame()(this.inertia.bind(this)));
51078
51095
  }
51079
51096
  inertia() {
51080
51097
  var _a;
@@ -51086,10 +51103,10 @@
51086
51103
  newSpeedY = f * this.speedY;
51087
51104
  let dx = 0,
51088
51105
  dy = 0;
51089
- Math.abs(newSpeedX) > .05 && (stopped = !1, dx = (this.speedX + newSpeedX) / 2 * dffTime), Math.abs(newSpeedY) > .05 && (stopped = !1, dy = (this.speedY + newSpeedY) / 2 * dffTime), null === (_a = this.scrollHandle) || void 0 === _a || _a.call(this, dx, dy), stopped ? this.runingId = null : (this.lastTime = now, this.speedX = newSpeedX, this.speedY = newSpeedY, this.runingId = requestAnimationFrame(this.inertia.bind(this)));
51106
+ Math.abs(newSpeedX) > .05 && (stopped = !1, dx = (this.speedX + newSpeedX) / 2 * dffTime), Math.abs(newSpeedY) > .05 && (stopped = !1, dy = (this.speedY + newSpeedY) / 2 * dffTime), null === (_a = this.scrollHandle) || void 0 === _a || _a.call(this, dx, dy), stopped ? this.runingId = null : (this.lastTime = now, this.speedX = newSpeedX, this.speedY = newSpeedY, this.runingId = vglobal.getRequestAnimationFrame()(this.inertia.bind(this)));
51090
51107
  }
51091
51108
  endInertia() {
51092
- cancelAnimationFrame(this.runingId), this.runingId = null;
51109
+ vglobal.getCancelAnimationFrame()(this.runingId), this.runingId = null;
51093
51110
  }
51094
51111
  isInertiaScrolling() {
51095
51112
  return !!this.runingId;
@@ -51104,7 +51121,8 @@
51104
51121
  colSource: colSource,
51105
51122
  rowSource: rowSource,
51106
51123
  colTarget: colTarget,
51107
- rowTarget: rowTarget
51124
+ rowTarget: rowTarget,
51125
+ movingColumnOrRow: movingColumnOrRow
51108
51126
  } = table.stateManager.columnMove,
51109
51127
  rowSourceSize = null !== (_e = table.stateManager.columnMove.rowSourceSize) && void 0 !== _e ? _e : 0,
51110
51128
  rowTargetSize = null !== (_f = table.stateManager.columnMove.rowTargetSize) && void 0 !== _f ? _f : 0;
@@ -51117,6 +51135,7 @@
51117
51135
  col: colSource,
51118
51136
  row: rowSource
51119
51137
  },
51138
+ movingColumnOrRow: movingColumnOrRow,
51120
51139
  event: e
51121
51140
  });
51122
51141
  }
@@ -51132,6 +51151,7 @@
51132
51151
  col: table.stateManager.columnMove.colSource,
51133
51152
  row: table.stateManager.columnMove.rowSource
51134
51153
  },
51154
+ movingColumnOrRow: table.stateManager.columnMove.movingColumnOrRow,
51135
51155
  event: e
51136
51156
  });
51137
51157
  }
@@ -51157,7 +51177,7 @@
51157
51177
  event: e.nativeEvent,
51158
51178
  target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
51159
51179
  mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
51160
- }), stateManager.interactionState === InteractionState.grabing) return void (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1 && (stateManager.isResizeCol() || stateManager.isResizeRow() || (stateManager.isMoveCol() ? eventManager.dealColumnMover(eventArgsSet) : stateManager.isFillHandle() ? eventManager.dealFillSelect(eventArgsSet, !0) : (null === (_g = table.options.select) || void 0 === _g ? void 0 : _g.disableDragSelect) || eventManager.dealTableSelect(eventArgsSet, !0))));
51180
+ }), stateManager.interactionState === InteractionState.grabing) return void (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1 && (stateManager.isResizeCol() || stateManager.isResizeRow() || stateManager.isMoveCol() || (stateManager.isFillHandle() ? eventManager.dealFillSelect(eventArgsSet, !0) : (null === (_g = table.options.select) || void 0 === _g ? void 0 : _g.disableDragSelect) || eventManager.dealTableSelect(eventArgsSet, !0))));
51161
51181
  !(null === (_h = table.options.select) || void 0 === _h ? void 0 : _h.disableDragSelect) && table.eventManager.isDraging && stateManager.isSelecting() && !(null === (_j = table.editorManager) || void 0 === _j ? void 0 : _j.editingEditor) && eventManager.dealTableSelect(eventArgsSet, !0);
51162
51182
  const cellGoup = e.path.find(node => "cell" === node.role);
51163
51183
  if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL) && (-1 === table.stateManager.hover.cellPos.col || -1 === table.stateManager.hover.cellPos.row || (null == cellGoup ? void 0 : cellGoup.col) === table.stateManager.hover.cellPos.col && (null == cellGoup ? void 0 : cellGoup.row) === table.stateManager.hover.cellPos.row || table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
@@ -51827,7 +51847,7 @@
51827
51847
  !1 !== (null === (_a = table.eventOptions) || void 0 === _a ? void 0 : _a.preventDefaultContextMenu) ? e.preventDefault() : globalPointerupCallback(e);
51828
51848
  }), table.options.canvas || handler.on(table.getContainer(), "resize", e => {
51829
51849
  var _a;
51830
- table.isReleased || 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$3(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio()), e.windowSizeNotChange || table.resize());
51850
+ table.isReleased || 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight || "adaptive" === table.widthMode || "adaptive" === table.heightMode) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$3(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio()), e.windowSizeNotChange || table.resize());
51831
51851
  });
51832
51852
  const globalPointerdownCallback = e => {
51833
51853
  var _a;
@@ -51909,10 +51929,10 @@
51909
51929
  stateManager.interactionState === InteractionState.grabing && (stateManager.isResizeCol() ? (eventManager.dealColumnResize(x, y), table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN) && table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN, {
51910
51930
  col: table.stateManager.columnResize.col,
51911
51931
  colWidth: table.getColWidth(table.stateManager.columnResize.col)
51912
- })) : stateManager.isResizeRow() && (eventManager.dealRowResize(x, y), table.hasListeners(TABLE_EVENT_TYPE.RESIZE_ROW) && table.fireListeners(TABLE_EVENT_TYPE.RESIZE_ROW, {
51932
+ })) : stateManager.isResizeRow() ? (eventManager.dealRowResize(x, y), table.hasListeners(TABLE_EVENT_TYPE.RESIZE_ROW) && table.fireListeners(TABLE_EVENT_TYPE.RESIZE_ROW, {
51913
51933
  row: table.stateManager.rowResize.row,
51914
51934
  rowHeight: table.getRowHeight(table.stateManager.rowResize.row)
51915
- })));
51935
+ })) : stateManager.isMoveCol() && eventManager.dealColumnMover(x, y, e));
51916
51936
  const isSelecting = table.stateManager.isSelecting();
51917
51937
  if (eventManager._enableTableScroll && eventManager.isDraging && isSelecting && (null === (_e = table.stateManager.select.ranges) || void 0 === _e ? void 0 : _e.length) > 0) {
51918
51938
  const drawRange = table.getDrawRange(),
@@ -52526,12 +52546,10 @@
52526
52546
  } = eventArgsSet;
52527
52547
  return !(!eventArgs || !this.table._canDragHeaderPosition(eventArgs.col, eventArgs.row)) && (this.table.stateManager.startMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = null == eventArgs ? void 0 : eventArgs.event) || void 0 === _a ? void 0 : _a.nativeEvent), !0);
52528
52548
  }
52529
- dealColumnMover(eventArgsSet) {
52530
- var _a;
52531
- const {
52532
- eventArgs: eventArgs
52533
- } = eventArgsSet;
52534
- isValid$3(eventArgs.col) && isValid$3(eventArgs.row) && this.table.stateManager.updateMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = null == eventArgs ? void 0 : eventArgs.event) || void 0 === _a ? void 0 : _a.nativeEvent);
52549
+ dealColumnMover(x, y, event) {
52550
+ let col = this.table.getColAtRelativePosition(x),
52551
+ row = this.table.getRowAtRelativePosition(y);
52552
+ -1 === col && "row" === this.table.stateManager.columnMove.movingColumnOrRow && (col = 0), -1 === row && "column" === this.table.stateManager.columnMove.movingColumnOrRow && (row = 0), isValid$3(col) && isValid$3(row) && this.table.stateManager.updateMoveCol(col, row, x, y, event);
52535
52553
  }
52536
52554
  startColumnResize(eventArgsSet) {}
52537
52555
  dealIconClick(e, eventArgsSet) {
@@ -53998,12 +54016,12 @@
53998
54016
  clearRange() {
53999
54017
  this.cumulativeSum.clear(), this.difference.clear();
54000
54018
  }
54001
- add(position, value) {
54019
+ _add(position, value) {
54002
54020
  if (!isValid$3(value)) return;
54003
54021
  const defaultValue = this.table.getRowHeight(position);
54004
54022
  this.data.has(position) || (this._keys.push(position), this._sorted = !1), this.data.set(position, value), this.totalSum += value, this.updateDifference(position, value - defaultValue);
54005
54023
  }
54006
- remove(position) {
54024
+ _remove(position) {
54007
54025
  if (this.data.has(position)) {
54008
54026
  const value = this.data.get(position);
54009
54027
  this.data.delete(position);
@@ -54020,7 +54038,7 @@
54020
54038
  this.data.set(position, newValue);
54021
54039
  const difference = newValue - oldValue;
54022
54040
  this.totalSum += difference, this.updateDifference(position, difference);
54023
- } else this.add(position, newValue);
54041
+ } else this._add(position, newValue);
54024
54042
  }
54025
54043
  get(position) {
54026
54044
  return this.data.get(position);
@@ -54087,21 +54105,38 @@
54087
54105
  }
54088
54106
  insert(position, value) {
54089
54107
  for (let i = position; i <= this.getLastIndex(); i++) this.cumulativeSum.delete(i);
54090
- const lastIndex = this.getLastIndex() + 1;
54091
- this.adjustOrder(position, position + 1, lastIndex - position), isValid$3(value) && this.put(position, value);
54108
+ const lastIndex = this.getLastIndex() + 1,
54109
+ values = [];
54110
+ for (let i = position; i <= lastIndex; i++) this.has(i) && (values.push({
54111
+ position: i,
54112
+ value: this.get(i)
54113
+ }), this._remove(i));
54114
+ isValid$3(value) && this.put(position, value);
54115
+ for (const {
54116
+ position: position,
54117
+ value: value
54118
+ } of values) this.put(position + 1, value);
54092
54119
  }
54093
54120
  getLastIndex() {
54094
54121
  return this._sort(), this._keys[this._keys.length - 1];
54095
54122
  }
54096
54123
  delLast() {
54097
54124
  const lastIndex = this.getLastIndex();
54098
- this.remove(lastIndex);
54125
+ this._remove(lastIndex);
54099
54126
  }
54100
54127
  delete(position) {
54101
- if (!this.has(position)) return;
54102
54128
  for (let i = position; i <= this.getLastIndex(); i++) this.cumulativeSum.delete(i);
54103
54129
  const lastIndex = this.getLastIndex();
54104
- this.adjustOrder(position + 1, position, lastIndex - position), this.delLast();
54130
+ this.has(position) && this._remove(position);
54131
+ const values = [];
54132
+ for (let i = position + 1; i <= lastIndex; i++) this.has(i) && values.push({
54133
+ position: i,
54134
+ value: this.get(i)
54135
+ });
54136
+ for (const {
54137
+ position: position,
54138
+ value: value
54139
+ } of values) this._remove(position), this._add(position - 1, value);
54105
54140
  }
54106
54141
  adjustOrder(sourceIndex, targetIndex, moveCount) {
54107
54142
  this.clearRange(), this._sort();
@@ -54129,28 +54164,12 @@
54129
54164
  }
54130
54165
  }
54131
54166
  exchangeOrder(sourceIndex, sourceCount, targetIndex, targetCount, insertIndex) {
54132
- const {
54133
- _keys: keys
54134
- } = this;
54135
- if (this._sorted || (keys.sort((a, b) => a < b ? -1 : a > b ? 1 : 0), this._sorted = !0), sourceIndex > targetIndex) {
54136
- const targetVals = [],
54137
- sourceVals = [];
54138
- for (let i = indexFirst(keys, targetIndex); i < indexFirst(keys, sourceIndex) + sourceCount; i++) {
54139
- const key = keys[i];
54140
- key >= sourceIndex && key < sourceIndex + sourceCount ? sourceVals.push(this.get(key)) : targetVals.push(this.get(key));
54141
- }
54142
- for (let i = 0; i < sourceCount; i++) this.put(insertIndex + i, sourceVals[i]);
54143
- for (let i = 0; i < targetVals.length; i++) this.put(insertIndex + sourceCount + i, targetVals[i]);
54144
- } else {
54145
- const targetVals = [],
54146
- sourceVals = [];
54147
- for (let i = indexFirst(keys, sourceIndex); i < indexFirst(keys, targetIndex) + targetCount; i++) {
54148
- const key = keys[i];
54149
- key >= sourceIndex && key < sourceIndex + sourceCount ? sourceVals.push(this.get(key)) : targetVals.push(this.get(key));
54150
- }
54151
- for (let i = 0; i < sourceCount; i++) this.put(insertIndex + i, sourceVals[i]);
54152
- for (let i = 0; i < targetVals.length; i++) this.put(sourceIndex + i, targetVals[i]);
54153
- }
54167
+ const values = [];
54168
+ for (let i = sourceIndex + sourceCount - 1; i >= sourceIndex; i--) values.push({
54169
+ position: i,
54170
+ value: this.get(i)
54171
+ }), this.delete(i);
54172
+ for (let i = 0; i < sourceCount; i++) this.insert(insertIndex, values[i].value);
54154
54173
  }
54155
54174
  }
54156
54175
  function indexFirst(arr, elm) {
@@ -54161,7 +54180,8 @@
54161
54180
  if (arr[i] === elm) return i;
54162
54181
  arr[i] > elm ? high = i - 1 : low = i + 1;
54163
54182
  }
54164
- return high < 0 ? 0 : high;
54183
+ const tempI = high < 0 ? 0 : high;
54184
+ return arr[tempI] === elm ? tempI : -1;
54165
54185
  }
54166
54186
 
54167
54187
  class RowSeriesNumberHelper {
@@ -54577,6 +54597,34 @@
54577
54597
  row: -1
54578
54598
  };
54579
54599
  }
54600
+ function getColAtRelativePosition(x, _this) {
54601
+ let leftFrozen = !1;
54602
+ (x -= _this.tableX) > 0 && x < _this.getFrozenColsWidth() && (leftFrozen = !0);
54603
+ let rightFrozen = !1;
54604
+ x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth && x <= _this.getAllColsWidth() && (rightFrozen = !0);
54605
+ const colInfo = getTargetColAtConsiderRightFrozen((leftFrozen || rightFrozen ? x : x + _this.scrollLeft) + _this.tableX, rightFrozen, _this);
54606
+ if (colInfo) {
54607
+ const {
54608
+ col: col
54609
+ } = colInfo;
54610
+ return col;
54611
+ }
54612
+ return -1;
54613
+ }
54614
+ function getRowAtRelativePosition(y, _this) {
54615
+ let topFrozen = !1;
54616
+ (y -= _this.tableY) > 0 && y < _this.getFrozenRowsHeight() && (topFrozen = !0);
54617
+ let bottomFrozen = !1;
54618
+ y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight && y <= _this.getAllRowsHeight() && (bottomFrozen = !0);
54619
+ const rowInfo = getTargetRowAtConsiderBottomFrozen((topFrozen || bottomFrozen ? y : y + _this.scrollTop) + _this.tableY, bottomFrozen, _this);
54620
+ if (rowInfo) {
54621
+ const {
54622
+ row: row
54623
+ } = rowInfo;
54624
+ return row;
54625
+ }
54626
+ return -1;
54627
+ }
54580
54628
 
54581
54629
  function isValidAlignDomain(domain) {
54582
54630
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -55495,7 +55543,7 @@
55495
55543
  }
55496
55544
  constructor(container, options = {}) {
55497
55545
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
55498
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
55546
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
55499
55547
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
55500
55548
  options: options,
55501
55549
  container: container
@@ -56247,6 +56295,12 @@
56247
56295
  getCellAtRelativePosition(relativeX, relativeY) {
56248
56296
  return getCellAtRelativePosition(relativeX, relativeY, this);
56249
56297
  }
56298
+ getColAtRelativePosition(relativeX) {
56299
+ return getColAtRelativePosition(relativeX, this);
56300
+ }
56301
+ getRowAtRelativePosition(relativeY) {
56302
+ return getRowAtRelativePosition(relativeY, this);
56303
+ }
56250
56304
  _checkRowCol(col, row) {
56251
56305
  return col >= 0 && col < this.colCount && row >= 0 && row < this.rowCount;
56252
56306
  }
@@ -57630,6 +57684,22 @@
57630
57684
  height: !1
57631
57685
  };
57632
57686
  }
57687
+ isColumnSelected(col) {
57688
+ const selectRange = this.stateManager.select.ranges;
57689
+ for (let i = 0; i <= selectRange.length - 1; i++) {
57690
+ const range = selectRange[i];
57691
+ if (range.start.col <= col && range.end.col >= col && 0 === range.start.row && range.end.row === this.rowCount - 1) return !0;
57692
+ }
57693
+ return !1;
57694
+ }
57695
+ isRowSelected(row) {
57696
+ const selectRange = this.stateManager.select.ranges;
57697
+ for (let i = 0; i <= selectRange.length - 1; i++) {
57698
+ const range = selectRange[i];
57699
+ if (range.start.row <= row && range.end.row >= row && 0 === range.start.col && range.end.col === this.colCount - 1) return !0;
57700
+ }
57701
+ return !1;
57702
+ }
57633
57703
  }
57634
57704
 
57635
57705
  const chartTypes = {};
@@ -59621,13 +59691,14 @@
59621
59691
  }
59622
59692
  }
59623
59693
  canMoveHeaderPosition(source, target) {
59694
+ const dragColumnOrRow = this._table.stateManager.columnMove.movingColumnOrRow;
59624
59695
  if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) return !1;
59625
- if (!this.transpose && this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row)) {
59696
+ if (!this.transpose && (this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row) || "row" === dragColumnOrRow)) {
59626
59697
  const sourceIndex = this.getRecordShowIndexByCell(0, source.row),
59627
59698
  targetIndex = this.getRecordShowIndexByCell(0, target.row);
59628
59699
  return this._table.dataSource.canChangeOrder(sourceIndex, targetIndex);
59629
59700
  }
59630
- if (this.transpose && this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row) && (this.getBody(source.col + this.leftRowSeriesNumberColumnCount, source.row).isChildNode && this.getBody(target.col + this.leftRowSeriesNumberColumnCount, target.row).isChildNode ? (source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1, target.col = target.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1) : (source.col = source.col + this.leftRowSeriesNumberColumnCount, target.col = target.col + this.leftRowSeriesNumberColumnCount)), source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) return !1;
59701
+ if (this.transpose && (this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row) || "row" === dragColumnOrRow) && (this.getBody(source.col + this.leftRowSeriesNumberColumnCount, source.row).isChildNode && this.getBody(target.col + this.leftRowSeriesNumberColumnCount, target.row).isChildNode ? (source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1, target.col = target.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1) : (source.col = source.col + this.leftRowSeriesNumberColumnCount, target.col = target.col + this.leftRowSeriesNumberColumnCount)), source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) return !1;
59631
59702
  if ("disabled" === this._table.internalProps.frozenColDragHeaderMode && this._table.isFrozenColumn(target.col)) return !1;
59632
59703
  const sourceCellRange = this.getCellRange(source.col, source.row);
59633
59704
  if (this.isColumnHeader(source.col, source.row)) {
@@ -59639,7 +59710,7 @@
59639
59710
  return !1;
59640
59711
  }
59641
59712
  moveHeaderPosition(source, target) {
59642
- var _a, _b;
59713
+ var _a, _b, _c, _d, _e, _f, _g;
59643
59714
  if ((!(null === (_a = this._table.options.dragOrder) || void 0 === _a ? void 0 : _a.validateDragOrderOnEnd) || (null === (_b = this._table.options.dragOrder) || void 0 === _b ? void 0 : _b.validateDragOrderOnEnd(source, target))) && this.canMoveHeaderPosition(source, target)) {
59644
59715
  let sourceCellRange = this.getCellRange(source.col, source.row);
59645
59716
  if (this.isColumnHeader(source.col, source.row)) {
@@ -59651,8 +59722,18 @@
59651
59722
  const sourceIds = this._headerCellIds[row].splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
59652
59723
  sourceIds.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
59653
59724
  }
59725
+ if (null === (_c = this._table.options.dragOrder) || void 0 === _c ? void 0 : _c.maintainArrayDataOrder) for (let j = 0; j < (null === (_d = this._table.dataSource.dataSourceObj) || void 0 === _d ? void 0 : _d.records.length); j++) {
59726
+ const rowRecords = null === (_e = this._table.dataSource.dataSourceObj) || void 0 === _e ? void 0 : _e.records[j];
59727
+ if (Array.isArray(rowRecords)) {
59728
+ rowRecords.length - 1 < targetIndex && rowRecords.push(...Array(targetIndex - rowRecords.length + 1).fill(void 0));
59729
+ const sourceData = rowRecords.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
59730
+ sourceData.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(rowRecords, sourceData);
59731
+ }
59732
+ }
59654
59733
  const sourceColumns = this._columns.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
59655
- return sourceColumns.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._columns, sourceColumns), this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, targetIndex - this.leftRowSeriesNumberColumnCount), this.columnTree.reset(this.columnTree.tree.children), this._cellRangeMap = new Map(), {
59734
+ if (sourceColumns.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._columns, sourceColumns), null === (_f = this._table.options.dragOrder) || void 0 === _f ? void 0 : _f.maintainArrayDataOrder) for (let i = 0; i < this._columns.length; i++) this._columns[i].field = i;
59735
+ if (this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, targetIndex - this.leftRowSeriesNumberColumnCount), null === (_g = this._table.options.dragOrder) || void 0 === _g ? void 0 : _g.maintainArrayDataOrder) for (let i = 0; i < this.columnTree.tree.children.length; i++) this.columnTree.tree.children[i].field = i;
59736
+ return this.columnTree.reset(this.columnTree.tree.children), this._cellRangeMap = new Map(), {
59656
59737
  sourceIndex: sourceCellRange.start.col,
59657
59738
  targetIndex: targetIndex,
59658
59739
  sourceSize: sourceSize,
@@ -59679,7 +59760,7 @@
59679
59760
  moveType: "row"
59680
59761
  };
59681
59762
  }
59682
- if (this.isSeriesNumberInBody(source.col, source.row)) return {
59763
+ if (this.isSeriesNumberInBody(source.col, source.row) || "row" === this._table.stateManager.columnMove.movingColumnOrRow) return {
59683
59764
  sourceIndex: source.row,
59684
59765
  targetIndex: target.row,
59685
59766
  sourceSize: 1,
@@ -60651,14 +60732,17 @@
60651
60732
  get recordsCount() {
60652
60733
  return this.dataSource.records.length;
60653
60734
  }
60654
- updateColumns(columns, options) {
60735
+ updateColumns(columns, options = {
60736
+ clearColWidthCache: !1,
60737
+ clearRowHeightCache: !0
60738
+ }) {
60655
60739
  var _a, _b, _c, _d;
60656
60740
  this.scenegraph.clearCells();
60657
60741
  const oldHoverState = {
60658
60742
  col: this.stateManager.hover.cellPos.col,
60659
60743
  row: this.stateManager.hover.cellPos.row
60660
60744
  };
60661
- this.internalProps.columns = cloneDeepSpec(columns, ["children"]), generateAggregationForColumn(this), (null == options ? void 0 : options.clearColWidthCache) && this.internalProps._widthResizedColMap.clear(), this.options.columns = columns, this.internalProps.headerHelper.setTableColumnsEditor(), this._hasAutoImageColumn = void 0, this.refreshHeader(), null === (_b = (_a = this.dataSource).updateColumns) || void 0 === _b || _b.call(_a, this.internalProps.columns), this.records && checkHasAggregationOnColumnDefine(this.internalProps.columns) && this.dataSource.processRecords(null !== (_d = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records) && void 0 !== _d ? _d : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
60745
+ this.internalProps.columns = cloneDeepSpec(columns, ["children"]), generateAggregationForColumn(this), (null == options ? void 0 : options.clearColWidthCache) && this.internalProps._widthResizedColMap.clear(), this.options.columns = columns, this.internalProps.headerHelper.setTableColumnsEditor(), this._hasAutoImageColumn = void 0, this.refreshHeader(), null === (_b = (_a = this.dataSource).updateColumns) || void 0 === _b || _b.call(_a, this.internalProps.columns), this.records && checkHasAggregationOnColumnDefine(this.internalProps.columns) && this.dataSource.processRecords(null !== (_d = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records) && void 0 !== _d ? _d : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this.scenegraph.createSceneGraph(!(null == options ? void 0 : options.clearRowHeightCache)), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
60662
60746
  }
60663
60747
  _recreateSceneForStateChange() {
60664
60748
  var _a, _b;
@@ -60670,15 +60754,23 @@
60670
60754
  this._hasAutoImageColumn = void 0, this.refreshHeader(), this.records && checkHasAggregationOnColumnDefine(this.internalProps.columns) && this.dataSource.processRecords(null !== (_b = null === (_a = this.dataSource.dataSourceObj) || void 0 === _a ? void 0 : _a.records) && void 0 !== _b ? _b : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this._updateSize(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
60671
60755
  }
60672
60756
  addColumns(toAddColumns, colIndex, isMaintainArrayData = !0) {
60757
+ var _a;
60673
60758
  const columns = this.options.columns;
60674
- if (void 0 === colIndex ? (colIndex = columns.length, columns.push(...toAddColumns)) : columns.splice(colIndex, 0, ...toAddColumns), isMaintainArrayData) {
60759
+ void 0 === colIndex ? (colIndex = columns.length, columns.push(...toAddColumns)) : columns.splice(colIndex, 0, ...toAddColumns);
60760
+ for (let i = 0; i < toAddColumns.length; i++) this.colWidthsMap.addAndReorder(colIndex + i, null !== (_a = toAddColumns[i].width) && void 0 !== _a ? _a : this.internalProps.defaultColWidth);
60761
+ this.internalProps._colRangeWidthsMap.clear();
60762
+ const resizedColIndexs = Array.from(this.internalProps._widthResizedColMap.keys());
60763
+ for (let i = 0; i < resizedColIndexs.length; i++) resizedColIndexs[i] >= colIndex && (this.internalProps._widthResizedColMap.delete(resizedColIndexs[i]), this.internalProps._widthResizedColMap.add(resizedColIndexs[i] + toAddColumns.length));
60764
+ if (isMaintainArrayData) {
60675
60765
  for (let i = 0; i < columns.length; i++) columns[i].field = i;
60676
60766
  for (let i = 0; i < this.records.length; i++) {
60677
60767
  const record = this.records[i];
60678
60768
  Array.isArray(record) && record.splice(colIndex, 0, ...Array(toAddColumns.length).fill(void 0));
60679
60769
  }
60680
60770
  }
60681
- this.updateColumns(columns), this.fireListeners(TABLE_EVENT_TYPE.ADD_COLUMN, {
60771
+ this.updateColumns(columns, {
60772
+ clearRowHeightCache: !1
60773
+ }), this.fireListeners(TABLE_EVENT_TYPE.ADD_COLUMN, {
60682
60774
  columnIndex: colIndex,
60683
60775
  columnCount: toAddColumns.length,
60684
60776
  columns: columns
@@ -60687,12 +60779,20 @@
60687
60779
  deleteColumns(deleteColIndexs, isMaintainArrayData = !0) {
60688
60780
  const columns = this.options.columns;
60689
60781
  deleteColIndexs.sort((a, b) => b - a);
60690
- for (let i = 0; i < deleteColIndexs.length; i++) if (columns.splice(deleteColIndexs[i], 1), isMaintainArrayData) for (let j = 0; j < this.records.length; j++) {
60782
+ for (let i = 0; i < deleteColIndexs.length; i++) if (columns.splice(deleteColIndexs[i], 1), this.colWidthsMap.delAndReorder(deleteColIndexs[i]), this.internalProps._widthResizedColMap.delete(deleteColIndexs[i]), isMaintainArrayData) for (let j = 0; j < this.records.length; j++) {
60691
60783
  const record = this.records[j];
60692
60784
  Array.isArray(record) && record.splice(deleteColIndexs[i], 1);
60693
60785
  }
60786
+ this.internalProps._colRangeWidthsMap.clear();
60787
+ const resizedColIndexs = Array.from(this.internalProps._widthResizedColMap.keys());
60788
+ for (let i = 0; i < resizedColIndexs.length; i++) for (let j = 0; j < deleteColIndexs.length; j++) if (resizedColIndexs[i] > deleteColIndexs[j]) {
60789
+ this.internalProps._widthResizedColMap.delete(resizedColIndexs[i]), this.internalProps._widthResizedColMap.add(resizedColIndexs[i] - (deleteColIndexs.length - j));
60790
+ break;
60791
+ }
60694
60792
  if (isMaintainArrayData) for (let i = 0; i < columns.length; i++) columns[i].field = i;
60695
- this.updateColumns(columns), this.fireListeners(TABLE_EVENT_TYPE.DELETE_COLUMN, {
60793
+ this.updateColumns(columns, {
60794
+ clearRowHeightCache: !1
60795
+ }), this.fireListeners(TABLE_EVENT_TYPE.DELETE_COLUMN, {
60696
60796
  deleteColIndexs: deleteColIndexs,
60697
60797
  columns: columns
60698
60798
  });