@visactor/vtable-sheet 1.22.11-alpha.9 → 1.22.11

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.
@@ -2965,6 +2965,14 @@
2965
2965
  type: "wheel",
2966
2966
  handler: wheelHandler
2967
2967
  });
2968
+ const pasteHandler = e => {
2969
+ const pasteEvent = e;
2970
+ "0" === this.element.style.opacity && pasteEvent.preventDefault();
2971
+ };
2972
+ input.addEventListener("paste", pasteHandler), this.eventHandlers.push({
2973
+ type: "paste",
2974
+ handler: pasteHandler
2975
+ });
2968
2976
  }
2969
2977
  setValue(value) {
2970
2978
  this.element.value = void 0 !== value ? value : "";
@@ -38828,7 +38836,6 @@
38828
38836
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
38829
38837
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
38830
38838
  CHANGE_CELL_VALUE: "change_cell_value",
38831
- CHANGE_CELL_VALUES: "change_cell_values",
38832
38839
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
38833
38840
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
38834
38841
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -40961,24 +40968,6 @@
40961
40968
  }
40962
40969
  }
40963
40970
  }
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
- }
40982
40971
  cacheBeforeChangedRecord(dataIndex, table) {
40983
40972
  var _a;
40984
40973
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -40994,92 +40983,41 @@
40994
40983
  Array.isArray(indexed) || this.records.splice(indexed, 1, record);
40995
40984
  }
40996
40985
  }
40997
- _getRawRecordsArray() {
40986
+ addRecord(record, index) {
40998
40987
  var _a;
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 (0 === this.records.length) return rawRecords.length;
41011
- if (viewIndex <= 0) {
41012
- const firstVisibleRecord = this.records[0],
41013
- rawIndex = rawRecords.indexOf(firstVisibleRecord);
41014
- return rawIndex >= 0 ? rawIndex : 0;
41015
- }
41016
- if (viewIndex >= this.records.length) {
41017
- const lastVisibleRecord = this.records[this.records.length - 1],
41018
- rawIndex = rawRecords.indexOf(lastVisibleRecord);
41019
- return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
41020
- }
41021
- const prevRecord = this.records[viewIndex - 1],
41022
- rawIndex = rawRecords.indexOf(prevRecord);
41023
- return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
41024
- }
41025
- _resetIndexingFromViewRecords() {
41026
- if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
41027
- length: this._sourceLength
41028
- }, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
41029
- this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
41030
- }
41031
- addRecord(record, index, syncToOriginalRecords = !1) {
41032
- var _a, _b, _c;
41033
- if (!syncToOriginalRecords) {
41034
- if (Array.isArray(this.records)) {
41035
- this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
41036
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
41037
- if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
41038
- this.pagination.totalCount = this._sourceLength;
41039
- const {
41040
- perPageCount: perPageCount,
41041
- currentPage: currentPage
41042
- } = this.pagination;
41043
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
41044
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
41045
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
41046
- }
41047
- return;
40988
+ if (Array.isArray(this.records)) {
40989
+ this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
40990
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
40991
+ if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
40992
+ this.pagination.totalCount = this._sourceLength;
40993
+ const {
40994
+ perPageCount: perPageCount,
40995
+ currentPage: currentPage
40996
+ } = this.pagination;
40997
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
40998
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
40999
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
41048
41000
  }
41049
- const rawRecords = this._getRawRecordsArray();
41050
- if (!rawRecords) return;
41051
- const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
41052
- rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
41053
- rawRecords.splice(rawInsertIndex, 0, record), syncToOriginalRecords && this._hasFilterInEffect() && this.markForceVisibleRecord(record), this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules), (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, 1);
41054
41001
  }
41055
- addRecords(recordArr, index, syncToOriginalRecords = !1) {
41056
- var _a, _b, _c;
41057
- if (!syncToOriginalRecords) {
41058
- if (Array.isArray(this.records)) {
41059
- if (Array.isArray(recordArr)) {
41060
- this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
41061
- for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
41062
- this._sourceLength += recordArr.length;
41063
- for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
41064
- }
41065
- if (this.userPagination) {
41066
- this.pagination.totalCount = this._sourceLength;
41067
- const {
41068
- perPageCount: perPageCount,
41069
- currentPage: currentPage
41070
- } = this.pagination;
41071
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
41072
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
41073
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
41002
+ addRecords(recordArr, index) {
41003
+ var _a;
41004
+ if (Array.isArray(this.records)) {
41005
+ if (Array.isArray(recordArr)) {
41006
+ this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
41007
+ for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
41008
+ this._sourceLength += recordArr.length;
41009
+ for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
41074
41010
  }
41075
- return;
41011
+ if (this.userPagination) {
41012
+ this.pagination.totalCount = this._sourceLength;
41013
+ const {
41014
+ perPageCount: perPageCount,
41015
+ currentPage: currentPage
41016
+ } = this.pagination;
41017
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
41018
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
41019
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
41076
41020
  }
41077
- const rawRecords = this._getRawRecordsArray();
41078
- if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
41079
- const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
41080
- rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
41081
- if (rawRecords.splice(rawInsertIndex, 0, ...recordArr), syncToOriginalRecords && this._hasFilterInEffect()) for (let i = 0; i < recordArr.length; i++) this.markForceVisibleRecord(recordArr[i]);
41082
- 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);
41083
41021
  }
41084
41022
  addRecordForSorted(record) {
41085
41023
  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));
@@ -41095,49 +41033,27 @@
41095
41033
  }
41096
41034
  }
41097
41035
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
41098
- const delta = "add" === type ? insertCount : -insertCount,
41099
- numericKeys = [];
41100
- this.beforeChangedRecordsMap.forEach((_, key) => {
41101
- const numKey = Number(key);
41102
- Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
41103
- }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
41104
- for (let i = 0; i < numericKeys.length; i++) {
41105
- const key = numericKeys[i],
41106
- record = this.beforeChangedRecordsMap.get(key.toString());
41107
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
41108
- }
41109
- }
41110
- deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
41111
- var _a, _b, _c;
41112
- if (!syncToOriginalRecords) {
41113
- if (Array.isArray(this.records)) {
41114
- const realDeletedRecordIndexs = [],
41115
- recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
41116
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
41117
- const recordIndex = recordIndexsMaxToMin[index];
41118
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41119
- this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
41120
- const deletedRecord = this.records[recordIndex];
41121
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
41122
- this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
41123
- }
41124
- 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;
41125
- }
41126
- return [];
41127
- }
41128
- const rawRecords = this._getRawRecordsArray();
41129
- if (!rawRecords || !Array.isArray(this.records)) return [];
41130
- const realDeletedRecordIndexs = [],
41131
- recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
41132
- rawDeletedIndexs = [];
41133
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
41134
- const viewIndex = recordIndexsMaxToMin[index];
41135
- if (viewIndex >= this.records.length || viewIndex < 0) continue;
41136
- const deletedRecord = this.records[viewIndex],
41137
- rawIndex = rawRecords.indexOf(deletedRecord);
41138
- rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
41036
+ for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
41037
+ const record = this.beforeChangedRecordsMap.get(key.toString());
41038
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
41039
+ }
41040
+ }
41041
+ deleteRecords(recordIndexs) {
41042
+ var _a;
41043
+ if (Array.isArray(this.records)) {
41044
+ const realDeletedRecordIndexs = [],
41045
+ recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
41046
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
41047
+ const recordIndex = recordIndexsMaxToMin[index];
41048
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41049
+ this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
41050
+ const deletedRecord = this.records[recordIndex];
41051
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
41052
+ this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
41053
+ }
41054
+ 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;
41139
41055
  }
