@visactor/vtable-gantt 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.
@@ -38455,24 +38455,6 @@
38455
38455
  }, delay));
38456
38456
  };
38457
38457
  }
38458
- function cancellableThrottle(func, delay) {
38459
- let timer = null,
38460
- lastArgs = null,
38461
- context = null;
38462
- return {
38463
- throttled: function (...args) {
38464
- lastArgs = args, context = this, timer || (timer = setTimeout(() => {
38465
- lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
38466
- }, delay));
38467
- },
38468
- cancel: () => {
38469
- timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
38470
- },
38471
- flush: () => {
38472
- timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
38473
- }
38474
- };
38475
- }
38476
38458
  function pad(num, totalChars) {
38477
38459
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
38478
38460
  return num;
@@ -38736,6 +38718,7 @@
38736
38718
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
38737
38719
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
38738
38720
  CHANGE_CELL_VALUE: "change_cell_value",
38721
+ CHANGE_CELL_VALUES: "change_cell_values",
38739
38722
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
38740
38723
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
38741
38724
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -40868,6 +40851,24 @@
40868
40851
  }
40869
40852
  }
40870
40853
  }
40854
+ changeFieldValueByRecordIndex(value, recordIndex, field, table) {
40855
+ var _a, _b, _c, _d;
40856
+ if (null === field) return;
40857
+ if (null == recordIndex) return;
40858
+ const rawKey = recordIndex.toString();
40859
+ if (!this.beforeChangedRecordsMap.has(rawKey)) {
40860
+ const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
40861
+ originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40862
+ this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
40863
+ }
40864
+ if ("string" == typeof field || "number" == typeof field) {
40865
+ const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
40866
+ rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
40867
+ record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40868
+ let formatValue = value;
40869
+ "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);
40870
+ }
40871
+ }
40871
40872
  cacheBeforeChangedRecord(dataIndex, table) {
40872
40873
  var _a;
40873
40874
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -40883,41 +40884,92 @@
40883
40884
  Array.isArray(indexed) || this.records.splice(indexed, 1, record);
40884
40885
  }
40885
40886
  }
40886
- addRecord(record, index) {
40887
+ _getRawRecordsArray() {
40887
40888
  var _a;
40888
- if (Array.isArray(this.records)) {
40889
- this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
40890
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
40891
- if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
40892
- this.pagination.totalCount = this._sourceLength;
40893
- const {
40894
- perPageCount: perPageCount,
40895
- currentPage: currentPage
40896
- } = this.pagination;
40897
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
40898
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40899
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
40889
+ const rawRecords = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records;
40890
+ return Array.isArray(rawRecords) ? rawRecords : null;
40891
+ }
40892
+ _hasFilterInEffect() {
40893
+ var _a, _b, _c, _d, _e;
40894
+ 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;
40895
+ }
40896
+ _normalizeInsertIndex(index, length) {
40897
+ return null == index || index > length ? length : index < 0 ? 0 : index;
40898
+ }
40899
+ _mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
40900
+ if (0 === this.records.length) return rawRecords.length;
40901
+ if (viewIndex <= 0) {
40902
+ const firstVisibleRecord = this.records[0],
40903
+ rawIndex = rawRecords.indexOf(firstVisibleRecord);
40904
+ return rawIndex >= 0 ? rawIndex : 0;
40905
+ }
40906
+ if (viewIndex >= this.records.length) {
40907
+ const lastVisibleRecord = this.records[this.records.length - 1],
40908
+ rawIndex = rawRecords.indexOf(lastVisibleRecord);
40909
+ return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
40900
40910
  }
40911
+ const prevRecord = this.records[viewIndex - 1],
40912
+ rawIndex = rawRecords.indexOf(prevRecord);
40913
+ return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
40901
40914
  }
40902
- addRecords(recordArr, index) {
40903
- var _a;
40904
- if (Array.isArray(this.records)) {
40905
- if (Array.isArray(recordArr)) {
40906
- this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
40907
- for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
40908
- this._sourceLength += recordArr.length;
40909
- for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
40915
+ _resetIndexingFromViewRecords() {
40916
+ if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
40917
+ length: this._sourceLength
40918
+ }, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
40919
+ this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40920
+ }
40921
+ addRecord(record, index, syncToOriginalRecords = !1) {
40922
+ var _a, _b, _c;
40923
+ if (!syncToOriginalRecords) {
40924
+ if (Array.isArray(this.records)) {
40925
+ this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
40926
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
40927
+ if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
40928
+ this.pagination.totalCount = this._sourceLength;
40929
+ const {
40930
+ perPageCount: perPageCount,
40931
+ currentPage: currentPage
40932
+ } = this.pagination;
40933
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
40934
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40935
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
40910
40936
  }
40911
- if (this.userPagination) {
40912
- this.pagination.totalCount = this._sourceLength;
40913
- const {
40914
- perPageCount: perPageCount,
40915
- currentPage: currentPage
40916
- } = this.pagination;
40917
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
40918
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40919
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
40937
+ return;
40938
+ }
40939
+ const rawRecords = this._getRawRecordsArray();
40940
+ if (!rawRecords) return;
40941
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
40942
+ rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
40943
+ 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);
40944
+ }
40945
+ addRecords(recordArr, index, syncToOriginalRecords = !1) {
40946
+ var _a, _b, _c;
40947
+ if (!syncToOriginalRecords) {
40948
+ if (Array.isArray(this.records)) {
40949
+ if (Array.isArray(recordArr)) {
40950
+ this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
40951
+ for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
40952
+ this._sourceLength += recordArr.length;
40953
+ for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
40954
+ }
40955
+ if (this.userPagination) {
40956
+ this.pagination.totalCount = this._sourceLength;
40957
+ const {
40958
+ perPageCount: perPageCount,
40959
+ currentPage: currentPage
40960
+ } = this.pagination;
40961
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
40962
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40963
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
40964
+ }
40965
+ return;
40920
40966
  }
40967
+ const rawRecords = this._getRawRecordsArray();
40968
+ if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
40969
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
40970
+ rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
40971
+ if (rawRecords.splice(rawInsertIndex, 0, ...recordArr), syncToOriginalRecords && this._hasFilterInEffect()) for (let i = 0; i < recordArr.length; i++) this.markForceVisibleRecord(recordArr[i]);
40972
+ 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);
40921
40973
  }
40922
40974
  addRecordForSorted(record) {
40923
40975
  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));
@@ -40933,27 +40985,49 @@
40933
40985
  }
40934
40986
  }
