@visactor/vtable-gantt 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.
@@ -38455,6 +38455,24 @@
38455
38455
  }, delay));
38456
38456
  };
38457
38457
  }
38458
+ function cancellableThrottle(func, delay) {
38459
+ let timer = null,
38460
+ lastArgs = null,
38461
+ context = null;
38462
+ return {
38463
+ throttled: function (...args) {
38464
+ lastArgs = args, context = this, timer || (timer = setTimeout(() => {
38465
+ lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
38466
+ }, delay));
38467
+ },
38468
+ cancel: () => {
38469
+ timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
38470
+ },
38471
+ flush: () => {
38472
+ timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
38473
+ }
38474
+ };
38475
+ }
38458
38476
  function pad(num, totalChars) {
38459
38477
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
38460
38478
  return num;
@@ -38718,7 +38736,6 @@
38718
38736
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
38719
38737
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
38720
38738
  CHANGE_CELL_VALUE: "change_cell_value",
38721
- CHANGE_CELL_VALUES: "change_cell_values",
38722
38739
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
38723
38740
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
38724
38741
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -39739,6 +39756,9 @@
39739
39756
  var _a;
39740
39757
  return null !== (_a = defaultStyle.textAlign) && void 0 !== _a ? _a : "left";
39741
39758
  },
39759
+ get textStickBaseOnAlign() {
39760
+ return defaultStyle.textStickBaseOnAlign;
39761
+ },
39742
39762
  get textBaseline() {
39743
39763
  var _a;
39744
39764
  return null !== (_a = defaultStyle.textBaseline) && void 0 !== _a ? _a : "middle";
@@ -40422,6 +40442,9 @@
40422
40442
  get textStick() {
40423
40443
  return style.textStick;
40424
40444
  },
40445
+ get textStickBaseOnAlign() {
40446
+ return style.textStickBaseOnAlign;
40447
+ },
40425
40448
  get marked() {
40426
40449
  return style.marked;
40427
40450
  },
@@ -40845,24 +40868,6 @@
40845
40868
  }
40846
40869
  }
40847
40870
  }
40848
- changeFieldValueByRecordIndex(value, recordIndex, field, table) {
40849
- var _a, _b, _c, _d;
40850
- if (null === field) return;
40851
- if (null == recordIndex) return;
40852
- const rawKey = recordIndex.toString();
40853
- if (!this.beforeChangedRecordsMap.has(rawKey)) {
40854
- const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
40855
- originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40856
- this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
40857
- }
40858
- if ("string" == typeof field || "number" == typeof field) {
40859
- const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
40860
- rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
40861
- record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40862
- let formatValue = value;
40863
- "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);
40864
- }
40865
- }
40866
40871
  cacheBeforeChangedRecord(dataIndex, table) {
40867
40872
  var _a;
40868
40873
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -40928,16 +40933,9 @@
40928
40933
  }
40929
40934
  }
40930
40935
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
40931
- const delta = "add" === type ? insertCount : -insertCount,
40932
- numericKeys = [];
40933
- this.beforeChangedRecordsMap.forEach((_, key) => {
40934
- const numKey = Number(key);
40935
- Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
40936
- }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
40937
- for (let i = 0; i < numericKeys.length; i++) {
40938
- const key = numericKeys[i],
40939
- record = this.beforeChangedRecordsMap.get(key.toString());
40940
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
40936
+ for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
40937
+ const record = this.beforeChangedRecordsMap.get(key.toString());
40938
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
40941
40939
  }
40942
40940
  }
40943
40941
  deleteRecords(recordIndexs) {
@@ -47614,11 +47612,35 @@
47614
47612
  return hoverMode;
47615
47613
  }
47616
47614
 
47615
+ let brushingChartInstance,
47616
+ brushingChartInstanceCellPos = {
47617
+ col: -1,
47618
+ row: -1
47619
+ };
47620
+ function setBrushingChartInstance(chartInstance, col, row) {
47621
+ brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
47622
+ col: col,
47623
+ row: row
47624
+ };
47625
+ }
47626
+ function clearBrushingChartInstance() {
47627
+ brushingChartInstance = void 0, brushingChartInstanceCellPos = {
47628
+ col: -1,
47629
+ row: -1
47630
+ };
47631
+ }
47632
+ function getBrushingChartInstance() {
47633
+ return brushingChartInstance;
47634
+ }
47635
+ function getBrushingChartInstanceCellPos() {
47636
+ return brushingChartInstanceCellPos;
47637
+ }
47617
47638
  const chartInstanceListColumnByColumnDirection = {};
47618
47639
  const chartInstanceListRowByRowDirection = {};
47640
+ const delayRunDimensionHoverTimer = [];
47619
47641
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47620
47642
  var _a;
47621
- isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47643
+ clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47622
47644
  const {
47623
47645
  rowStart: rowStart
47624
47646
  } = table.getBodyVisibleRowRange();
