@visactor/vtable-gantt 1.22.11-alpha.0 → 1.22.11-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/vtable-gantt.js +368 -254
- package/dist/vtable-gantt.min.js +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable-gantt.js
CHANGED
|
@@ -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;
|
|
@@ -38736,6 +38718,7 @@
|
|
|
38736
38718
|
AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
|
|
38737
38719
|
AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
|
|
38738
38720
|
CHANGE_CELL_VALUE: "change_cell_value",
|
|
38721
|
+
CHANGE_CELL_VALUES: "change_cell_values",
|
|
38739
38722
|
DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
|
|
38740
38723
|
MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
|
|
38741
38724
|
DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
|
|
@@ -40862,6 +40845,24 @@
|
|
|
40862
40845
|
}
|
|
40863
40846
|
}
|
|
40864
40847
|
}
|
|
40848
|
+
changeFieldValueByRecordIndex(value, recordIndex, field, table) {
|
|
40849
|
+
var _a, _b, _c, _d;
|
|
40850
|
+
if (null === field) return;
|
|
40851
|
+
if (null == recordIndex) return;
|
|
40852
|
+
const rawKey = recordIndex.toString();
|
|
40853
|
+
if (!this.beforeChangedRecordsMap.has(rawKey)) {
|
|
40854
|
+
const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
|
|
40855
|
+
originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
40856
|
+
this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
|
|
40857
|
+
}
|
|
40858
|
+
if ("string" == typeof field || "number" == typeof field) {
|
|
40859
|
+
const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
|
|
40860
|
+
rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
|
|
40861
|
+
record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
40862
|
+
let formatValue = value;
|
|
40863
|
+
"number" == typeof beforeChangedValue && isAllDigits(value) && (formatValue = parseFloat(value)), record ? record[field] = formatValue : rawRecords && "number" == typeof recordIndex && (rawRecords[recordIndex] = "Array" === this.addRecordRule ? [] : {}, rawRecords[recordIndex][field] = formatValue);
|
|
40864
|
+
}
|
|
40865
|
+
}
|
|
40865
40866
|
cacheBeforeChangedRecord(dataIndex, table) {
|
|
40866
40867
|
var _a;
|
|
40867
40868
|
if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
|
|
@@ -40927,9 +40928,16 @@
|
|
|
40927
40928
|
}
|
|
40928
40929
|
}
|
|
40929
40930
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
|
|
40930
|
-
|
|
40931
|
-
|
|
40932
|
-
|
|
40931
|
+
const delta = "add" === type ? insertCount : -insertCount,
|
|
40932
|
+
numericKeys = [];
|
|
40933
|
+
this.beforeChangedRecordsMap.forEach((_, key) => {
|
|
40934
|
+
const numKey = Number(key);
|
|
40935
|
+
Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
|
|
40936
|
+
}), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
|
|
40937
|
+
for (let i = 0; i < numericKeys.length; i++) {
|
|
40938
|
+
const key = numericKeys[i],
|
|
40939
|
+
record = this.beforeChangedRecordsMap.get(key.toString());
|
|
40940
|
+
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
40933
40941
|
}
|
|
40934
40942
|
}
|
|
40935
40943
|
deleteRecords(recordIndexs) {
|
|
@@ -47620,26 +47628,48 @@
|
|
|
47620
47628
|
const cellGroup = table.scenegraph.getCell(col, i),
|
|
47621
47629
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47622
47630
|
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
|
|
47623
|
-
var _a, _b, _c, _d;
|
|
47631
|
+
var _a, _b, _c, _d, _e, _f;
|
|
47624
47632
|
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47625
47633
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47626
47634
|
let isShowTooltip = !isScatter;
|
|
47627
|
-
if (isScatter
|
|
47628
|
-
const
|
|
47629
|
-
|
|
47635
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
|
|
47636
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
|
|
47637
|
+
{
|
|
47638
|
+
rowEnd: rowEnd1
|
|
47639
|
+
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
47640
|
+
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
47641
|
+
const {
|
|
47642
|
+
rowEnd: rowEnd2
|
|
47643
|
+
} = table.getBodyVisibleRowRange(0, 5);
|
|
47644
|
+
isShowTooltip = rowEnd2 !== rowEnd;
|
|
47645
|
+
}
|
|
47646
|
+
} else if (i === rowStart && isShowTooltip) {
|
|
47647
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
|
|
47648
|
+
{
|
|
47649
|
+
rowStart: rowStart1
|
|
47650
|
+
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
47651
|
+
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
47652
|
+
const {
|
|
47653
|
+
rowStart: rowStart2
|
|
47654
|
+
} = table.getBodyVisibleRowRange(0, -5);
|
|
47655
|
+
isShowTooltip = rowStart2 !== rowStart;
|
|
47656
|
+
}
|
|
47657
|
+
}
|
|
47658
|
+
if (isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_f = (_e = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _f || _f.call(_e, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47659
|
+
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
47630
47660
|
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
47631
47661
|
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47632
47662
|
tooltip: !1,
|
|
47633
47663
|
showTooltipOption: {
|
|
47634
|
-
x: canvasXY.x
|
|
47635
|
-
y: absolutePositionTop
|
|
47664
|
+
x: canvasXY.x,
|
|
47665
|
+
y: absolutePositionTop,
|
|
47636
47666
|
activeType: "dimension"
|
|
47637
47667
|
}
|
|
47638
47668
|
})) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47639
47669
|
tooltip: isShowTooltip,
|
|
47640
47670
|
showTooltipOption: {
|
|
47641
|
-
x: canvasXY.x
|
|
47642
|
-
y: absolutePositionTop
|
|
47671
|
+
x: canvasXY.x,
|
|
47672
|
+
y: absolutePositionTop,
|
|
47643
47673
|
activeType: "dimension"
|
|
47644
47674
|
}
|
|
47645
47675
|
});
|
|
@@ -47680,22 +47710,44 @@
|
|
|
47680
47710
|
if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47681
47711
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47682
47712
|
let isShowTooltip = !isScatter;
|
|
47683
|
-
if (isScatter
|
|
47684
|
-
const
|
|
47685
|
-
|
|
47713
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
|
|
47714
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47715
|
+
{
|
|
47716
|
+
colEnd: colEnd1
|
|
47717
|
+
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
47718
|
+
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
47719
|
+
const {
|
|
47720
|
+
colEnd: colEnd2
|
|
47721
|
+
} = table.getBodyVisibleColRange(0, 5);
|
|
47722
|
+
isShowTooltip = colEnd2 !== colEnd;
|
|
47723
|
+
}
|
|
47724
|
+
} else if (i === colStart && isShowTooltip) {
|
|
47725
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47726
|
+
{
|
|
47727
|
+
colStart: colStart1
|
|
47728
|
+
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
47729
|
+
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
47730
|
+
const {
|
|
47731
|
+
colStart: colStart2
|
|
47732
|
+
} = table.getBodyVisibleColRange(0, -5);
|
|
47733
|
+
isShowTooltip = colStart2 !== colStart;
|
|
47734
|
+
}
|
|
47735
|
+
}
|
|
47736
|
+
if (isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47737
|
+
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
47686
47738
|
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
47687
47739
|
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47688
47740
|
tooltip: !1,
|
|
47689
47741
|
showTooltipOption: {
|
|
47690
|
-
x: absolutePositionLeft
|
|
47691
|
-
y: canvasXY.y
|
|
47742
|
+
x: absolutePositionLeft,
|
|
47743
|
+
y: canvasXY.y,
|
|
47692
47744
|
activeType: "dimension"
|
|
47693
47745
|
}
|
|
47694
47746
|
})) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47695
47747
|
tooltip: isShowTooltip,
|
|
47696
47748
|
showTooltipOption: {
|
|
47697
|
-
x: absolutePositionLeft
|
|
47698
|
-
y: canvasXY.y
|
|
47749
|
+
x: absolutePositionLeft,
|
|
47750
|
+
y: canvasXY.y,
|
|
47699
47751
|
activeType: "dimension"
|
|
47700
47752
|
}
|
|
47701
47753
|
});
|
|
@@ -47704,103 +47756,6 @@
|
|
|
47704
47756
|
}, 0), table.scenegraph.updateNextFrame();
|
|
47705
47757
|
}
|
|
47706
47758
|
}
|
|
47707
|
-
function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
|
|
47708
|
-
var _a;
|
|
47709
|
-
const {
|
|
47710
|
-
rowStart: rowStart
|
|
47711
|
-
} = table.getBodyVisibleRowRange();
|
|
47712
|
-
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
47713
|
-
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
47714
|
-
const {
|
|
47715
|
-
colStart: colStart
|
|
47716
|
-
} = table.getBodyVisibleColRange();
|
|
47717
|
-
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
47718
|
-
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
47719
|
-
for (let col = colStart; col <= colEnd; col++) {
|
|
47720
|
-
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
47721
|
-
for (let i = rowStart; i <= rowEnd; i++) {
|
|
47722
|
-
const cellGroup = table.scenegraph.getCell(col, i),
|
|
47723
|
-
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47724
|
-
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance)), setTimeout(() => {
|
|
47725
|
-
var _a, _b;
|
|
47726
|
-
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47727
|
-
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47728
|
-
let isShowTooltip = !0;
|
|
47729
|
-
"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, {
|
|
47730
|
-
activeType: "mark"
|
|
47731
|
-
})));
|
|
47732
|
-
}
|
|
47733
|
-
}, 0), table.scenegraph.updateNextFrame();
|
|
47734
|
-
}
|
|
47735
|
-
}
|
|
47736
|
-
}
|
|
47737
|
-
function checkIsShowTooltipForEdgeRow(row, table) {
|
|
47738
|
-
var _a, _b;
|
|
47739
|
-
let isShowTooltip = !0;
|
|
47740
|
-
const {
|
|
47741
|
-
rowStart: rowStart
|
|
47742
|
-
} = table.getBodyVisibleRowRange();
|
|
47743
|
-
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
47744
|
-
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
47745
|
-
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47746
|
-
if (row === rowEnd && isShowTooltip) {
|
|
47747
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
|
|
47748
|
-
{
|
|
47749
|
-
rowEnd: rowEnd1
|
|
47750
|
-
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
47751
|
-
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
47752
|
-
const {
|
|
47753
|
-
rowEnd: rowEnd2
|
|
47754
|
-
} = table.getBodyVisibleRowRange(0, 5);
|
|
47755
|
-
isShowTooltip = rowEnd2 !== rowEnd;
|
|
47756
|
-
}
|
|
47757
|
-
} else if (row === rowStart && isShowTooltip) {
|
|
47758
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
|
|
47759
|
-
{
|
|
47760
|
-
rowStart: rowStart1
|
|
47761
|
-
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
47762
|
-
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
47763
|
-
const {
|
|
47764
|
-
rowStart: rowStart2
|
|
47765
|
-
} = table.getBodyVisibleRowRange(0, -5);
|
|
47766
|
-
isShowTooltip = rowStart2 !== rowStart;
|
|
47767
|
-
}
|
|
47768
|
-
}
|
|
47769
|
-
return isShowTooltip;
|
|
47770
|
-
}
|
|
47771
|
-
function checkIsShowTooltipForEdgeColumn(col, table) {
|
|
47772
|
-
let isShowTooltip = !0;
|
|
47773
|
-
const {
|
|
47774
|
-
colStart: colStart
|
|
47775
|
-
} = table.getBodyVisibleColRange();
|
|
47776
|
-
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
47777
|
-
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
47778
|
-
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47779
|
-
if (col === colEnd && isShowTooltip) {
|
|
47780
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47781
|
-
{
|
|
47782
|
-
colEnd: colEnd1
|
|
47783
|
-
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
47784
|
-
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
47785
|
-
const {
|
|
47786
|
-
colEnd: colEnd2
|
|
47787
|
-
} = table.getBodyVisibleColRange(0, 5);
|
|
47788
|
-
isShowTooltip = colEnd2 !== colEnd;
|
|
47789
|
-
}
|
|
47790
|
-
} else if (col === colStart && isShowTooltip) {
|
|
47791
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47792
|
-
{
|
|
47793
|
-
colStart: colStart1
|
|
47794
|
-
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
47795
|
-
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
47796
|
-
const {
|
|
47797
|
-
colStart: colStart2
|
|
47798
|
-
} = table.getBodyVisibleColRange(0, -5);
|
|
47799
|
-
isShowTooltip = colStart2 !== colStart;
|
|
47800
|
-
}
|
|
47801
|
-
}
|
|
47802
|
-
return isShowTooltip;
|
|
47803
|
-
}
|
|
47804
47759
|
function clearChartInstanceListByRowDirection(row, excludedCol, table) {
|
|
47805
47760
|
var _a;
|
|
47806
47761
|
if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
|
|
@@ -47815,10 +47770,6 @@
|
|
|
47815
47770
|
}
|
|
47816
47771
|
delete chartInstanceListRowByRowDirection[row];
|
|
47817
47772
|
}
|
|
47818
|
-
function clearAllChartInstanceList(table) {
|
|
47819
|
-
for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table);
|
|
47820
|
-
for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table);
|
|
47821
|
-
}
|
|
47822
47773
|
|
|
47823
47774
|
function isValidAlignDomain(domain) {
|
|
47824
47775
|
return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
|
|
@@ -48452,7 +48403,7 @@
|
|
|
48452
48403
|
const CHART_NUMBER_TYPE = genNumberType();
|
|
48453
48404
|
class Chart extends Rect$2 {
|
|
48454
48405
|
constructor(isShareChartSpec, params) {
|
|
48455
|
-
if (super(params), this.type = "chart", this.
|
|
48406
|
+
if (super(params), this.type = "chart", this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
|
|
48456
48407
|
const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
|
|
48457
48408
|
renderCanvas: params.canvas,
|
|
48458
48409
|
mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
|
|
@@ -48473,7 +48424,7 @@
|
|
|
48473
48424
|
}
|
|
48474
48425
|
}
|
|
48475
48426
|
activate(table) {
|
|
48476
|
-
var _a, _b, _c, _d, _e
|
|
48427
|
+
var _a, _b, _c, _d, _e;
|
|
48477
48428
|
if (this.activeChartInstance) return;
|
|
48478
48429
|
const {
|
|
48479
48430
|
col: col,
|
|
@@ -48526,7 +48477,7 @@
|
|
|
48526
48477
|
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());
|
|
48527
48478
|
}
|
|
48528
48479
|
},
|
|
48529
|
-
componentShowContent:
|
|
48480
|
+
componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
|
|
48530
48481
|
tooltip: {
|
|
48531
48482
|
dimension: !1,
|
|
48532
48483
|
mark: !0
|
|
@@ -48537,37 +48488,15 @@
|
|
|
48537
48488
|
const chartStage = this.activeChartInstance.getStage(),
|
|
48538
48489
|
matrix = this.globalTransMatrix.clone(),
|
|
48539
48490
|
stageMatrix = this.stage.window.getViewBoxTransform();
|
|
48540
|
-
|
|
48541
|
-
matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), this.activeChartInstance.renderSync(), null === (_d = null === (_c = table.internalProps.layoutMap) || void 0 === _c ? void 0 : _c.updateDataStateToActiveChartInstance) || void 0 === _d || _d.call(_c, this.activeChartInstance), this.activeChartInstance.on("click", params => {
|
|
48542
|
-
var _a;
|
|
48543
|
-
!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");
|
|
48544
|
-
}), (null === (_e = table.options.chartDimensionLinkage) || void 0 === _e ? void 0 : _e.listenBrushChange) && (brushChangeThrottle = cancellableThrottle(table.scenegraph.updateChartState.bind(table.scenegraph), null !== (_g = null === (_f = table.options.chartDimensionLinkage) || void 0 === _f ? void 0 : _f.brushChangeDelay) && void 0 !== _g ? _g : 100), this.activeChartInstance.on("brushChange", params => {
|
|
48491
|
+
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 => {
|
|
48545
48492
|
var _a;
|
|
48546
|
-
|
|
48547
|
-
})
|
|
48493
|
+
!1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum);
|
|
48494
|
+
}), this.activeChartInstance.on("brushEnd", params => {
|
|
48548
48495
|
var _a;
|
|
48549
|
-
|
|
48496
|
+
table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
|
|
48550
48497
|
Chart.temp = 1;
|
|
48551
48498
|
}, 0);
|
|
48552
|
-
}),
|
|
48553
|
-
markName: "pie"
|
|
48554
|
-
}, params => {
|
|
48555
|
-
var _a;
|
|
48556
|
-
const categoryField = this.attribute.spec.categoryField,
|
|
48557
|
-
datum = {
|
|
48558
|
-
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
48559
|
-
};
|
|
48560
|
-
generateChartInstanceListByViewRange(datum, table, !1);
|
|
48561
|
-
}), this.activeChartInstance.on("pointerout", {
|
|
48562
|
-
markName: "pie"
|
|
48563
|
-
}, params => {
|
|
48564
|
-
var _a;
|
|
48565
|
-
const categoryField = this.attribute.spec.categoryField,
|
|
48566
|
-
datum = {
|
|
48567
|
-
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
48568
|
-
};
|
|
48569
|
-
generateChartInstanceListByViewRange(datum, table, !0);
|
|
48570
|
-
})), this.activeChartInstance.on("dimensionHover", params => {
|
|
48499
|
+
}), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
|
|
48571
48500
|
var _a, _b;
|
|
48572
48501
|
const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
|
|
48573
48502
|
canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
|
|
@@ -48630,13 +48559,12 @@
|
|
|
48630
48559
|
}
|
|
48631
48560
|
}
|
|
48632
48561
|
}
|
|
48633
|
-
})
|
|
48562
|
+
}), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
|
|
48634
48563
|
}
|
|
48635
48564
|
deactivate(table, {
|
|
48636
48565
|
releaseChartInstance = !0,
|
|
48637
48566
|
releaseColumnChartInstance = !0,
|
|
48638
|
-
releaseRowChartInstance = !0
|
|
48639
|
-
releaseAllChartInstance = !1
|
|
48567
|
+
releaseRowChartInstance = !0
|
|
48640
48568
|
} = {}) {
|
|
48641
48569
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
48642
48570
|
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
|
|
@@ -48658,7 +48586,7 @@
|
|
|
48658
48586
|
} = this.parent;
|
|
48659
48587
|
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));
|
|
48660
48588
|
}
|
|
48661
|
-
|
|
48589
|
+
releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table);
|
|
48662
48590
|
}
|
|
48663
48591
|
updateData(data) {
|
|
48664
48592
|
this.attribute.data = data;
|
|
@@ -48673,14 +48601,13 @@
|
|
|
48673
48601
|
y1: y1,
|
|
48674
48602
|
x2: x2,
|
|
48675
48603
|
y2: y2
|
|
48676
|
-
} = cellGroup.globalAABBBounds
|
|
48677
|
-
|
|
48678
|
-
|
|
48679
|
-
|
|
48680
|
-
|
|
48681
|
-
|
|
48682
|
-
|
|
48683
|
-
return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
|
|
48604
|
+
} = cellGroup.globalAABBBounds;
|
|
48605
|
+
return {
|
|
48606
|
+
x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (null !== (_b = null === (_a = table.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0)),
|
|
48607
|
+
x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (null !== (_d = null === (_c = table.options.viewBox) || void 0 === _c ? void 0 : _c.x1) && void 0 !== _d ? _d : 0)),
|
|
48608
|
+
y1: Math.ceil(y1 + padding[0] + table.scrollTop + (null !== (_f = null === (_e = table.options.viewBox) || void 0 === _e ? void 0 : _e.y1) && void 0 !== _f ? _f : 0)),
|
|
48609
|
+
y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (null !== (_h = null === (_g = table.options.viewBox) || void 0 === _g ? void 0 : _g.y1) && void 0 !== _h ? _h : 0))
|
|
48610
|
+
};
|
|
48684
48611
|
}
|
|
48685
48612
|
}
|
|
48686
48613
|
function getTableBounds(col, row, table) {
|
|
@@ -48895,7 +48822,7 @@
|
|
|
48895
48822
|
{
|
|
48896
48823
|
width = groupAttribute.width,
|
|
48897
48824
|
height = groupAttribute.height
|
|
48898
|
-
} = chart.attribute,
|
|
48825
|
+
} = (chart.getViewBox(), chart.attribute),
|
|
48899
48826
|
{
|
|
48900
48827
|
table: table
|
|
48901
48828
|
} = chart.getRootNode(),
|
|
@@ -48923,9 +48850,8 @@
|
|
|
48923
48850
|
});
|
|
48924
48851
|
}
|
|
48925
48852
|
}
|
|
48926
|
-
const
|
|
48927
|
-
|
|
48928
|
-
lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
|
|
48853
|
+
const viewBox = chart.getViewBox();
|
|
48854
|
+
activeChartInstance.updateViewBox({
|
|
48929
48855
|
x1: 0,
|
|
48930
48856
|
x2: viewBox.x2 - viewBox.x1,
|
|
48931
48857
|
y1: 0,
|
|
@@ -52443,10 +52369,9 @@
|
|
|
52443
52369
|
});
|
|
52444
52370
|
}
|
|
52445
52371
|
}
|
|
52446
|
-
function updateChartState(scenegraph, datum
|
|
52372
|
+
function updateChartState(scenegraph, datum) {
|
|
52447
52373
|
const table = scenegraph.table;
|
|
52448
52374
|
if (table.isPivotChart()) {
|
|
52449
|
-
table._selectedDataMode = selectedDataMode;
|
|
52450
52375
|
const preSelectItemsCount = table._selectedDataItemsInChart.length;
|
|
52451
52376
|
if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
|
|
52452
52377
|
const newSelectedDataItemsInChart = [];
|
|
@@ -53194,22 +53119,16 @@
|
|
|
53194
53119
|
resetResidentHoverIcon(col, row) {
|
|
53195
53120
|
resetResidentHoverIcon(col, row, this);
|
|
53196
53121
|
}
|
|
53197
|
-
deactivateChart(col, row
|
|
53198
|
-
var _a, _b, _c
|
|
53122
|
+
deactivateChart(col, row) {
|
|
53123
|
+
var _a, _b, _c;
|
|
53199
53124
|
if (-1 === col || -1 === row) return;
|
|
53200
53125
|
const cellGroup = this.getCell(col, row);
|
|
53201
53126
|
if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
|
|
53202
|
-
if (forceRelease) return void (null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
|
|
53203
|
-
releaseChartInstance: !0,
|
|
53204
|
-
releaseColumnChartInstance: !0,
|
|
53205
|
-
releaseRowChartInstance: !0,
|
|
53206
|
-
releaseAllChartInstance: !0
|
|
53207
|
-
}));
|
|
53208
53127
|
const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
|
|
53209
|
-
null === (
|
|
53210
|
-
releaseChartInstance: "
|
|
53211
|
-
releaseColumnChartInstance:
|
|
53212
|
-
releaseRowChartInstance:
|
|
53128
|
+
null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, this.table.options.chartDimensionLinkage ? {
|
|
53129
|
+
releaseChartInstance: "scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
|
|
53130
|
+
releaseColumnChartInstance: col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
|
|
53131
|
+
releaseRowChartInstance: row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
|
|
53213
53132
|
} : void 0);
|
|
53214
53133
|
}
|
|
53215
53134
|
}
|
|
@@ -53257,8 +53176,8 @@
|
|
|
53257
53176
|
updateChartSizeForResizeRowHeight(row) {
|
|
53258
53177
|
updateChartSizeForResizeRowHeight(this, row);
|
|
53259
53178
|
}
|
|
53260
|
-
updateChartState(datum
|
|
53261
|
-
this.table.isPivotChart() && updateChartState(this, datum
|
|
53179
|
+
updateChartState(datum) {
|
|
53180
|
+
this.table.isPivotChart() && updateChartState(this, datum);
|
|
53262
53181
|
}
|
|
53263
53182
|
updateCheckboxCellState(col, row, checked) {
|
|
53264
53183
|
var _a, _b;
|
|
@@ -56285,7 +56204,7 @@
|
|
|
56285
56204
|
}, 0 !== e.button) return;
|
|
56286
56205
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
56287
56206
|
if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
|
|
56288
|
-
if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null
|
|
56207
|
+
if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
|
|
56289
56208
|
const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
|
|
56290
56209
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
56291
56210
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -56313,7 +56232,7 @@
|
|
|
56313
56232
|
}
|
|
56314
56233
|
eventManager.dealTableHover(eventArgsSet);
|
|
56315
56234
|
} else {
|
|
56316
|
-
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null
|
|
56235
|
+
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56317
56236
|
if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56318
56237
|
if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56319
56238
|
eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
|
|
@@ -56465,7 +56384,7 @@
|
|
|
56465
56384
|
if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
|
|
56466
56385
|
const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
|
|
56467
56386
|
if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
|
|
56468
|
-
table.scenegraph.updateChartState(null
|
|
56387
|
+
table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
|
|
56469
56388
|
const {
|
|
56470
56389
|
eventArgs: eventArgs
|
|
56471
56390
|
} = eventArgsSet;
|
|
@@ -56484,7 +56403,7 @@
|
|
|
56484
56403
|
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 {
|
|
56485
56404
|
stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
|
|
56486
56405
|
const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
56487
|
-
(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
|
|
56406
|
+
(null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null);
|
|
56488
56407
|
}
|
|
56489
56408
|
}), table.scenegraph.stage.addEventListener("pointermove", e => {
|
|
56490
56409
|
var _a, _b, _c;
|
|
@@ -56602,15 +56521,7 @@
|
|
|
56602
56521
|
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
|
|
56603
56522
|
}), table.scenegraph.stage.addEventListener("wheel", e => {
|
|
56604
56523
|
var _a;
|
|
56605
|
-
|
|
56606
|
-
null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
|
|
56607
|
-
const {
|
|
56608
|
-
cellPos: cellPos
|
|
56609
|
-
} = table.stateManager.hover,
|
|
56610
|
-
prevHoverCellCol = cellPos.col,
|
|
56611
|
-
prevHoverCellRow = cellPos.row;
|
|
56612
|
-
table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
|
|
56613
|
-
}
|
|
56524
|
+
e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
|
|
56614
56525
|
});
|
|
56615
56526
|
}
|
|
56616
56527
|
function bindGesture(eventManager) {
|
|
@@ -57390,7 +57301,7 @@
|
|
|
57390
57301
|
};
|
|
57391
57302
|
let EventManager$1 = class EventManager {
|
|
57392
57303
|
constructor(table) {
|
|
57393
|
-
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
57304
|
+
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.cutRanges = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
57394
57305
|
this.bindSelfEvent();
|
|
57395
57306
|
}, 0));
|
|
57396
57307
|
}
|
|
@@ -57692,15 +57603,25 @@
|
|
|
57692
57603
|
} catch (error) {}
|
|
57693
57604
|
}
|
|
57694
57605
|
handleCut(e) {
|
|
57606
|
+
var _a;
|
|
57695
57607
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
57696
|
-
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.
|
|
57697
|
-
|
|
57608
|
+
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.cutRanges = null === (_a = this.table.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.map(r => ({
|
|
57609
|
+
start: {
|
|
57610
|
+
col: r.start.col,
|
|
57611
|
+
row: r.start.row
|
|
57612
|
+
},
|
|
57613
|
+
end: {
|
|
57614
|
+
col: r.end.col,
|
|
57615
|
+
row: r.end.row
|
|
57616
|
+
}
|
|
57617
|
+
})), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
57618
|
+
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
|
|
57698
57619
|
}, 3e4), this.saveClipboardContent();
|
|
57699
57620
|
});
|
|
57700
57621
|
}
|
|
57701
57622
|
handlePaste(e) {
|
|
57702
57623
|
this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
|
|
57703
|
-
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
57624
|
+
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
57704
57625
|
}).catch(() => {
|
|
57705
57626
|
this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
57706
57627
|
}) : this.executePaste(e);
|
|
@@ -57777,9 +57698,9 @@
|
|
|
57777
57698
|
}
|
|
57778
57699
|
clearCutArea(table) {
|
|
57779
57700
|
try {
|
|
57780
|
-
const
|
|
57781
|
-
if (!
|
|
57782
|
-
|
|
57701
|
+
const ranges = this.cutRanges;
|
|
57702
|
+
if (!ranges || 0 === ranges.length) return;
|
|
57703
|
+
table.changeCellValuesByIds(ranges, "");
|
|
57783
57704
|
} catch (error) {}
|
|
57784
57705
|
}
|
|
57785
57706
|
checkClipboardChanged() {
|
|
@@ -60022,7 +59943,7 @@
|
|
|
60022
59943
|
}
|
|
60023
59944
|
constructor(container, options = {}) {
|
|
60024
59945
|
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;
|
|
60025
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
59946
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
60026
59947
|
this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
60027
59948
|
options: options,
|
|
60028
59949
|
container: container
|
|
@@ -63833,15 +63754,16 @@
|
|
|
63833
63754
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
63834
63755
|
});
|
|
63835
63756
|
};
|
|
63836
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
63757
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
63837
63758
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
63838
|
-
const
|
|
63759
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
63760
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63839
63761
|
{
|
|
63840
63762
|
field: field
|
|
63841
63763
|
} = table.internalProps.layoutMap.getBody(col, row),
|
|
63842
63764
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
63843
63765
|
oldValue = table.getCellOriginValue(col, row);
|
|
63844
|
-
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value,
|
|
63766
|
+
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
|
|
63845
63767
|
const range = table.getCellRange(col, row),
|
|
63846
63768
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
63847
63769
|
if (aggregators) {
|
|
@@ -63864,16 +63786,24 @@
|
|
|
63864
63786
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
63865
63787
|
}
|
|
63866
63788
|
const changedValue = table.getCellOriginValue(col, row);
|
|
63867
|
-
oldValue !== changedValue && triggerEvent
|
|
63868
|
-
|
|
63869
|
-
|
|
63870
|
-
|
|
63871
|
-
|
|
63872
|
-
|
|
63873
|
-
|
|
63789
|
+
if (oldValue !== changedValue && triggerEvent) {
|
|
63790
|
+
const changeValue = {
|
|
63791
|
+
col: col,
|
|
63792
|
+
row: row,
|
|
63793
|
+
recordIndex: recordIndex,
|
|
63794
|
+
field: field,
|
|
63795
|
+
rawValue: beforeChangeValue,
|
|
63796
|
+
currentValue: oldValue,
|
|
63797
|
+
changedValue: changedValue
|
|
63798
|
+
};
|
|
63799
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63800
|
+
values: [changeValue]
|
|
63801
|
+
});
|
|
63802
|
+
}
|
|
63803
|
+
table.scenegraph.updateNextFrame();
|
|
63874
63804
|
}
|
|
63875
63805
|
}
|
|
63876
|
-
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
63806
|
+
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
63877
63807
|
var _a, _b;
|
|
63878
63808
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63879
63809
|
const changedCellResults = [];
|
|
@@ -63895,6 +63825,7 @@
|
|
|
63895
63825
|
oldRowValues.push(oldValue);
|
|
63896
63826
|
}
|
|
63897
63827
|
}
|
|
63828
|
+
const resultChangeValues = [];
|
|
63898
63829
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
63899
63830
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
63900
63831
|
const rowValues = values[i];
|
|
@@ -63918,25 +63849,34 @@
|
|
|
63918
63849
|
if (isCanChange) {
|
|
63919
63850
|
changedCellResults[i][j] = !0;
|
|
63920
63851
|
const value = rowValues[j],
|
|
63921
|
-
|
|
63852
|
+
recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
63853
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63922
63854
|
{
|
|
63923
63855
|
field: field
|
|
63924
63856
|
} = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
|
|
63925
63857
|
beforeChangeValue = beforeChangeValues[i][j],
|
|
63926
63858
|
oldValue = oldValues[i][j];
|
|
63927
|
-
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value,
|
|
63859
|
+
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, startCol + j, startRow + i, table);
|
|
63928
63860
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
63929
|
-
oldValue !== changedValue && triggerEvent
|
|
63930
|
-
|
|
63931
|
-
|
|
63932
|
-
|
|
63933
|
-
|
|
63934
|
-
|
|
63935
|
-
|
|
63861
|
+
if (oldValue !== changedValue && triggerEvent) {
|
|
63862
|
+
const changeValue = {
|
|
63863
|
+
col: startCol + j,
|
|
63864
|
+
row: startRow + i,
|
|
63865
|
+
recordIndex: recordIndex,
|
|
63866
|
+
field: field,
|
|
63867
|
+
rawValue: beforeChangeValue,
|
|
63868
|
+
currentValue: oldValue,
|
|
63869
|
+
changedValue: changedValue
|
|
63870
|
+
};
|
|
63871
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
63872
|
+
}
|
|
63936
63873
|
} else changedCellResults[i][j] = !1;
|
|
63937
63874
|
}
|
|
63938
63875
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
63939
63876
|
}
|
|
63877
|
+
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63878
|
+
values: resultChangeValues
|
|
63879
|
+
});
|
|
63940
63880
|
const startRange = table.getCellRange(startCol, startRow),
|
|
63941
63881
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
63942
63882
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -63970,6 +63910,58 @@
|
|
|
63970
63910
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
63971
63911
|
});
|
|
63972
63912
|
}
|
|
63913
|
+
function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
63914
|
+
var _a, _b;
|
|
63915
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63916
|
+
const resultChangeValues = [],
|
|
63917
|
+
processed = new Set(),
|
|
63918
|
+
nextValue = null != value ? value : "";
|
|
63919
|
+
for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
|
|
63920
|
+
const range = ranges[i],
|
|
63921
|
+
startCol = Math.min(range.start.col, range.end.col),
|
|
63922
|
+
endCol = Math.max(range.start.col, range.end.col),
|
|
63923
|
+
startRow = Math.min(range.start.row, range.end.row),
|
|
63924
|
+
endRow = Math.max(range.start.row, range.end.row);
|
|
63925
|
+
if (startCol > endCol || startRow > endRow) continue;
|
|
63926
|
+
const values = [],
|
|
63927
|
+
oldValues = [];
|
|
63928
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
63929
|
+
const rowValues = [],
|
|
63930
|
+
rowOldValues = [];
|
|
63931
|
+
for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
|
|
63932
|
+
values.push(rowValues), oldValues.push(rowOldValues);
|
|
63933
|
+
}
|
|
63934
|
+
const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
|
|
63935
|
+
for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
|
|
63936
|
+
const col = startCol + c,
|
|
63937
|
+
row = startRow + r,
|
|
63938
|
+
key = `${col},${row}`;
|
|
63939
|
+
if (processed.has(key)) continue;
|
|
63940
|
+
if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
|
|
63941
|
+
const oldValue = oldValues[r][c],
|
|
63942
|
+
changedValue = table.getCellOriginValue(col, row);
|
|
63943
|
+
if (oldValue === changedValue) continue;
|
|
63944
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
63945
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63946
|
+
{
|
|
63947
|
+
field: field
|
|
63948
|
+
} = table.internalProps.layoutMap.getBody(col, row);
|
|
63949
|
+
resultChangeValues.push({
|
|
63950
|
+
col: col,
|
|
63951
|
+
row: row,
|
|
63952
|
+
recordIndex: recordIndex,
|
|
63953
|
+
field: field,
|
|
63954
|
+
rawValue: oldValue,
|
|
63955
|
+
currentValue: oldValue,
|
|
63956
|
+
changedValue: changedValue
|
|
63957
|
+
});
|
|
63958
|
+
}
|
|
63959
|
+
}
|
|
63960
|
+
!silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63961
|
+
values: resultChangeValues
|
|
63962
|
+
});
|
|
63963
|
+
});
|
|
63964
|
+
}
|
|
63973
63965
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
63974
63966
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
63975
63967
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -65133,43 +65125,165 @@
|
|
|
65133
65125
|
}
|
|
65134
65126
|
return isValid$1(editorDefine);
|
|
65135
65127
|
}
|
|
65136
|
-
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
|
|
65137
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
65128
|
+
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65129
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65130
|
+
}
|
|
65131
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65132
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65133
|
+
}
|
|
65134
|
+
changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65135
|
+
return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65136
|
+
}
|
|
65137
|
+
changeSourceCellValue(recordIndex, field, value) {
|
|
65138
|
+
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
65139
|
+
cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
65140
|
+
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
|
|
65141
|
+
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
65142
|
+
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
|
|
65143
|
+
oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
|
|
65144
|
+
changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
65145
|
+
if (oldValue !== changedValue) {
|
|
65146
|
+
const changeValue = {
|
|
65147
|
+
col: cellAddr.col,
|
|
65148
|
+
row: cellAddr.row,
|
|
65149
|
+
recordIndex: recordIndex,
|
|
65150
|
+
field: field,
|
|
65151
|
+
rawValue: beforeChangeValue,
|
|
65152
|
+
currentValue: oldValue,
|
|
65153
|
+
changedValue: changedValue
|
|
65154
|
+
};
|
|
65155
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65156
|
+
values: [changeValue]
|
|
65157
|
+
});
|
|
65158
|
+
}
|
|
65159
|
+
}
|
|
65160
|
+
changeCellValueByRecord(recordIndex, field, value, options) {
|
|
65161
|
+
var _a, _b, _c, _d, _e;
|
|
65162
|
+
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
65163
|
+
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
65164
|
+
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
65165
|
+
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
65166
|
+
let record, oldValue;
|
|
65167
|
+
if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), !triggerEvent) return;
|
|
65168
|
+
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
65169
|
+
if (oldValue !== changedValue) {
|
|
65170
|
+
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
|
|
65171
|
+
changeValue = {
|
|
65172
|
+
col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
|
|
65173
|
+
row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
|
|
65174
|
+
recordIndex: recordIndex,
|
|
65175
|
+
field: field,
|
|
65176
|
+
rawValue: oldValue,
|
|
65177
|
+
currentValue: oldValue,
|
|
65178
|
+
changedValue: changedValue
|
|
65179
|
+
};
|
|
65180
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65181
|
+
values: [changeValue]
|
|
65182
|
+
});
|
|
65183
|
+
}
|
|
65184
|
+
autoRefresh && this.refreshAfterSourceChange();
|
|
65185
|
+
}
|
|
65186
|
+
changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65187
|
+
return this.changeCellValueByRecord(recordIndex, field, value, {
|
|
65188
|
+
triggerEvent: triggerEvent,
|
|
65189
|
+
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
65190
|
+
autoRefresh: !0
|
|
65191
|
+
});
|
|
65192
|
+
}
|
|
65193
|
+
changeCellValuesByRecords(changeValues, options) {
|
|
65194
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
65195
|
+
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
65196
|
+
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
65197
|
+
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
65198
|
+
resultChangeValues = [];
|
|
65199
|
+
for (let i = 0; i < changeValues.length; i++) {
|
|
65200
|
+
const {
|
|
65201
|
+
recordIndex: recordIndex,
|
|
65202
|
+
field: field,
|
|
65203
|
+
value: value
|
|
65204
|
+
} = changeValues[i],
|
|
65205
|
+
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
65206
|
+
let record, oldValue;
|
|
65207
|
+
if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), triggerEvent) {
|
|
65208
|
+
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
65209
|
+
if (oldValue !== changedValue) {
|
|
65210
|
+
const changeValue = {
|
|
65211
|
+
col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
|
|
65212
|
+
row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
|
|
65213
|
+
recordIndex: recordIndex,
|
|
65214
|
+
field: field,
|
|
65215
|
+
rawValue: oldValue,
|
|
65216
|
+
currentValue: oldValue,
|
|
65217
|
+
changedValue: changedValue
|
|
65218
|
+
};
|
|
65219
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
65220
|
+
}
|
|
65221
|
+
}
|
|
65222
|
+
}
|
|
65223
|
+
!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65224
|
+
values: resultChangeValues
|
|
65225
|
+
}), autoRefresh && this.refreshAfterSourceChange();
|
|
65138
65226
|
}
|
|
65139
|
-
|
|
65140
|
-
return
|
|
65227
|
+
changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65228
|
+
return this.changeCellValuesByRecords(changeValues, {
|
|
65229
|
+
triggerEvent: triggerEvent,
|
|
65230
|
+
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
65231
|
+
autoRefresh: !0
|
|
65232
|
+
});
|
|
65141
65233
|
}
|
|
65142
|
-
|
|
65234
|
+
refreshAfterSourceChange(options) {
|
|
65235
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
65236
|
+
const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
|
|
65237
|
+
reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
|
|
65238
|
+
clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
|
|
65239
|
+
this.scenegraph.clearCells(), this.sortState && reapplySort && (null === (_e = (_d = this.dataSource).clearSortedIndexMap) || void 0 === _e || _e.call(_d), null === (_g = null === (_f = this.dataSource.sortedIndexMap) || void 0 === _f ? void 0 : _f.clear) || void 0 === _g || _g.call(_f)), reapplyFilter ? this.sortState && reapplySort ? (this.dataSource.updateFilterRulesForSorted(null === (_h = this.dataSource.dataConfig) || void 0 === _h ? void 0 : _h.filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(null === (_j = this.dataSource.dataConfig) || void 0 === _j ? void 0 : _j.filterRules) : this.sortState && reapplySort && sortRecords(this);
|
|
65240
|
+
const traverseColumns = columns => {
|
|
65241
|
+
var _a, _b, _c, _d;
|
|
65242
|
+
for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
|
|
65243
|
+
const column = columns[i],
|
|
65244
|
+
aggregators = null == column ? void 0 : column.vtable_aggregator;
|
|
65245
|
+
if (aggregators) if (Array.isArray(aggregators)) for (let j = 0; j < aggregators.length; j++) null === (_c = null === (_b = aggregators[j]) || void 0 === _b ? void 0 : _b.recalculate) || void 0 === _c || _c.call(_b);else null === (_d = null == aggregators ? void 0 : aggregators.recalculate) || void 0 === _d || _d.call(aggregators);
|
|
65246
|
+
(null == column ? void 0 : column.columns) && traverseColumns(column.columns);
|
|
65247
|
+
}
|
|
65248
|
+
};
|
|
65249
|
+
traverseColumns(this.internalProps.columns), this.refreshRowColCount(), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!clearRowHeightCache), null === (_k = this.internalProps.emptyTip) || void 0 === _k || _k.resetVisible(), this.resize();
|
|
65250
|
+
}
|
|
65251
|
+
addRecord(record, recordIndex, triggerEvent = !0) {
|
|
65143
65252
|
var _a;
|
|
65144
65253
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
65145
|
-
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
65254
|
+
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
65146
65255
|
records: [record],
|
|
65147
65256
|
recordIndex: recordIndex,
|
|
65148
65257
|
recordCount: 1
|
|
65149
65258
|
});
|
|
65150
65259
|
}
|
|
65151
|
-
addRecords(records, recordIndex) {
|
|
65260
|
+
addRecords(records, recordIndex, triggerEvent = !0) {
|
|
65152
65261
|
var _a;
|
|
65153
65262
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
65154
|
-
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
65263
|
+
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
65155
65264
|
records: records,
|
|
65156
65265
|
recordIndex: recordIndex,
|
|
65157
65266
|
recordCount: records.length
|
|
65158
65267
|
});
|
|
65159
65268
|
}
|
|
65160
|
-
deleteRecords(recordIndexs) {
|
|
65269
|
+
deleteRecords(recordIndexs, triggerEvent = !0) {
|
|
65161
65270
|
var _a;
|
|
65162
|
-
|
|
65271
|
+
const deletedRecords = [];
|
|
65272
|
+
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
65273
|
+
let record = null;
|
|
65274
|
+
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
65275
|
+
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
65163
65276
|
const rowIndexs = [];
|
|
65164
65277
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
65165
|
-
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
65278
|
+
triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
65166
65279
|
recordIndexs: recordIndexs,
|
|
65280
|
+
records: deletedRecords,
|
|
65167
65281
|
rowIndexs: rowIndexs,
|
|
65168
65282
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
65169
65283
|
});
|
|
65170
65284
|
}
|
|
65171
|
-
updateRecords(records, recordIndexs) {
|
|
65172
|
-
listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
65285
|
+
updateRecords(records, recordIndexs, triggerEvent = !0) {
|
|
65286
|
+
listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
65173
65287
|
records: records,
|
|
65174
65288
|
recordIndexs: recordIndexs,
|
|
65175
65289
|
updateCount: records.length
|
|
@@ -76327,7 +76441,7 @@
|
|
|
76327
76441
|
PluginManager: PluginManager
|
|
76328
76442
|
});
|
|
76329
76443
|
|
|
76330
|
-
const version = "1.22.11-alpha.
|
|
76444
|
+
const version = "1.22.11-alpha.2";
|
|
76331
76445
|
|
|
76332
76446
|
exports.Gantt = Gantt;
|
|
76333
76447
|
exports.TYPES = index$4;
|