41140
- 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;
41056
+ return [];
41141
41057
  }
41142
41058
  deleteRecordsForSorted(recordIndexs) {
41143
41059
  if (Array.isArray(this.records)) {
@@ -41151,34 +41067,18 @@
41151
41067
  this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
41152
41068
  }
41153
41069
  }
41154
- updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
41155
- var _a;
41156
- if (!syncToOriginalRecords) {
41157
- const realDeletedRecordIndexs = [];
41158
- for (let index = 0; index < recordIndexs.length; index++) {
41159
- const recordIndex = recordIndexs[index];
41160
- 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 {
41161
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41162
- this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
41163
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
41164
- this.records[recordIndex] = records[index];
41165
- }
41166
- }
41167
- return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
41168
- }
41169
- const rawRecords = this._getRawRecordsArray();
41170
- if (!rawRecords || !Array.isArray(this.records)) return [];
41171
- const realUpdatedIndexs = [];
41070
+ updateRecords(records, recordIndexs) {
41071
+ const realDeletedRecordIndexs = [];
41172
41072
  for (let index = 0; index < recordIndexs.length; index++) {
41173
41073
  const recordIndex = recordIndexs[index];
41174
- 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 {
41175
- if (recordIndex >= this.records.length || recordIndex < 0) continue;
41176
- const oldRecord = this.records[recordIndex],
41177
- rawIndex = rawRecords.indexOf(oldRecord);
41178
- rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
41074
+ 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 {
41075
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
41076
+ this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
41077
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
41078
+ this.records[recordIndex] = records[index];
41179
41079
  }
41180
41080
  }
41181
- return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
41081
+ return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
41182
41082
  }
41183
41083
  updateRecordsForSorted(records, recordIndexs) {
41184
41084
  for (let index = 0; index < recordIndexs.length; index++) {
@@ -41246,30 +41146,23 @@
41246
41146
  setSortedIndexMap(field, filedMap) {
41247
41147
  this.sortedIndexMap.set(field, filedMap);
41248
41148
  }
41249
- markForceVisibleRecord(record) {
41250
- !record || "object" != typeof record && "function" != typeof record || (this._forceVisibleRecords || (this._forceVisibleRecords = new WeakSet()), this._forceVisibleRecords.add(record));
41251
- }
41252
- clearForceVisibleRecords() {
41253
- this._forceVisibleRecords = void 0;
41254
- }
41255
41149
  clearFilteredChildren(record) {
41256
41150
  var _a, _b;
41257
41151
  record.filteredChildren = void 0;
41258
41152
  for (let i = 0; i < (null !== (_b = null === (_a = record.children) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0); i++) this.clearFilteredChildren(record.children[i]);
41259
41153
  }
41260
41154
  filterRecord(record) {
41261
- var _a, _b, _c, _d;
41262
- if (null === (_a = this._forceVisibleRecords) || void 0 === _a ? void 0 : _a.has(record)) return !0;
41155
+ var _a, _b, _c;
41263
41156
  let isReserved = !0;
41264
- for (let i = 0; i < (null === (_b = this.dataConfig.filterRules) || void 0 === _b ? void 0 : _b.length); i++) {
41265
- const filterRule = null === (_c = this.dataConfig) || void 0 === _c ? void 0 : _c.filterRules[i];
41157
+ for (let i = 0; i < (null === (_a = this.dataConfig.filterRules) || void 0 === _a ? void 0 : _a.length); i++) {
41158
+ const filterRule = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules[i];
41266
41159
  if (filterRule.filterKey) {
41267
41160
  const filterValue = record[filterRule.filterKey];
41268
41161
  if (-1 === filterRule.filteredValues.indexOf(filterValue)) {
41269
41162
  isReserved = !1;
41270
41163
  break;
41271
41164
  }
41272
- } else if (!(null === (_d = filterRule.filterFunc) || void 0 === _d ? void 0 : _d.call(filterRule, record))) {
41165
+ } else if (!(null === (_c = filterRule.filterFunc) || void 0 === _c ? void 0 : _c.call(filterRule, record))) {
41273
41166
  isReserved = !1;
41274
41167
  break;
41275
41168
  }
@@ -51853,7 +51746,7 @@
51853
51746
  rowUpdatePos = isValid$2(rowUpdatePos) ? isValid$2(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos : pos;
51854
51747
  }
51855
51748
  let updateAfter;
51856
- if (scene.table._clearRowRangeHeightsMap(), addRows.forEach(row => {
51749
+ if (scene.table._clearRowRangeHeightsMap(), verifyProxyRowStatus(scene), addRows.forEach(row => {
51857
51750
  const needUpdateAfter = addRow(row, scene, skipUpdateProxy);
51858
51751
  updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.insert(row);
51859
51752
  }), resetRowNumberAndY(scene), addRows.length) {
@@ -52083,6 +51976,25 @@
52083
51976
  function setRowSeriesNumberCellNeedUpdate(startUpdateRow, scene) {
52084
51977
  if (scene.table.isHasSeriesNumber()) for (let row = startUpdateRow; row <= scene.table.rowCount - 1; row++) updateCell$1(0, row, scene.table, !1);
52085
51978
  }
51979
+ function verifyProxyRowStatus(scene) {
51980
+ const proxy = scene.proxy,
51981
+ {
51982
+ rowStart: rowStart,
51983
+ rowEnd: rowEnd,
51984
+ rowLimit: rowLimit,
51985
+ totalRow: totalRow
51986
+ } = proxy;
51987
+ if (rowStart > rowEnd) return proxy.rowStart = scene.table.columnHeaderLevelCount, proxy.rowEnd = Math.min(totalRow, proxy.rowStart + rowLimit - 1), void (proxy.currentRow = 0);
51988
+ if (rowStart + rowLimit - 1 > totalRow) {
51989
+ const oldRowStart = proxy.rowStart,
51990
+ newRowStart = Math.max(scene.table.columnHeaderLevelCount, totalRow - rowLimit + 1);
51991
+ if (newRowStart === oldRowStart) return;
51992
+ proxy.rowStart = newRowStart, proxy.rowEnd = Math.min(totalRow, newRowStart + rowLimit - 1), proxy.currentRow = proxy.rowEnd + 1;
51993
+ const addRowCount = oldRowStart - proxy.rowStart;
51994
+ for (let i = 0; i < addRowCount; i++) addRowCellGroup(proxy.rowStart + i, scene);
51995
+ proxy.rowUpdatePos = proxy.rowStart;
51996
+ }
51997
+ }
52086
51998
 
52087
51999
  function createReactContainer(table) {
52088
52000
  const {
@@ -54038,7 +53950,7 @@
54038
53950
  } else if (-1 === cellPos.col || -1 === cellPos.row || -1 !== col && -1 !== row) {
54039
53951
  if (interactionState !== InteractionState.default || table.eventManager.isDraging || table.stateManager.isResizeCol()) {
54040
53952
  if ((interactionState === InteractionState.grabing || table.eventManager.isDraging) && !table.stateManager.isResizeCol()) {
54041
- let extendSelectRange = !0;
53953
+ let extendSelectRange = !isValid$2(skipBodyMerge) || !skipBodyMerge;
54042
53954
  -1 === cellPos.col && (cellPos.col = col), -1 === cellPos.row && (cellPos.row = row), cellPos.col = col, cellPos.row = row;
54043
53955
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
54044
53956
  if (currentRange) {
@@ -54160,7 +54072,7 @@
54160
54072
  };
54161
54073
  enableShiftSelectMode || (currentRange.end = currentRange.start), scenegraph.deleteLastSelectedRangeComponents(), scenegraph.updateCellSelectBorder(currentRange);
54162
54074
  } else {
54163
- let extendSelectRange = !0;
54075
+ let extendSelectRange = !isValid$2(skipBodyMerge) || !skipBodyMerge;
54164
54076
  if (-1 === cellPos.col || -1 === cellPos.row || enableCtrlSelectMode || (state.select.ranges = [], scenegraph.deleteAllSelectBorder()), "cell" !== state.select.headerSelectMode && table.isColumnHeader(col, row)) {
54165
54077
  const cellRange = table.getCellRange(col, row);
54166
54078
  "body" === state.select.headerSelectMode ? state.select.ranges.push({
@@ -57506,7 +57418,7 @@
57506
57418
  };
57507
57419
  let EventManager$1 = class EventManager {
57508
57420
  constructor(table) {
57509
- 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(() => {
57421
+ 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(() => {
57510
57422
  this.bindSelfEvent();
57511
57423
  }, 0));
57512
57424
  }
@@ -57808,25 +57720,15 @@
57808
57720
  } catch (error) {}
57809
57721
  }
57810
57722
  handleCut(e) {
57811
- var _a;
57812
57723
  return __awaiter$1(this, void 0, void 0, function* () {
57813
- 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 => ({
57814
- start: {
57815
- col: r.start.col,
57816
- row: r.start.row
57817
- },
57818
- end: {
57819
- col: r.end.col,
57820
- row: r.end.row
57821
- }
57822
- })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57823
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
57724
+ this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
57725
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
57824
57726
  }, 3e4), this.saveClipboardContent();
57825
57727
  });
57826
57728
  }
57827
57729
  handlePaste(e) {
57828
57730
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
57829
- 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));
57731
+ this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57830
57732
  }).catch(() => {
57831
57733
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
57832
57734
  }) : this.executePaste(e);
@@ -57903,9 +57805,9 @@
57903
57805
  }
57904
57806
  clearCutArea(table) {
57905
57807
  try {
57906
- const ranges = this.cutRanges;
57907
- if (!ranges || 0 === ranges.length) return;
57908
- table.changeCellValuesByIds(ranges, "");
57808
+ const selectCells = this.cutCellRange;
57809
+ if (!selectCells || 0 === selectCells.length) return;
57810
+ 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);
57909
57811
  } catch (error) {}
57910
57812
  }
57911
57813
  checkClipboardChanged() {
@@ -59841,22 +59743,41 @@
59841
59743
 
59842
59744
  class CustomCellStylePlugin {
59843
59745
  constructor(table, customCellStyle, customCellStyleArrangement) {
59844
- this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
59746
+ this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement, this._customCellStyleArrangementIndex = new Map(), this._customCellStyleArrangementTombstoneCount = 0, this._rebuildCustomCellStyleArrangementIndex();
59845
59747
  }
59846
- clearCustomCellStyleArrangement() {
59847
- this.customCellStyleArrangement = [];
59748
+ _getCustomCellStyleArrangementKey(cellPos) {
59749
+ if (cellPos.range) {
59750
+ const {
59751
+ start: start,
59752
+ end: end
59753
+ } = cellPos.range;
59754
+ return `range:${start.col},${start.row},${end.col},${end.row}`;
59755
+ }
59756
+ if (void 0 !== cellPos.col && void 0 !== cellPos.row) return `cell:${cellPos.col},${cellPos.row}`;
59848
59757
  }
59849
- addCustomCellStyleArrangement(cellPosition, customStyleId) {
59850
- this.customCellStyleArrangement.push({
59851
- cellPosition: cellPosition,
59852
- customStyleId: customStyleId
59853
- });
59758
+ _rebuildCustomCellStyleArrangementIndex() {
59759
+ this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0;
59760
+ for (let i = 0; i < this.customCellStyleArrangement.length; i++) {
59761
+ if (!isValid$2(this.customCellStyleArrangement[i].customStyleId)) {
59762
+ this._customCellStyleArrangementTombstoneCount++;
59763
+ continue;
59764
+ }
59765
+ const key = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[i].cellPosition);
59766
+ key && this._customCellStyleArrangementIndex.set(key, i);
59767
+ }
59768
+ }
59769
+ _compactCustomCellStyleArrangementIfNeeded() {
59770
+ const length = this.customCellStyleArrangement.length;
59771
+ if (this._customCellStyleArrangementTombstoneCount < 2048) return;
59772
+ if (4 * this._customCellStyleArrangementTombstoneCount < length) return;
59773
+ const compacted = this.customCellStyleArrangement.filter(style => isValid$2(style.customStyleId));
59774
+ compacted.length !== this.customCellStyleArrangement.length ? (this.customCellStyleArrangement.length = 0, this.customCellStyleArrangement.push(...compacted), this._rebuildCustomCellStyleArrangementIndex()) : this._customCellStyleArrangementTombstoneCount = 0;
59854
59775
  }
59855
59776
  getCustomCellStyle(col, row) {
59856
59777
  const customStyleIds = this.getCustomCellStyleIds(col, row);
59857
59778
  if (customStyleIds.length) {
59858
59779
  const styles = [];
59859
- return customStyleIds.forEach(customStyleId => {
59780
+ if (customStyleIds.forEach(customStyleId => {
59860
59781
  const styleOption = this.getCustomCellStyleOption(customStyleId);
59861
59782
  if (isFunction$4(null == styleOption ? void 0 : styleOption.style)) {
59862
59783
  const style = styleOption.style({
@@ -59869,14 +59790,15 @@
59869
59790
  });
59870
59791
  styles.push(style);
59871
59792
  } else (null == styleOption ? void 0 : styleOption.style) && styles.push(styleOption.style);
59872
- }), merge({}, ...styles);
59793
+ }), !styles.length) return;
59794
+ return merge({}, ...styles);
59873
59795
  }
59874
59796
  }
59875
59797
  getCustomCellStyleIds(col, row) {
59876
59798
  const customStyleIds = [],
59877
59799
  range = this.table.getCellRange(col, row);
59878
59800
  for (let c = range.start.col; c <= range.end.col; c++) for (let r = range.start.row; r <= range.end.row; r++) this.customCellStyleArrangement.forEach(style => {
59879
- style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId);
59801
+ isValid$2(style.customStyleId) && (style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && customStyleIds.push(style.customStyleId) : style.cellPosition.col === c && style.cellPosition.row === r && customStyleIds.push(style.customStyleId));
59880
59802
  });
59881
59803
  return customStyleIds;
59882
59804
  }
@@ -59897,21 +59819,35 @@
59897
59819
  }), this.table.scenegraph.updateNextFrame();
59898
59820
  }
59899
59821
  arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
59900
- var _a;
59901
- const index = this.customCellStyleArrangement.findIndex(style => style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row);
59902
- if (-1 === index && !customStyleId) return;
59903
- if (-1 === index && customStyleId) this.customCellStyleArrangement.push({
59904
- cellPosition: {
59905
- col: cellPos.col,
59906
- row: cellPos.row,
59907
- range: cellPos.range
59908
- },
59909
- customStyleId: customStyleId
59910
- });else {
59822
+ var _a, _b;
59823
+ const inputKey = this._getCustomCellStyleArrangementKey(cellPos);
59824
+ let index = inputKey && null !== (_a = this._customCellStyleArrangementIndex.get(inputKey)) && void 0 !== _a ? _a : -1;
59825
+ if (inputKey && -1 !== index) {
59826
+ const item = this.customCellStyleArrangement[index],
59827
+ itemKey = item ? this._getCustomCellStyleArrangementKey(item.cellPosition) : void 0;
59828
+ item && isValid$2(item.customStyleId) && itemKey === inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$2(style.customStyleId) && this._getCustomCellStyleArrangementKey(style.cellPosition) === inputKey), -1 !== index ? this._customCellStyleArrangementIndex.set(inputKey, index) : this._customCellStyleArrangementIndex.delete(inputKey));
59829
+ }
59830
+ if (-1 !== index || inputKey || (index = this.customCellStyleArrangement.findIndex(style => !!isValid$2(style.customStyleId) && (style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row))), -1 === index && !customStyleId) return;
59831
+ if (-1 === index && customStyleId) {
59832
+ this.customCellStyleArrangement.push({
59833
+ cellPosition: {
59834
+ col: cellPos.col,
59835
+ row: cellPos.row,
59836
+ range: cellPos.range
59837
+ },
59838
+ customStyleId: customStyleId
59839
+ });
59840
+ const pushedIndex = this.customCellStyleArrangement.length - 1,
59841
+ pushedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[pushedIndex].cellPosition);
59842
+ pushedKey && this._customCellStyleArrangementIndex.set(pushedKey, pushedIndex);
59843
+ } else {
59911
59844
  if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
59912
- customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
59845
+ if (customStyleId) this.customCellStyleArrangement[index].customStyleId = customStyleId;else {
59846
+ const existedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[index].cellPosition);
59847
+ isValid$2(this.customCellStyleArrangement[index].customStyleId) && this._customCellStyleArrangementTombstoneCount++, this.customCellStyleArrangement[index].customStyleId = null, existedKey && this._customCellStyleArrangementIndex.delete(existedKey), this._compactCustomCellStyleArrangementIfNeeded();
59848
+ }
59913
59849
  }
59914
- const style = null === (_a = this.getCustomCellStyleOption(customStyleId)) || void 0 === _a ? void 0 : _a.style;
59850
+ const style = customStyleId ? null === (_b = this.getCustomCellStyleOption(customStyleId)) || void 0 === _b ? void 0 : _b.style : void 0;
59915
59851
  if (style) {
59916
59852
  forceFastUpdate = !0;
59917
59853
  for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
@@ -59926,7 +59862,7 @@
59926
59862
  this.table.scenegraph.updateNextFrame();
59927
59863
  }
59928
59864
  updateCustomCell(customCellStyle, customCellStyleArrangement) {
59929
- this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, customCellStyle.forEach(cellStyle => {
59865
+ this.customCellStyle.length = 0, this.customCellStyleArrangement.length = 0, this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0, customCellStyle.forEach(cellStyle => {
59930
59866
  this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
59931
59867
  }), customCellStyleArrangement.forEach(cellStyle => {
59932
59868
  this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
@@ -60157,7 +60093,7 @@
60157
60093
  }
60158
60094
  constructor(container, options = {}) {
60159
60095
  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;
60160
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.9", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$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");
60096
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11", 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");
60161
60097
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
60162
60098
  options: options,
60163
60099
  container: container
@@ -61371,16 +61307,16 @@
61371
61307
  startCol = enableShiftSelectMode && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.col) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.col : colIndex,
61372
61308
  endCol = colIndex,
61373
61309
  endRow = this.rowCount - 1;
61374
- this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
61310
+ this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
61375
61311
  }
61376
61312
  dragSelectCol(colIndex, enableCtrlSelectMode) {
61377
61313
  var _a, _b;
61378
61314
  const currentSelectRanges = this.stateManager.select.ranges,
61379
61315
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
61380
- lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
61316
+ lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
61381
61317
  }
61382
61318
  endDragSelect() {
61383
- this.stateManager.updateInteractionState(InteractionState.default), this.stateManager.endSelectCells(!1, !1);
61319
+ this.stateManager.updateInteractionState(InteractionState.default);
61384
61320
  }
61385
61321
  startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
61386
61322
  var _a, _b, _c, _d, _e, _f;
@@ -61388,13 +61324,13 @@
61388
61324
  startRow = isShift && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.row) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.row : rowIndex,
61389
61325
  endCol = this.colCount - 1,
61390
61326
  endRow = rowIndex;
61391
- this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
61327
+ this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0), this.stateManager.select.selecting = !1;
61392
61328
  }
61393
61329
  dragSelectRow(rowIndex, isCtrl) {
61394
61330
  var _a, _b;
61395
61331
  const currentSelectRanges = this.stateManager.select.ranges,
61396
61332
  lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
61397
- lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
61333
+ lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0), this.stateManager.select.selecting = !1;
61398
61334
  }
61399
61335
  get recordsCount() {
61400
61336
  var _a;
@@ -62316,6 +62252,18 @@
62316
62252
  }
62317
62253
  return !1;
62318
62254
  }
62255
+ updateCellContent(col, row) {
62256
+ this.scenegraph.updateCellContent(col, row);
62257
+ }
62258
+ updateCellContentRange(startCol, startRow, endCol, endRow) {
62259
+ for (let i = startCol; i <= endCol; i++) for (let j = startRow; j <= endRow; j++) this.scenegraph.updateCellContent(i, j);
62260
+ }
62261
+ updateCellContentRanges(ranges) {
62262
+ for (let i = 0; i < ranges.length; i++) {
62263
+ const range = ranges[i];
62264
+ this.updateCellContentRange(range.start.col, range.start.row, range.end.col, range.end.row);
62265
+ }
62266
+ }
62319
62267
  }
62320
62268
 
62321
62269
  const chartTypes = {};
@@ -63818,8 +63766,8 @@
63818
63766
  col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1;
63819
63767
  const editor = this.table.getEditor(col, row);
63820
63768
  editor && setTimeout(() => {
63821
- var _a;
63822
- editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
63769
+ var _a, _b;
63770
+ editor && this.editingEditor !== editor && (null === (_b = (_a = editor).prepareEdit) || void 0 === _b || _b.call(_a, {
63823
63771
  referencePosition: referencePosition,
63824
63772
  container: this.table.getElement(),
63825
63773
  table: this.table,
@@ -63832,14 +63780,14 @@
63832
63780
  this.listenersId.push(doubleClickEventId, clickEventId, selectedChangedEventId);
63833
63781
  }
63834
63782
  startEditCell(col, row, value, editElement) {
63835
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
63783
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
63836
63784
  if (this.editingEditor) return;
63837
63785
  const editor = this.table.getEditor(col, row);
63838
63786
  if (editor) {
63839
- if (editElement && editor.setElement(editElement), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
63840
- if (null === (_b = null === (_a = this.table.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.isAggregation) || void 0 === _b ? void 0 : _b.call(_a, col, row)) {
63841
- const isPivotTable = null === (_d = (_c = this.table).isPivotTable) || void 0 === _d ? void 0 : _d.call(_c),
63842
- updateAggregationOnEditCell = !!isPivotTable && (null === (_f = null === (_e = this.table.internalProps) || void 0 === _e ? void 0 : _e.dataConfig) || void 0 === _f ? void 0 : _f.updateAggregationOnEditCell);
63787
+ if (editElement && (null === (_b = (_a = editor).setElement) || void 0 === _b || _b.call(_a, editElement)), this.table.internalProps.layoutMap.isSeriesNumber(col, row)) return;
63788
+ if (null === (_d = null === (_c = this.table.internalProps.layoutMap) || void 0 === _c ? void 0 : _c.isAggregation) || void 0 === _d ? void 0 : _d.call(_c, col, row)) {
63789
+ const isPivotTable = null === (_f = (_e = this.table).isPivotTable) || void 0 === _f ? void 0 : _f.call(_e),
63790
+ updateAggregationOnEditCell = !!isPivotTable && (null === (_h = null === (_g = this.table.internalProps) || void 0 === _g ? void 0 : _g.dataConfig) || void 0 === _h ? void 0 : _h.updateAggregationOnEditCell);
63843
63791
  if (!isPivotTable || isPivotTable && updateAggregationOnEditCell) return;
63844
63792
  }
63845
63793
  const record = this.table.getCellRawRecord(col, row);
@@ -63858,9 +63806,9 @@
63858
63806
  height: rect.height
63859
63807
  }
63860
63808
  };
63861
- col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (_g = editor.beginEditing) || void 0 === _g || _g.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_h = editor.bindSuccessCallback) || void 0 === _h || _h.call(editor, () => {
63809
+ col === this.table.colCount - 1 ? referencePosition.rect.width = rect.width - 1 : referencePosition.rect.width = rect.width + 1, row === this.table.rowCount - 1 ? referencePosition.rect.height = rect.height - 1 : referencePosition.rect.height = rect.height + 1, editor.beginEditing, null === (_j = editor.beginEditing) || void 0 === _j || _j.call(editor, this.table.getElement(), referencePosition, dataValue), editor.bindSuccessCallback, null === (_k = editor.bindSuccessCallback) || void 0 === _k || _k.call(editor, () => {
63862
63810
  this.completeEdit();
63863
- }), null === (_j = editor.onStart) || void 0 === _j || _j.call(editor, {
63811
+ }), null === (_l = editor.onStart) || void 0 === _l || _l.call(editor, {
63864
63812
  value: dataValue,
63865
63813
  endEdit: () => {
63866
63814
  this.completeEdit();
@@ -63968,16 +63916,15 @@
63968
63916
  step((generator = generator.apply(thisArg, _arguments || [])).next());
63969
63917
  });
63970
63918
  };
63971
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63919
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
63972
63920
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
63973
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
63974
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
63921
+ const recordIndex = table.getRecordShowIndexByCell(col, row),
63975
63922
  {
63976
63923
  field: field
63977
63924
  } = table.internalProps.layoutMap.getBody(col, row),
63978
63925
  beforeChangeValue = table.getCellRawValue(col, row),
63979
63926
  oldValue = table.getCellOriginValue(col, row);
63980
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
63927
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
63981
63928
  const range = table.getCellRange(col, row),
63982
63929
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
63983
63930
  if (aggregators) {
@@ -64000,24 +63947,16 @@
64000
63947
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
64001
63948
  }
64002
63949
  const changedValue = table.getCellOriginValue(col, row);
64003
- if (oldValue !== changedValue && triggerEvent) {
64004
- const changeValue = {
64005
- col: col,
64006
- row: row,
64007
- recordIndex: recordIndex,
64008
- field: field,
64009
- rawValue: beforeChangeValue,
64010
- currentValue: oldValue,
64011
- changedValue: changedValue
64012
- };
64013
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
64014
- values: [changeValue]
64015
- });
64016
- }
64017
- table.scenegraph.updateNextFrame();
63950
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
63951
+ col: col,
63952
+ row: row,
63953
+ rawValue: beforeChangeValue,
63954
+ currentValue: oldValue,
63955
+ changedValue: changedValue
63956
+ }), table.scenegraph.updateNextFrame();
64018
63957
  }
64019
63958
  }
64020
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
63959
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
64021
63960
  var _a, _b;
64022
63961
  return __awaiter(this, void 0, void 0, function* () {
64023
63962
  const changedCellResults = [];
@@ -64039,7 +63978,6 @@
64039
63978
  oldRowValues.push(oldValue);
64040
63979
  }
64041
63980
  }
64042
- const resultChangeValues = [];
64043
63981
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
64044
63982
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
64045
63983
  const rowValues = values[i];
@@ -64063,34 +64001,25 @@
64063
64001
  if (isCanChange) {
64064
64002
  changedCellResults[i][j] = !0;
64065
64003
  const value = rowValues[j],
64066
- recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
64067
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64004
+ recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
64068
64005
  {
64069
64006
  field: field
64070
64007
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
64071
64008
  beforeChangeValue = beforeChangeValues[i][j],
64072
64009
  oldValue = oldValues[i][j];
64073
- 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);
64010
+ table.isHeader(startCol + j, startRow + i) ? table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);
64074
64011
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
64075
- if (oldValue !== changedValue && triggerEvent) {
64076
- const changeValue = {
64077
- col: startCol + j,
64078
- row: startRow + i,
64079
- recordIndex: recordIndex,
64080
- field: field,
64081
- rawValue: beforeChangeValue,
64082
- currentValue: oldValue,
64083
- changedValue: changedValue
64084
- };
64085
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
64086
- }
64012
+ oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
64013
+ col: startCol + j,
64014
+ row: startRow + i,
64015
+ rawValue: beforeChangeValue,
64016
+ currentValue: oldValue,
64017
+ changedValue: changedValue
64018
+ });
64087
64019
  } else changedCellResults[i][j] = !1;
