@visactor/vtable-calendar 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.
@@ -34616,24 +34616,6 @@
34616
34616
  }, delay));
34617
34617
  };
34618
34618
  }
34619
- function cancellableThrottle(func, delay) {
34620
- let timer = null,
34621
- lastArgs = null,
34622
- context = null;
34623
- return {
34624
- throttled: function (...args) {
34625
- lastArgs = args, context = this, timer || (timer = setTimeout(() => {
34626
- lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
34627
- }, delay));
34628
- },
34629
- cancel: () => {
34630
- timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
34631
- },
34632
- flush: () => {
34633
- timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
34634
- }
34635
- };
34636
- }
34637
34619
  function pad(num, totalChars) {
34638
34620
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
34639
34621
  return num;
@@ -34897,6 +34879,7 @@
34897
34879
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
34898
34880
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
34899
34881
  CHANGE_CELL_VALUE: "change_cell_value",
34882
+ CHANGE_CELL_VALUES: "change_cell_values",
34900
34883
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
34901
34884
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
34902
34885
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -37009,6 +36992,24 @@
37009
36992
  }
37010
36993
  }
37011
36994
  }
36995
+ changeFieldValueByRecordIndex(value, recordIndex, field, table) {
36996
+ var _a, _b, _c, _d;
36997
+ if (null === field) return;
36998
+ if (null == recordIndex) return;
36999
+ const rawKey = recordIndex.toString();
37000
+ if (!this.beforeChangedRecordsMap.has(rawKey)) {
37001
+ const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
37002
+ originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
37003
+ this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
37004
+ }
37005
+ if ("string" == typeof field || "number" == typeof field) {
37006
+ const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
37007
+ rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
37008
+ record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
37009
+ let formatValue = value;
37010
+ "number" == typeof beforeChangedValue && isAllDigits(value) && (formatValue = parseFloat(value)), record ? record[field] = formatValue : rawRecords && "number" == typeof recordIndex && (rawRecords[recordIndex] = "Array" === this.addRecordRule ? [] : {}, rawRecords[recordIndex][field] = formatValue);
37011
+ }
37012
+ }
37012
37013
  cacheBeforeChangedRecord(dataIndex, table) {
37013
37014
  var _a;
37014
37015
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -37074,9 +37075,16 @@
37074
37075
  }
37075
37076
  }
37076
37077
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
37077
- for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
37078
- const record = this.beforeChangedRecordsMap.get(key.toString());
37079
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
37078
+ const delta = "add" === type ? insertCount : -insertCount,
37079
+ numericKeys = [];
37080
+ this.beforeChangedRecordsMap.forEach((_, key) => {
37081
+ const numKey = Number(key);
37082
+ Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
37083
+ }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
37084
+ for (let i = 0; i < numericKeys.length; i++) {
37085
+ const key = numericKeys[i],
37086
+ record = this.beforeChangedRecordsMap.get(key.toString());
37087
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
37080
37088
  }
37081
37089
  }
