@visactor/vtable-calendar 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.
@@ -34616,24 +34616,6 @@
34616
34616
  }, delay));
34617
34617
  };
34618
34618
  }
34619
- function cancellableThrottle(func, delay) {
34620
- let timer = null,
34621
- lastArgs = null,
34622
- context = null;
34623
- return {
34624
- throttled: function (...args) {
34625
- lastArgs = args, context = this, timer || (timer = setTimeout(() => {
34626
- lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
34627
- }, delay));
34628
- },
34629
- cancel: () => {
34630
- timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
34631
- },
34632
- flush: () => {
34633
- timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
34634
- }
34635
- };
34636
- }
34637
34619
  function pad(num, totalChars) {
34638
34620
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
34639
34621
  return num;
@@ -43759,35 +43741,11 @@
43759
43741
  return hoverMode;
43760
43742
  }
43761
43743
 
43762
- let brushingChartInstance,
43763
- brushingChartInstanceCellPos = {
43764
- col: -1,
43765
- row: -1
43766
- };
43767
- function setBrushingChartInstance(chartInstance, col, row) {
43768
- brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
43769
- col: col,
43770
- row: row
43771
- };
43772
- }
43773
- function clearBrushingChartInstance() {
43774
- brushingChartInstance = void 0, brushingChartInstanceCellPos = {
43775
- col: -1,
43776
- row: -1
43777
- };
43778
- }
43779
- function getBrushingChartInstance() {
43780
- return brushingChartInstance;
43781
- }
43782
- function getBrushingChartInstanceCellPos() {
43783
- return brushingChartInstanceCellPos;
43784
- }
43785
43744
  const chartInstanceListColumnByColumnDirection = {};
43786
43745
  const chartInstanceListRowByRowDirection = {};
43787
- const delayRunDimensionHoverTimer = [];
43788
43746
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
43789
43747
  var _a;
43790
- clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43748
+ isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43791
43749
  const {
43792
43750
  rowStart: rowStart
43793
43751
  } = table.getBodyVisibleRowRange();
@@ -43796,40 +43754,76 @@
43796
43754
  for (let i = rowStart; i <= rowEnd; i++) {
43797
43755
  const cellGroup = table.scenegraph.getCell(col, i),
43798
43756
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43799
- chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
43800
- const timer = setTimeout(() => {
43801
- var _a, _b, _c, _d;
43757
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
43758
+ var _a, _b, _c, _d, _e, _f;
43802
43759
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
43803
43760
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43804
43761
  let isShowTooltip = !isScatter;
43805
- 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 {
43806
- const cellBoundry = table.getCellRelativeRect(col, i),
43807
- bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
43762
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
43763
+ const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
43764
+ {
43765
+ rowEnd: rowEnd1
43766
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
43767
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
43768
+ const {
43769
+ rowEnd: rowEnd2
43770
+ } = table.getBodyVisibleRowRange(0, 5);
43771
+ isShowTooltip = rowEnd2 !== rowEnd;
43772
+ }
43773
+ } else if (i === rowStart && isShowTooltip) {
43774
+ const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
43775
+ {
43776
+ rowStart: rowStart1
43777
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
43778
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
43779
+ const {
43780
+ rowStart: rowStart2
43781
+ } = table.getBodyVisibleRowRange(0, -5);
43782
+ isShowTooltip = rowStart2 !== rowStart;
43783
+ }
43784
+ }
43785
+ 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 {
43786
+ const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
43808
43787
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
43809
43788
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43810
43789
  tooltip: !1,
43811
43790
  showTooltipOption: {
43812
- x: canvasXY.x - cellBoundry.left,
43813
- y: absolutePositionTop - cellBoundry.top,
43791
+ x: canvasXY.x,
43792
+ y: absolutePositionTop,
43814
43793
  activeType: "dimension"
43815
43794
  }
43816
43795
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43817
43796
  tooltip: isShowTooltip,
43818
43797
  showTooltipOption: {
43819
- x: canvasXY.x - cellBoundry.left,
43820
- y: absolutePositionTop - cellBoundry.top,
43798
+ x: canvasXY.x,
43799
+ y: absolutePositionTop,
43821
43800
  activeType: "dimension"
43822
43801
  }
43823
43802
  });
43824
43803
  }
43825
43804
  }
43826
- }, 0);
43827
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
43805
+ }, 0), table.scenegraph.updateNextFrame();
43806
+ }
43807
+ }
43808
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
43809
+ var _a;
43810
+ if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
43811
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
43812
+ if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
43813
+ const cellGroup = table.scenegraph.getCell(col, Number(i)),
43814
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43815
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
43816
+ releaseChartInstance: !0,
43817
+ releaseColumnChartInstance: !1,
43818
+ releaseRowChartInstance: !1
43819
+ }), chartInstanceListColumnByColumnDirection[col][i] = null);
43820
+ }
43821
+ delete chartInstanceListColumnByColumnDirection[col];
43828
43822
  }
43829
43823
  }
43830
43824
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
43831
43825
  var _a;
