@visactor/vtable-sheet 1.22.11-alpha.8 → 1.22.11

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.
@@ -2965,6 +2965,14 @@
2965
2965
  type: "wheel",
2966
2966
  handler: wheelHandler
2967
2967
  });
2968
+ const pasteHandler = e => {
2969
+ const pasteEvent = e;
2970
+ "0" === this.element.style.opacity && pasteEvent.preventDefault();
2971
+ };
2972
+ input.addEventListener("paste", pasteHandler), this.eventHandlers.push({
2973
+ type: "paste",
2974
+ handler: pasteHandler
2975
+ });
2968
2976
  }
2969
2977
  setValue(value) {
2970
2978
  this.element.value = void 0 !== value ? value : "";
@@ -37856,24 +37864,6 @@
37856
37864
  }, delay));
37857
37865
  };
37858
37866
  }
37859
- function cancellableThrottle(func, delay) {
37860
- let timer = null,
37861
- lastArgs = null,
37862
- context = null;
37863
- return {
37864
- throttled: function (...args) {
37865
- lastArgs = args, context = this, timer || (timer = setTimeout(() => {
37866
- lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
37867
- }, delay));
37868
- },
37869
- cancel: () => {
37870
- timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
37871
- },
37872
- flush: () => {
37873
- timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
37874
- }
37875
- };
37876
- }
37877
37867
  function pad(num, totalChars) {
37878
37868
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
37879
37869
  return num;
@@ -47722,35 +47712,11 @@
47722
47712
  return hoverMode;
47723
47713
  }
47724
47714
 
47725
- let brushingChartInstance,
47726
- brushingChartInstanceCellPos = {
47727
- col: -1,
47728
- row: -1
47729
- };
47730
- function setBrushingChartInstance(chartInstance, col, row) {
47731
- brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
47732
- col: col,
47733
- row: row
47734
- };
47735
- }
47736
- function clearBrushingChartInstance() {
47737
- brushingChartInstance = void 0, brushingChartInstanceCellPos = {
47738
- col: -1,
47739
- row: -1
47740
- };
47741
- }
47742
- function getBrushingChartInstance() {
47743
- return brushingChartInstance;
47744
- }
47745
- function getBrushingChartInstanceCellPos() {
47746
- return brushingChartInstanceCellPos;
47747
- }
47748
47715
  const chartInstanceListColumnByColumnDirection = {};
47749
47716
  const chartInstanceListRowByRowDirection = {};
47750
- const delayRunDimensionHoverTimer = [];
47751
47717
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47752
47718
  var _a;
47753
- clearDelayRunDimensionHoverTimers(), isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47719
+ isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47754
47720
  const {
47755
47721
  rowStart: rowStart
47756
47722
  } = table.getBodyVisibleRowRange();
@@ -47759,40 +47725,76 @@
47759
47725
  for (let i = rowStart; i <= rowEnd; i++) {
47760
47726
  const cellGroup = table.scenegraph.getCell(col, i),
47761
47727
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47762
- chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
47763
- const timer = setTimeout(() => {
47764
- var _a, _b, _c, _d;
47728
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
47729
+ var _a, _b, _c, _d, _e, _f;
47765
47730
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47766
47731
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47767
47732
  let isShowTooltip = !isScatter;
47768
- if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table)), isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_d = (_c = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47769
- const cellBoundry = table.getCellRelativeRect(col, i),
47770
- bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47733
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
47734
+ const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
47735
+ {
47736
+ rowEnd: rowEnd1
47737
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47738
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47739
+ const {
47740
+ rowEnd: rowEnd2
47741
+ } = table.getBodyVisibleRowRange(0, 5);
47742
+ isShowTooltip = rowEnd2 !== rowEnd;
47743
+ }
47744
+ } else if (i === rowStart && isShowTooltip) {
47745
+ const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
47746
+ {
47747
+ rowStart: rowStart1
47748
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47749
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
47750
+ const {
47751
+ rowStart: rowStart2
47752
+ } = table.getBodyVisibleRowRange(0, -5);
47753
+ isShowTooltip = rowStart2 !== rowStart;
47754
+ }
47755
+ }
47756
+ if (isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_f = (_e = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _f || _f.call(_e, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47757
+ const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47771
47758
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
47772
47759
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47773
47760
  tooltip: !1,
47774
47761
  showTooltipOption: {
47775
- x: canvasXY.x - cellBoundry.left,
47776
- y: absolutePositionTop - cellBoundry.top,
47762
+ x: canvasXY.x,
47763
+ y: absolutePositionTop,
47777
47764
  activeType: "dimension"
47778
47765
  }
47779
47766
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47780
47767
  tooltip: isShowTooltip,
47781
47768
  showTooltipOption: {
47782
- x: canvasXY.x - cellBoundry.left,
47783
- y: absolutePositionTop - cellBoundry.top,
47769
+ x: canvasXY.x,
47770
+ y: absolutePositionTop,
47784
47771
  activeType: "dimension"
47785
47772
  }
47786
47773
  });
47787
47774
  }
47788
47775
  }
47789
- }, 0);
47790
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47776
+ }, 0), table.scenegraph.updateNextFrame();
47777
+ }
47778
+ }
47779
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
47780
+ var _a;
47781
+ if (isValid$2(chartInstanceListColumnByColumnDirection[col])) {
47782
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
47783
+ if (isValid$2(excludedRow) && Number(i) === excludedRow) continue;
47784
+ const cellGroup = table.scenegraph.getCell(col, Number(i)),
47785
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47786
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$2(chartNode) && (chartNode.deactivate(table, {
47787
+ releaseChartInstance: !0,
47788
+ releaseColumnChartInstance: !1,
47789
+ releaseRowChartInstance: !1
47790
+ }), chartInstanceListColumnByColumnDirection[col][i] = null);
47791
+ }
47792
+ delete chartInstanceListColumnByColumnDirection[col];
47791
47793
  }
47792
47794
  }
47793
47795
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47794
47796
  var _a;