64088
64020
  }
64089
64021
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
64090
64022
  }
64091
- silentChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
64092
- values: resultChangeValues
64093
- });
64094
64023
  const startRange = table.getCellRange(startCol, startRow),
64095
64024
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
64096
64025
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -64124,58 +64053,6 @@
64124
64053
  return table.scenegraph.updateNextFrame(), changedCellResults;
64125
64054
  });
64126
64055
  }
64127
- function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
64128
- var _a, _b;
64129
- return __awaiter(this, void 0, void 0, function* () {
64130
- const resultChangeValues = [],
64131
- processed = new Set(),
64132
- nextValue = null != value ? value : "";
64133
- for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
64134
- const range = ranges[i],
64135
- startCol = Math.min(range.start.col, range.end.col),
64136
- endCol = Math.max(range.start.col, range.end.col),
64137
- startRow = Math.min(range.start.row, range.end.row),
64138
- endRow = Math.max(range.start.row, range.end.row);
64139
- if (startCol > endCol || startRow > endRow) continue;
64140
- const values = [],
64141
- oldValues = [];
64142
- for (let row = startRow; row <= endRow; row++) {
64143
- const rowValues = [],
64144
- rowOldValues = [];
64145
- for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
64146
- values.push(rowValues), oldValues.push(rowOldValues);
64147
- }
64148
- const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
64149
- for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
64150
- const col = startCol + c,
64151
- row = startRow + r,
64152
- key = `${col},${row}`;
64153
- if (processed.has(key)) continue;
64154
- if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
64155
- const oldValue = oldValues[r][c],
64156
- changedValue = table.getCellOriginValue(col, row);
64157
- if (oldValue === changedValue) continue;
64158
- const recordShowIndex = table.getRecordShowIndexByCell(col, row),
64159
- recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
64160
- {
64161
- field: field
64162
- } = table.internalProps.layoutMap.getBody(col, row);
64163
- resultChangeValues.push({
64164
- col: col,
64165
- row: row,
64166
- recordIndex: recordIndex,
64167
- field: field,
64168
- rawValue: oldValue,
64169
- currentValue: oldValue,
64170
- changedValue: changedValue
64171
- });
64172
- }
64173
- }
64174
- !silentChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
64175
- values: resultChangeValues
64176
- });
64177
- });
64178
- }
64179
64056
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
64180
64057
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
64181
64058
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -64193,16 +64070,13 @@
64193
64070
  }), table.dataSource.sort(sortState));
