@visactor/vtable-calendar 1.21.1 → 1.22.1

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) {
@@ -34794,6 +34794,8 @@
34794
34794
  AFTER_RENDER: "after_render",
34795
34795
  INITIALIZED: "initialized",
34796
34796
  UPDATED: "updated",
34797
+ AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
34798
+ AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
34797
34799
  CHANGE_CELL_VALUE: "change_cell_value",
34798
34800
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
34799
34801
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
@@ -34803,7 +34805,12 @@
34803
34805
  BUTTON_CLICK: "button_click",
34804
34806
  BEFORE_CACHE_CHART_IMAGE: "before_cache_chart_image",
34805
34807
  PASTED_DATA: "pasted_data",
34806
- PLUGIN_EVENT: "plugin_event"
34808
+ PLUGIN_EVENT: "plugin_event",
34809
+ ADD_RECORD: "add_record",
34810
+ DELETE_RECORD: "delete_record",
34811
+ UPDATE_RECORD: "update_record",
34812
+ ADD_COLUMN: "add_column",
34813
+ DELETE_COLUMN: "delete_column"
34807
34814
  };
34808
34815
 
34809
34816
  const judgeType = value => {
@@ -34854,7 +34861,7 @@
34854
34861
  maxing = !1,
34855
34862
  leading = !1,
34856
34863
  trailing = !0;
34857
- const useRAF = !wait && 0 !== wait && "function" == typeof requestAnimationFrame;
34864
+ const useRAF = !wait && 0 !== wait && "function" == typeof vglobal.getRequestAnimationFrame();
34858
34865
  if ("function" != typeof func) throw new TypeError("Expected a function");
34859
34866
  function invokeFunc(time) {
34860
34867
  const args = lastArgs,
@@ -34862,7 +34869,7 @@
34862
34869
  return lastThis = void 0, lastArgs = void 0, lastInvokeTime = time, result = func.apply(thisArg, args), result;
34863
34870
  }
34864
34871
  function startTimer(pendingFunc, wait) {
34865
- return useRAF ? requestAnimationFrame(pendingFunc) : setTimeout(pendingFunc, wait);
34872
+ return useRAF ? vglobal.getRequestAnimationFrame()(pendingFunc) : setTimeout(pendingFunc, wait);
34866
34873
  }
34867
34874
  function shouldInvoke(time) {
34868
34875
  const timeSinceLastCall = time - lastCallTime;
@@ -38555,7 +38562,7 @@
38555
38562
  }
38556
38563
  constructor(opt, dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel) {
38557
38564
  let _isGrouped;
38558
- isArray$7(null == dataConfig ? void 0 : dataConfig.groupByRules) && (rowHierarchyType = "tree", _isGrouped = !0), super(opt, dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel), this._isGrouped = _isGrouped, this._recordCache = [], this._fieldCache = {};
38565
+ isArray$7(null == dataConfig ? void 0 : dataConfig.groupByRules) && (_isGrouped = !0), super(opt, dataConfig, pagination, columns, rowHierarchyType, hierarchyExpandLevel), this._isGrouped = _isGrouped, this._recordCache = [], this._fieldCache = {};
38559
38566
  }
38560
38567
  getOriginalRecord(index) {
38561
38568
  return isNumber$4(index) && this._recordCache && this._recordCache[index] ? this._recordCache[index] : super.getOriginalRecord(index);
@@ -39171,9 +39178,13 @@
39171
39178
  })];
39172
39179
  }
39173
39180
  function _setRecords(table, records = []) {
39181
+ const tableWithPlugins = table;
39174
39182
  _dealWithUpdateDataSource(table, () => {
39183
+ var _a;
39175
39184
  table.internalProps.records = records;
39176
- const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, table.internalProps.layoutMap.rowHierarchyType, getHierarchyExpandLevel(table));
39185
+ let rowHierarchyType = table.internalProps.layoutMap.rowHierarchyType;
39186
+ isArray$7(null === (_a = table.internalProps.dataConfig) || void 0 === _a ? void 0 : _a.groupByRules) && (rowHierarchyType = "tree"), tableWithPlugins.pluginManager.getPluginByName("Master Detail Plugin") && (rowHierarchyType = "grid");
39187
+ const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.columns, rowHierarchyType, getHierarchyExpandLevel(table));
39177
39188
  table.addReleaseObj(newDataSource);
39178
39189
  });
39179
39190
  }
@@ -40665,14 +40676,28 @@
40665
40676
  } else "mark" === child.name && child.setAttribute("x", cellGroup.attribute.width);
40666
40677
  }), autoRowHeight) {
40667
40678
  let newHeight = Math.max(leftIconHeight, contentHeight, rightIconHeight);
40668
- if (isCellHeightUpdate(scene, cellGroup, Math.round(newHeight + padding[0] + padding[2]), oldCellHeight)) return !0;
40679
+ if (isCellHeightUpdate(scene, cellGroup, Math.round(newHeight + padding[0] + padding[2]), oldCellHeight)) return scene.table.hasListeners(TABLE_EVENT_TYPE.AFTER_UPDATE_CELL_CONTENT_WIDTH) && scene.table.fireListeners(TABLE_EVENT_TYPE.AFTER_UPDATE_CELL_CONTENT_WIDTH, {
40680
+ col: cellGroup.col,
40681
+ row: cellGroup.row,
40682
+ cellHeight: cellHeight,
40683
+ cellGroup: cellGroup,
40684
+ padding: padding,
40685
+ textBaseline: textBaseline
40686
+ }), !0;
40669
40687
  newHeight = (null !== (_d = cellGroup.contentHeight) && void 0 !== _d ? _d : cellHeight) - (padding[0] + padding[2]), cellGroup.forEachChildren(child => {
40670
40688
  "rect" !== child.type && "chart" !== child.type && child.name !== CUSTOM_CONTAINER_NAME$1 && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", padding[0] + (newHeight - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", padding[0] + newHeight - child.AABBBounds.height()) : child.setAttribute("y", padding[0]));
40671
40689
  });
40672
40690
  } else "middle" !== textBaseline && "bottom" !== textBaseline || cellGroup.forEachChildren(child => {
40673
40691
  "rect" !== child.type && "chart" !== child.type && child.name !== CUSTOM_CONTAINER_NAME$1 && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", (cellHeight - padding[2] + padding[0] - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", cellHeight - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]));
40674
40692
  });
40675
- return !1;
40693
+ return scene.table.hasListeners(TABLE_EVENT_TYPE.AFTER_UPDATE_CELL_CONTENT_WIDTH) && scene.table.fireListeners(TABLE_EVENT_TYPE.AFTER_UPDATE_CELL_CONTENT_WIDTH, {
40694
+ col: cellGroup.col,
40695
+ row: cellGroup.row,
40696
+ cellHeight: cellHeight,
40697
+ cellGroup: cellGroup,
40698
+ padding: padding,
40699
+ textBaseline: textBaseline
40700
+ }), !1;
40676
40701
  }
