@visactor/vtable-calendar 1.22.11-alpha.5 → 1.22.11-alpha.6

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
  },
@@ -36992,24 +37015,6 @@
36992
37015
  }
36993
37016
  }
36994
37017
  }
36995
- changeFieldValueByRecordIndex(value, recordIndex, field, table) {
36996
- var _a, _b, _c, _d;
36997
- if (null === field) return;
36998
- if (null == recordIndex) return;
36999
- const rawKey = recordIndex.toString();
37000
- if (!this.beforeChangedRecordsMap.has(rawKey)) {
37001
- const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
37002
- originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
37003
- this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
37004
- }
37005
- if ("string" == typeof field || "number" == typeof field) {
37006
- const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
37007
- rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
37008
- record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
37009
- let formatValue = value;
37010
- "number" == typeof beforeChangedValue && isAllDigits(value) && (formatValue = parseFloat(value)), record ? record[field] = formatValue : rawRecords && "number" == typeof recordIndex && (rawRecords[recordIndex] = "Array" === this.addRecordRule ? [] : {}, rawRecords[recordIndex][field] = formatValue);
37011
- }
37012
- }
37013
37018
  cacheBeforeChangedRecord(dataIndex, table) {
37014
37019
  var _a;
37015
37020
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -37075,16 +37080,9 @@
37075
37080
  }
37076
37081
  }
37077
37082
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
37078
- const delta = "add" === type ? insertCount : -insertCount,
37079
- numericKeys = [];
37080
- this.beforeChangedRecordsMap.forEach((_, key) => {
37081
- const numKey = Number(key);
37082
- Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
37083
- }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
37084
- for (let i = 0; i < numericKeys.length; i++) {
37085
- const key = numericKeys[i],
37086
- record = this.beforeChangedRecordsMap.get(key.toString());
37087
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
37083
+ for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
37084
+ const record = this.beforeChangedRecordsMap.get(key.toString());
37085
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
37088
37086
  }
37089
37087
  }
37090
37088
  deleteRecords(recordIndexs) {
@@ -43761,11 +43759,35 @@
43761
43759
  return hoverMode;
43762
43760
  }
43763
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 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
+ }
43764
43785
  const chartInstanceListColumnByColumnDirection = {};
43765
43786
  const chartInstanceListRowByRowDirection = {};
43787
+ const delayRunDimensionHoverTimer = [];
43766
43788
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
43767
43789
  var _a;
43768
- isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43790
+ clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43769
43791
  const {
43770
43792
  rowStart: rowStart
43771
43793
  } = table.getBodyVisibleRowRange();
@@ -43774,76 +43796,40 @@
43774
43796
  for (let i = rowStart; i <= rowEnd; i++) {
43775
43797
  const cellGroup = table.scenegraph.getCell(col, i),
43776
43798
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43777
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
43778
- var _a, _b, _c, _d, _e, _f;
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;
43779
43802
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
43780
43803
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43781
43804
  let isShowTooltip = !isScatter;
43782
- if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
43783
- const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
43784
- {
43785
- rowEnd: rowEnd1
43786
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
43787
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
43788
- const {
43789
- rowEnd: rowEnd2
43790
- } = table.getBodyVisibleRowRange(0, 5);
43791
- isShowTooltip = rowEnd2 !== rowEnd;
43792
- }
43793
- } else if (i === rowStart && isShowTooltip) {
43794
- const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
43795
- {
43796
- rowStart: rowStart1
43797
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
43798
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
43799
- const {
43800
- rowStart: rowStart2
43801
- } = table.getBodyVisibleRowRange(0, -5);
43802
- isShowTooltip = rowStart2 !== rowStart;
43803
- }
43804
- }
43805
- 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 {
43806
- const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
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,
43807
43808
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
43808
43809
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43809
43810
  tooltip: !1,
43810
43811
  showTooltipOption: {
43811
- x: canvasXY.x,
43812
- y: absolutePositionTop,
43812
+ x: canvasXY.x - cellBoundry.left,
43813
+ y: absolutePositionTop - cellBoundry.top,
43813
43814
  activeType: "dimension"
43814
43815
  }
43815
43816
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43816
43817
  tooltip: isShowTooltip,
43817
43818
  showTooltipOption: {
43818
- x: canvasXY.x,
43819
- y: absolutePositionTop,
43819
+ x: canvasXY.x - cellBoundry.left,
43820
+ y: absolutePositionTop - cellBoundry.top,
43820
43821
  activeType: "dimension"
43821
43822
  }
43822
43823
  });