64194
64071
  }
64195
64072
  function listTableAddRecord(record, recordIndex, table) {
64196
- var _a, _b, _c, _d, _e, _f;
64073
+ var _a, _b, _c, _d;
64197
64074
  try {
64198
64075
  if (!record) return !1;
64199
- 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) {
64200
- !!(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();
64201
- } else {
64076
+ if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [record], recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [record], recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordForSorted(record), table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64202
64077
  (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
64203
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
64204
- syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
64205
- 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;
64078
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
64079
+ table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
64206
64080
  const oldRowCount = table.rowCount;
64207
64081
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64208
64082
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -64271,16 +64145,13 @@
64271
64145
  }
64272
64146
  }
64273
64147
  function listTableAddRecords(records, recordIndex, table) {
64274
- var _a, _b, _c, _d, _e, _f;
64148
+ var _a, _b, _c, _d;
64275
64149
  try {
64276
64150
  if (!records || 0 === records.length) return !1;
64277
- 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) {
64278
- !!(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();
64279
- } else {
64151
+ if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.addRecordsForSorted(records), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64280
64152
  void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
64281
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
64282
- syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
64283
- 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;
64153
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
64154
+ table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
64284
64155
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
64285
64156
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
64286
64157
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -64349,20 +64220,16 @@
64349
64220
  }
64350
64221
  }
64351
64222
  function listTableDeleteRecords(recordIndexs, table) {
64352
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
64223
+ var _a, _b, _c, _d, _e, _f, _g, _h;
64353
64224
  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) {
64354
64225
  const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
64355
64226
  if (0 === deletedRecordIndexs.length) return;
64356
64227
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
64357
64228
  table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
64358
- } else if (table.sortState) {
64359
- !!(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();
64360
- } else {
64361
- const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
64362
- deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
64229
+ } else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64230
+ const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
64363
64231
  if (0 === deletedRecordIndexs.length) return;
64364
64232
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
64365
- if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
64366
64233
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
64367
64234
  table.refreshRowColCount();
64368
64235
  const newRowCount = table.transpose ? table.colCount : table.rowCount,
@@ -64400,7 +64267,7 @@
64400
64267
  col: 0,
64401
64268
  row: row
64402
64269
  });
64403
- 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();
64270
+ null === (_e = table.reactCustomLayout) || void 0 === _e || _e.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_f = table.reactCustomLayout) || void 0 === _f || _f.updateAllCustomCell();
64404
64271
  }
