@visactor/vtable-sheet 1.22.2 → 1.22.3

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.
@@ -1940,7 +1940,7 @@
1940
1940
  needsCellMove = true;
1941
1941
  }
1942
1942
  }
1943
- const newFormula = this.adjustFormulaWithColumnMapping(formula, columnMapping);
1943
+ const newFormula = this.adjustFormulaWithColumnMapping(formula, columnMapping, sourceCol, targetCol);
1944
1944
  if (needsCellMove || newFormula !== formula) {
1945
1945
  if (needsCellMove) {
1946
1946
  movedFormulas.push({
@@ -1977,7 +1977,7 @@
1977
1977
  return { adjustedCells: [], movedCells: [] };
1978
1978
  }
1979
1979
  }
1980
- adjustFormulaWithColumnMapping(formula, columnMapping) {
1980
+ adjustFormulaWithColumnMapping(formula, columnMapping, sourceCol, targetCol) {
1981
1981
  if (!formula || !formula.startsWith('=')) {
1982
1982
  return formula;
1983
1983
  }
@@ -1996,16 +1996,23 @@
1996
1996
  const endColIndex = this.columnLettersToIndex(endCol);
1997
1997
  let newStartCol = startColIndex;
1998
1998
  let newEndCol = endColIndex;
1999
- if (columnMapping.has(startColIndex)) {
2000
- const mappedStartCol = columnMapping.get(startColIndex);
2001
- if (mappedStartCol !== undefined) {
2002
- newStartCol = mappedStartCol;
2003
- }
1999
+ const isSourceColInRange = startColIndex <= sourceCol && sourceCol <= endColIndex;
2000
+ if (isSourceColInRange) {
2001
+ newStartCol = startColIndex;
2002
+ newEndCol = endColIndex;
2004
2003
  }
2005
- if (columnMapping.has(endColIndex)) {
2006
- const mappedEndCol = columnMapping.get(endColIndex);
2007
- if (mappedEndCol !== undefined) {
2008
- newEndCol = mappedEndCol;
2004
+ else {
2005
+ if (columnMapping.has(startColIndex)) {
2006
+ const mappedStartCol = columnMapping.get(startColIndex);
2007
+ if (mappedStartCol !== undefined) {
2008
+ newStartCol = mappedStartCol;
2009
+ }
2010
+ }
2011
+ if (columnMapping.has(endColIndex)) {
2012
+ const mappedEndCol = columnMapping.get(endColIndex);
2013
+ if (mappedEndCol !== undefined) {
2014
+ newEndCol = mappedEndCol;
2015
+ }
2009
2016
  }
2010
2017
  }
2011
2018
  if (newStartCol > newEndCol) {
@@ -40766,7 +40773,7 @@
40766
40773
  } else if (isEmptyA || isEmptyB) return indexA - indexB;
40767
40774
  return (state.orderFn || ("desc" !== state.order ? (v1, v2) => v1 === v2 ? 0 : v1 > v2 ? 1 : -1 : (v1, v2) => v1 === v2 ? 0 : v1 < v2 ? 1 : -1))(this.getOriginalField(indexA, state.field), this.getOriginalField(indexB, state.field), state.order);
40768
40775
  }, 0);
40769
- }), this.currentIndexedData = sortedIndexArray, this.hierarchyExpandLevel) {
40776
+ }), this.currentIndexedData = sortedIndexArray, this.hierarchyExpandLevel && "tree" === this.rowHierarchyType) {
40770
40777
  let nodeLength = sortedIndexArray.length;
40771
40778
  for (let i = 0; i < nodeLength; i++) {
40772
40779
  const record = this.getOriginalRecord(sortedIndexArray[i]),
@@ -45025,7 +45032,7 @@
45025
45032
  var _a, _b;
45026
45033
  if (isPromise(value) && (value = table.getCellValue(col, row)), !addNew && (oldCellGroup.row !== row || oldCellGroup.col !== col)) return null;
45027
45034
  if (!addNew && oldCellGroup.parent && table.reactCustomLayout) {
45028
- const reactGroup = oldCellGroup.getChildByName("custom-container");
45035
+ const reactGroup = oldCellGroup.getChildByName(CUSTOM_CONTAINER_NAME);
45029
45036
  if (reactGroup) {
45030
45037
  const {
45031
45038
  col: col,
@@ -45438,7 +45445,6 @@
45438
45445
  });
45439
45446
  function computeRowsHeight(table, rowStart, rowEnd, isClearRowRangeHeightsMap = !0, update) {
45440
45447
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
45441
- "undefined" != typeof window && window.performance.now();
45442
45448
  const oldRowHeights = [],
45443
45449
  newHeights = [];
45444
45450
  if (update) for (let row = rowStart; row <= rowEnd; row++) oldRowHeights[row] = table.getRowHeight(row);
@@ -45461,7 +45467,7 @@
45461
45467
  const height = computeRowHeight(row, 0, table.colCount - 1, table);
45462
45468
  update ? newHeights[row] = Math.round(height) : table._setRowHeight(row, height);
45463
45469
  }
45464
- if (rowEnd < table.columnHeaderLevelCount || !isAllRowsAuto && !isDefaultRowHeightIsAuto) ;else if (table.internalProps.transpose || table.isPivotTable() && !table.internalProps.layoutMap.indicatorsAsCol || table.options.customComputeRowHeight || !checkFixedStyleAndNoWrap(table, rowStart)) {
45470
+ if (rowEnd < table.columnHeaderLevelCount || !isAllRowsAuto && !isDefaultRowHeightIsAuto) ;else if (table.internalProps.transpose || table.isPivotTable() && !table.internalProps.layoutMap.indicatorsAsCol || table.options.customComputeRowHeight || table.options.rowHeightConfig || !checkFixedStyleAndNoWrap(table, rowStart)) {
45465
45471
  if (table.internalProps.transpose || table.isPivotTable() && !table.internalProps.layoutMap.indicatorsAsCol) for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {
45466
45472
  let height;
45467
45473
  height = checkFixedStyleAndNoWrapForTranspose(table, row) ? computeRowHeight(row, 0, table.rowHeaderLevelCount, table) : computeRowHeight(row, 0, table.colCount - 1, table), update ? newHeights[row] = Math.round(height) : table._setRowHeight(row, height);
@@ -45545,6 +45551,10 @@
45545
45551
  if ("number" == typeof customRowHeight) return customRowHeight;
45546
45552
  if ("auto" !== customRowHeight) return table.getDefaultRowHeight(row);
45547
45553
  }
45554
+ if (table.internalProps.rowHeightConfig) {
45555
+ const rowHeightConfig = table.internalProps.rowHeightConfig.find(item => item.key === row);
45556
+ if (rowHeightConfig) return table.internalProps._heightResizedRowMap.has(row) || (table._setRowHeight(row, rowHeightConfig.height), table.internalProps._heightResizedRowMap.add(row)), rowHeightConfig.height;
45557
+ }
45548
45558
  if (table.isPivotChart() && row >= table.columnHeaderLevelCount && row < table.rowCount - table.bottomFrozenRowCount) {
45549
45559
  let ifNeedComputeRowHeight = table.internalProps.layoutMap.indicatorsAsCol,
45550
45560
  isHeatmap = !1;
@@ -45573,7 +45583,8 @@
45573
45583
  }
45574
45584
  }
45575
45585
  if (table.isPivotChart() && (table.isLeftFrozenColumn(col) && table.isBottomFrozenRow(row) || table.isRightFrozenColumn(col) && table.isBottomFrozenRow(row))) continue;
45576
- const textHeight = computeTextHeight(col, row, table.isHeader(col, row) ? null === (_a = table._getHeaderLayoutMap(col, row)) || void 0 === _a ? void 0 : _a.headerType : table.getBodyColumnType(col, row), table);
45586
+ const cellType = table.isHeader(col, row) ? null === (_a = table._getHeaderLayoutMap(col, row)) || void 0 === _a ? void 0 : _a.headerType : table.getBodyColumnType(col, row),
45587
+ textHeight = computeTextHeight(col, row, cellType, table);
45577
45588
  maxHeight = isValid$4(maxHeight) ? Math.max(textHeight, maxHeight) : textHeight;
45578
45589
  }
45579
45590
  if (isValid$4(maxHeight)) return maxHeight;
@@ -48249,7 +48260,7 @@
48249
48260
  strokeColor = rectAttribute.stroke,
48250
48261
  cornerRadius = rectAttribute.cornerRadius
48251
48262
  } = rect.attribute;
48252
- if (stroke && (Array.isArray(strokeArrayWidth) || 0 !== lineWidth) && (Array.isArray(stroke) || Array.isArray(strokeArrayColor) || Array.isArray(strokeArrayWidth))) {
48263
+ if (!(!stroke || !Array.isArray(strokeArrayWidth) && 0 === lineWidth || width <= 0 || height <= 0) && (Array.isArray(stroke) || Array.isArray(strokeArrayColor) || Array.isArray(strokeArrayWidth))) {
48253
48264
  const deltaWidth = 0,
48254
48265
  deltaHeight = 0;
48255
48266
  "border-rect" !== rect.name && "table-border-rect" !== rect.name && ("number" == typeof lineWidth && 1 & lineWidth || Array.isArray(strokeArrayWidth) && strokeArrayWidth.some(width => 1 & width)) && (x = Math.floor(x) + .5, y = Math.floor(y) + .5), 0 === cornerRadius || isArray$a(cornerRadius) && cornerRadius.every(num => 0 === num) ? renderStroke(rect, context, x, y, rectAttribute, stroke, strokeArrayWidth || lineWidth, strokeArrayColor || strokeColor, "table-border-rect" !== rect.name ? Math.ceil(width + deltaWidth) : width + deltaWidth, "table-border-rect" !== rect.name ? Math.ceil(height + deltaHeight) : height + deltaHeight) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, !0, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
@@ -53162,9 +53173,9 @@
53162
53173
 
53163
53174
  function adjustMoveHeaderTarget(source, target, table) {
53164
53175
  const sourceCellRange = table.getCellRange(source.col, source.row);
53165
- if (table.isColumnHeader(source.col, source.row)) {
53176
+ if (table.isColumnHeader(source.col, source.row) || "column" === table.stateManager.columnMove.movingColumnOrRow && 0 === source.row) {
53166
53177
  const targetCellRange = table.getCellRange(target.col, sourceCellRange.start.row);
53167
- target.row >= table.columnHeaderLevelCount && (target.row = table.columnHeaderLevelCount - 1), target.col >= source.col ? target.col = targetCellRange.end.col : target.col = targetCellRange.start.col;
53178
+ target.row >= table.columnHeaderLevelCount && (target.row = Math.max(table.columnHeaderLevelCount - 1, 0)), target.col >= source.col ? target.col = targetCellRange.end.col : target.col = targetCellRange.start.col;
53168
53179
  } else if (table.isRowHeader(source.col, source.row)) {
53169
53180
  const layoutMap = table.internalProps.layoutMap,
53170
53181
  targetCellRange = table.getCellRange(sourceCellRange.start.col, target.row);
@@ -53179,6 +53190,52 @@
53179
53190
  }
53180
53191
  return target;
53181
53192
  }
53193
+ function adjustWidthResizedColMap(moveContext, table) {
53194
+ if (table.internalProps._widthResizedColMap.size > 0) {
53195
+ const resizedColIndexs = Array.from(table.internalProps._widthResizedColMap.keys());
53196
+ table.internalProps._widthResizedColMap.clear();
53197
+ for (let i = 0; i < resizedColIndexs.length; i++) {
53198
+ const colIndex = resizedColIndexs[i];
53199
+ let newColIndex;
53200
+ const {
53201
+ sourceIndex: sourceIndex,
53202
+ targetIndex: targetIndex,
53203
+ sourceSize: sourceSize
53204
+ } = moveContext;
53205
+ newColIndex = colIndex >= sourceIndex && colIndex < sourceIndex + sourceSize ? targetIndex + (colIndex - sourceIndex) : sourceIndex < targetIndex ? colIndex >= sourceIndex + sourceSize && colIndex < targetIndex || colIndex >= targetIndex ? colIndex - sourceSize : colIndex : colIndex >= targetIndex && colIndex < sourceIndex ? colIndex + sourceSize : colIndex, table.internalProps._widthResizedColMap.add(newColIndex);
53206
+ }
53207
+ }
53208
+ }
53209
+ function adjustHeightResizedRowMap(moveContext, table) {
53210
+ if (table.internalProps._heightResizedRowMap.size > 0) {
53211
+ const resizedRowIndexs = Array.from(table.internalProps._heightResizedRowMap.keys());
53212
+ table.internalProps._heightResizedRowMap.clear();
53213
+ for (let i = 0; i < resizedRowIndexs.length; i++) {
53214
+ const rowIndex = resizedRowIndexs[i];
53215
+ let newRowIndex;
53216
+ const {
53217
+ sourceIndex: sourceIndex,
53218
+ targetIndex: targetIndex,
53219
+ sourceSize: sourceSize
53220
+ } = moveContext;
53221
+ newRowIndex = rowIndex >= sourceIndex && rowIndex < sourceIndex + sourceSize ? targetIndex + (rowIndex - sourceIndex) : sourceIndex < targetIndex ? rowIndex >= sourceIndex + sourceSize && rowIndex < targetIndex || rowIndex >= targetIndex ? rowIndex - sourceSize : rowIndex : rowIndex >= targetIndex && rowIndex < sourceIndex ? rowIndex + sourceSize : rowIndex, table.internalProps._heightResizedRowMap.add(newRowIndex);
53222
+ }
53223
+ }
53224
+ }
53225
+ function adjustHeightResizedRowMapWithAddRecordIndex(table, recordIndex, records) {
53226
+ const resizedRowIndexs = Array.from(table.internalProps._heightResizedRowMap.keys()),
53227
+ rowIndex = recordIndex + (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount);
53228
+ for (let i = 0; i < resizedRowIndexs.length; i++) resizedRowIndexs[i] >= rowIndex && (table.internalProps._heightResizedRowMap.delete(resizedRowIndexs[i]), table.internalProps._heightResizedRowMap.add(resizedRowIndexs[i] + records.length));
53229
+ }
53230
+ function adjustHeightResizedRowMapWithDeleteRecordIndex(table, recordIndexs) {
53231
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
53232
+ recordIndexs.sort((a, b) => b - a);
53233
+ for (let i = 0; i < recordIndexs.length; i++) {
53234
+ const rowIndex = recordIndexs[i] + headerCount,
53235
+ resizedRowIndexs = Array.from(table.internalProps._heightResizedRowMap.keys());
53236
+ for (let j = 0; j < resizedRowIndexs.length; j++) resizedRowIndexs[j] === rowIndex ? table.internalProps._heightResizedRowMap.delete(resizedRowIndexs[j]) : resizedRowIndexs[j] > rowIndex && (table.internalProps._heightResizedRowMap.delete(resizedRowIndexs[j]), table.internalProps._heightResizedRowMap.add(resizedRowIndexs[j] - 1));
53237
+ }
53238
+ }
53182
53239
 
53183
53240
  function startMoveCol(col, row, x, y, state, event, dragColumnOrRow) {
53184
53241
  var _a;
@@ -53240,7 +53297,7 @@
53240
53297
  let lineX, backX, lineY, backY;
53241
53298
  state.updateCursor("grabbing");
53242
53299
  const cellLocation = state.table.getCellLocation(state.columnMove.colSource, state.columnMove.rowSource);
53243
- "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, {
53300
+ "columnHeader" === cellLocation || "column" === state.columnMove.movingColumnOrRow && 0 === state.columnMove.rowSource ? (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, {
53244
53301
  col: col,
53245
53302
  row: row,
53246
53303
  x: x,
@@ -54754,7 +54811,7 @@
54754
54811
  });
54755
54812
  (optimizedDeltaX || optimizedDeltaY) && state.interactionState !== InteractionState.scrolling && state.updateInteractionState(InteractionState.scrolling);
54756
54813
  const autoHide = "scrolling" === (null === (_b = null === (_a = state.table.options.theme) || void 0 === _a ? void 0 : _a.scrollStyle) || void 0 === _b ? void 0 : _b.visible);
54757
- optimizedDeltaX && (state.setScrollLeft(state.scroll.horizontalBarPos + optimizedDeltaX, event), state.showHorizontalScrollBar(autoHide)), optimizedDeltaY && (state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY, event), state.showVerticalScrollBar(autoHide)), isWheelEvent && state.resetInteractionState(state.interactionStateBeforeScroll), (null === (_c = event.nativeEvent) || void 0 === _c ? void 0 : _c.cancelable) && ("none" === state.table.internalProps.overscrollBehavior || Math.abs(deltaY) >= Math.abs(deltaX) && 0 !== deltaY && isVerticalScrollable(deltaY, state) || Math.abs(deltaY) <= Math.abs(deltaX) && 0 !== deltaX && isHorizontalScrollable(deltaX, state)) && event.nativeEvent.preventDefault();
54814
+ optimizedDeltaX && (state.setScrollLeft(state.scroll.horizontalBarPos + optimizedDeltaX, event), state.showHorizontalScrollBar(autoHide)), optimizedDeltaY && (state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY, event), state.showVerticalScrollBar(autoHide)), isWheelEvent && state.resetInteractionState(state.interactionStateBeforeScroll), (null === (_c = event.nativeEvent) || void 0 === _c ? void 0 : _c.cancelable) && ("none" === state.table.internalProps.overscrollBehavior && (deltaY && isVerticalExistScrollBar(state) || deltaX && isHorizontalExistScrollBar(state)) || Math.abs(deltaY) >= Math.abs(deltaX) && 0 !== deltaY && isVerticalScrollable(deltaY, state) || Math.abs(deltaY) <= Math.abs(deltaX) && 0 !== deltaX && isHorizontalScrollable(deltaX, state)) && event.nativeEvent.preventDefault();
54758
54815
  }
54759
54816
  function optimizeScrollXY(x, y, ratio) {
54760
54817
  var _a, _b;
@@ -54769,6 +54826,12 @@
54769
54826
  function isHorizontalScrollable(deltaX, state) {
54770
54827
  return 0 != state.table.getAllColsWidth() - state.table.scenegraph.width && !isScrollToLeft(deltaX, state) && !isScrollToRight(deltaX, state);
54771
54828
  }
54829
+ function isVerticalExistScrollBar(state) {
54830
+ return !(state.table.getAllRowsHeight() - state.table.scenegraph.height <= 0);
54831
+ }
54832
+ function isHorizontalExistScrollBar(state) {
54833
+ return !(state.table.getAllColsWidth() - state.table.scenegraph.width <= 0);
54834
+ }
54772
54835
  function isScrollToTop(deltaY, state) {
54773
54836
  return 0 !== state.table.getAllRowsHeight() - state.table.scenegraph.height && deltaY <= 0 && state.scroll.verticalBarPos < 1;
54774
54837
  }
@@ -55711,7 +55774,7 @@
55711
55774
  handleWhell({
55712
55775
  deltaX: deltaX,
55713
55776
  deltaY: deltaY
55714
- }, stateManager), e.cancelable && ("none" === table.internalProps.overscrollBehavior || Math.abs(deltaY) >= Math.abs(deltaX) && 0 !== deltaY && isVerticalScrollable(deltaY, stateManager) || Math.abs(deltaY) <= Math.abs(deltaX) && 0 !== deltaX && isHorizontalScrollable(deltaX, stateManager)) && e.preventDefault();
55777
+ }, stateManager), e.cancelable && ("none" === table.internalProps.overscrollBehavior && (deltaY && isVerticalExistScrollBar(stateManager) || deltaX && isHorizontalExistScrollBar(stateManager)) || Math.abs(deltaY) >= Math.abs(deltaX) && 0 !== deltaY && isVerticalScrollable(deltaY, stateManager) || Math.abs(deltaY) <= Math.abs(deltaX) && 0 !== deltaX && isHorizontalScrollable(deltaX, stateManager)) && e.preventDefault();
55715
55778
  }
55716
55779
  };
