@visactor/vtable 1.6.0-alpha.1 → 1.6.0-alpha.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-all.js +5 -5
- package/cjs/ListTable-all.js.map +1 -1
- package/cjs/ListTable.d.ts +0 -5
- package/cjs/ListTable.js +278 -34
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.d.ts +0 -2
- package/cjs/PivotTable.js +1 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +7 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/react/react-custom-layout.d.ts +3 -1
- package/cjs/components/react/react-custom-layout.js +7 -3
- package/cjs/components/react/react-custom-layout.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +8 -6
- package/cjs/core/BaseTable.js +93 -15
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/style.js +1 -1
- package/cjs/core/style.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +3 -1
- package/cjs/core/tableHelper.js +22 -12
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +1 -10
- package/cjs/data/CachedDataSource.js +3 -102
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.js +1 -0
- package/cjs/dataset/dataset-pivot-table.js.map +1 -1
- package/cjs/dataset/dataset.js +1 -0
- package/cjs/edit/edit-manager.js +5 -9
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/event.js +4 -6
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +43 -19
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +6 -4
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/index.d.ts +3 -3
- 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/pivot-header-layout.js +11 -5
- package/cjs/layout/pivot-header-layout.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/component/table-component.js +18 -14
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +26 -10
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.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 +1 -2
- package/cjs/scenegraph/group-creater/cell-helper.js +10 -29
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +2 -9
- 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/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +1 -1
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +2 -1
- package/cjs/scenegraph/refresh-node/update-chart.js +18 -4
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -1
- package/cjs/scenegraph/scenegraph.js +13 -8
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/create-select-border.js +2 -2
- package/cjs/scenegraph/select/create-select-border.js.map +1 -1
- package/cjs/scenegraph/utils/cell-border-stroke-width.js +9 -14
- package/cjs/scenegraph/utils/cell-border-stroke-width.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 +8 -6
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +6 -5
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/cell-move/index.js +14 -11
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/select/is-cell-select-highlight.js +6 -0
- package/cjs/state/select/is-cell-select-highlight.js.map +1 -1
- package/cjs/state/state.d.ts +2 -2
- package/cjs/state/state.js +12 -10
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.d.ts +0 -2
- package/cjs/themes/theme.js +18 -13
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/helper.js.map +1 -1
- package/cjs/tools/style.d.ts +2 -1
- package/cjs/tools/style.js +9 -3
- package/cjs/tools/style.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +5 -10
- 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/pivot-table/dimension/basic-dimension.d.ts +1 -0
- package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +48 -12
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +4 -1
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js +1 -2
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +3421 -3838
- package/dist/vtable.min.js +2 -2
- package/es/ListTable-all.js +3 -5
- package/es/ListTable-all.js.map +1 -1
- package/es/ListTable.d.ts +0 -5
- package/es/ListTable.js +280 -37
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.d.ts +0 -2
- package/es/PivotTable.js +1 -1
- package/es/PivotTable.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +7 -1
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/react/react-custom-layout.d.ts +3 -1
- package/es/components/react/react-custom-layout.js +7 -3
- package/es/components/react/react-custom-layout.js.map +1 -1
- package/es/core/BaseTable.d.ts +8 -6
- package/es/core/BaseTable.js +98 -20
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/style.js +1 -1
- package/es/core/style.js.map +1 -1
- package/es/core/tableHelper.d.ts +3 -1
- package/es/core/tableHelper.js +21 -9
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +1 -10
- package/es/data/CachedDataSource.js +0 -103
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/dataset/dataset-pivot-table.js +1 -0
- package/es/dataset/dataset-pivot-table.js.map +1 -1
- package/es/dataset/dataset.js +2 -1
- package/es/edit/edit-manager.js +5 -9
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/event.js +4 -6
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +39 -18
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +6 -4
- package/es/event/listener/table-group.js.map +1 -1
- package/es/index.d.ts +3 -3
- 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/pivot-header-layout.js +11 -5
- package/es/layout/pivot-header-layout.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/component/table-component.js +18 -14
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +26 -10
- package/es/scenegraph/graphic/contributions/chart-render-helper.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 +1 -2
- package/es/scenegraph/group-creater/cell-helper.js +8 -23
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +2 -8
- 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/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +1 -1
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +2 -1
- package/es/scenegraph/refresh-node/update-chart.js +14 -1
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -1
- package/es/scenegraph/scenegraph.js +15 -10
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/create-select-border.js +2 -2
- package/es/scenegraph/select/create-select-border.js.map +1 -1
- package/es/scenegraph/utils/cell-border-stroke-width.js +6 -9
- package/es/scenegraph/utils/cell-border-stroke-width.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 +9 -7
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +7 -4
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/cell-move/index.js +14 -11
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/select/is-cell-select-highlight.js +6 -0
- package/es/state/select/is-cell-select-highlight.js.map +1 -1
- package/es/state/state.d.ts +2 -2
- package/es/state/state.js +12 -10
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.d.ts +0 -2
- package/es/themes/theme.js +18 -13
- package/es/themes/theme.js.map +1 -1
- package/es/tools/helper.js.map +1 -1
- package/es/tools/style.d.ts +2 -1
- package/es/tools/style.js +7 -2
- package/es/tools/style.js.map +1 -1
- package/es/ts-types/base-table.d.ts +5 -10
- 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/pivot-table/dimension/basic-dimension.d.ts +1 -0
- package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +48 -12
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +4 -1
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js +2 -3
- package/es/vrender.js.map +1 -1
- package/package.json +3 -3
- 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 -8
- package/cjs/core/record-helper.js +0 -337
- 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/cjs/plugins/list-tree-stick-cell.d.ts +0 -16
- package/cjs/plugins/list-tree-stick-cell.js +0 -171
- package/cjs/plugins/list-tree-stick-cell.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 -8
- package/es/core/record-helper.js +0 -332
- 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/plugins/list-tree-stick-cell.d.ts +0 -16
- package/es/plugins/list-tree-stick-cell.js +0 -169
- package/es/plugins/list-tree-stick-cell.js.map +0 -1
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"),
|
|
7
|
+
const ListTable_1 = require("./ListTable"), components_1 = require("./components"), 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
|
-
|
|
13
|
-
cell_type_1.
|
|
14
|
-
cell_type_1.
|
|
11
|
+
(0, cell_type_1.registerChartCell)(), (0, cell_type_1.registerCheckboxCell)(), (0,
|
|
12
|
+
cell_type_1.registerImageCell)(), (0, cell_type_1.registerProgressBarCell)(), (0,
|
|
13
|
+
cell_type_1.registerRadioCell)(), (0, cell_type_1.registerSparkLineCell)(), (0,
|
|
14
|
+
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,
|
|
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;AAElB,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 {\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();\n\nregisterChartCell();\nregisterCheckboxCell();\nregisterImageCell();\nregisterProgressBarCell();\nregisterRadioCell();\nregisterSparkLineCell();\nregisterTextCell();\nregisterVideoCell();\nexport class ListTableAll extends ListTable {}\n"]}
|
package/cjs/ListTable.d.ts
CHANGED
|
@@ -2,15 +2,11 @@ import type { AggregationType, CellAddress, CellRange, ColumnsDefine, DropDownMe
|
|
|
2
2
|
import { HierarchyState } from './ts-types';
|
|
3
3
|
import { BaseTable } from './core';
|
|
4
4
|
import type { ListTableProtected } from './ts-types/base-table';
|
|
5
|
-
import { EditManeger } from './edit/edit-manager';
|
|
6
5
|
import type { IEditor } from '@visactor/vtable-editors';
|
|
7
|
-
import type { ListTreeStickCellPlugin } from './plugins/list-tree-stick-cell';
|
|
8
6
|
export declare class ListTable extends BaseTable implements ListTableAPI {
|
|
9
7
|
internalProps: ListTableProtected;
|
|
10
8
|
options: ListTableConstructorOptions;
|
|
11
9
|
showHeader: boolean;
|
|
12
|
-
editorManager: EditManeger;
|
|
13
|
-
listTreeStickCellPlugin?: ListTreeStickCellPlugin;
|
|
14
10
|
constructor(options: ListTableConstructorOptions);
|
|
15
11
|
constructor(container: HTMLElement, options: ListTableConstructorOptions);
|
|
16
12
|
isListTable(): true;
|
|
@@ -89,5 +85,4 @@ export declare class ListTable extends BaseTable implements ListTableAPI {
|
|
|
89
85
|
}[];
|
|
90
86
|
}[];
|
|
91
87
|
isAggregation(col: number, row: number): boolean;
|
|
92
|
-
getGroupTitleLevel(col: number, row: number): number | undefined;
|
|
93
88
|
}
|
package/cjs/ListTable.js
CHANGED
|
@@ -29,22 +29,20 @@ 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"), 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");
|
|
33
33
|
|
|
34
34
|
class ListTable extends core_1.BaseTable {
|
|
35
35
|
constructor(container, options) {
|
|
36
|
-
var _a, _b
|
|
36
|
+
var _a, _b;
|
|
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 = options.
|
|
43
|
-
group_helper_1.getGroupByDataConfig)(options.groupBy) : {}, internalProps.columns = options.columns ? (0,
|
|
42
|
+
internalProps.sortState = options.sortState, internalProps.dataConfig = {}, internalProps.columns = options.columns ? (0,
|
|
44
43
|
vutils_extension_1.cloneDeepSpec)(options.columns, [ "children" ]) : options.header ? (0,
|
|
45
|
-
vutils_extension_1.cloneDeepSpec)(options.header, [ "children" ]) : [], internalProps.
|
|
46
|
-
|
|
47
|
-
this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d,
|
|
44
|
+
vutils_extension_1.cloneDeepSpec)(options.header, [ "children" ]) : [], this.internalProps.headerHelper.setTableColumnsEditor(),
|
|
45
|
+
this.showHeader = null === (_a = options.showHeader) || void 0 === _a || _a, this.transpose = null !== (_b = options.transpose) && void 0 !== _b && _b,
|
|
48
46
|
"node" !== env_1.Env.mode && (this.editorManager = new edit_manager_1.EditManeger(this)),
|
|
49
47
|
this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? (0,
|
|
50
48
|
tableHelper_1._setDataSource)(this, options.dataSource) : options.records ? this.setRecords(options.records, {
|
|
@@ -57,10 +55,6 @@ class ListTable extends core_1.BaseTable {
|
|
|
57
55
|
const EmptyTip = factory_1.Factory.getComponent("emptyTip");
|
|
58
56
|
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), this.internalProps.emptyTip.resetVisible();
|
|
59
57
|
}
|
|
60
|
-
if (options.enableTreeStickCell) {
|
|
61
|
-
const ListTreeStickCellPlugin = factory_1.Factory.getComponent("listTreeStickCellPlugin");
|
|
62
|
-
this.listTreeStickCellPlugin = new ListTreeStickCellPlugin(this);
|
|
63
|
-
}
|
|
64
58
|
setTimeout((() => {
|
|
65
59
|
this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
66
60
|
}), 0);
|
|
@@ -231,9 +225,8 @@ class ListTable extends core_1.BaseTable {
|
|
|
231
225
|
const internalProps = this.internalProps;
|
|
232
226
|
if (super.updateOption(options), internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode,
|
|
233
227
|
this.pagination = options.pagination, internalProps.sortState = options.sortState,
|
|
234
|
-
internalProps.dataConfig =
|
|
235
|
-
|
|
236
|
-
vutils_extension_1.cloneDeepSpec)(options.columns, [ "children" ]) : options.header ? (0,
|
|
228
|
+
internalProps.dataConfig = {}, this.showHeader = null === (_a = options.showHeader) || void 0 === _a || _a,
|
|
229
|
+
internalProps.columns = options.columns ? (0, vutils_extension_1.cloneDeepSpec)(options.columns, [ "children" ]) : options.header ? (0,
|
|
237
230
|
vutils_extension_1.cloneDeepSpec)(options.header, [ "children" ]) : [], this.internalProps.headerHelper.setTableColumnsEditor(),
|
|
238
231
|
this.transpose = null !== (_b = options.transpose) && void 0 !== _b && _b, this.refreshHeader(),
|
|
239
232
|
this.internalProps.useOneRowHeightFillAll = !1, internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
@@ -356,9 +349,7 @@ class ListTable extends core_1.BaseTable {
|
|
|
356
349
|
return null;
|
|
357
350
|
}
|
|
358
351
|
getHierarchyState(col, row) {
|
|
359
|
-
if (!this.
|
|
360
|
-
if (!this.getBodyColumnDefine(col, row).tree) return ts_types_1.HierarchyState.none;
|
|
361
|
-
}
|
|
352
|
+
if (!this.getBodyColumnDefine(col, row).tree) return ts_types_1.HierarchyState.none;
|
|
362
353
|
const index = this.getRecordShowIndexByCell(col, row);
|
|
363
354
|
return this.dataSource.getHierarchyState(index);
|
|
364
355
|
}
|
|
@@ -391,7 +382,7 @@ class ListTable extends core_1.BaseTable {
|
|
|
391
382
|
this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions),
|
|
392
383
|
checkHasChart && (this.autoFillWidth && !notFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
|
|
393
384
|
this.autoFillHeight && !notFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight),
|
|
394
|
-
("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.
|
|
385
|
+
("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(0));
|
|
395
386
|
}
|
|
396
387
|
_hasHierarchyTreeHeader() {
|
|
397
388
|
var _a, _b;
|
|
@@ -429,7 +420,7 @@ class ListTable extends core_1.BaseTable {
|
|
|
429
420
|
}
|
|
430
421
|
updateFilterRules(filterRules) {
|
|
431
422
|
this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules),
|
|
432
|
-
(0,
|
|
423
|
+
(0, tableHelper_1.sortRecords)(this)) : this.dataSource.updateFilterRules(filterRules),
|
|
433
424
|
this.refreshRowColCount(), this.scenegraph.createSceneGraph();
|
|
434
425
|
}
|
|
435
426
|
getCheckboxState(field) {
|
|
@@ -486,7 +477,8 @@ class ListTable extends core_1.BaseTable {
|
|
|
486
477
|
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), this.internalProps.emptyTip.resetVisible();
|
|
487
478
|
}
|
|
488
479
|
this.render(), (0, vutils_1.isValid)(oldHoverState.col) && (0, vutils_1.isValid)(oldHoverState.row) && oldHoverState.col >= 0 && oldHoverState.row >= 0 && setTimeout((() => {
|
|
489
|
-
|
|
480
|
+
var _a;
|
|
481
|
+
null === (_a = this.internalProps) || void 0 === _a || _a.tooltipHandler.showTooltip(oldHoverState.col, oldHoverState.row);
|
|
490
482
|
}), 0);
|
|
491
483
|
}
|
|
492
484
|
setRecordChildren(records, col, row) {
|
|
@@ -537,22 +529,282 @@ class ListTable extends core_1.BaseTable {
|
|
|
537
529
|
return (0, vutils_1.isValid)(editorDefine);
|
|
538
530
|
}
|
|
539
531
|
changeCellValue(col, row, value, workOnEditableCell = !1) {
|
|
540
|
-
|
|
532
|
+
if (workOnEditableCell && this.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
|
|
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
561
|
}
|
|
542
562
|
changeCellValues(startCol, startRow, values, workOnEditableCell = !1) {
|
|
543
|
-
|
|
563
|
+
let pasteColEnd = startCol, pasteRowEnd = startRow;
|
|
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
616
|
}
|
|
545
617
|
addRecord(record, recordIndex) {
|
|
546
|
-
(
|
|
618
|
+
if (this.sortState) this.dataSource.addRecordForSorted(record), (0, tableHelper_1.sortRecords)(this),
|
|
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
666
|
}
|
|
548
667
|
addRecords(records, recordIndex) {
|
|
549
|
-
(
|
|
668
|
+
if (this.sortState) this.dataSource.addRecordsForSorted(records), (0, tableHelper_1.sortRecords)(this),
|
|
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
716
|
}
|
|
551
717
|
deleteRecords(recordIndexs) {
|
|
552
|
-
(0
|
|
718
|
+
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (this.sortState) this.dataSource.deleteRecordsForSorted(recordIndexs),
|
|
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
762
|
}
|
|
554
763
|
updateRecords(records, recordIndexs) {
|
|
555
|
-
(0
|
|
764
|
+
if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (this.sortState) this.dataSource.updateRecordsForSorted(records, recordIndexs),
|
|
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
808
|
}
|
|
557
809
|
_hasCustomRenderOrLayout() {
|
|
558
810
|
var _a, _b, _c, _d;
|
|
@@ -588,14 +840,6 @@ class ListTable extends core_1.BaseTable {
|
|
|
588
840
|
isAggregation(col, row) {
|
|
589
841
|
return this.internalProps.layoutMap.isAggregation(col, row);
|
|
590
842
|
}
|
|
591
|
-
getGroupTitleLevel(col, row) {
|
|
592
|
-
var _a;
|
|
593
|
-
if (!this.options.groupBy) return;
|
|
594
|
-
const indexArr = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row)), groupLength = null !== (_a = this.dataSource.getGroupLength()) && void 0 !== _a ? _a : 0;
|
|
595
|
-
let indexArrLngth = (0, vutils_1.isArray)(indexArr) ? indexArr.length - 1 : 0;
|
|
596
|
-
return groupLength > 0 && indexArrLngth === groupLength && (indexArrLngth = void 0),
|
|
597
|
-
indexArrLngth;
|
|
598
|
-
}
|
|
599
843
|
}
|
|
600
844
|
|
|
601
845
|
exports.ListTable = ListTable;
|