@@ -47627,76 +47649,40 @@
47627
47649
  for (let i = rowStart; i <= rowEnd; i++) {
47628
47650
  const cellGroup = table.scenegraph.getCell(col, i),
47629
47651
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47630
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
47631
- var _a, _b, _c, _d, _e, _f;
47652
+ chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
47653
+ const timer = setTimeout(() => {
47654
+ var _a, _b, _c, _d;
47632
47655
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47633
47656
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47634
47657
  let isShowTooltip = !isScatter;
47635
- if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
47636
- const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
47637
- {
47638
- rowEnd: rowEnd1
47639
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47640
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47641
- const {
47642
- rowEnd: rowEnd2
47643
- } = table.getBodyVisibleRowRange(0, 5);
47644
- isShowTooltip = rowEnd2 !== rowEnd;
47645
- }
47646
- } else if (i === rowStart && isShowTooltip) {
47647
- const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
47648
- {
47649
- rowStart: rowStart1
47650
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47651
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
47652
- const {
47653
- rowStart: rowStart2
47654
- } = table.getBodyVisibleRowRange(0, -5);
47655
- isShowTooltip = rowStart2 !== rowStart;
47656
- }
47657
- }
47658
- 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 {
47659
- const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47658
+ 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 {
47659
+ const cellBoundry = table.getCellRelativeRect(col, i),
47660
+ bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47660
47661
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
47661
47662
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47662
47663
  tooltip: !1,
47663
47664
  showTooltipOption: {
47664
- x: canvasXY.x,
47665
- y: absolutePositionTop,
47665
+ x: canvasXY.x - cellBoundry.left,
47666
+ y: absolutePositionTop - cellBoundry.top,
47666
47667
  activeType: "dimension"
47667
47668
  }
47668
47669
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47669
47670
  tooltip: isShowTooltip,
47670
47671
  showTooltipOption: {
47671
- x: canvasXY.x,
47672
- y: absolutePositionTop,
47672
+ x: canvasXY.x - cellBoundry.left,
47673
+ y: absolutePositionTop - cellBoundry.top,
47673
47674
  activeType: "dimension"
47674
47675
  }
47675
47676
  });
47676
47677
  }
47677
47678
  }
47678
- }, 0), table.scenegraph.updateNextFrame();
47679
- }
47680
- }
47681
- function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
47682
- var _a;
47683
- if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
47684
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
47685
- if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
47686
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
47687
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47688
- chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
47689
- releaseChartInstance: !0,
47690
- releaseColumnChartInstance: !1,
47691
- releaseRowChartInstance: !1
47692
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
47693
- }
47694
- delete chartInstanceListColumnByColumnDirection[col];
47679
+ }, 0);
47680
+ delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47695
47681
  }
47696
47682
  }
47697
47683
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47698
47684
  var _a;
47699
- isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47685
+ clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47700
47686
  const {
47701
47687
  colStart: colStart
47702
47688
  } = table.getBodyVisibleColRange();
