@visactor/vtable-calendar 1.22.11-alpha.9 → 1.22.12-alpha.0
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 +577 -625
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
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,92 +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) {
|
|
37049
|
-
const firstVisibleRecord = this.records[0],
|
|
37050
|
-
rawIndex = rawRecords.indexOf(firstVisibleRecord);
|
|
37051
|
-
return rawIndex >= 0 ? rawIndex : 0;
|
|
37052
|
-
}
|
|
37053
|
-
if (viewIndex >= this.records.length) {
|
|
37054
|
-
const lastVisibleRecord = this.records[this.records.length - 1],
|
|
37055
|
-
rawIndex = rawRecords.indexOf(lastVisibleRecord);
|
|
37056
|
-
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
37057
|
-
}
|
|
37058
|
-
const prevRecord = this.records[viewIndex - 1],
|
|
37059
|
-
rawIndex = rawRecords.indexOf(prevRecord);
|
|
37060
|
-
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
37061
|
-
}
|
|
37062
|
-
_resetIndexingFromViewRecords() {
|
|
37063
|
-
if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
|
|
37064
|
-
length: this._sourceLength
|
|
37065
|
-
}, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
|
|
37066
|
-
this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37067
|
-
}
|
|
37068
|
-
addRecord(record, index, syncToOriginalRecords = !1) {
|
|
37069
|
-
var _a, _b, _c;
|
|
37070
|
-
if (!syncToOriginalRecords) {
|
|
37071
|
-
if (Array.isArray(this.records)) {
|
|
37072
|
-
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
37073
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
37074
|
-
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
37075
|
-
this.pagination.totalCount = this._sourceLength;
|
|
37076
|
-
const {
|
|
37077
|
-
perPageCount: perPageCount,
|
|
37078
|
-
currentPage: currentPage
|
|
37079
|
-
} = this.pagination;
|
|
37080
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
37081
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37082
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
37083
|
-
}
|
|
37084
|
-
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);
|
|
37085
37047
|
}
|
|
37086
|
-
const rawRecords = this._getRawRecordsArray();
|
|
37087
|
-
if (!rawRecords) return;
|
|
37088
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
37089
|
-
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
37090
|
-
rawRecords.splice(rawInsertIndex, 0, record), syncToOriginalRecords && this._hasFilterInEffect() && this.markForceVisibleRecord(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);
|
|
37091
37048
|
}
|
|
37092
|
-
addRecords(recordArr, index
|
|
37093
|
-
var _a
|
|
37094
|
-
if (
|
|
37095
|
-
if (Array.isArray(
|
|
37096
|
-
|
|
37097
|
-
|
|
37098
|
-
|
|
37099
|
-
|
|
37100
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
37101
|
-
}
|
|
37102
|
-
if (this.userPagination) {
|
|
37103
|
-
this.pagination.totalCount = this._sourceLength;
|
|
37104
|
-
const {
|
|
37105
|
-
perPageCount: perPageCount,
|
|
37106
|
-
currentPage: currentPage
|
|
37107
|
-
} = this.pagination;
|
|
37108
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
37109
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37110
|
-
(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]);
|
|
37111
37057
|
}
|
|
37112
|
-
|
|
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);
|
|
37113
37067
|
}
|
|
37114
|
-
const rawRecords = this._getRawRecordsArray();
|
|
37115
|
-
if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
|
|
37116
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
37117
|
-
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
37118
|
-
if (rawRecords.splice(rawInsertIndex, 0, ...recordArr), syncToOriginalRecords && this._hasFilterInEffect()) for (let i = 0; i < recordArr.length; i++) this.markForceVisibleRecord(recordArr[i]);
|
|
37119
|
-
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);
|
|
37120
37068
|
}
|
|
37121
37069
|
addRecordForSorted(record) {
|
|
37122
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));
|
|
@@ -37132,49 +37080,27 @@
|
|
|
37132
37080
|
}
|
|
37133
37081
|
}
|
|
37134
37082
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
|
|
37135
|
-
|
|
37136
|
-
|
|
37137
|
-
|
|
37138
|
-
const numKey = Number(key);
|
|
37139
|
-
Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
|
|
37140
|
-
}), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
|
|
37141
|
-
for (let i = 0; i < numericKeys.length; i++) {
|
|
37142
|
-
const key = numericKeys[i],
|
|
37143
|
-
record = this.beforeChangedRecordsMap.get(key.toString());
|
|
37144
|
-
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
37145
|
-
}
|
|
37146
|
-
}
|
|
37147
|
-
deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
|
|
37148
|
-
var _a, _b, _c;
|
|
37149
|
-
if (!syncToOriginalRecords) {
|
|
37150
|
-
if (Array.isArray(this.records)) {
|
|
37151
|
-
const realDeletedRecordIndexs = [],
|
|
37152
|
-
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
37153
|
-
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
37154
|
-
const recordIndex = recordIndexsMaxToMin[index];
|
|
37155
|
-
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
37156
|
-
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
37157
|
-
const deletedRecord = this.records[recordIndex];
|
|
37158
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
37159
|
-
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
37160
|
-
}
|
|
37161
|
-
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;
|
|
37162
|
-
}
|
|
37163
|
-
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);
|
|
37164
37086
|
}
|
|
37165
|
-
|
|
37166
|
-
|
|
37167
|
-
|
|
37168
|
-
|
|
37169
|
-
|
|
37170
|
-
|
|
37171
|
-
|
|
37172
|
-
|
|
37173
|
-
|
|
37174
|
-
|
|
37175
|
-
|
|
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;
|
|
37176
37102
|
}
|
|
37177
|
-
return
|
|
37103
|
+
return [];
|
|
37178
37104
|
}
|
|
37179
37105
|
deleteRecordsForSorted(recordIndexs) {
|
|
37180
37106
|
if (Array.isArray(this.records)) {
|
|
@@ -37188,34 +37114,18 @@
|
|
|
37188
37114
|
this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
|
|
37189
37115
|
}
|
|
37190
37116
|
}
|
|
37191
|
-
updateRecords(records, recordIndexs
|
|
37192
|
-
|
|
37193
|
-
if (!syncToOriginalRecords) {
|
|
37194
|
-
const realDeletedRecordIndexs = [];
|
|
37195
|
-
for (let index = 0; index < recordIndexs.length; index++) {
|
|
37196
|
-
const recordIndex = recordIndexs[index];
|
|
37197
|
-
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 {
|
|
37198
|
-
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
37199
|
-
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
37200
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
37201
|
-
this.records[recordIndex] = records[index];
|
|
37202
|
-
}
|
|
37203
|
-
}
|
|
37204
|
-
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
37205
|
-
}
|
|
37206
|
-
const rawRecords = this._getRawRecordsArray();
|
|
37207
|
-
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
37208
|
-
const realUpdatedIndexs = [];
|
|
37117
|
+
updateRecords(records, recordIndexs) {
|
|
37118
|
+
const realDeletedRecordIndexs = [];
|
|
37209
37119
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
37210
37120
|
const recordIndex = recordIndexs[index];
|
|
37211
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
37212
|
-
if (recordIndex >= this.
|
|
37213
|
-
|
|
37214
|
-
|
|
37215
|
-
|
|
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];
|
|
37216
37126
|
}
|
|
37217
37127
|
}
|
|
37218
|
-
return this.
|
|
37128
|
+
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
37219
37129
|
}
|
|
37220
37130
|
updateRecordsForSorted(records, recordIndexs) {
|
|
37221
37131
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -37283,30 +37193,23 @@
|
|
|
37283
37193
|
setSortedIndexMap(field, filedMap) {
|
|
37284
37194
|
this.sortedIndexMap.set(field, filedMap);
|
|
37285
37195
|
}
|
|
37286
|
-
markForceVisibleRecord(record) {
|
|
37287
|
-
!record || "object" != typeof record && "function" != typeof record || (this._forceVisibleRecords || (this._forceVisibleRecords = new WeakSet()), this._forceVisibleRecords.add(record));
|
|
37288
|
-
}
|
|
37289
|
-
clearForceVisibleRecords() {
|
|
37290
|
-
this._forceVisibleRecords = void 0;
|
|
37291
|
-
}
|
|
37292
37196
|
clearFilteredChildren(record) {
|
|
37293
37197
|
var _a, _b;
|
|
37294
37198
|
record.filteredChildren = void 0;
|
|
37295
37199
|
for (let i = 0; i < (null !== (_b = null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0); i++) this.clearFilteredChildren(record.children[i]);
|
|
37296
37200
|
}
|
|
37297
37201
|
filterRecord(record) {
|
|
37298
|
-
var _a, _b, _c
|
|
37299
|
-
if (null === (_a = this._forceVisibleRecords) || void 0 === _a ? void 0 : _a.has(record)) return !0;
|
|
37202
|
+
var _a, _b, _c;
|
|
37300
37203
|
let isReserved = !0;
|
|
37301
|
-
for (let i = 0; i < (null === (
|
|
37302
|
-
const filterRule = null === (
|
|
37204
|
+
for (let i = 0; i < (null === (_a = this.dataConfig.filterRules) || void 0 === _a ? void 0 : _a.length); i++) {
|
|
37205
|
+
const filterRule = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules[i];
|
|
37303
37206
|
if (filterRule.filterKey) {
|
|
37304
37207
|
const filterValue = record[filterRule.filterKey];
|
|
37305
37208
|
if (-1 === filterRule.filteredValues.indexOf(filterValue)) {
|
|
37306
37209
|
isReserved = !1;
|
|
37307
37210
|
break;
|
|
37308
37211
|
}
|
|
37309
|
-
} else if (!(null === (
|
|
37212
|
+
} else if (!(null === (_c = filterRule.filterFunc) || void 0 === _c ? void 0 : _c.call(filterRule, record))) {
|
|
37310
37213
|
isReserved = !1;
|
|
37311
37214
|
break;
|
|
37312
37215
|
}
|
|
@@ -43856,11 +43759,46 @@
|
|
|
43856
43759
|
return hoverMode;
|
|
43857
43760
|
}
|
|
43858
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 clearAndReleaseBrushingChartInstance(scenegraph) {
|
|
43774
|
+
var _a, _b, _c;
|
|
43775
|
+
enableTooltipToAllChartInstances();
|
|
43776
|
+
const cellGroup = scenegraph.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
|
|
43777
|
+
(null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, scenegraph.table, {
|
|
43778
|
+
forceRelease: !0,
|
|
43779
|
+
releaseChartInstance: !0,
|
|
43780
|
+
releaseColumnChartInstance: !1,
|
|
43781
|
+
releaseRowChartInstance: !1,
|
|
43782
|
+
releaseAllChartInstance: !1
|
|
43783
|
+
})), isValid$1(chartInstanceListColumnByColumnDirection[brushingChartInstanceCellPos.col]) && delete chartInstanceListColumnByColumnDirection[brushingChartInstanceCellPos.col][brushingChartInstanceCellPos.row], isValid$1(chartInstanceListRowByRowDirection[brushingChartInstanceCellPos.row]) && delete chartInstanceListRowByRowDirection[brushingChartInstanceCellPos.row][brushingChartInstanceCellPos.col], brushingChartInstance = void 0, brushingChartInstanceCellPos = {
|
|
43784
|
+
col: -1,
|
|
43785
|
+
row: -1
|
|
43786
|
+
};
|
|
43787
|
+
}
|
|
43788
|
+
function getBrushingChartInstance() {
|
|
43789
|
+
return brushingChartInstance;
|
|
43790
|
+
}
|
|
43791
|
+
function getBrushingChartInstanceCellPos() {
|
|
43792
|
+
return brushingChartInstanceCellPos;
|
|
43793
|
+
}
|
|
43859
43794
|
const chartInstanceListColumnByColumnDirection = {};
|
|
43860
43795
|
const chartInstanceListRowByRowDirection = {};
|
|
43796
|
+
const delayRunDimensionHoverTimerForColumnDirection = [],
|
|
43797
|
+
delayRunDimensionHoverTimerForRowDirection = [],
|
|
43798
|
+
delayRunDimensionHoverTimerForViewRange = [];
|
|
43861
43799
|
function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
43862
43800
|
var _a;
|
|
43863
|
-
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43801
|
+
clearDelayRunDimensionHoverTimerForColumnDirection(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43864
43802
|
const {
|
|
43865
43803
|
rowStart: rowStart
|
|
43866
43804
|
} = table.getBodyVisibleRowRange();
|
|
@@ -43869,76 +43807,40 @@
|
|
|
43869
43807
|
for (let i = rowStart; i <= rowEnd; i++) {
|
|
43870
43808
|
const cellGroup = table.scenegraph.getCell(col, i),
|
|
43871
43809
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43872
|
-
|
|
43873
|
-
|
|
43810
|
+
chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
|
|
43811
|
+
const timer = setTimeout(() => {
|
|
43812
|
+
var _a, _b, _c, _d;
|
|
43874
43813
|
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43875
43814
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43876
43815
|
let isShowTooltip = !isScatter;
|
|
43877
|
-
if (
|
|
43878
|
-
const
|
|
43879
|
-
|
|
43880
|
-
rowEnd: rowEnd1
|
|
43881
|
-
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
43882
|
-
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
43883
|
-
const {
|
|
43884
|
-
rowEnd: rowEnd2
|
|
43885
|
-
} = table.getBodyVisibleRowRange(0, 5);
|
|
43886
|
-
isShowTooltip = rowEnd2 !== rowEnd;
|
|
43887
|
-
}
|
|
43888
|
-
} else if (i === rowStart && isShowTooltip) {
|
|
43889
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
|
|
43890
|
-
{
|
|
43891
|
-
rowStart: rowStart1
|
|
43892
|
-
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
43893
|
-
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
43894
|
-
const {
|
|
43895
|
-
rowStart: rowStart2
|
|
43896
|
-
} = table.getBodyVisibleRowRange(0, -5);
|
|
43897
|
-
isShowTooltip = rowStart2 !== rowStart;
|
|
43898
|
-
}
|
|
43899
|
-
}
|
|
43900
|
-
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 {
|
|
43901
|
-
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
43816
|
+
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 {
|
|
43817
|
+
const cellBoundry = table.getCellRelativeRect(col, i),
|
|
43818
|
+
bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
43902
43819
|
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
43903
43820
|
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43904
43821
|
tooltip: !1,
|
|
43905
43822
|
showTooltipOption: {
|
|
43906
|
-
x: canvasXY.x,
|
|
43907
|
-
y: absolutePositionTop,
|
|
43823
|
+
x: canvasXY.x - cellBoundry.left,
|
|
43824
|
+
y: absolutePositionTop - cellBoundry.top,
|
|
43908
43825
|
activeType: "dimension"
|
|
43909
43826
|
}
|
|
43910
43827
|
})) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43911
43828
|
tooltip: isShowTooltip,
|
|
43912
43829
|
showTooltipOption: {
|
|
43913
|
-
x: canvasXY.x,
|
|
43914
|
-
y: absolutePositionTop,
|
|
43830
|
+
x: canvasXY.x - cellBoundry.left,
|
|
43831
|
+
y: absolutePositionTop - cellBoundry.top,
|
|
43915
43832
|
activeType: "dimension"
|
|
43916
43833
|
}
|
|
43917
43834
|
});
|
|
43918
43835
|
}
|
|
43919
43836
|
}
|
|
43920
|
-
}, 0)
|
|
43921
|
-
|
|
43922
|
-
}
|
|
43923
|
-
function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
|
|
43924
|
-
var _a;
|
|
43925
|
-
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
43926
|
-
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
43927
|
-
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
43928
|
-
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
43929
|
-
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43930
|
-
chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
|
|
43931
|
-
releaseChartInstance: !0,
|
|
43932
|
-
releaseColumnChartInstance: !1,
|
|
43933
|
-
releaseRowChartInstance: !1
|
|
43934
|
-
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
43935
|
-
}
|
|
43936
|
-
delete chartInstanceListColumnByColumnDirection[col];
|
|
43837
|
+
}, 0);
|
|
43838
|
+
delayRunDimensionHoverTimerForColumnDirection.push(timer), table.scenegraph.updateNextFrame();
|
|
43937
43839
|
}
|
|
43938
43840
|
}
|
|
43939
43841
|
function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
43940
43842
|
var _a;
|
|
43941
|
-
isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
43843
|
+
clearDelayRunDimensionHoverTimerForRowDirection(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
43942
43844
|
const {
|
|
43943
43845
|
colStart: colStart
|
|
43944
43846
|
} = table.getBodyVisibleColRange();
|
|
@@ -43947,64 +43849,162 @@
|
|
|
43947
43849
|
for (let i = colStart; i <= colEnd; i++) {
|
|
43948
43850
|
const cellGroup = table.scenegraph.getCell(i, row),
|
|
43949
43851
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43950
|
-
|
|
43852
|
+
chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
|
|
43853
|
+
const timer = setTimeout(() => {
|
|
43951
43854
|
var _a, _b, _c, _d;
|
|
43952
43855
|
if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43953
43856
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43954
43857
|
let isShowTooltip = !isScatter;
|
|
43955
|
-
if (
|
|
43956
|
-
const
|
|
43957
|
-
|
|
43958
|
-
colEnd: colEnd1
|
|
43959
|
-
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
43960
|
-
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
43961
|
-
const {
|
|
43962
|
-
colEnd: colEnd2
|
|
43963
|
-
} = table.getBodyVisibleColRange(0, 5);
|
|
43964
|
-
isShowTooltip = colEnd2 !== colEnd;
|
|
43965
|
-
}
|
|
43966
|
-
} else if (i === colStart && isShowTooltip) {
|
|
43967
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43968
|
-
{
|
|
43969
|
-
colStart: colStart1
|
|
43970
|
-
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
43971
|
-
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
43972
|
-
const {
|
|
43973
|
-
colStart: colStart2
|
|
43974
|
-
} = table.getBodyVisibleColRange(0, -5);
|
|
43975
|
-
isShowTooltip = colStart2 !== colStart;
|
|
43976
|
-
}
|
|
43977
|
-
}
|
|
43978
|
-
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 {
|
|
43979
|
-
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
43858
|
+
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 {
|
|
43859
|
+
const cellBoundry = table.getCellRelativeRect(i, row),
|
|
43860
|
+
bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
43980
43861
|
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
43981
43862
|
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43982
43863
|
tooltip: !1,
|
|
43983
43864
|
showTooltipOption: {
|
|
43984
|
-
x: absolutePositionLeft,
|
|
43985
|
-
y: canvasXY.y,
|
|
43865
|
+
x: absolutePositionLeft - cellBoundry.left,
|
|
43866
|
+
y: canvasXY.y - cellBoundry.top,
|
|
43986
43867
|
activeType: "dimension"
|
|
43987
43868
|
}
|
|
43988
43869
|
})) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43989
43870
|
tooltip: isShowTooltip,
|
|
43990
43871
|
showTooltipOption: {
|
|
43991
|
-
x: absolutePositionLeft,
|
|
43992
|
-
y: canvasXY.y,
|
|
43872
|
+
x: absolutePositionLeft - cellBoundry.left,
|
|
43873
|
+
y: canvasXY.y - cellBoundry.top,
|
|
43993
43874
|
activeType: "dimension"
|
|
43994
43875
|
}
|
|
43995
43876
|
});
|
|
43996
43877
|
}
|
|
43997
43878
|
}
|
|
43998
|
-
}, 0)
|
|
43879
|
+
}, 0);
|
|
43880
|
+
delayRunDimensionHoverTimerForRowDirection.push(timer), table.scenegraph.updateNextFrame();
|
|
43881
|
+
}
|
|
43882
|
+
}
|
|
43883
|
+
function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
|
|
43884
|
+
var _a;
|
|
43885
|
+
clearDelayRunDimensionHoverTimerForViewRange();
|
|
43886
|
+
const {
|
|
43887
|
+
rowStart: rowStart
|
|
43888
|
+
} = table.getBodyVisibleRowRange();
|
|
43889
|
+
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
43890
|
+
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
43891
|
+
const {
|
|
43892
|
+
colStart: colStart
|
|
43893
|
+
} = table.getBodyVisibleColRange();
|
|
43894
|
+
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
43895
|
+
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
43896
|
+
for (let col = colStart; col <= colEnd; col++) {
|
|
43897
|
+
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43898
|
+
for (let i = rowStart; i <= rowEnd; i++) {
|
|
43899
|
+
const cellGroup = table.scenegraph.getCell(col, i),
|
|
43900
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43901
|
+
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));
|
|
43902
|
+
const timer = setTimeout(() => {
|
|
43903
|
+
var _a, _b;
|
|
43904
|
+
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43905
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43906
|
+
let isShowTooltip = !0;
|
|
43907
|
+
"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, {
|
|
43908
|
+
activeType: "mark"
|
|
43909
|
+
})));
|
|
43910
|
+
}
|
|
43911
|
+
}, 0);
|
|
43912
|
+
delayRunDimensionHoverTimerForViewRange.push(timer), table.scenegraph.updateNextFrame();
|
|
43913
|
+
}
|
|
43914
|
+
}
|
|
43915
|
+
}
|
|
43916
|
+
function checkIsShowTooltipForEdgeRow(row, table) {
|
|
43917
|
+
var _a, _b;
|
|
43918
|
+
let isShowTooltip = !0;
|
|
43919
|
+
const {
|
|
43920
|
+
rowStart: rowStart
|
|
43921
|
+
} = table.getBodyVisibleRowRange();
|
|
43922
|
+
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
43923
|
+
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
43924
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43925
|
+
if (row === rowEnd && isShowTooltip) {
|
|
43926
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
|
|
43927
|
+
{
|
|
43928
|
+
rowEnd: rowEnd1
|
|
43929
|
+
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
43930
|
+
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
43931
|
+
const {
|
|
43932
|
+
rowEnd: rowEnd2
|
|
43933
|
+
} = table.getBodyVisibleRowRange(0, 5);
|
|
43934
|
+
isShowTooltip = rowEnd2 !== rowEnd;
|
|
43935
|
+
}
|
|
43936
|
+
} else if (row === rowStart && isShowTooltip) {
|
|
43937
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
|
|
43938
|
+
{
|
|
43939
|
+
rowStart: rowStart1
|
|
43940
|
+
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
43941
|
+
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
43942
|
+
const {
|
|
43943
|
+
rowStart: rowStart2
|
|
43944
|
+
} = table.getBodyVisibleRowRange(0, -5);
|
|
43945
|
+
isShowTooltip = rowStart2 !== rowStart;
|
|
43946
|
+
}
|
|
43947
|
+
}
|
|
43948
|
+
return isShowTooltip;
|
|
43949
|
+
}
|
|
43950
|
+
function checkIsShowTooltipForEdgeColumn(col, table) {
|
|
43951
|
+
let isShowTooltip = !0;
|
|
43952
|
+
const {
|
|
43953
|
+
colStart: colStart
|
|
43954
|
+
} = table.getBodyVisibleColRange();
|
|
43955
|
+
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
43956
|
+
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
43957
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43958
|
+
if (col === colEnd && isShowTooltip) {
|
|
43959
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43960
|
+
{
|
|
43961
|
+
colEnd: colEnd1
|
|
43962
|
+
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
43963
|
+
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
43964
|
+
const {
|
|
43965
|
+
colEnd: colEnd2
|
|
43966
|
+
} = table.getBodyVisibleColRange(0, 5);
|
|
43967
|
+
isShowTooltip = colEnd2 !== colEnd;
|
|
43968
|
+
}
|
|
43969
|
+
} else if (col === colStart && isShowTooltip) {
|
|
43970
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43971
|
+
{
|
|
43972
|
+
colStart: colStart1
|
|
43973
|
+
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
43974
|
+
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
43975
|
+
const {
|
|
43976
|
+
colStart: colStart2
|
|
43977
|
+
} = table.getBodyVisibleColRange(0, -5);
|
|
43978
|
+
isShowTooltip = colStart2 !== colStart;
|
|
43979
|
+
}
|
|
43980
|
+
}
|
|
43981
|
+
return isShowTooltip;
|
|
43982
|
+
}
|
|
43983
|
+
function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
|
|
43984
|
+
var _a;
|
|
43985
|
+
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
43986
|
+
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
43987
|
+
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
43988
|
+
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
43989
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43990
|
+
isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
43991
|
+
forceRelease: forceRelease,
|
|
43992
|
+
releaseChartInstance: !0,
|
|
43993
|
+
releaseColumnChartInstance: !1,
|
|
43994
|
+
releaseRowChartInstance: !1
|
|
43995
|
+
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
43996
|
+
}
|
|
43997
|
+
delete chartInstanceListColumnByColumnDirection[col];
|
|
43999
43998
|
}
|
|
44000
43999
|
}
|
|
44001
|
-
function clearChartInstanceListByRowDirection(row, excludedCol, table) {
|
|
44000
|
+
function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
|
|
44002
44001
|
var _a;
|
|
44003
44002
|
if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
|
|
44004
44003
|
if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
|
|
44005
44004
|
const cellGroup = table.scenegraph.getCell(Number(i), row),
|
|
44006
44005
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
44007
|
-
|
|
44006
|
+
isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
44007
|
+
forceRelease: forceRelease,
|
|
44008
44008
|
releaseChartInstance: !0,
|
|
44009
44009
|
releaseColumnChartInstance: !1,
|
|
44010
44010
|
releaseRowChartInstance: !1
|
|
@@ -44012,6 +44012,40 @@
|
|
|
44012
44012
|
}
|
|
44013
44013
|
delete chartInstanceListRowByRowDirection[row];
|
|
44014
44014
|
}
|
|
44015
|
+
function clearDelayRunDimensionHoverTimerForColumnDirection() {
|
|
44016
|
+
for (const timer of delayRunDimensionHoverTimerForColumnDirection) clearTimeout(timer);
|
|
44017
|
+
delayRunDimensionHoverTimerForColumnDirection.length = 0;
|
|
44018
|
+
}
|
|
44019
|
+
function clearDelayRunDimensionHoverTimerForRowDirection() {
|
|
44020
|
+
for (const timer of delayRunDimensionHoverTimerForRowDirection) clearTimeout(timer);
|
|
44021
|
+
delayRunDimensionHoverTimerForRowDirection.length = 0;
|
|
44022
|
+
}
|
|
44023
|
+
function clearDelayRunDimensionHoverTimerForViewRange() {
|
|
44024
|
+
for (const timer of delayRunDimensionHoverTimerForViewRange) clearTimeout(timer);
|
|
44025
|
+
delayRunDimensionHoverTimerForViewRange.length = 0;
|
|
44026
|
+
}
|
|
44027
|
+
function clearDelayRunDimensionHoverTimers() {
|
|
44028
|
+
for (const timer of delayRunDimensionHoverTimerForColumnDirection) clearTimeout(timer);
|
|
44029
|
+
delayRunDimensionHoverTimerForColumnDirection.length = 0;
|
|
44030
|
+
for (const timer of delayRunDimensionHoverTimerForRowDirection) clearTimeout(timer);
|
|
44031
|
+
delayRunDimensionHoverTimerForRowDirection.length = 0;
|
|
44032
|
+
for (const timer of delayRunDimensionHoverTimerForViewRange) clearTimeout(timer);
|
|
44033
|
+
delayRunDimensionHoverTimerForViewRange.length = 0;
|
|
44034
|
+
}
|
|
44035
|
+
function clearAllChartInstanceList(table, forceRelease = !1) {
|
|
44036
|
+
clearDelayRunDimensionHoverTimers();
|
|
44037
|
+
for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
|
|
44038
|
+
for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
|
|
44039
|
+
}
|
|
44040
|
+
let disabledTooltipToAllChartInstances = !1;
|
|
44041
|
+
function isDisabledTooltipToAllChartInstances() {
|
|
44042
|
+
return disabledTooltipToAllChartInstances;
|
|
44043
|
+
}
|
|
44044
|
+
function enableTooltipToAllChartInstances() {
|
|
44045
|
+
disabledTooltipToAllChartInstances = !1;
|
|
44046
|
+
for (const col in chartInstanceListColumnByColumnDirection) for (const row in chartInstanceListColumnByColumnDirection[col]) chartInstanceListColumnByColumnDirection[col][row].disableTooltip(!1);
|
|
44047
|
+
for (const row in chartInstanceListRowByRowDirection) for (const col in chartInstanceListRowByRowDirection[row]) chartInstanceListRowByRowDirection[row][col].disableTooltip(!1);
|
|
44048
|
+
}
|
|
44015
44049
|
|
|
44016
44050
|
function isValidAlignDomain(domain) {
|
|
44017
44051
|
return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
|
|
@@ -44645,7 +44679,7 @@
|
|
|
44645
44679
|
const CHART_NUMBER_TYPE = genNumberType();
|
|
44646
44680
|
class Chart extends Rect$1 {
|
|
44647
44681
|
constructor(isShareChartSpec, params) {
|
|
44648
|
-
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 {
|
|
44682
|
+
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 {
|
|
44649
44683
|
const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
|
|
44650
44684
|
renderCanvas: params.canvas,
|
|
44651
44685
|
mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
|
|
@@ -44666,7 +44700,7 @@
|
|
|
44666
44700
|
}
|
|
44667
44701
|
}
|
|
44668
44702
|
activate(table) {
|
|
44669
|
-
var _a, _b, _c, _d, _e;
|
|
44703
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
44670
44704
|
if (this.activeChartInstance) return;
|
|
44671
44705
|
const {
|
|
44672
44706
|
col: col,
|
|
@@ -44685,7 +44719,7 @@
|
|
|
44685
44719
|
y1: y1 - table.scrollTop,
|
|
44686
44720
|
y2: y2 - table.scrollTop
|
|
44687
44721
|
});
|
|
44688
|
-
|
|
44722
|
+
this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
|
|
44689
44723
|
renderCanvas: this.attribute.canvas,
|
|
44690
44724
|
mode: "desktop-browser",
|
|
44691
44725
|
canvasControled: !1,
|
|
@@ -44719,7 +44753,7 @@
|
|
|
44719
44753
|
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());
|
|
44720
44754
|
}
|
|
44721
44755
|
},
|
|
44722
|
-
componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
|
|
44756
|
+
componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
|
|
44723
44757
|
tooltip: {
|
|
44724
44758
|
dimension: !1,
|
|
44725
44759
|
mark: !0
|
|
@@ -44730,16 +44764,43 @@
|
|
|
44730
44764
|
const chartStage = this.activeChartInstance.getStage(),
|
|
44731
44765
|
matrix = this.globalTransMatrix.clone(),
|
|
44732
44766
|
stageMatrix = this.stage.window.getViewBoxTransform();
|
|
44767
|
+
let brushChangeThrottle;
|
|
44733
44768
|
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 => {
|
|
44769
|
+
var _a, _b, _c;
|
|
44770
|
+
!1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? this.attribute.spec.interactions.find(interaction => "element-select" === interaction.type && interaction.isMultiple) ? table.scenegraph.updateChartState(null == params ? void 0 : params.datum, "multiple-select") : table.scenegraph.updateChartState(null, void 0) : !0 === (null === (_b = this.attribute.spec.select) || void 0 === _b ? void 0 : _b.enable) && "multiple" === (null === (_c = this.attribute.spec.select) || void 0 === _c ? void 0 : _c.mode) ? table.scenegraph.updateChartState(null == params ? void 0 : params.datum, "multiple-select") : Chart.temp && (table.scenegraph.updateChartState(null, "brush"), table.scenegraph.updateChartState(null == params ? void 0 : params.datum, "click"));
|
|
44771
|
+
}), (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 => {
|
|
44734
44772
|
var _a;
|
|
44735
|
-
|
|
44773
|
+
brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
|
|
44774
|
+
})), this.activeChartInstance.on("brushStart", params => {
|
|
44775
|
+
const brushingChartInstance = getBrushingChartInstance();
|
|
44776
|
+
brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && clearAndReleaseBrushingChartInstance(table.scenegraph), setBrushingChartInstance(this.activeChartInstance, col, row));
|
|
44736
44777
|
}), this.activeChartInstance.on("brushEnd", params => {
|
|
44737
44778
|
var _a;
|
|
44738
|
-
table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
|
|
44779
|
+
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(() => {
|
|
44739
44780
|
Chart.temp = 1;
|
|
44740
44781
|
}, 0);
|
|
44741
|
-
}), table.options.chartDimensionLinkage && this.activeChartInstance.on("
|
|
44782
|
+
}), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
|
|
44783
|
+
markName: "pie"
|
|
44784
|
+
}, params => {
|
|
44785
|
+
var _a;
|
|
44786
|
+
const categoryField = this.attribute.spec.categoryField,
|
|
44787
|
+
datum = {
|
|
44788
|
+
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
44789
|
+
};
|
|
44790
|
+
generateChartInstanceListByViewRange(datum, table, !1);
|
|
44791
|
+
}), this.activeChartInstance.on("pointerout", {
|
|
44792
|
+
markName: "pie"
|
|
44793
|
+
}, params => {
|
|
44794
|
+
var _a;
|
|
44795
|
+
const categoryField = this.attribute.spec.categoryField,
|
|
44796
|
+
datum = {
|
|
44797
|
+
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
44798
|
+
};
|
|
44799
|
+
generateChartInstanceListByViewRange(datum, table, !0);
|
|
44800
|
+
})), this.activeChartInstance.on("dimensionHover", params => {
|
|
44742
44801
|
var _a, _b;
|
|
44802
|
+
if (isDisabledTooltipToAllChartInstances()) return;
|
|
44803
|
+
this.activeChartInstance.disableTooltip(!1);
|
|
44743
44804
|
const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
|
|
44744
44805
|
canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
|
|
44745
44806
|
viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
|
|
@@ -44756,11 +44817,11 @@
|
|
|
44756
44817
|
prev_justShowMarkTooltip = this.justShowMarkTooltip;
|
|
44757
44818
|
params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
|
|
44758
44819
|
let delayRunDimensionHover = !1;
|
|
44759
|
-
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,
|
|
44820
|
+
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) {
|
|
44760
44821
|
const dimensionValue = dimensionInfo.value,
|
|
44761
44822
|
indicatorsAsCol = table.options.indicatorsAsCol;
|
|
44762
|
-
if (delayRunDimensionHover ? (
|
|
44763
|
-
indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
|
|
44823
|
+
if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
|
|
44824
|
+
isDisabledTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
|
|
44764
44825
|
}, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
|
|
44765
44826
|
const series = dimensionInfo.data[0].series,
|
|
44766
44827
|
width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
|
|
@@ -44801,21 +44862,26 @@
|
|
|
44801
44862
|
}
|
|
44802
44863
|
}
|
|
44803
44864
|
}
|
|
44804
|
-
}), null === (
|
|
44865
|
+
})), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
|
|
44866
|
+
}
|
|
44867
|
+
clearDelayRunDimensionHoverTimer() {
|
|
44868
|
+
clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
|
|
44805
44869
|
}
|
|
44806
44870
|
deactivate(table, {
|
|
44871
|
+
forceRelease = !1,
|
|
44807
44872
|
releaseChartInstance = !0,
|
|
44808
44873
|
releaseColumnChartInstance = !0,
|
|
44809
|
-
releaseRowChartInstance = !0
|
|
44874
|
+
releaseRowChartInstance = !0,
|
|
44875
|
+
releaseAllChartInstance = !1
|
|
44810
44876
|
} = {}) {
|
|
44811
44877
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
44812
|
-
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(),
|
|
44813
|
-
null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
44878
|
+
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
|
|
44879
|
+
!this.activeChartInstance || !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
44814
44880
|
x1: -1e3,
|
|
44815
44881
|
x2: -800,
|
|
44816
44882
|
y1: -1e3,
|
|
44817
44883
|
y2: -800
|
|
44818
|
-
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
|
|
44884
|
+
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
|
|
44819
44885
|
const {
|
|
44820
44886
|
col: col,
|
|
44821
44887
|
row: row
|
|
@@ -44828,7 +44894,7 @@
|
|
|
44828
44894
|
} = this.parent;
|
|
44829
44895
|
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));
|
|
44830
44896
|
}
|
|
44831
|
-
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);
|
|
44897
|
+
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));
|
|
44832
44898
|
}
|
|
44833
44899
|
updateData(data) {
|
|
44834
44900
|
this.attribute.data = data;
|
|
@@ -44843,13 +44909,14 @@
|
|
|
44843
44909
|
y1: y1,
|
|
44844
44910
|
x2: x2,
|
|
44845
44911
|
y2: y2
|
|
44846
|
-
} = cellGroup.globalAABBBounds
|
|
44847
|
-
|
|
44848
|
-
|
|
44849
|
-
|
|
44850
|
-
|
|
44851
|
-
|
|
44852
|
-
|
|
44912
|
+
} = cellGroup.globalAABBBounds,
|
|
44913
|
+
viewBox = {
|
|
44914
|
+
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)),
|
|
44915
|
+
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)),
|
|
44916
|
+
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)),
|
|
44917
|
+
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))
|
|
44918
|
+
};
|
|
44919
|
+
return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
|
|
44853
44920
|
}
|
|
44854
44921
|
}
|
|
44855
44922
|
function getTableBounds(col, row, table) {
|
|
@@ -45064,7 +45131,7 @@
|
|
|
45064
45131
|
{
|
|
45065
45132
|
width = groupAttribute.width,
|
|
45066
45133
|
height = groupAttribute.height
|
|
45067
|
-
} =
|
|
45134
|
+
} = chart.attribute,
|
|
45068
45135
|
{
|
|
45069
45136
|
table: table
|
|
45070
45137
|
} = chart.getRootNode(),
|
|
@@ -45092,8 +45159,9 @@
|
|
|
45092
45159
|
});
|
|
45093
45160
|
}
|
|
45094
45161
|
}
|
|
45095
|
-
const
|
|
45096
|
-
|
|
45162
|
+
const lastViewBox = chart.activeChartInstanceLastViewBox,
|
|
45163
|
+
viewBox = chart.getViewBox();
|
|
45164
|
+
lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
|
|
45097
45165
|
x1: 0,
|
|
45098
45166
|
x2: viewBox.x2 - viewBox.x1,
|
|
45099
45167
|
y1: 0,
|
|
@@ -47890,7 +47958,7 @@
|
|
|
47890
47958
|
rowUpdatePos = isValid$1(rowUpdatePos) ? isValid$1(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
|
|
47891
47959
|
}
|
|
47892
47960
|
let updateAfter;
|
|
47893
|
-
if (scene.table._clearRowRangeHeightsMap(), addRows.forEach(row => {
|
|
47961
|
+
if (scene.table._clearRowRangeHeightsMap(), verifyProxyRowStatus(scene), addRows.forEach(row => {
|
|
47894
47962
|
const needUpdateAfter = addRow(row, scene, skipUpdateProxy);
|
|
47895
47963
|
updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.insert(row);
|
|
47896
47964
|
}), resetRowNumberAndY(scene), addRows.length) {
|
|
@@ -48120,6 +48188,25 @@
|
|
|
48120
48188
|
function setRowSeriesNumberCellNeedUpdate(startUpdateRow, scene) {
|
|
48121
48189
|
if (scene.table.isHasSeriesNumber()) for (let row = startUpdateRow; row <= scene.table.rowCount - 1; row++) updateCell$1(0, row, scene.table, !1);
|
|
48122
48190
|
}
|
|
48191
|
+
function verifyProxyRowStatus(scene) {
|
|
48192
|
+
const proxy = scene.proxy,
|
|
48193
|
+
{
|
|
48194
|
+
rowStart: rowStart,
|
|
48195
|
+
rowEnd: rowEnd,
|
|
48196
|
+
rowLimit: rowLimit,
|
|
48197
|
+
totalRow: totalRow
|
|
48198
|
+
} = proxy;
|
|
48199
|
+
if (rowStart > rowEnd) return proxy.rowStart = scene.table.columnHeaderLevelCount, proxy.rowEnd = Math.min(totalRow, proxy.rowStart + rowLimit - 1), void (proxy.currentRow = 0);
|
|
48200
|
+
if (rowStart + rowLimit - 1 > totalRow) {
|
|
48201
|
+
const oldRowStart = proxy.rowStart,
|
|
48202
|
+
newRowStart = Math.max(scene.table.columnHeaderLevelCount, totalRow - rowLimit + 1);
|
|
48203
|
+
if (newRowStart === oldRowStart) return;
|
|
48204
|
+
proxy.rowStart = newRowStart, proxy.rowEnd = Math.min(totalRow, newRowStart + rowLimit - 1), proxy.currentRow = proxy.rowEnd + 1;
|
|
48205
|
+
const addRowCount = oldRowStart - proxy.rowStart;
|
|
48206
|
+
for (let i = 0; i < addRowCount; i++) addRowCellGroup(proxy.rowStart + i, scene);
|
|
48207
|
+
proxy.rowUpdatePos = proxy.rowStart;
|
|
48208
|
+
}
|
|
48209
|
+
}
|
|
48123
48210
|
|
|
48124
48211
|
function createReactContainer(table) {
|
|
48125
48212
|
const {
|
|
@@ -48602,18 +48689,25 @@
|
|
|
48602
48689
|
}
|
|
48603
48690
|
function clearChartCacheImage(scenegraph) {
|
|
48604
48691
|
var _a;
|
|
48692
|
+
const brushingCellPos = getBrushingChartInstanceCellPos();
|
|
48605
48693
|
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
48606
48694
|
const columnGroup = scenegraph.getColGroup(c);
|
|
48607
48695
|
null === (_a = null == columnGroup ? void 0 : columnGroup.getChildren()) || void 0 === _a || _a.forEach(cellNode => {
|
|
48608
|
-
cellNode.children.forEach(node => {
|
|
48696
|
+
brushingCellPos && brushingCellPos.col === cellNode.col && brushingCellPos.row === cellNode.row || cellNode.children.forEach(node => {
|
|
48609
48697
|
"chart" === node.type && (node.cacheCanvas = null, node.addUpdateBoundTag());
|
|
48610
48698
|
});
|
|
48611
48699
|
});
|
|
48612
48700
|
}
|
|
48613
48701
|
}
|
|
48614
|
-
function
|
|
48702
|
+
function clearCellChartCacheImage(col, row, scenegraph) {
|
|
48703
|
+
scenegraph.getCell(col, row).children.forEach(node => {
|
|
48704
|
+
"chart" === node.type && (node.cacheCanvas = null, node.addUpdateBoundTag());
|
|
48705
|
+
});
|
|
48706
|
+
}
|
|
48707
|
+
function updateChartState(scenegraph, datum, selectedDataMode) {
|
|
48615
48708
|
const table = scenegraph.table;
|
|
48616
48709
|
if (table.isPivotChart()) {
|
|
48710
|
+
table._selectedDataMode = selectedDataMode;
|
|
48617
48711
|
const preSelectItemsCount = table._selectedDataItemsInChart.length;
|
|
48618
48712
|
if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
|
|
48619
48713
|
const newSelectedDataItemsInChart = [];
|
|
@@ -48628,7 +48722,7 @@
|
|
|
48628
48722
|
for (const itemKey in datum) itemKey.startsWith("VGRAMMAR_") || itemKey.startsWith("__VCHART") || (selectedState[itemKey] = datum[itemKey]);
|
|
48629
48723
|
newSelectedDataItemsInChart.push(selectedState);
|
|
48630
48724
|
}
|
|
48631
|
-
isEqual(table._selectedDataItemsInChart, newSelectedDataItemsInChart) || (table._selectedDataItemsInChart = newSelectedDataItemsInChart, table.internalProps.layoutMap.updateDataStateToChartInstance(), clearChartCacheImage(scenegraph), table.scenegraph.updateNextFrame());
|
|
48725
|
+
"multiple-select" === selectedDataMode ? (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length ? table._selectedDataItemsInChart = [] : table._selectedDataItemsInChart.push(...newSelectedDataItemsInChart), table.internalProps.layoutMap.updateDataStateToChartInstance(), clearChartCacheImage(scenegraph), table.scenegraph.updateNextFrame()) : isEqual(table._selectedDataItemsInChart, newSelectedDataItemsInChart) || (table._selectedDataItemsInChart = newSelectedDataItemsInChart, table.internalProps.layoutMap.updateDataStateToChartInstance(), clearChartCacheImage(scenegraph), table.scenegraph.updateNextFrame());
|
|
48632
48726
|
}
|
|
48633
48727
|
}
|
|
48634
48728
|
function updateChartGraphicSize(cellNode, width, height) {
|
|
@@ -49361,16 +49455,28 @@
|
|
|
49361
49455
|
resetResidentHoverIcon(col, row) {
|
|
49362
49456
|
resetResidentHoverIcon(col, row, this);
|
|
49363
49457
|
}
|
|
49364
|
-
deactivateChart(col, row) {
|
|
49365
|
-
var _a, _b, _c;
|
|
49458
|
+
deactivateChart(col, row, forceRelease = !1) {
|
|
49459
|
+
var _a, _b, _c, _d, _e, _f;
|
|
49460
|
+
if (forceRelease) {
|
|
49461
|
+
const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
|
|
49462
|
+
brushingChartInstance = getBrushingChartInstance();
|
|
49463
|
+
brushingChartInstanceCellPos && brushingChartInstance && (clearAndReleaseBrushingChartInstance(this), clearCellChartCacheImage(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row, this));
|
|
49464
|
+
}
|
|
49366
49465
|
if (-1 === col || -1 === row) return;
|
|
49367
49466
|
const cellGroup = this.getCell(col, row);
|
|
49368
49467
|
if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
|
|
49468
|
+
if (forceRelease) return void (null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
|
|
49469
|
+
forceRelease: !0,
|
|
49470
|
+
releaseChartInstance: !0,
|
|
49471
|
+
releaseColumnChartInstance: !0,
|
|
49472
|
+
releaseRowChartInstance: !0,
|
|
49473
|
+
releaseAllChartInstance: !0
|
|
49474
|
+
}));
|
|
49369
49475
|
const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
|
|
49370
|
-
null === (
|
|
49371
|
-
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,
|
|
49372
|
-
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,
|
|
49373
|
-
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
|
|
49476
|
+
null === (_e = null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) || void 0 === _e || _e.call(_d, this.table, (null === (_f = this.table.options.chartDimensionLinkage) || void 0 === _f ? void 0 : _f.showTooltip) ? {
|
|
49477
|
+
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),
|
|
49478
|
+
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),
|
|
49479
|
+
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)
|
|
49374
49480
|
} : void 0);
|
|
49375
49481
|
}
|
|
49376
49482
|
}
|
|
@@ -49418,8 +49524,15 @@
|
|
|
49418
49524
|
updateChartSizeForResizeRowHeight(row) {
|
|
49419
49525
|
updateChartSizeForResizeRowHeight(this, row);
|
|
49420
49526
|
}
|
|
49421
|
-
updateChartState(datum) {
|
|
49422
|
-
|
|
49527
|
+
updateChartState(datum, selectedDataMode) {
|
|
49528
|
+
var _a, _b, _c;
|
|
49529
|
+
if (this.table.isPivotChart()) {
|
|
49530
|
+
if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
|
|
49531
|
+
const brushingChartInstance = getBrushingChartInstance();
|
|
49532
|
+
brushingChartInstance && (null === (_a = brushingChartInstance.getChart()) || void 0 === _a || _a.getComponentsByKey("brush")[0].clearBrushStateAndMask()), null === (_c = null === (_b = this.table.options.chartDimensionLinkage) || void 0 === _b ? void 0 : _b.clearChartState) || void 0 === _c || _c.call(_b);
|
|
49533
|
+
}
|
|
49534
|
+
updateChartState(this, datum, selectedDataMode);
|
|
49535
|
+
}
|
|
49423
49536
|
}
|
|
49424
49537
|
updateCheckboxCellState(col, row, checked) {
|
|
49425
49538
|
var _a, _b;
|
|
@@ -50075,7 +50188,7 @@
|
|
|
50075
50188
|
} else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
|
|
50076
50189
|
if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
|
|
50077
50190
|
if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
|
|
50078
|
-
let extendSelectRange = !
|
|
50191
|
+
let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
|
|
50079
50192
|
-1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
|
|
50080
50193
|
const currentRange = state.select.ranges[state.select.ranges.length - 1];
|
|
50081
50194
|
if (currentRange) {
|
|
@@ -50197,7 +50310,7 @@
|
|
|
50197
50310
|
};
|
|
50198
50311
|
enableShiftSelectMode || (currentRange.end = currentRange.start), scenegraph.deleteLastSelectedRangeComponents(), scenegraph.updateCellSelectBorder(currentRange);
|
|
50199
50312
|
} else {
|
|
50200
|
-
let extendSelectRange = !
|
|
50313
|
+
let extendSelectRange = !isValid$1(skipBodyMerge) || !skipBodyMerge;
|
|
50201
50314
|
if (-1 === cellPos.col || -1 === cellPos.row || enableCtrlSelectMode || (state.select.ranges = [], scenegraph.deleteAllSelectBorder()), "cell" !== state.select.headerSelectMode && table.isColumnHeader(col, row)) {
|
|
50202
50315
|
const cellRange = table.getCellRange(col, row);
|
|
50203
50316
|
"body" === state.select.headerSelectMode ? state.select.ranges.push({
|
|
@@ -52446,7 +52559,7 @@
|
|
|
52446
52559
|
}, 0 !== e.button) return;
|
|
52447
52560
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
52448
52561
|
if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
|
|
52449
|
-
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;
|
|
52562
|
+
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;
|
|
52450
52563
|
const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
|
|
52451
52564
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
52452
52565
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -52474,7 +52587,7 @@
|
|
|
52474
52587
|
}
|
|
52475
52588
|
eventManager.dealTableHover(eventArgsSet);
|
|
52476
52589
|
} else {
|
|
52477
|
-
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52590
|
+
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);
|
|
52478
52591
|
if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52479
52592
|
if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52480
52593
|
eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
|
|
@@ -52626,7 +52739,7 @@
|
|
|
52626
52739
|
if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
|
|
52627
52740
|
const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
|
|
52628
52741
|
if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
|
|
52629
|
-
table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
|
|
52742
|
+
table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
|
|
52630
52743
|
const {
|
|
52631
52744
|
eventArgs: eventArgs
|
|
52632
52745
|
} = eventArgsSet;
|
|
@@ -52645,7 +52758,7 @@
|
|
|
52645
52758
|
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 {
|
|
52646
52759
|
stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
|
|
52647
52760
|
const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
52648
|
-
(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);
|
|
52761
|
+
(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);
|
|
52649
52762
|
}
|
|
52650
52763
|
}), table.scenegraph.stage.addEventListener("pointermove", e => {
|
|
52651
52764
|
var _a, _b, _c;
|
|
@@ -52763,7 +52876,15 @@
|
|
|
52763
52876
|
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
|
|
52764
52877
|
}), table.scenegraph.stage.addEventListener("wheel", e => {
|
|
52765
52878
|
var _a;
|
|
52766
|
-
e.path.find(node => "legend" === node.name)
|
|
52879
|
+
if (!e.path.find(node => "legend" === node.name)) {
|
|
52880
|
+
null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
|
|
52881
|
+
const {
|
|
52882
|
+
cellPos: cellPos
|
|
52883
|
+
} = table.stateManager.hover,
|
|
52884
|
+
prevHoverCellCol = cellPos.col,
|
|
52885
|
+
prevHoverCellRow = cellPos.row;
|
|
52886
|
+
table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
|
|
52887
|
+
}
|
|
52767
52888
|
});
|
|
52768
52889
|
}
|
|
52769
52890
|
function bindGesture(eventManager) {
|
|
@@ -52878,11 +52999,13 @@
|
|
|
52878
52999
|
const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
|
|
52879
53000
|
throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
|
|
52880
53001
|
scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
|
|
52881
|
-
|
|
53002
|
+
var _a;
|
|
53003
|
+
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);
|
|
52882
53004
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
52883
53005
|
throttleVerticalWheel(ratio, e);
|
|
52884
53006
|
}), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
|
|
52885
|
-
|
|
53007
|
+
var _a;
|
|
53008
|
+
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);
|
|
52886
53009
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
52887
53010
|
throttleHorizontalWheel(ratio);
|
|
52888
53011
|
});
|
|
@@ -53017,22 +53140,22 @@
|
|
|
53017
53140
|
table.isReleased || 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight || "adaptive" === table.widthMode || "adaptive" === table.heightMode) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$1(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio()), e.windowSizeNotChange || table.resize());
|
|
53018
53141
|
});
|
|
53019
53142
|
const globalPointerdownCallback = e => {
|
|
53020
|
-
var _a;
|
|
53143
|
+
var _a, _b, _c, _d;
|
|
53021
53144
|
if (table.isReleased) return;
|
|
53022
53145
|
table.eventManager.LastBodyPointerXY = {
|
|
53023
53146
|
x: e.x,
|
|
53024
53147
|
y: e.y
|
|
53025
53148
|
}, table.eventManager.isDown = !0;
|
|
53026
53149
|
const target = e.target;
|
|
53027
|
-
if (!table.getElement().contains(target) && !table.internalProps.menuHandler.containElement(target)) {
|
|
53028
|
-
const isCompleteEdit = null === (
|
|
53150
|
+
if (!table.getElement().contains(target) && !table.internalProps.menuHandler.containElement(target) && (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.shouldTreatAsClickOnTable) || (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.shouldTreatAsClickOnTable) && !(null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.shouldTreatAsClickOnTable(e)))) {
|
|
53151
|
+
const isCompleteEdit = null === (_d = table.editorManager) || void 0 === _d ? void 0 : _d.completeEdit(e);
|
|
53029
53152
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
53030
53153
|
var _a, _b;
|
|
53031
53154
|
if (!1 !== isCompleteEdit && (null === (_a = table.options.select) || void 0 === _a ? void 0 : _a.outsideClickDeselect)) {
|
|
53032
53155
|
const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
|
|
53033
53156
|
eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
|
|
53034
53157
|
}
|
|
53035
|
-
});
|
|
53158
|
+
}), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
|
|
53036
53159
|
}
|
|
53037
53160
|
};
|
|
53038
53161
|
eventManager.globalEventListeners.push({
|
|
@@ -53543,7 +53666,7 @@
|
|
|
53543
53666
|
};
|
|
53544
53667
|
class EventManager {
|
|
53545
53668
|
constructor(table) {
|
|
53546
|
-
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.
|
|
53669
|
+
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(() => {
|
|
53547
53670
|
this.bindSelfEvent();
|
|
53548
53671
|
}, 0));
|
|
53549
53672
|
}
|
|
@@ -53845,25 +53968,15 @@
|
|
|
53845
53968
|
} catch (error) {}
|
|
53846
53969
|
}
|
|
53847
53970
|
handleCut(e) {
|
|
53848
|
-
var _a;
|
|
53849
53971
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53850
|
-
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.
|
|
53851
|
-
|
|
53852
|
-
col: r.start.col,
|
|
53853
|
-
row: r.start.row
|
|
53854
|
-
},
|
|
53855
|
-
end: {
|
|
53856
|
-
col: r.end.col,
|
|
53857
|
-
row: r.end.row
|
|
53858
|
-
}
|
|
53859
|
-
})), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
53860
|
-
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
|
|
53972
|
+
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
53973
|
+
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
|
|
53861
53974
|
}, 3e4), this.saveClipboardContent();
|
|
53862
53975
|
});
|
|
53863
53976
|
}
|
|
53864
53977
|
handlePaste(e) {
|
|
53865
53978
|
this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
|
|
53866
|
-
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.
|
|
53979
|
+
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53867
53980
|
}).catch(() => {
|
|
53868
53981
|
this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53869
53982
|
}) : this.executePaste(e);
|
|
@@ -53940,9 +54053,9 @@
|
|
|
53940
54053
|
}
|
|
53941
54054
|
clearCutArea(table) {
|
|
53942
54055
|
try {
|
|
53943
|
-
const
|
|
53944
|
-
if (!
|
|
53945
|
-
table.
|
|
54056
|
+
const selectCells = this.cutCellRange;
|
|
54057
|
+
if (!selectCells || 0 === selectCells.length) return;
|
|
54058
|
+
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);
|
|
53946
54059
|
} catch (error) {}
|
|
53947
54060
|
}
|
|
53948
54061
|
checkClipboardChanged() {
|
|
@@ -55878,22 +55991,41 @@
|
|
|
55878
55991
|
|
|
55879
55992
|
class CustomCellStylePlugin {
|
|
55880
55993
|
constructor(table, customCellStyle, customCellStyleArrangement) {
|
|
55881
|
-
this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
|
|
55994
|
+
this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement, this._customCellStyleArrangementIndex = new Map(), this._customCellStyleArrangementTombstoneCount = 0, this._rebuildCustomCellStyleArrangementIndex();
|
|
55995
|
+
}
|
|
55996
|
+
_getCustomCellStyleArrangementKey(cellPos) {
|
|
55997
|
+
if (cellPos.range) {
|
|
55998
|
+
const {
|
|
55999
|
+
start: start,
|
|
56000
|
+
end: end
|
|
56001
|
+
} = cellPos.range;
|
|
56002
|
+
return `range:${start.col},${start.row},${end.col},${end.row}`;
|
|
56003
|
+
}
|
|
56004
|
+
if (void 0 !== cellPos.col && void 0 !== cellPos.row) return `cell:${cellPos.col},${cellPos.row}`;
|
|
55882
56005
|
}
|
|
55883
|
-
|
|
55884
|
-
this.
|
|
56006
|
+
_rebuildCustomCellStyleArrangementIndex() {
|
|
56007
|
+
this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0;
|
|
56008
|
+
for (let i = 0; i < this.customCellStyleArrangement.length; i++) {
|
|
56009
|
+
if (!isValid$1(this.customCellStyleArrangement[i].customStyleId)) {
|
|
56010
|
+
this._customCellStyleArrangementTombstoneCount++;
|
|
56011
|
+
continue;
|
|
56012
|
+
}
|
|
56013
|
+
const key = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[i].cellPosition);
|
|
56014
|
+
key && this._customCellStyleArrangementIndex.set(key, i);
|
|
56015
|
+
}
|
|
55885
56016
|
}
|
|
55886
|
-
|
|
55887
|
-
this.customCellStyleArrangement.
|
|
55888
|
-
|
|
55889
|
-
|
|
55890
|
-
|
|
56017
|
+
_compactCustomCellStyleArrangementIfNeeded() {
|
|
56018
|
+
const length = this.customCellStyleArrangement.length;
|
|
56019
|
+
if (this._customCellStyleArrangementTombstoneCount < 2048) return;
|
|
56020
|
+
if (4 * this._customCellStyleArrangementTombstoneCount < length) return;
|
|
56021
|
+
const compacted = this.customCellStyleArrangement.filter(style => isValid$1(style.customStyleId));
|
|
56022
|
+
compacted.length !== this.customCellStyleArrangement.length ? (this.customCellStyleArrangement.length = 0, this.customCellStyleArrangement.push(...compacted), this._rebuildCustomCellStyleArrangementIndex()) : this._customCellStyleArrangementTombstoneCount = 0;
|
|
55891
56023
|
}
|
|
55892
56024
|
getCustomCellStyle(col, row) {
|
|
55893
56025
|
const customStyleIds = this.getCustomCellStyleIds(col, row);
|
|
55894
56026
|
if (customStyleIds.length) {
|
|
55895
56027
|
const styles = [];
|
|
55896
|
-
|
|
56028
|
+
if (customStyleIds.forEach(customStyleId => {
|
|
55897
56029
|
const styleOption = this.getCustomCellStyleOption(customStyleId);
|
|
55898
56030
|
if (isFunction$3(null == styleOption ? void 0 : styleOption.style)) {
|
|
55899
56031
|
const style = styleOption.style({
|
|
@@ -55906,14 +56038,15 @@
|
|
|
55906
56038
|
});
|
|
55907
56039
|
styles.push(style);
|
|
55908
56040
|
} else (null == styleOption ? void 0 : styleOption.style) && styles.push(styleOption.style);
|
|
55909
|
-
}),
|
|
56041
|
+
}), !styles.length) return;
|
|
56042
|
+
return merge({}, ...styles);
|
|
55910
56043
|
}
|
|
55911
56044
|
}
|
|
55912
56045
|
getCustomCellStyleIds(col, row) {
|
|
55913
56046
|
const customStyleIds = [],
|
|
55914
56047
|
range = this.table.getCellRange(col, row);
|
|
55915
56048
|
for (let c = range.start.col; c <= range.end.col; c++) for (let r = range.start.row; r <= range.end.row; r++) this.customCellStyleArrangement.forEach(style => {
|
|
55916
|
-
style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId);
|
|
56049
|
+
isValid$1(style.customStyleId) && (style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId));
|
|
55917
56050
|
});
|
|
55918
56051
|
return customStyleIds;
|
|
55919
56052
|
}
|
|
@@ -55934,21 +56067,35 @@
|
|
|
55934
56067
|
}), this.table.scenegraph.updateNextFrame();
|
|
55935
56068
|
}
|
|
55936
56069
|
arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
|
|
55937
|
-
var _a;
|
|
55938
|
-
const
|
|
55939
|
-
|
|
55940
|
-
if (-1
|
|
55941
|
-
|
|
55942
|
-
|
|
55943
|
-
|
|
55944
|
-
|
|
55945
|
-
|
|
55946
|
-
|
|
55947
|
-
|
|
56070
|
+
var _a, _b;
|
|
56071
|
+
const inputKey = this._getCustomCellStyleArrangementKey(cellPos);
|
|
56072
|
+
let index = inputKey && null !== (_a = this._customCellStyleArrangementIndex.get(inputKey)) && void 0 !== _a ? _a : -1;
|
|
56073
|
+
if (inputKey && -1 !== index) {
|
|
56074
|
+
const item = this.customCellStyleArrangement[index],
|
|
56075
|
+
itemKey = item ? this._getCustomCellStyleArrangementKey(item.cellPosition) : void 0;
|
|
56076
|
+
item && isValid$1(item.customStyleId) && itemKey === inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$1(style.customStyleId) && this._getCustomCellStyleArrangementKey(style.cellPosition) === inputKey), -1 !== index ? this._customCellStyleArrangementIndex.set(inputKey, index) : this._customCellStyleArrangementIndex.delete(inputKey));
|
|
56077
|
+
}
|
|
56078
|
+
if (-1 !== index || inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$1(style.customStyleId) && (style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row))), -1 === index && !customStyleId) return;
|
|
56079
|
+
if (-1 === index && customStyleId) {
|
|
56080
|
+
this.customCellStyleArrangement.push({
|
|
56081
|
+
cellPosition: {
|
|
56082
|
+
col: cellPos.col,
|
|
56083
|
+
row: cellPos.row,
|
|
56084
|
+
range: cellPos.range
|
|
56085
|
+
},
|
|
56086
|
+
customStyleId: customStyleId
|
|
56087
|
+
});
|
|
56088
|
+
const pushedIndex = this.customCellStyleArrangement.length - 1,
|
|
56089
|
+
pushedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[pushedIndex].cellPosition);
|
|
56090
|
+
pushedKey && this._customCellStyleArrangementIndex.set(pushedKey, pushedIndex);
|
|
56091
|
+
} else {
|
|
55948
56092
|
if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
|
|
55949
|
-
customStyleId
|
|
56093
|
+
if (customStyleId) this.customCellStyleArrangement[index].customStyleId = customStyleId;else {
|
|
56094
|
+
const existedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[index].cellPosition);
|
|
56095
|
+
isValid$1(this.customCellStyleArrangement[index].customStyleId) && this._customCellStyleArrangementTombstoneCount++, this.customCellStyleArrangement[index].customStyleId = null, existedKey && this._customCellStyleArrangementIndex.delete(existedKey), this._compactCustomCellStyleArrangementIfNeeded();
|
|
56096
|
+
}
|
|
55950
56097
|
}
|
|
55951
|
-
const style = null === (
|
|
56098
|
+
const style = customStyleId ? null === (_b = this.getCustomCellStyleOption(customStyleId)) || void 0 === _b ? void 0 : _b.style : void 0;
|
|
55952
56099
|
if (style) {
|
|
55953
56100
|
forceFastUpdate = !0;
|
|
55954
56101
|
for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
|
|
@@ -55963,7 +56110,7 @@
|
|
|
55963
56110
|
this.table.scenegraph.updateNextFrame();
|
|
55964
56111
|
}
|
|
55965
56112
|
updateCustomCell(customCellStyle, customCellStyleArrangement) {
|
|
55966
|
-
this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, customCellStyle.forEach(cellStyle => {
|
|
56113
|
+
this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0, customCellStyle.forEach(cellStyle => {
|
|
55967
56114
|
this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
|
|
55968
56115
|
}), customCellStyleArrangement.forEach(cellStyle => {
|
|
55969
56116
|
this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
|
|
@@ -56194,7 +56341,7 @@
|
|
|
56194
56341
|
}
|
|
56195
56342
|
constructor(container, options = {}) {
|
|
56196
56343
|
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;
|
|
56197
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.
|
|
56344
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.12-alpha.0", 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");
|
|
56198
56345
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
56199
56346
|
options: options,
|
|
56200
56347
|
container: container
|
|
@@ -57408,16 +57555,16 @@
|
|
|
57408
57555
|
startCol = enableShiftSelectMode && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.col) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.col : colIndex,
|
|
57409
57556
|
endCol = colIndex,
|
|
57410
57557
|
endRow = this.rowCount - 1;
|
|
57411
|
-
this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
|
|
57558
|
+
this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
|
|
57412
57559
|
}
|
|
57413
57560
|
dragSelectCol(colIndex, enableCtrlSelectMode) {
|
|
57414
57561
|
var _a, _b;
|
|
57415
57562
|
const currentSelectRanges = this.stateManager.select.ranges,
|
|
57416
57563
|
lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
|
|
57417
|
-
lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
|
|
57564
|
+
lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
|
|
57418
57565
|
}
|
|
57419
57566
|
endDragSelect() {
|
|
57420
|
-
this.stateManager.updateInteractionState(InteractionState.default)
|
|
57567
|
+
this.stateManager.updateInteractionState(InteractionState.default);
|
|
57421
57568
|
}
|
|
57422
57569
|
startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
|
|
57423
57570
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -57425,13 +57572,13 @@
|
|
|
57425
57572
|
startRow = isShift && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.row) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.row : rowIndex,
|
|
57426
57573
|
endCol = this.colCount - 1,
|
|
57427
57574
|
endRow = rowIndex;
|
|
57428
|
-
this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
|
|
57575
|
+
this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
|
|
57429
57576
|
}
|
|
57430
57577
|
dragSelectRow(rowIndex, isCtrl) {
|
|
57431
57578
|
var _a, _b;
|
|
57432
57579
|
const currentSelectRanges = this.stateManager.select.ranges,
|
|
57433
57580
|
lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
|
|
57434
|
-
lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
|
|
57581
|
+
lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
|
|
57435
57582
|
}
|
|
57436
57583
|
get recordsCount() {
|
|
57437
57584
|
var _a;
|
|
@@ -58353,6 +58500,18 @@
|
|
|
58353
58500
|
}
|
|
58354
58501
|
return !1;
|
|
58355
58502
|
}
|
|
58503
|
+
updateCellContent(col, row) {
|
|
58504
|
+
this.scenegraph.updateCellContent(col, row);
|
|
58505
|
+
}
|
|
58506
|
+
updateCellContentRange(startCol, startRow, endCol, endRow) {
|
|
58507
|
+
for (let i = startCol; i <= endCol; i++) for (let j = startRow; j <= endRow; j++) this.scenegraph.updateCellContent(i, j);
|
|
58508
|
+
}
|
|
58509
|
+
updateCellContentRanges(ranges) {
|
|
58510
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
58511
|
+
const range = ranges[i];
|
|
58512
|
+
this.updateCellContentRange(range.start.col, range.start.row, range.end.col, range.end.row);
|
|
58513
|
+
}
|
|
58514
|
+
}
|
|
58356
58515
|
}
|
|
58357
58516
|
|
|
58358
58517
|
const chartTypes = {};
|
|
@@ -59819,8 +59978,8 @@
|
|
|
59819
59978
|
col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1;
|
|
59820
59979
|
const editor = this.table.getEditor(col, row);
|
|
59821
59980
|
editor && setTimeout(() => {
|
|
59822
|
-
var _a;
|
|
59823
|
-
editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 ===
|
|
59981
|
+
var _a, _b;
|
|
59982
|
+
editor && this.editingEditor !== editor && (null === (_b = (_a = editor).prepareEdit) || void 0 === _b || _b.call(_a, {
|
|
59824
59983
|
referencePosition: referencePosition,
|
|
59825
59984
|
container: this.table.getElement(),
|
|
59826
59985
|
table: this.table,
|
|
@@ -59833,14 +59992,14 @@
|
|
|
59833
59992
|
this.listenersId.push(doubleClickEventId, clickEventId, selectedChangedEventId);
|
|
59834
59993
|
}
|
|
59835
59994
|
startEditCell(col, row, value, editElement) {
|
|
59836
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
59995
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
59837
59996
|
if (this.editingEditor) return;
|
|
59838
59997
|
const editor = this.table.getEditor(col, row);
|
|
59839
59998
|
if (editor) {
|
|
59840
|
-
if (editElement && editor.setElement(editElement), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
|
|
59841
|
-
if (null === (
|
|
59842
|
-
const isPivotTable = null === (
|
|
59843
|
-
updateAggregationOnEditCell = !!isPivotTable && (null === (
|
|
59999
|
+
if (editElement && (null === (_b = (_a = editor).setElement) || void 0 === _b || _b.call(_a, editElement)), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
|
|
60000
|
+
if (null === (_d = null === (_c = this.table.internalProps.layoutMap) || void 0 === _c ? void 0 : _c.isAggregation) || void 0 === _d ? void 0 : _d.call(_c, col, row)) {
|
|
60001
|
+
const isPivotTable = null === (_f = (_e = this.table).isPivotTable) || void 0 === _f ? void 0 : _f.call(_e),
|
|
60002
|
+
updateAggregationOnEditCell = !!isPivotTable && (null === (_h = null === (_g = this.table.internalProps) || void 0 === _g ? void 0 : _g.dataConfig) || void 0 === _h ? void 0 : _h.updateAggregationOnEditCell);
|
|
59844
60003
|
if (!isPivotTable || isPivotTable && updateAggregationOnEditCell) return;
|
|
59845
60004
|
}
|
|
59846
60005
|
const record = this.table.getCellRawRecord(col, row);
|
|
@@ -59859,9 +60018,9 @@
|
|
|
59859
60018
|
height: rect.height
|
|
59860
60019
|
}
|
|
59861
60020
|
};
|
|
59862
|
-
col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (
|
|
60021
|
+
col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (_j = editor.beginEditing) || void 0 === _j || _j.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_k = editor.bindSuccessCallback) || void 0 === _k || _k.call(editor, () => {
|
|
59863
60022
|
this.completeEdit();
|
|
59864
|
-
}), null === (
|
|
60023
|
+
}), null === (_l = editor.onStart) || void 0 === _l || _l.call(editor, {
|
|
59865
60024
|
value: dataValue,
|
|
59866
60025
|
endEdit: () => {
|
|
59867
60026
|
this.completeEdit();
|
|
@@ -59969,16 +60128,15 @@
|
|
|
59969
60128
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59970
60129
|
});
|
|
59971
60130
|
};
|
|
59972
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table
|
|
60131
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
59973
60132
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
59974
|
-
const
|
|
59975
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60133
|
+
const recordIndex = table.getRecordShowIndexByCell(col, row),
|
|
59976
60134
|
{
|
|
59977
60135
|
field: field
|
|
59978
60136
|
} = table.internalProps.layoutMap.getBody(col, row),
|
|
59979
60137
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
59980
60138
|
oldValue = table.getCellOriginValue(col, row);
|
|
59981
|
-
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value,
|
|
60139
|
+
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
|
|
59982
60140
|
const range = table.getCellRange(col, row),
|
|
59983
60141
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
59984
60142
|
if (aggregators) {
|
|
@@ -60001,24 +60159,16 @@
|
|
|
60001
60159
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
60002
60160
|
}
|
|
60003
60161
|
const changedValue = table.getCellOriginValue(col, row);
|
|
60004
|
-
|
|
60005
|
-
|
|
60006
|
-
|
|
60007
|
-
|
|
60008
|
-
|
|
60009
|
-
|
|
60010
|
-
|
|
60011
|
-
currentValue: oldValue,
|
|
60012
|
-
changedValue: changedValue
|
|
60013
|
-
};
|
|
60014
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
60015
|
-
values: [changeValue]
|
|
60016
|
-
});
|
|
60017
|
-
}
|
|
60018
|
-
table.scenegraph.updateNextFrame();
|
|
60162
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
60163
|
+
col: col,
|
|
60164
|
+
row: row,
|
|
60165
|
+
rawValue: beforeChangeValue,
|
|
60166
|
+
currentValue: oldValue,
|
|
60167
|
+
changedValue: changedValue
|
|
60168
|
+
}), table.scenegraph.updateNextFrame();
|
|
60019
60169
|
}
|
|
60020
60170
|
}
|
|
60021
|
-
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table
|
|
60171
|
+
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
60022
60172
|
var _a, _b;
|
|
60023
60173
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60024
60174
|
const changedCellResults = [];
|
|
@@ -60040,7 +60190,6 @@
|
|
|
60040
60190
|
oldRowValues.push(oldValue);
|
|
60041
60191
|
}
|
|
60042
60192
|
}
|
|
60043
|
-
const resultChangeValues = [];
|
|
60044
60193
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
60045
60194
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
60046
60195
|
const rowValues = values[i];
|
|
@@ -60064,34 +60213,25 @@
|
|
|
60064
60213
|
if (isCanChange) {
|
|
60065
60214
|
changedCellResults[i][j] = !0;
|
|
60066
60215
|
const value = rowValues[j],
|
|
60067
|
-
|
|
60068
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60216
|
+
recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
60069
60217
|
{
|
|
60070
60218
|
field: field
|
|
60071
60219
|
} = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
|
|
60072
60220
|
beforeChangeValue = beforeChangeValues[i][j],
|
|
60073
60221
|
oldValue = oldValues[i][j];
|
|
60074
|
-
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value,
|
|
60222
|
+
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);
|
|
60075
60223
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
60076
|
-
|
|
60077
|
-
|
|
60078
|
-
|
|
60079
|
-
|
|
60080
|
-
|
|
60081
|
-
|
|
60082
|
-
|
|
60083
|
-
currentValue: oldValue,
|
|
60084
|
-
changedValue: changedValue
|
|
60085
|
-
};
|
|
60086
|
-
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
60087
|
-
}
|
|
60224
|
+
oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
60225
|
+
col: startCol + j,
|
|
60226
|
+
row: startRow + i,
|
|
60227
|
+
rawValue: beforeChangeValue,
|
|
60228
|
+
currentValue: oldValue,
|
|
60229
|
+
changedValue: changedValue
|
|
60230
|
+
});
|
|
60088
60231
|
} else changedCellResults[i][j] = !1;
|
|
60089
60232
|
}
|
|
60090
60233
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
60091
60234
|
}
|
|
60092
|
-
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
60093
|
-
values: resultChangeValues
|
|
60094
|
-
});
|
|
60095
60235
|
const startRange = table.getCellRange(startCol, startRow),
|
|
60096
60236
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
60097
60237
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -60125,58 +60265,6 @@
|
|
|
60125
60265
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
60126
60266
|
});
|
|
60127
60267
|
}
|
|
60128
|
-
function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
60129
|
-
var _a, _b;
|
|
60130
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
60131
|
-
const resultChangeValues = [],
|
|
60132
|
-
processed = new Set(),
|
|
60133
|
-
nextValue = null != value ? value : "";
|
|
60134
|
-
for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
|
|
60135
|
-
const range = ranges[i],
|
|
60136
|
-
startCol = Math.min(range.start.col, range.end.col),
|
|
60137
|
-
endCol = Math.max(range.start.col, range.end.col),
|
|
60138
|
-
startRow = Math.min(range.start.row, range.end.row),
|
|
60139
|
-
endRow = Math.max(range.start.row, range.end.row);
|
|
60140
|
-
if (startCol > endCol || startRow > endRow) continue;
|
|
60141
|
-
const values = [],
|
|
60142
|
-
oldValues = [];
|
|
60143
|
-
for (let row = startRow; row <= endRow; row++) {
|
|
60144
|
-
const rowValues = [],
|
|
60145
|
-
rowOldValues = [];
|
|
60146
|
-
for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
|
|
60147
|
-
values.push(rowValues), oldValues.push(rowOldValues);
|
|
60148
|
-
}
|
|
60149
|
-
const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
|
|
60150
|
-
for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
|
|
60151
|
-
const col = startCol + c,
|
|
60152
|
-
row = startRow + r,
|
|
60153
|
-
key = `${col},${row}`;
|
|
60154
|
-
if (processed.has(key)) continue;
|
|
60155
|
-
if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
|
|
60156
|
-
const oldValue = oldValues[r][c],
|
|
60157
|
-
changedValue = table.getCellOriginValue(col, row);
|
|
60158
|
-
if (oldValue === changedValue) continue;
|
|
60159
|
-
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
60160
|
-
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60161
|
-
{
|
|
60162
|
-
field: field
|
|
60163
|
-
} = table.internalProps.layoutMap.getBody(col, row);
|
|
60164
|
-
resultChangeValues.push({
|
|
60165
|
-
col: col,
|
|
60166
|
-
row: row,
|
|
60167
|
-
recordIndex: recordIndex,
|
|
60168
|
-
field: field,
|
|
60169
|
-
rawValue: oldValue,
|
|
60170
|
-
currentValue: oldValue,
|
|
60171
|
-
changedValue: changedValue
|
|
60172
|
-
});
|
|
60173
|
-
}
|
|
60174
|
-
}
|
|
60175
|
-
!silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
60176
|
-
values: resultChangeValues
|
|
60177
|
-
});
|
|
60178
|
-
});
|
|
60179
|
-
}
|
|
60180
60268
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
60181
60269
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
60182
60270
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -60194,16 +60282,13 @@
|
|
|
60194
60282
|
}), table.dataSource.sort(sortState));
|
|
60195
60283
|
}
|
|
60196
60284
|
function listTableAddRecord(record, recordIndex, table) {
|
|
60197
|
-
var _a, _b, _c, _d
|
|
60285
|
+
var _a, _b, _c, _d;
|
|
60198
60286
|
try {
|
|
60199
60287
|
if (!record) return !1;
|
|
60200
|
-
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) {
|
|
60201
|
-
!!(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();
|
|
60202
|
-
} else {
|
|
60288
|
+
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 {
|
|
60203
60289
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
60204
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
60205
|
-
|
|
60206
|
-
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;
|
|
60290
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
60291
|
+
table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
|
|
60207
60292
|
const oldRowCount = table.rowCount;
|
|
60208
60293
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60209
60294
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -60272,16 +60357,13 @@
|
|
|
60272
60357
|
}
|
|
60273
60358
|
}
|
|
60274
60359
|
function listTableAddRecords(records, recordIndex, table) {
|
|
60275
|
-
var _a, _b, _c, _d
|
|
60360
|
+
var _a, _b, _c, _d;
|
|
60276
60361
|
try {
|
|
60277
60362
|
if (!records || 0 === records.length) return !1;
|
|
60278
|
-
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) {
|
|
60279
|
-
!!(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();
|
|
60280
|
-
} else {
|
|
60363
|
+
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 {
|
|
60281
60364
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
60282
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
60283
|
-
|
|
60284
|
-
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;
|
|
60365
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
60366
|
+
table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
|
|
60285
60367
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
60286
60368
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60287
60369
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -60350,20 +60432,16 @@
|
|
|
60350
60432
|
}
|
|
60351
60433
|
}
|
|
60352
60434
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
60353
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
60435
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
60354
60436
|
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) {
|
|
60355
60437
|
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
60356
60438
|
if (0 === deletedRecordIndexs.length) return;
|
|
60357
60439
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
60358
60440
|
table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
60359
|
-
} else if (table.sortState) {
|
|
60360
|
-
|
|
60361
|
-
} else {
|
|
60362
|
-
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
60363
|
-
deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
60441
|
+
} else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
|
|
60442
|
+
const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
|
|
60364
60443
|
if (0 === deletedRecordIndexs.length) return;
|
|
60365
60444
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
60366
|
-
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
60367
60445
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
60368
60446
|
table.refreshRowColCount();
|
|
60369
60447
|
const newRowCount = table.transpose ? table.colCount : table.rowCount,
|
|
@@ -60401,7 +60479,7 @@
|
|
|
60401
60479
|
col: 0,
|
|
60402
60480
|
row: row
|
|
60403
60481
|
});
|
|
60404
|
-
null === (
|
|
60482
|
+
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();
|
|
60405
60483
|
}
|
|
60406
60484
|
} else {
|
|
60407
60485
|
const delRows = [],
|
|
@@ -60433,19 +60511,15 @@
|
|
|
60433
60511
|
col: 0,
|
|
60434
60512
|
row: row
|
|
60435
60513
|
});
|
|
60436
|
-
null === (
|
|
60514
|
+
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();
|
|
60437
60515
|
}
|
|
60438
60516
|
}
|
|
60439
60517
|
}
|
|
60440
60518
|
function listTableUpdateRecords(records, recordIndexs, table) {
|
|
60441
|
-
var _a, _b, _c, _d
|
|
60442
|
-
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) {
|
|
60443
|
-
|
|
60444
|
-
} else {
|
|
60445
|
-
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
60446
|
-
updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
60519
|
+
var _a, _b, _c, _d;
|
|
60520
|
+
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 {
|
|
60521
|
+
const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
|
|
60447
60522
|
if (0 === updateRecordIndexs.length) return;
|
|
60448
|
-
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
60449
60523
|
const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
|
|
60450
60524
|
if (table.pagination) {
|
|
60451
60525
|
const {
|
|
@@ -61211,8 +61285,8 @@
|
|
|
61211
61285
|
updateFilterRules(filterRules, options = {
|
|
61212
61286
|
clearRowHeightCache: !0
|
|
61213
61287
|
}) {
|
|
61214
|
-
var _a
|
|
61215
|
-
this.scenegraph.clearCells(),
|
|
61288
|
+
var _a;
|
|
61289
|
+
this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules, null == options ? void 0 : options.onFilterRecordsEnd), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!(null == options ? void 0 : options.clearRowHeightCache)), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), this.resize();
|
|
61216
61290
|
}
|
|
61217
61291
|
getFilteredRecords() {
|
|
61218
61292
|
return this.dataSource.records;
|
|
@@ -61354,165 +61428,43 @@
|
|
|
61354
61428
|
}
|
|
61355
61429
|
return isValid$1(editorDefine);
|
|
61356
61430
|
}
|
|
61357
|
-
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0
|
|
61358
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this
|
|
61359
|
-
}
|
|
61360
|
-
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61361
|
-
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61362
|
-
}
|
|
61363
|
-
changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61364
|
-
return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61365
|
-
}
|
|
61366
|
-
changeSourceCellValue(recordIndex, field, value) {
|
|
61367
|
-
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
61368
|
-
cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
61369
|
-
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
|
|
61370
|
-
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
61371
|
-
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
|
|
61372
|
-
oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
|
|
61373
|
-
changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
61374
|
-
if (oldValue !== changedValue) {
|
|
61375
|
-
const changeValue = {
|
|
61376
|
-
col: cellAddr.col,
|
|
61377
|
-
row: cellAddr.row,
|
|
61378
|
-
recordIndex: recordIndex,
|
|
61379
|
-
field: field,
|
|
61380
|
-
rawValue: beforeChangeValue,
|
|
61381
|
-
currentValue: oldValue,
|
|
61382
|
-
changedValue: changedValue
|
|
61383
|
-
};
|
|
61384
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61385
|
-
values: [changeValue]
|
|
61386
|
-
});
|
|
61387
|
-
}
|
|
61388
|
-
}
|
|
61389
|
-
changeCellValueByRecord(recordIndex, field, value, options) {
|
|
61390
|
-
var _a, _b, _c, _d, _e;
|
|
61391
|
-
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
61392
|
-
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
61393
|
-
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
61394
|
-
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
61395
|
-
let record, oldValue;
|
|
61396
|
-
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;
|
|
61397
|
-
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
61398
|
-
if (oldValue !== changedValue) {
|
|
61399
|
-
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
|
|
61400
|
-
changeValue = {
|
|
61401
|
-
col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
|
|
61402
|
-
row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
|
|
61403
|
-
recordIndex: recordIndex,
|
|
61404
|
-
field: field,
|
|
61405
|
-
rawValue: oldValue,
|
|
61406
|
-
currentValue: oldValue,
|
|
61407
|
-
changedValue: changedValue
|
|
61408
|
-
};
|
|
61409
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61410
|
-
values: [changeValue]
|
|
61411
|
-
});
|
|
61412
|
-
}
|
|
61413
|
-
autoRefresh && this.refreshAfterSourceChange();
|
|
61414
|
-
}
|
|
61415
|
-
changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61416
|
-
return this.changeCellValueByRecord(recordIndex, field, value, {
|
|
61417
|
-
triggerEvent: triggerEvent,
|
|
61418
|
-
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
61419
|
-
autoRefresh: !0
|
|
61420
|
-
});
|
|
61431
|
+
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
|
|
61432
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
61421
61433
|
}
|
|
61422
|
-
|
|
61423
|
-
|
|
61424
|
-
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
61425
|
-
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
61426
|
-
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
61427
|
-
resultChangeValues = [];
|
|
61428
|
-
for (let i = 0; i < changeValues.length; i++) {
|
|
61429
|
-
const {
|
|
61430
|
-
recordIndex: recordIndex,
|
|
61431
|
-
field: field,
|
|
61432
|
-
value: value
|
|
61433
|
-
} = changeValues[i],
|
|
61434
|
-
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
61435
|
-
let record, oldValue;
|
|
61436
|
-
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) {
|
|
61437
|
-
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
61438
|
-
if (oldValue !== changedValue) {
|
|
61439
|
-
const changeValue = {
|
|
61440
|
-
col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
|
|
61441
|
-
row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
|
|
61442
|
-
recordIndex: recordIndex,
|
|
61443
|
-
field: field,
|
|
61444
|
-
rawValue: oldValue,
|
|
61445
|
-
currentValue: oldValue,
|
|
61446
|
-
changedValue: changedValue
|
|
61447
|
-
};
|
|
61448
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
61449
|
-
}
|
|
61450
|
-
}
|
|
61451
|
-
}
|
|
61452
|
-
!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61453
|
-
values: resultChangeValues
|
|
61454
|
-
}), autoRefresh && this.refreshAfterSourceChange();
|
|
61455
|
-
}
|
|
61456
|
-
changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61457
|
-
return this.changeCellValuesByRecords(changeValues, {
|
|
61458
|
-
triggerEvent: triggerEvent,
|
|
61459
|
-
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
61460
|
-
autoRefresh: !0
|
|
61461
|
-
});
|
|
61462
|
-
}
|
|
61463
|
-
refreshAfterSourceChange(options) {
|
|
61464
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
61465
|
-
const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
|
|
61466
|
-
reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
|
|
61467
|
-
clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
|
|
61468
|
-
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);
|
|
61469
|
-
const traverseColumns = columns => {
|
|
61470
|
-
var _a, _b, _c, _d;
|
|
61471
|
-
for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
|
|
61472
|
-
const column = columns[i],
|
|
61473
|
-
aggregators = null == column ? void 0 : column.vtable_aggregator;
|
|
61474
|
-
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);
|
|
61475
|
-
(null == column ? void 0 : column.columns) && traverseColumns(column.columns);
|
|
61476
|
-
}
|
|
61477
|
-
};
|
|
61478
|
-
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();
|
|
61434
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
|
|
61435
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
|
|
61479
61436
|
}
|
|
61480
|
-
addRecord(record, recordIndex
|
|
61437
|
+
addRecord(record, recordIndex) {
|
|
61481
61438
|
var _a;
|
|
61482
61439
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
61483
|
-
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(),
|
|
61440
|
+
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61484
61441
|
records: [record],
|
|
61485
61442
|
recordIndex: recordIndex,
|
|
61486
61443
|
recordCount: 1
|
|
61487
61444
|
});
|
|
61488
61445
|
}
|
|
61489
|
-
addRecords(records, recordIndex
|
|
61446
|
+
addRecords(records, recordIndex) {
|
|
61490
61447
|
var _a;
|
|
61491
61448
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
61492
|
-
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(),
|
|
61449
|
+
"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, {
|
|
61493
61450
|
records: records,
|
|
61494
61451
|
recordIndex: recordIndex,
|
|
61495
61452
|
recordCount: records.length
|
|
61496
61453
|
});
|
|
61497
61454
|
}
|
|
61498
|
-
deleteRecords(recordIndexs
|
|
61455
|
+
deleteRecords(recordIndexs) {
|
|
61499
61456
|
var _a;
|
|
61500
|
-
|
|
61501
|
-
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
61502
|
-
let record = null;
|
|
61503
|
-
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
61504
|
-
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
61457
|
+
listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
61505
61458
|
const rowIndexs = [];
|
|
61506
61459
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
61507
|
-
|
|
61460
|
+
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
61508
61461
|
recordIndexs: recordIndexs,
|
|
61509
|
-
records: deletedRecords,
|
|
61510
61462
|
rowIndexs: rowIndexs,
|
|
61511
61463
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
61512
61464
|
});
|
|
61513
61465
|
}
|
|
61514
|
-
updateRecords(records, recordIndexs
|
|
61515
|
-
listTableUpdateRecords(records, recordIndexs, this),
|
|
61466
|
+
updateRecords(records, recordIndexs) {
|
|
61467
|
+
listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
61516
61468
|
records: records,
|
|
61517
61469
|
recordIndexs: recordIndexs,
|
|
61518
61470
|
updateCount: records.length
|