@visactor/vtable-gantt 1.22.11-alpha.8 → 1.22.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35301,12 +35301,12 @@
35301
35301
  difference = (adjusted_date.getTime() - startDate.getTime()) / msInWeek;
35302
35302
  break;
35303
35303
  case 'month':
35304
+ const startDaysInMonth = new Date(startDate.getFullYear(), startDate.getMonth() + 1, 0).getDate();
35305
+ const adjustedDaysInMonth = new Date(adjusted_date.getFullYear(), adjusted_date.getMonth() + 1, 0).getDate();
35304
35306
  difference =
35305
35307
  (adjusted_date.getFullYear() - startDate.getFullYear()) * 12 +
35306
35308
  (adjusted_date.getMonth() - startDate.getMonth());
35307
- difference +=
35308
- (adjusted_date.getDate() - startDate.getDate()) /
35309
- new Date(adjusted_date.getFullYear(), adjusted_date.getMonth() + 1, 0).getDate();
35309
+ difference += adjusted_date.getDate() / adjustedDaysInMonth - startDate.getDate() / startDaysInMonth;
35310
35310
  break;
35311
35311
  case 'quarter':
35312
35312
  difference =
@@ -38455,24 +38455,6 @@
38455
38455
  }, delay));
38456
38456
  };
38457
38457
  }
38458
- function cancellableThrottle(func, delay) {
38459
- let timer = null,
38460
- lastArgs = null,
38461
- context = null;
38462
- return {
38463
- throttled: function (...args) {
38464
- lastArgs = args, context = this, timer || (timer = setTimeout(() => {
38465
- lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
38466
- }, delay));
38467
- },
38468
- cancel: () => {
38469
- timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
38470
- },
38471
- flush: () => {
38472
- timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
38473
- }
38474
- };
38475
- }
38476
38458
  function pad(num, totalChars) {
38477
38459
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
38478
38460
  return num;
@@ -47612,35 +47594,11 @@
47612
47594
  return hoverMode;
47613
47595
  }
47614
47596
 
47615
- let brushingChartInstance,
47616
- brushingChartInstanceCellPos = {
47617
- col: -1,
47618
- row: -1
47619
- };
47620
- function setBrushingChartInstance(chartInstance, col, row) {
47621
- brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
47622
- col: col,
47623
- row: row
47624
- };
47625
- }
47626
- function clearBrushingChartInstance() {
47627
- brushingChartInstance = void 0, brushingChartInstanceCellPos = {
47628
- col: -1,
47629
- row: -1
47630
- };
47631
- }
47632
- function getBrushingChartInstance() {
47633
- return brushingChartInstance;
47634
- }
47635
- function getBrushingChartInstanceCellPos() {
47636
- return brushingChartInstanceCellPos;
47637
- }
47638
47597
  const chartInstanceListColumnByColumnDirection = {};
47639
47598
  const chartInstanceListRowByRowDirection = {};
47640
- const delayRunDimensionHoverTimer = [];
47641
47599
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47642
47600
  var _a;
47643
- clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47601
+ isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47644
47602
  const {
47645
47603
  rowStart: rowStart
47646
47604
  } = table.getBodyVisibleRowRange();
@@ -47649,40 +47607,76 @@
47649
47607
  for (let i = rowStart; i <= rowEnd; i++) {
47650
47608
  const cellGroup = table.scenegraph.getCell(col, i),
47651
47609
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47652
- chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
47653
- const timer = setTimeout(() => {
47654
- var _a, _b, _c, _d;
47610
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
47611
+ var _a, _b, _c, _d, _e, _f;
47655
47612
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47656
47613
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47657
47614
  let isShowTooltip = !isScatter;
47658
- if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table)), isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_d = (_c = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47659
- const cellBoundry = table.getCellRelativeRect(col, i),
47660
- bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47615
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
47616
+ const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
47617
+ {
47618
+ rowEnd: rowEnd1
47619
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47620
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47621
+ const {
47622
+ rowEnd: rowEnd2
47623
+ } = table.getBodyVisibleRowRange(0, 5);
47624
+ isShowTooltip = rowEnd2 !== rowEnd;
47625
+ }
47626
+ } else if (i === rowStart && isShowTooltip) {
47627
+ const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
47628
+ {
47629
+ rowStart: rowStart1
47630
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47631
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
47632
+ const {
47633
+ rowStart: rowStart2
47634
+ } = table.getBodyVisibleRowRange(0, -5);
47635
+ isShowTooltip = rowStart2 !== rowStart;
47636
+ }
47637
+ }
47638
+ 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 {
47639
+ const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47661
47640
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
47662
47641
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47663
47642
  tooltip: !1,
47664
47643
  showTooltipOption: {
47665
- x: canvasXY.x - cellBoundry.left,
47666
- y: absolutePositionTop - cellBoundry.top,
47644
+ x: canvasXY.x,
47645
+ y: absolutePositionTop,
47667
47646
  activeType: "dimension"
47668
47647
  }
47669
47648
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47670
47649
  tooltip: isShowTooltip,
47671
47650
  showTooltipOption: {
47672
- x: canvasXY.x - cellBoundry.left,
47673
- y: absolutePositionTop - cellBoundry.top,
47651
+ x: canvasXY.x,
47652
+ y: absolutePositionTop,
47674
47653
  activeType: "dimension"
47675
47654
  }
47676
47655
  });
47677
47656
  }
47678
47657
  }
