@visactor/vtable-sheet 1.22.11-alpha.0 → 1.22.11-alpha.2

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.
@@ -37856,24 +37856,6 @@
37856
37856
  }, delay));
37857
37857
  };
37858
37858
  }
37859
- function cancellableThrottle(func, delay) {
37860
- let timer = null,
37861
- lastArgs = null,
37862
- context = null;
37863
- return {
37864
- throttled: function (...args) {
37865
- lastArgs = args, context = this, timer || (timer = setTimeout(() => {
37866
- lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
37867
- }, delay));
37868
- },
37869
- cancel: () => {
37870
- timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
37871
- },
37872
- flush: () => {
37873
- timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
37874
- }
37875
- };
37876
- }
37877
37859
  function pad(num, totalChars) {
37878
37860
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
37879
37861
  return num;
@@ -38846,6 +38828,7 @@
38846
38828
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
38847
38829
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
38848
38830
  CHANGE_CELL_VALUE: "change_cell_value",
38831
+ CHANGE_CELL_VALUES: "change_cell_values",
38849
38832
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
38850
38833
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
38851
38834
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -40972,6 +40955,24 @@
40972
40955
  }
40973
40956
  }
40974
40957
  }
40958
+ changeFieldValueByRecordIndex(value, recordIndex, field, table) {
40959
+ var _a, _b, _c, _d;
40960
+ if (null === field) return;
40961
+ if (null == recordIndex) return;
40962
+ const rawKey = recordIndex.toString();
40963
+ if (!this.beforeChangedRecordsMap.has(rawKey)) {
40964
+ const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
40965
+ originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40966
+ this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep$1(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
40967
+ }
40968
+ if ("string" == typeof field || "number" == typeof field) {
40969
+ const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
40970
+ rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
40971
+ record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40972
+ let formatValue = value;
40973
+ "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);
40974
+ }
40975
+ }
40975
40976
  cacheBeforeChangedRecord(dataIndex, table) {
40976
40977
  var _a;
40977
40978
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -41037,9 +41038,16 @@
41037
41038
  }
41038
41039
  }
41039
41040
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
41040
- for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
41041
- const record = this.beforeChangedRecordsMap.get(key.toString());
41042
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
41041
+ const delta = "add" === type ? insertCount : -insertCount,
41042
+ numericKeys = [];
41043
+ this.beforeChangedRecordsMap.forEach((_, key) => {
41044
+ const numKey = Number(key);
41045
+ Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
41046
+ }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
41047
+ for (let i = 0; i < numericKeys.length; i++) {
41048
+ const key = numericKeys[i],
41049
+ record = this.beforeChangedRecordsMap.get(key.toString());
41050
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
41043
41051
  }
41044
41052
  }
41045
41053
  deleteRecords(recordIndexs) {
@@ -47730,26 +47738,48 @@
47730
47738
  const cellGroup = table.scenegraph.getCell(col, i),
47731
47739
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47732
47740
  chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
47733
- var _a, _b, _c, _d;
47741
+ var _a, _b, _c, _d, _e, _f;
47734
47742
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47735
47743
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47736
47744
  let isShowTooltip = !isScatter;
47737
- 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 {
47738
- const cellBoundry = table.getCellRelativeRect(col, i),
47739
- bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47745
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
47746
+ const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
47747
+ {
47748
+ rowEnd: rowEnd1
47749
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47750
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47751
+ const {
47752
+ rowEnd: rowEnd2
47753
+ } = table.getBodyVisibleRowRange(0, 5);
47754
+ isShowTooltip = rowEnd2 !== rowEnd;
47755
+ }
47756
+ } else if (i === rowStart && isShowTooltip) {
47757
+ const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
47758
+ {
47759
+ rowStart: rowStart1
47760
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47761
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
47762
+ const {
47763
+ rowStart: rowStart2
47764
+ } = table.getBodyVisibleRowRange(0, -5);
47765
+ isShowTooltip = rowStart2 !== rowStart;
47766
+ }
47767
+ }
47768
+ 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 {
47769
+ const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47740
47770
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
47741
47771
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47742
47772
  tooltip: !1,
47743
47773
  showTooltipOption: {
47744
- x: canvasXY.x - cellBoundry.left,
47745
- y: absolutePositionTop - cellBoundry.top,
47774
+ x: canvasXY.x,
47775
+ y: absolutePositionTop,
47746
47776
  activeType: "dimension"
47747
47777
  }
47748
47778
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47749
47779
  tooltip: isShowTooltip,
47750
47780
  showTooltipOption: {
47751
- x: canvasXY.x - cellBoundry.left,
47752
- y: absolutePositionTop - cellBoundry.top,
47781
+ x: canvasXY.x,
47782
+ y: absolutePositionTop,
47753
47783
  activeType: "dimension"
47754
47784
  }
47755
47785
  });
@@ -47790,22 +47820,44 @@
47790
47820
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
47791
47821
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47792
47822
  let isShowTooltip = !isScatter;
