@visactor/vtable-calendar 1.22.11-alpha.1 → 1.22.11-alpha.10
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.
- package/dist/vtable-calendar.js +361 -245
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +3 -3
package/dist/vtable-calendar.js
CHANGED
|
@@ -34616,6 +34616,24 @@
|
|
|
34616
34616
|
}, delay));
|
|
34617
34617
|
};
|
|
34618
34618
|
}
|
|
34619
|
+
function cancellableThrottle(func, delay) {
|
|
34620
|
+
let timer = null,
|
|
34621
|
+
lastArgs = null,
|
|
34622
|
+
context = null;
|
|
34623
|
+
return {
|
|
34624
|
+
throttled: function (...args) {
|
|
34625
|
+
lastArgs = args, context = this, timer || (timer = setTimeout(() => {
|
|
34626
|
+
lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
|
|
34627
|
+
}, delay));
|
|
34628
|
+
},
|
|
34629
|
+
cancel: () => {
|
|
34630
|
+
timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
|
|
34631
|
+
},
|
|
34632
|
+
flush: () => {
|
|
34633
|
+
timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
|
|
34634
|
+
}
|
|
34635
|
+
};
|
|
34636
|
+
}
|
|
34619
34637
|
function pad(num, totalChars) {
|
|
34620
34638
|
for (num = `${num}`; num.length < totalChars;) num = "0" + num;
|
|
34621
34639
|
return num;
|
|
@@ -34879,7 +34897,6 @@
|
|
|
34879
34897
|
AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
|
|
34880
34898
|
AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
|
|
34881
34899
|
CHANGE_CELL_VALUE: "change_cell_value",
|
|
34882
|
-
CHANGE_CELL_VALUES: "change_cell_values",
|
|
34883
34900
|
DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
|
|
34884
34901
|
MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
|
|
34885
34902
|
DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
|
|
@@ -35900,6 +35917,9 @@
|
|
|
35900
35917
|
var _a;
|
|
35901
35918
|
return null !== (_a = defaultStyle.textAlign) && void 0 !== _a ? _a : "left";
|
|
35902
35919
|
},
|
|
35920
|
+
get textStickBaseOnAlign() {
|
|
35921
|
+
return defaultStyle.textStickBaseOnAlign;
|
|
35922
|
+
},
|
|
35903
35923
|
get textBaseline() {
|
|
35904
35924
|
var _a;
|
|
35905
35925
|
return null !== (_a = defaultStyle.textBaseline) && void 0 !== _a ? _a : "middle";
|
|
@@ -36583,6 +36603,9 @@
|
|
|
36583
36603
|
get textStick() {
|
|
36584
36604
|
return style.textStick;
|
|
36585
36605
|
},
|
|
36606
|
+
get textStickBaseOnAlign() {
|
|
36607
|
+
return style.textStickBaseOnAlign;
|
|
36608
|
+
},
|
|
36586
36609
|
get marked() {
|
|
36587
36610
|
return style.marked;
|
|
36588
36611
|
},
|
|
@@ -43736,11 +43759,35 @@
|
|
|
43736
43759
|
return hoverMode;
|
|
43737
43760
|
}
|
|
43738
43761
|
|
|
43762
|
+
let brushingChartInstance,
|
|
43763
|
+
brushingChartInstanceCellPos = {
|
|
43764
|
+
col: -1,
|
|
43765
|
+
row: -1
|
|
43766
|
+
};
|
|
43767
|
+
function setBrushingChartInstance(chartInstance, col, row) {
|
|
43768
|
+
brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
|
|
43769
|
+
col: col,
|
|
43770
|
+
row: row
|
|
43771
|
+
};
|
|
43772
|
+
}
|
|
43773
|
+
function clearBrushingChartInstance() {
|
|
43774
|
+
brushingChartInstance = void 0, brushingChartInstanceCellPos = {
|
|
43775
|
+
col: -1,
|
|
43776
|
+
row: -1
|
|
43777
|
+
};
|
|
43778
|
+
}
|
|
43779
|
+
function getBrushingChartInstance() {
|
|
43780
|
+
return brushingChartInstance;
|
|
43781
|
+
}
|
|
43782
|
+
function getBrushingChartInstanceCellPos() {
|
|
43783
|
+
return brushingChartInstanceCellPos;
|
|
43784
|
+
}
|
|
43739
43785
|
const chartInstanceListColumnByColumnDirection = {};
|
|
43740
43786
|
const chartInstanceListRowByRowDirection = {};
|
|
43787
|
+
const delayRunDimensionHoverTimer = [];
|
|
43741
43788
|
function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
43742
43789
|
var _a;
|
|
43743
|
-
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43790
|
+
clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43744
43791
|
const {
|
|
43745
43792
|
rowStart: rowStart
|
|
43746
43793
|
} = table.getBodyVisibleRowRange();
|
|
@@ -43749,76 +43796,40 @@
|
|
|
43749
43796
|
for (let i = rowStart; i <= rowEnd; i++) {
|
|
43750
43797
|
const cellGroup = table.scenegraph.getCell(col, i),
|
|
43751
43798
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43752
|
-
|
|
43753
|
-
|
|
43799
|
+
chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
|
|
43800
|
+
const timer = setTimeout(() => {
|
|
43801
|
+
var _a, _b, _c, _d;
|
|
43754
43802
|
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43755
43803
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43756
43804
|
let isShowTooltip = !isScatter;
|
|
43757
|
-
if (
|
|
43758
|
-
const
|
|
43759
|
-
|
|
43760
|
-
rowEnd: rowEnd1
|
|
43761
|
-
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
43762
|
-
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
43763
|
-
const {
|
|
43764
|
-
rowEnd: rowEnd2
|
|
43765
|
-
} = table.getBodyVisibleRowRange(0, 5);
|
|
43766
|
-
isShowTooltip = rowEnd2 !== rowEnd;
|
|
43767
|
-
}
|
|
43768
|
-
} else if (i === rowStart && isShowTooltip) {
|
|
43769
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
|
|
43770
|
-
{
|
|
43771
|
-
rowStart: rowStart1
|
|
43772
|
-
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
43773
|
-
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
43774
|
-
const {
|
|
43775
|
-
rowStart: rowStart2
|
|
43776
|
-
} = table.getBodyVisibleRowRange(0, -5);
|
|
43777
|
-
isShowTooltip = rowStart2 !== rowStart;
|
|
43778
|
-
}
|
|
43779
|
-
}
|
|
43780
|
-
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 {
|
|
43781
|
-
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
43805
|
+
if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table)), isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_d = (_c = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
43806
|
+
const cellBoundry = table.getCellRelativeRect(col, i),
|
|
43807
|
+
bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
43782
43808
|
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
43783
43809
|
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43784
43810
|
tooltip: !1,
|
|
43785
43811
|
showTooltipOption: {
|
|
43786
|
-
x: canvasXY.x,
|
|
43787
|
-
y: absolutePositionTop,
|
|
43812
|
+
x: canvasXY.x - cellBoundry.left,
|
|
43813
|
+
y: absolutePositionTop - cellBoundry.top,
|
|
43788
43814
|
activeType: "dimension"
|
|
43789
43815
|
}
|
|
43790
43816
|
})) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43791
43817
|
tooltip: isShowTooltip,
|
|
43792
43818
|
showTooltipOption: {
|
|
43793
|
-
x: canvasXY.x,
|
|
43794
|
-
y: absolutePositionTop,
|
|
43819
|
+
x: canvasXY.x - cellBoundry.left,
|
|
43820
|
+
y: absolutePositionTop - cellBoundry.top,
|
|
43795
43821
|
activeType: "dimension"
|
|
43796
43822
|
}
|
|
43797
43823
|
});
|
|
43798
43824
|
}
|
|
43799
43825
|
}
|
|
43800
|
-
}, 0)
|
|
43801
|
-
|
|
43802
|
-
}
|
|
43803
|
-
function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
|
|
43804
|
-
var _a;
|
|
43805
|
-
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
43806
|
-
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
43807
|
-
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
43808
|
-
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
43809
|
-
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43810
|
-
chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
|
|
43811
|
-
releaseChartInstance: !0,
|
|
43812
|
-
releaseColumnChartInstance: !1,
|
|
43813
|
-
releaseRowChartInstance: !1
|
|
43814
|
-
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
43815
|
-
}
|
|
43816
|
-
delete chartInstanceListColumnByColumnDirection[col];
|
|
43826
|
+
}, 0);
|
|
43827
|
+
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
43817
43828
|
}
|
|
43818
43829
|
}
|
|
43819
43830
|
function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
43820
43831
|
var _a;
|
|
43821
|
-
isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
43832
|
+
clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
43822
43833
|
const {
|
|
43823
43834
|
colStart: colStart
|
|
43824
43835
|
} = table.getBodyVisibleColRange();
|
|
@@ -43827,64 +43838,162 @@
|
|
|
43827
43838
|
for (let i = colStart; i <= colEnd; i++) {
|
|
43828
43839
|
const cellGroup = table.scenegraph.getCell(i, row),
|
|
43829
43840
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43830
|
-
|
|
43841
|
+
chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
|
|
43842
|
+
const timer = setTimeout(() => {
|
|
43831
43843
|
var _a, _b, _c, _d;
|
|
43832
43844
|
if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43833
43845
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43834
43846
|
let isShowTooltip = !isScatter;
|
|
43835
|
-
if (
|
|
43836
|
-
const
|
|
43837
|
-
|
|
43838
|
-
colEnd: colEnd1
|
|
43839
|
-
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
43840
|
-
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
43841
|
-
const {
|
|
43842
|
-
colEnd: colEnd2
|
|
43843
|
-
} = table.getBodyVisibleColRange(0, 5);
|
|
43844
|
-
isShowTooltip = colEnd2 !== colEnd;
|
|
43845
|
-
}
|
|
43846
|
-
} else if (i === colStart && isShowTooltip) {
|
|
43847
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43848
|
-
{
|
|
43849
|
-
colStart: colStart1
|
|
43850
|
-
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
43851
|
-
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
43852
|
-
const {
|
|
43853
|
-
colStart: colStart2
|
|
43854
|
-
} = table.getBodyVisibleColRange(0, -5);
|
|
43855
|
-
isShowTooltip = colStart2 !== colStart;
|
|
43856
|
-
}
|
|
43857
|
-
}
|
|
43858
|
-
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 {
|
|
43859
|
-
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
43847
|
+
if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table)), isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
43848
|
+
const cellBoundry = table.getCellRelativeRect(i, row),
|
|
43849
|
+
bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
43860
43850
|
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
43861
43851
|
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43862
43852
|
tooltip: !1,
|
|
43863
43853
|
showTooltipOption: {
|
|
43864
|
-
x: absolutePositionLeft,
|
|
43865
|
-
y: canvasXY.y,
|
|
43854
|
+
x: absolutePositionLeft - cellBoundry.left,
|
|
43855
|
+
y: canvasXY.y - cellBoundry.top,
|
|
43866
43856
|
activeType: "dimension"
|
|
43867
43857
|
}
|
|
43868
43858
|
})) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43869
43859
|
tooltip: isShowTooltip,
|
|
43870
43860
|
showTooltipOption: {
|
|
43871
|
-
x: absolutePositionLeft,
|
|
43872
|
-
y: canvasXY.y,
|
|
43861
|
+
x: absolutePositionLeft - cellBoundry.left,
|
|
43862
|
+
y: canvasXY.y - cellBoundry.top,
|
|
43873
43863
|
activeType: "dimension"
|
|
43874
43864
|
}
|
|
43875
43865
|
});
|
|
43876
43866
|
}
|
|
43877
43867
|
}
|
|
43878
|
-
}, 0)
|
|
43868
|
+
}, 0);
|
|
43869
|
+
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
43879
43870
|
}
|
|
43880
43871
|
}
|
|
43881
|
-
function
|
|
43872
|
+
function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
|
|
43873
|
+
var _a;
|
|
43874
|
+
clearDelayRunDimensionHoverTimers();
|
|
43875
|
+
const {
|
|
43876
|
+
rowStart: rowStart
|
|
43877
|
+
} = table.getBodyVisibleRowRange();
|
|
43878
|
+
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
43879
|
+
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
43880
|
+
const {
|
|
43881
|
+
colStart: colStart
|
|
43882
|
+
} = table.getBodyVisibleColRange();
|
|
43883
|
+
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
43884
|
+
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
43885
|
+
for (let col = colStart; col <= colEnd; col++) {
|
|
43886
|
+
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43887
|
+
for (let i = rowStart; i <= rowEnd; i++) {
|
|
43888
|
+
const cellGroup = table.scenegraph.getCell(col, i),
|
|
43889
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43890
|
+
chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
|
|
43891
|
+
const timer = setTimeout(() => {
|
|
43892
|
+
var _a, _b;
|
|
43893
|
+
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43894
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43895
|
+
let isShowTooltip = !0;
|
|
43896
|
+
"object" == typeof chartDimensionLinkage && (deactivate ? (chartInstanceListColumnByColumnDirection[col][i].setHovered(), chartInstanceListColumnByColumnDirection[col][i].hideTooltip()) : (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table), isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table), chartInstanceListColumnByColumnDirection[col][i].setHovered(datum), isShowTooltip && chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
|
|
43897
|
+
activeType: "mark"
|
|
43898
|
+
})));
|
|
43899
|
+
}
|
|
43900
|
+
}, 0);
|
|
43901
|
+
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
43902
|
+
}
|
|
43903
|
+
}
|
|
43904
|
+
}
|
|
43905
|
+
function checkIsShowTooltipForEdgeRow(row, table) {
|
|
43906
|
+
var _a, _b;
|
|
43907
|
+
let isShowTooltip = !0;
|
|
43908
|
+
const {
|
|
43909
|
+
rowStart: rowStart
|
|
43910
|
+
} = table.getBodyVisibleRowRange();
|
|
43911
|
+
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
43912
|
+
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
43913
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43914
|
+
if (row === rowEnd && isShowTooltip) {
|
|
43915
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
|
|
43916
|
+
{
|
|
43917
|
+
rowEnd: rowEnd1
|
|
43918
|
+
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
43919
|
+
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
43920
|
+
const {
|
|
43921
|
+
rowEnd: rowEnd2
|
|
43922
|
+
} = table.getBodyVisibleRowRange(0, 5);
|
|
43923
|
+
isShowTooltip = rowEnd2 !== rowEnd;
|
|
43924
|
+
}
|
|
43925
|
+
} else if (row === rowStart && isShowTooltip) {
|
|
43926
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
|
|
43927
|
+
{
|
|
43928
|
+
rowStart: rowStart1
|
|
43929
|
+
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
43930
|
+
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
43931
|
+
const {
|
|
43932
|
+
rowStart: rowStart2
|
|
43933
|
+
} = table.getBodyVisibleRowRange(0, -5);
|
|
43934
|
+
isShowTooltip = rowStart2 !== rowStart;
|
|
43935
|
+
}
|
|
43936
|
+
}
|
|
43937
|
+
return isShowTooltip;
|
|
43938
|
+
}
|
|
43939
|
+
function checkIsShowTooltipForEdgeColumn(col, table) {
|
|
43940
|
+
let isShowTooltip = !0;
|
|
43941
|
+
const {
|
|
43942
|
+
colStart: colStart
|
|
43943
|
+
} = table.getBodyVisibleColRange();
|
|
43944
|
+
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
43945
|
+
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
43946
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43947
|
+
if (col === colEnd && isShowTooltip) {
|
|
43948
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43949
|
+
{
|
|
43950
|
+
colEnd: colEnd1
|
|
43951
|
+
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
43952
|
+
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
43953
|
+
const {
|
|
43954
|
+
colEnd: colEnd2
|
|
43955
|
+
} = table.getBodyVisibleColRange(0, 5);
|
|
43956
|
+
isShowTooltip = colEnd2 !== colEnd;
|
|
43957
|
+
}
|
|
43958
|
+
} else if (col === colStart && isShowTooltip) {
|
|
43959
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43960
|
+
{
|
|
43961
|
+
colStart: colStart1
|
|
43962
|
+
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
43963
|
+
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
43964
|
+
const {
|
|
43965
|
+
colStart: colStart2
|
|
43966
|
+
} = table.getBodyVisibleColRange(0, -5);
|
|
43967
|
+
isShowTooltip = colStart2 !== colStart;
|
|
43968
|
+
}
|
|
43969
|
+
}
|
|
43970
|
+
return isShowTooltip;
|
|
43971
|
+
}
|
|
43972
|
+
function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
|
|
43973
|
+
var _a;
|
|
43974
|
+
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
43975
|
+
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
43976
|
+
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
43977
|
+
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
43978
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43979
|
+
isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
43980
|
+
forceRelease: forceRelease,
|
|
43981
|
+
releaseChartInstance: !0,
|
|
43982
|
+
releaseColumnChartInstance: !1,
|
|
43983
|
+
releaseRowChartInstance: !1
|
|
43984
|
+
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
43985
|
+
}
|
|
43986
|
+
delete chartInstanceListColumnByColumnDirection[col];
|
|
43987
|
+
}
|
|
43988
|
+
}
|
|
43989
|
+
function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
|
|
43882
43990
|
var _a;
|
|
43883
43991
|
if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
|
|
43884
43992
|
if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
|
|
43885
43993
|
const cellGroup = table.scenegraph.getCell(Number(i), row),
|
|
43886
43994
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43887
|
-
|
|
43995
|
+
isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
43996
|
+
forceRelease: forceRelease,
|
|
43888
43997
|
releaseChartInstance: !0,
|
|
43889
43998
|
releaseColumnChartInstance: !1,
|
|
43890
43999
|
releaseRowChartInstance: !1
|
|
@@ -43892,6 +44001,19 @@
|
|
|
43892
44001
|
}
|
|
43893
44002
|
delete chartInstanceListRowByRowDirection[row];
|
|
43894
44003
|
}
|
|
44004
|
+
function clearDelayRunDimensionHoverTimers() {
|
|
44005
|
+
for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
|
|
44006
|
+
delayRunDimensionHoverTimer.length = 0;
|
|
44007
|
+
}
|
|
44008
|
+
function clearAllChartInstanceList(table, forceRelease = !1) {
|
|
44009
|
+
clearDelayRunDimensionHoverTimers();
|
|
44010
|
+
for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
|
|
44011
|
+
for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
|
|
44012
|
+
}
|
|
44013
|
+
let disabledTooltipToAllChartInstances = !1;
|
|
44014
|
+
function isDisabledTooltipToAllChartInstances() {
|
|
44015
|
+
return disabledTooltipToAllChartInstances;
|
|
44016
|
+
}
|
|
43895
44017
|
|
|
43896
44018
|
function isValidAlignDomain(domain) {
|
|
43897
44019
|
return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
|
|
@@ -44525,7 +44647,7 @@
|
|
|
44525
44647
|
const CHART_NUMBER_TYPE = genNumberType();
|
|
44526
44648
|
class Chart extends Rect$1 {
|
|
44527
44649
|
constructor(isShareChartSpec, params) {
|
|
44528
|
-
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 {
|
|
44650
|
+
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 {
|
|
44529
44651
|
const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
|
|
44530
44652
|
renderCanvas: params.canvas,
|
|
44531
44653
|
mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
|
|
@@ -44546,7 +44668,7 @@
|
|
|
44546
44668
|
}
|
|
44547
44669
|
}
|
|
44548
44670
|
activate(table) {
|
|
44549
|
-
var _a, _b, _c, _d, _e;
|
|
44671
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
44550
44672
|
if (this.activeChartInstance) return;
|
|
44551
44673
|
const {
|
|
44552
44674
|
col: col,
|
|
@@ -44565,7 +44687,7 @@
|
|
|
44565
44687
|
y1: y1 - table.scrollTop,
|
|
44566
44688
|
y2: y2 - table.scrollTop
|
|
44567
44689
|
});
|
|
44568
|
-
|
|
44690
|
+
this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
|
|
44569
44691
|
renderCanvas: this.attribute.canvas,
|
|
44570
44692
|
mode: "desktop-browser",
|
|
44571
44693
|
canvasControled: !1,
|
|
@@ -44599,7 +44721,7 @@
|
|
|
44599
44721
|
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());
|
|
44600
44722
|
}
|
|
44601
44723
|
},
|
|
44602
|
-
componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
|
|
44724
|
+
componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
|
|
44603
44725
|
tooltip: {
|
|
44604
44726
|
dimension: !1,
|
|
44605
44727
|
mark: !0
|
|
@@ -44610,16 +44732,44 @@
|
|
|
44610
44732
|
const chartStage = this.activeChartInstance.getStage(),
|
|
44611
44733
|
matrix = this.globalTransMatrix.clone(),
|
|
44612
44734
|
stageMatrix = this.stage.window.getViewBoxTransform();
|
|
44735
|
+
let brushChangeThrottle;
|
|
44613
44736
|
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 => {
|
|
44614
44737
|
var _a;
|
|
44615
|
-
!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);
|
|
44738
|
+
!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");
|
|
44739
|
+
}), (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 => {
|
|
44740
|
+
var _a;
|
|
44741
|
+
brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
|
|
44742
|
+
})), this.activeChartInstance.on("brushStart", params => {
|
|
44743
|
+
var _a;
|
|
44744
|
+
const brushingChartInstance = getBrushingChartInstance();
|
|
44745
|
+
brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && (null === (_a = brushingChartInstance.getChart()) || void 0 === _a || _a.getComponentsByKey("brush")[0].clearBrushStateAndMask()), setBrushingChartInstance(this.activeChartInstance, col, row));
|
|
44616
44746
|
}), this.activeChartInstance.on("brushEnd", params => {
|
|
44617
44747
|
var _a;
|
|
44618
|
-
table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
|
|
44748
|
+
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(() => {
|
|
44619
44749
|
Chart.temp = 1;
|
|
44620
44750
|
}, 0);
|
|
44621
|
-
}), table.options.chartDimensionLinkage && this.activeChartInstance.on("
|
|
44751
|
+
}), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
|
|
44752
|
+
markName: "pie"
|
|
44753
|
+
}, params => {
|
|
44754
|
+
var _a;
|
|
44755
|
+
const categoryField = this.attribute.spec.categoryField,
|
|
44756
|
+
datum = {
|
|
44757
|
+
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
44758
|
+
};
|
|
44759
|
+
generateChartInstanceListByViewRange(datum, table, !1);
|
|
44760
|
+
}), this.activeChartInstance.on("pointerout", {
|
|
44761
|
+
markName: "pie"
|
|
44762
|
+
}, params => {
|
|
44763
|
+
var _a;
|
|
44764
|
+
const categoryField = this.attribute.spec.categoryField,
|
|
44765
|
+
datum = {
|
|
44766
|
+
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
44767
|
+
};
|
|
44768
|
+
generateChartInstanceListByViewRange(datum, table, !0);
|
|
44769
|
+
})), this.activeChartInstance.on("dimensionHover", params => {
|
|
44622
44770
|
var _a, _b;
|
|
44771
|
+
if (isDisabledTooltipToAllChartInstances()) return;
|
|
44772
|
+
this.activeChartInstance.disableTooltip(!1);
|
|
44623
44773
|
const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
|
|
44624
44774
|
canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
|
|
44625
44775
|
viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
|
|
@@ -44636,11 +44786,11 @@
|
|
|
44636
44786
|
prev_justShowMarkTooltip = this.justShowMarkTooltip;
|
|
44637
44787
|
params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
|
|
44638
44788
|
let delayRunDimensionHover = !1;
|
|
44639
|
-
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,
|
|
44789
|
+
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) {
|
|
44640
44790
|
const dimensionValue = dimensionInfo.value,
|
|
44641
44791
|
indicatorsAsCol = table.options.indicatorsAsCol;
|
|
44642
|
-
if (delayRunDimensionHover ? (
|
|
44643
|
-
indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
|
|
44792
|
+
if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
|
|
44793
|
+
isDisabledTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
|
|
44644
44794
|
}, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
|
|
44645
44795
|
const series = dimensionInfo.data[0].series,
|
|
44646
44796
|
width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
|
|
@@ -44681,21 +44831,26 @@
|
|
|
44681
44831
|
}
|
|
44682
44832
|
}
|
|
44683
44833
|
}
|
|
44684
|
-
}), null === (
|
|
44834
|
+
})), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
|
|
44835
|
+
}
|
|
44836
|
+
clearDelayRunDimensionHoverTimer() {
|
|
44837
|
+
clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
|
|
44685
44838
|
}
|
|
44686
44839
|
deactivate(table, {
|
|
44840
|
+
forceRelease = !1,
|
|
44687
44841
|
releaseChartInstance = !0,
|
|
44688
44842
|
releaseColumnChartInstance = !0,
|
|
44689
|
-
releaseRowChartInstance = !0
|
|
44843
|
+
releaseRowChartInstance = !0,
|
|
44844
|
+
releaseAllChartInstance = !1
|
|
44690
44845
|
} = {}) {
|
|
44691
44846
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
44692
|
-
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(),
|
|
44693
|
-
null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
44847
|
+
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
|
|
44848
|
+
!this.activeChartInstance || !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
44694
44849
|
x1: -1e3,
|
|
44695
44850
|
x2: -800,
|
|
44696
44851
|
y1: -1e3,
|
|
44697
44852
|
y2: -800
|
|
44698
|
-
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
|
|
44853
|
+
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
|
|
44699
44854
|
const {
|
|
44700
44855
|
col: col,
|
|
44701
44856
|
row: row
|
|
@@ -44708,7 +44863,7 @@
|
|
|
44708
44863
|
} = this.parent;
|
|
44709
44864
|
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));
|
|
44710
44865
|
}
|
|
44711
|
-
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);
|
|
44866
|
+
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));
|
|
44712
44867
|
}
|
|
44713
44868
|
updateData(data) {
|
|
44714
44869
|
this.attribute.data = data;
|
|
@@ -44723,13 +44878,14 @@
|
|
|
44723
44878
|
y1: y1,
|
|
44724
44879
|
x2: x2,
|
|
44725
44880
|
y2: y2
|
|
44726
|
-
} = cellGroup.globalAABBBounds
|
|
44727
|
-
|
|
44728
|
-
|
|
44729
|
-
|
|
44730
|
-
|
|
44731
|
-
|
|
44732
|
-
|
|
44881
|
+
} = cellGroup.globalAABBBounds,
|
|
44882
|
+
viewBox = {
|
|
44883
|
+
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)),
|
|
44884
|
+
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)),
|
|
44885
|
+
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)),
|
|
44886
|
+
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))
|
|
44887
|
+
};
|
|
44888
|
+
return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
|
|
44733
44889
|
}
|
|
44734
44890
|
}
|
|
44735
44891
|
function getTableBounds(col, row, table) {
|
|
@@ -44944,7 +45100,7 @@
|
|
|
44944
45100
|
{
|
|
44945
45101
|
width = groupAttribute.width,
|
|
44946
45102
|
height = groupAttribute.height
|
|
44947
|
-
} =
|
|
45103
|
+
} = chart.attribute,
|
|
44948
45104
|
{
|
|
44949
45105
|
table: table
|
|
44950
45106
|
} = chart.getRootNode(),
|
|
@@ -44972,8 +45128,9 @@
|
|
|
44972
45128
|
});
|
|
44973
45129
|
}
|
|
44974
45130
|
}
|
|
44975
|
-
const
|
|
44976
|
-
|
|
45131
|
+
const lastViewBox = chart.activeChartInstanceLastViewBox,
|
|
45132
|
+
viewBox = chart.getViewBox();
|
|
45133
|
+
lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
|
|
44977
45134
|
x1: 0,
|
|
44978
45135
|
x2: viewBox.x2 - viewBox.x1,
|
|
44979
45136
|
y1: 0,
|
|
@@ -48482,18 +48639,25 @@
|
|
|
48482
48639
|
}
|
|
48483
48640
|
function clearChartCacheImage(scenegraph) {
|
|
48484
48641
|
var _a;
|
|
48642
|
+
const brushingCellPos = getBrushingChartInstanceCellPos();
|
|
48485
48643
|
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
48486
48644
|
const columnGroup = scenegraph.getColGroup(c);
|
|
48487
48645
|
null === (_a = null == columnGroup ? void 0 : columnGroup.getChildren()) || void 0 === _a || _a.forEach(cellNode => {
|
|
48488
|
-
cellNode.children.forEach(node => {
|
|
48646
|
+
brushingCellPos && brushingCellPos.col === cellNode.col && brushingCellPos.row === cellNode.row || cellNode.children.forEach(node => {
|
|
48489
48647
|
"chart" === node.type && (node.cacheCanvas = null, node.addUpdateBoundTag());
|
|
48490
48648
|
});
|
|
48491
48649
|
});
|
|
48492
48650
|
}
|
|
48493
48651
|
}
|
|
48494
|
-
function
|
|
48652
|
+
function clearCellChartCacheImage(col, row, scenegraph) {
|
|
48653
|
+
scenegraph.getCell(col, row).children.forEach(node => {
|
|
48654
|
+
"chart" === node.type && (node.cacheCanvas = null, node.addUpdateBoundTag());
|
|
48655
|
+
});
|
|
48656
|
+
}
|
|
48657
|
+
function updateChartState(scenegraph, datum, selectedDataMode) {
|
|
48495
48658
|
const table = scenegraph.table;
|
|
48496
48659
|
if (table.isPivotChart()) {
|
|
48660
|
+
table._selectedDataMode = selectedDataMode;
|
|
48497
48661
|
const preSelectItemsCount = table._selectedDataItemsInChart.length;
|
|
48498
48662
|
if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
|
|
48499
48663
|
const newSelectedDataItemsInChart = [];
|
|
@@ -49241,16 +49405,37 @@
|
|
|
49241
49405
|
resetResidentHoverIcon(col, row) {
|
|
49242
49406
|
resetResidentHoverIcon(col, row, this);
|
|
49243
49407
|
}
|
|
49244
|
-
deactivateChart(col, row) {
|
|
49245
|
-
var _a, _b, _c;
|
|
49408
|
+
deactivateChart(col, row, forceRelease = !1) {
|
|
49409
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
49410
|
+
if (forceRelease) {
|
|
49411
|
+
const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
|
|
49412
|
+
brushingChartInstance = getBrushingChartInstance();
|
|
49413
|
+
if (brushingChartInstanceCellPos && brushingChartInstance) {
|
|
49414
|
+
const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
|
|
49415
|
+
(null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (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, {
|
|
49416
|
+
forceRelease: !0,
|
|
49417
|
+
releaseChartInstance: !0,
|
|
49418
|
+
releaseColumnChartInstance: !0,
|
|
49419
|
+
releaseRowChartInstance: !0,
|
|
49420
|
+
releaseAllChartInstance: !0
|
|
49421
|
+
})), clearCellChartCacheImage(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row, this), clearBrushingChartInstance();
|
|
49422
|
+
}
|
|
49423
|
+
}
|
|
49246
49424
|
if (-1 === col || -1 === row) return;
|
|
49247
49425
|
const cellGroup = this.getCell(col, row);
|
|
49248
|
-
if (null === (
|
|
49426
|
+
if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
|
|
49427
|
+
if (forceRelease) return 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, {
|
|
49428
|
+
forceRelease: !0,
|
|
49429
|
+
releaseChartInstance: !0,
|
|
49430
|
+
releaseColumnChartInstance: !0,
|
|
49431
|
+
releaseRowChartInstance: !0,
|
|
49432
|
+
releaseAllChartInstance: !0
|
|
49433
|
+
}));
|
|
49249
49434
|
const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
|
|
49250
|
-
null === (
|
|
49251
|
-
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,
|
|
49252
|
-
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,
|
|
49253
|
-
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
|
|
49435
|
+
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) ? {
|
|
49436
|
+
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),
|
|
49437
|
+
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),
|
|
49438
|
+
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)
|
|
49254
49439
|
} : void 0);
|
|
49255
49440
|
}
|
|
49256
49441
|
}
|
|
@@ -49298,8 +49483,15 @@
|
|
|
49298
49483
|
updateChartSizeForResizeRowHeight(row) {
|
|
49299
49484
|
updateChartSizeForResizeRowHeight(this, row);
|
|
49300
49485
|
}
|
|
49301
|
-
updateChartState(datum) {
|
|
49302
|
-
|
|
49486
|
+
updateChartState(datum, selectedDataMode) {
|
|
49487
|
+
var _a, _b, _c;
|
|
49488
|
+
if (this.table.isPivotChart()) {
|
|
49489
|
+
if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
|
|
49490
|
+
const brushingChartInstance = getBrushingChartInstance();
|
|
49491
|
+
brushingChartInstance && (null === (_a = brushingChartInstance.getChart()) || void 0 === _a || _a.getComponentsByKey("brush")[0].clearBrushStateAndMask()), null === (_c = null === (_b = this.table.options.chartDimensionLinkage) || void 0 === _b ? void 0 : _b.clearChartState) || void 0 === _c || _c.call(_b);
|
|
49492
|
+
}
|
|
49493
|
+
updateChartState(this, datum, selectedDataMode);
|
|
49494
|
+
}
|
|
49303
49495
|
}
|
|
49304
49496
|
updateCheckboxCellState(col, row, checked) {
|
|
49305
49497
|
var _a, _b;
|
|
@@ -52326,7 +52518,7 @@
|
|
|
52326
52518
|
}, 0 !== e.button) return;
|
|
52327
52519
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
52328
52520
|
if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
|
|
52329
|
-
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;
|
|
52521
|
+
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;
|
|
52330
52522
|
const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
|
|
52331
52523
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
52332
52524
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -52354,7 +52546,7 @@
|
|
|
52354
52546
|
}
|
|
52355
52547
|
eventManager.dealTableHover(eventArgsSet);
|
|
52356
52548
|
} else {
|
|
52357
|
-
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52549
|
+
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);
|
|
52358
52550
|
if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52359
52551
|
if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52360
52552
|
eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
|
|
@@ -52506,7 +52698,7 @@
|
|
|
52506
52698
|
if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
|
|
52507
52699
|
const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
|
|
52508
52700
|
if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
|
|
52509
|
-
table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
|
|
52701
|
+
table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
|
|
52510
52702
|
const {
|
|
52511
52703
|
eventArgs: eventArgs
|
|
52512
52704
|
} = eventArgsSet;
|
|
@@ -52525,7 +52717,7 @@
|
|
|
52525
52717
|
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 {
|
|
52526
52718
|
stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
|
|
52527
52719
|
const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
52528
|
-
(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);
|
|
52720
|
+
(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);
|
|
52529
52721
|
}
|
|
52530
52722
|
}), table.scenegraph.stage.addEventListener("pointermove", e => {
|
|
52531
52723
|
var _a, _b, _c;
|
|
@@ -52643,7 +52835,15 @@
|
|
|
52643
52835
|
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
|
|
52644
52836
|
}), table.scenegraph.stage.addEventListener("wheel", e => {
|
|
52645
52837
|
var _a;
|
|
52646
|
-
e.path.find(node => "legend" === node.name)
|
|
52838
|
+
if (!e.path.find(node => "legend" === node.name)) {
|
|
52839
|
+
null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
|
|
52840
|
+
const {
|
|
52841
|
+
cellPos: cellPos
|
|
52842
|
+
} = table.stateManager.hover,
|
|
52843
|
+
prevHoverCellCol = cellPos.col,
|
|
52844
|
+
prevHoverCellRow = cellPos.row;
|
|
52845
|
+
table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
|
|
52846
|
+
}
|
|
52647
52847
|
});
|
|
52648
52848
|
}
|
|
52649
52849
|
function bindGesture(eventManager) {
|
|
@@ -52758,11 +52958,13 @@
|
|
|
52758
52958
|
const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
|
|
52759
52959
|
throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
|
|
52760
52960
|
scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
|
|
52761
|
-
|
|
52961
|
+
var _a;
|
|
52962
|
+
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);
|
|
52762
52963
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
52763
52964
|
throttleVerticalWheel(ratio, e);
|
|
52764
52965
|
}), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
|
|
52765
|
-
|
|
52966
|
+
var _a;
|
|
52967
|
+
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);
|
|
52766
52968
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
52767
52969
|
throttleHorizontalWheel(ratio);
|
|
52768
52970
|
});
|
|
@@ -52912,7 +53114,7 @@
|
|
|
52912
53114
|
const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
|
|
52913
53115
|
eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
|
|
52914
53116
|
}
|
|
52915
|
-
});
|
|
53117
|
+
}), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
|
|
52916
53118
|
}
|
|
52917
53119
|
};
|
|
52918
53120
|
eventManager.globalEventListeners.push({
|
|
@@ -53812,13 +54014,7 @@
|
|
|
53812
54014
|
try {
|
|
53813
54015
|
const selectCells = this.cutCellRange;
|
|
53814
54016
|
if (!selectCells || 0 === selectCells.length) return;
|
|
53815
|
-
|
|
53816
|
-
for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && changeValues.push({
|
|
53817
|
-
col: selectCells[i][j].col,
|
|
53818
|
-
row: selectCells[i][j].row,
|
|
53819
|
-
value: void 0
|
|
53820
|
-
});
|
|
53821
|
-
table.changeCellValuesByIds(changeValues);
|
|
54017
|
+
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);
|
|
53822
54018
|
} catch (error) {}
|
|
53823
54019
|
}
|
|
53824
54020
|
checkClipboardChanged() {
|
|
@@ -56061,7 +56257,7 @@
|
|
|
56061
56257
|
}
|
|
56062
56258
|
constructor(container, options = {}) {
|
|
56063
56259
|
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;
|
|
56064
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
56260
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.10", 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");
|
|
56065
56261
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
56066
56262
|
options: options,
|
|
56067
56263
|
container: container
|
|
@@ -59685,9 +59881,9 @@
|
|
|
59685
59881
|
};
|
|
59686
59882
|
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;
|
|
59687
59883
|
const editor = this.table.getEditor(col, row);
|
|
59688
|
-
setTimeout(() => {
|
|
59884
|
+
editor && setTimeout(() => {
|
|
59689
59885
|
var _a;
|
|
59690
|
-
this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
|
|
59886
|
+
editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
|
|
59691
59887
|
referencePosition: referencePosition,
|
|
59692
59888
|
container: this.table.getElement(),
|
|
59693
59889
|
table: this.table,
|
|
@@ -59836,16 +60032,15 @@
|
|
|
59836
60032
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59837
60033
|
});
|
|
59838
60034
|
};
|
|
59839
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table
|
|
60035
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
59840
60036
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
59841
|
-
const
|
|
59842
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60037
|
+
const recordIndex = table.getRecordShowIndexByCell(col, row),
|
|
59843
60038
|
{
|
|
59844
60039
|
field: field
|
|
59845
60040
|
} = table.internalProps.layoutMap.getBody(col, row),
|
|
59846
60041
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
59847
60042
|
oldValue = table.getCellOriginValue(col, row);
|
|
59848
|
-
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value,
|
|
60043
|
+
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
|
|
59849
60044
|
const range = table.getCellRange(col, row),
|
|
59850
60045
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
59851
60046
|
if (aggregators) {
|
|
@@ -59868,24 +60063,16 @@
|
|
|
59868
60063
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
59869
60064
|
}
|
|
59870
60065
|
const changedValue = table.getCellOriginValue(col, row);
|
|
59871
|
-
|
|
59872
|
-
|
|
59873
|
-
|
|
59874
|
-
|
|
59875
|
-
|
|
59876
|
-
|
|
59877
|
-
|
|
59878
|
-
currentValue: oldValue,
|
|
59879
|
-
changedValue: changedValue
|
|
59880
|
-
};
|
|
59881
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
59882
|
-
values: [changeValue]
|
|
59883
|
-
});
|
|
59884
|
-
}
|
|
59885
|
-
table.scenegraph.updateNextFrame();
|
|
60066
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
60067
|
+
col: col,
|
|
60068
|
+
row: row,
|
|
60069
|
+
rawValue: beforeChangeValue,
|
|
60070
|
+
currentValue: oldValue,
|
|
60071
|
+
changedValue: changedValue
|
|
60072
|
+
}), table.scenegraph.updateNextFrame();
|
|
59886
60073
|
}
|
|
59887
60074
|
}
|
|
59888
|
-
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table
|
|
60075
|
+
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
59889
60076
|
var _a, _b;
|
|
59890
60077
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59891
60078
|
const changedCellResults = [];
|
|
@@ -59907,7 +60094,6 @@
|
|
|
59907
60094
|
oldRowValues.push(oldValue);
|
|
59908
60095
|
}
|
|
59909
60096
|
}
|
|
59910
|
-
const resultChangeValues = [];
|
|
59911
60097
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
59912
60098
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
59913
60099
|
const rowValues = values[i];
|
|
@@ -59931,34 +60117,25 @@
|
|
|
59931
60117
|
if (isCanChange) {
|
|
59932
60118
|
changedCellResults[i][j] = !0;
|
|
59933
60119
|
const value = rowValues[j],
|
|
59934
|
-
|
|
59935
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60120
|
+
recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
59936
60121
|
{
|
|
59937
60122
|
field: field
|
|
59938
60123
|
} = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
|
|
59939
60124
|
beforeChangeValue = beforeChangeValues[i][j],
|
|
59940
60125
|
oldValue = oldValues[i][j];
|
|
59941
|
-
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value,
|
|
60126
|
+
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);
|
|
59942
60127
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
59943
|
-
|
|
59944
|
-
|
|
59945
|
-
|
|
59946
|
-
|
|
59947
|
-
|
|
59948
|
-
|
|
59949
|
-
|
|
59950
|
-
currentValue: oldValue,
|
|
59951
|
-
changedValue: changedValue
|
|
59952
|
-
};
|
|
59953
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
59954
|
-
}
|
|
60128
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
60129
|
+
col: startCol + j,
|
|
60130
|
+
row: startRow + i,
|
|
60131
|
+
rawValue: beforeChangeValue,
|
|
60132
|
+
currentValue: oldValue,
|
|
60133
|
+
changedValue: changedValue
|
|
60134
|
+
});
|
|
59955
60135
|
} else changedCellResults[i][j] = !1;
|
|
59956
60136
|
}
|
|
59957
60137
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
59958
60138
|
}
|
|
59959
|
-
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
59960
|
-
values: resultChangeValues
|
|
59961
|
-
});
|
|
59962
60139
|
const startRange = table.getCellRange(startCol, startRow),
|
|
59963
60140
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
59964
60141
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -59992,36 +60169,6 @@
|
|
|
59992
60169
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
59993
60170
|
});
|
|
59994
60171
|
}
|
|
59995
|
-
function listTableChangeCellValuesByIds(changeValues, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
59996
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
59997
|
-
const resultChangeValues = [];
|
|
59998
|
-
for (let i = 0; i < changeValues.length; i++) {
|
|
59999
|
-
const {
|
|
60000
|
-
col: col,
|
|
60001
|
-
row: row,
|
|
60002
|
-
value: value
|
|
60003
|
-
} = changeValues[i],
|
|
60004
|
-
recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
60005
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60006
|
-
{
|
|
60007
|
-
field: field
|
|
60008
|
-
} = table.internalProps.layoutMap.getBody(col, row),
|
|
60009
|
-
oldValue = table.getCellOriginValue(col, row);
|
|
60010
|
-
listTableChangeCellValue(col, row, value, !1, triggerEvent, table, !0), oldValue !== value && triggerEvent && resultChangeValues.push({
|
|
60011
|
-
col: col,
|
|
60012
|
-
row: row,
|
|
60013
|
-
recordIndex: recordIndex,
|
|
60014
|
-
field: field,
|
|
60015
|
-
rawValue: oldValue,
|
|
60016
|
-
currentValue: oldValue,
|
|
60017
|
-
changedValue: value
|
|
60018
|
-
});
|
|
60019
|
-
}
|
|
60020
|
-
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
60021
|
-
values: resultChangeValues
|
|
60022
|
-
});
|
|
60023
|
-
});
|
|
60024
|
-
}
|
|
60025
60172
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
60026
60173
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
60027
60174
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -61185,37 +61332,11 @@
|
|
|
61185
61332
|
}
|
|
61186
61333
|
return isValid$1(editorDefine);
|
|
61187
61334
|
}
|
|
61188
|
-
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0
|
|
61189
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this
|
|
61190
|
-
}
|
|
61191
|
-
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0
|
|
61192
|
-
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this
|
|
61193
|
-
}
|
|
61194
|
-
changeCellValuesByIds(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61195
|
-
return listTableChangeCellValuesByIds(changeValues, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61196
|
-
}
|
|
61197
|
-
changeSourceCellValue(recordIndex, field, value) {
|
|
61198
|
-
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
61199
|
-
cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
61200
|
-
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
|
|
61201
|
-
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
61202
|
-
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
|
|
61203
|
-
oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
|
|
61204
|
-
changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
61205
|
-
if (oldValue !== changedValue) {
|
|
61206
|
-
const changeValue = {
|
|
61207
|
-
col: cellAddr.col,
|
|
61208
|
-
row: cellAddr.row,
|
|
61209
|
-
recordIndex: recordIndex,
|
|
61210
|
-
field: field,
|
|
61211
|
-
rawValue: beforeChangeValue,
|
|
61212
|
-
currentValue: oldValue,
|
|
61213
|
-
changedValue: changedValue
|
|
61214
|
-
};
|
|
61215
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61216
|
-
values: [changeValue]
|
|
61217
|
-
});
|
|
61218
|
-
}
|
|
61335
|
+
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
|
|
61336
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
61337
|
+
}
|
|
61338
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
|
|
61339
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
|
|
61219
61340
|
}
|
|
61220
61341
|
addRecord(record, recordIndex) {
|
|
61221
61342
|
var _a;
|
|
@@ -61237,16 +61358,11 @@
|
|
|
61237
61358
|
}
|
|
61238
61359
|
deleteRecords(recordIndexs) {
|
|
61239
61360
|
var _a;
|
|
61240
|
-
|
|
61241
|
-
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
61242
|
-
let record = null;
|
|
61243
|
-
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
61244
|
-
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
61361
|
+
listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
61245
61362
|
const rowIndexs = [];
|
|
61246
61363
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
61247
61364
|
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
61248
61365
|
recordIndexs: recordIndexs,
|
|
61249
|
-
records: deletedRecords,
|
|
61250
61366
|
rowIndexs: rowIndexs,
|
|
61251
61367
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
61252
61368
|
});
|