@visactor/vtable-calendar 1.23.1-alpha.2 → 1.23.2

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.
@@ -33565,7 +33565,7 @@
33565
33565
  }(IconPosition || (IconPosition = {}));
33566
33566
  var IconFuncTypeEnum;
33567
33567
  !function (IconFuncTypeEnum) {
33568
- IconFuncTypeEnum.frozen = "frozen", IconFuncTypeEnum.sort = "sort", IconFuncTypeEnum.dropDown = "dropDown", IconFuncTypeEnum.dropDownState = "dropDownState", IconFuncTypeEnum.play = "play", IconFuncTypeEnum.damagePic = "damagePic", IconFuncTypeEnum.expand = "expand", IconFuncTypeEnum.collapse = "collapse", IconFuncTypeEnum.drillDown = "drillDown", IconFuncTypeEnum.drillUp = "drillUp", IconFuncTypeEnum.dragReorder = "dragReorder";
33568
+ IconFuncTypeEnum.frozen = "frozen", IconFuncTypeEnum.sort = "sort", IconFuncTypeEnum.dropDown = "dropDown", IconFuncTypeEnum.dropDownState = "dropDownState", IconFuncTypeEnum.play = "play", IconFuncTypeEnum.damagePic = "damagePic", IconFuncTypeEnum.imageDamagePic = "imageDamagePic", IconFuncTypeEnum.videoDamagePic = "videoDamagePic", IconFuncTypeEnum.expand = "expand", IconFuncTypeEnum.collapse = "collapse", IconFuncTypeEnum.drillDown = "drillDown", IconFuncTypeEnum.drillUp = "drillUp", IconFuncTypeEnum.dragReorder = "dragReorder";
33569
33569
  }(IconFuncTypeEnum || (IconFuncTypeEnum = {}));
33570
33570
  var InternalIconName;
33571
33571
  !function (InternalIconName) {
@@ -34922,6 +34922,7 @@
34922
34922
  AFTER_UPDATE_CELL_CONTENT_WIDTH: "after_update_cell_content_width",
34923
34923
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: "after_update_select_border_height",
34924
34924
  CHANGE_CELL_VALUE: "change_cell_value",
34925
+ CHANGE_CELL_VALUES: "change_cell_values",
34925
34926
  DRAG_FILL_HANDLE_END: "drag_fill_handle_end",
34926
34927
  MOUSEDOWN_FILL_HANDLE: "mousedown_fill_handle",
34927
34928
  DBLCLICK_FILL_HANDLE: "dblclick_fill_handle",
@@ -37040,6 +37041,24 @@
37040
37041
  }
37041
37042
  }
37042
37043
  }
37044
+ changeFieldValueByRecordIndex(value, recordIndex, field, table) {
37045
+ var _a, _b, _c, _d;
37046
+ if (null === field) return;
37047
+ if (null == recordIndex) return;
37048
+ const rawKey = recordIndex.toString();
37049
+ if (!this.beforeChangedRecordsMap.has(rawKey)) {
37050
+ const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null,
37051
+ originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
37052
+ this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, ["vtable_gantt_linkedFrom", "vtable_gantt_linkedTo"])) && void 0 !== _b ? _b : {});
37053
+ }
37054
+ if ("string" == typeof field || "number" == typeof field) {
37055
+ const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field],
37056
+ rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null,
37057
+ record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
37058
+ let formatValue = value;
37059
+ "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);
37060
+ }
37061
+ }
37043
37062
  cacheBeforeChangedRecord(dataIndex, table) {
37044
37063
  var _a;
37045
37064
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -37055,41 +37074,92 @@
37055
37074
  Array.isArray(indexed) || this.records.splice(indexed, 1, record);
37056
37075
  }
37057
37076
  }
37058
- addRecord(record, index) {
37077
+ _getRawRecordsArray() {
37059
37078
  var _a;
37060
- if (Array.isArray(this.records)) {
37061
- this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
37062
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
37063
- if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
37064
- this.pagination.totalCount = this._sourceLength;
37065
- const {
37066
- perPageCount: perPageCount,
37067
- currentPage: currentPage
37068
- } = this.pagination;
37069
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
37070
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37071
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
37079
+ const rawRecords = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records;
37080
+ return Array.isArray(rawRecords) ? rawRecords : null;
37081
+ }
37082
+ _hasFilterInEffect() {
37083
+ var _a, _b, _c, _d, _e;
37084
+ 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;
37085
+ }
37086
+ _normalizeInsertIndex(index, length) {
37087
+ return null == index || index > length ? length : index < 0 ? 0 : index;
37088
+ }
37089
+ _mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
37090
+ if (0 === this.records.length) return rawRecords.length;
37091
+ if (viewIndex <= 0) {
37092
+ const firstVisibleRecord = this.records[0],
37093
+ rawIndex = rawRecords.indexOf(firstVisibleRecord);
37094
+ return rawIndex >= 0 ? rawIndex : 0;
37072
37095
  }
37096
+ if (viewIndex >= this.records.length) {
37097
+ const lastVisibleRecord = this.records[this.records.length - 1],
37098
+ rawIndex = rawRecords.indexOf(lastVisibleRecord);
37099
+ return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
37100
+ }
37101
+ const prevRecord = this.records[viewIndex - 1],
37102
+ rawIndex = rawRecords.indexOf(prevRecord);
37103
+ return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
37073
37104
  }
37074
- addRecords(recordArr, index) {
37075
- var _a;
37076
- if (Array.isArray(this.records)) {
37077
- if (Array.isArray(recordArr)) {
37078
- this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
37079
- for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
37080
- this._sourceLength += recordArr.length;
37081
- for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
37105
+ _resetIndexingFromViewRecords() {
37106
+ if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
37107
+ length: this._sourceLength
37108
+ }, (_, i) => i), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
37109
+ this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37110
+ }
37111
+ addRecord(record, index, syncToOriginalRecords = !1) {
37112
+ var _a, _b, _c;
37113
+ if (!syncToOriginalRecords) {
37114
+ if (Array.isArray(this.records)) {
37115
+ this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1), this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
37116
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
37117
+ if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
37118
+ this.pagination.totalCount = this._sourceLength;
37119
+ const {
37120
+ perPageCount: perPageCount,
37121
+ currentPage: currentPage
37122
+ } = this.pagination;
37123
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
37124
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37125
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
37082
37126
  }
37083
- if (this.userPagination) {
37084
- this.pagination.totalCount = this._sourceLength;
37085
- const {
37086
- perPageCount: perPageCount,
37087
- currentPage: currentPage
37088
- } = this.pagination;
37089
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
37090
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37091
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
37127
+ return;
37092
37128
  }
37129
+ const rawRecords = this._getRawRecordsArray();
37130
+ if (!rawRecords) return;
37131
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
37132
+ rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
37133
+ 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);
37134
+ }
37135
+ addRecords(recordArr, index, syncToOriginalRecords = !1) {
37136
+ var _a, _b, _c;
37137
+ if (!syncToOriginalRecords) {
37138
+ if (Array.isArray(this.records)) {
37139
+ if (Array.isArray(recordArr)) {
37140
+ this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
37141
+ for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
37142
+ this._sourceLength += recordArr.length;
37143
+ for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
37144
+ }
37145
+ if (this.userPagination) {
37146
+ this.pagination.totalCount = this._sourceLength;
37147
+ const {
37148
+ perPageCount: perPageCount,
37149
+ currentPage: currentPage
37150
+ } = this.pagination;
37151
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
37152
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength, this.updatePagerData();
37153
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
37154
+ }
37155
+ return;
37156
+ }
37157
+ const rawRecords = this._getRawRecordsArray();
37158
+ if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
37159
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length),
37160
+ rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
37161
+ if (rawRecords.splice(rawInsertIndex, 0, ...recordArr), syncToOriginalRecords && this._hasFilterInEffect()) for (let i = 0; i < recordArr.length; i++) this.markForceVisibleRecord(recordArr[i]);
37162
+ 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);
37093
37163
  }
37094
37164
  addRecordForSorted(record) {
37095
37165
  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));
@@ -37105,27 +37175,49 @@
37105
37175
  }
37106
37176
  }