40935
40987
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
40936
- for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
40937
- const record = this.beforeChangedRecordsMap.get(key.toString());
40938
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
40939
- }
40940
- }
40941
- deleteRecords(recordIndexs) {
40942
- var _a;
40943
- if (Array.isArray(this.records)) {
40944
- const realDeletedRecordIndexs = [],
40945
- recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
40946
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
40947
- const recordIndex = recordIndexsMaxToMin[index];
40948
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
40949
- this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
40950
- const deletedRecord = this.records[recordIndex];
40951
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
40952
- this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
40953
- }
40954
- 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;
40988
+ const delta = "add" === type ? insertCount : -insertCount,
40989
+ numericKeys = [];
40990
+ this.beforeChangedRecordsMap.forEach((_, key) => {
40991
+ const numKey = Number(key);
40992
+ Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
40993
+ }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
40994
+ for (let i = 0; i < numericKeys.length; i++) {
40995
+ const key = numericKeys[i],
40996
+ record = this.beforeChangedRecordsMap.get(key.toString());
40997
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
40998
+ }
40999
+ }
41000
+ deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
41001
+ var _a, _b, _c;
41002
+ if (!syncToOriginalRecords) {
41003
+ if (Array.isArray(this.records)) {
41004
+ const realDeletedRecordIndexs = [],
41005
+ recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
41006
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
41007
+ const recordIndex = recordIndexsMaxToMin[index];
41008
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41009
+ this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
41010
+ const deletedRecord = this.records[recordIndex];
41011
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
41012
+ this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
41013
+ }
41014
+ 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;
41015
+ }
41016
+ return [];
41017
+ }
41018
+ const rawRecords = this._getRawRecordsArray();
41019
+ if (!rawRecords || !Array.isArray(this.records)) return [];
41020
+ const realDeletedRecordIndexs = [],
41021
+ recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
41022
+ rawDeletedIndexs = [];
41023
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
41024
+ const viewIndex = recordIndexsMaxToMin[index];
41025
+ if (viewIndex >= this.records.length || viewIndex < 0) continue;
41026
+ const deletedRecord = this.records[viewIndex],
41027
+ rawIndex = rawRecords.indexOf(deletedRecord);
41028
+ rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
40955
41029
  }
40956
- return [];
41030
+ 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;
40957
41031
  }
40958
41032
  deleteRecordsForSorted(recordIndexs) {
40959
41033
  if (Array.isArray(this.records)) {
@@ -40967,18 +41041,34 @@
40967
41041
  this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
40968
41042
  }
40969
41043
  }
40970
- updateRecords(records, recordIndexs) {
40971
- const realDeletedRecordIndexs = [];
41044
+ updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
41045
+ var _a;
41046
+ if (!syncToOriginalRecords) {
41047
+ const realDeletedRecordIndexs = [];
41048
+ for (let index = 0; index < recordIndexs.length; index++) {
41049
+ const recordIndex = recordIndexs[index];
41050
+ 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 {
41051
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41052
+ this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
41053
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
41054
+ this.records[recordIndex] = records[index];
41055
+ }
41056
+ }
41057
+ return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
41058
+ }
41059
+ const rawRecords = this._getRawRecordsArray();
41060
+ if (!rawRecords || !Array.isArray(this.records)) return [];
41061
+ const realUpdatedIndexs = [];
40972
41062
  for (let index = 0; index < recordIndexs.length; index++) {
40973
41063
  const recordIndex = recordIndexs[index];
40974
- 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 {
40975
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
40976
- this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
40977
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
40978
- this.records[recordIndex] = records[index];
41064
+ 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 {
41065
+ if (recordIndex >= this.records.length || recordIndex < 0) continue;
41066
+ const oldRecord = this.records[recordIndex],
41067
+ rawIndex = rawRecords.indexOf(oldRecord);
41068
+ rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
40979
41069
  }
40980
41070
  }
40981
- return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
41071
+ return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
40982
41072
  }
40983
41073
  updateRecordsForSorted(records, recordIndexs) {
40984
41074
  for (let index = 0; index < recordIndexs.length; index++) {
@@ -41046,23 +41136,30 @@
41046
41136
  setSortedIndexMap(field, filedMap) {
41047
41137
  this.sortedIndexMap.set(field, filedMap);
41048
41138
  }
41139
+ markForceVisibleRecord(record) {
41140
+ !record || "object" != typeof record && "function" != typeof record || (this._forceVisibleRecords || (this._forceVisibleRecords = new WeakSet()), this._forceVisibleRecords.add(record));
41141
+ }
41142
+ clearForceVisibleRecords() {
41143
+ this._forceVisibleRecords = void 0;
41144
+ }
41049
41145
  clearFilteredChildren(record) {
41050
41146
  var _a, _b;
41051
41147
  record.filteredChildren = void 0;
41052
41148
  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]);
41053
41149
  }
41054
41150
  filterRecord(record) {
41055
- var _a, _b, _c;
41151
+ var _a, _b, _c, _d;
41152
+ if (null === (_a = this._forceVisibleRecords) || void 0 === _a ? void 0 : _a.has(record)) return !0;
41056
41153
  let isReserved = !0;
41057
- for (let i = 0; i < (null === (_a = this.dataConfig.filterRules) || void 0 === _a ? void 0 : _a.length); i++) {
41058
- const filterRule = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules[i];
41154
+ for (let i = 0; i < (null === (_b = this.dataConfig.filterRules) || void 0 === _b ? void 0 : _b.length); i++) {
41155
+ const filterRule = null === (_c = this.dataConfig) || void 0 === _c ? void 0 : _c.filterRules[i];
41059
41156
  if (filterRule.filterKey) {
41060
41157
  const filterValue = record[filterRule.filterKey];
41061
41158
  if (-1 === filterRule.filteredValues.indexOf(filterValue)) {
41062
41159
  isReserved = !1;
41063
41160
  break;
41064
41161
  }
41065
- } else if (!(null === (_c = filterRule.filterFunc) || void 0 === _c ? void 0 : _c.call(filterRule, record))) {
41162
+ } else if (!(null === (_d = filterRule.filterFunc) || void 0 === _d ? void 0 : _d.call(filterRule, record))) {
41066
41163
  isReserved = !1;
41067
41164
  break;
41068
41165
  }
@@ -47612,35 +47709,11 @@
47612
47709
  return hoverMode;
47613
47710
  }
47614
47711
 
47615
- let brushingChartInstance,
47616
- brushingChartInstanceCellPos = {
47617
- col: -1,
47618
- row: -1
47619
- };
47620
- function setBrushingChartInstance(chartInstance, col, row) {
47621
- brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
47622
- col: col,
47623
- row: row
47624
- };
47625
- }
47626
- function clearBrushingChartInstance() {
47627
- brushingChartInstance = void 0, brushingChartInstanceCellPos = {
47628
- col: -1,
47629
- row: -1
47630
- };
47631
- }
47632
- function getBrushingChartInstance() {
47633
- return brushingChartInstance;
47634
- }
47635
- function getBrushingChartInstanceCellPos() {
47636
- return brushingChartInstanceCellPos;
47637
- }
47638
47712
  const chartInstanceListColumnByColumnDirection = {};
47639
47713
  const chartInstanceListRowByRowDirection = {};
47640
- const delayRunDimensionHoverTimer = [];
47641
47714
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47642
47715
  var _a;
47643
- clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47716
+ isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47644
47717
  const {
47645
47718
  rowStart: rowStart
47646
47719
  } = table.getBodyVisibleRowRange();
@@ -47649,40 +47722,76 @@
47649
47722
  for (let i = rowStart; i <= rowEnd; i++) {
47650
47723
  const cellGroup = table.scenegraph.getCell(col, i),
47651
47724
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47652
- chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
47653
- const timer = setTimeout(() => {
47654
- var _a, _b, _c, _d;
47725
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
47726
+ var _a, _b, _c, _d, _e, _f;
47655
47727
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47656
47728
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47657
47729
  let isShowTooltip = !isScatter;
47658
- 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 {
47659
- const cellBoundry = table.getCellRelativeRect(col, i),
47660
- bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47730
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
47731
+ const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
47732
+ {
47733
+ rowEnd: rowEnd1
47734
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47735
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47736
+ const {
47737
+ rowEnd: rowEnd2
47738
+ } = table.getBodyVisibleRowRange(0, 5);
47739
+ isShowTooltip = rowEnd2 !== rowEnd;
47740
+ }
47741
+ } else if (i === rowStart && isShowTooltip) {
47742
+ const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
47743
+ {
47744
+ rowStart: rowStart1
47745
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47746
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
47747
+ const {
47748
+ rowStart: rowStart2
47749
+ } = table.getBodyVisibleRowRange(0, -5);
47750
+ isShowTooltip = rowStart2 !== rowStart;
47751
+ }
47752
+ }
47753
+ 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 {
47754
+ const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47661
47755
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
47662
47756
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47663
47757
  tooltip: !1,
47664
47758
  showTooltipOption: {
47665
- x: canvasXY.x - cellBoundry.left,
47666
- y: absolutePositionTop - cellBoundry.top,
47759
+ x: canvasXY.x,
47760
+ y: absolutePositionTop,
47667
47761
  activeType: "dimension"
47668
47762
  }
47669
47763
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47670
47764
  tooltip: isShowTooltip,
47671
47765
  showTooltipOption: {
47672
- x: canvasXY.x - cellBoundry.left,
47673
- y: absolutePositionTop - cellBoundry.top,
47766
+ x: canvasXY.x,
47767
+ y: absolutePositionTop,
47674
47768
  activeType: "dimension"
47675
47769
  }
47676
47770
  });
47677
47771
  }
47678
47772
  }
47679
- }, 0);
47680
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47773
+ }, 0), table.scenegraph.updateNextFrame();
47774
+ }
47775
+ }
47776
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
47777
+ var _a;
47778
+ if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
47779
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
47780
+ if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
47781
+ const cellGroup = table.scenegraph.getCell(col, Number(i)),
47782
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47783
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
47784
+ releaseChartInstance: !0,
47785
+ releaseColumnChartInstance: !1,
47786
+ releaseRowChartInstance: !1
47787
+ }), chartInstanceListColumnByColumnDirection[col][i] = null);
47788
+ }
47789
+ delete chartInstanceListColumnByColumnDirection[col];
47681
47790
  }