47795
- clearDelayRunDimensionHoverTimers(), isValid$2(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47797
+ isValid$2(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47796
47798
  const {
47797
47799
  colStart: colStart
47798
47800
  } = table.getBodyVisibleColRange();
@@ -47801,162 +47803,64 @@
47801
47803
  for (let i = colStart; i <= colEnd; i++) {
47802
47804
  const cellGroup = table.scenegraph.getCell(i, row),
47803
47805
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47804
- chartInstanceListRowByRowDirection[row][i] || isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
47805
- const timer = setTimeout(() => {
47806
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$2(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
47806
47807
  var _a, _b, _c, _d;
47807
47808
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
47808
47809
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47809
47810
  let isShowTooltip = !isScatter;
47810
- if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table)), isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47811
- const cellBoundry = table.getCellRelativeRect(i, row),
47812
- bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47811
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
47812
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47813
+ {
47814
+ colEnd: colEnd1
47815
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47816
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
47817
+ const {
47818
+ colEnd: colEnd2
47819
+ } = table.getBodyVisibleColRange(0, 5);
47820
+ isShowTooltip = colEnd2 !== colEnd;
47821
+ }
47822
+ } else if (i === colStart && isShowTooltip) {
47823
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47824
+ {
47825
+ colStart: colStart1
47826
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47827
+ if (colStart1 === colStart) isShowTooltip = !0;else {
47828
+ const {
47829
+ colStart: colStart2
47830
+ } = table.getBodyVisibleColRange(0, -5);
47831
+ isShowTooltip = colStart2 !== colStart;
47832
+ }
47833
+ }
47834
+ if (isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47835
+ const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47813
47836
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
47814
47837
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47815
47838
  tooltip: !1,
47816
47839
  showTooltipOption: {
47817
- x: absolutePositionLeft - cellBoundry.left,
47818
- y: canvasXY.y - cellBoundry.top,
47840
+ x: absolutePositionLeft,
47841
+ y: canvasXY.y,
47819
47842
  activeType: "dimension"
47820
47843
  }
47821
47844
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47822
47845
  tooltip: isShowTooltip,
47823
47846
  showTooltipOption: {
47824
- x: absolutePositionLeft - cellBoundry.left,
47825
- y: canvasXY.y - cellBoundry.top,
47847
+ x: absolutePositionLeft,
47848
+ y: canvasXY.y,
47826
47849
  activeType: "dimension"
47827
47850
  }
47828
47851
  });
47829
47852
  }
47830
47853
  }
47831
- }, 0);
47832
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47833
- }
47834
- }
47835
- function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
47836
- var _a;
47837
- clearDelayRunDimensionHoverTimers();
47838
- const {
47839
- rowStart: rowStart
47840
- } = table.getBodyVisibleRowRange();
47841
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47842
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47843
- const {
47844
- colStart: colStart
47845
- } = table.getBodyVisibleColRange();
47846
- let colEnd = table.getBodyVisibleColRange().colEnd;
47847
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47848
- for (let col = colStart; col <= colEnd; col++) {
47849
- isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47850
- for (let i = rowStart; i <= rowEnd; i++) {
47851
- const cellGroup = table.scenegraph.getCell(col, i),
47852
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47853
- chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
47854
- const timer = setTimeout(() => {
47855
- var _a, _b;
47856
- if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47857
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47858
- let isShowTooltip = !0;
47859
- "object" == typeof chartDimensionLinkage && (deactivate ? (chartInstanceListColumnByColumnDirection[col][i].setHovered(), chartInstanceListColumnByColumnDirection[col][i].hideTooltip()) : (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table), isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table), chartInstanceListColumnByColumnDirection[col][i].setHovered(datum), isShowTooltip && chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
47860
- activeType: "mark"
47861
- })));
47862
- }
47863
- }, 0);
47864
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47865
- }
47866
- }
47867
- }
47868
- function checkIsShowTooltipForEdgeRow(row, table) {
47869
- var _a, _b;
47870
- let isShowTooltip = !0;
47871
- const {
47872
- rowStart: rowStart
47873
- } = table.getBodyVisibleRowRange();
47874
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47875
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47876
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47877
- if (row === rowEnd && isShowTooltip) {
47878
- const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
47879
- {
47880
- rowEnd: rowEnd1
47881
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47882
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47883
- const {
47884
- rowEnd: rowEnd2
47885
- } = table.getBodyVisibleRowRange(0, 5);
47886
- isShowTooltip = rowEnd2 !== rowEnd;
47887
- }
47888
- } else if (row === rowStart && isShowTooltip) {
47889
- const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
47890
- {
47891
- rowStart: rowStart1
47892
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47893
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
47894
- const {
47895
- rowStart: rowStart2
47896
- } = table.getBodyVisibleRowRange(0, -5);
47897
- isShowTooltip = rowStart2 !== rowStart;
47898
- }
47899
- }
47900
- return isShowTooltip;
47901
- }
47902
- function checkIsShowTooltipForEdgeColumn(col, table) {
47903
- let isShowTooltip = !0;
47904
- const {
47905
- colStart: colStart
47906
- } = table.getBodyVisibleColRange();
47907
- let colEnd = table.getBodyVisibleColRange().colEnd;
47908
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47909
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47910
- if (col === colEnd && isShowTooltip) {
47911
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47912
- {
47913
- colEnd: colEnd1
47914
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47915
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
47916
- const {
47917
- colEnd: colEnd2
47918
- } = table.getBodyVisibleColRange(0, 5);
47919
- isShowTooltip = colEnd2 !== colEnd;
47920
- }
47921
- } else if (col === colStart && isShowTooltip) {
47922
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47923
- {
47924
- colStart: colStart1
47925
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47926
- if (colStart1 === colStart) isShowTooltip = !0;else {
47927
- const {
47928
- colStart: colStart2
47929
- } = table.getBodyVisibleColRange(0, -5);
47930
- isShowTooltip = colStart2 !== colStart;
47931
- }
47932
- }
47933
- return isShowTooltip;
47934
- }
47935
- function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
47936
- var _a;
47937
- if (isValid$2(chartInstanceListColumnByColumnDirection[col])) {
47938
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
47939
- if (isValid$2(excludedRow) && Number(i) === excludedRow) continue;
47940
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
47941
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47942
- isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47943
- forceRelease: forceRelease,
47944
- releaseChartInstance: !0,
47945
- releaseColumnChartInstance: !1,
47946
- releaseRowChartInstance: !1
47947
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
47948
- }
47949
- delete chartInstanceListColumnByColumnDirection[col];
47854
+ }, 0), table.scenegraph.updateNextFrame();
47950
47855
  }
47951
47856
  }