37107
37177
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
37108
- for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
37109
- const record = this.beforeChangedRecordsMap.get(key.toString());
37110
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
37111
- }
37112
- }
37113
- deleteRecords(recordIndexs) {
37114
- var _a;
37115
- if (Array.isArray(this.records)) {
37116
- const realDeletedRecordIndexs = [],
37117
- recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
37118
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
37119
- const recordIndex = recordIndexsMaxToMin[index];
37120
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
37121
- this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
37122
- const deletedRecord = this.records[recordIndex];
37123
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
37124
- this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
37178
+ const delta = "add" === type ? insertCount : -insertCount,
37179
+ numericKeys = [];
37180
+ this.beforeChangedRecordsMap.forEach((_, key) => {
37181
+ const numKey = Number(key);
37182
+ Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
37183
+ }), numericKeys.sort((a, b) => "add" === type ? b - a : a - b);
37184
+ for (let i = 0; i < numericKeys.length; i++) {
37185
+ const key = numericKeys[i],
37186
+ record = this.beforeChangedRecordsMap.get(key.toString());
37187
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
37188
+ }
37189
+ }
37190
+ deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
37191
+ var _a, _b, _c;
37192
+ if (!syncToOriginalRecords) {
37193
+ if (Array.isArray(this.records)) {
37194
+ const realDeletedRecordIndexs = [],
37195
+ recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
37196
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
37197
+ const recordIndex = recordIndexsMaxToMin[index];
37198
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
37199
+ this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
37200
+ const deletedRecord = this.records[recordIndex];
37201
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
37202
+ this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
37203
+ }
37204
+ 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;
37125
37205
  }
37126
- 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;
37206
+ return [];
37127
37207
  }
37128
- return [];
37208
+ const rawRecords = this._getRawRecordsArray();
37209
+ if (!rawRecords || !Array.isArray(this.records)) return [];
37210
+ const realDeletedRecordIndexs = [],
37211
+ recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a),
37212
+ rawDeletedIndexs = [];
37213
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
37214
+ const viewIndex = recordIndexsMaxToMin[index];
37215
+ if (viewIndex >= this.records.length || viewIndex < 0) continue;
37216
+ const deletedRecord = this.records[viewIndex],
37217
+ rawIndex = rawRecords.indexOf(deletedRecord);
37218
+ rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)), realDeletedRecordIndexs.push(viewIndex);
37219
+ }
37220
+ 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;
37129
37221
  }
37130
37222
  deleteRecordsForSorted(recordIndexs) {
37131
37223
  if (Array.isArray(this.records)) {
@@ -37139,18 +37231,34 @@
37139
37231
  this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
37140
37232
  }
37141
37233
  }
37142
- updateRecords(records, recordIndexs) {
37143
- const realDeletedRecordIndexs = [];
37234
+ updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
37235
+ var _a;
37236
+ if (!syncToOriginalRecords) {
37237
+ const realDeletedRecordIndexs = [];
37238
+ for (let index = 0; index < recordIndexs.length; index++) {
37239
+ const recordIndex = recordIndexs[index];
37240
+ 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 {
37241
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
37242
+ this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
37243
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
37244
+ this.records[recordIndex] = records[index];
37245
+ }
37246
+ }
37247
+ return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
37248
+ }
37249
+ const rawRecords = this._getRawRecordsArray();
37250
+ if (!rawRecords || !Array.isArray(this.records)) return [];
37251
+ const realUpdatedIndexs = [];
37144
37252
  for (let index = 0; index < recordIndexs.length; index++) {
37145
37253
  const recordIndex = recordIndexs[index];
37146
- 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 {
37147
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
37148
- this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
37149
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
37150
- this.records[recordIndex] = records[index];
37254
+ 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 {
37255
+ if (recordIndex >= this.records.length || recordIndex < 0) continue;
37256
+ const oldRecord = this.records[recordIndex],
37257
+ rawIndex = rawRecords.indexOf(oldRecord);
37258
+ rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
37151
37259
  }
37152
37260
  }
37153
- return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
37261
+ return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules), realUpdatedIndexs;
37154
37262
  }
37155
37263
  updateRecordsForSorted(records, recordIndexs) {
37156
37264
  for (let index = 0; index < recordIndexs.length; index++) {
@@ -37218,23 +37326,30 @@
37218
37326
  setSortedIndexMap(field, filedMap) {
37219
37327
  this.sortedIndexMap.set(field, filedMap);
37220
37328
  }
37329
+ markForceVisibleRecord(record) {
37330
+ !record || "object" != typeof record && "function" != typeof record || (this._forceVisibleRecords || (this._forceVisibleRecords = new WeakSet()), this._forceVisibleRecords.add(record));
37331
+ }
37332
+ clearForceVisibleRecords() {
37333
+ this._forceVisibleRecords = void 0;
37334
+ }
37221
37335
  clearFilteredChildren(record) {
37222
37336
  var _a, _b;
37223
37337
  record.filteredChildren = void 0;
37224
37338
  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]);
37225
37339
  }
37226
37340
  filterRecord(record) {
37227
- var _a, _b, _c;
37341
+ var _a, _b, _c, _d;
37342
+ if (null === (_a = this._forceVisibleRecords) || void 0 === _a ? void 0 : _a.has(record)) return !0;
37228
37343
  let isReserved = !0;
37229
- for (let i = 0; i < (null === (_a = this.dataConfig.filterRules) || void 0 === _a ? void 0 : _a.length); i++) {
37230
- const filterRule = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules[i];
37344
+ for (let i = 0; i < (null === (_b = this.dataConfig.filterRules) || void 0 === _b ? void 0 : _b.length); i++) {
37345
+ const filterRule = null === (_c = this.dataConfig) || void 0 === _c ? void 0 : _c.filterRules[i];
37231
37346
  if (filterRule.filterKey) {
37232
37347
  const filterValue = record[filterRule.filterKey];
37233
37348
  if (-1 === filterRule.filteredValues.indexOf(filterValue)) {
37234
37349
  isReserved = !1;
37235
37350
  break;
37236
37351
  }
37237
- } else if (!(null === (_c = filterRule.filterFunc) || void 0 === _c ? void 0 : _c.call(filterRule, record))) {
37352
+ } else if (!(null === (_d = filterRule.filterFunc) || void 0 === _d ? void 0 : _d.call(filterRule, record))) {
37238
37353
  isReserved = !1;
37239
37354
  break;
37240
37355
  }
@@ -41050,7 +41165,7 @@
41050
41165
  image: value,
41051
41166
  cursor: "pointer"
41052
41167
  });
41053
- return image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, keepAspectRatio || imageAutoSizing ? image.resources && image.resources.has(image.attribute.image) && "success" === image.resources.get(image.attribute.image).state ? (image.setAttribute("opacity", 0), setTimeout(() => {
41168
+ if (image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, keepAspectRatio || imageAutoSizing ? image.resources && image.resources.has(image.attribute.image) && "success" === image.resources.get(image.attribute.image).state ? (image.setAttribute("opacity", 0), setTimeout(() => {
41054
41169
  image.setAttribute("opacity", 1), updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table), table.scenegraph.updateNextFrame();
41055
41170
  }, 0)) : image.successCallback = () => {
41056
41171
  updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table), table.scenegraph.updateNextFrame();
@@ -41058,8 +41173,12 @@
41058
41173
  updateImageCellContentWhileResize(cellGroup, col, row, 0, 0, table);
41059
41174
  }, image.failCallback = () => {
41060
41175
  const regedIcons = get$2();
41061
- image.image = regedIcons.damage_pic.svg;
41062
- }, cellGroup.appendChild(image), cellGroup;
41176
+ image.image = regedIcons.image_damage_pic ? regedIcons.image_damage_pic.svg : regedIcons.damage_pic.svg;
41177
+ }, "string" == typeof value && !(value.startsWith("<svg") || isValidUrl$1(value) || value.includes("/") || isBase64$1(value))) {
41178
+ const regedIcons = get$2();
41179
+ image.image = regedIcons.image_damage_pic ? regedIcons.image_damage_pic.svg : regedIcons.damage_pic.svg;
41180
+ }
41181
+ return cellGroup.appendChild(image), cellGroup;
41063
41182
  }
41064
41183
  function _adjustWidthHeight(col, row, width, height, scene, padding, cellGroup) {
41065
41184
  let needInvalidate = !1,
@@ -41203,7 +41322,7 @@
41203
41322
  }