47682
47791
  }
47683
47792
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47684
47793
  var _a;
47685
- clearDelayRunDimensionHoverTimers(), isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47794
+ isValid$1(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47686
47795
  const {
47687
47796
  colStart: colStart
47688
47797
  } = table.getBodyVisibleColRange();
@@ -47691,162 +47800,64 @@
47691
47800
  for (let i = colStart; i <= colEnd; i++) {
47692
47801
  const cellGroup = table.scenegraph.getCell(i, row),
47693
47802
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47694
- chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
47695
- const timer = setTimeout(() => {
47803
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$1(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
47696
47804
  var _a, _b, _c, _d;
47697
47805
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
47698
47806
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47699
47807
  let isShowTooltip = !isScatter;
47700
- 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 {
47701
- const cellBoundry = table.getCellRelativeRect(i, row),
47702
- bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47808
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
47809
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47810
+ {
47811
+ colEnd: colEnd1
47812
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47813
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
47814
+ const {
47815
+ colEnd: colEnd2
47816
+ } = table.getBodyVisibleColRange(0, 5);
47817
+ isShowTooltip = colEnd2 !== colEnd;
47818
+ }
47819
+ } else if (i === colStart && isShowTooltip) {
47820
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47821
+ {
47822
+ colStart: colStart1
47823
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47824
+ if (colStart1 === colStart) isShowTooltip = !0;else {
47825
+ const {
47826
+ colStart: colStart2
47827
+ } = table.getBodyVisibleColRange(0, -5);
47828
+ isShowTooltip = colStart2 !== colStart;
47829
+ }
47830
+ }
47831
+ 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 {
47832
+ const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47703
47833
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
47704
47834
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47705
47835
  tooltip: !1,
47706
47836
  showTooltipOption: {
47707
- x: absolutePositionLeft - cellBoundry.left,
47708
- y: canvasXY.y - cellBoundry.top,
47837
+ x: absolutePositionLeft,
47838
+ y: canvasXY.y,
47709
47839
  activeType: "dimension"
47710
47840
  }
47711
47841
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47712
47842
  tooltip: isShowTooltip,
47713
47843
  showTooltipOption: {
47714
- x: absolutePositionLeft - cellBoundry.left,
47715
- y: canvasXY.y - cellBoundry.top,
47844
+ x: absolutePositionLeft,
47845
+ y: canvasXY.y,
47716
47846
  activeType: "dimension"
47717
47847
  }
47718
47848
  });
47719
47849
  }
47720
47850
  }
47721
- }, 0);
47722
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47851
+ }, 0), table.scenegraph.updateNextFrame();
47723
47852
  }
47724
47853
  }