64405
64272
  } else {
64406
64273
  const delRows = [],
@@ -64432,19 +64299,15 @@
64432
64299
  col: 0,
64433
64300
  row: row
64434
64301
  });
64435
- 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();
64302
+ null === (_g = table.reactCustomLayout) || void 0 === _g || _g.clearCache(), table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows), null === (_h = table.reactCustomLayout) || void 0 === _h || _h.updateAllCustomCell();
64436
64303
  }
64437
64304
  }
64438
64305
  }
64439
64306
  function listTableUpdateRecords(records, recordIndexs, table) {
64440
- var _a, _b, _c, _d, _e, _f;
64441
- 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) {
64442
- !!(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();
64443
- } else {
64444
- const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
64445
- updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
64307
+ var _a, _b, _c, _d;
64308
+ if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).updateRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndexs), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else if (table.sortState) table.dataSource.updateRecordsForSorted(records, recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
64309
+ const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
64446
64310
  if (0 === updateRecordIndexs.length) return;
64447
- if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
64448
64311
  const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
64449
64312
  if (table.pagination) {
64450
64313
  const {
@@ -65210,8 +65073,8 @@
65210
65073
  updateFilterRules(filterRules, options = {
65211
65074
  clearRowHeightCache: !0
65212
65075
  }) {
65213
- var _a, _b, _c;
65214
- this.scenegraph.clearCells(), null === (_b = (_a = this.dataSource).clearForceVisibleRecords) || void 0 === _b || _b.call(_a), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules, null == options ? void 0 : options.onFilterRecordsEnd), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!(null == options ? void 0 : options.clearRowHeightCache)), null === (_c = this.internalProps.emptyTip) || void 0 === _c || _c.resetVisible(), this.resize();
65076
+ var _a;
65077
+ this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules, null == options ? void 0 : options.onFilterRecordsEnd), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(!(null == options ? void 0 : options.clearRowHeightCache)), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), this.resize();
65215
65078
  }