41204
41323
  function isDamagePic(image) {
41205
41324
  const regedIcons = get$2();
41206
- return image.attribute.image === regedIcons.damage_pic.svg;
41325
+ return image.attribute.image === regedIcons.damage_pic.svg || regedIcons.image_damage_pic && image.attribute.image === regedIcons.image_damage_pic.svg || regedIcons.video_damage_pic && image.attribute.image === regedIcons.video_damage_pic.svg;
41207
41326
  }
41208
41327
 
41209
41328
  function dealPromiseData(dataPromise, tabel, callback) {
@@ -41320,7 +41439,7 @@
41320
41439
  };
41321
41440
  }
41322
41441
  function updateCell$1(col, row, table, addNew, isShadow, forceFastUpdate) {
41323
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
41442
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
41324
41443
  const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, !0);
41325
41444
  if ("cell" !== oldCellGroup.role && !addNew) return;
41326
41445
  const cellLocation = table.getCellLocation(col, row);
@@ -41429,7 +41548,7 @@
41429
41548
  return oldCellGroup;
41430
41549
  }
41431
41550
  if (!addNew && "empty" === oldCellGroup.role) return;
41432
- const type = isVtableMerge || isCustomMerge ? "text" : table.isHeader(col, row) ? null !== (_s = table._getHeaderLayoutMap(col, row).headerType) && void 0 !== _s ? _s : "text" : null !== (_t = table.getBodyColumnType(col, row)) && void 0 !== _t ? _t : "text",
41551
+ const type = isVtableMerge || isCustomMerge ? "text" : table.getCellType(col, row),
41433
41552
  padding = cellTheme._vtable.padding,
41434
41553
  textAlign = cellTheme.text.textAlign,
41435
41554
  textBaseline = cellTheme.text.textBaseline;
@@ -41975,7 +42094,6 @@
41975
42094
  table.isPivotTable() && (layoutMap.disableUseGetBodyCache(), layoutMap.disableUseHeaderPathCache());
41976
42095
  }
41977
42096
  function computeRowHeight(row, startCol, endCol, table) {
41978
- var _a;
41979
42097
  if (!(table.isAutoRowHeight(row) || "adaptive" === table.heightMode && !1 !== table.options.autoHeightInAdaptiveMode) && "auto" !== table.getDefaultRowHeight(row)) return table.getDefaultRowHeight(row);
41980
42098
  let maxHeight;
41981
42099
  if (table.options.customComputeRowHeight) {
@@ -42018,7 +42136,7 @@
42018
42136
  }
42019
42137
  }
42020
42138
  if (table.isPivotChart() && (table.isLeftFrozenColumn(col) && table.isBottomFrozenRow(row) || table.isRightFrozenColumn(col) && table.isBottomFrozenRow(row))) continue;
42021
- const cellType = table.isHeader(col, row) ? null === (_a = table._getHeaderLayoutMap(col, row)) || void 0 === _a ? void 0 : _a.headerType : table.getBodyColumnType(col, row),
42139
+ const cellType = table.getCellType(col, row),
42022
42140
  textHeight = computeTextHeight(col, row, cellType, table);
42023
42141
  maxHeight = isValid$1(maxHeight) ? Math.max(textHeight, maxHeight) : textHeight;
42024
42142
  }
@@ -42265,12 +42383,12 @@
42265
42383
  cell && updateCellHeight(scene, cell, col, row, height, detaY);
42266
42384
  }
