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

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.
Files changed (151) hide show
  1. package/cjs/ListTable.d.ts +7 -34
  2. package/cjs/ListTable.js +14 -134
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +3 -0
  5. package/cjs/PivotChart.js +12 -5
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/core/BaseTable.js +1 -1
  8. package/cjs/core/BaseTable.js.map +1 -1
  9. package/cjs/core/TABLE_EVENT_TYPE.d.ts +0 -1
  10. package/cjs/core/TABLE_EVENT_TYPE.js +0 -1
  11. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  12. package/cjs/core/record-helper.d.ts +2 -4
  13. package/cjs/core/record-helper.js +47 -120
  14. package/cjs/core/record-helper.js.map +1 -1
  15. package/cjs/data/DataSource.d.ts +4 -10
  16. package/cjs/data/DataSource.js +56 -155
  17. package/cjs/data/DataSource.js.map +1 -1
  18. package/cjs/dataset/DataStatistics.js +2 -1
  19. package/cjs/dataset/dataset-pivot-table.js +1 -2
  20. package/cjs/event/event.d.ts +1 -2
  21. package/cjs/event/event.js +9 -20
  22. package/cjs/event/event.js.map +1 -1
  23. package/cjs/event/listener/container-dom.js +1 -1
  24. package/cjs/event/listener/container-dom.js.map +1 -1
  25. package/cjs/event/listener/scroll-bar.js +8 -2
  26. package/cjs/event/listener/scroll-bar.js.map +1 -1
  27. package/cjs/event/listener/table-group.js +14 -8
  28. package/cjs/event/listener/table-group.js.map +1 -1
  29. package/cjs/event/media-click.js +1 -1
  30. package/cjs/event/scroll.js +1 -1
  31. package/cjs/event/sparkline-event.js +1 -1
  32. package/cjs/event/util.js +1 -1
  33. package/cjs/header-helper/style.js +2 -1
  34. package/cjs/index.d.ts +1 -1
  35. package/cjs/index.js +1 -1
  36. package/cjs/index.js.map +1 -1
  37. package/cjs/layout/pivot-header-layout.d.ts +6 -0
  38. package/cjs/layout/pivot-header-layout.js +39 -20
  39. package/cjs/layout/pivot-header-layout.js.map +1 -1
  40. package/cjs/plugins/custom-cell-style.d.ts +0 -5
  41. package/cjs/plugins/custom-cell-style.js +0 -9
  42. package/cjs/plugins/custom-cell-style.js.map +1 -1
  43. package/cjs/plugins/index.js +1 -1
  44. package/cjs/plugins/interface.js +1 -1
  45. package/cjs/plugins/invert-highlight.js +1 -2
  46. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  47. package/cjs/plugins/plugin-manager.js +1 -1
  48. package/cjs/scenegraph/graphic/active-cell-chart-list.d.ts +15 -2
  49. package/cjs/scenegraph/graphic/active-cell-chart-list.js +198 -75
  50. package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  51. package/cjs/scenegraph/graphic/chart.d.ts +10 -1
  52. package/cjs/scenegraph/graphic/chart.js +61 -27
  53. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  54. package/cjs/scenegraph/graphic/contributions/chart-render.js +3 -4
  55. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  56. package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -1
  57. package/cjs/scenegraph/refresh-node/update-chart.js +2 -1
  58. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  59. package/cjs/scenegraph/scenegraph.d.ts +2 -2
  60. package/cjs/scenegraph/scenegraph.js +44 -11
  61. package/cjs/scenegraph/scenegraph.js.map +1 -1
  62. package/cjs/tools/util.d.ts +5 -0
  63. package/cjs/tools/util.js +22 -4
  64. package/cjs/tools/util.js.map +1 -1
  65. package/cjs/ts-types/base-table.d.ts +2 -2
  66. package/cjs/ts-types/base-table.js.map +1 -1
  67. package/cjs/ts-types/events.d.ts +0 -15
  68. package/cjs/ts-types/events.js.map +1 -1
  69. package/cjs/ts-types/table-engine.d.ts +13 -33
  70. package/cjs/ts-types/table-engine.js.map +1 -1
  71. package/cjs/vrender.js.map +1 -1
  72. package/dist/vtable.js +712 -869
  73. package/dist/vtable.min.js +2 -2
  74. package/es/ListTable.d.ts +7 -34
  75. package/es/ListTable.js +14 -130
  76. package/es/ListTable.js.map +1 -1
  77. package/es/PivotChart.d.ts +3 -0
  78. package/es/PivotChart.js +13 -4
  79. package/es/PivotChart.js.map +1 -1
  80. package/es/core/BaseTable.js +1 -1
  81. package/es/core/BaseTable.js.map +1 -1
  82. package/es/core/TABLE_EVENT_TYPE.d.ts +0 -1
  83. package/es/core/TABLE_EVENT_TYPE.js +0 -1
  84. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  85. package/es/core/record-helper.d.ts +2 -4
  86. package/es/core/record-helper.js +43 -114
  87. package/es/core/record-helper.js.map +1 -1
  88. package/es/data/DataSource.d.ts +4 -10
  89. package/es/data/DataSource.js +56 -155
  90. package/es/data/DataSource.js.map +1 -1
  91. package/es/dataset/DataStatistics.js +2 -1
  92. package/es/dataset/dataset-pivot-table.js +1 -2
  93. package/es/event/event.d.ts +1 -2
  94. package/es/event/event.js +9 -20
  95. package/es/event/event.js.map +1 -1
  96. package/es/event/listener/container-dom.js +1 -1
  97. package/es/event/listener/container-dom.js.map +1 -1
  98. package/es/event/listener/scroll-bar.js +8 -2
  99. package/es/event/listener/scroll-bar.js.map +1 -1
  100. package/es/event/listener/table-group.js +13 -8
  101. package/es/event/listener/table-group.js.map +1 -1
  102. package/es/event/media-click.js +1 -1
  103. package/es/event/scroll.js +1 -1
  104. package/es/event/sparkline-event.js +1 -1
  105. package/es/event/util.js +1 -1
  106. package/es/header-helper/style.js +2 -1
  107. package/es/index.d.ts +1 -1
  108. package/es/index.js +1 -1
  109. package/es/index.js.map +1 -1
  110. package/es/layout/pivot-header-layout.d.ts +6 -0
  111. package/es/layout/pivot-header-layout.js +39 -20
  112. package/es/layout/pivot-header-layout.js.map +1 -1
  113. package/es/plugins/custom-cell-style.d.ts +0 -5
  114. package/es/plugins/custom-cell-style.js +0 -9
  115. package/es/plugins/custom-cell-style.js.map +1 -1
  116. package/es/plugins/index.js +1 -1
  117. package/es/plugins/interface.js +1 -1
  118. package/es/plugins/invert-highlight.js +1 -2
  119. package/es/plugins/list-tree-stick-cell.js +1 -1
  120. package/es/plugins/plugin-manager.js +1 -1
  121. package/es/scenegraph/graphic/active-cell-chart-list.d.ts +15 -2
  122. package/es/scenegraph/graphic/active-cell-chart-list.js +186 -68
  123. package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  124. package/es/scenegraph/graphic/chart.d.ts +10 -1
  125. package/es/scenegraph/graphic/chart.js +58 -25
  126. package/es/scenegraph/graphic/chart.js.map +1 -1
  127. package/es/scenegraph/graphic/contributions/chart-render.js +3 -4
  128. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  129. package/es/scenegraph/refresh-node/update-chart.d.ts +1 -1
  130. package/es/scenegraph/refresh-node/update-chart.js +2 -1
  131. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  132. package/es/scenegraph/scenegraph.d.ts +2 -2
  133. package/es/scenegraph/scenegraph.js +43 -10
  134. package/es/scenegraph/scenegraph.js.map +1 -1
  135. package/es/tools/util.d.ts +5 -0
  136. package/es/tools/util.js +18 -0
  137. package/es/tools/util.js.map +1 -1
  138. package/es/ts-types/base-table.d.ts +2 -2
  139. package/es/ts-types/base-table.js.map +1 -1
  140. package/es/ts-types/events.d.ts +0 -15
  141. package/es/ts-types/events.js.map +1 -1
  142. package/es/ts-types/table-engine.d.ts +13 -33
  143. package/es/ts-types/table-engine.js.map +1 -1
  144. package/es/vrender.js.map +1 -1
  145. package/package.json +4 -4
  146. package/cjs/core/index.d.ts +0 -1
  147. package/cjs/core/index.js +0 -30
  148. package/cjs/core/index.js.map +0 -1
  149. package/es/core/index.d.ts +0 -1
  150. package/es/core/index.js +0 -2
  151. package/es/core/index.js.map +0 -1
