@visactor/vtable-sheet 1.22.11-alpha.6 → 1.22.11-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37856,24 +37856,6 @@
37856
37856
  }, delay));
37857
37857
  };
37858
37858
  }
37859
- function cancellableThrottle(func, delay) {
37860
- let timer = null,
37861
- lastArgs = null,
37862
- context = null;
37863
- return {
37864
- throttled: function (...args) {
37865
- lastArgs = args, context = this, timer || (timer = setTimeout(() => {
37866
- lastArgs && func.apply(context, lastArgs), timer = null, lastArgs = null, context = null;
37867
- }, delay));
37868
- },
37869
- cancel: () => {
37870
- timer && (clearTimeout(timer), timer = null, lastArgs = null, context = null);
37871
- },
37872
- flush: () => {
37873
- timer && lastArgs && (clearTimeout(timer), func.apply(context, lastArgs), timer = null, lastArgs = null, context = null);
37874
- }
37875
- };
37876
- }
37877
37859
  function pad(num, totalChars) {
37878
37860
  for (num = `${num}`; num.length < totalChars;) num = "0" + num;
37879
37861
  return num;
@@ -38846,6 +38828,7 @@
38846
38828
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
38847
38829
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
38848
38830
  CHANGE_CELL_VALUE: "change_cell_value",
38831
+ CHANGE_CELL_VALUES: "change_cell_values",
38849
38832
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
38850
38833
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
38851
38834
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -40978,6 +40961,24 @@
40978
40961
  }
40979
40962
  }
40980
40963
  }
40964
+ changeFieldValueByRecordIndex(value, recordIndex, field, table) {
40965
+ var _a, _b, _c, _d;
40966
+ if (null === field) return;
40967
+ if (null == recordIndex) return;
40968
+ const rawKey = recordIndex.toString();
40969
+ if (!this.beforeChangedRecordsMap.has(rawKey)) {
40970
+ const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
40971
+ originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40972
+ this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep$1(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
40973
+ }
40974
+ if ("string" == typeof field || "number" == typeof field) {
40975
+ const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
40976
+ rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
40977
+ record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
40978
+ let formatValue = value;
40979
+ "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);
40980
+ }
40981
+ }
40981
40982
  cacheBeforeChangedRecord(dataIndex, table) {
40982
40983
  var _a;
40983
40984
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -40993,41 +40994,82 @@
40993
40994
  Array.isArray(indexed) || this.records.splice(indexed, 1, record);
40994
40995
  }
40995
40996
  }
40996
- addRecord(record, index) {
40997
+ _getRawRecordsArray() {
40997
40998
  var _a;
40998
- if (Array.isArray(this.records)) {
40999
- this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
41000
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
41001
- if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
41002
- this.pagination.totalCount = this._sourceLength;
41003
- const {
41004
- perPageCount: perPageCount,
41005
- currentPage: currentPage
41006
- } = this.pagination;
41007
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
41008
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
41009
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
40999
+ const rawRecords = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records;
41000
+ return Array.isArray(rawRecords) ? rawRecords : null;
41001
+ }
41002
+ _hasFilterInEffect() {
41003
+ var _a, _b, _c, _d, _e;
41004
+ 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;
41005
+ }
41006
+ _normalizeInsertIndex(index, length) {
41007
+ return null == index || index > length ? length : index < 0 ? 0 : index;
41008
+ }
41009
+ _mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
41010
+ if (viewIndex >= this.records.length) return rawRecords.length;
41011
+ if (viewIndex <= 0) return 0;
41012
+ const prevRecord = this.records[viewIndex - 1],
41013
+ rawIndex = rawRecords.indexOf(prevRecord);
41014
+ return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
41015
+ }
41016
+ _resetIndexingFromViewRecords() {
41017
+ if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
41018
+ length: this._sourceLength
41019
+ }, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
41020
+ this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
41021
+ }
41022
+ addRecord(record, index, syncToOriginalRecords = !1) {
41023
+ var _a, _b, _c;
41024
+ if (!syncToOriginalRecords) {
41025
+ if (Array.isArray(this.records)) {
41026
+ this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
41027
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
41028
+ if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
41029
+ this.pagination.totalCount = this._sourceLength;
41030
+ const {
41031
+ perPageCount: perPageCount,
41032
+ currentPage: currentPage
41033
+ } = this.pagination;
41034
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
41035
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
41036
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
41037
+ }
41038
+ return;
41010
41039
  }
41040
+ const rawRecords = this._getRawRecordsArray();
41041
+ if (!rawRecords) return;
41042
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
41043
+ rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
41044
+ rawRecords.splice(rawInsertIndex, 0, record), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, 1);
41011
41045
  }
41012
- addRecords(recordArr, index) {
41013
- var _a;
41014
- if (Array.isArray(this.records)) {
41015
- if (Array.isArray(recordArr)) {
41016
- this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
41017
- for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
41018
- this._sourceLength += recordArr.length;
41019
- for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
41046
+ addRecords(recordArr, index, syncToOriginalRecords = !1) {
41047
+ var _a, _b, _c;
41048
+ if (!syncToOriginalRecords) {
41049
+ if (Array.isArray(this.records)) {
41050
+ if (Array.isArray(recordArr)) {
41051
+ this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
41052
+ for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
41053
+ this._sourceLength += recordArr.length;
41054
+ for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
41055
+ }
41056
+ if (this.userPagination) {
41057
+ this.pagination.totalCount = this._sourceLength;
41058
+ const {
41059
+ perPageCount: perPageCount,
41060
+ currentPage: currentPage
41061
+ } = this.pagination;
41062
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
41063
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
41064
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
41020
41065
  }
41021
- if (this.userPagination) {
41022
- this.pagination.totalCount = this._sourceLength;
41023
- const {
41024
- perPageCount: perPageCount,
41025
- currentPage: currentPage
41026
- } = this.pagination;
41027
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
41028
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
41029
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
41066
+ return;
41030
41067
  }
41068
+ const rawRecords = this._getRawRecordsArray();
41069
+ if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
41070
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
41071
+ rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
41072
+ rawRecords.splice(rawInsertIndex, 0, ...recordArr), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, recordArr.length);
41031
41073
  }
41032
41074
  addRecordForSorted(record) {
41033
41075
  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));
@@ -41043,27 +41085,49 @@
41043
41085
  }
41044
41086
  }
41045
41087
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
41046
- for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
41047
- const record = this.beforeChangedRecordsMap.get(key.toString());
41048
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
41049
- }
41050
- }
41051
- deleteRecords(recordIndexs) {
41052
- var _a;
41053
- if (Array.isArray(this.records)) {
41054
- const realDeletedRecordIndexs = [],
41055
- recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
41056
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
41057
- const recordIndex = recordIndexsMaxToMin[index];
41058
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41059
- this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
41060
- const deletedRecord = this.records[recordIndex];
41061
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
41062
- this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
41063
- }
41064
- 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;
41088
+ const delta = "add" === type ? insertCount : -insertCount,
41089
+ numericKeys = [];
41090
+ this.beforeChangedRecordsMap.forEach((_, key) => {
41091
+ const numKey = Number(key);
41092
+ Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
41093
+ }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
41094
+ for (let i = 0; i < numericKeys.length; i++) {
41095
+ const key = numericKeys[i],
41096
+ record = this.beforeChangedRecordsMap.get(key.toString());
41097
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
41098
+ }
41099
+ }
41100
+ deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
41101
+ var _a, _b, _c;
41102
+ if (!syncToOriginalRecords) {
41103
+ if (Array.isArray(this.records)) {
41104
+ const realDeletedRecordIndexs = [],
41105
+ recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
41106
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
41107
+ const recordIndex = recordIndexsMaxToMin[index];
41108
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41109
+ this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
41110
+ const deletedRecord = this.records[recordIndex];
41111
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
41112
+ this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
41113
+ }
41114
+ 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;
41115
+ }
41116
+ return [];
41117
+ }
41118
+ const rawRecords = this._getRawRecordsArray();
41119
+ if (!rawRecords || !Array.isArray(this.records)) return [];
41120
+ const realDeletedRecordIndexs = [],
41121
+ recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
41122
+ rawDeletedIndexs = [];
41123
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
41124
+ const viewIndex = recordIndexsMaxToMin[index];
41125
+ if (viewIndex >= this.records.length || viewIndex < 0) continue;
41126
+ const deletedRecord = this.records[viewIndex],
41127
+ rawIndex = rawRecords.indexOf(deletedRecord);
41128
+ rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
41065
41129
  }