42267
42385
  function updateCellHeight(scene, cell, col, row, distHeight, detaY, isHeader) {
42268
- var _a, _b, _c, _d, _e;
42386
+ var _a, _b, _c;
42269
42387
  if (cell.attribute.height === distHeight && !cell.needUpdateHeight) return;
42270
42388
  cell.needUpdateHeight = !1, cell.setAttribute("height", distHeight);
42271
42389
  const isVtableMerge = null === (_a = scene.table.getCellRawRecord(col, row)) || void 0 === _a ? void 0 : _a.vtableMerge,
42272
42390
  isCustomMerge = !!scene.table.getCustomMerge(col, row),
42273
- type = isVtableMerge || isCustomMerge ? "text" : scene.table.isHeader(col, row) ? null !== (_b = scene.table._getHeaderLayoutMap(col, row).headerType) && void 0 !== _b ? _b : "text" : null !== (_c = scene.table.getBodyColumnType(col, row)) && void 0 !== _c ? _c : "text";
42391
+ type = isVtableMerge || isCustomMerge ? "text" : scene.table.getCellType(col, row);
42274
42392
  if ("progressbar" === type) {
42275
42393
  const columnDefine = scene.table.getBodyColumnDefine(col, row),
42276
42394
  style = scene.table._getCellStyle(col, row),
@@ -42287,7 +42405,7 @@
42287
42405
  const headerStyle = scene.table._getCellStyle(col, row),
42288
42406
  padding = getQuadProps(getProp("padding", headerStyle, col, row, scene.table));
42289
42407
  Factory.getFunction("createSparkLineCellGroup")(cell, cell.parent, cell.attribute.x, cell.attribute.y, col, row, cell.attribute.width, cell.attribute.height, padding, scene.table, getStyleTheme(headerStyle, scene.table, col, row, getProp).theme, !1);
42290
- } else if ("image" === type || "video" === type) updateImageCellContentWhileResize(cell, col, row, 0, detaY, scene.table);else if ("axis" === (null === (_d = cell.firstChild) || void 0 === _d ? void 0 : _d.name)) null === (_e = cell.firstChild) || void 0 === _e || _e.originAxis.resize(cell.attribute.width, cell.attribute.height);else {
42408
+ } else if ("image" === type || "video" === type) updateImageCellContentWhileResize(cell, col, row, 0, detaY, scene.table);else if ("axis" === (null === (_b = cell.firstChild) || void 0 === _b ? void 0 : _b.name)) null === (_c = cell.firstChild) || void 0 === _c || _c.originAxis.resize(cell.attribute.width, cell.attribute.height);else {
42291
42409
  let renderDefault = !0;
42292
42410
  const customContainer = cell.getChildByName(CUSTOM_CONTAINER_NAME$1) || cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
42293
42411
  if (customContainer) {
@@ -42460,7 +42578,7 @@
42460
42578
  }
42461
42579
  }
42462
42580
  function updateCellWidth(scene, cell, col, row, oldWidth, distWidth, detaX, isHeader, autoWrapText) {
42463
- var _a, _b, _c, _d, _e, _f, _g;
42581
+ var _a, _b, _c, _d, _e;
42464
42582
  if (cell.attribute.width === distWidth && !cell.needUpdateWidth) return !1;
42465
42583
  cell.needUpdateWidth = !1, cell.setAttribute("width", distWidth);
42466
42584
  const cellGroup = cell;
@@ -42468,7 +42586,7 @@
42468
42586
  const autoRowHeight = scene.table.isAutoRowHeight(row),
42469
42587
  isVtableMerge = null === (_a = scene.table.getCellRawRecord(col, row)) || void 0 === _a ? void 0 : _a.vtableMerge,
42470
42588
  isCustomMerge = !!scene.table.getCustomMerge(col, row),
42471
- type = isVtableMerge || isCustomMerge ? "text" : scene.table.isHeader(col, row) ? null !== (_b = scene.table._getHeaderLayoutMap(col, row).headerType) && void 0 !== _b ? _b : "text" : null !== (_c = scene.table.getBodyColumnType(col, row)) && void 0 !== _c ? _c : "text";
42589
+ type = isVtableMerge || isCustomMerge ? "text" : scene.table.getCellType(col, row);
42472
42590
  let isHeightChange = !1;
42473
42591
  if ("progressbar" === type) {
42474
42592
  const columnDefine = scene.table.getBodyColumnDefine(col, row),
@@ -42488,15 +42606,15 @@
42488
42606
  const headerStyle = scene.table._getCellStyle(col, row),
42489
42607
  padding = getQuadProps(getProp("padding", headerStyle, col, row, scene.table));
42490
42608
  Factory.getFunction("createSparkLineCellGroup")(cellGroup, cellGroup.parent, cellGroup.attribute.x, cellGroup.attribute.y, col, row, cellGroup.attribute.width, cellGroup.attribute.height, padding, scene.table, getStyleTheme(headerStyle, scene.table, col, row, getProp).theme, !1);
42491
- } else if ("image" === type || "video" === type) updateImageCellContentWhileResize(cellGroup, col, row, detaX, 0, scene.table);else if ("axis" === (null === (_d = cellGroup.firstChild) || void 0 === _d ? void 0 : _d.name)) {
42609
+ } else if ("image" === type || "video" === type) updateImageCellContentWhileResize(cellGroup, col, row, detaX, 0, scene.table);else if ("axis" === (null === (_b = cellGroup.firstChild) || void 0 === _b ? void 0 : _b.name)) {
42492
42610
  const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row),
42493
42611
  cellStyle = scene.table._getCellStyle(col, row),
42494
42612
  padding = getQuadProps(getProp("padding", cellStyle, col, row, scene.table));
42495
42613
  if (axisConfig) {
42496
- const axis = new (Factory.getComponent("axis"))(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, null !== (_e = axisConfig.__vtableBodyChartCellPadding) && void 0 !== _e ? _e : padding, scene.table);
42614
+ const axis = new (Factory.getComponent("axis"))(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, null !== (_c = axisConfig.__vtableBodyChartCellPadding) && void 0 !== _c ? _c : padding, scene.table);
42497
42615
  cellGroup.clear(), cellGroup.appendChild(axis.component), axis.overlap();
42498
42616
  }
42499
- } else if ("axis" === (null === (_f = cell.firstChild) || void 0 === _f ? void 0 : _f.name)) null === (_g = cell.firstChild) || void 0 === _g || _g.originAxis.resize(cell.attribute.width, cell.attribute.height);else {
42617
+ } else if ("axis" === (null === (_d = cell.firstChild) || void 0 === _d ? void 0 : _d.name)) null === (_e = cell.firstChild) || void 0 === _e || _e.originAxis.resize(cell.attribute.width, cell.attribute.height);else {
42500
42618
  let renderDefault = !0;
42501
42619
  const customContainer = cell.getChildByName(CUSTOM_CONTAINER_NAME$1) || cell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
42502
42620
  if (customContainer) {
@@ -46034,7 +46152,7 @@
46034
46152
  return table.internalProps.transpose && "auto" === width && ("only-header" === table.columnWidthComputeMode && col >= table.rowHeaderLevelCount || "only-body" === table.columnWidthComputeMode && col < table.rowHeaderLevelCount) && (width = table.getDefaultColumnWidth(col)), forceCompute && !table.internalProps.transpose ? computeAutoColWidth(width, col, startRow, endRow, forceCompute, table) : "number" == typeof width ? width : "auto" !== width && "string" == typeof width ? table._adjustColWidth(col, table._colWidthDefineToPxWidth(width)) : computeAutoColWidth(width, col, startRow, endRow, forceCompute, table);
46035
46153
  }
46036
46154
  function computeAutoColWidth(widthDeifne, col, startRow, endRow, forceCompute, table) {
46037
- var _a, _b, _c, _d, _e;
46155
+ var _a, _b, _c, _d;
46038
46156
  let maxWidth = 0,
46039
46157
  deltaRow = 1,
46040
46158
  prepareDeltaRow = 1;
@@ -46066,7 +46184,7 @@
46066
46184
  maxWidth = Math.max(indicatorWidth, maxWidth);
46067
46185
  continue;
46068
46186
  }
46069
- const cellType = table.isHeader(col, row) ? null === (_a = table._getHeaderLayoutMap(col, row)) || void 0 === _a ? void 0 : _a.headerType : table.getBodyColumnType(col, row);
46187
+ const cellType = table.getCellType(col, row);
46070
46188
  if (isValid$1(cellType) && "text" !== cellType && "link" !== cellType && "progressbar" !== cellType && "checkbox" !== cellType && "radio" !== cellType && "switch" !== cellType && "button" !== cellType) {
46071
46189
  maxWidth = Math.max(maxWidth, table.getColWidthDefinedNumber(col) || 0);
46072
46190
  continue;
@@ -46075,14 +46193,14 @@
46075
46193
  const layoutMap = table.internalProps.layoutMap;
46076
46194
  if (layoutMap.isHeader(col, row)) {
46077
46195
  const hd = layoutMap.getHeader(col, row);
46078
- if ("only-body" === (null === (_b = null == hd ? void 0 : hd.define) || void 0 === _b ? void 0 : _b.columnWidthComputeMode)) continue;
46079
- isValid$1(null == hd ? void 0 : hd.hierarchyLevel) && (cellHierarchyIndent = (null !== (_c = hd.hierarchyLevel) && void 0 !== _c ? _c : 0) * ("tree" === layoutMap.rowHierarchyType && null !== (_d = layoutMap.rowHierarchyIndent) && void 0 !== _d ? _d : 0), layoutMap.rowHierarchyTextStartAlignment && !table.internalProps.headerHelper.getHierarchyIcon(col, row) && (cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth()));
46196
+ if ("only-body" === (null === (_a = null == hd ? void 0 : hd.define) || void 0 === _a ? void 0 : _a.columnWidthComputeMode)) continue;
46197
+ isValid$1(null == hd ? void 0 : hd.hierarchyLevel) && (cellHierarchyIndent = (null !== (_b = hd.hierarchyLevel) && void 0 !== _b ? _b : 0) * ("tree" === layoutMap.rowHierarchyType && null !== (_c = layoutMap.rowHierarchyIndent) && void 0 !== _c ? _c : 0), layoutMap.rowHierarchyTextStartAlignment && !table.internalProps.headerHelper.getHierarchyIcon(col, row) && (cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth()));
46080
46198
  } else if (table.isListTable()) {
46081
46199
  deltaRow = prepareDeltaRow;
46082
46200
  const define = table.getBodyColumnDefine(col, row);
46083
46201
  if (null == define ? void 0 : define.tree) {
46084
46202
  const indexArr = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));
46085
- cellHierarchyIndent = Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none ? (indexArr.length - 1) * (null !== (_e = layoutMap.hierarchyIndent) && void 0 !== _e ? _e : 0) : 0, layoutMap.hierarchyTextStartAlignment && !table.internalProps.bodyHelper.getHierarchyIcon(col, row) && (cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth());
46203
+ cellHierarchyIndent = Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none ? (indexArr.length - 1) * (null !== (_d = layoutMap.hierarchyIndent) && void 0 !== _d ? _d : 0) : 0, layoutMap.hierarchyTextStartAlignment && !table.internalProps.bodyHelper.getHierarchyIcon(col, row) && (cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth());
46086
46204
  }
46087
46205
  }
46088
46206
  const textWidth = computeTextWidth(col, row, cellType, table);
@@ -46336,7 +46454,6 @@
46336
46454
  emptyGroup.role = "empty";
46337
46455
 
46338
46456
  function createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, mergeMap, defaultRowHeight, table, rowLimit) {
46339
- var _a, _b;
46340
46457
  let padding,
46341
46458
  textAlign,
46342
46459
  textBaseline,
@@ -46390,7 +46507,7 @@
46390
46507
  } = null != rawRecord ? rawRecord : {};
46391
46508
  isVtableMerge = vtableMerge, vtableMerge && (mayHaveIcon = !0, table.internalProps.groupTitleCustomLayout && (customResult = dealWithCustom(table.internalProps.groupTitleCustomLayout, void 0, range.start.col, range.start.row, table.getColsWidth(range.start.col, range.end.col), table.getRowsHeight(range.start.row, range.end.row), !1, table.isAutoRowHeight(row), [0, 0, 0, 0], range, table)), table.internalProps.groupTitleFieldFormat ? value = table.internalProps.groupTitleFieldFormat(rawRecord, col, row, table) : void 0 !== vtableMergeName && (value = vtableMergeName));
46392
46509
  }
