@visactor/vtable-sheet 1.22.11-alpha.7 → 1.22.11-alpha.8
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-sheet.js +441 -576
- package/dist/vtable-sheet.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +6 -6
package/dist/vtable-sheet.js
CHANGED
|
@@ -37856,6 +37856,24 @@
|
|
|
37856
37856
|
}, delay));
|
|
37857
37857
|
};
|
|
37858
37858
|
}
|
|
37859
|
+
function cancellableThrottle(func, delay) {
|
|
37860
|
+
let timer = null,
|
|
37861
|
+
lastArgs = null,
|
|
37862
|
+
context = null;
|
|
37863
|
+
return {
|
|
37864
|
+
throttled: function (...args) {
|
|
37865
|
+
lastArgs = args, context = this, timer || (timer = setTimeout(() => {
|
|
37866
|
+
lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
|
|
37867
|
+
}, delay));
|
|
37868
|
+
},
|
|
37869
|
+
cancel: () => {
|
|
37870
|
+
timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
|
|
37871
|
+
},
|
|
37872
|
+
flush: () => {
|
|
37873
|
+
timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
|
|
37874
|
+
}
|
|
37875
|
+
};
|
|
37876
|
+
}
|
|
37859
37877
|
function pad(num, totalChars) {
|
|
37860
37878
|
for (num = `${num}`; num.length < totalChars;) num = "0" + num;
|
|
37861
37879
|
return num;
|
|
@@ -38828,7 +38846,6 @@
|
|
|
38828
38846
|
AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
|
|
38829
38847
|
AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
|
|
38830
38848
|
CHANGE_CELL_VALUE: "change_cell_value",
|
|
38831
|
-
CHANGE_CELL_VALUES: "change_cell_values",
|
|
38832
38849
|
DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
|
|
38833
38850
|
MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
|
|
38834
38851
|
DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
|
|
@@ -40961,24 +40978,6 @@
|
|
|
40961
40978
|
}
|
|
40962
40979
|
}
|
|
40963
40980
|
}
|
|
40964
|
-
changeFieldValueByRecordIndex(value, recordIndex, field, table) {
|
|
40965
|
-
var _a, _b, _c, _d;
|
|
40966
|
-
if (null === field) return;
|
|
40967
|
-
if (null == recordIndex) return;
|
|
40968
|
-
const rawKey = recordIndex.toString();
|
|
40969
|
-
if (!this.beforeChangedRecordsMap.has(rawKey)) {
|
|
40970
|
-
const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
|
|
40971
|
-
originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
40972
|
-
this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep$1(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
|
|
40973
|
-
}
|
|
40974
|
-
if ("string" == typeof field || "number" == typeof field) {
|
|
40975
|
-
const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
|
|
40976
|
-
rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
|
|
40977
|
-
record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
40978
|
-
let formatValue = value;
|
|
40979
|
-
"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);
|
|
40980
|
-
}
|
|
40981
|
-
}
|
|
40982
40981
|
cacheBeforeChangedRecord(dataIndex, table) {
|
|
40983
40982
|
var _a;
|
|
40984
40983
|
if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
|
|
@@ -40994,82 +40993,41 @@
|
|
|
40994
40993
|
Array.isArray(indexed) || this.records.splice(indexed, 1, record);
|
|
40995
40994
|
}
|
|
40996
40995
|
}
|
|
40997
|
-
|
|
40996
|
+
addRecord(record, index) {
|
|
40998
40997
|
var _a;
|
|
40999
|
-
|
|
41000
|
-
|
|
41001
|
-
|
|
41002
|
-
|
|
41003
|
-
|
|
41004
|
-
|
|
41005
|
-
|
|
41006
|
-
|
|
41007
|
-
|
|
41008
|
-
|
|
41009
|
-
|
|
41010
|
-
|
|
41011
|
-
if (viewIndex <= 0) return 0;
|
|
41012
|
-
const prevRecord = this.records[viewIndex - 1],
|
|
41013
|
-
rawIndex = rawRecords.indexOf(prevRecord);
|
|
41014
|
-
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
41015
|
-
}
|
|
41016
|
-
_resetIndexingFromViewRecords() {
|
|
41017
|
-
if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
|
|
41018
|
-
length: this._sourceLength
|
|
41019
|
-
}, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
|
|
41020
|
-
this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
41021
|
-
}
|
|
41022
|
-
addRecord(record, index, syncToOriginalRecords = !1) {
|
|
41023
|
-
var _a, _b, _c;
|
|
41024
|
-
if (!syncToOriginalRecords) {
|
|
41025
|
-
if (Array.isArray(this.records)) {
|
|
41026
|
-
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
41027
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
41028
|
-
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
41029
|
-
this.pagination.totalCount = this._sourceLength;
|
|
41030
|
-
const {
|
|
41031
|
-
perPageCount: perPageCount,
|
|
41032
|
-
currentPage: currentPage
|
|
41033
|
-
} = this.pagination;
|
|
41034
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
41035
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
41036
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
41037
|
-
}
|
|
41038
|
-
return;
|
|
40998
|
+
if (Array.isArray(this.records)) {
|
|
40999
|
+
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
41000
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
41001
|
+
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
41002
|
+
this.pagination.totalCount = this._sourceLength;
|
|
41003
|
+
const {
|
|
41004
|
+
perPageCount: perPageCount,
|
|
41005
|
+
currentPage: currentPage
|
|
41006
|
+
} = this.pagination;
|
|
41007
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
41008
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
41009
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
41039
41010
|
}
|
|
41040
|
-
const rawRecords = this._getRawRecordsArray();
|
|
41041
|
-
if (!rawRecords) return;
|
|
41042
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
41043
|
-
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
41044
|
-
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);
|
|
41045
41011
|
}
|
|
41046
|
-
addRecords(recordArr, index
|
|
41047
|
-
var _a
|
|
41048
|
-
if (
|
|
41049
|
-
if (Array.isArray(
|
|
41050
|
-
|
|
41051
|
-
|
|
41052
|
-
|
|
41053
|
-
|
|
41054
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
41055
|
-
}
|
|
41056
|
-
if (this.userPagination) {
|
|
41057
|
-
this.pagination.totalCount = this._sourceLength;
|
|
41058
|
-
const {
|
|
41059
|
-
perPageCount: perPageCount,
|
|
41060
|
-
currentPage: currentPage
|
|
41061
|
-
} = this.pagination;
|
|
41062
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
41063
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
41064
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
41012
|
+
addRecords(recordArr, index) {
|
|
41013
|
+
var _a;
|
|
41014
|
+
if (Array.isArray(this.records)) {
|
|
41015
|
+
if (Array.isArray(recordArr)) {
|
|
41016
|
+
this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
41017
|
+
for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
|
|
41018
|
+
this._sourceLength += recordArr.length;
|
|
41019
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
41065
41020
|
}
|
|
41066
|
-
|
|
41021
|
+
if (this.userPagination) {
|
|
41022
|
+
this.pagination.totalCount = this._sourceLength;
|
|
41023
|
+
const {
|
|
41024
|
+
perPageCount: perPageCount,
|
|
41025
|
+
currentPage: currentPage
|
|
41026
|
+
} = this.pagination;
|
|
41027
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
41028
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
41029
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
41067
41030
|
}
|
|
41068
|
-
const rawRecords = this._getRawRecordsArray();
|
|
41069
|
-
if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
|
|
41070
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
41071
|
-
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
41072
|
-
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);
|
|
41073
41031
|
}
|
|
41074
41032
|
addRecordForSorted(record) {
|
|
41075
41033
|
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));
|
|
@@ -41085,49 +41043,27 @@
|
|
|
41085
41043
|
}
|
|
41086
41044
|
}
|
|
41087
41045
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
|
|
41088
|
-
|
|
41089
|
-
|
|
41090
|
-
|
|
41091
|
-
const numKey = Number(key);
|
|
41092
|
-
Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
|
|
41093
|
-
}), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
|
|
41094
|
-
for (let i = 0; i < numericKeys.length; i++) {
|
|
41095
|
-
const key = numericKeys[i],
|
|
41096
|
-
record = this.beforeChangedRecordsMap.get(key.toString());
|
|
41097
|
-
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
41098
|
-
}
|
|
41099
|
-
}
|
|
41100
|
-
deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
|
|
41101
|
-
var _a, _b, _c;
|
|
41102
|
-
if (!syncToOriginalRecords) {
|
|
41103
|
-
if (Array.isArray(this.records)) {
|
|
41104
|
-
const realDeletedRecordIndexs = [],
|
|
41105
|
-
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
41106
|
-
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41107
|
-
const recordIndex = recordIndexsMaxToMin[index];
|
|
41108
|
-
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41109
|
-
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
41110
|
-
const deletedRecord = this.records[recordIndex];
|
|
41111
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
41112
|
-
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
41113
|
-
}
|
|
41114
|
-
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;
|
|
41115
|
-
}
|
|
41116
|
-
return [];
|
|
41117
|
-
}
|
|
41118
|
-
const rawRecords = this._getRawRecordsArray();
|
|
41119
|
-
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41120
|
-
const realDeletedRecordIndexs = [],
|
|
41121
|
-
recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
|
|
41122
|
-
rawDeletedIndexs = [];
|
|
41123
|
-
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41124
|
-
const viewIndex = recordIndexsMaxToMin[index];
|
|
41125
|
-
if (viewIndex >= this.records.length || viewIndex < 0) continue;
|
|
41126
|
-
const deletedRecord = this.records[viewIndex],
|
|
41127
|
-
rawIndex = rawRecords.indexOf(deletedRecord);
|
|
41128
|
-
rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
|
|
41046
|
+
for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
|
|
41047
|
+
const record = this.beforeChangedRecordsMap.get(key.toString());
|
|
41048
|
+
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
|
|
41129
41049
|
}
|
|
41130
|
-
|
|
41050
|
+
}
|
|
41051
|
+
deleteRecords(recordIndexs) {
|
|
41052
|
+
var _a;
|
|
41053
|
+
if (Array.isArray(this.records)) {
|
|
41054
|
+
const realDeletedRecordIndexs = [],
|
|
41055
|
+
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
41056
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
41057
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
41058
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41059
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
41060
|
+
const deletedRecord = this.records[recordIndex];
|
|
41061
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
41062
|
+
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
41063
|
+
}
|
|
41064
|
+
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;
|
|
41065
|
+
}
|
|
41066
|
+
return [];
|
|
41131
41067
|
}
|
|
41132
41068
|
deleteRecordsForSorted(recordIndexs) {
|
|
41133
41069
|
if (Array.isArray(this.records)) {
|
|
@@ -41141,34 +41077,18 @@
|
|
|
41141
41077
|
this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
|
|
41142
41078
|
}
|
|
41143
41079
|
}
|
|
41144
|
-
updateRecords(records, recordIndexs
|
|
41145
|
-
|
|
41146
|
-
if (!syncToOriginalRecords) {
|
|
41147
|
-
const realDeletedRecordIndexs = [];
|
|
41148
|
-
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41149
|
-
const recordIndex = recordIndexs[index];
|
|
41150
|
-
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 {
|
|
41151
|
-
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41152
|
-
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
41153
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
41154
|
-
this.records[recordIndex] = records[index];
|
|
41155
|
-
}
|
|
41156
|
-
}
|
|
41157
|
-
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
41158
|
-
}
|
|
41159
|
-
const rawRecords = this._getRawRecordsArray();
|
|
41160
|
-
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
41161
|
-
const realUpdatedIndexs = [];
|
|
41080
|
+
updateRecords(records, recordIndexs) {
|
|
41081
|
+
const realDeletedRecordIndexs = [];
|
|
41162
41082
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
41163
41083
|
const recordIndex = recordIndexs[index];
|
|
41164
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
41165
|
-
if (recordIndex >= this.
|
|
41166
|
-
|
|
41167
|
-
|
|
41168
|
-
|
|
41084
|
+
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 {
|
|
41085
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
41086
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
41087
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
41088
|
+
this.records[recordIndex] = records[index];
|
|
41169
41089
|
}
|
|
41170
41090
|
}
|
|
41171
|
-
return this.
|
|
41091
|
+
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
41172
41092
|
}
|
|
41173
41093
|
updateRecordsForSorted(records, recordIndexs) {
|
|
41174
41094
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -47802,11 +47722,35 @@
|
|
|
47802
47722
|
return hoverMode;
|
|
47803
47723
|
}
|
|
47804
47724
|
|
|
47725
|
+
let brushingChartInstance,
|
|
47726
|
+
brushingChartInstanceCellPos = {
|
|
47727
|
+
col: -1,
|
|
47728
|
+
row: -1
|
|
47729
|
+
};
|
|
47730
|
+
function setBrushingChartInstance(chartInstance, col, row) {
|
|
47731
|
+
brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
|
|
47732
|
+
col: col,
|
|
47733
|
+
row: row
|
|
47734
|
+
};
|
|
47735
|
+
}
|
|
47736
|
+
function clearBrushingChartInstance() {
|
|
47737
|
+
brushingChartInstance = void 0, brushingChartInstanceCellPos = {
|
|
47738
|
+
col: -1,
|
|
47739
|
+
row: -1
|
|
47740
|
+
};
|
|
47741
|
+
}
|
|
47742
|
+
function getBrushingChartInstance() {
|
|
47743
|
+
return brushingChartInstance;
|
|
47744
|
+
}
|
|
47745
|
+
function getBrushingChartInstanceCellPos() {
|
|
47746
|
+
return brushingChartInstanceCellPos;
|
|
47747
|
+
}
|
|
47805
47748
|
const chartInstanceListColumnByColumnDirection = {};
|
|
47806
47749
|
const chartInstanceListRowByRowDirection = {};
|
|
47750
|
+
const delayRunDimensionHoverTimer = [];
|
|
47807
47751
|
function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
47808
47752
|
var _a;
|
|
47809
|
-
isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
47753
|
+
clearDelayRunDimensionHoverTimers(), isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
47810
47754
|
const {
|
|
47811
47755
|
rowStart: rowStart
|
|
47812
47756
|
} = table.getBodyVisibleRowRange();
|
|
@@ -47815,76 +47759,40 @@
|
|
|
47815
47759
|
for (let i = rowStart; i <= rowEnd; i++) {
|
|
47816
47760
|
const cellGroup = table.scenegraph.getCell(col, i),
|
|
47817
47761
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47818
|
-
|
|
47819
|
-
|
|
47762
|
+
chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
|
|
47763
|
+
const timer = setTimeout(() => {
|
|
47764
|
+
var _a, _b, _c, _d;
|
|
47820
47765
|
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47821
47766
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47822
47767
|
let isShowTooltip = !isScatter;
|
|
47823
|
-
if (
|
|
47824
|
-
const
|
|
47825
|
-
|
|
47826
|
-
rowEnd: rowEnd1
|
|
47827
|
-
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
47828
|
-
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
47829
|
-
const {
|
|
47830
|
-
rowEnd: rowEnd2
|
|
47831
|
-
} = table.getBodyVisibleRowRange(0, 5);
|
|
47832
|
-
isShowTooltip = rowEnd2 !== rowEnd;
|
|
47833
|
-
}
|
|
47834
|
-
} else if (i === rowStart && isShowTooltip) {
|
|
47835
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
|
|
47836
|
-
{
|
|
47837
|
-
rowStart: rowStart1
|
|
47838
|
-
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
47839
|
-
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
47840
|
-
const {
|
|
47841
|
-
rowStart: rowStart2
|
|
47842
|
-
} = table.getBodyVisibleRowRange(0, -5);
|
|
47843
|
-
isShowTooltip = rowStart2 !== rowStart;
|
|
47844
|
-
}
|
|
47845
|
-
}
|
|
47846
|
-
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 {
|
|
47847
|
-
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
47768
|
+
if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table)), isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_d = (_c = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47769
|
+
const cellBoundry = table.getCellRelativeRect(col, i),
|
|
47770
|
+
bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
47848
47771
|
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
47849
47772
|
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47850
47773
|
tooltip: !1,
|
|
47851
47774
|
showTooltipOption: {
|
|
47852
|
-
x: canvasXY.x,
|
|
47853
|
-
y: absolutePositionTop,
|
|
47775
|
+
x: canvasXY.x - cellBoundry.left,
|
|
47776
|
+
y: absolutePositionTop - cellBoundry.top,
|
|
47854
47777
|
activeType: "dimension"
|
|
47855
47778
|
}
|
|
47856
47779
|
})) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47857
47780
|
tooltip: isShowTooltip,
|
|
47858
47781
|
showTooltipOption: {
|
|
47859
|
-
x: canvasXY.x,
|
|
47860
|
-
y: absolutePositionTop,
|
|
47782
|
+
x: canvasXY.x - cellBoundry.left,
|
|
47783
|
+
y: absolutePositionTop - cellBoundry.top,
|
|
47861
47784
|
activeType: "dimension"
|
|
47862
47785
|
}
|
|
47863
47786
|
});
|
|
47864
47787
|
}
|
|
47865
47788
|
}
|
|
47866
|
-
}, 0)
|
|
47867
|
-
|
|
47868
|
-
}
|
|
47869
|
-
function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
|
|
47870
|
-
var _a;
|
|
47871
|
-
if (isValid$2(chartInstanceListColumnByColumnDirection[col])) {
|
|
47872
|
-
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
47873
|
-
if (isValid$2(excludedRow) && Number(i) === excludedRow) continue;
|
|
47874
|
-
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
47875
|
-
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47876
|
-
chartNode.addUpdateShapeAndBoundsTag(), isValid$2(chartNode) && (chartNode.deactivate(table, {
|
|
47877
|
-
releaseChartInstance: !0,
|
|
47878
|
-
releaseColumnChartInstance: !1,
|
|
47879
|
-
releaseRowChartInstance: !1
|
|
47880
|
-
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
47881
|
-
}
|
|
47882
|
-
delete chartInstanceListColumnByColumnDirection[col];
|
|
47789
|
+
}, 0);
|
|
47790
|
+
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
47883
47791
|
}
|
|
47884
47792
|
}
|
|
47885
47793
|
function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
47886
47794
|
var _a;
|
|
47887
|
-
isValid$2(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
47795
|
+
clearDelayRunDimensionHoverTimers(), isValid$2(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
47888
47796
|
const {
|
|
47889
47797
|
colStart: colStart
|
|
47890
47798
|
} = table.getBodyVisibleColRange();
|
|
@@ -47893,64 +47801,162 @@
|
|
|
47893
47801
|
for (let i = colStart; i <= colEnd; i++) {
|
|
47894
47802
|
const cellGroup = table.scenegraph.getCell(i, row),
|
|
47895
47803
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47896
|
-
|
|
47804
|
+
chartInstanceListRowByRowDirection[row][i] || isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
|
|
47805
|
+
const timer = setTimeout(() => {
|
|
47897
47806
|
var _a, _b, _c, _d;
|
|
47898
47807
|
if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47899
47808
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47900
47809
|
let isShowTooltip = !isScatter;
|
|
47901
|
-
if (
|
|
47902
|
-
const
|
|
47903
|
-
|
|
47904
|
-
colEnd: colEnd1
|
|
47905
|
-
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
47906
|
-
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
47907
|
-
const {
|
|
47908
|
-
colEnd: colEnd2
|
|
47909
|
-
} = table.getBodyVisibleColRange(0, 5);
|
|
47910
|
-
isShowTooltip = colEnd2 !== colEnd;
|
|
47911
|
-
}
|
|
47912
|
-
} else if (i === colStart && isShowTooltip) {
|
|
47913
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47914
|
-
{
|
|
47915
|
-
colStart: colStart1
|
|
47916
|
-
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
47917
|
-
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
47918
|
-
const {
|
|
47919
|
-
colStart: colStart2
|
|
47920
|
-
} = table.getBodyVisibleColRange(0, -5);
|
|
47921
|
-
isShowTooltip = colStart2 !== colStart;
|
|
47922
|
-
}
|
|
47923
|
-
}
|
|
47924
|
-
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 {
|
|
47925
|
-
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
47810
|
+
if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table)), isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47811
|
+
const cellBoundry = table.getCellRelativeRect(i, row),
|
|
47812
|
+
bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
47926
47813
|
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
47927
47814
|
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47928
47815
|
tooltip: !1,
|
|
47929
47816
|
showTooltipOption: {
|
|
47930
|
-
x: absolutePositionLeft,
|
|
47931
|
-
y: canvasXY.y,
|
|
47817
|
+
x: absolutePositionLeft - cellBoundry.left,
|
|
47818
|
+
y: canvasXY.y - cellBoundry.top,
|
|
47932
47819
|
activeType: "dimension"
|
|
47933
47820
|
}
|
|
47934
47821
|
})) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47935
47822
|
tooltip: isShowTooltip,
|
|
47936
47823
|
showTooltipOption: {
|
|
47937
|
-
x: absolutePositionLeft,
|
|
47938
|
-
y: canvasXY.y,
|
|
47824
|
+
x: absolutePositionLeft - cellBoundry.left,
|
|
47825
|
+
y: canvasXY.y - cellBoundry.top,
|
|
47939
47826
|
activeType: "dimension"
|
|
47940
47827
|
}
|
|
47941
47828
|
});
|
|
47942
47829
|
}
|
|
47943
47830
|
}
|
|
47944
|
-
}, 0)
|
|
47831
|
+
}, 0);
|
|
47832
|
+
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
47833
|
+
}
|
|
47834
|
+
}
|
|
47835
|
+
function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
|
|
47836
|
+
var _a;
|
|
47837
|
+
clearDelayRunDimensionHoverTimers();
|
|
47838
|
+
const {
|
|
47839
|
+
rowStart: rowStart
|
|
47840
|
+
} = table.getBodyVisibleRowRange();
|
|
47841
|
+
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
47842
|
+
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
47843
|
+
const {
|
|
47844
|
+
colStart: colStart
|
|
47845
|
+
} = table.getBodyVisibleColRange();
|
|
47846
|
+
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
47847
|
+
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
47848
|
+
for (let col = colStart; col <= colEnd; col++) {
|
|
47849
|
+
isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
47850
|
+
for (let i = rowStart; i <= rowEnd; i++) {
|
|
47851
|
+
const cellGroup = table.scenegraph.getCell(col, i),
|
|
47852
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47853
|
+
chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
|
|
47854
|
+
const timer = setTimeout(() => {
|
|
47855
|
+
var _a, _b;
|
|
47856
|
+
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47857
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47858
|
+
let isShowTooltip = !0;
|
|
47859
|
+
"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, {
|
|
47860
|
+
activeType: "mark"
|
|
47861
|
+
})));
|
|
47862
|
+
}
|
|
47863
|
+
}, 0);
|
|
47864
|
+
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
47865
|
+
}
|
|
47866
|
+
}
|
|
47867
|
+
}
|
|
47868
|
+
function checkIsShowTooltipForEdgeRow(row, table) {
|
|
47869
|
+
var _a, _b;
|
|
47870
|
+
let isShowTooltip = !0;
|
|
47871
|
+
const {
|
|
47872
|
+
rowStart: rowStart
|
|
47873
|
+
} = table.getBodyVisibleRowRange();
|
|
47874
|
+
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
47875
|
+
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
47876
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47877
|
+
if (row === rowEnd && isShowTooltip) {
|
|
47878
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
|
|
47879
|
+
{
|
|
47880
|
+
rowEnd: rowEnd1
|
|
47881
|
+
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
47882
|
+
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
47883
|
+
const {
|
|
47884
|
+
rowEnd: rowEnd2
|
|
47885
|
+
} = table.getBodyVisibleRowRange(0, 5);
|
|
47886
|
+
isShowTooltip = rowEnd2 !== rowEnd;
|
|
47887
|
+
}
|
|
47888
|
+
} else if (row === rowStart && isShowTooltip) {
|
|
47889
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
|
|
47890
|
+
{
|
|
47891
|
+
rowStart: rowStart1
|
|
47892
|
+
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
47893
|
+
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
47894
|
+
const {
|
|
47895
|
+
rowStart: rowStart2
|
|
47896
|
+
} = table.getBodyVisibleRowRange(0, -5);
|
|
47897
|
+
isShowTooltip = rowStart2 !== rowStart;
|
|
47898
|
+
}
|
|
47899
|
+
}
|
|
47900
|
+
return isShowTooltip;
|
|
47901
|
+
}
|
|
47902
|
+
function checkIsShowTooltipForEdgeColumn(col, table) {
|
|
47903
|
+
let isShowTooltip = !0;
|
|
47904
|
+
const {
|
|
47905
|
+
colStart: colStart
|
|
47906
|
+
} = table.getBodyVisibleColRange();
|
|
47907
|
+
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
47908
|
+
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
47909
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47910
|
+
if (col === colEnd && isShowTooltip) {
|
|
47911
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47912
|
+
{
|
|
47913
|
+
colEnd: colEnd1
|
|
47914
|
+
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
47915
|
+
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
47916
|
+
const {
|
|
47917
|
+
colEnd: colEnd2
|
|
47918
|
+
} = table.getBodyVisibleColRange(0, 5);
|
|
47919
|
+
isShowTooltip = colEnd2 !== colEnd;
|
|
47920
|
+
}
|
|
47921
|
+
} else if (col === colStart && isShowTooltip) {
|
|
47922
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47923
|
+
{
|
|
47924
|
+
colStart: colStart1
|
|
47925
|
+
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
47926
|
+
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
47927
|
+
const {
|
|
47928
|
+
colStart: colStart2
|
|
47929
|
+
} = table.getBodyVisibleColRange(0, -5);
|
|
47930
|
+
isShowTooltip = colStart2 !== colStart;
|
|
47931
|
+
}
|
|
47945
47932
|
}
|
|
47933
|
+
return isShowTooltip;
|
|
47946
47934
|
}
|
|
47947
|
-
function
|
|
47935
|
+
function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
|
|
47936
|
+
var _a;
|
|
47937
|
+
if (isValid$2(chartInstanceListColumnByColumnDirection[col])) {
|
|
47938
|
+
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
47939
|
+
if (isValid$2(excludedRow) && Number(i) === excludedRow) continue;
|
|
47940
|
+
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
47941
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47942
|
+
isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
47943
|
+
forceRelease: forceRelease,
|
|
47944
|
+
releaseChartInstance: !0,
|
|
47945
|
+
releaseColumnChartInstance: !1,
|
|
47946
|
+
releaseRowChartInstance: !1
|
|
47947
|
+
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
47948
|
+
}
|
|
47949
|
+
delete chartInstanceListColumnByColumnDirection[col];
|
|
47950
|
+
}
|
|
47951
|
+
}
|
|
47952
|
+
function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
|
|
47948
47953
|
var _a;
|
|
47949
47954
|
if (isValid$2(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
|
|
47950
47955
|
if (isValid$2(excludedCol) && Number(i) === excludedCol) continue;
|
|
47951
47956
|
const cellGroup = table.scenegraph.getCell(Number(i), row),
|
|
47952
47957
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47953
|
-
|
|
47958
|
+
isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
47959
|
+
forceRelease: forceRelease,
|
|
47954
47960
|
releaseChartInstance: !0,
|
|
47955
47961
|
releaseColumnChartInstance: !1,
|
|
47956
47962
|
releaseRowChartInstance: !1
|
|
@@ -47958,6 +47964,19 @@
|
|
|
47958
47964
|
}
|
|
47959
47965
|
delete chartInstanceListRowByRowDirection[row];
|
|
47960
47966
|
}
|
|
47967
|
+
function clearDelayRunDimensionHoverTimers() {
|
|
47968
|
+
for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
|
|
47969
|
+
delayRunDimensionHoverTimer.length = 0;
|
|
47970
|
+
}
|
|
47971
|
+
function clearAllChartInstanceList(table, forceRelease = !1) {
|
|
47972
|
+
clearDelayRunDimensionHoverTimers();
|
|
47973
|
+
for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
|
|
47974
|
+
for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
|
|
47975
|
+
}
|
|
47976
|
+
let disabledShowTooltipToAllChartInstances = !1;
|
|
47977
|
+
function isDisabledShowTooltipToAllChartInstances() {
|
|
47978
|
+
return disabledShowTooltipToAllChartInstances;
|
|
47979
|
+
}
|
|
47961
47980
|
|
|
47962
47981
|
function isValidAlignDomain(domain) {
|
|
47963
47982
|
return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
|
|
@@ -48591,7 +48610,7 @@
|
|
|
48591
48610
|
const CHART_NUMBER_TYPE = genNumberType();
|
|
48592
48611
|
class Chart extends Rect$2 {
|
|
48593
48612
|
constructor(isShareChartSpec, params) {
|
|
48594
|
-
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 {
|
|
48613
|
+
if (super(params), this.type = "chart", this.activeChartInstanceLastViewBox = null, this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
|
|
48595
48614
|
const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
|
|
48596
48615
|
renderCanvas: params.canvas,
|
|
48597
48616
|
mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
|
|
@@ -48612,7 +48631,7 @@
|
|
|
48612
48631
|
}
|
|
48613
48632
|
}
|
|
48614
48633
|
activate(table) {
|
|
48615
|
-
var _a, _b, _c, _d, _e;
|
|
48634
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
48616
48635
|
if (this.activeChartInstance) return;
|
|
48617
48636
|
const {
|
|
48618
48637
|
col: col,
|
|
@@ -48631,7 +48650,7 @@
|
|
|
48631
48650
|
y1: y1 - table.scrollTop,
|
|
48632
48651
|
y2: y2 - table.scrollTop
|
|
48633
48652
|
});
|
|
48634
|
-
|
|
48653
|
+
this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
|
|
48635
48654
|
renderCanvas: this.attribute.canvas,
|
|
48636
48655
|
mode: "desktop-browser",
|
|
48637
48656
|
canvasControled: !1,
|
|
@@ -48665,7 +48684,7 @@
|
|
|
48665
48684
|
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());
|
|
48666
48685
|
}
|
|
48667
48686
|
},
|
|
48668
|
-
componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
|
|
48687
|
+
componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
|
|
48669
48688
|
tooltip: {
|
|
48670
48689
|
dimension: !1,
|
|
48671
48690
|
mark: !0
|
|
@@ -48676,16 +48695,43 @@
|
|
|
48676
48695
|
const chartStage = this.activeChartInstance.getStage(),
|
|
48677
48696
|
matrix = this.globalTransMatrix.clone(),
|
|
48678
48697
|
stageMatrix = this.stage.window.getViewBoxTransform();
|
|
48698
|
+
let brushChangeThrottle;
|
|
48679
48699
|
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 => {
|
|
48680
48700
|
var _a;
|
|
48681
|
-
!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);
|
|
48701
|
+
!1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null, void 0) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum, "click");
|
|
48702
|
+
}), (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 => {
|
|
48703
|
+
var _a;
|
|
48704
|
+
brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
|
|
48705
|
+
})), this.activeChartInstance.on("brushStart", params => {
|
|
48706
|
+
const brushingChartInstance = getBrushingChartInstance();
|
|
48707
|
+
brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
|
|
48682
48708
|
}), this.activeChartInstance.on("brushEnd", params => {
|
|
48683
48709
|
var _a;
|
|
48684
|
-
table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
|
|
48710
|
+
null == brushChangeThrottle || brushChangeThrottle.cancel(), table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush"), Chart.temp = 0, setTimeout(() => {
|
|
48685
48711
|
Chart.temp = 1;
|
|
48686
48712
|
}, 0);
|
|
48687
|
-
}), table.options.chartDimensionLinkage && this.activeChartInstance.on("
|
|
48713
|
+
}), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
|
|
48714
|
+
markName: "pie"
|
|
48715
|
+
}, params => {
|
|
48716
|
+
var _a;
|
|
48717
|
+
const categoryField = this.attribute.spec.categoryField,
|
|
48718
|
+
datum = {
|
|
48719
|
+
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
48720
|
+
};
|
|
48721
|
+
generateChartInstanceListByViewRange(datum, table, !1);
|
|
48722
|
+
}), this.activeChartInstance.on("pointerout", {
|
|
48723
|
+
markName: "pie"
|
|
48724
|
+
}, params => {
|
|
48725
|
+
var _a;
|
|
48726
|
+
const categoryField = this.attribute.spec.categoryField,
|
|
48727
|
+
datum = {
|
|
48728
|
+
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
48729
|
+
};
|
|
48730
|
+
generateChartInstanceListByViewRange(datum, table, !0);
|
|
48731
|
+
})), this.activeChartInstance.on("dimensionHover", params => {
|
|
48688
48732
|
var _a, _b;
|
|
48733
|
+
if (isDisabledShowTooltipToAllChartInstances()) return;
|
|
48734
|
+
this.activeChartInstance.disableTooltip(!1);
|
|
48689
48735
|
const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
|
|
48690
48736
|
canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
|
|
48691
48737
|
viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
|
|
@@ -48702,11 +48748,11 @@
|
|
|
48702
48748
|
prev_justShowMarkTooltip = this.justShowMarkTooltip;
|
|
48703
48749
|
params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
|
|
48704
48750
|
let delayRunDimensionHover = !1;
|
|
48705
|
-
if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1,
|
|
48751
|
+
if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, this.clearDelayRunDimensionHoverTimer()), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
|
|
48706
48752
|
const dimensionValue = dimensionInfo.value,
|
|
48707
48753
|
indicatorsAsCol = table.options.indicatorsAsCol;
|
|
48708
|
-
if (delayRunDimensionHover ? (
|
|
48709
|
-
indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
|
|
48754
|
+
if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
|
|
48755
|
+
isDisabledShowTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
|
|
48710
48756
|
}, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
|
|
48711
48757
|
const series = dimensionInfo.data[0].series,
|
|
48712
48758
|
width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
|
|
@@ -48747,21 +48793,26 @@
|
|
|
48747
48793
|
}
|
|
48748
48794
|
}
|
|
48749
48795
|
}
|
|
48750
|
-
}), null === (
|
|
48796
|
+
})), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledShowTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
|
|
48797
|
+
}
|
|
48798
|
+
clearDelayRunDimensionHoverTimer() {
|
|
48799
|
+
clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
|
|
48751
48800
|
}
|
|
48752
48801
|
deactivate(table, {
|
|
48802
|
+
forceRelease = !1,
|
|
48753
48803
|
releaseChartInstance = !0,
|
|
48754
48804
|
releaseColumnChartInstance = !0,
|
|
48755
|
-
releaseRowChartInstance = !0
|
|
48805
|
+
releaseRowChartInstance = !0,
|
|
48806
|
+
releaseAllChartInstance = !1
|
|
48756
48807
|
} = {}) {
|
|
48757
48808
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
48758
|
-
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(),
|
|
48759
|
-
null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
48809
|
+
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
|
|
48810
|
+
!forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
48760
48811
|
x1: -1e3,
|
|
48761
48812
|
x2: -800,
|
|
48762
48813
|
y1: -1e3,
|
|
48763
48814
|
y2: -800
|
|
48764
|
-
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
|
|
48815
|
+
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
|
|
48765
48816
|
const {
|
|
48766
48817
|
col: col,
|
|
48767
48818
|
row: row
|
|
@@ -48774,7 +48825,7 @@
|
|
|
48774
48825
|
} = this.parent;
|
|
48775
48826
|
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));
|
|
48776
48827
|
}
|
|
48777
|
-
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);
|
|
48828
|
+
releaseAllChartInstance ? clearAllChartInstanceList(table, forceRelease) : (releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table, forceRelease), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table, forceRelease));
|
|
48778
48829
|
}
|
|
48779
48830
|
updateData(data) {
|
|
48780
48831
|
this.attribute.data = data;
|
|
@@ -48789,13 +48840,14 @@
|
|
|
48789
48840
|
y1: y1,
|
|
48790
48841
|
x2: x2,
|
|
48791
48842
|
y2: y2
|
|
48792
|
-
} = cellGroup.globalAABBBounds
|
|
48793
|
-
|
|
48794
|
-
|
|
48795
|
-
|
|
48796
|
-
|
|
48797
|
-
|
|
48798
|
-
|
|
48843
|
+
} = cellGroup.globalAABBBounds,
|
|
48844
|
+
viewBox = {
|
|
48845
|
+
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)),
|
|
48846
|
+
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)),
|
|
48847
|
+
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)),
|
|
48848
|
+
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))
|
|
48849
|
+
};
|
|
48850
|
+
return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
|
|
48799
48851
|
}
|
|
48800
48852
|
}
|
|
48801
48853
|
function getTableBounds(col, row, table) {
|
|
@@ -49010,7 +49062,7 @@
|
|
|
49010
49062
|
{
|
|
49011
49063
|
width = groupAttribute.width,
|
|
49012
49064
|
height = groupAttribute.height
|
|
49013
|
-
} =
|
|
49065
|
+
} = chart.attribute,
|
|
49014
49066
|
{
|
|
49015
49067
|
table: table
|
|
49016
49068
|
} = chart.getRootNode(),
|
|
@@ -49038,8 +49090,9 @@
|
|
|
49038
49090
|
});
|
|
49039
49091
|
}
|
|
49040
49092
|
}
|
|
49041
|
-
const
|
|
49042
|
-
|
|
49093
|
+
const lastViewBox = chart.activeChartInstanceLastViewBox,
|
|
49094
|
+
viewBox = chart.getViewBox();
|
|
49095
|
+
lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
|
|
49043
49096
|
x1: 0,
|
|
49044
49097
|
x2: viewBox.x2 - viewBox.x1,
|
|
49045
49098
|
y1: 0,
|
|
@@ -52557,9 +52610,10 @@
|
|
|
52557
52610
|
});
|
|
52558
52611
|
}
|
|
52559
52612
|
}
|
|
52560
|
-
function updateChartState(scenegraph, datum) {
|
|
52613
|
+
function updateChartState(scenegraph, datum, selectedDataMode) {
|
|
52561
52614
|
const table = scenegraph.table;
|
|
52562
52615
|
if (table.isPivotChart()) {
|
|
52616
|
+
table._selectedDataMode = selectedDataMode;
|
|
52563
52617
|
const preSelectItemsCount = table._selectedDataItemsInChart.length;
|
|
52564
52618
|
if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
|
|
52565
52619
|
const newSelectedDataItemsInChart = [];
|
|
@@ -53307,16 +53361,39 @@
|
|
|
53307
53361
|
resetResidentHoverIcon(col, row) {
|
|
53308
53362
|
resetResidentHoverIcon(col, row, this);
|
|
53309
53363
|
}
|
|
53310
|
-
deactivateChart(col, row) {
|
|
53311
|
-
var _a, _b, _c;
|
|
53312
|
-
if (-1 === col || -1 === row)
|
|
53364
|
+
deactivateChart(col, row, forceRelease = !1) {
|
|
53365
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
53366
|
+
if (-1 === col || -1 === row) {
|
|
53367
|
+
if (forceRelease) {
|
|
53368
|
+
const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
|
|
53369
|
+
brushingChartInstance = getBrushingChartInstance();
|
|
53370
|
+
if (brushingChartInstanceCellPos && brushingChartInstance) {
|
|
53371
|
+
const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
|
|
53372
|
+
(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, {
|
|
53373
|
+
forceRelease: !0,
|
|
53374
|
+
releaseChartInstance: !0,
|
|
53375
|
+
releaseColumnChartInstance: !0,
|
|
53376
|
+
releaseRowChartInstance: !0,
|
|
53377
|
+
releaseAllChartInstance: !0
|
|
53378
|
+
}));
|
|
53379
|
+
}
|
|
53380
|
+
}
|
|
53381
|
+
return;
|
|
53382
|
+
}
|
|
53313
53383
|
const cellGroup = this.getCell(col, row);
|
|
53314
|
-
if (null === (
|
|
53384
|
+
if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
|
|
53385
|
+
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, {
|
|
53386
|
+
forceRelease: !0,
|
|
53387
|
+
releaseChartInstance: !0,
|
|
53388
|
+
releaseColumnChartInstance: !0,
|
|
53389
|
+
releaseRowChartInstance: !0,
|
|
53390
|
+
releaseAllChartInstance: !0
|
|
53391
|
+
}));
|
|
53315
53392
|
const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
|
|
53316
|
-
null === (
|
|
53317
|
-
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,
|
|
53318
|
-
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,
|
|
53319
|
-
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
|
|
53393
|
+
null === (_h = null === (_g = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _g ? void 0 : _g.deactivate) || void 0 === _h || _h.call(_g, this.table, (null === (_j = this.table.options.chartDimensionLinkage) || void 0 === _j ? void 0 : _j.showTooltip) ? {
|
|
53394
|
+
releaseChartInstance: "pie" !== chartType && ("scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
|
|
53395
|
+
releaseColumnChartInstance: "pie" !== chartType && (col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
|
|
53396
|
+
releaseRowChartInstance: "pie" !== chartType && (row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount)
|
|
53320
53397
|
} : void 0);
|
|
53321
53398
|
}
|
|
53322
53399
|
}
|
|
@@ -53364,8 +53441,15 @@
|
|
|
53364
53441
|
updateChartSizeForResizeRowHeight(row) {
|
|
53365
53442
|
updateChartSizeForResizeRowHeight(this, row);
|
|
53366
53443
|
}
|
|
53367
|
-
updateChartState(datum) {
|
|
53368
|
-
|
|
53444
|
+
updateChartState(datum, selectedDataMode) {
|
|
53445
|
+
var _a, _b;
|
|
53446
|
+
if (this.table.isPivotChart()) {
|
|
53447
|
+
if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
|
|
53448
|
+
const brushingChartInstance = getBrushingChartInstance();
|
|
53449
|
+
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);
|
|
53450
|
+
}
|
|
53451
|
+
updateChartState(this, datum, selectedDataMode);
|
|
53452
|
+
}
|
|
53369
53453
|
}
|
|
53370
53454
|
updateCheckboxCellState(col, row, checked) {
|
|
53371
53455
|
var _a, _b;
|
|
@@ -56392,7 +56476,7 @@
|
|
|
56392
56476
|
}, 0 !== e.button) return;
|
|
56393
56477
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
56394
56478
|
if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
|
|
56395
|
-
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;
|
|
56479
|
+
if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && (table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0)), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
|
|
56396
56480
|
const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
|
|
56397
56481
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
56398
56482
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -56420,7 +56504,7 @@
|
|
|
56420
56504
|
}
|
|
56421
56505
|
eventManager.dealTableHover(eventArgsSet);
|
|
56422
56506
|
} else {
|
|
56423
|
-
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56507
|
+
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56424
56508
|
if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56425
56509
|
if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
56426
56510
|
eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
|
|
@@ -56572,7 +56656,7 @@
|
|
|
56572
56656
|
if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
|
|
56573
56657
|
const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
|
|
56574
56658
|
if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
|
|
56575
|
-
table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
|
|
56659
|
+
table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
|
|
56576
56660
|
const {
|
|
56577
56661
|
eventArgs: eventArgs
|
|
56578
56662
|
} = eventArgsSet;
|
|
@@ -56591,7 +56675,7 @@
|
|
|
56591
56675
|
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 {
|
|
56592
56676
|
stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
|
|
56593
56677
|
const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
56594
|
-
(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);
|
|
56678
|
+
(null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
|
|
56595
56679
|
}
|
|
56596
56680
|
}), table.scenegraph.stage.addEventListener("pointermove", e => {
|
|
56597
56681
|
var _a, _b, _c;
|
|
@@ -56709,7 +56793,15 @@
|
|
|
56709
56793
|
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
|
|
56710
56794
|
}), table.scenegraph.stage.addEventListener("wheel", e => {
|
|
56711
56795
|
var _a;
|
|
56712
|
-
e.path.find(node => "legend" === node.name)
|
|
56796
|
+
if (!e.path.find(node => "legend" === node.name)) {
|
|
56797
|
+
null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
|
|
56798
|
+
const {
|
|
56799
|
+
cellPos: cellPos
|
|
56800
|
+
} = table.stateManager.hover,
|
|
56801
|
+
prevHoverCellCol = cellPos.col,
|
|
56802
|
+
prevHoverCellRow = cellPos.row;
|
|
56803
|
+
table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
|
|
56804
|
+
}
|
|
56713
56805
|
});
|
|
56714
56806
|
}
|
|
56715
56807
|
function bindGesture(eventManager) {
|
|
@@ -56824,11 +56916,13 @@
|
|
|
56824
56916
|
const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
|
|
56825
56917
|
throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
|
|
56826
56918
|
scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
|
|
56827
|
-
|
|
56919
|
+
var _a;
|
|
56920
|
+
scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
|
|
56828
56921
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
56829
56922
|
throttleVerticalWheel(ratio, e);
|
|
56830
56923
|
}), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
|
|
56831
|
-
|
|
56924
|
+
var _a;
|
|
56925
|
+
scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
|
|
56832
56926
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
56833
56927
|
throttleHorizontalWheel(ratio);
|
|
56834
56928
|
});
|
|
@@ -56978,7 +57072,7 @@
|
|
|
56978
57072
|
const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
|
|
56979
57073
|
eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
|
|
56980
57074
|
}
|
|
56981
|
-
});
|
|
57075
|
+
}), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
|
|
56982
57076
|
}
|
|
56983
57077
|
};
|
|
56984
57078
|
eventManager.globalEventListeners.push({
|
|
@@ -57489,7 +57583,7 @@
|
|
|
57489
57583
|
};
|
|
57490
57584
|
let EventManager$1 = class EventManager {
|
|
57491
57585
|
constructor(table) {
|
|
57492
|
-
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.
|
|
57586
|
+
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$1.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
57493
57587
|
this.bindSelfEvent();
|
|
57494
57588
|
}, 0));
|
|
57495
57589
|
}
|
|
@@ -57791,25 +57885,15 @@
|
|
|
57791
57885
|
} catch (error) {}
|
|
57792
57886
|
}
|
|
57793
57887
|
handleCut(e) {
|
|
57794
|
-
var _a;
|
|
57795
57888
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
57796
|
-
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.
|
|
57797
|
-
|
|
57798
|
-
col: r.start.col,
|
|
57799
|
-
row: r.start.row
|
|
57800
|
-
},
|
|
57801
|
-
end: {
|
|
57802
|
-
col: r.end.col,
|
|
57803
|
-
row: r.end.row
|
|
57804
|
-
}
|
|
57805
|
-
})), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
57806
|
-
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
|
|
57889
|
+
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
57890
|
+
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
|
|
57807
57891
|
}, 3e4), this.saveClipboardContent();
|
|
57808
57892
|
});
|
|
57809
57893
|
}
|
|
57810
57894
|
handlePaste(e) {
|
|
57811
57895
|
this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
|
|
57812
|
-
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.
|
|
57896
|
+
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
57813
57897
|
}).catch(() => {
|
|
57814
57898
|
this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
57815
57899
|
}) : this.executePaste(e);
|
|
@@ -57886,9 +57970,9 @@
|
|
|
57886
57970
|
}
|
|
57887
57971
|
clearCutArea(table) {
|
|
57888
57972
|
try {
|
|
57889
|
-
const
|
|
57890
|
-
if (!
|
|
57891
|
-
table.
|
|
57973
|
+
const selectCells = this.cutCellRange;
|
|
57974
|
+
if (!selectCells || 0 === selectCells.length) return;
|
|
57975
|
+
for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && table.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, void 0);
|
|
57892
57976
|
} catch (error) {}
|
|
57893
57977
|
}
|
|
57894
57978
|
checkClipboardChanged() {
|
|
@@ -59826,15 +59910,6 @@
|
|
|
59826
59910
|
constructor(table, customCellStyle, customCellStyleArrangement) {
|
|
59827
59911
|
this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
|
|
59828
59912
|
}
|
|
59829
|
-
clearCustomCellStyleArrangement() {
|
|
59830
|
-
this.customCellStyleArrangement = [];
|
|
59831
|
-
}
|
|
59832
|
-
addCustomCellStyleArrangement(cellPosition, customStyleId) {
|
|
59833
|
-
this.customCellStyleArrangement.push({
|
|
59834
|
-
cellPosition: cellPosition,
|
|
59835
|
-
customStyleId: customStyleId
|
|
59836
|
-
});
|
|
59837
|
-
}
|
|
59838
59913
|
getCustomCellStyle(col, row) {
|
|
59839
59914
|
const customStyleIds = this.getCustomCellStyleIds(col, row);
|
|
59840
59915
|
if (customStyleIds.length) {
|
|
@@ -60140,7 +60215,7 @@
|
|
|
60140
60215
|
}
|
|
60141
60216
|
constructor(container, options = {}) {
|
|
60142
60217
|
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;
|
|
60143
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
60218
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.8", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.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");
|
|
60144
60219
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
60145
60220
|
options: options,
|
|
60146
60221
|
container: container
|
|
@@ -63951,16 +64026,15 @@
|
|
|
63951
64026
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
63952
64027
|
});
|
|
63953
64028
|
};
|
|
63954
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table
|
|
64029
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
63955
64030
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
63956
|
-
const
|
|
63957
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
64031
|
+
const recordIndex = table.getRecordShowIndexByCell(col, row),
|
|
63958
64032
|
{
|
|
63959
64033
|
field: field
|
|
63960
64034
|
} = table.internalProps.layoutMap.getBody(col, row),
|
|
63961
64035
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
63962
64036
|
oldValue = table.getCellOriginValue(col, row);
|
|
63963
|
-
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value,
|
|
64037
|
+
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
|
|
63964
64038
|
const range = table.getCellRange(col, row),
|
|
63965
64039
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
63966
64040
|
if (aggregators) {
|
|
@@ -63983,24 +64057,16 @@
|
|
|
63983
64057
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
63984
64058
|
}
|
|
63985
64059
|
const changedValue = table.getCellOriginValue(col, row);
|
|
63986
|
-
|
|
63987
|
-
|
|
63988
|
-
|
|
63989
|
-
|
|
63990
|
-
|
|
63991
|
-
|
|
63992
|
-
|
|
63993
|
-
currentValue: oldValue,
|
|
63994
|
-
changedValue: changedValue
|
|
63995
|
-
};
|
|
63996
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
63997
|
-
values: [changeValue]
|
|
63998
|
-
});
|
|
63999
|
-
}
|
|
64000
|
-
table.scenegraph.updateNextFrame();
|
|
64060
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
64061
|
+
col: col,
|
|
64062
|
+
row: row,
|
|
64063
|
+
rawValue: beforeChangeValue,
|
|
64064
|
+
currentValue: oldValue,
|
|
64065
|
+
changedValue: changedValue
|
|
64066
|
+
}), table.scenegraph.updateNextFrame();
|
|
64001
64067
|
}
|
|
64002
64068
|
}
|
|
64003
|
-
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table
|
|
64069
|
+
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
64004
64070
|
var _a, _b;
|
|
64005
64071
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64006
64072
|
const changedCellResults = [];
|
|
@@ -64022,7 +64088,6 @@
|
|
|
64022
64088
|
oldRowValues.push(oldValue);
|
|
64023
64089
|
}
|
|
64024
64090
|
}
|
|
64025
|
-
const resultChangeValues = [];
|
|
64026
64091
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
64027
64092
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
64028
64093
|
const rowValues = values[i];
|
|
@@ -64046,34 +64111,25 @@
|
|
|
64046
64111
|
if (isCanChange) {
|
|
64047
64112
|
changedCellResults[i][j] = !0;
|
|
64048
64113
|
const value = rowValues[j],
|
|
64049
|
-
|
|
64050
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
64114
|
+
recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
64051
64115
|
{
|
|
64052
64116
|
field: field
|
|
64053
64117
|
} = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
|
|
64054
64118
|
beforeChangeValue = beforeChangeValues[i][j],
|
|
64055
64119
|
oldValue = oldValues[i][j];
|
|
64056
|
-
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value,
|
|
64120
|
+
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);
|
|
64057
64121
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
64058
|
-
|
|
64059
|
-
|
|
64060
|
-
|
|
64061
|
-
|
|
64062
|
-
|
|
64063
|
-
|
|
64064
|
-
|
|
64065
|
-
currentValue: oldValue,
|
|
64066
|
-
changedValue: changedValue
|
|
64067
|
-
};
|
|
64068
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
64069
|
-
}
|
|
64122
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
64123
|
+
col: startCol + j,
|
|
64124
|
+
row: startRow + i,
|
|
64125
|
+
rawValue: beforeChangeValue,
|
|
64126
|
+
currentValue: oldValue,
|
|
64127
|
+
changedValue: changedValue
|
|
64128
|
+
});
|
|
64070
64129
|
} else changedCellResults[i][j] = !1;
|
|
64071
64130
|
}
|
|
64072
64131
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
64073
64132
|
}
|
|
64074
|
-
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
64075
|
-
values: resultChangeValues
|
|
64076
|
-
});
|
|
64077
64133
|
const startRange = table.getCellRange(startCol, startRow),
|
|
64078
64134
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
64079
64135
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -64107,58 +64163,6 @@
|
|
|
64107
64163
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
64108
64164
|
});
|
|
64109
64165
|
}
|
|
64110
|
-
function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
64111
|
-
var _a, _b;
|
|
64112
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
64113
|
-
const resultChangeValues = [],
|
|
64114
|
-
processed = new Set(),
|
|
64115
|
-
nextValue = null != value ? value : "";
|
|
64116
|
-
for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
|
|
64117
|
-
const range = ranges[i],
|
|
64118
|
-
startCol = Math.min(range.start.col, range.end.col),
|
|
64119
|
-
endCol = Math.max(range.start.col, range.end.col),
|
|
64120
|
-
startRow = Math.min(range.start.row, range.end.row),
|
|
64121
|
-
endRow = Math.max(range.start.row, range.end.row);
|
|
64122
|
-
if (startCol > endCol || startRow > endRow) continue;
|
|
64123
|
-
const values = [],
|
|
64124
|
-
oldValues = [];
|
|
64125
|
-
for (let row = startRow; row <= endRow; row++) {
|
|
64126
|
-
const rowValues = [],
|
|
64127
|
-
rowOldValues = [];
|
|
64128
|
-
for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
|
|
64129
|
-
values.push(rowValues), oldValues.push(rowOldValues);
|
|
64130
|
-
}
|
|
64131
|
-
const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
|
|
64132
|
-
for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
|
|
64133
|
-
const col = startCol + c,
|
|
64134
|
-
row = startRow + r,
|
|
64135
|
-
key = `${col},${row}`;
|
|
64136
|
-
if (processed.has(key)) continue;
|
|
64137
|
-
if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
|
|
64138
|
-
const oldValue = oldValues[r][c],
|
|
64139
|
-
changedValue = table.getCellOriginValue(col, row);
|
|
64140
|
-
if (oldValue === changedValue) continue;
|
|
64141
|
-
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
64142
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
64143
|
-
{
|
|
64144
|
-
field: field
|
|
64145
|
-
} = table.internalProps.layoutMap.getBody(col, row);
|
|
64146
|
-
resultChangeValues.push({
|
|
64147
|
-
col: col,
|
|
64148
|
-
row: row,
|
|
64149
|
-
recordIndex: recordIndex,
|
|
64150
|
-
field: field,
|
|
64151
|
-
rawValue: oldValue,
|
|
64152
|
-
currentValue: oldValue,
|
|
64153
|
-
changedValue: changedValue
|
|
64154
|
-
});
|
|
64155
|
-
}
|
|
64156
|
-
}
|
|
64157
|
-
!silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
64158
|
-
values: resultChangeValues
|
|
64159
|
-
});
|
|
64160
|
-
});
|
|
64161
|
-
}
|
|
64162
64166
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
64163
64167
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
64164
64168
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -64176,16 +64180,13 @@
|
|
|
64176
64180
|
}), table.dataSource.sort(sortState));
|
|
64177
64181
|
}
|
|
64178
64182
|
function listTableAddRecord(record, recordIndex, table) {
|
|
64179
|
-
var _a, _b, _c, _d
|
|
64183
|
+
var _a, _b, _c, _d;
|
|
64180
64184
|
try {
|
|
64181
64185
|
if (!record) return !1;
|
|
64182
|
-
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) {
|
|
64183
|
-
!!(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();
|
|
64184
|
-
} else {
|
|
64186
|
+
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) table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
64185
64187
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
64186
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
64187
|
-
|
|
64188
|
-
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;
|
|
64188
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
64189
|
+
table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
|
|
64189
64190
|
const oldRowCount = table.rowCount;
|
|
64190
64191
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64191
64192
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64254,16 +64255,13 @@
|
|
|
64254
64255
|
}
|
|
64255
64256
|
}
|
|
64256
64257
|
function listTableAddRecords(records, recordIndex, table) {
|
|
64257
|
-
var _a, _b, _c, _d
|
|
64258
|
+
var _a, _b, _c, _d;
|
|
64258
64259
|
try {
|
|
64259
64260
|
if (!records || 0 === records.length) return !1;
|
|
64260
|
-
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) {
|
|
64261
|
-
!!(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();
|
|
64262
|
-
} else {
|
|
64261
|
+
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) table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
64263
64262
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
64264
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
64265
|
-
|
|
64266
|
-
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;
|
|
64263
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
64264
|
+
table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
|
|
64267
64265
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64268
64266
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
64269
64267
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -64332,20 +64330,16 @@
|
|
|
64332
64330
|
}
|
|
64333
64331
|
}
|
|
64334
64332
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
64335
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
64333
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
64336
64334
|
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) {
|
|
64337
64335
|
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
64338
64336
|
if (0 === deletedRecordIndexs.length) return;
|
|
64339
64337
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64340
64338
|
table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
64341
|
-
} else if (table.sortState) {
|
|
64342
|
-
|
|
64343
|
-
} else {
|
|
64344
|
-
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64345
|
-
deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
64339
|
+
} else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
64340
|
+
const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
|
|
64346
64341
|
if (0 === deletedRecordIndexs.length) return;
|
|
64347
64342
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
64348
|
-
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64349
64343
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
64350
64344
|
table.refreshRowColCount();
|
|
64351
64345
|
const newRowCount = table.transpose ? table.colCount : table.rowCount,
|
|
@@ -64383,7 +64377,7 @@
|
|
|
64383
64377
|
col: 0,
|
|
64384
64378
|
row: row
|
|
64385
64379
|
});
|
|
64386
|
-
null === (
|
|
64380
|
+
null === (_e = table.reactCustomLayout) || void 0 === _e || _e.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_f = table.reactCustomLayout) || void 0 === _f || _f.updateAllCustomCell();
|
|
64387
64381
|
}
|
|
64388
64382
|
} else {
|
|
64389
64383
|
const delRows = [],
|
|
@@ -64415,19 +64409,15 @@
|
|
|
64415
64409
|
col: 0,
|
|
64416
64410
|
row: row
|
|
64417
64411
|
});
|
|
64418
|
-
null === (
|
|
64412
|
+
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();
|
|
64419
64413
|
}
|
|
64420
64414
|
}
|
|
64421
64415
|
}
|
|
64422
64416
|
function listTableUpdateRecords(records, recordIndexs, table) {
|
|
64423
|
-
var _a, _b, _c, _d
|
|
64424
|
-
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) {
|
|
64425
|
-
|
|
64426
|
-
} else {
|
|
64427
|
-
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
64428
|
-
updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
64417
|
+
var _a, _b, _c, _d;
|
|
64418
|
+
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) table.dataSource.updateRecordsForSorted(records, recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
64419
|
+
const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
|
|
64429
64420
|
if (0 === updateRecordIndexs.length) return;
|
|
64430
|
-
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
64431
64421
|
const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
|
|
64432
64422
|
if (table.pagination) {
|
|
64433
64423
|
const {
|
|
@@ -65336,165 +65326,43 @@
|
|
|
65336
65326
|
}
|
|
65337
65327
|
return isValid$2(editorDefine);
|
|
65338
65328
|
}
|
|
65339
|
-
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0
|
|
65340
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this
|
|
65341
|
-
}
|
|
65342
|
-
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65343
|
-
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65344
|
-
}
|
|
65345
|
-
changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65346
|
-
return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
65347
|
-
}
|
|
65348
|
-
changeSourceCellValue(recordIndex, field, value) {
|
|
65349
|
-
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
65350
|
-
cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
65351
|
-
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
|
|
65352
|
-
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
65353
|
-
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
|
|
65354
|
-
oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
|
|
65355
|
-
changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
65356
|
-
if (oldValue !== changedValue) {
|
|
65357
|
-
const changeValue = {
|
|
65358
|
-
col: cellAddr.col,
|
|
65359
|
-
row: cellAddr.row,
|
|
65360
|
-
recordIndex: recordIndex,
|
|
65361
|
-
field: field,
|
|
65362
|
-
rawValue: beforeChangeValue,
|
|
65363
|
-
currentValue: oldValue,
|
|
65364
|
-
changedValue: changedValue
|
|
65365
|
-
};
|
|
65366
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65367
|
-
values: [changeValue]
|
|
65368
|
-
});
|
|
65369
|
-
}
|
|
65329
|
+
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
|
|
65330
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
65370
65331
|
}
|
|
65371
|
-
|
|
65372
|
-
|
|
65373
|
-
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
65374
|
-
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
65375
|
-
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
65376
|
-
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
65377
|
-
let record, oldValue;
|
|
65378
|
-
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;
|
|
65379
|
-
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
65380
|
-
if (oldValue !== changedValue) {
|
|
65381
|
-
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
|
|
65382
|
-
changeValue = {
|
|
65383
|
-
col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
|
|
65384
|
-
row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
|
|
65385
|
-
recordIndex: recordIndex,
|
|
65386
|
-
field: field,
|
|
65387
|
-
rawValue: oldValue,
|
|
65388
|
-
currentValue: oldValue,
|
|
65389
|
-
changedValue: changedValue
|
|
65390
|
-
};
|
|
65391
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65392
|
-
values: [changeValue]
|
|
65393
|
-
});
|
|
65394
|
-
}
|
|
65395
|
-
autoRefresh && this.refreshAfterSourceChange();
|
|
65396
|
-
}
|
|
65397
|
-
changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65398
|
-
return this.changeCellValueByRecord(recordIndex, field, value, {
|
|
65399
|
-
triggerEvent: triggerEvent,
|
|
65400
|
-
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
65401
|
-
autoRefresh: !0
|
|
65402
|
-
});
|
|
65332
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
|
|
65333
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
|
|
65403
65334
|
}
|
|
65404
|
-
|
|
65405
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
65406
|
-
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
65407
|
-
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
65408
|
-
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
65409
|
-
resultChangeValues = [];
|
|
65410
|
-
for (let i = 0; i < changeValues.length; i++) {
|
|
65411
|
-
const {
|
|
65412
|
-
recordIndex: recordIndex,
|
|
65413
|
-
field: field,
|
|
65414
|
-
value: value
|
|
65415
|
-
} = changeValues[i],
|
|
65416
|
-
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
65417
|
-
let record, oldValue;
|
|
65418
|
-
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) {
|
|
65419
|
-
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
65420
|
-
if (oldValue !== changedValue) {
|
|
65421
|
-
const changeValue = {
|
|
65422
|
-
col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
|
|
65423
|
-
row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
|
|
65424
|
-
recordIndex: recordIndex,
|
|
65425
|
-
field: field,
|
|
65426
|
-
rawValue: oldValue,
|
|
65427
|
-
currentValue: oldValue,
|
|
65428
|
-
changedValue: changedValue
|
|
65429
|
-
};
|
|
65430
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
65431
|
-
}
|
|
65432
|
-
}
|
|
65433
|
-
}
|
|
65434
|
-
!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
65435
|
-
values: resultChangeValues
|
|
65436
|
-
}), autoRefresh && this.refreshAfterSourceChange();
|
|
65437
|
-
}
|
|
65438
|
-
changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
65439
|
-
return this.changeCellValuesByRecords(changeValues, {
|
|
65440
|
-
triggerEvent: triggerEvent,
|
|
65441
|
-
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
65442
|
-
autoRefresh: !0
|
|
65443
|
-
});
|
|
65444
|
-
}
|
|
65445
|
-
refreshAfterSourceChange(options) {
|
|
65446
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
65447
|
-
const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
|
|
65448
|
-
reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
|
|
65449
|
-
clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
|
|
65450
|
-
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);
|
|
65451
|
-
const traverseColumns = columns => {
|
|
65452
|
-
var _a, _b, _c, _d;
|
|
65453
|
-
for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
|
|
65454
|
-
const column = columns[i],
|
|
65455
|
-
aggregators = null == column ? void 0 : column.vtable_aggregator;
|
|
65456
|
-
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);
|
|
65457
|
-
(null == column ? void 0 : column.columns) && traverseColumns(column.columns);
|
|
65458
|
-
}
|
|
65459
|
-
};
|
|
65460
|
-
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();
|
|
65461
|
-
}
|
|
65462
|
-
addRecord(record, recordIndex, triggerEvent = !0) {
|
|
65335
|
+
addRecord(record, recordIndex) {
|
|
65463
65336
|
var _a;
|
|
65464
65337
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
65465
|
-
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(),
|
|
65338
|
+
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
65466
65339
|
records: [record],
|
|
65467
65340
|
recordIndex: recordIndex,
|
|
65468
65341
|
recordCount: 1
|
|
65469
65342
|
});
|
|
65470
65343
|
}
|
|
65471
|
-
addRecords(records, recordIndex
|
|
65344
|
+
addRecords(records, recordIndex) {
|
|
65472
65345
|
var _a;
|
|
65473
65346
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
65474
|
-
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(),
|
|
65347
|
+
"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, {
|
|
65475
65348
|
records: records,
|
|
65476
65349
|
recordIndex: recordIndex,
|
|
65477
65350
|
recordCount: records.length
|
|
65478
65351
|
});
|
|
65479
65352
|
}
|
|
65480
|
-
deleteRecords(recordIndexs
|
|
65353
|
+
deleteRecords(recordIndexs) {
|
|
65481
65354
|
var _a;
|
|
65482
|
-
|
|
65483
|
-
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
65484
|
-
let record = null;
|
|
65485
|
-
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
65486
|
-
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
65355
|
+
listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
65487
65356
|
const rowIndexs = [];
|
|
65488
65357
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
65489
|
-
|
|
65358
|
+
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
65490
65359
|
recordIndexs: recordIndexs,
|
|
65491
|
-
records: deletedRecords,
|
|
65492
65360
|
rowIndexs: rowIndexs,
|
|
65493
65361
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
65494
65362
|
});
|
|
65495
65363
|
}
|
|
65496
|
-
updateRecords(records, recordIndexs
|
|
65497
|
-
listTableUpdateRecords(records, recordIndexs, this),
|
|
65364
|
+
updateRecords(records, recordIndexs) {
|
|
65365
|
+
listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
65498
65366
|
records: records,
|
|
65499
65367
|
recordIndexs: recordIndexs,
|
|
65500
65368
|
updateCount: records.length
|
|
@@ -69714,8 +69582,8 @@
|
|
|
69714
69582
|
}(ExcelEditCellKeyboardResponse || (ExcelEditCellKeyboardResponse = {}));
|
|
69715
69583
|
class ExcelEditCellKeyboardPlugin {
|
|
69716
69584
|
constructor(pluginOptions) {
|
|
69717
|
-
var _a, _b
|
|
69718
|
-
this.id = "excel-edit-cell-keyboard", this.name = "Excel Edit Cell Keyboard", this.runTime = [TABLE_EVENT_TYPE.INITIALIZED], this.id = null !== (_a = null == pluginOptions ? void 0 : pluginOptions.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = pluginOptions, this.responseKeyboard = null !== (_b = null == pluginOptions ? void 0 : pluginOptions.responseKeyboard) && void 0 !== _b ? _b : [ExcelEditCellKeyboardResponse.ENTER, ExcelEditCellKeyboardResponse.TAB, ExcelEditCellKeyboardResponse.ARROW_LEFT, ExcelEditCellKeyboardResponse.ARROW_RIGHT, ExcelEditCellKeyboardResponse.ARROW_DOWN, ExcelEditCellKeyboardResponse.ARROW_UP, ExcelEditCellKeyboardResponse.DELETE, ExcelEditCellKeyboardResponse.BACKSPACE], this.
|
|
69585
|
+
var _a, _b;
|
|
69586
|
+
this.id = "excel-edit-cell-keyboard", this.name = "Excel Edit Cell Keyboard", this.runTime = [TABLE_EVENT_TYPE.INITIALIZED], this.id = null !== (_a = null == pluginOptions ? void 0 : pluginOptions.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = pluginOptions, this.responseKeyboard = null !== (_b = null == pluginOptions ? void 0 : pluginOptions.responseKeyboard) && void 0 !== _b ? _b : [ExcelEditCellKeyboardResponse.ENTER, ExcelEditCellKeyboardResponse.TAB, ExcelEditCellKeyboardResponse.ARROW_LEFT, ExcelEditCellKeyboardResponse.ARROW_RIGHT, ExcelEditCellKeyboardResponse.ARROW_DOWN, ExcelEditCellKeyboardResponse.ARROW_UP, ExcelEditCellKeyboardResponse.DELETE, ExcelEditCellKeyboardResponse.BACKSPACE], this.bindEvent();
|
|
69719
69587
|
}
|
|
69720
69588
|
run(...args) {
|
|
69721
69589
|
const table = args[2];
|
|
@@ -69746,7 +69614,7 @@
|
|
|
69746
69614
|
(null == selectCells ? void 0 : selectCells.length) > 0 && (document.activeElement === this.table.getElement() || Object.values(this.table.editorManager.cacheLastSelectedCellEditor || {}).some(editor => {
|
|
69747
69615
|
var _a;
|
|
69748
69616
|
return (null === (_a = editor.getInputElement) || void 0 === _a ? void 0 : _a.call(editor)) === document.activeElement;
|
|
69749
|
-
})) && (deleteSelectRange(selectCells, this.table, null === (_c = null === (_b = this.pluginOptions) || void 0 === _b ? void 0 : _b.deleteWorkOnEditableCell) || void 0 === _c || _c
|
|
69617
|
+
})) && (deleteSelectRange(selectCells, this.table, null === (_c = null === (_b = this.pluginOptions) || void 0 === _b ? void 0 : _b.deleteWorkOnEditableCell) || void 0 === _c || _c), event.stopPropagation(), event.preventDefault());
|
|
69750
69618
|
}
|
|
69751
69619
|
} else this.table.editorManager.completeEdit(), this.table.getElement().focus(), eventKey === ExcelEditCellKeyboardResponse.ENTER ? this.table.selectCell(col, row + 1) : eventKey === ExcelEditCellKeyboardResponse.TAB && this.table.selectCell(col + 1, row), event.stopPropagation(), event.preventDefault();
|
|
69752
69620
|
}
|
|
@@ -69768,11 +69636,8 @@
|
|
|
69768
69636
|
document.removeEventListener("keydown", this.handleKeyDown, !0);
|
|
69769
69637
|
}
|
|
69770
69638
|
}
|
|
69771
|
-
function deleteSelectRange(selectCells, tableInstance, workOnEditableCell = !1
|
|
69772
|
-
|
|
69773
|
-
const ranges = tableInstance.stateManager.select.ranges;
|
|
69774
|
-
(null == ranges ? void 0 : ranges.length) && tableInstance.changeCellValuesByIds(ranges, "", workOnEditableCell, !0);
|
|
69775
|
-
} else for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) tableInstance.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, "", workOnEditableCell);
|
|
69639
|
+
function deleteSelectRange(selectCells, tableInstance, workOnEditableCell = !1) {
|
|
69640
|
+
for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) tableInstance.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, "", workOnEditableCell);
|
|
69776
69641
|
}
|
|
69777
69642
|
|
|
69778
69643
|
const MENU_CONTAINER_CLASS = "vtable-context-menu-container";
|
|
@@ -91335,7 +91200,7 @@
|
|
|
91335
91200
|
importStyle();
|
|
91336
91201
|
}
|
|
91337
91202
|
|
|
91338
|
-
const version = "1.22.11-alpha.
|
|
91203
|
+
const version = "1.22.11-alpha.8";
|
|
91339
91204
|
importStyles();
|
|
91340
91205
|
|
|
91341
91206
|
exports.TYPES = index;
|