41066
- return [];
41130
+ 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;
41067
41131
  }
41068
41132
  deleteRecordsForSorted(recordIndexs) {
41069
41133
  if (Array.isArray(this.records)) {
@@ -41077,18 +41141,34 @@
41077
41141
  this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
41078
41142
  }
41079
41143
  }
41080
- updateRecords(records, recordIndexs) {
41081
- const realDeletedRecordIndexs = [];
41144
+ updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
41145
+ var _a;
41146
+ if (!syncToOriginalRecords) {
41147
+ const realDeletedRecordIndexs = [];
41148
+ for (let index = 0; index < recordIndexs.length; index++) {
41149
+ const recordIndex = recordIndexs[index];
41150
+ 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 {
41151
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41152
+ this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
41153
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
41154
+ this.records[recordIndex] = records[index];
41155
+ }
41156
+ }
41157
+ return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
41158
+ }
41159
+ const rawRecords = this._getRawRecordsArray();
41160
+ if (!rawRecords || !Array.isArray(this.records)) return [];
41161
+ const realUpdatedIndexs = [];
41082
41162
  for (let index = 0; index < recordIndexs.length; index++) {
41083
41163
  const recordIndex = recordIndexs[index];
41084
- 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 {
41085
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41086
- this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
41087
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
41088
- this.records[recordIndex] = records[index];
41164
+ 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 {
41165
+ if (recordIndex >= this.records.length || recordIndex < 0) continue;
41166
+ const oldRecord = this.records[recordIndex],
41167
+ rawIndex = rawRecords.indexOf(oldRecord);
41168
+ rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
41089
41169
  }
41090
41170
  }
41091
- return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
41171
+ return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
41092
41172
  }
41093
41173
  updateRecordsForSorted(records, recordIndexs) {
41094
41174
  for (let index = 0; index < recordIndexs.length; index++) {
@@ -47722,35 +47802,11 @@
47722
47802
  return hoverMode;
47723
47803
  }
47724
47804
 
47725
- let brushingChartInstance,
47726
- brushingChartInstanceCellPos = {
47727
- col: -1,
47728
- row: -1
47729
- };
47730
- function setBrushingChartInstance(chartInstance, col, row) {
47731
- brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
47732
- col: col,
47733
- row: row
47734
- };
47735
- }
47736
- function clearBrushingChartInstance() {
47737
- brushingChartInstance = void 0, brushingChartInstanceCellPos = {
47738
- col: -1,
47739
- row: -1
47740
- };
47741
- }
47742
- function getBrushingChartInstance() {
47743
- return brushingChartInstance;
47744
- }
47745
- function getBrushingChartInstanceCellPos() {
47746
- return brushingChartInstanceCellPos;
47747
- }
47748
47805
  const chartInstanceListColumnByColumnDirection = {};
47749
47806
  const chartInstanceListRowByRowDirection = {};
47750
- const delayRunDimensionHoverTimer = [];
47751
47807
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47752
47808
  var _a;
47753
- clearDelayRunDimensionHoverTimers(), isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47809
+ isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47754
47810
  const {
47755
47811
  rowStart: rowStart
47756
47812
  } = table.getBodyVisibleRowRange();
@@ -47759,40 +47815,76 @@
47759
47815
  for (let i = rowStart; i <= rowEnd; i++) {
47760
47816
  const cellGroup = table.scenegraph.getCell(col, i),
47761
47817
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47762
- chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
47763
- const timer = setTimeout(() => {
47764
- var _a, _b, _c, _d;
47818
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
47819
+ var _a, _b, _c, _d, _e, _f;
47765
47820
  if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47766
47821
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47767
47822
  let isShowTooltip = !isScatter;
47768
- 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 {
47769
- const cellBoundry = table.getCellRelativeRect(col, i),
47770
- bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47823
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
47824
+ const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0,
47825
+ {
47826
+ rowEnd: rowEnd1
47827
+ } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47828
+ if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47829
+ const {
47830
+ rowEnd: rowEnd2
47831
+ } = table.getBodyVisibleRowRange(0, 5);
47832
+ isShowTooltip = rowEnd2 !== rowEnd;
47833
+ }
47834
+ } else if (i === rowStart && isShowTooltip) {
47835
+ const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0,
47836
+ {
47837
+ rowStart: rowStart1
47838
+ } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47839
+ if (rowStart1 === rowStart) isShowTooltip = !0;else {
47840
+ const {
47841
+ rowStart: rowStart2
47842
+ } = table.getBodyVisibleRowRange(0, -5);
47843
+ isShowTooltip = rowStart2 !== rowStart;
47844
+ }
47845
+ }
47846
+ 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 {
47847
+ const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
47771
47848
  absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
47772
47849
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47773
47850
  tooltip: !1,
47774
47851
  showTooltipOption: {
47775
- x: canvasXY.x - cellBoundry.left,
47776
- y: absolutePositionTop - cellBoundry.top,
47852
+ x: canvasXY.x,
47853
+ y: absolutePositionTop,
47777
47854
  activeType: "dimension"
47778
47855
  }
47779
47856
  })) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
47780
47857
  tooltip: isShowTooltip,
47781
47858
  showTooltipOption: {
47782
- x: canvasXY.x - cellBoundry.left,
47783
- y: absolutePositionTop - cellBoundry.top,
47859
+ x: canvasXY.x,
47860
+ y: absolutePositionTop,
47784
47861
  activeType: "dimension"
47785
47862
  }
47786
47863
  });
47787
47864
  }
47788
47865
  }
47789
- }, 0);
47790
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47866
+ }, 0), table.scenegraph.updateNextFrame();
47867
+ }
47868
+ }
47869
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
47870
+ var _a;
47871
+ if (isValid$2(chartInstanceListColumnByColumnDirection[col])) {
47872
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
47873
+ if (isValid$2(excludedRow) && Number(i) === excludedRow) continue;
47874
+ const cellGroup = table.scenegraph.getCell(col, Number(i)),
47875
+ chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47876
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$2(chartNode) && (chartNode.deactivate(table, {
47877
+ releaseChartInstance: !0,
47878
+ releaseColumnChartInstance: !1,
47879
+ releaseRowChartInstance: !1
47880
+ }), chartInstanceListColumnByColumnDirection[col][i] = null);
47881
+ }
47882
+ delete chartInstanceListColumnByColumnDirection[col];
47791
47883
  }