47679
- }, 0);
47680
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47658
+ }, 0), table.scenegraph.updateNextFrame();
47659
+ }
47660
+ }
47661
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
47662
+ var _a;
47663
+ if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
47664
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
47665
+ if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
47666
+ const cellGroup = table.scenegraph.getCell(col, Number(i)),
47667
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47668
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
47669
+ releaseChartInstance: !0,
47670
+ releaseColumnChartInstance: !1,
47671
+ releaseRowChartInstance: !1
47672
+ }), chartInstanceListColumnByColumnDirection[col][i] = null);
47673
+ }
47674
+ delete chartInstanceListColumnByColumnDirection[col];
47681
47675
  }
47682
47676
  }
47683
47677
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47684
47678
  var _a;
47685
- clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47679
+ isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47686
47680
  const {
47687
47681
  colStart: colStart
47688
47682
  } = table.getBodyVisibleColRange();
@@ -47691,162 +47685,64 @@
47691
47685
  for (let i = colStart; i <= colEnd; i++) {
47692
47686
  const cellGroup = table.scenegraph.getCell(i, row),
47693
47687
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47694
- chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
47695
- const timer = setTimeout(() => {
47688
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
47696
47689
  var _a, _b, _c, _d;
47697
47690
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
47698
47691
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47699
47692
  let isShowTooltip = !isScatter;
47700
- if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table)), isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
47701
- const cellBoundry = table.getCellRelativeRect(i, row),
47702
- bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47693
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
47694
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47695
+ {
47696
+ colEnd: colEnd1
47697
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47698
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
47699
+ const {
47700
+ colEnd: colEnd2
47701
+ } = table.getBodyVisibleColRange(0, 5);
47702
+ isShowTooltip = colEnd2 !== colEnd;
47703
+ }
47704
+ } else if (i === colStart && isShowTooltip) {
47705
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47706
+ {
47707
+ colStart: colStart1
47708
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47709
+ if (colStart1 === colStart) isShowTooltip = !0;else {
47710
+ const {
47711
+ colStart: colStart2
47712
+ } = table.getBodyVisibleColRange(0, -5);
47713
+ isShowTooltip = colStart2 !== colStart;
47714
+ }
47715
+ }
47716
+ 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 {
47717
+ const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47703
47718
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
47704
47719
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47705
47720
  tooltip: !1,
47706
47721
  showTooltipOption: {
47707
- x: absolutePositionLeft - cellBoundry.left,
47708
- y: canvasXY.y - cellBoundry.top,
47722
+ x: absolutePositionLeft,
47723
+ y: canvasXY.y,
47709
47724
  activeType: "dimension"
47710
47725
  }
47711
47726
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47712
47727
  tooltip: isShowTooltip,
47713
47728
  showTooltipOption: {
47714
- x: absolutePositionLeft - cellBoundry.left,
47715
- y: canvasXY.y - cellBoundry.top,
47729
+ x: absolutePositionLeft,
47730
+ y: canvasXY.y,
47716
47731
  activeType: "dimension"
47717
47732
  }
47718
47733
  });
47719
47734
  }
47720
47735
  }
47721
- }, 0);
47722
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47736
+ }, 0), table.scenegraph.updateNextFrame();
47723
47737
  }
47724
47738
  }
47725
- function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
47726
- var _a;
47727
- clearDelayRunDimensionHoverTimers();
47728
- const {
47729
- rowStart: rowStart
47730
- } = table.getBodyVisibleRowRange();
47731
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47732
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47733
- const {
47734
- colStart: colStart
47735
- } = table.getBodyVisibleColRange();
47736
- let colEnd = table.getBodyVisibleColRange().colEnd;
47737
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47738
- for (let col = colStart; col <= colEnd; col++) {
47739
- isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47740
- for (let i = rowStart; i <= rowEnd; i++) {
47741
- const cellGroup = table.scenegraph.getCell(col, i),
47742
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47743
- chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
47744
- const timer = setTimeout(() => {
47745
- var _a, _b;
47746
- if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47747
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47748
- let isShowTooltip = !0;
47749
- "object" == typeof chartDimensionLinkage && (deactivate ? (chartInstanceListColumnByColumnDirection[col][i].setHovered(), chartInstanceListColumnByColumnDirection[col][i].hideTooltip()) : (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table), isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table), chartInstanceListColumnByColumnDirection[col][i].setHovered(datum), isShowTooltip && chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
47750
- activeType: "mark"
47751
- })));
47752
- }
47753
- }, 0);
47754
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47755
- }
47756
- }
47757
- }
47758
- function checkIsShowTooltipForEdgeRow(row, table) {
47759
- var _a, _b;
47760
- let isShowTooltip = !0;
47761
- const {
47762
- rowStart: rowStart
47763
- } = table.getBodyVisibleRowRange();
47764
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47765
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47766
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47767
- if (row === rowEnd && isShowTooltip) {
47768
- const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
47769
- {
47770
- rowEnd: rowEnd1
47771
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47772
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47773
- const {
47774
- rowEnd: rowEnd2
47775
- } = table.getBodyVisibleRowRange(0, 5);
47776
- isShowTooltip = rowEnd2 !== rowEnd;
47777
- }
47778
- } else if (row === rowStart && isShowTooltip) {
47779
- const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
47780
- {
47781
- rowStart: rowStart1
47782
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47783
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
47784
- const {
47785
- rowStart: rowStart2
47786
- } = table.getBodyVisibleRowRange(0, -5);
47787
- isShowTooltip = rowStart2 !== rowStart;
47788
- }
47789
- }
47790
- return isShowTooltip;
47791
- }
47792
- function checkIsShowTooltipForEdgeColumn(col, table) {
47793
- let isShowTooltip = !0;
47794
- const {
47795
- colStart: colStart
47796
- } = table.getBodyVisibleColRange();
47797
- let colEnd = table.getBodyVisibleColRange().colEnd;
47798
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47799
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47800
- if (col === colEnd && isShowTooltip) {
47801
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47802
- {
47803
- colEnd: colEnd1
47804
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47805
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
47806
- const {
47807
- colEnd: colEnd2
47808
- } = table.getBodyVisibleColRange(0, 5);
47809
- isShowTooltip = colEnd2 !== colEnd;
47810
- }
47811
- } else if (col === colStart && isShowTooltip) {
47812
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47813
- {
47814
- colStart: colStart1
47815
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47816
- if (colStart1 === colStart) isShowTooltip = !0;else {
47817
- const {
47818
- colStart: colStart2
47819
- } = table.getBodyVisibleColRange(0, -5);
47820
- isShowTooltip = colStart2 !== colStart;
47821
- }
47822
- }
47823
- return isShowTooltip;
47824
- }
47825
- function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
47826
- var _a;
47827
- if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
47828
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
47829
- if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
47830
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
47831
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47832
- isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47833
- forceRelease: forceRelease,
47834
- releaseChartInstance: !0,
47835
- releaseColumnChartInstance: !1,
47836
- releaseRowChartInstance: !1
47837
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
47838
- }
47839
- delete chartInstanceListColumnByColumnDirection[col];
47840
- }
47841
- }
47842
- function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
47739
+ function clearChartInstanceListByRowDirection(row, excludedCol, table) {
47843
47740
  var _a;
47844
47741
  if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
47845
47742
  if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
47846
47743
  const cellGroup = table.scenegraph.getCell(Number(i), row),
47847
47744
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47848
- isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47849
- forceRelease: forceRelease,
47745
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
47850
47746
  releaseChartInstance: !0,
47851
47747
  releaseColumnChartInstance: !1,
47852
47748
  releaseRowChartInstance: !1
@@ -47854,19 +47750,6 @@
47854
47750
  }