@@ -47705,64 +47691,162 @@
47705
47691
  for (let i = colStart; i <= colEnd; i++) {
47706
47692
  const cellGroup = table.scenegraph.getCell(i, row),
47707
47693
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47708
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
47694
+ chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
47695
+ const timer = setTimeout(() => {
47709
47696
  var _a, _b, _c, _d;
47710
47697
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
47711
47698
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47712
47699
  let isShowTooltip = !isScatter;
47713
- if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
47714
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47715
- {
47716
- colEnd: colEnd1
47717
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47718
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
47719
- const {
47720
- colEnd: colEnd2
47721
- } = table.getBodyVisibleColRange(0, 5);
47722
- isShowTooltip = colEnd2 !== colEnd;
47723
- }
47724
- } else if (i === colStart && isShowTooltip) {
47725
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47726
- {
47727
- colStart: colStart1
47728
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47729
- if (colStart1 === colStart) isShowTooltip = !0;else {
47730
- const {
47731
- colStart: colStart2
47732
- } = table.getBodyVisibleColRange(0, -5);
47733
- isShowTooltip = colStart2 !== colStart;
47734
- }
47735
- }
47736
- 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 {
47737
- const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47700
+ 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 {
47701
+ const cellBoundry = table.getCellRelativeRect(i, row),
47702
+ bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47738
47703
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
47739
47704
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47740
47705
  tooltip: !1,
47741
47706
  showTooltipOption: {
47742
- x: absolutePositionLeft,
47743
- y: canvasXY.y,
47707
+ x: absolutePositionLeft - cellBoundry.left,
47708
+ y: canvasXY.y - cellBoundry.top,
47744
47709
  activeType: "dimension"
47745
47710
  }
47746
47711
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47747
47712
  tooltip: isShowTooltip,
47748
47713
  showTooltipOption: {
47749
- x: absolutePositionLeft,
47750
- y: canvasXY.y,
47714
+ x: absolutePositionLeft - cellBoundry.left,
47715
+ y: canvasXY.y - cellBoundry.top,
47751
47716
  activeType: "dimension"
47752
47717
  }
47753
47718
  });
47754
47719
  }
47755
47720
  }
47756
- }, 0), table.scenegraph.updateNextFrame();
47721
+ }, 0);
47722
+ delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47723
+ }
47724
+ }
47725
+ function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
47726
+ var _a;
47727
+ clearDelayRunDimensionHoverTimers();
47728
+ const {
47729
+ rowStart: rowStart
47730
+ } = table.getBodyVisibleRowRange();
47731
+ let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47732
+ rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47733
+ const {
47734
+ colStart: colStart
47735
+ } = table.getBodyVisibleColRange();
47736
+ let colEnd = table.getBodyVisibleColRange().colEnd;
47737
+ colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47738
+ for (let col = colStart; col <= colEnd; col++) {
47739
+ isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47740
+ for (let i = rowStart; i <= rowEnd; i++) {
47741
+ const cellGroup = table.scenegraph.getCell(col, i),
47742
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47743
+ 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));
47744
+ const timer = setTimeout(() => {
47745
+ var _a, _b;
47746
+ if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47747
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
47748
+ let isShowTooltip = !0;
47749
+ "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, {
47750
+ activeType: "mark"
47751
+ })));
47752
+ }
47753
+ }, 0);
47754
+ delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47755
+ }
47756
+ }
47757
+ }
47758
+ function checkIsShowTooltipForEdgeRow(row, table) {
47759
+ var _a, _b;
47760
+ let isShowTooltip = !0;
47761
+ const {
47762
+ rowStart: rowStart
47763
+ } = table.getBodyVisibleRowRange();
47764
+ let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47765
+ rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47766
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
47767
+ if (row === rowEnd && isShowTooltip) {
47768
+ const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
47769
+ {
47770
+ rowEnd: rowEnd1
47771
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47772
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47773
+ const {
47774
+ rowEnd: rowEnd2
47775
+ } = table.getBodyVisibleRowRange(0, 5);
47776
+ isShowTooltip = rowEnd2 !== rowEnd;
47777
+ }
47778
+ } else if (row === rowStart && isShowTooltip) {
47779
+ const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
47780
+ {
47781
+ rowStart: rowStart1
47782
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47783
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
47784
+ const {
47785
+ rowStart: rowStart2
47786
+ } = table.getBodyVisibleRowRange(0, -5);
47787
+ isShowTooltip = rowStart2 !== rowStart;
47788
+ }
47789
+ }
47790
+ return isShowTooltip;
47791
+ }
47792
+ function checkIsShowTooltipForEdgeColumn(col, table) {
47793
+ let isShowTooltip = !0;
47794
+ const {
47795
+ colStart: colStart
47796
+ } = table.getBodyVisibleColRange();
47797
+ let colEnd = table.getBodyVisibleColRange().colEnd;
47798
+ colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47799
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
47800
+ if (col === colEnd && isShowTooltip) {
47801
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47802
+ {
47803
+ colEnd: colEnd1
47804
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47805
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
47806
+ const {
47807
+ colEnd: colEnd2
47808
+ } = table.getBodyVisibleColRange(0, 5);
47809
+ isShowTooltip = colEnd2 !== colEnd;
47810
+ }
47811
+ } else if (col === colStart && isShowTooltip) {
47812
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47813
+ {
47814
+ colStart: colStart1
47815
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47816
+ if (colStart1 === colStart) isShowTooltip = !0;else {
47817
+ const {
47818
+ colStart: colStart2
47819
+ } = table.getBodyVisibleColRange(0, -5);
47820
+ isShowTooltip = colStart2 !== colStart;
47821
+ }
47822
+ }
47823
+ return isShowTooltip;
47824
+ }
47825
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
47826
+ var _a;
47827
+ if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
47828
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
47829
+ if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
47830
+ const cellGroup = table.scenegraph.getCell(col, Number(i)),
47831
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47832
+ isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47833
+ forceRelease: forceRelease,
47834
+ releaseChartInstance: !0,
47835
+ releaseColumnChartInstance: !1,
47836
+ releaseRowChartInstance: !1
47837
+ }), chartInstanceListColumnByColumnDirection[col][i] = null);
47838
+ }
47839
+ delete chartInstanceListColumnByColumnDirection[col];
47757
47840
  }
47758
47841
  }
47759
- function clearChartInstanceListByRowDirection(row, excludedCol, table) {
47842
+ function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
47760
47843
  var _a;
47761
47844
  if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
47762
47845
  if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
47763
47846
  const cellGroup = table.scenegraph.getCell(Number(i), row),
47764
47847
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47765
- chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
47848
+ isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47849
+ forceRelease: forceRelease,
47766
47850
  releaseChartInstance: !0,
47767
47851
  releaseColumnChartInstance: !1,
47768
47852
  releaseRowChartInstance: !1
@@ -47770,6 +47854,15 @@
47770
47854
  }
47771
47855
  delete chartInstanceListRowByRowDirection[row];