40677
40702
  function updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline, table) {
40678
40703
  var _a;
@@ -42759,14 +42784,15 @@
42759
42784
  symbolX = 0,
42760
42785
  symbolY = 0,
42761
42786
  symbolRotate = Math.PI;
42762
- const linePoints = [];
42763
- 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({
42764
42790
  x: 0,
42765
42791
  y: 0
42766
42792
  }), linePoints.push({
42767
42793
  x: 0,
42768
42794
  y: this.table.tableNoFrameHeight
42769
- })) : ("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({
42770
42796
  x: 0,
42771
42797
  y: 0
42772
42798
  }), linePoints.push({
@@ -43750,7 +43776,7 @@
43750
43776
  isValid$3(count) && (batchRenderChartCount = count);
43751
43777
  }
43752
43778
  function clearChartRenderQueue() {
43753
- chartRenderKeys = [], chartRenderQueueList = [], isHandlingChartQueue = !1, cancelAnimationFrame(requestAnimationFrameId);
43779
+ chartRenderKeys = [], chartRenderQueueList = [], isHandlingChartQueue = !1, vglobal.getCancelAnimationFrame()(requestAnimationFrameId);
43754
43780
  }
43755
43781
  function IsHandlingChartQueue() {
43756
43782
  return isHandlingChartQueue;
@@ -43829,7 +43855,7 @@
43829
43855
  tickMode: null === (_e = axis.tick) || void 0 === _e ? void 0 : _e.tickMode
43830
43856
  }
43831
43857
  }, !0);
43832
- }), 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 {
43833
43859
  const dataBatch = [];
43834
43860
  for (const dataIdStr in dataId) {
43835
43861
  const dataIdAndField = dataId[dataIdStr],
@@ -43843,7 +43869,7 @@
43843
43869
  fields: null === (_e = null == series ? void 0 : series.data) || void 0 === _e ? void 0 : _e.fields
43844
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 : []);
43845
43871
  }
43846
- 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);
43847
43873
  }
43848
43874
  table.fireListeners("before_cache_chart_image", {
43849
43875
  chartInstance: chartInstance
@@ -43851,7 +43877,7 @@
43851
43877
  cacheStageCanvas(chartInstance.getStage(), chart);
43852
43878
  }
43853
43879
  function startRenderChartQueue(table) {
43854
- isHandlingChartQueue = !0, chartRenderQueueList.length > 0 ? requestAnimationFrameId = requestAnimationFrame(() => {
43880
+ isHandlingChartQueue = !0, chartRenderQueueList.length > 0 ? requestAnimationFrameId = vglobal.getRequestAnimationFrame()(() => {
43855
43881
  const chartsToRender = chartRenderQueueList.splice(0, batchRenderChartCount);
43856
43882
  chartRenderKeys.splice(0, batchRenderChartCount), chartsToRender.forEach(chart => {
43857
43883
  renderChart(chart), chart.addUpdateBoundTag();
@@ -44790,10 +44816,12 @@
44790
44816
  actualWidth = 0;
44791
44817
  for (let col = 0; col < table.colCount; col++) {
44792
44818
  const colWidth = update && null !== (_f = newWidths[col]) && void 0 !== _f ? _f : table.getColWidth(col);
44793
- (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;
44794
44820
  }
44795
44821
  if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
44796
- 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);
44797
44825
  }
44798
44826
  }
44799
44827
  if (update) {
@@ -46269,7 +46297,8 @@
46269
46297
  } else if (this.rowEnd === this.bodyBottomRow) {
46270
46298
  const cellGroup = this.table.scenegraph.highPerformanceGetCell(this.colStart, this.rowEnd, !0);
46271
46299
  if ("cell" === cellGroup.role) {
46272
- const deltaY = cellGroup.attribute.y + cellGroup.attribute.height - (this.table.getAllRowsHeight() - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight());
46300
+ const actualRowHeight = this.table.getRowHeight(this.rowEnd),
46301
+ deltaY = cellGroup.attribute.y + actualRowHeight - (this.table.getAllRowsHeight() - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight());
46273
46302
  this.deltaY = -deltaY;
46274
46303
  }
46275
46304
  } else if (isValid$3(screenTopY) && isValid$3(screenTopRow)) {
@@ -46410,6 +46439,11 @@
46410
46439
  width: colsWidth,
46411
46440
  height: rowsHeight,
46412
46441
  visible: !0
46442
+ }), table.hasListeners(TABLE_EVENT_TYPE.AFTER_UPDATE_SELECT_BORDER_HEIGHT) && table.fireListeners(TABLE_EVENT_TYPE.AFTER_UPDATE_SELECT_BORDER_HEIGHT, {
46443
+ startRow: computeRectCellRangeStartRow,
46444
+ endRow: computeRectCellRangeEndRow,
46445
+ currentHeight: rowsHeight,
46446
+ selectComp: selectComp
46413
46447
  }), selectComp.fillhandle) {
46414
46448
  const fillHandle = null === (_a = scene.table.options.excelOptions) || void 0 === _a ? void 0 : _a.fillHandle;
46415
46449
  let lastCellBound,
@@ -48439,7 +48473,7 @@
48439
48473
  var _a, _b, _c, _d, _e, _f;
48440
48474
  const firstBodyCell = null !== (_b = null === (_a = this.bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.firstChild) && void 0 !== _b ? _b : null === (_c = this.rowHeaderGroup.firstChild) || void 0 === _c ? void 0 : _c.firstChild,
48441
48475
  lastBodyCell = null !== (_e = null === (_d = this.bodyGroup.firstChild) || void 0 === _d ? void 0 : _d.lastChild) && void 0 !== _e ? _e : null === (_f = this.rowHeaderGroup.firstChild) || void 0 === _f ? void 0 : _f.lastChild;
48442
- 0 === y && firstBodyCell && firstBodyCell.row === this.table.frozenRowCount && firstBodyCell.attribute.y + y < 0 ? y = -firstBodyCell.attribute.y : lastBodyCell && this.table.tableNoFrameHeight < this.table.getAllRowsHeight() && lastBodyCell.row === this.table.rowCount - this.table.bottomFrozenRowCount - 1 && lastBodyCell.attribute.y + lastBodyCell.attribute.height + y < this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight() && (y = this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight() - lastBodyCell.attribute.y - lastBodyCell.attribute.height), this.colHeaderGroup.attribute.height + y !== this.bodyGroup.attribute.y && (this.bodyGroup.setAttribute("y", this.colHeaderGroup.attribute.height + y), this.rowHeaderGroup.setAttribute("y", this.cornerHeaderGroup.attribute.height + y), this.table.rightFrozenColCount > 0 && this.rightFrozenGroup.setAttribute("y", this.rightTopCornerGroup.attribute.height + y), this.updateNextFrame());
48476
+ 0 === y && firstBodyCell && firstBodyCell.row === this.table.frozenRowCount && firstBodyCell.attribute.y + y < 0 ? y = -firstBodyCell.attribute.y : lastBodyCell && this.table.tableNoFrameHeight < this.table.getAllRowsHeight() && lastBodyCell.row === this.table.rowCount - this.table.bottomFrozenRowCount - 1 && lastBodyCell.attribute.y + this.table.getRowHeight(lastBodyCell.row) + y < this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight() && (y = this.table.tableNoFrameHeight - this.table.getFrozenRowsHeight() - this.table.getBottomFrozenRowsHeight() - lastBodyCell.attribute.y - this.table.getRowHeight(lastBodyCell.row)), this.colHeaderGroup.attribute.height + y !== this.bodyGroup.attribute.y && (this.bodyGroup.setAttribute("y", this.colHeaderGroup.attribute.height + y), this.rowHeaderGroup.setAttribute("y", this.cornerHeaderGroup.attribute.height + y), this.table.rightFrozenColCount > 0 && this.rightFrozenGroup.setAttribute("y", this.rightTopCornerGroup.attribute.height + y), this.updateNextFrame());
48443
48477
  }
48444
48478
  setBodyAndColHeaderX(x) {
48445
48479
  const firstBodyCol = this.bodyGroup.firstChild,
@@ -48472,12 +48506,12 @@
48472
48506
  actualWidth = 0;
48473
48507
  for (let col = 0; col < table.colCount; col++) {
48474
48508
  const colWidth = table.getColWidth(col);
48475
- (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;
48476
48510
  }
48477
48511
  if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
48478
- const startCol = table.rowHeaderLevelCount,
48479
- endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
48480
- 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);
48481
48515
  }
48482
48516
  }
48483
48517
  let bodyWidth = 0;
@@ -49442,24 +49476,26 @@
49442
49476
  return target;
49443
49477
  }
49444
49478
 
49445
- function startMoveCol(col, row, x, y, state, event) {
49479
+ function startMoveCol(col, row, x, y, state, event, dragColumnOrRow) {
49446
49480
  var _a;
49447
49481
  if (!("canMoveHeaderPosition" in state.table.internalProps.layoutMap)) return;
49448
- 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()) {
49449
49483
  const nodeIndex = state.table.getRecordIndexByCell(col, row),
49450
49484
  nodeData = state.table.getRecordByCell(col, row),
49451
49485
  hierarchyState = state.table.getRecordHierarchyState(col, row);
49452
49486
  state.columnMove.rowSourceSize = computeChildrenNodeLength(nodeIndex, hierarchyState, nodeData) + 1;
49453
49487
  }
49454
- state.columnMove.x = x - state.table.tableX, state.columnMove.y = y - state.table.tableY;
49455
- const cellLocation = state.table.getCellLocation(col, row),
49456
- delta = "columnHeader" === cellLocation ? state.columnMove.x : "rowHeader" === cellLocation || state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row) ? state.columnMove.y : 0,
49457
- {
49458
- backX: backX,
49459
- lineX: lineX,
49460
- backY: backY,
49461
- lineY: lineY
49462
- } = 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);
49463
49499
  state.table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START, {
49464
49500
  col: col,
49465
49501
  row: row,
@@ -49469,7 +49505,8 @@
49469
49505
  lineX: lineX,
49470
49506
  backY: backY,
49471
49507
  lineY: lineY,
49472
- event: event
49508
+ event: event,
49509
+ movingColumnOrRow: dragColumnOrRow
49473
49510
  });
49474
49511
  const isHasSelected = !!(null === (_a = state.select.ranges) || void 0 === _a ? void 0 : _a.length);
49475
49512
  state.table.stateManager.updateSelectPos(-1, -1), state.table.stateManager.endSelectCells(!0, isHasSelected), state.table.scenegraph.updateNextFrame();
@@ -49499,7 +49536,7 @@
49499
49536
  let lineX, backX, lineY, backY;
49500
49537
  state.updateCursor("grabbing");
49501
49538
  const cellLocation = state.table.getCellLocation(state.columnMove.colSource, state.columnMove.rowSource);
49502
- "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, {
49503
49540
  col: col,
49504
49541
  row: row,
49505
49542
  x: x,
@@ -49508,14 +49545,15 @@
49508
49545
  lineX: lineX,
49509
49546
  backY: backY,
49510
49547
  lineY: lineY,
49511
- event: event
49548
+ event: event,
49549
+ movingColumnOrRow: state.columnMove.movingColumnOrRow
49512
49550
  }), state.table.scenegraph.updateNextFrame();