47855
47751
  delete chartInstanceListRowByRowDirection[row];
47856
47752
  }
47857
- function clearDelayRunDimensionHoverTimers() {
47858
- for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
47859
- delayRunDimensionHoverTimer.length = 0;
47860
- }
47861
- function clearAllChartInstanceList(table, forceRelease = !1) {
47862
- clearDelayRunDimensionHoverTimers();
47863
- for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
47864
- for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
47865
- }
47866
- let disabledShowTooltipToAllChartInstances = !1;
47867
- function isDisabledShowTooltipToAllChartInstances() {
47868
- return disabledShowTooltipToAllChartInstances;
47869
- }
47870
47753
 
47871
47754
  function isValidAlignDomain(domain) {
47872
47755
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -48500,7 +48383,7 @@
48500
48383
  const CHART_NUMBER_TYPE = genNumberType();
48501
48384
  class Chart extends Rect$2 {
48502
48385
  constructor(isShareChartSpec, params) {
48503
- 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 {
48386
+ 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 {
48504
48387
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
48505
48388
  renderCanvas: params.canvas,
48506
48389
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -48521,7 +48404,7 @@
48521
48404
  }
48522
48405
  }
48523
48406
  activate(table) {
48524
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48407
+ var _a, _b, _c, _d, _e;
48525
48408
  if (this.activeChartInstance) return;
48526
48409
  const {
48527
48410
  col: col,
@@ -48540,7 +48423,7 @@
48540
48423
  y1: y1 - table.scrollTop,
48541
48424
  y2: y2 - table.scrollTop
48542
48425
  });
48543
- this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
48426
+ null === (_a = this.activeChartInstance) || void 0 === _a || _a.release(), this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
48544
48427
  renderCanvas: this.attribute.canvas,
48545
48428
  mode: "desktop-browser",
48546
48429
  canvasControled: !1,
@@ -48574,7 +48457,7 @@
48574
48457
  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());
48575
48458
  }
48576
48459
  },
48577
- componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
48460
+ componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
48578
48461
  tooltip: {
48579
48462
  dimension: !1,
48580
48463
  mark: !0
@@ -48585,43 +48468,16 @@
48585
48468
  const chartStage = this.activeChartInstance.getStage(),
48586
48469
  matrix = this.globalTransMatrix.clone(),
48587
48470
  stageMatrix = this.stage.window.getViewBoxTransform();
48588
- let brushChangeThrottle;
48589
48471
  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 => {
48590
48472
  var _a;
48591
- !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");
48592
- }), (null === (_d = table.options.chartDimensionLinkage) || void 0 === _d ? void 0 : _d.listenBrushChange) && (brushChangeThrottle = cancellableThrottle(table.scenegraph.updateChartState.bind(table.scenegraph), null !== (_f = null === (_e = table.options.chartDimensionLinkage) || void 0 === _e ? void 0 : _e.brushChangeDelay) && void 0 !== _f ? _f : 100), this.activeChartInstance.on("brushChange", params => {
48593
- var _a;
48594
- brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
48595
- })), this.activeChartInstance.on("brushStart", params => {
48596
- const brushingChartInstance = getBrushingChartInstance();
48597
- brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
48473
+ !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);
48598
48474
  }), this.activeChartInstance.on("brushEnd", params => {
48599
48475
  var _a;
48600
- 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(() => {
48476
+ table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
48601
48477
  Chart.temp = 1;
48602
48478
  }, 0);
48603
- }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
48604
- markName: "pie"
48605
- }, params => {
48606
- var _a;
48607
- const categoryField = this.attribute.spec.categoryField,
48608
- datum = {
48609
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48610
- };
48611
- generateChartInstanceListByViewRange(datum, table, !1);
48612
- }), this.activeChartInstance.on("pointerout", {
48613
- markName: "pie"
48614
- }, params => {
48615
- var _a;
48616
- const categoryField = this.attribute.spec.categoryField,
48617
- datum = {
48618
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48619
- };
48620
- generateChartInstanceListByViewRange(datum, table, !0);
48621
- })), this.activeChartInstance.on("dimensionHover", params => {
48479
+ }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
48622
48480
  var _a, _b;
48623
- if (isDisabledShowTooltipToAllChartInstances()) return;
48624
- this.activeChartInstance.disableTooltip(!1);
48625
48481
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
48626
48482
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
48627
48483
  viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
@@ -48638,11 +48494,11 @@
48638
48494
  prev_justShowMarkTooltip = this.justShowMarkTooltip;
48639
48495
  params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
48640
48496
  let delayRunDimensionHover = !1;
48641
- if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, this.clearDelayRunDimensionHoverTimer()), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
48497
+ if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
48642
48498
  const dimensionValue = dimensionInfo.value,