43823
43824
  }
43824
43825
  }
43825
- }, 0), table.scenegraph.updateNextFrame();
43826
- }
43827
- }
43828
- function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
43829
- var _a;
43830
- if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
43831
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
43832
- if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
43833
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
43834
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43835
- chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
43836
- releaseChartInstance: !0,
43837
- releaseColumnChartInstance: !1,
43838
- releaseRowChartInstance: !1
43839
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
43840
- }
43841
- delete chartInstanceListColumnByColumnDirection[col];
43826
+ }, 0);
43827
+ delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
43842
43828
  }
43843
43829
  }
43844
43830
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
43845
43831
  var _a;
43846
- isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
43832
+ clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
43847
43833
  const {
43848
43834
  colStart: colStart
43849
43835
  } = table.getBodyVisibleColRange();
@@ -43852,64 +43838,162 @@
43852
43838
  for (let i = colStart; i <= colEnd; i++) {
43853
43839
  const cellGroup = table.scenegraph.getCell(i, row),
43854
43840
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43855
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
43841
+ chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
43842
+ const timer = setTimeout(() => {
43856
43843
  var _a, _b, _c, _d;
43857
43844
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
43858
43845
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43859
43846
  let isShowTooltip = !isScatter;
43860
- if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
43861
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43862
- {
43863
- colEnd: colEnd1
43864
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
43865
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
43866
- const {
43867
- colEnd: colEnd2
43868
- } = table.getBodyVisibleColRange(0, 5);
43869
- isShowTooltip = colEnd2 !== colEnd;
43870
- }
43871
- } else if (i === colStart && isShowTooltip) {
43872
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43873
- {
43874
- colStart: colStart1
43875
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
43876
- if (colStart1 === colStart) isShowTooltip = !0;else {
43877
- const {
43878
- colStart: colStart2
43879
- } = table.getBodyVisibleColRange(0, -5);
43880
- isShowTooltip = colStart2 !== colStart;
43881
- }
43882
- }
43883
- 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 {
43884
- const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
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,
43885
43850
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
43886
43851
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43887
43852
  tooltip: !1,
43888
43853
  showTooltipOption: {
43889
- x: absolutePositionLeft,
43890
- y: canvasXY.y,
43854
+ x: absolutePositionLeft - cellBoundry.left,
43855
+ y: canvasXY.y - cellBoundry.top,
43891
43856
  activeType: "dimension"
43892
43857
  }
43893
43858
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43894
43859
  tooltip: isShowTooltip,
43895
43860
  showTooltipOption: {
43896
- x: absolutePositionLeft,
43897
- y: canvasXY.y,
43861
+ x: absolutePositionLeft - cellBoundry.left,
43862
+ y: canvasXY.y - cellBoundry.top,
43898
43863
  activeType: "dimension"
43899
43864
  }
43900
43865
  });
43901
43866
  }
43902
43867
  }
43903
- }, 0), table.scenegraph.updateNextFrame();
43868
+ }, 0);
43869
+ delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
43870
+ }
43871
+ }
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];
43904
43987
  }
43905
43988
  }
43906
- function clearChartInstanceListByRowDirection(row, excludedCol, table) {
43989
+ function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
43907
43990
  var _a;
43908
43991
  if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
43909
43992
  if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
43910
43993
  const cellGroup = table.scenegraph.getCell(Number(i), row),
43911
43994
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43912
- chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
43995
+ isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
43996
+ forceRelease: forceRelease,
43913
43997
  releaseChartInstance: !0,
43914
43998
  releaseColumnChartInstance: !1,
43915
43999
  releaseRowChartInstance: !1
@@ -43917,6 +44001,15 @@
43917
44001
  }
43918
44002
  delete chartInstanceListRowByRowDirection[row];
43919
44003
  }
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
+ }
43920
44013
 