55717
55780
  vglobal.addEventListener("touchmove", globalTouchMoveCallback, {
@@ -58563,7 +58626,7 @@
58563
58626
  targetRange: targetRange,
58564
58627
  theme: theme
58565
58628
  } = axisRange;
58566
- isNumber$4(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)), isNumber$4(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1));
58629
+ isNumber$4(null == axisOption ? void 0 : axisOption.max) ? (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1)) : "boxPlot" === chartType && (range.max += (range.max - range.min) / 20), isNumber$4(null == axisOption ? void 0 : axisOption.min) ? (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)) : "boxPlot" === chartType && (range.min -= (range.max - range.min) / 20);
58567
58630
  let domain = [];
58568
58631
  if ("heatmap" === chartType) {
58569
58632
  const colDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.rowCount - layout.bottomFrozenRowCount - 1, "xField"),
@@ -58645,7 +58708,7 @@
58645
58708
  targetRange: targetRange,
58646
58709
  theme: theme
58647
58710
  } = axisRange;
58648
- isNumber$4(null == axisOption ? void 0 : axisOption.min) && (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)), isNumber$4(null == axisOption ? void 0 : axisOption.max) && (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1));
58711
+ isNumber$4(null == axisOption ? void 0 : axisOption.max) ? (range.max = axisOption.max, range.max < 0 && (axisOption.zero = !1)) : "boxPlot" === chartType && (range.max += (range.max - range.min) / 20), isNumber$4(null == axisOption ? void 0 : axisOption.min) ? (range.min = axisOption.min, range.min > 0 && (axisOption.zero = !1)) : "boxPlot" === chartType && (range.min -= (range.max - range.min) / 20);
58649
58712
  let domain = [];