43832
- clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
43826
+ isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
43833
43827
  const {
43834
43828
  colStart: colStart
43835
43829
  } = table.getBodyVisibleColRange();
@@ -43838,162 +43832,64 @@
43838
43832
  for (let i = colStart; i <= colEnd; i++) {
43839
43833
  const cellGroup = table.scenegraph.getCell(i, row),
43840
43834
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43841
- chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
43842
- const timer = setTimeout(() => {
43835
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
43843
43836
  var _a, _b, _c, _d;
43844
43837
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
43845
43838
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43846
43839
  let isShowTooltip = !isScatter;
43847
- 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 {
43848
- const cellBoundry = table.getCellRelativeRect(i, row),
43849
- bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
43840
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
43841
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43842
+ {
43843
+ colEnd: colEnd1
43844
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
43845
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
43846
+ const {
43847
+ colEnd: colEnd2
43848
+ } = table.getBodyVisibleColRange(0, 5);
43849
+ isShowTooltip = colEnd2 !== colEnd;
43850
+ }
43851
+ } else if (i === colStart && isShowTooltip) {
43852
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43853
+ {
43854
+ colStart: colStart1
43855
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
43856
+ if (colStart1 === colStart) isShowTooltip = !0;else {
43857
+ const {
43858
+ colStart: colStart2
43859
+ } = table.getBodyVisibleColRange(0, -5);
43860
+ isShowTooltip = colStart2 !== colStart;
43861
+ }
43862
+ }
43863
+ 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 {
43864
+ const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
43850
43865
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
43851
43866
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43852
43867
  tooltip: !1,
43853
43868
  showTooltipOption: {
43854
- x: absolutePositionLeft - cellBoundry.left,
43855
- y: canvasXY.y - cellBoundry.top,
43869
+ x: absolutePositionLeft,
43870
+ y: canvasXY.y,
43856
43871
  activeType: "dimension"
43857
43872
  }
43858
43873
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43859
43874
  tooltip: isShowTooltip,
43860
43875
  showTooltipOption: {
43861
- x: absolutePositionLeft - cellBoundry.left,
43862
- y: canvasXY.y - cellBoundry.top,
43876
+ x: absolutePositionLeft,
43877
+ y: canvasXY.y,
43863
43878
  activeType: "dimension"
43864
43879
  }
43865
43880
  });
43866
43881
  }
43867
43882
  }
43868
- }, 0);
43869
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
43883
+ }, 0), table.scenegraph.updateNextFrame();
43870
43884
  }
43871
43885
  }
43872
- function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
43873
- var _a;
43874
- clearDelayRunDimensionHoverTimers();
43875
- const {
43876
- rowStart: rowStart
43877
- } = table.getBodyVisibleRowRange();
43878
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
43879
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
43880
- const {
43881
- colStart: colStart
43882
- } = table.getBodyVisibleColRange();
43883
- let colEnd = table.getBodyVisibleColRange().colEnd;
43884
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
43885
- for (let col = colStart; col <= colEnd; col++) {
43886
- isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43887
- for (let i = rowStart; i <= rowEnd; i++) {
43888
- const cellGroup = table.scenegraph.getCell(col, i),
43889
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43890
- chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
43891
- const timer = setTimeout(() => {
43892
- var _a, _b;
43893
- if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
43894
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
43895
- let isShowTooltip = !0;
43896
- "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, {
43897
- activeType: "mark"
43898
- })));
43899
- }
43900
- }, 0);
43901
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
43902
- }
43903
- }
43904
- }
43905
- function checkIsShowTooltipForEdgeRow(row, table) {
43906
- var _a, _b;
43907
- let isShowTooltip = !0;
43908
- const {
43909
- rowStart: rowStart
43910
- } = table.getBodyVisibleRowRange();
43911
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
43912
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
43913
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
43914
- if (row === rowEnd && isShowTooltip) {
43915
- const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
43916
- {
43917
- rowEnd: rowEnd1
43918
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
43919
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
43920
- const {
43921
- rowEnd: rowEnd2
43922
- } = table.getBodyVisibleRowRange(0, 5);
43923
- isShowTooltip = rowEnd2 !== rowEnd;
43924
- }
43925
- } else if (row === rowStart && isShowTooltip) {
43926
- const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
43927
- {
43928
- rowStart: rowStart1
43929
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
43930
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
43931
- const {
43932
- rowStart: rowStart2
43933
- } = table.getBodyVisibleRowRange(0, -5);
43934
- isShowTooltip = rowStart2 !== rowStart;
43935
- }
43936
- }
43937
- return isShowTooltip;
43938
- }
43939
- function checkIsShowTooltipForEdgeColumn(col, table) {
43940
- let isShowTooltip = !0;
43941
- const {
43942
- colStart: colStart
43943
- } = table.getBodyVisibleColRange();
43944
- let colEnd = table.getBodyVisibleColRange().colEnd;
43945
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
43946
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
43947
- if (col === colEnd && isShowTooltip) {
43948
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43949
- {
43950
- colEnd: colEnd1
43951
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
43952
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
43953
- const {
43954
- colEnd: colEnd2
43955
- } = table.getBodyVisibleColRange(0, 5);
43956
- isShowTooltip = colEnd2 !== colEnd;
43957
- }
43958
- } else if (col === colStart && isShowTooltip) {
43959
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43960
- {
43961
- colStart: colStart1
43962
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
43963
- if (colStart1 === colStart) isShowTooltip = !0;else {
43964
- const {
43965
- colStart: colStart2
43966
- } = table.getBodyVisibleColRange(0, -5);
43967
- isShowTooltip = colStart2 !== colStart;
43968
- }
43969
- }
43970
- return isShowTooltip;
43971
- }
43972
- function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
43973
- var _a;
43974
- if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
43975
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
43976
- if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
43977
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
43978
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43979
- isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
43980
- forceRelease: forceRelease,
43981
- releaseChartInstance: !0,
43982
- releaseColumnChartInstance: !1,
43983
- releaseRowChartInstance: !1
43984
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
43985
- }
43986
- delete chartInstanceListColumnByColumnDirection[col];
43987
- }
43988
- }
43989
- function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
43886
+ function clearChartInstanceListByRowDirection(row, excludedCol, table) {
43990
43887
  var _a;
43991
43888
  if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
43992
43889
  if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
43993
43890
  const cellGroup = table.scenegraph.getCell(Number(i), row),
43994
43891
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43995
- isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
43996
- forceRelease: forceRelease,
43892
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
43997
43893
  releaseChartInstance: !0,
43998
43894
  releaseColumnChartInstance: !1,
43999
43895
  releaseRowChartInstance: !1
@@ -44001,19 +43897,6 @@
44001
43897
  }