43921
44014
  function isValidAlignDomain(domain) {
43922
44015
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -44550,7 +44643,7 @@
44550
44643
  const CHART_NUMBER_TYPE = genNumberType();
44551
44644
  class Chart extends Rect$1 {
44552
44645
  constructor(isShareChartSpec, params) {
44553
- 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 {
44646
+ 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 {
44554
44647
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
44555
44648
  renderCanvas: params.canvas,
44556
44649
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -44571,7 +44664,7 @@
44571
44664
  }
44572
44665
  }
44573
44666
  activate(table) {
44574
- var _a, _b, _c, _d, _e;
44667
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
44575
44668
  if (this.activeChartInstance) return;
44576
44669
  const {
44577
44670
  col: col,
@@ -44590,7 +44683,7 @@
44590
44683
  y1: y1 - table.scrollTop,
44591
44684
  y2: y2 - table.scrollTop
44592
44685
  });
44593
- 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, {
44686
+ this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
44594
44687
  renderCanvas: this.attribute.canvas,
44595
44688
  mode: "desktop-browser",
44596
44689
  canvasControled: !1,
@@ -44624,7 +44717,7 @@
44624
44717
  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());
44625
44718
  }
44626
44719
  },
44627
- componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
44720
+ componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
44628
44721
  tooltip: {
44629
44722
  dimension: !1,
44630
44723
  mark: !0
@@ -44635,15 +44728,40 @@
44635
44728
  const chartStage = this.activeChartInstance.getStage(),
44636
44729
  matrix = this.globalTransMatrix.clone(),
44637
44730
  stageMatrix = this.stage.window.getViewBoxTransform();
44731
+ let brushChangeThrottle;
44638
44732
  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 => {
44639
44733
  var _a;
44640
- !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);
44734
+ !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");
44735
+ }), (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 => {
44736
+ var _a;
44737
+ brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
44738
+ })), this.activeChartInstance.on("brushStart", params => {
44739
+ const brushingChartInstance = getBrushingChartInstance();
44740
+ brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
44641
44741
  }), this.activeChartInstance.on("brushEnd", params => {
44642
44742
  var _a;
44643
- table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
44743
+ 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(() => {
44644
44744
  Chart.temp = 1;
44645
44745
  }, 0);
44646
- }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
44746
+ }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
44747
+ markName: "pie"
44748
+ }, params => {
44749
+ var _a;
44750
+ const categoryField = this.attribute.spec.categoryField,
44751
+ datum = {
44752
+ [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44753
+ };
44754
+ generateChartInstanceListByViewRange(datum, table, !1);
44755
+ }), this.activeChartInstance.on("pointerout", {
44756
+ markName: "pie"
44757
+ }, params => {
44758
+ var _a;
44759
+ const categoryField = this.attribute.spec.categoryField,
44760
+ datum = {
44761
+ [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44762
+ };
44763
+ generateChartInstanceListByViewRange(datum, table, !0);
44764
+ })), this.activeChartInstance.on("dimensionHover", params => {
44647
44765
  var _a, _b;
44648
44766
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
44649
44767
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
@@ -44706,21 +44824,23 @@
44706
44824
  }
44707
44825
  }
44708
44826
  }
44709
- }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
44827
+ })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance);
44710
44828
  }
44711
44829
  deactivate(table, {
44830
+ forceRelease = !1,
44712
44831
  releaseChartInstance = !0,
44713
44832
  releaseColumnChartInstance = !0,
44714
- releaseRowChartInstance = !0
44833
+ releaseRowChartInstance = !0,
44834
+ releaseAllChartInstance = !1
44715
44835
  } = {}) {
44716
44836
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
44717
44837
  if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
44718
- null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44838
+ !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44719
44839
  x1: -1e3,
44720
44840
  x2: -800,
44721
44841
  y1: -1e3,
44722
44842
  y2: -800
44723
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
44843
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
44724
44844
  const {
44725
44845
  col: col,
44726
44846
  row: row
@@ -44733,7 +44853,7 @@
44733
44853
  } = this.parent;
44734
44854
  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));
44735
44855
  }
44736
- 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);
44856
+ 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));
44737
44857
  }
