@visactor/vtable-calendar 1.22.11-alpha.8 → 1.22.11-alpha.9

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.
@@ -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,92 @@
37030
37031
  Array.isArray(indexed) || this.records.splice(indexed, 1, record);
37031
37032
  }
37032
37033
  }
37033
- addRecord(record, index) {
37034
+ _getRawRecordsArray() {
37034
37035
  var _a;
37035
- if (Array.isArray(this.records)) {
37036
- this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
37037
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
37038
- if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
37039
- this.pagination.totalCount = this._sourceLength;
37040
- const {
37041
- perPageCount: perPageCount,
37042
- currentPage: currentPage
37043
- } = this.pagination;
37044
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
37045
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37046
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
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 (0 === this.records.length) return rawRecords.length;
37048
+ if (viewIndex <= 0) {
37049
+ const firstVisibleRecord = this.records[0],
37050
+ rawIndex = rawRecords.indexOf(firstVisibleRecord);
37051
+ return rawIndex >= 0 ? rawIndex : 0;
37052
+ }
37053
+ if (viewIndex >= this.records.length) {
37054
+ const lastVisibleRecord = this.records[this.records.length - 1],
37055
+ rawIndex = rawRecords.indexOf(lastVisibleRecord);
37056
+ return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
37047
37057
  }
37058
+ const prevRecord = this.records[viewIndex - 1],
37059
+ rawIndex = rawRecords.indexOf(prevRecord);
37060
+ return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
37048
37061
  }
37049
- addRecords(recordArr, index) {
37050
- var _a;
37051
- if (Array.isArray(this.records)) {
37052
- if (Array.isArray(recordArr)) {
37053
- this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
37054
- for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
37055
- this._sourceLength += recordArr.length;
37056
- for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
37062
+ _resetIndexingFromViewRecords() {
37063
+ if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
37064
+ length: this._sourceLength
37065
+ }, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
37066
+ this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37067
+ }
37068
+ addRecord(record, index, syncToOriginalRecords = !1) {
37069
+ var _a, _b, _c;
37070
+ if (!syncToOriginalRecords) {
37071
+ if (Array.isArray(this.records)) {
37072
+ this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
37073
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
37074
+ if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
37075
+ this.pagination.totalCount = this._sourceLength;
37076
+ const {
37077
+ perPageCount: perPageCount,
37078
+ currentPage: currentPage
37079
+ } = this.pagination;
37080
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
37081
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37082
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
37057
37083
  }
37058
- if (this.userPagination) {
37059
- this.pagination.totalCount = this._sourceLength;
37060
- const {
37061
- perPageCount: perPageCount,
37062
- currentPage: currentPage
37063
- } = this.pagination;
37064
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
37065
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37066
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
37084
+ return;
37067
37085
  }
37086
+ const rawRecords = this._getRawRecordsArray();
37087
+ if (!rawRecords) return;
37088
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
37089
+ rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
37090
+ rawRecords.splice(rawInsertIndex, 0, record), syncToOriginalRecords && this._hasFilterInEffect() && this.markForceVisibleRecord(record), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, 1);
37091
+ }
37092
+ addRecords(recordArr, index, syncToOriginalRecords = !1) {
37093
+ var _a, _b, _c;
37094
+ if (!syncToOriginalRecords) {
37095
+ if (Array.isArray(this.records)) {
37096
+ if (Array.isArray(recordArr)) {
37097
+ this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
37098
+ for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
37099
+ this._sourceLength += recordArr.length;
37100
+ for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
37101
+ }
37102
+ if (this.userPagination) {
37103
+ this.pagination.totalCount = this._sourceLength;
37104
+ const {
37105
+ perPageCount: perPageCount,
37106
+ currentPage: currentPage
37107
+ } = this.pagination;
37108
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
37109
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37110
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
37111
+ }
37112
+ return;
37113
+ }
37114
+ const rawRecords = this._getRawRecordsArray();
37115
+ if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
37116
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
37117
+ rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
37118
+ if (rawRecords.splice(rawInsertIndex, 0, ...recordArr), syncToOriginalRecords && this._hasFilterInEffect()) for (let i = 0; i < recordArr.length; i++) this.markForceVisibleRecord(recordArr[i]);
37119
+ this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, recordArr.length);
37068
37120
  }
37069
37121
  addRecordForSorted(record) {
37070
37122
  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 +37132,49 @@
37080
37132
  }
37081
37133
  }
37082
37134
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
37083
- for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
37084
- const record = this.beforeChangedRecordsMap.get(key.toString());
37085
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
37086
- }
37087
- }
37088
- deleteRecords(recordIndexs) {
37089
- var _a;
37090
- if (Array.isArray(this.records)) {
37091
- const realDeletedRecordIndexs = [],
37092
- recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
37093
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
37094
- const recordIndex = recordIndexsMaxToMin[index];
37095
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
37096
- this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
37097
- const deletedRecord = this.records[recordIndex];
37098
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
37099
- this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
37135
+ const delta = "add" === type ? insertCount : -insertCount,
37136
+ numericKeys = [];
37137
+ this.beforeChangedRecordsMap.forEach((_, key) => {
37138
+ const numKey = Number(key);
37139
+ Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
37140
+ }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
37141
+ for (let i = 0; i < numericKeys.length; i++) {
37142
+ const key = numericKeys[i],
37143
+ record = this.beforeChangedRecordsMap.get(key.toString());
37144
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
37145
+ }
37146
+ }
37147
+ deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
37148
+ var _a, _b, _c;
37149
+ if (!syncToOriginalRecords) {
37150
+ if (Array.isArray(this.records)) {
37151
+ const realDeletedRecordIndexs = [],
37152
+ recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
37153
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
37154
+ const recordIndex = recordIndexsMaxToMin[index];
37155
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
37156
+ this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
37157
+ const deletedRecord = this.records[recordIndex];
37158
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
37159
+ this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
37160
+ }
37161
+ return this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs), realDeletedRecordIndexs;
37100
37162
  }
37101
- return this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs), realDeletedRecordIndexs;
37163
+ return [];
37102
37164
  }
37103
- return [];
37165
+ const rawRecords = this._getRawRecordsArray();
37166
+ if (!rawRecords || !Array.isArray(this.records)) return [];
37167
+ const realDeletedRecordIndexs = [],
37168
+ recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
37169
+ rawDeletedIndexs = [];
37170
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
37171
+ const viewIndex = recordIndexsMaxToMin[index];
37172
+ if (viewIndex >= this.records.length || viewIndex < 0) continue;
37173
+ const deletedRecord = this.records[viewIndex],
37174
+ rawIndex = rawRecords.indexOf(deletedRecord);
37175
+ rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
37176
+ }
37177
+ 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
37178
  }