44002
43898
  delete chartInstanceListRowByRowDirection[row];
44003
43899
  }
44004
- function clearDelayRunDimensionHoverTimers() {
44005
- for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
44006
- delayRunDimensionHoverTimer.length = 0;
44007
- }
44008
- function clearAllChartInstanceList(table, forceRelease = !1) {
44009
- clearDelayRunDimensionHoverTimers();
44010
- for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
44011
- for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
44012
- }
44013
- let disabledShowTooltipToAllChartInstances = !1;
44014
- function isDisabledShowTooltipToAllChartInstances() {
44015
- return disabledShowTooltipToAllChartInstances;
44016
- }
44017
43900
 
44018
43901
  function isValidAlignDomain(domain) {
44019
43902
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -44647,7 +44530,7 @@
44647
44530
  const CHART_NUMBER_TYPE = genNumberType();
44648
44531
  class Chart extends Rect$1 {
44649
44532
  constructor(isShareChartSpec, params) {
44650
- 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 {
44533
+ 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 {
44651
44534
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
44652
44535
  renderCanvas: params.canvas,
44653
44536
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -44668,7 +44551,7 @@
44668
44551
  }
44669
44552
  }
44670
44553
  activate(table) {
44671
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
44554
+ var _a, _b, _c, _d, _e;
44672
44555
  if (this.activeChartInstance) return;
44673
44556
  const {
44674
44557
  col: col,
@@ -44687,7 +44570,7 @@
44687
44570
  y1: y1 - table.scrollTop,
44688
44571
  y2: y2 - table.scrollTop
44689
44572
  });
44690
- this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
44573
+ 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, {
44691
44574
  renderCanvas: this.attribute.canvas,
44692
44575
  mode: "desktop-browser",
44693
44576
  canvasControled: !1,
@@ -44721,7 +44604,7 @@
44721
44604
  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());
44722
44605
  }
44723
44606
  },
44724
- componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
44607
+ componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
44725
44608
  tooltip: {
44726
44609
  dimension: !1,
44727
44610
  mark: !0
@@ -44732,43 +44615,16 @@
44732
44615
  const chartStage = this.activeChartInstance.getStage(),
44733
44616
  matrix = this.globalTransMatrix.clone(),
44734
44617
  stageMatrix = this.stage.window.getViewBoxTransform();
44735
- let brushChangeThrottle;
44736
44618
  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 => {
44737
44619
  var _a;
44738
- !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");
44739
- }), (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 => {
44740
- var _a;
44741
- brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
44742
- })), this.activeChartInstance.on("brushStart", params => {
44743
- const brushingChartInstance = getBrushingChartInstance();
44744
- brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
44620
+ !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);
44745
44621
  }), this.activeChartInstance.on("brushEnd", params => {
44746
44622
  var _a;
44747
- 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(() => {
44623
+ table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
44748
44624
  Chart.temp = 1;
44749
44625
  }, 0);
44750
- }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
44751
- markName: "pie"
44752
- }, params => {
44753
- var _a;
44754
- const categoryField = this.attribute.spec.categoryField,
44755
- datum = {
44756
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44757
- };
44758
- generateChartInstanceListByViewRange(datum, table, !1);
44759
- }), this.activeChartInstance.on("pointerout", {
44760
- markName: "pie"
44761
- }, params => {
44762
- var _a;
44763
- const categoryField = this.attribute.spec.categoryField,
44764
- datum = {
44765
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44766
- };
44767
- generateChartInstanceListByViewRange(datum, table, !0);
44768
- })), this.activeChartInstance.on("dimensionHover", params => {
44626
+ }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
44769
44627
  var _a, _b;
44770
- if (isDisabledShowTooltipToAllChartInstances()) return;
44771
- this.activeChartInstance.disableTooltip(!1);
44772
44628
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
44773
44629
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
44774
44630
  viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
@@ -44785,11 +44641,11 @@
44785
44641
  prev_justShowMarkTooltip = this.justShowMarkTooltip;
44786
44642
  params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
44787
44643
  let delayRunDimensionHover = !1;
44788
- 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) {
44644
+ 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) {
44789
44645
  const dimensionValue = dimensionInfo.value,
44790
44646
  indicatorsAsCol = table.options.indicatorsAsCol;
44791
- if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
44792
- isDisabledShowTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
44647
+ if (delayRunDimensionHover ? (clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = setTimeout(() => {
44648
+ indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
44793
44649
  }, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
44794
44650
  const series = dimensionInfo.data[0].series,
44795
44651
  width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
@@ -44830,26 +44686,21 @@
44830
44686
  }
44831
44687
  }
44832
44688
  }
44833
- })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledShowTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
44834
- }
44835
- clearDelayRunDimensionHoverTimer() {
44836
- clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
44689
+ }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
44837
44690
  }