44738
44858
  updateData(data) {
44739
44859
  this.attribute.data = data;
@@ -44748,13 +44868,14 @@
44748
44868
  y1: y1,
44749
44869
  x2: x2,
44750
44870
  y2: y2
44751
- } = cellGroup.globalAABBBounds;
44752
- return {
44753
- 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)),
44754
- 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)),
44755
- 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)),
44756
- 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))
44757
- };
44871
+ } = cellGroup.globalAABBBounds,
44872
+ viewBox = {
44873
+ 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)),
44874
+ 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)),
44875
+ 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)),
44876
+ 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))
44877
+ };
44878
+ return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
44758
44879
  }
44759
44880
  }
44760
44881
  function getTableBounds(col, row, table) {
@@ -44969,7 +45090,7 @@
44969
45090
  {
44970
45091
  width = groupAttribute.width,
44971
45092
  height = groupAttribute.height
44972
- } = (chart.getViewBox(), chart.attribute),
45093
+ } = chart.attribute,
44973
45094
  {
44974
45095
  table: table
44975
45096
  } = chart.getRootNode(),
@@ -44997,8 +45118,9 @@
44997
45118
  });
44998
45119
  }
44999
45120
  }
45000
- const viewBox = chart.getViewBox();
45001
- activeChartInstance.updateViewBox({
45121
+ const lastViewBox = chart.activeChartInstanceLastViewBox,
45122
+ viewBox = chart.getViewBox();
45123
+ lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
45002
45124
  x1: 0,
45003
45125
  x2: viewBox.x2 - viewBox.x1,
45004
45126
  y1: 0,
@@ -48516,9 +48638,10 @@
48516
48638
  });
48517
48639
  }
48518
48640
  }
48519
- function updateChartState(scenegraph, datum) {
48641
+ function updateChartState(scenegraph, datum, selectedDataMode) {
48520
48642
  const table = scenegraph.table;
48521
48643
  if (table.isPivotChart()) {
48644
+ table._selectedDataMode = selectedDataMode;
48522
48645
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
48523
48646
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
48524
48647
  const newSelectedDataItemsInChart = [];
@@ -49266,16 +49389,36 @@
49266
49389
  resetResidentHoverIcon(col, row) {
49267
49390
  resetResidentHoverIcon(col, row, this);
49268
49391
  }
49269
- deactivateChart(col, row) {
49270
- var _a, _b, _c;
49271
- if (-1 === col || -1 === row) return;
49392
+ deactivateChart(col, row, forceRelease = !1) {
49393
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
49394
+ if (-1 === col || -1 === row) {
49395
+ if (forceRelease) {
49396
+ const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
49397
+ cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
49398
+ (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, {
49399
+ forceRelease: !0,
49400
+ releaseChartInstance: !0,
49401
+ releaseColumnChartInstance: !0,
49402
+ releaseRowChartInstance: !0,
49403
+ releaseAllChartInstance: !0
49404
+ }));
49405
+ }
49406
+ return;
49407
+ }
49272
49408
  const cellGroup = this.getCell(col, row);
49273
- if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
49409
+ if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
49410
+ 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, {
49411
+ forceRelease: !0,
49412
+ releaseChartInstance: !0,
49413
+ releaseColumnChartInstance: !0,
49414
+ releaseRowChartInstance: !0,
49415
+ releaseAllChartInstance: !0
49416
+ }));
49274
49417
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
49275
- 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 ? {
49276
- 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,
49277
- 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,
49278
- 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
49418
+ 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) ? {
49419
+ 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),
49420
+ 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),
49421
+ 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)
49279
49422
  } : void 0);
49280
49423
  }
49281
49424
  }
@@ -49323,8 +49466,15 @@
49323
49466
  updateChartSizeForResizeRowHeight(row) {
49324
49467
  updateChartSizeForResizeRowHeight(this, row);
49325
49468
  }
49326
- updateChartState(datum) {
49327
- this.table.isPivotChart() && updateChartState(this, datum);
49469
+ updateChartState(datum, selectedDataMode) {
49470
+ var _a, _b;
49471
+ if (this.table.isPivotChart()) {
49472
+ if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
49473
+ const brushingChartInstance = getBrushingChartInstance();
49474
+ 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);
49475
+ }
49476
+ updateChartState(this, datum, selectedDataMode);
49477
+ }
49328
49478
  }