49513
49551
  } else state.updateCursor("not-allowed"), state.columnMove.colTarget = state.columnMove.colSource, state.columnMove.rowTarget = state.columnMove.rowSource;
49514
49552
  }
49515
49553
  function endMoveCol(state) {
49516
49554
  var _a, _b;
49517
49555
  let moveColResult = !1;
49518
- 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)) {
49519
49557
  const oldSourceMergeInfo = state.table.getCellRange(state.columnMove.colSource, state.columnMove.rowSource),
49520
49558
  oldTargetMergeInfo = state.table.getCellRange(state.columnMove.colTarget, state.columnMove.rowTarget),
49521
49559
  moveContext = state.table._moveHeaderPosition({
@@ -49525,7 +49563,9 @@
49525
49563
  col: state.columnMove.colTarget,
49526
49564
  row: state.columnMove.rowTarget
49527
49565
  });
49528
- 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;
49529
49569
  {
49530
49570
  state.table.internalProps.useOneRowHeightFillAll = !1, state.table.internalProps.layoutMap.clearCellRangeMap();
49531
49571
  const sourceMergeInfo = state.table.getCellRange(state.columnMove.colSource, state.columnMove.rowSource),
@@ -49534,11 +49574,11 @@
49534
49574
  colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col),
49535
49575
  rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
49536
49576
  let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
49537
- "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;
49538
49578
  }
49539
49579
  }
49540
49580
  return state.columnMove.moving = !1, setTimeout(() => {
49541
- 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;
49542
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;
49543
49583
  }
49544
49584
  function clearWidthsAndHeightsCache(colMin, colMax, rowMin, rowMax, table) {
@@ -49576,6 +49616,7 @@
49576
49616
  }
49577
49617
 
49578
49618
  function updateResizeColumn(xInTable, yInTable, state) {
49619
+ var _a;
49579
49620
  xInTable = Math.ceil(xInTable), yInTable = Math.ceil(yInTable);
49580
49621
  let detaX = state.columnResize.isRightFrozen ? state.columnResize.x - xInTable : xInTable - state.columnResize.x;
49581
49622
  if (Math.abs(detaX) < 1) return;
@@ -49600,7 +49641,9 @@
49600
49641
  }
49601
49642
  rightColWidth - detaX < state.table.internalProps.limitMinWidth && (detaX = rightColWidth - state.table.internalProps.limitMinWidth);
49602
49643
  }
49603
- 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();
49604
49647
  }