44838
44691
  deactivate(table, {
44839
- forceRelease = !1,
44840
44692
  releaseChartInstance = !0,
44841
44693
  releaseColumnChartInstance = !0,
44842
- releaseRowChartInstance = !0,
44843
- releaseAllChartInstance = !1
44694
+ releaseRowChartInstance = !0
44844
44695
  } = {}) {
44845
44696
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
44846
- if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
44847
- !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44697
+ if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
44698
+ null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44848
44699
  x1: -1e3,
44849
44700
  x2: -800,
44850
44701
  y1: -1e3,
44851
44702
  y2: -800
44852
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
44703
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
44853
44704
  const {
44854
44705
  col: col,
44855
44706
  row: row
@@ -44862,7 +44713,7 @@
44862
44713
  } = this.parent;
44863
44714
  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));
44864
44715
  }
44865
- 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));
44716
+ 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);
44866
44717
  }
44867
44718
  updateData(data) {
44868
44719
  this.attribute.data = data;
@@ -44877,14 +44728,13 @@
44877
44728
  y1: y1,
44878
44729
  x2: x2,
44879
44730
  y2: y2
44880
- } = cellGroup.globalAABBBounds,
44881
- viewBox = {
44882
- 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)),
44883
- 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)),
44884
- 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)),
44885
- 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))
44886
- };
44887
- return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
44731
+ } = cellGroup.globalAABBBounds;
44732
+ return {
44733
+ 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)),
44734
+ 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)),
44735
+ 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)),
44736
+ 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))
44737
+ };
44888
44738
  }
44889
44739
  }
44890
44740
  function getTableBounds(col, row, table) {
@@ -45099,7 +44949,7 @@
45099
44949
  {
45100
44950
  width = groupAttribute.width,
45101
44951
  height = groupAttribute.height
45102
- } = chart.attribute,
44952
+ } = (chart.getViewBox(), chart.attribute),
45103
44953
  {
45104
44954
  table: table
45105
44955
  } = chart.getRootNode(),
@@ -45127,9 +44977,8 @@
45127
44977
  });
45128
44978
  }
45129
44979
  }