37082
37090
  deleteRecords(recordIndexs) {
@@ -43767,26 +43775,48 @@
43767
43775
  const cellGroup = table.scenegraph.getCell(col, i),
43768
43776
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43769
43777
  chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
43770
- var _a, _b, _c, _d;
43778
+ var _a, _b, _c, _d, _e, _f;
43771
43779
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
43772
43780
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43773
43781
  let isShowTooltip = !isScatter;
43774
- 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 {
43775
- const cellBoundry = table.getCellRelativeRect(col, i),
43776
- bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
43782
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
43783
+ const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
43784
+ {
43785
+ rowEnd: rowEnd1
43786
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
43787
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
43788
+ const {
43789
+ rowEnd: rowEnd2
43790
+ } = table.getBodyVisibleRowRange(0, 5);
43791
+ isShowTooltip = rowEnd2 !== rowEnd;
43792
+ }
43793
+ } else if (i === rowStart && isShowTooltip) {
43794
+ const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
43795
+ {
43796
+ rowStart: rowStart1
43797
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
43798
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
43799
+ const {
43800
+ rowStart: rowStart2
43801
+ } = table.getBodyVisibleRowRange(0, -5);
43802
+ isShowTooltip = rowStart2 !== rowStart;
43803
+ }
43804
+ }
43805
+ if (isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_f = (_e = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _f || _f.call(_e, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
43806
+ const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
43777
43807
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
43778
43808
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43779
43809
  tooltip: !1,
43780
43810
  showTooltipOption: {
43781
- x: canvasXY.x - cellBoundry.left,
43782
- y: absolutePositionTop - cellBoundry.top,
43811
+ x: canvasXY.x,
43812
+ y: absolutePositionTop,
43783
43813
  activeType: "dimension"
43784
43814
  }
43785
43815
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43786
43816
  tooltip: isShowTooltip,
43787
43817
  showTooltipOption: {
43788
- x: canvasXY.x - cellBoundry.left,
43789
- y: absolutePositionTop - cellBoundry.top,
43818
+ x: canvasXY.x,
43819
+ y: absolutePositionTop,
43790
43820
  activeType: "dimension"
43791
43821
  }
43792
43822
  });
@@ -43827,22 +43857,44 @@
43827
43857
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
43828
43858
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43829
43859
  let isShowTooltip = !isScatter;
43830
- 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 {
43831
- const cellBoundry = table.getCellRelativeRect(i, row),
43832
- bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
43860
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
43861
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43862
+ {
43863
+ colEnd: colEnd1
43864
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
43865
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
43866
+ const {
43867
+ colEnd: colEnd2
43868
+ } = table.getBodyVisibleColRange(0, 5);
43869
+ isShowTooltip = colEnd2 !== colEnd;
43870
+ }
43871
+ } else if (i === colStart && isShowTooltip) {
43872
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43873
+ {
43874
+ colStart: colStart1
43875
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
43876
+ if (colStart1 === colStart) isShowTooltip = !0;else {
43877
+ const {
43878
+ colStart: colStart2
43879
+ } = table.getBodyVisibleColRange(0, -5);
43880
+ isShowTooltip = colStart2 !== colStart;
43881
+ }
43882
+ }
43883
+ if (isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
43884
+ const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
43833
43885
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
43834
43886
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43835
43887
  tooltip: !1,
43836
43888
  showTooltipOption: {
43837
- x: absolutePositionLeft - cellBoundry.left,
43838
- y: canvasXY.y - cellBoundry.top,
43889
+ x: absolutePositionLeft,
43890
+ y: canvasXY.y,
43839
43891
  activeType: "dimension"
43840
43892
  }
43841
43893
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43842
43894
  tooltip: isShowTooltip,
43843
43895
  showTooltipOption: {
43844
- x: absolutePositionLeft - cellBoundry.left,
43845
- y: canvasXY.y - cellBoundry.top,
43896
+ x: absolutePositionLeft,
43897
+ y: canvasXY.y,
43846
43898
  activeType: "dimension"
43847
43899
  }
43848
43900
  });
@@ -43851,103 +43903,6 @@
43851
43903
  }, 0), table.scenegraph.updateNextFrame();
43852
43904
  }
43853
43905
  }