65216
65079
  getFilteredRecords() {
65217
65080
  return this.dataSource.records;
@@ -65353,165 +65216,43 @@
65353
65216
  }
65354
65217
  return isValid$2(editorDefine);
65355
65218
  }
65356
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65357
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65358
- }
65359
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65360
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65361
- }
65362
- changeCellValuesByIds(ranges, value, workOnEditableCell = !1, triggerEvent = !0, silentChangeCellValuesEvent) {
65363
- return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
65364
- }
65365
- changeSourceCellValue(recordIndex, field, value) {
65366
- const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
65367
- cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
65368
- if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
65369
- this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
65370
- const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
65371
- oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
65372
- changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
65373
- if (oldValue !== changedValue) {
65374
- const changeValue = {
65375
- col: cellAddr.col,
65376
- row: cellAddr.row,
65377
- recordIndex: recordIndex,
65378
- field: field,
65379
- rawValue: beforeChangeValue,
65380
- currentValue: oldValue,
65381
- changedValue: changedValue
65382
- };
65383
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65384
- values: [changeValue]
65385
- });
65386
- }
65387
- }
65388
- changeCellValueByRecord(recordIndex, field, value, options) {
65389
- var _a, _b, _c, _d, _e;
65390
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65391
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65392
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65393
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65394
- let record, oldValue;
65395
- 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;
65396
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65397
- if (oldValue !== changedValue) {
65398
- const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
65399
- changeValue = {
65400
- col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
65401
- row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
65402
- recordIndex: recordIndex,
65403
- field: field,
65404
- rawValue: oldValue,
65405
- currentValue: oldValue,
65406
- changedValue: changedValue
65407
- };
65408
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), silentChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65409
- values: [changeValue]
65410
- });
65411
- }
65412
- autoRefresh && this.refreshAfterSourceChange();
65413
- }
65414
- changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, silentChangeCellValuesEvent) {
65415
- return this.changeCellValueByRecord(recordIndex, field, value, {
65416
- triggerEvent: triggerEvent,
65417
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65418
- autoRefresh: !0
65419
- });
65420
- }
65421
- changeCellValuesByRecords(changeValues, options) {
65422
- var _a, _b, _c, _d, _e, _f, _g;
65423
- const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
65424
- silentChangeCellValuesEvent = null == options ? void 0 : options.silentChangeCellValuesEvent,
65425
- autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
65426
- resultChangeValues = [];
65427
- for (let i = 0; i < changeValues.length; i++) {
65428
- const {
65429
- recordIndex: recordIndex,
65430
- field: field,
65431
- value: value
65432
- } = changeValues[i],
65433
- records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
65434
- let record, oldValue;
65435
- 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) {
65436
- const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
65437
- if (oldValue !== changedValue) {
65438
- const changeValue = {
65439
- col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
65440
- row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
65441
- recordIndex: recordIndex,
65442
- field: field,
65443
- rawValue: oldValue,
65444
- currentValue: oldValue,
65445
- changedValue: changedValue
65446
- };
65447
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
65448
- }
65449
- }
65450
- }
65451
- !silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
65452
- values: resultChangeValues
65453
- }), autoRefresh && this.refreshAfterSourceChange();
65454
- }
65455
- changeCellValuesBySource(changeValues, triggerEvent = !0, silentChangeCellValuesEvent) {
65456
- return this.changeCellValuesByRecords(changeValues, {
65457
- triggerEvent: triggerEvent,
65458
- silentChangeCellValuesEvent: silentChangeCellValuesEvent,
65459
- autoRefresh: !0
65460
- });
65219
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
65220
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
65461
65221
  }
