@visactor/vtable-calendar 1.22.11-alpha.1 → 1.22.11-alpha.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,6 +34616,24 @@
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
+ }
34619
34637
  function pad(num, totalChars) {
34620
34638
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
34621
34639
  return num;
@@ -34879,7 +34897,6 @@
34879
34897
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
34880
34898
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
34881
34899
  CHANGE_CELL_VALUE: "change_cell_value",
34882
- CHANGE_CELL_VALUES: "change_cell_values",
34883
34900
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
34884
34901
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
34885
34902
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -35900,6 +35917,9 @@
35900
35917
  var _a;
35901
35918
  return null !== (_a = defaultStyle.textAlign) && void 0 !== _a ? _a : "left";
35902
35919
  },
35920
+ get textStickBaseOnAlign() {
35921
+ return defaultStyle.textStickBaseOnAlign;
35922
+ },
35903
35923
  get textBaseline() {
35904
35924
  var _a;
35905
35925
  return null !== (_a = defaultStyle.textBaseline) && void 0 !== _a ? _a : "middle";
@@ -36583,6 +36603,9 @@
36583
36603
  get textStick() {
36584
36604
  return style.textStick;
36585
36605
  },
36606
+ get textStickBaseOnAlign() {
36607
+ return style.textStickBaseOnAlign;
36608
+ },
36586
36609
  get marked() {
36587
36610
  return style.marked;
36588
36611
  },
@@ -43736,11 +43759,46 @@
43736
43759
  return hoverMode;
43737
43760
  }
43738
43761
 
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 clearAndReleaseBrushingChartInstance(scenegraph) {
43774
+ var _a, _b, _c;
43775
+ enableTooltipToAllChartInstances();
43776
+ const cellGroup = scenegraph.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
43777
+ (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, scenegraph.table, {
43778
+ forceRelease: !0,
43779
+ releaseChartInstance: !0,
43780
+ releaseColumnChartInstance: !1,
43781
+ releaseRowChartInstance: !1,
43782
+ releaseAllChartInstance: !1
43783
+ })), isValid$1(chartInstanceListColumnByColumnDirection[brushingChartInstanceCellPos.col]) && delete chartInstanceListColumnByColumnDirection[brushingChartInstanceCellPos.col][brushingChartInstanceCellPos.row], isValid$1(chartInstanceListRowByRowDirection[brushingChartInstanceCellPos.row]) && delete chartInstanceListRowByRowDirection[brushingChartInstanceCellPos.row][brushingChartInstanceCellPos.col], brushingChartInstance = void 0, brushingChartInstanceCellPos = {
43784
+ col: -1,
43785
+ row: -1
43786
+ };
43787
+ }
43788
+ function getBrushingChartInstance() {
43789
+ return brushingChartInstance;
43790
+ }
43791
+ function getBrushingChartInstanceCellPos() {
43792
+ return brushingChartInstanceCellPos;
43793
+ }
43739
43794
  const chartInstanceListColumnByColumnDirection = {};
43740
43795
  const chartInstanceListRowByRowDirection = {};
43796
+ const delayRunDimensionHoverTimerForColumnDirection = [],
43797
+ delayRunDimensionHoverTimerForRowDirection = [],
43798
+ delayRunDimensionHoverTimerForViewRange = [];
43741
43799
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
43742
43800
  var _a;
