@visactor/vtable 1.5.7-alpha.1 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ListTable-all.js +5 -5
- package/cjs/ListTable-all.js.map +1 -1
- package/cjs/ListTable.d.ts +3 -0
- package/cjs/ListTable.js +41 -284
- package/cjs/ListTable.js.map +1 -1
- package/cjs/body-helper/style/Style.d.ts +2 -2
- package/cjs/body-helper/style/Style.js.map +1 -1
- package/cjs/components/title/title.js +3 -1
- package/cjs/components/title/title.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +5 -3
- package/cjs/core/BaseTable.js +13 -83
- 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 +8 -0
- package/cjs/core/record-helper.js +337 -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 +15 -19
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +10 -1
- package/cjs/data/CachedDataSource.js +102 -3
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/dataset/dataset.js +0 -1
- package/cjs/edit/edit-manager.js +2 -1
- package/cjs/event/event.js +3 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/header-helper/style/Style.d.ts +2 -2
- package/cjs/header-helper/style/Style.js.map +1 -1
- package/cjs/index.d.ts +3 -1
- package/cjs/index.js +25 -2
- 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/pivot-header-layout.js +4 -2
- package/cjs/layout/pivot-header-layout.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 +6 -90
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/plugins/icons.js +1 -1
- package/cjs/plugins/list-tree-stick-cell.d.ts +16 -0
- package/cjs/plugins/list-tree-stick-cell.js +178 -0
- package/cjs/plugins/list-tree-stick-cell.js.map +1 -0
- package/cjs/plugins/themes.js +1 -1
- package/cjs/scenegraph/component/custom.js +1 -1
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +6 -3
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +48 -7
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/group.js +1 -1
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +2 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +29 -10
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +9 -2
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/init-scenegraph.js +2 -2
- package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +2 -2
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +2 -2
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +3 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +5 -3
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +54 -39
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +5 -6
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.d.ts +1 -1
- package/cjs/scenegraph/style/frame-border.js +27 -12
- package/cjs/scenegraph/style/frame-border.js.map +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/scenegraph/utils/text-icon-layout.js +6 -4
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/themes/theme.d.ts +2 -0
- package/cjs/themes/theme.js +13 -4
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/helper.d.ts +1 -1
- package/cjs/tools/helper.js +3 -3
- 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/column/style.d.ts +2 -2
- package/cjs/ts-types/column/style.js.map +1 -1
- package/cjs/ts-types/component/index.d.ts +1 -0
- package/cjs/ts-types/component/index.js +21 -0
- package/cjs/ts-types/component/index.js.map +1 -0
- package/cjs/ts-types/index.d.ts +1 -0
- package/cjs/ts-types/index.js +1 -1
- package/cjs/ts-types/index.js.map +1 -1
- package/cjs/ts-types/list-table/layout-map/api.d.ts +1 -0
- package/cjs/ts-types/list-table/layout-map/api.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 +10 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -1
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.d.ts +1 -1
- package/cjs/vrender.js +2 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +8405 -5360
- package/dist/vtable.min.js +2 -2
- package/es/ListTable-all.js +5 -3
- package/es/ListTable-all.js.map +1 -1
- package/es/ListTable.d.ts +3 -0
- package/es/ListTable.js +44 -286
- package/es/ListTable.js.map +1 -1
- package/es/body-helper/style/Style.d.ts +2 -2
- package/es/body-helper/style/Style.js.map +1 -1
- package/es/components/title/title.js +3 -1
- package/es/components/title/title.js.map +1 -1
- package/es/core/BaseTable.d.ts +5 -3
- package/es/core/BaseTable.js +16 -87
- 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 +8 -0
- package/es/core/record-helper.js +332 -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 +12 -17
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +10 -1
- package/es/data/CachedDataSource.js +103 -0
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/dataset/dataset.js +1 -2
- package/es/edit/edit-manager.js +2 -1
- package/es/event/event.js +3 -1
- package/es/event/event.js.map +1 -1
- package/es/header-helper/style/Style.d.ts +2 -2
- package/es/header-helper/style/Style.js.map +1 -1
- package/es/index.d.ts +3 -1
- package/es/index.js +5 -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/pivot-header-layout.js +4 -2
- package/es/layout/pivot-header-layout.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 +7 -89
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/plugins/icons.js +1 -1
- package/es/plugins/list-tree-stick-cell.d.ts +16 -0
- package/es/plugins/list-tree-stick-cell.js +176 -0
- package/es/plugins/list-tree-stick-cell.js.map +1 -0
- package/es/plugins/themes.js +1 -1
- package/es/scenegraph/component/custom.js +1 -1
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +8 -3
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js +49 -5
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/group.js +1 -1
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.d.ts +2 -1
- package/es/scenegraph/group-creater/cell-helper.js +23 -8
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +8 -2
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/init-scenegraph.js +2 -2
- package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -3
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +2 -2
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +3 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +5 -3
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +54 -39
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +5 -6
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/style/frame-border.d.ts +1 -1
- package/es/scenegraph/style/frame-border.js +27 -10
- package/es/scenegraph/style/frame-border.js.map +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/scenegraph/utils/text-icon-layout.js +6 -4
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/themes/theme.d.ts +2 -0
- package/es/themes/theme.js +13 -4
- package/es/themes/theme.js.map +1 -1
- package/es/tools/helper.d.ts +1 -1
- package/es/tools/helper.js +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/column/style.d.ts +2 -2
- package/es/ts-types/column/style.js.map +1 -1
- package/es/ts-types/component/index.d.ts +1 -0
- package/es/ts-types/component/index.js +2 -0
- package/es/ts-types/component/index.js.map +1 -0
- package/es/ts-types/index.d.ts +1 -0
- package/es/ts-types/index.js +2 -0
- package/es/ts-types/index.js.map +1 -1
- package/es/ts-types/list-table/layout-map/api.d.ts +1 -0
- package/es/ts-types/list-table/layout-map/api.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 +10 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -1
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.d.ts +1 -1
- package/es/vrender.js +3 -2
- package/es/vrender.js.map +1 -1
- package/package.json +9 -8
package/cjs/ListTable-all.js
CHANGED
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.ListTableAll = void 0;
|
|
6
6
|
|
|
7
|
-
const ListTable_1 = require("./ListTable"), components_1 = require("./components"), cell_type_1 = require("./scenegraph/group-creater/cell-type");
|
|
7
|
+
const ListTable_1 = require("./ListTable"), components_1 = require("./components"), list_tree_stick_cell_1 = require("./plugins/list-tree-stick-cell"), cell_type_1 = require("./scenegraph/group-creater/cell-type");
|
|
8
8
|
|
|
9
9
|
(0, components_1.registerAxis)(), (0, components_1.registerEmptyTip)(), (0, components_1.registerLegend)(),
|
|
10
10
|
(0, components_1.registerMenu)(), (0, components_1.registerTitle)(), (0, components_1.registerTooltip)(),
|
|
11
|
-
(0,
|
|
12
|
-
cell_type_1.
|
|
13
|
-
cell_type_1.
|
|
14
|
-
cell_type_1.registerTextCell)(), (0, cell_type_1.registerVideoCell)();
|
|
11
|
+
(0, list_tree_stick_cell_1.registerListTreeStickCellPlugin)(), (0, cell_type_1.registerChartCell)(),
|
|
12
|
+
(0, cell_type_1.registerCheckboxCell)(), (0, cell_type_1.registerImageCell)(), (0,
|
|
13
|
+
cell_type_1.registerProgressBarCell)(), (0, cell_type_1.registerRadioCell)(), (0,
|
|
14
|
+
cell_type_1.registerSparkLineCell)(), (0, cell_type_1.registerTextCell)(), (0, cell_type_1.registerVideoCell)();
|
|
15
15
|
|
|
16
16
|
class ListTableAll extends ListTable_1.ListTable {}
|
|
17
17
|
|
package/cjs/ListTable-all.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ListTable-all.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,6CAOsB;AACtB,oEAS8C;AAE9C,IAAA,yBAAY,GAAE,CAAC;AACf,IAAA,6BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAc,GAAE,CAAC;AACjB,IAAA,yBAAY,GAAE,CAAC;AACf,IAAA,0BAAa,GAAE,CAAC;AAChB,IAAA,4BAAe,GAAE,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/ListTable-all.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,6CAOsB;AACtB,yEAAiF;AACjF,oEAS8C;AAE9C,IAAA,yBAAY,GAAE,CAAC;AACf,IAAA,6BAAgB,GAAE,CAAC;AACnB,IAAA,2BAAc,GAAE,CAAC;AACjB,IAAA,yBAAY,GAAE,CAAC;AACf,IAAA,0BAAa,GAAE,CAAC;AAChB,IAAA,4BAAe,GAAE,CAAC;AAClB,IAAA,sDAA+B,GAAE,CAAC;AAElC,IAAA,6BAAiB,GAAE,CAAC;AACpB,IAAA,gCAAoB,GAAE,CAAC;AACvB,IAAA,6BAAiB,GAAE,CAAC;AACpB,IAAA,mCAAuB,GAAE,CAAC;AAC1B,IAAA,6BAAiB,GAAE,CAAC;AACpB,IAAA,iCAAqB,GAAE,CAAC;AACxB,IAAA,4BAAgB,GAAE,CAAC;AACnB,IAAA,6BAAiB,GAAE,CAAC;AACpB,MAAa,YAAa,SAAQ,qBAAS;CAAG;AAA9C,oCAA8C","file":"ListTable-all.js","sourcesContent":["import { ListTable } from './ListTable';\nimport {\n registerAxis,\n registerEmptyTip,\n registerLegend,\n registerMenu,\n registerTitle,\n registerTooltip\n} from './components';\nimport { registerListTreeStickCellPlugin } from './plugins/list-tree-stick-cell';\nimport {\n registerChartCell,\n registerCheckboxCell,\n registerImageCell,\n registerProgressBarCell,\n registerRadioCell,\n registerSparkLineCell,\n registerTextCell,\n registerVideoCell\n} from './scenegraph/group-creater/cell-type';\n\nregisterAxis();\nregisterEmptyTip();\nregisterLegend();\nregisterMenu();\nregisterTitle();\nregisterTooltip();\nregisterListTreeStickCellPlugin();\n\nregisterChartCell();\nregisterCheckboxCell();\nregisterImageCell();\nregisterProgressBarCell();\nregisterRadioCell();\nregisterSparkLineCell();\nregisterTextCell();\nregisterVideoCell();\nexport class ListTableAll extends ListTable {}\n"]}
|
package/cjs/ListTable.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ import { HierarchyState } from './ts-types';
|
|
|
3
3
|
import { BaseTable } from './core';
|
|
4
4
|
import type { ListTableProtected } from './ts-types/base-table';
|
|
5
5
|
import type { IEditor } from '@visactor/vtable-editors';
|
|
6
|
+
import type { ListTreeStickCellPlugin } from './plugins/list-tree-stick-cell';
|
|
6
7
|
export declare class ListTable extends BaseTable implements ListTableAPI {
|
|
7
8
|
internalProps: ListTableProtected;
|
|
8
9
|
options: ListTableConstructorOptions;
|
|
9
10
|
showHeader: boolean;
|
|
11
|
+
listTreeStickCellPlugin?: ListTreeStickCellPlugin;
|
|
10
12
|
constructor(options: ListTableConstructorOptions);
|
|
11
13
|
constructor(container: HTMLElement, options: ListTableConstructorOptions);
|
|
12
14
|
isListTable(): true;
|
|
@@ -85,4 +87,5 @@ export declare class ListTable extends BaseTable implements ListTableAPI {
|
|
|
85
87
|
}[];
|
|
86
88
|
}[];
|
|
87
89
|
isAggregation(col: number, row: number): boolean;
|
|
90
|
+
getGroupTitleLevel(col: number, row: number): number | undefined;
|
|
88
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"),
|
|
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"), 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, {
|
|
@@ -55,6 +57,10 @@ class ListTable extends core_1.BaseTable {
|
|
|
55
57
|
const EmptyTip = factory_1.Factory.getComponent("emptyTip");
|
|
56
58
|
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), this.internalProps.emptyTip.resetVisible();
|
|
57
59
|
}
|
|
60
|
+
if (options.enableTreeStickCell) {
|
|
61
|
+
const ListTreeStickCellPlugin = factory_1.Factory.getComponent("listTreeStickCellPlugin");
|
|
62
|
+
this.listTreeStickCellPlugin = new ListTreeStickCellPlugin(this);
|
|
63
|
+
}
|
|
58
64
|
setTimeout((() => {
|
|
59
65
|
this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
60
66
|
}), 0);
|
|
@@ -225,8 +231,9 @@ class ListTable extends core_1.BaseTable {
|
|
|
225
231
|
const internalProps = this.internalProps;
|
|
226
232
|
if (super.updateOption(options), internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode,
|
|
227
233
|
this.pagination = options.pagination, internalProps.sortState = options.sortState,
|
|
228
|
-
internalProps.dataConfig =
|
|
229
|
-
|
|
234
|
+
internalProps.dataConfig = options.groupBy ? (0, group_helper_1.getGroupByDataConfig)(options.groupBy) : {},
|
|
235
|
+
this.showHeader = null === (_a = options.showHeader) || void 0 === _a || _a, internalProps.columns = options.columns ? (0,
|
|
236
|
+
vutils_extension_1.cloneDeepSpec)(options.columns, [ "children" ]) : options.header ? (0,
|
|
230
237
|
vutils_extension_1.cloneDeepSpec)(options.header, [ "children" ]) : [], this.internalProps.headerHelper.setTableColumnsEditor(),
|
|
231
238
|
this.transpose = null !== (_b = options.transpose) && void 0 !== _b && _b, this.refreshHeader(),
|
|
232
239
|
this.internalProps.useOneRowHeightFillAll = !1, internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
@@ -261,21 +268,21 @@ class ListTable extends core_1.BaseTable {
|
|
|
261
268
|
transpose || this.setMinMaxLimitWidth(!0), this.refreshRowColCount();
|
|
262
269
|
}
|
|
263
270
|
refreshRowColCount() {
|
|
264
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
271
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
265
272
|
const table = this, {layoutMap: layoutMap} = table.internalProps;
|
|
266
273
|
if (!layoutMap) return;
|
|
267
274
|
const dataCount = null !== (_b = null === (_a = table.internalProps.dataSource) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0;
|
|
268
275
|
layoutMap.recordsCount = dataCount + (dataCount > 0 ? layoutMap.hasAggregationOnTopCount + layoutMap.hasAggregationOnBottomCount : 0),
|
|
269
276
|
table.transpose ? (table.rowCount = null !== (_c = layoutMap.rowCount) && void 0 !== _c ? _c : 0,
|
|
270
|
-
table.colCount = null !== (_d = layoutMap.colCount) && void 0 !== _d ? _d : 0,
|
|
271
|
-
this.internalProps.
|
|
272
|
-
table.bottomFrozenRowCount !== (null !== (
|
|
273
|
-
table.rightFrozenColCount !== (null !== (
|
|
277
|
+
table.colCount = null !== (_d = layoutMap.colCount) && void 0 !== _d ? _d : 0, this.internalProps.frozenColCount = Math.max((null !== (_e = layoutMap.headerLevelCount) && void 0 !== _e ? _e : 0) + layoutMap.leftRowSeriesNumberColumnCount, null !== (_f = this.options.frozenColCount) && void 0 !== _f ? _f : 0),
|
|
278
|
+
this.internalProps.frozenRowCount = null !== (_g = this.options.frozenRowCount) && void 0 !== _g ? _g : 0,
|
|
279
|
+
table.bottomFrozenRowCount !== (null !== (_h = this.options.bottomFrozenRowCount) && void 0 !== _h ? _h : 0) && (table.bottomFrozenRowCount = null !== (_j = this.options.bottomFrozenRowCount) && void 0 !== _j ? _j : 0),
|
|
280
|
+
table.rightFrozenColCount !== (null !== (_k = this.options.rightFrozenColCount) && void 0 !== _k ? _k : 0) && (table.rightFrozenColCount = null !== (_l = this.options.rightFrozenColCount) && void 0 !== _l ? _l : 0)) : (table.colCount = null !== (_m = layoutMap.colCount) && void 0 !== _m ? _m : 0,
|
|
274
281
|
table.rowCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount,
|
|
275
|
-
this.internalProps.frozenColCount = null !== (
|
|
276
|
-
table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (
|
|
277
|
-
table.bottomFrozenRowCount !== (null !== (
|
|
278
|
-
table.rightFrozenColCount !== (null !== (
|
|
282
|
+
this.internalProps.frozenColCount = null !== (_o = this.options.frozenColCount) && void 0 !== _o ? _o : 0,
|
|
283
|
+
table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (_p = this.options.frozenRowCount) && void 0 !== _p ? _p : 0),
|
|
284
|
+
table.bottomFrozenRowCount !== (null !== (_q = this.options.bottomFrozenRowCount) && void 0 !== _q ? _q : 0) && (table.bottomFrozenRowCount = null !== (_r = this.options.bottomFrozenRowCount) && void 0 !== _r ? _r : 0),
|
|
285
|
+
table.rightFrozenColCount !== (null !== (_s = this.options.rightFrozenColCount) && void 0 !== _s ? _s : 0) && (table.rightFrozenColCount = null !== (_t = this.options.rightFrozenColCount) && void 0 !== _t ? _t : 0)),
|
|
279
286
|
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
280
287
|
}
|
|
281
288
|
getFieldData(field, col, row) {
|
|
@@ -349,7 +356,9 @@ class ListTable extends core_1.BaseTable {
|
|
|
349
356
|
return null;
|
|
350
357
|
}
|
|
351
358
|
getHierarchyState(col, row) {
|
|
352
|
-
if (!this.
|
|
359
|
+
if (!this.options.groupBy) {
|
|
360
|
+
if (!this.getBodyColumnDefine(col, row).tree) return ts_types_1.HierarchyState.none;
|
|
361
|
+
}
|
|
353
362
|
const index = this.getRecordShowIndexByCell(col, row);
|
|
354
363
|
return this.dataSource.getHierarchyState(index);
|
|
355
364
|
}
|
|
@@ -420,7 +429,7 @@ class ListTable extends core_1.BaseTable {
|
|
|
420
429
|
}
|
|
421
430
|
updateFilterRules(filterRules) {
|
|
422
431
|
this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules),
|
|
423
|
-
(0,
|
|
432
|
+
(0, record_helper_1.sortRecords)(this)) : this.dataSource.updateFilterRules(filterRules),
|
|
424
433
|
this.refreshRowColCount(), this.scenegraph.createSceneGraph();
|
|
425
434
|
}
|
|
426
435
|
getCheckboxState(field) {
|
|
@@ -529,282 +538,22 @@ class ListTable extends core_1.BaseTable {
|
|
|
529
538
|
return (0, vutils_1.isValid)(editorDefine);
|
|
530
539
|
}
|
|
531
540
|
changeCellValue(col, row, value, workOnEditableCell = !1) {
|
|
532
|
-
|
|
533
|
-
const recordIndex = this.getRecordShowIndexByCell(col, row), {field: field} = this.internalProps.layoutMap.getBody(col, row), beforeChangeValue = this.getCellRawValue(col, row), oldValue = this.getCellOriginValue(col, row);
|
|
534
|
-
this.isHeader(col, row) ? this.internalProps.layoutMap.updateColumnTitle(col, row, value) : this.dataSource.changeFieldValue(value, recordIndex, field, col, row, this);
|
|
535
|
-
const range = this.getCellRange(col, row), aggregators = this.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
536
|
-
if (aggregators) {
|
|
537
|
-
if (Array.isArray(aggregators)) for (let i = 0; i < (null == aggregators ? void 0 : aggregators.length); i++) aggregators[i].recalculate(); else aggregators.recalculate();
|
|
538
|
-
const aggregatorCells = this.internalProps.layoutMap.getAggregatorCellAddress(range.start.col, range.start.row, range.end.col, range.end.row);
|
|
539
|
-
for (let i = 0; i < aggregatorCells.length; i++) {
|
|
540
|
-
const range = this.getCellRange(aggregatorCells[i].col, aggregatorCells[i].row);
|
|
541
|
-
for (let sCol = range.start.col; sCol <= range.end.col; sCol++) for (let sRow = range.start.row; sRow <= range.end.row; sRow++) this.scenegraph.updateCellContent(sCol, sRow);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
for (let sCol = range.start.col; sCol <= range.end.col; sCol++) for (let sRow = range.start.row; sRow <= range.end.row; sRow++) this.scenegraph.updateCellContent(sCol, sRow);
|
|
545
|
-
if ("adaptive" === this.widthMode || this.autoFillWidth && this.getAllColsWidth() <= this.tableNoFrameWidth) 0 === this.internalProps._widthResizedColMap.size && this.scenegraph.recalculateColWidths(); else if (!this.internalProps._widthResizedColMap.has(col)) {
|
|
546
|
-
const oldWidth = this.getColWidth(col), newWidth = (0, compute_col_width_1.computeColWidth)(col, 0, this.rowCount - 1, this, !1);
|
|
547
|
-
newWidth !== oldWidth && this.scenegraph.updateColWidth(col, newWidth - oldWidth);
|
|
548
|
-
}
|
|
549
|
-
if ("adaptive" === this.heightMode || this.autoFillHeight && this.getAllRowsHeight() <= this.tableNoFrameHeight) 0 === this.internalProps._heightResizedRowMap.size && this.scenegraph.recalculateRowHeights(); else if ("autoHeight" === this.heightMode && !this.internalProps._heightResizedRowMap.has(row)) {
|
|
550
|
-
const oldHeight = this.getRowHeight(row), newHeight = (0, compute_row_height_1.computeRowHeight)(row, 0, this.colCount - 1, this);
|
|
551
|
-
this.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
552
|
-
}
|
|
553
|
-
this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
554
|
-
col: col,
|
|
555
|
-
row: row,
|
|
556
|
-
rawValue: beforeChangeValue,
|
|
557
|
-
currentValue: oldValue,
|
|
558
|
-
changedValue: this.getCellOriginValue(col, row)
|
|
559
|
-
}), this.scenegraph.updateNextFrame();
|
|
560
|
-
}
|
|
541
|
+
return (0, record_helper_1.listTableChangeCellValue)(col, row, value, workOnEditableCell, this);
|
|
561
542
|
}
|
|
562
543
|
changeCellValues(startCol, startRow, values, workOnEditableCell = !1) {
|
|
563
|
-
|
|
564
|
-
const beforeChangeValues = [], oldValues = [];
|
|
565
|
-
for (let i = 0; i < values.length && !(startRow + i > this.rowCount - 1); i++) {
|
|
566
|
-
const rowValues = values[i], rawRowValues = [], oldRowValues = [];
|
|
567
|
-
beforeChangeValues.push(rawRowValues), oldValues.push(oldRowValues);
|
|
568
|
-
for (let j = 0; j < rowValues.length && !(startCol + j > this.colCount - 1); j++) {
|
|
569
|
-
const beforeChangeValue = this.getCellRawValue(startCol + j, startRow + i);
|
|
570
|
-
rawRowValues.push(beforeChangeValue);
|
|
571
|
-
const oldValue = this.getCellOriginValue(startCol + j, startRow + i);
|
|
572
|
-
oldRowValues.push(oldValue);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
for (let i = 0; i < values.length && !(startRow + i > this.rowCount - 1); i++) {
|
|
576
|
-
pasteRowEnd = startRow + i;
|
|
577
|
-
const rowValues = values[i];
|
|
578
|
-
let thisRowPasteColEnd = startCol;
|
|
579
|
-
for (let j = 0; j < rowValues.length && !(startCol + j > this.colCount - 1); j++) if (thisRowPasteColEnd = startCol + j,
|
|
580
|
-
workOnEditableCell && this.isHasEditorDefine(startCol + j, startRow + i) || !1 === workOnEditableCell) {
|
|
581
|
-
const value = rowValues[j], recordIndex = this.getRecordShowIndexByCell(startCol + j, startRow + i), {field: field} = this.internalProps.layoutMap.getBody(startCol + j, startRow + i), beforeChangeValue = beforeChangeValues[i][j], oldValue = oldValues[i][j];
|
|
582
|
-
this.isHeader(startCol + j, startRow + i) ? this.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value) : this.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, this),
|
|
583
|
-
this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
584
|
-
col: startCol + j,
|
|
585
|
-
row: startRow + i,
|
|
586
|
-
rawValue: beforeChangeValue,
|
|
587
|
-
currentValue: oldValue,
|
|
588
|
-
changedValue: this.getCellOriginValue(startCol + j, startRow + i)
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
592
|
-
}
|
|
593
|
-
const startRange = this.getCellRange(startCol, startRow), range = this.getCellRange(pasteColEnd, pasteRowEnd), aggregators = this.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
594
|
-
if (aggregators) {
|
|
595
|
-
for (let i = 0; i < (null == aggregators ? void 0 : aggregators.length); i++) aggregators[i].recalculate();
|
|
596
|
-
const aggregatorCells = this.internalProps.layoutMap.getAggregatorCellAddress(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
597
|
-
for (let i = 0; i < aggregatorCells.length; i++) {
|
|
598
|
-
const range = this.getCellRange(aggregatorCells[i].col, aggregatorCells[i].row);
|
|
599
|
-
for (let sCol = range.start.col; sCol <= range.end.col; sCol++) for (let sRow = range.start.row; sRow <= range.end.row; sRow++) this.scenegraph.updateCellContent(sCol, sRow);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
for (let sCol = startRange.start.col; sCol <= range.end.col; sCol++) for (let sRow = startRange.start.row; sRow <= range.end.row; sRow++) this.scenegraph.updateCellContent(sCol, sRow);
|
|
603
|
-
if ("adaptive" === this.widthMode || this.autoFillWidth && this.getAllColsWidth() <= this.tableNoFrameWidth) 0 === this.internalProps._widthResizedColMap.size && this.scenegraph.recalculateColWidths(); else for (let sCol = startCol; sCol <= range.end.col; sCol++) if (!this.internalProps._widthResizedColMap.has(sCol)) {
|
|
604
|
-
const oldWidth = this.getColWidth(sCol), newWidth = (0, compute_col_width_1.computeColWidth)(sCol, 0, this.rowCount - 1, this, !1);
|
|
605
|
-
newWidth !== oldWidth && this.scenegraph.updateColWidth(sCol, newWidth - oldWidth);
|
|
606
|
-
}
|
|
607
|
-
if ("adaptive" === this.heightMode || this.autoFillHeight && this.getAllRowsHeight() <= this.tableNoFrameHeight) this.scenegraph.recalculateRowHeights(); else if ("autoHeight" === this.heightMode) {
|
|
608
|
-
const rows = [], deltaYs = [];
|
|
609
|
-
for (let sRow = startRow; sRow <= range.end.row; sRow++) if (this.rowHeightsMap.get(sRow)) {
|
|
610
|
-
const oldHeight = this.getRowHeight(sRow), newHeight = (0, compute_row_height_1.computeRowHeight)(sRow, 0, this.colCount - 1, this);
|
|
611
|
-
rows.push(sRow), deltaYs.push(newHeight - oldHeight);
|
|
612
|
-
}
|
|
613
|
-
this.scenegraph.updateRowsHeight(rows, deltaYs);
|
|
614
|
-
}
|
|
615
|
-
this.scenegraph.updateNextFrame();
|
|
544
|
+
return (0, record_helper_1.listTableChangeCellValues)(startCol, startRow, values, workOnEditableCell, this);
|
|
616
545
|
}
|
|
617
546
|
addRecord(record, recordIndex) {
|
|
618
|
-
|
|
619
|
-
this.refreshRowColCount(), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(); else {
|
|
620
|
-
(void 0 === recordIndex || recordIndex > this.dataSource.sourceLength) && (recordIndex = this.dataSource.sourceLength);
|
|
621
|
-
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
622
|
-
this.dataSource.addRecord(record, recordIndex);
|
|
623
|
-
const oldRowCount = this.rowCount;
|
|
624
|
-
if (this.refreshRowColCount(), 0 === this.scenegraph.proxy.totalActualBodyRowCount) return this.scenegraph.clearCells(),
|
|
625
|
-
void this.scenegraph.createSceneGraph();
|
|
626
|
-
const newRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
627
|
-
if (this.pagination) {
|
|
628
|
-
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
|
|
629
|
-
if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) this.scenegraph.clearCells(),
|
|
630
|
-
this.scenegraph.createSceneGraph(); else {
|
|
631
|
-
const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
|
|
632
|
-
if (oldRowCount - headerCount === this.pagination.perPageCount) {
|
|
633
|
-
const updateRows = [];
|
|
634
|
-
for (let row = rowNum; row < newRowCount; row++) this.transpose ? updateRows.push({
|
|
635
|
-
col: row,
|
|
636
|
-
row: 0
|
|
637
|
-
}) : updateRows.push({
|
|
638
|
-
col: 0,
|
|
639
|
-
row: row
|
|
640
|
-
});
|
|
641
|
-
this.transpose ? this.scenegraph.updateCol([], [], updateRows) : this.scenegraph.updateRow([], [], updateRows);
|
|
642
|
-
} else {
|
|
643
|
-
const addRows = [];
|
|
644
|
-
for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) this.transpose ? addRows.push({
|
|
645
|
-
col: row,
|
|
646
|
-
row: 0
|
|
647
|
-
}) : addRows.push({
|
|
648
|
-
col: 0,
|
|
649
|
-
row: row
|
|
650
|
-
});
|
|
651
|
-
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
} else {
|
|
655
|
-
const addRows = [];
|
|
656
|
-
for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) this.transpose ? addRows.push({
|
|
657
|
-
col: row,
|
|
658
|
-
row: 0
|
|
659
|
-
}) : addRows.push({
|
|
660
|
-
col: 0,
|
|
661
|
-
row: row
|
|
662
|
-
});
|
|
663
|
-
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
547
|
+
(0, record_helper_1.listTableAddRecord)(record, recordIndex, this);
|
|
666
548
|
}
|
|
667
549
|
addRecords(records, recordIndex) {
|
|
668
|
-
|
|
669
|
-
this.refreshRowColCount(), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(); else {
|
|
670
|
-
void 0 === recordIndex || recordIndex > this.dataSource.sourceLength ? recordIndex = this.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
|
|
671
|
-
const headerCount = this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount;
|
|
672
|
-
this.dataSource.addRecords(records, recordIndex);
|
|
673
|
-
const oldRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
674
|
-
if (this.refreshRowColCount(), 0 === this.scenegraph.proxy.totalActualBodyRowCount) return this.scenegraph.clearCells(),
|
|
675
|
-
void this.scenegraph.createSceneGraph();
|
|
676
|
-
const newRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
677
|
-
if (this.pagination) {
|
|
678
|
-
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
|
|
679
|
-
if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) this.scenegraph.clearCells(),
|
|
680
|
-
this.scenegraph.createSceneGraph(); else {
|
|
681
|
-
const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
|
|
682
|
-
if (oldRowCount - headerCount === this.pagination.perPageCount) {
|
|
683
|
-
const updateRows = [];
|
|
684
|
-
for (let row = rowNum; row < newRowCount; row++) this.transpose ? updateRows.push({
|
|
685
|
-
col: row,
|
|
686
|
-
row: 0
|
|
687
|
-
}) : updateRows.push({
|
|
688
|
-
col: 0,
|
|
689
|
-
row: row
|
|
690
|
-
});
|
|
691
|
-
this.transpose ? this.scenegraph.updateCol([], [], updateRows) : this.scenegraph.updateRow([], [], updateRows);
|
|
692
|
-
} else {
|
|
693
|
-
const addRows = [];
|
|
694
|
-
for (let row = rowNum; row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1)); row++) this.transpose ? addRows.push({
|
|
695
|
-
col: row,
|
|
696
|
-
row: 0
|
|
697
|
-
}) : addRows.push({
|
|
698
|
-
col: 0,
|
|
699
|
-
row: row
|
|
700
|
-
});
|
|
701
|
-
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
} else {
|
|
705
|
-
const addRows = [];
|
|
706
|
-
for (let row = recordIndex + headerCount; row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1); row++) this.transpose ? addRows.push({
|
|
707
|
-
col: row,
|
|
708
|
-
row: 0
|
|
709
|
-
}) : addRows.push({
|
|
710
|
-
col: 0,
|
|
711
|
-
row: row
|
|
712
|
-
});
|
|
713
|
-
this.transpose ? this.scenegraph.updateCol([], addRows, []) : this.scenegraph.updateRow([], addRows, []);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
550
|
+
(0, record_helper_1.listTableAddRecords)(records, recordIndex, this);
|
|
716
551
|
}
|
|
717
552
|
deleteRecords(recordIndexs) {
|
|
718
|
-
|
|
719
|
-
(0, tableHelper_1.sortRecords)(this), this.refreshRowColCount(), this.scenegraph.clearCells(),
|
|
720
|
-
this.scenegraph.createSceneGraph(); else {
|
|
721
|
-
const deletedRecordIndexs = this.dataSource.deleteRecords(recordIndexs);
|
|
722
|
-
if (0 === deletedRecordIndexs.length) return;
|
|
723
|
-
const oldRowCount = this.transpose ? this.colCount : this.rowCount;
|
|
724
|
-
this.refreshRowColCount();
|
|
725
|
-
const newRowCount = this.transpose ? this.colCount : this.rowCount, recordIndexsMinToMax = deletedRecordIndexs.sort(((a, b) => a - b)), minRecordIndex = recordIndexsMinToMax[0];
|
|
726
|
-
if (this.pagination) {
|
|
727
|
-
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
|
|
728
|
-
if (minRecordIndex < endIndex) if (minRecordIndex < endIndex - perPageCount) this.scenegraph.clearCells(),
|
|
729
|
-
this.scenegraph.createSceneGraph(); else {
|
|
730
|
-
const updateRows = [], delRows = [];
|
|
731
|
-
for (let row = minRecordIndex - (endIndex - perPageCount) + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount); row < newRowCount; row++) this.transpose ? updateRows.push({
|
|
732
|
-
col: row,
|
|
733
|
-
row: 0
|
|
734
|
-
}) : updateRows.push({
|
|
735
|
-
col: 0,
|
|
736
|
-
row: row
|
|
737
|
-
});
|
|
738
|
-
if (newRowCount < oldRowCount) for (let row = newRowCount; row < oldRowCount; row++) this.transpose ? delRows.push({
|
|
739
|
-
col: row,
|
|
740
|
-
row: 0
|
|
741
|
-
}) : delRows.push({
|
|
742
|
-
col: 0,
|
|
743
|
-
row: row
|
|
744
|
-
});
|
|
745
|
-
this.transpose ? this.scenegraph.updateCol(delRows, [], updateRows) : this.scenegraph.updateRow(delRows, [], updateRows);
|
|
746
|
-
}
|
|
747
|
-
} else {
|
|
748
|
-
const delRows = [];
|
|
749
|
-
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
750
|
-
const rowNum = recordIndexsMinToMax[index] + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
751
|
-
this.transpose ? delRows.push({
|
|
752
|
-
col: rowNum,
|
|
753
|
-
row: 0
|
|
754
|
-
}) : delRows.push({
|
|
755
|
-
col: 0,
|
|
756
|
-
row: rowNum
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
this.transpose ? this.scenegraph.updateCol(delRows, [], []) : this.scenegraph.updateRow(delRows, [], []);
|
|
760
|
-
}
|
|
761
|
-
}
|
|
553
|
+
(0, record_helper_1.listTableDeleteRecords)(recordIndexs, this);
|
|
762
554
|
}
|
|
763
555
|
updateRecords(records, recordIndexs) {
|
|
764
|
-
|
|
765
|
-
(0, tableHelper_1.sortRecords)(this), this.refreshRowColCount(), this.scenegraph.clearCells(),
|
|
766
|
-
this.scenegraph.createSceneGraph(); else {
|
|
767
|
-
const updateRecordIndexs = this.dataSource.updateRecords(records, recordIndexs);
|
|
768
|
-
if (0 === updateRecordIndexs.length) return;
|
|
769
|
-
const recordIndexsMinToMax = updateRecordIndexs.sort(((a, b) => a - b));
|
|
770
|
-
if (this.pagination) {
|
|
771
|
-
const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount, updateRows = [];
|
|
772
|
-
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
773
|
-
const recordIndex = recordIndexsMinToMax[index];
|
|
774
|
-
if (recordIndex < endIndex && recordIndex >= endIndex - perPageCount) {
|
|
775
|
-
const rowNum = recordIndex - (endIndex - perPageCount) + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
776
|
-
updateRows.push(rowNum);
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
if (updateRows.length >= 1) {
|
|
780
|
-
const updateRowCells = [];
|
|
781
|
-
for (let index = 0; index < updateRows.length; index++) {
|
|
782
|
-
const updateRow = updateRows[index];
|
|
783
|
-
this.transpose ? updateRowCells.push({
|
|
784
|
-
col: updateRow,
|
|
785
|
-
row: 0
|
|
786
|
-
}) : updateRowCells.push({
|
|
787
|
-
col: 0,
|
|
788
|
-
row: updateRow
|
|
789
|
-
});
|
|
790
|
-
}
|
|
791
|
-
this.transpose ? this.scenegraph.updateCol([], [], updateRowCells) : this.scenegraph.updateRow([], [], updateRowCells);
|
|
792
|
-
}
|
|
793
|
-
} else {
|
|
794
|
-
const updateRows = [];
|
|
795
|
-
for (let index = 0; index < recordIndexsMinToMax.length; index++) {
|
|
796
|
-
const rowNum = recordIndexsMinToMax[index] + (this.transpose ? this.rowHeaderLevelCount : this.columnHeaderLevelCount);
|
|
797
|
-
this.transpose ? updateRows.push({
|
|
798
|
-
col: rowNum,
|
|
799
|
-
row: 0
|
|
800
|
-
}) : updateRows.push({
|
|
801
|
-
col: 0,
|
|
802
|
-
row: rowNum
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
this.transpose ? this.scenegraph.updateCol([], [], updateRows) : this.scenegraph.updateRow([], [], updateRows);
|
|
806
|
-
}
|
|
807
|
-
}
|
|
556
|
+
(0, record_helper_1.listTableUpdateRecords)(records, recordIndexs, this);
|
|
808
557
|
}
|
|
809
558
|
_hasCustomRenderOrLayout() {
|
|
810
559
|
var _a, _b, _c, _d;
|
|
@@ -840,6 +589,14 @@ class ListTable extends core_1.BaseTable {
|
|
|
840
589
|
isAggregation(col, row) {
|
|
841
590
|
return this.internalProps.layoutMap.isAggregation(col, row);
|
|
842
591
|
}
|
|
592
|
+
getGroupTitleLevel(col, row) {
|
|
593
|
+
var _a;
|
|
594
|
+
if (!this.options.groupBy) return;
|
|
595
|
+
const indexArr = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row)), groupLength = null !== (_a = this.dataSource.getGroupLength()) && void 0 !== _a ? _a : 0;
|
|
596
|
+
let indexArrLngth = (0, vutils_1.isArray)(indexArr) ? indexArr.length - 1 : 0;
|
|
597
|
+
return groupLength > 0 && indexArrLngth === groupLength && (indexArrLngth = void 0),
|
|
598
|
+
indexArrLngth;
|
|
599
|
+
}
|
|
843
600
|
}
|
|
844
601
|
|
|
845
602
|
exports.ListTable = ListTable;
|