@visactor/vtable 1.5.3-alpha.1 → 1.5.3
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 +1 -2
- package/cjs/ListTable.js +194 -26
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -1
- package/cjs/PivotTable.js +3 -3
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +3 -5
- package/cjs/core/BaseTable.js +79 -8
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +2 -0
- package/cjs/core/tableHelper.js +18 -9
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +1 -10
- package/cjs/data/CachedDataSource.js +3 -78
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/dataset/statistics-helper.js +1 -0
- package/cjs/edit/edit-manager.d.ts +1 -1
- package/cjs/edit/edit-manager.js +4 -5
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/listener/container-dom.js +6 -5
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/scroll.js +6 -4
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/layout-helper.js +2 -2
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/row-height-map.js +0 -1
- package/cjs/layout/simple-header-layout.d.ts +2 -1
- package/cjs/layout/simple-header-layout.js +88 -2
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/plugins/icons.js +1 -1
- package/cjs/plugins/themes.js +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +6 -11
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +2 -7
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +1 -1
- package/cjs/scenegraph/utils/get-cell-merge.js +1 -1
- package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js +8 -6
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/cjs/state/select/is-cell-select-highlight.d.ts +1 -0
- package/cjs/state/select/is-cell-select-highlight.js +8 -2
- package/cjs/state/select/is-cell-select-highlight.js.map +1 -1
- package/cjs/themes/theme.d.ts +0 -2
- package/cjs/themes/theme.js +4 -12
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/helper.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +0 -9
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +0 -1
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +1 -9
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +0 -1
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +2901 -3149
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +1 -2
- package/es/ListTable.js +192 -30
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.d.ts +1 -1
- package/es/PivotTable.js +3 -3
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +3 -5
- package/es/core/BaseTable.js +83 -11
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/tableHelper.d.ts +2 -0
- package/es/core/tableHelper.js +16 -6
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +1 -10
- package/es/data/CachedDataSource.js +0 -79
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/dataset/statistics-helper.js +2 -1
- package/es/edit/edit-manager.d.ts +1 -1
- package/es/edit/edit-manager.js +5 -4
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/listener/container-dom.js +7 -4
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/scroll.js +6 -4
- package/es/event/scroll.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/layout-helper.js +2 -2
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/row-height-map.js +1 -2
- package/es/layout/simple-header-layout.d.ts +2 -1
- package/es/layout/simple-header-layout.js +87 -3
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/plugins/icons.js +1 -1
- package/es/plugins/themes.js +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +6 -11
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +2 -7
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/scenegraph.js +1 -1
- package/es/scenegraph/utils/get-cell-merge.js +1 -1
- package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js +9 -7
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/es/state/select/is-cell-select-highlight.d.ts +1 -0
- package/es/state/select/is-cell-select-highlight.js +5 -0
- package/es/state/select/is-cell-select-highlight.js.map +1 -1
- package/es/themes/theme.d.ts +0 -2
- package/es/themes/theme.js +4 -11
- package/es/themes/theme.js.map +1 -1
- package/es/tools/helper.js.map +1 -1
- package/es/ts-types/base-table.d.ts +0 -9
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +0 -1
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +1 -9
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +0 -1
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
- package/cjs/core/group-helper.d.ts +0 -6
- package/cjs/core/group-helper.js +0 -22
- package/cjs/core/group-helper.js.map +0 -1
- package/cjs/core/record-helper.d.ts +0 -6
- package/cjs/core/record-helper.js +0 -230
- package/cjs/core/record-helper.js.map +0 -1
- package/cjs/core/style-helper.d.ts +0 -3
- package/cjs/core/style-helper.js +0 -110
- package/cjs/core/style-helper.js.map +0 -1
- package/cjs/layout/cell-range/simple-cell-range.d.ts +0 -4
- package/cjs/layout/cell-range/simple-cell-range.js +0 -106
- package/cjs/layout/cell-range/simple-cell-range.js.map +0 -1
- package/es/core/group-helper.d.ts +0 -6
- package/es/core/group-helper.js +0 -14
- package/es/core/group-helper.js.map +0 -1
- package/es/core/record-helper.d.ts +0 -6
- package/es/core/record-helper.js +0 -220
- package/es/core/record-helper.js.map +0 -1
- package/es/core/style-helper.d.ts +0 -3
- package/es/core/style-helper.js +0 -86
- package/es/core/style-helper.js.map +0 -1
- package/es/layout/cell-range/simple-cell-range.d.ts +0 -4
- package/es/layout/cell-range/simple-cell-range.js +0 -99
- package/es/layout/cell-range/simple-cell-range.js.map +0 -1
package/es/ListTable.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export declare class ListTable extends BaseTable implements ListTableAPI {
|
|
|
68
68
|
sortState?: SortState | SortState[];
|
|
69
69
|
}): void;
|
|
70
70
|
setRecordChildren(records: any[], col: number, row: number): void;
|
|
71
|
-
startEditCell(col?: number, row?: number): void;
|
|
71
|
+
startEditCell(col?: number, row?: number, value?: string | number): void;
|
|
72
72
|
completeEditCell(): void;
|
|
73
73
|
getEditor(col: number, row: number): IEditor<any>;
|
|
74
74
|
isHasEditorDefine(col: number, row: number): boolean;
|
|
@@ -87,5 +87,4 @@ export declare class ListTable extends BaseTable implements ListTableAPI {
|
|
|
87
87
|
}[];
|
|
88
88
|
}[];
|
|
89
89
|
isAggregation(col: number, row: number): boolean;
|
|
90
|
-
getGroupTitleLevel(col: number, row: number): number | undefined;
|
|
91
90
|
}
|
package/es/ListTable.js
CHANGED
|
@@ -2,9 +2,9 @@ import { HierarchyState } from "./ts-types";
|
|
|
2
2
|
|
|
3
3
|
import { SimpleHeaderLayoutMap } from "./layout";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { isValid } from "@visactor/vutils";
|
|
6
6
|
|
|
7
|
-
import { _setDataSource, _setRecords } from "./core/tableHelper";
|
|
7
|
+
import { _setDataSource, _setRecords, sortRecords } from "./core/tableHelper";
|
|
8
8
|
|
|
9
9
|
import { BaseTable } from "./core";
|
|
10
10
|
|
|
@@ -30,23 +30,17 @@ import { setCellCheckboxState } from "./state/checkbox/checkbox";
|
|
|
30
30
|
|
|
31
31
|
import { Factory } from "./core/factory";
|
|
32
32
|
|
|
33
|
-
import { getGroupByDataConfig } from "./core/group-helper";
|
|
34
|
-
|
|
35
|
-
import { listTableAddRecord, listTableAddRecords, listTableDeleteRecords, listTableUpdateRecords, sortRecords } from "./core/record-helper";
|
|
36
|
-
|
|
37
33
|
export class ListTable extends BaseTable {
|
|
38
34
|
constructor(container, options) {
|
|
39
|
-
var _a, _b
|
|
35
|
+
var _a, _b;
|
|
40
36
|
"node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
|
|
41
37
|
container = container.container ? container.container : null), super(container, options),
|
|
42
38
|
this.showHeader = !0;
|
|
43
39
|
const internalProps = this.internalProps;
|
|
44
40
|
if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination,
|
|
45
|
-
internalProps.sortState = options.sortState, internalProps.dataConfig = options.
|
|
46
|
-
internalProps.
|
|
47
|
-
|
|
48
|
-
this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c,
|
|
49
|
-
this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, "node" !== Env.mode && (this.editorManager = new EditManeger(this)),
|
|
41
|
+
internalProps.sortState = options.sortState, internalProps.dataConfig = {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, [ "children" ]) : options.header ? cloneDeepSpec(options.header, [ "children" ]) : [],
|
|
42
|
+
this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_a = options.showHeader) || void 0 === _a || _a,
|
|
43
|
+
this.transpose = null !== (_b = options.transpose) && void 0 !== _b && _b, "node" !== Env.mode && (this.editorManager = new EditManeger(this)),
|
|
50
44
|
this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
|
|
51
45
|
sortState: internalProps.sortState
|
|
52
46
|
}) : this.setRecords([]), options.title) {
|
|
@@ -350,9 +344,7 @@ export class ListTable extends BaseTable {
|
|
|
350
344
|
return null;
|
|
351
345
|
}
|
|
352
346
|
getHierarchyState(col, row) {
|
|
353
|
-
if (!this.
|
|
354
|
-
if (!this.getBodyColumnDefine(col, row).tree) return HierarchyState.none;
|
|
355
|
-
}
|
|
347
|
+
if (!this.getBodyColumnDefine(col, row).tree) return HierarchyState.none;
|
|
356
348
|
const index = this.getRecordShowIndexByCell(col, row);
|
|
357
349
|
return this.dataSource.getHierarchyState(index);
|
|
358
350
|
}
|
|
@@ -489,12 +481,12 @@ export class ListTable extends BaseTable {
|
|
|
489
481
|
const index = this.getRecordShowIndexByCell(col, row);
|
|
490
482
|
this.dataSource.setRecord(record, index), this._refreshHierarchyState(col, row);
|
|
491
483
|
}
|
|
492
|
-
startEditCell(col, row) {
|
|
484
|
+
startEditCell(col, row, value) {
|
|
493
485
|
var _a;
|
|
494
486
|
if (isValid(col) && isValid(row)) this.eventManager.isDraging = !1, this.selectCell(col, row),
|
|
495
|
-
this.editorManager.startEditCell(col, row); else if (null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.cellPos) {
|
|
487
|
+
this.editorManager.startEditCell(col, row, value); else if (null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.cellPos) {
|
|
496
488
|
const {col: col, row: row} = this.stateManager.select.cellPos;
|
|
497
|
-
isValid(col) && isValid(row) && this.editorManager.startEditCell(col, row);
|
|
489
|
+
isValid(col) && isValid(row) && this.editorManager.startEditCell(col, row, value);
|
|
498
490
|
}
|
|
499
491
|
}
|
|
500
492
|
completeEditCell() {
|
|
@@ -617,16 +609,194 @@ export class ListTable extends BaseTable {
|
|
|
617
609
|
this.scenegraph.updateNextFrame();
|
|
618
610
|
}
|
|
619
611
|
addRecord(record, recordIndex) {
|
|
620
|
-
|
|
612
|
+
if (this.sortState) this.dataSource.addRecordForSorted(record), sortRecords(this),
|
|
613
|
+
this.refreshRowColCount(), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(); else {
|
|
614
|
+
(void 0 === recordIndex || recordIndex > this.dataSource.sourceLength) && (recordIndex = this.dataSource.sourceLength);
|
|
615
|
+
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
616
|
+
this.dataSource.addRecord(record, recordIndex);
|
|
617
|
+
const oldRowCount = this.rowCount;
|
|
618
|
+
if (this.refreshRowColCount(), 0 === this.scenegraph.proxy.totalActualBodyRowCount) return this.scenegraph.clearCells(),
|
|
619
|
+
void this.scenegraph.createSceneGraph();
|
|
620
|
+
const newRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
621
|
+
if (this.pagination) {
|
|
622
|
+
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
|
|
623
|
+
if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) this.scenegraph.clearCells(),
|
|
624
|
+
this.scenegraph.createSceneGraph(); else {
|
|
625
|
+
const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
|
|
626
|
+
if (oldRowCount - headerCount === this.pagination.perPageCount) {
|
|
627
|
+
const updateRows = [];
|
|
628
|
+
for (let row = rowNum; row < newRowCount; row++) this.transpose ? updateRows.push({
|
|
629
|
+
col: row,
|
|
630
|
+
row: 0
|
|
631
|
+
}) : updateRows.push({
|
|
632
|
+
col: 0,
|
|
633
|
+
row: row
|
|
634
|
+
});
|
|
635
|
+
this.transpose ? this.scenegraph.updateCol([], [], updateRows) : this.scenegraph.updateRow([], [], updateRows);
|
|
636
|
+
} else {
|
|
637
|
+
const addRows = [];
|
|
638
|
+
for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) this.transpose ? addRows.push({
|
|
639
|
+
col: row,
|
|
640
|
+
row: 0
|
|
641
|
+
}) : addRows.push({
|
|
642
|
+
col: 0,
|
|
643
|
+
row: row
|
|
644
|
+
});
|
|
645
|
+
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
} else {
|
|
649
|
+
const addRows = [];
|
|
650
|
+
for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) this.transpose ? addRows.push({
|
|
651
|
+
col: row,
|
|
652
|
+
row: 0
|
|
653
|
+
}) : addRows.push({
|
|
654
|
+
col: 0,
|
|
655
|
+
row: row
|
|
656
|
+
});
|
|
657
|
+
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
621
660
|
}
|
|
622
661
|
addRecords(records, recordIndex) {
|
|
623
|
-
|
|
662
|
+
if (this.sortState) this.dataSource.addRecordsForSorted(records), sortRecords(this),
|
|
663
|
+
this.refreshRowColCount(), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(); else {
|
|
664
|
+
void 0 === recordIndex || recordIndex > this.dataSource.sourceLength ? recordIndex = this.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
665
|
+
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
666
|
+
this.dataSource.addRecords(records, recordIndex);
|
|
667
|
+
const oldRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
668
|
+
if (this.refreshRowColCount(), 0 === this.scenegraph.proxy.totalActualBodyRowCount) return this.scenegraph.clearCells(),
|
|
669
|
+
void this.scenegraph.createSceneGraph();
|
|
670
|
+
const newRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
671
|
+
if (this.pagination) {
|
|
672
|
+
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
|
|
673
|
+
if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) this.scenegraph.clearCells(),
|
|
674
|
+
this.scenegraph.createSceneGraph(); else {
|
|
675
|
+
const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
|
|
676
|
+
if (oldRowCount - headerCount === this.pagination.perPageCount) {
|
|
677
|
+
const updateRows = [];
|
|
678
|
+
for (let row = rowNum; row < newRowCount; row++) this.transpose ? updateRows.push({
|
|
679
|
+
col: row,
|
|
680
|
+
row: 0
|
|
681
|
+
}) : updateRows.push({
|
|
682
|
+
col: 0,
|
|
683
|
+
row: row
|
|
684
|
+
});
|
|
685
|
+
this.transpose ? this.scenegraph.updateCol([], [], updateRows) : this.scenegraph.updateRow([], [], updateRows);
|
|
686
|
+
} else {
|
|
687
|
+
const addRows = [];
|
|
688
|
+
for (let row = rowNum; row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1)); row++) this.transpose ? addRows.push({
|
|
689
|
+
col: row,
|
|
690
|
+
row: 0
|
|
691
|
+
}) : addRows.push({
|
|
692
|
+
col: 0,
|
|
693
|
+
row: row
|
|
694
|
+
});
|
|
695
|
+
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
} else {
|
|
699
|
+
const addRows = [];
|
|
700
|
+
for (let row = recordIndex + headerCount; row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1); row++) this.transpose ? addRows.push({
|
|
701
|
+
col: row,
|
|
702
|
+
row: 0
|
|
703
|
+
}) : addRows.push({
|
|
704
|
+
col: 0,
|
|
705
|
+
row: row
|
|
706
|
+
});
|
|
707
|
+
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
624
710
|
}
|
|
625
711
|
deleteRecords(recordIndexs) {
|
|
626
|
-
|
|
712
|
+
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (this.sortState) this.dataSource.deleteRecordsForSorted(recordIndexs),
|
|
713
|
+
sortRecords(this), this.refreshRowColCount(), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(); else {
|
|
714
|
+
const deletedRecordIndexs = this.dataSource.deleteRecords(recordIndexs);
|
|
715
|
+
if (0 === deletedRecordIndexs.length) return;
|
|
716
|
+
const oldRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
717
|
+
this.refreshRowColCount();
|
|
718
|
+
const newRowCount = this.transpose ? this.colCount : this.rowCount, recordIndexsMinToMax = deletedRecordIndexs.sort(((a, b) => a - b)), minRecordIndex = recordIndexsMinToMax[0];
|
|
719
|
+
if (this.pagination) {
|
|
720
|
+
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
|
|
721
|
+
if (minRecordIndex < endIndex) if (minRecordIndex < endIndex - perPageCount) this.scenegraph.clearCells(),
|
|
722
|
+
this.scenegraph.createSceneGraph(); else {
|
|
723
|
+
const updateRows = [], delRows = [];
|
|
724
|
+
for (let row = minRecordIndex - (endIndex - perPageCount) + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount); row < newRowCount; row++) this.transpose ? updateRows.push({
|
|
725
|
+
col: row,
|
|
726
|
+
row: 0
|
|
727
|
+
}) : updateRows.push({
|
|
728
|
+
col: 0,
|
|
729
|
+
row: row
|
|
730
|
+
});
|
|
731
|
+
if (newRowCount < oldRowCount) for (let row = newRowCount; row < oldRowCount; row++) this.transpose ? delRows.push({
|
|
732
|
+
col: row,
|
|
733
|
+
row: 0
|
|
734
|
+
}) : delRows.push({
|
|
735
|
+
col: 0,
|
|
736
|
+
row: row
|
|
737
|
+
});
|
|
738
|
+
this.transpose ? this.scenegraph.updateCol(delRows, [], updateRows) : this.scenegraph.updateRow(delRows, [], updateRows);
|
|
739
|
+
}
|
|
740
|
+
} else {
|
|
741
|
+
const delRows = [];
|
|
742
|
+
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
743
|
+
const rowNum = recordIndexsMinToMax[index] + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
744
|
+
this.transpose ? delRows.push({
|
|
745
|
+
col: rowNum,
|
|
746
|
+
row: 0
|
|
747
|
+
}) : delRows.push({
|
|
748
|
+
col: 0,
|
|
749
|
+
row: rowNum
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
this.transpose ? this.scenegraph.updateCol(delRows, [], []) : this.scenegraph.updateRow(delRows, [], []);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
627
755
|
}
|
|
628
756
|
updateRecords(records, recordIndexs) {
|
|
629
|
-
|
|
757
|
+
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (this.sortState) this.dataSource.updateRecordsForSorted(records, recordIndexs),
|
|
758
|
+
sortRecords(this), this.refreshRowColCount(), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(); else {
|
|
759
|
+
const updateRecordIndexs = this.dataSource.updateRecords(records, recordIndexs);
|
|
760
|
+
if (0 === updateRecordIndexs.length) return;
|
|
761
|
+
const recordIndexsMinToMax = updateRecordIndexs.sort(((a, b) => a - b));
|
|
762
|
+
if (this.pagination) {
|
|
763
|
+
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount, updateRows = [];
|
|
764
|
+
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
765
|
+
const recordIndex = recordIndexsMinToMax[index];
|
|
766
|
+
if (recordIndex < endIndex && recordIndex >= endIndex - perPageCount) {
|
|
767
|
+
const rowNum = recordIndex - (endIndex - perPageCount) + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
768
|
+
updateRows.push(rowNum);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
if (updateRows.length >= 1) {
|
|
772
|
+
const updateRowCells = [];
|
|
773
|
+
for (let index = 0; index < updateRows.length; index++) {
|
|
774
|
+
const updateRow = updateRows[index];
|
|
775
|
+
this.transpose ? updateRowCells.push({
|
|
776
|
+
col: updateRow,
|
|
777
|
+
row: 0
|
|
778
|
+
}) : updateRowCells.push({
|
|
779
|
+
col: 0,
|
|
780
|
+
row: updateRow
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
this.transpose ? this.scenegraph.updateCol([], [], updateRowCells) : this.scenegraph.updateRow([], [], updateRowCells);
|
|
784
|
+
}
|
|
785
|
+
} else {
|
|
786
|
+
const updateRows = [];
|
|
787
|
+
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
788
|
+
const rowNum = recordIndexsMinToMax[index] + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
789
|
+
this.transpose ? updateRows.push({
|
|
790
|
+
col: rowNum,
|
|
791
|
+
row: 0
|
|
792
|
+
}) : updateRows.push({
|
|
793
|
+
col: 0,
|
|
794
|
+
row: rowNum
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
this.transpose ? this.scenegraph.updateCol([], [], updateRows) : this.scenegraph.updateRow([], [], updateRows);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
630
800
|
}
|
|
631
801
|
_hasCustomRenderOrLayout() {
|
|
632
802
|
var _a, _b, _c, _d;
|
|
@@ -662,13 +832,5 @@ export class ListTable extends BaseTable {
|
|
|
662
832
|
isAggregation(col, row) {
|
|
663
833
|
return this.internalProps.layoutMap.isAggregation(col, row);
|
|
664
834
|
}
|
|
665
|
-
getGroupTitleLevel(col, row) {
|
|
666
|
-
var _a;
|
|
667
|
-
if (!this.options.groupBy) return;
|
|
668
|
-
const indexArr = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row)), groupLength = null !== (_a = this.dataSource.getGroupLength()) && void 0 !== _a ? _a : 0;
|
|
669
|
-
let indexArrLngth = isArray(indexArr) ? indexArr.length - 1 : 0;
|
|
670
|
-
return groupLength > 0 && indexArrLngth === groupLength && (indexArrLngth = void 0),
|
|
671
|
-
indexArrLngth;
|
|
672
|
-
}
|
|
673
835
|
}
|
|
674
836
|
//# sourceMappingURL=ListTable.js.map
|