47793
- 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 {
47794
- const cellBoundry = table.getCellRelativeRect(i, row),
47795
- bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47823
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
47824
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47825
+ {
47826
+ colEnd: colEnd1
47827
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47828
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
47829
+ const {
47830
+ colEnd: colEnd2
47831
+ } = table.getBodyVisibleColRange(0, 5);
47832
+ isShowTooltip = colEnd2 !== colEnd;
47833
+ }
47834
+ } else if (i === colStart && isShowTooltip) {
47835
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47836
+ {
47837
+ colStart: colStart1
47838
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47839
+ if (colStart1 === colStart) isShowTooltip = !0;else {
47840
+ const {
47841
+ colStart: colStart2
47842
+ } = table.getBodyVisibleColRange(0, -5);
47843
+ isShowTooltip = colStart2 !== colStart;
47844
+ }
47845
+ }
47846
+ 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 {
47847
+ const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47796
47848
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
47797
47849
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47798
47850
  tooltip: !1,
47799
47851
  showTooltipOption: {
47800
- x: absolutePositionLeft - cellBoundry.left,
47801
- y: canvasXY.y - cellBoundry.top,
47852
+ x: absolutePositionLeft,
47853
+ y: canvasXY.y,
47802
47854
  activeType: "dimension"
47803
47855
  }
47804
47856
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47805
47857
  tooltip: isShowTooltip,
47806
47858
  showTooltipOption: {
47807
- x: absolutePositionLeft - cellBoundry.left,
47808
- y: canvasXY.y - cellBoundry.top,
47859
+ x: absolutePositionLeft,
47860
+ y: canvasXY.y,
47809
47861
  activeType: "dimension"
47810
47862
  }
47811
47863
  });
@@ -47814,103 +47866,6 @@
47814
47866
  }, 0), table.scenegraph.updateNextFrame();
47815
47867
  }
47816
47868
  }
47817
- function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
47818
- var _a;
47819
- const {
47820
- rowStart: rowStart
47821
- } = table.getBodyVisibleRowRange();
47822
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47823
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47824
- const {
47825
- colStart: colStart
47826
- } = table.getBodyVisibleColRange();
47827
- let colEnd = table.getBodyVisibleColRange().colEnd;
47828
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47829
- for (let col = colStart; col <= colEnd; col++) {
47830
- isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47831
- for (let i = rowStart; i <= rowEnd; i++) {
47832
- const cellGroup = table.scenegraph.getCell(col, i),
47833
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47834
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance)), setTimeout(() => {
47835
- var _a, _b;
47836
- if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47837
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47838
- let isShowTooltip = !0;
47839
- "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, {
47840
- activeType: "mark"
47841
- })));
47842
- }
47843
- }, 0), table.scenegraph.updateNextFrame();
47844
- }
47845
- }
47846
- }
47847
- function checkIsShowTooltipForEdgeRow(row, table) {
47848
- var _a, _b;
47849
- let isShowTooltip = !0;
47850
- const {
47851
- rowStart: rowStart
47852
- } = table.getBodyVisibleRowRange();
47853
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47854
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47855
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47856
- if (row === rowEnd && isShowTooltip) {
47857
- const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
47858
- {
47859
- rowEnd: rowEnd1
47860
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47861
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47862
- const {
47863
- rowEnd: rowEnd2
47864
- } = table.getBodyVisibleRowRange(0, 5);
47865
- isShowTooltip = rowEnd2 !== rowEnd;
47866
- }
47867
- } else if (row === rowStart && isShowTooltip) {
47868
- const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
47869
- {
47870
- rowStart: rowStart1
47871
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47872
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
47873
- const {
47874
- rowStart: rowStart2
47875
- } = table.getBodyVisibleRowRange(0, -5);
47876
- isShowTooltip = rowStart2 !== rowStart;
47877
- }
47878
- }
47879
- return isShowTooltip;
47880
- }
47881
- function checkIsShowTooltipForEdgeColumn(col, table) {
47882
- let isShowTooltip = !0;
47883
- const {
47884
- colStart: colStart
47885
- } = table.getBodyVisibleColRange();
47886
- let colEnd = table.getBodyVisibleColRange().colEnd;
47887
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47888
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47889
- if (col === colEnd && isShowTooltip) {
47890
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47891
- {
47892
- colEnd: colEnd1
47893
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47894
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
47895
- const {
47896
- colEnd: colEnd2
47897
- } = table.getBodyVisibleColRange(0, 5);
47898
- isShowTooltip = colEnd2 !== colEnd;
47899
- }
47900
- } else if (col === colStart && isShowTooltip) {
47901
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47902
- {
47903
- colStart: colStart1
47904
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47905
- if (colStart1 === colStart) isShowTooltip = !0;else {
47906
- const {
47907
- colStart: colStart2
47908
- } = table.getBodyVisibleColRange(0, -5);
47909
- isShowTooltip = colStart2 !== colStart;
47910
- }
47911
- }
47912
- return isShowTooltip;
47913
- }
47914
47869
  function clearChartInstanceListByRowDirection(row, excludedCol, table) {
47915
47870
  var _a;
47916
47871
  if (isValid$2(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
@@ -47925,10 +47880,6 @@
47925
47880
  }
47926
47881
  delete chartInstanceListRowByRowDirection[row];
47927
47882
  }
47928
- function clearAllChartInstanceList(table) {
47929
- for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table);
47930
- for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table);
47931
- }
47932
47883
 