47792
47884
  }
47793
47885
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47794
47886
  var _a;
47795
- clearDelayRunDimensionHoverTimers(), isValid$2(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47887
+ isValid$2(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47796
47888
  const {
47797
47889
  colStart: colStart
47798
47890
  } = table.getBodyVisibleColRange();
@@ -47801,162 +47893,64 @@
47801
47893
  for (let i = colStart; i <= colEnd; i++) {
47802
47894
  const cellGroup = table.scenegraph.getCell(i, row),
47803
47895
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47804
- chartInstanceListRowByRowDirection[row][i] || isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
47805
- const timer = setTimeout(() => {
47896
+ chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$2(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
47806
47897
  var _a, _b, _c, _d;
47807
47898
  if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
47808
47899
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
47809
47900
  let isShowTooltip = !isScatter;
47810
- 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 {
47811
- const cellBoundry = table.getCellRelativeRect(i, row),
47812
- bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47901
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
47902
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47903
+ {
47904
+ colEnd: colEnd1
47905
+ } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47906
+ if (colEnd1 === colEnd) isShowTooltip = !0;else {
47907
+ const {
47908
+ colEnd: colEnd2
47909
+ } = table.getBodyVisibleColRange(0, 5);
47910
+ isShowTooltip = colEnd2 !== colEnd;
47911
+ }
47912
+ } else if (i === colStart && isShowTooltip) {
47913
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47914
+ {
47915
+ colStart: colStart1
47916
+ } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47917
+ if (colStart1 === colStart) isShowTooltip = !0;else {
47918
+ const {
47919
+ colStart: colStart2
47920
+ } = table.getBodyVisibleColRange(0, -5);
47921
+ isShowTooltip = colStart2 !== colStart;
47922
+ }
47923
+ }
47924
+ 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 {
47925
+ const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
47813
47926
  absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
47814
47927
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47815
47928
  tooltip: !1,
47816
47929
  showTooltipOption: {
47817
- x: absolutePositionLeft - cellBoundry.left,
47818
- y: canvasXY.y - cellBoundry.top,
47930
+ x: absolutePositionLeft,
47931
+ y: canvasXY.y,
47819
47932
  activeType: "dimension"
47820
47933
  }
47821
47934
  })) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
47822
47935
  tooltip: isShowTooltip,
47823
47936
  showTooltipOption: {
47824
- x: absolutePositionLeft - cellBoundry.left,
47825
- y: canvasXY.y - cellBoundry.top,
47937
+ x: absolutePositionLeft,
47938
+ y: canvasXY.y,
47826
47939
  activeType: "dimension"
47827
47940
  }
47828
47941
  });
47829
47942
  }
47830
47943
  }
47831
- }, 0);
47832
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47833
- }
47834
- }
47835
- function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
47836
- var _a;
47837
- clearDelayRunDimensionHoverTimers();
47838
- const {
47839
- rowStart: rowStart
47840
- } = table.getBodyVisibleRowRange();
47841
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47842
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47843
- const {
47844
- colStart: colStart
47845
- } = table.getBodyVisibleColRange();
47846
- let colEnd = table.getBodyVisibleColRange().colEnd;
47847
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47848
- for (let col = colStart; col <= colEnd; col++) {
47849
- isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47850
- for (let i = rowStart; i <= rowEnd; i++) {
47851
- const cellGroup = table.scenegraph.getCell(col, i),
47852
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47853
- chartInstanceListColumnByColumnDirection[col][i] || isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.activeChartInstance ? chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
47854
- const timer = setTimeout(() => {
47855
- var _a, _b;
47856
- if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
47857
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47858
- let isShowTooltip = !0;
47859
- "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, {
47860
- activeType: "mark"
47861
- })));
47862
- }
47863
- }, 0);
47864
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47865
- }
47866
- }
47867
- }
47868
- function checkIsShowTooltipForEdgeRow(row, table) {
47869
- var _a, _b;
47870
- let isShowTooltip = !0;
47871
- const {
47872
- rowStart: rowStart
47873
- } = table.getBodyVisibleRowRange();
47874
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47875
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
47876
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47877
- if (row === rowEnd && isShowTooltip) {
47878
- const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0,
47879
- {
47880
- rowEnd: rowEnd1
47881
- } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
47882
- if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
47883
- const {
47884
- rowEnd: rowEnd2
47885
- } = table.getBodyVisibleRowRange(0, 5);
47886
- isShowTooltip = rowEnd2 !== rowEnd;
47887
- }
47888
- } else if (row === rowStart && isShowTooltip) {
47889
- const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0,
47890
- {
47891
- rowStart: rowStart1
47892
- } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
47893
- if (rowStart1 === rowStart) isShowTooltip = !0;else {
47894
- const {
47895
- rowStart: rowStart2
47896
- } = table.getBodyVisibleRowRange(0, -5);
47897
- isShowTooltip = rowStart2 !== rowStart;
47898
- }
47899
- }
47900
- return isShowTooltip;
47901
- }
47902
- function checkIsShowTooltipForEdgeColumn(col, table) {
47903
- let isShowTooltip = !0;
47904
- const {
47905
- colStart: colStart
47906
- } = table.getBodyVisibleColRange();
47907
- let colEnd = table.getBodyVisibleColRange().colEnd;
47908
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
47909
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
47910
- if (col === colEnd && isShowTooltip) {
47911
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47912
- {
47913
- colEnd: colEnd1
47914
- } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
47915
- if (colEnd1 === colEnd) isShowTooltip = !0;else {
47916
- const {
47917
- colEnd: colEnd2
47918
- } = table.getBodyVisibleColRange(0, 5);
47919
- isShowTooltip = colEnd2 !== colEnd;
47920
- }
47921
- } else if (col === colStart && isShowTooltip) {
47922
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
47923
- {
47924
- colStart: colStart1
47925
- } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
47926
- if (colStart1 === colStart) isShowTooltip = !0;else {
47927
- const {
47928
- colStart: colStart2
47929
- } = table.getBodyVisibleColRange(0, -5);
47930
- isShowTooltip = colStart2 !== colStart;
47931
- }
47944
+ }, 0), table.scenegraph.updateNextFrame();
47932
47945
  }
47933
- return isShowTooltip;
47934
47946
  }
