@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.
- package/cjs/ListTable.d.ts +7 -34
- package/cjs/ListTable.js +14 -134
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +3 -0
- package/cjs/PivotChart.js +12 -5
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +0 -1
- package/cjs/core/TABLE_EVENT_TYPE.js +0 -1
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/record-helper.d.ts +2 -4
- package/cjs/core/record-helper.js +47 -120
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/data/DataSource.d.ts +4 -10
- package/cjs/data/DataSource.js +56 -155
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/DataStatistics.js +2 -1
- package/cjs/dataset/dataset-pivot-table.js +1 -2
- package/cjs/event/event.d.ts +1 -2
- package/cjs/event/event.js +9 -20
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +1 -1
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/scroll-bar.js +8 -2
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/event/listener/table-group.js +14 -8
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +1 -1
- package/cjs/event/scroll.js +1 -1
- package/cjs/event/sparkline-event.js +1 -1
- package/cjs/event/util.js +1 -1
- package/cjs/header-helper/style.js +2 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +6 -0
- package/cjs/layout/pivot-header-layout.js +39 -20
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/plugins/custom-cell-style.d.ts +0 -5
- package/cjs/plugins/custom-cell-style.js +0 -9
- package/cjs/plugins/custom-cell-style.js.map +1 -1
- package/cjs/plugins/index.js +1 -1
- package/cjs/plugins/interface.js +1 -1
- package/cjs/plugins/invert-highlight.js +1 -2
- package/cjs/plugins/list-tree-stick-cell.js +1 -1
- package/cjs/plugins/plugin-manager.js +1 -1
- package/cjs/scenegraph/graphic/active-cell-chart-list.d.ts +15 -2
- package/cjs/scenegraph/graphic/active-cell-chart-list.js +198 -75
- package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +10 -1
- package/cjs/scenegraph/graphic/chart.js +61 -27
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +3 -4
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.js +2 -1
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -2
- package/cjs/scenegraph/scenegraph.js +44 -11
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/tools/util.d.ts +5 -0
- package/cjs/tools/util.js +22 -4
- package/cjs/tools/util.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -2
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/events.d.ts +0 -15
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +13 -33
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +712 -869
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +7 -34
- package/es/ListTable.js +14 -130
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +3 -0
- package/es/PivotChart.js +13 -4
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +0 -1
- package/es/core/TABLE_EVENT_TYPE.js +0 -1
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/record-helper.d.ts +2 -4
- package/es/core/record-helper.js +43 -114
- package/es/core/record-helper.js.map +1 -1
- package/es/data/DataSource.d.ts +4 -10
- package/es/data/DataSource.js +56 -155
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/DataStatistics.js +2 -1
- package/es/dataset/dataset-pivot-table.js +1 -2
- package/es/event/event.d.ts +1 -2
- package/es/event/event.js +9 -20
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +1 -1
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/scroll-bar.js +8 -2
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/event/listener/table-group.js +13 -8
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +1 -1
- package/es/event/scroll.js +1 -1
- package/es/event/sparkline-event.js +1 -1
- package/es/event/util.js +1 -1
- package/es/header-helper/style.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +6 -0
- package/es/layout/pivot-header-layout.js +39 -20
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/plugins/custom-cell-style.d.ts +0 -5
- package/es/plugins/custom-cell-style.js +0 -9
- package/es/plugins/custom-cell-style.js.map +1 -1
- package/es/plugins/index.js +1 -1
- package/es/plugins/interface.js +1 -1
- package/es/plugins/invert-highlight.js +1 -2
- package/es/plugins/list-tree-stick-cell.js +1 -1
- package/es/plugins/plugin-manager.js +1 -1
- package/es/scenegraph/graphic/active-cell-chart-list.d.ts +15 -2
- package/es/scenegraph/graphic/active-cell-chart-list.js +186 -68
- package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +10 -1
- package/es/scenegraph/graphic/chart.js +58 -25
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +3 -4
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +1 -1
- package/es/scenegraph/refresh-node/update-chart.js +2 -1
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -2
- package/es/scenegraph/scenegraph.js +43 -10
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/tools/util.d.ts +5 -0
- package/es/tools/util.js +18 -0
- package/es/tools/util.js.map +1 -1
- package/es/ts-types/base-table.d.ts +2 -2
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/events.d.ts +0 -15
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +13 -33
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
- package/cjs/core/index.d.ts +0 -1
- package/cjs/core/index.js +0 -30
- package/cjs/core/index.js.map +0 -1
- package/es/core/index.d.ts +0 -1
- package/es/core/index.js +0 -2
- package/es/core/index.js.map +0 -1
package/es/data/DataSource.js
CHANGED
|
@@ -323,23 +323,6 @@ export class DataSource extends EventTarget {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
changeFieldValueByRecordIndex(value, recordIndex, field, table) {
|
|
327
|
-
var _a, _b, _c, _d;
|
|
328
|
-
if (null === field) return;
|
|
329
|
-
if (null == recordIndex) return;
|
|
330
|
-
const rawKey = recordIndex.toString();
|
|
331
|
-
if (!this.beforeChangedRecordsMap.has(rawKey)) {
|
|
332
|
-
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;
|
|
333
|
-
this.beforeChangedRecordsMap.set(rawKey, null !== (_b = cloneDeep(originRecord, void 0, [ "vtable_gantt_linkedFrom", "vtable_gantt_linkedTo" ])) && void 0 !== _b ? _b : {});
|
|
334
|
-
}
|
|
335
|
-
if ("string" == typeof field || "number" == typeof field) {
|
|
336
|
-
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;
|
|
337
|
-
let formatValue = value;
|
|
338
|
-
"number" == typeof beforeChangedValue && isAllDigits(value) && (formatValue = parseFloat(value)),
|
|
339
|
-
record ? record[field] = formatValue : rawRecords && "number" == typeof recordIndex && (rawRecords[recordIndex] = "Array" === this.addRecordRule ? [] : {},
|
|
340
|
-
rawRecords[recordIndex][field] = formatValue);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
326
|
cacheBeforeChangedRecord(dataIndex, table) {
|
|
344
327
|
var _a;
|
|
345
328
|
if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
|
|
@@ -356,82 +339,38 @@ export class DataSource extends EventTarget {
|
|
|
356
339
|
Array.isArray(indexed) || this.records.splice(indexed, 1, record);
|
|
357
340
|
}
|
|
358
341
|
}
|
|
359
|
-
|
|
342
|
+
addRecord(record, index) {
|
|
360
343
|
var _a;
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
|
|
383
|
-
this.updatePagerData();
|
|
384
|
-
}
|
|
385
|
-
addRecord(record, index, syncToOriginalRecords = !1) {
|
|
386
|
-
var _a, _b, _c;
|
|
387
|
-
if (!syncToOriginalRecords) {
|
|
388
|
-
if (Array.isArray(this.records)) {
|
|
389
|
-
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1),
|
|
390
|
-
this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
391
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
392
|
-
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), 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, 1);
|
|
399
|
-
}
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
const rawRecords = this._getRawRecordsArray();
|
|
403
|
-
if (!rawRecords) return;
|
|
404
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length), rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
405
|
-
rawRecords.splice(rawInsertIndex, 0, record), this.beforeChangedRecordsMap.clear(),
|
|
406
|
-
this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules),
|
|
407
|
-
(null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, 1);
|
|
408
|
-
}
|
|
409
|
-
addRecords(recordArr, index, syncToOriginalRecords = !1) {
|
|
410
|
-
var _a, _b, _c;
|
|
411
|
-
if (!syncToOriginalRecords) {
|
|
412
|
-
if (Array.isArray(this.records)) {
|
|
413
|
-
if (Array.isArray(recordArr)) {
|
|
414
|
-
this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
415
|
-
for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
|
|
416
|
-
this._sourceLength += recordArr.length;
|
|
417
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
418
|
-
}
|
|
419
|
-
if (this.userPagination) {
|
|
420
|
-
this.pagination.totalCount = this._sourceLength;
|
|
421
|
-
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
|
|
422
|
-
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
423
|
-
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
|
|
424
|
-
this.updatePagerData();
|
|
425
|
-
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
344
|
+
if (Array.isArray(this.records)) {
|
|
345
|
+
this.records.splice(index, 0, record), this.adjustBeforeChangedRecordsMap(index, 1),
|
|
346
|
+
this.currentIndexedData.push(this.currentIndexedData.length), this._sourceLength += 1;
|
|
347
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].push(record);
|
|
348
|
+
if ("tree" === this.rowHierarchyType && this.initTreeHierarchyState(), this.userPagination) {
|
|
349
|
+
this.pagination.totalCount = this._sourceLength;
|
|
350
|
+
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
|
|
351
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
352
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
|
|
353
|
+
this.updatePagerData();
|
|
354
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
addRecords(recordArr, index) {
|
|
358
|
+
var _a;
|
|
359
|
+
if (Array.isArray(this.records)) {
|
|
360
|
+
if (Array.isArray(recordArr)) {
|
|
361
|
+
this.records.splice(index, 0, ...recordArr), this.adjustBeforeChangedRecordsMap(index, recordArr.length);
|
|
362
|
+
for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
|
|
363
|
+
this._sourceLength += recordArr.length;
|
|
364
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) for (let j = 0; j < recordArr.length; j++) this.fieldAggregators[i].push(recordArr[j]);
|
|
426
365
|
}
|
|
427
|
-
|
|
366
|
+
if (this.userPagination) {
|
|
367
|
+
this.pagination.totalCount = this._sourceLength;
|
|
368
|
+
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
|
|
369
|
+
index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
|
|
370
|
+
} else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
|
|
371
|
+
this.updatePagerData();
|
|
372
|
+
(null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
|
|
428
373
|
}
|
|
429
|
-
const rawRecords = this._getRawRecordsArray();
|
|
430
|
-
if (!rawRecords || !Array.isArray(recordArr) || 0 === recordArr.length) return;
|
|
431
|
-
const viewInsertIndex = this._normalizeInsertIndex(index, this.records.length), rawInsertIndex = this._hasFilterInEffect() ? this._mapViewInsertIndexToRawInsertIndex(rawRecords, viewInsertIndex) : this._normalizeInsertIndex(viewInsertIndex, rawRecords.length);
|
|
432
|
-
rawRecords.splice(rawInsertIndex, 0, ...recordArr), this.beforeChangedRecordsMap.clear(),
|
|
433
|
-
this.sortedIndexMap.clear(), this.updateFilterRules(null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules),
|
|
434
|
-
(null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.added) && this.dataSourceObj.added(rawInsertIndex, recordArr.length);
|
|
435
374
|
}
|
|
436
375
|
addRecordForSorted(record) {
|
|
437
376
|
Array.isArray(this.records) && (this.beforeChangedRecordsMap.clear(), this.records.push(record),
|
|
@@ -450,48 +389,28 @@ export class DataSource extends EventTarget {
|
|
|
450
389
|
}
|
|
451
390
|
}
|
|
452
391
|
adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = "add") {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex && numericKeys.push(numKey);
|
|
457
|
-
})), numericKeys.sort(((a, b) => "add" === type ? b - a : a - b));
|
|
458
|
-
for (let i = 0; i < numericKeys.length; i++) {
|
|
459
|
-
const key = numericKeys[i], record = this.beforeChangedRecordsMap.get(key.toString());
|
|
460
|
-
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + delta).toString(), record);
|
|
392
|
+
for (let key = this.beforeChangedRecordsMap.size - 1; key >= insertIndex; key--) {
|
|
393
|
+
const record = this.beforeChangedRecordsMap.get(key.toString());
|
|
394
|
+
this.beforeChangedRecordsMap.delete(key.toString()), this.beforeChangedRecordsMap.set((key + ("add" === type ? insertCount : -insertCount)).toString(), record);
|
|
461
395
|
}
|
|
462
396
|
}
|
|
463
|
-
deleteRecords(recordIndexs
|
|
464
|
-
var _a
|
|
465
|
-
if (
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
475
|
-
}
|
|
476
|
-
return this.userPagination || (this.pagination.perPageCount = this._sourceLength,
|
|
477
|
-
this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs),
|
|
478
|
-
realDeletedRecordIndexs;
|
|
397
|
+
deleteRecords(recordIndexs) {
|
|
398
|
+
var _a;
|
|
399
|
+
if (Array.isArray(this.records)) {
|
|
400
|
+
const realDeletedRecordIndexs = [], recordIndexsMaxToMin = recordIndexs.sort(((a, b) => b - a));
|
|
401
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
402
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
403
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
404
|
+
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), realDeletedRecordIndexs.push(recordIndex);
|
|
405
|
+
const deletedRecord = this.records[recordIndex];
|
|
406
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].deleteRecord(deletedRecord);
|
|
407
|
+
this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1;
|
|
479
408
|
}
|
|
480
|
-
return
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
484
|
-
const realDeletedRecordIndexs = [], recordIndexsMaxToMin = recordIndexs.slice().sort(((a, b) => b - a)), rawDeletedIndexs = [];
|
|
485
|
-
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
486
|
-
const viewIndex = recordIndexsMaxToMin[index];
|
|
487
|
-
if (viewIndex >= this.records.length || viewIndex < 0) continue;
|
|
488
|
-
const deletedRecord = this.records[viewIndex], rawIndex = rawRecords.indexOf(deletedRecord);
|
|
489
|
-
rawIndex >= 0 && (rawRecords.splice(rawIndex, 1), rawDeletedIndexs.push(rawIndex)),
|
|
490
|
-
realDeletedRecordIndexs.push(viewIndex);
|
|
409
|
+
return this.userPagination || (this.pagination.perPageCount = this._sourceLength,
|
|
410
|
+
this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs),
|
|
411
|
+
realDeletedRecordIndexs;
|
|
491
412
|
}
|
|
492
|
-
return
|
|
493
|
-
(null === (_c = this.dataSourceObj) || void 0 === _c ? void 0 : _c.deleted) && this.dataSourceObj.deleted(rawDeletedIndexs),
|
|
494
|
-
realDeletedRecordIndexs;
|
|
413
|
+
return [];
|
|
495
414
|
}
|
|
496
415
|
deleteRecordsForSorted(recordIndexs) {
|
|
497
416
|
if (Array.isArray(this.records)) {
|
|
@@ -506,38 +425,20 @@ export class DataSource extends EventTarget {
|
|
|
506
425
|
this.pagination.totalCount = this._sourceLength), this.beforeChangedRecordsMap.clear();
|
|
507
426
|
}
|
|
508
427
|
}
|
|
509
|
-
updateRecords(records, recordIndexs
|
|
510
|
-
|
|
511
|
-
if (!syncToOriginalRecords) {
|
|
512
|
-
const realDeletedRecordIndexs = [];
|
|
513
|
-
for (let index = 0; index < recordIndexs.length; index++) {
|
|
514
|
-
const recordIndex = recordIndexs[index];
|
|
515
|
-
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
516
|
-
realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce(((acc, key) => (void 0 === acc[key] && (acc[key] = {}),
|
|
517
|
-
acc[key].children)), this.records)[recordIndex[recordIndex.length - 1]] = records[index]; else {
|
|
518
|
-
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
519
|
-
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
520
|
-
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
521
|
-
this.records[recordIndex] = records[index];
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
525
|
-
}
|
|
526
|
-
const rawRecords = this._getRawRecordsArray();
|
|
527
|
-
if (!rawRecords || !Array.isArray(this.records)) return [];
|
|
528
|
-
const realUpdatedIndexs = [];
|
|
428
|
+
updateRecords(records, recordIndexs) {
|
|
429
|
+
const realDeletedRecordIndexs = [];
|
|
529
430
|
for (let index = 0; index < recordIndexs.length; index++) {
|
|
530
431
|
const recordIndex = recordIndexs[index];
|
|
531
432
|
if (Array.isArray(recordIndex)) this.beforeChangedRecordsMap.delete(recordIndex.toString()),
|
|
532
|
-
|
|
533
|
-
acc[key].children)),
|
|
534
|
-
if (recordIndex >= this.
|
|
535
|
-
|
|
536
|
-
|
|
433
|
+
realDeletedRecordIndexs.push(recordIndex), recordIndex.slice(0, -1).reduce(((acc, key) => (void 0 === acc[key] && (acc[key] = {}),
|
|
434
|
+
acc[key].children)), this.records)[recordIndex[recordIndex.length - 1]] = records[index]; else {
|
|
435
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
|
|
436
|
+
this.beforeChangedRecordsMap.delete(recordIndex.toString()), realDeletedRecordIndexs.push(recordIndex);
|
|
437
|
+
for (let i = 0; i < this.fieldAggregators.length; i++) this.fieldAggregators[i].updateRecord(this.records[recordIndex], records[index]);
|
|
438
|
+
this.records[recordIndex] = records[index];
|
|
537
439
|
}
|
|
538
440
|
}
|
|
539
|
-
return this.
|
|
540
|
-
realUpdatedIndexs;
|
|
441
|
+
return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
|
|
541
442
|
}
|
|
542
443
|
updateRecordsForSorted(records, recordIndexs) {
|
|
543
444
|
const realDeletedRecordIndexs = [];
|