46393
- const type = isVtableMerge || isCustomMerge ? "text" : null !== (_b = table.isHeader(col, row) ? null !== (_a = table._getHeaderLayoutMap(col, row).headerType) && void 0 !== _a ? _a : "text" : table.getBodyColumnType(col, row)) && void 0 !== _b ? _b : "text";
46510
+ const type = isVtableMerge || isCustomMerge ? "text" : table.getCellType(col, row);
46394
46511
  if (isPromise(value)) {
46395
46512
  createEmptyCellGroup(col, row, 0, y, cellWidth, cellHeight, columnGroup), dealPromiseData(value, table, callCreateCellForPromiseValue.bind(null, {
46396
46513
  type: type,
@@ -49884,7 +50001,7 @@
49884
50001
  }
49885
50002
  updateCellContentWhileResize(col, row) {
49886
50003
  var _a;
49887
- const type = (null === (_a = this.table.getCellRawRecord(col, row)) || void 0 === _a ? void 0 : _a.vtableMerge) ? "text" : this.table.isHeader(col, row) ? this.table._getHeaderLayoutMap(col, row).headerType : this.table.getBodyColumnType(col, row),
50004
+ const type = (null === (_a = this.table.getCellRawRecord(col, row)) || void 0 === _a ? void 0 : _a.vtableMerge) ? "text" : this.table.getCellType(col, row),
49888
50005
  cellGroup = this.getCell(col, row);
49889
50006
  "image" !== type && "video" !== type || updateImageCellContentWhileResize(cellGroup, col, row, 0, 0, this.table);
49890
50007
  }
@@ -52209,9 +52326,8 @@
52209
52326
  row: row
52210
52327
  } = e;
52211
52328
  if ("image" === e.target.type && e.target.role && e.target.role.startsWith("icon")) return;
52212
- let cellType;
52213
- cellType = table.internalProps.layoutMap.isHeader(col, row) ? table.isPivotTable() ? table._getHeaderLayoutMap(col, row).headerType : table.getHeaderDefine(col, row).headerType : table.getBodyColumnType(col, row);
52214
- const columnDefine = table.isHeader(col, row) ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row),
52329
+ const cellType = table.getCellType(col, row),
52330
+ columnDefine = table.isHeader(col, row) ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row),
52215
52331
  cellValue = table.getCellValue(col, row),
52216
52332
  cellOriginValue = table.getCellOriginValue(col, row);
52217
52333
  if ("link" === cellType) {
@@ -52239,7 +52355,9 @@
52239
52355
  if (rowData && rowData.vtableMerge) return;
52240
52356
  const data = Object.assign({
52241
52357
  __value: cellValue,
52242
- __dataValue: cellOriginValue
52358
+ __dataValue: cellOriginValue,
52359
+ value: cellValue,
52360
+ dataValue: cellOriginValue
52243
52361
  }, rowData);
52244
52362
  if (isFunction$3(templateLink)) url = templateLink(data, col, row, table);else {
52245
52363
  const re = /\{\s*(\S+?)\s*\}/g;
@@ -52263,7 +52381,7 @@
52263
52381
  e.target === overlay && document.body.removeChild(overlay);
52264
52382
  });
52265
52383
  const image = new Image();
52266
- image.src = cellValue, image.style.maxWidth = "80%", image.style.maxHeight = "80%", overlay.appendChild(image), document.body.appendChild(overlay);
52384
+ image.src = cellValue, image.style.maxWidth = "80%", image.style.maxHeight = "80%", image.style.backgroundColor = "#FFF", overlay.appendChild(image), document.body.appendChild(overlay);
52267
52385
  } else if ("video" === cellType) {
52268
52386
  const {
52269
52387
  clickToPreview: clickToPreview
@@ -52701,7 +52819,7 @@
52701
52819
  }, 0);
52702
52820
  }
52703
52821
  }), table.scenegraph.tableGroup.addEventListener("rightdown", e => {
52704
- var _a, _b, _c, _d, _e, _f, _g;
52822
+ var _a, _b, _c, _d, _e, _f, _g, _h;
52705
52823
  const eventArgsSet = getCellEventArgsSet(e);
52706
52824
  if (eventArgsSet.eventArgs) {
52707
52825
  stateManager.triggerContextMenu(eventArgsSet.eventArgs.col, eventArgsSet.eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
@@ -52724,11 +52842,11 @@
52724
52842
  }
52725
52843
  }
52726
52844
  const disableSelectOnContextMenu = null === (_a = table.options.select) || void 0 === _a ? void 0 : _a.disableSelectOnContextMenu;
52727
- if (cellInRange || disableSelectOnContextMenu || table.selectCell(col, row), table.hasListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL)) {
52845
+ if (cellInRange || disableSelectOnContextMenu || "chart" === (null === (_b = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target.type) || table.selectCell(col, row), table.hasListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL)) {
52728
52846
  const cellInfo = table.getCellInfo(col, row);
52729
52847
  let icon, position;
52730
- if (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) {
52731
- const iconInfo = getIconAndPositionFromTarget(null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target);
52848
+ if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
52849
+ const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
52732
52850
  iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
52733
52851
  }
52734
52852
  const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
@@ -52739,10 +52857,10 @@
52739
52857
  position: position,
52740
52858
  funcType: icon.attribute.funcType
52741
52859
  } : void 0,
52742
- target: null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target,
52743
- mergeCellInfo: null === (_e = eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.mergeInfo
52860
+ target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
52861
+ mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
52744
52862
  });
52745
- (null === (_g = null === (_f = table.options.eventOptions) || void 0 === _f ? void 0 : _f.contextmenuReturnAllSelectedCells) || void 0 === _g || _g) && (cellInRanges(table.stateManager.select.ranges, col, row) ? cellsEvent.cells = table.getSelectedCellInfos() : cellsEvent.cells = [[cellInfo]]), table.fireListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, cellsEvent);
52863
+ (null === (_h = null === (_g = table.options.eventOptions) || void 0 === _g ? void 0 : _g.contextmenuReturnAllSelectedCells) || void 0 === _h || _h) && (cellInRanges(table.stateManager.select.ranges, col, row) ? cellsEvent.cells = table.getSelectedCellInfos() : cellsEvent.cells = [[cellInfo]]), table.fireListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, cellsEvent);
52746
52864
  }
52747
52865
  }
52748
52866
  }
@@ -53093,7 +53211,7 @@
53093
53211
  const relatedTarget = e.relatedTarget;
53094
53212
  if (relatedTarget) {
53095
53213
  const selectedRanges = table.stateManager.select.ranges,
53096
- editor = 1 === selectedRanges.length && selectedRanges[0].start.col === selectedRanges[0].end.col && selectedRanges[0].start.row === selectedRanges[0].end.row && table.getEditor(table.stateManager.select.cellPos.col, table.stateManager.select.cellPos.row);
53214
+ editor = 1 === selectedRanges.length && selectedRanges[0].start.col === selectedRanges[0].end.col && selectedRanges[0].start.row === selectedRanges[0].end.row && table.getEditor && table.getEditor(table.stateManager.select.cellPos.col, table.stateManager.select.cellPos.row);
53097
53215
  if ((null === (_a = null == editor ? void 0 : editor.getInputElement) || void 0 === _a ? void 0 : _a.call(editor)) === relatedTarget) return;
53098
53216
  }
53099
53217
  eventManager.dealTableHover();
@@ -53696,7 +53814,7 @@
53696
53814
  };
53697
53815
  class EventManager {
53698
53816
  constructor(table) {
53699
- this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
53817
+ this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.cutRanges = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
53700
53818
  this.bindSelfEvent();
53701
53819
  }, 0));
53702
53820
  }
@@ -53998,15 +54116,25 @@
53998
54116
  } catch (error) {}
53999
54117
  }
54000
54118
  handleCut(e) {
54119
+ var _a;
54001
54120
  return __awaiter$1(this, void 0, void 0, function* () {
54002
- this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
54003
- this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer = null);
54121
+ 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 => ({
54122
+ start: {
54123
+ col: r.start.col,
54124
+ row: r.start.row
54125
+ },
54126
+ end: {
54127
+ col: r.end.col,
54128
+ row: r.end.row
54129
+ }
54130
+ })), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
54131
+ this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.cutRanges = null, this.clipboardCheckTimer = null);
54004
54132
  }, 3e4), this.saveClipboardContent();
54005
54133
  });
54006
54134
  }
54007
54135
  handlePaste(e) {
54008
54136
  this.cutWaitPaste ? this.checkClipboardChanged().then(changed => {
54009
- this.executePaste(e), changed || this.clearCutArea(this.table), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
54137
+ 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));
54010
54138
  }).catch(() => {
54011
54139
  this.executePaste(e), this.cutWaitPaste && (this.cutWaitPaste = !1, this.cutCellRange = null, this.clipboardCheckTimer && (clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = null));
54012
54140
  }) : this.executePaste(e);
@@ -54083,9 +54211,9 @@
54083
54211
  }
54084
54212
  clearCutArea(table) {
54085
54213
  try {
54086
- const selectCells = this.cutCellRange;
54087
- if (!selectCells || 0 === selectCells.length) return;
54088
- 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);
54214
+ const ranges = this.cutRanges;
54215
+ if (!ranges || 0 === ranges.length) return;
54216
+ table.changeCellValuesByRanges(ranges, "");
54089
54217
  } catch (error) {}