48643
48499
  indicatorsAsCol = table.options.indicatorsAsCol;
48644
- if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
48645
- isDisabledShowTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
48500
+ if (delayRunDimensionHover ? (clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = setTimeout(() => {
48501
+ indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
48646
48502
  }, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
48647
48503
  const series = dimensionInfo.data[0].series,
48648
48504
  width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
@@ -48683,26 +48539,21 @@
48683
48539
  }
48684
48540
  }
48685
48541
  }
48686
- })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledShowTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
48687
- }
48688
- clearDelayRunDimensionHoverTimer() {
48689
- clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
48542
+ }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
48690
48543
  }
48691
48544
  deactivate(table, {
48692
- forceRelease = !1,
48693
48545
  releaseChartInstance = !0,
48694
48546
  releaseColumnChartInstance = !0,
48695
- releaseRowChartInstance = !0,
48696
- releaseAllChartInstance = !1
48547
+ releaseRowChartInstance = !0
48697
48548
  } = {}) {
48698
48549
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48699
- if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
48700
- !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48550
+ if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
48551
+ null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48701
48552
  x1: -1e3,
48702
48553
  x2: -800,
48703
48554
  y1: -1e3,
48704
48555
  y2: -800
48705
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
48556
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
48706
48557
  const {
48707
48558
  col: col,
48708
48559
  row: row
@@ -48715,7 +48566,7 @@
48715
48566
  } = this.parent;
48716
48567
  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));
48717
48568
  }
48718
- releaseAllChartInstance ? clearAllChartInstanceList(table, forceRelease) : (releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table, forceRelease), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table, forceRelease));
48569
+ 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);
48719
48570
  }
48720
48571
  updateData(data) {
48721
48572
  this.attribute.data = data;
@@ -48730,14 +48581,13 @@
48730
48581
  y1: y1,
48731
48582
  x2: x2,
48732
48583
  y2: y2
48733
- } = cellGroup.globalAABBBounds,
48734
- viewBox = {
48735
- 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)),
48736
- 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)),
48737
- 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)),
48738
- 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))
48739
- };
48740
- return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
48584
+ } = cellGroup.globalAABBBounds;
48585
+ return {
48586
+ 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)),
48587
+ 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)),
48588
+ 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)),
48589
+ 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))
48590
+ };
48741
48591
  }
48742
48592
  }
48743
48593
  function getTableBounds(col, row, table) {
@@ -48952,7 +48802,7 @@
48952
48802
  {
48953
48803
  width = groupAttribute.width,
48954
48804
  height = groupAttribute.height
48955
- } = chart.attribute,
48805
+ } = (chart.getViewBox(), chart.attribute),
48956
48806
  {
48957
48807
  table: table
48958
48808
  } = chart.getRootNode(),
@@ -48980,9 +48830,8 @@
48980
48830
  });
48981
48831
  }
48982
48832
  }
