@visactor/vtable 1.5.3-alpha.0 → 1.5.3-alpha.1
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 +2 -1
- package/cjs/ListTable.js +26 -194
- 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 +5 -3
- package/cjs/core/BaseTable.js +8 -79
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/group-helper.d.ts +6 -0
- package/cjs/core/group-helper.js +22 -0
- package/cjs/core/group-helper.js.map +1 -0
- package/cjs/core/record-helper.d.ts +6 -0
- package/cjs/core/record-helper.js +230 -0
- package/cjs/core/record-helper.js.map +1 -0
- package/cjs/core/style-helper.d.ts +3 -0
- package/cjs/core/style-helper.js +110 -0
- package/cjs/core/style-helper.js.map +1 -0
- package/cjs/core/tableHelper.d.ts +0 -2
- package/cjs/core/tableHelper.js +9 -18
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +10 -1
- package/cjs/data/CachedDataSource.js +78 -3
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/dataset/statistics-helper.js +0 -1
- package/cjs/edit/edit-manager.d.ts +1 -1
- package/cjs/edit/edit-manager.js +5 -4
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/listener/table-group.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/cell-range/simple-cell-range.d.ts +4 -0
- package/cjs/layout/cell-range/simple-cell-range.js +106 -0
- package/cjs/layout/cell-range/simple-cell-range.js.map +1 -0
- package/cjs/layout/layout-helper.js +2 -2
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/row-height-map.js +1 -0
- package/cjs/layout/simple-header-layout.d.ts +1 -2
- package/cjs/layout/simple-header-layout.js +2 -88
- 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 +11 -6
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +7 -2
- 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 +6 -8
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/cjs/themes/theme.d.ts +2 -0
- package/cjs/themes/theme.js +12 -4
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/helper.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +9 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +1 -0
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +9 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +1 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +3145 -2878
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +2 -1
- package/es/ListTable.js +30 -192
- 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 +5 -3
- package/es/core/BaseTable.js +11 -83
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/group-helper.d.ts +6 -0
- package/es/core/group-helper.js +14 -0
- package/es/core/group-helper.js.map +1 -0
- package/es/core/record-helper.d.ts +6 -0
- package/es/core/record-helper.js +220 -0
- package/es/core/record-helper.js.map +1 -0
- package/es/core/style-helper.d.ts +3 -0
- package/es/core/style-helper.js +86 -0
- package/es/core/style-helper.js.map +1 -0
- package/es/core/tableHelper.d.ts +0 -2
- package/es/core/tableHelper.js +6 -16
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +10 -1
- package/es/data/CachedDataSource.js +79 -0
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/dataset/statistics-helper.js +1 -2
- package/es/edit/edit-manager.d.ts +1 -1
- package/es/edit/edit-manager.js +4 -5
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/listener/table-group.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/cell-range/simple-cell-range.d.ts +4 -0
- package/es/layout/cell-range/simple-cell-range.js +99 -0
- package/es/layout/cell-range/simple-cell-range.js.map +1 -0
- package/es/layout/layout-helper.js +2 -2
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/row-height-map.js +2 -1
- package/es/layout/simple-header-layout.d.ts +1 -2
- package/es/layout/simple-header-layout.js +3 -87
- 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 +11 -6
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +7 -2
- 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 +7 -9
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/es/themes/theme.d.ts +2 -0
- package/es/themes/theme.js +11 -4
- package/es/themes/theme.js.map +1 -1
- package/es/tools/helper.js.map +1 -1
- package/es/ts-types/base-table.d.ts +9 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +1 -0
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +9 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +1 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
package/cjs/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
|
|
71
|
+
startEditCell(col?: number, row?: number): void;
|
|
72
72
|
completeEditCell(): void;
|
|
73
73
|
getEditor(col: number, row: number): IEditor<any>;
|
|
74
74
|
isHasEditorDefine(col: number, row: number): boolean;
|
|
@@ -87,4 +87,5 @@ 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;
|
|
90
91
|
}
|
package/cjs/ListTable.js
CHANGED
|
@@ -29,20 +29,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
29
29
|
value: !0
|
|
30
30
|
}), exports.ListTable = void 0;
|
|
31
31
|
|
|
32
|
-
const ts_types_1 = require("./ts-types"), layout_1 = require("./layout"), vutils_1 = require("@visactor/vutils"), tableHelper_1 = require("./core/tableHelper"), core_1 = require("./core"), TABLE_EVENT_TYPE_1 = require("./core/TABLE_EVENT_TYPE"), env_1 = require("./tools/env"), editors = __importStar(require("./edit/editors")), edit_manager_1 = require("./edit/edit-manager"), compute_col_width_1 = require("./scenegraph/layout/compute-col-width"), compute_row_height_1 = require("./scenegraph/layout/compute-row-height"), util_1 = require("./tools/util"), radio_1 = require("./state/radio/radio"), vutils_extension_1 = require("@visactor/vutils-extension"), checkbox_1 = require("./state/checkbox/checkbox"), factory_1 = require("./core/factory");
|
|
32
|
+
const ts_types_1 = require("./ts-types"), layout_1 = require("./layout"), vutils_1 = require("@visactor/vutils"), tableHelper_1 = require("./core/tableHelper"), core_1 = require("./core"), TABLE_EVENT_TYPE_1 = require("./core/TABLE_EVENT_TYPE"), env_1 = require("./tools/env"), editors = __importStar(require("./edit/editors")), edit_manager_1 = require("./edit/edit-manager"), compute_col_width_1 = require("./scenegraph/layout/compute-col-width"), compute_row_height_1 = require("./scenegraph/layout/compute-row-height"), util_1 = require("./tools/util"), radio_1 = require("./state/radio/radio"), vutils_extension_1 = require("@visactor/vutils-extension"), checkbox_1 = require("./state/checkbox/checkbox"), factory_1 = require("./core/factory"), group_helper_1 = require("./core/group-helper"), record_helper_1 = require("./core/record-helper");
|
|
33
33
|
|
|
34
34
|
class ListTable extends core_1.BaseTable {
|
|
35
35
|
constructor(container, options) {
|
|
36
|
-
var _a, _b;
|
|
36
|
+
var _a, _b, _c, _d;
|
|
37
37
|
"node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
|
|
38
38
|
container = container.container ? container.container : null), super(container, options),
|
|
39
39
|
this.showHeader = !0;
|
|
40
40
|
const internalProps = this.internalProps;
|
|
41
41
|
if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination,
|
|
42
|
-
internalProps.sortState = options.sortState, internalProps.dataConfig =
|
|
42
|
+
internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? (0,
|
|
43
|
+
group_helper_1.getGroupByDataConfig)(options.groupBy) : {}, internalProps.columns = options.columns ? (0,
|
|
43
44
|
vutils_extension_1.cloneDeepSpec)(options.columns, [ "children" ]) : options.header ? (0,
|
|
44
|
-
vutils_extension_1.cloneDeepSpec)(options.header, [ "children" ]) : [],
|
|
45
|
-
|
|
45
|
+
vutils_extension_1.cloneDeepSpec)(options.header, [ "children" ]) : [], internalProps.enableTreeNodeMerge = null !== (_b = null !== (_a = options.enableTreeNodeMerge) && void 0 !== _a ? _a : (0,
|
|
46
|
+
vutils_1.isValid)(options.groupBy)) && void 0 !== _b && _b, this.internalProps.headerHelper.setTableColumnsEditor(),
|
|
47
|
+
this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d,
|
|
46
48
|
"node" !== env_1.Env.mode && (this.editorManager = new edit_manager_1.EditManeger(this)),
|
|
47
49
|
this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? (0,
|
|
48
50
|
tableHelper_1._setDataSource)(this, options.dataSource) : options.records ? this.setRecords(options.records, {
|
|
@@ -349,7 +351,9 @@ class ListTable extends core_1.BaseTable {
|
|
|
349
351
|
return null;
|
|
350
352
|
}
|
|
351
353
|
getHierarchyState(col, row) {
|
|
352
|
-
if (!this.
|
|
354
|
+
if (!this.options.groupBy) {
|
|
355
|
+
if (!this.getBodyColumnDefine(col, row).tree) return ts_types_1.HierarchyState.none;
|
|
356
|
+
}
|
|
353
357
|
const index = this.getRecordShowIndexByCell(col, row);
|
|
354
358
|
return this.dataSource.getHierarchyState(index);
|
|
355
359
|
}
|
|
@@ -420,7 +424,7 @@ class ListTable extends core_1.BaseTable {
|
|
|
420
424
|
}
|
|
421
425
|
updateFilterRules(filterRules) {
|
|
422
426
|
this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules),
|
|
423
|
-
(0,
|
|
427
|
+
(0, record_helper_1.sortRecords)(this)) : this.dataSource.updateFilterRules(filterRules),
|
|
424
428
|
this.refreshRowColCount(), this.scenegraph.createSceneGraph();
|
|
425
429
|
}
|
|
426
430
|
getCheckboxState(field) {
|
|
@@ -486,12 +490,12 @@ class ListTable extends core_1.BaseTable {
|
|
|
486
490
|
const index = this.getRecordShowIndexByCell(col, row);
|
|
487
491
|
this.dataSource.setRecord(record, index), this._refreshHierarchyState(col, row);
|
|
488
492
|
}
|
|
489
|
-
startEditCell(col, row
|
|
493
|
+
startEditCell(col, row) {
|
|
490
494
|
var _a;
|
|
491
495
|
if ((0, vutils_1.isValid)(col) && (0, vutils_1.isValid)(row)) this.eventManager.isDraging = !1,
|
|
492
|
-
this.selectCell(col, row), this.editorManager.startEditCell(col, row
|
|
496
|
+
this.selectCell(col, row), this.editorManager.startEditCell(col, row); else if (null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.cellPos) {
|
|
493
497
|
const {col: col, row: row} = this.stateManager.select.cellPos;
|
|
494
|
-
(0, vutils_1.isValid)(col) && (0, vutils_1.isValid)(row) && this.editorManager.startEditCell(col, row
|
|
498
|
+
(0, vutils_1.isValid)(col) && (0, vutils_1.isValid)(row) && this.editorManager.startEditCell(col, row);
|
|
495
499
|
}
|
|
496
500
|
}
|
|
497
501
|
completeEditCell() {
|
|
@@ -614,196 +618,16 @@ class ListTable extends core_1.BaseTable {
|
|
|
614
618
|
this.scenegraph.updateNextFrame();
|
|
615
619
|
}
|
|
616
620
|
addRecord(record, recordIndex) {
|
|
617
|
-
|
|
618
|
-
this.refreshRowColCount(), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(); else {
|
|
619
|
-
(void 0 === recordIndex || recordIndex > this.dataSource.sourceLength) && (recordIndex = this.dataSource.sourceLength);
|
|
620
|
-
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
621
|
-
this.dataSource.addRecord(record, recordIndex);
|
|
622
|
-
const oldRowCount = this.rowCount;
|
|
623
|
-
if (this.refreshRowColCount(), 0 === this.scenegraph.proxy.totalActualBodyRowCount) return this.scenegraph.clearCells(),
|
|
624
|
-
void this.scenegraph.createSceneGraph();
|
|
625
|
-
const newRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
626
|
-
if (this.pagination) {
|
|
627
|
-
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
|
|
628
|
-
if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) this.scenegraph.clearCells(),
|
|
629
|
-
this.scenegraph.createSceneGraph(); else {
|
|
630
|
-
const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
|
|
631
|
-
if (oldRowCount - headerCount === this.pagination.perPageCount) {
|
|
632
|
-
const updateRows = [];
|
|
633
|
-
for (let row = rowNum; row < newRowCount; row++) this.transpose ? updateRows.push({
|
|
634
|
-
col: row,
|
|
635
|
-
row: 0
|
|
636
|
-
}) : updateRows.push({
|
|
637
|
-
col: 0,
|
|
638
|
-
row: row
|
|
639
|
-
});
|
|
640
|
-
this.transpose ? this.scenegraph.updateCol([], [], updateRows) : this.scenegraph.updateRow([], [], updateRows);
|
|
641
|
-
} else {
|
|
642
|
-
const addRows = [];
|
|
643
|
-
for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) this.transpose ? addRows.push({
|
|
644
|
-
col: row,
|
|
645
|
-
row: 0
|
|
646
|
-
}) : addRows.push({
|
|
647
|
-
col: 0,
|
|
648
|
-
row: row
|
|
649
|
-
});
|
|
650
|
-
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
} else {
|
|
654
|
-
const addRows = [];
|
|
655
|
-
for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) this.transpose ? addRows.push({
|
|
656
|
-
col: row,
|
|
657
|
-
row: 0
|
|
658
|
-
}) : addRows.push({
|
|
659
|
-
col: 0,
|
|
660
|
-
row: row
|
|
661
|
-
});
|
|
662
|
-
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
663
|
-
}
|
|
664
|
-
}
|
|
621
|
+
(0, record_helper_1.listTableAddRecord)(record, recordIndex, this);
|
|
665
622
|
}
|
|
666
623
|
addRecords(records, recordIndex) {
|
|
667
|
-
|
|
668
|
-
this.refreshRowColCount(), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(); else {
|
|
669
|
-
void 0 === recordIndex || recordIndex > this.dataSource.sourceLength ? recordIndex = this.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
670
|
-
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
671
|
-
this.dataSource.addRecords(records, recordIndex);
|
|
672
|
-
const oldRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
673
|
-
if (this.refreshRowColCount(), 0 === this.scenegraph.proxy.totalActualBodyRowCount) return this.scenegraph.clearCells(),
|
|
674
|
-
void this.scenegraph.createSceneGraph();
|
|
675
|
-
const newRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
676
|
-
if (this.pagination) {
|
|
677
|
-
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
|
|
678
|
-
if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) this.scenegraph.clearCells(),
|
|
679
|
-
this.scenegraph.createSceneGraph(); else {
|
|
680
|
-
const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
|
|
681
|
-
if (oldRowCount - headerCount === this.pagination.perPageCount) {
|
|
682
|
-
const updateRows = [];
|
|
683
|
-
for (let row = rowNum; row < newRowCount; row++) this.transpose ? updateRows.push({
|
|
684
|
-
col: row,
|
|
685
|
-
row: 0
|
|
686
|
-
}) : updateRows.push({
|
|
687
|
-
col: 0,
|
|
688
|
-
row: row
|
|
689
|
-
});
|
|
690
|
-
this.transpose ? this.scenegraph.updateCol([], [], updateRows) : this.scenegraph.updateRow([], [], updateRows);
|
|
691
|
-
} else {
|
|
692
|
-
const addRows = [];
|
|
693
|
-
for (let row = rowNum; row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1)); row++) this.transpose ? addRows.push({
|
|
694
|
-
col: row,
|
|
695
|
-
row: 0
|
|
696
|
-
}) : addRows.push({
|
|
697
|
-
col: 0,
|
|
698
|
-
row: row
|
|
699
|
-
});
|
|
700
|
-
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
} else {
|
|
704
|
-
const addRows = [];
|
|
705
|
-
for (let row = recordIndex + headerCount; row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1); row++) this.transpose ? addRows.push({
|
|
706
|
-
col: row,
|
|
707
|
-
row: 0
|
|
708
|
-
}) : addRows.push({
|
|
709
|
-
col: 0,
|
|
710
|
-
row: row
|
|
711
|
-
});
|
|
712
|
-
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
713
|
-
}
|
|
714
|
-
}
|
|
624
|
+
(0, record_helper_1.listTableAddRecords)(records, recordIndex, this);
|
|
715
625
|
}
|
|
716
626
|
deleteRecords(recordIndexs) {
|
|
717
|
-
|
|
718
|
-
(0, tableHelper_1.sortRecords)(this), this.refreshRowColCount(), this.scenegraph.clearCells(),
|
|
719
|
-
this.scenegraph.createSceneGraph(); else {
|
|
720
|
-
const deletedRecordIndexs = this.dataSource.deleteRecords(recordIndexs);
|
|
721
|
-
if (0 === deletedRecordIndexs.length) return;
|
|
722
|
-
const oldRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
723
|
-
this.refreshRowColCount();
|
|
724
|
-
const newRowCount = this.transpose ? this.colCount : this.rowCount, recordIndexsMinToMax = deletedRecordIndexs.sort(((a, b) => a - b)), minRecordIndex = recordIndexsMinToMax[0];
|
|
725
|
-
if (this.pagination) {
|
|
726
|
-
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
|
|
727
|
-
if (minRecordIndex < endIndex) if (minRecordIndex < endIndex - perPageCount) this.scenegraph.clearCells(),
|
|
728
|
-
this.scenegraph.createSceneGraph(); else {
|
|
729
|
-
const updateRows = [], delRows = [];
|
|
730
|
-
for (let row = minRecordIndex - (endIndex - perPageCount) + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount); row < newRowCount; row++) this.transpose ? updateRows.push({
|
|
731
|
-
col: row,
|
|
732
|
-
row: 0
|
|
733
|
-
}) : updateRows.push({
|
|
734
|
-
col: 0,
|
|
735
|
-
row: row
|
|
736
|
-
});
|
|
737
|
-
if (newRowCount < oldRowCount) for (let row = newRowCount; row < oldRowCount; row++) this.transpose ? delRows.push({
|
|
738
|
-
col: row,
|
|
739
|
-
row: 0
|
|
740
|
-
}) : delRows.push({
|
|
741
|
-
col: 0,
|
|
742
|
-
row: row
|
|
743
|
-
});
|
|
744
|
-
this.transpose ? this.scenegraph.updateCol(delRows, [], updateRows) : this.scenegraph.updateRow(delRows, [], updateRows);
|
|
745
|
-
}
|
|
746
|
-
} else {
|
|
747
|
-
const delRows = [];
|
|
748
|
-
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
749
|
-
const rowNum = recordIndexsMinToMax[index] + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
750
|
-
this.transpose ? delRows.push({
|
|
751
|
-
col: rowNum,
|
|
752
|
-
row: 0
|
|
753
|
-
}) : delRows.push({
|
|
754
|
-
col: 0,
|
|
755
|
-
row: rowNum
|
|
756
|
-
});
|
|
757
|
-
}
|
|
758
|
-
this.transpose ? this.scenegraph.updateCol(delRows, [], []) : this.scenegraph.updateRow(delRows, [], []);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
627
|
+
(0, record_helper_1.listTableDeleteRecords)(recordIndexs, this);
|
|
761
628
|
}
|
|
762
629
|
updateRecords(records, recordIndexs) {
|
|
763
|
-
|
|
764
|
-
(0, tableHelper_1.sortRecords)(this), this.refreshRowColCount(), this.scenegraph.clearCells(),
|
|
765
|
-
this.scenegraph.createSceneGraph(); else {
|
|
766
|
-
const updateRecordIndexs = this.dataSource.updateRecords(records, recordIndexs);
|
|
767
|
-
if (0 === updateRecordIndexs.length) return;
|
|
768
|
-
const recordIndexsMinToMax = updateRecordIndexs.sort(((a, b) => a - b));
|
|
769
|
-
if (this.pagination) {
|
|
770
|
-
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount, updateRows = [];
|
|
771
|
-
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
772
|
-
const recordIndex = recordIndexsMinToMax[index];
|
|
773
|
-
if (recordIndex < endIndex && recordIndex >= endIndex - perPageCount) {
|
|
774
|
-
const rowNum = recordIndex - (endIndex - perPageCount) + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
775
|
-
updateRows.push(rowNum);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
if (updateRows.length >= 1) {
|
|
779
|
-
const updateRowCells = [];
|
|
780
|
-
for (let index = 0; index < updateRows.length; index++) {
|
|
781
|
-
const updateRow = updateRows[index];
|
|
782
|
-
this.transpose ? updateRowCells.push({
|
|
783
|
-
col: updateRow,
|
|
784
|
-
row: 0
|
|
785
|
-
}) : updateRowCells.push({
|
|
786
|
-
col: 0,
|
|
787
|
-
row: updateRow
|
|
788
|
-
});
|
|
789
|
-
}
|
|
790
|
-
this.transpose ? this.scenegraph.updateCol([], [], updateRowCells) : this.scenegraph.updateRow([], [], updateRowCells);
|
|
791
|
-
}
|
|
792
|
-
} else {
|
|
793
|
-
const updateRows = [];
|
|
794
|
-
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
795
|
-
const rowNum = recordIndexsMinToMax[index] + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
796
|
-
this.transpose ? updateRows.push({
|
|
797
|
-
col: rowNum,
|
|
798
|
-
row: 0
|
|
799
|
-
}) : updateRows.push({
|
|
800
|
-
col: 0,
|
|
801
|
-
row: rowNum
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
this.transpose ? this.scenegraph.updateCol([], [], updateRows) : this.scenegraph.updateRow([], [], updateRows);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
630
|
+
(0, record_helper_1.listTableUpdateRecords)(records, recordIndexs, this);
|
|
807
631
|
}
|
|
808
632
|
_hasCustomRenderOrLayout() {
|
|
809
633
|
var _a, _b, _c, _d;
|
|
@@ -839,6 +663,14 @@ class ListTable extends core_1.BaseTable {
|
|
|
839
663
|
isAggregation(col, row) {
|
|
840
664
|
return this.internalProps.layoutMap.isAggregation(col, row);
|
|
841
665
|
}
|
|
666
|
+
getGroupTitleLevel(col, row) {
|
|
667
|
+
var _a;
|
|
668
|
+
if (!this.options.groupBy) return;
|
|
669
|
+
const indexArr = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row)), groupLength = null !== (_a = this.dataSource.getGroupLength()) && void 0 !== _a ? _a : 0;
|
|
670
|
+
let indexArrLngth = (0, vutils_1.isArray)(indexArr) ? indexArr.length - 1 : 0;
|
|
671
|
+
return groupLength > 0 && indexArrLngth === groupLength && (indexArrLngth = void 0),
|
|
672
|
+
indexArrLngth;
|
|
673
|
+
}
|
|
842
674
|
}
|
|
843
675
|
|
|
844
676
|
exports.ListTable = ListTable;
|