47933
47884
  function isValidAlignDomain(domain) {
47934
47885
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -48562,7 +48513,7 @@
48562
48513
  const CHART_NUMBER_TYPE = genNumberType();
48563
48514
  class Chart extends Rect$2 {
48564
48515
  constructor(isShareChartSpec, params) {
48565
- 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 {
48516
+ 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 {
48566
48517
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
48567
48518
  renderCanvas: params.canvas,
48568
48519
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -48583,7 +48534,7 @@
48583
48534
  }
48584
48535
  }
48585
48536
  activate(table) {
48586
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48537
+ var _a, _b, _c, _d, _e;
48587
48538
  if (this.activeChartInstance) return;
48588
48539
  const {
48589
48540
  col: col,
@@ -48636,7 +48587,7 @@
48636
48587
  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());
48637
48588
  }
48638
48589
  },
48639
- componentShowContent: (null === (_b = table.options.chartDimensionLinkage) || void 0 === _b ? void 0 : _b.showTooltip) && "scatter" !== this.attribute.spec.type ? {
48590
+ componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
48640
48591
  tooltip: {
48641
48592
  dimension: !1,
48642
48593
  mark: !0
@@ -48647,37 +48598,15 @@
48647
48598
  const chartStage = this.activeChartInstance.getStage(),
48648
48599
  matrix = this.globalTransMatrix.clone(),
48649
48600
  stageMatrix = this.stage.window.getViewBoxTransform();
48650
- let brushChangeThrottle;
48651
- 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 === (_d = null === (_c = table.internalProps.layoutMap) || void 0 === _c ? void 0 : _c.updateDataStateToActiveChartInstance) || void 0 === _d || _d.call(_c, this.activeChartInstance), this.activeChartInstance.on("click", params => {
48601
+ 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 => {
48652
48602
  var _a;
48653
- !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");
48654
- }), (null === (_e = table.options.chartDimensionLinkage) || void 0 === _e ? void 0 : _e.listenBrushChange) && (brushChangeThrottle = cancellableThrottle(table.scenegraph.updateChartState.bind(table.scenegraph), null !== (_g = null === (_f = table.options.chartDimensionLinkage) || void 0 === _f ? void 0 : _f.brushChangeDelay) && void 0 !== _g ? _g : 100), this.activeChartInstance.on("brushChange", params => {
48603
+ !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);
48604
+ }), this.activeChartInstance.on("brushEnd", params => {
48655
48605
  var _a;
48656
- brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
48657
- })), this.activeChartInstance.on("brushEnd", params => {
48658
- var _a;
48659
- 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(() => {
48606
+ table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
48660
48607
  Chart.temp = 1;
48661
48608
  }, 0);
48662
- }), (null === (_h = table.options.chartDimensionLinkage) || void 0 === _h ? void 0 : _h.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
48663
- markName: "pie"
48664
- }, params => {
48665
- var _a;
48666
- const categoryField = this.attribute.spec.categoryField,
48667
- datum = {
48668
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48669
- };
48670
- generateChartInstanceListByViewRange(datum, table, !1);
48671
- }), this.activeChartInstance.on("pointerout", {
48672
- markName: "pie"
48673
- }, params => {
48674
- var _a;
48675
- const categoryField = this.attribute.spec.categoryField,
48676
- datum = {
48677
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48678
- };
48679
- generateChartInstanceListByViewRange(datum, table, !0);
48680
- })), this.activeChartInstance.on("dimensionHover", params => {
48609
+ }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
48681
48610
  var _a, _b;
48682
48611
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
48683
48612
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
@@ -48740,13 +48669,12 @@
48740
48669
  }
48741
48670
  }
48742
48671
  }
48743
- })), null === (_k = (_j = table)._bindChartEvent) || void 0 === _k || _k.call(_j, this.activeChartInstance);
48672
+ }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
48744
48673
  }
48745
48674
  deactivate(table, {
48746
48675
  releaseChartInstance = !0,
48747
48676
  releaseColumnChartInstance = !0,
48748
- releaseRowChartInstance = !0,
48749
- releaseAllChartInstance = !1
48677
+ releaseRowChartInstance = !0
48750
48678
  } = {}) {
48751
48679
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48752
48680
  if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
@@ -48768,7 +48696,7 @@
48768
48696
  } = this.parent;
48769
48697
  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));
