@visactor/vtable 1.22.11-alpha.5 → 1.22.11-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vtable.js CHANGED
@@ -37665,6 +37665,9 @@
37665
37665
  get textAlign() {
37666
37666
  return defaultStyle.textAlign ?? 'left';
37667
37667
  },
37668
+ get textStickBaseOnAlign() {
37669
+ return defaultStyle.textStickBaseOnAlign;
37670
+ },
37668
37671
  get textBaseline() {
37669
37672
  return defaultStyle.textBaseline ?? 'middle';
37670
37673
  },
@@ -38266,6 +38269,9 @@
38266
38269
  get textStick() {
38267
38270
  return style.textStick;
38268
38271
  },
38272
+ get textStickBaseOnAlign() {
38273
+ return style.textStickBaseOnAlign;
38274
+ },
38269
38275
  get marked() {
38270
38276
  return style.marked;
38271
38277
  },
@@ -38994,69 +39000,150 @@
38994
39000
  }
38995
39001
  }
38996
39002
  }
38997
- addRecord(record, index) {
38998
- if (Array.isArray(this.records)) {
38999
- this.records.splice(index, 0, record);
39000
- this.adjustBeforeChangedRecordsMap(index, 1);
39001
- this.currentIndexedData.push(this.currentIndexedData.length);
39002
- this._sourceLength += 1;
39003
- for (let i = 0; i < this.fieldAggregators.length; i++) {
39004
- this.fieldAggregators[i].push(record);
39005
- }
39006
- if (this.rowHierarchyType === 'tree') {
39007
- this.initTreeHierarchyState();
39008
- }
39009
- if (this.userPagination) {
39010
- this.pagination.totalCount = this._sourceLength;
39011
- const { perPageCount, currentPage } = this.pagination;
39012
- const startIndex = perPageCount * (currentPage || 0);
39013
- const endIndex = startIndex + perPageCount;
39014
- if (index < endIndex) {
39003
+ _getRawRecordsArray() {
39004
+ const rawRecords = this.dataSourceObj?.records;
39005
+ return Array.isArray(rawRecords) ? rawRecords : null;
39006
+ }
39007
+ _hasFilterInEffect() {
39008
+ return (this.dataConfig?.filterRules?.length ?? 0) >= 1 || (this.lastFilterRules?.length ?? 0) >= 1;
39009
+ }
39010
+ _normalizeInsertIndex(index, length) {
39011
+ if (index === undefined || index === null) {
39012
+ return length;
39013
+ }
39014
+ if (index > length) {
39015
+ return length;
39016
+ }
39017
+ if (index < 0) {
39018
+ return 0;
39019
+ }
39020
+ return index;
39021
+ }
39022
+ _mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
39023
+ if (viewIndex >= this.records.length) {
39024
+ return rawRecords.length;
39025
+ }
39026
+ if (viewIndex <= 0) {
39027
+ return 0;
39028
+ }
39029
+ const prevRecord = this.records[viewIndex - 1];
39030
+ const rawIndex = rawRecords.indexOf(prevRecord);
39031
+ return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
39032
+ }
39033
+ _resetIndexingFromViewRecords() {
39034
+ this._sourceLength = this.records.length;
39035
+ this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
39036
+ if (this.rowHierarchyType === 'tree') {
39037
+ this.initTreeHierarchyState();
39038
+ }
39039
+ if (this.userPagination) {
39040
+ this.pagination.totalCount = this._sourceLength;
39041
+ this.updatePagerData();
39042
+ return;
39043
+ }
39044
+ this.pagination.perPageCount = this._sourceLength;
39045
+ this.pagination.totalCount = this._sourceLength;
39046
+ this.updatePagerData();
39047
+ }
39048
+ addRecord(record, index, syncToOriginalRecords = false) {
39049
+ if (!syncToOriginalRecords) {
39050
+ if (Array.isArray(this.records)) {
39051
+ this.records.splice(index, 0, record);
39052
+ this.adjustBeforeChangedRecordsMap(index, 1);
39053
+ this.currentIndexedData.push(this.currentIndexedData.length);
39054
+ this._sourceLength += 1;
39055
+ for (let i = 0; i < this.fieldAggregators.length; i++) {
39056
+ this.fieldAggregators[i].push(record);
39057
+ }
39058
+ if (this.rowHierarchyType === 'tree') {
39059
+ this.initTreeHierarchyState();
39060
+ }
39061
+ if (this.userPagination) {
39062
+ this.pagination.totalCount = this._sourceLength;
39063
+ const { perPageCount, currentPage } = this.pagination;
39064
+ const startIndex = perPageCount * (currentPage || 0);
39065
+ const endIndex = startIndex + perPageCount;
39066
+ if (index < endIndex) {
39067
+ this.updatePagerData();
39068
+ }
39069
+ }
39070
+ else {
39071
+ this.pagination.perPageCount = this._sourceLength;
39072
+ this.pagination.totalCount = this._sourceLength;
39015
39073
  this.updatePagerData();
39016
39074
  }
39075
+ if (this.dataSourceObj?.added) {
39076
+ this.dataSourceObj.added(index, 1);
39077
+ }
39017
39078
  }
39018
- else {
39019
- this.pagination.perPageCount = this._sourceLength;
39020
- this.pagination.totalCount = this._sourceLength;
39021
- this.updatePagerData();
39022
- }
39023
- if (this.dataSourceObj?.added) {
39024
- this.dataSourceObj.added(index, 1);
39025
- }
39079
+ return;
39080
+ }
39081
+ const rawRecords = this._getRawRecordsArray();
39082
+ if (!rawRecords) {
39083
+ return;
39084
+ }
39085
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length);
39086
+ const rawInsertIndex = this._hasFilterInEffect()
39087
+ ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex)
39088
+ : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
39089
+ rawRecords.splice(rawInsertIndex, 0, record);
39090
+ this.beforeChangedRecordsMap.clear();
39091
+ this.sortedIndexMap.clear();
39092
+ this.updateFilterRules(this.dataConfig?.filterRules);
39093
+ if (this.dataSourceObj?.added) {
39094
+ this.dataSourceObj.added(rawInsertIndex, 1);
39026
39095
  }
39027
39096
  }
39028
- addRecords(recordArr, index) {
39029
- if (Array.isArray(this.records)) {
39030
- if (Array.isArray(recordArr)) {
39031
- this.records.splice(index, 0, ...recordArr);
39032
- this.adjustBeforeChangedRecordsMap(index, recordArr.length);
39033
- for (let i = 0; i < recordArr.length; i++) {
39034
- this.currentIndexedData.push(this.currentIndexedData.length);
39097
+ addRecords(recordArr, index, syncToOriginalRecords = false) {
39098
+ if (!syncToOriginalRecords) {
39099
+ if (Array.isArray(this.records)) {
39100
+ if (Array.isArray(recordArr)) {
39101
+ this.records.splice(index, 0, ...recordArr);
39102
+ this.adjustBeforeChangedRecordsMap(index, recordArr.length);
39103
+ for (let i = 0; i < recordArr.length; i++) {
39104
+ this.currentIndexedData.push(this.currentIndexedData.length);
39105
+ }
39106
+ this._sourceLength += recordArr.length;
39107
+ for (let i = 0; i < this.fieldAggregators.length; i++) {
39108
+ for (let j = 0; j < recordArr.length; j++) {
39109
+ this.fieldAggregators[i].push(recordArr[j]);
39110
+ }
39111
+ }
39035
39112
  }
39036
- this._sourceLength += recordArr.length;
39037
- for (let i = 0; i < this.fieldAggregators.length; i++) {
39038
- for (let j = 0; j < recordArr.length; j++) {
39039
- this.fieldAggregators[i].push(recordArr[j]);
39113
+ if (this.userPagination) {
39114
+ this.pagination.totalCount = this._sourceLength;
39115
+ const { perPageCount, currentPage } = this.pagination;
39116
+ const startIndex = perPageCount * (currentPage || 0);
39117
+ const endIndex = startIndex + perPageCount;
39118
+ if (index < endIndex) {
39119
+ this.updatePagerData();
39040
39120
  }
39041
39121
  }
39042
- }
39043
- if (this.userPagination) {
39044
- this.pagination.totalCount = this._sourceLength;
39045
- const { perPageCount, currentPage } = this.pagination;
39046
- const startIndex = perPageCount * (currentPage || 0);
39047
- const endIndex = startIndex + perPageCount;
39048
- if (index < endIndex) {
39122
+ else {
39123
+ this.pagination.perPageCount = this._sourceLength;
39124
+ this.pagination.totalCount = this._sourceLength;
39049
39125
  this.updatePagerData();
39050
39126
  }
39127
+ if (this.dataSourceObj?.added) {
39128
+ this.dataSourceObj.added(index, recordArr.length);
39129
+ }
39051
39130
  }
39052
- else {
39053
- this.pagination.perPageCount = this._sourceLength;
39054
- this.pagination.totalCount = this._sourceLength;
39055
- this.updatePagerData();
39056
- }
39057
- if (this.dataSourceObj?.added) {
39058
- this.dataSourceObj.added(index, recordArr.length);
39059
- }
39131
+ return;
39132
+ }
39133
+ const rawRecords = this._getRawRecordsArray();
39134
+ if (!rawRecords || !Array.isArray(recordArr) || recordArr.length === 0) {
39135
+ return;
39136
+ }
39137
+ const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length);
39138
+ const rawInsertIndex = this._hasFilterInEffect()
39139
+ ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex)
39140
+ : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
39141
+ rawRecords.splice(rawInsertIndex, 0, ...recordArr);
39142
+ this.beforeChangedRecordsMap.clear();
39143
+ this.sortedIndexMap.clear();
39144
+ this.updateFilterRules(this.dataConfig?.filterRules);
39145
+ if (this.dataSourceObj?.added) {
39146
+ this.dataSourceObj.added(rawInsertIndex, recordArr.length);
39060
39147
  }
39061
39148
  }
39062
39149
  addRecordForSorted(record) {
@@ -39106,39 +39193,68 @@
39106
39193
  this.beforeChangedRecordsMap.set((key + delta).toString(), record);
39107
39194
  }
39108
39195
  }
39109
- deleteRecords(recordIndexs) {
39110
- if (Array.isArray(this.records)) {
39111
- const realDeletedRecordIndexs = [];
39112
- const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
39113
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
39114
- const recordIndex = recordIndexsMaxToMin[index];
39115
- if (recordIndex >= this._sourceLength || recordIndex < 0) {
39116
- continue;
39196
+ deleteRecords(recordIndexs, syncToOriginalRecords = false) {
39197
+ if (!syncToOriginalRecords) {
39198
+ if (Array.isArray(this.records)) {
39199
+ const realDeletedRecordIndexs = [];
39200
+ const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
39201
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
39202
+ const recordIndex = recordIndexsMaxToMin[index];
39203
+ if (recordIndex >= this._sourceLength || recordIndex < 0) {
39204
+ continue;
39205
+ }
39206
+ this.adjustBeforeChangedRecordsMap(recordIndex, 1, 'delete');
39207
+ realDeletedRecordIndexs.push(recordIndex);
39208
+ const deletedRecord = this.records[recordIndex];
39209
+ for (let i = 0; i < this.fieldAggregators.length; i++) {
39210
+ this.fieldAggregators[i].deleteRecord(deletedRecord);
39211
+ }
39212
+ this.records.splice(recordIndex, 1);
39213
+ this.currentIndexedData.pop();
39214
+ this._sourceLength -= 1;
39117
39215
  }
39118
- this.adjustBeforeChangedRecordsMap(recordIndex, 1, 'delete');
39119
- realDeletedRecordIndexs.push(recordIndex);
39120
- const deletedRecord = this.records[recordIndex];
39121
- for (let i = 0; i < this.fieldAggregators.length; i++) {
39122
- this.fieldAggregators[i].deleteRecord(deletedRecord);
39216
+ if (this.userPagination) {
39217
+ this.updatePagerData();
39123
39218
  }
39124
- this.records.splice(recordIndex, 1);
39125
- this.currentIndexedData.pop();
39126
- this._sourceLength -= 1;
39127
- }
39128
- if (this.userPagination) {
39129
- this.updatePagerData();
39219
+ else {
39220
+ this.pagination.perPageCount = this._sourceLength;
39221
+ this.pagination.totalCount = this._sourceLength;
39222
+ this.updatePagerData();
39223
+ }
39224
+ if (this.dataSourceObj?.deleted) {
39225
+ this.dataSourceObj.deleted(realDeletedRecordIndexs);
39226
+ }
39227
+ return realDeletedRecordIndexs;
39130
39228
  }
39131
- else {
39132
- this.pagination.perPageCount = this._sourceLength;
39133
- this.pagination.totalCount = this._sourceLength;
39134
- this.updatePagerData();
39229
+ return [];
39230
+ }
39231
+ const rawRecords = this._getRawRecordsArray();
39232
+ if (!rawRecords || !Array.isArray(this.records)) {
39233
+ return [];
39234
+ }
39235
+ const realDeletedRecordIndexs = [];
39236
+ const recordIndexsMaxToMin = recordIndexs.slice().sort((a, b) => b - a);
39237
+ const rawDeletedIndexs = [];
39238
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
39239
+ const viewIndex = recordIndexsMaxToMin[index];
39240
+ if (viewIndex >= this.records.length || viewIndex < 0) {
39241
+ continue;
39135
39242
  }
39136
- if (this.dataSourceObj?.deleted) {
39137
- this.dataSourceObj.deleted(realDeletedRecordIndexs);
39243
+ const deletedRecord = this.records[viewIndex];
39244
+ const rawIndex = rawRecords.indexOf(deletedRecord);
39245
+ if (rawIndex >= 0) {
39246
+ rawRecords.splice(rawIndex, 1);
39247
+ rawDeletedIndexs.push(rawIndex);
39138
39248
  }
39139
- return realDeletedRecordIndexs;
39249
+ realDeletedRecordIndexs.push(viewIndex);
39140
39250
  }
39141
- return [];
39251
+ this.beforeChangedRecordsMap.clear();
39252
+ this.sortedIndexMap.clear();
39253
+ this.updateFilterRules(this.dataConfig?.filterRules);
39254
+ if (this.dataSourceObj?.deleted) {
39255
+ this.dataSourceObj.deleted(rawDeletedIndexs);
39256
+ }
39257
+ return realDeletedRecordIndexs;
39142
39258
  }
39143
39259
  deleteRecordsForSorted(recordIndexs) {
39144
39260
  if (Array.isArray(this.records)) {
@@ -39160,36 +39276,71 @@
39160
39276
  this.beforeChangedRecordsMap.clear();
39161
39277
  }
39162
39278
  }
39163
- updateRecords(records, recordIndexs) {
39164
- const realDeletedRecordIndexs = [];
39279
+ updateRecords(records, recordIndexs, syncToOriginalRecords = false) {
39280
+ if (!syncToOriginalRecords) {
39281
+ const realDeletedRecordIndexs = [];
39282
+ for (let index = 0; index < recordIndexs.length; index++) {
39283
+ const recordIndex = recordIndexs[index];
39284
+ if (Array.isArray(recordIndex)) {
39285
+ this.beforeChangedRecordsMap.delete(recordIndex.toString());
39286
+ realDeletedRecordIndexs.push(recordIndex);
39287
+ recordIndex.slice(0, -1).reduce((acc, key) => {
39288
+ if (acc[key] === undefined) {
39289
+ acc[key] = {};
39290
+ }
39291
+ return acc[key].children;
39292
+ }, this.records)[recordIndex[recordIndex.length - 1]] = records[index];
39293
+ }
39294
+ else {
39295
+ if (recordIndex >= this._sourceLength || recordIndex < 0) {
39296
+ continue;
39297
+ }
39298
+ this.beforeChangedRecordsMap.delete(recordIndex.toString());
39299
+ realDeletedRecordIndexs.push(recordIndex);
39300
+ for (let i = 0; i < this.fieldAggregators.length; i++) {
39301
+ this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
39302
+ }
39303
+ this.records[recordIndex] = records[index];
39304
+ }
39305
+ }
39306
+ if (this.userPagination) {
39307
+ this.updatePagerData();
39308
+ }
39309
+ return realDeletedRecordIndexs;
39310
+ }
39311
+ const rawRecords = this._getRawRecordsArray();
39312
+ if (!rawRecords || !Array.isArray(this.records)) {
39313
+ return [];
39314
+ }
39315
+ const realUpdatedIndexs = [];
39165
39316
  for (let index = 0; index < recordIndexs.length; index++) {
39166
39317
  const recordIndex = recordIndexs[index];
39167
39318
  if (Array.isArray(recordIndex)) {
39168
39319
  this.beforeChangedRecordsMap.delete(recordIndex.toString());
39169
- realDeletedRecordIndexs.push(recordIndex);
39320
+ realUpdatedIndexs.push(recordIndex);
39170
39321
  recordIndex.slice(0, -1).reduce((acc, key) => {
39171
39322
  if (acc[key] === undefined) {
39172
39323
  acc[key] = {};
39173
39324
  }
39174
39325
  return acc[key].children;
39175
- }, this.records)[recordIndex[recordIndex.length - 1]] = records[index];
39326
+ }, rawRecords)[recordIndex[recordIndex.length - 1]] = records[index];
39176
39327
  }
39177
39328
  else {
39178
- if (recordIndex >= this._sourceLength || recordIndex < 0) {
39329
+ if (recordIndex >= this.records.length || recordIndex < 0) {
39179
39330
  continue;
39180
39331
  }
39181
- this.beforeChangedRecordsMap.delete(recordIndex.toString());
39182
- realDeletedRecordIndexs.push(recordIndex);
39183
- for (let i = 0; i < this.fieldAggregators.length; i++) {
39184
- this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
39332
+ const oldRecord = this.records[recordIndex];
39333
+ const rawIndex = rawRecords.indexOf(oldRecord);
39334
+ if (rawIndex >= 0) {
39335
+ rawRecords[rawIndex] = records[index];
39185
39336
  }
39186
- this.records[recordIndex] = records[index];
39337
+ realUpdatedIndexs.push(recordIndex);
39187
39338
  }
39188
39339
  }
39189
- if (this.userPagination) {
39190
- this.updatePagerData();
39191
- }
39192
- return realDeletedRecordIndexs;
39340
+ this.beforeChangedRecordsMap.clear();
39341
+ this.sortedIndexMap.clear();
39342
+ this.updateFilterRules(this.dataConfig?.filterRules);
39343
+ return realUpdatedIndexs;
39193
39344
  }
39194
39345
  updateRecordsForSorted(records, recordIndexs) {
39195
39346
  for (let index = 0; index < recordIndexs.length; index++) {
@@ -70235,7 +70386,7 @@
70235
70386
  return TABLE_EVENT_TYPE;
70236
70387
  }
70237
70388
  options;
70238
- version = "1.22.11-alpha.5";
70389
+ version = "1.22.11-alpha.7";
70239
70390
  pagination;
70240
70391
  id = `VTable${Date.now()}`;
70241
70392
  headerStyleCache;
@@ -76643,7 +76794,13 @@
76643
76794
  table.scenegraph.createSceneGraph();
76644
76795
  }
76645
76796
  else if (table.sortState) {
76646
- table.dataSource.addRecordForSorted(record);
76797
+ const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
76798
+ if (syncToOriginalRecords) {
76799
+ table.dataSource.addRecord(record, table.dataSource.records.length, true);
76800
+ }
76801
+ else {
76802
+ table.dataSource.addRecordForSorted(record);
76803
+ }
76647
76804
  table.stateManager.checkedState.clear();
76648
76805
  sortRecords(table);
76649
76806
  table.refreshRowColCount();
@@ -76656,8 +76813,16 @@
76656
76813
  recordIndex = table.dataSource.sourceLength;
76657
76814
  }
76658
76815
  const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
76659
- table.dataSource.addRecord(record, recordIndex);
76816
+ const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
76817
+ table.dataSource.addRecord(record, recordIndex, syncToOriginalRecords);
76660
76818
  adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
76819
+ if (syncToOriginalRecords) {
76820
+ table.refreshRowColCount();
76821
+ table.internalProps.layoutMap.clearCellRangeMap();
76822
+ table.scenegraph.clearCells();
76823
+ table.scenegraph.createSceneGraph();
76824
+ return true;
76825
+ }
76661
76826
  const oldRowCount = table.rowCount;
76662
76827
  table.refreshRowColCount();
76663
76828
  if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {
@@ -76769,7 +76934,13 @@
76769
76934
  table.scenegraph.createSceneGraph();
76770
76935
  }
76771
76936
  else if (table.sortState) {
76772
- table.dataSource.addRecordsForSorted(records);
76937
+ const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
76938
+ if (syncToOriginalRecords) {
76939
+ table.dataSource.addRecords(records, table.dataSource.records.length, true);
76940
+ }
76941
+ else {
76942
+ table.dataSource.addRecordsForSorted(records);
76943
+ }
76773
76944
  sortRecords(table);
76774
76945
  table.refreshRowColCount();
76775
76946
  table.scenegraph.clearCells();
@@ -76784,8 +76955,16 @@
76784
76955
  recordIndex = 0;
76785
76956
  }
76786
76957
  const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
76787
- table.dataSource.addRecords(records, recordIndex);
76958
+ const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
76959
+ table.dataSource.addRecords(records, recordIndex, syncToOriginalRecords);
76788
76960
  adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
76961
+ if (syncToOriginalRecords) {
76962
+ table.refreshRowColCount();
76963
+ table.internalProps.layoutMap.clearCellRangeMap();
76964
+ table.scenegraph.clearCells();
76965
+ table.scenegraph.createSceneGraph();
76966
+ return true;
76967
+ }
76789
76968
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
76790
76969
  table.refreshRowColCount();
76791
76970
  if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {
@@ -76901,20 +77080,34 @@
76901
77080
  table.scenegraph.createSceneGraph();
76902
77081
  }
76903
77082
  else if (table.sortState) {
76904
- table.dataSource.deleteRecordsForSorted(recordIndexs);
77083
+ const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
77084
+ if (syncToOriginalRecords) {
77085
+ table.dataSource.deleteRecords(recordIndexs, true);
77086
+ }
77087
+ else {
77088
+ table.dataSource.deleteRecordsForSorted(recordIndexs);
77089
+ }
76905
77090
  sortRecords(table);
76906
77091
  table.refreshRowColCount();
76907
77092
  table.scenegraph.clearCells();
76908
77093
  table.scenegraph.createSceneGraph();
76909
77094
  }
76910
77095
  else {
76911
- const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
77096
+ const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
77097
+ const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs, syncToOriginalRecords);
76912
77098
  if (deletedRecordIndexs.length === 0) {
76913
77099
  return;
76914
77100
  }
76915
77101
  for (let index = 0; index < deletedRecordIndexs.length; index++) {
76916
77102
  adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
76917
77103
  }
77104
+ if (syncToOriginalRecords) {
77105
+ table.refreshRowColCount();
77106
+ table.internalProps.layoutMap.clearCellRangeMap();
77107
+ table.scenegraph.clearCells();
77108
+ table.scenegraph.createSceneGraph();
77109
+ return;
77110
+ }
76918
77111
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
76919
77112
  table.refreshRowColCount();
76920
77113
  const newRowCount = table.transpose ? table.colCount : table.rowCount;
@@ -77032,18 +77225,32 @@
77032
77225
  table.scenegraph.createSceneGraph();
77033
77226
  }
77034
77227
  else if (table.sortState) {
77035
- table.dataSource.updateRecordsForSorted(records, recordIndexs);
77228
+ const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
77229
+ if (syncToOriginalRecords) {
77230
+ table.dataSource.updateRecords(records, recordIndexs, true);
77231
+ }
77232
+ else {
77233
+ table.dataSource.updateRecordsForSorted(records, recordIndexs);
77234
+ }
77036
77235
  sortRecords(table);
77037
77236
  table.refreshRowColCount();
77038
77237
  table.scenegraph.clearCells();
77039
77238
  table.scenegraph.createSceneGraph();
77040
77239
  }
77041
77240
  else {
77042
- const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
77241
+ const syncToOriginalRecords = !!table.options?.syncRecordOperationsToSourceRecords;
77242
+ const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs, syncToOriginalRecords);
77043
77243
  if (updateRecordIndexs.length === 0) {
77044
77244
  return;
77045
77245
  }
77046
- const bodyRowIndex = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index));
77246
+ if (syncToOriginalRecords) {
77247
+ table.refreshRowColCount();
77248
+ table.internalProps.layoutMap.clearCellRangeMap();
77249
+ table.scenegraph.clearCells();
77250
+ table.scenegraph.createSceneGraph();
77251
+ return;
77252
+ }
77253
+ const bodyRowIndex = updateRecordIndexs.map((index) => table.getBodyRowIndexByRecordIndex(index));
77047
77254
  const recordIndexsMinToMax = bodyRowIndex.sort((a, b) => a - b);
77048
77255
  if (table.pagination) {
77049
77256
  const { perPageCount, currentPage } = table.pagination;
@@ -93642,7 +93849,7 @@
93642
93849
  }
93643
93850
 
93644
93851
  registerForVrender();
93645
- const version = "1.22.11-alpha.5";
93852
+ const version = "1.22.11-alpha.7";
93646
93853
  function getIcons() {
93647
93854
  return get$2();
93648
93855
  }