54090
54218
  }
54091
54219
  checkClipboardChanged() {
@@ -56051,6 +56179,15 @@
56051
56179
  const compacted = this.customCellStyleArrangement.filter(style => isValid$1(style.customStyleId));
56052
56180
  compacted.length !== this.customCellStyleArrangement.length ? (this.customCellStyleArrangement.length = 0, this.customCellStyleArrangement.push(...compacted), this._rebuildCustomCellStyleArrangementIndex()) : this._customCellStyleArrangementTombstoneCount = 0;
56053
56181
  }
56182
+ clearCustomCellStyleArrangement() {
56183
+ this.customCellStyleArrangement = [];
56184
+ }
56185
+ addCustomCellStyleArrangement(cellPosition, customStyleId) {
56186
+ this.customCellStyleArrangement.push({
56187
+ cellPosition: cellPosition,
56188
+ customStyleId: customStyleId
56189
+ });
56190
+ }
56054
56191
  getCustomCellStyle(col, row) {
56055
56192
  const customStyleIds = this.getCustomCellStyleIds(col, row);
56056
56193
  if (customStyleIds.length) {
@@ -56186,7 +56323,7 @@
56186
56323
  paddingForAxis = null !== (_e = null === (_d = layoutMap.getBody(table.columnHeaderLevelCount, row).style) || void 0 === _d ? void 0 : _d.padding) && void 0 !== _e ? _e : table.theme.bodyStyle.padding;
56187
56324
  }
56188
56325
  if ((!hd || hd.isEmpty) && (layoutMap.isLeftBottomCorner(col, row) || layoutMap.isRightBottomCorner(col, row) || layoutMap.isCornerHeader(col, row) || layoutMap.isRightTopCorner(col, row))) return EMPTY_STYLE;
56189
- const styleClass = table.internalProps.headerHelper.getStyleClass((null == hd ? void 0 : hd.headerType) || "text");
56326
+ const styleClass = table.internalProps.headerHelper.getStyleClass(table.getCellType(col, row));
56190
56327
  if (layoutMap.isBottomFrozenRow(col, row) && table.theme.bottomFrozenStyle) cacheStyle = of(paddingForAxis ? {
56191
56328
  padding: paddingForAxis
56192
56329
  } : {}, table.theme.bottomFrozenStyle, {
@@ -56371,7 +56508,7 @@
56371
56508
  }
56372
56509
  constructor(container, options = {}) {
56373
56510
  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;
56374
- if (super(), this.showFrozenIcon = !0, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.23.1-alpha.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
56511
+ if (super(), this.showFrozenIcon = !0, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.23.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
56375
56512
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
56376
56513
  options: options,
56377
56514
  container: container
@@ -60016,8 +60153,8 @@
60016
60153
  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;
60017
60154
  const editor = this.table.getEditor(col, row);
60018
60155
  editor && setTimeout(() => {
60019
- var _a, _b;
60020
- editor && this.editingEditor !== editor && (null === (_b = (_a = editor).prepareEdit) || void 0 === _b || _b.call(_a, {
60156
+ var _a;
60157
+ editor && this.editingEditor !== editor && (null === (_a = editor.prepareEdit) || void 0 === _a || _a.call(editor, {
60021
60158
  referencePosition: referencePosition,
60022
60159
  container: this.table.getElement(),
60023
60160
  table: this.table,
@@ -60166,15 +60303,16 @@
60166
60303
  step((generator = generator.apply(thisArg, _arguments || [])).next());
60167
60304
  });
60168
60305
  };
60169
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
60306
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, noTriggerChangeCellValuesEvent) {
60170
60307
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
60171
- const recordIndex = table.getRecordShowIndexByCell(col, row),
60308
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
60309
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60172
60310
  {
60173
60311
  field: field
60174
60312
  } = table.internalProps.layoutMap.getBody(col, row),
60175
60313
  beforeChangeValue = table.getCellRawValue(col, row),
60176
60314
  oldValue = table.getCellOriginValue(col, row);
60177
- table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
60315
+ table.isHeader(col, row) ? table.internalProps.layoutMap.updateColumnTitle(col, row, value) : table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
60178
60316
  const range = table.getCellRange(col, row),
60179
60317
  aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
60180
60318
  if (aggregators) {
@@ -60197,16 +60335,24 @@
60197
60335
  table.scenegraph.updateRowHeight(row, newHeight - oldHeight);
60198
60336
  }
60199
60337
  const changedValue = table.getCellOriginValue(col, row);
60200
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
60201
- col: col,
60202
- row: row,
60203
- rawValue: beforeChangeValue,
60204
- currentValue: oldValue,
60205
- changedValue: changedValue
60206
- }), table.scenegraph.updateNextFrame();
60338
+ if (oldValue !== changedValue && triggerEvent) {
60339
+ const changeValue = {
60340
+ col: col,
60341
+ row: row,
60342
+ recordIndex: recordIndex,
60343
+ field: field,
60344
+ rawValue: beforeChangeValue,
60345
+ currentValue: oldValue,
60346
+ changedValue: changedValue
60347
+ };
60348
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), noTriggerChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
60349
+ values: [changeValue]
60350
+ });
60351
+ }
60352
+ table.scenegraph.updateNextFrame();
60207
60353
  }
60208
60354
  }
60209
- function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
60355
+ function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, noTriggerChangeCellValuesEvent) {
60210
60356
  var _a, _b;
60211
60357
  return __awaiter(this, void 0, void 0, function* () {
60212
60358
  const changedCellResults = [];
@@ -60228,6 +60374,7 @@
60228
60374
  oldRowValues.push(oldValue);
60229
60375
  }
60230
60376
  }
60377
+ const resultChangeValues = [];
60231
60378
  for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
60232
60379
  changedCellResults[i] = [], pasteRowEnd = startRow + i;
60233
60380
  const rowValues = values[i];
@@ -60251,25 +60398,34 @@
60251
60398
  if (isCanChange) {
60252
60399
  changedCellResults[i][j] = !0;
60253
60400
  const value = rowValues[j],
60254
- recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
60401
+ recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
60402
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60255
60403
  {
60256
60404
  field: field
60257
60405
  } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i),
60258
60406
  beforeChangeValue = beforeChangeValues[i][j],
60259
60407
  oldValue = oldValues[i][j];
60260
- 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);
60408
+ 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);
60261
60409
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
60262
- oldValue !== changedValue && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
60263
- col: startCol + j,
60264
- row: startRow + i,
60265
- rawValue: beforeChangeValue,
60266
- currentValue: oldValue,
60267
- changedValue: changedValue
60268
- });
60410
+ if (oldValue !== changedValue && triggerEvent) {
60411
+ const changeValue = {
60412
+ col: startCol + j,
60413
+ row: startRow + i,
60414
+ recordIndex: recordIndex,
60415
+ field: field,
60416
+ rawValue: beforeChangeValue,
60417
+ currentValue: oldValue,
60418
+ changedValue: changedValue
60419
+ };
60420
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
60421
+ }
60269
60422
  } else changedCellResults[i][j] = !1;
60270
60423
  }
60271
60424
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
60272
60425
  }
60426
+ noTriggerChangeCellValuesEvent || table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
60427
+ values: resultChangeValues
60428
+ });
60273
60429
  const startRange = table.getCellRange(startCol, startRow),
60274
60430
  range = table.getCellRange(pasteColEnd, pasteRowEnd),
60275
60431
  aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -60303,6 +60459,58 @@
60303
60459
  return table.scenegraph.updateNextFrame(), changedCellResults;
60304
60460
  });
60305
60461
  }