37105
37179
  deleteRecordsForSorted(recordIndexs) {
37106
37180
  if (Array.isArray(this.records)) {
@@ -37114,18 +37188,34 @@
37114
37188
  this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
37115
37189
  }
37116
37190
  }
37117
- updateRecords(records, recordIndexs) {
37118
- const realDeletedRecordIndexs = [];
37191
+ updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
37192
+ var _a;
37193
+ if (!syncToOriginalRecords) {
37194
+ const realDeletedRecordIndexs = [];
37195
+ for (let index = 0; index < recordIndexs.length; index++) {
37196
+ const recordIndex = recordIndexs[index];
37197
+ if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), this.records)[recordIndex[recordIndex.length - 1]] = records[index];else {
37198
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
37199
+ this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
37200
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
37201
+ this.records[recordIndex] = records[index];
37202
+ }
37203
+ }
37204
+ return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
37205
+ }
37206
+ const rawRecords = this._getRawRecordsArray();
37207
+ if (!rawRecords || !Array.isArray(this.records)) return [];
37208
+ const realUpdatedIndexs = [];
37119
37209
  for (let index = 0; index < recordIndexs.length; index++) {
37120
37210
  const recordIndex = recordIndexs[index];
37121
- if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce((acc, key) => (void 0 === acc[key] && (acc[key] = {}), acc[key].children), this.records)[recordIndex[recordIndex.length - 1]] = records[index];else {
37122
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
37123
- this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
37124
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
37125
- this.records[recordIndex] = records[index];
37211
+ 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 {
37212
+ if (recordIndex >= this.records.length || recordIndex < 0) continue;
37213
+ const oldRecord = this.records[recordIndex],
37214
+ rawIndex = rawRecords.indexOf(oldRecord);
37215
+ rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
37126
37216
  }
37127
37217
  }
37128
- return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
37218
+ return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
37129
37219
  }
37130
37220
  updateRecordsForSorted(records, recordIndexs) {
37131
37221
  for (let index = 0; index < recordIndexs.length; index++) {
@@ -37193,23 +37283,30 @@
37193
37283
  setSortedIndexMap(field, filedMap) {
37194
37284
  this.sortedIndexMap.set(field, filedMap);
37195
37285
  }
37286
+ markForceVisibleRecord(record) {
37287
+ !record || "object" != typeof record && "function" != typeof record || (this._forceVisibleRecords || (this._forceVisibleRecords = new WeakSet()), this._forceVisibleRecords.add(record));
37288
+ }
37289
+ clearForceVisibleRecords() {
37290
+ this._forceVisibleRecords = void 0;
37291
+ }
37196
37292
  clearFilteredChildren(record) {
37197
37293
  var _a, _b;
37198
37294
  record.filteredChildren = void 0;
37199
37295
  for (let i = 0; i < (null !== (_b = null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0); i++) this.clearFilteredChildren(record.children[i]);
37200
37296
  }
37201
37297
  filterRecord(record) {
37202
- var _a, _b, _c;
37298
+ var _a, _b, _c, _d;
37299
+ if (null === (_a = this._forceVisibleRecords) || void 0 === _a ? void 0 : _a.has(record)) return !0;
37203
37300
  let isReserved = !0;
37204
- for (let i = 0; i < (null === (_a = this.dataConfig.filterRules) || void 0 === _a ? void 0 : _a.length); i++) {
37205
- const filterRule = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules[i];
37301
+ for (let i = 0; i < (null === (_b = this.dataConfig.filterRules) || void 0 === _b ? void 0 : _b.length); i++) {
37302
+ const filterRule = null === (_c = this.dataConfig) || void 0 === _c ? void 0 : _c.filterRules[i];
37206
37303
  if (filterRule.filterKey) {
37207
37304
  const filterValue = record[filterRule.filterKey];
37208
37305
  if (-1 === filterRule.filteredValues.indexOf(filterValue)) {
37209
37306
  isReserved = !1;
37210
37307
  break;
37211
37308
  }
37212
- } else if (!(null === (_c = filterRule.filterFunc) || void 0 === _c ? void 0 : _c.call(filterRule, record))) {
37309
+ } else if (!(null === (_d = filterRule.filterFunc) || void 0 === _d ? void 0 : _d.call(filterRule, record))) {
37213
37310
  isReserved = !1;
37214
37311
  break;
37215
37312
  }
@@ -43759,35 +43856,11 @@
43759
43856
  return hoverMode;
43760
43857
  }
43761
43858
 
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
43859
  const chartInstanceListColumnByColumnDirection = {};
43786
43860
  const chartInstanceListRowByRowDirection = {};
43787
- const delayRunDimensionHoverTimer = [];
43788
43861
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
43789
43862
  var _a;
43790
- clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43863
+ isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
43791
43864
  const {
43792
43865
  rowStart: rowStart
43793
43866
  } = table.getBodyVisibleRowRange();
@@ -43796,40 +43869,76 @@
43796
43869
  for (let i = rowStart; i <= rowEnd; i++) {
43797
43870
  const cellGroup = table.scenegraph.getCell(col, i),
43798
43871
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43799
- chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
43800
- const timer = setTimeout(() => {
43801
- var _a, _b, _c, _d;
43872
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
43873
+ var _a, _b, _c, _d, _e, _f;
43802
43874
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
43803
43875
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43804
43876
  let isShowTooltip = !isScatter;
43805
- if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table)), isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_d = (_c = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
43806
- const cellBoundry = table.getCellRelativeRect(col, i),
43807
- bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
43877
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
43878
+ const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
43879
+ {
43880
+ rowEnd: rowEnd1
43881
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
43882
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
43883
+ const {
43884
+ rowEnd: rowEnd2
43885
+ } = table.getBodyVisibleRowRange(0, 5);
43886
+ isShowTooltip = rowEnd2 !== rowEnd;
43887
+ }
43888
+ } else if (i === rowStart && isShowTooltip) {
43889
+ const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
43890
+ {
43891
+ rowStart: rowStart1
43892
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
43893
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
43894
+ const {
43895
+ rowStart: rowStart2
43896
+ } = table.getBodyVisibleRowRange(0, -5);
43897
+ isShowTooltip = rowStart2 !== rowStart;
43898
+ }
43899
+ }
43900
+ if (isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_f = (_e = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _f || _f.call(_e, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
43901
+ const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
43808
43902
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
43809
43903
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43810
43904
  tooltip: !1,
43811
43905
  showTooltipOption: {
43812
- x: canvasXY.x - cellBoundry.left,
43813
- y: absolutePositionTop - cellBoundry.top,
43906
+ x: canvasXY.x,
43907
+ y: absolutePositionTop,
43814
43908
  activeType: "dimension"
43815
43909
  }
43816
43910
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
43817
43911
  tooltip: isShowTooltip,
43818
43912
  showTooltipOption: {
43819
- x: canvasXY.x - cellBoundry.left,
43820
- y: absolutePositionTop - cellBoundry.top,
43913
+ x: canvasXY.x,
43914
+ y: absolutePositionTop,
43821
43915
  activeType: "dimension"
43822
43916
  }
43823
43917
  });
43824
43918
  }
43825
43919
  }
43826
- }, 0);
43827
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
43920
+ }, 0), table.scenegraph.updateNextFrame();
43921
+ }
43922
+ }
43923
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
43924
+ var _a;
43925
+ if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
43926
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
43927
+ if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
43928
+ const cellGroup = table.scenegraph.getCell(col, Number(i)),
43929
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43930
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
43931
+ releaseChartInstance: !0,
43932
+ releaseColumnChartInstance: !1,
43933
+ releaseRowChartInstance: !1
43934
+ }), chartInstanceListColumnByColumnDirection[col][i] = null);
43935
+ }
43936
+ delete chartInstanceListColumnByColumnDirection[col];
43828
43937
  }