43743
- isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43801
+ clearDelayRunDimensionHoverTimerForColumnDirection(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43744
43802
  const {
43745
43803
  rowStart: rowStart
43746
43804
  } = table.getBodyVisibleRowRange();
@@ -43749,76 +43807,40 @@
43749
43807
  for (let i = rowStart; i <= rowEnd; i++) {
43750
43808
  const cellGroup = table.scenegraph.getCell(col, i),
43751
43809
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43752
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
43753
- var _a, _b, _c, _d, _e, _f;
43810
+ chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
43811
+ const timer = setTimeout(() => {
43812
+ var _a, _b, _c, _d;
43754
43813
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
43755
43814
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43756
43815
  let isShowTooltip = !isScatter;
43757
- if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
43758
- const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
43759
- {
43760
- rowEnd: rowEnd1
43761
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
43762
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
43763
- const {
43764
- rowEnd: rowEnd2
43765
- } = table.getBodyVisibleRowRange(0, 5);
43766
- isShowTooltip = rowEnd2 !== rowEnd;
43767
- }
43768
- } else if (i === rowStart && isShowTooltip) {
43769
- const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
43770
- {
43771
- rowStart: rowStart1
43772
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
43773
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
43774
- const {
43775
- rowStart: rowStart2
43776
- } = table.getBodyVisibleRowRange(0, -5);
43777
- isShowTooltip = rowStart2 !== rowStart;
43778
- }
43779
- }
43780
- 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 {
43781
- const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
43816
+ 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 {
43817
+ const cellBoundry = table.getCellRelativeRect(col, i),
43818
+ bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
43782
43819
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
43783
43820
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43784
43821
  tooltip: !1,
43785
43822
  showTooltipOption: {
43786
- x: canvasXY.x,
43787
- y: absolutePositionTop,
43823
+ x: canvasXY.x - cellBoundry.left,
43824
+ y: absolutePositionTop - cellBoundry.top,
43788
43825
  activeType: "dimension"
43789
43826
  }
43790
43827
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43791
43828
  tooltip: isShowTooltip,
43792
43829
  showTooltipOption: {
43793
- x: canvasXY.x,
43794
- y: absolutePositionTop,
43830
+ x: canvasXY.x - cellBoundry.left,
43831
+ y: absolutePositionTop - cellBoundry.top,
43795
43832
  activeType: "dimension"
43796
43833
  }
43797
43834
  });
43798
43835
  }
43799
43836
  }
43800
- }, 0), table.scenegraph.updateNextFrame();
43801
- }
43802
- }
43803
- function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
43804
- var _a;
43805
- if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
43806
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
43807
- if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
43808
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
43809
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43810
- chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
43811
- releaseChartInstance: !0,
43812
- releaseColumnChartInstance: !1,
43813
- releaseRowChartInstance: !1
43814
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
43815
- }
43816
- delete chartInstanceListColumnByColumnDirection[col];
43837
+ }, 0);
43838
+ delayRunDimensionHoverTimerForColumnDirection.push(timer), table.scenegraph.updateNextFrame();
43817
43839
  }
43818
43840
  }
43819
43841
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
43820
43842
  var _a;