43854
- function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
43855
- var _a;
43856
- const {
43857
- rowStart: rowStart
43858
- } = table.getBodyVisibleRowRange();
43859
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
43860
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
43861
- const {
43862
- colStart: colStart
43863
- } = table.getBodyVisibleColRange();
43864
- let colEnd = table.getBodyVisibleColRange().colEnd;
43865
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
43866
- for (let col = colStart; col <= colEnd; col++) {
43867
- isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43868
- for (let i = rowStart; i <= rowEnd; i++) {
43869
- const cellGroup = table.scenegraph.getCell(col, i),
43870
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43871
- chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance)), setTimeout(() => {
43872
- var _a, _b;
43873
- if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
43874
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
43875
- let isShowTooltip = !0;
43876
- "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, {
43877
- activeType: "mark"
43878
- })));
43879
- }
43880
- }, 0), table.scenegraph.updateNextFrame();
43881
- }
43882
- }
43883
- }
43884
- function checkIsShowTooltipForEdgeRow(row, table) {
43885
- var _a, _b;
43886
- let isShowTooltip = !0;
43887
- const {
43888
- rowStart: rowStart
43889
- } = table.getBodyVisibleRowRange();
43890
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
43891
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
43892
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
43893
- if (row === rowEnd && isShowTooltip) {
43894
- const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
43895
- {
43896
- rowEnd: rowEnd1
43897
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
43898
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
43899
- const {
43900
- rowEnd: rowEnd2
43901
- } = table.getBodyVisibleRowRange(0, 5);
43902
- isShowTooltip = rowEnd2 !== rowEnd;
43903
- }
43904
- } else if (row === rowStart && isShowTooltip) {
43905
- const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
43906
- {
43907
- rowStart: rowStart1
43908
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
43909
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
43910
- const {
43911
- rowStart: rowStart2
43912
- } = table.getBodyVisibleRowRange(0, -5);
43913
- isShowTooltip = rowStart2 !== rowStart;
43914
- }
43915
- }
43916
- return isShowTooltip;
43917
- }
43918
- function checkIsShowTooltipForEdgeColumn(col, table) {
43919
- let isShowTooltip = !0;
43920
- const {
43921
- colStart: colStart
43922
- } = table.getBodyVisibleColRange();
43923
- let colEnd = table.getBodyVisibleColRange().colEnd;
43924
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
43925
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
43926
- if (col === colEnd && isShowTooltip) {
43927
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43928
- {
43929
- colEnd: colEnd1
43930
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
43931
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
43932
- const {
43933
- colEnd: colEnd2
43934
- } = table.getBodyVisibleColRange(0, 5);
43935
- isShowTooltip = colEnd2 !== colEnd;
43936
- }
43937
- } else if (col === colStart && isShowTooltip) {
43938
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43939
- {
43940
- colStart: colStart1
43941
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
43942
- if (colStart1 === colStart) isShowTooltip = !0;else {
43943
- const {
43944
- colStart: colStart2
43945
- } = table.getBodyVisibleColRange(0, -5);
43946
- isShowTooltip = colStart2 !== colStart;
43947
- }
43948
- }
43949
- return isShowTooltip;
43950
- }
43951
43906
  function clearChartInstanceListByRowDirection(row, excludedCol, table) {
43952
43907
  var _a;
43953
43908
  if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
@@ -43962,10 +43917,6 @@
43962
43917
  }
43963
43918
  delete chartInstanceListRowByRowDirection[row];
43964
43919
  }
43965
- function clearAllChartInstanceList(table) {
43966
- for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table);
43967
- for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table);
43968
- }
43969
43920
 
43970
43921
  function isValidAlignDomain(domain) {
43971
43922
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -44599,7 +44550,7 @@
44599
44550
  const CHART_NUMBER_TYPE = genNumberType();
44600
44551
  class Chart extends Rect$1 {
44601
44552
  constructor(isShareChartSpec, params) {
44602
- 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 {
44553
+ if (super(params), this.type = "chart", this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
44603
44554
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
44604
44555
  renderCanvas: params.canvas,
44605
44556
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -44620,7 +44571,7 @@
44620
44571
  }
44621
44572
  }
44622
44573
  activate(table) {
44623
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
44574
+ var _a, _b, _c, _d, _e;
44624
44575
  if (this.activeChartInstance) return;
44625
44576
  const {
44626
44577
  col: col,
@@ -44673,7 +44624,7 @@
44673
44624
  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());
44674
44625
  }
44675
44626
  },
44676
- componentShowContent: (null === (_b = table.options.chartDimensionLinkage) || void 0 === _b ? void 0 : _b.showTooltip) && "scatter" !== this.attribute.spec.type ? {
44627
+ componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
44677
44628
  tooltip: {
44678
44629
  dimension: !1,
44679
44630
  mark: !0
@@ -44684,37 +44635,15 @@
44684
44635
  const chartStage = this.activeChartInstance.getStage(),
44685
44636
  matrix = this.globalTransMatrix.clone(),
44686
44637
  stageMatrix = this.stage.window.getViewBoxTransform();
44687
- let brushChangeThrottle;
44688
- 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 => {
44689
- var _a;
44690
- !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");
44691
- }), (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 => {
44638
+ 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 => {
44692
44639
  var _a;
44693
- brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
44694
- })), this.activeChartInstance.on("brushEnd", params => {
44640
+ !1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum);
44641
+ }), this.activeChartInstance.on("brushEnd", params => {
44695
44642
  var _a;
44696
- 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(() => {
44643
+ table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
44697
44644
  Chart.temp = 1;
44698
44645
  }, 0);
44699
- }), (null === (_h = table.options.chartDimensionLinkage) || void 0 === _h ? void 0 : _h.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
44700
- markName: "pie"
44701
- }, params => {
44702
- var _a;
44703
- const categoryField = this.attribute.spec.categoryField,
44704
- datum = {
44705
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44706
- };
44707
- generateChartInstanceListByViewRange(datum, table, !1);
44708
- }), this.activeChartInstance.on("pointerout", {
44709
- markName: "pie"
44710
- }, params => {
44711
- var _a;
44712
- const categoryField = this.attribute.spec.categoryField,
44713
- datum = {
44714
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44715
- };
44716
- generateChartInstanceListByViewRange(datum, table, !0);
44717
- })), this.activeChartInstance.on("dimensionHover", params => {
44646
+ }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
44718
44647
  var _a, _b;
44719
44648
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
44720
44649
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
@@ -44777,13 +44706,12 @@
44777
44706
  }