47952
- function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
47857
+ function clearChartInstanceListByRowDirection(row, excludedCol, table) {
47953
47858
  var _a;
47954
47859
  if (isValid$2(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
47955
47860
  if (isValid$2(excludedCol) && Number(i) === excludedCol) continue;
47956
47861
  const cellGroup = table.scenegraph.getCell(Number(i), row),
47957
47862
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47958
- isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47959
- forceRelease: forceRelease,
47863
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$2(chartNode) && (chartNode.deactivate(table, {
47960
47864
  releaseChartInstance: !0,
47961
47865
  releaseColumnChartInstance: !1,
47962
47866
  releaseRowChartInstance: !1
@@ -47964,19 +47868,6 @@
47964
47868
  }
47965
47869
  delete chartInstanceListRowByRowDirection[row];
47966
47870
  }
47967
- function clearDelayRunDimensionHoverTimers() {
47968
- for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
47969
- delayRunDimensionHoverTimer.length = 0;
47970
- }
47971
- function clearAllChartInstanceList(table, forceRelease = !1) {
47972
- clearDelayRunDimensionHoverTimers();
47973
- for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
47974
- for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
47975
- }
47976
- let disabledShowTooltipToAllChartInstances = !1;
47977
- function isDisabledShowTooltipToAllChartInstances() {
47978
- return disabledShowTooltipToAllChartInstances;
47979
- }
47980
47871
 
47981
47872
  function isValidAlignDomain(domain) {
47982
47873
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -48610,7 +48501,7 @@
48610
48501
  const CHART_NUMBER_TYPE = genNumberType();
48611
48502
  class Chart extends Rect$2 {
48612
48503
  constructor(isShareChartSpec, params) {
48613
- if (super(params), this.type = "chart", this.activeChartInstanceLastViewBox = null, this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
48504
+ if (super(params), this.type = "chart", this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
48614
48505
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
48615
48506
  renderCanvas: params.canvas,
48616
48507
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -48631,7 +48522,7 @@
48631
48522
  }
48632
48523
  }
48633
48524
  activate(table) {
48634
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48525
+ var _a, _b, _c, _d, _e;
48635
48526
  if (this.activeChartInstance) return;
48636
48527
  const {
48637
48528
  col: col,
@@ -48650,7 +48541,7 @@
48650
48541
  y1: y1 - table.scrollTop,
48651
48542
  y2: y2 - table.scrollTop
48652
48543
  });
48653
- this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
48544
+ null === (_a = this.activeChartInstance) || void 0 === _a || _a.release(), this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
48654
48545
  renderCanvas: this.attribute.canvas,
48655
48546
  mode: "desktop-browser",
48656
48547
  canvasControled: !1,
@@ -48684,7 +48575,7 @@
48684
48575
  layer.main && drawParams.clear && hoverColor && (context.beginPath(), context.fillStyle = hoverColor, context.rect(viewBox.x1, viewBox.y1, viewBox.x2 - viewBox.x1, viewBox.y2 - viewBox.y1), context.fill());
48685
48576
  }
48686
48577
  },
48687
- componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
48578
+ componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
48688
48579
  tooltip: {
48689
48580
  dimension: !1,
48690
48581
  mark: !0
@@ -48695,43 +48586,16 @@
48695
48586
  const chartStage = this.activeChartInstance.getStage(),
48696
48587
  matrix = this.globalTransMatrix.clone(),
48697
48588
  stageMatrix = this.stage.window.getViewBoxTransform();
48698
- let brushChangeThrottle;
48699
48589
  matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), this.activeChartInstance.renderSync(), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, this.activeChartInstance), this.activeChartInstance.on("click", params => {
48700
48590
  var _a;
48701
- !1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null, void 0) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum, "click");
48702
- }), (null === (_d = table.options.chartDimensionLinkage) || void 0 === _d ? void 0 : _d.listenBrushChange) && (brushChangeThrottle = cancellableThrottle(table.scenegraph.updateChartState.bind(table.scenegraph), null !== (_f = null === (_e = table.options.chartDimensionLinkage) || void 0 === _e ? void 0 : _e.brushChangeDelay) && void 0 !== _f ? _f : 100), this.activeChartInstance.on("brushChange", params => {
48703
- var _a;
48704
- brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
48705
- })), this.activeChartInstance.on("brushStart", params => {
48706
- const brushingChartInstance = getBrushingChartInstance();
48707
- brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
48591
+ !1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum);
48708
48592
  }), this.activeChartInstance.on("brushEnd", params => {
48709
48593
  var _a;
48710
- null == brushChangeThrottle || brushChangeThrottle.cancel(), table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush"), Chart.temp = 0, setTimeout(() => {
48594
+ table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
48711
48595
  Chart.temp = 1;
48712
48596
  }, 0);
48713
- }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
48714
- markName: "pie"
48715
- }, params => {
48716
- var _a;
48717
- const categoryField = this.attribute.spec.categoryField,
48718
- datum = {
48719
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48720
- };
48721
- generateChartInstanceListByViewRange(datum, table, !1);
48722
- }), this.activeChartInstance.on("pointerout", {
48723
- markName: "pie"
48724
- }, params => {
48725
- var _a;
48726
- const categoryField = this.attribute.spec.categoryField,
48727
- datum = {
48728
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48729
- };
48730
- generateChartInstanceListByViewRange(datum, table, !0);
48731
- })), this.activeChartInstance.on("dimensionHover", params => {
48597
+ }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
48732
48598
  var _a, _b;
48733
- if (isDisabledShowTooltipToAllChartInstances()) return;
48734
- this.activeChartInstance.disableTooltip(!1);
48735
48599
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
48736
48600
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
48737
48601
  viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
@@ -48748,11 +48612,11 @@
48748
48612
  prev_justShowMarkTooltip = this.justShowMarkTooltip;
48749
48613
  params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
48750
48614
  let delayRunDimensionHover = !1;
48751
- if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, this.clearDelayRunDimensionHoverTimer()), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
48615
+ if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
48752
48616
  const dimensionValue = dimensionInfo.value,
48753
48617
  indicatorsAsCol = table.options.indicatorsAsCol;
48754
- if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
48755
- isDisabledShowTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
48618
+ if (delayRunDimensionHover ? (clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = setTimeout(() => {
48619
+ indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
48756
48620
  }, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
48757
48621
  const series = dimensionInfo.data[0].series,
48758
48622
  width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
@@ -48793,26 +48657,21 @@
48793
48657
  }
48794
48658
  }
48795
48659
  }
48796
- })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledShowTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
48797
- }
48798
- clearDelayRunDimensionHoverTimer() {
48799
- clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
48660
+ }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
48800
48661
  }
48801
48662
  deactivate(table, {
48802
- forceRelease = !1,
48803
48663
  releaseChartInstance = !0,
48804
48664
  releaseColumnChartInstance = !0,
48805
- releaseRowChartInstance = !0,
48806
- releaseAllChartInstance = !1
48665
+ releaseRowChartInstance = !0
48807
48666
  } = {}) {
48808
48667
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48809
- if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
48810
- !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48668
+ if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
48669
+ null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48811
48670
  x1: -1e3,
48812
48671
  x2: -800,
48813
48672
  y1: -1e3,
48814
48673
  y2: -800
48815
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
48674
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
48816
48675
  const {
48817
48676
  col: col,
48818
48677
  row: row
@@ -48825,7 +48684,7 @@
48825
48684
  } = this.parent;
48826
48685
  releaseColumnChartInstance && table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_h = null === (_g = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild) || void 0 === _g ? void 0 : _g.hideLabelHoverOnAxis) || void 0 === _h || _h.call(_g)), releaseRowChartInstance && table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_k = null === (_j = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild) || void 0 === _j ? void 0 : _j.hideLabelHoverOnAxis) || void 0 === _k || _k.call(_j));