47935
- function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
47936
- var _a;
47937
- if (isValid$2(chartInstanceListColumnByColumnDirection[col])) {
47938
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
47939
- if (isValid$2(excludedRow) && Number(i) === excludedRow) continue;
47940
- const cellGroup = table.scenegraph.getCell(col, Number(i)),
47941
- chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47942
- isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47943
- forceRelease: forceRelease,
47944
- releaseChartInstance: !0,
47945
- releaseColumnChartInstance: !1,
47946
- releaseRowChartInstance: !1
47947
- }), chartInstanceListColumnByColumnDirection[col][i] = null);
47948
- }
47949
- delete chartInstanceListColumnByColumnDirection[col];
47950
- }
47951
- }
47952
- function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
47947
+ function clearChartInstanceListByRowDirection(row, excludedCol, table) {
47953
47948
  var _a;
47954
47949
  if (isValid$2(chartInstanceListRowByRowDirection[row])) for (const i in chartInstanceListRowByRowDirection[row]) {
47955
47950
  if (isValid$2(excludedCol) && Number(i) === excludedCol) continue;
47956
47951
  const cellGroup = table.scenegraph.getCell(Number(i), row),
47957
47952
  chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
47958
- isValid$2(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
47959
- forceRelease: forceRelease,
47953
+ chartNode.addUpdateShapeAndBoundsTag(), isValid$2(chartNode) && (chartNode.deactivate(table, {
47960
47954
  releaseChartInstance: !0,
47961
47955
  releaseColumnChartInstance: !1,
47962
47956
  releaseRowChartInstance: !1
@@ -47964,15 +47958,6 @@
47964
47958
  }
47965
47959
  delete chartInstanceListRowByRowDirection[row];
47966
47960
  }
47967
- function clearDelayRunDimensionHoverTimers() {
47968
- for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
47969
- delayRunDimensionHoverTimer.length = 0;
47970
- }
47971
- function clearAllChartInstanceList(table, forceRelease = !1) {
47972
- clearDelayRunDimensionHoverTimers();
47973
- for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
47974
- for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
47975
- }
47976
47961
 
47977
47962
  function isValidAlignDomain(domain) {
47978
47963
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -48606,7 +48591,7 @@
48606
48591
  const CHART_NUMBER_TYPE = genNumberType();
48607
48592
  class Chart extends Rect$2 {
48608
48593
  constructor(isShareChartSpec, params) {
48609
- 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 {
48594
+ 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 {
48610
48595
  const chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
48611
48596
  renderCanvas: params.canvas,
48612
48597
  mode: "node" === this.attribute.mode ? "node" : "desktop-browser",
@@ -48627,7 +48612,7 @@
48627
48612
  }
48628
48613
  }
48629
48614
  activate(table) {
48630
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48615
+ var _a, _b, _c, _d, _e;
48631
48616
  if (this.activeChartInstance) return;
48632
48617
  const {
48633
48618
  col: col,
@@ -48646,7 +48631,7 @@
48646
48631
  y1: y1 - table.scrollTop,
48647
48632
  y2: y2 - table.scrollTop
48648
48633
  });
48649
- this.attribute.ClassType.globalConfig.uniqueTooltip = !1, this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
48634
+ 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, {
48650
48635
  renderCanvas: this.attribute.canvas,
48651
48636
  mode: "desktop-browser",
48652
48637
  canvasControled: !1,
@@ -48680,7 +48665,7 @@
48680
48665
  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());
48681
48666
  }
48682
48667
  },
48683
- componentShowContent: (null === (_a = table.options.chartDimensionLinkage) || void 0 === _a ? void 0 : _a.showTooltip) && "scatter" !== this.attribute.spec.type ? {
48668
+ componentShowContent: table.options.chartDimensionLinkage && "scatter" !== this.attribute.spec.type ? {
48684
48669
  tooltip: {
48685
48670
  dimension: !1,
48686
48671
  mark: !0
@@ -48691,40 +48676,15 @@
48691
48676
  const chartStage = this.activeChartInstance.getStage(),
48692
48677
  matrix = this.globalTransMatrix.clone(),
48693
48678
  stageMatrix = this.stage.window.getViewBoxTransform();
48694
- let brushChangeThrottle;
48695
48679
  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 => {
48696
48680
  var _a;
48697
- !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");
48698
- }), (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 => {
48699
- var _a;
48700
- brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
48701
- })), this.activeChartInstance.on("brushStart", params => {
48702
- const brushingChartInstance = getBrushingChartInstance();
48703
- brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && brushingChartInstance.getChart().getComponentsByKey("brush")[0].clearBrushStateAndMask(), setBrushingChartInstance(this.activeChartInstance, col, row));
48681
+ !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);
48704
48682
  }), this.activeChartInstance.on("brushEnd", params => {
48705
48683
  var _a;
48706
- 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(() => {
48684
+ table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
48707
48685
  Chart.temp = 1;
48708
48686
  }, 0);
48709
- }), (null === (_g = table.options.chartDimensionLinkage) || void 0 === _g ? void 0 : _g.showTooltip) && ("pie" === this.attribute.spec.type && (this.activeChartInstance.on("pointerover", {
48710
- markName: "pie"
48711
- }, params => {
48712
- var _a;
48713
- const categoryField = this.attribute.spec.categoryField,
48714
- datum = {
48715
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48716
- };
48717
- generateChartInstanceListByViewRange(datum, table, !1);
48718
- }), this.activeChartInstance.on("pointerout", {
48719
- markName: "pie"
48720
- }, params => {
48721
- var _a;
48722
- const categoryField = this.attribute.spec.categoryField,
48723
- datum = {
48724
- [categoryField]: null === (_a = null == params ? void 0 : params.datum) || void 0 === _a ? void 0 : _a[categoryField]
48725
- };
48726
- generateChartInstanceListByViewRange(datum, table, !0);
48727
- })), this.activeChartInstance.on("dimensionHover", params => {
48687
+ }), table.options.chartDimensionLinkage && this.activeChartInstance.on("dimensionHover", params => {
48728
48688
  var _a, _b;
48729
48689
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
48730
48690
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
@@ -48787,23 +48747,21 @@
48787
48747
  }
48788
48748
  }
48789
48749
  }
48790
- })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance);
48750
+ }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
48791
48751
  }
48792
48752
  deactivate(table, {
48793
- forceRelease = !1,
48794
48753
  releaseChartInstance = !0,
48795
48754
  releaseColumnChartInstance = !0,
48796
- releaseRowChartInstance = !0,
48797
- releaseAllChartInstance = !1
48755
+ releaseRowChartInstance = !0
48798
48756
  } = {}) {
48799
48757
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48800
48758
  if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
48801
- !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48759
+ null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48802
48760
  x1: -1e3,
48803
48761
  x2: -800,
48804
48762
  y1: -1e3,
48805
48763
  y2: -800
48806
- }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null);
48764
+ }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
48807
48765
  const {
48808
48766
  col: col,
48809
48767
  row: row
@@ -48816,7 +48774,7 @@
48816
48774
  } = this.parent;
48817
48775
  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));
48818
48776
  }
48819
- 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));
48777
+ 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);
48820
48778
  }
48821
48779
  updateData(data) {
48822
48780
  this.attribute.data = data;
@@ -48831,14 +48789,13 @@
48831
48789
  y1: y1,
48832
48790
  x2: x2,
48833
48791
  y2: y2
48834
- } = cellGroup.globalAABBBounds,
48835
- viewBox = {
48836
- 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)),
48837
- 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)),
48838
- 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)),
48839
- 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))
48840
- };
48841
- return this.activeChartInstance ? this.activeChartInstanceLastViewBox = viewBox : this.activeChartInstanceLastViewBox = null, viewBox;
48792
+ } = cellGroup.globalAABBBounds;
48793
+ return {
48794
+ 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)),
48795
+ 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)),
48796
+ 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)),
48797
+ 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))
48798
+ };
48842
48799
  }