45130
- const lastViewBox = chart.activeChartInstanceLastViewBox,
45131
- viewBox = chart.getViewBox();
45132
- lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
44980
+ const viewBox = chart.getViewBox();
44981
+ activeChartInstance.updateViewBox({
45133
44982
  x1: 0,
45134
44983
  x2: viewBox.x2 - viewBox.x1,
45135
44984
  y1: 0,
@@ -47926,7 +47775,7 @@
47926
47775
  rowUpdatePos = isValid$1(rowUpdatePos) ? isValid$1(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
47927
47776
  }
47928
47777
  let updateAfter;
47929
- if (scene.table._clearRowRangeHeightsMap(), addRows.forEach(row => {
47778
+ if (scene.table._clearRowRangeHeightsMap(), verifyProxyRowStatus(scene), addRows.forEach(row => {
47930
47779
  const needUpdateAfter = addRow(row, scene, skipUpdateProxy);
47931
47780
  updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.insert(row);
47932
47781
  }), resetRowNumberAndY(scene), addRows.length) {
@@ -48156,6 +48005,25 @@
48156
48005
  function setRowSeriesNumberCellNeedUpdate(startUpdateRow, scene) {
48157
48006
  if (scene.table.isHasSeriesNumber()) for (let row = startUpdateRow; row <= scene.table.rowCount - 1; row++) updateCell$1(0, row, scene.table, !1);
48158
48007
  }
48008
+ function verifyProxyRowStatus(scene) {
48009
+ const proxy = scene.proxy,
48010
+ {
48011
+ rowStart: rowStart,
48012
+ rowEnd: rowEnd,
48013
+ rowLimit: rowLimit,
48014
+ totalRow: totalRow
48015
+ } = proxy;
48016
+ if (rowStart > rowEnd) return proxy.rowStart = scene.table.columnHeaderLevelCount, proxy.rowEnd = Math.min(totalRow, proxy.rowStart + rowLimit - 1), void (proxy.currentRow = 0);
48017
+ if (rowStart + rowLimit - 1 > totalRow) {
48018
+ const oldRowStart = proxy.rowStart,
48019
+ newRowStart = Math.max(scene.table.columnHeaderLevelCount, totalRow - rowLimit + 1);
48020
+ if (newRowStart === oldRowStart) return;
48021
+ proxy.rowStart = newRowStart, proxy.rowEnd = Math.min(totalRow, newRowStart + rowLimit - 1), proxy.currentRow = proxy.rowEnd + 1;
48022
+ const addRowCount = oldRowStart - proxy.rowStart;
48023
+ for (let i = 0; i < addRowCount; i++) addRowCellGroup(proxy.rowStart + i, scene);
48024
+ proxy.rowUpdatePos = proxy.rowStart;
48025
+ }
48026
+ }
48159
48027
 
48160
48028
  function createReactContainer(table) {
48161
48029
  const {
@@ -48647,10 +48515,9 @@
48647
48515
  });
48648
48516
  }
48649
48517
  }
48650
- function updateChartState(scenegraph, datum, selectedDataMode) {
48518
+ function updateChartState(scenegraph, datum) {
48651
48519
  const table = scenegraph.table;
48652
48520
  if (table.isPivotChart()) {
48653
- table._selectedDataMode = selectedDataMode;
48654
48521
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
48655
48522
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
48656
48523
  const newSelectedDataItemsInChart = [];
@@ -49398,39 +49265,16 @@
49398
49265
  resetResidentHoverIcon(col, row) {
49399
49266
  resetResidentHoverIcon(col, row, this);
49400
49267
  }
49401
- deactivateChart(col, row, forceRelease = !1) {
49402
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
49403
- if (-1 === col || -1 === row) {
49404
- if (forceRelease) {
49405
- const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
49406
- brushingChartInstance = getBrushingChartInstance();
49407
- if (brushingChartInstanceCellPos && brushingChartInstance) {
49408
- const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
49409
- (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, {
49410
- forceRelease: !0,
49411
- releaseChartInstance: !0,
49412
- releaseColumnChartInstance: !0,
49413
- releaseRowChartInstance: !0,
49414
- releaseAllChartInstance: !0
49415
- }));
49416
- }
49417
- }
49418
- return;
49419
- }
49268
+ deactivateChart(col, row) {
49269
+ var _a, _b, _c;
49270
+ if (-1 === col || -1 === row) return;
49420
49271
  const cellGroup = this.getCell(col, row);
49421
- if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
49422
- 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, {
49423
- forceRelease: !0,
49424
- releaseChartInstance: !0,
49425
- releaseColumnChartInstance: !0,
49426
- releaseRowChartInstance: !0,
49427
- releaseAllChartInstance: !0
49428
- }));
49272
+ if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
49429
49273
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
49430
- 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) ? {
49431
- 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),
49432
- 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),
49433
- 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)
49274
+ 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 ? {
49275
+ 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,
49276
+ 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,
49277
+ 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
49434
49278
  } : void 0);
49435
49279
  }
49436
49280
  }
@@ -49478,15 +49322,8 @@
49478
49322
  updateChartSizeForResizeRowHeight(row) {
49479
49323
  updateChartSizeForResizeRowHeight(this, row);
49480
49324
  }
49481
- updateChartState(datum, selectedDataMode) {
49482
- var _a, _b;
49483
- if (this.table.isPivotChart()) {
49484
- if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
49485
- const brushingChartInstance = getBrushingChartInstance();
49486
- 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);
49487
- }
49488
- updateChartState(this, datum, selectedDataMode);
49489
- }
49325
+ updateChartState(datum) {
49326
+ this.table.isPivotChart() && updateChartState(this, datum);
49490
49327
  }
49491
49328
  updateCheckboxCellState(col, row, checked) {
49492
49329
  var _a, _b;
@@ -50142,7 +49979,7 @@
50142
49979
  } else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
50143
49980
  if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
50144
49981
  if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
50145
- let extendSelectRange = !0;
49982
+ let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
50146
49983
  -1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
50147
49984
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
50148
49985
  if (currentRange) {
@@ -50264,7 +50101,7 @@
50264
50101
  };
50265
50102
  enableShiftSelectMode || (currentRange.end = currentRange.start), scenegraph.deleteLastSelectedRangeComponents(), scenegraph.updateCellSelectBorder(currentRange);