58650
58713
  if ("heatmap" === chartType) {
58651
58714
  const rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row, "yField"),
@@ -59247,7 +59310,7 @@
59247
59310
  }
59248
59311
  constructor(container, options = {}) {
59249
59312
  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;
59250
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.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");
59313
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.3", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.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");
59251
59314
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
59252
59315
  options: options,
59253
59316
  container: container
@@ -59827,7 +59890,7 @@
59827
59890
  return this._adjustColWidth(col, this._colWidthDefineToPxWidth(width));
59828
59891
  }
59829
59892
  isAutoRowHeight(row) {
59830
- return "autoHeight" === this.heightMode || !!this.options.customComputeRowHeight || (row >= 0 && row < this.columnHeaderLevelCount ? "auto" === this.getDefaultRowHeight(row) : "auto" === this.internalProps.defaultRowHeight);
59893
+ return "autoHeight" === this.heightMode || !!this.options.customComputeRowHeight || !!this.internalProps.rowHeightConfig || (row >= 0 && row < this.columnHeaderLevelCount ? "auto" === this.getDefaultRowHeight(row) : "auto" === this.internalProps.defaultRowHeight);
59831
59894
  }
59832
59895
  getColWidth(col) {
59833
59896
  var _a;
@@ -63441,7 +63504,7 @@
63441
63504
  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;
63442
63505
  if ("disabled" === this._table.internalProps.frozenColDragHeaderMode && this._table.isFrozenColumn(target.col)) return !1;
63443
63506
  const sourceCellRange = this.getCellRange(source.col, source.row);
63444
- if (this.isColumnHeader(source.col, source.row)) {
63507
+ if (this.isColumnHeader(source.col, source.row) || "column" === this._table.stateManager.columnMove.movingColumnOrRow && 0 === source.row) {
63445
63508
  return this.getParentCellId(source.col, sourceCellRange.start.row) === this.getParentCellId(target.col, sourceCellRange.start.row);
63446
63509
  }
63447
63510
  if (this.isRowHeader(source.col, source.row)) {
@@ -63453,7 +63516,7 @@
63453
63516
  var _a, _b, _c, _d, _e, _f, _g;
63454
63517
  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)) {
63455
63518
  let sourceCellRange = this.getCellRange(source.col, source.row);
63456
- if (this.isColumnHeader(source.col, source.row)) {
63519
+ if (this.isColumnHeader(source.col, source.row) || "column" === this._table.stateManager.columnMove.movingColumnOrRow && 0 === source.row) {
63457
63520
  const sourceSize = sourceCellRange.end.col - sourceCellRange.start.col + 1;
63458
63521
  let targetIndex;
63459
63522
  const targetCellRange = this.getCellRange(target.col, sourceCellRange.start.row);
@@ -63465,7 +63528,7 @@
63465
63528
  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++) {
63466
63529
  const rowRecords = null === (_e = this._table.dataSource.dataSourceObj) || void 0 === _e ? void 0 : _e.records[j];
63467
63530
  if (Array.isArray(rowRecords)) {
63468
- rowRecords.length - 1 < targetIndex && rowRecords.push(...Array(targetIndex - rowRecords.length + 1).fill(void 0));
63531
+ rowRecords.length - 1 < Math.max(targetIndex, source.col) && rowRecords.push(...Array(Math.max(targetIndex, source.col) - rowRecords.length + 1).fill(void 0));
63469
63532
  const sourceData = rowRecords.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
63470
63533
  sourceData.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(rowRecords, sourceData);
63471
63534
  }
@@ -64435,7 +64498,7 @@
64435
64498
  const internalProps = this.internalProps;
64436
64499
  if (internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = this.internalProps.groupBy ? getGroupByDataConfig(this.internalProps.groupBy, options.addRecordRule) : {
64437
64500
  addRecordRule: options.addRecordRule
64438
- }, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_d = null !== (_c = options.enableTreeNodeMerge) && void 0 !== _c ? _c : isValid$4(this.internalProps.groupBy)) && void 0 !== _d && _d, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_e = options.showHeader) || void 0 === _e || _e, this.internalProps.columnWidthConfig = options.columnWidthConfig, this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, "node" !== Env$1.mode && (this.editorManager = new EditManager(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
64501
+ }, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_d = null !== (_c = options.enableTreeNodeMerge) && void 0 !== _c ? _c : isValid$4(this.internalProps.groupBy)) && void 0 !== _d && _d, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_e = options.showHeader) || void 0 === _e || _e, this.internalProps.columnWidthConfig = options.columnWidthConfig, this.internalProps.rowHeightConfig = options.rowHeightConfig, this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, "node" !== Env$1.mode && (this.editorManager = new EditManager(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
64439
64502
  sortState: internalProps.sortState
64440
64503
  }) : this.setRecords([]), options.title) {
64441
64504
  const Title = Factory.getComponent("title");
@@ -64714,7 +64777,7 @@
64714
64777
  const internalProps = this.internalProps;
64715
64778
  if (super.updateOption(options, updateConfig), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = this.internalProps.groupBy ? getGroupByDataConfig(this.internalProps.groupBy, options.addRecordRule) : {
64716
64779
  addRecordRule: options.addRecordRule
64717
- }, this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_e = null !== (_d = options.enableTreeNodeMerge) && void 0 !== _d ? _d : isValid$4(this.internalProps.groupBy)) && void 0 !== _e && _e, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, internalProps.releaseList) for (let i = internalProps.releaseList.length - 1; i >= 0; i--) {
64780
+ }, this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_e = null !== (_d = options.enableTreeNodeMerge) && void 0 !== _d ? _d : isValid$4(this.internalProps.groupBy)) && void 0 !== _e && _e, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, this.internalProps.rowHeightConfig = options.rowHeightConfig, internalProps.releaseList) for (let i = internalProps.releaseList.length - 1; i >= 0; i--) {
64718
64781
  const releaseObj = internalProps.releaseList[i];
64719
64782
  releaseObj instanceof DataSource ? releaseObj.updateColumns(this.internalProps.columns) : (null === (_g = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _g || _g.call(releaseObj), internalProps.releaseList.splice(i, 1));
64720
64783
  }
@@ -64770,7 +64833,7 @@
64770
64833
  const sourceCellRange = this.getCellRange(source.col, source.row),
64771
64834
  targetCellRange = this.getCellRange(target.col, target.row),
64772
64835
  moveContext = this.internalProps.layoutMap.moveHeaderPosition(source, target);
64773
- return moveContext ? ("column" === moveContext.moveType ? (this.colWidthsMap.exchangeOrder(sourceCellRange.start.col, sourceCellRange.end.col - sourceCellRange.start.col + 1, targetCellRange.start.col, targetCellRange.end.col - targetCellRange.start.col + 1, moveContext.targetIndex), this.transpose || (this.colWidthsLimit = {}, this.setMinMaxLimitWidth())) : moveContext.targetIndex > moveContext.sourceIndex ? this.rowHeightsMap.exchangeOrder(moveContext.sourceIndex, moveContext.sourceSize, moveContext.targetIndex + moveContext.sourceSize - moveContext.targetSize, moveContext.targetSize, moveContext.targetIndex) : this.rowHeightsMap.exchangeOrder(moveContext.sourceIndex, moveContext.sourceSize, moveContext.targetIndex, moveContext.targetSize, moveContext.targetIndex), moveContext) : null;
64836
+ return moveContext ? ("column" === moveContext.moveType ? (this.colWidthsMap.exchangeOrder(sourceCellRange.start.col, sourceCellRange.end.col - sourceCellRange.start.col + 1, targetCellRange.start.col, targetCellRange.end.col - targetCellRange.start.col + 1, moveContext.targetIndex), adjustWidthResizedColMap(moveContext, this), this.transpose || (this.colWidthsLimit = {}, this.setMinMaxLimitWidth())) : (moveContext.targetIndex > moveContext.sourceIndex ? this.rowHeightsMap.exchangeOrder(moveContext.sourceIndex, moveContext.sourceSize, moveContext.targetIndex + moveContext.sourceSize - moveContext.targetSize, moveContext.targetSize, moveContext.targetIndex) : this.rowHeightsMap.exchangeOrder(moveContext.sourceIndex, moveContext.sourceSize, moveContext.targetIndex, moveContext.targetSize, moveContext.targetIndex), adjustHeightResizedRowMap(moveContext, this)), moveContext) : null;
64774
64837
  }