48770
48698
  }
48771
- releaseAllChartInstance ? clearAllChartInstanceList(table) : (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));
48699
+ 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);
48772
48700
  }
48773
48701
  updateData(data) {
48774
48702
  this.attribute.data = data;
@@ -48783,14 +48711,13 @@
48783
48711
  y1: y1,
48784
48712
  x2: x2,
48785
48713
  y2: y2
48786
- } = cellGroup.globalAABBBounds,
48787
- viewBox = {
48788
- 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)),
48789
- 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)),
48790
- 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)),
48791
- 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))
48792
- };
48793
- return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
48714
+ } = cellGroup.globalAABBBounds;
48715
+ return {
48716
+ 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)),
48717
+ 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)),
48718
+ 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)),
48719
+ 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))
48720
+ };
48794
48721
  }
48795
48722
  }
48796
48723
  function getTableBounds(col, row, table) {
@@ -49005,7 +48932,7 @@
49005
48932
  {
49006
48933
  width = groupAttribute.width,
49007
48934
  height = groupAttribute.height
49008
- } = chart.attribute,
48935
+ } = (chart.getViewBox(), chart.attribute),
49009
48936
  {
49010
48937
  table: table
49011
48938
  } = chart.getRootNode(),
@@ -49033,9 +48960,8 @@
49033
48960
  });
49034
48961
  }
49035
48962
  }
49036
- const lastViewBox = chart.activeChartInstanceLastViewBox,
49037
- viewBox = chart.getViewBox();
49038
- lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
48963
+ const viewBox = chart.getViewBox();
48964
+ activeChartInstance.updateViewBox({
49039
48965
  x1: 0,
49040
48966
  x2: viewBox.x2 - viewBox.x1,
49041
48967
  y1: 0,
@@ -52553,10 +52479,9 @@
52553
52479
  });
52554
52480
  }
52555
52481
  }
52556
- function updateChartState(scenegraph, datum, selectedDataMode) {
52482
+ function updateChartState(scenegraph, datum) {
52557
52483
  const table = scenegraph.table;
52558
52484
  if (table.isPivotChart()) {
52559
- table._selectedDataMode = selectedDataMode;
52560
52485
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
52561
52486
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
52562
52487
  const newSelectedDataItemsInChart = [];
@@ -53304,22 +53229,16 @@
53304
53229
  resetResidentHoverIcon(col, row) {
53305
53230
  resetResidentHoverIcon(col, row, this);
53306
53231
  }
53307
- deactivateChart(col, row, forceRelease = !1) {
53308
- var _a, _b, _c, _d, _e, _f;
53232
+ deactivateChart(col, row) {
53233
+ var _a, _b, _c;
53309
53234
  if (-1 === col || -1 === row) return;
53310
53235
  const cellGroup = this.getCell(col, row);
53311
53236
  if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
53312
- if (forceRelease) return void (null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
53313
- releaseChartInstance: !0,
53314
- releaseColumnChartInstance: !0,
53315
- releaseRowChartInstance: !0,
53316
- releaseAllChartInstance: !0
53317
- }));
53318
53237
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
53319
- null === (_e = null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) || void 0 === _e || _e.call(_d, this.table, (null === (_f = this.table.options.chartDimensionLinkage) || void 0 === _f ? void 0 : _f.showTooltip) ? {
53320
- 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),
53321
- 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),
53322
- 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)
53238
+ 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 ? {
53239
+ 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,
53240
+ 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,
53241
+ 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
53323
53242
  } : void 0);
53324
53243
  }
53325
53244
  }
@@ -53367,8 +53286,8 @@
53367
53286
  updateChartSizeForResizeRowHeight(row) {
53368
53287
  updateChartSizeForResizeRowHeight(this, row);
53369
53288
  }
53370
- updateChartState(datum, selectedDataMode) {
53371
- this.table.isPivotChart() && updateChartState(this, datum, selectedDataMode);
53289
+ updateChartState(datum) {
53290
+ this.table.isPivotChart() && updateChartState(this, datum);
53372
53291
  }
53373
53292
  updateCheckboxCellState(col, row, checked) {
53374
53293
  var _a, _b;
@@ -56395,7 +56314,7 @@
56395
56314
  }, 0 !== e.button) return;
56396
56315
  const eventArgsSet = getCellEventArgsSet(e);
56397
56316
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
56398
- 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;
56317
+ 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;
56399
56318
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
56400
56319
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
56401
56320
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -56423,7 +56342,7 @@
56423
56342
  }
56424
56343
  eventManager.dealTableHover(eventArgsSet);
56425
56344
  } else {
56426
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), void stateManager.updateInteractionState(InteractionState.grabing);
56345
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
56427
56346
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56428
56347
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56429
56348
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -56575,7 +56494,7 @@
56575
56494
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
56576
56495
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
56577
56496
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
56578
- table.scenegraph.updateChartState(null, void 0), stateManager.updateInteractionState(InteractionState.grabing);
56497
+ table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
56579
56498
  const {
56580
56499
  eventArgs: eventArgs
56581
56500
  } = eventArgsSet;