47725
- function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
47726
- var _a;
47727
- clearDelayRunDimensionHoverTimers();
47728
- const {
47729
- rowStart: rowStart
47730
- } = table.getBodyVisibleRowRange();
47731
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47732
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47733
- const {
47734
- colStart: colStart
47735
- } = table.getBodyVisibleColRange();
47736
- let colEnd = table.getBodyVisibleColRange().colEnd;
47737
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47738
- for (let col = colStart; col <= colEnd; col++) {
47739
- isValid$1(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47740
- for (let i = rowStart; i <= rowEnd; i++) {
47741
- const cellGroup = table.scenegraph.getCell(col, i),
47742
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47743
- 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));
47744
- const timer = setTimeout(() => {
47745
- var _a, _b;
47746
- if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47747
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47748
- let isShowTooltip = !0;
47749
- "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, {
47750
- activeType: "mark"
47751
- })));
47752
- }
47753
- }, 0);
47754
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47755
- }
47756
- }
47757
- }
47758
- function checkIsShowTooltipForEdgeRow(row, table) {
47759
- var _a, _b;
47760
- let isShowTooltip = !0;
47761
- const {
47762
- rowStart: rowStart
47763
- } = table.getBodyVisibleRowRange();
47764
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47765
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47766
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47767
- if (row === rowEnd && isShowTooltip) {
47768
- const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
47769
- {
47770
- rowEnd: rowEnd1
47771
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47772
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47773
- const {
47774
- rowEnd: rowEnd2
47775
- } = table.getBodyVisibleRowRange(0, 5);
47776
- isShowTooltip = rowEnd2 !== rowEnd;
47777
- }
47778
- } else if (row === rowStart && isShowTooltip) {
47779
- const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
47780
- {
47781
- rowStart: rowStart1
47782
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47783
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
47784
- const {
47785
- rowStart: rowStart2
47786
- } = table.getBodyVisibleRowRange(0, -5);
47787
- isShowTooltip = rowStart2 !== rowStart;
47788
- }
47789
- }
47790
- return isShowTooltip;
47791
- }
47792
- function checkIsShowTooltipForEdgeColumn(col, table) {
47793
- let isShowTooltip = !0;
47794
- const {
47795
- colStart: colStart
47796
- } = table.getBodyVisibleColRange();
47797
- let colEnd = table.getBodyVisibleColRange().colEnd;
47798
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47799
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47800
- if (col === colEnd && isShowTooltip) {
47801
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47802
- {
47803
- colEnd: colEnd1
47804
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47805
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
47806
- const {
47807
- colEnd: colEnd2
47808
- } = table.getBodyVisibleColRange(0, 5);
47809
- isShowTooltip = colEnd2 !== colEnd;
47810
- }
47811
- } else if (col === colStart && isShowTooltip) {
47812
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47813
- {
47814
- colStart: colStart1
47815
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47816
- if (colStart1 === colStart) isShowTooltip = !0;else {
47817
- const {
47818
- colStart: colStart2
47819
- } = table.getBodyVisibleColRange(0, -5);
47820
- isShowTooltip = colStart2 !== colStart;
47821
- }
47822
- }
47823
- return isShowTooltip;
47824
- }
47825
- function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
47826
- var _a;
47827
- if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
47828
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
47829
- if (isValid$1(excludedRow) && Number(i) === excludedRow) continue;
47830
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
47831
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47832
- isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47833
- forceRelease: forceRelease,
47834
- releaseChartInstance: !0,
47835
- releaseColumnChartInstance: !1,
47836
- releaseRowChartInstance: !1
47837
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
47838
- }
47839
- delete chartInstanceListColumnByColumnDirection[col];
47840
- }
47841
- }
47842
- function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
47854
+ function clearChartInstanceListByRowDirection(row, excludedCol, table) {
47843
47855
  var _a;
47844
47856
  if (isValid$1(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
47845
47857
  if (isValid$1(excludedCol) && Number(i) === excludedCol) continue;
47846
47858
  const cellGroup = table.scenegraph.getCell(Number(i), row),
47847
47859
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47848
- isValid$1(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47849
- forceRelease: forceRelease,
47860
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$1(chartNode) && (chartNode.deactivate(table, {
47850
47861
  releaseChartInstance: !0,
47851
47862
  releaseColumnChartInstance: !1,
47852
47863
  releaseRowChartInstance: !1
@@ -47854,19 +47865,6 @@
47854
47865
  }
47855
47866
  delete chartInstanceListRowByRowDirection[row];
47856
47867
  }
47857
- function clearDelayRunDimensionHoverTimers() {
47858
- for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
47859
- delayRunDimensionHoverTimer.length = 0;
47860
- }
47861
- function clearAllChartInstanceList(table, forceRelease = !1) {
47862
- clearDelayRunDimensionHoverTimers();
47863
- for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
47864
- for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
47865
- }
47866
- let disabledShowTooltipToAllChartInstances = !1;
47867
- function isDisabledShowTooltipToAllChartInstances() {
47868
- return disabledShowTooltipToAllChartInstances;
47869
- }
47870
47868
 
47871
47869
  function isValidAlignDomain(domain) {
47872
47870
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -48500,7 +48498,7 @@
48500
48498
  const CHART_NUMBER_TYPE = genNumberType();
48501
48499
  class Chart extends Rect$2 {
48502
48500
  constructor(isShareChartSpec, params) {
48503
- 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 {
48501
+ 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 {
48504
48502
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
48505
48503
  renderCanvas: params.canvas,
48506
48504
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -48521,7 +48519,7 @@
48521
48519
  }
48522
48520
  }
48523
48521
  activate(table) {
48524
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48522
+ var _a, _b, _c, _d, _e;
48525
48523
  if (this.activeChartInstance) return;
48526
48524
  const {
48527
48525
  col: col,
@@ -48540,7 +48538,7 @@
48540
48538
  y1: y1 - table.scrollTop,
48541
48539
  y2: y2 - table.scrollTop
48542
48540
  });
48543
- this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
48541
+ 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, {
48544
48542
  renderCanvas: this.attribute.canvas,
48545
48543
  mode: "desktop-browser",
48546
48544
  canvasControled: !1,
@@ -48574,7 +48572,7 @@
48574
48572
  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());
48575
48573
  }
48576
48574
  },
48577
- componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
48575
+ componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
48578
48576
  tooltip: {
48579
48577
  dimension: !1,
48580
48578
  mark: !0
@@ -48585,43 +48583,16 @@
48585
48583
  const chartStage = this.activeChartInstance.getStage(),
48586
48584
  matrix = this.globalTransMatrix.clone(),
48587
48585
  stageMatrix = this.stage.window.getViewBoxTransform();
48588
- let brushChangeThrottle;
48589
48586
  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 => {
48590
48587
  var _a;
48591
- !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");
48592
- }), (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 => {
48593
- var _a;
48594
- brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
48595
- })), this.activeChartInstance.on("brushStart", params => {
48596
- const brushingChartInstance = getBrushingChartInstance();
48597
- brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
48588
+ !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);
48598
48589
  }), this.activeChartInstance.on("brushEnd", params => {
48599
48590
  var _a;
48600
- 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(() => {
48591
+ table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
48601
48592
  Chart.temp = 1;
48602
48593
  }, 0);
48603
- }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
48604
- markName: "pie"
48605
- }, params => {
48606
- var _a;
48607
- const categoryField = this.attribute.spec.categoryField,
48608
- datum = {
48609
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48610
- };
48611
- generateChartInstanceListByViewRange(datum, table, !1);
48612
- }), this.activeChartInstance.on("pointerout", {
48613
- markName: "pie"
48614
- }, params => {
48615
- var _a;
48616
- const categoryField = this.attribute.spec.categoryField,
48617
- datum = {
48618
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48619
- };
48620
- generateChartInstanceListByViewRange(datum, table, !0);
48621
- })), this.activeChartInstance.on("dimensionHover", params => {
48594
+ }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
48622
48595
  var _a, _b;
48623
- if (isDisabledShowTooltipToAllChartInstances()) return;
48624
- this.activeChartInstance.disableTooltip(!1);
48625
48596
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
48626
48597
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
48627
48598
  viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
@@ -48638,11 +48609,11 @@
48638
48609
  prev_justShowMarkTooltip = this.justShowMarkTooltip;
48639
48610
  params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
48640
48611
  let delayRunDimensionHover = !1;
48641
- 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) {
48612
+ 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) {
48642
48613
  const dimensionValue = dimensionInfo.value,
48643
48614
  indicatorsAsCol = table.options.indicatorsAsCol;
48644
- if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
48645
- isDisabledShowTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
48615
+ if (delayRunDimensionHover ? (clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = setTimeout(() => {
48616
+ indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
48646
48617
  }, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
48647
48618
  const series = dimensionInfo.data[0].series,
48648
48619
  width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
@@ -48683,26 +48654,21 @@
48683
48654
  }
48684
48655
  }
48685
48656
  }
48686
- })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledShowTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
48687
- }
48688
- clearDelayRunDimensionHoverTimer() {
48689
- clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
48657
+ }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
48690
48658
  }