49329
49479
  updateCheckboxCellState(col, row, checked) {
49330
49480
  var _a, _b;
@@ -52351,7 +52501,7 @@
52351
52501
  }, 0 !== e.button) return;
52352
52502
  const eventArgsSet = getCellEventArgsSet(e);
52353
52503
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
52354
- 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;
52504
+ 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), (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;
52355
52505
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
52356
52506
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
52357
52507
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -52379,7 +52529,7 @@
52379
52529
  }
52380
52530
  eventManager.dealTableHover(eventArgsSet);
52381
52531
  } else {
52382
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
52532
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), void stateManager.updateInteractionState(InteractionState.grabing);
52383
52533
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52384
52534
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52385
52535
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -52531,7 +52681,7 @@
52531
52681
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
52532
52682
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
52533
52683
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
52534
- table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
52684
+ table.scenegraph.updateChartState(null, void 0), stateManager.updateInteractionState(InteractionState.grabing);
52535
52685
  const {
52536
52686
  eventArgs: eventArgs
52537
52687
  } = eventArgsSet;
@@ -52550,7 +52700,7 @@
52550
52700
  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 {
52551
52701
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
52552
52702
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
52553
- (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);
52703
+ (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);
52554
52704
  }
52555
52705
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
52556
52706
  var _a, _b, _c;
@@ -52668,7 +52818,15 @@
52668
52818
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
52669
52819
  }), table.scenegraph.stage.addEventListener("wheel", e => {
52670
52820
  var _a;
52671
- e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
52821
+ if (!e.path.find(node => "legend" === node.name)) {
52822
+ null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
52823
+ const {
52824
+ cellPos: cellPos
52825
+ } = table.stateManager.hover,
52826
+ prevHoverCellCol = cellPos.col,
52827
+ prevHoverCellRow = cellPos.row;
52828
+ table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
52829
+ }
52672
52830
  });
52673
52831
  }
52674
52832
  function bindGesture(eventManager) {
@@ -53448,7 +53606,7 @@
53448
53606
  };
53449
53607
  class EventManager {
53450
53608
  constructor(table) {
53451
- this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.cutRanges = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
53609
+ this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
53452
53610
  this.bindSelfEvent();
53453
53611
  }, 0));
53454
53612
  }
@@ -53750,25 +53908,15 @@
53750
53908
  } catch (error) {}
53751
53909
  }
53752
53910
  handleCut(e) {
53753
- var _a;
53754
53911
  return __awaiter$1(this, void 0, void 0, function* () {
53755
- this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.cutRanges = null === (_a = this.table.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.map(r => ({
53756
- start: {
53757
- col: r.start.col,
53758
- row: r.start.row
53759
- },
53760
- end: {
53761
- col: r.end.col,
53762
- row: r.end.row
53763
- }
53764
- })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
53765
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
53912
+ this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
53913
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
53766
53914
  }, 3e4), this.saveClipboardContent();
53767
53915
  });
53768
53916
  }
53769
53917
  handlePaste(e) {
53770
53918
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
53771
- this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
53919
+ this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
53772
53920
  }).catch(() => {
53773
53921
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
53774
53922
  }) : this.executePaste(e);
@@ -53845,9 +53993,9 @@
53845
53993
  }
53846
53994
  clearCutArea(table) {
53847
53995
  try {
53848
- const ranges = this.cutRanges;
53849
- if (!ranges || 0 === ranges.length) return;
53850
- table.changeCellValuesByIds(ranges, "");
53996
+ const selectCells = this.cutCellRange;
53997
+ if (!selectCells || 0 === selectCells.length) return;
53998
+ 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);
53851
53999
  } catch (error) {}
53852
54000
  }