48827
48686
  }
48828
- releaseAllChartInstance ? clearAllChartInstanceList(table, forceRelease) : (releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table, forceRelease), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table, forceRelease));
48687
+ releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table);
48829
48688
  }
48830
48689
  updateData(data) {
48831
48690
  this.attribute.data = data;
@@ -48840,14 +48699,13 @@
48840
48699
  y1: y1,
48841
48700
  x2: x2,
48842
48701
  y2: y2
48843
- } = cellGroup.globalAABBBounds,
48844
- viewBox = {
48845
- x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (null !== (_b = null === (_a = table.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0)),
48846
- x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (null !== (_d = null === (_c = table.options.viewBox) || void 0 === _c ? void 0 : _c.x1) && void 0 !== _d ? _d : 0)),
48847
- y1: Math.ceil(y1 + padding[0] + table.scrollTop + (null !== (_f = null === (_e = table.options.viewBox) || void 0 === _e ? void 0 : _e.y1) && void 0 !== _f ? _f : 0)),
48848
- y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (null !== (_h = null === (_g = table.options.viewBox) || void 0 === _g ? void 0 : _g.y1) && void 0 !== _h ? _h : 0))
48849
- };
48850
- return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
48702
+ } = cellGroup.globalAABBBounds;
48703
+ return {
48704
+ x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (null !== (_b = null === (_a = table.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0)),
48705
+ x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (null !== (_d = null === (_c = table.options.viewBox) || void 0 === _c ? void 0 : _c.x1) && void 0 !== _d ? _d : 0)),
48706
+ y1: Math.ceil(y1 + padding[0] + table.scrollTop + (null !== (_f = null === (_e = table.options.viewBox) || void 0 === _e ? void 0 : _e.y1) && void 0 !== _f ? _f : 0)),
48707
+ y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (null !== (_h = null === (_g = table.options.viewBox) || void 0 === _g ? void 0 : _g.y1) && void 0 !== _h ? _h : 0))
48708
+ };
48851
48709
  }
48852
48710
  }
48853
48711
  function getTableBounds(col, row, table) {
@@ -49062,7 +48920,7 @@
49062
48920
  {
49063
48921
  width = groupAttribute.width,
49064
48922
  height = groupAttribute.height
49065
- } = chart.attribute,
48923
+ } = (chart.getViewBox(), chart.attribute),
49066
48924
  {
49067
48925
  table: table
49068
48926
  } = chart.getRootNode(),
@@ -49090,9 +48948,8 @@
49090
48948
  });
49091
48949
  }
49092
48950
  }