47772
47856
  }
47857
+ function clearDelayRunDimensionHoverTimers() {
47858
+ for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
47859
+ delayRunDimensionHoverTimer.length = 0;
47860
+ }
47861
+ function clearAllChartInstanceList(table, forceRelease = !1) {
47862
+ clearDelayRunDimensionHoverTimers();
47863
+ for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
47864
+ for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
47865
+ }
47773
47866
 
47774
47867
  function isValidAlignDomain(domain) {
47775
47868
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -48403,7 +48496,7 @@
48403
48496
  const CHART_NUMBER_TYPE = genNumberType();
48404
48497
  class Chart extends Rect$2 {
48405
48498
  constructor(isShareChartSpec, params) {
48406
- 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 {
48499
+ 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 {
48407
48500
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
48408
48501
  renderCanvas: params.canvas,
48409
48502
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -48424,7 +48517,7 @@
48424
48517
  }
48425
48518
  }
48426
48519
  activate(table) {
48427
- var _a, _b, _c, _d, _e;
48520
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48428
48521
  if (this.activeChartInstance) return;
48429
48522
  const {
48430
48523
  col: col,
@@ -48443,7 +48536,7 @@
48443
48536
  y1: y1 - table.scrollTop,
48444
48537
  y2: y2 - table.scrollTop
48445
48538
  });
48446
- 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, {
48539
+ this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
48447
48540
  renderCanvas: this.attribute.canvas,
48448
48541
  mode: "desktop-browser",
48449
48542
  canvasControled: !1,
@@ -48477,7 +48570,7 @@
48477
48570
  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());
48478
48571
  }
48479
48572
  },
48480
- componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
48573
+ componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
48481
48574
  tooltip: {
48482
48575
  dimension: !1,
48483
48576
  mark: !0
@@ -48488,15 +48581,40 @@
48488
48581
  const chartStage = this.activeChartInstance.getStage(),
48489
48582
  matrix = this.globalTransMatrix.clone(),
48490
48583
  stageMatrix = this.stage.window.getViewBoxTransform();
48584
+ let brushChangeThrottle;
48491
48585
  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 => {
48492
48586
  var _a;
48493
- !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);
48587
+ !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");
48588
+ }), (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 => {
48589
+ var _a;
48590
+ brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
48591
+ })), this.activeChartInstance.on("brushStart", params => {
48592
+ const brushingChartInstance = getBrushingChartInstance();
48593
+ brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
48494
48594
  }), this.activeChartInstance.on("brushEnd", params => {
48495
48595
  var _a;
48496
- table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
48596
+ 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(() => {
48497
48597
  Chart.temp = 1;
48498
48598
  }, 0);
48499
- }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
48599
+ }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
48600
+ markName: "pie"
48601
+ }, params => {
48602
+ var _a;
48603
+ const categoryField = this.attribute.spec.categoryField,
48604
+ datum = {
48605
+ [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48606
+ };
48607
+ generateChartInstanceListByViewRange(datum, table, !1);
48608
+ }), this.activeChartInstance.on("pointerout", {
48609
+ markName: "pie"
48610
+ }, params => {
48611
+ var _a;
48612
+ const categoryField = this.attribute.spec.categoryField,
48613
+ datum = {
48614
+ [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48615
+ };
48616
+ generateChartInstanceListByViewRange(datum, table, !0);
48617
+ })), this.activeChartInstance.on("dimensionHover", params => {
48500
48618
  var _a, _b;
48501
48619
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
48502
48620
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
@@ -48559,21 +48677,23 @@
48559
48677
  }
48560
48678
  }
48561
48679
  }
48562
- }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
48680
+ })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance);
48563
48681
  }
48564
48682
  deactivate(table, {
48683
+ forceRelease = !1,
48565
48684
  releaseChartInstance = !0,
48566
48685
  releaseColumnChartInstance = !0,
48567
- releaseRowChartInstance = !0
48686
+ releaseRowChartInstance = !0,
48687
+ releaseAllChartInstance = !1
48568
48688
  } = {}) {
48569
48689
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48570
48690
  if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
48571
- null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48691
+ !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48572
48692
  x1: -1e3,
48573
48693
  x2: -800,
48574
48694
  y1: -1e3,
48575
48695
  y2: -800
48576
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
48696
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
48577
48697
  const {
48578
48698
  col: col,
48579
48699
  row: row
@@ -48586,7 +48706,7 @@
48586
48706
  } = this.parent;
48587
48707
  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));
48588
48708
  }
48589
- 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);
48709
+ 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));
48590
48710
  }
48591
48711
  updateData(data) {
48592
48712
  this.attribute.data = data;
@@ -48601,13 +48721,14 @@
48601
48721
  y1: y1,
48602
48722
  x2: x2,
48603
48723
  y2: y2
48604
- } = cellGroup.globalAABBBounds;
48605
- return {
48606
- 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)),
48607
- 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)),
48608
- 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)),
48609
- 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))
48610
- };
48724
+ } = cellGroup.globalAABBBounds,
48725
+ viewBox = {
48726
+ 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)),
48727
+ 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)),
48728
+ 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)),
48729
+ 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))
48730
+ };
48731
+ return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
48611
48732
  }