48983
- const lastViewBox = chart.activeChartInstanceLastViewBox,
48984
- viewBox = chart.getViewBox();
48985
- lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
48833
+ const viewBox = chart.getViewBox();
48834
+ activeChartInstance.updateViewBox({
48986
48835
  x1: 0,
48987
48836
  x2: viewBox.x2 - viewBox.x1,
48988
48837
  y1: 0,
@@ -51779,7 +51628,7 @@
51779
51628
  rowUpdatePos = isValid$1(rowUpdatePos) ? isValid$1(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
51780
51629
  }
51781
51630
  let updateAfter;
51782
- if (scene.table._clearRowRangeHeightsMap(), addRows.forEach(row => {
51631
+ if (scene.table._clearRowRangeHeightsMap(), verifyProxyRowStatus(scene), addRows.forEach(row => {
51783
51632
  const needUpdateAfter = addRow(row, scene, skipUpdateProxy);
51784
51633
  updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.insert(row);
51785
51634
  }), resetRowNumberAndY(scene), addRows.length) {
@@ -52009,6 +51858,25 @@
52009
51858
  function setRowSeriesNumberCellNeedUpdate(startUpdateRow, scene) {
52010
51859
  if (scene.table.isHasSeriesNumber()) for (let row = startUpdateRow; row <= scene.table.rowCount - 1; row++) updateCell$1(0, row, scene.table, !1);
52011
51860
  }
51861
+ function verifyProxyRowStatus(scene) {
51862
+ const proxy = scene.proxy,
51863
+ {
51864
+ rowStart: rowStart,
51865
+ rowEnd: rowEnd,
51866
+ rowLimit: rowLimit,
51867
+ totalRow: totalRow
51868
+ } = proxy;
51869
+ if (rowStart > rowEnd) return proxy.rowStart = scene.table.columnHeaderLevelCount, proxy.rowEnd = Math.min(totalRow, proxy.rowStart + rowLimit - 1), void (proxy.currentRow = 0);
51870
+ if (rowStart + rowLimit - 1 > totalRow) {
51871
+ const oldRowStart = proxy.rowStart,
51872
+ newRowStart = Math.max(scene.table.columnHeaderLevelCount, totalRow - rowLimit + 1);
51873
+ if (newRowStart === oldRowStart) return;
51874
+ proxy.rowStart = newRowStart, proxy.rowEnd = Math.min(totalRow, newRowStart + rowLimit - 1), proxy.currentRow = proxy.rowEnd + 1;
51875
+ const addRowCount = oldRowStart - proxy.rowStart;
51876
+ for (let i = 0; i < addRowCount; i++) addRowCellGroup(proxy.rowStart + i, scene);
51877
+ proxy.rowUpdatePos = proxy.rowStart;
51878
+ }
51879
+ }
52012
51880
 
52013
51881
  function createReactContainer(table) {
52014
51882
  const {
@@ -52500,10 +52368,9 @@
52500
52368
  });
52501
52369
  }
52502
52370
  }
52503
- function updateChartState(scenegraph, datum, selectedDataMode) {
52371
+ function updateChartState(scenegraph, datum) {
52504
52372
  const table = scenegraph.table;
52505
52373
  if (table.isPivotChart()) {
52506
- table._selectedDataMode = selectedDataMode;
52507
52374
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
52508
52375
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
52509
52376
  const newSelectedDataItemsInChart = [];
@@ -53251,39 +53118,16 @@
53251
53118
  resetResidentHoverIcon(col, row) {
53252
53119
  resetResidentHoverIcon(col, row, this);
53253
53120
  }
53254
- deactivateChart(col, row, forceRelease = !1) {
53255
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53256
- if (-1 === col || -1 === row) {
53257
- if (forceRelease) {
53258
- const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
53259
- brushingChartInstance = getBrushingChartInstance();
53260
- if (brushingChartInstanceCellPos && brushingChartInstance) {
53261
- const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
53262
- (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (clearBrushingChartInstance(), null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
53263
- forceRelease: !0,
53264
- releaseChartInstance: !0,
53265
- releaseColumnChartInstance: !0,
53266
- releaseRowChartInstance: !0,
53267
- releaseAllChartInstance: !0
53268
- }));
53269
- }
53270
- }
53271
- return;
53272
- }
53121
+ deactivateChart(col, row) {
53122
+ var _a, _b, _c;
53123
+ if (-1 === col || -1 === row) return;
53273
53124
  const cellGroup = this.getCell(col, row);
53274
- if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
53275
- if (forceRelease) return clearBrushingChartInstance(), void (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _e ? void 0 : _e.deactivate) || void 0 === _f || _f.call(_e, this.table, {
53276
- forceRelease: !0,
53277
- releaseChartInstance: !0,
53278
- releaseColumnChartInstance: !0,
53279
- releaseRowChartInstance: !0,
53280
- releaseAllChartInstance: !0
53281
- }));
53125
+ if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
53282
53126
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
53283
- null === (_h = null === (_g = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _g ? void 0 : _g.deactivate) || void 0 === _h || _h.call(_g, this.table, (null === (_j = this.table.options.chartDimensionLinkage) || void 0 === _j ? void 0 : _j.showTooltip) ? {
53284
- 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),
53285
- 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),
53286
- 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)
53127
+ 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 ? {
53128
+ 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,
53129
+ 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,
53130
+ 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
53287
53131
  } : void 0);
53288
53132
  }
53289
53133
  }
@@ -53331,15 +53175,8 @@
53331
53175
  updateChartSizeForResizeRowHeight(row) {
53332
53176
  updateChartSizeForResizeRowHeight(this, row);
53333
53177
  }
53334
- updateChartState(datum, selectedDataMode) {
53335
- var _a, _b;
53336
- if (this.table.isPivotChart()) {
53337
- if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
53338
- const brushingChartInstance = getBrushingChartInstance();
53339
- brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), null === (_b = null === (_a = this.table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.clearChartState) || void 0 === _b || _b.call(_a);
53340
- }
53341
- updateChartState(this, datum, selectedDataMode);
53342
- }
53178
+ updateChartState(datum) {
53179
+ this.table.isPivotChart() && updateChartState(this, datum);
53343
53180
  }
53344
53181
  updateCheckboxCellState(col, row, checked) {
53345
53182
  var _a, _b;
@@ -53995,7 +53832,7 @@
53995
53832
  } else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
53996
53833
  if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
53997
53834
  if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
53998
- let extendSelectRange = !0;
53835
+ let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
53999
53836
  -1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
54000
53837
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
54001
53838
  if (currentRange) {
@@ -54117,7 +53954,7 @@
54117
53954
  };
54118
53955
  enableShiftSelectMode || (currentRange.end = currentRange.start), scenegraph.deleteLastSelectedRangeComponents(), scenegraph.updateCellSelectBorder(currentRange);
54119
53956
  } else {
54120
- let extendSelectRange = !0;
53957
+ let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
54121
53958
  if (-1 === cellPos.col || -1 === cellPos.row || enableCtrlSelectMode || (state.select.ranges = [], scenegraph.deleteAllSelectBorder()), "cell" !== state.select.headerSelectMode && table.isColumnHeader(col, row)) {
54122
53959
  const cellRange = table.getCellRange(col, row);
54123
53960
  "body" === state.select.headerSelectMode ? state.select.ranges.push({
@@ -56366,7 +56203,7 @@
56366
56203
  }, 0 !== e.button) return;
56367
56204
  const eventArgsSet = getCellEventArgsSet(e);
56368
56205
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
56369
- if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && (table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0)), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
56206
+ 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;
56370
56207
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
56371
56208
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
56372
56209
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -56394,7 +56231,7 @@
56394
56231
  }
56395
56232
  eventManager.dealTableHover(eventArgsSet);
56396
56233
  } else {
56397
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), void stateManager.updateInteractionState(InteractionState.grabing);
56234
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
56398
56235
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56399
56236
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56400
56237
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -56546,7 +56383,7 @@
56546
56383
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
56547
56384
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
56548
56385
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
56549
- table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
56386
+ table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
56550
56387
  const {
56551
56388
  eventArgs: eventArgs
56552
56389
  } = eventArgsSet;
@@ -56565,7 +56402,7 @@
56565
56402
  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 {
56566
56403
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
56567
56404
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
56568
- (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
56405
+ (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);
56569
56406
  }
56570
56407
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
56571
56408
  var _a, _b, _c;
@@ -56683,15 +56520,7 @@
56683
56520
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
56684
56521
  }), table.scenegraph.stage.addEventListener("wheel", e => {
56685
56522
  var _a;
56686
- if (!e.path.find(node => "legend" === node.name)) {
56687
- null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
56688
- const {
56689
- cellPos: cellPos
56690
- } = table.stateManager.hover,
56691
- prevHoverCellCol = cellPos.col,
56692
- prevHoverCellRow = cellPos.row;
56693
- table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
56694
- }
56523
+ e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
56695
56524
  });
56696
56525
  }