44778
44707
  }
44779
44708
  }
44780
- })), null === (_k = (_j = table)._bindChartEvent) || void 0 === _k || _k.call(_j, this.activeChartInstance);
44709
+ }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
44781
44710
  }
44782
44711
  deactivate(table, {
44783
44712
  releaseChartInstance = !0,
44784
44713
  releaseColumnChartInstance = !0,
44785
- releaseRowChartInstance = !0,
44786
- releaseAllChartInstance = !1
44714
+ releaseRowChartInstance = !0
44787
44715
  } = {}) {
44788
44716
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
44789
44717
  if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
@@ -44805,7 +44733,7 @@
44805
44733
  } = this.parent;
44806
44734
  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));
44807
44735
  }
44808
- 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));
44736
+ releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table);
44809
44737
  }
44810
44738
  updateData(data) {
44811
44739
  this.attribute.data = data;
@@ -44820,14 +44748,13 @@
44820
44748
  y1: y1,
44821
44749
  x2: x2,
44822
44750
  y2: y2
44823
- } = cellGroup.globalAABBBounds,
44824
- viewBox = {
44825
- 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)),
44826
- 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)),
44827
- 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)),
44828
- 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))
44829
- };
44830
- return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
44751
+ } = cellGroup.globalAABBBounds;
44752
+ return {
44753
+ x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (null !== (_b = null === (_a = table.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0)),
44754
+ x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (null !== (_d = null === (_c = table.options.viewBox) || void 0 === _c ? void 0 : _c.x1) && void 0 !== _d ? _d : 0)),
44755
+ y1: Math.ceil(y1 + padding[0] + table.scrollTop + (null !== (_f = null === (_e = table.options.viewBox) || void 0 === _e ? void 0 : _e.y1) && void 0 !== _f ? _f : 0)),
44756
+ y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (null !== (_h = null === (_g = table.options.viewBox) || void 0 === _g ? void 0 : _g.y1) && void 0 !== _h ? _h : 0))
44757
+ };
44831
44758
  }
44832
44759
  }
44833
44760
  function getTableBounds(col, row, table) {
@@ -45042,7 +44969,7 @@
45042
44969
  {
45043
44970
  width = groupAttribute.width,
45044
44971
  height = groupAttribute.height
45045
- } = chart.attribute,
44972
+ } = (chart.getViewBox(), chart.attribute),
45046
44973
  {
45047
44974
  table: table
45048
44975
  } = chart.getRootNode(),
@@ -45070,9 +44997,8 @@
45070
44997
  });
45071
44998
  }
45072
44999
  }
45073
- const lastViewBox = chart.activeChartInstanceLastViewBox,
45074
- viewBox = chart.getViewBox();
45075
- lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
45000
+ const viewBox = chart.getViewBox();
45001
+ activeChartInstance.updateViewBox({
45076
45002
  x1: 0,
45077
45003
  x2: viewBox.x2 - viewBox.x1,
45078
45004
  y1: 0,
@@ -48590,10 +48516,9 @@
48590
48516
  });
48591
48517
  }
48592
48518
  }