@@ -349,23 +349,6 @@ class DataSource extends EventTarget_1.EventTarget {
349
349
  }
350
350
  }
351
351
  }
352
- changeFieldValueByRecordIndex(value, recordIndex, field, table) {
353
- var _a, _b, _c, _d;
354
- if (null === field) return;
355
- if (null == recordIndex) return;
356
- const rawKey = recordIndex.toString();
357
- if (!this.beforeChangedRecordsMap.has(rawKey)) {
358
- const rawRecords = Array.isArray(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) ? this.dataSourceObj.records : null, originRecord = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
359
- this.beforeChangedRecordsMap.set(rawKey, null !== (_b = (0, vutils_1.cloneDeep)(originRecord, void 0, [ "vtable_gantt_linkedFrom", "vtable_gantt_linkedTo" ])) && void 0 !== _b ? _b : {});
360
- }
361
- if ("string" == typeof field || "number" == typeof field) {
362
- const beforeChangedValue = null === (_c = this.beforeChangedRecordsMap.get(rawKey)) || void 0 === _c ? void 0 : _c[field], rawRecords = Array.isArray(null === (_d = this.dataSourceObj) || void 0 === _d ? void 0 : _d.records) ? this.dataSourceObj.records : null, record = rawRecords ? Array.isArray(recordIndex) ? getValueFromDeepArray(rawRecords, recordIndex) : rawRecords[recordIndex] : void 0;
363
- let formatValue = value;
364
- "number" == typeof beforeChangedValue && (0, util_1.isAllDigits)(value) && (formatValue = parseFloat(value)),
365
- record ? record[field] = formatValue : rawRecords && "number" == typeof recordIndex && (rawRecords[recordIndex] = "Array" === this.addRecordRule ? [] : {},
366
- rawRecords[recordIndex][field] = formatValue);
367
- }
368
- }
369
352
  cacheBeforeChangedRecord(dataIndex, table) {
370
353
  var _a;
371
354
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
@@ -382,82 +365,38 @@ class DataSource extends EventTarget_1.EventTarget {
382
365
  Array.isArray(indexed) || this.records.splice(indexed, 1, record);
383
366
  }
384
367
  }