56697
56526
  function bindGesture(eventManager) {
@@ -56806,13 +56635,11 @@
56806
56635
  const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
56807
56636
  throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
56808
56637
  scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
56809
- var _a;
56810
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
56638
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
56811
56639
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
56812
56640
  throttleVerticalWheel(ratio, e);
56813
56641
  }), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
56814
- var _a;
56815
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
56642
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
56816
56643
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
56817
56644
  throttleHorizontalWheel(ratio);
56818
56645
  });
@@ -56962,7 +56789,7 @@
56962
56789
  const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
56963
56790
  eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
56964
56791
  }
56965
- }), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
56792
+ });
56966
56793
  }
56967
56794
  };
56968
56795
  eventManager.globalEventListeners.push({
@@ -59798,13 +59625,41 @@
59798
59625
 
59799
59626
  class CustomCellStylePlugin {
59800
59627
  constructor(table, customCellStyle, customCellStyleArrangement) {
59801
- this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
59628
+ this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement, this._customCellStyleArrangementIndex = new Map(), this._customCellStyleArrangementTombstoneCount = 0, this._rebuildCustomCellStyleArrangementIndex();
59629
+ }
59630
+ _getCustomCellStyleArrangementKey(cellPos) {
59631
+ if (cellPos.range) {
59632
+ const {
59633
+ start: start,
59634
+ end: end
59635
+ } = cellPos.range;
59636
+ return `range:${start.col},${start.row},${end.col},${end.row}`;
59637
+ }
59638
+ if (void 0 !== cellPos.col && void 0 !== cellPos.row) return `cell:${cellPos.col},${cellPos.row}`;
59639
+ }
59640
+ _rebuildCustomCellStyleArrangementIndex() {
59641
+ this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0;
59642
+ for (let i = 0; i < this.customCellStyleArrangement.length; i++) {
59643
+ if (!isValid$1(this.customCellStyleArrangement[i].customStyleId)) {
59644
+ this._customCellStyleArrangementTombstoneCount++;
59645
+ continue;
59646
+ }
59647
+ const key = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[i].cellPosition);
59648
+ key && this._customCellStyleArrangementIndex.set(key, i);
59649
+ }
59650
+ }
59651
+ _compactCustomCellStyleArrangementIfNeeded() {
59652
+ const length = this.customCellStyleArrangement.length;
59653
+ if (this._customCellStyleArrangementTombstoneCount < 2048) return;
59654
+ if (4 * this._customCellStyleArrangementTombstoneCount < length) return;
59655
+ const compacted = this.customCellStyleArrangement.filter(style => isValid$1(style.customStyleId));
59656
+ compacted.length !== this.customCellStyleArrangement.length ? (this.customCellStyleArrangement.length = 0, this.customCellStyleArrangement.push(...compacted), this._rebuildCustomCellStyleArrangementIndex()) : this._customCellStyleArrangementTombstoneCount = 0;
59802
59657
  }
59803
59658
  getCustomCellStyle(col, row) {
59804
59659
  const customStyleIds = this.getCustomCellStyleIds(col, row);
59805
59660
  if (customStyleIds.length) {
59806
59661
  const styles = [];
59807
- return customStyleIds.forEach(customStyleId => {
59662
+ if (customStyleIds.forEach(customStyleId => {
59808
59663
  const styleOption = this.getCustomCellStyleOption(customStyleId);
59809
59664
  if (isFunction$3(null == styleOption ? void 0 : styleOption.style)) {
59810
59665
  const style = styleOption.style({
@@ -59817,14 +59672,15 @@
59817
59672
  });
59818
59673
  styles.push(style);
59819
59674
  } else (null == styleOption ? void 0 : styleOption.style) && styles.push(styleOption.style);
59820
- }), merge({}, ...styles);
59675
+ }), !styles.length) return;
59676
+ return merge({}, ...styles);
59821
59677
  }
59822
59678
  }
59823
59679
  getCustomCellStyleIds(col, row) {
59824
59680
  const customStyleIds = [],
59825
59681
  range = this.table.getCellRange(col, row);
59826
59682
  for (let c = range.start.col; c <= range.end.col; c++) for (let r = range.start.row; r <= range.end.row; r++) this.customCellStyleArrangement.forEach(style => {
59827
- style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId);
59683
+ isValid$1(style.customStyleId) && (style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId));
59828
59684
  });
59829
59685
  return customStyleIds;
59830
59686
  }