43821
- isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
43843
+ clearDelayRunDimensionHoverTimerForRowDirection(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
43822
43844
  const {
43823
43845
  colStart: colStart
43824
43846
  } = table.getBodyVisibleColRange();
@@ -43827,64 +43849,162 @@
43827
43849
  for (let i = colStart; i <= colEnd; i++) {
43828
43850
  const cellGroup = table.scenegraph.getCell(i, row),
43829
43851
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43830
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
43852
+ chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
43853
+ const timer = setTimeout(() => {
43831
43854
  var _a, _b, _c, _d;
43832
43855
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
43833
43856
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43834
43857
  let isShowTooltip = !isScatter;
43835
- if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
43836
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43837
- {
43838
- colEnd: colEnd1
43839
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
43840
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
43841
- const {
43842
- colEnd: colEnd2
43843
- } = table.getBodyVisibleColRange(0, 5);
43844
- isShowTooltip = colEnd2 !== colEnd;
43845
- }
43846
- } else if (i === colStart && isShowTooltip) {
43847
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43848
- {
43849
- colStart: colStart1
43850
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
43851
- if (colStart1 === colStart) isShowTooltip = !0;else {
43852
- const {
43853
- colStart: colStart2
43854
- } = table.getBodyVisibleColRange(0, -5);
43855
- isShowTooltip = colStart2 !== colStart;
43856
- }
43857
- }
43858
- 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 {
43859
- const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
43858
+ 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 {
43859
+ const cellBoundry = table.getCellRelativeRect(i, row),
43860
+ bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
43860
43861
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
43861
43862
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43862
43863
  tooltip: !1,
43863
43864
  showTooltipOption: {
43864
- x: absolutePositionLeft,
43865
- y: canvasXY.y,
43865
+ x: absolutePositionLeft - cellBoundry.left,
43866
+ y: canvasXY.y - cellBoundry.top,
43866
43867
  activeType: "dimension"
43867
43868
  }
43868
43869
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43869
43870
  tooltip: isShowTooltip,
43870
43871
  showTooltipOption: {
43871
- x: absolutePositionLeft,
43872
- y: canvasXY.y,
43872
+ x: absolutePositionLeft - cellBoundry.left,
43873
+ y: canvasXY.y - cellBoundry.top,
43873
43874
  activeType: "dimension"
43874
43875
  }
43875
43876
  });
43876
43877
  }
43877
43878
  }
43878
- }, 0), table.scenegraph.updateNextFrame();
43879
+ }, 0);
43880
+ delayRunDimensionHoverTimerForRowDirection.push(timer), table.scenegraph.updateNextFrame();
43881
+ }
43882
+ }
43883
+ function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
43884
+ var _a;
43885
+ clearDelayRunDimensionHoverTimerForViewRange();
43886
+ const {
43887
+ rowStart: rowStart
43888
+ } = table.getBodyVisibleRowRange();
43889
+ let rowEnd = table.getBodyVisibleRowRange().rowEnd;
43890
+ rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
43891
+ const {
43892
+ colStart: colStart
43893
+ } = table.getBodyVisibleColRange();
43894
+ let colEnd = table.getBodyVisibleColRange().colEnd;
43895
+ colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
43896
+ for (let col = colStart; col <= colEnd; col++) {
43897
+ isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43898
+ for (let i = rowStart; i <= rowEnd; i++) {
43899
+ const cellGroup = table.scenegraph.getCell(col, i),
43900
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43901
+ 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));
43902
+ const timer = setTimeout(() => {
43903
+ var _a, _b;
43904
+ if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
43905
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
43906
+ let isShowTooltip = !0;
43907
+ "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, {
43908
+ activeType: "mark"
43909
+ })));
43910
+ }
43911
+ }, 0);
43912
+ delayRunDimensionHoverTimerForViewRange.push(timer), table.scenegraph.updateNextFrame();
43913
+ }
43914
+ }
43915
+ }
43916
+ function checkIsShowTooltipForEdgeRow(row, table) {
43917
+ var _a, _b;
43918
+ let isShowTooltip = !0;
43919
+ const {
43920
+ rowStart: rowStart
43921
+ } = table.getBodyVisibleRowRange();
43922
+ let rowEnd = table.getBodyVisibleRowRange().rowEnd;
43923
+ rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
43924
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
43925
+ if (row === rowEnd && isShowTooltip) {
43926
+ const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
43927
+ {
43928
+ rowEnd: rowEnd1
43929
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
43930
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
43931
+ const {
43932
+ rowEnd: rowEnd2
43933
+ } = table.getBodyVisibleRowRange(0, 5);
43934
+ isShowTooltip = rowEnd2 !== rowEnd;
43935
+ }
43936
+ } else if (row === rowStart && isShowTooltip) {
43937
+ const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
43938
+ {
43939
+ rowStart: rowStart1
43940
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
43941
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
43942
+ const {
43943
+ rowStart: rowStart2
43944
+ } = table.getBodyVisibleRowRange(0, -5);
43945
+ isShowTooltip = rowStart2 !== rowStart;
43946
+ }
43947
+ }
43948
+ return isShowTooltip;
43949
+ }
43950
+ function checkIsShowTooltipForEdgeColumn(col, table) {
43951
+ let isShowTooltip = !0;
43952
+ const {
43953
+ colStart: colStart
43954
+ } = table.getBodyVisibleColRange();
43955
+ let colEnd = table.getBodyVisibleColRange().colEnd;
43956
+ colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
43957
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
43958
+ if (col === colEnd && isShowTooltip) {
43959
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43960
+ {
43961
+ colEnd: colEnd1
43962
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
43963
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
43964
+ const {
43965
+ colEnd: colEnd2
43966
+ } = table.getBodyVisibleColRange(0, 5);
43967
+ isShowTooltip = colEnd2 !== colEnd;
43968
+ }
43969
+ } else if (col === colStart && isShowTooltip) {
43970
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43971
+ {
43972
+ colStart: colStart1
43973
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
43974
+ if (colStart1 === colStart) isShowTooltip = !0;else {
43975
+ const {
43976
+ colStart: colStart2
43977
+ } = table.getBodyVisibleColRange(0, -5);
43978
+ isShowTooltip = colStart2 !== colStart;
43979
+ }
43879
43980
  }
43981
+ return isShowTooltip;
43880
43982
  }
43881
- function clearChartInstanceListByRowDirection(row, excludedCol, table) {
43983
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
43984
+ var _a;
43985
+ if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
43986
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
43987
+ if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
43988
+ const cellGroup = table.scenegraph.getCell(col, Number(i)),
43989
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43990
+ isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
43991
+ forceRelease: forceRelease,
43992
+ releaseChartInstance: !0,
43993
+ releaseColumnChartInstance: !1,
43994
+ releaseRowChartInstance: !1
43995
+ }), chartInstanceListColumnByColumnDirection[col][i] = null);
43996
+ }
43997
+ delete chartInstanceListColumnByColumnDirection[col];
43998
+ }
43999
+ }
44000
+ function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
43882
44001
  var _a;
43883
44002
  if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
43884
44003
  if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
43885
44004
  const cellGroup = table.scenegraph.getCell(Number(i), row),
43886
44005
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43887
- chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
44006
+ isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
44007
+ forceRelease: forceRelease,
43888
44008
  releaseChartInstance: !0,
43889
44009
  releaseColumnChartInstance: !1,
43890
44010
  releaseRowChartInstance: !1
@@ -43892,6 +44012,40 @@
43892
44012
  }
43893
44013
  delete chartInstanceListRowByRowDirection[row];
43894
44014
  }