49605
49648
  function updateResizeColForColumn(detaX, state) {
49606
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));
@@ -49914,6 +49957,7 @@
49914
49957
  }
49915
49958
 
49916
49959
  function updateResizeRow(xInTable, yInTable, state) {
49960
+ var _a;
49917
49961
  xInTable = Math.ceil(xInTable), yInTable = Math.ceil(yInTable);
49918
49962
  let detaY = state.rowResize.isBottomFrozen ? state.rowResize.y - yInTable : yInTable - state.rowResize.y;
49919
49963
  if (Math.abs(detaY) < 1) return;
@@ -49923,7 +49967,9 @@
49923
49967
  let bottomRowHeight = state.table.getRowHeight(state.rowResize.row + 1);
49924
49968
  bottomRowHeight -= detaY, bottomRowHeight - detaY < state.table.internalProps.limitMinHeight && (detaY = bottomRowHeight - state.table.internalProps.limitMinHeight);
49925
49969
  }
49926
- 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();
49927
49973
  }
49928
49974
  function updateResizeColForRow(detaY, state) {
49929
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));
@@ -50095,7 +50141,8 @@
50095
50141
  rowTargetSize: 0,
50096
50142
  x: 0,
50097
50143
  y: 0,
50098
- moving: !1
50144
+ moving: !1,
50145
+ movingColumnOrRow: void 0
50099
50146
  }, this.menu = {
50100
50147
  x: -1,
50101
50148
  y: -1,
@@ -50162,7 +50209,8 @@
50162
50209
  rowTargetSize: 0,
50163
50210
  x: 0,
50164
50211
  y: 0,
50165
- moving: !1
50212
+ moving: !1,
50213
+ movingColumnOrRow: void 0
50166
50214
  }, this.menu = {
50167
50215
  x: -1,
50168
50216
  y: -1,
@@ -50329,7 +50377,7 @@
50329
50377
  if (this.select.selecting) {
50330
50378
  if (this.select.selecting = !1, 0 === this.select.ranges.length) return;
50331
50379
  const currentRange = this.select.ranges[this.select.ranges.length - 1];
50332
- 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);
50333
50381
  let isSame = !1;
50334
50382
  for (let i = 0; i < this.select.ranges.length - 1; i++) {
50335
50383
  const range = this.select.ranges[i];
@@ -50385,8 +50433,8 @@
50385
50433
  direction: this.fillHandle.direction
50386
50434
  }), this.fillHandle.beforeFillMaxCol = void 0, this.fillHandle.beforeFillMaxRow = void 0, this.fillHandle.beforeFillMinCol = void 0, this.fillHandle.beforeFillMinRow = void 0;
50387
50435
  }
50388
- startMoveCol(col, row, x, y, event) {
50389
- startMoveCol(col, row, x, y, this, event);
50436
+ startMoveCol(col, row, x, y, event, dragColumnOrRow) {
50437
+ startMoveCol(col, row, x, y, this, event, dragColumnOrRow);
50390
50438
  }
50391
50439
  updateMoveCol(col, row, x, y, event) {
50392
50440
  updateMoveCol(col, row, x, y, this, event);
@@ -51043,7 +51091,7 @@
51043
51091
  this.scrollHandle = scrollHandle;
51044
51092
  }
51045
51093
  startInertia(speedX, speedY, friction) {
51046
- 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)));
51047
51095
  }
51048
51096
  inertia() {
51049
51097
  var _a;
@@ -51055,10 +51103,10 @@
51055
51103
  newSpeedY = f * this.speedY;
51056
51104
  let dx = 0,
51057
51105
  dy = 0;
51058
- 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)));
51059
51107
  }
51060
51108
  endInertia() {
51061
- cancelAnimationFrame(this.runingId), this.runingId = null;
51109
+ vglobal.getCancelAnimationFrame()(this.runingId), this.runingId = null;
51062
51110
  }
51063
51111
  isInertiaScrolling() {
51064
51112
  return !!this.runingId;
@@ -51073,7 +51121,8 @@
51073
51121
  colSource: colSource,
51074
51122
  rowSource: rowSource,
51075
51123
  colTarget: colTarget,
51076
- rowTarget: rowTarget
51124
+ rowTarget: rowTarget,
51125
+ movingColumnOrRow: movingColumnOrRow
51077
51126
  } = table.stateManager.columnMove,
51078
51127
  rowSourceSize = null !== (_e = table.stateManager.columnMove.rowSourceSize) && void 0 !== _e ? _e : 0,
51079
51128
  rowTargetSize = null !== (_f = table.stateManager.columnMove.rowTargetSize) && void 0 !== _f ? _f : 0;
@@ -51086,6 +51135,7 @@
51086
51135
  col: colSource,
51087
51136
  row: rowSource
51088
51137
  },
51138
+ movingColumnOrRow: movingColumnOrRow,
51089
51139
  event: e
51090
51140
  });
51091
51141
  }
@@ -51101,6 +51151,7 @@
51101
51151
  col: table.stateManager.columnMove.colSource,
51102
51152
  row: table.stateManager.columnMove.rowSource
51103
51153
  },
51154
+ movingColumnOrRow: table.stateManager.columnMove.movingColumnOrRow,
51104
51155
  event: e
51105
51156
  });
51106
51157
  }
@@ -51126,7 +51177,7 @@
51126
51177
  event: e.nativeEvent,
51127
51178
  target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
51128
51179
  mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
51129
- }), 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))));
51130
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);
51131
51182
  const cellGoup = e.path.find(node => "cell" === node.role);
51132
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, {
@@ -51441,8 +51492,9 @@
51441
51492
  (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null);
51442
51493
  }
51443
51494
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
51495
+ var _a, _b, _c;
51444
51496
  const eventArgsSet = getCellEventArgsSet(e);
51445
- stateManager.isResizeCol() || eventManager.checkColumnResize(eventArgsSet) ? table.stateManager.select && eventManager.checkCellFillhandle(eventArgsSet) ? stateManager.updateCursor("crosshair") : stateManager.updateCursor("col-resize") : stateManager.isResizeRow() || eventManager.checkRowResize(eventArgsSet) ? table.stateManager.select && eventManager.checkCellFillhandle(eventArgsSet) ? stateManager.updateCursor("crosshair") : stateManager.updateCursor("row-resize") : stateManager.isMoveCol() || stateManager.updateCursor();
51497
+ null !== (_c = null === (_b = null === (_a = e.target) || void 0 === _a ? void 0 : _a.isDescendantsOf) || void 0 === _b ? void 0 : _b.call(_a, table.scenegraph.tableGroup)) && void 0 !== _c && _c && (stateManager.isResizeCol() || eventManager.checkColumnResize(eventArgsSet) ? table.stateManager.select && eventManager.checkCellFillhandle(eventArgsSet) ? stateManager.updateCursor("crosshair") : stateManager.updateCursor("col-resize") : stateManager.isResizeRow() || eventManager.checkRowResize(eventArgsSet) ? table.stateManager.select && eventManager.checkCellFillhandle(eventArgsSet) ? stateManager.updateCursor("crosshair") : stateManager.updateCursor("row-resize") : stateManager.isMoveCol() || stateManager.updateCursor());
51446
51498
  }), table.scenegraph.tableGroup.addEventListener("checkbox_state_change", e => {
51447
51499
  var _a, _b;
51448
51500
  const eventArgsSet = getCellEventArgsSet(e),
@@ -51795,7 +51847,7 @@
51795
51847
  !1 !== (null === (_a = table.eventOptions) || void 0 === _a ? void 0 : _a.preventDefaultContextMenu) ? e.preventDefault() : globalPointerupCallback(e);
51796
51848
  }), table.options.canvas || handler.on(table.getContainer(), "resize", e => {
51797
51849
  var _a;
51798
- 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());
51799
51851
  });