65462
- refreshAfterSourceChange(options) {
65463
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
65464
- const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
65465
- reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
65466
- clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
65467
- 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);
65468
- const traverseColumns = columns => {
65469
- var _a, _b, _c, _d;
65470
- for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
65471
- const column = columns[i],
65472
- aggregators = null == column ? void 0 : column.vtable_aggregator;
65473
- 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);
65474
- (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
65475
- }
65476
- };
65477
- 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();
65222
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
65223
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
65478
65224
  }
65479
- addRecord(record, recordIndex, triggerEvent = !0) {
65225
+ addRecord(record, recordIndex) {
65480
65226
  var _a;
65481
65227
  const success = listTableAddRecord(record, recordIndex, this);
65482
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65228
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65483
65229
  records: [record],
65484
65230
  recordIndex: recordIndex,
65485
65231
  recordCount: 1
65486
65232
  });
65487
65233
  }
65488
- addRecords(records, recordIndex, triggerEvent = !0) {
65234
+ addRecords(records, recordIndex) {
65489
65235
  var _a;
65490
65236
  const success = listTableAddRecords(records, recordIndex, this);
65491
- "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, {
65237
+ "number" == typeof recordIndex && adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
65492
65238
  records: records,
65493
65239
  recordIndex: recordIndex,
65494
65240
  recordCount: records.length
65495
65241
  });
65496
65242
  }
65497
- deleteRecords(recordIndexs, triggerEvent = !0) {
65243
+ deleteRecords(recordIndexs) {
65498
65244
  var _a;
65499
- const deletedRecords = [];
65500
- (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
65501
- let record = null;
65502
- record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
65503
- }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65245
+ listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
65504
65246
  const rowIndexs = [];
65505
65247
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
65506
- triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65248
+ this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
65507
65249
  recordIndexs: recordIndexs,
65508
- records: deletedRecords,
65509
65250
  rowIndexs: rowIndexs,
65510
65251
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
65511
65252
  });
65512
65253
  }
65513
- updateRecords(records, recordIndexs, triggerEvent = !0) {
65514
- listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65254
+ updateRecords(records, recordIndexs) {
65255
+ listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
65515
65256
  records: records,
65516
65257
  recordIndexs: recordIndexs,
65517
65258
  updateCount: records.length
@@ -69731,8 +69472,8 @@
69731
69472
  }(ExcelEditCellKeyboardResponse || (ExcelEditCellKeyboardResponse = {}));
69732
69473
  class ExcelEditCellKeyboardPlugin {
69733
69474
  constructor(pluginOptions) {
69734
- var _a, _b, _c;
69735
- 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();
69475
+ var _a, _b;
69476
+ 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();
69736
69477
  }
69737
69478
  run(...args) {
69738
69479
  const table = args[2];
@@ -69763,7 +69504,7 @@
69763
69504
  (null == selectCells ? void 0 : selectCells.length) > 0 && (document.activeElement === this.table.getElement() || Object.values(this.table.editorManager.cacheLastSelectedCellEditor || {}).some(editor => {
69764
69505
  var _a;
69765
69506
  return (null === (_a = editor.getInputElement) || void 0 === _a ? void 0 : _a.call(editor)) === document.activeElement;
69766
- })) && (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());
69507
+ })) && (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());
69767
69508
  }
69768
69509
  } 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();
69769
69510
  }
@@ -69785,11 +69526,8 @@
69785
69526
  document.removeEventListener("keydown", this.handleKeyDown, !0);
69786
69527
  }
69787
69528
  }