43829
43938
  }
43830
43939
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
43831
43940
  var _a;
43832
- clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
43941
+ isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
43833
43942
  const {
43834
43943
  colStart: colStart
43835
43944
  } = table.getBodyVisibleColRange();
@@ -43838,162 +43947,64 @@
43838
43947
  for (let i = colStart; i <= colEnd; i++) {
43839
43948
  const cellGroup = table.scenegraph.getCell(i, row),
43840
43949
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43841
- chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
43842
- const timer = setTimeout(() => {
43950
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
43843
43951
  var _a, _b, _c, _d;
43844
43952
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
43845
43953
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
43846
43954
  let isShowTooltip = !isScatter;
43847
- if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table)), isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
43848
- const cellBoundry = table.getCellRelativeRect(i, row),
43849
- bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
43955
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
43956
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43957
+ {
43958
+ colEnd: colEnd1
43959
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
43960
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
43961
+ const {
43962
+ colEnd: colEnd2
43963
+ } = table.getBodyVisibleColRange(0, 5);
43964
+ isShowTooltip = colEnd2 !== colEnd;
43965
+ }
43966
+ } else if (i === colStart && isShowTooltip) {
43967
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43968
+ {
43969
+ colStart: colStart1
43970
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
43971
+ if (colStart1 === colStart) isShowTooltip = !0;else {
43972
+ const {
43973
+ colStart: colStart2
43974
+ } = table.getBodyVisibleColRange(0, -5);
43975
+ isShowTooltip = colStart2 !== colStart;
43976
+ }
43977
+ }
43978
+ if (isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
43979
+ const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
43850
43980
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
43851
43981
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43852
43982
  tooltip: !1,
43853
43983
  showTooltipOption: {
43854
- x: absolutePositionLeft - cellBoundry.left,
43855
- y: canvasXY.y - cellBoundry.top,
43984
+ x: absolutePositionLeft,
43985
+ y: canvasXY.y,
43856
43986
  activeType: "dimension"
43857
43987
  }
43858
43988
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
43859
43989
  tooltip: isShowTooltip,
43860
43990
  showTooltipOption: {
43861
- x: absolutePositionLeft - cellBoundry.left,
43862
- y: canvasXY.y - cellBoundry.top,
43991
+ x: absolutePositionLeft,
43992
+ y: canvasXY.y,
43863
43993
  activeType: "dimension"
43864
43994
  }
43865
43995
  });
43866
43996
  }
43867
43997
  }
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
- }
43998
+ }, 0), table.scenegraph.updateNextFrame();
43936
43999
  }
43937
- return isShowTooltip;
43938
44000
  }
43939
- function checkIsShowTooltipForEdgeColumn(col, table) {
43940
- let isShowTooltip = !0;
43941
- const {
43942
- colStart: colStart
43943
- } = table.getBodyVisibleColRange();
43944
- let colEnd = table.getBodyVisibleColRange().colEnd;
43945
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
43946
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
43947
- if (col === colEnd && isShowTooltip) {
43948
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43949
- {
43950
- colEnd: colEnd1
43951
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
43952
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
43953
- const {
43954
- colEnd: colEnd2
43955
- } = table.getBodyVisibleColRange(0, 5);
43956
- isShowTooltip = colEnd2 !== colEnd;
43957
- }
43958
- } else if (col === colStart && isShowTooltip) {
43959
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
43960
- {
43961
- colStart: colStart1
43962
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
43963
- if (colStart1 === colStart) isShowTooltip = !0;else {
43964
- const {
43965
- colStart: colStart2
43966
- } = table.getBodyVisibleColRange(0, -5);
43967
- isShowTooltip = colStart2 !== colStart;
43968
- }
43969
- }
43970
- return isShowTooltip;
43971
- }
43972
- function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
43973
- var _a;
43974
- if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
43975
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
43976
- if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
43977
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
43978
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43979
- isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
43980
- forceRelease: forceRelease,
43981
- releaseChartInstance: !0,
43982
- releaseColumnChartInstance: !1,
43983
- releaseRowChartInstance: !1
43984
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
43985
- }
43986
- delete chartInstanceListColumnByColumnDirection[col];
43987
- }
43988
- }
43989
- function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
44001
+ function clearChartInstanceListByRowDirection(row, excludedCol, table) {
43990
44002
  var _a;
43991
44003
  if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
43992
44004
  if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
43993
44005
  const cellGroup = table.scenegraph.getCell(Number(i), row),
43994
44006
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
43995
- isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
43996
- forceRelease: forceRelease,
44007
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
43997
44008
  releaseChartInstance: !0,
43998
44009
  releaseColumnChartInstance: !1,
43999
44010
  releaseRowChartInstance: !1
@@ -44001,19 +44012,6 @@
44001
44012
  }
44002
44013
  delete chartInstanceListRowByRowDirection[row];
44003
44014
  }
44004
- function clearDelayRunDimensionHoverTimers() {
44005
- for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
44006
- delayRunDimensionHoverTimer.length = 0;
44007
- }
44008
- function clearAllChartInstanceList(table, forceRelease = !1) {
44009
- clearDelayRunDimensionHoverTimers();
44010
- for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
44011
- for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
44012
- }
44013
- let disabledShowTooltipToAllChartInstances = !1;
44014
- function isDisabledShowTooltipToAllChartInstances() {
44015
- return disabledShowTooltipToAllChartInstances;
44016
- }
44017
44015
 