@@ -56594,7 +56513,7 @@
56594
56513
  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 {
56595
56514
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
56596
56515
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
56597
- (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);
56516
+ (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);
56598
56517
  }
56599
56518
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
56600
56519
  var _a, _b, _c;
@@ -56712,15 +56631,7 @@
56712
56631
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
56713
56632
  }), table.scenegraph.stage.addEventListener("wheel", e => {
56714
56633
  var _a;
56715
- if (!e.path.find(node => "legend" === node.name)) {
56716
- null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
56717
- const {
56718
- cellPos: cellPos
56719
- } = table.stateManager.hover,
56720
- prevHoverCellCol = cellPos.col,
56721
- prevHoverCellRow = cellPos.row;
56722
- table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
56723
- }
56634
+ e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
56724
56635
  });
56725
56636
  }
56726
56637
  function bindGesture(eventManager) {
@@ -57500,7 +57411,7 @@
57500
57411
  };
57501
57412
  let EventManager$1 = class EventManager {
57502
57413
  constructor(table) {
57503
- 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$1.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
57414
+ 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$1.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
57504
57415
  this.bindSelfEvent();
57505
57416
  }, 0));
57506
57417
  }
@@ -57802,15 +57713,25 @@
57802
57713
  } catch (error) {}
57803
57714
  }
57804
57715
  handleCut(e) {
57716
+ var _a;
57805
57717
  return __awaiter$1(this, void 0, void 0, function* () {
57806
- this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57807
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
57718
+ 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 => ({
57719
+ start: {
57720
+ col: r.start.col,
57721
+ row: r.start.row
57722
+ },
57723
+ end: {
57724
+ col: r.end.col,
57725
+ row: r.end.row
57726
+ }
57727
+ })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57728
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
57808
57729
  }, 3e4), this.saveClipboardContent();
57809
57730
  });
57810
57731
  }
57811
57732
  handlePaste(e) {
57812
57733
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
57813
- this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57734
+ 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));
57814
57735
  }).catch(() => {
57815
57736
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57816
57737
  }) : this.executePaste(e);
@@ -57887,9 +57808,9 @@
57887
57808
  }
57888
57809
  clearCutArea(table) {
57889
57810
  try {
57890
- const selectCells = this.cutCellRange;
57891
- if (!selectCells || 0 === selectCells.length) return;
57892
- 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);
57811
+ const ranges = this.cutRanges;
57812
+ if (!ranges || 0 === ranges.length) return;
57813
+ table.changeCellValuesByIds(ranges, "");
57893
57814
  } catch (error) {}
57894
57815
  }
57895
57816
  checkClipboardChanged() {
@@ -60132,7 +60053,7 @@
60132
60053
  }
60133
60054
  constructor(container, options = {}) {
60134
60055
  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;
60135
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
60056
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
60136
60057
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
60137
60058
  options: options,
60138
60059
  container: container
@@ -63943,15 +63864,16 @@
63943
63864
  step((generator = generator.apply(thisArg, _arguments || [])).next());
63944
63865
  });
63945
63866
  };
63946
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
63867
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63947
63868
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
63948
- const recordIndex = table.getRecordShowIndexByCell(col, row),
63869
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
63870
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63949
63871
  {
63950
63872
  field: field
63951
63873
  } = table.internalProps.layoutMap.getBody(col, row),
63952
63874
  beforeChangeValue = table.getCellRawValue(col, row),
63953
63875
  oldValue = table.getCellOriginValue(col, row);
63954
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
63876
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
63955
63877
  const range = table.getCellRange(col, row),
63956
63878
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
63957
63879
  if (aggregators) {
@@ -63974,16 +63896,24 @@
63974
63896
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
63975
63897
  }
63976
63898
  const changedValue = table.getCellOriginValue(col, row);
63977
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
63978
- col: col,
63979
- row: row,
63980
- rawValue: beforeChangeValue,
63981
- currentValue: oldValue,
63982
- changedValue: changedValue
63983
- }), table.scenegraph.updateNextFrame();
63899
+ if (oldValue !== changedValue && triggerEvent) {
63900
+ const changeValue = {
63901
+ col: col,
63902
+ row: row,
63903
+ recordIndex: recordIndex,
63904
+ field: field,
63905
+ rawValue: beforeChangeValue,
63906
+ currentValue: oldValue,
63907
+ changedValue: changedValue
63908
+ };
63909
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63910
+ values: [changeValue]
63911
+ });
63912
+ }
63913
+ table.scenegraph.updateNextFrame();
63984
63914
  }
63985
63915
  }
63986
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
63916
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63987
63917
  var _a, _b;
63988
63918
  return __awaiter(this, void 0, void 0, function* () {
63989
63919
  const changedCellResults = [];
@@ -64005,6 +63935,7 @@
64005
63935
  oldRowValues.push(oldValue);
64006
63936
  }
64007
63937
  }