48593
- function updateChartState(scenegraph, datum, selectedDataMode) {
48519
+ function updateChartState(scenegraph, datum) {
48594
48520
  const table = scenegraph.table;
48595
48521
  if (table.isPivotChart()) {
48596
- table._selectedDataMode = selectedDataMode;
48597
48522
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
48598
48523
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
48599
48524
  const newSelectedDataItemsInChart = [];
@@ -49341,22 +49266,16 @@
49341
49266
  resetResidentHoverIcon(col, row) {
49342
49267
  resetResidentHoverIcon(col, row, this);
49343
49268
  }
49344
- deactivateChart(col, row, forceRelease = !1) {
49345
- var _a, _b, _c, _d, _e, _f;
49269
+ deactivateChart(col, row) {
49270
+ var _a, _b, _c;
49346
49271
  if (-1 === col || -1 === row) return;
49347
49272
  const cellGroup = this.getCell(col, row);
49348
49273
  if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
49349
- 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, {
49350
- releaseChartInstance: !0,
49351
- releaseColumnChartInstance: !0,
49352
- releaseRowChartInstance: !0,
49353
- releaseAllChartInstance: !0
49354
- }));
49355
49274
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
49356
- 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) ? {
49357
- 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),
49358
- 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),
49359
- 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)
49275
+ null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, this.table.options.chartDimensionLinkage ? {
49276
+ releaseChartInstance: "scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
49277
+ releaseColumnChartInstance: col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
49278
+ releaseRowChartInstance: row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
49360
49279
  } : void 0);
49361
49280
  }
49362
49281
  }
@@ -49404,8 +49323,8 @@
49404
49323
  updateChartSizeForResizeRowHeight(row) {
49405
49324
  updateChartSizeForResizeRowHeight(this, row);
49406
49325
  }
49407
- updateChartState(datum, selectedDataMode) {
49408
- this.table.isPivotChart() && updateChartState(this, datum, selectedDataMode);
49326
+ updateChartState(datum) {
49327
+ this.table.isPivotChart() && updateChartState(this, datum);
49409
49328
  }
49410
49329
  updateCheckboxCellState(col, row, checked) {
49411
49330
  var _a, _b;
@@ -52432,7 +52351,7 @@
52432
52351
  }, 0 !== e.button) return;
52433
52352
  const eventArgsSet = getCellEventArgsSet(e);
52434
52353
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
52435
- 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;
52354
+ if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
52436
52355
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
52437
52356
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
52438
52357
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -52460,7 +52379,7 @@
52460
52379
  }
52461
52380
  eventManager.dealTableHover(eventArgsSet);
52462
52381
  } else {
52463
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), void stateManager.updateInteractionState(InteractionState.grabing);
52382
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
52464
52383
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52465
52384
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52466
52385
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -52612,7 +52531,7 @@
52612
52531
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
52613
52532
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
52614
52533
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
52615
- table.scenegraph.updateChartState(null, void 0), stateManager.updateInteractionState(InteractionState.grabing);
52534
+ table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
52616
52535
  const {
52617
52536
  eventArgs: eventArgs
52618
52537
  } = eventArgsSet;
@@ -52631,7 +52550,7 @@
52631
52550
  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 {
52632
52551
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
52633
52552
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
52634
- (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);
52553
+ (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null);
52635
52554
  }
52636
52555
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
52637
52556
  var _a, _b, _c;
@@ -52749,15 +52668,7 @@
52749
52668
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
52750
52669
  }), table.scenegraph.stage.addEventListener("wheel", e => {
52751
52670
  var _a;
52752
- if (!e.path.find(node => "legend" === node.name)) {
52753
- null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
52754
- const {
52755
- cellPos: cellPos
52756
- } = table.stateManager.hover,
52757
- prevHoverCellCol = cellPos.col,
52758
- prevHoverCellRow = cellPos.row;
52759
- table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
52760
- }
52671
+ e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
52761
52672
  });
52762
52673
  }
52763
52674
  function bindGesture(eventManager) {
@@ -53537,7 +53448,7 @@
53537
53448
  };
53538
53449
  class EventManager {
53539
53450
  constructor(table) {
53540
- 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(() => {
53451
+ this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.cutRanges = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
53541
53452
  this.bindSelfEvent();
53542
53453
  }, 0));
53543
53454
  }
@@ -53839,15 +53750,25 @@
53839
53750
  } catch (error) {}
53840
53751
  }