64775
64838
  changeRecordOrder(sourceIndex, targetIndex) {
64776
64839
  this.transpose ? (sourceIndex = this.getRecordShowIndexByCell(sourceIndex, 0), targetIndex = this.getRecordShowIndexByCell(targetIndex, 0)) : (sourceIndex = this.getRecordShowIndexByCell(0, sourceIndex), targetIndex = this.getRecordShowIndexByCell(0, targetIndex)), this.dataSource.changeOrder(sourceIndex, targetIndex);
@@ -64934,8 +64997,10 @@
64934
64997
  };
64935
64998
  })), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.sortCell()), sortState.length && this.stateManager.updateSortState(sortState);
64936
64999
  }
64937
- updateFilterRules(filterRules) {
64938
- 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();
65000
+ updateFilterRules(filterRules, options = {
65001
+ clearRowHeightCache: !0
65002
+ }) {
65003
+ 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(!(null == options ? void 0 : options.clearRowHeightCache)), this.resize();
64939
65004
  }
64940
65005
  getFilteredRecords() {
64941
65006
  return this.dataSource.records;
@@ -65080,7 +65145,7 @@
65080
65145
  addRecord(record, recordIndex) {
65081
65146
  var _a;
65082
65147
  const success = listTableAddRecord(record, recordIndex, this);
65083
- null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65148
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65084
65149
  records: [record],
65085
65150
  recordIndex: recordIndex,
65086
65151
  recordCount: 1
@@ -65089,7 +65154,7 @@
65089
65154
  addRecords(records, recordIndex) {
65090
65155
  var _a;
65091
65156
  const success = listTableAddRecords(records, recordIndex, this);
65092
- null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65157
+ "number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65093
65158
  records: records,
65094
65159
  recordIndex: recordIndex,
65095
65160
  recordCount: records.length
@@ -65097,7 +65162,7 @@
65097
65162
  }
65098
65163
  deleteRecords(recordIndexs) {
65099
65164
  var _a;
65100
- listTableDeleteRecords(recordIndexs, this), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65165
+ listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65101
65166
  const rowIndexs = [];
65102
65167
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
65103
65168
  this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
@@ -71742,8 +71807,14 @@
71742
71807
  }
71743
71808
  }
71744
71809
  }, pluginOptions.cornerCellStyle),