44015
+ function clearDelayRunDimensionHoverTimerForColumnDirection() {
44016
+ for (const timer of delayRunDimensionHoverTimerForColumnDirection) clearTimeout(timer);
44017
+ delayRunDimensionHoverTimerForColumnDirection.length = 0;
44018
+ }
44019
+ function clearDelayRunDimensionHoverTimerForRowDirection() {
44020
+ for (const timer of delayRunDimensionHoverTimerForRowDirection) clearTimeout(timer);
44021
+ delayRunDimensionHoverTimerForRowDirection.length = 0;
44022
+ }
44023
+ function clearDelayRunDimensionHoverTimerForViewRange() {
44024
+ for (const timer of delayRunDimensionHoverTimerForViewRange) clearTimeout(timer);
44025
+ delayRunDimensionHoverTimerForViewRange.length = 0;
44026
+ }
44027
+ function clearDelayRunDimensionHoverTimers() {
44028
+ for (const timer of delayRunDimensionHoverTimerForColumnDirection) clearTimeout(timer);
44029
+ delayRunDimensionHoverTimerForColumnDirection.length = 0;
44030
+ for (const timer of delayRunDimensionHoverTimerForRowDirection) clearTimeout(timer);
44031
+ delayRunDimensionHoverTimerForRowDirection.length = 0;
44032
+ for (const timer of delayRunDimensionHoverTimerForViewRange) clearTimeout(timer);
44033
+ delayRunDimensionHoverTimerForViewRange.length = 0;
44034
+ }
44035
+ function clearAllChartInstanceList(table, forceRelease = !1) {
44036
+ clearDelayRunDimensionHoverTimers();
44037
+ for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
44038
+ for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
44039
+ }
44040
+ let disabledTooltipToAllChartInstances = !1;
44041
+ function isDisabledTooltipToAllChartInstances() {
44042
+ return disabledTooltipToAllChartInstances;
44043
+ }
44044
+ function enableTooltipToAllChartInstances() {
44045
+ disabledTooltipToAllChartInstances = !1;
44046
+ for (const col in chartInstanceListColumnByColumnDirection) for (const row in chartInstanceListColumnByColumnDirection[col]) chartInstanceListColumnByColumnDirection[col][row].disableTooltip(!1);
44047
+ for (const row in chartInstanceListRowByRowDirection) for (const col in chartInstanceListRowByRowDirection[row]) chartInstanceListRowByRowDirection[row][col].disableTooltip(!1);
44048
+ }
43895
44049
 
43896
44050
  function isValidAlignDomain(domain) {
43897
44051
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -44525,7 +44679,7 @@
44525
44679
  const CHART_NUMBER_TYPE = genNumberType();
44526
44680
  class Chart extends Rect$1 {
44527
44681
  constructor(isShareChartSpec, params) {
44528
- 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 {
44682
+ 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 {
44529
44683
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
44530
44684
  renderCanvas: params.canvas,
44531
44685
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -44546,7 +44700,7 @@
44546
44700
  }
44547
44701
  }
44548
44702
  activate(table) {
44549
- var _a, _b, _c, _d, _e;
44703
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
44550
44704
  if (this.activeChartInstance) return;
44551
44705
  const {
44552
44706
  col: col,
@@ -44565,7 +44719,7 @@
44565
44719
  y1: y1 - table.scrollTop,
44566
44720
  y2: y2 - table.scrollTop
44567
44721
  });
44568
- 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, {
44722
+ this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
44569
44723
  renderCanvas: this.attribute.canvas,
44570
44724
  mode: "desktop-browser",
44571
44725
  canvasControled: !1,
@@ -44599,7 +44753,7 @@
44599
44753
  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());
44600
44754
  }
44601
44755
  },
44602
- componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
44756
+ componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
44603
44757
  tooltip: {
44604
44758
  dimension: !1,
44605
44759
  mark: !0
@@ -44610,16 +44764,43 @@
44610
44764
  const chartStage = this.activeChartInstance.getStage(),
44611
44765
  matrix = this.globalTransMatrix.clone(),
44612
44766
  stageMatrix = this.stage.window.getViewBoxTransform();
44767
+ let brushChangeThrottle;
44613
44768
  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 => {
44614
44769
  var _a;
44615
- !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);
44770
+ !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");
44771
+ }), (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 => {
44772
+ var _a;
44773
+ brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
44774
+ })), this.activeChartInstance.on("brushStart", params => {
44775
+ const brushingChartInstance = getBrushingChartInstance();
44776
+ brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && clearAndReleaseBrushingChartInstance(table.scenegraph), setBrushingChartInstance(this.activeChartInstance, col, row));
44616
44777
  }), this.activeChartInstance.on("brushEnd", params => {
44617
44778
  var _a;
44618
- table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
44779
+ 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(() => {
44619
44780
  Chart.temp = 1;
44620
44781
  }, 0);
44621
- }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
44782
+ }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
44783
+ markName: "pie"
44784
+ }, params => {
44785
+ var _a;
44786
+ const categoryField = this.attribute.spec.categoryField,
44787
+ datum = {
44788
+ [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44789
+ };
44790
+ generateChartInstanceListByViewRange(datum, table, !1);
44791
+ }), this.activeChartInstance.on("pointerout", {
44792
+ markName: "pie"
44793
+ }, params => {
44794
+ var _a;
44795
+ const categoryField = this.attribute.spec.categoryField,
44796
+ datum = {
44797
+ [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44798
+ };
44799
+ generateChartInstanceListByViewRange(datum, table, !0);
44800
+ })), this.activeChartInstance.on("dimensionHover", params => {
44622
44801
  var _a, _b;
44802
+ if (isDisabledTooltipToAllChartInstances()) return;
44803
+ this.activeChartInstance.disableTooltip(!1);
44623
44804
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
44624
44805
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
44625
44806
  viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
@@ -44636,11 +44817,11 @@
44636
44817
  prev_justShowMarkTooltip = this.justShowMarkTooltip;
44637
44818
  params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
44638
44819
  let delayRunDimensionHover = !1;
44639
- 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) {
44820
+ 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) {
44640
44821
  const dimensionValue = dimensionInfo.value,
44641
44822
  indicatorsAsCol = table.options.indicatorsAsCol;
44642
- if (delayRunDimensionHover ? (clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = setTimeout(() => {
44643
- indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
44823
+ if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
44824
+ isDisabledTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
44644
44825
  }, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
44645
44826
  const series = dimensionInfo.data[0].series,
44646
44827
  width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
@@ -44681,21 +44862,26 @@
44681
44862
  }
44682
44863
  }
44683
44864
  }
44684
- }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
44865
+ })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
44866
+ }
44867
+ clearDelayRunDimensionHoverTimer() {
44868
+ clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
44685
44869
  }