44018
44016
  function isValidAlignDomain(domain) {
44019
44017
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -44647,7 +44645,7 @@
44647
44645
  const CHART_NUMBER_TYPE = genNumberType();
44648
44646
  class Chart extends Rect$1 {
44649
44647
  constructor(isShareChartSpec, params) {
44650
- if (super(params), this.type = "chart", this.activeChartInstanceLastViewBox = null, this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
44648
+ if (super(params), this.type = "chart", this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.delayRunDimensionHoverTimer = void 0, this.numberType = CHART_NUMBER_TYPE, this.isShareChartSpec = isShareChartSpec, params.chartInstance) this.chartInstance = params.chartInstance;else {
44651
44649
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
44652
44650
  renderCanvas: params.canvas,
44653
44651
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -44668,7 +44666,7 @@
44668
44666
  }
44669
44667
  }
44670
44668
  activate(table) {
44671
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
44669
+ var _a, _b, _c, _d, _e;
44672
44670
  if (this.activeChartInstance) return;
44673
44671
  const {
44674
44672
  col: col,
@@ -44687,7 +44685,7 @@
44687
44685
  y1: y1 - table.scrollTop,
44688
44686
  y2: y2 - table.scrollTop
44689
44687
  });
44690
- this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
44688
+ 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, {
44691
44689
  renderCanvas: this.attribute.canvas,
44692
44690
  mode: "desktop-browser",
44693
44691
  canvasControled: !1,
@@ -44721,7 +44719,7 @@
44721
44719
  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());
44722
44720
  }
44723
44721
  },
44724
- componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
44722
+ componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
44725
44723
  tooltip: {
44726
44724
  dimension: !1,
44727
44725
  mark: !0
@@ -44732,43 +44730,16 @@
44732
44730
  const chartStage = this.activeChartInstance.getStage(),
44733
44731
  matrix = this.globalTransMatrix.clone(),
44734
44732
  stageMatrix = this.stage.window.getViewBoxTransform();
44735
- let brushChangeThrottle;
44736
44733
  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 => {
44737
44734
  var _a;
44738
- !1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null, void 0) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum, "click");
44739
- }), (null === (_d = table.options.chartDimensionLinkage) || void 0 === _d ? void 0 : _d.listenBrushChange) && (brushChangeThrottle = cancellableThrottle(table.scenegraph.updateChartState.bind(table.scenegraph), null !== (_f = null === (_e = table.options.chartDimensionLinkage) || void 0 === _e ? void 0 : _e.brushChangeDelay) && void 0 !== _f ? _f : 100), this.activeChartInstance.on("brushChange", params => {
44740
- var _a;
44741
- brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
44742
- })), this.activeChartInstance.on("brushStart", params => {
44743
- const brushingChartInstance = getBrushingChartInstance();
44744
- brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
44735
+ !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);
44745
44736
  }), this.activeChartInstance.on("brushEnd", params => {
44746
44737
  var _a;
44747
- null == brushChangeThrottle || brushChangeThrottle.cancel(), table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush"), Chart.temp = 0, setTimeout(() => {
44738
+ table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
44748
44739
  Chart.temp = 1;
44749
44740
  }, 0);
44750
- }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
44751
- markName: "pie"
44752
- }, params => {
44753
- var _a;
44754
- const categoryField = this.attribute.spec.categoryField,
44755
- datum = {
44756
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44757
- };
44758
- generateChartInstanceListByViewRange(datum, table, !1);
44759
- }), this.activeChartInstance.on("pointerout", {
44760
- markName: "pie"
44761
- }, params => {
44762
- var _a;
44763
- const categoryField = this.attribute.spec.categoryField,
44764
- datum = {
44765
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
44766
- };
44767
- generateChartInstanceListByViewRange(datum, table, !0);
44768
- })), this.activeChartInstance.on("dimensionHover", params => {
44741
+ }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
44769
44742
  var _a, _b;
44770
- if (isDisabledShowTooltipToAllChartInstances()) return;
44771
- this.activeChartInstance.disableTooltip(!1);
44772
44743
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
44773
44744
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
44774
44745
  viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
@@ -44785,11 +44756,11 @@
44785
44756
  prev_justShowMarkTooltip = this.justShowMarkTooltip;
44786
44757
  params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
44787
44758
  let delayRunDimensionHover = !1;
44788
- if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, this.clearDelayRunDimensionHoverTimer()), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
44759
+ if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
44789
44760
  const dimensionValue = dimensionInfo.value,
44790
44761
  indicatorsAsCol = table.options.indicatorsAsCol;
44791
- if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
44792
- isDisabledShowTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
44762
+ if (delayRunDimensionHover ? (clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = setTimeout(() => {
44763
+ indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
44793
44764
  }, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
44794
44765
  const series = dimensionInfo.data[0].series,
44795
44766
  width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
@@ -44830,26 +44801,21 @@
44830
44801
  }
44831
44802
  }
44832
44803
  }
44833
- })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledShowTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
44834
- }
44835
- clearDelayRunDimensionHoverTimer() {
44836
- clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
44804
+ }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
44837
44805
  }
44838
44806
  deactivate(table, {
44839
- forceRelease = !1,
44840
44807
  releaseChartInstance = !0,
44841
44808
  releaseColumnChartInstance = !0,
44842
- releaseRowChartInstance = !0,
44843
- releaseAllChartInstance = !1
44809
+ releaseRowChartInstance = !0
44844
44810
  } = {}) {
44845
44811
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
44846
- if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
44847
- !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44812
+ if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
44813
+ null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44848
44814
  x1: -1e3,
44849
44815
  x2: -800,
44850
44816
  y1: -1e3,
44851
44817
  y2: -800
44852
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
44818
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
44853
44819
  const {
44854
44820
  col: col,
44855
44821
  row: row
@@ -44862,7 +44828,7 @@
44862
44828
  } = this.parent;
44863
44829
  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));
44864
44830
  }
44865
- releaseAllChartInstance ? clearAllChartInstanceList(table, forceRelease) : (releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table, forceRelease), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table, forceRelease));
44831
+ releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table);
44866
44832
  }
44867
44833
  updateData(data) {
44868
44834
  this.attribute.data = data;
@@ -44877,14 +44843,13 @@
44877
44843
  y1: y1,
44878
44844
  x2: x2,
44879
44845
  y2: y2
44880
- } = cellGroup.globalAABBBounds,
44881
- viewBox = {
44882
- x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (null !== (_b = null === (_a = table.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0)),
44883
- x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (null !== (_d = null === (_c = table.options.viewBox) || void 0 === _c ? void 0 : _c.x1) && void 0 !== _d ? _d : 0)),
44884
- y1: Math.ceil(y1 + padding[0] + table.scrollTop + (null !== (_f = null === (_e = table.options.viewBox) || void 0 === _e ? void 0 : _e.y1) && void 0 !== _f ? _f : 0)),
44885
- y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (null !== (_h = null === (_g = table.options.viewBox) || void 0 === _g ? void 0 : _g.y1) && void 0 !== _h ? _h : 0))
44886
- };
44887
- return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
44846
+ } = cellGroup.globalAABBBounds;
44847
+ return {
44848
+ 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)),
44849
+ 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)),
44850
+ 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)),
44851
+ 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))
44852
+ };
44888
44853
  }