60462
+ function listTableChangeCellValuesByRanges(ranges, value, workOnEditableCell, triggerEvent, table, noTriggerChangeCellValuesEvent) {
60463
+ var _a, _b;
60464
+ return __awaiter(this, void 0, void 0, function* () {
60465
+ const resultChangeValues = [],
60466
+ processed = new Set(),
60467
+ nextValue = null != value ? value : "";
60468
+ for (let i = 0; i < (null !== (_a = null == ranges ? void 0 : ranges.length) && void 0 !== _a ? _a : 0); i++) {
60469
+ const range = ranges[i],
60470
+ startCol = Math.min(range.start.col, range.end.col),
60471
+ endCol = Math.max(range.start.col, range.end.col),
60472
+ startRow = Math.min(range.start.row, range.end.row),
60473
+ endRow = Math.max(range.start.row, range.end.row);
60474
+ if (startCol > endCol || startRow > endRow) continue;
60475
+ const values = [],
60476
+ oldValues = [];
60477
+ for (let row = startRow; row <= endRow; row++) {
60478
+ const rowValues = [],
60479
+ rowOldValues = [];
60480
+ for (let col = startCol; col <= endCol; col++) rowValues.push(nextValue), rowOldValues.push(table.getCellOriginValue(col, row));
60481
+ values.push(rowValues), oldValues.push(rowOldValues);
60482
+ }
60483
+ const changedCellResults = yield listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, !0);
60484
+ for (let r = 0; r < values.length; r++) for (let c = 0; c < values[r].length; c++) {
60485
+ const col = startCol + c,
60486
+ row = startRow + r,
60487
+ key = `${col},${row}`;
60488
+ if (processed.has(key)) continue;
60489
+ if (processed.add(key), !triggerEvent || !(null === (_b = null == changedCellResults ? void 0 : changedCellResults[r]) || void 0 === _b ? void 0 : _b[c])) continue;
60490
+ const oldValue = oldValues[r][c],
60491
+ changedValue = table.getCellOriginValue(col, row);
60492
+ if (oldValue === changedValue) continue;
60493
+ const recordShowIndex = table.getRecordShowIndexByCell(col, row),
60494
+ recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : void 0,
60495
+ {
60496
+ field: field
60497
+ } = table.internalProps.layoutMap.getBody(col, row);
60498
+ resultChangeValues.push({
60499
+ col: col,
60500
+ row: row,
60501
+ recordIndex: recordIndex,
60502
+ field: field,
60503
+ rawValue: oldValue,
60504
+ currentValue: oldValue,
60505
+ changedValue: changedValue
60506
+ });
60507
+ }
60508
+ }
60509
+ !noTriggerChangeCellValuesEvent && triggerEvent && table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
60510
+ values: resultChangeValues
60511
+ });
60512
+ });
60513
+ }
60306
60514
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
60307
60515
  if ("group" === oldCellUpdateType) return oldCellUpdateType;
60308
60516
  if ("sort" === oldCellUpdateType && !table.internalProps.groupBy) return oldCellUpdateType;
@@ -60320,13 +60528,16 @@
60320
60528
  }), table.dataSource.sort(sortState));
60321
60529
  }
60322
60530
  function listTableAddRecord(record, recordIndex, table) {
60323
- var _a, _b, _c, _d;
60531
+ var _a, _b, _c, _d, _e, _f;
60324
60532
  try {
60325
60533
  if (!record) return !1;
60326
- 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 {
60534
+ 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) {
60535
+ !!(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();
60536
+ } else {
60327
60537
  (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
60328
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
60329
- table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
60538
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
60539
+ syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
60540
+ 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;
60330
60541
  const oldRowCount = table.rowCount;
60331
60542
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
60332
60543
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -60395,13 +60606,16 @@
60395
60606
  }
60396
60607
  }
60397
60608
  function listTableAddRecords(records, recordIndex, table) {
60398
- var _a, _b, _c, _d;
60609
+ var _a, _b, _c, _d, _e, _f;
60399
60610
  try {
60400
60611
  if (!records || 0 === records.length) return !1;
60401
- 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 {
60612
+ 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) {
60613
+ !!(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();
60614
+ } else {
60402
60615
  void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
60403
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
60404
- table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
60616
+ const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount,
60617
+ syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords);
60618
+ 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;
60405
60619
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
60406
60620
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), !0;
60407
60621
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -60470,16 +60684,20 @@
60470
60684
  }
60471
60685
  }
60472
60686
  function listTableDeleteRecords(recordIndexs, table) {
60473
- var _a, _b, _c, _d, _e, _f, _g, _h;
60687
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
60474
60688
  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) {
60475
60689
  const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
60476
60690
  if (0 === deletedRecordIndexs.length) return;
60477
60691
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
60478
60692
  table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
60479
- } else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs), sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();else {
60480
- const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
60693
+ } else if (table.sortState) {
60694
+ !!(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();
60695
+ } else {
60696
+ const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
60697
+ deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
60481
60698
  if (0 === deletedRecordIndexs.length) return;
60482
60699
  for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
60700
+ if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
60483
60701
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
60484
60702
  table.refreshRowColCount();
60485
60703
  const newRowCount = table.transpose ? table.colCount : table.rowCount,
@@ -60517,7 +60735,7 @@
60517
60735
  col: 0,
60518
60736
  row: row
60519
60737
  });
60520
- 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();
60738
+ 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();
60521
60739
  }
60522
60740
  } else {
60523
60741
  const delRows = [],
@@ -60549,15 +60767,19 @@
60549
60767
  col: 0,
60550
60768
  row: row
60551
60769
  });
60552
- 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();
60770
+ 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();
60553
60771
  }
60554
60772
  }
60555
60773
  }
60556
60774
  function listTableUpdateRecords(records, recordIndexs, table) {
60557
- var _a, _b, _c, _d;
60558
- 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 {
60559
- const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
60775
+ var _a, _b, _c, _d, _e, _f;
60776
+ 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) {
60777
+ !!(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();
60778
+ } else {
60779
+ const syncToOriginalRecords = !!(null === (_f = table.options) || void 0 === _f ? void 0 : _f.syncRecordOperationsToSourceRecords),
60780
+ updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
60560
60781
  if (0 === updateRecordIndexs.length) return;
60782
+ if (syncToOriginalRecords) return table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), void table.scenegraph.createSceneGraph();
60561
60783
  const recordIndexsMinToMax = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index)).sort((a, b) => a - b);
60562
60784
  if (table.pagination) {
60563
60785
  const {
@@ -61323,8 +61545,8 @@
61323
61545
  updateFilterRules(filterRules, options = {
61324
61546
  clearRowHeightCache: !0
61325
61547
  }) {
61326
- var _a;
61327
- 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();
61548
+ var _a, _b, _c;
61549
+ 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();
61328
61550
  }
61329
61551
  getFilteredRecords() {
61330
61552
  return this.dataSource.records;
@@ -61475,43 +61697,165 @@
61475
61697
  }
61476
61698
  return isValid$1(editorDefine);
61477
61699
  }
61478
- changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0) {
61479
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
61700
+ changeCellValue(col, row, value, workOnEditableCell = !1, triggerEvent = !0, noTriggerChangeCellValuesEvent) {
61701
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, noTriggerChangeCellValuesEvent);
61702
+ }
61703
+ changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0, noTriggerChangeCellValuesEvent) {
61704
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, noTriggerChangeCellValuesEvent);
61705
+ }
61706
+ changeCellValuesByRanges(ranges, value, workOnEditableCell = !1, triggerEvent = !0, noTriggerChangeCellValuesEvent) {
61707
+ return listTableChangeCellValuesByRanges(ranges, value, workOnEditableCell, triggerEvent, this, noTriggerChangeCellValuesEvent);
61708
+ }
61709
+ changeSourceCellValue(recordIndex, field, value) {
61710
+ const tableIndex = this.getTableIndexByRecordIndex(recordIndex),
61711
+ cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
61712
+ if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) return;
61713
+ this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
61714
+ const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row),
61715
+ oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row),
61716
+ changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
61717
+ if (oldValue !== changedValue) {
61718
+ const changeValue = {
61719
+ col: cellAddr.col,
61720
+ row: cellAddr.row,
61721
+ recordIndex: recordIndex,
61722
+ field: field,
61723
+ rawValue: beforeChangeValue,
61724
+ currentValue: oldValue,
61725
+ changedValue: changedValue
61726
+ };
61727
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61728
+ values: [changeValue]
61729
+ });
61730
+ }
61731
+ }
61732
+ changeCellValueByRecord(recordIndex, field, value, options) {
61733
+ var _a, _b, _c, _d, _e;
61734
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
61735
+ noTriggerChangeCellValuesEvent = null == options ? void 0 : options.noTriggerChangeCellValuesEvent,
61736
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
61737
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
61738
+ let record, oldValue;
61739
+ 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;
61740
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
61741
+ if (oldValue !== changedValue) {
61742
+ const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex),
61743
+ changeValue = {
61744
+ col: null !== (_d = null == cellAddr ? void 0 : cellAddr.col) && void 0 !== _d ? _d : -1,
61745
+ row: null !== (_e = null == cellAddr ? void 0 : cellAddr.row) && void 0 !== _e ? _e : -1,
61746
+ recordIndex: recordIndex,
61747
+ field: field,
61748
+ rawValue: oldValue,
61749
+ currentValue: oldValue,
61750
+ changedValue: changedValue
61751
+ };
61752
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), noTriggerChangeCellValuesEvent || this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61753
+ values: [changeValue]
61754
+ });
61755
+ }
61756
+ autoRefresh && this.refreshAfterSourceChange();
61480
61757
  }