53853
54001
  checkClipboardChanged() {
@@ -55785,15 +55933,6 @@
55785
55933
  constructor(table, customCellStyle, customCellStyleArrangement) {
55786
55934
  this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
55787
55935
  }
55788
- clearCustomCellStyleArrangement() {
55789
- this.customCellStyleArrangement = [];
55790
- }
55791
- addCustomCellStyleArrangement(cellPosition, customStyleId) {
55792
- this.customCellStyleArrangement.push({
55793
- cellPosition: cellPosition,
55794
- customStyleId: customStyleId
55795
- });
55796
- }
55797
55936
  getCustomCellStyle(col, row) {
55798
55937
  const customStyleIds = this.getCustomCellStyleIds(col, row);
55799
55938
  if (customStyleIds.length) {
@@ -56099,7 +56238,7 @@
56099
56238
  }
56100
56239
  constructor(container, options = {}) {
56101
56240
  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;
56102
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.5", 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");
56241
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.6", 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");
56103
56242
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
56104
56243
  options: options,
56105
56244
  container: container
@@ -59874,16 +60013,15 @@
59874
60013
  step((generator = generator.apply(thisArg, _arguments || [])).next());
59875
60014
  });
59876
60015
  };
59877
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
60016
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
59878
60017
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
59879
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
59880
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60018
+ const recordIndex = table.getRecordShowIndexByCell(col, row),
59881
60019
  {
59882
60020
  field: field
59883
60021
  } = table.internalProps.layoutMap.getBody(col, row),
59884
60022
  beforeChangeValue = table.getCellRawValue(col, row),
59885
60023
  oldValue = table.getCellOriginValue(col, row);
59886
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
60024
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
59887
60025
  const range = table.getCellRange(col, row),
59888
60026
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
59889
60027
  if (aggregators) {
@@ -59906,24 +60044,16 @@
59906
60044
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
59907
60045
  }
59908
60046
  const changedValue = table.getCellOriginValue(col, row);
59909
- if (oldValue !== changedValue && triggerEvent) {
59910
- const changeValue = {
59911
- col: col,
59912
- row: row,
59913
- recordIndex: recordIndex,
59914
- field: field,
59915
- rawValue: beforeChangeValue,
59916
- currentValue: oldValue,
59917
- changedValue: changedValue
59918
- };
59919
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
59920
- values: [changeValue]
59921
- });
59922
- }
59923
- table.scenegraph.updateNextFrame();
60047
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
60048
+ col: col,
60049
+ row: row,
60050
+ rawValue: beforeChangeValue,
60051
+ currentValue: oldValue,
60052
+ changedValue: changedValue
60053
+ }), table.scenegraph.updateNextFrame();
59924
60054
  }
59925
60055
  }
59926
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
60056
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
59927
60057
  var _a, _b;
59928
60058
  return __awaiter(this, void 0, void 0, function* () {
59929
60059
  const changedCellResults = [];
@@ -59945,7 +60075,6 @@
59945
60075
  oldRowValues.push(oldValue);
59946
60076
  }
59947
60077
  }
59948
- const resultChangeValues = [];
59949
60078
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
59950
60079
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
59951
60080
  const rowValues = values[i];
@@ -59969,34 +60098,25 @@
59969
60098
  if (isCanChange) {
59970
60099
  changedCellResults[i][j] = !0;
59971
60100
  const value = rowValues[j],
59972
- recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
59973
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60101
+ recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
59974
60102
  {
59975
60103
  field: field
59976
60104
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
59977
60105
  beforeChangeValue = beforeChangeValues[i][j],
59978
60106
  oldValue = oldValues[i][j];
59979
- 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);
60107
+ 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);
59980
60108
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
59981
- if (oldValue !== changedValue && triggerEvent) {
59982
- const changeValue = {
59983
- col: startCol + j,
59984
- row: startRow + i,
59985
- recordIndex: recordIndex,
59986
- field: field,
59987
- rawValue: beforeChangeValue,
59988
- currentValue: oldValue,
59989
- changedValue: changedValue
59990
- };
59991
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
59992
- }
60109
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
60110
+ col: startCol + j,
60111
+ row: startRow + i,
60112
+ rawValue: beforeChangeValue,
60113
+ currentValue: oldValue,
60114
+ changedValue: changedValue
60115
+ });
59993
60116
  } else changedCellResults[i][j] = !1;
59994
60117
  }
59995
60118
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
59996
60119
  }
59997
- silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
59998
- values: resultChangeValues
59999
- });
60000
60120
  const startRange = table.getCellRange(startCol, startRow),
60001
60121
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
60002
60122
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -60030,58 +60150,6 @@
60030
60150
  return table.scenegraph.updateNextFrame(), changedCellResults;
60031
60151
  });
60032
60152
  }
