@visactor/vtable-calendar 1.22.11-alpha.6 → 1.22.11-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vtable-calendar.js +559 -413
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -34616,24 +34616,6 @@
|
|
|
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
|
-
}
|
|
34637
34619
|
function pad(num, totalChars) {
|
|
34638
34620
|
for (num = `${num}`; num.length < totalChars;) num = "0" + num;
|
|
34639
34621
|
return num;
|
|
@@ -34897,6 +34879,7 @@
|
|
|
34897
34879
|
AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
|
|
34898
34880
|
AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
|
|
34899
34881
|
CHANGE_CELL_VALUE: "change_cell_value",
|
|
34882
|
+
CHANGE_CELL_VALUES: "change_cell_values",
|
|
34900
34883
|
DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
|
|
34901
34884
|
MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
|
|
34902
34885
|
DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
|
|
@@ -37015,6 +36998,24 @@
|
|
|
37015
36998
|
}
|
|
37016
36999
|
}
|
|
37017
37000
|
}
|
|
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
|
+
}
|
|
37018
37019
|
cacheBeforeChangedRecord(dataIndex, table) {
|
|
37019
37020
|
var _a;
|
|
37020
37021
|
if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
|
|
@@ -37030,41 +37031,82 @@
|
|
|
37030
37031
|
Array.isArray(indexed) || this.records.splice(indexed, 1, record);
|
|
37031
37032
|
}
|
|
37032
37033
|
}
|
|
37033
|
-
|
|
37034
|
+
_getRawRecordsArray() {
|
|
37034
37035
|
var _a;
|
|
37035
|
-
|
|
37036
|
-
|
|
37037
|
-
|
|
37038
|
-
|
|
37039
|
-
|
|
37040
|
-
|
|
37041
|
-
|
|
37042
|
-
|
|
37043
|
-
|
|
37044
|
-
|
|
37045
|
-
|
|
37046
|
-
|
|
37036
|
+
const rawRecords = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records;
|
|
37037
|
+
return Array.isArray(rawRecords) ? rawRecords : null;
|
|
37038
|
+
}
|
|
37039
|
+
_hasFilterInEffect() {
|
|
37040
|
+
var _a, _b, _c, _d, _e;
|
|
37041
|
+
return (null !== (_c = null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) >= 1 || (null !== (_e = null === (_d = this.lastFilterRules) || void 0 === _d ? void 0 : _d.length) && void 0 !== _e ? _e : 0) >= 1;
|
|
37042
|
+
}
|
|
37043
|
+
_normalizeInsertIndex(index, length) {
|
|
37044
|
+
return null == index || index > length ? length : index < 0 ? 0 : index;
|
|
37045
|
+
}
|
|
37046
|
+
_mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
|
|
37047
|
+
if (viewIndex >= this.records.length) return rawRecords.length;
|
|
37048
|
+
if (viewIndex <= 0) return 0;
|
|
37049
|
+
const prevRecord = this.records[viewIndex - 1],
|
|
37050
|
+
rawIndex = rawRecords.indexOf(prevRecord);
|
|
37051
|
+
return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
|
|
37052
|
+
}
|
|
37053
|
+
_resetIndexingFromViewRecords() {
|
|
37054
|
+
if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
|
|
37055
|
+
length: this._sourceLength
|
|
37056
|
+
}, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
|
|
37057
|
+
this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37058
|
+
}
|
|
37059
|
+
addRecord(record, index, syncToOriginalRecords = !1) {
|
|
37060
|
+
var _a, _b, _c;
|
|
37061
|
+
if (!syncToOriginalRecords) {
|
|
37062
|
+
if (Array.isArray(this.records)) {
|
|
37063
|
+
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
37064
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
37065
|
+
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
37066
|
+
this.pagination.totalCount = this._sourceLength;
|
|
37067
|
+
const {
|
|
37068
|
+
perPageCount: perPageCount,
|
|
37069
|
+
currentPage: currentPage
|
|
37070
|
+
} = this.pagination;
|
|
37071
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
37072
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37073
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
37074
|
+
}
|
|
37075
|
+
return;
|
|
37047
37076
|
}
|
|
37077
|
+
const rawRecords = this._getRawRecordsArray();
|
|
37078
|
+
if (!rawRecords) return;
|
|
37079
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
37080
|
+
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
37081
|
+
rawRecords.splice(rawInsertIndex, 0, record), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, 1);
|
|
37048
37082
|
}
|
|
37049
|
-
addRecords(recordArr, index) {
|
|
37050
|
-
var _a;
|
|
37051
|
-
if (
|
|
37052
|
-
if (Array.isArray(
|
|
37053
|
-
|
|
37054
|
-
|
|
37055
|
-
|
|
37056
|
-
|
|
37083
|
+
addRecords(recordArr, index, syncToOriginalRecords = !1) {
|
|
37084
|
+
var _a, _b, _c;
|
|
37085
|
+
if (!syncToOriginalRecords) {
|
|
37086
|
+
if (Array.isArray(this.records)) {
|
|
37087
|
+
if (Array.isArray(recordArr)) {
|
|
37088
|
+
this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
37089
|
+
for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
|
|
37090
|
+
this._sourceLength += recordArr.length;
|
|
37091
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
37092
|
+
}
|
|
37093
|
+
if (this.userPagination) {
|
|
37094
|
+
this.pagination.totalCount = this._sourceLength;
|
|
37095
|
+
const {
|
|
37096
|
+
perPageCount: perPageCount,
|
|
37097
|
+
currentPage: currentPage
|
|
37098
|
+
} = this.pagination;
|
|
37099
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
37100
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
|
|
37101
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
37057
37102
|
}
|
|
37058
|
-
|
|
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);
|
|
37103
|
+
return;
|
|
37067
37104
|
}
|
|
37105
|
+
const rawRecords = this._getRawRecordsArray();
|
|
37106
|
+
if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
|
|
37107
|
+
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
|
|
37108
|
+
rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
37109
|
+
rawRecords.splice(rawInsertIndex, 0, ...recordArr), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, recordArr.length);
|
|
37068
37110
|
}
|
|
37069
37111
|
addRecordForSorted(record) {
|
|
37070
37112
|
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));
|
|
@@ -37080,27 +37122,49 @@
|
|
|
37080
37122
|
}
|
|
37081
37123
|
}
|
|
37082
37124
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
|
|
37083
|
-
|
|
37084
|
-
|
|
37085
|
-
|
|
37086
|
-
|
|
37087
|
-
|
|
37088
|
-
|
|
37089
|
-
|
|
37090
|
-
|
|
37091
|
-
|
|
37092
|
-
|
|
37093
|
-
|
|
37094
|
-
|
|
37095
|
-
|
|
37096
|
-
|
|
37097
|
-
|
|
37098
|
-
|
|
37099
|
-
|
|
37125
|
+
const delta = "add" === type ? insertCount : -insertCount,
|
|
37126
|
+
numericKeys = [];
|
|
37127
|
+
this.beforeChangedRecordsMap.forEach((_, key) => {
|
|
37128
|
+
const numKey = Number(key);
|
|
37129
|
+
Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
|
|
37130
|
+
}), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
|
|
37131
|
+
for (let i = 0; i < numericKeys.length; i++) {
|
|
37132
|
+
const key = numericKeys[i],
|
|
37133
|
+
record = this.beforeChangedRecordsMap.get(key.toString());
|
|
37134
|
+
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
37135
|
+
}
|
|
37136
|
+
}
|
|
37137
|
+
deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
|
|
37138
|
+
var _a, _b, _c;
|
|
37139
|
+
if (!syncToOriginalRecords) {
|
|
37140
|
+
if (Array.isArray(this.records)) {
|
|
37141
|
+
const realDeletedRecordIndexs = [],
|
|
37142
|
+
recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
37143
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
37144
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
37145
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
37146
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
37147
|
+
const deletedRecord = this.records[recordIndex];
|
|
37148
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
37149
|
+
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
37150
|
+
}
|
|
37151
|
+
return this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs), realDeletedRecordIndexs;
|
|
37100
37152
|
}
|
|
37101
|
-
return
|
|
37153
|
+
return [];
|
|
37102
37154
|
}
|
|
37103
|
-
|
|
37155
|
+
const rawRecords = this._getRawRecordsArray();
|
|
37156
|
+
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
37157
|
+
const realDeletedRecordIndexs = [],
|
|
37158
|
+
recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
|
|
37159
|
+
rawDeletedIndexs = [];
|
|
37160
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
37161
|
+
const viewIndex = recordIndexsMaxToMin[index];
|
|
37162
|
+
if (viewIndex >= this.records.length || viewIndex < 0) continue;
|
|
37163
|
+
const deletedRecord = this.records[viewIndex],
|
|
37164
|
+
rawIndex = rawRecords.indexOf(deletedRecord);
|
|
37165
|
+
rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
|
|
37166
|
+
}
|
|
37167
|
+
return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.deleted) && this.dataSourceObj.deleted(rawDeletedIndexs), realDeletedRecordIndexs;
|
|
37104
37168
|
}
|
|
37105
37169
|
deleteRecordsForSorted(recordIndexs) {
|
|
37106
37170
|
if (Array.isArray(this.records)) {
|
|
@@ -37114,18 +37178,34 @@
|
|
|
37114
37178
|
this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
|
|
37115
37179
|
}
|
|
37116
37180
|
}
|
|
37117
|
-
updateRecords(records, recordIndexs) {
|
|
37118
|
-
|
|
37181
|
+
updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
|
|
37182
|
+
var _a;
|
|
37183
|
+
if (!syncToOriginalRecords) {
|
|
37184
|
+
const realDeletedRecordIndexs = [];
|
|
37185
|
+
for (let index = 0; index < recordIndexs.length; index++) {
|
|
37186
|
+
const recordIndex = recordIndexs[index];
|
|
37187
|
+
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), this.records)[recordIndex[recordIndex.length - 1]] = records[index];else {
|
|
37188
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
37189
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
37190
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
37191
|
+
this.records[recordIndex] = records[index];
|
|
37192
|
+
}
|
|
37193
|
+
}
|
|
37194
|
+
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
37195
|
+
}
|
|
37196
|
+
const rawRecords = this._getRawRecordsArray();
|
|
37197
|
+
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
37198
|
+
const realUpdatedIndexs = [];
|
|
37119
37199
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
37120
37200
|
const recordIndex = recordIndexs[index];
|
|
37121
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
37122
|
-
if (recordIndex >= this.
|
|
37123
|
-
this.
|
|
37124
|
-
|
|
37125
|
-
|
|
37201
|
+
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realUpdatedIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), rawRecords)[recordIndex[recordIndex.length - 1]] = records[index];else {
|
|
37202
|
+
if (recordIndex >= this.records.length || recordIndex < 0) continue;
|
|
37203
|
+
const oldRecord = this.records[recordIndex],
|
|
37204
|
+
rawIndex = rawRecords.indexOf(oldRecord);
|
|
37205
|
+
rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
|
|
37126
37206
|
}
|
|
37127
37207
|
}
|
|
37128
|
-
return this.
|
|
37208
|
+
return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
|
|
37129
37209
|
}
|
|
37130
37210
|
updateRecordsForSorted(records, recordIndexs) {
|
|
37131
37211
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
@@ -43759,35 +43839,11 @@
|
|
|
43759
43839
|
return hoverMode;
|
|
43760
43840
|
}
|
|
43761
43841
|
|
|
43762
|
-
let brushingChartInstance,
|
|
43763
|
-
brushingChartInstanceCellPos = {
|
|
43764
|
-
col: -1,
|
|
43765
|
-
row: -1
|
|
43766
|
-
};
|
|
43767
|
-
function setBrushingChartInstance(chartInstance, col, row) {
|
|
43768
|
-
brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
|
|
43769
|
-
col: col,
|
|
43770
|
-
row: row
|
|
43771
|
-
};
|
|
43772
|
-
}
|
|
43773
|
-
function clearBrushingChartInstance() {
|
|
43774
|
-
brushingChartInstance = void 0, brushingChartInstanceCellPos = {
|
|
43775
|
-
col: -1,
|
|
43776
|
-
row: -1
|
|
43777
|
-
};
|
|
43778
|
-
}
|
|
43779
|
-
function getBrushingChartInstance() {
|
|
43780
|
-
return brushingChartInstance;
|
|
43781
|
-
}
|
|
43782
|
-
function getBrushingChartInstanceCellPos() {
|
|
43783
|
-
return brushingChartInstanceCellPos;
|
|
43784
|
-
}
|
|
43785
43842
|
const chartInstanceListColumnByColumnDirection = {};
|
|
43786
43843
|
const chartInstanceListRowByRowDirection = {};
|
|
43787
|
-
const delayRunDimensionHoverTimer = [];
|
|
43788
43844
|
function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
43789
43845
|
var _a;
|
|
43790
|
-
|
|
43846
|
+
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43791
43847
|
const {
|
|
43792
43848
|
rowStart: rowStart
|
|
43793
43849
|
} = table.getBodyVisibleRowRange();
|
|
@@ -43796,40 +43852,76 @@
|
|
|
43796
43852
|
for (let i = rowStart; i <= rowEnd; i++) {
|
|
43797
43853
|
const cellGroup = table.scenegraph.getCell(col, i),
|
|
43798
43854
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43799
|
-
chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.
|
|
43800
|
-
|
|
43801
|
-
var _a, _b, _c, _d;
|
|
43855
|
+
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
|
|
43856
|
+
var _a, _b, _c, _d, _e, _f;
|
|
43802
43857
|
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43803
43858
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43804
43859
|
let isShowTooltip = !isScatter;
|
|
43805
|
-
if (isScatter
|
|
43806
|
-
const
|
|
43807
|
-
|
|
43860
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
|
|
43861
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
|
|
43862
|
+
{
|
|
43863
|
+
rowEnd: rowEnd1
|
|
43864
|
+
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
43865
|
+
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
43866
|
+
const {
|
|
43867
|
+
rowEnd: rowEnd2
|
|
43868
|
+
} = table.getBodyVisibleRowRange(0, 5);
|
|
43869
|
+
isShowTooltip = rowEnd2 !== rowEnd;
|
|
43870
|
+
}
|
|
43871
|
+
} else if (i === rowStart && isShowTooltip) {
|
|
43872
|
+
const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
|
|
43873
|
+
{
|
|
43874
|
+
rowStart: rowStart1
|
|
43875
|
+
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
43876
|
+
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
43877
|
+
const {
|
|
43878
|
+
rowStart: rowStart2
|
|
43879
|
+
} = table.getBodyVisibleRowRange(0, -5);
|
|
43880
|
+
isShowTooltip = rowStart2 !== rowStart;
|
|
43881
|
+
}
|
|
43882
|
+
}
|
|
43883
|
+
if (isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_f = (_e = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _f || _f.call(_e, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
43884
|
+
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
43808
43885
|
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
43809
43886
|
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43810
43887
|
tooltip: !1,
|
|
43811
43888
|
showTooltipOption: {
|
|
43812
|
-
x: canvasXY.x
|
|
43813
|
-
y: absolutePositionTop
|
|
43889
|
+
x: canvasXY.x,
|
|
43890
|
+
y: absolutePositionTop,
|
|
43814
43891
|
activeType: "dimension"
|
|
43815
43892
|
}
|
|
43816
43893
|
})) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43817
43894
|
tooltip: isShowTooltip,
|
|
43818
43895
|
showTooltipOption: {
|
|
43819
|
-
x: canvasXY.x
|
|
43820
|
-
y: absolutePositionTop
|
|
43896
|
+
x: canvasXY.x,
|
|
43897
|
+
y: absolutePositionTop,
|
|
43821
43898
|
activeType: "dimension"
|
|
43822
43899
|
}
|
|
43823
43900
|
});
|
|
43824
43901
|
}
|
|
43825
43902
|
}
|
|
43826
|
-
}, 0);
|
|
43827
|
-
|
|
43903
|
+
}, 0), table.scenegraph.updateNextFrame();
|
|
43904
|
+
}
|
|
43905
|
+
}
|
|
43906
|
+
function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
|
|
43907
|
+
var _a;
|
|
43908
|
+
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
43909
|
+
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
43910
|
+
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
43911
|
+
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
43912
|
+
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43913
|
+
chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
|
|
43914
|
+
releaseChartInstance: !0,
|
|
43915
|
+
releaseColumnChartInstance: !1,
|
|
43916
|
+
releaseRowChartInstance: !1
|
|
43917
|
+
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
43918
|
+
}
|
|
43919
|
+
delete chartInstanceListColumnByColumnDirection[col];
|
|
43828
43920
|
}
|
|
43829
43921
|
}
|
|
43830
43922
|
function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
|
|
43831
43923
|
var _a;
|
|
43832
|
-
|
|
43924
|
+
isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
|
|
43833
43925
|
const {
|
|
43834
43926
|
colStart: colStart
|
|
43835
43927
|
} = table.getBodyVisibleColRange();
|
|
@@ -43838,162 +43930,64 @@
|
|
|
43838
43930
|
for (let i = colStart; i <= colEnd; i++) {
|
|
43839
43931
|
const cellGroup = table.scenegraph.getCell(i, row),
|
|
43840
43932
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43841
|
-
chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.
|
|
43842
|
-
const timer = setTimeout(() => {
|
|
43933
|
+
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
|
|
43843
43934
|
var _a, _b, _c, _d;
|
|
43844
43935
|
if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43845
43936
|
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43846
43937
|
let isShowTooltip = !isScatter;
|
|
43847
|
-
if (isScatter
|
|
43848
|
-
const
|
|
43849
|
-
|
|
43938
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
|
|
43939
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43940
|
+
{
|
|
43941
|
+
colEnd: colEnd1
|
|
43942
|
+
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
43943
|
+
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
43944
|
+
const {
|
|
43945
|
+
colEnd: colEnd2
|
|
43946
|
+
} = table.getBodyVisibleColRange(0, 5);
|
|
43947
|
+
isShowTooltip = colEnd2 !== colEnd;
|
|
43948
|
+
}
|
|
43949
|
+
} else if (i === colStart && isShowTooltip) {
|
|
43950
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43951
|
+
{
|
|
43952
|
+
colStart: colStart1
|
|
43953
|
+
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
43954
|
+
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
43955
|
+
const {
|
|
43956
|
+
colStart: colStart2
|
|
43957
|
+
} = table.getBodyVisibleColRange(0, -5);
|
|
43958
|
+
isShowTooltip = colStart2 !== colStart;
|
|
43959
|
+
}
|
|
43960
|
+
}
|
|
43961
|
+
if (isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
43962
|
+
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
43850
43963
|
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
43851
43964
|
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43852
43965
|
tooltip: !1,
|
|
43853
43966
|
showTooltipOption: {
|
|
43854
|
-
x: absolutePositionLeft
|
|
43855
|
-
y: canvasXY.y
|
|
43967
|
+
x: absolutePositionLeft,
|
|
43968
|
+
y: canvasXY.y,
|
|
43856
43969
|
activeType: "dimension"
|
|
43857
43970
|
}
|
|
43858
43971
|
})) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43859
43972
|
tooltip: isShowTooltip,
|
|
43860
43973
|
showTooltipOption: {
|
|
43861
|
-
x: absolutePositionLeft
|
|
43862
|
-
y: canvasXY.y
|
|
43974
|
+
x: absolutePositionLeft,
|
|
43975
|
+
y: canvasXY.y,
|
|
43863
43976
|
activeType: "dimension"
|
|
43864
43977
|
}
|
|
43865
43978
|
});
|
|
43866
43979
|
}
|
|
43867
43980
|
}
|
|
43868
|
-
}, 0);
|
|
43869
|
-
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
43870
|
-
}
|
|
43871
|
-
}
|
|
43872
|
-
function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
|
|
43873
|
-
var _a;
|
|
43874
|
-
clearDelayRunDimensionHoverTimers();
|
|
43875
|
-
const {
|
|
43876
|
-
rowStart: rowStart
|
|
43877
|
-
} = table.getBodyVisibleRowRange();
|
|
43878
|
-
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
43879
|
-
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
43880
|
-
const {
|
|
43881
|
-
colStart: colStart
|
|
43882
|
-
} = table.getBodyVisibleColRange();
|
|
43883
|
-
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
43884
|
-
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
43885
|
-
for (let col = colStart; col <= colEnd; col++) {
|
|
43886
|
-
isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
|
|
43887
|
-
for (let i = rowStart; i <= rowEnd; i++) {
|
|
43888
|
-
const cellGroup = table.scenegraph.getCell(col, i),
|
|
43889
|
-
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43890
|
-
chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
|
|
43891
|
-
const timer = setTimeout(() => {
|
|
43892
|
-
var _a, _b;
|
|
43893
|
-
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43894
|
-
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43895
|
-
let isShowTooltip = !0;
|
|
43896
|
-
"object" == typeof chartDimensionLinkage && (deactivate ? (chartInstanceListColumnByColumnDirection[col][i].setHovered(), chartInstanceListColumnByColumnDirection[col][i].hideTooltip()) : (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table), isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table), chartInstanceListColumnByColumnDirection[col][i].setHovered(datum), isShowTooltip && chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
|
|
43897
|
-
activeType: "mark"
|
|
43898
|
-
})));
|
|
43899
|
-
}
|
|
43900
|
-
}, 0);
|
|
43901
|
-
delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
|
|
43902
|
-
}
|
|
43903
|
-
}
|
|
43904
|
-
}
|
|
43905
|
-
function checkIsShowTooltipForEdgeRow(row, table) {
|
|
43906
|
-
var _a, _b;
|
|
43907
|
-
let isShowTooltip = !0;
|
|
43908
|
-
const {
|
|
43909
|
-
rowStart: rowStart
|
|
43910
|
-
} = table.getBodyVisibleRowRange();
|
|
43911
|
-
let rowEnd = table.getBodyVisibleRowRange().rowEnd;
|
|
43912
|
-
rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
|
|
43913
|
-
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43914
|
-
if (row === rowEnd && isShowTooltip) {
|
|
43915
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
|
|
43916
|
-
{
|
|
43917
|
-
rowEnd: rowEnd1
|
|
43918
|
-
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
43919
|
-
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
43920
|
-
const {
|
|
43921
|
-
rowEnd: rowEnd2
|
|
43922
|
-
} = table.getBodyVisibleRowRange(0, 5);
|
|
43923
|
-
isShowTooltip = rowEnd2 !== rowEnd;
|
|
43924
|
-
}
|
|
43925
|
-
} else if (row === rowStart && isShowTooltip) {
|
|
43926
|
-
const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
|
|
43927
|
-
{
|
|
43928
|
-
rowStart: rowStart1
|
|
43929
|
-
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
43930
|
-
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
43931
|
-
const {
|
|
43932
|
-
rowStart: rowStart2
|
|
43933
|
-
} = table.getBodyVisibleRowRange(0, -5);
|
|
43934
|
-
isShowTooltip = rowStart2 !== rowStart;
|
|
43935
|
-
}
|
|
43981
|
+
}, 0), table.scenegraph.updateNextFrame();
|
|
43936
43982
|
}
|
|
43937
|
-
return isShowTooltip;
|
|
43938
43983
|
}
|
|
43939
|
-
function
|
|
43940
|
-
let isShowTooltip = !0;
|
|
43941
|
-
const {
|
|
43942
|
-
colStart: colStart
|
|
43943
|
-
} = table.getBodyVisibleColRange();
|
|
43944
|
-
let colEnd = table.getBodyVisibleColRange().colEnd;
|
|
43945
|
-
colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
|
|
43946
|
-
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43947
|
-
if (col === colEnd && isShowTooltip) {
|
|
43948
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43949
|
-
{
|
|
43950
|
-
colEnd: colEnd1
|
|
43951
|
-
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
43952
|
-
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
43953
|
-
const {
|
|
43954
|
-
colEnd: colEnd2
|
|
43955
|
-
} = table.getBodyVisibleColRange(0, 5);
|
|
43956
|
-
isShowTooltip = colEnd2 !== colEnd;
|
|
43957
|
-
}
|
|
43958
|
-
} else if (col === colStart && isShowTooltip) {
|
|
43959
|
-
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43960
|
-
{
|
|
43961
|
-
colStart: colStart1
|
|
43962
|
-
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
43963
|
-
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
43964
|
-
const {
|
|
43965
|
-
colStart: colStart2
|
|
43966
|
-
} = table.getBodyVisibleColRange(0, -5);
|
|
43967
|
-
isShowTooltip = colStart2 !== colStart;
|
|
43968
|
-
}
|
|
43969
|
-
}
|
|
43970
|
-
return isShowTooltip;
|
|
43971
|
-
}
|
|
43972
|
-
function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
|
|
43973
|
-
var _a;
|
|
43974
|
-
if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
|
|
43975
|
-
for (const i in chartInstanceListColumnByColumnDirection[col]) {
|
|
43976
|
-
if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
|
|
43977
|
-
const cellGroup = table.scenegraph.getCell(col, Number(i)),
|
|
43978
|
-
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43979
|
-
isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
|
|
43980
|
-
forceRelease: forceRelease,
|
|
43981
|
-
releaseChartInstance: !0,
|
|
43982
|
-
releaseColumnChartInstance: !1,
|
|
43983
|
-
releaseRowChartInstance: !1
|
|
43984
|
-
}), chartInstanceListColumnByColumnDirection[col][i] = null);
|
|
43985
|
-
}
|
|
43986
|
-
delete chartInstanceListColumnByColumnDirection[col];
|
|
43987
|
-
}
|
|
43988
|
-
}
|
|
43989
|
-
function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
|
|
43984
|
+
function clearChartInstanceListByRowDirection(row, excludedCol, table) {
|
|
43990
43985
|
var _a;
|
|
43991
43986
|
if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
|
|
43992
43987
|
if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
|
|
43993
43988
|
const cellGroup = table.scenegraph.getCell(Number(i), row),
|
|
43994
43989
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43995
|
-
isValid$1(chartNode) && (chartNode.
|
|
43996
|
-
forceRelease: forceRelease,
|
|
43990
|
+
chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
|
|
43997
43991
|
releaseChartInstance: !0,
|
|
43998
43992
|
releaseColumnChartInstance: !1,
|
|
43999
43993
|
releaseRowChartInstance: !1
|
|
@@ -44001,15 +43995,6 @@
|
|
|
44001
43995
|
}
|
|
44002
43996
|
delete chartInstanceListRowByRowDirection[row];
|
|
44003
43997
|
}
|
|
44004
|
-
function clearDelayRunDimensionHoverTimers() {
|
|
44005
|
-
for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
|
|
44006
|
-
delayRunDimensionHoverTimer.length = 0;
|
|
44007
|
-
}
|
|
44008
|
-
function clearAllChartInstanceList(table, forceRelease = !1) {
|
|
44009
|
-
clearDelayRunDimensionHoverTimers();
|
|
44010
|
-
for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
|
|
44011
|
-
for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
|
|
44012
|
-
}
|
|
44013
43998
|
|
|
44014
43999
|
function isValidAlignDomain(domain) {
|
|
44015
44000
|
return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
|
|
@@ -44643,7 +44628,7 @@
|
|
|
44643
44628
|
const CHART_NUMBER_TYPE = genNumberType();
|
|
44644
44629
|
class Chart extends Rect$1 {
|
|
44645
44630
|
constructor(isShareChartSpec, params) {
|
|
44646
|
-
if (super(params), this.type = "chart", this.
|
|
44631
|
+
if (super(params), this.type = "chart", this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
|
|
44647
44632
|
const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
|
|
44648
44633
|
renderCanvas: params.canvas,
|
|
44649
44634
|
mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
|
|
@@ -44664,7 +44649,7 @@
|
|
|
44664
44649
|
}
|
|
44665
44650
|
}
|
|
44666
44651
|
activate(table) {
|
|
44667
|
-
var _a, _b, _c, _d, _e
|
|
44652
|
+
var _a, _b, _c, _d, _e;
|
|
44668
44653
|
if (this.activeChartInstance) return;
|
|
44669
44654
|
const {
|
|
44670
44655
|
col: col,
|
|
@@ -44683,7 +44668,7 @@
|
|
|
44683
44668
|
y1: y1 - table.scrollTop,
|
|
44684
44669
|
y2: y2 - table.scrollTop
|
|
44685
44670
|
});
|
|
44686
|
-
this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
|
|
44671
|
+
null === (_a = this.activeChartInstance) || void 0 === _a || _a.release(), this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
|
|
44687
44672
|
renderCanvas: this.attribute.canvas,
|
|
44688
44673
|
mode: "desktop-browser",
|
|
44689
44674
|
canvasControled: !1,
|
|
@@ -44717,7 +44702,7 @@
|
|
|
44717
44702
|
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());
|
|
44718
44703
|
}
|
|
44719
44704
|
},
|
|
44720
|
-
componentShowContent:
|
|
44705
|
+
componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
|
|
44721
44706
|
tooltip: {
|
|
44722
44707
|
dimension: !1,
|
|
44723
44708
|
mark: !0
|
|
@@ -44728,40 +44713,15 @@
|
|
|
44728
44713
|
const chartStage = this.activeChartInstance.getStage(),
|
|
44729
44714
|
matrix = this.globalTransMatrix.clone(),
|
|
44730
44715
|
stageMatrix = this.stage.window.getViewBoxTransform();
|
|
44731
|
-
let brushChangeThrottle;
|
|
44732
44716
|
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 => {
|
|
44733
44717
|
var _a;
|
|
44734
|
-
!1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null
|
|
44735
|
-
}), (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 => {
|
|
44736
|
-
var _a;
|
|
44737
|
-
brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
|
|
44738
|
-
})), this.activeChartInstance.on("brushStart", params => {
|
|
44739
|
-
const brushingChartInstance = getBrushingChartInstance();
|
|
44740
|
-
brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
|
|
44718
|
+
!1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum);
|
|
44741
44719
|
}), this.activeChartInstance.on("brushEnd", params => {
|
|
44742
44720
|
var _a;
|
|
44743
|
-
|
|
44721
|
+
table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
|
|
44744
44722
|
Chart.temp = 1;
|
|
44745
44723
|
}, 0);
|
|
44746
|
-
}),
|
|
44747
|
-
markName: "pie"
|
|
44748
|
-
}, params => {
|
|
44749
|
-
var _a;
|
|
44750
|
-
const categoryField = this.attribute.spec.categoryField,
|
|
44751
|
-
datum = {
|
|
44752
|
-
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
44753
|
-
};
|
|
44754
|
-
generateChartInstanceListByViewRange(datum, table, !1);
|
|
44755
|
-
}), this.activeChartInstance.on("pointerout", {
|
|
44756
|
-
markName: "pie"
|
|
44757
|
-
}, params => {
|
|
44758
|
-
var _a;
|
|
44759
|
-
const categoryField = this.attribute.spec.categoryField,
|
|
44760
|
-
datum = {
|
|
44761
|
-
[categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
|
|
44762
|
-
};
|
|
44763
|
-
generateChartInstanceListByViewRange(datum, table, !0);
|
|
44764
|
-
})), this.activeChartInstance.on("dimensionHover", params => {
|
|
44724
|
+
}), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
|
|
44765
44725
|
var _a, _b;
|
|
44766
44726
|
const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
|
|
44767
44727
|
canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
|
|
@@ -44824,23 +44784,21 @@
|
|
|
44824
44784
|
}
|
|
44825
44785
|
}
|
|
44826
44786
|
}
|
|
44827
|
-
})
|
|
44787
|
+
}), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
|
|
44828
44788
|
}
|
|
44829
44789
|
deactivate(table, {
|
|
44830
|
-
forceRelease = !1,
|
|
44831
44790
|
releaseChartInstance = !0,
|
|
44832
44791
|
releaseColumnChartInstance = !0,
|
|
44833
|
-
releaseRowChartInstance = !0
|
|
44834
|
-
releaseAllChartInstance = !1
|
|
44792
|
+
releaseRowChartInstance = !0
|
|
44835
44793
|
} = {}) {
|
|
44836
44794
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
44837
44795
|
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
|
|
44838
|
-
|
|
44796
|
+
null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
44839
44797
|
x1: -1e3,
|
|
44840
44798
|
x2: -800,
|
|
44841
44799
|
y1: -1e3,
|
|
44842
44800
|
y2: -800
|
|
44843
|
-
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null
|
|
44801
|
+
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
|
|
44844
44802
|
const {
|
|
44845
44803
|
col: col,
|
|
44846
44804
|
row: row
|
|
@@ -44853,7 +44811,7 @@
|
|
|
44853
44811
|
} = this.parent;
|
|
44854
44812
|
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));
|
|
44855
44813
|
}
|
|
44856
|
-
|
|
44814
|
+
releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table);
|
|
44857
44815
|
}
|
|
44858
44816
|
updateData(data) {
|
|
44859
44817
|
this.attribute.data = data;
|
|
@@ -44868,14 +44826,13 @@
|
|
|
44868
44826
|
y1: y1,
|
|
44869
44827
|
x2: x2,
|
|
44870
44828
|
y2: y2
|
|
44871
|
-
} = cellGroup.globalAABBBounds
|
|
44872
|
-
|
|
44873
|
-
|
|
44874
|
-
|
|
44875
|
-
|
|
44876
|
-
|
|
44877
|
-
|
|
44878
|
-
return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
|
|
44829
|
+
} = cellGroup.globalAABBBounds;
|
|
44830
|
+
return {
|
|
44831
|
+
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)),
|
|
44832
|
+
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)),
|
|
44833
|
+
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)),
|
|
44834
|
+
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))
|
|
44835
|
+
};
|
|
44879
44836
|
}
|
|
44880
44837
|
}
|
|
44881
44838
|
function getTableBounds(col, row, table) {
|
|
@@ -45090,7 +45047,7 @@
|
|
|
45090
45047
|
{
|
|
45091
45048
|
width = groupAttribute.width,
|
|
45092
45049
|
height = groupAttribute.height
|
|
45093
|
-
} = chart.attribute,
|
|
45050
|
+
} = (chart.getViewBox(), chart.attribute),
|
|
45094
45051
|
{
|
|
45095
45052
|
table: table
|
|
45096
45053
|
} = chart.getRootNode(),
|
|
@@ -45118,9 +45075,8 @@
|
|
|
45118
45075
|
});
|
|
45119
45076
|
}
|
|
45120
45077
|
}
|
|
45121
|
-
const
|
|
45122
|
-
|
|
45123
|
-
lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
|
|
45078
|
+
const viewBox = chart.getViewBox();
|
|
45079
|
+
activeChartInstance.updateViewBox({
|
|
45124
45080
|
x1: 0,
|
|
45125
45081
|
x2: viewBox.x2 - viewBox.x1,
|
|
45126
45082
|
y1: 0,
|
|
@@ -48638,10 +48594,9 @@
|
|
|
48638
48594
|
});
|
|
48639
48595
|
}
|
|
48640
48596
|
}
|
|
48641
|
-
function updateChartState(scenegraph, datum
|
|
48597
|
+
function updateChartState(scenegraph, datum) {
|
|
48642
48598
|
const table = scenegraph.table;
|
|
48643
48599
|
if (table.isPivotChart()) {
|
|
48644
|
-
table._selectedDataMode = selectedDataMode;
|
|
48645
48600
|
const preSelectItemsCount = table._selectedDataItemsInChart.length;
|
|
48646
48601
|
if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
|
|
48647
48602
|
const newSelectedDataItemsInChart = [];
|
|
@@ -49389,36 +49344,16 @@
|
|
|
49389
49344
|
resetResidentHoverIcon(col, row) {
|
|
49390
49345
|
resetResidentHoverIcon(col, row, this);
|
|
49391
49346
|
}
|
|
49392
|
-
deactivateChart(col, row
|
|
49393
|
-
var _a, _b, _c
|
|
49394
|
-
if (-1 === col || -1 === row)
|
|
49395
|
-
if (forceRelease) {
|
|
49396
|
-
const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
|
|
49397
|
-
cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
|
|
49398
|
-
(null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (clearBrushingChartInstance(), null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
|
|
49399
|
-
forceRelease: !0,
|
|
49400
|
-
releaseChartInstance: !0,
|
|
49401
|
-
releaseColumnChartInstance: !0,
|
|
49402
|
-
releaseRowChartInstance: !0,
|
|
49403
|
-
releaseAllChartInstance: !0
|
|
49404
|
-
}));
|
|
49405
|
-
}
|
|
49406
|
-
return;
|
|
49407
|
-
}
|
|
49347
|
+
deactivateChart(col, row) {
|
|
49348
|
+
var _a, _b, _c;
|
|
49349
|
+
if (-1 === col || -1 === row) return;
|
|
49408
49350
|
const cellGroup = this.getCell(col, row);
|
|
49409
|
-
if (null === (
|
|
49410
|
-
if (forceRelease) return clearBrushingChartInstance(), void (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _e ? void 0 : _e.deactivate) || void 0 === _f || _f.call(_e, this.table, {
|
|
49411
|
-
forceRelease: !0,
|
|
49412
|
-
releaseChartInstance: !0,
|
|
49413
|
-
releaseColumnChartInstance: !0,
|
|
49414
|
-
releaseRowChartInstance: !0,
|
|
49415
|
-
releaseAllChartInstance: !0
|
|
49416
|
-
}));
|
|
49351
|
+
if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
|
|
49417
49352
|
const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
|
|
49418
|
-
null === (
|
|
49419
|
-
releaseChartInstance: "
|
|
49420
|
-
releaseColumnChartInstance:
|
|
49421
|
-
releaseRowChartInstance:
|
|
49353
|
+
null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, this.table.options.chartDimensionLinkage ? {
|
|
49354
|
+
releaseChartInstance: "scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
|
|
49355
|
+
releaseColumnChartInstance: col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
|
|
49356
|
+
releaseRowChartInstance: row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
|
|
49422
49357
|
} : void 0);
|
|
49423
49358
|
}
|
|
49424
49359
|
}
|
|
@@ -49466,15 +49401,8 @@
|
|
|
49466
49401
|
updateChartSizeForResizeRowHeight(row) {
|
|
49467
49402
|
updateChartSizeForResizeRowHeight(this, row);
|
|
49468
49403
|
}
|
|
49469
|
-
updateChartState(datum
|
|
49470
|
-
|
|
49471
|
-
if (this.table.isPivotChart()) {
|
|
49472
|
-
if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
|
|
49473
|
-
const brushingChartInstance = getBrushingChartInstance();
|
|
49474
|
-
brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), null === (_b = null === (_a = this.table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.clearChartState) || void 0 === _b || _b.call(_a);
|
|
49475
|
-
}
|
|
49476
|
-
updateChartState(this, datum, selectedDataMode);
|
|
49477
|
-
}
|
|
49404
|
+
updateChartState(datum) {
|
|
49405
|
+
this.table.isPivotChart() && updateChartState(this, datum);
|
|
49478
49406
|
}
|
|
49479
49407
|
updateCheckboxCellState(col, row, checked) {
|
|
49480
49408
|
var _a, _b;
|
|
@@ -52501,7 +52429,7 @@
|
|
|
52501
52429
|
}, 0 !== e.button) return;
|
|
52502
52430
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
52503
52431
|
if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
|
|
52504
|
-
if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null
|
|
52432
|
+
if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
|
|
52505
52433
|
const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
|
|
52506
52434
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
52507
52435
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -52529,7 +52457,7 @@
|
|
|
52529
52457
|
}
|
|
52530
52458
|
eventManager.dealTableHover(eventArgsSet);
|
|
52531
52459
|
} else {
|
|
52532
|
-
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null
|
|
52460
|
+
if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52533
52461
|
if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52534
52462
|
if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
|
|
52535
52463
|
eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
|
|
@@ -52681,7 +52609,7 @@
|
|
|
52681
52609
|
if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
|
|
52682
52610
|
const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
|
|
52683
52611
|
if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
|
|
52684
|
-
table.scenegraph.updateChartState(null
|
|
52612
|
+
table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
|
|
52685
52613
|
const {
|
|
52686
52614
|
eventArgs: eventArgs
|
|
52687
52615
|
} = eventArgsSet;
|
|
@@ -52700,7 +52628,7 @@
|
|
|
52700
52628
|
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 {
|
|
52701
52629
|
stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
|
|
52702
52630
|
const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
52703
|
-
(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
|
|
52631
|
+
(null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null);
|
|
52704
52632
|
}
|
|
52705
52633
|
}), table.scenegraph.stage.addEventListener("pointermove", e => {
|
|
52706
52634
|
var _a, _b, _c;
|
|
@@ -52818,15 +52746,7 @@
|
|
|
52818
52746
|
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
|
|
52819
52747
|
}), table.scenegraph.stage.addEventListener("wheel", e => {
|
|
52820
52748
|
var _a;
|
|
52821
|
-
|
|
52822
|
-
null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
|
|
52823
|
-
const {
|
|
52824
|
-
cellPos: cellPos
|
|
52825
|
-
} = table.stateManager.hover,
|
|
52826
|
-
prevHoverCellCol = cellPos.col,
|
|
52827
|
-
prevHoverCellRow = cellPos.row;
|
|
52828
|
-
table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
|
|
52829
|
-
}
|
|
52749
|
+
e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
|
|
52830
52750
|
});
|
|
52831
52751
|
}
|
|
52832
52752
|
function bindGesture(eventManager) {
|
|
@@ -53606,7 +53526,7 @@
|
|
|
53606
53526
|
};
|
|
53607
53527
|
class EventManager {
|
|
53608
53528
|
constructor(table) {
|
|
53609
|
-
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(() => {
|
|
53529
|
+
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.cutRanges = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
53610
53530
|
this.bindSelfEvent();
|
|
53611
53531
|
}, 0));
|
|
53612
53532
|
}
|
|
@@ -53908,15 +53828,25 @@
|
|
|
53908
53828
|
} catch (error) {}
|
|
53909
53829
|
}
|
|
53910
53830
|
handleCut(e) {
|
|
53831
|
+
var _a;
|
|
53911
53832
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53912
|
-
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.
|
|
53913
|
-
|
|
53833
|
+
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.cutRanges = null === (_a = this.table.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.map(r => ({
|
|
53834
|
+
start: {
|
|
53835
|
+
col: r.start.col,
|
|
53836
|
+
row: r.start.row
|
|
53837
|
+
},
|
|
53838
|
+
end: {
|
|
53839
|
+
col: r.end.col,
|
|
53840
|
+
row: r.end.row
|
|
53841
|
+
}
|
|
53842
|
+
})), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
53843
|
+
this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
|
|
53914
53844
|
}, 3e4), this.saveClipboardContent();
|
|
53915
53845
|
});
|
|
53916
53846
|
}
|
|
53917
53847
|
handlePaste(e) {
|
|
53918
53848
|
this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
|
|
53919
|
-
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53849
|
+
this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53920
53850
|
}).catch(() => {
|
|
53921
53851
|
this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
|
|
53922
53852
|
}) : this.executePaste(e);
|
|
@@ -53993,9 +53923,9 @@
|
|
|
53993
53923
|
}
|
|
53994
53924
|
clearCutArea(table) {
|
|
53995
53925
|
try {
|
|
53996
|
-
const
|
|
53997
|
-
if (!
|
|
53998
|
-
|
|
53926
|
+
const ranges = this.cutRanges;
|
|
53927
|
+
if (!ranges || 0 === ranges.length) return;
|
|
53928
|
+
table.changeCellValuesByIds(ranges, "");
|
|
53999
53929
|
} catch (error) {}
|
|
54000
53930
|
}
|
|
54001
53931
|
checkClipboardChanged() {
|
|
@@ -55933,6 +55863,15 @@
|
|
|
55933
55863
|
constructor(table, customCellStyle, customCellStyleArrangement) {
|
|
55934
55864
|
this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
|
|
55935
55865
|
}
|
|
55866
|
+
clearCustomCellStyleArrangement() {
|
|
55867
|
+
this.customCellStyleArrangement = [];
|
|
55868
|
+
}
|
|
55869
|
+
addCustomCellStyleArrangement(cellPosition, customStyleId) {
|
|
55870
|
+
this.customCellStyleArrangement.push({
|
|
55871
|
+
cellPosition: cellPosition,
|
|
55872
|
+
customStyleId: customStyleId
|
|
55873
|
+
});
|
|
55874
|
+
}
|
|
55936
55875
|
getCustomCellStyle(col, row) {
|
|
55937
55876
|
const customStyleIds = this.getCustomCellStyleIds(col, row);
|
|
55938
55877
|
if (customStyleIds.length) {
|
|
@@ -56238,7 +56177,7 @@
|
|
|
56238
56177
|
}
|
|
56239
56178
|
constructor(container, options = {}) {
|
|
56240
56179
|
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;
|
|
56241
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.
|
|
56180
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.7", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
56242
56181
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
56243
56182
|
options: options,
|
|
56244
56183
|
container: container
|
|
@@ -60013,15 +59952,16 @@
|
|
|
60013
59952
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60014
59953
|
});
|
|
60015
59954
|
};
|
|
60016
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
59955
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
60017
59956
|
if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
60018
|
-
const
|
|
59957
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
59958
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60019
59959
|
{
|
|
60020
59960
|
field: field
|
|
60021
59961
|
} = table.internalProps.layoutMap.getBody(col, row),
|
|
60022
59962
|
beforeChangeValue = table.getCellRawValue(col, row),
|
|
60023
59963
|
oldValue = table.getCellOriginValue(col, row);
|
|
60024
|
-
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value,
|
|
59964
|
+
table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
|
|
60025
59965
|
const range = table.getCellRange(col, row),
|
|
60026
59966
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
60027
59967
|
if (aggregators) {
|
|
@@ -60044,16 +59984,24 @@
|
|
|
60044
59984
|
table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
60045
59985
|
}
|
|
60046
59986
|
const changedValue = table.getCellOriginValue(col, row);
|
|
60047
|
-
oldValue !== changedValue && triggerEvent
|
|
60048
|
-
|
|
60049
|
-
|
|
60050
|
-
|
|
60051
|
-
|
|
60052
|
-
|
|
60053
|
-
|
|
59987
|
+
if (oldValue !== changedValue && triggerEvent) {
|
|
59988
|
+
const changeValue = {
|
|
59989
|
+
col: col,
|
|
59990
|
+
row: row,
|
|
59991
|
+
recordIndex: recordIndex,
|
|
59992
|
+
field: field,
|
|
59993
|
+
rawValue: beforeChangeValue,
|
|
59994
|
+
currentValue: oldValue,
|
|
59995
|
+
changedValue: changedValue
|
|
59996
|
+
};
|
|
59997
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
59998
|
+
values: [changeValue]
|
|
59999
|
+
});
|
|
60000
|
+
}
|
|
60001
|
+
table.scenegraph.updateNextFrame();
|
|
60054
60002
|
}
|
|
60055
60003
|
}
|
|
60056
|
-
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
60004
|
+
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
60057
60005
|
var _a, _b;
|
|
60058
60006
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60059
60007
|
const changedCellResults = [];
|
|
@@ -60075,6 +60023,7 @@
|
|
|
60075
60023
|
oldRowValues.push(oldValue);
|
|
60076
60024
|
}
|
|
60077
60025
|
}
|
|
60026
|
+
const resultChangeValues = [];
|
|
60078
60027
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
60079
60028
|
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
60080
60029
|
const rowValues = values[i];
|
|
@@ -60098,25 +60047,34 @@
|
|
|
60098
60047
|
if (isCanChange) {
|
|
60099
60048
|
changedCellResults[i][j] = !0;
|
|
60100
60049
|
const value = rowValues[j],
|
|
60101
|
-
|
|
60050
|
+
recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
60051
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60102
60052
|
{
|
|
60103
60053
|
field: field
|
|
60104
60054
|
} = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
|
|
60105
60055
|
beforeChangeValue = beforeChangeValues[i][j],
|
|
60106
60056
|
oldValue = oldValues[i][j];
|
|
60107
|
-
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value,
|
|
60057
|
+
table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, startCol + j, startRow + i, table);
|
|
60108
60058
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
60109
|
-
oldValue !== changedValue && triggerEvent
|
|
60110
|
-
|
|
60111
|
-
|
|
60112
|
-
|
|
60113
|
-
|
|
60114
|
-
|
|
60115
|
-
|
|
60059
|
+
if (oldValue !== changedValue && triggerEvent) {
|
|
60060
|
+
const changeValue = {
|
|
60061
|
+
col: startCol + j,
|
|
60062
|
+
row: startRow + i,
|
|
60063
|
+
recordIndex: recordIndex,
|
|
60064
|
+
field: field,
|
|
60065
|
+
rawValue: beforeChangeValue,
|
|
60066
|
+
currentValue: oldValue,
|
|
60067
|
+
changedValue: changedValue
|
|
60068
|
+
};
|
|
60069
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
60070
|
+
}
|
|
60116
60071
|
} else changedCellResults[i][j] = !1;
|
|
60117
60072
|
}
|
|
60118
60073
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
60119
60074
|
}
|
|
60075
|
+
silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
60076
|
+
values: resultChangeValues
|
|
60077
|
+
});
|
|
60120
60078
|
const startRange = table.getCellRange(startCol, startRow),
|
|
60121
60079
|
range = table.getCellRange(pasteColEnd, pasteRowEnd),
|
|
60122
60080
|
aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -60150,6 +60108,58 @@
|
|
|
60150
60108
|
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
60151
60109
|
});
|
|
60152
60110
|
}
|
|
60111
|
+
function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
60112
|
+
var _a, _b;
|
|
60113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60114
|
+
const resultChangeValues = [],
|
|
60115
|
+
processed = new Set(),
|
|
60116
|
+
nextValue = null != value ? value : "";
|
|
60117
|
+
for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
|
|
60118
|
+
const range = ranges[i],
|
|
60119
|
+
startCol = Math.min(range.start.col, range.end.col),
|
|
60120
|
+
endCol = Math.max(range.start.col, range.end.col),
|
|
60121
|
+
startRow = Math.min(range.start.row, range.end.row),
|
|
60122
|
+
endRow = Math.max(range.start.row, range.end.row);
|
|
60123
|
+
if (startCol > endCol || startRow > endRow) continue;
|
|
60124
|
+
const values = [],
|
|
60125
|
+
oldValues = [];
|
|
60126
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
60127
|
+
const rowValues = [],
|
|
60128
|
+
rowOldValues = [];
|
|
60129
|
+
for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
|
|
60130
|
+
values.push(rowValues), oldValues.push(rowOldValues);
|
|
60131
|
+
}
|
|
60132
|
+
const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
|
|
60133
|
+
for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
|
|
60134
|
+
const col = startCol + c,
|
|
60135
|
+
row = startRow + r,
|
|
60136
|
+
key = `${col},${row}`;
|
|
60137
|
+
if (processed.has(key)) continue;
|
|
60138
|
+
if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
|
|
60139
|
+
const oldValue = oldValues[r][c],
|
|
60140
|
+
changedValue = table.getCellOriginValue(col, row);
|
|
60141
|
+
if (oldValue === changedValue) continue;
|
|
60142
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row),
|
|
60143
|
+
recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
|
|
60144
|
+
{
|
|
60145
|
+
field: field
|
|
60146
|
+
} = table.internalProps.layoutMap.getBody(col, row);
|
|
60147
|
+
resultChangeValues.push({
|
|
60148
|
+
col: col,
|
|
60149
|
+
row: row,
|
|
60150
|
+
recordIndex: recordIndex,
|
|
60151
|
+
field: field,
|
|
60152
|
+
rawValue: oldValue,
|
|
60153
|
+
currentValue: oldValue,
|
|
60154
|
+
changedValue: changedValue
|
|
60155
|
+
});
|
|
60156
|
+
}
|
|
60157
|
+
}
|
|
60158
|
+
!silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
60159
|
+
values: resultChangeValues
|
|
60160
|
+
});
|
|
60161
|
+
});
|
|
60162
|
+
}
|
|
60153
60163
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
60154
60164
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
60155
60165
|
if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
|
|
@@ -60167,13 +60177,16 @@
|
|
|
60167
60177
|
}), table.dataSource.sort(sortState));
|
|
60168
60178
|
}
|
|
60169
60179
|
function listTableAddRecord(record, recordIndex, table) {
|
|
60170
|
-
var _a, _b, _c, _d;
|
|
60180
|
+
var _a, _b, _c, _d, _e, _f;
|
|
60171
60181
|
try {
|
|
60172
60182
|
if (!record) return !1;
|
|
60173
|
-
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)
|
|
60183
|
+
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
|
|
60184
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecord(record, table.dataSource.records.length, !0) : table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
60185
|
+
} else {
|
|
60174
60186
|
(void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
|
|
60175
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
60176
|
-
|
|
60187
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
60188
|
+
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
60189
|
+
if (table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60177
60190
|
const oldRowCount = table.rowCount;
|
|
60178
60191
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60179
60192
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -60242,13 +60255,16 @@
|
|
|
60242
60255
|
}
|
|
60243
60256
|
}
|
|
60244
60257
|
function listTableAddRecords(records, recordIndex, table) {
|
|
60245
|
-
var _a, _b, _c, _d;
|
|
60258
|
+
var _a, _b, _c, _d, _e, _f;
|
|
60246
60259
|
try {
|
|
60247
60260
|
if (!records || 0 === records.length) return !1;
|
|
60248
|
-
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)
|
|
60261
|
+
if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
|
|
60262
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecords(records, table.dataSource.records.length, !0) : table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
60263
|
+
} else {
|
|
60249
60264
|
void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
60250
|
-
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount
|
|
60251
|
-
|
|
60265
|
+
const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
|
|
60266
|
+
syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
|
|
60267
|
+
if (table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60252
60268
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
60253
60269
|
if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
|
|
60254
60270
|
const newRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
@@ -60317,16 +60333,20 @@
|
|
|
60317
60333
|
}
|
|
60318
60334
|
}
|
|
60319
60335
|
function listTableDeleteRecords(recordIndexs, table) {
|
|
60320
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
60336
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
60321
60337
|
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) {
|
|
60322
60338
|
const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
|
|
60323
60339
|
if (0 === deletedRecordIndexs.length) return;
|
|
60324
60340
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
60325
60341
|
table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
60326
|
-
} else if (table.sortState)
|
|
60327
|
-
|
|
60342
|
+
} else if (table.sortState) {
|
|
60343
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.deleteRecords(recordIndexs, !0) : table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
60344
|
+
} else {
|
|
60345
|
+
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
60346
|
+
deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
|
|
60328
60347
|
if (0 === deletedRecordIndexs.length) return;
|
|
60329
60348
|
for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
|
|
60349
|
+
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
60330
60350
|
const oldRowCount = table.transpose ? table.colCount : table.rowCount;
|
|
60331
60351
|
table.refreshRowColCount();
|
|
60332
60352
|
const newRowCount = table.transpose ? table.colCount : table.rowCount,
|
|
@@ -60364,7 +60384,7 @@
|
|
|
60364
60384
|
col: 0,
|
|
60365
60385
|
row: row
|
|
60366
60386
|
});
|
|
60367
|
-
null === (
|
|
60387
|
+
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();
|
|
60368
60388
|
}
|
|
60369
60389
|
} else {
|
|
60370
60390
|
const delRows = [],
|
|
@@ -60396,15 +60416,19 @@
|
|
|
60396
60416
|
col: 0,
|
|
60397
60417
|
row: row
|
|
60398
60418
|
});
|
|
60399
|
-
null === (
|
|
60419
|
+
null === (_j = table.reactCustomLayout) || void 0 === _j || _j.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_k = table.reactCustomLayout) || void 0 === _k || _k.updateAllCustomCell();
|
|
60400
60420
|
}
|
|
60401
60421
|
}
|
|
60402
60422
|
}
|
|
60403
60423
|
function listTableUpdateRecords(records, recordIndexs, table) {
|
|
60404
|
-
var _a, _b, _c, _d;
|
|
60405
|
-
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)
|
|
60406
|
-
|
|
60424
|
+
var _a, _b, _c, _d, _e, _f;
|
|
60425
|
+
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
|
|
60426
|
+
!!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.updateRecords(records, recordIndexs, !0) : table.dataSource.updateRecordsForSorted(records, recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
|
|
60427
|
+
} else {
|
|
60428
|
+
const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
|
|
60429
|
+
updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
|
|
60407
60430
|
if (0 === updateRecordIndexs.length) return;
|
|
60431
|
+
if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
|
|
60408
60432
|
const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
|
|
60409
60433
|
if (table.pagination) {
|
|
60410
60434
|
const {
|
|
@@ -61313,43 +61337,165 @@
|
|
|
61313
61337
|
}
|
|
61314
61338
|
return isValid$1(editorDefine);
|
|
61315
61339
|
}
|
|
61316
|
-
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
|
|
61317
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
61340
|
+
changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61341
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61342
|
+
}
|
|
61343
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61344
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61345
|
+
}
|
|
61346
|
+
changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61347
|
+
return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
61348
|
+
}
|
|
61349
|
+
changeSourceCellValue(recordIndex, field, value) {
|
|
61350
|
+
const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
|
|
61351
|
+
cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
61352
|
+
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
|
|
61353
|
+
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
61354
|
+
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
|
|
61355
|
+
oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
|
|
61356
|
+
changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
61357
|
+
if (oldValue !== changedValue) {
|
|
61358
|
+
const changeValue = {
|
|
61359
|
+
col: cellAddr.col,
|
|
61360
|
+
row: cellAddr.row,
|
|
61361
|
+
recordIndex: recordIndex,
|
|
61362
|
+
field: field,
|
|
61363
|
+
rawValue: beforeChangeValue,
|
|
61364
|
+
currentValue: oldValue,
|
|
61365
|
+
changedValue: changedValue
|
|
61366
|
+
};
|
|
61367
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61368
|
+
values: [changeValue]
|
|
61369
|
+
});
|
|
61370
|
+
}
|
|
61371
|
+
}
|
|
61372
|
+
changeCellValueByRecord(recordIndex, field, value, options) {
|
|
61373
|
+
var _a, _b, _c, _d, _e;
|
|
61374
|
+
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
61375
|
+
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
61376
|
+
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
61377
|
+
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
61378
|
+
let record, oldValue;
|
|
61379
|
+
if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), !triggerEvent) return;
|
|
61380
|
+
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
61381
|
+
if (oldValue !== changedValue) {
|
|
61382
|
+
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
|
|
61383
|
+
changeValue = {
|
|
61384
|
+
col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
|
|
61385
|
+
row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
|
|
61386
|
+
recordIndex: recordIndex,
|
|
61387
|
+
field: field,
|
|
61388
|
+
rawValue: oldValue,
|
|
61389
|
+
currentValue: oldValue,
|
|
61390
|
+
changedValue: changedValue
|
|
61391
|
+
};
|
|
61392
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61393
|
+
values: [changeValue]
|
|
61394
|
+
});
|
|
61395
|
+
}
|
|
61396
|
+
autoRefresh && this.refreshAfterSourceChange();
|
|
61397
|
+
}
|
|
61398
|
+
changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61399
|
+
return this.changeCellValueByRecord(recordIndex, field, value, {
|
|
61400
|
+
triggerEvent: triggerEvent,
|
|
61401
|
+
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
61402
|
+
autoRefresh: !0
|
|
61403
|
+
});
|
|
61404
|
+
}
|
|
61405
|
+
changeCellValuesByRecords(changeValues, options) {
|
|
61406
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
61407
|
+
const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
|
|
61408
|
+
silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
|
|
61409
|
+
autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
|
|
61410
|
+
resultChangeValues = [];
|
|
61411
|
+
for (let i = 0; i < changeValues.length; i++) {
|
|
61412
|
+
const {
|
|
61413
|
+
recordIndex: recordIndex,
|
|
61414
|
+
field: field,
|
|
61415
|
+
value: value
|
|
61416
|
+
} = changeValues[i],
|
|
61417
|
+
records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
|
|
61418
|
+
let record, oldValue;
|
|
61419
|
+
if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), triggerEvent) {
|
|
61420
|
+
const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
|
|
61421
|
+
if (oldValue !== changedValue) {
|
|
61422
|
+
const changeValue = {
|
|
61423
|
+
col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
|
|
61424
|
+
row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
|
|
61425
|
+
recordIndex: recordIndex,
|
|
61426
|
+
field: field,
|
|
61427
|
+
rawValue: oldValue,
|
|
61428
|
+
currentValue: oldValue,
|
|
61429
|
+
changedValue: changedValue
|
|
61430
|
+
};
|
|
61431
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
|
|
61432
|
+
}
|
|
61433
|
+
}
|
|
61434
|
+
}
|
|
61435
|
+
!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
|
|
61436
|
+
values: resultChangeValues
|
|
61437
|
+
}), autoRefresh && this.refreshAfterSourceChange();
|
|
61438
|
+
}
|
|
61439
|
+
changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
|
|
61440
|
+
return this.changeCellValuesByRecords(changeValues, {
|
|
61441
|
+
triggerEvent: triggerEvent,
|
|
61442
|
+
silentChangeCellValuesEvent: silentChangeCellValuesEvent,
|
|
61443
|
+
autoRefresh: !0
|
|
61444
|
+
});
|
|
61318
61445
|
}
|
|
61319
|
-
|
|
61320
|
-
|
|
61446
|
+
refreshAfterSourceChange(options) {
|
|
61447
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
61448
|
+
const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
|
|
61449
|
+
reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
|
|
61450
|
+
clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
|
|
61451
|
+
this.scenegraph.clearCells(), this.sortState && reapplySort && (null === (_e = (_d = this.dataSource).clearSortedIndexMap) || void 0 === _e || _e.call(_d), null === (_g = null === (_f = this.dataSource.sortedIndexMap) || void 0 === _f ? void 0 : _f.clear) || void 0 === _g || _g.call(_f)), reapplyFilter ? this.sortState && reapplySort ? (this.dataSource.updateFilterRulesForSorted(null === (_h = this.dataSource.dataConfig) || void 0 === _h ? void 0 : _h.filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(null === (_j = this.dataSource.dataConfig) || void 0 === _j ? void 0 : _j.filterRules) : this.sortState && reapplySort && sortRecords(this);
|
|
61452
|
+
const traverseColumns = columns => {
|
|
61453
|
+
var _a, _b, _c, _d;
|
|
61454
|
+
for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
|
|
61455
|
+
const column = columns[i],
|
|
61456
|
+
aggregators = null == column ? void 0 : column.vtable_aggregator;
|
|
61457
|
+
if (aggregators) if (Array.isArray(aggregators)) for (let j = 0; j < aggregators.length; j++) null === (_c = null === (_b = aggregators[j]) || void 0 === _b ? void 0 : _b.recalculate) || void 0 === _c || _c.call(_b);else null === (_d = null == aggregators ? void 0 : aggregators.recalculate) || void 0 === _d || _d.call(aggregators);
|
|
61458
|
+
(null == column ? void 0 : column.columns) && traverseColumns(column.columns);
|
|
61459
|
+
}
|
|
61460
|
+
};
|
|
61461
|
+
traverseColumns(this.internalProps.columns), this.refreshRowColCount(), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!clearRowHeightCache), null === (_k = this.internalProps.emptyTip) || void 0 === _k || _k.resetVisible(), this.resize();
|
|
61321
61462
|
}
|
|
61322
|
-
addRecord(record, recordIndex) {
|
|
61463
|
+
addRecord(record, recordIndex, triggerEvent = !0) {
|
|
61323
61464
|
var _a;
|
|
61324
61465
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
61325
|
-
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61466
|
+
adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61326
61467
|
records: [record],
|
|
61327
61468
|
recordIndex: recordIndex,
|
|
61328
61469
|
recordCount: 1
|
|
61329
61470
|
});
|
|
61330
61471
|
}
|
|
61331
|
-
addRecords(records, recordIndex) {
|
|
61472
|
+
addRecords(records, recordIndex, triggerEvent = !0) {
|
|
61332
61473
|
var _a;
|
|
61333
61474
|
const success = listTableAddRecords(records, recordIndex, this);
|
|
61334
|
-
"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, {
|
|
61475
|
+
"number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
|
|
61335
61476
|
records: records,
|
|
61336
61477
|
recordIndex: recordIndex,
|
|
61337
61478
|
recordCount: records.length
|
|
61338
61479
|
});
|
|
61339
61480
|
}
|
|
61340
|
-
deleteRecords(recordIndexs) {
|
|
61481
|
+
deleteRecords(recordIndexs, triggerEvent = !0) {
|
|
61341
61482
|
var _a;
|
|
61342
|
-
|
|
61483
|
+
const deletedRecords = [];
|
|
61484
|
+
(null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
|
|
61485
|
+
let record = null;
|
|
61486
|
+
record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
|
|
61487
|
+
}), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
|
|
61343
61488
|
const rowIndexs = [];
|
|
61344
61489
|
for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
|
|
61345
|
-
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
61490
|
+
triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
61346
61491
|
recordIndexs: recordIndexs,
|
|
61492
|
+
records: deletedRecords,
|
|
61347
61493
|
rowIndexs: rowIndexs,
|
|
61348
61494
|
deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
|
|
61349
61495
|
});
|
|
61350
61496
|
}
|
|
61351
|
-
updateRecords(records, recordIndexs) {
|
|
61352
|
-
listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
61497
|
+
updateRecords(records, recordIndexs, triggerEvent = !0) {
|
|
61498
|
+
listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
|
|
61353
61499
|
records: records,
|
|
61354
61500
|
recordIndexs: recordIndexs,
|
|
61355
61501
|
updateCount: records.length
|