@visactor/vtable-gantt 1.22.11-alpha.6 → 1.22.11-alpha.7
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 +561 -415
- 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 +3 -3
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",
|
|
@@ -40868,6 +40851,24 @@
|
|
|
40868
40851
|
}
|
|
40869
40852
|
}
|
|
40870
40853
|
}
|
|
40854
|
+
changeFieldValueByRecordIndex(value, recordIndex, field, table) {
|
|
40855
|
+
var _a, _b, _c, _d;
|
|
40856
|
+
if (null === field) return;
|
|
40857
|
+
if (null == recordIndex) return;
|
|
40858
|
+
const rawKey = recordIndex.toString();
|
|
40859
|
+
if (!this.beforeChangedRecordsMap.has(rawKey)) {
|
|
40860
|
+
const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
|
|
40861
|
+
originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
40862
|
+
this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
|
|
40863
|
+
}
|
|
40864
|
+
if ("string" == typeof field || "number" == typeof field) {
|
|
40865
|
+
const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
|
|
40866
|
+
rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
|
|
40867
|
+
record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
40868
|
+
let formatValue = value;
|
|
40869
|
+
"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);
|
|
40870
|
+
}
|
|
40871
|
+
}
|
|
40871
40872
|
cacheBeforeChangedRecord(dataIndex, table) {
|
|
40872
40873
|
var _a;
|
|
40873
40874
|
if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
|
|
@@ -40883,41 +40884,82 @@
|
|
|
40883
40884
|
Array.isArray(indexed) || this.records.splice(indexed, 1, record);
|
|
40884
40885
|
}
|
|
40885
40886
|
}
|
|
40886
|
-
|
|
40887
|
+
_getRawRecordsArray() {
|
|
40887
40888
|
var _a;
|
|
40888
|
-
|
|
40889
|
-
|
|
40890
|
-
|
|
40891
|
-
|
|
40892
|
-
|
|
40893
|
-
|
|
40894
|
-
|
|
40895
|
-
|
|
40896
|
-
|
|
40897
|
-
|
|
40898
|
-
|
|
40899
|
-
|
|
40889
|
+
const rawRecords = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records;
|
|
40890
|
+
return Array.isArray(rawRecords) ? rawRecords : null;
|
|
40891
|
+
}
|
|
40892
|
+
_hasFilterInEffect() {
|
|
40893
|
+
var _a, _b, _c, _d, _e;
|
|
40894
|
+
return (null !== (_c = null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) >= 1 || (null !== (_e = null === (_d = this.lastFilterRules) || void 0 === _d ? void 0 : _d.length) && void 0 !== _e ? _e : 0) >= 1;
|
|
40895
|
+
}
|
|
40896
|
+
_normalizeInsertIndex(index, length) {
|
|
40897
|
+
return null == index || index > length ? length : index < 0 ? 0 : index;
|
|
40898
|
+
}
|
|
40899
|
+
_mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
|
|
40900
|
+
if (viewIndex >= this.records.length) return rawRecords.length;
|
|
40901
|
+
if (viewIndex <= 0) return 0;
|
|
40902
|
+
const prevRecord = this.records[viewIndex - 1],
|
|
40903
|
+
rawIndex = rawRecords.indexOf(prevRecord);
|
|
40904
|
+
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
40905
|
+
}
|
|
40906
|
+
_resetIndexingFromViewRecords() {
|
|
40907
|
+
if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
|
|
40908
|
+
length: this._sourceLength
|
|
40909
|
+
}, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
|
|
40910
|
+
this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40911
|
+
}
|
|
40912
|
+
addRecord(record, index, syncToOriginalRecords = !1) {
|
|
40913
|
+
var _a, _b, _c;
|
|
40914
|
+
if (!syncToOriginalRecords) {
|
|
40915
|
+
if (Array.isArray(this.records)) {
|
|
40916
|
+
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
40917
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
40918
|
+
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
40919
|
+
this.pagination.totalCount = this._sourceLength;
|
|
40920
|
+
const {
|
|
40921
|
+
perPageCount: perPageCount,
|
|
40922
|
+
currentPage: currentPage
|
|
40923
|
+
} = this.pagination;
|
|
40924
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40925
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40926
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
40927
|
+
}
|
|
40928
|
+
return;
|
|
40900
40929
|
}
|
|
40930
|
+
const rawRecords = this._getRawRecordsArray();
|
|
40931
|
+
if (!rawRecords) return;
|
|
40932
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
40933
|
+
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
40934
|
+
rawRecords.splice(rawInsertIndex, 0, record), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, 1);
|
|
40901
40935
|
}
|
|
40902
|
-
addRecords(recordArr, index) {
|
|
40903
|
-
var _a;
|
|
40904
|
-
if (
|
|
40905
|
-
if (Array.isArray(
|
|
40906
|
-
|
|
40907
|
-
|
|
40908
|
-
|
|
40909
|
-
|
|
40936
|
+
addRecords(recordArr, index, syncToOriginalRecords = !1) {
|
|
40937
|
+
var _a, _b, _c;
|
|
40938
|
+
if (!syncToOriginalRecords) {
|
|
40939
|
+
if (Array.isArray(this.records)) {
|
|
40940
|
+
if (Array.isArray(recordArr)) {
|
|
40941
|
+
this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
40942
|
+
for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
|
|
40943
|
+
this._sourceLength += recordArr.length;
|
|
40944
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
40945
|
+
}
|
|
40946
|
+
if (this.userPagination) {
|
|
40947
|
+
this.pagination.totalCount = this._sourceLength;
|
|
40948
|
+
const {
|
|
40949
|
+
perPageCount: perPageCount,
|
|
40950
|
+
currentPage: currentPage
|
|
40951
|
+
} = this.pagination;
|
|
40952
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40953
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40954
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
40910
40955
|
}
|
|
40911
|
-
|
|
40912
|
-
this.pagination.totalCount = this._sourceLength;
|
|
40913
|
-
const {
|
|
40914
|
-
perPageCount: perPageCount,
|
|
40915
|
-
currentPage: currentPage
|
|
40916
|
-
} = this.pagination;
|
|
40917
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
40918
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
40919
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
40956
|
+
return;
|
|
40920
40957
|
}
|
|
40958
|
+
const rawRecords = this._getRawRecordsArray();
|
|
40959
|
+
if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
|
|
40960
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
40961
|
+
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
40962
|
+
rawRecords.splice(rawInsertIndex, 0, ...recordArr), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, recordArr.length);
|
|
40921
40963
|
}
|
|
40922
40964
|
addRecordForSorted(record) {
|
|
40923
40965
|
Array.isArray(this.records) && (this.beforeChangedRecordsMap.clear(), this.records.push(record), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1, this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength));
|
|
@@ -40933,27 +40975,49 @@
|
|
|
40933
40975
|
}
|
|
40934
40976
|
}
|
|
40935
40977
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
|
|
40936
|
-
|
|
40937
|
-
|
|
40938
|
-
|
|
40939
|
-
|
|
40940
|
-
|
|
40941
|
-
|
|
40942
|
-
|
|
40943
|
-
|
|
40944
|
-
|
|
40945
|
-
|
|
40946
|
-
|
|
40947
|
-
|
|
40948
|
-
|
|
40949
|
-
|
|
40950
|
-
|
|
40951
|
-
|
|
40952
|
-
|
|
40953
|
-
|
|
40954
|
-
|
|
40978
|
+
const delta = "add" === type ? insertCount : -insertCount,
|
|
40979
|
+
numericKeys = [];
|
|
40980
|
+
this.beforeChangedRecordsMap.forEach((_, key) => {
|
|
40981
|
+
const numKey = Number(key);
|
|
40982
|
+
Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
|
|
40983
|
+
}), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
|
|
40984
|
+
for (let i = 0; i < numericKeys.length; i++) {
|
|
40985
|
+
const key = numericKeys[i],
|
|
40986
|
+
record = this.beforeChangedRecordsMap.get(key.toString());
|
|
40987
|
+
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
40988
|
+
}
|
|
40989
|
+
}
|
|
40990
|
+
deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
|
|
40991
|
+
var _a, _b, _c;
|
|
40992
|
+
if (!syncToOriginalRecords) {
|
|
40993
|
+
if (Array.isArray(this.records)) {
|
|
40994
|
+
const realDeletedRecordIndexs = [],
|
|
40995
|
+
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
40996
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
40997
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
40998
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
40999
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
41000
|
+
const deletedRecord = this.records[recordIndex];
|
|
41001
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
41002
|
+
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
41003
|
+
}
|
|
41004
|
+
return this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs), realDeletedRecordIndexs;
|
|
41005
|
+
}
|
|
41006
|
+
return [];
|
|
41007
|
+
}
|
|
41008
|
+
const rawRecords = this._getRawRecordsArray();
|
|
41009
|
+
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41010
|
+
const realDeletedRecordIndexs = [],
|
|
41011
|
+
recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
|
|
41012
|
+
rawDeletedIndexs = [];
|
|
41013
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41014
|
+
const viewIndex = recordIndexsMaxToMin[index];
|
|
41015
|
+
if (viewIndex >= this.records.length || viewIndex < 0) continue;
|
|
41016
|
+
const deletedRecord = this.records[viewIndex],
|
|
41017
|
+
rawIndex = rawRecords.indexOf(deletedRecord);
|
|
41018
|
+
rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
|
|
40955
41019
|
}
|
|
40956
|
-
return
|
|
41020
|
+
return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.deleted) && this.dataSourceObj.deleted(rawDeletedIndexs), realDeletedRecordIndexs;
|
|
40957
41021
|
}
|
|
40958
41022
|
deleteRecordsForSorted(recordIndexs) {
|
|
40959
41023
|
if (Array.isArray(this.records)) {
|
|
@@ -40967,18 +41031,34 @@
|
|
|
40967
41031
|
this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
|
|
40968
41032
|
}
|
|
40969
41033
|
}
|
|
40970
|
-
updateRecords(records, recordIndexs) {
|
|
40971
|
-
|
|
41034
|
+
updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
|
|
41035
|
+
var _a;
|
|
41036
|
+
if (!syncToOriginalRecords) {
|
|
41037
|
+
const realDeletedRecordIndexs = [];
|
|
41038
|
+
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41039
|
+
const recordIndex = recordIndexs[index];
|
|
41040
|
+
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), this.records)[recordIndex[recordIndex.length - 1]] = records[index];else {
|
|
41041
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41042
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
41043
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
41044
|
+
this.records[recordIndex] = records[index];
|
|
41045
|
+
}
|
|
41046
|
+
}
|
|
41047
|
+
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
41048
|
+
}
|
|
41049
|
+
const rawRecords = this._getRawRecordsArray();
|
|
41050
|
+
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41051
|
+
const realUpdatedIndexs = [];
|
|
40972
41052
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
40973
41053
|
const recordIndex = recordIndexs[index];
|
|
40974
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
40975
|
-
if (recordIndex >= this.
|
|
40976
|
-
this.
|
|
40977
|
-
|
|
40978
|
-
|
|
41054
|
+
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realUpdatedIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), rawRecords)[recordIndex[recordIndex.length - 1]] = records[index];else {
|
|
41055
|
+
if (recordIndex >= this.records.length || recordIndex < 0) continue;
|
|
41056
|
+
const oldRecord = this.records[recordIndex],
|
|
41057
|
+
rawIndex = rawRecords.indexOf(oldRecord);
|
|
41058
|
+
rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
|
|
40979
41059
|
}
|
|
40980
41060
|
}
|
|
40981
|
-
return this.
|
|
41061
|
+
return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
|
|
40982
41062
|
}
|
|
40983
41063
|
updateRecordsForSorted(records, recordIndexs) {
|
|
40984
41064
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -47612,35 +47692,11 @@
|
|
|
47612
47692
|
return hoverMode;
|
|
47613
47693
|
}
|
|
47614
47694
|
|
|
47615
|
-
let brushingChartInstance,
|
|
47616
|
-
brushingChartInstanceCellPos = {
|
|
47617
|
-
col: -1,
|
|
47618
|
-
row: -1
|
|
47619
|
-
};
|
|
47620
|
-
function setBrushingChartInstance(chartInstance, col, row) {
|
|
47621
|
-
brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
|
|
47622
|
-
col: col,
|
|
47623
|
-
row: row
|
|
47624
|
-
};
|
|
47625
|
-
}
|
|
47626
|
-
function clearBrushingChartInstance() {
|
|
47627
|
-
brushingChartInstance = void 0, brushingChartInstanceCellPos = {
|
|
47628
|
-
col: -1,
|
|
47629
|
-
row: -1
|
|
47630
|
-
};
|
|
47631
|
-
}
|
|
47632
|
-
function getBrushingChartInstance() {
|
|
47633
|
-
return brushingChartInstance;
|
|
47634
|
-
}
|
|
47635
|
-
function getBrushingChartInstanceCellPos() {
|
|
47636
|
-
return brushingChartInstanceCellPos;
|
|
47637
|
-
}
|
|
47638
47695
|
const chartInstanceListColumnByColumnDirection = {};
|
|
47639
47696
|
const chartInstanceListRowByRowDirection = {};
|
|
47640
|
-
const delayRunDimensionHoverTimer = [];
|
|
47641
47697
|
function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
47642
47698
|
var _a;
|
|
47643
|
-
|
|
47699
|
+
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
47644
47700
|
const {
|
|
47645
47701
|
rowStart: rowStart
|
|
47646
47702
|
} = table.getBodyVisibleRowRange();
|
|
@@ -47649,40 +47705,76 @@
|
|
|
47649
47705
|
for (let i = rowStart; i <= rowEnd; i++) {
|
|
47650
47706
|
const cellGroup = table.scenegraph.getCell(col, i),
|
|
47651
47707
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47652
|
-
chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.
|
|
47653
|
-
|
|
47654
|
-
var _a, _b, _c, _d;
|
|
47708
|
+
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
|
|
47709
|
+
var _a, _b, _c, _d, _e, _f;
|
|
47655
47710
|
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47656
47711
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47657
47712
|
let isShowTooltip = !isScatter;
|
|
47658
|
-
if (isScatter
|
|
47659
|
-
const
|
|
47660
|
-
|
|
47713
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
|
|
47714
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
|
|
47715
|
+
{
|
|
47716
|
+
rowEnd: rowEnd1
|
|
47717
|
+
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
47718
|
+
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
47719
|
+
const {
|
|
47720
|
+
rowEnd: rowEnd2
|
|
47721
|
+
} = table.getBodyVisibleRowRange(0, 5);
|
|
47722
|
+
isShowTooltip = rowEnd2 !== rowEnd;
|
|
47723
|
+
}
|
|
47724
|
+
} else if (i === rowStart && isShowTooltip) {
|
|
47725
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
|
|
47726
|
+
{
|
|
47727
|
+
rowStart: rowStart1
|
|
47728
|
+
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
47729
|
+
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
47730
|
+
const {
|
|
47731
|
+
rowStart: rowStart2
|
|
47732
|
+
} = table.getBodyVisibleRowRange(0, -5);
|
|
47733
|
+
isShowTooltip = rowStart2 !== rowStart;
|
|
47734
|
+
}
|
|
47735
|
+
}
|
|
47736
|
+
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 {
|
|
47737
|
+
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
47661
47738
|
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
47662
47739
|
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47663
47740
|
tooltip: !1,
|
|
47664
47741
|
showTooltipOption: {
|
|
47665
|
-
x: canvasXY.x
|
|
47666
|
-
y: absolutePositionTop
|
|
47742
|
+
x: canvasXY.x,
|
|
47743
|
+
y: absolutePositionTop,
|
|
47667
47744
|
activeType: "dimension"
|
|
47668
47745
|
}
|
|
47669
47746
|
})) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47670
47747
|
tooltip: isShowTooltip,
|
|
47671
47748
|
showTooltipOption: {
|
|
47672
|
-
x: canvasXY.x
|
|
47673
|
-
y: absolutePositionTop
|
|
47749
|
+
x: canvasXY.x,
|
|
47750
|
+
y: absolutePositionTop,
|
|
47674
47751
|
activeType: "dimension"
|
|
47675
47752
|
}
|
|
47676
47753
|
});
|
|
47677
47754
|
}
|
|
47678
47755
|
}
|
|
47679
|
-
}, 0);
|
|
47680
|
-
|
|
47756
|
+
}, 0), table.scenegraph.updateNextFrame();
|
|
47757
|
+
}
|
|
47758
|
+
}
|
|
47759
|
+
function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
|
|
47760
|
+
var _a;
|
|
47761
|
+
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
47762
|
+
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
47763
|
+
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
47764
|
+
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
47765
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47766
|
+
chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
|
|
47767
|
+
releaseChartInstance: !0,
|
|
47768
|
+
releaseColumnChartInstance: !1,
|
|
47769
|
+
releaseRowChartInstance: !1
|
|
47770
|
+
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
47771
|
+
}
|
|
47772
|
+
delete chartInstanceListColumnByColumnDirection[col];
|
|
47681
47773
|
}
|
|
47682
47774
|
}
|
|
47683
47775
|
function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
47684
47776
|
var _a;
|
|
47685
|
-
|
|
47777
|
+
isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
47686
47778
|
const {
|
|
47687
47779
|
colStart: colStart
|
|
47688
47780
|
} = table.getBodyVisibleColRange();
|
|
@@ -47691,162 +47783,64 @@
|
|
|
47691
47783
|
for (let i = colStart; i <= colEnd; i++) {
|
|
47692
47784
|
const cellGroup = table.scenegraph.getCell(i, row),
|
|
47693
47785
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47694
|
-
chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.
|
|
47695
|
-
const timer = setTimeout(() => {
|
|
47786
|
+
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
|
|
47696
47787
|
var _a, _b, _c, _d;
|
|
47697
47788
|
if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47698
47789
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47699
47790
|
let isShowTooltip = !isScatter;
|
|
47700
|
-
if (isScatter
|
|
47701
|
-
const
|
|
47702
|
-
|
|
47791
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
|
|
47792
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47793
|
+
{
|
|
47794
|
+
colEnd: colEnd1
|
|
47795
|
+
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
47796
|
+
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
47797
|
+
const {
|
|
47798
|
+
colEnd: colEnd2
|
|
47799
|
+
} = table.getBodyVisibleColRange(0, 5);
|
|
47800
|
+
isShowTooltip = colEnd2 !== colEnd;
|
|
47801
|
+
}
|
|
47802
|
+
} else if (i === colStart && isShowTooltip) {
|
|
47803
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47804
|
+
{
|
|
47805
|
+
colStart: colStart1
|
|
47806
|
+
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
47807
|
+
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
47808
|
+
const {
|
|
47809
|
+
colStart: colStart2
|
|
47810
|
+
} = table.getBodyVisibleColRange(0, -5);
|
|
47811
|
+
isShowTooltip = colStart2 !== colStart;
|
|
47812
|
+
}
|
|
47813
|
+
}
|
|
47814
|
+
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 {
|
|
47815
|
+
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
47703
47816
|
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
47704
47817
|
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47705
47818
|
tooltip: !1,
|
|
47706
47819
|
showTooltipOption: {
|
|
47707
|
-
x: absolutePositionLeft
|
|
47708
|
-
y: canvasXY.y
|
|
47820
|
+
x: absolutePositionLeft,
|
|
47821
|
+
y: canvasXY.y,
|
|
47709
47822
|
activeType: "dimension"
|
|
47710
47823
|
}
|
|
47711
47824
|
})) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47712
47825
|
tooltip: isShowTooltip,
|
|
47713
47826
|
showTooltipOption: {
|
|
47714
|
-
x: absolutePositionLeft
|
|
47715
|
-
y: canvasXY.y
|
|
47827
|
+
x: absolutePositionLeft,
|
|
47828
|
+
y: canvasXY.y,
|
|
47716
47829
|
activeType: "dimension"
|
|
47717
47830
|
}
|
|
47718
47831
|
});
|
|
47719
47832
|
}
|
|
47720
47833
|
}
|
|
47721
|
-
}, 0);
|
|
47722
|
-
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
47834
|
+
}, 0), table.scenegraph.updateNextFrame();
|
|
47723
47835
|
}
|
|
47724
47836
|
}
|
|
47725
|
-
function
|
|
47726
|
-
var _a;
|
|
47727
|
-
clearDelayRunDimensionHoverTimers();
|
|
47728
|
-
const {
|
|
47729
|
-
rowStart: rowStart
|
|
47730
|
-
} = table.getBodyVisibleRowRange();
|
|
47731
|
-
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
47732
|
-
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
47733
|
-
const {
|
|
47734
|
-
colStart: colStart
|
|
47735
|
-
} = table.getBodyVisibleColRange();
|
|
47736
|
-
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
47737
|
-
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
47738
|
-
for (let col = colStart; col <= colEnd; col++) {
|
|
47739
|
-
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
47740
|
-
for (let i = rowStart; i <= rowEnd; i++) {
|
|
47741
|
-
const cellGroup = table.scenegraph.getCell(col, i),
|
|
47742
|
-
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47743
|
-
chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
|
|
47744
|
-
const timer = setTimeout(() => {
|
|
47745
|
-
var _a, _b;
|
|
47746
|
-
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47747
|
-
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47748
|
-
let isShowTooltip = !0;
|
|
47749
|
-
"object" == typeof chartDimensionLinkage && (deactivate ? (chartInstanceListColumnByColumnDirection[col][i].setHovered(), chartInstanceListColumnByColumnDirection[col][i].hideTooltip()) : (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table), isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table), chartInstanceListColumnByColumnDirection[col][i].setHovered(datum), isShowTooltip && chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
|
|
47750
|
-
activeType: "mark"
|
|
47751
|
-
})));
|
|
47752
|
-
}
|
|
47753
|
-
}, 0);
|
|
47754
|
-
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
47755
|
-
}
|
|
47756
|
-
}
|
|
47757
|
-
}
|
|
47758
|
-
function checkIsShowTooltipForEdgeRow(row, table) {
|
|
47759
|
-
var _a, _b;
|
|
47760
|
-
let isShowTooltip = !0;
|
|
47761
|
-
const {
|
|
47762
|
-
rowStart: rowStart
|
|
47763
|
-
} = table.getBodyVisibleRowRange();
|
|
47764
|
-
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
47765
|
-
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
47766
|
-
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47767
|
-
if (row === rowEnd && isShowTooltip) {
|
|
47768
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
|
|
47769
|
-
{
|
|
47770
|
-
rowEnd: rowEnd1
|
|
47771
|
-
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
47772
|
-
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
47773
|
-
const {
|
|
47774
|
-
rowEnd: rowEnd2
|
|
47775
|
-
} = table.getBodyVisibleRowRange(0, 5);
|
|
47776
|
-
isShowTooltip = rowEnd2 !== rowEnd;
|
|
47777
|
-
}
|
|
47778
|
-
} else if (row === rowStart && isShowTooltip) {
|
|
47779
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
|
|
47780
|
-
{
|
|
47781
|
-
rowStart: rowStart1
|
|
47782
|
-
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
47783
|
-
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
47784
|
-
const {
|
|
47785
|
-
rowStart: rowStart2
|
|
47786
|
-
} = table.getBodyVisibleRowRange(0, -5);
|
|
47787
|
-
isShowTooltip = rowStart2 !== rowStart;
|
|
47788
|
-
}
|
|
47789
|
-
}
|
|
47790
|
-
return isShowTooltip;
|
|
47791
|
-
}
|
|
47792
|
-
function checkIsShowTooltipForEdgeColumn(col, table) {
|
|
47793
|
-
let isShowTooltip = !0;
|
|
47794
|
-
const {
|
|
47795
|
-
colStart: colStart
|
|
47796
|
-
} = table.getBodyVisibleColRange();
|
|
47797
|
-
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
47798
|
-
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
47799
|
-
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47800
|
-
if (col === colEnd && isShowTooltip) {
|
|
47801
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47802
|
-
{
|
|
47803
|
-
colEnd: colEnd1
|
|
47804
|
-
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
47805
|
-
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
47806
|
-
const {
|
|
47807
|
-
colEnd: colEnd2
|
|
47808
|
-
} = table.getBodyVisibleColRange(0, 5);
|
|
47809
|
-
isShowTooltip = colEnd2 !== colEnd;
|
|
47810
|
-
}
|
|
47811
|
-
} else if (col === colStart && isShowTooltip) {
|
|
47812
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47813
|
-
{
|
|
47814
|
-
colStart: colStart1
|
|
47815
|
-
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
47816
|
-
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
47817
|
-
const {
|
|
47818
|
-
colStart: colStart2
|
|
47819
|
-
} = table.getBodyVisibleColRange(0, -5);
|
|
47820
|
-
isShowTooltip = colStart2 !== colStart;
|
|
47821
|
-
}
|
|
47822
|
-
}
|
|
47823
|
-
return isShowTooltip;
|
|
47824
|
-
}
|
|
47825
|
-
function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
|
|
47826
|
-
var _a;
|
|
47827
|
-
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
47828
|
-
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
47829
|
-
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
47830
|
-
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
47831
|
-
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47832
|
-
isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
47833
|
-
forceRelease: forceRelease,
|
|
47834
|
-
releaseChartInstance: !0,
|
|
47835
|
-
releaseColumnChartInstance: !1,
|
|
47836
|
-
releaseRowChartInstance: !1
|
|
47837
|
-
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
47838
|
-
}
|
|
47839
|
-
delete chartInstanceListColumnByColumnDirection[col];
|
|
47840
|
-
}
|
|
47841
|
-
}
|
|
47842
|
-
function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
|
|
47837
|
+
function clearChartInstanceListByRowDirection(row, excludedCol, table) {
|
|
47843
47838
|
var _a;
|
|
47844
47839
|
if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
|
|
47845
47840
|
if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
|
|
47846
47841
|
const cellGroup = table.scenegraph.getCell(Number(i), row),
|
|
47847
47842
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47848
|
-
isValid$1(chartNode) && (chartNode.
|
|
47849
|
-
forceRelease: forceRelease,
|
|
47843
|
+
chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
|
|
47850
47844
|
releaseChartInstance: !0,
|
|
47851
47845
|
releaseColumnChartInstance: !1,
|
|
47852
47846
|
releaseRowChartInstance: !1
|
|
@@ -47854,15 +47848,6 @@
|
|
|
47854
47848
|
}
|
|
47855
47849
|
delete chartInstanceListRowByRowDirection[row];
|
|
47856
47850
|
}
|
|
47857
|
-
function clearDelayRunDimensionHoverTimers() {
|
|
47858
|
-
for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
|
|
47859
|
-
delayRunDimensionHoverTimer.length = 0;
|
|
47860
|
-
}
|
|
47861
|
-
function clearAllChartInstanceList(table, forceRelease = !1) {
|
|
47862
|
-
clearDelayRunDimensionHoverTimers();
|
|
47863
|
-
for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
|
|
47864
|
-
for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
|
|
47865
|
-
}
|
|
47866
47851
|
|
|
47867
47852
|
function isValidAlignDomain(domain) {
|
|
47868
47853
|
return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
|
|
@@ -48496,7 +48481,7 @@
|
|
|
48496
48481
|
const CHART_NUMBER_TYPE = genNumberType();
|
|
48497
48482
|
class Chart extends Rect$2 {
|
|
48498
48483
|
constructor(isShareChartSpec, params) {
|
|
48499
|
-
if (super(params), this.type = "chart", this.
|
|
48484
|
+
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 {
|
|
48500
48485
|
const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
|
|
48501
48486
|
renderCanvas: params.canvas,
|
|
48502
48487
|
mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
|
|
@@ -48517,7 +48502,7 @@
|
|
|
48517
48502
|
}
|
|
48518
48503
|
}
|
|
48519
48504
|
activate(table) {
|
|
48520
|
-
var _a, _b, _c, _d, _e
|
|
48505
|
+
var _a, _b, _c, _d, _e;
|
|
48521
48506
|
if (this.activeChartInstance) return;
|
|
48522
48507
|
const {
|
|
48523
48508
|
col: col,
|
|
@@ -48536,7 +48521,7 @@
|
|
|
48536
48521
|
y1: y1 - table.scrollTop,
|
|
48537
48522
|
y2: y2 - table.scrollTop
|
|
48538
48523
|
});
|
|
48539
|
-
this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
|
|
48524
|
+
null === (_a = this.activeChartInstance) || void 0 === _a || _a.release(), this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
|
|
48540
48525
|
renderCanvas: this.attribute.canvas,
|
|
48541
48526
|
mode: "desktop-browser",
|
|
48542
48527
|
canvasControled: !1,
|
|
@@ -48570,7 +48555,7 @@
|
|
|
48570
48555
|
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());
|
|
48571
48556
|
}
|
|
48572
48557
|
},
|
|
48573
|
-
componentShowContent:
|
|
48558
|
+
componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
|
|
48574
48559
|
tooltip: {
|
|
48575
48560
|
dimension: !1,
|
|
48576
48561
|
mark: !0
|
|
@@ -48581,40 +48566,15 @@
|
|
|
48581
48566
|
const chartStage = this.activeChartInstance.getStage(),
|
|
48582
48567
|
matrix = this.globalTransMatrix.clone(),
|
|
48583
48568
|
stageMatrix = this.stage.window.getViewBoxTransform();
|
|
48584
|
-
let brushChangeThrottle;
|
|
48585
48569
|
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 => {
|
|
48586
48570
|
var _a;
|
|
48587
|
-
!1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null
|
|
48588
|
-
}), (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 => {
|
|
48589
|
-
var _a;
|
|
48590
|
-
brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
|
|
48591
|
-
})), this.activeChartInstance.on("brushStart", params => {
|
|
48592
|
-
const brushingChartInstance = getBrushingChartInstance();
|
|
48593
|
-
brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
|
|
48571
|
+
!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);
|
|
48594
48572
|
}), this.activeChartInstance.on("brushEnd", params => {
|
|
48595
48573
|
var _a;
|
|
48596
|
-
|
|
48574
|
+
table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
|
|
48597
48575
|
Chart.temp = 1;
|
|
48598
48576
|
}, 0);
|
|
48599
|
-
}),
|
|
48600
|
-
markName: "pie"
|
|
48601
|
-
}, params => {
|
|
48602
|
-
var _a;
|
|
48603
|
-
const categoryField = this.attribute.spec.categoryField,
|
|
48604
|
-
datum = {
|
|
48605
|
-
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
48606
|
-
};
|
|
48607
|
-
generateChartInstanceListByViewRange(datum, table, !1);
|
|
48608
|
-
}), this.activeChartInstance.on("pointerout", {
|
|
48609
|
-
markName: "pie"
|
|
48610
|
-
}, params => {
|
|
48611
|
-
var _a;
|
|
48612
|
-
const categoryField = this.attribute.spec.categoryField,
|
|
48613
|
-
datum = {
|
|
48614
|
-
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
48615
|
-
};
|
|
48616
|
-
generateChartInstanceListByViewRange(datum, table, !0);
|
|
48617
|
-
})), this.activeChartInstance.on("dimensionHover", params => {
|
|
48577
|
+
}), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
|
|
48618
48578
|
var _a, _b;
|
|
48619
48579
|
const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
|
|
48620
48580
|
canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
|
|
@@ -48677,23 +48637,21 @@
|
|
|
48677
48637
|
}
|
|
48678
48638
|
}
|
|
48679
48639
|
}
|
|
48680
|
-
})
|
|
48640
|
+
}), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
|
|
48681
48641
|
}
|
|
48682
48642
|
deactivate(table, {
|
|
48683
|
-
forceRelease = !1,
|
|
48684
48643
|
releaseChartInstance = !0,
|
|
48685
48644
|
releaseColumnChartInstance = !0,
|
|
48686
|
-
releaseRowChartInstance = !0
|
|
48687
|
-
releaseAllChartInstance = !1
|
|
48645
|
+
releaseRowChartInstance = !0
|
|
48688
48646
|
} = {}) {
|
|
48689
48647
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
48690
48648
|
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
|
|
48691
|
-
|
|
48649
|
+
null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
48692
48650
|
x1: -1e3,
|
|
48693
48651
|
x2: -800,
|
|
48694
48652
|
y1: -1e3,
|
|
48695
48653
|
y2: -800
|
|
48696
|
-
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null
|
|
48654
|
+
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
|
|
48697
48655
|
const {
|
|
48698
48656
|
col: col,
|
|
48699
48657
|
row: row
|
|
@@ -48706,7 +48664,7 @@
|
|
|
48706
48664
|
} = this.parent;
|
|
48707
48665
|
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));
|
|
48708
48666
|
}
|
|
48709
|
-
|
|
48667
|
+
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);
|
|
48710
48668
|
}
|
|
48711
48669
|
updateData(data) {
|
|
48712
48670
|
this.attribute.data = data;
|
|
@@ -48721,14 +48679,13 @@
|
|
|
48721
48679
|
y1: y1,
|
|
48722
48680
|
x2: x2,
|
|
48723
48681
|
y2: y2
|
|
48724
|
-
} = cellGroup.globalAABBBounds
|
|
48725
|
-
|
|
48726
|
-
|
|
48727
|
-
|
|
48728
|
-
|
|
48729
|
-
|
|
48730
|
-
|
|
48731
|
-
return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
|
|
48682
|
+
} = cellGroup.globalAABBBounds;
|
|
48683
|
+
return {
|
|
48684
|
+
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)),
|
|
48685
|
+
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)),
|
|
48686
|
+
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)),
|
|
48687
|
+
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))
|
|
48688
|
+
};
|
|
48732
48689
|
}
|
|
48733
48690
|
}
|
|
48734
48691
|
function getTableBounds(col, row, table) {
|
|
@@ -48943,7 +48900,7 @@
|
|
|
48943
48900
|
{
|
|
48944
48901
|
width = groupAttribute.width,
|
|
48945
48902
|
height = groupAttribute.height
|
|
48946
|
-
} = chart.attribute,
|
|
48903
|
+
} = (chart.getViewBox(), chart.attribute),
|
|
48947
48904
|
{
|
|
48948
48905
|
table: table
|
|
48949
48906
|
} = chart.getRootNode(),
|
|
@@ -48971,9 +48928,8 @@
|
|
|
48971
48928
|
});
|
|
48972
48929
|
}
|
|
48973
48930
|
}
|
|
48974
|
-
const
|
|
48975
|
-
|
|
48976
|
-
lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
|
|
48931
|
+
const viewBox = chart.getViewBox();
|
|
48932
|
+
activeChartInstance.updateViewBox({
|
|
48977
48933
|
x1: 0,
|
|
48978
48934
|
x2: viewBox.x2 - viewBox.x1,
|
|
48979
48935
|
y1: 0,
|
|
@@ -52491,10 +52447,9 @@
|
|
|
52491
52447
|
});
|
|
52492
52448
|
}
|
|
52493
52449
|
}
|
|
52494
|
-
function updateChartState(scenegraph, datum
|
|
52450
|
+
function updateChartState(scenegraph, datum) {
|
|
52495
52451
|
const table = scenegraph.table;
|
|
52496
52452
|
if (table.isPivotChart()) {
|
|
52497
|
-
table._selectedDataMode = selectedDataMode;
|
|
52498
52453
|
const preSelectItemsCount = table._selectedDataItemsInChart.length;
|
|
52499
52454
|
if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
|
|
52500
52455
|
const newSelectedDataItemsInChart = [];
|
|
@@ -53242,36 +53197,16 @@
|
|
|
53242
53197
|
resetResidentHoverIcon(col, row) {
|
|
53243
53198
|
resetResidentHoverIcon(col, row, this);
|
|
53244
53199
|
}
|
|
53245
|
-
deactivateChart(col, row
|
|
53246
|
-
var _a, _b, _c
|
|
53247
|
-
if (-1 === col || -1 === row)
|
|
53248
|
-
if (forceRelease) {
|
|
53249
|
-
const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
|
|
53250
|
-
cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
|
|
53251
|
-
(null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (clearBrushingChartInstance(), null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
|
|
53252
|
-
forceRelease: !0,
|
|
53253
|
-
releaseChartInstance: !0,
|
|
53254
|
-
releaseColumnChartInstance: !0,
|
|
53255
|
-
releaseRowChartInstance: !0,
|
|
53256
|
-
releaseAllChartInstance: !0
|
|
53257
|
-
}));
|
|
53258
|
-
}
|
|
53259
|
-
return;
|
|
53260
|
-
}
|
|
53200
|
+
deactivateChart(col, row) {
|
|
53201
|
+
var _a, _b, _c;
|
|
53202
|
+
if (-1 === col || -1 === row) return;
|
|
53261
53203
|
const cellGroup = this.getCell(col, row);
|
|
53262
|
-
if (null === (
|
|
53263
|
-
if (forceRelease) return clearBrushingChartInstance(), void (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _e ? void 0 : _e.deactivate) || void 0 === _f || _f.call(_e, this.table, {
|
|
53264
|
-
forceRelease: !0,
|
|
53265
|
-
releaseChartInstance: !0,
|
|
53266
|
-
releaseColumnChartInstance: !0,
|
|
53267
|
-
releaseRowChartInstance: !0,
|
|
53268
|
-
releaseAllChartInstance: !0
|
|
53269
|
-
}));
|
|
53204
|
+
if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
|
|
53270
53205
|
const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
|
|
53271
|
-
null === (
|
|
53272
|
-
releaseChartInstance: "
|
|
53273
|
-
releaseColumnChartInstance:
|
|
53274
|
-
releaseRowChartInstance:
|
|
53206
|
+
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 ? {
|
|
53207
|
+
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,
|
|
53208
|
+
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,
|
|
53209
|
+
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
|
|
53275
53210
|
} : void 0);
|
|
53276
53211
|
}
|
|
53277
53212
|
}
|
|
@@ -53319,15 +53254,8 @@
|
|
|
53319
53254
|
updateChartSizeForResizeRowHeight(row) {
|
|
53320
53255
|
updateChartSizeForResizeRowHeight(this, row);
|
|
53321
53256
|
}
|
|
53322
|
-
updateChartState(datum
|
|
53323
|
-
|
|
53324
|
-
if (this.table.isPivotChart()) {
|
|
53325
|
-
if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
|
|
53326
|
-
const brushingChartInstance = getBrushingChartInstance();
|
|
53327
|
-
brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), null === (_b = null === (_a = this.table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.clearChartState) || void 0 === _b || _b.call(_a);
|
|
53328
|
-
}
|
|
53329
|
-
updateChartState(this, datum, selectedDataMode);
|
|
53330
|
-
}
|
|
53257
|
+
updateChartState(datum) {
|
|
53258
|
+
this.table.isPivotChart() && updateChartState(this, datum);
|
|
53331
53259
|
}
|
|
53332
53260
|
updateCheckboxCellState(col, row, checked) {
|
|
53333
53261
|
var _a, _b;
|
|
@@ -56354,7 +56282,7 @@
|
|
|
56354
56282
|
}, 0 !== e.button) return;
|
|
56355
56283
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
56356
56284
|
if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
|
|
56357
|
-
if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null
|
|
56285
|
+
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;
|
|
56358
56286
|
const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
|
|
56359
56287
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
56360
56288
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -56382,7 +56310,7 @@
|
|
|
56382
56310
|
}
|
|
56383
56311
|
eventManager.dealTableHover(eventArgsSet);
|
|
56384
56312
|
} else {
|
|
56385
|
-
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null
|
|
56313
|
+
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56386
56314
|
if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56387
56315
|
if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56388
56316
|
eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
|
|
@@ -56534,7 +56462,7 @@
|
|
|
56534
56462
|
if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
|
|
56535
56463
|
const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
|
|
56536
56464
|
if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
|
|
56537
|
-
table.scenegraph.updateChartState(null
|
|
56465
|
+
table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
|
|
56538
56466
|
const {
|
|
56539
56467
|
eventArgs: eventArgs
|
|
56540
56468
|
} = eventArgsSet;
|
|
@@ -56553,7 +56481,7 @@
|
|
|
56553
56481
|
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 {
|
|
56554
56482
|
stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
|
|
56555
56483
|
const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
56556
|
-
(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
|
|
56484
|
+
(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);
|
|
56557
56485
|
}
|
|
56558
56486
|
}), table.scenegraph.stage.addEventListener("pointermove", e => {
|
|
56559
56487
|
var _a, _b, _c;
|
|
@@ -56671,15 +56599,7 @@
|
|
|
56671
56599
|
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
|
|
56672
56600
|
}), table.scenegraph.stage.addEventListener("wheel", e => {
|
|
56673
56601
|
var _a;
|
|
56674
|
-
|
|
56675
|
-
null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
|
|
56676
|
-
const {
|
|
56677
|
-
cellPos: cellPos
|
|
56678
|
-
} = table.stateManager.hover,
|
|
56679
|
-
prevHoverCellCol = cellPos.col,
|
|
56680
|
-
prevHoverCellRow = cellPos.row;
|
|
56681
|
-
table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
|
|
56682
|
-
}
|
|
56602
|
+
e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
|
|
56683
56603
|
});
|
|
56684
56604
|
}
|
|
56685
56605
|
function bindGesture(eventManager) {
|
|
@@ -57459,7 +57379,7 @@
|
|
|
57459
57379
|
};
|
|
57460
57380
|
let EventManager$1 = class EventManager {
|
|
57461
57381
|
constructor(table) {
|
|
57462
|
-
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(() => {
|
|
57382
|
+
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(() => {
|
|
57463
57383
|
this.bindSelfEvent();
|
|
57464
57384
|
}, 0));
|
|
57465
57385
|
}
|
|
@@ -57761,15 +57681,25 @@
|
|
|
57761
57681
|
} catch (error) {}
|
|
57762
57682
|
}
|
|
57763
57683
|
handleCut(e) {
|
|
57684
|
+
var _a;
|
|
57764
57685
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
57765
|
-
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.
|
|
57766
|
-
|
|
57686
|
+
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 => ({
|
|
57687
|
+
start: {
|
|
57688
|
+
col: r.start.col,
|
|
57689
|
+
row: r.start.row
|
|
57690
|
+
},
|
|
57691
|
+
end: {
|
|
57692
|
+
col: r.end.col,
|
|
57693
|
+
row: r.end.row
|
|
57694
|
+
}
|
|
57695
|
+
})), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
57696
|
+
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
|
|
57767
57697
|
}, 3e4), this.saveClipboardContent();
|
|
57768
57698
|
});
|
|
57769
57699
|
}
|
|
57770
57700
|
handlePaste(e) {
|
|
57771
57701
|
this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
|
|
57772
|
-
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
57702
|
+
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));
|
|
57773
57703
|
}).catch(() => {
|
|
57774
57704
|
this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
57775
57705
|
}) : this.executePaste(e);
|
|
@@ -57846,9 +57776,9 @@
|
|
|
57846
57776
|
}
|
|
57847
57777
|
clearCutArea(table) {
|
|
57848
57778
|
try {
|
|
57849
|
-
const
|
|
57850
|
-
if (!
|
|
57851
|
-
|
|
57779
|
+
const ranges = this.cutRanges;
|
|
57780
|
+
if (!ranges || 0 === ranges.length) return;
|
|
57781
|
+
table.changeCellValuesByIds(ranges, "");
|
|
57852
57782
|
} catch (error) {}
|
|
57853
57783
|
}
|
|
57854
57784
|
checkClipboardChanged() {
|
|
@@ -59786,6 +59716,15 @@
|
|
|
59786
59716
|
constructor(table, customCellStyle, customCellStyleArrangement) {
|
|
59787
59717
|
this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
|
|
59788
59718
|
}
|
|
59719
|
+
clearCustomCellStyleArrangement() {
|
|
59720
|
+
this.customCellStyleArrangement = [];
|
|
59721
|
+
}
|
|
59722
|
+
addCustomCellStyleArrangement(cellPosition, customStyleId) {
|
|
59723
|
+
this.customCellStyleArrangement.push({
|
|
59724
|
+
cellPosition: cellPosition,
|
|
59725
|
+
customStyleId: customStyleId
|
|
59726
|
+
});
|
|
59727
|
+
}
|
|
59789
59728
|
getCustomCellStyle(col, row) {
|
|
59790
59729
|
const customStyleIds = this.getCustomCellStyleIds(col, row);
|
|
59791
59730
|
if (customStyleIds.length) {
|
|
@@ -60091,7 +60030,7 @@
|
|
|
60091
60030
|
}
|
|
60092
60031
|
constructor(container, options = {}) {
|
|
60093
60032
|
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;
|
|
60094
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
60033
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.7", 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");
|
|
60095
60034
|
this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
60096
60035
|
options: options,
|
|
60097
60036
|
container: container
|
|
@@ -63902,15 +63841,16 @@
|
|
|
63902
63841
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
63903
63842
|
});
|
|
63904
63843
|
};
|
|
63905
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
63844
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
63906
63845
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
63907
|
-
const
|
|
63846
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
63847
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63908
63848
|
{
|
|
63909
63849
|
field: field
|
|
63910
63850
|
} = table.internalProps.layoutMap.getBody(col, row),
|
|
63911
63851
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
63912
63852
|
oldValue = table.getCellOriginValue(col, row);
|
|
63913
|
-
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value,
|
|
63853
|
+
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
|
|
63914
63854
|
const range = table.getCellRange(col, row),
|
|
63915
63855
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
63916
63856
|
if (aggregators) {
|
|
@@ -63933,16 +63873,24 @@
|
|
|
63933
63873
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
63934
63874
|
}
|
|
63935
63875
|
const changedValue = table.getCellOriginValue(col, row);
|
|
63936
|
-
oldValue !== changedValue && triggerEvent
|
|
63937
|
-
|
|
63938
|
-
|
|
63939
|
-
|
|
63940
|
-
|
|
63941
|
-
|
|
63942
|
-
|
|
63876
|
+
if (oldValue !== changedValue && triggerEvent) {
|
|
63877
|
+
const changeValue = {
|
|
63878
|
+
col: col,
|
|
63879
|
+
row: row,
|
|
63880
|
+
recordIndex: recordIndex,
|
|
63881
|
+
field: field,
|
|
63882
|
+
rawValue: beforeChangeValue,
|
|
63883
|
+
currentValue: oldValue,
|
|
63884
|
+
changedValue: changedValue
|
|
63885
|
+
};
|
|
63886
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63887
|
+
values: [changeValue]
|
|
63888
|
+
});
|
|
63889
|
+
}
|
|
63890
|
+
table.scenegraph.updateNextFrame();
|
|
63943
63891
|
}
|
|
63944
63892
|
}
|
|
63945
|
-
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
63893
|
+
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
63946
63894
|
var _a, _b;
|
|
63947
63895
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63948
63896
|
const changedCellResults = [];
|
|
@@ -63964,6 +63912,7 @@
|
|
|
63964
63912
|
oldRowValues.push(oldValue);
|
|
63965
63913
|
}
|
|
63966
63914
|
}
|
|
63915
|
+
const resultChangeValues = [];
|
|
63967
63916
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
63968
63917
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
63969
63918
|
const rowValues = values[i];
|
|
@@ -63987,25 +63936,34 @@
|
|
|
63987
63936
|
if (isCanChange) {
|
|
63988
63937
|
changedCellResults[i][j] = !0;
|
|
63989
63938
|
const value = rowValues[j],
|
|
63990
|
-
|
|
63939
|
+
recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
63940
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
63991
63941
|
{
|
|
63992
63942
|
field: field
|
|
63993
63943
|
} = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
|
|
63994
63944
|
beforeChangeValue = beforeChangeValues[i][j],
|
|
63995
63945
|
oldValue = oldValues[i][j];
|
|
63996
|
-
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value,
|
|
63946
|
+
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);
|
|
63997
63947
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
63998
|
-
oldValue !== changedValue && triggerEvent
|
|
63999
|
-
|
|
64000
|
-
|
|
64001
|
-
|
|
64002
|
-
|
|
64003
|
-
|
|
64004
|
-
|
|
63948
|
+
if (oldValue !== changedValue && triggerEvent) {
|
|
63949
|
+
const changeValue = {
|
|
63950
|
+
col: startCol + j,
|
|
63951
|
+
row: startRow + i,
|
|
63952
|
+
recordIndex: recordIndex,
|
|
63953
|
+
field: field,
|
|
63954
|
+
rawValue: beforeChangeValue,
|
|
63955
|
+
currentValue: oldValue,
|
|
63956
|
+
changedValue: changedValue
|
|
63957
|
+
};
|
|
63958
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
63959
|
+
}
|
|
64005
63960
|
} else changedCellResults[i][j] = !1;
|
|
64006
63961
|
}
|
|
64007
63962
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
64008
63963
|
}
|
|
63964
|
+
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63965
|
+
values: resultChangeValues
|
|
63966
|
+
});
|
|
64009
63967
|
const startRange = table.getCellRange(startCol, startRow),
|
|
64010
63968
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
64011
63969
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -64039,6 +63997,58 @@
|
|
|
64039
63997
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
64040
63998
|
});
|
|
64041
63999
|
}
|
|
64000
|
+
function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
64001
|
+
var _a, _b;
|
|
64002
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64003
|
+
const resultChangeValues = [],
|
|
64004
|
+
processed = new Set(),
|
|
64005
|
+
nextValue = null != value ? value : "";
|
|
64006
|
+
for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
|
|
64007
|
+
const range = ranges[i],
|
|
64008
|
+
startCol = Math.min(range.start.col, range.end.col),
|
|
64009
|
+
endCol = Math.max(range.start.col, range.end.col),
|
|
64010
|
+
startRow = Math.min(range.start.row, range.end.row),
|
|
64011
|
+
endRow = Math.max(range.start.row, range.end.row);
|
|
64012
|
+
if (startCol > endCol || startRow > endRow) continue;
|
|
64013
|
+
const values = [],
|
|
64014
|
+
oldValues = [];
|
|
64015
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
64016
|
+
const rowValues = [],
|
|
64017
|
+
rowOldValues = [];
|
|
64018
|
+
for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
|
|
64019
|
+
values.push(rowValues), oldValues.push(rowOldValues);
|
|
64020
|
+
}
|
|
64021
|
+
const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
|
|
64022
|
+
for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
|
|
64023
|
+
const col = startCol + c,
|
|
64024
|
+
row = startRow + r,
|
|
64025
|
+
key = `${col},${row}`;
|
|
64026
|
+
if (processed.has(key)) continue;
|
|
64027
|
+
if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
|
|
64028
|
+
const oldValue = oldValues[r][c],
|
|
64029
|
+
changedValue = table.getCellOriginValue(col, row);
|
|
64030
|
+
if (oldValue === changedValue) continue;
|
|
64031
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
64032
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
64033
|
+
{
|
|
64034
|
+
field: field
|
|
64035
|
+
} = table.internalProps.layoutMap.getBody(col, row);
|
|
64036
|
+
resultChangeValues.push({
|
|
64037
|
+
col: col,
|
|
64038
|
+
row: row,
|
|
64039
|
+
recordIndex: recordIndex,
|
|
64040
|
+
field: field,
|
|
64041
|
+
rawValue: oldValue,
|
|
64042
|
+
currentValue: oldValue,
|
|
64043
|
+
changedValue: changedValue
|
|
64044
|
+
});
|
|
64045
|
+
}
|
|
64046
|
+
}
|
|
64047
|
+
!silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
64048
|
+
values: resultChangeValues
|
|
64049
|
+
});
|
|
64050
|
+
});
|
|
64051
|
+
}
|
|
64042
64052
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
64043
64053
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
64044
64054
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -64056,13 +64066,16 @@
|
|
|
64056
64066
|
}), table.dataSource.sort(sortState));
|
|
64057
64067
|
}
|
|
64058
64068
|
function listTableAddRecord(record, recordIndex, table) {
|
|
64059
|
-
var _a, _b, _c, _d;
|
|
64069
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64060
64070
|
try {
|
|
64061
64071
|
if (!record) return !1;
|
|
64062
|
-
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState)
|
|
64072
|
+
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
|
|
64073
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecord(record, table.dataSource.records.length, !0) : table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64074
|
+
} else {
|
|
64063
64075
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
64064
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
64065
|
-
|
|
64076
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
64077
|
+
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
64078
|
+
if (table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64066
64079
|
const oldRowCount = table.rowCount;
|
|
64067
64080
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64068
64081
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64131,13 +64144,16 @@
|
|
|
64131
64144
|
}
|
|
64132
64145
|
}
|
|
64133
64146
|
function listTableAddRecords(records, recordIndex, table) {
|
|
64134
|
-
var _a, _b, _c, _d;
|
|
64147
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64135
64148
|
try {
|
|
64136
64149
|
if (!records || 0 === records.length) return !1;
|
|
64137
|
-
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState)
|
|
64150
|
+
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
|
|
64151
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecords(records, table.dataSource.records.length, !0) : table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64152
|
+
} else {
|
|
64138
64153
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
64139
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
64140
|
-
|
|
64154
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
64155
|
+
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
64156
|
+
if (table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64141
64157
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64142
64158
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64143
64159
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64206,16 +64222,20 @@
|
|
|
64206
64222
|
}
|
|
64207
64223
|
}
|
|
64208
64224
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
64209
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
64225
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
64210
64226
|
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).deleteRecordsForGroup) || void 0 === _b || _b.call(_a, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) {
|
|
64211
64227
|
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
64212
64228
|
if (0 === deletedRecordIndexs.length) return;
|
|
64213
64229
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64214
64230
|
table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64215
|
-
} else if (table.sortState)
|
|
64216
|
-
|
|
64231
|
+
} else if (table.sortState) {
|
|
64232
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.deleteRecords(recordIndexs, !0) : table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64233
|
+
} else {
|
|
64234
|
+
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64235
|
+
deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
64217
64236
|
if (0 === deletedRecordIndexs.length) return;
|
|
64218
64237
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64238
|
+
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64219
64239
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64220
64240
|
table.refreshRowColCount();
|
|
64221
64241
|
const newRowCount = table.transpose ? table.colCount : table.rowCount,
|
|
@@ -64253,7 +64273,7 @@
|
|
|
64253
64273
|
col: 0,
|
|
64254
64274
|
row: row
|
|
64255
64275
|
});
|
|
64256
|
-
null === (
|
|
64276
|
+
null === (_g = table.reactCustomLayout) || void 0 === _g || _g.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_h = table.reactCustomLayout) || void 0 === _h || _h.updateAllCustomCell();
|
|
64257
64277
|
}
|
|
64258
64278
|
} else {
|
|
64259
64279
|
const delRows = [],
|
|
@@ -64285,15 +64305,19 @@
|
|
|
64285
64305
|
col: 0,
|
|
64286
64306
|
row: row
|
|
64287
64307
|
});
|
|
64288
|
-
null === (
|
|
64308
|
+
null === (_j = table.reactCustomLayout) || void 0 === _j || _j.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_k = table.reactCustomLayout) || void 0 === _k || _k.updateAllCustomCell();
|
|
64289
64309
|
}
|
|
64290
64310
|
}
|
|
64291
64311
|
}
|
|
64292
64312
|
function listTableUpdateRecords(records, recordIndexs, table) {
|
|
64293
|
-
var _a, _b, _c, _d;
|
|
64294
|
-
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState)
|
|
64295
|
-
|
|
64313
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64314
|
+
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
|
|
64315
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.updateRecords(records, recordIndexs, !0) : table.dataSource.updateRecordsForSorted(records, recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64316
|
+
} else {
|
|
64317
|
+
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64318
|
+
updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
64296
64319
|
if (0 === updateRecordIndexs.length) return;
|
|
64320
|
+
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64297
64321
|
const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
|
|
64298
64322
|
if (table.pagination) {
|
|
64299
64323
|
const {
|
|
@@ -65202,43 +65226,165 @@
|
|
|
65202
65226
|
}
|
|
65203
65227
|
return isValid$1(editorDefine);
|
|
65204
65228
|
}
|
|
65205
|
-
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
|
|
65206
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
65229
|
+
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65230
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65231
|
+
}
|
|
65232
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65233
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65234
|
+
}
|
|
65235
|
+
changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65236
|
+
return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65237
|
+
}
|
|
65238
|
+
changeSourceCellValue(recordIndex, field, value) {
|
|
65239
|
+
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
65240
|
+
cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
65241
|
+
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
|
|
65242
|
+
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
65243
|
+
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
|
|
65244
|
+
oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
|
|
65245
|
+
changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
65246
|
+
if (oldValue !== changedValue) {
|
|
65247
|
+
const changeValue = {
|
|
65248
|
+
col: cellAddr.col,
|
|
65249
|
+
row: cellAddr.row,
|
|
65250
|
+
recordIndex: recordIndex,
|
|
65251
|
+
field: field,
|
|
65252
|
+
rawValue: beforeChangeValue,
|
|
65253
|
+
currentValue: oldValue,
|
|
65254
|
+
changedValue: changedValue
|
|
65255
|
+
};
|
|
65256
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65257
|
+
values: [changeValue]
|
|
65258
|
+
});
|
|
65259
|
+
}
|
|
65260
|
+
}
|
|
65261
|
+
changeCellValueByRecord(recordIndex, field, value, options) {
|
|
65262
|
+
var _a, _b, _c, _d, _e;
|
|
65263
|
+
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
65264
|
+
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
65265
|
+
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
65266
|
+
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
65267
|
+
let record, oldValue;
|
|
65268
|
+
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;
|
|
65269
|
+
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
65270
|
+
if (oldValue !== changedValue) {
|
|
65271
|
+
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
|
|
65272
|
+
changeValue = {
|
|
65273
|
+
col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
|
|
65274
|
+
row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
|
|
65275
|
+
recordIndex: recordIndex,
|
|
65276
|
+
field: field,
|
|
65277
|
+
rawValue: oldValue,
|
|
65278
|
+
currentValue: oldValue,
|
|
65279
|
+
changedValue: changedValue
|
|
65280
|
+
};
|
|
65281
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65282
|
+
values: [changeValue]
|
|
65283
|
+
});
|
|
65284
|
+
}
|
|
65285
|
+
autoRefresh && this.refreshAfterSourceChange();
|
|
65207
65286
|
}
|
|
65208
|
-
|
|
65209
|
-
return
|
|
65287
|
+
changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65288
|
+
return this.changeCellValueByRecord(recordIndex, field, value, {
|
|
65289
|
+
triggerEvent: triggerEvent,
|
|
65290
|
+
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
65291
|
+
autoRefresh: !0
|
|
65292
|
+
});
|
|
65293
|
+
}
|
|
65294
|
+
changeCellValuesByRecords(changeValues, options) {
|
|
65295
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
65296
|
+
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
65297
|
+
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
65298
|
+
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
65299
|
+
resultChangeValues = [];
|
|
65300
|
+
for (let i = 0; i < changeValues.length; i++) {
|
|
65301
|
+
const {
|
|
65302
|
+
recordIndex: recordIndex,
|
|
65303
|
+
field: field,
|
|
65304
|
+
value: value
|
|
65305
|
+
} = changeValues[i],
|
|
65306
|
+
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
65307
|
+
let record, oldValue;
|
|
65308
|
+
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) {
|
|
65309
|
+
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
65310
|
+
if (oldValue !== changedValue) {
|
|
65311
|
+
const changeValue = {
|
|
65312
|
+
col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
|
|
65313
|
+
row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
|
|
65314
|
+
recordIndex: recordIndex,
|
|
65315
|
+
field: field,
|
|
65316
|
+
rawValue: oldValue,
|
|
65317
|
+
currentValue: oldValue,
|
|
65318
|
+
changedValue: changedValue
|
|
65319
|
+
};
|
|
65320
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
65321
|
+
}
|
|
65322
|
+
}
|
|
65323
|
+
}
|
|
65324
|
+
!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65325
|
+
values: resultChangeValues
|
|
65326
|
+
}), autoRefresh && this.refreshAfterSourceChange();
|
|
65327
|
+
}
|
|
65328
|
+
changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65329
|
+
return this.changeCellValuesByRecords(changeValues, {
|
|
65330
|
+
triggerEvent: triggerEvent,
|
|
65331
|
+
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
65332
|
+
autoRefresh: !0
|
|
65333
|
+
});
|
|
65334
|
+
}
|
|
65335
|
+
refreshAfterSourceChange(options) {
|
|
65336
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
65337
|
+
const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
|
|
65338
|
+
reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
|
|
65339
|
+
clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
|
|
65340
|
+
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);
|
|
65341
|
+
const traverseColumns = columns => {
|
|
65342
|
+
var _a, _b, _c, _d;
|
|
65343
|
+
for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
|
|
65344
|
+
const column = columns[i],
|
|
65345
|
+
aggregators = null == column ? void 0 : column.vtable_aggregator;
|
|
65346
|
+
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);
|
|
65347
|
+
(null == column ? void 0 : column.columns) && traverseColumns(column.columns);
|
|
65348
|
+
}
|
|
65349
|
+
};
|
|
65350
|
+
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();
|
|
65210
65351
|
}
|
|
65211
|
-
addRecord(record, recordIndex) {
|
|
65352
|
+
addRecord(record, recordIndex, triggerEvent = !0) {
|
|
65212
65353
|
var _a;
|
|
65213
65354
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
65214
|
-
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
65355
|
+
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
65215
65356
|
records: [record],
|
|
65216
65357
|
recordIndex: recordIndex,
|
|
65217
65358
|
recordCount: 1
|
|
65218
65359
|
});
|
|
65219
65360
|
}
|
|
65220
|
-
addRecords(records, recordIndex) {
|
|
65361
|
+
addRecords(records, recordIndex, triggerEvent = !0) {
|
|
65221
65362
|
var _a;
|
|
65222
65363
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
65223
|
-
"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, {
|
|
65364
|
+
"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, {
|
|
65224
65365
|
records: records,
|
|
65225
65366
|
recordIndex: recordIndex,
|
|
65226
65367
|
recordCount: records.length
|
|
65227
65368
|
});
|
|
65228
65369
|
}
|
|
65229
|
-
deleteRecords(recordIndexs) {
|
|
65370
|
+
deleteRecords(recordIndexs, triggerEvent = !0) {
|
|
65230
65371
|
var _a;
|
|
65231
|
-
|
|
65372
|
+
const deletedRecords = [];
|
|
65373
|
+
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
65374
|
+
let record = null;
|
|
65375
|
+
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
65376
|
+
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
65232
65377
|
const rowIndexs = [];
|
|
65233
65378
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
65234
|
-
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
65379
|
+
triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
65235
65380
|
recordIndexs: recordIndexs,
|
|
65381
|
+
records: deletedRecords,
|
|
65236
65382
|
rowIndexs: rowIndexs,
|
|
65237
65383
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
65238
65384
|
});
|
|
65239
65385
|
}
|
|
65240
|
-
updateRecords(records, recordIndexs) {
|
|
65241
|
-
listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
65386
|
+
updateRecords(records, recordIndexs, triggerEvent = !0) {
|
|
65387
|
+
listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
65242
65388
|
records: records,
|
|
65243
65389
|
recordIndexs: recordIndexs,
|
|
65244
65390
|
updateCount: records.length
|
|
@@ -76396,7 +76542,7 @@
|
|
|
76396
76542
|
PluginManager: PluginManager
|
|
76397
76543
|
});
|
|
76398
76544
|
|
|
76399
|
-
const version = "1.22.11-alpha.
|
|
76545
|
+
const version = "1.22.11-alpha.7";
|
|
76400
76546
|
|
|
76401
76547
|
exports.Gantt = Gantt;
|
|
76402
76548
|
exports.TYPES = index$4;
|