53841
53752
  handleCut(e) {
53753
+ var _a;
53842
53754
  return __awaiter$1(this, void 0, void 0, function* () {
53843
- this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
53844
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
53755
+ this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.cutRanges = null === (_a = this.table.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.map(r => ({
53756
+ start: {
53757
+ col: r.start.col,
53758
+ row: r.start.row
53759
+ },
53760
+ end: {
53761
+ col: r.end.col,
53762
+ row: r.end.row
53763
+ }
53764
+ })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
53765
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
53845
53766
  }, 3e4), this.saveClipboardContent();
53846
53767
  });
53847
53768
  }
53848
53769
  handlePaste(e) {
53849
53770
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
53850
- this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
53771
+ this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
53851
53772
  }).catch(() => {
53852
53773
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
53853
53774
  }) : this.executePaste(e);
@@ -53924,9 +53845,9 @@
53924
53845
  }
53925
53846
  clearCutArea(table) {
53926
53847
  try {
53927
- const selectCells = this.cutCellRange;
53928
- if (!selectCells || 0 === selectCells.length) return;
53929
- 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);
53848
+ const ranges = this.cutRanges;
53849
+ if (!ranges || 0 === ranges.length) return;
53850
+ table.changeCellValuesByIds(ranges, "");
53930
53851
  } catch (error) {}
53931
53852
  }
53932
53853
  checkClipboardChanged() {
@@ -56169,7 +56090,7 @@
56169
56090
  }
56170
56091
  constructor(container, options = {}) {
56171
56092
  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;
56172
- 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.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");
56093
+ 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.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");
56173
56094
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
56174
56095
  options: options,
56175
56096
  container: container
@@ -59944,15 +59865,16 @@
59944
59865
  step((generator = generator.apply(thisArg, _arguments || [])).next());
59945
59866
  });
59946
59867
  };
59947
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
59868
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
59948
59869
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
59949
- const recordIndex = table.getRecordShowIndexByCell(col, row),
59870
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
59871
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
59950
59872
  {
59951
59873
  field: field
59952
59874
  } = table.internalProps.layoutMap.getBody(col, row),
59953
59875
  beforeChangeValue = table.getCellRawValue(col, row),
59954
59876
  oldValue = table.getCellOriginValue(col, row);
59955
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
59877
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
59956
59878
  const range = table.getCellRange(col, row),
59957
59879
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
59958
59880
  if (aggregators) {
@@ -59975,16 +59897,24 @@
59975
59897
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
59976
59898
  }
59977
59899
  const changedValue = table.getCellOriginValue(col, row);
59978
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
59979
- col: col,
59980
- row: row,
59981
- rawValue: beforeChangeValue,
59982
- currentValue: oldValue,
59983
- changedValue: changedValue
59984
- }), table.scenegraph.updateNextFrame();
59900
+ if (oldValue !== changedValue && triggerEvent) {
59901
+ const changeValue = {
59902
+ col: col,
59903
+ row: row,
59904
+ recordIndex: recordIndex,
59905
+ field: field,
59906
+ rawValue: beforeChangeValue,
59907
+ currentValue: oldValue,
59908
+ changedValue: changedValue
59909
+ };
59910
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
59911
+ values: [changeValue]
59912
+ });
59913
+ }
59914
+ table.scenegraph.updateNextFrame();
59985
59915
  }
59986
59916
  }
59987
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
59917
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
59988
59918
  var _a, _b;
59989
59919
  return __awaiter(this, void 0, void 0, function* () {
59990
59920
  const changedCellResults = [];
@@ -60006,6 +59936,7 @@
60006
59936
  oldRowValues.push(oldValue);
60007
59937
  }
60008
59938
  }
59939
+ const resultChangeValues = [];
60009
59940
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
60010
59941
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
60011
59942
  const rowValues = values[i];
@@ -60029,25 +59960,34 @@
60029
59960
  if (isCanChange) {
60030
59961
  changedCellResults[i][j] = !0;
60031
59962
  const value = rowValues[j],
60032
- recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
59963
+ recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
59964
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60033
59965
  {
60034
59966
  field: field
60035
59967
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
60036
59968
  beforeChangeValue = beforeChangeValues[i][j],
60037
59969
  oldValue = oldValues[i][j];
60038
- 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);
59970
+ 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);
60039
59971
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
60040
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
60041
- col: startCol + j,
60042
- row: startRow + i,
60043
- rawValue: beforeChangeValue,
60044
- currentValue: oldValue,
60045
- changedValue: changedValue
60046
- });
59972
+ if (oldValue !== changedValue && triggerEvent) {
59973
+ const changeValue = {
59974
+ col: startCol + j,
59975
+ row: startRow + i,
59976
+ recordIndex: recordIndex,
59977
+ field: field,
59978
+ rawValue: beforeChangeValue,
59979
+ currentValue: oldValue,
59980
+ changedValue: changedValue
59981
+ };
59982
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
59983
+ }
60047
59984
  } else changedCellResults[i][j] = !1;