48843
48800
  }
48844
48801
  function getTableBounds(col, row, table) {
@@ -49053,7 +49010,7 @@
49053
49010
  {
49054
49011
  width = groupAttribute.width,
49055
49012
  height = groupAttribute.height
49056
- } = chart.attribute,
49013
+ } = (chart.getViewBox(), chart.attribute),
49057
49014
  {
49058
49015
  table: table
49059
49016
  } = chart.getRootNode(),
@@ -49081,9 +49038,8 @@
49081
49038
  });
49082
49039
  }
49083
49040
  }
49084
- const lastViewBox = chart.activeChartInstanceLastViewBox,
49085
- viewBox = chart.getViewBox();
49086
- lastViewBox && viewBox.x1 === lastViewBox.x1 && viewBox.x2 === lastViewBox.x2 && viewBox.y1 === lastViewBox.y1 && viewBox.y2 === lastViewBox.y2 || activeChartInstance.updateViewBox({
49041
+ const viewBox = chart.getViewBox();
49042
+ activeChartInstance.updateViewBox({
49087
49043
  x1: 0,
49088
49044
  x2: viewBox.x2 - viewBox.x1,
49089
49045
  y1: 0,
@@ -52601,10 +52557,9 @@
52601
52557
  });
52602
52558
  }
52603
52559
  }
52604
- function updateChartState(scenegraph, datum, selectedDataMode) {
52560
+ function updateChartState(scenegraph, datum) {
52605
52561
  const table = scenegraph.table;
52606
52562
  if (table.isPivotChart()) {
52607
- table._selectedDataMode = selectedDataMode;
52608
52563
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
52609
52564
  if ((null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) && 0 === preSelectItemsCount) return;
52610
52565
  const newSelectedDataItemsInChart = [];
@@ -53352,36 +53307,16 @@
53352
53307
  resetResidentHoverIcon(col, row) {
53353
53308
  resetResidentHoverIcon(col, row, this);
53354
53309
  }
53355
- deactivateChart(col, row, forceRelease = !1) {
53356
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53357
- if (-1 === col || -1 === row) {
53358
- if (forceRelease) {
53359
- const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
53360
- cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
53361
- (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, {
53362
- forceRelease: !0,
53363
- releaseChartInstance: !0,
53364
- releaseColumnChartInstance: !0,
53365
- releaseRowChartInstance: !0,
53366
- releaseAllChartInstance: !0
53367
- }));
53368
- }
53369
- return;
53370
- }
53310
+ deactivateChart(col, row) {
53311
+ var _a, _b, _c;
53312
+ if (-1 === col || -1 === row) return;
53371
53313
  const cellGroup = this.getCell(col, row);
53372
- if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
53373
- 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, {
53374
- forceRelease: !0,
53375
- releaseChartInstance: !0,
53376
- releaseColumnChartInstance: !0,
53377
- releaseRowChartInstance: !0,
53378
- releaseAllChartInstance: !0
53379
- }));
53314
+ if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
53380
53315
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
53381
- 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) ? {
53382
- 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),
53383
- 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),
53384
- 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)
53316
+ 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 ? {
53317
+ 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,
53318
+ 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,
53319
+ 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
53385
53320
  } : void 0);
53386
53321
  }
53387
53322
  }
@@ -53429,15 +53364,8 @@
53429
53364
  updateChartSizeForResizeRowHeight(row) {
53430
53365
  updateChartSizeForResizeRowHeight(this, row);
53431
53366
  }
53432
- updateChartState(datum, selectedDataMode) {
53433
- var _a, _b;
53434
- if (this.table.isPivotChart()) {
53435
- if (null == datum || 0 === (null == datum ? void 0 : datum.length) || 0 === Object.keys(datum).length) {
53436
- const brushingChartInstance = getBrushingChartInstance();
53437
- 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);
53438
- }
53439
- updateChartState(this, datum, selectedDataMode);
53440
- }
53367
+ updateChartState(datum) {
53368
+ this.table.isPivotChart() && updateChartState(this, datum);
53441
53369
  }
53442
53370
  updateCheckboxCellState(col, row, checked) {
53443
53371
  var _a, _b;
@@ -56464,7 +56392,7 @@
56464
56392
  }, 0 !== e.button) return;
56465
56393
  const eventArgsSet = getCellEventArgsSet(e);
56466
56394
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
56467
- 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), (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;
56395
+ 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;
56468
56396
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
56469
56397
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
56470
56398
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -56492,7 +56420,7 @@
56492
56420
  }
56493
56421
  eventManager.dealTableHover(eventArgsSet);
56494
56422
  } else {
56495
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), void stateManager.updateInteractionState(InteractionState.grabing);
56423
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null), void stateManager.updateInteractionState(InteractionState.grabing);
56496
56424
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56497
56425
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
56498
56426
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -56644,7 +56572,7 @@
56644
56572
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
56645
56573
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
56646
56574
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
56647
- table.scenegraph.updateChartState(null, void 0), stateManager.updateInteractionState(InteractionState.grabing);
56575
+ table.scenegraph.updateChartState(null), stateManager.updateInteractionState(InteractionState.grabing);
56648
56576
  const {
56649
56577
  eventArgs: eventArgs
56650
56578
  } = eventArgsSet;
@@ -56663,7 +56591,7 @@
56663
56591
  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 {
56664
56592
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
56665
56593
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
56666
- (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);
56594
+ (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);
56667
56595
  }
56668
56596
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
56669
56597
  var _a, _b, _c;
@@ -56781,15 +56709,7 @@
56781
56709
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked), table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent), table.scenegraph.updateNextFrame();
56782
56710
  }), table.scenegraph.stage.addEventListener("wheel", e => {
56783
56711
  var _a;
56784
- if (!e.path.find(node => "legend" === node.name)) {
56785
- null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit();
56786
- const {
56787
- cellPos: cellPos
56788
- } = table.stateManager.hover,
56789
- prevHoverCellCol = cellPos.col,
56790
- prevHoverCellRow = cellPos.row;
56791
- table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, !0), table.eventManager._enableTableScroll && handleWhell(e, stateManager);
56792
- }
56712
+ e.path.find(node => "legend" === node.name) || (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit(), table.eventManager._enableTableScroll && handleWhell(e, stateManager));
56793
56713
  });
56794
56714
  }
56795
56715
  function bindGesture(eventManager) {
@@ -57569,7 +57489,7 @@
57569
57489
  };
57570
57490
  let EventManager$1 = class EventManager {
57571
57491
  constructor(table) {
57572
- 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$1.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
57492
+ 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$1.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
57573
57493
  this.bindSelfEvent();
57574
57494
  }, 0));
57575
57495
  }
@@ -57871,15 +57791,25 @@
57871
57791
  } catch (error) {}
57872
57792
  }
57873
57793
  handleCut(e) {
57794
+ var _a;
57874
57795
  return __awaiter$1(this, void 0, void 0, function* () {
57875
- this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57876
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
57796
+ 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 => ({
57797
+ start: {
57798
+ col: r.start.col,
57799
+ row: r.start.row
57800
+ },
57801
+ end: {
57802
+ col: r.end.col,
57803
+ row: r.end.row
57804
+ }
57805
+ })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57806
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
57877
57807
  }, 3e4), this.saveClipboardContent();
57878
57808
  });