61481
- changeCellValues(startCol, startRow, values, workOnEditableCell = !1, triggerEvent = !0) {
61482
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
61758
+ changeCellValueBySource(recordIndex, field, value, triggerEvent = !0, noTriggerChangeCellValuesEvent) {
61759
+ return this.changeCellValueByRecord(recordIndex, field, value, {
61760
+ triggerEvent: triggerEvent,
61761
+ noTriggerChangeCellValuesEvent: noTriggerChangeCellValuesEvent,
61762
+ autoRefresh: !0
61763
+ });
61483
61764
  }
61484
- addRecord(record, recordIndex) {
61765
+ changeCellValuesByRecords(changeValues, options) {
61766
+ var _a, _b, _c, _d, _e, _f, _g;
61767
+ const triggerEvent = null === (_a = null == options ? void 0 : options.triggerEvent) || void 0 === _a || _a,
61768
+ noTriggerChangeCellValuesEvent = null == options ? void 0 : options.noTriggerChangeCellValuesEvent,
61769
+ autoRefresh = null === (_b = null == options ? void 0 : options.autoRefresh) || void 0 === _b || _b,
61770
+ resultChangeValues = [];
61771
+ for (let i = 0; i < changeValues.length; i++) {
61772
+ const {
61773
+ recordIndex: recordIndex,
61774
+ field: field,
61775
+ value: value
61776
+ } = changeValues[i],
61777
+ records = null === (_c = this.dataSource.dataSourceObj) || void 0 === _c ? void 0 : _c.records;
61778
+ let record, oldValue;
61779
+ 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) {
61780
+ const changedValue = !record || "string" != typeof field && "number" != typeof field ? value : null == record ? void 0 : record[field];
61781
+ if (oldValue !== changedValue) {
61782
+ const changeValue = {
61783
+ col: null !== (_e = null === (_d = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _d ? void 0 : _d.col) && void 0 !== _e ? _e : -1,
61784
+ row: null !== (_g = null === (_f = this.getCellAddrByFieldRecord(field, recordIndex)) || void 0 === _f ? void 0 : _f.row) && void 0 !== _g ? _g : -1,
61785
+ recordIndex: recordIndex,
61786
+ field: field,
61787
+ rawValue: oldValue,
61788
+ currentValue: oldValue,
61789
+ changedValue: changedValue
61790
+ };
61791
+ this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue), resultChangeValues.push(changeValue);
61792
+ }
61793
+ }
61794
+ }
61795
+ !noTriggerChangeCellValuesEvent && resultChangeValues.length && triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, {
61796
+ values: resultChangeValues
61797
+ }), autoRefresh && this.refreshAfterSourceChange();
61798
+ }
61799
+ changeCellValuesBySource(changeValues, triggerEvent = !0, noTriggerChangeCellValuesEvent) {
61800
+ return this.changeCellValuesByRecords(changeValues, {
61801
+ triggerEvent: triggerEvent,
61802
+ noTriggerChangeCellValuesEvent: noTriggerChangeCellValuesEvent,
61803
+ autoRefresh: !0
61804
+ });
61805
+ }
61806
+ refreshAfterSourceChange(options) {
61807
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
61808
+ const reapplyFilter = null === (_a = null == options ? void 0 : options.reapplyFilter) || void 0 === _a || _a,
61809
+ reapplySort = null === (_b = null == options ? void 0 : options.reapplySort) || void 0 === _b || _b,
61810
+ clearRowHeightCache = null === (_c = null == options ? void 0 : options.clearRowHeightCache) || void 0 === _c || _c;
61811
+ 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);
61812
+ const traverseColumns = columns => {
61813
+ var _a, _b, _c, _d;
61814
+ for (let i = 0; i < (null !== (_a = null == columns ? void 0 : columns.length) && void 0 !== _a ? _a : 0); i++) {
61815
+ const column = columns[i],
61816
+ aggregators = null == column ? void 0 : column.vtable_aggregator;
61817
+ 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);
61818
+ (null == column ? void 0 : column.columns) && traverseColumns(column.columns);
61819
+ }
61820
+ };
61821
+ 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();
61822
+ }
61823
+ addRecord(record, recordIndex, triggerEvent = !0) {
61485
61824
  var _a;
61486
61825
  const success = listTableAddRecord(record, recordIndex, this);
61487
- adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61826
+ adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible(), triggerEvent && success && this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
61488
61827
  records: [record],
61489
61828
  recordIndex: recordIndex,
61490
61829
  recordCount: 1
61491
61830
  });
61492
61831
  }
61493
- addRecords(records, recordIndex) {
61832
+ addRecords(records, recordIndex, triggerEvent = !0) {
61494
61833
  var _a;
61495
61834
  const success = listTableAddRecords(records, recordIndex, this);
61496
- "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, {
61835
+ "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, {
61497
61836
  records: records,
61498
61837
  recordIndex: recordIndex,
61499
61838
  recordCount: records.length
61500
61839
  });
61501
61840
  }
61502
- deleteRecords(recordIndexs) {
61841
+ deleteRecords(recordIndexs, triggerEvent = !0) {
61503
61842
  var _a;
61504
- listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61843
+ const deletedRecords = [];
61844
+ (null == recordIndexs ? void 0 : recordIndexs.length) > 0 && recordIndexs.forEach(index => {
61845
+ let record = null;
61846
+ record = "number" == typeof index ? this.dataSource.get(index) : [], deletedRecords.push(record);
61847
+ }), listTableDeleteRecords(recordIndexs, this), adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs), null === (_a = this.internalProps.emptyTip) || void 0 === _a || _a.resetVisible();
61505
61848
  const rowIndexs = [];
61506
61849
  for (let i = 0; i < recordIndexs.length; i++) rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
61507
- this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61850
+ triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
61508
61851
  recordIndexs: recordIndexs,
61852
+ records: deletedRecords,
61509
61853
  rowIndexs: rowIndexs,
61510
61854
  deletedCount: (Array.isArray(recordIndexs[0]), recordIndexs.length)
61511
61855
  });
61512
61856
  }
61513
- updateRecords(records, recordIndexs) {
61514
- listTableUpdateRecords(records, recordIndexs, this), this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
61857
+ updateRecords(records, recordIndexs, triggerEvent = !0) {
61858
+ listTableUpdateRecords(records, recordIndexs, this), triggerEvent && this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
61515
61859
  records: records,
61516
61860
  recordIndexs: recordIndexs,
61517
61861
  updateCount: records.length
@@ -64690,7 +65034,8 @@
64690
65034
  });
64691
65035
  playIcon.name = "play-icon", cellGroup.appendChild(playIcon), table.scenegraph.updateNextFrame();
64692
65036
  }), video.onerror = () => {
64693
- image.image = regedIcons.damage_pic.svg;
65037
+ const regedIcons = get$2();
65038
+ image.image = regedIcons.video_damage_pic ? regedIcons.video_damage_pic.svg : regedIcons.damage_pic.svg;
64694
65039
  }, video.src = value, video.setAttribute("preload", "auto");
64695
65040
  const image = createImage({
64696
65041
  x: padding[3],
@@ -64700,7 +65045,9 @@
64700
65045
  image: video,
64701
65046
  cursor: "pointer"
64702
65047
  });
64703
- return image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), cellGroup;
65048
+ return image.name = "image", image.keepAspectRatio = keepAspectRatio, image.textAlign = textAlign, image.textBaseline = textBaseline, cellGroup.appendChild(image), image.successCallback = () => {
65049
+ isDamagePic(image) && (updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table), table.scenegraph.updateNextFrame());
65050
+ }, cellGroup;
64704
65051
  }
64705
65052
 
64706
65053
  function createMark(marked, cellGroup, table) {