71745
- checkMoveColumnOrder: colIndex => this.table.isColumnSelected(colIndex),
71746
- checkMoveRowOrder: rowIndex => this.table.isRowSelected(rowIndex)
71810
+ checkMoveColumnOrder: colIndex => {
71811
+ var _a;
71812
+ return !!(null === (_a = this.pluginOptions.dragOrder) || void 0 === _a ? void 0 : _a.enableDragColumnOrder) && this.table.isColumnSelected(colIndex);
71813
+ },
71814
+ checkMoveRowOrder: rowIndex => {
71815
+ var _a;
71816
+ return !!(null === (_a = this.pluginOptions.dragOrder) || void 0 === _a ? void 0 : _a.enableDragRowOrder) && this.table.isRowSelected(rowIndex);
71817
+ }
71747
71818
  }), this.listenComponentEvents();
71748
71819
  }
71749
71820
  run(...args) {
@@ -71759,6 +71830,7 @@
71759
71830
  for (let i = options.columns.length; i < this.pluginOptions.colCount; i++) {
71760
71831
  const columnFields = {
71761
71832
  field: i,
71833
+ key: i,
71762
71834
  title: ""
71763
71835
  };
71764
71836
  options.columns.push(columnFields);
@@ -71785,7 +71857,8 @@
71785
71857
  this.table.on(TABLE_EVENT_TYPE.SCROLL, this.handleScroll), this.table.on(TABLE_EVENT_TYPE.AFTER_SORT, this.handleAfterSort), this.table.on(TABLE_EVENT_TYPE.SELECTED_CHANGED, this.handleSelectedChanged), this.table.on(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, this.handleResizeColumnEnd), this.table.on(TABLE_EVENT_TYPE.RESIZE_ROW_END, this.handleResizeRowEnd), this.table.on(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, this.handleChangeHeaderPosition);
71786
71858
  }
71787
71859
  listenComponentEvents() {
71788
- this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellRightClick, this.handleSeriesNumberCellRightClick), this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellHover, this.handleSeriesNumberCellHover), this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellUnHover, this.handleSeriesNumberCellUnHover), this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellClick, this.handleSeriesNumberCellClick), this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellClickUp, this.handleSeriesNumberCellClickUp), this.seriesNumberComponent.on(SeriesNumberEvent.rowSeriesNumberWidthChange, this.handleRowSeriesNumberWidthChange), this.seriesNumberComponent.on(SeriesNumberEvent.resizeColWidthStart, this.handleResizeColWidthStart), this.seriesNumberComponent.on(SeriesNumberEvent.resizeRowHeightStart, this.handleResizeRowHeightStart), this.seriesNumberComponent.on(SeriesNumberEvent.dragColumnOrderStart, this.handleDragColumOrderStart), this.seriesNumberComponent.on(SeriesNumberEvent.dragRowOrderStart, this.handleDragRowOrderStart);
71860
+ var _a, _b;
71861
+ this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellRightClick, this.handleSeriesNumberCellRightClick), this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellHover, this.handleSeriesNumberCellHover), this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellUnHover, this.handleSeriesNumberCellUnHover), this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellClick, this.handleSeriesNumberCellClick), this.seriesNumberComponent.on(SeriesNumberEvent.seriesNumberCellClickUp, this.handleSeriesNumberCellClickUp), this.seriesNumberComponent.on(SeriesNumberEvent.rowSeriesNumberWidthChange, this.handleRowSeriesNumberWidthChange), this.seriesNumberComponent.on(SeriesNumberEvent.resizeColWidthStart, this.handleResizeColWidthStart), this.seriesNumberComponent.on(SeriesNumberEvent.resizeRowHeightStart, this.handleResizeRowHeightStart), (null === (_a = this.pluginOptions.dragOrder) || void 0 === _a ? void 0 : _a.enableDragColumnOrder) && this.seriesNumberComponent.on(SeriesNumberEvent.dragColumnOrderStart, this.handleDragColumOrderStart), (null === (_b = this.pluginOptions.dragOrder) || void 0 === _b ? void 0 : _b.enableDragRowOrder) && this.seriesNumberComponent.on(SeriesNumberEvent.dragRowOrderStart, this.handleDragRowOrderStart);
71789
71862
  }