44686
44870
  deactivate(table, {
44871
+ forceRelease = !1,
44687
44872
  releaseChartInstance = !0,
44688
44873
  releaseColumnChartInstance = !0,
44689
- releaseRowChartInstance = !0
44874
+ releaseRowChartInstance = !0,
44875
+ releaseAllChartInstance = !1
44690
44876
  } = {}) {
44691
44877
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
44692
- if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
44693
- null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44878
+ if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
44879
+ !this.activeChartInstance || !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44694
44880
  x1: -1e3,
44695
44881
  x2: -800,
44696
44882
  y1: -1e3,
44697
44883
  y2: -800
44698
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
44884
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
44699
44885
  const {
44700
44886
  col: col,
44701
44887
  row: row
@@ -44708,7 +44894,7 @@
44708
44894
  } = this.parent;
44709
44895
  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));
44710
44896
  }
44711
- 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);
44897
+ 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));
44712
44898
  }
44713
44899
  updateData(data) {
44714
44900
  this.attribute.data = data;
@@ -44723,13 +44909,14 @@
44723
44909
  y1: y1,
44724
44910
  x2: x2,
44725
44911
  y2: y2
44726
- } = cellGroup.globalAABBBounds;
44727
- return {
44728
- 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)),
44729
- 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)),
44730
- 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)),
44731
- 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))
44732
- };
44912
+ } = cellGroup.globalAABBBounds,
44913
+ viewBox = {
44914
+ 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)),
44915
+ 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)),
44916
+ 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)),
44917
+ 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))
44918
+ };
44919
+ return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
44733
44920
  }
44734
44921
  }
44735
44922
  function getTableBounds(col, row, table) {
@@ -44944,7 +45131,7 @@
44944
45131
  {
44945
45132
  width = groupAttribute.width,
44946
45133
  height = groupAttribute.height
44947
- } = (chart.getViewBox(), chart.attribute),
45134
+ } = chart.attribute,
44948
45135
  {
44949
45136
  table: table
44950
45137
  } = chart.getRootNode(),
@@ -44972,8 +45159,9 @@
44972
45159
  });
44973
45160
  }
44974
45161
  }