57879
57809
  }
57880
57810
  handlePaste(e) {
57881
57811
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
57882
- this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57812
+ 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));
57883
57813
  }).catch(() => {
57884
57814
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57885
57815
  }) : this.executePaste(e);
@@ -57956,9 +57886,9 @@
57956
57886
  }
57957
57887
  clearCutArea(table) {
57958
57888
  try {
57959
- const selectCells = this.cutCellRange;
57960
- if (!selectCells || 0 === selectCells.length) return;
57961
- 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);
57889
+ const ranges = this.cutRanges;
57890
+ if (!ranges || 0 === ranges.length) return;
57891
+ table.changeCellValuesByIds(ranges, "");
57962
57892
  } catch (error) {}
57963
57893
  }
57964
57894
  checkClipboardChanged() {
@@ -59896,6 +59826,15 @@
59896
59826
  constructor(table, customCellStyle, customCellStyleArrangement) {
59897
59827
  this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
59898
59828
  }
59829
+ clearCustomCellStyleArrangement() {
59830
+ this.customCellStyleArrangement = [];
59831
+ }
59832
+ addCustomCellStyleArrangement(cellPosition, customStyleId) {
59833
+ this.customCellStyleArrangement.push({
59834
+ cellPosition: cellPosition,
59835
+ customStyleId: customStyleId
59836
+ });
59837
+ }
59899
59838
  getCustomCellStyle(col, row) {
59900
59839
  const customStyleIds = this.getCustomCellStyleIds(col, row);
59901
59840
  if (customStyleIds.length) {
@@ -60201,7 +60140,7 @@
60201
60140
  }
60202
60141
  constructor(container, options = {}) {
60203
60142
  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;
60204
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.6", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.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");
60143
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.7", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.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");
60205
60144
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
60206
60145
  options: options,
60207
60146
  container: container
@@ -64012,15 +63951,16 @@
64012
63951
  step((generator = generator.apply(thisArg, _arguments || [])).next());
64013
63952
  });
64014
63953
  };
64015
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
63954
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
64016
63955
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
64017
- const recordIndex = table.getRecordShowIndexByCell(col, row),
63956
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
63957
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64018
63958
  {
64019
63959
  field: field
64020
63960
  } = table.internalProps.layoutMap.getBody(col, row),
64021
63961
  beforeChangeValue = table.getCellRawValue(col, row),
64022
63962
  oldValue = table.getCellOriginValue(col, row);
64023
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
63963
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
64024
63964
  const range = table.getCellRange(col, row),
64025
63965
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
64026
63966
  if (aggregators) {
@@ -64043,16 +63983,24 @@
64043
63983
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
64044
63984
  }
64045
63985
  const changedValue = table.getCellOriginValue(col, row);
64046
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
64047
- col: col,
64048
- row: row,
64049
- rawValue: beforeChangeValue,
64050
- currentValue: oldValue,
64051
- changedValue: changedValue
64052
- }), table.scenegraph.updateNextFrame();
63986
+ if (oldValue !== changedValue && triggerEvent) {
63987
+ const changeValue = {
63988
+ col: col,
63989
+ row: row,
63990
+ recordIndex: recordIndex,
63991
+ field: field,
63992
+ rawValue: beforeChangeValue,
63993
+ currentValue: oldValue,
63994
+ changedValue: changedValue
63995
+ };
63996
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
63997
+ values: [changeValue]
63998
+ });
63999
+ }
64000
+ table.scenegraph.updateNextFrame();
64053
64001
  }
64054
64002
  }
64055
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
64003
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
64056
64004
  var _a, _b;
64057
64005
  return __awaiter(this, void 0, void 0, function* () {
64058
64006
  const changedCellResults = [];
@@ -64074,6 +64022,7 @@
64074
64022
  oldRowValues.push(oldValue);
64075
64023
  }
64076
64024
  }
64025
+ const resultChangeValues = [];
64077
64026
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
64078
64027
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
64079
64028
  const rowValues = values[i];
@@ -64097,25 +64046,34 @@
64097
64046
  if (isCanChange) {
64098
64047
  changedCellResults[i][j] = !0;
64099
64048
  const value = rowValues[j],
64100
- recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
64049
+ recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
64050
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64101
64051
  {
64102
64052
  field: field
64103
64053
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
64104
64054
  beforeChangeValue = beforeChangeValues[i][j],
64105
64055
  oldValue = oldValues[i][j];
64106
- 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);
64056
+ 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);
64107
64057
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
64108
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
64109
- col: startCol + j,
64110
- row: startRow + i,
64111
- rawValue: beforeChangeValue,
64112
- currentValue: oldValue,
64113
- changedValue: changedValue
64114
- });
64058
+ if (oldValue !== changedValue && triggerEvent) {
64059
+ const changeValue = {
64060
+ col: startCol + j,
64061
+ row: startRow + i,
64062
+ recordIndex: recordIndex,
64063
+ field: field,
64064
+ rawValue: beforeChangeValue,
64065
+ currentValue: oldValue,
64066
+ changedValue: changedValue
64067
+ };
64068
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
64069
+ }
64115
64070
  } else changedCellResults[i][j] = !1;
64116
64071
  }
64117
64072
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
64118
64073
  }
64074
+ silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
64075
+ values: resultChangeValues
64076
+ });
64119
64077
  const startRange = table.getCellRange(startCol, startRow),
64120
64078
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
64121
64079
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -64149,6 +64107,58 @@
64149
64107
  return table.scenegraph.updateNextFrame(), changedCellResults;
64150
64108
  });
64151
64109
  }
64110
+ function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
64111
+ var _a, _b;
64112
+ return __awaiter(this, void 0, void 0, function* () {
64113
+ const resultChangeValues = [],
64114
+ processed = new Set(),
64115
+ nextValue = null != value ? value : "";
64116
+ for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
64117
+ const range = ranges[i],
64118
+ startCol = Math.min(range.start.col, range.end.col),
64119
+ endCol = Math.max(range.start.col, range.end.col),
64120
+ startRow = Math.min(range.start.row, range.end.row),
64121
+ endRow = Math.max(range.start.row, range.end.row);
64122
+ if (startCol > endCol || startRow > endRow) continue;
64123
+ const values = [],
64124
+ oldValues = [];
64125
+ for (let row = startRow; row <= endRow; row++) {
64126
+ const rowValues = [],
64127
+ rowOldValues = [];
64128
+ for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
64129
+ values.push(rowValues), oldValues.push(rowOldValues);
64130
+ }
64131
+ const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
64132
+ for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
64133
+ const col = startCol + c,
64134
+ row = startRow + r,
64135
+ key = `${col},${row}`;
64136
+ if (processed.has(key)) continue;
64137
+ if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
64138
+ const oldValue = oldValues[r][c],
64139
+ changedValue = table.getCellOriginValue(col, row);
64140
+ if (oldValue === changedValue) continue;
64141
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
64142
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64143
+ {
64144
+ field: field
64145
+ } = table.internalProps.layoutMap.getBody(col, row);
64146
+ resultChangeValues.push({
64147
+ col: col,
64148
+ row: row,
64149
+ recordIndex: recordIndex,
64150
+ field: field,
64151
+ rawValue: oldValue,
64152
+ currentValue: oldValue,
64153
+ changedValue: changedValue
64154
+ });
64155
+ }
64156
+ }
64157
+ !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
64158
+ values: resultChangeValues
64159
+ });
64160
+ });
64161
+ }
64152
64162
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
64153
64163
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
64154
64164
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -64166,13 +64176,16 @@
64166
64176
  }), table.dataSource.sort(sortState));