44889
44854
  }
44890
44855
  function getTableBounds(col, row, table) {
@@ -45099,7 +45064,7 @@
45099
45064
  {
45100
45065
  width = groupAttribute.width,
45101
45066
  height = groupAttribute.height
45102
- } = chart.attribute,
45067
+ } = (chart.getViewBox(), chart.attribute),
45103
45068
  {
45104
45069
  table: table
45105
45070
  } = chart.getRootNode(),
@@ -45127,9 +45092,8 @@
45127
45092
  });
45128
45093
  }
45129
45094
  }
45130
- const lastViewBox = chart.activeChartInstanceLastViewBox,
45131
- viewBox = chart.getViewBox();
45132
- lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
45095
+ const viewBox = chart.getViewBox();
45096
+ activeChartInstance.updateViewBox({
45133
45097
  x1: 0,
45134
45098
  x2: viewBox.x2 - viewBox.x1,
45135
45099
  y1: 0,
@@ -48647,10 +48611,9 @@
48647
48611
  });
48648
48612
  }
48649
48613
  }
48650
- function updateChartState(scenegraph, datum, selectedDataMode) {
48614
+ function updateChartState(scenegraph, datum) {
48651
48615
  const table = scenegraph.table;
48652
48616
  if (table.isPivotChart()) {
48653
- table._selectedDataMode = selectedDataMode;
48654
48617
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
48655
48618
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
48656
48619
  const newSelectedDataItemsInChart = [];
@@ -49398,39 +49361,16 @@
49398
49361
  resetResidentHoverIcon(col, row) {
49399
49362
  resetResidentHoverIcon(col, row, this);
49400
49363
  }
49401
- deactivateChart(col, row, forceRelease = !1) {
49402
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
49403
- if (-1 === col || -1 === row) {
49404
- if (forceRelease) {
49405
- const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
49406
- brushingChartInstance = getBrushingChartInstance();
49407
- if (brushingChartInstanceCellPos && brushingChartInstance) {
49408
- const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
49409
- (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (clearBrushingChartInstance(), null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
49410
- forceRelease: !0,
49411
- releaseChartInstance: !0,
49412
- releaseColumnChartInstance: !0,
49413
- releaseRowChartInstance: !0,
49414
- releaseAllChartInstance: !0
49415
- }));
49416
- }
49417
- }
49418
- return;
49419
- }
49364
+ deactivateChart(col, row) {
49365
+ var _a, _b, _c;
49366
+ if (-1 === col || -1 === row) return;
49420
49367
  const cellGroup = this.getCell(col, row);
49421
- if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
49422
- if (forceRelease) return clearBrushingChartInstance(), void (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _e ? void 0 : _e.deactivate) || void 0 === _f || _f.call(_e, this.table, {
49423
- forceRelease: !0,
49424
- releaseChartInstance: !0,
49425
- releaseColumnChartInstance: !0,
49426
- releaseRowChartInstance: !0,
49427
- releaseAllChartInstance: !0
49428
- }));
49368
+ if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
49429
49369
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
49430
- null === (_h = null === (_g = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _g ? void 0 : _g.deactivate) || void 0 === _h || _h.call(_g, this.table, (null === (_j = this.table.options.chartDimensionLinkage) || void 0 === _j ? void 0 : _j.showTooltip) ? {
49431
- releaseChartInstance: "pie" !== chartType && ("scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
49432
- releaseColumnChartInstance: "pie" !== chartType && (col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
49433
- releaseRowChartInstance: "pie" !== chartType && (row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount)
49370
+ 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 ? {
49371
+ releaseChartInstance: "scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
49372
+ releaseColumnChartInstance: col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
49373
+ releaseRowChartInstance: row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
49434
49374
  } : void 0);
49435
49375
  }
49436
49376
  }
@@ -49478,15 +49418,8 @@
49478
49418
  updateChartSizeForResizeRowHeight(row) {
49479
49419
  updateChartSizeForResizeRowHeight(this, row);
49480
49420
  }
49481
- updateChartState(datum, selectedDataMode) {
49482
- var _a, _b;
49483
- if (this.table.isPivotChart()) {
49484
- if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
49485
- const brushingChartInstance = getBrushingChartInstance();
49486
- brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), null === (_b = null === (_a = this.table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.clearChartState) || void 0 === _b || _b.call(_a);
49487
- }
49488
- updateChartState(this, datum, selectedDataMode);
49489
- }
49421
+ updateChartState(datum) {
49422
+ this.table.isPivotChart() && updateChartState(this, datum);
49490
49423
  }
49491
49424
  updateCheckboxCellState(col, row, checked) {
49492
49425
  var _a, _b;
@@ -52513,7 +52446,7 @@
52513
52446
  }, 0 !== e.button) return;
52514
52447
  const eventArgsSet = getCellEventArgsSet(e);
52515
52448
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
52516
- if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && (table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0)), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
52449
+ if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
52517
52450
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
52518
52451
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
52519
52452
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -52541,7 +52474,7 @@
52541
52474
  }
52542
52475
  eventManager.dealTableHover(eventArgsSet);
52543
52476
  } else {
52544
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), void stateManager.updateInteractionState(InteractionState.grabing);
52477
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
52545
52478
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52546
52479
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52547
52480
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -52693,7 +52626,7 @@
52693
52626
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
52694
52627
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
52695
52628
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
52696
- table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
52629
+ table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
52697
52630
  const {
52698
52631
  eventArgs: eventArgs
52699
52632
  } = eventArgsSet;
@@ -52712,7 +52645,7 @@
52712
52645
  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 {
52713
52646
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
52714
52647
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
52715
- (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
52648
+ (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null);
52716
52649
  }
52717
52650
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
52718
52651
  var _a, _b, _c;
@@ -52830,15 +52763,7 @@
52830
52763
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
52831
52764
  }), table.scenegraph.stage.addEventListener("wheel", e => {
52832
52765
  var _a;
52833
- if (!e.path.find(node => "legend" === node.name)) {
52834
- null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
52835
- const {
52836
- cellPos: cellPos
52837
- } = table.stateManager.hover,
52838
- prevHoverCellCol = cellPos.col,
52839
- prevHoverCellRow = cellPos.row;
52840
- table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
52841
- }
52766
+ e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
52842
52767
  });
52843
52768
  }
52844
52769
  function bindGesture(eventManager) {
@@ -52953,13 +52878,11 @@
52953
52878
  const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
52954
52879
  throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
52955
52880
  scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
52956
- var _a;
52957
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
52881
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
52958
52882
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
52959
52883
  throttleVerticalWheel(ratio, e);
52960
52884
  }), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
52961
- var _a;
52962
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
52885
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
52963
52886
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
52964
52887
  throttleHorizontalWheel(ratio);