69788
- function deleteSelectRange(selectCells, tableInstance, workOnEditableCell = !1, aggregateToOneChangeCellValuesEvent = !1) {
69789
- if (aggregateToOneChangeCellValuesEvent) {
69790
- const ranges = tableInstance.stateManager.select.ranges;
69791
- (null == ranges ? void 0 : ranges.length) && tableInstance.changeCellValuesByIds(ranges, "", workOnEditableCell, !0);
69792
- } 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);
69529
+ function deleteSelectRange(selectCells, tableInstance, workOnEditableCell = !1) {
69530
+ 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);
69793
69531
  }
69794
69532
 
69795
69533
  const MENU_CONTAINER_CLASS = "vtable-context-menu-container";
@@ -82023,7 +81761,9 @@
82023
81761
  } else (runtime === TABLE_EVENT_TYPE.UPDATE_RECORD || runtime === TABLE_EVENT_TYPE.ADD_RECORD || runtime === TABLE_EVENT_TYPE.DELETE_RECORD) && this.syncFilterWithTableData();
82024
81762
  }
82025
81763
  updatePluginOptions(pluginOptions) {
82026
- this.pluginOptions = lodashExports.merge(this.pluginOptions, pluginOptions), this.filterToolbar.updateStyles(this.pluginOptions.styles);
81764
+ this.pluginOptions = lodashExports.merge(this.pluginOptions, pluginOptions), this.filterToolbar.updateStyles(this.pluginOptions.styles), this.table.updateColumns(this.columns, {
81765
+ clearRowHeightCache: !1
81766
+ });
82027
81767
  }
82028
81768
  update() {
82029
81769
  this.filterStateManager && this.reapplyActiveFilters();
@@ -87983,6 +87723,54 @@
87983
87723
  if (rowIndexs && rowIndexs.length > 0) {
87984
87724
  const minIndex = Math.min(...rowIndexs.flat());
87985
87725
  this.vtableSheet.formulaManager.removeRows(sheetKey, minIndex, deletedCount);
87726
+ if (Array.isArray(this.tableInstance.options.customMergeCell)) {
87727
+ const mergeCellsToRemove = [];
87728
+ const deleteEndIndex = minIndex + deletedCount - 1;
87729
+ const customMergeCellArray = this.tableInstance.options.customMergeCell;
87730
+ const cloneMergeCellArray = customMergeCellArray.map(mergeCell => ({
87731
+ ...mergeCell,
87732
+ range: {
87733
+ start: { ...mergeCell.range.start },
87734
+ end: { ...mergeCell.range.end }
87735
+ }
87736
+ }));
87737
+ customMergeCellArray.forEach((mergeCell, index) => {
87738
+ const startRow = mergeCell.range.start.row;
87739
+ const endRow = mergeCell.range.end.row;
87740
+ if (startRow >= minIndex && endRow <= deleteEndIndex) {
87741
+ mergeCellsToRemove.push(index);
87742
+ return;
87743
+ }
87744
+ if (startRow <= deleteEndIndex && endRow >= minIndex) {
87745
+ if (startRow >= minIndex) {
87746
+ mergeCell.range.start.row = minIndex;
87747
+ }
87748
+ if (endRow <= deleteEndIndex) {
87749
+ mergeCell.range.end.row = minIndex - 1;
87750
+ }
87751
+ else {
87752
+ mergeCell.range.end.row -= deletedCount;
87753
+ }
87754
+ if (mergeCell.range.start.row > mergeCell.range.end.row) {
87755
+ mergeCellsToRemove.push(index);
87756
+ }
87757
+ }
87758
+ else if (startRow > deleteEndIndex) {
87759
+ mergeCell.range.start.row -= deletedCount;
87760
+ mergeCell.range.end.row -= deletedCount;
87761
+ }
87762
+ });
87763
+ mergeCellsToRemove
87764
+ .sort((a, b) => b - a)
87765
+ .forEach(index => {
87766
+ customMergeCellArray.splice(index, 1);
87767
+ });
87768
+ const updateRanges = cloneMergeCellArray.map(mergeCell => ({
87769
+ start: { ...mergeCell.range.start },
87770
+ end: { ...mergeCell.range.end }
87771
+ }));
87772
+ this.tableInstance.updateCellContentRange(updateRanges);
87773
+ }
87986
87774
  }
87987
87775
  }
87988
87776
  }
@@ -88010,6 +87798,54 @@
88010
87798
  const minIndex = Math.min(...deleteColIndexs.flat());
88011
87799
  const deletedCount = deleteColIndexs.length;
88012
87800
  this.vtableSheet.formulaManager.removeColumns(sheetKey, minIndex, deletedCount);
87801
+ if (Array.isArray(this.tableInstance.options.customMergeCell)) {
87802
+ const mergeCellsToRemove = [];
87803
+ const deleteEndIndex = minIndex + deletedCount - 1;
87804
+ const customMergeCellArray = this.tableInstance.options.customMergeCell;
87805
+ const cloneMergeCellArray = customMergeCellArray.map(mergeCell => ({
87806
+ ...mergeCell,
87807
+ range: {
87808
+ start: { ...mergeCell.range.start },
87809
+ end: { ...mergeCell.range.end }
87810
+ }
87811
+ }));
87812
+ customMergeCellArray.forEach((mergeCell, index) => {
87813
+ const startCol = mergeCell.range.start.col;
87814
+ const endCol = mergeCell.range.end.col;
87815
+ if (startCol >= minIndex && endCol <= deleteEndIndex) {
87816
+ mergeCellsToRemove.push(index);
87817
+ return;
87818
+ }
87819
+ if (startCol <= deleteEndIndex && endCol >= minIndex) {
87820
+ if (startCol >= minIndex) {
87821
+ mergeCell.range.start.col = minIndex;
87822
+ }
87823
+ if (endCol <= deleteEndIndex) {
87824
+ mergeCell.range.end.col = minIndex - 1;
87825
+ }
87826
+ else {
87827
+ mergeCell.range.end.col -= deletedCount;
87828
+ }
87829
+ if (mergeCell.range.start.col > mergeCell.range.end.col) {
87830
+ mergeCellsToRemove.push(index);
87831
+ }
87832
+ }
87833
+ else if (startCol > deleteEndIndex) {
87834
+ mergeCell.range.start.col -= deletedCount;
87835
+ mergeCell.range.end.col -= deletedCount;
87836
+ }
87837
+ });
87838
+ mergeCellsToRemove
87839
+ .sort((a, b) => b - a)
87840
+ .forEach(index => {
87841
+ customMergeCellArray.splice(index, 1);
87842
+ });
87843
+ const updateRanges = cloneMergeCellArray.map(mergeCell => ({
87844
+ start: { ...mergeCell.range.start },
87845
+ end: { ...mergeCell.range.end }
87846
+ }));
87847
+ this.tableInstance.updateCellContentRange(updateRanges);
87848
+ }
88013
87849
  }
88014
87850
  }
88015
87851
  }
@@ -91352,7 +91188,7 @@
91352
91188
  importStyle();
91353
91189
  }
91354
91190
 
91355
- const version = "1.22.11-alpha.9";
91191
+ const version = "1.22.11";
91356
91192
  importStyles();
91357
91193
 
91358
91194
  exports.TYPES = index;