64167
64177
  }
64168
64178
  function listTableAddRecord(record, recordIndex, table) {
64169
- var _a, _b, _c, _d;
64179
+ var _a, _b, _c, _d, _e, _f;
64170
64180
  try {
64171
64181
  if (!record) return !1;
64172
- 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 {
64182
+ 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) {
64183
+ !!(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();
64184
+ } else {
64173
64185
  (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
64174
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
64175
- table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
64186
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
64187
+ syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
64188
+ 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;
64176
64189
  const oldRowCount = table.rowCount;
64177
64190
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64178
64191
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -64241,13 +64254,16 @@
64241
64254
  }
64242
64255
  }
64243
64256
  function listTableAddRecords(records, recordIndex, table) {
64244
- var _a, _b, _c, _d;
64257
+ var _a, _b, _c, _d, _e, _f;
64245
64258
  try {
64246
64259
  if (!records || 0 === records.length) return !1;
64247
- 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 {
64260
+ 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) {
64261
+ !!(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();
64262
+ } else {
64248
64263
  void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
64249
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
64250
- table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
64264
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
64265
+ syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
64266
+ 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;
64251
64267
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
64252
64268
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64253
64269
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -64316,16 +64332,20 @@
64316
64332
  }
64317
64333
  }
64318
64334
  function listTableDeleteRecords(recordIndexs, table) {
64319
- var _a, _b, _c, _d, _e, _f, _g, _h;
64335
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
64320
64336
  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) {
64321
64337
  const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
64322
64338
  if (0 === deletedRecordIndexs.length) return;
64323
64339
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
64324
64340
  table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
64325
- } else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64326
- const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
64341
+ } else if (table.sortState) {
64342
+ !!(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();
64343
+ } else {
64344
+ const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
64345
+ deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
64327
64346
  if (0 === deletedRecordIndexs.length) return;
64328
64347
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
64348
+ if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
64329
64349
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
64330
64350
  table.refreshRowColCount();
64331
64351
  const newRowCount = table.transpose ? table.colCount : table.rowCount,
@@ -64363,7 +64383,7 @@
64363
64383
  col: 0,
64364
64384
  row: row
64365
64385
  });
64366
- 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();
64386
+ 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();
64367
64387
  }
64368
64388
  } else {
64369
64389
  const delRows = [],
@@ -64395,15 +64415,19 @@
64395
64415
  col: 0,
64396
64416
  row: row
64397
64417
  });
64398
- 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();
64418
+ 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();
64399
64419
  }
64400
64420
  }
64401
64421
  }
64402
64422
  function listTableUpdateRecords(records, recordIndexs, table) {
64403
- var _a, _b, _c, _d;
64404
- 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 {
64405
- const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
64423
+ var _a, _b, _c, _d, _e, _f;
64424
+ 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) {
64425
+ !!(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();
64426
+ } else {
64427
+ const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
64428
+ updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
64406
64429
  if (0 === updateRecordIndexs.length) return;
64430
+ if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
64407
64431
  const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
64408
64432
  if (table.pagination) {
64409
64433
  const {
@@ -65312,43 +65336,165 @@
65312
65336
  }
65313
65337
  return isValid$2(editorDefine);
65314
65338
  }
65315
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
65316
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
65339
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65340
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65341
+ }
65342
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65343
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65344
+ }
65345
+ changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65346
+ return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65347
+ }
65348
+ changeSourceCellValue(recordIndex, field, value) {
65349
+ const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
65350
+ cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
65351
+ if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
65352
+ this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
65353
+ const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
65354
+ oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
65355
+ changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
65356
+ if (oldValue !== changedValue) {
65357
+ const changeValue = {
65358
+ col: cellAddr.col,
65359
+ row: cellAddr.row,
65360
+ recordIndex: recordIndex,
65361
+ field: field,
65362
+ rawValue: beforeChangeValue,
65363
+ currentValue: oldValue,
65364
+ changedValue: changedValue
65365
+ };
65366
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65367
+ values: [changeValue]
65368
+ });
65369
+ }
65370
+ }
65371
+ changeCellValueByRecord(recordIndex, field, value, options) {
65372
+ var _a, _b, _c, _d, _e;
65373
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65374
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65375
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65376
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65377
+ let record, oldValue;
65378
+ 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;
65379
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65380
+ if (oldValue !== changedValue) {
65381
+ const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
65382
+ changeValue = {
65383
+ col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
65384
+ row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
65385
+ recordIndex: recordIndex,
65386
+ field: field,
65387
+ rawValue: oldValue,
65388
+ currentValue: oldValue,
65389
+ changedValue: changedValue
65390
+ };
65391
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65392
+ values: [changeValue]
65393
+ });
65394
+ }
65395
+ autoRefresh && this.refreshAfterSourceChange();
65396
+ }
65397
+ changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
65398
+ return this.changeCellValueByRecord(recordIndex, field, value, {
65399
+ triggerEvent: triggerEvent,
65400
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65401
+ autoRefresh: !0
65402
+ });
65403
+ }
65404
+ changeCellValuesByRecords(changeValues, options) {
65405
+ var _a, _b, _c, _d, _e, _f, _g;
65406
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65407
+ silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65408
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65409
+ resultChangeValues = [];
65410
+ for (let i = 0; i < changeValues.length; i++) {
65411
+ const {
65412
+ recordIndex: recordIndex,
65413
+ field: field,
65414
+ value: value
65415
+ } = changeValues[i],
65416
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65417
+ let record, oldValue;
65418
+ 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) {
65419
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65420
+ if (oldValue !== changedValue) {
65421
+ const changeValue = {
65422
+ col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
65423
+ row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
65424
+ recordIndex: recordIndex,
65425
+ field: field,
65426
+ rawValue: oldValue,
65427
+ currentValue: oldValue,
65428
+ changedValue: changedValue
65429
+ };
65430
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
65431
+ }
65432
+ }
65433
+ }
65434
+ !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65435
+ values: resultChangeValues
65436
+ }), autoRefresh && this.refreshAfterSourceChange();
65437
+ }
65438
+ changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
65439
+ return this.changeCellValuesByRecords(changeValues, {
65440
+ triggerEvent: triggerEvent,
65441
+ silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65442
+ autoRefresh: !0
65443
+ });
65317
65444
  }
65318
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
65319
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
65445
+ refreshAfterSourceChange(options) {
65446
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
65447
+ const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
65448
+ reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
65449
+ clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
65450
+ 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);
65451
+ const traverseColumns = columns => {
65452
+ var _a, _b, _c, _d;
65453
+ for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
65454
+ const column = columns[i],
65455
+ aggregators = null == column ? void 0 : column.vtable_aggregator;
65456
+ 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);
65457
+ (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
65458
+ }
65459
+ };
65460
+ 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();
65320
65461
  }