49093
- const lastViewBox = chart.activeChartInstanceLastViewBox,
49094
- viewBox = chart.getViewBox();
49095
- lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
48951
+ const viewBox = chart.getViewBox();
48952
+ activeChartInstance.updateViewBox({
49096
48953
  x1: 0,
49097
48954
  x2: viewBox.x2 - viewBox.x1,
49098
48955
  y1: 0,
@@ -51889,7 +51746,7 @@
51889
51746
  rowUpdatePos = isValid$2(rowUpdatePos) ? isValid$2(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
51890
51747
  }
51891
51748
  let updateAfter;
51892
- if (scene.table._clearRowRangeHeightsMap(), addRows.forEach(row => {
51749
+ if (scene.table._clearRowRangeHeightsMap(), verifyProxyRowStatus(scene), addRows.forEach(row => {
51893
51750
  const needUpdateAfter = addRow(row, scene, skipUpdateProxy);
51894
51751
  updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.insert(row);
51895
51752
  }), resetRowNumberAndY(scene), addRows.length) {
@@ -52119,6 +51976,25 @@
52119
51976
  function setRowSeriesNumberCellNeedUpdate(startUpdateRow, scene) {
52120
51977
  if (scene.table.isHasSeriesNumber()) for (let row = startUpdateRow; row <= scene.table.rowCount - 1; row++) updateCell$1(0, row, scene.table, !1);
52121
51978
  }
51979
+ function verifyProxyRowStatus(scene) {
51980
+ const proxy = scene.proxy,
51981
+ {
51982
+ rowStart: rowStart,
51983
+ rowEnd: rowEnd,
51984
+ rowLimit: rowLimit,
51985
+ totalRow: totalRow
51986
+ } = proxy;
51987
+ if (rowStart > rowEnd) return proxy.rowStart = scene.table.columnHeaderLevelCount, proxy.rowEnd = Math.min(totalRow, proxy.rowStart + rowLimit - 1), void (proxy.currentRow = 0);
51988
+ if (rowStart + rowLimit - 1 > totalRow) {
51989
+ const oldRowStart = proxy.rowStart,
51990
+ newRowStart = Math.max(scene.table.columnHeaderLevelCount, totalRow - rowLimit + 1);
51991
+ if (newRowStart === oldRowStart) return;
51992
+ proxy.rowStart = newRowStart, proxy.rowEnd = Math.min(totalRow, newRowStart + rowLimit - 1), proxy.currentRow = proxy.rowEnd + 1;
51993
+ const addRowCount = oldRowStart - proxy.rowStart;
51994
+ for (let i = 0; i < addRowCount; i++) addRowCellGroup(proxy.rowStart + i, scene);
51995
+ proxy.rowUpdatePos = proxy.rowStart;
51996
+ }
51997
+ }
52122
51998
 
52123
51999
  function createReactContainer(table) {
52124
52000
  const {
@@ -52610,10 +52486,9 @@
52610
52486
  });
52611
52487
  }
52612
52488
  }
52613
- function updateChartState(scenegraph, datum, selectedDataMode) {
52489
+ function updateChartState(scenegraph, datum) {
52614
52490
  const table = scenegraph.table;
52615
52491
  if (table.isPivotChart()) {
52616
- table._selectedDataMode = selectedDataMode;
52617
52492
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
52618
52493
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
52619
52494
  const newSelectedDataItemsInChart = [];
@@ -53361,39 +53236,16 @@
53361
53236
  resetResidentHoverIcon(col, row) {
53362
53237
  resetResidentHoverIcon(col, row, this);
53363
53238
  }
53364
- deactivateChart(col, row, forceRelease = !1) {
53365
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53366
- if (-1 === col || -1 === row) {
53367
- if (forceRelease) {
53368
- const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
53369
- brushingChartInstance = getBrushingChartInstance();
53370
- if (brushingChartInstanceCellPos && brushingChartInstance) {
53371
- const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
53372
- (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (clearBrushingChartInstance(), null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
53373
- forceRelease: !0,
53374
- releaseChartInstance: !0,
53375
- releaseColumnChartInstance: !0,
53376
- releaseRowChartInstance: !0,
53377
- releaseAllChartInstance: !0
53378
- }));
53379
- }
53380
- }
53381
- return;
53382
- }
53239
+ deactivateChart(col, row) {
53240
+ var _a, _b, _c;
53241
+ if (-1 === col || -1 === row) return;
53383
53242
  const cellGroup = this.getCell(col, row);
53384
- if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
53385
- if (forceRelease) return clearBrushingChartInstance(), void (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _e ? void 0 : _e.deactivate) || void 0 === _f || _f.call(_e, this.table, {
53386
- forceRelease: !0,
53387
- releaseChartInstance: !0,
53388
- releaseColumnChartInstance: !0,
53389
- releaseRowChartInstance: !0,
53390
- releaseAllChartInstance: !0
53391
- }));
53243
+ if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
53392
53244
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
53393
- null === (_h = null === (_g = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _g ? void 0 : _g.deactivate) || void 0 === _h || _h.call(_g, this.table, (null === (_j = this.table.options.chartDimensionLinkage) || void 0 === _j ? void 0 : _j.showTooltip) ? {
53394
- releaseChartInstance: "pie" !== chartType && ("scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
53395
- releaseColumnChartInstance: "pie" !== chartType && (col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
53396
- releaseRowChartInstance: "pie" !== chartType && (row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount)
53245
+ null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, this.table.options.chartDimensionLinkage ? {
53246
+ releaseChartInstance: "scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
53247
+ releaseColumnChartInstance: col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
53248
+ releaseRowChartInstance: row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
53397
53249
  } : void 0);
53398
53250
  }
53399
53251
  }
@@ -53441,15 +53293,8 @@
53441
53293
  updateChartSizeForResizeRowHeight(row) {
53442
53294
  updateChartSizeForResizeRowHeight(this, row);
53443
53295
  }
53444
- updateChartState(datum, selectedDataMode) {
53445
- var _a, _b;
53446
- if (this.table.isPivotChart()) {
53447
- if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
53448
- const brushingChartInstance = getBrushingChartInstance();
53449
- brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), null === (_b = null === (_a = this.table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.clearChartState) || void 0 === _b || _b.call(_a);
53450
- }
53451
- updateChartState(this, datum, selectedDataMode);
53452
- }
53296
+ updateChartState(datum) {
53297
+ this.table.isPivotChart() && updateChartState(this, datum);
53453
53298
  }
53454
53299
  updateCheckboxCellState(col, row, checked) {
53455
53300
  var _a, _b;
@@ -54105,7 +53950,7 @@
54105
53950
  } else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
54106
53951
  if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
54107
53952
  if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
54108
- let extendSelectRange = !0;
53953
+ let extendSelectRange = !isValid$2(skipBodyMerge) || !skipBodyMerge;
54109
53954
  -1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
54110
53955
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
54111
53956
  if (currentRange) {
@@ -54227,7 +54072,7 @@
54227
54072
  };
54228
54073
  enableShiftSelectMode || (currentRange.end = currentRange.start), scenegraph.deleteLastSelectedRangeComponents(), scenegraph.updateCellSelectBorder(currentRange);
54229
54074
  } else {
54230
- let extendSelectRange = !0;
54075
+ let extendSelectRange = !isValid$2(skipBodyMerge) || !skipBodyMerge;
54231
54076
  if (-1 === cellPos.col || -1 === cellPos.row || enableCtrlSelectMode || (state.select.ranges = [], scenegraph.deleteAllSelectBorder()), "cell" !== state.select.headerSelectMode && table.isColumnHeader(col, row)) {
54232
54077
  const cellRange = table.getCellRange(col, row);
54233
54078
  "body" === state.select.headerSelectMode ? state.select.ranges.push({
@@ -56476,7 +56321,7 @@
56476
56321
  }, 0 !== e.button) return;
56477
56322
  const eventArgsSet = getCellEventArgsSet(e);
56478
56323
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
56479
- if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && (table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0)), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
56324
+ if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
56480
56325
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
56481
56326
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
56482
56327
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -56504,7 +56349,7 @@
56504
56349
  }
56505
56350
  eventManager.dealTableHover(eventArgsSet);
56506
56351
  } else {
56507
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), void stateManager.updateInteractionState(InteractionState.grabing);
56352
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
56508
56353
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56509
56354
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56510
56355
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -56656,7 +56501,7 @@
56656
56501
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
56657
56502
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
56658
56503
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
56659
- table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
56504
+ table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
56660
56505
  const {
56661
56506
  eventArgs: eventArgs
56662
56507
  } = eventArgsSet;
@@ -56675,7 +56520,7 @@
56675
56520
  if (table.eventManager.isDraging || !target || !target.isDescendantsOf(table.scenegraph.stage) && target.stage !== target || target.isDescendantsOf(table.scenegraph.tableGroup)) table.eventManager.isDraging && stateManager.isSelecting() && stateManager.endSelectCells();else {
56676
56521
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
56677
56522
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
56678
- (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, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
56523
+ (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);
56679
56524
  }
56680
56525
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
56681
56526
  var _a, _b, _c;
@@ -56793,15 +56638,7 @@
56793
56638
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
56794
56639
  }), table.scenegraph.stage.addEventListener("wheel", e => {
56795
56640
  var _a;
56796
- if (!e.path.find(node => "legend" === node.name)) {
56797
- null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
56798
- const {
56799
- cellPos: cellPos
56800
- } = table.stateManager.hover,
56801
- prevHoverCellCol = cellPos.col,
56802
- prevHoverCellRow = cellPos.row;
56803
- table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
56804
- }
56641
+ e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
56805
56642
  });
56806
56643
  }
56807
56644
  function bindGesture(eventManager) {
@@ -56916,13 +56753,11 @@
56916
56753
  const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
56917
56754
  throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
56918
56755
  scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
56919
- var _a;
56920
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
56756
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
56921
56757
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
56922
56758
  throttleVerticalWheel(ratio, e);
56923
56759
  }), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
56924
- var _a;
56925
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
56760
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
56926
56761
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
56927
56762
  throttleHorizontalWheel(ratio);
56928
56763
  });
@@ -57072,7 +56907,7 @@
57072
56907
  const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
57073
56908
  eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
57074
56909
  }
57075
- }), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
56910
+ });
57076
56911
  }