60048
59985
  }
60049
59986
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
60050
59987
  }
59988
+ silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
59989
+ values: resultChangeValues
59990
+ });
60051
59991
  const startRange = table.getCellRange(startCol, startRow),
60052
59992
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
60053
59993
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -60081,6 +60021,58 @@
60081
60021
  return table.scenegraph.updateNextFrame(), changedCellResults;
60082
60022
  });
60083
60023
  }
60024
+ function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
60025
+ var _a, _b;
60026
+ return __awaiter(this, void 0, void 0, function* () {
60027
+ const resultChangeValues = [],
60028
+ processed = new Set(),
60029
+ nextValue = null != value ? value : "";
60030
+ for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
60031
+ const range = ranges[i],
60032
+ startCol = Math.min(range.start.col, range.end.col),
60033
+ endCol = Math.max(range.start.col, range.end.col),
60034
+ startRow = Math.min(range.start.row, range.end.row),
60035
+ endRow = Math.max(range.start.row, range.end.row);
60036
+ if (startCol > endCol || startRow > endRow) continue;
60037
+ const values = [],
60038
+ oldValues = [];
60039
+ for (let row = startRow; row <= endRow; row++) {
60040
+ const rowValues = [],
60041
+ rowOldValues = [];
60042
+ for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
60043
+ values.push(rowValues), oldValues.push(rowOldValues);
60044
+ }
60045
+ const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
60046
+ for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
60047
+ const col = startCol + c,
60048
+ row = startRow + r,
60049
+ key = `${col},${row}`;
60050
+ if (processed.has(key)) continue;
60051
+ if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
60052
+ const oldValue = oldValues[r][c],
60053
+ changedValue = table.getCellOriginValue(col, row);
60054
+ if (oldValue === changedValue) continue;
60055
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
60056
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60057
+ {
60058
+ field: field
60059
+ } = table.internalProps.layoutMap.getBody(col, row);
60060
+ resultChangeValues.push({
60061
+ col: col,
60062
+ row: row,
60063
+ recordIndex: recordIndex,
60064
+ field: field,
60065
+ rawValue: oldValue,
60066
+ currentValue: oldValue,
60067
+ changedValue: changedValue
60068
+ });
60069
+ }
60070
+ }
60071
+ !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
60072
+ values: resultChangeValues
60073
+ });
60074
+ });
60075
+ }
60084
60076
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
60085
60077
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
60086
60078
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -61244,43 +61236,165 @@
61244
61236
  }
61245
61237
  return isValid$1(editorDefine);
61246
61238
  }