65321
- addRecord(record, recordIndex) {
65462
+ addRecord(record, recordIndex, triggerEvent = !0) {
65322
65463
  var _a;
65323
65464
  const success = listTableAddRecord(record, recordIndex, this);
65324
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65465
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65325
65466
  records: [record],
65326
65467
  recordIndex: recordIndex,
65327
65468
  recordCount: 1
65328
65469
  });
65329
65470
  }
65330
- addRecords(records, recordIndex) {
65471
+ addRecords(records, recordIndex, triggerEvent = !0) {
65331
65472
  var _a;
65332
65473
  const success = listTableAddRecords(records, recordIndex, this);
65333
- "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, {
65474
+ "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, {
65334
65475
  records: records,
65335
65476
  recordIndex: recordIndex,
65336
65477
  recordCount: records.length
65337
65478
  });
65338
65479
  }
65339
- deleteRecords(recordIndexs) {
65480
+ deleteRecords(recordIndexs, triggerEvent = !0) {
65340
65481
  var _a;
65341
- listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65482
+ const deletedRecords = [];
65483
+ (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
65484
+ let record = null;
65485
+ record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
65486
+ }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65342
65487
  const rowIndexs = [];
65343
65488
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
65344
- this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65489
+ triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65345
65490
  recordIndexs: recordIndexs,
65491
+ records: deletedRecords,
65346
65492
  rowIndexs: rowIndexs,
65347
65493
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
65348
65494
  });
65349
65495
  }
65350
- updateRecords(records, recordIndexs) {
65351
- listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65496
+ updateRecords(records, recordIndexs, triggerEvent = !0) {
65497
+ listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65352
65498
  records: records,
65353
65499
  recordIndexs: recordIndexs,
65354
65500
  updateCount: records.length
@@ -69568,8 +69714,8 @@
69568
69714
  }(ExcelEditCellKeyboardResponse || (ExcelEditCellKeyboardResponse = {}));
69569
69715
  class ExcelEditCellKeyboardPlugin {
69570
69716
  constructor(pluginOptions) {
69571
- var _a, _b;
69572
- this.id = "excel-edit-cell-keyboard", this.name = "Excel Edit Cell Keyboard", this.runTime = [TABLE_EVENT_TYPE.INITIALIZED], this.id = null !== (_a = null == pluginOptions ? void 0 : pluginOptions.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = pluginOptions, this.responseKeyboard = null !== (_b = null == pluginOptions ? void 0 : pluginOptions.responseKeyboard) && void 0 !== _b ? _b : [ExcelEditCellKeyboardResponse.ENTER, ExcelEditCellKeyboardResponse.TAB, ExcelEditCellKeyboardResponse.ARROW_LEFT, ExcelEditCellKeyboardResponse.ARROW_RIGHT, ExcelEditCellKeyboardResponse.ARROW_DOWN, ExcelEditCellKeyboardResponse.ARROW_UP, ExcelEditCellKeyboardResponse.DELETE, ExcelEditCellKeyboardResponse.BACKSPACE], this.bindEvent();
69717
+ var _a, _b, _c;
69718
+ this.id = "excel-edit-cell-keyboard", this.name = "Excel Edit Cell Keyboard", this.runTime = [TABLE_EVENT_TYPE.INITIALIZED], this.id = null !== (_a = null == pluginOptions ? void 0 : pluginOptions.id) && void 0 !== _a ? _a : this.id, this.pluginOptions = pluginOptions, this.responseKeyboard = null !== (_b = null == pluginOptions ? void 0 : pluginOptions.responseKeyboard) && void 0 !== _b ? _b : [ExcelEditCellKeyboardResponse.ENTER, ExcelEditCellKeyboardResponse.TAB, ExcelEditCellKeyboardResponse.ARROW_LEFT, ExcelEditCellKeyboardResponse.ARROW_RIGHT, ExcelEditCellKeyboardResponse.ARROW_DOWN, ExcelEditCellKeyboardResponse.ARROW_UP, ExcelEditCellKeyboardResponse.DELETE, ExcelEditCellKeyboardResponse.BACKSPACE], this.aggregateDeleteToOneChangeCellValuesEvent = null !== (_c = null == pluginOptions ? void 0 : pluginOptions.aggregateDeleteToOneChangeCellValuesEvent) && void 0 !== _c && _c, this.bindEvent();
69573
69719
  }
69574
69720
  run(...args) {
69575
69721
  const table = args[2];
@@ -69600,7 +69746,7 @@
69600
69746
  (null == selectCells ? void 0 : selectCells.length) > 0 && (document.activeElement === this.table.getElement() || Object.values(this.table.editorManager.cacheLastSelectedCellEditor || {}).some(editor => {
69601
69747
  var _a;
69602
69748
  return (null === (_a = editor.getInputElement) || void 0 === _a ? void 0 : _a.call(editor)) === document.activeElement;
69603
- })) && (deleteSelectRange(selectCells, this.table, null === (_c = null === (_b = this.pluginOptions) || void 0 === _b ? void 0 : _b.deleteWorkOnEditableCell) || void 0 === _c || _c), event.stopPropagation(), event.preventDefault());
69749
+ })) && (deleteSelectRange(selectCells, this.table, null === (_c = null === (_b = this.pluginOptions) || void 0 === _b ? void 0 : _b.deleteWorkOnEditableCell) || void 0 === _c || _c, this.aggregateDeleteToOneChangeCellValuesEvent), event.stopPropagation(), event.preventDefault());
69604
69750
  }
69605
69751
  } else this.table.editorManager.completeEdit(), this.table.getElement().focus(), eventKey === ExcelEditCellKeyboardResponse.ENTER ? this.table.selectCell(col, row + 1) : eventKey === ExcelEditCellKeyboardResponse.TAB && this.table.selectCell(col + 1, row), event.stopPropagation(), event.preventDefault();
69606
69752
  }
@@ -69622,8 +69768,11 @@
69622
69768
  document.removeEventListener("keydown", this.handleKeyDown, !0);
69623
69769
  }
69624
69770
  }
69625
- function deleteSelectRange(selectCells, tableInstance, workOnEditableCell = !1) {
69626
- for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) tableInstance.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, "", workOnEditableCell);
69771
+ function deleteSelectRange(selectCells, tableInstance, workOnEditableCell = !1, aggregateToOneChangeCellValuesEvent = !1) {
69772
+ if (aggregateToOneChangeCellValuesEvent) {
69773
+ const ranges = tableInstance.stateManager.select.ranges;
69774
+ (null == ranges ? void 0 : ranges.length) && tableInstance.changeCellValuesByIds(ranges, "", workOnEditableCell, !0);
69775
+ } else for (let i = 0; i < selectCells.length; i++) for (let j = 0; j < selectCells[i].length; j++) tableInstance.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, "", workOnEditableCell);
69627
69776
  }
69628
69777
 
69629
69778
  const MENU_CONTAINER_CLASS = "vtable-context-menu-container";
@@ -91186,7 +91335,7 @@
91186
91335
  importStyle();
91187
91336
  }
91188
91337
 
91189
- const version = "1.22.11-alpha.6";
91338
+ const version = "1.22.11-alpha.7";
91190
91339
  importStyles();
91191
91340
 
91192
91341
  exports.TYPES = index;