44975
- const viewBox = chart.getViewBox();
44976
- activeChartInstance.updateViewBox({
45162
+ const lastViewBox = chart.activeChartInstanceLastViewBox,
45163
+ viewBox = chart.getViewBox();
45164
+ lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
44977
45165
  x1: 0,
44978
45166
  x2: viewBox.x2 - viewBox.x1,
44979
45167
  y1: 0,
@@ -48482,18 +48670,25 @@
48482
48670
  }
48483
48671
  function clearChartCacheImage(scenegraph) {
48484
48672
  var _a;
48673
+ const brushingCellPos = getBrushingChartInstanceCellPos();
48485
48674
  for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
48486
48675
  const columnGroup = scenegraph.getColGroup(c);
48487
48676
  null === (_a = null == columnGroup ? void 0 : columnGroup.getChildren()) || void 0 === _a || _a.forEach(cellNode => {
48488
- cellNode.children.forEach(node => {
48677
+ brushingCellPos && brushingCellPos.col === cellNode.col && brushingCellPos.row === cellNode.row || cellNode.children.forEach(node => {
48489
48678
  "chart" === node.type && (node.cacheCanvas = null, node.addUpdateBoundTag());
48490
48679
  });
48491
48680
  });
48492
48681
  }
48493
48682
  }
48494
- function updateChartState(scenegraph, datum) {
48683
+ function clearCellChartCacheImage(col, row, scenegraph) {
48684
+ scenegraph.getCell(col, row).children.forEach(node => {
48685
+ "chart" === node.type && (node.cacheCanvas = null, node.addUpdateBoundTag());
48686
+ });
48687
+ }
48688
+ function updateChartState(scenegraph, datum, selectedDataMode) {
48495
48689
  const table = scenegraph.table;
48496
48690
  if (table.isPivotChart()) {
48691
+ table._selectedDataMode = selectedDataMode;
48497
48692
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
48498
48693
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
48499
48694
  const newSelectedDataItemsInChart = [];
@@ -49241,16 +49436,28 @@
49241
49436
  resetResidentHoverIcon(col, row) {
49242
49437
  resetResidentHoverIcon(col, row, this);
49243
49438
  }
49244
- deactivateChart(col, row) {
49245
- var _a, _b, _c;
49439
+ deactivateChart(col, row, forceRelease = !1) {
49440
+ var _a, _b, _c, _d, _e, _f;
49441
+ if (forceRelease) {
49442
+ const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
49443
+ brushingChartInstance = getBrushingChartInstance();
49444
+ brushingChartInstanceCellPos && brushingChartInstance && (clearAndReleaseBrushingChartInstance(this), clearCellChartCacheImage(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row, this));
49445
+ }
49246
49446
  if (-1 === col || -1 === row) return;
49247
49447
  const cellGroup = this.getCell(col, row);
49248
49448
  if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
49449
+ if (forceRelease) return void (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, {
49450
+ forceRelease: !0,
49451
+ releaseChartInstance: !0,
49452
+ releaseColumnChartInstance: !0,
49453
+ releaseRowChartInstance: !0,
49454
+ releaseAllChartInstance: !0
49455
+ }));
49249
49456
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
49250
- 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 ? {
49251
- 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,
49252
- 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,
49253
- 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
49457
+ null === (_e = null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) || void 0 === _e || _e.call(_d, this.table, (null === (_f = this.table.options.chartDimensionLinkage) || void 0 === _f ? void 0 : _f.showTooltip) ? {
49458
+ 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),
49459
+ 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),
49460
+ 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)
49254
49461
  } : void 0);
49255
49462
  }
49256
49463
  }
@@ -49298,8 +49505,15 @@
49298
49505
  updateChartSizeForResizeRowHeight(row) {
49299
49506
  updateChartSizeForResizeRowHeight(this, row);
49300
49507
  }
49301
- updateChartState(datum) {
49302
- this.table.isPivotChart() && updateChartState(this, datum);
49508
+ updateChartState(datum, selectedDataMode) {
49509
+ var _a, _b, _c;
49510
+ if (this.table.isPivotChart()) {
49511
+ if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
49512
+ const brushingChartInstance = getBrushingChartInstance();
49513
+ brushingChartInstance && (null === (_a = brushingChartInstance.getChart()) || void 0 === _a || _a.getComponentsByKey("brush")[0].clearBrushStateAndMask()), null === (_c = null === (_b = this.table.options.chartDimensionLinkage) || void 0 === _b ? void 0 : _b.clearChartState) || void 0 === _c || _c.call(_b);
49514
+ }
49515
+ updateChartState(this, datum, selectedDataMode);
49516
+ }
49303
49517
  }
49304
49518
  updateCheckboxCellState(col, row, checked) {
49305
49519
  var _a, _b;
@@ -52326,7 +52540,7 @@
52326
52540
  }, 0 !== e.button) return;
52327
52541
  const eventArgsSet = getCellEventArgsSet(e);
52328
52542
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
52329
- 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;
52543
+ 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;
52330
52544
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
52331
52545
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
52332
52546
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -52354,7 +52568,7 @@
52354
52568
  }
52355
52569
  eventManager.dealTableHover(eventArgsSet);
52356
52570
  } else {
52357
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
52571
+ 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);
52358
52572
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52359
52573
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52360
52574
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -52506,7 +52720,7 @@
52506
52720
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
52507
52721
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
52508
52722
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
52509
- table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
52723
+ table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
52510
52724
  const {
52511
52725
  eventArgs: eventArgs
52512
52726
  } = eventArgsSet;