50266
50103
  } else {
50267
- let extendSelectRange = !0;
50104
+ let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
50268
50105
  if (-1 === cellPos.col || -1 === cellPos.row || enableCtrlSelectMode || (state.select.ranges = [], scenegraph.deleteAllSelectBorder()), "cell" !== state.select.headerSelectMode && table.isColumnHeader(col, row)) {
50269
50106
  const cellRange = table.getCellRange(col, row);
50270
50107
  "body" === state.select.headerSelectMode ? state.select.ranges.push({
@@ -52513,7 +52350,7 @@
52513
52350
  }, 0 !== e.button) return;
52514
52351
  const eventArgsSet = getCellEventArgsSet(e);
52515
52352
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
52516
- 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;
52353
+ 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;
52517
52354
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
52518
52355
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
52519
52356
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -52541,7 +52378,7 @@
52541
52378
  }
52542
52379
  eventManager.dealTableHover(eventArgsSet);
52543
52380
  } else {
52544
- 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);
52381
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
52545
52382
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52546
52383
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52547
52384
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -52693,7 +52530,7 @@
52693
52530
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
52694
52531
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
52695
52532
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
52696
- table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
52533
+ table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
52697
52534
  const {
52698
52535
  eventArgs: eventArgs
52699
52536
  } = eventArgsSet;
@@ -52712,7 +52549,7 @@
52712
52549
  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 {
52713
52550
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
52714
52551
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
52715
- (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);
52552
+ (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);
52716
52553
  }
52717
52554
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
52718
52555
  var _a, _b, _c;
@@ -52830,15 +52667,7 @@
52830
52667
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
52831
52668
  }), table.scenegraph.stage.addEventListener("wheel", e => {
52832
52669
  var _a;
52833
- if (!e.path.find(node => "legend" === node.name)) {
52834
- null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
52835
- const {
52836
- cellPos: cellPos
52837
- } = table.stateManager.hover,
52838
- prevHoverCellCol = cellPos.col,
52839
- prevHoverCellRow = cellPos.row;
52840
- table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
52841
- }
52670
+ e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
52842
52671
  });
52843
52672
  }
52844
52673
  function bindGesture(eventManager) {
@@ -52953,13 +52782,11 @@
52953
52782
  const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
52954
52783
  throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
52955
52784
  scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
52956
- var _a;
52957
- 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);
52785
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
52958
52786
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
52959
52787
  throttleVerticalWheel(ratio, e);
52960
52788
  }), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
52961
- var _a;
52962
- 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);
52789
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
52963
52790
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
52964
52791
  throttleHorizontalWheel(ratio);
52965
52792
  });
@@ -53109,7 +52936,7 @@
53109
52936
  const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
53110
52937
  eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
53111
52938
  }
53112
- }), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
52939
+ });
53113
52940
  }
53114
52941
  };
53115
52942
  eventManager.globalEventListeners.push({
@@ -55945,13 +55772,41 @@
55945
55772
 
55946
55773
  class CustomCellStylePlugin {
55947
55774
  constructor(table, customCellStyle, customCellStyleArrangement) {
55948
- this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
55775
+ this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement, this._customCellStyleArrangementIndex = new Map(), this._customCellStyleArrangementTombstoneCount = 0, this._rebuildCustomCellStyleArrangementIndex();
55776
+ }
55777
+ _getCustomCellStyleArrangementKey(cellPos) {
55778
+ if (cellPos.range) {
55779
+ const {
55780
+ start: start,
55781
+ end: end
55782
+ } = cellPos.range;
55783
+ return `range:${start.col},${start.row},${end.col},${end.row}`;
55784
+ }
55785
+ if (void 0 !== cellPos.col && void 0 !== cellPos.row) return `cell:${cellPos.col},${cellPos.row}`;
55786
+ }
55787
+ _rebuildCustomCellStyleArrangementIndex() {
55788
+ this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0;
55789
+ for (let i = 0; i < this.customCellStyleArrangement.length; i++) {
55790
+ if (!isValid$1(this.customCellStyleArrangement[i].customStyleId)) {
55791
+ this._customCellStyleArrangementTombstoneCount++;
55792
+ continue;
55793
+ }
55794
+ const key = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[i].cellPosition);
55795
+ key && this._customCellStyleArrangementIndex.set(key, i);
55796
+ }
55797
+ }
55798
+ _compactCustomCellStyleArrangementIfNeeded() {
55799
+ const length = this.customCellStyleArrangement.length;
55800
+ if (this._customCellStyleArrangementTombstoneCount < 2048) return;
55801
+ if (4 * this._customCellStyleArrangementTombstoneCount < length) return;
55802
+ const compacted = this.customCellStyleArrangement.filter(style => isValid$1(style.customStyleId));
55803
+ compacted.length !== this.customCellStyleArrangement.length ? (this.customCellStyleArrangement.length = 0, this.customCellStyleArrangement.push(...compacted), this._rebuildCustomCellStyleArrangementIndex()) : this._customCellStyleArrangementTombstoneCount = 0;
55949
55804
  }
55950
55805
  getCustomCellStyle(col, row) {
55951
55806
  const customStyleIds = this.getCustomCellStyleIds(col, row);
55952
55807
  if (customStyleIds.length) {
55953
55808
  const styles = [];
55954
- return customStyleIds.forEach(customStyleId => {
55809
+ if (customStyleIds.forEach(customStyleId => {
55955
55810
  const styleOption = this.getCustomCellStyleOption(customStyleId);
55956
55811
  if (isFunction$3(null == styleOption ? void 0 : styleOption.style)) {
55957
55812
  const style = styleOption.style({
@@ -55964,14 +55819,15 @@
55964
55819
  });
55965
55820
  styles.push(style);
55966
55821
  } else (null == styleOption ? void 0 : styleOption.style) && styles.push(styleOption.style);
55967
- }), merge({}, ...styles);
55822
+ }), !styles.length) return;
55823
+ return merge({}, ...styles);
55968
55824
  }
55969
55825
  }
55970
55826
  getCustomCellStyleIds(col, row) {
55971
55827
  const customStyleIds = [],
55972
55828
  range = this.table.getCellRange(col, row);
55973
55829
  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 => {
55974
- 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);
55830
+ isValid$1(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));
55975
55831
  });