71790
71863
  release() {
71791
71864
  var _a, _b;
@@ -72118,7 +72191,9 @@
72118
72191
  fieldId: String(filter.field)
72119
72192
  });
72120
72193
  }
72121
- }), table.updateFilterRules([...this.filterFuncRule, ...this.filterValueRule]);
72194
+ }), table.updateFilterRules([...this.filterFuncRule, ...this.filterValueRule], {
72195
+ clearRowHeightCache: !1
72196
+ });
72122
72197
  }
72123
72198
  createFilterFunction(filter) {
72124
72199
  const {
@@ -72262,20 +72337,7 @@
72262
72337
  });
72263
72338
  }
72264
72339
  applyFilters() {
72265
- this.engine.applyFilter(this.state, this.table), this.updateColumnIcons();
72266
- }
72267
- updateColumnIcons() {
72268
- const columns = this.table.columns;
72269
- if (!columns) return;
72270
- const plugin = this.table.pluginManager.getPluginByName("Filter");
72271
- if (!plugin || !plugin.pluginOptions) return;
72272
- const filterIcon = plugin.pluginOptions.filterIcon,
72273
- filteringIcon = plugin.pluginOptions.filteringIcon;
72274
- columns.forEach((col, index) => {
72275
- const field = col.field,
72276
- filterConfig = this.state.filters.get(field);
72277
- !plugin.shouldEnableFilterForColumn || plugin.shouldEnableFilterForColumn(index, col) ? filterConfig && filterConfig.enable ? col.headerIcon = filteringIcon : col.headerIcon = filterIcon : col.headerIcon !== filterIcon && col.headerIcon !== filteringIcon || delete col.headerIcon;
72278
- }), this.table.updateColumns(columns);
72340
+ this.engine.applyFilter(this.state, this.table);
72279
72341
  }