@@ -52525,7 +52739,7 @@
52525
52739
  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 {
52526
52740
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
52527
52741
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
52528
- (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);
52742
+ (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);
52529
52743
  }
52530
52744
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
52531
52745
  var _a, _b, _c;
@@ -52643,7 +52857,15 @@
52643
52857
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
52644
52858
  }), table.scenegraph.stage.addEventListener("wheel", e => {
52645
52859
  var _a;
52646
- e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
52860
+ if (!e.path.find(node => "legend" === node.name)) {
52861
+ null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
52862
+ const {
52863
+ cellPos: cellPos
52864
+ } = table.stateManager.hover,
52865
+ prevHoverCellCol = cellPos.col,
52866
+ prevHoverCellRow = cellPos.row;
52867
+ table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
52868
+ }
52647
52869
  });
52648
52870
  }
52649
52871
  function bindGesture(eventManager) {
@@ -52758,11 +52980,13 @@
52758
52980
  const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
52759
52981
  throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
52760
52982
  scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
52761
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
52983
+ var _a;
52984
+ 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);
52762
52985
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
52763
52986
  throttleVerticalWheel(ratio, e);
52764
52987
  }), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
52765
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
52988
+ var _a;
52989
+ 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);
52766
52990
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
52767
52991
  throttleHorizontalWheel(ratio);
52768
52992
  });
@@ -52912,7 +53136,7 @@
52912
53136
  const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
52913
53137
  eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
52914
53138
  }
52915
- });
53139
+ }), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
52916
53140
  }
52917
53141
  };
52918
53142
  eventManager.globalEventListeners.push({
@@ -53812,13 +54036,7 @@
53812
54036
  try {
53813
54037
  const selectCells = this.cutCellRange;
53814
54038
  if (!selectCells || 0 === selectCells.length) return;
53815
- const changeValues = [];
53816
- for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && changeValues.push({
53817
- col: selectCells[i][j].col,
53818
- row: selectCells[i][j].row,
53819
- value: void 0
53820
- });
53821
- table.changeCellValuesByIds(changeValues);
54039
+ for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && table.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, void 0);
53822
54040
  } catch (error) {}
53823
54041
  }
53824
54042
  checkClipboardChanged() {
@@ -56061,7 +56279,7 @@
56061
56279
  }
56062
56280
  constructor(container, options = {}) {
56063
56281
  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;
56064
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.1", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
56282
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.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");
56065
56283
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
56066
56284
  options: options,
56067
56285
  container: container
@@ -59685,9 +59903,9 @@
59685
59903
  };
59686
59904
  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;
59687
59905
  const editor = this.table.getEditor(col, row);
59688
- setTimeout(() => {
59906
+ editor && setTimeout(() => {
59689
59907
  var _a;
59690
- this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
59908
+ editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
59691
59909
  referencePosition: referencePosition,
59692
59910
  container: this.table.getElement(),
59693
59911
  table: this.table,
@@ -59836,16 +60054,15 @@
59836
60054
  step((generator = generator.apply(thisArg, _arguments || [])).next());
59837
60055
  });
59838
60056
  };
59839
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
60057
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
59840
60058
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
59841
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
59842
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60059
+ const recordIndex = table.getRecordShowIndexByCell(col, row),
59843
60060
  {
59844
60061
  field: field
59845
60062
  } = table.internalProps.layoutMap.getBody(col, row),
59846
60063
  beforeChangeValue = table.getCellRawValue(col, row),
59847
60064
  oldValue = table.getCellOriginValue(col, row);
59848
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
60065
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
59849
60066
  const range = table.getCellRange(col, row),
59850
60067
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
59851
60068
  if (aggregators) {
@@ -59868,24 +60085,16 @@
59868
60085
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
59869
60086
  }
59870
60087
  const changedValue = table.getCellOriginValue(col, row);
59871
- if (oldValue !== changedValue && triggerEvent) {
59872
- const changeValue = {
59873
- col: col,
59874
- row: row,
59875
- recordIndex: recordIndex,
59876
- field: field,
59877
- rawValue: beforeChangeValue,
59878
- currentValue: oldValue,
59879
- changedValue: changedValue
59880
- };
59881
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
59882
- values: [changeValue]
59883
- });
59884
- }
59885
- table.scenegraph.updateNextFrame();
60088
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
60089
+ col: col,
60090
+ row: row,
60091
+ rawValue: beforeChangeValue,
60092
+ currentValue: oldValue,
60093
+ changedValue: changedValue
60094
+ }), table.scenegraph.updateNextFrame();
59886
60095
  }
59887
60096
  }
59888
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
60097
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
59889
60098
  var _a, _b;
59890
60099
  return __awaiter(this, void 0, void 0, function* () {
59891
60100
  const changedCellResults = [];
@@ -59907,7 +60116,6 @@
59907
60116
  oldRowValues.push(oldValue);
59908
60117
  }
59909
60118
  }