51800
51852
  const globalPointerdownCallback = e => {
51801
51853
  var _a;
@@ -51877,10 +51929,10 @@
51877
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, {
51878
51930
  col: table.stateManager.columnResize.col,
51879
51931
  colWidth: table.getColWidth(table.stateManager.columnResize.col)
51880
- })) : 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, {
51881
51933
  row: table.stateManager.rowResize.row,
51882
51934
  rowHeight: table.getRowHeight(table.stateManager.rowResize.row)
51883
- })));
51935
+ })) : stateManager.isMoveCol() && eventManager.dealColumnMover(x, y, e));
51884
51936
  const isSelecting = table.stateManager.isSelecting();
51885
51937
  if (eventManager._enableTableScroll && eventManager.isDraging && isSelecting && (null === (_e = table.stateManager.select.ranges) || void 0 === _e ? void 0 : _e.length) > 0) {
51886
51938
  const drawRange = table.getDrawRange(),
@@ -52494,12 +52546,10 @@
52494
52546
  } = eventArgsSet;
52495
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);
52496
52548
  }
52497
- dealColumnMover(eventArgsSet) {
52498
- var _a;
52499
- const {
52500
- eventArgs: eventArgs
52501
- } = eventArgsSet;
52502
- 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);
52503
52553
  }
52504
52554
  startColumnResize(eventArgsSet) {}
52505
52555
  dealIconClick(e, eventArgsSet) {
@@ -53966,12 +54016,12 @@
53966
54016
  clearRange() {
53967
54017
  this.cumulativeSum.clear(), this.difference.clear();
53968
54018
  }
53969
- add(position, value) {
54019
+ _add(position, value) {
53970
54020
  if (!isValid$3(value)) return;
53971
54021
  const defaultValue = this.table.getRowHeight(position);
53972
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);
53973
54023
  }
53974
- remove(position) {
54024
+ _remove(position) {
53975
54025
  if (this.data.has(position)) {
53976
54026
  const value = this.data.get(position);
53977
54027
  this.data.delete(position);
@@ -53988,7 +54038,7 @@
53988
54038
  this.data.set(position, newValue);
53989
54039
  const difference = newValue - oldValue;
53990
54040
  this.totalSum += difference, this.updateDifference(position, difference);
53991
- } else this.add(position, newValue);
54041
+ } else this._add(position, newValue);
53992
54042
  }
53993
54043
  get(position) {
53994
54044
  return this.data.get(position);
@@ -54055,21 +54105,38 @@
54055
54105
  }
54056
54106
  insert(position, value) {
54057
54107
  for (let i = position; i <= this.getLastIndex(); i++) this.cumulativeSum.delete(i);
54058
- const lastIndex = this.getLastIndex() + 1;
54059
- 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);
54060
54119
  }
54061
54120
  getLastIndex() {
54062
54121
  return this._sort(), this._keys[this._keys.length - 1];
54063
54122
  }
54064
54123
  delLast() {
54065
54124
  const lastIndex = this.getLastIndex();
54066
- this.remove(lastIndex);
54125
+ this._remove(lastIndex);
54067
54126
  }
54068
54127
  delete(position) {
54069
- if (!this.has(position)) return;
54070
54128
  for (let i = position; i <= this.getLastIndex(); i++) this.cumulativeSum.delete(i);
54071
54129
  const lastIndex = this.getLastIndex();
54072
- 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);
54073
54140
  }
54074
54141
  adjustOrder(sourceIndex, targetIndex, moveCount) {
54075
54142
  this.clearRange(), this._sort();
@@ -54097,28 +54164,12 @@
54097
54164
  }
54098
54165
  }
54099
54166
  exchangeOrder(sourceIndex, sourceCount, targetIndex, targetCount, insertIndex) {
54100
- const {
54101
- _keys: keys
54102
- } = this;
54103
- if (this._sorted || (keys.sort((a, b) => a < b ? -1 : a > b ? 1 : 0), this._sorted = !0), sourceIndex > targetIndex) {
54104
- const targetVals = [],
54105
- sourceVals = [];
54106
- for (let i = indexFirst(keys, targetIndex); i < indexFirst(keys, sourceIndex) + sourceCount; i++) {
54107
- const key = keys[i];
54108
- key >= sourceIndex && key < sourceIndex + sourceCount ? sourceVals.push(this.get(key)) : targetVals.push(this.get(key));
54109
- }
54110
- for (let i = 0; i < sourceCount; i++) this.put(insertIndex + i, sourceVals[i]);
54111
- for (let i = 0; i < targetVals.length; i++) this.put(insertIndex + sourceCount + i, targetVals[i]);
54112
- } else {
54113
- const targetVals = [],
54114
- sourceVals = [];
54115
- for (let i = indexFirst(keys, sourceIndex); i < indexFirst(keys, targetIndex) + targetCount; i++) {
54116
- const key = keys[i];
54117
- key >= sourceIndex && key < sourceIndex + sourceCount ? sourceVals.push(this.get(key)) : targetVals.push(this.get(key));
54118
- }
54119
- for (let i = 0; i < sourceCount; i++) this.put(insertIndex + i, sourceVals[i]);
54120
- for (let i = 0; i < targetVals.length; i++) this.put(sourceIndex + i, targetVals[i]);
54121
- }
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);
54122
54173
  }
54123
54174
  }
54124
54175
  function indexFirst(arr, elm) {
@@ -54129,7 +54180,8 @@
54129
54180
  if (arr[i] === elm) return i;
54130
54181
  arr[i] > elm ? high = i - 1 : low = i + 1;
54131
54182
  }
54132
- return high < 0 ? 0 : high;
54183
+ const tempI = high < 0 ? 0 : high;
54184
+ return arr[tempI] === elm ? tempI : -1;
54133
54185
  }
54134
54186
 
54135
54187
  class RowSeriesNumberHelper {
@@ -54545,6 +54597,34 @@
54545
54597
  row: -1
54546
54598
  };
54547
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
+ }
54548
54628
 
54549
54629
  function isValidAlignDomain(domain) {
54550
54630
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -55463,7 +55543,7 @@
55463
55543
  }