48612
48733
  }
48613
48734
  function getTableBounds(col, row, table) {
@@ -48822,7 +48943,7 @@
48822
48943
  {
48823
48944
  width = groupAttribute.width,
48824
48945
  height = groupAttribute.height
48825
- } = (chart.getViewBox(), chart.attribute),
48946
+ } = chart.attribute,
48826
48947
  {
48827
48948
  table: table
48828
48949
  } = chart.getRootNode(),
@@ -48850,8 +48971,9 @@
48850
48971
  });
48851
48972
  }
48852
48973
  }
48853
- const viewBox = chart.getViewBox();
48854
- activeChartInstance.updateViewBox({
48974
+ const lastViewBox = chart.activeChartInstanceLastViewBox,
48975
+ viewBox = chart.getViewBox();
48976
+ lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
48855
48977
  x1: 0,
48856
48978
  x2: viewBox.x2 - viewBox.x1,
48857
48979
  y1: 0,
@@ -52369,9 +52491,10 @@
52369
52491
  });
52370
52492
  }
52371
52493
  }
52372
- function updateChartState(scenegraph, datum) {
52494
+ function updateChartState(scenegraph, datum, selectedDataMode) {
52373
52495
  const table = scenegraph.table;
52374
52496
  if (table.isPivotChart()) {
52497
+ table._selectedDataMode = selectedDataMode;
52375
52498
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
52376
52499
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
52377
52500
  const newSelectedDataItemsInChart = [];
@@ -53119,16 +53242,36 @@
53119
53242
  resetResidentHoverIcon(col, row) {
53120
53243
  resetResidentHoverIcon(col, row, this);
53121
53244
  }
53122
- deactivateChart(col, row) {
53123
- var _a, _b, _c;
53124
- if (-1 === col || -1 === row) return;
53245
+ deactivateChart(col, row, forceRelease = !1) {
53246
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53247
+ if (-1 === col || -1 === row) {
53248
+ if (forceRelease) {
53249
+ const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
53250
+ cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
53251
+ (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, {
53252
+ forceRelease: !0,
53253
+ releaseChartInstance: !0,
53254
+ releaseColumnChartInstance: !0,
53255
+ releaseRowChartInstance: !0,
53256
+ releaseAllChartInstance: !0
53257
+ }));
53258
+ }
53259
+ return;
53260
+ }
53125
53261
  const cellGroup = this.getCell(col, row);
53126
- if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
53262
+ if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
53263
+ 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, {
53264
+ forceRelease: !0,
53265
+ releaseChartInstance: !0,
53266
+ releaseColumnChartInstance: !0,
53267
+ releaseRowChartInstance: !0,
53268
+ releaseAllChartInstance: !0
53269
+ }));
53127
53270
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
53128
- 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 ? {
53129
- 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,
53130
- 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,
53131
- 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
53271
+ 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) ? {
53272
+ 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),
53273
+ 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),
53274
+ 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)
53132
53275
  } : void 0);
53133
53276
  }
53134
53277
  }
@@ -53176,8 +53319,15 @@
53176
53319
  updateChartSizeForResizeRowHeight(row) {
53177
53320
  updateChartSizeForResizeRowHeight(this, row);
53178
53321
  }
53179
- updateChartState(datum) {
53180
- this.table.isPivotChart() && updateChartState(this, datum);
53322
+ updateChartState(datum, selectedDataMode) {
53323
+ var _a, _b;
53324
+ if (this.table.isPivotChart()) {
53325
+ if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
53326
+ const brushingChartInstance = getBrushingChartInstance();
53327
+ 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);
53328
+ }
53329
+ updateChartState(this, datum, selectedDataMode);
53330
+ }
53181
53331
  }
53182
53332
  updateCheckboxCellState(col, row, checked) {
53183
53333
  var _a, _b;
@@ -56204,7 +56354,7 @@
56204
56354
  }, 0 !== e.button) return;
56205
56355
  const eventArgsSet = getCellEventArgsSet(e);
56206
56356
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
56207
- 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;
56357
+ 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;
56208
56358
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
56209
56359
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
56210
56360
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -56232,7 +56382,7 @@
56232
56382
  }
56233
56383
  eventManager.dealTableHover(eventArgsSet);
56234
56384
  } else {
56235
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
56385
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), void stateManager.updateInteractionState(InteractionState.grabing);
56236
56386
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56237
56387
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56238
56388
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -56384,7 +56534,7 @@
56384
56534
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
56385
56535
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
56386
56536
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
56387
- table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
56537
+ table.scenegraph.updateChartState(null, void 0), stateManager.updateInteractionState(InteractionState.grabing);
56388
56538
  const {
56389
56539
  eventArgs: eventArgs
56390
56540
  } = eventArgsSet;