48691
48659
  deactivate(table, {
48692
- forceRelease = !1,
48693
48660
  releaseChartInstance = !0,
48694
48661
  releaseColumnChartInstance = !0,
48695
- releaseRowChartInstance = !0,
48696
- releaseAllChartInstance = !1
48662
+ releaseRowChartInstance = !0
48697
48663
  } = {}) {
48698
48664
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48699
- if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
48700
- !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48665
+ if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
48666
+ null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48701
48667
  x1: -1e3,
48702
48668
  x2: -800,
48703
48669
  y1: -1e3,
48704
48670
  y2: -800
48705
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
48671
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
48706
48672
  const {
48707
48673
  col: col,
48708
48674
  row: row
@@ -48715,7 +48681,7 @@
48715
48681
  } = this.parent;
48716
48682
  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));
48717
48683
  }
48718
- 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));
48684
+ 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);
48719
48685
  }
48720
48686
  updateData(data) {
48721
48687
  this.attribute.data = data;
@@ -48730,14 +48696,13 @@
48730
48696
  y1: y1,
48731
48697
  x2: x2,
48732
48698
  y2: y2
48733
- } = cellGroup.globalAABBBounds,
48734
- viewBox = {
48735
- 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)),
48736
- 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)),
48737
- 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)),
48738
- 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))
48739
- };
48740
- return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
48699
+ } = cellGroup.globalAABBBounds;
48700
+ return {
48701
+ 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)),
48702
+ 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)),
48703
+ 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)),
48704
+ 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))
48705
+ };
48741
48706
  }
48742
48707
  }
48743
48708
  function getTableBounds(col, row, table) {
@@ -48952,7 +48917,7 @@
48952
48917
  {
48953
48918
  width = groupAttribute.width,
48954
48919
  height = groupAttribute.height
48955
- } = chart.attribute,
48920
+ } = (chart.getViewBox(), chart.attribute),
48956
48921
  {
48957
48922
  table: table
48958
48923
  } = chart.getRootNode(),
@@ -48980,9 +48945,8 @@
48980
48945
  });
48981
48946
  }
48982
48947
  }
48983
- const lastViewBox = chart.activeChartInstanceLastViewBox,
48984
- viewBox = chart.getViewBox();
48985
- lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
48948
+ const viewBox = chart.getViewBox();
48949
+ activeChartInstance.updateViewBox({
48986
48950
  x1: 0,
48987
48951
  x2: viewBox.x2 - viewBox.x1,
48988
48952
  y1: 0,
@@ -52500,10 +52464,9 @@
52500
52464
  });
52501
52465
  }
52502
52466
  }
52503
- function updateChartState(scenegraph, datum, selectedDataMode) {
52467
+ function updateChartState(scenegraph, datum) {
52504
52468
  const table = scenegraph.table;
52505
52469
  if (table.isPivotChart()) {
52506
- table._selectedDataMode = selectedDataMode;
52507
52470
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
52508
52471
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
52509
52472
  const newSelectedDataItemsInChart = [];
@@ -53251,39 +53214,16 @@
53251
53214
  resetResidentHoverIcon(col, row) {
53252
53215
  resetResidentHoverIcon(col, row, this);
53253
53216
  }
53254
- deactivateChart(col, row, forceRelease = !1) {
53255
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53256
- if (-1 === col || -1 === row) {
53257
- if (forceRelease) {
53258
- const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
53259
- brushingChartInstance = getBrushingChartInstance();
53260
- if (brushingChartInstanceCellPos && brushingChartInstance) {
53261
- const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
53262
- (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, {
53263
- forceRelease: !0,
53264
- releaseChartInstance: !0,
53265
- releaseColumnChartInstance: !0,
53266
- releaseRowChartInstance: !0,
53267
- releaseAllChartInstance: !0
53268
- }));
53269
- }
53270
- }
53271
- return;
53272
- }
53217
+ deactivateChart(col, row) {
53218
+ var _a, _b, _c;
53219
+ if (-1 === col || -1 === row) return;
53273
53220
  const cellGroup = this.getCell(col, row);
53274
- if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
53275
- 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, {
53276
- forceRelease: !0,
53277
- releaseChartInstance: !0,
53278
- releaseColumnChartInstance: !0,
53279
- releaseRowChartInstance: !0,
53280
- releaseAllChartInstance: !0
53281
- }));
53221
+ if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
53282
53222
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
53283
- 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) ? {
53284
- 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),
53285
- 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),
53286
- 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)
53223
+ 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 ? {
53224
+ 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,
53225
+ 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,
53226
+ 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
53287
53227
  } : void 0);
53288
53228
  }
53289
53229
  }
@@ -53331,15 +53271,8 @@
53331
53271
  updateChartSizeForResizeRowHeight(row) {
53332
53272
  updateChartSizeForResizeRowHeight(this, row);
53333
53273
  }
53334
- updateChartState(datum, selectedDataMode) {
53335
- var _a, _b;
53336
- if (this.table.isPivotChart()) {
53337
- if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
53338
- const brushingChartInstance = getBrushingChartInstance();
53339
- 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);
53340
- }
53341
- updateChartState(this, datum, selectedDataMode);
53342
- }
53274
+ updateChartState(datum) {
53275
+ this.table.isPivotChart() && updateChartState(this, datum);
53343
53276
  }