52965
52888
  });
@@ -53109,7 +53032,7 @@
53109
53032
  const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
53110
53033
  eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
53111
53034
  }
53112
- }), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
53035
+ });
53113
53036
  }
53114
53037
  };
53115
53038
  eventManager.globalEventListeners.push({
@@ -53620,7 +53543,7 @@
53620
53543
  };
53621
53544
  class EventManager {
53622
53545
  constructor(table) {
53623
- this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
53546
+ this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.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(() => {
53624
53547
  this.bindSelfEvent();
53625
53548
  }, 0));
53626
53549
  }
@@ -53922,15 +53845,25 @@
53922
53845
  } catch (error) {}
53923
53846
  }
53924
53847
  handleCut(e) {
53848
+ var _a;
53925
53849
  return __awaiter$1(this, void 0, void 0, function* () {
53926
- this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
53927
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
53850
+ 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 => ({
53851
+ start: {
53852
+ col: r.start.col,
53853
+ row: r.start.row
53854
+ },
53855
+ end: {
53856
+ col: r.end.col,
53857
+ row: r.end.row
53858
+ }
53859
+ })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
53860
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
53928
53861
  }, 3e4), this.saveClipboardContent();
53929
53862
  });
53930
53863
  }
53931
53864
  handlePaste(e) {
53932
53865
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
53933
- this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
53866
+ 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));
53934
53867
  }).catch(() => {
53935
53868
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
53936
53869
  }) : this.executePaste(e);
@@ -54007,9 +53940,9 @@
54007
53940
  }
54008
53941
  clearCutArea(table) {
54009
53942
  try {
54010
- const selectCells = this.cutCellRange;
54011
- if (!selectCells || 0 === selectCells.length) return;
54012
- for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) selectCells[i][j] && table.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, void 0);
53943
+ const ranges = this.cutRanges;
53944
+ if (!ranges || 0 === ranges.length) return;
53945
+ table.changeCellValuesByIds(ranges, "");
54013
53946
  } catch (error) {}
54014
53947
  }
54015
53948
  checkClipboardChanged() {
@@ -55947,6 +55880,15 @@
55947
55880
  constructor(table, customCellStyle, customCellStyleArrangement) {
55948
55881
  this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
55949
55882
  }
55883
+ clearCustomCellStyleArrangement() {
55884
+ this.customCellStyleArrangement = [];
55885
+ }
55886
+ addCustomCellStyleArrangement(cellPosition, customStyleId) {
55887
+ this.customCellStyleArrangement.push({
55888
+ cellPosition: cellPosition,
55889
+ customStyleId: customStyleId
55890
+ });
55891
+ }
55950
55892
  getCustomCellStyle(col, row) {
55951
55893
  const customStyleIds = this.getCustomCellStyleIds(col, row);
55952
55894
  if (customStyleIds.length) {
@@ -56252,7 +56194,7 @@
56252
56194
  }
56253
56195
  constructor(container, options = {}) {
56254
56196
  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;
56255
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.8", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
56197
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.9", 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");
56256
56198
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
56257
56199
  options: options,
56258
56200
  container: container
@@ -60027,15 +59969,16 @@
60027
59969
  step((generator = generator.apply(thisArg, _arguments || [])).next());
60028
59970
  });
60029
59971
  };
60030
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
59972
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
60031
59973
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
60032
- const recordIndex = table.getRecordShowIndexByCell(col, row),
59974
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
59975
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60033
59976
  {
60034
59977
  field: field
60035
59978
  } = table.internalProps.layoutMap.getBody(col, row),
60036
59979
  beforeChangeValue = table.getCellRawValue(col, row),
60037
59980
  oldValue = table.getCellOriginValue(col, row);
60038
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
59981
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
60039
59982
  const range = table.getCellRange(col, row),
60040
59983
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
60041
59984
  if (aggregators) {
@@ -60058,16 +60001,24 @@
60058
60001
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
60059
60002
  }
60060
60003
  const changedValue = table.getCellOriginValue(col, row);
60061
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
60062
- col: col,
60063
- row: row,
60064
- rawValue: beforeChangeValue,
60065
- currentValue: oldValue,
60066
- changedValue: changedValue
60067
- }), table.scenegraph.updateNextFrame();
60004
+ if (oldValue !== changedValue && triggerEvent) {
60005
+ const changeValue = {
60006
+ col: col,
60007
+ row: row,
60008
+ recordIndex: recordIndex,
60009
+ field: field,
60010
+ rawValue: beforeChangeValue,
60011
+ currentValue: oldValue,
60012
+ changedValue: changedValue
60013
+ };
60014
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
60015
+ values: [changeValue]
60016
+ });
60017
+ }
60018
+ table.scenegraph.updateNextFrame();
60068
60019
  }
60069
60020
  }
60070
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
60021
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
60071
60022
  var _a, _b;
60072
60023
  return __awaiter(this, void 0, void 0, function* () {
60073
60024
  const changedCellResults = [];
@@ -60089,6 +60040,7 @@
60089
60040
  oldRowValues.push(oldValue);
60090
60041
  }
60091
60042
  }
60043
+ const resultChangeValues = [];
60092
60044
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
60093
60045
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
60094
60046
  const rowValues = values[i];
@@ -60112,25 +60064,34 @@
60112
60064
  if (isCanChange) {
60113
60065
  changedCellResults[i][j] = !0;
60114
60066
  const value = rowValues[j],
60115
- recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
60067
+ recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
60068
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60116
60069
  {
60117
60070
  field: field
60118
60071
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
60119
60072
  beforeChangeValue = beforeChangeValues[i][j],
60120
60073
  oldValue = oldValues[i][j];
60121
- table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);
60074
+ 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);
60122
60075
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
60123
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
60124
- col: startCol + j,
60125
- row: startRow + i,
60126
- rawValue: beforeChangeValue,
60127
- currentValue: oldValue,
60128
- changedValue: changedValue
60129
- });
60076
+ if (oldValue !== changedValue && triggerEvent) {
60077
+ const changeValue = {
60078
+ col: startCol + j,
60079
+ row: startRow + i,
60080
+ recordIndex: recordIndex,
60081
+ field: field,
60082
+ rawValue: beforeChangeValue,
60083
+ currentValue: oldValue,
60084
+ changedValue: changedValue
60085
+ };
60086
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
60087
+ }
60130
60088
  } else changedCellResults[i][j] = !1;
60131
60089
  }
60132
60090
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
60133
60091
  }
60092
+ silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
60093
+ values: resultChangeValues
60094
+ });
60134
60095
  const startRange = table.getCellRange(startCol, startRow),
60135
60096
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
60136
60097
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -60164,6 +60125,58 @@
60164
60125
  return table.scenegraph.updateNextFrame(), changedCellResults;
60165
60126
  });
60166
60127
  }