@@ -56403,7 +56553,7 @@
56403
56553
  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 {
56404
56554
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
56405
56555
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
56406
- (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);
56556
+ (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);
56407
56557
  }
56408
56558
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
56409
56559
  var _a, _b, _c;
@@ -56521,7 +56671,15 @@
56521
56671
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
56522
56672
  }), table.scenegraph.stage.addEventListener("wheel", e => {
56523
56673
  var _a;
56524
- e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
56674
+ if (!e.path.find(node => "legend" === node.name)) {
56675
+ null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
56676
+ const {
56677
+ cellPos: cellPos
56678
+ } = table.stateManager.hover,
56679
+ prevHoverCellCol = cellPos.col,
56680
+ prevHoverCellRow = cellPos.row;
56681
+ table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
56682
+ }
56525
56683
  });
56526
56684
  }
56527
56685
  function bindGesture(eventManager) {
@@ -57301,7 +57459,7 @@
57301
57459
  };
57302
57460
  let EventManager$1 = class EventManager {
57303
57461
  constructor(table) {
57304
- 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(() => {
57462
+ 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(() => {
57305
57463
  this.bindSelfEvent();
57306
57464
  }, 0));
57307
57465
  }
@@ -57603,25 +57761,15 @@
57603
57761
  } catch (error) {}
57604
57762
  }
57605
57763
  handleCut(e) {
57606
- var _a;
57607
57764
  return __awaiter$1(this, void 0, void 0, function* () {
57608
- 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 => ({
57609
- start: {
57610
- col: r.start.col,
57611
- row: r.start.row
57612
- },
57613
- end: {
57614
- col: r.end.col,
57615
- row: r.end.row
57616
- }
57617
- })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57618
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
57765
+ this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57766
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
57619
57767
  }, 3e4), this.saveClipboardContent();
57620
57768
  });
57621
57769
  }
57622
57770
  handlePaste(e) {
57623
57771
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
57624
- 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));
57772
+ this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57625
57773
  }).catch(() => {
57626
57774
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57627
57775
  }) : this.executePaste(e);
@@ -57698,9 +57846,9 @@
57698
57846
  }
57699
57847
  clearCutArea(table) {
57700
57848
  try {
57701
- const ranges = this.cutRanges;
57702
- if (!ranges || 0 === ranges.length) return;
57703
- table.changeCellValuesByIds(ranges, "");
57849
+ const selectCells = this.cutCellRange;
57850
+ if (!selectCells || 0 === selectCells.length) return;
57851
+ 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);
57704
57852
  } catch (error) {}
57705
57853
  }
57706
57854
  checkClipboardChanged() {
@@ -59638,15 +59786,6 @@
59638
59786
  constructor(table, customCellStyle, customCellStyleArrangement) {
59639
59787
  this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
59640
59788
  }
59641
- clearCustomCellStyleArrangement() {
59642
- this.customCellStyleArrangement = [];
59643
- }
59644
- addCustomCellStyleArrangement(cellPosition, customStyleId) {
59645
- this.customCellStyleArrangement.push({
59646
- cellPosition: cellPosition,
59647
- customStyleId: customStyleId
59648
- });
59649
- }
59650
59789
  getCustomCellStyle(col, row) {
59651
59790
  const customStyleIds = this.getCustomCellStyleIds(col, row);
59652
59791
  if (customStyleIds.length) {
@@ -59952,7 +60091,7 @@
59952
60091
  }
59953
60092
  constructor(container, options = {}) {
59954
60093
  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;
59955
- 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");
60094
+ 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");
59956
60095
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
59957
60096
  options: options,
59958
60097
  container: container
@@ -63763,16 +63902,15 @@
63763
63902
  step((generator = generator.apply(thisArg, _arguments || [])).next());
63764
63903
  });
63765
63904
  };
63766
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63905
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
63767
63906
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
63768
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
63769
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63907
+ const recordIndex = table.getRecordShowIndexByCell(col, row),
63770
63908
  {
63771
63909
  field: field
63772
63910
  } = table.internalProps.layoutMap.getBody(col, row),
63773
63911
  beforeChangeValue = table.getCellRawValue(col, row),
63774
63912
  oldValue = table.getCellOriginValue(col, row);
63775
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
63913
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
63776
63914
  const range = table.getCellRange(col, row),
63777
63915
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
63778
63916
  if (aggregators) {
@@ -63795,24 +63933,16 @@
63795
63933
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
63796
63934
  }
63797
63935
  const changedValue = table.getCellOriginValue(col, row);
63798
- if (oldValue !== changedValue && triggerEvent) {
63799
- const changeValue = {
63800
- col: col,
63801
- row: row,
63802
- recordIndex: recordIndex,
63803
- field: field,
63804
- rawValue: beforeChangeValue,
63805
- currentValue: oldValue,
63806
- changedValue: changedValue
63807
- };
63808
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63809
- values: [changeValue]
63810
- });
63811
- }
63812
- table.scenegraph.updateNextFrame();
63936
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
63937
+ col: col,
63938
+ row: row,
63939
+ rawValue: beforeChangeValue,
63940
+ currentValue: oldValue,
63941
+ changedValue: changedValue
63942
+ }), table.scenegraph.updateNextFrame();
63813
63943
  }