55976
55832
  return customStyleIds;
55977
55833
  }
@@ -55992,21 +55848,35 @@
55992
55848
  }), this.table.scenegraph.updateNextFrame();
55993
55849
  }
55994
55850
  arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
55995
- var _a;
55996
- 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);
55997
- if (-1 === index && !customStyleId) return;
55998
- if (-1 === index && customStyleId) this.customCellStyleArrangement.push({
55999
- cellPosition: {
56000
- col: cellPos.col,
56001
- row: cellPos.row,
56002
- range: cellPos.range
56003
- },
56004
- customStyleId: customStyleId
56005
- });else {
55851
+ var _a, _b;
55852
+ const inputKey = this._getCustomCellStyleArrangementKey(cellPos);
55853
+ let index = inputKey && null !== (_a = this._customCellStyleArrangementIndex.get(inputKey)) && void 0 !== _a ? _a : -1;
55854
+ if (inputKey && -1 !== index) {
55855
+ const item = this.customCellStyleArrangement[index],
55856
+ itemKey = item ? this._getCustomCellStyleArrangementKey(item.cellPosition) : void 0;
55857
+ item && isValid$1(item.customStyleId) && itemKey === inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$1(style.customStyleId) && this._getCustomCellStyleArrangementKey(style.cellPosition) === inputKey), -1 !== index ? this._customCellStyleArrangementIndex.set(inputKey, index) : this._customCellStyleArrangementIndex.delete(inputKey));
55858
+ }
55859
+ if (-1 !== index || inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$1(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;
55860
+ if (-1 === index && customStyleId) {
55861
+ this.customCellStyleArrangement.push({
55862
+ cellPosition: {
55863
+ col: cellPos.col,
55864
+ row: cellPos.row,
55865
+ range: cellPos.range
55866
+ },
55867
+ customStyleId: customStyleId
55868
+ });
55869
+ const pushedIndex = this.customCellStyleArrangement.length - 1,
55870
+ pushedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[pushedIndex].cellPosition);
55871
+ pushedKey && this._customCellStyleArrangementIndex.set(pushedKey, pushedIndex);
55872
+ } else {
56006
55873
  if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
56007
- customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
55874
+ if (customStyleId) this.customCellStyleArrangement[index].customStyleId = customStyleId;else {
55875
+ const existedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[index].cellPosition);
55876
+ isValid$1(this.customCellStyleArrangement[index].customStyleId) && this._customCellStyleArrangementTombstoneCount++, this.customCellStyleArrangement[index].customStyleId = null, existedKey && this._customCellStyleArrangementIndex.delete(existedKey), this._compactCustomCellStyleArrangementIfNeeded();
55877
+ }
56008
55878
  }
56009
- const style = null === (_a = this.getCustomCellStyleOption(customStyleId)) || void 0 === _a ? void 0 : _a.style;
55879
+ const style = customStyleId ? null === (_b = this.getCustomCellStyleOption(customStyleId)) || void 0 === _b ? void 0 : _b.style : void 0;
56010
55880
  if (style) {
56011
55881
  forceFastUpdate = !0;
56012
55882
  for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
@@ -56021,7 +55891,7 @@
56021
55891
  this.table.scenegraph.updateNextFrame();
56022
55892
  }