59910
- const resultChangeValues = [];
59911
60119
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
59912
60120
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
59913
60121
  const rowValues = values[i];
@@ -59931,34 +60139,25 @@
59931
60139
  if (isCanChange) {
59932
60140
  changedCellResults[i][j] = !0;
59933
60141
  const value = rowValues[j],
59934
- recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
59935
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60142
+ recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
59936
60143
  {
59937
60144
  field: field
59938
60145
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
59939
60146
  beforeChangeValue = beforeChangeValues[i][j],
59940
60147
  oldValue = oldValues[i][j];
59941
- table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, startCol + j, startRow + i, table);
60148
+ table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);
59942
60149
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
59943
- if (oldValue !== changedValue && triggerEvent) {
59944
- const changeValue = {
59945
- col: startCol + j,
59946
- row: startRow + i,
59947
- recordIndex: recordIndex,
59948
- field: field,
59949
- rawValue: beforeChangeValue,
59950
- currentValue: oldValue,
59951
- changedValue: changedValue
59952
- };
59953
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
59954
- }
60150
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
60151
+ col: startCol + j,
60152
+ row: startRow + i,
60153
+ rawValue: beforeChangeValue,
60154
+ currentValue: oldValue,
60155
+ changedValue: changedValue
60156
+ });
59955
60157
  } else changedCellResults[i][j] = !1;
59956
60158
  }
59957
60159
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
59958
60160
  }
59959
- silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
59960
- values: resultChangeValues
59961
- });
59962
60161
  const startRange = table.getCellRange(startCol, startRow),
59963
60162
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
59964
60163
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -59992,36 +60191,6 @@
59992
60191
  return table.scenegraph.updateNextFrame(), changedCellResults;
59993
60192
  });
59994
60193
  }
59995
- function listTableChangeCellValuesByIds(changeValues, triggerEvent, table, silentChangeCellValuesEvent) {
59996
- return __awaiter(this, void 0, void 0, function* () {
59997
- const resultChangeValues = [];
59998
- for (let i = 0; i < changeValues.length; i++) {
59999
- const {
60000
- col: col,
60001
- row: row,
60002
- value: value
60003
- } = changeValues[i],
60004
- recordShowIndex = table.getRecordShowIndexByCell(col, row),
60005
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60006
- {
60007
- field: field
60008
- } = table.internalProps.layoutMap.getBody(col, row),
60009
- oldValue = table.getCellOriginValue(col, row);
60010
- listTableChangeCellValue(col, row, value, !1, triggerEvent, table, !0), oldValue !== value && triggerEvent && resultChangeValues.push({
60011
- col: col,
60012
- row: row,
60013
- recordIndex: recordIndex,
60014
- field: field,
60015
- rawValue: oldValue,
60016
- currentValue: oldValue,
60017
- changedValue: value
60018
- });
60019
- }
60020
- silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
60021
- values: resultChangeValues
60022
- });
60023
- });
60024
- }
60025
60194
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
60026
60195
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
60027
60196
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -61185,37 +61354,11 @@
61185
61354
  }
61186
61355
  return isValid$1(editorDefine);
61187
61356
  }
61188
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61189
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61190
- }
61191
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61192
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61193
- }
61194
- changeCellValuesByIds(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
61195
- return listTableChangeCellValuesByIds(changeValues, triggerEvent, this, silentChangeCellValuesEvent);
61196
- }
61197
- changeSourceCellValue(recordIndex, field, value) {
61198
- const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
61199
- cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
61200
- if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
61201
- this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
61202
- const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
61203
- oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
61204
- changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
61205
- if (oldValue !== changedValue) {
61206
- const changeValue = {
61207
- col: cellAddr.col,
61208
- row: cellAddr.row,
61209
- recordIndex: recordIndex,
61210
- field: field,
61211
- rawValue: beforeChangeValue,
61212
- currentValue: oldValue,
61213
- changedValue: changedValue
61214
- };
61215
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61216
- values: [changeValue]
61217
- });
61218
- }
61357
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
61358
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
61359
+ }
61360
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
61361
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
61219
61362
  }
61220
61363
  addRecord(record, recordIndex) {
61221
61364
  var _a;
@@ -61237,16 +61380,11 @@
61237
61380
  }
61238
61381
  deleteRecords(recordIndexs) {
61239
61382
  var _a;
61240
- const deletedRecords = [];
61241
- (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
61242
- let record = null;
61243
- record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
61244
- }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61383
+ listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61245
61384
  const rowIndexs = [];
61246
61385
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
61247
61386
  this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61248
61387
  recordIndexs: recordIndexs,
61249
- records: deletedRecords,
61250
61388
  rowIndexs: rowIndexs,
61251
61389
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
61252
61390
  });