63938
+ const resultChangeValues = [];
64008
63939
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
64009
63940
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
64010
63941
  const rowValues = values[i];
@@ -64028,25 +63959,34 @@
64028
63959
  if (isCanChange) {
64029
63960
  changedCellResults[i][j] = !0;
64030
63961
  const value = rowValues[j],
64031
- recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63962
+ recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63963
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64032
63964
  {
64033
63965
  field: field
64034
63966
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
64035
63967
  beforeChangeValue = beforeChangeValues[i][j],
64036
63968
  oldValue = oldValues[i][j];
64037
- 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);
63969
+ 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);
64038
63970
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
64039
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
64040
- col: startCol + j,
64041
- row: startRow + i,
64042
- rawValue: beforeChangeValue,
64043
- currentValue: oldValue,
64044
- changedValue: changedValue
64045
- });
63971
+ if (oldValue !== changedValue && triggerEvent) {
63972
+ const changeValue = {
63973
+ col: startCol + j,
63974
+ row: startRow + i,
63975
+ recordIndex: recordIndex,
63976
+ field: field,
63977
+ rawValue: beforeChangeValue,
63978
+ currentValue: oldValue,
63979
+ changedValue: changedValue
63980
+ };
63981
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
63982
+ }
64046
63983
  } else changedCellResults[i][j] = !1;
64047
63984
  }
64048
63985
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
64049
63986
  }
63987
+ silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63988
+ values: resultChangeValues
63989
+ });
64050
63990
  const startRange = table.getCellRange(startCol, startRow),
64051
63991
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
64052
63992
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -64080,6 +64020,58 @@
64080
64020
  return table.scenegraph.updateNextFrame(), changedCellResults;
64081
64021
  });
64082
64022
  }
64023
+ function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
64024
+ var _a, _b;
64025
+ return __awaiter(this, void 0, void 0, function* () {
64026
+ const resultChangeValues = [],
64027
+ processed = new Set(),
64028
+ nextValue = null != value ? value : "";
64029
+ for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
64030
+ const range = ranges[i],
64031
+ startCol = Math.min(range.start.col, range.end.col),
64032
+ endCol = Math.max(range.start.col, range.end.col),
64033
+ startRow = Math.min(range.start.row, range.end.row),
64034
+ endRow = Math.max(range.start.row, range.end.row);
64035
+ if (startCol > endCol || startRow > endRow) continue;
64036
+ const values = [],
64037
+ oldValues = [];
64038
+ for (let row = startRow; row <= endRow; row++) {
64039
+ const rowValues = [],
64040
+ rowOldValues = [];
64041
+ for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
64042
+ values.push(rowValues), oldValues.push(rowOldValues);
64043
+ }
64044
+ const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
64045
+ for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
64046
+ const col = startCol + c,
64047
+ row = startRow + r,
64048
+ key = `${col},${row}`;
64049
+ if (processed.has(key)) continue;
64050
+ if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
64051
+ const oldValue = oldValues[r][c],
64052
+ changedValue = table.getCellOriginValue(col, row);
64053
+ if (oldValue === changedValue) continue;
64054
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
64055
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64056
+ {
64057
+ field: field
64058
+ } = table.internalProps.layoutMap.getBody(col, row);
64059
+ resultChangeValues.push({
64060
+ col: col,
64061
+ row: row,
64062
+ recordIndex: recordIndex,
64063
+ field: field,
64064
+ rawValue: oldValue,
64065
+ currentValue: oldValue,
64066
+ changedValue: changedValue
64067
+ });
64068
+ }
64069
+ }
64070
+ !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
64071
+ values: resultChangeValues
64072
+ });
64073
+ });
64074
+ }
64083
64075
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
64084
64076
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
64085
64077
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -65243,43 +65235,165 @@
65243
65235
  }
65244
65236
  return isValid$2(editorDefine);
65245
65237
  }
65246
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
65247
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
65238
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65239
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65240
+ }
65241
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65242
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65243
+ }
65244
+ changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65245
+ return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65246
+ }
65247
+ changeSourceCellValue(recordIndex, field, value) {
65248
+ const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
65249
+ cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
65250
+ if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
65251
+ this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
65252
+ const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
65253
+ oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
65254
+ changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
65255
+ if (oldValue !== changedValue) {
65256
+ const changeValue = {
65257
+ col: cellAddr.col,
65258
+ row: cellAddr.row,
65259
+ recordIndex: recordIndex,
65260
+ field: field,
65261
+ rawValue: beforeChangeValue,
65262
+ currentValue: oldValue,
65263
+ changedValue: changedValue
65264
+ };
65265
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65266
+ values: [changeValue]
65267
+ });
65268
+ }
65248
65269
  }