63814
63944
  }
63815
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63945
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
63816
63946
  var _a, _b;
63817
63947
  return __awaiter(this, void 0, void 0, function* () {
63818
63948
  const changedCellResults = [];
@@ -63834,7 +63964,6 @@
63834
63964
  oldRowValues.push(oldValue);
63835
63965
  }
63836
63966
  }
63837
- const resultChangeValues = [];
63838
63967
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
63839
63968
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
63840
63969
  const rowValues = values[i];
@@ -63858,34 +63987,25 @@
63858
63987
  if (isCanChange) {
63859
63988
  changedCellResults[i][j] = !0;
63860
63989
  const value = rowValues[j],
63861
- recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63862
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63990
+ recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63863
63991
  {
63864
63992
  field: field
63865
63993
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
63866
63994
  beforeChangeValue = beforeChangeValues[i][j],
63867
63995
  oldValue = oldValues[i][j];
63868
- 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);
63996
+ 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);
63869
63997
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
63870
- if (oldValue !== changedValue && triggerEvent) {
63871
- const changeValue = {
63872
- col: startCol + j,
63873
- row: startRow + i,
63874
- recordIndex: recordIndex,
63875
- field: field,
63876
- rawValue: beforeChangeValue,
63877
- currentValue: oldValue,
63878
- changedValue: changedValue
63879
- };
63880
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
63881
- }
63998
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
63999
+ col: startCol + j,
64000
+ row: startRow + i,
64001
+ rawValue: beforeChangeValue,
64002
+ currentValue: oldValue,
64003
+ changedValue: changedValue
64004
+ });
63882
64005
  } else changedCellResults[i][j] = !1;
63883
64006
  }
63884
64007
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
63885
64008
  }
63886
- silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63887
- values: resultChangeValues
63888
- });
63889
64009
  const startRange = table.getCellRange(startCol, startRow),
63890
64010
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
63891
64011
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -63919,58 +64039,6 @@
63919
64039
  return table.scenegraph.updateNextFrame(), changedCellResults;
63920
64040
  });
63921
64041
  }
63922
- function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63923
- var _a, _b;
63924
- return __awaiter(this, void 0, void 0, function* () {
63925
- const resultChangeValues = [],
63926
- processed = new Set(),
63927
- nextValue = null != value ? value : "";
63928
- for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
63929
- const range = ranges[i],
63930
- startCol = Math.min(range.start.col, range.end.col),
63931
- endCol = Math.max(range.start.col, range.end.col),
63932
- startRow = Math.min(range.start.row, range.end.row),
63933
- endRow = Math.max(range.start.row, range.end.row);
63934
- if (startCol > endCol || startRow > endRow) continue;
63935
- const values = [],
63936
- oldValues = [];
63937
- for (let row = startRow; row <= endRow; row++) {
63938
- const rowValues = [],
63939
- rowOldValues = [];
63940
- for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
63941
- values.push(rowValues), oldValues.push(rowOldValues);
63942
- }
63943
- const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
63944
- for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
63945
- const col = startCol + c,
63946
- row = startRow + r,
63947
- key = `${col},${row}`;
63948
- if (processed.has(key)) continue;
63949
- if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
63950
- const oldValue = oldValues[r][c],
63951
- changedValue = table.getCellOriginValue(col, row);
63952
- if (oldValue === changedValue) continue;
63953
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
63954
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63955
- {
63956
- field: field
63957
- } = table.internalProps.layoutMap.getBody(col, row);
63958
- resultChangeValues.push({
63959
- col: col,
63960
- row: row,
63961
- recordIndex: recordIndex,
63962
- field: field,
63963
- rawValue: oldValue,
63964
- currentValue: oldValue,
63965
- changedValue: changedValue
63966
- });
63967
- }
63968
- }
63969
- !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63970
- values: resultChangeValues
63971
- });
63972
- });
63973
- }
63974
64042
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
63975
64043
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
63976
64044
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -65134,165 +65202,43 @@
65134
65202
  }
65135
65203
  return isValid$1(editorDefine);
65136
65204
  }
65137
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65138
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65139
- }
65140
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65141
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65142
- }
65143
- changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65144
- return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65145
- }
65146
- changeSourceCellValue(recordIndex, field, value) {
65147
- const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
65148
- cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
65149
- if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
65150
- this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
65151
- const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
65152
- oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
65153
- changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
65154
- if (oldValue !== changedValue) {
65155
- const changeValue = {
65156
- col: cellAddr.col,
65157
- row: cellAddr.row,
65158
- recordIndex: recordIndex,
65159
- field: field,
65160
- rawValue: beforeChangeValue,
65161
- currentValue: oldValue,
65162
- changedValue: changedValue
65163
- };
65164
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65165
- values: [changeValue]
65166
- });
65167
- }
65205
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
65206
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
65168
65207
  }