57077
56912
  };
57078
56913
  eventManager.globalEventListeners.push({
@@ -59908,13 +59743,41 @@
59908
59743
 
59909
59744
  class CustomCellStylePlugin {
59910
59745
  constructor(table, customCellStyle, customCellStyleArrangement) {
59911
- this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
59746
+ this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement, this._customCellStyleArrangementIndex = new Map(), this._customCellStyleArrangementTombstoneCount = 0, this._rebuildCustomCellStyleArrangementIndex();
59747
+ }
59748
+ _getCustomCellStyleArrangementKey(cellPos) {
59749
+ if (cellPos.range) {
59750
+ const {
59751
+ start: start,
59752
+ end: end
59753
+ } = cellPos.range;
59754
+ return `range:${start.col},${start.row},${end.col},${end.row}`;
59755
+ }
59756
+ if (void 0 !== cellPos.col && void 0 !== cellPos.row) return `cell:${cellPos.col},${cellPos.row}`;
59757
+ }
59758
+ _rebuildCustomCellStyleArrangementIndex() {
59759
+ this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0;
59760
+ for (let i = 0; i < this.customCellStyleArrangement.length; i++) {
59761
+ if (!isValid$2(this.customCellStyleArrangement[i].customStyleId)) {
59762
+ this._customCellStyleArrangementTombstoneCount++;
59763
+ continue;
59764
+ }
59765
+ const key = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[i].cellPosition);
59766
+ key && this._customCellStyleArrangementIndex.set(key, i);
59767
+ }
59768
+ }
59769
+ _compactCustomCellStyleArrangementIfNeeded() {
59770
+ const length = this.customCellStyleArrangement.length;
59771
+ if (this._customCellStyleArrangementTombstoneCount < 2048) return;
59772
+ if (4 * this._customCellStyleArrangementTombstoneCount < length) return;
59773
+ const compacted = this.customCellStyleArrangement.filter(style => isValid$2(style.customStyleId));
59774
+ compacted.length !== this.customCellStyleArrangement.length ? (this.customCellStyleArrangement.length = 0, this.customCellStyleArrangement.push(...compacted), this._rebuildCustomCellStyleArrangementIndex()) : this._customCellStyleArrangementTombstoneCount = 0;
59912
59775
  }
59913
59776
  getCustomCellStyle(col, row) {
59914
59777
  const customStyleIds = this.getCustomCellStyleIds(col, row);
59915
59778
  if (customStyleIds.length) {
59916
59779
  const styles = [];
59917
- return customStyleIds.forEach(customStyleId => {
59780
+ if (customStyleIds.forEach(customStyleId => {
59918
59781
  const styleOption = this.getCustomCellStyleOption(customStyleId);
59919
59782
  if (isFunction$4(null == styleOption ? void 0 : styleOption.style)) {
59920
59783
  const style = styleOption.style({
@@ -59927,14 +59790,15 @@
59927
59790
  });
59928
59791
  styles.push(style);
59929
59792
  } else (null == styleOption ? void 0 : styleOption.style) && styles.push(styleOption.style);
59930
- }), merge({}, ...styles);
59793
+ }), !styles.length) return;
59794
+ return merge({}, ...styles);
59931
59795
  }
59932
59796
  }
59933
59797
  getCustomCellStyleIds(col, row) {
59934
59798
  const customStyleIds = [],
59935
59799
  range = this.table.getCellRange(col, row);
59936
59800
  for (let c = range.start.col; c <= range.end.col; c++) for (let r = range.start.row; r <= range.end.row; r++) this.customCellStyleArrangement.forEach(style => {
59937
- style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId);
59801
+ isValid$2(style.customStyleId) && (style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId));
59938
59802
  });
59939
59803
  return customStyleIds;
59940
59804
  }
@@ -59955,21 +59819,35 @@
59955
59819
  }), this.table.scenegraph.updateNextFrame();
59956
59820
  }
59957
59821
  arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
59958
- var _a;
59959
- const index = this.customCellStyleArrangement.findIndex(style => style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row);
59960
- if (-1 === index && !customStyleId) return;
59961
- if (-1 === index && customStyleId) this.customCellStyleArrangement.push({
59962
- cellPosition: {
59963
- col: cellPos.col,
59964
- row: cellPos.row,
59965
- range: cellPos.range
59966
- },
59967
- customStyleId: customStyleId
59968
- });else {
59822
+ var _a, _b;
59823
+ const inputKey = this._getCustomCellStyleArrangementKey(cellPos);
59824
+ let index = inputKey && null !== (_a = this._customCellStyleArrangementIndex.get(inputKey)) && void 0 !== _a ? _a : -1;
59825
+ if (inputKey && -1 !== index) {
59826
+ const item = this.customCellStyleArrangement[index],
59827
+ itemKey = item ? this._getCustomCellStyleArrangementKey(item.cellPosition) : void 0;
59828
+ item && isValid$2(item.customStyleId) && itemKey === inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$2(style.customStyleId) && this._getCustomCellStyleArrangementKey(style.cellPosition) === inputKey), -1 !== index ? this._customCellStyleArrangementIndex.set(inputKey, index) : this._customCellStyleArrangementIndex.delete(inputKey));
59829
+ }
59830
+ if (-1 !== index || inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$2(style.customStyleId) && (style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row))), -1 === index && !customStyleId) return;
59831
+ if (-1 === index && customStyleId) {
59832
+ this.customCellStyleArrangement.push({
59833
+ cellPosition: {
59834
+ col: cellPos.col,
59835
+ row: cellPos.row,
59836
+ range: cellPos.range
59837
+ },
59838
+ customStyleId: customStyleId
59839
+ });
59840
+ const pushedIndex = this.customCellStyleArrangement.length - 1,
59841
+ pushedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[pushedIndex].cellPosition);
59842
+ pushedKey && this._customCellStyleArrangementIndex.set(pushedKey, pushedIndex);
59843
+ } else {
59969
59844
  if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
59970
- customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
59845
+ if (customStyleId) this.customCellStyleArrangement[index].customStyleId = customStyleId;else {
59846
+ const existedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[index].cellPosition);
59847
+ isValid$2(this.customCellStyleArrangement[index].customStyleId) && this._customCellStyleArrangementTombstoneCount++, this.customCellStyleArrangement[index].customStyleId = null, existedKey && this._customCellStyleArrangementIndex.delete(existedKey), this._compactCustomCellStyleArrangementIfNeeded();
59848
+ }
59971
59849
  }