@@ -59845,21 +59701,35 @@
59845
59701
  }), this.table.scenegraph.updateNextFrame();
59846
59702
  }
59847
59703
  arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
59848
- var _a;
59849
- const index = this.customCellStyleArrangement.findIndex(style => style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row);
59850
- if (-1 === index && !customStyleId) return;
59851
- if (-1 === index && customStyleId) this.customCellStyleArrangement.push({
59852
- cellPosition: {
59853
- col: cellPos.col,
59854
- row: cellPos.row,
59855
- range: cellPos.range
59856
- },
59857
- customStyleId: customStyleId
59858
- });else {
59704
+ var _a, _b;
59705
+ const inputKey = this._getCustomCellStyleArrangementKey(cellPos);
59706
+ let index = inputKey && null !== (_a = this._customCellStyleArrangementIndex.get(inputKey)) && void 0 !== _a ? _a : -1;
59707
+ if (inputKey && -1 !== index) {
59708
+ const item = this.customCellStyleArrangement[index],
59709
+ itemKey = item ? this._getCustomCellStyleArrangementKey(item.cellPosition) : void 0;
59710
+ item && isValid$1(item.customStyleId) && itemKey === inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$1(style.customStyleId) && this._getCustomCellStyleArrangementKey(style.cellPosition) === inputKey), -1 !== index ? this._customCellStyleArrangementIndex.set(inputKey, index) : this._customCellStyleArrangementIndex.delete(inputKey));
59711
+ }
59712
+ if (-1 !== index || inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$1(style.customStyleId) && (style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row))), -1 === index && !customStyleId) return;
59713
+ if (-1 === index && customStyleId) {
59714
+ this.customCellStyleArrangement.push({
59715
+ cellPosition: {
59716
+ col: cellPos.col,
59717
+ row: cellPos.row,
59718
+ range: cellPos.range
59719
+ },
59720
+ customStyleId: customStyleId
59721
+ });
59722
+ const pushedIndex = this.customCellStyleArrangement.length - 1,
59723
+ pushedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[pushedIndex].cellPosition);
59724
+ pushedKey && this._customCellStyleArrangementIndex.set(pushedKey, pushedIndex);
59725
+ } else {
59859
59726
  if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
59860
- customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
59727
+ if (customStyleId) this.customCellStyleArrangement[index].customStyleId = customStyleId;else {
59728
+ const existedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[index].cellPosition);
59729
+ isValid$1(this.customCellStyleArrangement[index].customStyleId) && this._customCellStyleArrangementTombstoneCount++, this.customCellStyleArrangement[index].customStyleId = null, existedKey && this._customCellStyleArrangementIndex.delete(existedKey), this._compactCustomCellStyleArrangementIfNeeded();
59730
+ }
59861
59731
  }
59862
- const style = null === (_a = this.getCustomCellStyleOption(customStyleId)) || void 0 === _a ? void 0 : _a.style;
59732
+ const style = customStyleId ? null === (_b = this.getCustomCellStyleOption(customStyleId)) || void 0 === _b ? void 0 : _b.style : void 0;
59863
59733
  if (style) {
59864
59734
  forceFastUpdate = !0;
59865
59735
  for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
@@ -59874,7 +59744,7 @@
59874
59744
  this.table.scenegraph.updateNextFrame();
59875
59745
  }
59876
59746
  updateCustomCell(customCellStyle, customCellStyleArrangement) {
59877
- this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, customCellStyle.forEach(cellStyle => {
59747
+ this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0, customCellStyle.forEach(cellStyle => {
59878
59748
  this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
59879
59749
  }), customCellStyleArrangement.forEach(cellStyle => {
59880
59750
  this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
@@ -60105,7 +59975,7 @@
60105
59975
  }
60106
59976
  constructor(container, options = {}) {
60107
59977
  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;
60108
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.8", 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");
59978
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
60109
59979
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
60110
59980
  options: options,
60111
59981
  container: container
@@ -61319,16 +61189,16 @@
61319
61189
  startCol = enableShiftSelectMode && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.col) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.col : colIndex,
61320
61190
  endCol = colIndex,
61321
61191
  endRow = this.rowCount - 1;
61322
- this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
61192
+ this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
61323
61193
  }
61324
61194
  dragSelectCol(colIndex, enableCtrlSelectMode) {
61325
61195
  var _a, _b;
61326
61196
  const currentSelectRanges = this.stateManager.select.ranges,
61327
61197
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
61328
- lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
61198
+ lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
61329
61199
  }
61330
61200
  endDragSelect() {
61331
- this.stateManager.updateInteractionState(InteractionState.default), this.stateManager.endSelectCells(!1, !1);
61201
+ this.stateManager.updateInteractionState(InteractionState.default);
61332
61202
  }
61333
61203
  startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
61334
61204
  var _a, _b, _c, _d, _e, _f;
@@ -61336,13 +61206,13 @@
61336
61206
  startRow = isShift && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.row) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.row : rowIndex,
61337
61207
  endCol = this.colCount - 1,
61338
61208
  endRow = rowIndex;
61339
- this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
61209
+ this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
61340
61210
  }