61247
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
61248
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
61239
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61240
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61241
+ }
61242
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61243
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61244
+ }
61245
+ changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61246
+ return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61247
+ }
61248
+ changeSourceCellValue(recordIndex, field, value) {
61249
+ const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
61250
+ cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
61251
+ if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
61252
+ this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
61253
+ const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
61254
+ oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
61255
+ changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
61256
+ if (oldValue !== changedValue) {
61257
+ const changeValue = {
61258
+ col: cellAddr.col,
61259
+ row: cellAddr.row,
61260
+ recordIndex: recordIndex,
61261
+ field: field,
61262
+ rawValue: beforeChangeValue,
61263
+ currentValue: oldValue,
61264
+ changedValue: changedValue
61265
+ };
61266
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61267
+ values: [changeValue]
61268
+ });
61269
+ }
61270
+ }
61271
+ changeCellValueByRecord(recordIndex, field, value, options) {
61272
+ var _a, _b, _c, _d, _e;
61273
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
61274
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
61275
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
61276
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
61277
+ let record, oldValue;
61278
+ 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;
61279
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
61280
+ if (oldValue !== changedValue) {
61281
+ const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
61282
+ changeValue = {
61283
+ col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
61284
+ row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
61285
+ recordIndex: recordIndex,
61286
+ field: field,
61287
+ rawValue: oldValue,
61288
+ currentValue: oldValue,
61289
+ changedValue: changedValue
61290
+ };
61291
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61292
+ values: [changeValue]
61293
+ });
61294
+ }
61295
+ autoRefresh && this.refreshAfterSourceChange();
61296
+ }
61297
+ changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
61298
+ return this.changeCellValueByRecord(recordIndex, field, value, {
61299
+ triggerEvent: triggerEvent,
61300
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
61301
+ autoRefresh: !0
61302
+ });
61303
+ }
61304
+ changeCellValuesByRecords(changeValues, options) {
61305
+ var _a, _b, _c, _d, _e, _f, _g;
61306
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
61307
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
61308
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
61309
+ resultChangeValues = [];
61310
+ for (let i = 0; i < changeValues.length; i++) {
61311
+ const {
61312
+ recordIndex: recordIndex,
61313
+ field: field,
61314
+ value: value
61315
+ } = changeValues[i],
61316
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
61317
+ let record, oldValue;
61318
+ 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) {
61319
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
61320
+ if (oldValue !== changedValue) {
61321
+ const changeValue = {
61322
+ col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
61323
+ row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
61324
+ recordIndex: recordIndex,
61325
+ field: field,
61326
+ rawValue: oldValue,
61327
+ currentValue: oldValue,
61328
+ changedValue: changedValue
61329
+ };
61330
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
61331
+ }
61332
+ }
61333
+ }
61334
+ !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61335
+ values: resultChangeValues
61336
+ }), autoRefresh && this.refreshAfterSourceChange();
61249
61337
  }
61250
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
61251
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
61338
+ changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
61339
+ return this.changeCellValuesByRecords(changeValues, {
61340
+ triggerEvent: triggerEvent,
61341
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
61342
+ autoRefresh: !0
61343
+ });
61252
61344
  }
61253
- addRecord(record, recordIndex) {
61345
+ refreshAfterSourceChange(options) {
61346
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
61347
+ const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
61348
+ reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
61349
+ clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
61350
+ 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);
61351
+ const traverseColumns = columns => {
61352
+ var _a, _b, _c, _d;
61353
+ for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
61354
+ const column = columns[i],
61355
+ aggregators = null == column ? void 0 : column.vtable_aggregator;
61356
+ 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);
61357
+ (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
61358
+ }
61359
+ };
61360
+ 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();
61361
+ }
61362
+ addRecord(record, recordIndex, triggerEvent = !0) {
61254
61363
  var _a;
61255
61364
  const success = listTableAddRecord(record, recordIndex, this);
61256
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61365
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61257
61366
  records: [record],
61258
61367
  recordIndex: recordIndex,
61259
61368
  recordCount: 1
61260
61369
  });
61261
61370
  }
61262
- addRecords(records, recordIndex) {
61371
+ addRecords(records, recordIndex, triggerEvent = !0) {
61263
61372
  var _a;
61264
61373
  const success = listTableAddRecords(records, recordIndex, this);
61265
- "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, {
61374
+ "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, {
61266
61375
  records: records,
61267
61376
  recordIndex: recordIndex,
61268
61377
  recordCount: records.length
61269
61378
  });
61270
61379
  }
61271
- deleteRecords(recordIndexs) {
61380
+ deleteRecords(recordIndexs, triggerEvent = !0) {
61272
61381
  var _a;
61273
- listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61382
+ const deletedRecords = [];
61383
+ (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
61384
+ let record = null;
61385
+ record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
61386
+ }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61274
61387
  const rowIndexs = [];
61275
61388
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
61276
- this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61389
+ triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61277
61390
  recordIndexs: recordIndexs,
61391
+ records: deletedRecords,
61278
61392
  rowIndexs: rowIndexs,
61279
61393
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
61280
61394
  });
61281
61395
  }
61282
- updateRecords(records, recordIndexs) {
61283
- listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
61396
+ updateRecords(records, recordIndexs, triggerEvent = !0) {
61397
+ listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
61284
61398
  records: records,
61285
61399
  recordIndexs: recordIndexs,
61286
61400
  updateCount: records.length