59972
- const style = null === (_a = this.getCustomCellStyleOption(customStyleId)) || void 0 === _a ? void 0 : _a.style;
59850
+ const style = customStyleId ? null === (_b = this.getCustomCellStyleOption(customStyleId)) || void 0 === _b ? void 0 : _b.style : void 0;
59973
59851
  if (style) {
59974
59852
  forceFastUpdate = !0;
59975
59853
  for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
@@ -59984,7 +59862,7 @@
59984
59862
  this.table.scenegraph.updateNextFrame();
59985
59863
  }
59986
59864
  updateCustomCell(customCellStyle, customCellStyleArrangement) {
59987
- this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, customCellStyle.forEach(cellStyle => {
59865
+ this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0, customCellStyle.forEach(cellStyle => {
59988
59866
  this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
59989
59867
  }), customCellStyleArrangement.forEach(cellStyle => {
59990
59868
  this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
@@ -60215,7 +60093,7 @@
60215
60093
  }
60216
60094
  constructor(container, options = {}) {
60217
60095
  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;
60218
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.8", 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");
60096
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11", 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");
60219
60097
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
60220
60098
  options: options,
60221
60099
  container: container
@@ -61429,16 +61307,16 @@
61429
61307
  startCol = enableShiftSelectMode && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.col) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.col : colIndex,
61430
61308
  endCol = colIndex,
61431
61309
  endRow = this.rowCount - 1;
61432
- this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
61310
+ this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
61433
61311
  }
61434
61312
  dragSelectCol(colIndex, enableCtrlSelectMode) {
61435
61313
  var _a, _b;
61436
61314
  const currentSelectRanges = this.stateManager.select.ranges,
61437
61315
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
61438
- lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
61316
+ lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
61439
61317
  }
61440
61318
  endDragSelect() {
61441
- this.stateManager.updateInteractionState(InteractionState.default), this.stateManager.endSelectCells(!1, !1);
61319
+ this.stateManager.updateInteractionState(InteractionState.default);
61442
61320
  }
61443
61321
  startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
61444
61322
  var _a, _b, _c, _d, _e, _f;
@@ -61446,13 +61324,13 @@
61446
61324
  startRow = isShift && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.row) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.row : rowIndex,
61447
61325
  endCol = this.colCount - 1,
61448
61326
  endRow = rowIndex;
61449
- this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
61327
+ this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
61450
61328
  }
61451
61329
  dragSelectRow(rowIndex, isCtrl) {
61452
61330
  var _a, _b;
61453
61331
  const currentSelectRanges = this.stateManager.select.ranges,
61454
61332
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
61455
- lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
61333
+ lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
61456
61334
  }
61457
61335
  get recordsCount() {
61458
61336
  var _a;
@@ -62374,6 +62252,18 @@
62374
62252
  }
62375
62253
  return !1;
62376
62254
  }
62255
+ updateCellContent(col, row) {
62256
+ this.scenegraph.updateCellContent(col, row);
62257
+ }
62258
+ updateCellContentRange(startCol, startRow, endCol, endRow) {
62259
+ for (let i = startCol; i <= endCol; i++) for (let j = startRow; j <= endRow; j++) this.scenegraph.updateCellContent(i, j);
62260
+ }
62261
+ updateCellContentRanges(ranges) {
62262
+ for (let i = 0; i < ranges.length; i++) {
62263
+ const range = ranges[i];
62264
+ this.updateCellContentRange(range.start.col, range.start.row, range.end.col, range.end.row);
62265
+ }
62266
+ }
62377
62267
  }
62378
62268
 
62379
62269
  const chartTypes = {};
@@ -63876,8 +63766,8 @@
63876
63766
  col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1;
63877
63767
  const editor = this.table.getEditor(col, row);