65249
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
65250
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
65270
+ changeCellValueByRecord(recordIndex, field, value, options) {
65271
+ var _a, _b, _c, _d, _e;
65272
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65273
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65274
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65275
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65276
+ let record, oldValue;
65277
+ 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;
65278
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65279
+ if (oldValue !== changedValue) {
65280
+ const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
65281
+ changeValue = {
65282
+ col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
65283
+ row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
65284
+ recordIndex: recordIndex,
65285
+ field: field,
65286
+ rawValue: oldValue,
65287
+ currentValue: oldValue,
65288
+ changedValue: changedValue
65289
+ };
65290
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65291
+ values: [changeValue]
65292
+ });
65293
+ }
65294
+ autoRefresh && this.refreshAfterSourceChange();
65295
+ }
65296
+ changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
65297
+ return this.changeCellValueByRecord(recordIndex, field, value, {
65298
+ triggerEvent: triggerEvent,
65299
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65300
+ autoRefresh: !0
65301
+ });
65251
65302
  }
65252
- addRecord(record, recordIndex) {
65303
+ changeCellValuesByRecords(changeValues, options) {
65304
+ var _a, _b, _c, _d, _e, _f, _g;
65305
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65306
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65307
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65308
+ resultChangeValues = [];
65309
+ for (let i = 0; i < changeValues.length; i++) {
65310
+ const {
65311
+ recordIndex: recordIndex,
65312
+ field: field,
65313
+ value: value
65314
+ } = changeValues[i],
65315
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65316
+ let record, oldValue;
65317
+ 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) {
65318
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65319
+ if (oldValue !== changedValue) {
65320
+ const changeValue = {
65321
+ col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
65322
+ row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
65323
+ recordIndex: recordIndex,
65324
+ field: field,
65325
+ rawValue: oldValue,
65326
+ currentValue: oldValue,
65327
+ changedValue: changedValue
65328
+ };
65329
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
65330
+ }
65331
+ }
65332
+ }
65333
+ !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65334
+ values: resultChangeValues
65335
+ }), autoRefresh && this.refreshAfterSourceChange();
65336
+ }
65337
+ changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
65338
+ return this.changeCellValuesByRecords(changeValues, {
65339
+ triggerEvent: triggerEvent,
65340
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65341
+ autoRefresh: !0
65342
+ });
65343
+ }
65344
+ refreshAfterSourceChange(options) {
65345
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
65346
+ const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
65347
+ reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
65348
+ clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
65349
+ 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);
65350
+ const traverseColumns = columns => {
65351
+ var _a, _b, _c, _d;
65352
+ for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
65353
+ const column = columns[i],
65354
+ aggregators = null == column ? void 0 : column.vtable_aggregator;
65355
+ 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);
65356
+ (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
65357
+ }
65358
+ };
65359
+ 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();
65360
+ }
65361
+ addRecord(record, recordIndex, triggerEvent = !0) {
65253
65362
  var _a;
65254
65363
  const success = listTableAddRecord(record, recordIndex, this);
65255
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65364
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65256
65365
  records: [record],
65257
65366
  recordIndex: recordIndex,
65258
65367
  recordCount: 1
65259
65368
  });
65260
65369
  }
65261
- addRecords(records, recordIndex) {
65370
+ addRecords(records, recordIndex, triggerEvent = !0) {
65262
65371
  var _a;
65263
65372
  const success = listTableAddRecords(records, recordIndex, this);
65264
- "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, {
65373
+ "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, {
65265
65374
  records: records,
65266
65375
  recordIndex: recordIndex,
65267
65376
  recordCount: records.length
65268
65377
  });
65269
65378
  }
65270
- deleteRecords(recordIndexs) {
65379
+ deleteRecords(recordIndexs, triggerEvent = !0) {
65271
65380
  var _a;
65272
- listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65381
+ const deletedRecords = [];
65382
+ (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
65383
+ let record = null;
65384
+ record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
65385
+ }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65273
65386
  const rowIndexs = [];
65274
65387
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
65275
- this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65388
+ triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65276
65389
  recordIndexs: recordIndexs,
65390
+ records: deletedRecords,
65277
65391
  rowIndexs: rowIndexs,
65278
65392
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
65279
65393
  });
65280
65394
  }