60033
- function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
60034
- var _a, _b;
60035
- return __awaiter(this, void 0, void 0, function* () {
60036
- const resultChangeValues = [],
60037
- processed = new Set(),
60038
- nextValue = null != value ? value : "";
60039
- for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
60040
- const range = ranges[i],
60041
- startCol = Math.min(range.start.col, range.end.col),
60042
- endCol = Math.max(range.start.col, range.end.col),
60043
- startRow = Math.min(range.start.row, range.end.row),
60044
- endRow = Math.max(range.start.row, range.end.row);
60045
- if (startCol > endCol || startRow > endRow) continue;
60046
- const values = [],
60047
- oldValues = [];
60048
- for (let row = startRow; row <= endRow; row++) {
60049
- const rowValues = [],
60050
- rowOldValues = [];
60051
- for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
60052
- values.push(rowValues), oldValues.push(rowOldValues);
60053
- }
60054
- const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
60055
- for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
60056
- const col = startCol + c,
60057
- row = startRow + r,
60058
- key = `${col},${row}`;
60059
- if (processed.has(key)) continue;
60060
- if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
60061
- const oldValue = oldValues[r][c],
60062
- changedValue = table.getCellOriginValue(col, row);
60063
- if (oldValue === changedValue) continue;
60064
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
60065
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60066
- {
60067
- field: field
60068
- } = table.internalProps.layoutMap.getBody(col, row);
60069
- resultChangeValues.push({
60070
- col: col,
60071
- row: row,
60072
- recordIndex: recordIndex,
60073
- field: field,
60074
- rawValue: oldValue,
60075
- currentValue: oldValue,
60076
- changedValue: changedValue
60077
- });
60078
- }
60079
- }
60080
- !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
60081
- values: resultChangeValues
60082
- });
60083
- });
60084
- }
60085
60153
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
60086
60154
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
60087
60155
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -61245,165 +61313,43 @@
61245
61313
  }
61246
61314
  return isValid$1(editorDefine);
61247
61315
  }
61248
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61249
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61250
- }
61251
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61252
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61253
- }
61254
- changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61255
- return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61256
- }
61257
- changeSourceCellValue(recordIndex, field, value) {
61258
- const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
61259
- cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
61260
- if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
61261
- this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
61262
- const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
61263
- oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
61264
- changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
61265
- if (oldValue !== changedValue) {
61266
- const changeValue = {
61267
- col: cellAddr.col,
61268
- row: cellAddr.row,
61269
- recordIndex: recordIndex,
61270
- field: field,
61271
- rawValue: beforeChangeValue,
61272
- currentValue: oldValue,
61273
- changedValue: changedValue
61274
- };
61275
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61276
- values: [changeValue]
61277
- });
61278
- }
61316
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
61317
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
61279
61318
  }
61280
- changeCellValueByRecord(recordIndex, field, value, options) {
61281
- var _a, _b, _c, _d, _e;
61282
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
61283
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
61284
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
61285
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
61286
- let record, oldValue;
61287
- if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), !triggerEvent) return;
61288
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
61289
- if (oldValue !== changedValue) {
61290
- const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
61291
- changeValue = {
61292
- col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
61293
- row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
61294
- recordIndex: recordIndex,
61295
- field: field,
61296
- rawValue: oldValue,
61297
- currentValue: oldValue,
61298
- changedValue: changedValue
61299
- };
61300
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61301
- values: [changeValue]
61302
- });
61303
- }
61304
- autoRefresh && this.refreshAfterSourceChange();
61319
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
61320
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
61305
61321
  }