55464
55544
  constructor(container, options = {}) {
55465
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;
55466
- if (super(), this.showFrozenIcon = !0, this.version = "1.21.1", 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.1", 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");
55467
55547
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
55468
55548
  options: options,
55469
55549
  container: container
@@ -56215,6 +56295,12 @@
56215
56295
  getCellAtRelativePosition(relativeX, relativeY) {
56216
56296
  return getCellAtRelativePosition(relativeX, relativeY, this);
56217
56297
  }
56298
+ getColAtRelativePosition(relativeX) {
56299
+ return getColAtRelativePosition(relativeX, this);
56300
+ }
56301
+ getRowAtRelativePosition(relativeY) {
56302
+ return getRowAtRelativePosition(relativeY, this);
56303
+ }
56218
56304
  _checkRowCol(col, row) {
56219
56305
  return col >= 0 && col < this.colCount && row >= 0 && row < this.rowCount;
56220
56306
  }
@@ -57598,6 +57684,22 @@
57598
57684
  height: !1
57599
57685
  };
57600
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
+ }
57601
57703
  }
57602
57704
 
57603
57705
  const chartTypes = {};
@@ -59589,13 +59691,14 @@
59589
59691
  }
59590
59692
  }
59591
59693
  canMoveHeaderPosition(source, target) {
59694
+ const dragColumnOrRow = this._table.stateManager.columnMove.movingColumnOrRow;
59592
59695
  if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) return !1;
59593
- 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)) {
59594
59697
  const sourceIndex = this.getRecordShowIndexByCell(0, source.row),
59595
59698
  targetIndex = this.getRecordShowIndexByCell(0, target.row);
59596
59699
  return this._table.dataSource.canChangeOrder(sourceIndex, targetIndex);
59597
59700
  }
59598
- 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;
59599
59702
  if ("disabled" === this._table.internalProps.frozenColDragHeaderMode && this._table.isFrozenColumn(target.col)) return !1;
59600
59703
  const sourceCellRange = this.getCellRange(source.col, source.row);
59601
59704
  if (this.isColumnHeader(source.col, source.row)) {
@@ -59607,7 +59710,7 @@
59607
59710
  return !1;
59608
59711
  }
59609
59712
  moveHeaderPosition(source, target) {
59610
- var _a, _b;
59713
+ var _a, _b, _c, _d, _e, _f, _g;
59611
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)) {
59612
59715
  let sourceCellRange = this.getCellRange(source.col, source.row);
59613
59716
  if (this.isColumnHeader(source.col, source.row)) {
@@ -59619,8 +59722,18 @@
59619
59722
  const sourceIds = this._headerCellIds[row].splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
59620
59723
  sourceIds.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
59621
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
+ }
59622
59733
  const sourceColumns = this._columns.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
59623
- 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(), {
59624
59737
  sourceIndex: sourceCellRange.start.col,
59625
59738
  targetIndex: targetIndex,
59626
59739
  sourceSize: sourceSize,
@@ -59647,7 +59760,7 @@
59647
59760
  moveType: "row"
59648
59761
  };
59649
59762
  }
59650
- if (this.isSeriesNumberInBody(source.col, source.row)) return {
59763
+ if (this.isSeriesNumberInBody(source.col, source.row) || "row" === this._table.stateManager.columnMove.movingColumnOrRow) return {
59651
59764
  sourceIndex: source.row,
59652
59765
  targetIndex: target.row,
59653
59766
  sourceSize: 1,
@@ -60082,140 +60195,152 @@
60082
60195
  }
60083
60196
  function listTableAddRecord(record, recordIndex, table) {
60084
60197
  var _a, _b, _c, _d;
60085
- if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60086
- (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
60087
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
60088
- table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
60089
- const oldRowCount = table.rowCount;
60090
- if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
60091
- const newRowCount = table.transpose ? table.colCount : table.rowCount;
60092
- if (table.pagination) {
60093
- const {
60094
- perPageCount: perPageCount,
60095
- currentPage: currentPage
60096
- } = table.pagination,
60097
- endIndex = perPageCount * (currentPage || 0) + perPageCount;
60098
- if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60099
- const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
60100
- if (oldRowCount - headerCount === table.pagination.perPageCount) {
60101
- const updateRows = [];
60102
- for (let row = rowNum; row < newRowCount; row++) table.transpose ? updateRows.push({
60103
- col: row,
60104
- row: 0
60105
- }) : updateRows.push({
60106
- col: 0,
60107
- row: row
60108
- });
60109
- table.transpose ? table.scenegraph.updateCol([], [], updateRows) : table.scenegraph.updateRow([], [], updateRows);
60110
- } else {
60111
- const addRows = [];
60112
- for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) table.transpose ? addRows.push({
60113
- col: row,
60114
- row: 0
60115
- }) : addRows.push({
60116
- col: 0,
60117
- row: row
60118
- });
60119
- table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
60198
+ try {
60199
+ if (!record) return !1;
60200
+ if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60201
+ (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
60202
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
60203
+ table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
60204
+ const oldRowCount = table.rowCount;
60205
+ if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
60206
+ const newRowCount = table.transpose ? table.colCount : table.rowCount;
60207
+ if (table.pagination) {
60208
+ const {
60209
+ perPageCount: perPageCount,
60210
+ currentPage: currentPage
60211
+ } = table.pagination,
60212
+ endIndex = perPageCount * (currentPage || 0) + perPageCount;
60213
+ if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60214
+ const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
60215
+ if (oldRowCount - headerCount === table.pagination.perPageCount) {
60216
+ const updateRows = [];
60217
+ for (let row = rowNum; row < newRowCount; row++) table.transpose ? updateRows.push({
60218
+ col: row,
60219
+ row: 0
60220
+ }) : updateRows.push({
60221
+ col: 0,
60222
+ row: row
60223
+ });
60224
+ table.transpose ? table.scenegraph.updateCol([], [], updateRows) : table.scenegraph.updateRow([], [], updateRows);
60225
+ } else {
60226
+ const addRows = [];
60227
+ for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) table.transpose ? addRows.push({
60228
+ col: row,
60229
+ row: 0
60230
+ }) : addRows.push({
60231
+ col: 0,
60232
+ row: row
60233
+ });
60234
+ table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
60235
+ }
60120
60236
  }
60237
+ } else {
60238
+ const addRows = [];
60239
+ for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) table.transpose ? addRows.push({
60240
+ col: row,
60241
+ row: 0
60242
+ }) : addRows.push({
60243
+ col: 0,
60244
+ row: row
60245
+ });
60246
+ const updateRows = [],
60247
+ topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount,
60248
+ bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;
60249
+ for (let row = headerCount; row < headerCount + topAggregationCount; row++) table.transpose ? updateRows.push({
60250
+ col: row,
60251
+ row: 0
60252
+ }) : updateRows.push({
60253
+ col: 0,
60254
+ row: row
60255
+ });
60256
+ for (let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount; row < (table.transpose ? table.colCount : table.rowCount); row++) table.transpose ? updateRows.push({
60257
+ col: row,
60258
+ row: 0
60259
+ }) : updateRows.push({
60260
+ col: 0,
60261
+ row: row
60262
+ });
60263
+ table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
60121
60264
  }
60122
- } else {
60123
- const addRows = [];
60124
- for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) table.transpose ? addRows.push({
60125
- col: row,
60126
- row: 0
60127
- }) : addRows.push({
60128
- col: 0,
60129
- row: row
60130
- });
60131
- const updateRows = [],
60132
- topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount,
60133
- bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;
60134
- for (let row = headerCount; row < headerCount + topAggregationCount; row++) table.transpose ? updateRows.push({
60135
- col: row,
60136
- row: 0
60137
- }) : updateRows.push({
60138
- col: 0,
60139
- row: row
60140
- });
60141
- for (let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount; row < (table.transpose ? table.colCount : table.rowCount); row++) table.transpose ? updateRows.push({
60142
- col: row,
60143
- row: 0
60144
- }) : updateRows.push({
60145
- col: 0,
60146
- row: row
60147
- });
60148
- table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
60149
60265
  }
60266
+ return !0;
60267
+ } catch (error) {
60268
+ return !1;
60150
60269
  }