65281
- updateRecords(records, recordIndexs) {
65282
- listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65395
+ updateRecords(records, recordIndexs, triggerEvent = !0) {
65396
+ listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65283
65397
  records: records,
65284
65398
  recordIndexs: recordIndexs,
65285
65399
  updateCount: records.length
@@ -69499,8 +69613,8 @@
69499
69613
  }(ExcelEditCellKeyboardResponse || (ExcelEditCellKeyboardResponse = {}));
69500
69614
  class ExcelEditCellKeyboardPlugin {
69501
69615
  constructor(pluginOptions) {
69502
- var _a, _b;
69503
- this.id = "excel-edit-cell-keyboard", this.name = "Excel Edit Cell Keyboard", this.runTime = [TABLE_EVENT_TYPE.INITIALIZED], this.id = null !== (_a = null == pluginOptions ? void 0 : pluginOptions.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = pluginOptions, this.responseKeyboard = null !== (_b = null == pluginOptions ? void 0 : pluginOptions.responseKeyboard) && void 0 !== _b ? _b : [ExcelEditCellKeyboardResponse.ENTER, ExcelEditCellKeyboardResponse.TAB, ExcelEditCellKeyboardResponse.ARROW_LEFT, ExcelEditCellKeyboardResponse.ARROW_RIGHT, ExcelEditCellKeyboardResponse.ARROW_DOWN, ExcelEditCellKeyboardResponse.ARROW_UP, ExcelEditCellKeyboardResponse.DELETE, ExcelEditCellKeyboardResponse.BACKSPACE], this.bindEvent();
69616
+ var _a, _b, _c;
69617
+ this.id = "excel-edit-cell-keyboard", this.name = "Excel Edit Cell Keyboard", this.runTime = [TABLE_EVENT_TYPE.INITIALIZED], this.id = null !== (_a = null == pluginOptions ? void 0 : pluginOptions.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = pluginOptions, this.responseKeyboard = null !== (_b = null == pluginOptions ? void 0 : pluginOptions.responseKeyboard) && void 0 !== _b ? _b : [ExcelEditCellKeyboardResponse.ENTER, ExcelEditCellKeyboardResponse.TAB, ExcelEditCellKeyboardResponse.ARROW_LEFT, ExcelEditCellKeyboardResponse.ARROW_RIGHT, ExcelEditCellKeyboardResponse.ARROW_DOWN, ExcelEditCellKeyboardResponse.ARROW_UP, ExcelEditCellKeyboardResponse.DELETE, ExcelEditCellKeyboardResponse.BACKSPACE], this.aggregateDeleteToOneChangeCellValuesEvent = null !== (_c = null == pluginOptions ? void 0 : pluginOptions.aggregateDeleteToOneChangeCellValuesEvent) && void 0 !== _c && _c, this.bindEvent();
69504
69618
  }
69505
69619
  run(...args) {
69506
69620
  const table = args[2];
@@ -69531,7 +69645,7 @@
69531
69645
  (null == selectCells ? void 0 : selectCells.length) > 0 && (document.activeElement === this.table.getElement() || Object.values(this.table.editorManager.cacheLastSelectedCellEditor || {}).some(editor => {
69532
69646
  var _a;
69533
69647
  return (null === (_a = editor.getInputElement) || void 0 === _a ? void 0 : _a.call(editor)) === document.activeElement;
69534
- })) && (deleteSelectRange(selectCells, this.table, null === (_c = null === (_b = this.pluginOptions) || void 0 === _b ? void 0 : _b.deleteWorkOnEditableCell) || void 0 === _c || _c), event.stopPropagation(), event.preventDefault());
69648
+ })) && (deleteSelectRange(selectCells, this.table, null === (_c = null === (_b = this.pluginOptions) || void 0 === _b ? void 0 : _b.deleteWorkOnEditableCell) || void 0 === _c || _c, this.aggregateDeleteToOneChangeCellValuesEvent), event.stopPropagation(), event.preventDefault());
69535
69649
  }
69536
69650
  } else this.table.editorManager.completeEdit(), this.table.getElement().focus(), eventKey === ExcelEditCellKeyboardResponse.ENTER ? this.table.selectCell(col, row + 1) : eventKey === ExcelEditCellKeyboardResponse.TAB && this.table.selectCell(col + 1, row), event.stopPropagation(), event.preventDefault();
69537
69651
  }
@@ -69553,8 +69667,11 @@
69553
69667
  document.removeEventListener("keydown", this.handleKeyDown, !0);
69554
69668
  }
69555
69669
  }
69556
- function deleteSelectRange(selectCells, tableInstance, workOnEditableCell = !1) {
69557
- for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) tableInstance.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, "", workOnEditableCell);
69670
+ function deleteSelectRange(selectCells, tableInstance, workOnEditableCell = !1, aggregateToOneChangeCellValuesEvent = !1) {
69671
+ if (aggregateToOneChangeCellValuesEvent) {
69672
+ const ranges = tableInstance.stateManager.select.ranges;
69673
+ (null == ranges ? void 0 : ranges.length) && tableInstance.changeCellValuesByIds(ranges, "", workOnEditableCell, !0);
69674
+ } else for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) tableInstance.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, "", workOnEditableCell);
69558
69675
  }
69559
69676
 
69560
69677
  const MENU_CONTAINER_CLASS = "vtable-context-menu-container";
@@ -91117,7 +91234,7 @@
91117
91234
  importStyle();
91118
91235
  }
91119
91236
 
91120
- const version = "1.22.11-alpha.0";
91237
+ const version = "1.22.11-alpha.2";
91121
91238
  importStyles();
91122
91239
 
91123
91240
  exports.TYPES = index;