72280
72342
  shouldApplyFilter(action) {
72281
72343
  return [FilterActionType.REMOVE_FILTER, FilterActionType.ENABLE_FILTER, FilterActionType.DISABLE_FILTER, FilterActionType.CLEAR_ALL_FILTERS, FilterActionType.APPLY_FILTERS].includes(action.type) || action.payload.enable;
@@ -73015,7 +73077,11 @@
73015
73077
  const eventArgs = args[0],
73016
73078
  runtime = args[1],
73017
73079
  table = args[2];
73018
- if (this.table = table, runtime === TABLE_EVENT_TYPE.BEFORE_INIT) this.filterEngine = new FilterEngine(), this.filterStateManager = new FilterStateManager(this.table, this.filterEngine), this.filterToolbar = new FilterToolbar(this.table, this.filterStateManager), this.filterToolbar.render(document.body), this.updateFilterIcons(eventArgs.options);else if (runtime === TABLE_EVENT_TYPE.BEFORE_UPDATE_OPTION) this.pluginOptions = Object.assign(Object.assign({}, this.pluginOptions), eventArgs.options.plugins.find(plugin => plugin.id === this.id).pluginOptions), this.handleOptionUpdate(eventArgs.options);else if (runtime === TABLE_EVENT_TYPE.ICON_CLICK && "filter-icon" === eventArgs.name || "filtering-icon" === eventArgs.name) {
73080
+ if (this.table = table, runtime === TABLE_EVENT_TYPE.BEFORE_INIT) this.filterEngine = new FilterEngine(), this.filterStateManager = new FilterStateManager(this.table, this.filterEngine), this.filterToolbar = new FilterToolbar(this.table, this.filterStateManager), this.filterToolbar.render(document.body), this.updateFilterIcons(eventArgs.options), this.filterStateManager.subscribe(() => {
73081
+ this.updateFilterIcons(eventArgs.options), this.table.updateColumns(eventArgs.options.columns, {
73082
+ clearRowHeightCache: !1
73083
+ });
73084
+ });else if (runtime === TABLE_EVENT_TYPE.BEFORE_UPDATE_OPTION) this.pluginOptions = Object.assign(Object.assign({}, this.pluginOptions), eventArgs.options.plugins.find(plugin => plugin.id === this.id).pluginOptions), this.handleOptionUpdate(eventArgs.options);else if (runtime === TABLE_EVENT_TYPE.ICON_CLICK && "filter-icon" === eventArgs.name || "filtering-icon" === eventArgs.name) {
73019
73085
  if (3 === (null === (_a = eventArgs.event) || void 0 === _a ? void 0 : _a.which) || 2 === (null === (_b = eventArgs.event) || void 0 === _b ? void 0 : _b.button) || 2 == (2 & (null === (_c = eventArgs.event) || void 0 === _c ? void 0 : _c.buttons))) return;
73020
73086
  const col = eventArgs.col,
73021
73087
  row = eventArgs.row;
@@ -73048,8 +73114,16 @@
73048
73114
  });
73049
73115
  }