60151
60270
  }
60152
60271
  function listTableAddRecords(records, recordIndex, table) {
60153
60272
  var _a, _b, _c, _d;
60154
- if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60155
- void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
60156
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
60157
- table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
60158
- const oldRowCount = table.transpose ? table.colCount : table.rowCount;
60159
- if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
60160
- const newRowCount = table.transpose ? table.colCount : table.rowCount;
60161
- if (table.pagination) {
60162
- const {
60163
- perPageCount: perPageCount,
60164
- currentPage: currentPage
60165
- } = table.pagination,
60166
- endIndex = perPageCount * (currentPage || 0) + perPageCount;
60167
- if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60168
- const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
60169
- if (oldRowCount - headerCount === table.pagination.perPageCount) {
60170
- const updateRows = [];
60171
- for (let row = rowNum; row < newRowCount; row++) table.transpose ? updateRows.push({
60172
- col: row,
60173
- row: 0
60174
- }) : updateRows.push({
60175
- col: 0,
60176
- row: row
60177
- });
60178
- table.transpose ? table.scenegraph.updateCol([], [], updateRows) : table.scenegraph.updateRow([], [], updateRows);
60179
- } else {
60180
- const addRows = [];
60181
- for (let row = rowNum; row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1)); row++) table.transpose ? addRows.push({
60182
- col: row,
60183
- row: 0
60184
- }) : addRows.push({
60185
- col: 0,
60186
- row: row
60187
- });
60188
- table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
60273
+ try {
60274
+ if (!records || 0 === records.length) return !1;
60275
+ if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60276
+ void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
60277
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
60278
+ table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
60279
+ const oldRowCount = table.transpose ? table.colCount : table.rowCount;
60280
+ if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
60281
+ const newRowCount = table.transpose ? table.colCount : table.rowCount;
60282
+ if (table.pagination) {
60283
+ const {
60284
+ perPageCount: perPageCount,
60285
+ currentPage: currentPage
60286
+ } = table.pagination,
60287
+ endIndex = perPageCount * (currentPage || 0) + perPageCount;
60288
+ if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60289
+ const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
60290
+ if (oldRowCount - headerCount === table.pagination.perPageCount) {
60291
+ const updateRows = [];
60292
+ for (let row = rowNum; row < newRowCount; row++) table.transpose ? updateRows.push({
60293
+ col: row,
60294
+ row: 0
60295
+ }) : updateRows.push({
60296
+ col: 0,
60297
+ row: row
60298
+ });
60299
+ table.transpose ? table.scenegraph.updateCol([], [], updateRows) : table.scenegraph.updateRow([], [], updateRows);
60300
+ } else {
60301
+ const addRows = [];
60302
+ for (let row = rowNum; row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1)); row++) table.transpose ? addRows.push({
60303
+ col: row,
60304
+ row: 0
60305
+ }) : addRows.push({
60306
+ col: 0,
60307
+ row: row
60308
+ });
60309
+ table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
60310
+ }
60189
60311
  }
60312
+ } else {
60313
+ const addRows = [];
60314
+ for (let row = recordIndex + headerCount; row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1); row++) table.transpose ? addRows.push({
60315
+ col: row,
60316
+ row: 0
60317
+ }) : addRows.push({
60318
+ col: 0,
60319
+ row: row
60320
+ });
60321
+ const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount,
60322
+ bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount,
60323
+ updateRows = [];
60324
+ for (let row = headerCount; row < headerCount + topAggregationCount; row++) table.transpose ? updateRows.push({
60325
+ col: row,
60326
+ row: 0
60327
+ }) : updateRows.push({
60328
+ col: 0,
60329
+ row: row
60330
+ });
60331
+ for (let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount; row < (table.transpose ? table.colCount : table.rowCount); row++) table.transpose ? updateRows.push({
60332
+ col: row,
60333
+ row: 0
60334
+ }) : updateRows.push({
60335
+ col: 0,
60336
+ row: row
60337
+ });
60338
+ table.transpose ? table.scenegraph.updateCol([], addRows, updateRows) : table.scenegraph.updateRow([], addRows, updateRows);
60190
60339
  }
60191
- } else {
60192
- const addRows = [];
60193
- for (let row = recordIndex + headerCount; row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1); row++) table.transpose ? addRows.push({
60194
- col: row,
60195
- row: 0
60196
- }) : addRows.push({
60197
- col: 0,
60198
- row: row
60199
- });
60200
- const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount,
60201
- bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount,
60202
- updateRows = [];
60203
- for (let row = headerCount; row < headerCount + topAggregationCount; row++) table.transpose ? updateRows.push({
60204
- col: row,
60205
- row: 0
60206
- }) : updateRows.push({
60207
- col: 0,
60208
- row: row
60209
- });
60210
- for (let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount; row < (table.transpose ? table.colCount : table.rowCount); row++) table.transpose ? updateRows.push({
60211
- col: row,
60212
- row: 0
60213
- }) : updateRows.push({
60214
- col: 0,
60215
- row: row
60216
- });
60217
- table.transpose ? table.scenegraph.updateCol([], addRows, updateRows) : table.scenegraph.updateRow([], addRows, updateRows);
60218
60340
  }
60341
+ return !0;
60342
+ } catch (error) {
60343
+ return !1;
60219
60344
  }
60220
60345
  }