65169
- changeCellValueByRecord(recordIndex, field, value, options) {
65170
- var _a, _b, _c, _d, _e;
65171
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65172
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65173
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65174
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65175
- let record, oldValue;
65176
- 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;
65177
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65178
- if (oldValue !== changedValue) {
65179
- const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
65180
- changeValue = {
65181
- col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
65182
- row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
65183
- recordIndex: recordIndex,
65184
- field: field,
65185
- rawValue: oldValue,
65186
- currentValue: oldValue,
65187
- changedValue: changedValue
65188
- };
65189
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65190
- values: [changeValue]
65191
- });
65192
- }
65193
- autoRefresh && this.refreshAfterSourceChange();
65208
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
65209
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
65194
65210
  }
65195
- changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
65196
- return this.changeCellValueByRecord(recordIndex, field, value, {
65197
- triggerEvent: triggerEvent,
65198
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65199
- autoRefresh: !0
65200
- });
65201
- }
65202
- changeCellValuesByRecords(changeValues, options) {
65203
- var _a, _b, _c, _d, _e, _f, _g;
65204
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65205
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65206
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65207
- resultChangeValues = [];
65208
- for (let i = 0; i < changeValues.length; i++) {
65209
- const {
65210
- recordIndex: recordIndex,
65211
- field: field,
65212
- value: value
65213
- } = changeValues[i],
65214
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65215
- let record, oldValue;
65216
- 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) {
65217
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65218
- if (oldValue !== changedValue) {
65219
- const changeValue = {
65220
- col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
65221
- row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
65222
- recordIndex: recordIndex,
65223
- field: field,
65224
- rawValue: oldValue,
65225
- currentValue: oldValue,
65226
- changedValue: changedValue
65227
- };
65228
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
65229
- }
65230
- }
65231
- }
65232
- !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65233
- values: resultChangeValues
65234
- }), autoRefresh && this.refreshAfterSourceChange();
65235
- }
65236
- changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
65237
- return this.changeCellValuesByRecords(changeValues, {
65238
- triggerEvent: triggerEvent,
65239
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65240
- autoRefresh: !0
65241
- });
65242
- }
65243
- refreshAfterSourceChange(options) {
65244
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
65245
- const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
65246
- reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
65247
- clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
65248
- 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);
65249
- const traverseColumns = columns => {
65250
- var _a, _b, _c, _d;
65251
- for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
65252
- const column = columns[i],
65253
- aggregators = null == column ? void 0 : column.vtable_aggregator;
65254
- 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);
65255
- (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
65256
- }
65257
- };
65258
- 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();
65259
- }
65260
- addRecord(record, recordIndex, triggerEvent = !0) {
65211
+ addRecord(record, recordIndex) {
65261
65212
  var _a;
65262
65213
  const success = listTableAddRecord(record, recordIndex, this);
65263
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65214
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65264
65215
  records: [record],
65265
65216
  recordIndex: recordIndex,
65266
65217
  recordCount: 1
65267
65218
  });
65268
65219
  }
65269
- addRecords(records, recordIndex, triggerEvent = !0) {
65220
+ addRecords(records, recordIndex) {
65270
65221
  var _a;
65271
65222
  const success = listTableAddRecords(records, recordIndex, this);
65272
- "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, {
65223
+ "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, {
65273
65224
  records: records,
65274
65225
  recordIndex: recordIndex,
65275
65226
  recordCount: records.length
65276
65227
  });
65277
65228
  }
65278
- deleteRecords(recordIndexs, triggerEvent = !0) {
65229
+ deleteRecords(recordIndexs) {
65279
65230
  var _a;
65280
- const deletedRecords = [];
65281
- (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
65282
- let record = null;
65283
- record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
65284
- }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65231
+ listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65285
65232
  const rowIndexs = [];
65286
65233
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
65287
- triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65234
+ this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65288
65235
  recordIndexs: recordIndexs,
65289
- records: deletedRecords,
65290
65236
  rowIndexs: rowIndexs,
65291
65237
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
65292
65238
  });
65293
65239
  }
65294
- updateRecords(records, recordIndexs, triggerEvent = !0) {
65295
- listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65240
+ updateRecords(records, recordIndexs) {
65241
+ listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65296
65242
  records: records,
65297
65243
  recordIndexs: recordIndexs,
65298
65244
  updateCount: records.length
@@ -76450,7 +76396,7 @@
76450
76396
  PluginManager: PluginManager
76451
76397
  });
76452
76398
 
76453
- const version = "1.22.11-alpha.5";
76399
+ const version = "1.22.11-alpha.6";
76454
76400
 
76455
76401
  exports.Gantt = Gantt;
76456
76402
  exports.TYPES = index$4;