63878
63768
  editor && setTimeout(() => {
63879
- var _a;
63880
- editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
63769
+ var _a, _b;
63770
+ editor && this.editingEditor !== editor && (null === (_b = (_a = editor).prepareEdit) || void 0 === _b || _b.call(_a, {
63881
63771
  referencePosition: referencePosition,
63882
63772
  container: this.table.getElement(),
63883
63773
  table: this.table,
@@ -63890,14 +63780,14 @@
63890
63780
  this.listenersId.push(doubleClickEventId, clickEventId, selectedChangedEventId);
63891
63781
  }
63892
63782
  startEditCell(col, row, value, editElement) {
63893
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
63783
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
63894
63784
  if (this.editingEditor) return;
63895
63785
  const editor = this.table.getEditor(col, row);
63896
63786
  if (editor) {
63897
- if (editElement && editor.setElement(editElement), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
63898
- if (null === (_b = null === (_a = this.table.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.isAggregation) || void 0 === _b ? void 0 : _b.call(_a, col, row)) {
63899
- const isPivotTable = null === (_d = (_c = this.table).isPivotTable) || void 0 === _d ? void 0 : _d.call(_c),
63900
- updateAggregationOnEditCell = !!isPivotTable && (null === (_f = null === (_e = this.table.internalProps) || void 0 === _e ? void 0 : _e.dataConfig) || void 0 === _f ? void 0 : _f.updateAggregationOnEditCell);
63787
+ if (editElement && (null === (_b = (_a = editor).setElement) || void 0 === _b || _b.call(_a, editElement)), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
63788
+ if (null === (_d = null === (_c = this.table.internalProps.layoutMap) || void 0 === _c ? void 0 : _c.isAggregation) || void 0 === _d ? void 0 : _d.call(_c, col, row)) {
63789
+ const isPivotTable = null === (_f = (_e = this.table).isPivotTable) || void 0 === _f ? void 0 : _f.call(_e),
63790
+ updateAggregationOnEditCell = !!isPivotTable && (null === (_h = null === (_g = this.table.internalProps) || void 0 === _g ? void 0 : _g.dataConfig) || void 0 === _h ? void 0 : _h.updateAggregationOnEditCell);
63901
63791
  if (!isPivotTable || isPivotTable && updateAggregationOnEditCell) return;
63902
63792
  }
63903
63793
  const record = this.table.getCellRawRecord(col, row);
@@ -63916,9 +63806,9 @@
63916
63806
  height: rect.height
63917
63807
  }
63918
63808
  };
63919
- col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (_g = editor.beginEditing) || void 0 === _g || _g.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_h = editor.bindSuccessCallback) || void 0 === _h || _h.call(editor, () => {
63809
+ col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (_j = editor.beginEditing) || void 0 === _j || _j.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_k = editor.bindSuccessCallback) || void 0 === _k || _k.call(editor, () => {
63920
63810
  this.completeEdit();
63921
- }), null === (_j = editor.onStart) || void 0 === _j || _j.call(editor, {
63811
+ }), null === (_l = editor.onStart) || void 0 === _l || _l.call(editor, {
63922
63812
  value: dataValue,
63923
63813
  endEdit: () => {
63924
63814
  this.completeEdit();
@@ -81871,7 +81761,9 @@
81871
81761
  } else (runtime === TABLE_EVENT_TYPE.UPDATE_RECORD || runtime === TABLE_EVENT_TYPE.ADD_RECORD || runtime === TABLE_EVENT_TYPE.DELETE_RECORD) && this.syncFilterWithTableData();
81872
81762
  }
81873
81763
  updatePluginOptions(pluginOptions) {
81874
- this.pluginOptions = lodashExports.merge(this.pluginOptions, pluginOptions), this.filterToolbar.updateStyles(this.pluginOptions.styles);
81764
+ this.pluginOptions = lodashExports.merge(this.pluginOptions, pluginOptions), this.filterToolbar.updateStyles(this.pluginOptions.styles), this.table.updateColumns(this.columns, {
81765
+ clearRowHeightCache: !1
81766
+ });
81875
81767
  }
81876
81768
  update() {
81877
81769
  this.filterStateManager && this.reapplyActiveFilters();
@@ -87831,6 +87723,54 @@
87831
87723
  if (rowIndexs && rowIndexs.length > 0) {
87832
87724
  const minIndex = Math.min(...rowIndexs.flat());
87833
87725
  this.vtableSheet.formulaManager.removeRows(sheetKey, minIndex, deletedCount);
87726
+ if (Array.isArray(this.tableInstance.options.customMergeCell)) {
87727
+ const mergeCellsToRemove = [];
87728
+ const deleteEndIndex = minIndex + deletedCount - 1;
87729
+ const customMergeCellArray = this.tableInstance.options.customMergeCell;
87730
+ const cloneMergeCellArray = customMergeCellArray.map(mergeCell => ({
87731
+ ...mergeCell,
87732
+ range: {
87733
+ start: { ...mergeCell.range.start },
87734
+ end: { ...mergeCell.range.end }
87735
+ }
87736
+ }));
87737
+ customMergeCellArray.forEach((mergeCell, index) => {
87738
+ const startRow = mergeCell.range.start.row;
87739
+ const endRow = mergeCell.range.end.row;
87740
+ if (startRow >= minIndex && endRow <= deleteEndIndex) {
87741
+ mergeCellsToRemove.push(index);
87742
+ return;
87743
+ }
87744
+ if (startRow <= deleteEndIndex && endRow >= minIndex) {
87745
+ if (startRow >= minIndex) {
87746
+ mergeCell.range.start.row = minIndex;
87747
+ }
87748
+ if (endRow <= deleteEndIndex) {
87749
+ mergeCell.range.end.row = minIndex - 1;
87750
+ }
87751
+ else {
87752
+ mergeCell.range.end.row -= deletedCount;
87753
+ }
87754
+ if (mergeCell.range.start.row > mergeCell.range.end.row) {
87755
+ mergeCellsToRemove.push(index);
87756
+ }
87757
+ }
87758
+ else if (startRow > deleteEndIndex) {
87759
+ mergeCell.range.start.row -= deletedCount;
87760
+ mergeCell.range.end.row -= deletedCount;
87761
+ }
87762
+ });
87763
+ mergeCellsToRemove
87764
+ .sort((a, b) => b - a)
87765
+ .forEach(index => {
87766
+ customMergeCellArray.splice(index, 1);
87767
+ });
87768
+ const updateRanges = cloneMergeCellArray.map(mergeCell => ({
87769
+ start: { ...mergeCell.range.start },
87770
+ end: { ...mergeCell.range.end }
87771
+ }));
87772
+ this.tableInstance.updateCellContentRange(updateRanges);
87773
+ }
87834
87774
  }
87835
87775
  }
87836
87776
  }
@@ -87858,6 +87798,54 @@
87858
87798
  const minIndex = Math.min(...deleteColIndexs.flat());
87859
87799
  const deletedCount = deleteColIndexs.length;
87860
87800
  this.vtableSheet.formulaManager.removeColumns(sheetKey, minIndex, deletedCount);
87801
+ if (Array.isArray(this.tableInstance.options.customMergeCell)) {
87802
+ const mergeCellsToRemove = [];
87803
+ const deleteEndIndex = minIndex + deletedCount - 1;
87804
+ const customMergeCellArray = this.tableInstance.options.customMergeCell;
87805
+ const cloneMergeCellArray = customMergeCellArray.map(mergeCell => ({
87806
+ ...mergeCell,
87807
+ range: {
87808
+ start: { ...mergeCell.range.start },
87809
+ end: { ...mergeCell.range.end }
87810
+ }
87811
+ }));
87812
+ customMergeCellArray.forEach((mergeCell, index) => {
87813
+ const startCol = mergeCell.range.start.col;
87814
+ const endCol = mergeCell.range.end.col;
87815
+ if (startCol >= minIndex && endCol <= deleteEndIndex) {
87816
+ mergeCellsToRemove.push(index);
87817
+ return;
87818
+ }
87819
+ if (startCol <= deleteEndIndex && endCol >= minIndex) {
87820
+ if (startCol >= minIndex) {
87821
+ mergeCell.range.start.col = minIndex;
87822
+ }
87823
+ if (endCol <= deleteEndIndex) {
87824
+ mergeCell.range.end.col = minIndex - 1;
87825
+ }
87826
+ else {
87827
+ mergeCell.range.end.col -= deletedCount;
87828
+ }
87829
+ if (mergeCell.range.start.col > mergeCell.range.end.col) {
87830
+ mergeCellsToRemove.push(index);
87831
+ }
87832
+ }
87833
+ else if (startCol > deleteEndIndex) {
87834
+ mergeCell.range.start.col -= deletedCount;
87835
+ mergeCell.range.end.col -= deletedCount;
87836
+ }
87837
+ });
87838
+ mergeCellsToRemove
87839
+ .sort((a, b) => b - a)
87840
+ .forEach(index => {
87841
+ customMergeCellArray.splice(index, 1);
87842
+ });
87843
+ const updateRanges = cloneMergeCellArray.map(mergeCell => ({
87844
+ start: { ...mergeCell.range.start },
87845
+ end: { ...mergeCell.range.end }
87846
+ }));
87847
+ this.tableInstance.updateCellContentRange(updateRanges);
87848
+ }
87861
87849
  }
87862
87850
  }
87863
87851
  }
@@ -91200,7 +91188,7 @@
91200
91188
  importStyle();
91201
91189
  }
91202
91190
 
91203
- const version = "1.22.11-alpha.8";
91191
+ const version = "1.22.11";
91204
91192
  importStyles();
91205
91193
 
91206
91194
  exports.TYPES = index;