53344
53277
  updateCheckboxCellState(col, row, checked) {
53345
53278
  var _a, _b;
@@ -56366,7 +56299,7 @@
56366
56299
  }, 0 !== e.button) return;
56367
56300
  const eventArgsSet = getCellEventArgsSet(e);
56368
56301
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
56369
- 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;
56302
+ 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;
56370
56303
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
56371
56304
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
56372
56305
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -56394,7 +56327,7 @@
56394
56327
  }
56395
56328
  eventManager.dealTableHover(eventArgsSet);
56396
56329
  } else {
56397
- 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);
56330
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
56398
56331
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56399
56332
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56400
56333
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -56546,7 +56479,7 @@
56546
56479
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
56547
56480
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
56548
56481
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
56549
- table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
56482
+ table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
56550
56483
  const {
56551
56484
  eventArgs: eventArgs
56552
56485
  } = eventArgsSet;
@@ -56565,7 +56498,7 @@
56565
56498
  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 {
56566
56499
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
56567
56500
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
56568
- (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);
56501
+ (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);
56569
56502
  }
56570
56503
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
56571
56504
  var _a, _b, _c;
@@ -56683,15 +56616,7 @@
56683
56616
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
56684
56617
  }), table.scenegraph.stage.addEventListener("wheel", e => {
56685
56618
  var _a;
56686
- if (!e.path.find(node => "legend" === node.name)) {
56687
- null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
56688
- const {
56689
- cellPos: cellPos
56690
- } = table.stateManager.hover,
56691
- prevHoverCellCol = cellPos.col,
56692
- prevHoverCellRow = cellPos.row;
56693
- table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
56694
- }
56619
+ e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
56695
56620
  });
56696
56621
  }
56697
56622
  function bindGesture(eventManager) {
@@ -56806,13 +56731,11 @@
56806
56731
  const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
56807
56732
  throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
56808
56733
  scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
56809
- var _a;
56810
- 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);
56734
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
56811
56735
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
56812
56736
  throttleVerticalWheel(ratio, e);
56813
56737
  }), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
56814
- var _a;
56815
- 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);
56738
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
56816
56739
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
56817
56740
  throttleHorizontalWheel(ratio);
56818
56741
  });
@@ -56962,7 +56885,7 @@
56962
56885
  const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
56963
56886
  eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
56964
56887
  }
56965
- }), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
56888
+ });
56966
56889
  }
56967
56890
  };
56968
56891
  eventManager.globalEventListeners.push({
@@ -57473,7 +57396,7 @@
57473
57396
  };
57474
57397
  let EventManager$1 = class EventManager {
57475
57398
  constructor(table) {
57476
- 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(() => {
57399
+ 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(() => {
57477
57400
  this.bindSelfEvent();
57478
57401
  }, 0));
57479
57402
  }
@@ -57775,15 +57698,25 @@
57775
57698
  } catch (error) {}
57776
57699
  }
57777
57700
  handleCut(e) {
57701
+ var _a;
57778
57702
  return __awaiter$1(this, void 0, void 0, function* () {
57779
- this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57780
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
57703
+ 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 => ({
57704
+ start: {
57705
+ col: r.start.col,
57706
+ row: r.start.row
57707
+ },
57708
+ end: {
57709
+ col: r.end.col,
57710
+ row: r.end.row
57711
+ }
57712
+ })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57713
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
57781
57714
  }, 3e4), this.saveClipboardContent();
57782
57715
  });
57783
57716
  }
57784
57717
  handlePaste(e) {
57785
57718
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
57786
- this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57719
+ 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));
57787
57720
  }).catch(() => {
57788
57721
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57789
57722
  }) : this.executePaste(e);
@@ -57860,9 +57793,9 @@
57860
57793
  }
57861
57794
  clearCutArea(table) {
57862
57795
  try {
57863
- const selectCells = this.cutCellRange;
57864
- if (!selectCells || 0 === selectCells.length) return;
57865
- 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);
57796
+ const ranges = this.cutRanges;
57797
+ if (!ranges || 0 === ranges.length) return;
57798
+ table.changeCellValuesByIds(ranges, "");
57866
57799
  } catch (error) {}
57867
57800
  }
57868
57801
  checkClipboardChanged() {
@@ -59800,6 +59733,15 @@
59800
59733
  constructor(table, customCellStyle, customCellStyleArrangement) {
59801
59734
  this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
59802
59735
  }
59736
+ clearCustomCellStyleArrangement() {
59737
+ this.customCellStyleArrangement = [];
59738
+ }
59739
+ addCustomCellStyleArrangement(cellPosition, customStyleId) {
59740
+ this.customCellStyleArrangement.push({
59741
+ cellPosition: cellPosition,
59742
+ customStyleId: customStyleId
59743
+ });
59744
+ }
59803
59745
  getCustomCellStyle(col, row) {
59804
59746
  const customStyleIds = this.getCustomCellStyleIds(col, row);
59805
59747
  if (customStyleIds.length) {
@@ -60105,7 +60047,7 @@
60105
60047
  }
60106
60048
  constructor(container, options = {}) {
60107
60049
  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;
60108
- 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");
60050
+ 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");
60109
60051
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
60110
60052
  options: options,
60111
60053
  container: container
@@ -63916,15 +63858,16 @@
63916
63858
  step((generator = generator.apply(thisArg, _arguments || [])).next());
63917
63859
  });
63918
63860
  };
63919
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
63861
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63920
63862
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
63921
- const recordIndex = table.getRecordShowIndexByCell(col, row),
63863
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
63864
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63922
63865
  {
63923
63866
  field: field
63924
63867
  } = table.internalProps.layoutMap.getBody(col, row),
63925
63868
  beforeChangeValue = table.getCellRawValue(col, row),
63926
63869
  oldValue = table.getCellOriginValue(col, row);
63927
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
63870
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
63928
63871
  const range = table.getCellRange(col, row),
63929
63872
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
63930
63873
  if (aggregators) {
@@ -63947,16 +63890,24 @@
63947
63890
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
63948
63891
  }
63949
63892
  const changedValue = table.getCellOriginValue(col, row);
63950
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
63951
- col: col,
63952
- row: row,
63953
- rawValue: beforeChangeValue,
63954
- currentValue: oldValue,
63955
- changedValue: changedValue
63956
- }), table.scenegraph.updateNextFrame();
63893
+ if (oldValue !== changedValue && triggerEvent) {
63894
+ const changeValue = {
63895
+ col: col,
63896
+ row: row,
63897
+ recordIndex: recordIndex,
63898
+ field: field,
63899
+ rawValue: beforeChangeValue,
63900
+ currentValue: oldValue,
63901
+ changedValue: changedValue
63902
+ };
63903
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63904
+ values: [changeValue]
63905
+ });
63906
+ }
63907
+ table.scenegraph.updateNextFrame();
63957
63908
  }