60128
+ function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
60129
+ var _a, _b;
60130
+ return __awaiter(this, void 0, void 0, function* () {
60131
+ const resultChangeValues = [],
60132
+ processed = new Set(),
60133
+ nextValue = null != value ? value : "";
60134
+ for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
60135
+ const range = ranges[i],
60136
+ startCol = Math.min(range.start.col, range.end.col),
60137
+ endCol = Math.max(range.start.col, range.end.col),
60138
+ startRow = Math.min(range.start.row, range.end.row),
60139
+ endRow = Math.max(range.start.row, range.end.row);
60140
+ if (startCol > endCol || startRow > endRow) continue;
60141
+ const values = [],
60142
+ oldValues = [];
60143
+ for (let row = startRow; row <= endRow; row++) {
60144
+ const rowValues = [],
60145
+ rowOldValues = [];
60146
+ for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
60147
+ values.push(rowValues), oldValues.push(rowOldValues);
60148
+ }
60149
+ const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
60150
+ for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
60151
+ const col = startCol + c,
60152
+ row = startRow + r,
60153
+ key = `${col},${row}`;
60154
+ if (processed.has(key)) continue;
60155
+ if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
60156
+ const oldValue = oldValues[r][c],
60157
+ changedValue = table.getCellOriginValue(col, row);
60158
+ if (oldValue === changedValue) continue;
60159
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
60160
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60161
+ {
60162
+ field: field
60163
+ } = table.internalProps.layoutMap.getBody(col, row);
60164
+ resultChangeValues.push({
60165
+ col: col,
60166
+ row: row,
60167
+ recordIndex: recordIndex,
60168
+ field: field,
60169
+ rawValue: oldValue,
60170
+ currentValue: oldValue,
60171
+ changedValue: changedValue
60172
+ });
60173
+ }
60174
+ }
60175
+ !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
60176
+ values: resultChangeValues
60177
+ });
60178
+ });
60179
+ }
60167
60180
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
60168
60181
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
60169
60182
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -60181,13 +60194,16 @@
60181
60194
  }), table.dataSource.sort(sortState));
60182
60195
  }
60183
60196
  function listTableAddRecord(record, recordIndex, table) {
60184
- var _a, _b, _c, _d;
60197
+ var _a, _b, _c, _d, _e, _f;
60185
60198
  try {
60186
60199
  if (!record) return !1;
60187
- if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60200
+ if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
60201
+ !!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecord(record, table.dataSource.records.length, !0) : table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
60202
+ } else {
60188
60203
  (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
60189
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
60190
- table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
60204
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
60205
+ syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
60206
+ if (table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
60191
60207
  const oldRowCount = table.rowCount;
60192
60208
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
60193
60209
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -60256,13 +60272,16 @@
60256
60272
  }
60257
60273
  }
60258
60274
  function listTableAddRecords(records, recordIndex, table) {
60259
- var _a, _b, _c, _d;
60275
+ var _a, _b, _c, _d, _e, _f;
60260
60276
  try {
60261
60277
  if (!records || 0 === records.length) return !1;
60262
- if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60278
+ if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
60279
+ !!(null === (_e = table.options) || void 0 === _e ? void 0 : _e.syncRecordOperationsToSourceRecords) ? table.dataSource.addRecords(records, table.dataSource.records.length, !0) : table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
60280
+ } else {
60263
60281
  void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
60264
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
60265
- table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
60282
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
60283
+ syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
60284
+ if (table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
60266
60285
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
60267
60286
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
60268
60287
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -60331,16 +60350,20 @@
60331
60350
  }
60332
60351
  }
60333
60352
  function listTableDeleteRecords(recordIndexs, table) {
60334
- var _a, _b, _c, _d, _e, _f, _g, _h;
60353
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
60335
60354
  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) {
60336
60355
  const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
60337
60356
  if (0 === deletedRecordIndexs.length) return;
60338
60357
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
60339
60358
  table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
60340
- } else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60341
- const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
60359
+ } else if (table.sortState) {
60360
+ !!(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();
60361
+ } else {
60362
+ const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
60363
+ deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
60342
60364
  if (0 === deletedRecordIndexs.length) return;
60343
60365
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
60366
+ if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
60344
60367
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
60345
60368
  table.refreshRowColCount();
60346
60369
  const newRowCount = table.transpose ? table.colCount : table.rowCount,
@@ -60378,7 +60401,7 @@
60378
60401
  col: 0,
60379
60402
  row: row
60380
60403
  });
60381
- null === (_e = table.reactCustomLayout) || void 0 === _e || _e.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_f = table.reactCustomLayout) || void 0 === _f || _f.updateAllCustomCell();
60404
+ 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();
60382
60405
  }
60383
60406
  } else {
60384
60407
  const delRows = [],
@@ -60410,15 +60433,19 @@
60410
60433
  col: 0,
60411
60434
  row: row
60412
60435
  });
60413
- null === (_g = table.reactCustomLayout) || void 0 === _g || _g.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_h = table.reactCustomLayout) || void 0 === _h || _h.updateAllCustomCell();
60436
+ 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();
60414
60437
  }
60415
60438
  }
60416
60439
  }
60417
60440
  function listTableUpdateRecords(records, recordIndexs, table) {
60418
- var _a, _b, _c, _d;
60419
- if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.updateRecordsForSorted(records, recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60420
- const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
60441
+ var _a, _b, _c, _d, _e, _f;
60442
+ if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) {
60443
+ !!(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();
60444
+ } else {
60445
+ const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
60446
+ updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
60421
60447
  if (0 === updateRecordIndexs.length) return;
60448
+ if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
60422
60449
  const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
60423
60450
  if (table.pagination) {
60424
60451
  const {
@@ -61184,8 +61211,8 @@
61184
61211
  updateFilterRules(filterRules, options = {
61185
61212
  clearRowHeightCache: !0
61186
61213
  }) {
61187
- var _a;
61188
- this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules, null == options ? void 0 : options.onFilterRecordsEnd), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!(null == options ? void 0 : options.clearRowHeightCache)), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), this.resize();
61214
+ var _a, _b, _c;
61215
+ this.scenegraph.clearCells(), null === (_b = (_a = this.dataSource).clearForceVisibleRecords) || void 0 === _b || _b.call(_a), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules, null == options ? void 0 : options.onFilterRecordsEnd), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!(null == options ? void 0 : options.clearRowHeightCache)), null === (_c = this.internalProps.emptyTip) || void 0 === _c || _c.resetVisible(), this.resize();
61189
61216
  }
61190
61217
  getFilteredRecords() {
61191
61218
  return this.dataSource.records;
@@ -61327,43 +61354,165 @@
61327
61354
  }
61328
61355
  return isValid$1(editorDefine);
61329
61356
  }