61306
- changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
61307
- return this.changeCellValueByRecord(recordIndex, field, value, {
61308
- triggerEvent: triggerEvent,
61309
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
61310
- autoRefresh: !0
61311
- });
61312
- }
61313
- changeCellValuesByRecords(changeValues, options) {
61314
- var _a, _b, _c, _d, _e, _f, _g;
61315
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
61316
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
61317
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
61318
- resultChangeValues = [];
61319
- for (let i = 0; i < changeValues.length; i++) {
61320
- const {
61321
- recordIndex: recordIndex,
61322
- field: field,
61323
- value: value
61324
- } = changeValues[i],
61325
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
61326
- let record, oldValue;
61327
- if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), triggerEvent) {
61328
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
61329
- if (oldValue !== changedValue) {
61330
- const changeValue = {
61331
- col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
61332
- row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
61333
- recordIndex: recordIndex,
61334
- field: field,
61335
- rawValue: oldValue,
61336
- currentValue: oldValue,
61337
- changedValue: changedValue
61338
- };
61339
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
61340
- }
61341
- }
61342
- }
61343
- !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61344
- values: resultChangeValues
61345
- }), autoRefresh && this.refreshAfterSourceChange();
61346
- }
61347
- changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
61348
- return this.changeCellValuesByRecords(changeValues, {
61349
- triggerEvent: triggerEvent,
61350
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
61351
- autoRefresh: !0
61352
- });
61353
- }
61354
- refreshAfterSourceChange(options) {
61355
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
61356
- const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
61357
- reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
61358
- clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
61359
- this.scenegraph.clearCells(), this.sortState && reapplySort && (null === (_e = (_d = this.dataSource).clearSortedIndexMap) || void 0 === _e || _e.call(_d), null === (_g = null === (_f = this.dataSource.sortedIndexMap) || void 0 === _f ? void 0 : _f.clear) || void 0 === _g || _g.call(_f)), reapplyFilter ? this.sortState && reapplySort ? (this.dataSource.updateFilterRulesForSorted(null === (_h = this.dataSource.dataConfig) || void 0 === _h ? void 0 : _h.filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(null === (_j = this.dataSource.dataConfig) || void 0 === _j ? void 0 : _j.filterRules) : this.sortState && reapplySort && sortRecords(this);
61360
- const traverseColumns = columns => {
61361
- var _a, _b, _c, _d;
61362
- for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
61363
- const column = columns[i],
61364
- aggregators = null == column ? void 0 : column.vtable_aggregator;
61365
- if (aggregators) if (Array.isArray(aggregators)) for (let j = 0; j < aggregators.length; j++) null === (_c = null === (_b = aggregators[j]) || void 0 === _b ? void 0 : _b.recalculate) || void 0 === _c || _c.call(_b);else null === (_d = null == aggregators ? void 0 : aggregators.recalculate) || void 0 === _d || _d.call(aggregators);
61366
- (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
61367
- }
61368
- };
61369
- traverseColumns(this.internalProps.columns), this.refreshRowColCount(), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!clearRowHeightCache), null === (_k = this.internalProps.emptyTip) || void 0 === _k || _k.resetVisible(), this.resize();
61370
- }
61371
- addRecord(record, recordIndex, triggerEvent = !0) {
61322
+ addRecord(record, recordIndex) {
61372
61323
  var _a;
61373
61324
  const success = listTableAddRecord(record, recordIndex, this);
61374
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61325
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61375
61326
  records: [record],
61376
61327
  recordIndex: recordIndex,
61377
61328
  recordCount: 1
61378
61329
  });
61379
61330
  }
61380
- addRecords(records, recordIndex, triggerEvent = !0) {
61331
+ addRecords(records, recordIndex) {
61381
61332
  var _a;
61382
61333
  const success = listTableAddRecords(records, recordIndex, this);
61383
- "number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61334
+ "number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61384
61335
  records: records,
61385
61336
  recordIndex: recordIndex,
61386
61337
  recordCount: records.length
61387
61338
  });
61388
61339
  }
61389
- deleteRecords(recordIndexs, triggerEvent = !0) {
61340
+ deleteRecords(recordIndexs) {
61390
61341
  var _a;
61391
- const deletedRecords = [];
61392
- (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
61393
- let record = null;
61394
- record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
61395
- }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61342
+ listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61396
61343
  const rowIndexs = [];
61397
61344
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
61398
- triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61345
+ this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61399
61346
  recordIndexs: recordIndexs,
61400
- records: deletedRecords,
61401
61347
  rowIndexs: rowIndexs,
61402
61348
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
61403
61349
  });
61404
61350
  }
61405
- updateRecords(records, recordIndexs, triggerEvent = !0) {
61406
- listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
61351
+ updateRecords(records, recordIndexs) {
61352
+ listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
61407
61353
  records: records,
61408
61354
  recordIndexs: recordIndexs,
61409
61355
  updateCount: records.length