61341
61211
  dragSelectRow(rowIndex, isCtrl) {
61342
61212
  var _a, _b;
61343
61213
  const currentSelectRanges = this.stateManager.select.ranges,
61344
61214
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
61345
- lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
61215
+ lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
61346
61216
  }
61347
61217
  get recordsCount() {
61348
61218
  var _a;
@@ -62264,6 +62134,18 @@
62264
62134
  }
62265
62135
  return !1;
62266
62136
  }
62137
+ updateCellContent(col, row) {
62138
+ this.scenegraph.updateCellContent(col, row);
62139
+ }
62140
+ updateCellContentRange(startCol, startRow, endCol, endRow) {
62141
+ for (let i = startCol; i <= endCol; i++) for (let j = startRow; j <= endRow; j++) this.scenegraph.updateCellContent(i, j);
62142
+ }
62143
+ updateCellContentRanges(ranges) {
62144
+ for (let i = 0; i < ranges.length; i++) {
62145
+ const range = ranges[i];
62146
+ this.updateCellContentRange(range.start.col, range.start.row, range.end.col, range.end.row);
62147
+ }
62148
+ }
62267
62149
  }
62268
62150
 
62269
62151
  const chartTypes = {};
@@ -63766,8 +63648,8 @@
63766
63648
  col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1;
63767
63649
  const editor = this.table.getEditor(col, row);
63768
63650
  editor && setTimeout(() => {
63769
- var _a;
63770
- editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
63651
+ var _a, _b;
63652
+ editor && this.editingEditor !== editor && (null === (_b = (_a = editor).prepareEdit) || void 0 === _b || _b.call(_a, {
63771
63653
  referencePosition: referencePosition,
63772
63654
  container: this.table.getElement(),
63773
63655
  table: this.table,
@@ -63780,14 +63662,14 @@
63780
63662
  this.listenersId.push(doubleClickEventId, clickEventId, selectedChangedEventId);
63781
63663
  }
63782
63664
  startEditCell(col, row, value, editElement) {
63783
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
63665
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
63784
63666
  if (this.editingEditor) return;
63785
63667
  const editor = this.table.getEditor(col, row);
63786
63668
  if (editor) {
63787
- if (editElement && editor.setElement(editElement), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
63788
- if (null === (_b = null === (_a = this.table.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.isAggregation) || void 0 === _b ? void 0 : _b.call(_a, col, row)) {
63789
- const isPivotTable = null === (_d = (_c = this.table).isPivotTable) || void 0 === _d ? void 0 : _d.call(_c),
63790
- updateAggregationOnEditCell = !!isPivotTable && (null === (_f = null === (_e = this.table.internalProps) || void 0 === _e ? void 0 : _e.dataConfig) || void 0 === _f ? void 0 : _f.updateAggregationOnEditCell);
63669
+ if (editElement && (null === (_b = (_a = editor).setElement) || void 0 === _b || _b.call(_a, editElement)), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
63670
+ if (null === (_d = null === (_c = this.table.internalProps.layoutMap) || void 0 === _c ? void 0 : _c.isAggregation) || void 0 === _d ? void 0 : _d.call(_c, col, row)) {
63671
+ const isPivotTable = null === (_f = (_e = this.table).isPivotTable) || void 0 === _f ? void 0 : _f.call(_e),
63672
+ updateAggregationOnEditCell = !!isPivotTable && (null === (_h = null === (_g = this.table.internalProps) || void 0 === _g ? void 0 : _g.dataConfig) || void 0 === _h ? void 0 : _h.updateAggregationOnEditCell);
63791
63673
  if (!isPivotTable || isPivotTable && updateAggregationOnEditCell) return;
63792
63674
  }
63793
63675
  const record = this.table.getCellRawRecord(col, row);
@@ -63806,9 +63688,9 @@
63806
63688
  height: rect.height
63807
63689
  }
63808
63690
  };
63809
- col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (_g = editor.beginEditing) || void 0 === _g || _g.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_h = editor.bindSuccessCallback) || void 0 === _h || _h.call(editor, () => {
63691
+ col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (_j = editor.beginEditing) || void 0 === _j || _j.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_k = editor.bindSuccessCallback) || void 0 === _k || _k.call(editor, () => {
63810
63692
  this.completeEdit();
63811
- }), null === (_j = editor.onStart) || void 0 === _j || _j.call(editor, {
63693
+ }), null === (_l = editor.onStart) || void 0 === _l || _l.call(editor, {
63812
63694
  value: dataValue,
63813
63695
  endEdit: () => {
63814
63696
  this.completeEdit();
@@ -76410,7 +76292,7 @@
76410
76292
  PluginManager: PluginManager
76411
76293
  });
76412
76294
 
76413
- const version = "1.22.11-alpha.8";
76295
+ const version = "1.22.11";
76414
76296
 
76415
76297
  exports.Gantt = Gantt;
76416
76298
  exports.TYPES = index$4;