63958
63909
  }
63959
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
63910
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63960
63911
  var _a, _b;
63961
63912
  return __awaiter(this, void 0, void 0, function* () {
63962
63913
  const changedCellResults = [];
@@ -63978,6 +63929,7 @@
63978
63929
  oldRowValues.push(oldValue);
63979
63930
  }
63980
63931
  }
63932
+ const resultChangeValues = [];
63981
63933
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
63982
63934
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
63983
63935
  const rowValues = values[i];
@@ -64001,25 +63953,34 @@
64001
63953
  if (isCanChange) {
64002
63954
  changedCellResults[i][j] = !0;
64003
63955
  const value = rowValues[j],
64004
- recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63956
+ recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
63957
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64005
63958
  {
64006
63959
  field: field
64007
63960
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
64008
63961
  beforeChangeValue = beforeChangeValues[i][j],
64009
63962
  oldValue = oldValues[i][j];
64010
- 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);
63963
+ 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);
64011
63964
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
64012
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
64013
- col: startCol + j,
64014
- row: startRow + i,
64015
- rawValue: beforeChangeValue,
64016
- currentValue: oldValue,
64017
- changedValue: changedValue
64018
- });
63965
+ if (oldValue !== changedValue && triggerEvent) {
63966
+ const changeValue = {
63967
+ col: startCol + j,
63968
+ row: startRow + i,
63969
+ recordIndex: recordIndex,
63970
+ field: field,
63971
+ rawValue: beforeChangeValue,
63972
+ currentValue: oldValue,
63973
+ changedValue: changedValue
63974
+ };
63975
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
63976
+ }
64019
63977
  } else changedCellResults[i][j] = !1;
64020
63978
  }
64021
63979
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
64022
63980
  }
63981
+ silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63982
+ values: resultChangeValues
63983
+ });
64023
63984
  const startRange = table.getCellRange(startCol, startRow),
64024
63985
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
64025
63986
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -64053,6 +64014,58 @@
64053
64014
  return table.scenegraph.updateNextFrame(), changedCellResults;
64054
64015
  });
64055
64016
  }
64017
+ function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
64018
+ var _a, _b;
64019
+ return __awaiter(this, void 0, void 0, function* () {
64020
+ const resultChangeValues = [],
64021
+ processed = new Set(),
64022
+ nextValue = null != value ? value : "";
64023
+ for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
64024
+ const range = ranges[i],
64025
+ startCol = Math.min(range.start.col, range.end.col),
64026
+ endCol = Math.max(range.start.col, range.end.col),
64027
+ startRow = Math.min(range.start.row, range.end.row),
64028
+ endRow = Math.max(range.start.row, range.end.row);
64029
+ if (startCol > endCol || startRow > endRow) continue;
64030
+ const values = [],
64031
+ oldValues = [];
64032
+ for (let row = startRow; row <= endRow; row++) {
64033
+ const rowValues = [],
64034
+ rowOldValues = [];
64035
+ for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
64036
+ values.push(rowValues), oldValues.push(rowOldValues);
64037
+ }
64038
+ const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
64039
+ for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
64040
+ const col = startCol + c,
64041
+ row = startRow + r,
64042
+ key = `${col},${row}`;
64043
+ if (processed.has(key)) continue;
64044
+ if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
64045
+ const oldValue = oldValues[r][c],
64046
+ changedValue = table.getCellOriginValue(col, row);
64047
+ if (oldValue === changedValue) continue;
64048
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
64049
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64050
+ {
64051
+ field: field
64052
+ } = table.internalProps.layoutMap.getBody(col, row);
64053
+ resultChangeValues.push({
64054
+ col: col,
64055
+ row: row,
64056
+ recordIndex: recordIndex,
64057
+ field: field,
64058
+ rawValue: oldValue,
64059
+ currentValue: oldValue,
64060
+ changedValue: changedValue
64061
+ });
64062
+ }
64063
+ }
64064
+ !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
64065
+ values: resultChangeValues
64066
+ });
64067
+ });
64068
+ }
64056
64069
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
64057
64070
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
64058
64071
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -64070,13 +64083,16 @@
64070
64083
  }), table.dataSource.sort(sortState));
64071
64084
  }
64072
64085
  function listTableAddRecord(record, recordIndex, table) {
64073
- var _a, _b, _c, _d;
64086
+ var _a, _b, _c, _d, _e, _f;
64074
64087
  try {
64075
64088
  if (!record) return !1;
64076
- 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 {
64089
+ 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) {
64090
+ !!(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();
64091
+ } else {
64077
64092
  (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
64078
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
64079
- table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
64093
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
64094
+ syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
64095
+ 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;
64080
64096
  const oldRowCount = table.rowCount;
64081
64097
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64082
64098
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -64145,13 +64161,16 @@
64145
64161
  }
64146
64162
  }
64147
64163
  function listTableAddRecords(records, recordIndex, table) {
64148
- var _a, _b, _c, _d;
64164
+ var _a, _b, _c, _d, _e, _f;
64149
64165
  try {
64150
64166
  if (!records || 0 === records.length) return !1;
64151
- 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 {
64167
+ 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) {
64168
+ !!(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();
64169
+ } else {
64152
64170
  void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
64153
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
64154
- table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
64171
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
64172
+ syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
64173
+ 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;
64155
64174
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
64156
64175
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64157
64176
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -64220,16 +64239,20 @@
64220
64239
  }
64221
64240
  }
64222
64241
  function listTableDeleteRecords(recordIndexs, table) {
64223
- var _a, _b, _c, _d, _e, _f, _g, _h;
64242
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
64224
64243
  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) {
64225
64244
  const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
64226
64245
  if (0 === deletedRecordIndexs.length) return;
64227
64246
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
64228
64247
  table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
64229
- } else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64230
- const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
64248
+ } else if (table.sortState) {
64249
+ !!(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();
64250
+ } else {
64251
+ const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
64252
+ deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
64231
64253
  if (0 === deletedRecordIndexs.length) return;
64232
64254
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
64255
+ if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
64233
64256
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
64234
64257
  table.refreshRowColCount();
64235
64258
  const newRowCount = table.transpose ? table.colCount : table.rowCount,
@@ -64267,7 +64290,7 @@
64267
64290
  col: 0,
64268
64291
  row: row
64269
64292
  });
64270
- 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();
64293
+ 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();
64271
64294
  }
64272
64295
  } else {
64273
64296
  const delRows = [],
@@ -64299,15 +64322,19 @@
64299
64322
  col: 0,
64300
64323
  row: row
64301
64324
  });
64302
- 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();
64325
+ 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();
64303
64326
  }
64304
64327
  }
64305
64328
  }