385
- _getRawRecordsArray() {
368
+ addRecord(record, index) {
386
369
  var _a;
387
- const rawRecords = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records;
388
- return Array.isArray(rawRecords) ? rawRecords : null;
389
- }
390
- _hasFilterInEffect() {
391
- var _a, _b, _c, _d, _e;
392
- 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;
393
- }
394
- _normalizeInsertIndex(index, length) {
395
- return null == index || index > length ? length : index < 0 ? 0 : index;
396
- }
397
- _mapViewInsertIndexToRawInsertIndex(rawRecords, viewIndex) {
398
- if (viewIndex >= this.records.length) return rawRecords.length;
399
- if (viewIndex <= 0) return 0;
400
- const prevRecord = this.records[viewIndex - 1], rawIndex = rawRecords.indexOf(prevRecord);
401
- return rawIndex >= 0 ? rawIndex + 1 : rawRecords.length;
402
- }
403
- _resetIndexingFromViewRecords() {
404
- if (this._sourceLength = this.records.length, this.currentIndexedData = Array.from({
405
- length: this._sourceLength
406
- }, ((_, i) => i)), "tree" === this.rowHierarchyType && this.initTreeHierarchyState(),
407
- this.userPagination) return this.pagination.totalCount = this._sourceLength, void this.updatePagerData();
408
- this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
409
- this.updatePagerData();
410
- }
411
- addRecord(record, index, syncToOriginalRecords = !1) {
412
- var _a, _b, _c;
413
- if (!syncToOriginalRecords) {
414
- if (Array.isArray(this.records)) {
415
- this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1),
416
- this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
417
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
418
- if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
419
- this.pagination.totalCount = this._sourceLength;
420
- const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
421
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
422
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
423
- this.updatePagerData();
424
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
425
- }
426
- return;
427
- }
428
- const rawRecords = this._getRawRecordsArray();
429
- if (!rawRecords) return;
430
- const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length), rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
431
- rawRecords.splice(rawInsertIndex, 0, record), this.beforeChangedRecordsMap.clear(),
432
- this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules),
433
- (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, 1);
434
- }
435
- addRecords(recordArr, index, syncToOriginalRecords = !1) {
436
- var _a, _b, _c;
437
- if (!syncToOriginalRecords) {
438
- if (Array.isArray(this.records)) {
439
- if (Array.isArray(recordArr)) {
440
- this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
441
- for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
442
- this._sourceLength += recordArr.length;
443
- for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
444
- }
445
- if (this.userPagination) {
446
- this.pagination.totalCount = this._sourceLength;
447
- const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
448
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
449
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
450
- this.updatePagerData();
451
- (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
370
+ if (Array.isArray(this.records)) {
371
+ this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1),
372
+ this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
373
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
374
+ if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
375
+ this.pagination.totalCount = this._sourceLength;
376
+ const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
377
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
378
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
379
+ this.updatePagerData();
380
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
381
+ }
382
+ }
383
+ addRecords(recordArr, index) {
384
+ var _a;
385
+ if (Array.isArray(this.records)) {
386
+ if (Array.isArray(recordArr)) {
387
+ this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
388
+ for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
389
+ this._sourceLength += recordArr.length;
390
+ for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
452
391
  }
453
- return;
392
+ if (this.userPagination) {
393
+ this.pagination.totalCount = this._sourceLength;
394
+ const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
395
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
396
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
397
+ this.updatePagerData();
398
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
454
399
  }
455
- const rawRecords = this._getRawRecordsArray();
456
- if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
457
- const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length), rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
458
- rawRecords.splice(rawInsertIndex, 0, ...recordArr), this.beforeChangedRecordsMap.clear(),
459
- this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules),
460
- (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, recordArr.length);
461
400
  }
462
401
  addRecordForSorted(record) {
463
402
  Array.isArray(this.records) && (this.beforeChangedRecordsMap.clear(), this.records.push(record),
@@ -476,48 +415,28 @@ class DataSource extends EventTarget_1.EventTarget {
476
415
  }
477
416
  }
478
417
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
479
- const delta = "add" === type ? insertCount : -insertCount, numericKeys = [];
480
- this.beforeChangedRecordsMap.forEach(((_, key) => {
481
- const numKey = Number(key);
482
- Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
483
- })), numericKeys.sort(((a, b) => "add" === type ? b - a : a - b));
484
- for (let i = 0; i < numericKeys.length; i++) {
485
- const key = numericKeys[i], record = this.beforeChangedRecordsMap.get(key.toString());
486
- this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
418
+ for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
419
+ const record = this.beforeChangedRecordsMap.get(key.toString());
420
+ this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
487
421
  }
488
422
  }
489
- deleteRecords(recordIndexs, syncToOriginalRecords = !1) {
490
- var _a, _b, _c;
491
- if (!syncToOriginalRecords) {
492
- if (Array.isArray(this.records)) {
493
- const realDeletedRecordIndexs = [], recordIndexsMaxToMin = recordIndexs.sort(((a, b) => b - a));
494
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
495
- const recordIndex = recordIndexsMaxToMin[index];
496
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
497
- this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
498
- const deletedRecord = this.records[recordIndex];
499
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
500
- this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
501
- }
502
- return this.userPagination || (this.pagination.perPageCount = this._sourceLength,
503
- this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs),
504
- realDeletedRecordIndexs;
423
+ deleteRecords(recordIndexs) {
424
+ var _a;
425
+ if (Array.isArray(this.records)) {
426
+ const realDeletedRecordIndexs = [], recordIndexsMaxToMin = recordIndexs.sort(((a, b) => b - a));
427
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
428
+ const recordIndex = recordIndexsMaxToMin[index];
429
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
430
+ this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
431
+ const deletedRecord = this.records[recordIndex];
432
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
433
+ this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
505
434
  }
506
- return [];
507
- }
508
- const rawRecords = this._getRawRecordsArray();
509
- if (!rawRecords || !Array.isArray(this.records)) return [];
510
- const realDeletedRecordIndexs = [], recordIndexsMaxToMin = recordIndexs.slice().sort(((a, b) => b - a)), rawDeletedIndexs = [];
511
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
512
- const viewIndex = recordIndexsMaxToMin[index];
513
- if (viewIndex >= this.records.length || viewIndex < 0) continue;
514
- const deletedRecord = this.records[viewIndex], rawIndex = rawRecords.indexOf(deletedRecord);
515
- rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)),
516
- realDeletedRecordIndexs.push(viewIndex);
435
+ return this.userPagination || (this.pagination.perPageCount = this._sourceLength,
436
+ this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs),
437
+ realDeletedRecordIndexs;
517
438
  }
518
- return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules),
519
- (null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.deleted) && this.dataSourceObj.deleted(rawDeletedIndexs),
520
- realDeletedRecordIndexs;
439
+ return [];
521
440
  }