73050
73116
  updateFilterIcons(options) {
73051
- options.columns.forEach(col => {
73052
- this.shouldEnableFilterForColumn(col.field, col) ? col.headerIcon = this.pluginOptions.filterIcon : delete col.headerIcon;
73117
+ const filterIcon = this.pluginOptions.filterIcon,
73118
+ filteringIcon = this.pluginOptions.filteringIcon,
73119
+ isIconEqual = (a, b) => a === b || a && b && "object" == typeof a && "object" == typeof b && a.name === b.name;
73120
+ options.columns.forEach(column => {
73121
+ var _a;
73122
+ const shouldShow = this.shouldEnableFilterForColumn(column.field, column),
73123
+ isFiltering = !!(null === (_a = this.filterStateManager.getFilterState(column.field)) || void 0 === _a ? void 0 : _a.enable);
73124
+ let icons = (icons => icons ? Array.isArray(icons) ? icons : [icons] : [])(column.headerIcon);
73125
+ var list;
73126
+ shouldShow ? isFiltering ? icons.some(icon => isIconEqual(icon, filteringIcon)) || (icons = icons.filter(icon => !isIconEqual(icon, filterIcon)), icons.push(filteringIcon)) : icons.some(icon => isIconEqual(icon, filterIcon)) || (icons = icons.filter(icon => !isIconEqual(icon, filteringIcon)), icons.push(filterIcon)) : icons = icons.filter(icon => !isIconEqual(icon, filterIcon)), column.headerIcon = 0 === (list = icons).length ? void 0 : 1 === list.length ? list[0] : list;
73053
73127
  });
73054
73128
  }
73055
73129
  shouldEnableFilterForColumn(field, column) {
@@ -77069,6 +77143,7 @@
77069
77143
  else {
77070
77144
  for (let i = 0; i < this.options.columns.length; i++) {
77071
77145
  this.options.columns[i].field = i;
77146
+ this.options.columns[i].key = i;
77072
77147
  }
77073
77148
  }
77074
77149
  if (!this.options.data) {
@@ -77080,6 +77155,7 @@
77080
77155
  for (let i = 0; i < data[0].length; i++) {
77081
77156
  this.options.columns[i] = {
77082
77157
  field: i,
77158
+ key: i,
77083
77159
  title: data[0][i],
77084
77160
  filter: !!this.options.filter
77085
77161
  };
@@ -77530,16 +77606,16 @@
77530
77606
 
77531
77607
  function getTablePlugins(sheetDefine, options) {
77532
77608
  const plugins = [];
77533
- const disabledPlugins = options?.VTablePluginModules?.filter(module => module.disabled);
77534
- const enabledPlugins = options?.VTablePluginModules?.filter(module => !module.disabled);
77535
- if (!disabledPlugins?.some(module => module.module === FilterPlugin)) {
77536
- const userPluginOptions = enabledPlugins?.find(module => module.module === FilterPlugin)
77609
+ const disabledPluginsUserSetted = options?.VTablePluginModules?.filter(module => module.disabled);
77610
+ let enabledPluginsUserSetted = options?.VTablePluginModules?.filter(module => !module.disabled);
77611
+ if (!disabledPluginsUserSetted?.some(module => module.module === FilterPlugin)) {
77612
+ const userPluginOptions = enabledPluginsUserSetted?.find(module => module.module === FilterPlugin)
77537
77613
  ?.moduleOptions;
77538
77614
  const filterPlugin = createFilterPlugin(sheetDefine, userPluginOptions);
77539
77615
  plugins.push(filterPlugin);
77540
77616
  }
77541
- if (!disabledPlugins?.some(module => module.module === AddRowColumnPlugin)) {
77542
- const userPluginOptions = enabledPlugins?.find(module => module.module === AddRowColumnPlugin)
77617
+ if (!disabledPluginsUserSetted?.some(module => module.module === AddRowColumnPlugin)) {
77618
+ const userPluginOptions = enabledPluginsUserSetted?.find(module => module.module === AddRowColumnPlugin)
77543
77619
  ?.moduleOptions;
77544
77620
  const addRowColumnPlugin = new AddRowColumnPlugin({
77545
77621
  addRowCallback: (row, tableInstance) => {
@@ -77548,13 +77624,15 @@
77548
77624
  ...userPluginOptions
77549
77625
  });
77550
77626
  plugins.push(addRowColumnPlugin);
77627
+ enabledPluginsUserSetted = enabledPluginsUserSetted?.filter(module => module.module !== AddRowColumnPlugin);
77551
77628
  }
77552
- if (!disabledPlugins?.some(module => module.module === TableSeriesNumber)) {
77553
- const userPluginOptions = enabledPlugins?.find(module => module.module === TableSeriesNumber)
77629
+ if (!disabledPluginsUserSetted?.some(module => module.module === TableSeriesNumber)) {
77630
+ const userPluginOptions = enabledPluginsUserSetted?.find(module => module.module === TableSeriesNumber)
77554
77631
  ?.moduleOptions;
77555
77632
  const tableSeriesNumberPlugin = new TableSeriesNumber({
77556
77633
  rowCount: sheetDefine?.rowCount || 100,
77557
77634
  colCount: sheetDefine?.columnCount || 100,
77635
+ dragOrder: sheetDefine?.dragOrder,
77558
77636
  rowSeriesNumberWidth: 30,
77559
77637
  colSeriesNumberHeight: 30,
77560
77638
  rowSeriesNumberCellStyle: sheetDefine?.theme?.rowSeriesNumberCellStyle || options?.theme?.rowSeriesNumberCellStyle,
@@ -77562,23 +77640,27 @@
77562
77640
  ...userPluginOptions
77563
77641
  });
77564
77642
  plugins.push(tableSeriesNumberPlugin);
77643
+ enabledPluginsUserSetted = enabledPluginsUserSetted?.filter(module => module.module !== TableSeriesNumber);
77565
77644
  }
77566
- if (!disabledPlugins?.some(module => module.module === ContextMenuPlugin)) {
77567
- const userPluginOptions = enabledPlugins?.find(module => module.module === ContextMenuPlugin)?.moduleOptions;
77645
+ if (!disabledPluginsUserSetted?.some(module => module.module === ContextMenuPlugin)) {
77646
+ const userPluginOptions = enabledPluginsUserSetted?.find(module => module.module === ContextMenuPlugin)?.moduleOptions;
77568
77647
  const contextMenuPlugin = createContextMenuItems(sheetDefine, userPluginOptions);
77569
77648
  plugins.push(contextMenuPlugin);
77649
+ enabledPluginsUserSetted = enabledPluginsUserSetted?.filter(module => module.module !== ContextMenuPlugin);
77570
77650
  }
77571
- if (!disabledPlugins?.some(module => module.module === ExcelEditCellKeyboardPlugin)) {
77572
- const userPluginOptions = enabledPlugins?.find(module => module.module === ExcelEditCellKeyboardPlugin)?.moduleOptions;
77651
+ if (!disabledPluginsUserSetted?.some(module => module.module === ExcelEditCellKeyboardPlugin)) {
77652
+ const userPluginOptions = enabledPluginsUserSetted?.find(module => module.module === ExcelEditCellKeyboardPlugin)?.moduleOptions;
77573
77653
  const excelEditCellKeyboardPlugin = new ExcelEditCellKeyboardPlugin(userPluginOptions);
77574
77654
  plugins.push(excelEditCellKeyboardPlugin);
77655
+ enabledPluginsUserSetted = enabledPluginsUserSetted?.filter(module => module.module !== ExcelEditCellKeyboardPlugin);
77575
77656
  }
77576
- if (!disabledPlugins?.some(module => module.module === AutoFillPlugin)) {
77657
+ if (!disabledPluginsUserSetted?.some(module => module.module === AutoFillPlugin)) {
77577
77658
  const autoFillPlugin = new AutoFillPlugin();
77578
77659
  plugins.push(autoFillPlugin);
77660
+ enabledPluginsUserSetted = enabledPluginsUserSetted?.filter(module => module.module !== AutoFillPlugin);
77579
77661
  }
77580
- if (options?.VTablePluginModules) {
77581
- options.VTablePluginModules.forEach((module) => {
77662
+ if (enabledPluginsUserSetted?.length) {
77663
+ enabledPluginsUserSetted.forEach((module) => {
77582
77664
  if (typeof module?.module === 'function') {
77583
77665
  plugins.push(new module.module(module.moduleOptions));
77584
77666
  }
@@ -78686,6 +78768,7 @@
78686
78768
  formulaEditor.setSheet(this);
78687
78769
  const contentWidth = this.contentElement.clientWidth;
78688
78770
  const contentHeight = this.contentElement.clientHeight;
78771
+ sheetDefine.dragOrder = sheetDefine.dragOrder ?? this.options.dragOrder;
78689
78772
  const sheet = new WorkSheet(this, {
78690
78773
  ...sheetDefine,
78691
78774
  container: this.contentElement,
@@ -78693,6 +78776,7 @@
78693
78776
  height: contentHeight,
78694
78777
  defaultRowHeight: this.options.defaultRowHeight,
78695
78778
  defaultColWidth: this.options.defaultColWidth,
78779
+ dragOrder: sheetDefine.dragOrder,
78696
78780
  plugins: getTablePlugins(sheetDefine, this.options),
78697
78781
  headerEditor: 'formula',
78698
78782
  editor: 'formula',
@@ -78843,6 +78927,18 @@
78843
78927
  }));
78844
78928
  }
78845
78929
  const formulas = this.formulaManager.exportFormulas(sheetDefine.sheetKey);
78930
+ const columnWidthConfig = Array.from(instance.tableInstance.internalProps._widthResizedColMap).map(key => {
78931
+ return {
78932
+ key: key,
78933
+ width: instance.tableInstance.getColWidth(key)
78934
+ };
78935
+ });
78936
+ const rowHeightConfig = Array.from(instance.tableInstance.internalProps._heightResizedRowMap).map(key => {
78937
+ return {
78938
+ key: key,
78939
+ height: instance.tableInstance.getRowHeight(key)
78940
+ };
78941
+ });
78846
78942
  sheets.push({
78847
78943
  ...sheetDefine,
78848
78944
  data,
@@ -78854,7 +78950,9 @@
78854
78950
  active: sheetDefine.sheetKey === this.sheetManager.getActiveSheet().sheetKey,
78855
78951
  filterState: filterState,
78856
78952
  sortState: currentSortState,
78857
- formulas: Object.keys(formulas).length > 0 ? formulas : undefined
78953
+ formulas: Object.keys(formulas).length > 0 ? formulas : undefined,
78954
+ columnWidthConfig,
78955
+ rowHeightConfig
78858
78956
  });
78859
78957
  }
78860
78958
  else {
@@ -80383,7 +80481,7 @@
80383
80481
  importStyle();
80384
80482
  }
80385
80483
 
80386
- const version = "1.22.2";
80484
+ const version = "1.22.3";
80387
80485
  importStyles();
80388
80486
 
80389
80487
  exports.TYPES = index;