@visactor/vtable-calendar 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/dist/vtable-calendar.js +434 -566
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +3 -3
package/dist/vtable-calendar.js
CHANGED
|
@@ -34616,6 +34616,24 @@
|
|
|
34616
34616
|
}, delay));
|
|
34617
34617
|
};
|
|
34618
34618
|
}
|
|
34619
|
+
function cancellableThrottle(func, delay) {
|
|
34620
|
+
let timer = null,
|
|
34621
|
+
lastArgs = null,
|
|
34622
|
+
context = null;
|
|
34623
|
+
return {
|
|
34624
|
+
throttled: function (...args) {
|
|
34625
|
+
lastArgs = args, context = this, timer || (timer = setTimeout(() => {
|
|
34626
|
+
lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
|
|
34627
|
+
}, delay));
|
|
34628
|
+
},
|
|
34629
|
+
cancel: () => {
|
|
34630
|
+
timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
|
|
34631
|
+
},
|
|
34632
|
+
flush: () => {
|
|
34633
|
+
timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
|
|
34634
|
+
}
|
|
34635
|
+
};
|
|
34636
|
+
}
|
|
34619
34637
|
function pad(num, totalChars) {
|
|
34620
34638
|
for (num = `${num}`; num.length < totalChars;) num = "0" + num;
|
|
34621
34639
|
return num;
|
|
@@ -34879,7 +34897,6 @@
|
|
|
34879
34897
|
AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
|
|
34880
34898
|
AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
|
|
34881
34899
|
CHANGE_CELL_VALUE: "change_cell_value",
|
|
34882
|
-
CHANGE_CELL_VALUES: "change_cell_values",
|
|
34883
34900
|
DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
|
|
34884
34901
|
MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
|
|
34885
34902
|
DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
|
|
@@ -36998,24 +37015,6 @@
|
|
|
36998
37015
|
}
|
|
36999
37016
|
}
|
|
37000
37017
|
}
|
|
37001
|
-
changeFieldValueByRecordIndex(value, recordIndex, field, table) {
|
|
37002
|
-
var _a, _b, _c, _d;
|
|
37003
|
-
if (null === field) return;
|
|
37004
|
-
if (null == recordIndex) return;
|
|
37005
|
-
const rawKey = recordIndex.toString();
|
|
37006
|
-
if (!this.beforeChangedRecordsMap.has(rawKey)) {
|
|
37007
|
-
const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
|
|
37008
|
-
originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
37009
|
-
this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
|
|
37010
|
-
}
|
|
37011
|
-
if ("string" == typeof field || "number" == typeof field) {
|
|
37012
|
-
const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
|
|
37013
|
-
rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
|
|
37014
|
-
record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
|
|
37015
|
-
let formatValue = value;
|
|
37016
|
-
"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);
|
|
37017
|
-
}
|
|
37018
|
-
}
|
|
37019
37018
|
cacheBeforeChangedRecord(dataIndex, table) {
|
|
37020
37019
|
var _a;
|
|
37021
37020
|
if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
|
|
@@ -37031,82 +37030,41 @@
|
|
|
37031
37030
|
Array.isArray(indexed) || this.records.splice(indexed, 1, record);
|
|
37032
37031
|
}
|
|
37033
37032
|
}
|
|
37034
|
-
|
|
37033
|
+
addRecord(record, index) {
|
|
37035
37034
|
var _a;
|
|
37036
|
-
|
|
37037
|
-
|
|
37038
|
-
|
|
37039
|
-
|
|
37040
|
-
|
|
37041
|
-
|
|
37042
|
-
|
|
37043
|
-
|
|
37044
|
-
|
|
37045
|
-
|
|
37046
|
-
|
|
37047
|
-
|
|
37048
|
-
if (viewIndex <= 0) return 0;
|
|
37049
|
-
const prevRecord = this.records[viewIndex - 1],
|
|
37050
|
-
rawIndex = rawRecords.indexOf(prevRecord);
|
|
37051
|
-
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
37052
|
-
}
|
|
37053
|
-
_resetIndexingFromViewRecords() {
|
|
37054
|
-
if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
|
|
37055
|
-
length: this._sourceLength
|
|
37056
|
-
}, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
|
|
37057
|
-
this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37058
|
-
}
|
|
37059
|
-
addRecord(record, index, syncToOriginalRecords = !1) {
|
|
37060
|
-
var _a, _b, _c;
|
|
37061
|
-
if (!syncToOriginalRecords) {
|
|
37062
|
-
if (Array.isArray(this.records)) {
|
|
37063
|
-
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
37064
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
37065
|
-
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
37066
|
-
this.pagination.totalCount = this._sourceLength;
|
|
37067
|
-
const {
|
|
37068
|
-
perPageCount: perPageCount,
|
|
37069
|
-
currentPage: currentPage
|
|
37070
|
-
} = this.pagination;
|
|
37071
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
37072
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37073
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
37074
|
-
}
|
|
37075
|
-
return;
|
|
37035
|
+
if (Array.isArray(this.records)) {
|
|
37036
|
+
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
37037
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
37038
|
+
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
37039
|
+
this.pagination.totalCount = this._sourceLength;
|
|
37040
|
+
const {
|
|
37041
|
+
perPageCount: perPageCount,
|
|
37042
|
+
currentPage: currentPage
|
|
37043
|
+
} = this.pagination;
|
|
37044
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
37045
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37046
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
37076
37047
|
}
|
|
37077
|
-
const rawRecords = this._getRawRecordsArray();
|
|
37078
|
-
if (!rawRecords) return;
|
|
37079
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
37080
|
-
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
37081
|
-
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);
|
|
37082
37048
|
}
|
|
37083
|
-
addRecords(recordArr, index
|
|
37084
|
-
var _a
|
|
37085
|
-
if (
|
|
37086
|
-
if (Array.isArray(
|
|
37087
|
-
|
|
37088
|
-
|
|
37089
|
-
|
|
37090
|
-
|
|
37091
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
37092
|
-
}
|
|
37093
|
-
if (this.userPagination) {
|
|
37094
|
-
this.pagination.totalCount = this._sourceLength;
|
|
37095
|
-
const {
|
|
37096
|
-
perPageCount: perPageCount,
|
|
37097
|
-
currentPage: currentPage
|
|
37098
|
-
} = this.pagination;
|
|
37099
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
37100
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37101
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
37049
|
+
addRecords(recordArr, index) {
|
|
37050
|
+
var _a;
|
|
37051
|
+
if (Array.isArray(this.records)) {
|
|
37052
|
+
if (Array.isArray(recordArr)) {
|
|
37053
|
+
this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
37054
|
+
for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
|
|
37055
|
+
this._sourceLength += recordArr.length;
|
|
37056
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
37102
37057
|
}
|
|
37103
|
-
|
|
37058
|
+
if (this.userPagination) {
|
|
37059
|
+
this.pagination.totalCount = this._sourceLength;
|
|
37060
|
+
const {
|
|
37061
|
+
perPageCount: perPageCount,
|
|
37062
|
+
currentPage: currentPage
|
|
37063
|
+
} = this.pagination;
|
|
37064
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
37065
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37066
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
37104
37067
|
}
|
|
37105
|
-
const rawRecords = this._getRawRecordsArray();
|
|
37106
|
-
if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
|
|
37107
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
37108
|
-
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
37109
|
-
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);
|
|
37110
37068
|
}
|
|
37111
37069
|
addRecordForSorted(record) {
|
|
37112
37070
|
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));
|
|
@@ -37122,49 +37080,27 @@
|
|
|
37122
37080
|
}
|
|
37123
37081
|
}
|
|
37124
37082
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
|
|
37125
|
-
|
|
37126
|
-
|
|
37127
|
-
|
|
37128
|
-
const numKey = Number(key);
|
|
37129
|
-
Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
|
|
37130
|
-
}), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
|
|
37131
|
-
for (let i = 0; i < numericKeys.length; i++) {
|
|
37132
|
-
const key = numericKeys[i],
|
|
37133
|
-
record = this.beforeChangedRecordsMap.get(key.toString());
|
|
37134
|
-
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
37135
|
-
}
|
|
37136
|
-
}
|
|
37137
|
-
deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
|
|
37138
|
-
var _a, _b, _c;
|
|
37139
|
-
if (!syncToOriginalRecords) {
|
|
37140
|
-
if (Array.isArray(this.records)) {
|
|
37141
|
-
const realDeletedRecordIndexs = [],
|
|
37142
|
-
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
37143
|
-
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
37144
|
-
const recordIndex = recordIndexsMaxToMin[index];
|
|
37145
|
-
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
37146
|
-
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
37147
|
-
const deletedRecord = this.records[recordIndex];
|
|
37148
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
37149
|
-
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
37150
|
-
}
|
|
37151
|
-
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;
|
|
37152
|
-
}
|
|
37153
|
-
return [];
|
|
37083
|
+
for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
|
|
37084
|
+
const record = this.beforeChangedRecordsMap.get(key.toString());
|
|
37085
|
+
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
|
|
37154
37086
|
}
|
|
37155
|
-
|
|
37156
|
-
|
|
37157
|
-
|
|
37158
|
-
|
|
37159
|
-
|
|
37160
|
-
|
|
37161
|
-
|
|
37162
|
-
|
|
37163
|
-
|
|
37164
|
-
|
|
37165
|
-
|
|
37087
|
+
}
|
|
37088
|
+
deleteRecords(recordIndexs) {
|
|
37089
|
+
var _a;
|
|
37090
|
+
if (Array.isArray(this.records)) {
|
|
37091
|
+
const realDeletedRecordIndexs = [],
|
|
37092
|
+
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
37093
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
37094
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
37095
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
37096
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
37097
|
+
const deletedRecord = this.records[recordIndex];
|
|
37098
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
37099
|
+
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
37100
|
+
}
|
|
37101
|
+
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;
|
|
37166
37102
|
}
|
|
37167
|
-
return
|
|
37103
|
+
return [];
|
|
37168
37104
|
}
|
|
37169
37105
|
deleteRecordsForSorted(recordIndexs) {
|
|
37170
37106
|
if (Array.isArray(this.records)) {
|
|
@@ -37178,34 +37114,18 @@
|
|
|
37178
37114
|
this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
|
|
37179
37115
|
}
|
|
37180
37116
|
}
|
|
37181
|
-
updateRecords(records, recordIndexs
|
|
37182
|
-
|
|
37183
|
-
if (!syncToOriginalRecords) {
|
|
37184
|
-
const realDeletedRecordIndexs = [];
|
|
37185
|
-
for (let index = 0; index < recordIndexs.length; index++) {
|
|
37186
|
-
const recordIndex = recordIndexs[index];
|
|
37187
|
-
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 {
|
|
37188
|
-
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
37189
|
-
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
37190
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
37191
|
-
this.records[recordIndex] = records[index];
|
|
37192
|
-
}
|
|
37193
|
-
}
|
|
37194
|
-
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
37195
|
-
}
|
|
37196
|
-
const rawRecords = this._getRawRecordsArray();
|
|
37197
|
-
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
37198
|
-
const realUpdatedIndexs = [];
|
|
37117
|
+
updateRecords(records, recordIndexs) {
|
|
37118
|
+
const realDeletedRecordIndexs = [];
|
|
37199
37119
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
37200
37120
|
const recordIndex = recordIndexs[index];
|
|
37201
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
37202
|
-
if (recordIndex >= this.
|
|
37203
|
-
|
|
37204
|
-
|
|
37205
|
-
|
|
37121
|
+
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 {
|
|
37122
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
37123
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
37124
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
37125
|
+
this.records[recordIndex] = records[index];
|
|
37206
37126
|
}
|
|
37207
37127
|
}
|
|
37208
|
-
return this.
|
|
37128
|
+
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
37209
37129
|
}
|
|
37210
37130
|
updateRecordsForSorted(records, recordIndexs) {
|
|
37211
37131
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -43839,11 +43759,35 @@
|
|
|
43839
43759
|
return hoverMode;
|
|
43840
43760
|
}
|
|
43841
43761
|
|
|
43762
|
+
let brushingChartInstance,
|
|
43763
|
+
brushingChartInstanceCellPos = {
|
|
43764
|
+
col: -1,
|
|
43765
|
+
row: -1
|
|
43766
|
+
};
|
|
43767
|
+
function setBrushingChartInstance(chartInstance, col, row) {
|
|
43768
|
+
brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
|
|
43769
|
+
col: col,
|
|
43770
|
+
row: row
|
|
43771
|
+
};
|
|
43772
|
+
}
|
|
43773
|
+
function clearBrushingChartInstance() {
|
|
43774
|
+
brushingChartInstance = void 0, brushingChartInstanceCellPos = {
|
|
43775
|
+
col: -1,
|
|
43776
|
+
row: -1
|
|
43777
|
+
};
|
|
43778
|
+
}
|
|
43779
|
+
function getBrushingChartInstance() {
|
|
43780
|
+
return brushingChartInstance;
|
|
43781
|
+
}
|
|
43782
|
+
function getBrushingChartInstanceCellPos() {
|
|
43783
|
+
return brushingChartInstanceCellPos;
|
|
43784
|
+
}
|
|
43842
43785
|
const chartInstanceListColumnByColumnDirection = {};
|
|
43843
43786
|
const chartInstanceListRowByRowDirection = {};
|
|
43787
|
+
const delayRunDimensionHoverTimer = [];
|
|
43844
43788
|
function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
43845
43789
|
var _a;
|
|
43846
|
-
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43790
|
+
clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43847
43791
|
const {
|
|
43848
43792
|
rowStart: rowStart
|
|
43849
43793
|
} = table.getBodyVisibleRowRange();
|
|
@@ -43852,76 +43796,40 @@
|
|
|
43852
43796
|
for (let i = rowStart; i <= rowEnd; i++) {
|
|
43853
43797
|
const cellGroup = table.scenegraph.getCell(col, i),
|
|
43854
43798
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43855
|
-
|
|
43856
|
-
|
|
43799
|
+
chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
|
|
43800
|
+
const timer = setTimeout(() => {
|
|
43801
|
+
var _a, _b, _c, _d;
|
|
43857
43802
|
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43858
43803
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43859
43804
|
let isShowTooltip = !isScatter;
|
|
43860
|
-
if (
|
|
43861
|
-
const
|
|
43862
|
-
|
|
43863
|
-
rowEnd: rowEnd1
|
|
43864
|
-
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
43865
|
-
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
43866
|
-
const {
|
|
43867
|
-
rowEnd: rowEnd2
|
|
43868
|
-
} = table.getBodyVisibleRowRange(0, 5);
|
|
43869
|
-
isShowTooltip = rowEnd2 !== rowEnd;
|
|
43870
|
-
}
|
|
43871
|
-
} else if (i === rowStart && isShowTooltip) {
|
|
43872
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
|
|
43873
|
-
{
|
|
43874
|
-
rowStart: rowStart1
|
|
43875
|
-
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
43876
|
-
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
43877
|
-
const {
|
|
43878
|
-
rowStart: rowStart2
|
|
43879
|
-
} = table.getBodyVisibleRowRange(0, -5);
|
|
43880
|
-
isShowTooltip = rowStart2 !== rowStart;
|
|
43881
|
-
}
|
|
43882
|
-
}
|
|
43883
|
-
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 {
|
|
43884
|
-
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
43805
|
+
if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table)), isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_d = (_c = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
43806
|
+
const cellBoundry = table.getCellRelativeRect(col, i),
|
|
43807
|
+
bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
43885
43808
|
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
43886
43809
|
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43887
43810
|
tooltip: !1,
|
|
43888
43811
|
showTooltipOption: {
|
|
43889
|
-
x: canvasXY.x,
|
|
43890
|
-
y: absolutePositionTop,
|
|
43812
|
+
x: canvasXY.x - cellBoundry.left,
|
|
43813
|
+
y: absolutePositionTop - cellBoundry.top,
|
|
43891
43814
|
activeType: "dimension"
|
|
43892
43815
|
}
|
|
43893
43816
|
})) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43894
43817
|
tooltip: isShowTooltip,
|
|
43895
43818
|
showTooltipOption: {
|
|
43896
|
-
x: canvasXY.x,
|
|
43897
|
-
y: absolutePositionTop,
|
|
43819
|
+
x: canvasXY.x - cellBoundry.left,
|
|
43820
|
+
y: absolutePositionTop - cellBoundry.top,
|
|
43898
43821
|
activeType: "dimension"
|
|
43899
43822
|
}
|
|
43900
43823
|
});
|
|
43901
43824
|
}
|
|
43902
43825
|
}
|
|
43903
|
-
}, 0)
|
|
43904
|
-
|
|
43905
|
-
}
|
|
43906
|
-
function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
|
|
43907
|
-
var _a;
|
|
43908
|
-
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
43909
|
-
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
43910
|
-
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
43911
|
-
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
43912
|
-
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43913
|
-
chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
|
|
43914
|
-
releaseChartInstance: !0,
|
|
43915
|
-
releaseColumnChartInstance: !1,
|
|
43916
|
-
releaseRowChartInstance: !1
|
|
43917
|
-
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
43918
|
-
}
|
|
43919
|
-
delete chartInstanceListColumnByColumnDirection[col];
|
|
43826
|
+
}, 0);
|
|
43827
|
+
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
43920
43828
|
}
|
|
43921
43829
|
}
|
|
43922
43830
|
function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
43923
43831
|
var _a;
|
|
43924
|
-
isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
43832
|
+
clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
43925
43833
|
const {
|
|
43926
43834
|
colStart: colStart
|
|
43927
43835
|
} = table.getBodyVisibleColRange();
|
|
@@ -43930,64 +43838,162 @@
|
|
|
43930
43838
|
for (let i = colStart; i <= colEnd; i++) {
|
|
43931
43839
|
const cellGroup = table.scenegraph.getCell(i, row),
|
|
43932
43840
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43933
|
-
|
|
43841
|
+
chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
|
|
43842
|
+
const timer = setTimeout(() => {
|
|
43934
43843
|
var _a, _b, _c, _d;
|
|
43935
43844
|
if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43936
43845
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43937
43846
|
let isShowTooltip = !isScatter;
|
|
43938
|
-
if (
|
|
43939
|
-
const
|
|
43940
|
-
|
|
43941
|
-
colEnd: colEnd1
|
|
43942
|
-
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
43943
|
-
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
43944
|
-
const {
|
|
43945
|
-
colEnd: colEnd2
|
|
43946
|
-
} = table.getBodyVisibleColRange(0, 5);
|
|
43947
|
-
isShowTooltip = colEnd2 !== colEnd;
|
|
43948
|
-
}
|
|
43949
|
-
} else if (i === colStart && isShowTooltip) {
|
|
43950
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43951
|
-
{
|
|
43952
|
-
colStart: colStart1
|
|
43953
|
-
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
43954
|
-
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
43955
|
-
const {
|
|
43956
|
-
colStart: colStart2
|
|
43957
|
-
} = table.getBodyVisibleColRange(0, -5);
|
|
43958
|
-
isShowTooltip = colStart2 !== colStart;
|
|
43959
|
-
}
|
|
43960
|
-
}
|
|
43961
|
-
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 {
|
|
43962
|
-
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
43847
|
+
if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table)), isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
43848
|
+
const cellBoundry = table.getCellRelativeRect(i, row),
|
|
43849
|
+
bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
43963
43850
|
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
43964
43851
|
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43965
43852
|
tooltip: !1,
|
|
43966
43853
|
showTooltipOption: {
|
|
43967
|
-
x: absolutePositionLeft,
|
|
43968
|
-
y: canvasXY.y,
|
|
43854
|
+
x: absolutePositionLeft - cellBoundry.left,
|
|
43855
|
+
y: canvasXY.y - cellBoundry.top,
|
|
43969
43856
|
activeType: "dimension"
|
|
43970
43857
|
}
|
|
43971
43858
|
})) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43972
43859
|
tooltip: isShowTooltip,
|
|
43973
43860
|
showTooltipOption: {
|
|
43974
|
-
x: absolutePositionLeft,
|
|
43975
|
-
y: canvasXY.y,
|
|
43861
|
+
x: absolutePositionLeft - cellBoundry.left,
|
|
43862
|
+
y: canvasXY.y - cellBoundry.top,
|
|
43976
43863
|
activeType: "dimension"
|
|
43977
43864
|
}
|
|
43978
43865
|
});
|
|
43979
43866
|
}
|
|
43980
43867
|
}
|
|
43981
|
-
}, 0)
|
|
43868
|
+
}, 0);
|
|
43869
|
+
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
43870
|
+
}
|
|
43871
|
+
}
|
|
43872
|
+
function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
|
|
43873
|
+
var _a;
|
|
43874
|
+
clearDelayRunDimensionHoverTimers();
|
|
43875
|
+
const {
|
|
43876
|
+
rowStart: rowStart
|
|
43877
|
+
} = table.getBodyVisibleRowRange();
|
|
43878
|
+
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
43879
|
+
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
43880
|
+
const {
|
|
43881
|
+
colStart: colStart
|
|
43882
|
+
} = table.getBodyVisibleColRange();
|
|
43883
|
+
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
43884
|
+
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
43885
|
+
for (let col = colStart; col <= colEnd; col++) {
|
|
43886
|
+
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43887
|
+
for (let i = rowStart; i <= rowEnd; i++) {
|
|
43888
|
+
const cellGroup = table.scenegraph.getCell(col, i),
|
|
43889
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43890
|
+
chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
|
|
43891
|
+
const timer = setTimeout(() => {
|
|
43892
|
+
var _a, _b;
|
|
43893
|
+
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43894
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43895
|
+
let isShowTooltip = !0;
|
|
43896
|
+
"object" == typeof chartDimensionLinkage && (deactivate ? (chartInstanceListColumnByColumnDirection[col][i].setHovered(), chartInstanceListColumnByColumnDirection[col][i].hideTooltip()) : (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table), isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table), chartInstanceListColumnByColumnDirection[col][i].setHovered(datum), isShowTooltip && chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
|
|
43897
|
+
activeType: "mark"
|
|
43898
|
+
})));
|
|
43899
|
+
}
|
|
43900
|
+
}, 0);
|
|
43901
|
+
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
43902
|
+
}
|
|
43903
|
+
}
|
|
43904
|
+
}
|
|
43905
|
+
function checkIsShowTooltipForEdgeRow(row, table) {
|
|
43906
|
+
var _a, _b;
|
|
43907
|
+
let isShowTooltip = !0;
|
|
43908
|
+
const {
|
|
43909
|
+
rowStart: rowStart
|
|
43910
|
+
} = table.getBodyVisibleRowRange();
|
|
43911
|
+
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
43912
|
+
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
43913
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43914
|
+
if (row === rowEnd && isShowTooltip) {
|
|
43915
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
|
|
43916
|
+
{
|
|
43917
|
+
rowEnd: rowEnd1
|
|
43918
|
+
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
43919
|
+
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
43920
|
+
const {
|
|
43921
|
+
rowEnd: rowEnd2
|
|
43922
|
+
} = table.getBodyVisibleRowRange(0, 5);
|
|
43923
|
+
isShowTooltip = rowEnd2 !== rowEnd;
|
|
43924
|
+
}
|
|
43925
|
+
} else if (row === rowStart && isShowTooltip) {
|
|
43926
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
|
|
43927
|
+
{
|
|
43928
|
+
rowStart: rowStart1
|
|
43929
|
+
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
43930
|
+
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
43931
|
+
const {
|
|
43932
|
+
rowStart: rowStart2
|
|
43933
|
+
} = table.getBodyVisibleRowRange(0, -5);
|
|
43934
|
+
isShowTooltip = rowStart2 !== rowStart;
|
|
43935
|
+
}
|
|
43936
|
+
}
|
|
43937
|
+
return isShowTooltip;
|
|
43938
|
+
}
|
|
43939
|
+
function checkIsShowTooltipForEdgeColumn(col, table) {
|
|
43940
|
+
let isShowTooltip = !0;
|
|
43941
|
+
const {
|
|
43942
|
+
colStart: colStart
|
|
43943
|
+
} = table.getBodyVisibleColRange();
|
|
43944
|
+
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
43945
|
+
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
43946
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43947
|
+
if (col === colEnd && isShowTooltip) {
|
|
43948
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43949
|
+
{
|
|
43950
|
+
colEnd: colEnd1
|
|
43951
|
+
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
43952
|
+
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
43953
|
+
const {
|
|
43954
|
+
colEnd: colEnd2
|
|
43955
|
+
} = table.getBodyVisibleColRange(0, 5);
|
|
43956
|
+
isShowTooltip = colEnd2 !== colEnd;
|
|
43957
|
+
}
|
|
43958
|
+
} else if (col === colStart && isShowTooltip) {
|
|
43959
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43960
|
+
{
|
|
43961
|
+
colStart: colStart1
|
|
43962
|
+
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
43963
|
+
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
43964
|
+
const {
|
|
43965
|
+
colStart: colStart2
|
|
43966
|
+
} = table.getBodyVisibleColRange(0, -5);
|
|
43967
|
+
isShowTooltip = colStart2 !== colStart;
|
|
43968
|
+
}
|
|
43969
|
+
}
|
|
43970
|
+
return isShowTooltip;
|
|
43971
|
+
}
|
|
43972
|
+
function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
|
|
43973
|
+
var _a;
|
|
43974
|
+
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
43975
|
+
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
43976
|
+
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
43977
|
+
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
43978
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43979
|
+
isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
43980
|
+
forceRelease: forceRelease,
|
|
43981
|
+
releaseChartInstance: !0,
|
|
43982
|
+
releaseColumnChartInstance: !1,
|
|
43983
|
+
releaseRowChartInstance: !1
|
|
43984
|
+
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
43985
|
+
}
|
|
43986
|
+
delete chartInstanceListColumnByColumnDirection[col];
|
|
43982
43987
|
}
|
|
43983
43988
|
}
|
|
43984
|
-
function clearChartInstanceListByRowDirection(row, excludedCol, table) {
|
|
43989
|
+
function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
|
|
43985
43990
|
var _a;
|
|
43986
43991
|
if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
|
|
43987
43992
|
if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
|
|
43988
43993
|
const cellGroup = table.scenegraph.getCell(Number(i), row),
|
|
43989
43994
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43990
|
-
|
|
43995
|
+
isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
43996
|
+
forceRelease: forceRelease,
|
|
43991
43997
|
releaseChartInstance: !0,
|
|
43992
43998
|
releaseColumnChartInstance: !1,
|
|
43993
43999
|
releaseRowChartInstance: !1
|
|
@@ -43995,6 +44001,19 @@
|
|
|
43995
44001
|
}
|
|
43996
44002
|
delete chartInstanceListRowByRowDirection[row];
|
|
43997
44003
|
}
|
|
44004
|
+
function clearDelayRunDimensionHoverTimers() {
|
|
44005
|
+
for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
|
|
44006
|
+
delayRunDimensionHoverTimer.length = 0;
|
|
44007
|
+
}
|
|
44008
|
+
function clearAllChartInstanceList(table, forceRelease = !1) {
|
|
44009
|
+
clearDelayRunDimensionHoverTimers();
|
|
44010
|
+
for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
|
|
44011
|
+
for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
|
|
44012
|
+
}
|
|
44013
|
+
let disabledShowTooltipToAllChartInstances = !1;
|
|
44014
|
+
function isDisabledShowTooltipToAllChartInstances() {
|
|
44015
|
+
return disabledShowTooltipToAllChartInstances;
|
|
44016
|
+
}
|
|
43998
44017
|
|
|
43999
44018
|
function isValidAlignDomain(domain) {
|
|
44000
44019
|
return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
|
|
@@ -44628,7 +44647,7 @@
|
|
|
44628
44647
|
const CHART_NUMBER_TYPE = genNumberType();
|
|
44629
44648
|
class Chart extends Rect$1 {
|
|
44630
44649
|
constructor(isShareChartSpec, params) {
|
|
44631
|
-
if (super(params), this.type = "chart", this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
|
|
44650
|
+
if (super(params), this.type = "chart", this.activeChartInstanceLastViewBox = null, this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
|
|
44632
44651
|
const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
|
|
44633
44652
|
renderCanvas: params.canvas,
|
|
44634
44653
|
mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
|
|
@@ -44649,7 +44668,7 @@
|
|
|
44649
44668
|
}
|
|
44650
44669
|
}
|
|
44651
44670
|
activate(table) {
|
|
44652
|
-
var _a, _b, _c, _d, _e;
|
|
44671
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
44653
44672
|
if (this.activeChartInstance) return;
|
|
44654
44673
|
const {
|
|
44655
44674
|
col: col,
|
|
@@ -44668,7 +44687,7 @@
|
|
|
44668
44687
|
y1: y1 - table.scrollTop,
|
|
44669
44688
|
y2: y2 - table.scrollTop
|
|
44670
44689
|
});
|
|
44671
|
-
|
|
44690
|
+
this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
|
|
44672
44691
|
renderCanvas: this.attribute.canvas,
|
|
44673
44692
|
mode: "desktop-browser",
|
|
44674
44693
|
canvasControled: !1,
|
|
@@ -44702,7 +44721,7 @@
|
|
|
44702
44721
|
layer.main && drawParams.clear && hoverColor && (context.beginPath(), context.fillStyle = hoverColor, context.rect(viewBox.x1, viewBox.y1, viewBox.x2 - viewBox.x1, viewBox.y2 - viewBox.y1), context.fill());
|
|
44703
44722
|
}
|
|
44704
44723
|
},
|
|
44705
|
-
componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
|
|
44724
|
+
componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
|
|
44706
44725
|
tooltip: {
|
|
44707
44726
|
dimension: !1,
|
|
44708
44727
|
mark: !0
|
|
@@ -44713,16 +44732,43 @@
|
|
|
44713
44732
|
const chartStage = this.activeChartInstance.getStage(),
|
|
44714
44733
|
matrix = this.globalTransMatrix.clone(),
|
|
44715
44734
|
stageMatrix = this.stage.window.getViewBoxTransform();
|
|
44735
|
+
let brushChangeThrottle;
|
|
44716
44736
|
matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), this.activeChartInstance.renderSync(), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, this.activeChartInstance), this.activeChartInstance.on("click", params => {
|
|
44717
44737
|
var _a;
|
|
44718
|
-
!1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum);
|
|
44738
|
+
!1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null, void 0) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum, "click");
|
|
44739
|
+
}), (null === (_d = table.options.chartDimensionLinkage) || void 0 === _d ? void 0 : _d.listenBrushChange) && (brushChangeThrottle = cancellableThrottle(table.scenegraph.updateChartState.bind(table.scenegraph), null !== (_f = null === (_e = table.options.chartDimensionLinkage) || void 0 === _e ? void 0 : _e.brushChangeDelay) && void 0 !== _f ? _f : 100), this.activeChartInstance.on("brushChange", params => {
|
|
44740
|
+
var _a;
|
|
44741
|
+
brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
|
|
44742
|
+
})), this.activeChartInstance.on("brushStart", params => {
|
|
44743
|
+
const brushingChartInstance = getBrushingChartInstance();
|
|
44744
|
+
brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
|
|
44719
44745
|
}), this.activeChartInstance.on("brushEnd", params => {
|
|
44720
44746
|
var _a;
|
|
44721
|
-
table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
|
|
44747
|
+
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(() => {
|
|
44722
44748
|
Chart.temp = 1;
|
|
44723
44749
|
}, 0);
|
|
44724
|
-
}), table.options.chartDimensionLinkage && this.activeChartInstance.on("
|
|
44750
|
+
}), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
|
|
44751
|
+
markName: "pie"
|
|
44752
|
+
}, params => {
|
|
44753
|
+
var _a;
|
|
44754
|
+
const categoryField = this.attribute.spec.categoryField,
|
|
44755
|
+
datum = {
|
|
44756
|
+
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
44757
|
+
};
|
|
44758
|
+
generateChartInstanceListByViewRange(datum, table, !1);
|
|
44759
|
+
}), this.activeChartInstance.on("pointerout", {
|
|
44760
|
+
markName: "pie"
|
|
44761
|
+
}, params => {
|
|
44762
|
+
var _a;
|
|
44763
|
+
const categoryField = this.attribute.spec.categoryField,
|
|
44764
|
+
datum = {
|
|
44765
|
+
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
44766
|
+
};
|
|
44767
|
+
generateChartInstanceListByViewRange(datum, table, !0);
|
|
44768
|
+
})), this.activeChartInstance.on("dimensionHover", params => {
|
|
44725
44769
|
var _a, _b;
|
|
44770
|
+
if (isDisabledShowTooltipToAllChartInstances()) return;
|
|
44771
|
+
this.activeChartInstance.disableTooltip(!1);
|
|
44726
44772
|
const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
|
|
44727
44773
|
canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
|
|
44728
44774
|
viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
|
|
@@ -44739,11 +44785,11 @@
|
|
|
44739
44785
|
prev_justShowMarkTooltip = this.justShowMarkTooltip;
|
|
44740
44786
|
params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
|
|
44741
44787
|
let delayRunDimensionHover = !1;
|
|
44742
|
-
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,
|
|
44788
|
+
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) {
|
|
44743
44789
|
const dimensionValue = dimensionInfo.value,
|
|
44744
44790
|
indicatorsAsCol = table.options.indicatorsAsCol;
|
|
44745
|
-
if (delayRunDimensionHover ? (
|
|
44746
|
-
indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
|
|
44791
|
+
if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
|
|
44792
|
+
isDisabledShowTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
|
|
44747
44793
|
}, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
|
|
44748
44794
|
const series = dimensionInfo.data[0].series,
|
|
44749
44795
|
width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
|
|
@@ -44784,21 +44830,26 @@
|
|
|
44784
44830
|
}
|
|
44785
44831
|
}
|
|
44786
44832
|
}
|
|
44787
|
-
}), null === (
|
|
44833
|
+
})), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledShowTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
|
|
44834
|
+
}
|
|
44835
|
+
clearDelayRunDimensionHoverTimer() {
|
|
44836
|
+
clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
|
|
44788
44837
|
}
|
|
44789
44838
|
deactivate(table, {
|
|
44839
|
+
forceRelease = !1,
|
|
44790
44840
|
releaseChartInstance = !0,
|
|
44791
44841
|
releaseColumnChartInstance = !0,
|
|
44792
|
-
releaseRowChartInstance = !0
|
|
44842
|
+
releaseRowChartInstance = !0,
|
|
44843
|
+
releaseAllChartInstance = !1
|
|
44793
44844
|
} = {}) {
|
|
44794
44845
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
44795
|
-
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(),
|
|
44796
|
-
null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
44846
|
+
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
|
|
44847
|
+
!forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
44797
44848
|
x1: -1e3,
|
|
44798
44849
|
x2: -800,
|
|
44799
44850
|
y1: -1e3,
|
|
44800
44851
|
y2: -800
|
|
44801
|
-
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
|
|
44852
|
+
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
|
|
44802
44853
|
const {
|
|
44803
44854
|
col: col,
|
|
44804
44855
|
row: row
|
|
@@ -44811,7 +44862,7 @@
|
|
|
44811
44862
|
} = this.parent;
|
|
44812
44863
|
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));
|
|
44813
44864
|
}
|
|
44814
|
-
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);
|
|
44865
|
+
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));
|
|
44815
44866
|
}
|
|
44816
44867
|
updateData(data) {
|
|
44817
44868
|
this.attribute.data = data;
|
|
@@ -44826,13 +44877,14 @@
|
|
|
44826
44877
|
y1: y1,
|
|
44827
44878
|
x2: x2,
|
|
44828
44879
|
y2: y2
|
|
44829
|
-
} = cellGroup.globalAABBBounds
|
|
44830
|
-
|
|
44831
|
-
|
|
44832
|
-
|
|
44833
|
-
|
|
44834
|
-
|
|
44835
|
-
|
|
44880
|
+
} = cellGroup.globalAABBBounds,
|
|
44881
|
+
viewBox = {
|
|
44882
|
+
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)),
|
|
44883
|
+
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)),
|
|
44884
|
+
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)),
|
|
44885
|
+
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))
|
|
44886
|
+
};
|
|
44887
|
+
return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
|
|
44836
44888
|
}
|
|
44837
44889
|
}
|
|
44838
44890
|
function getTableBounds(col, row, table) {
|
|
@@ -45047,7 +45099,7 @@
|
|
|
45047
45099
|
{
|
|
45048
45100
|
width = groupAttribute.width,
|
|
45049
45101
|
height = groupAttribute.height
|
|
45050
|
-
} =
|
|
45102
|
+
} = chart.attribute,
|
|
45051
45103
|
{
|
|
45052
45104
|
table: table
|
|
45053
45105
|
} = chart.getRootNode(),
|
|
@@ -45075,8 +45127,9 @@
|
|
|
45075
45127
|
});
|
|
45076
45128
|
}
|
|
45077
45129
|
}
|
|
45078
|
-
const
|
|
45079
|
-
|
|
45130
|
+
const lastViewBox = chart.activeChartInstanceLastViewBox,
|
|
45131
|
+
viewBox = chart.getViewBox();
|
|
45132
|
+
lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
|
|
45080
45133
|
x1: 0,
|
|
45081
45134
|
x2: viewBox.x2 - viewBox.x1,
|
|
45082
45135
|
y1: 0,
|
|
@@ -48594,9 +48647,10 @@
|
|
|
48594
48647
|
});
|
|
48595
48648
|
}
|
|
48596
48649
|
}
|
|
48597
|
-
function updateChartState(scenegraph, datum) {
|
|
48650
|
+
function updateChartState(scenegraph, datum, selectedDataMode) {
|
|
48598
48651
|
const table = scenegraph.table;
|
|
48599
48652
|
if (table.isPivotChart()) {
|
|
48653
|
+
table._selectedDataMode = selectedDataMode;
|
|
48600
48654
|
const preSelectItemsCount = table._selectedDataItemsInChart.length;
|
|
48601
48655
|
if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
|
|
48602
48656
|
const newSelectedDataItemsInChart = [];
|
|
@@ -49344,16 +49398,39 @@
|
|
|
49344
49398
|
resetResidentHoverIcon(col, row) {
|
|
49345
49399
|
resetResidentHoverIcon(col, row, this);
|
|
49346
49400
|
}
|
|
49347
|
-
deactivateChart(col, row) {
|
|
49348
|
-
var _a, _b, _c;
|
|
49349
|
-
if (-1 === col || -1 === row)
|
|
49401
|
+
deactivateChart(col, row, forceRelease = !1) {
|
|
49402
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
49403
|
+
if (-1 === col || -1 === row) {
|
|
49404
|
+
if (forceRelease) {
|
|
49405
|
+
const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
|
|
49406
|
+
brushingChartInstance = getBrushingChartInstance();
|
|
49407
|
+
if (brushingChartInstanceCellPos && brushingChartInstance) {
|
|
49408
|
+
const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
|
|
49409
|
+
(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, {
|
|
49410
|
+
forceRelease: !0,
|
|
49411
|
+
releaseChartInstance: !0,
|
|
49412
|
+
releaseColumnChartInstance: !0,
|
|
49413
|
+
releaseRowChartInstance: !0,
|
|
49414
|
+
releaseAllChartInstance: !0
|
|
49415
|
+
}));
|
|
49416
|
+
}
|
|
49417
|
+
}
|
|
49418
|
+
return;
|
|
49419
|
+
}
|
|
49350
49420
|
const cellGroup = this.getCell(col, row);
|
|
49351
|
-
if (null === (
|
|
49421
|
+
if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
|
|
49422
|
+
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, {
|
|
49423
|
+
forceRelease: !0,
|
|
49424
|
+
releaseChartInstance: !0,
|
|
49425
|
+
releaseColumnChartInstance: !0,
|
|
49426
|
+
releaseRowChartInstance: !0,
|
|
49427
|
+
releaseAllChartInstance: !0
|
|
49428
|
+
}));
|
|
49352
49429
|
const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
|
|
49353
|
-
null === (
|
|
49354
|
-
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,
|
|
49355
|
-
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,
|
|
49356
|
-
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
|
|
49430
|
+
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) ? {
|
|
49431
|
+
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),
|
|
49432
|
+
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),
|
|
49433
|
+
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)
|
|
49357
49434
|
} : void 0);
|
|
49358
49435
|
}
|
|
49359
49436
|
}
|
|
@@ -49401,8 +49478,15 @@
|
|
|
49401
49478
|
updateChartSizeForResizeRowHeight(row) {
|
|
49402
49479
|
updateChartSizeForResizeRowHeight(this, row);
|
|
49403
49480
|
}
|
|
49404
|
-
updateChartState(datum) {
|
|
49405
|
-
|
|
49481
|
+
updateChartState(datum, selectedDataMode) {
|
|
49482
|
+
var _a, _b;
|
|
49483
|
+
if (this.table.isPivotChart()) {
|
|
49484
|
+
if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
|
|
49485
|
+
const brushingChartInstance = getBrushingChartInstance();
|
|
49486
|
+
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);
|
|
49487
|
+
}
|
|
49488
|
+
updateChartState(this, datum, selectedDataMode);
|
|
49489
|
+
}
|
|
49406
49490
|
}
|
|
49407
49491
|
updateCheckboxCellState(col, row, checked) {
|
|
49408
49492
|
var _a, _b;
|
|
@@ -52429,7 +52513,7 @@
|
|
|
52429
52513
|
}, 0 !== e.button) return;
|
|
52430
52514
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
52431
52515
|
if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
|
|
52432
|
-
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;
|
|
52516
|
+
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;
|
|
52433
52517
|
const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
|
|
52434
52518
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
52435
52519
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -52457,7 +52541,7 @@
|
|
|
52457
52541
|
}
|
|
52458
52542
|
eventManager.dealTableHover(eventArgsSet);
|
|
52459
52543
|
} else {
|
|
52460
|
-
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52544
|
+
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);
|
|
52461
52545
|
if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52462
52546
|
if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52463
52547
|
eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
|
|
@@ -52609,7 +52693,7 @@
|
|
|
52609
52693
|
if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
|
|
52610
52694
|
const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
|
|
52611
52695
|
if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
|
|
52612
|
-
table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
|
|
52696
|
+
table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
|
|
52613
52697
|
const {
|
|
52614
52698
|
eventArgs: eventArgs
|
|
52615
52699
|
} = eventArgsSet;
|
|
@@ -52628,7 +52712,7 @@
|
|
|
52628
52712
|
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 {
|
|
52629
52713
|
stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
|
|
52630
52714
|
const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
52631
|
-
(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);
|
|
52715
|
+
(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);
|
|
52632
52716
|
}
|
|
52633
52717
|
}), table.scenegraph.stage.addEventListener("pointermove", e => {
|
|
52634
52718
|
var _a, _b, _c;
|
|
@@ -52746,7 +52830,15 @@
|
|
|
52746
52830
|
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
|
|
52747
52831
|
}), table.scenegraph.stage.addEventListener("wheel", e => {
|
|
52748
52832
|
var _a;
|
|
52749
|
-
e.path.find(node => "legend" === node.name)
|
|
52833
|
+
if (!e.path.find(node => "legend" === node.name)) {
|
|
52834
|
+
null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
|
|
52835
|
+
const {
|
|
52836
|
+
cellPos: cellPos
|
|
52837
|
+
} = table.stateManager.hover,
|
|
52838
|
+
prevHoverCellCol = cellPos.col,
|
|
52839
|
+
prevHoverCellRow = cellPos.row;
|
|
52840
|
+
table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
|
|
52841
|
+
}
|
|
52750
52842
|
});
|
|
52751
52843
|
}
|
|
52752
52844
|
function bindGesture(eventManager) {
|
|
@@ -52861,11 +52953,13 @@
|
|
|
52861
52953
|
const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
|
|
52862
52954
|
throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
|
|
52863
52955
|
scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
|
|
52864
|
-
|
|
52956
|
+
var _a;
|
|
52957
|
+
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);
|
|
52865
52958
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
52866
52959
|
throttleVerticalWheel(ratio, e);
|
|
52867
52960
|
}), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
|
|
52868
|
-
|
|
52961
|
+
var _a;
|
|
52962
|
+
scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
|
|
52869
52963
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
52870
52964
|
throttleHorizontalWheel(ratio);
|
|
52871
52965
|
});
|
|
@@ -53015,7 +53109,7 @@
|
|
|
53015
53109
|
const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
|
|
53016
53110
|
eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
|
|
53017
53111
|
}
|
|
53018
|
-
});
|
|
53112
|
+
}), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
|
|
53019
53113
|
}
|
|
53020
53114
|
};
|
|
53021
53115
|
eventManager.globalEventListeners.push({
|
|
@@ -53526,7 +53620,7 @@
|
|
|
53526
53620
|
};
|
|
53527
53621
|
class EventManager {
|
|
53528
53622
|
constructor(table) {
|
|
53529
|
-
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.
|
|
53623
|
+
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
53530
53624
|
this.bindSelfEvent();
|
|
53531
53625
|
}, 0));
|
|
53532
53626
|
}
|
|
@@ -53828,25 +53922,15 @@
|
|
|
53828
53922
|
} catch (error) {}
|
|
53829
53923
|
}
|
|
53830
53924
|
handleCut(e) {
|
|
53831
|
-
var _a;
|
|
53832
53925
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53833
|
-
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.
|
|
53834
|
-
|
|
53835
|
-
col: r.start.col,
|
|
53836
|
-
row: r.start.row
|
|
53837
|
-
},
|
|
53838
|
-
end: {
|
|
53839
|
-
col: r.end.col,
|
|
53840
|
-
row: r.end.row
|
|
53841
|
-
}
|
|
53842
|
-
})), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
53843
|
-
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
|
|
53926
|
+
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
53927
|
+
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
|
|
53844
53928
|
}, 3e4), this.saveClipboardContent();
|
|
53845
53929
|
});
|
|
53846
53930
|
}
|
|
53847
53931
|
handlePaste(e) {
|
|
53848
53932
|
this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
|
|
53849
|
-
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.
|
|
53933
|
+
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53850
53934
|
}).catch(() => {
|
|
53851
53935
|
this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53852
53936
|
}) : this.executePaste(e);
|
|
@@ -53923,9 +54007,9 @@
|
|
|
53923
54007
|
}
|
|
53924
54008
|
clearCutArea(table) {
|
|
53925
54009
|
try {
|
|
53926
|
-
const
|
|
53927
|
-
if (!
|
|
53928
|
-
table.
|
|
54010
|
+
const selectCells = this.cutCellRange;
|
|
54011
|
+
if (!selectCells || 0 === selectCells.length) return;
|
|
54012
|
+
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);
|
|
53929
54013
|
} catch (error) {}
|
|
53930
54014
|
}
|
|
53931
54015
|
checkClipboardChanged() {
|
|
@@ -55863,15 +55947,6 @@
|
|
|
55863
55947
|
constructor(table, customCellStyle, customCellStyleArrangement) {
|
|
55864
55948
|
this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
|
|
55865
55949
|
}
|
|
55866
|
-
clearCustomCellStyleArrangement() {
|
|
55867
|
-
this.customCellStyleArrangement = [];
|
|
55868
|
-
}
|
|
55869
|
-
addCustomCellStyleArrangement(cellPosition, customStyleId) {
|
|
55870
|
-
this.customCellStyleArrangement.push({
|
|
55871
|
-
cellPosition: cellPosition,
|
|
55872
|
-
customStyleId: customStyleId
|
|
55873
|
-
});
|
|
55874
|
-
}
|
|
55875
55950
|
getCustomCellStyle(col, row) {
|
|
55876
55951
|
const customStyleIds = this.getCustomCellStyleIds(col, row);
|
|
55877
55952
|
if (customStyleIds.length) {
|
|
@@ -56177,7 +56252,7 @@
|
|
|
56177
56252
|
}
|
|
56178
56253
|
constructor(container, options = {}) {
|
|
56179
56254
|
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;
|
|
56180
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
56255
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.8", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
56181
56256
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
56182
56257
|
options: options,
|
|
56183
56258
|
container: container
|
|
@@ -59952,16 +60027,15 @@
|
|
|
59952
60027
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59953
60028
|
});
|
|
59954
60029
|
};
|
|
59955
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table
|
|
60030
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
59956
60031
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
59957
|
-
const
|
|
59958
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60032
|
+
const recordIndex = table.getRecordShowIndexByCell(col, row),
|
|
59959
60033
|
{
|
|
59960
60034
|
field: field
|
|
59961
60035
|
} = table.internalProps.layoutMap.getBody(col, row),
|
|
59962
60036
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
59963
60037
|
oldValue = table.getCellOriginValue(col, row);
|
|
59964
|
-
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value,
|
|
60038
|
+
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
|
|
59965
60039
|
const range = table.getCellRange(col, row),
|
|
59966
60040
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
59967
60041
|
if (aggregators) {
|
|
@@ -59984,24 +60058,16 @@
|
|
|
59984
60058
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
59985
60059
|
}
|
|
59986
60060
|
const changedValue = table.getCellOriginValue(col, row);
|
|
59987
|
-
|
|
59988
|
-
|
|
59989
|
-
|
|
59990
|
-
|
|
59991
|
-
|
|
59992
|
-
|
|
59993
|
-
|
|
59994
|
-
currentValue: oldValue,
|
|
59995
|
-
changedValue: changedValue
|
|
59996
|
-
};
|
|
59997
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
59998
|
-
values: [changeValue]
|
|
59999
|
-
});
|
|
60000
|
-
}
|
|
60001
|
-
table.scenegraph.updateNextFrame();
|
|
60061
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
60062
|
+
col: col,
|
|
60063
|
+
row: row,
|
|
60064
|
+
rawValue: beforeChangeValue,
|
|
60065
|
+
currentValue: oldValue,
|
|
60066
|
+
changedValue: changedValue
|
|
60067
|
+
}), table.scenegraph.updateNextFrame();
|
|
60002
60068
|
}
|
|
60003
60069
|
}
|
|
60004
|
-
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table
|
|
60070
|
+
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
60005
60071
|
var _a, _b;
|
|
60006
60072
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60007
60073
|
const changedCellResults = [];
|
|
@@ -60023,7 +60089,6 @@
|
|
|
60023
60089
|
oldRowValues.push(oldValue);
|
|
60024
60090
|
}
|
|
60025
60091
|
}
|
|
60026
|
-
const resultChangeValues = [];
|
|
60027
60092
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
60028
60093
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
60029
60094
|
const rowValues = values[i];
|
|
@@ -60047,34 +60112,25 @@
|
|
|
60047
60112
|
if (isCanChange) {
|
|
60048
60113
|
changedCellResults[i][j] = !0;
|
|
60049
60114
|
const value = rowValues[j],
|
|
60050
|
-
|
|
60051
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60115
|
+
recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
60052
60116
|
{
|
|
60053
60117
|
field: field
|
|
60054
60118
|
} = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
|
|
60055
60119
|
beforeChangeValue = beforeChangeValues[i][j],
|
|
60056
60120
|
oldValue = oldValues[i][j];
|
|
60057
|
-
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value,
|
|
60121
|
+
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);
|
|
60058
60122
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
60059
|
-
|
|
60060
|
-
|
|
60061
|
-
|
|
60062
|
-
|
|
60063
|
-
|
|
60064
|
-
|
|
60065
|
-
|
|
60066
|
-
currentValue: oldValue,
|
|
60067
|
-
changedValue: changedValue
|
|
60068
|
-
};
|
|
60069
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
60070
|
-
}
|
|
60123
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
60124
|
+
col: startCol + j,
|
|
60125
|
+
row: startRow + i,
|
|
60126
|
+
rawValue: beforeChangeValue,
|
|
60127
|
+
currentValue: oldValue,
|
|
60128
|
+
changedValue: changedValue
|
|
60129
|
+
});
|
|
60071
60130
|
} else changedCellResults[i][j] = !1;
|
|
60072
60131
|
}
|
|
60073
60132
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
60074
60133
|
}
|
|
60075
|
-
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
60076
|
-
values: resultChangeValues
|
|
60077
|
-
});
|
|
60078
60134
|
const startRange = table.getCellRange(startCol, startRow),
|
|
60079
60135
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
60080
60136
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -60108,58 +60164,6 @@
|
|
|
60108
60164
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
60109
60165
|
});
|
|
60110
60166
|
}
|
|
60111
|
-
function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
60112
|
-
var _a, _b;
|
|
60113
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
60114
|
-
const resultChangeValues = [],
|
|
60115
|
-
processed = new Set(),
|
|
60116
|
-
nextValue = null != value ? value : "";
|
|
60117
|
-
for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
|
|
60118
|
-
const range = ranges[i],
|
|
60119
|
-
startCol = Math.min(range.start.col, range.end.col),
|
|
60120
|
-
endCol = Math.max(range.start.col, range.end.col),
|
|
60121
|
-
startRow = Math.min(range.start.row, range.end.row),
|
|
60122
|
-
endRow = Math.max(range.start.row, range.end.row);
|
|
60123
|
-
if (startCol > endCol || startRow > endRow) continue;
|
|
60124
|
-
const values = [],
|
|
60125
|
-
oldValues = [];
|
|
60126
|
-
for (let row = startRow; row <= endRow; row++) {
|
|
60127
|
-
const rowValues = [],
|
|
60128
|
-
rowOldValues = [];
|
|
60129
|
-
for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
|
|
60130
|
-
values.push(rowValues), oldValues.push(rowOldValues);
|
|
60131
|
-
}
|
|
60132
|
-
const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
|
|
60133
|
-
for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
|
|
60134
|
-
const col = startCol + c,
|
|
60135
|
-
row = startRow + r,
|
|
60136
|
-
key = `${col},${row}`;
|
|
60137
|
-
if (processed.has(key)) continue;
|
|
60138
|
-
if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
|
|
60139
|
-
const oldValue = oldValues[r][c],
|
|
60140
|
-
changedValue = table.getCellOriginValue(col, row);
|
|
60141
|
-
if (oldValue === changedValue) continue;
|
|
60142
|
-
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
60143
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60144
|
-
{
|
|
60145
|
-
field: field
|
|
60146
|
-
} = table.internalProps.layoutMap.getBody(col, row);
|
|
60147
|
-
resultChangeValues.push({
|
|
60148
|
-
col: col,
|
|
60149
|
-
row: row,
|
|
60150
|
-
recordIndex: recordIndex,
|
|
60151
|
-
field: field,
|
|
60152
|
-
rawValue: oldValue,
|
|
60153
|
-
currentValue: oldValue,
|
|
60154
|
-
changedValue: changedValue
|
|
60155
|
-
});
|
|
60156
|
-
}
|
|
60157
|
-
}
|
|
60158
|
-
!silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
60159
|
-
values: resultChangeValues
|
|
60160
|
-
});
|
|
60161
|
-
});
|
|
60162
|
-
}
|
|
60163
60167
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
60164
60168
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
60165
60169
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -60177,16 +60181,13 @@
|
|
|
60177
60181
|
}), table.dataSource.sort(sortState));
|
|
60178
60182
|
}
|
|
60179
60183
|
function listTableAddRecord(record, recordIndex, table) {
|
|
60180
|
-
var _a, _b, _c, _d
|
|
60184
|
+
var _a, _b, _c, _d;
|
|
60181
60185
|
try {
|
|
60182
60186
|
if (!record) return !1;
|
|
60183
|
-
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) {
|
|
60184
|
-
!!(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();
|
|
60185
|
-
} else {
|
|
60187
|
+
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 {
|
|
60186
60188
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
60187
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
60188
|
-
|
|
60189
|
-
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;
|
|
60189
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
60190
|
+
table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
|
|
60190
60191
|
const oldRowCount = table.rowCount;
|
|
60191
60192
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60192
60193
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -60255,16 +60256,13 @@
|
|
|
60255
60256
|
}
|
|
60256
60257
|
}
|
|
60257
60258
|
function listTableAddRecords(records, recordIndex, table) {
|
|
60258
|
-
var _a, _b, _c, _d
|
|
60259
|
+
var _a, _b, _c, _d;
|
|
60259
60260
|
try {
|
|
60260
60261
|
if (!records || 0 === records.length) return !1;
|
|
60261
|
-
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) {
|
|
60262
|
-
!!(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();
|
|
60263
|
-
} else {
|
|
60262
|
+
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 {
|
|
60264
60263
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
60265
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
60266
|
-
|
|
60267
|
-
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;
|
|
60264
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
60265
|
+
table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
|
|
60268
60266
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
60269
60267
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60270
60268
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -60333,20 +60331,16 @@
|
|
|
60333
60331
|
}
|
|
60334
60332
|
}
|
|
60335
60333
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
60336
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
60334
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
60337
60335
|
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) {
|
|
60338
60336
|
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
60339
60337
|
if (0 === deletedRecordIndexs.length) return;
|
|
60340
60338
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
60341
60339
|
table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
60342
|
-
} else if (table.sortState) {
|
|
60343
|
-
|
|
60344
|
-
} else {
|
|
60345
|
-
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
60346
|
-
deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
60340
|
+
} else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
60341
|
+
const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
|
|
60347
60342
|
if (0 === deletedRecordIndexs.length) return;
|
|
60348
60343
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
60349
|
-
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
60350
60344
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
60351
60345
|
table.refreshRowColCount();
|
|
60352
60346
|
const newRowCount = table.transpose ? table.colCount : table.rowCount,
|
|
@@ -60384,7 +60378,7 @@
|
|
|
60384
60378
|
col: 0,
|
|
60385
60379
|
row: row
|
|
60386
60380
|
});
|
|
60387
|
-
null === (
|
|
60381
|
+
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();
|
|
60388
60382
|
}
|
|
60389
60383
|
} else {
|
|
60390
60384
|
const delRows = [],
|
|
@@ -60416,19 +60410,15 @@
|
|
|
60416
60410
|
col: 0,
|
|
60417
60411
|
row: row
|
|
60418
60412
|
});
|
|
60419
|
-
null === (
|
|
60413
|
+
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();
|
|
60420
60414
|
}
|
|
60421
60415
|
}
|
|
60422
60416
|
}
|
|
60423
60417
|
function listTableUpdateRecords(records, recordIndexs, table) {
|
|
60424
|
-
var _a, _b, _c, _d
|
|
60425
|
-
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) {
|
|
60426
|
-
|
|
60427
|
-
} else {
|
|
60428
|
-
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
60429
|
-
updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
60418
|
+
var _a, _b, _c, _d;
|
|
60419
|
+
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 {
|
|
60420
|
+
const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
|
|
60430
60421
|
if (0 === updateRecordIndexs.length) return;
|
|
60431
|
-
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
60432
60422
|
const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
|
|
60433
60423
|
if (table.pagination) {
|
|
60434
60424
|
const {
|
|
@@ -61337,165 +61327,43 @@
|
|
|
61337
61327
|
}
|
|
61338
61328
|
return isValid$1(editorDefine);
|
|
61339
61329
|
}
|
|
61340
|
-
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0
|
|
61341
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this
|
|
61342
|
-
}
|
|
61343
|
-
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61344
|
-
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61345
|
-
}
|
|
61346
|
-
changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61347
|
-
return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61348
|
-
}
|
|
61349
|
-
changeSourceCellValue(recordIndex, field, value) {
|
|
61350
|
-
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
61351
|
-
cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
61352
|
-
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
|
|
61353
|
-
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
61354
|
-
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
|
|
61355
|
-
oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
|
|
61356
|
-
changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
61357
|
-
if (oldValue !== changedValue) {
|
|
61358
|
-
const changeValue = {
|
|
61359
|
-
col: cellAddr.col,
|
|
61360
|
-
row: cellAddr.row,
|
|
61361
|
-
recordIndex: recordIndex,
|
|
61362
|
-
field: field,
|
|
61363
|
-
rawValue: beforeChangeValue,
|
|
61364
|
-
currentValue: oldValue,
|
|
61365
|
-
changedValue: changedValue
|
|
61366
|
-
};
|
|
61367
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61368
|
-
values: [changeValue]
|
|
61369
|
-
});
|
|
61370
|
-
}
|
|
61330
|
+
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
|
|
61331
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
61371
61332
|
}
|
|
61372
|
-
|
|
61373
|
-
|
|
61374
|
-
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
61375
|
-
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
61376
|
-
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
61377
|
-
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
61378
|
-
let record, oldValue;
|
|
61379
|
-
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;
|
|
61380
|
-
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
61381
|
-
if (oldValue !== changedValue) {
|
|
61382
|
-
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
|
|
61383
|
-
changeValue = {
|
|
61384
|
-
col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
|
|
61385
|
-
row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
|
|
61386
|
-
recordIndex: recordIndex,
|
|
61387
|
-
field: field,
|
|
61388
|
-
rawValue: oldValue,
|
|
61389
|
-
currentValue: oldValue,
|
|
61390
|
-
changedValue: changedValue
|
|
61391
|
-
};
|
|
61392
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61393
|
-
values: [changeValue]
|
|
61394
|
-
});
|
|
61395
|
-
}
|
|
61396
|
-
autoRefresh && this.refreshAfterSourceChange();
|
|
61397
|
-
}
|
|
61398
|
-
changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61399
|
-
return this.changeCellValueByRecord(recordIndex, field, value, {
|
|
61400
|
-
triggerEvent: triggerEvent,
|
|
61401
|
-
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
61402
|
-
autoRefresh: !0
|
|
61403
|
-
});
|
|
61404
|
-
}
|
|
61405
|
-
changeCellValuesByRecords(changeValues, options) {
|
|
61406
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
61407
|
-
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
61408
|
-
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
61409
|
-
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
61410
|
-
resultChangeValues = [];
|
|
61411
|
-
for (let i = 0; i < changeValues.length; i++) {
|
|
61412
|
-
const {
|
|
61413
|
-
recordIndex: recordIndex,
|
|
61414
|
-
field: field,
|
|
61415
|
-
value: value
|
|
61416
|
-
} = changeValues[i],
|
|
61417
|
-
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
61418
|
-
let record, oldValue;
|
|
61419
|
-
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) {
|
|
61420
|
-
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
61421
|
-
if (oldValue !== changedValue) {
|
|
61422
|
-
const changeValue = {
|
|
61423
|
-
col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
|
|
61424
|
-
row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
|
|
61425
|
-
recordIndex: recordIndex,
|
|
61426
|
-
field: field,
|
|
61427
|
-
rawValue: oldValue,
|
|
61428
|
-
currentValue: oldValue,
|
|
61429
|
-
changedValue: changedValue
|
|
61430
|
-
};
|
|
61431
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
61432
|
-
}
|
|
61433
|
-
}
|
|
61434
|
-
}
|
|
61435
|
-
!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61436
|
-
values: resultChangeValues
|
|
61437
|
-
}), autoRefresh && this.refreshAfterSourceChange();
|
|
61438
|
-
}
|
|
61439
|
-
changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61440
|
-
return this.changeCellValuesByRecords(changeValues, {
|
|
61441
|
-
triggerEvent: triggerEvent,
|
|
61442
|
-
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
61443
|
-
autoRefresh: !0
|
|
61444
|
-
});
|
|
61445
|
-
}
|
|
61446
|
-
refreshAfterSourceChange(options) {
|
|
61447
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
61448
|
-
const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
|
|
61449
|
-
reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
|
|
61450
|
-
clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
|
|
61451
|
-
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);
|
|
61452
|
-
const traverseColumns = columns => {
|
|
61453
|
-
var _a, _b, _c, _d;
|
|
61454
|
-
for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
|
|
61455
|
-
const column = columns[i],
|
|
61456
|
-
aggregators = null == column ? void 0 : column.vtable_aggregator;
|
|
61457
|
-
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);
|
|
61458
|
-
(null == column ? void 0 : column.columns) && traverseColumns(column.columns);
|
|
61459
|
-
}
|
|
61460
|
-
};
|
|
61461
|
-
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();
|
|
61333
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
|
|
61334
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
|
|
61462
61335
|
}
|
|
61463
|
-
addRecord(record, recordIndex
|
|
61336
|
+
addRecord(record, recordIndex) {
|
|
61464
61337
|
var _a;
|
|
61465
61338
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
61466
|
-
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(),
|
|
61339
|
+
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61467
61340
|
records: [record],
|
|
61468
61341
|
recordIndex: recordIndex,
|
|
61469
61342
|
recordCount: 1
|
|
61470
61343
|
});
|
|
61471
61344
|
}
|
|
61472
|
-
addRecords(records, recordIndex
|
|
61345
|
+
addRecords(records, recordIndex) {
|
|
61473
61346
|
var _a;
|
|
61474
61347
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
61475
|
-
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(),
|
|
61348
|
+
"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, {
|
|
61476
61349
|
records: records,
|
|
61477
61350
|
recordIndex: recordIndex,
|
|
61478
61351
|
recordCount: records.length
|
|
61479
61352
|
});
|
|
61480
61353
|
}
|
|
61481
|
-
deleteRecords(recordIndexs
|
|
61354
|
+
deleteRecords(recordIndexs) {
|
|
61482
61355
|
var _a;
|
|
61483
|
-
|
|
61484
|
-
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
61485
|
-
let record = null;
|
|
61486
|
-
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
61487
|
-
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
61356
|
+
listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
61488
61357
|
const rowIndexs = [];
|
|
61489
61358
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
61490
|
-
|
|
61359
|
+
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
61491
61360
|
recordIndexs: recordIndexs,
|
|
61492
|
-
records: deletedRecords,
|
|
61493
61361
|
rowIndexs: rowIndexs,
|
|
61494
61362
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
61495
61363
|
});
|
|
61496
61364
|
}
|
|
61497
|
-
updateRecords(records, recordIndexs
|
|
61498
|
-
listTableUpdateRecords(records, recordIndexs, this),
|
|
61365
|
+
updateRecords(records, recordIndexs) {
|
|
61366
|
+
listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
61499
61367
|
records: records,
|
|
61500
61368
|
recordIndexs: recordIndexs,
|
|
61501
61369
|
updateCount: records.length
|