60221
60346
  function listTableDeleteRecords(recordIndexs, table) {
@@ -60607,14 +60732,17 @@
60607
60732
  get recordsCount() {
60608
60733
  return this.dataSource.records.length;
60609
60734
  }
60610
- updateColumns(columns, options) {
60735
+ updateColumns(columns, options = {
60736
+ clearColWidthCache: !1,
60737
+ clearRowHeightCache: !0
60738
+ }) {
60611
60739
  var _a, _b, _c, _d;
60612
60740
  this.scenegraph.clearCells();
60613
60741
  const oldHoverState = {
60614
60742
  col: this.stateManager.hover.cellPos.col,
60615
60743
  row: this.stateManager.hover.cellPos.row
60616
60744
  };
60617
- 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();
60618
60746
  }
60619
60747
  _recreateSceneForStateChange() {
60620
60748
  var _a, _b;
@@ -60625,21 +60753,49 @@
60625
60753
  };
60626
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();
60627
60755
  }
60628
- addColumn(column, colIndex, isMaintainArrayData = !0) {
60756
+ addColumns(toAddColumns, colIndex, isMaintainArrayData = !0) {
60757
+ var _a;
60629
60758
  const columns = this.options.columns;
60630
- if (void 0 === colIndex) columns.push(column);else {
60631
- if (isMaintainArrayData) for (let i = 0; i < columns.length; i++) "number" == typeof columns[i].field && columns[i].field >= colIndex && (columns[i].field = columns[i].field + 1);
60632
- columns.splice(colIndex, 0, column);
60633
- }
60634
- if (isMaintainArrayData) for (let i = 0; i < this.records.length; i++) {
60635
- const record = this.records[i];
60636
- Array.isArray(record) && record.splice(colIndex, 0, void 0);
60637
- }
60638
- this.updateColumns(columns);
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) {
60765
+ for (let i = 0; i < columns.length; i++) columns[i].field = i;
60766
+ for (let i = 0; i < this.records.length; i++) {
60767
+ const record = this.records[i];
60768
+ Array.isArray(record) && record.splice(colIndex, 0, ...Array(toAddColumns.length).fill(void 0));
60769
+ }
60770
+ }
60771
+ this.updateColumns(columns, {
60772
+ clearRowHeightCache: !1
60773
+ }), this.fireListeners(TABLE_EVENT_TYPE.ADD_COLUMN, {
60774
+ columnIndex: colIndex,
60775
+ columnCount: toAddColumns.length,
60776
+ columns: columns
60777
+ });
60639
60778
  }
60640
- deleteColumn(colIndex) {
60779
+ deleteColumns(deleteColIndexs, isMaintainArrayData = !0) {
60641
60780
  const columns = this.options.columns;
60642
- columns.splice(colIndex, 1), this.updateColumns(columns);
60781
+ deleteColIndexs.sort((a, b) => b - a);
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++) {
60783
+ const record = this.records[j];
60784
+ Array.isArray(record) && record.splice(deleteColIndexs[i], 1);
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
+ }
60792
+ if (isMaintainArrayData) for (let i = 0; i < columns.length; i++) columns[i].field = i;
60793
+ this.updateColumns(columns, {
60794
+ clearRowHeightCache: !1
60795
+ }), this.fireListeners(TABLE_EVENT_TYPE.DELETE_COLUMN, {
60796
+ deleteColIndexs: deleteColIndexs,
60797
+ columns: columns
60798
+ });
60643
60799
  }
60644
60800
  get columns() {
60645
60801
  return this.internalProps.layoutMap.columnTree.getCopiedTree();
@@ -61041,6 +61197,9 @@
61041
61197
  updateFilterRules(filterRules) {
61042
61198
  this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(), this.resize();
61043
61199
  }
61200
+ getFilteredRecords() {
61201
+ return this.dataSource.records;
61202
+ }
61044
61203
  getCheckboxState(field) {
61045
61204
  if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount && this.stateManager.initLeftRecordsCheckState(this.records), isValid$3(field)) {
61046
61205
  let stateArr = Array.from(this.stateManager.checkedState.keys()).sort((a, b) => {
@@ -61180,18 +61339,39 @@
61180
61339
  }
61181
61340
  addRecord(record, recordIndex) {
61182
61341
  var _a;
61183
- listTableAddRecord(record, recordIndex, this), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61342
+ const success = listTableAddRecord(record, recordIndex, this);
61343
+ null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61344
+ records: [record],
61345
+ recordIndex: recordIndex,
61346
+ recordCount: 1
61347
+ });
61184
61348
  }
61185
61349
  addRecords(records, recordIndex) {
61186
61350
  var _a;
61187
- listTableAddRecords(records, recordIndex, this), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61351
+ const success = listTableAddRecords(records, recordIndex, this);
61352
+ null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61353
+ records: records,
61354
+ recordIndex: recordIndex,
61355
+ recordCount: records.length
61356
+ });
61188
61357
  }
61189
61358
  deleteRecords(recordIndexs) {
61190
61359
  var _a;
61191
61360
  listTableDeleteRecords(recordIndexs, this), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61361
+ const rowIndexs = [];
61362
+ for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
61363
+ this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61364
+ recordIndexs: recordIndexs,
61365
+ rowIndexs: rowIndexs,
61366
+ deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
61367
+ });
61192
61368
  }
61193
61369
  updateRecords(records, recordIndexs) {
61194
- listTableUpdateRecords(records, recordIndexs, this);
61370
+ listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
61371
+ records: records,
61372
+ recordIndexs: recordIndexs,
61373
+ updateCount: records.length
61374
+ });
61195
61375
  }
61196
61376
  _hasCustomRenderOrLayout() {
61197
61377
  var _a, _b, _c, _d;
@@ -65405,7 +65585,7 @@
65405
65585
  }
65406
65586
 
65407
65587
  function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table, range) {
65408
- var _a, _b, _c, _d, _e;
65588
+ var _a, _b, _c, _d, _e, _f;
65409
65589
  if (progressBarDefine.dependField) {
65410
65590
  const dependField = getOrApply(progressBarDefine.dependField, {
65411
65591
  col: col,
@@ -65442,7 +65622,14 @@
65442
65622
  cellHeaderPaths: void 0
65443
65623
  })) && void 0 !== _e ? _e : min + 100;
65444
65624
  let height = 0;
65445
- height = range ? table.getRowsHeight(range.start.row, range.end.row) : table.getRowHeight(row);
65625
+ if (height = range ? table.getRowsHeight(range.start.row, range.end.row) : table.getRowHeight(row), table.pluginManager) {
65626
+ if (table.pluginManager.getPluginByName("Master Detail Plugin")) {
65627
+ const bodyRowIndex = row - table.columnHeaderLevelCount,
65628
+ internalProps = table.internalProps,
65629
+ originalHeight = null === (_f = null == internalProps ? void 0 : internalProps.originalRowHeights) || void 0 === _f ? void 0 : _f.get(bodyRowIndex);
65630
+ void 0 !== originalHeight && originalHeight > 0 && (height = originalHeight);
65631
+ }
65632
+ }
65446
65633
  let contentWidth = width,
65447
65634
  contentHeight = height,
65448
65635
  _contentOffset = 0;