522
441
  deleteRecordsForSorted(recordIndexs) {
523
442
  if (Array.isArray(this.records)) {
@@ -532,38 +451,20 @@ class DataSource extends EventTarget_1.EventTarget {
532
451
  this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
533
452
  }
534
453
  }
535
- updateRecords(records, recordIndexs, syncToOriginalRecords = !1) {
536
- var _a;
537
- if (!syncToOriginalRecords) {
538
- const realDeletedRecordIndexs = [];
539
- for (let index = 0; index < recordIndexs.length; index++) {
540
- const recordIndex = recordIndexs[index];
541
- if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
542
- realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce(((acc, key) => (void 0 === acc[key] && (acc[key] = {}),
543
- acc[key].children)), this.records)[recordIndex[recordIndex.length - 1]] = records[index]; else {
544
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
545
- this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
546
- for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
547
- this.records[recordIndex] = records[index];
548
- }
549
- }
550
- return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
551
- }
552
- const rawRecords = this._getRawRecordsArray();
553
- if (!rawRecords || !Array.isArray(this.records)) return [];
554
- const realUpdatedIndexs = [];
454
+ updateRecords(records, recordIndexs) {
455
+ const realDeletedRecordIndexs = [];
555
456
  for (let index = 0; index < recordIndexs.length; index++) {
556
457
  const recordIndex = recordIndexs[index];
557
458
  if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
558
- realUpdatedIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce(((acc, key) => (void 0 === acc[key] && (acc[key] = {}),
559
- acc[key].children)), rawRecords)[recordIndex[recordIndex.length - 1]] = records[index]; else {
560
- if (recordIndex >= this.records.length || recordIndex < 0) continue;
561
- const oldRecord = this.records[recordIndex], rawIndex = rawRecords.indexOf(oldRecord);
562
- rawIndex >= 0 && (rawRecords[rawIndex] = records[index]), realUpdatedIndexs.push(recordIndex);
459
+ realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce(((acc, key) => (void 0 === acc[key] && (acc[key] = {}),
460
+ acc[key].children)), this.records)[recordIndex[recordIndex.length - 1]] = records[index]; else {
461
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
462
+ this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
463
+ for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
464
+ this.records[recordIndex] = records[index];
563
465
  }
564
466
  }
565
- return this.beforeChangedRecordsMap.clear(), this.sortedIndexMap.clear(), this.updateFilterRules(null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules),
566
- realUpdatedIndexs;
467
+ return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
567
468
  }
568
469
  updateRecordsForSorted(records, recordIndexs) {
569
470
  const realDeletedRecordIndexs = [];