56023
55893
  updateCustomCell(customCellStyle, customCellStyleArrangement) {
56024
- this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, customCellStyle.forEach(cellStyle => {
55894
+ this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0, customCellStyle.forEach(cellStyle => {
56025
55895
  this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
56026
55896
  }), customCellStyleArrangement.forEach(cellStyle => {
56027
55897
  this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
@@ -56252,7 +56122,7 @@
56252
56122
  }
56253
56123
  constructor(container, options = {}) {
56254
56124
  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;
56255
- 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.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");
56125
+ 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.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");
56256
56126
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
56257
56127
  options: options,
56258
56128
  container: container
@@ -57466,16 +57336,16 @@
57466
57336
  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,
57467
57337
  endCol = colIndex,
57468
57338
  endRow = this.rowCount - 1;
57469
- 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);
57339
+ 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;
57470
57340
  }
57471
57341
  dragSelectCol(colIndex, enableCtrlSelectMode) {
57472
57342
  var _a, _b;
57473
57343
  const currentSelectRanges = this.stateManager.select.ranges,
57474
57344
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
57475
- 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);
57345
+ 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;
57476
57346
  }
57477
57347
  endDragSelect() {
57478
- this.stateManager.updateInteractionState(InteractionState.default), this.stateManager.endSelectCells(!1, !1);
57348
+ this.stateManager.updateInteractionState(InteractionState.default);
57479
57349
  }
57480
57350
  startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
57481
57351
  var _a, _b, _c, _d, _e, _f;
@@ -57483,13 +57353,13 @@
57483
57353
  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,
57484
57354
  endCol = this.colCount - 1,
57485
57355
  endRow = rowIndex;
57486
- 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);
57356
+ 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;
57487
57357
  }
57488
57358
  dragSelectRow(rowIndex, isCtrl) {
57489
57359
  var _a, _b;
57490
57360
  const currentSelectRanges = this.stateManager.select.ranges,
57491
57361
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
57492
- 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);
57362
+ 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;
57493
57363
  }
57494
57364
  get recordsCount() {
57495
57365
  var _a;
@@ -58411,6 +58281,18 @@
58411
58281
  }
58412
58282
  return !1;
58413
58283
  }
58284
+ updateCellContent(col, row) {
58285
+ this.scenegraph.updateCellContent(col, row);
58286
+ }
58287
+ updateCellContentRange(startCol, startRow, endCol, endRow) {
58288
+ for (let i = startCol; i <= endCol; i++) for (let j = startRow; j <= endRow; j++) this.scenegraph.updateCellContent(i, j);
58289
+ }
58290
+ updateCellContentRanges(ranges) {
58291
+ for (let i = 0; i < ranges.length; i++) {
58292
+ const range = ranges[i];
58293
+ this.updateCellContentRange(range.start.col, range.start.row, range.end.col, range.end.row);
58294
+ }
58295
+ }
58414
58296
  }
58415
58297
 
58416
58298
  const chartTypes = {};
@@ -59877,8 +59759,8 @@
59877
59759
  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;
59878
59760
  const editor = this.table.getEditor(col, row);
59879
59761
  editor && setTimeout(() => {
59880
- var _a;
59881
- editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
59762
+ var _a, _b;
59763
+ editor && this.editingEditor !== editor && (null === (_b = (_a = editor).prepareEdit) || void 0 === _b || _b.call(_a, {
59882
59764
  referencePosition: referencePosition,
59883
59765
  container: this.table.getElement(),
59884
59766
  table: this.table,
@@ -59891,14 +59773,14 @@
59891
59773
  this.listenersId.push(doubleClickEventId, clickEventId, selectedChangedEventId);
59892
59774
  }
59893
59775
  startEditCell(col, row, value, editElement) {
59894
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
59776
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
59895
59777
  if (this.editingEditor) return;
59896
59778
  const editor = this.table.getEditor(col, row);
59897
59779
  if (editor) {
59898
- if (editElement && editor.setElement(editElement), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
59899
- 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)) {
59900
- const isPivotTable = null === (_d = (_c = this.table).isPivotTable) || void 0 === _d ? void 0 : _d.call(_c),
59901
- updateAggregationOnEditCell = !!isPivotTable && (null === (_f = null === (_e = this.table.internalProps) || void 0 === _e ? void 0 : _e.dataConfig) || void 0 === _f ? void 0 : _f.updateAggregationOnEditCell);
59780
+ if (editElement && (null === (_b = (_a = editor).setElement) || void 0 === _b || _b.call(_a, editElement)), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
59781
+ 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)) {
59782
+ const isPivotTable = null === (_f = (_e = this.table).isPivotTable) || void 0 === _f ? void 0 : _f.call(_e),
59783
+ updateAggregationOnEditCell = !!isPivotTable && (null === (_h = null === (_g = this.table.internalProps) || void 0 === _g ? void 0 : _g.dataConfig) || void 0 === _h ? void 0 : _h.updateAggregationOnEditCell);
59902
59784
  if (!isPivotTable || isPivotTable && updateAggregationOnEditCell) return;
59903
59785
  }
59904
59786
  const record = this.table.getCellRawRecord(col, row);
@@ -59917,9 +59799,9 @@
59917
59799
  height: rect.height
59918
59800
  }
59919
59801
  };
59920
- 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, () => {
59802
+ 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, () => {
59921
59803
  this.completeEdit();
59922
- }), null === (_j = editor.onStart) || void 0 === _j || _j.call(editor, {
59804
+ }), null === (_l = editor.onStart) || void 0 === _l || _l.call(editor, {
59923
59805
  value: dataValue,
59924
59806
  endEdit: () => {
59925
59807
  this.completeEdit();