64306
64329
  function listTableUpdateRecords(records, recordIndexs, table) {
64307
- var _a, _b, _c, _d;
64308
- 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 {
64309
- const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
64330
+ var _a, _b, _c, _d, _e, _f;
64331
+ 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) {
64332
+ !!(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();
64333
+ } else {
64334
+ const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
64335
+ updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
64310
64336
  if (0 === updateRecordIndexs.length) return;
64337
+ if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
64311
64338
  const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
64312
64339
  if (table.pagination) {
64313
64340
  const {
@@ -65073,8 +65100,8 @@
65073
65100
  updateFilterRules(filterRules, options = {
65074
65101
  clearRowHeightCache: !0
65075
65102
  }) {
65076
- var _a;
65077
- 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();
65103
+ var _a, _b, _c;
65104
+ 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();
65078
65105
  }
65079
65106
  getFilteredRecords() {
65080
65107
  return this.dataSource.records;
@@ -65216,43 +65243,165 @@
65216
65243
  }
65217
65244
  return isValid$1(editorDefine);
65218
65245
  }
65219
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
65220
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
65246
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65247
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65248
+ }
65249
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65250
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65251
+ }
65252
+ changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65253
+ return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65254
+ }
65255
+ changeSourceCellValue(recordIndex, field, value) {
65256
+ const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
65257
+ cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
65258
+ if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
65259
+ this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
65260
+ const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
65261
+ oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
65262
+ changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
65263
+ if (oldValue !== changedValue) {
65264
+ const changeValue = {
65265
+ col: cellAddr.col,
65266
+ row: cellAddr.row,
65267
+ recordIndex: recordIndex,
65268
+ field: field,
65269
+ rawValue: beforeChangeValue,
65270
+ currentValue: oldValue,
65271
+ changedValue: changedValue
65272
+ };
65273
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65274
+ values: [changeValue]
65275
+ });
65276
+ }
65221
65277
  }
65222
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
65223
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
65278
+ changeCellValueByRecord(recordIndex, field, value, options) {
65279
+ var _a, _b, _c, _d, _e;
65280
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65281
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65282
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65283
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65284
+ let record, oldValue;
65285
+ 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;
65286
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65287
+ if (oldValue !== changedValue) {
65288
+ const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
65289
+ changeValue = {
65290
+ col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
65291
+ row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
65292
+ recordIndex: recordIndex,
65293
+ field: field,
65294
+ rawValue: oldValue,
65295
+ currentValue: oldValue,
65296
+ changedValue: changedValue
65297
+ };
65298
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65299
+ values: [changeValue]
65300
+ });
65301
+ }
65302
+ autoRefresh && this.refreshAfterSourceChange();
65303
+ }
65304
+ changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
65305
+ return this.changeCellValueByRecord(recordIndex, field, value, {
65306
+ triggerEvent: triggerEvent,
65307
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65308
+ autoRefresh: !0
65309
+ });
65310
+ }
65311
+ changeCellValuesByRecords(changeValues, options) {
65312
+ var _a, _b, _c, _d, _e, _f, _g;
65313
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65314
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65315
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65316
+ resultChangeValues = [];
65317
+ for (let i = 0; i < changeValues.length; i++) {
65318
+ const {
65319
+ recordIndex: recordIndex,
65320
+ field: field,
65321
+ value: value
65322
+ } = changeValues[i],
65323
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65324
+ let record, oldValue;
65325
+ 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) {
65326
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65327
+ if (oldValue !== changedValue) {
65328
+ const changeValue = {
65329
+ col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
65330
+ row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
65331
+ recordIndex: recordIndex,
65332
+ field: field,
65333
+ rawValue: oldValue,
65334
+ currentValue: oldValue,
65335
+ changedValue: changedValue
65336
+ };
65337
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
65338
+ }
65339
+ }
65340
+ }
65341
+ !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65342
+ values: resultChangeValues
65343
+ }), autoRefresh && this.refreshAfterSourceChange();
65344
+ }
65345
+ changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
65346
+ return this.changeCellValuesByRecords(changeValues, {
65347
+ triggerEvent: triggerEvent,
65348
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65349
+ autoRefresh: !0
65350
+ });
65351
+ }
65352
+ refreshAfterSourceChange(options) {
65353
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
65354
+ const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
65355
+ reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
65356
+ clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
65357
+ 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);
65358
+ const traverseColumns = columns => {
65359
+ var _a, _b, _c, _d;
65360
+ for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
65361
+ const column = columns[i],
65362
+ aggregators = null == column ? void 0 : column.vtable_aggregator;
65363
+ 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);
65364
+ (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
65365
+ }
65366
+ };
65367
+ 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();
65224
65368
  }
65225
- addRecord(record, recordIndex) {
65369
+ addRecord(record, recordIndex, triggerEvent = !0) {
65226
65370
  var _a;
65227
65371
  const success = listTableAddRecord(record, recordIndex, this);
65228
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65372
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65229
65373
  records: [record],
65230
65374
  recordIndex: recordIndex,
65231
65375
  recordCount: 1
65232
65376
  });
65233
65377
  }
65234
- addRecords(records, recordIndex) {
65378
+ addRecords(records, recordIndex, triggerEvent = !0) {
65235
65379
  var _a;
65236
65380
  const success = listTableAddRecords(records, recordIndex, this);
65237
- "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, {
65381
+ "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, {
65238
65382
  records: records,
65239
65383
  recordIndex: recordIndex,
65240
65384
  recordCount: records.length
65241
65385
  });
65242
65386
  }
65243
- deleteRecords(recordIndexs) {
65387
+ deleteRecords(recordIndexs, triggerEvent = !0) {
65244
65388
  var _a;
65245
- listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65389
+ const deletedRecords = [];
65390
+ (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
65391
+ let record = null;
65392
+ record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
65393
+ }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65246
65394
  const rowIndexs = [];
65247
65395
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
65248
- this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65396
+ triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65249
65397
  recordIndexs: recordIndexs,
65398
+ records: deletedRecords,
65250
65399
  rowIndexs: rowIndexs,
65251
65400
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
65252
65401
  });
65253
65402
  }
65254
- updateRecords(records, recordIndexs) {
65255
- listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65403
+ updateRecords(records, recordIndexs, triggerEvent = !0) {
65404
+ listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65256
65405
  records: records,
65257
65406
  recordIndexs: recordIndexs,
65258
65407
  updateCount: records.length
@@ -76410,7 +76559,7 @@
76410
76559
  PluginManager: PluginManager
76411
76560
  });
76412
76561
 
76413
- const version = "1.22.11-alpha.8";
76562
+ const version = "1.22.11-alpha.9";
76414
76563
 
76415
76564
  exports.Gantt = Gantt;
76416
76565
  exports.TYPES = index$4;