61330
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
61331
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
61357
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61358
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61359
+ }
61360
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61361
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61362
+ }
61363
+ changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
61364
+ return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
61365
+ }
61366
+ changeSourceCellValue(recordIndex, field, value) {
61367
+ const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
61368
+ cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
61369
+ if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
61370
+ this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
61371
+ const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
61372
+ oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
61373
+ changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
61374
+ if (oldValue !== changedValue) {
61375
+ const changeValue = {
61376
+ col: cellAddr.col,
61377
+ row: cellAddr.row,
61378
+ recordIndex: recordIndex,
61379
+ field: field,
61380
+ rawValue: beforeChangeValue,
61381
+ currentValue: oldValue,
61382
+ changedValue: changedValue
61383
+ };
61384
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61385
+ values: [changeValue]
61386
+ });
61387
+ }
61388
+ }
61389
+ changeCellValueByRecord(recordIndex, field, value, options) {
61390
+ var _a, _b, _c, _d, _e;
61391
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
61392
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
61393
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
61394
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
61395
+ let record, oldValue;
61396
+ if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), !triggerEvent) return;
61397
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
61398
+ if (oldValue !== changedValue) {
61399
+ const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
61400
+ changeValue = {
61401
+ col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
61402
+ row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
61403
+ recordIndex: recordIndex,
61404
+ field: field,
61405
+ rawValue: oldValue,
61406
+ currentValue: oldValue,
61407
+ changedValue: changedValue
61408
+ };
61409
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61410
+ values: [changeValue]
61411
+ });
61412
+ }
61413
+ autoRefresh && this.refreshAfterSourceChange();
61414
+ }
61415
+ changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
61416
+ return this.changeCellValueByRecord(recordIndex, field, value, {
61417
+ triggerEvent: triggerEvent,
61418
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
61419
+ autoRefresh: !0
61420
+ });
61421
+ }
61422
+ changeCellValuesByRecords(changeValues, options) {
61423
+ var _a, _b, _c, _d, _e, _f, _g;
61424
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
61425
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
61426
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
61427
+ resultChangeValues = [];
61428
+ for (let i = 0; i < changeValues.length; i++) {
61429
+ const {
61430
+ recordIndex: recordIndex,
61431
+ field: field,
61432
+ value: value
61433
+ } = changeValues[i],
61434
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
61435
+ let record, oldValue;
61436
+ if (!Array.isArray(records) || "string" != typeof field && "number" != typeof field || (record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex], oldValue = null == record ? void 0 : record[field]), this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this), triggerEvent) {
61437
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
61438
+ if (oldValue !== changedValue) {
61439
+ const changeValue = {
61440
+ col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
61441
+ row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
61442
+ recordIndex: recordIndex,
61443
+ field: field,
61444
+ rawValue: oldValue,
61445
+ currentValue: oldValue,
61446
+ changedValue: changedValue
61447
+ };
61448
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
61449
+ }
61450
+ }
61451
+ }
61452
+ !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61453
+ values: resultChangeValues
61454
+ }), autoRefresh && this.refreshAfterSourceChange();
61455
+ }
61456
+ changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
61457
+ return this.changeCellValuesByRecords(changeValues, {
61458
+ triggerEvent: triggerEvent,
61459
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
61460
+ autoRefresh: !0
61461
+ });
61332
61462
  }
61333
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
61334
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
61463
+ refreshAfterSourceChange(options) {
61464
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
61465
+ const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
61466
+ reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
61467
+ clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
61468
+ this.scenegraph.clearCells(), this.sortState && reapplySort && (null === (_e = (_d = this.dataSource).clearSortedIndexMap) || void 0 === _e || _e.call(_d), null === (_g = null === (_f = this.dataSource.sortedIndexMap) || void 0 === _f ? void 0 : _f.clear) || void 0 === _g || _g.call(_f)), reapplyFilter ? this.sortState && reapplySort ? (this.dataSource.updateFilterRulesForSorted(null === (_h = this.dataSource.dataConfig) || void 0 === _h ? void 0 : _h.filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(null === (_j = this.dataSource.dataConfig) || void 0 === _j ? void 0 : _j.filterRules) : this.sortState && reapplySort && sortRecords(this);
61469
+ const traverseColumns = columns => {
61470
+ var _a, _b, _c, _d;
61471
+ for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
61472
+ const column = columns[i],
61473
+ aggregators = null == column ? void 0 : column.vtable_aggregator;
61474
+ if (aggregators) if (Array.isArray(aggregators)) for (let j = 0; j < aggregators.length; j++) null === (_c = null === (_b = aggregators[j]) || void 0 === _b ? void 0 : _b.recalculate) || void 0 === _c || _c.call(_b);else null === (_d = null == aggregators ? void 0 : aggregators.recalculate) || void 0 === _d || _d.call(aggregators);
61475
+ (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
61476
+ }
61477
+ };
61478
+ traverseColumns(this.internalProps.columns), this.refreshRowColCount(), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!clearRowHeightCache), null === (_k = this.internalProps.emptyTip) || void 0 === _k || _k.resetVisible(), this.resize();
61335
61479
  }
61336
- addRecord(record, recordIndex) {
61480
+ addRecord(record, recordIndex, triggerEvent = !0) {
61337
61481
  var _a;
61338
61482
  const success = listTableAddRecord(record, recordIndex, this);
61339
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61483
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61340
61484
  records: [record],
61341
61485
  recordIndex: recordIndex,
61342
61486
  recordCount: 1
61343
61487
  });
61344
61488
  }
61345
- addRecords(records, recordIndex) {
61489
+ addRecords(records, recordIndex, triggerEvent = !0) {
61346
61490
  var _a;
61347
61491
  const success = listTableAddRecords(records, recordIndex, this);
61348
- "number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61492
+ "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, {
61349
61493
  records: records,
61350
61494
  recordIndex: recordIndex,
61351
61495
  recordCount: records.length
61352
61496
  });
61353
61497
  }
61354
- deleteRecords(recordIndexs) {
61498
+ deleteRecords(recordIndexs, triggerEvent = !0) {
61355
61499
  var _a;
61356
- listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61500
+ const deletedRecords = [];
61501
+ (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
61502
+ let record = null;
61503
+ record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
61504
+ }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61357
61505
  const rowIndexs = [];
61358
61506
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
61359
- this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61507
+ triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61360
61508
  recordIndexs: recordIndexs,
61509
+ records: deletedRecords,
61361
61510
  rowIndexs: rowIndexs,
61362
61511
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
61363
61512
  });
61364
61513
  }
61365
- updateRecords(records, recordIndexs) {
61366
- listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
61514
+ updateRecords(records, recordIndexs, triggerEvent = !0) {
61515
+ listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
61367
61516
  records: records,
61368
61517
  recordIndexs: recordIndexs,
61369
61518
  updateCount: records.length