@visactor/vtable 0.13.4 → 0.14.0
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/PivotTable.d.ts +2 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/style/CheckboxStyle.d.ts +8 -2
- package/cjs/body-helper/style/CheckboxStyle.js +17 -3
- package/cjs/body-helper/style/CheckboxStyle.js.map +1 -1
- package/cjs/components/axis/get-axis-attributes.d.ts +7 -0
- package/cjs/components/axis/get-axis-attributes.js +13 -17
- package/cjs/components/axis/get-axis-attributes.js.map +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.js +1 -0
- package/cjs/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -0
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/title/title.js +7 -6
- package/cjs/components/title/title.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -0
- package/cjs/core/BaseTable.js +28 -2
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +0 -1
- package/cjs/dataset/dataset.js +3 -43
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/header-helper/header-helper.d.ts +2 -1
- package/cjs/header-helper/style/CheckboxStyle.d.ts +8 -2
- package/cjs/header-helper/style/CheckboxStyle.js +15 -1
- package/cjs/header-helper/style/CheckboxStyle.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/chart-helper/get-axis-config.js +71 -35
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.d.ts +1 -1
- package/cjs/layout/chart-helper/get-axis-domain.js +18 -8
- package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +33 -17
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/chart-helper/zero-align.js.map +1 -0
- package/cjs/layout/pivot-header-layout.js +20 -11
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.js +2 -1
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/render/layout/arc.d.ts +10 -21
- package/cjs/render/layout/arc.js +7 -9
- package/cjs/render/layout/arc.js.map +1 -1
- package/cjs/render/layout/circle.d.ts +10 -17
- package/cjs/render/layout/circle.js +5 -6
- package/cjs/render/layout/circle.js.map +1 -1
- package/cjs/render/layout/container.d.ts +10 -48
- package/cjs/render/layout/container.js +15 -100
- package/cjs/render/layout/container.js.map +1 -1
- package/cjs/render/layout/group-element.d.ts +4 -24
- package/cjs/render/layout/group-element.js +4 -40
- package/cjs/render/layout/group-element.js.map +1 -1
- package/cjs/render/layout/group.d.ts +12 -0
- package/cjs/render/layout/group.js +18 -0
- package/cjs/render/layout/group.js.map +1 -0
- package/cjs/render/layout/icon.d.ts +10 -10
- package/cjs/render/layout/icon.js +11 -9
- package/cjs/render/layout/icon.js.map +1 -1
- package/cjs/render/layout/image.d.ts +10 -17
- package/cjs/render/layout/image.js +6 -7
- package/cjs/render/layout/image.js.map +1 -1
- package/cjs/render/layout/index.d.ts +2 -0
- package/cjs/render/layout/index.js +2 -1
- package/cjs/render/layout/index.js.map +1 -1
- package/cjs/render/layout/percent-calc.d.ts +1 -4
- package/cjs/render/layout/percent-calc.js.map +1 -1
- package/cjs/render/layout/rect.d.ts +10 -20
- package/cjs/render/layout/rect.js +5 -6
- package/cjs/render/layout/rect.js.map +1 -1
- package/cjs/render/layout/tag.d.ts +14 -0
- package/cjs/render/layout/tag.js +21 -0
- package/cjs/render/layout/tag.js.map +1 -0
- package/cjs/render/layout/text.d.ts +9 -46
- package/cjs/render/layout/text.js +8 -18
- package/cjs/render/layout/text.js.map +1 -1
- package/cjs/scenegraph/component/custom.d.ts +2 -2
- package/cjs/scenegraph/component/custom.js +14 -6
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/graphic/group.d.ts +6 -2
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +3 -3
- package/cjs/scenegraph/group-creater/cell-helper.js +40 -40
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +22 -3
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.d.ts +3 -2
- package/cjs/scenegraph/group-creater/column-helper.js +78 -46
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +4 -5
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/icon/icon-update.d.ts +17 -0
- package/cjs/scenegraph/icon/icon-update.js +165 -0
- package/cjs/scenegraph/icon/icon-update.js.map +1 -0
- package/cjs/scenegraph/layout/compute-col-width.js +22 -15
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +49 -15
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/move-cell.js +8 -27
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +39 -29
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +6 -2
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +43 -29
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +7 -13
- package/cjs/scenegraph/scenegraph.js +25 -141
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +77 -38
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/scenegraph/utils/is-merge-cell-group.d.ts +2 -0
- package/cjs/scenegraph/utils/is-merge-cell-group.js +16 -0
- package/cjs/scenegraph/utils/is-merge-cell-group.js.map +1 -0
- package/cjs/scenegraph/utils/text-icon-layout.d.ts +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +11 -5
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/cell-move/index.js +14 -12
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/hover/is-cell-hover.js +4 -2
- package/cjs/state/hover/is-cell-hover.js.map +1 -1
- package/cjs/state/hover/update-cell.js +10 -5
- package/cjs/state/hover/update-cell.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/BRIGHT.js +2 -1
- package/cjs/themes/DARK.js +1 -2
- package/cjs/tools/calc.js +1 -1
- package/cjs/tools/util.js +1 -1
- package/cjs/tools/util.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +9 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/column/style.d.ts +4 -1
- package/cjs/ts-types/column/style.js.map +1 -1
- package/cjs/ts-types/common.d.ts +2 -0
- package/cjs/ts-types/common.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +13 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/dist/vtable.js +22152 -11275
- package/dist/vtable.min.js +2 -2
- package/es/PivotTable.d.ts +2 -1
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/style/CheckboxStyle.d.ts +8 -2
- package/es/body-helper/style/CheckboxStyle.js +17 -3
- package/es/body-helper/style/CheckboxStyle.js.map +1 -1
- package/es/components/axis/get-axis-attributes.d.ts +7 -0
- package/es/components/axis/get-axis-attributes.js +1 -1
- package/es/components/axis/get-axis-attributes.js.map +1 -1
- package/es/components/legend/continue-legend/continue-legend.js +1 -0
- package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +1 -0
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/title/title.js +6 -6
- package/es/components/title/title.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -0
- package/es/core/BaseTable.js +28 -2
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset.d.ts +0 -1
- package/es/dataset/dataset.js +2 -46
- package/es/dataset/dataset.js.map +1 -1
- package/es/header-helper/header-helper.d.ts +2 -1
- package/es/header-helper/style/CheckboxStyle.d.ts +8 -2
- package/es/header-helper/style/CheckboxStyle.js +15 -1
- package/es/header-helper/style/CheckboxStyle.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/chart-helper/get-axis-config.js +72 -33
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-axis-domain.d.ts +1 -1
- package/es/layout/chart-helper/get-axis-domain.js +20 -8
- package/es/layout/chart-helper/get-axis-domain.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +33 -12
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/chart-helper/zero-align.js.map +1 -0
- package/es/layout/pivot-header-layout.js +20 -11
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.js +2 -1
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/render/layout/arc.d.ts +10 -21
- package/es/render/layout/arc.js +7 -7
- package/es/render/layout/arc.js.map +1 -1
- package/es/render/layout/circle.d.ts +10 -17
- package/es/render/layout/circle.js +7 -6
- package/es/render/layout/circle.js.map +1 -1
- package/es/render/layout/container.d.ts +10 -48
- package/es/render/layout/container.js +16 -107
- package/es/render/layout/container.js.map +1 -1
- package/es/render/layout/group-element.d.ts +4 -24
- package/es/render/layout/group-element.js +4 -42
- package/es/render/layout/group-element.js.map +1 -1
- package/es/render/layout/group.d.ts +12 -0
- package/es/render/layout/group.js +12 -0
- package/es/render/layout/group.js.map +1 -0
- package/es/render/layout/icon.d.ts +10 -10
- package/es/render/layout/icon.js +12 -10
- package/es/render/layout/icon.js.map +1 -1
- package/es/render/layout/image.d.ts +10 -17
- package/es/render/layout/image.js +8 -7
- package/es/render/layout/image.js.map +1 -1
- package/es/render/layout/index.d.ts +2 -0
- package/es/render/layout/index.js +4 -0
- package/es/render/layout/index.js.map +1 -1
- package/es/render/layout/percent-calc.d.ts +1 -4
- package/es/render/layout/percent-calc.js.map +1 -1
- package/es/render/layout/rect.d.ts +10 -20
- package/es/render/layout/rect.js +7 -6
- package/es/render/layout/rect.js.map +1 -1
- package/es/render/layout/tag.d.ts +14 -0
- package/es/render/layout/tag.js +15 -0
- package/es/render/layout/tag.js.map +1 -0
- package/es/render/layout/text.d.ts +9 -46
- package/es/render/layout/text.js +10 -18
- package/es/render/layout/text.js.map +1 -1
- package/es/scenegraph/component/custom.d.ts +2 -2
- package/es/scenegraph/component/custom.js +15 -7
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/graphic/group.d.ts +6 -2
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.d.ts +3 -3
- package/es/scenegraph/group-creater/cell-helper.js +41 -40
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +22 -2
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.d.ts +3 -2
- package/es/scenegraph/group-creater/column-helper.js +75 -44
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +3 -4
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +3 -6
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/icon/icon-update.d.ts +17 -0
- package/es/scenegraph/icon/icon-update.js +154 -0
- package/es/scenegraph/icon/icon-update.js.map +1 -0
- package/es/scenegraph/layout/compute-col-width.js +23 -14
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +51 -15
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/move-cell.js +8 -27
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +41 -27
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +6 -1
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +45 -27
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +7 -13
- package/es/scenegraph/scenegraph.js +25 -142
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +75 -38
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/scenegraph/utils/is-merge-cell-group.d.ts +2 -0
- package/es/scenegraph/utils/is-merge-cell-group.js +6 -0
- package/es/scenegraph/utils/is-merge-cell-group.js.map +1 -0
- package/es/scenegraph/utils/text-icon-layout.d.ts +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +11 -5
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/cell-move/index.js +14 -12
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/hover/is-cell-hover.js +3 -1
- package/es/state/hover/is-cell-hover.js.map +1 -1
- package/es/state/hover/update-cell.js +4 -2
- package/es/state/hover/update-cell.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/state/state.js.map +1 -1
- package/es/themes/BRIGHT.js +2 -1
- package/es/themes/DARK.js +1 -2
- package/es/tools/calc.js +1 -1
- package/es/tools/util.js +1 -1
- package/es/tools/util.js.map +1 -1
- package/es/ts-types/base-table.d.ts +9 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/column/style.d.ts +4 -1
- package/es/ts-types/column/style.js.map +1 -1
- package/es/ts-types/common.d.ts +2 -0
- package/es/ts-types/common.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +13 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/package.json +3 -3
- package/cjs/dataset/util/zero-align.js.map +0 -1
- package/cjs/scenegraph/header-icon/layout.d.ts +0 -3
- package/cjs/scenegraph/header-icon/layout.js +0 -75
- package/cjs/scenegraph/header-icon/layout.js.map +0 -1
- package/cjs/scenegraph/hover-state.d.ts +0 -14
- package/cjs/scenegraph/hover-state.js +0 -27
- package/cjs/scenegraph/hover-state.js.map +0 -1
- package/es/dataset/util/zero-align.js.map +0 -1
- package/es/scenegraph/header-icon/layout.d.ts +0 -3
- package/es/scenegraph/header-icon/layout.js +0 -69
- package/es/scenegraph/header-icon/layout.js.map +0 -1
- package/es/scenegraph/hover-state.d.ts +0 -14
- package/es/scenegraph/hover-state.js +0 -19
- package/es/scenegraph/hover-state.js.map +0 -1
- /package/cjs/{dataset/util → layout/chart-helper}/zero-align.d.ts +0 -0
- /package/cjs/{dataset/util → layout/chart-helper}/zero-align.js +0 -0
- /package/es/{dataset/util → layout/chart-helper}/zero-align.d.ts +0 -0
- /package/es/{dataset/util → layout/chart-helper}/zero-align.js +0 -0
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Group } from "../graphic/group";
|
|
2
|
-
|
|
3
1
|
import { getProp, getRawProp } from "../utils/get-prop";
|
|
4
2
|
|
|
5
3
|
import { createCell } from "./cell-helper";
|
|
@@ -10,56 +8,50 @@ import { isPromise } from "../../tools/helper";
|
|
|
10
8
|
|
|
11
9
|
import { dealPromiseData } from "../utils/deal-promise-data";
|
|
12
10
|
|
|
11
|
+
import { isArray } from "@visactor/vutils";
|
|
12
|
+
|
|
13
13
|
export function createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, mergeMap, defaultRowHeight, table, cellLocation, rowLimit) {
|
|
14
|
-
let padding, textAlign, textBaseline,
|
|
14
|
+
let padding, textAlign, textBaseline, y = 0;
|
|
15
15
|
columnGroup.colHeight && (y = columnGroup.colHeight);
|
|
16
16
|
for (let j = rowStart; j <= rowEnd; j++) {
|
|
17
|
-
const row = j, define = "body" !== cellLocation ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row), mayHaveIcon = "body" !== cellLocation || (!!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree))
|
|
17
|
+
const row = j, define = "body" !== cellLocation ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row), mayHaveIcon = "body" !== cellLocation || (!!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree));
|
|
18
|
+
let range, isMerge, customStyle, value = table.getCellValue(col, row), cellWidth = colWidth, cellHeight = table.getRowHeight(row);
|
|
19
|
+
if (table.internalProps.customMergeCell) {
|
|
20
|
+
const customMerge = table.getCustomMerge(col, row);
|
|
21
|
+
if (customMerge) {
|
|
22
|
+
const {range: customMergeRange, text: customMergeText, style: customMergeStyle} = customMerge;
|
|
23
|
+
if (range = customMergeRange, isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row,
|
|
24
|
+
isMerge) {
|
|
25
|
+
const mergeSize = dealMerge(range, mergeMap, table);
|
|
26
|
+
cellWidth = mergeSize.cellWidth, cellHeight = mergeSize.cellHeight;
|
|
27
|
+
}
|
|
28
|
+
value = customMergeText, customStyle = customMergeStyle;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!range && ("body" !== cellLocation || (null == define ? void 0 : define.mergeCell)) && (range = table.getCellRange(col, row),
|
|
32
|
+
isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row,
|
|
33
|
+
isMerge)) {
|
|
34
|
+
const mergeSize = dealMerge(range, mergeMap, table);
|
|
35
|
+
cellWidth = mergeSize.cellWidth, cellHeight = mergeSize.cellHeight;
|
|
36
|
+
}
|
|
37
|
+
const cellStyle = customStyle || table._getCellStyle(col, row), cellTheme = getStyleTheme(cellStyle, table, range ? range.start.col : col, range ? range.start.row : row, getProp).theme;
|
|
18
38
|
cellTheme.group.width = colWidth, cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight,
|
|
19
39
|
cellTheme._vtable.padding && (padding = cellTheme._vtable.padding), cellTheme.text.textAlign && (textAlign = cellTheme.text.textAlign),
|
|
20
40
|
cellTheme.text.textBaseline && (textBaseline = cellTheme.text.textBaseline), "body" === cellLocation || cellTheme.group.fill || (cellTheme.group.fill = "#fff");
|
|
21
|
-
let cellWidth = colWidth, cellHeight = table.getRowHeight(row);
|
|
22
41
|
const type = (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) || "text";
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
for (let col = range.start.col; col <= range.end.col; col++) cellWidth += table.getColWidth(col);
|
|
29
|
-
for (let i = range.start.row; i <= range.end.row; i++) cellHeight += table.getRowHeight(i);
|
|
30
|
-
mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {
|
|
31
|
-
x: 0,
|
|
32
|
-
y: y,
|
|
33
|
-
cellWidth: cellWidth,
|
|
34
|
-
cellHeight: cellHeight
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
if (mergeResult) {
|
|
38
|
-
const height = mergeResult.cellHeight / (range.end.row - range.start.row + 1), cellGroup = new Group({
|
|
39
|
-
x: 0,
|
|
40
|
-
y: y,
|
|
41
|
-
width: 0,
|
|
42
|
-
height: height,
|
|
43
|
-
visible: !1,
|
|
44
|
-
pickable: !1
|
|
45
|
-
});
|
|
46
|
-
cellGroup.role = "shadow-cell", cellGroup.col = col, cellGroup.row = row, cellGroup.mergeCol = range.start.col,
|
|
47
|
-
cellGroup.mergeRow = range.start.row, null == columnGroup || columnGroup.addChild(cellGroup),
|
|
48
|
-
columnGroup.updateColumnRowNumber(row), columnGroup.updateColumnHeight(height),
|
|
49
|
-
range = table.getCellRange(col, row), y += height, maxWidth = Math.max(maxWidth, mergeResult.cellWidth);
|
|
42
|
+
if (isPromise(value)) {
|
|
43
|
+
dealPromiseData(value, table, createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, isMerge, range, cellTheme)),
|
|
44
|
+
columnGroup.updateColumnRowNumber(row);
|
|
45
|
+
const height = isMerge ? table.getRowHeight(row) / (range.end.row - range.start.row + 1) : table.getRowHeight(row);
|
|
46
|
+
columnGroup.updateColumnHeight(height), y += height;
|
|
50
47
|
} else {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} else
|
|
58
|
-
const cellGroup = createCell(type, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, isMerge, range, cellTheme);
|
|
59
|
-
columnGroup.updateColumnRowNumber(row);
|
|
60
|
-
const height = isMerge ? cellGroup.attribute.height / (range.end.row - range.start.row + 1) : cellGroup.attribute.height;
|
|
61
|
-
columnGroup.updateColumnHeight(height), y += height;
|
|
62
|
-
}
|
|
48
|
+
const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme);
|
|
49
|
+
if (columnGroup.updateColumnRowNumber(row), isMerge) {
|
|
50
|
+
const rangeHeight = table.getRowHeight(row), rangeWidth = table.getColWidth(col), {width: contentWidth} = cellGroup.attribute, {height: contentHeight} = cellGroup.attribute;
|
|
51
|
+
cellGroup.contentWidth = contentWidth, cellGroup.contentHeight = contentHeight,
|
|
52
|
+
resizeCellGroup(cellGroup, rangeWidth, rangeHeight, range, table), columnGroup.updateColumnHeight(rangeHeight),
|
|
53
|
+
y += rangeHeight;
|
|
54
|
+
} else columnGroup.updateColumnHeight(cellGroup.attribute.height), y += cellGroup.attribute.height;
|
|
63
55
|
}
|
|
64
56
|
if (rowLimit && row > rowLimit) break;
|
|
65
57
|
}
|
|
@@ -76,4 +68,43 @@ export function getColumnGroupTheme(col, colWidth, table) {
|
|
|
76
68
|
hasFunctionPros: hasFunctionPros
|
|
77
69
|
};
|
|
78
70
|
}
|
|
71
|
+
|
|
72
|
+
export function resizeCellGroup(cellGroup, rangeWidth, rangeHeight, range, table) {
|
|
73
|
+
const {col: col, row: row} = cellGroup, dx = -table.getColsWidth(range.start.col, col - 1), dy = -table.getRowsHeight(range.start.row, row - 1);
|
|
74
|
+
cellGroup.forEachChildren((child => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
child.setAttributes({
|
|
77
|
+
dx: (null !== (_a = child.attribute.dx) && void 0 !== _a ? _a : 0) + dx,
|
|
78
|
+
dy: (null !== (_b = child.attribute.dy) && void 0 !== _b ? _b : 0) + dy
|
|
79
|
+
});
|
|
80
|
+
}));
|
|
81
|
+
const lineWidth = cellGroup.attribute.lineWidth, isLineWidthArray = isArray(lineWidth), newLineWidth = [ 0, 0, 0, 0 ];
|
|
82
|
+
col === range.start.col && (newLineWidth[3] = isLineWidthArray ? lineWidth[3] : lineWidth),
|
|
83
|
+
row === range.start.row && (newLineWidth[0] = isLineWidthArray ? lineWidth[0] : lineWidth),
|
|
84
|
+
col === range.end.col && (newLineWidth[1] = isLineWidthArray ? lineWidth[1] : lineWidth),
|
|
85
|
+
row === range.end.row && (newLineWidth[2] = isLineWidthArray ? lineWidth[2] : lineWidth),
|
|
86
|
+
cellGroup.setAttributes({
|
|
87
|
+
width: rangeWidth,
|
|
88
|
+
height: rangeHeight,
|
|
89
|
+
strokeArrayWidth: newLineWidth
|
|
90
|
+
}), cellGroup.mergeStartCol = range.start.col, cellGroup.mergeStartRow = range.start.row,
|
|
91
|
+
cellGroup.mergeEndCol = range.end.col, cellGroup.mergeEndRow = range.end.row;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function dealMerge(range, mergeMap, table) {
|
|
95
|
+
let cellWidth = 0, cellHeight = 0;
|
|
96
|
+
const mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);
|
|
97
|
+
if (mergeResult) cellWidth = mergeResult.cellWidth, cellHeight = mergeResult.cellHeight; else {
|
|
98
|
+
for (let col = range.start.col; col <= range.end.col; col++) cellWidth += table.getColWidth(col);
|
|
99
|
+
for (let i = range.start.row; i <= range.end.row; i++) cellHeight += table.getRowHeight(i);
|
|
100
|
+
mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {
|
|
101
|
+
cellWidth: cellWidth,
|
|
102
|
+
cellHeight: cellHeight
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
cellWidth: cellWidth,
|
|
107
|
+
cellHeight: cellHeight
|
|
108
|
+
};
|
|
109
|
+
}
|
|
79
110
|
//# sourceMapp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C,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;oBACpE,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;gBAC/B,WAAW,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;gBACvC,CAAC,IAAI,MAAM,CAAC;aACb;SACF;QACD,IAAI,QAAQ,IAAI,GAAG,GAAG,QAAQ,EAAE;YAC9B,MAAM;SACP;KACF;IAED,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC5C,OAAO;QACL,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC;AASD,MAAM,UAAU,mBAAmB,CACjC,GAAW,EACX,QAAgB,EAChB,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACrE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,aAAa,CAC3D,KAAK,EACL,KAAK,EACL,GAAG,EACH,KAAK,CAAC,sBAAsB,EAC5B,UAAU,CACX,CAAC;IAGF,WAAW,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAC;IACnC,WAAW,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AACjD,CAAC","file":"column-helper.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IThemeSpec } from '@visactor/vrender';\nimport type {\n CellLocation,\n FullExtendStyle,\n ICustomLayout,\n ICustomRender,\n MappingRule,\n TextColumnDefine\n} from '../../ts-types';\nimport { Group } from '../graphic/group';\nimport { getProp, getRawProp } from '../utils/get-prop';\nimport type { MergeMap } from '../scenegraph';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { createCell } from './cell-helper';\nimport type { BaseTableAPI, PivotTableProtected } from '../../ts-types/base-table';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\n/**\n * 创建复合列 同一列支持创建不同类型单元格\n * @param columnGroup 列Group\n * @param col\n * @param colWidth 配置列宽\n * @param rowStart\n * @param rowEnd\n * @param mergeMap merge单元格信息\n * @param defaultRowHeight\n * @param table\n * @param cellLocation\n * @param rowLimit\n * @param customRender\n * @param customLayout\n * @returns\n */\nexport function createComplexColumn(\n columnGroup: Group,\n col: number,\n colWidth: number,\n rowStart: number,\n rowEnd: number,\n mergeMap: MergeMap,\n defaultRowHeight: number | number[],\n table: BaseTableAPI,\n cellLocation: CellLocation,\n rowLimit?: number\n) {\n let maxWidth = 0;\n let padding;\n let textAlign;\n let textBaseline;\n /** useColumnTheme 判断是否可以使用columnTheme */\n // insert cell into column group top\n let y = 0;\n if (columnGroup.colHeight) {\n // insert cell into column group bottom\n y = columnGroup.colHeight;\n }\n\n for (let j = rowStart; j <= rowEnd; j++) {\n const row = j;\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n const headerStyle = table._getCellStyle(col, row);\n const cellTheme = getStyleTheme(headerStyle, table, col, row, getProp).theme;\n cellTheme.group.width = colWidth;\n cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight;\n if (cellTheme._vtable.padding) {\n padding = cellTheme._vtable.padding;\n }\n if (cellTheme.text.textAlign) {\n textAlign = cellTheme.text.textAlign;\n }\n if (cellTheme.text.textBaseline) {\n textBaseline = cellTheme.text.textBaseline;\n }\n\n // enable clip body\n if (cellLocation !== 'body' && !cellTheme.group.fill) {\n cellTheme.group.fill = '#fff';\n }\n // margin = getProp('margin', headerStyle, col, 0, table)\n\n let cellWidth = colWidth;\n // let cellHeight = table.internalProps.autoRowHeight ? 0 : table.getRowHeight(row);\n let cellHeight = table.getRowHeight(row);\n const type =\n (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||\n 'text';\n // 处理单元格合并\n let mergeResult;\n let range;\n let isMerge;\n if (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n // 所有Merge单元格,只保留左上角一个真实的单元格,其他使用空Group占位\n if (isMerge) {\n cellWidth = 0;\n cellHeight = 0;\n mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);\n if (!mergeResult) {\n for (let col = range.start.col; col <= range.end.col; col++) {\n cellWidth += table.getColWidth(col);\n }\n\n // let cellHeight = 0;\n for (let i = range.start.row; i <= range.end.row; i++) {\n cellHeight += table.getRowHeight(i);\n }\n\n mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {\n x: 0,\n y,\n cellWidth,\n cellHeight\n });\n }\n }\n }\n\n // let cellWidth = 0;\n // let cellHeight = 0;\n if (mergeResult) {\n const height = mergeResult.cellHeight / (range.end.row - range.start.row + 1);\n // 已有Merge单元格,使用空Group占位\n const cellGroup = new Group({\n x: 0,\n y,\n width: 0,\n height,\n visible: false,\n pickable: false\n });\n cellGroup.role = 'shadow-cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.mergeCol = range.start.col;\n cellGroup.mergeRow = range.start.row;\n columnGroup?.addChild(cellGroup);\n columnGroup.updateColumnRowNumber(row);\n columnGroup.updateColumnHeight(height);\n range = table.getCellRange(col, row);\n y += height;\n maxWidth = Math.max(maxWidth, mergeResult.cellWidth);\n } else {\n // deal with promise data\n const value = table.getCellValue(col, row);\n if (isPromise(value)) {\n dealPromiseData(\n value,\n table,\n createCell.bind(\n null,\n type,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isMerge,\n range,\n cellTheme\n )\n );\n columnGroup.updateColumnRowNumber(row);\n // const height = table.getRowHeight(row);\n const height = isMerge\n ? table.getRowHeight(row) / (range.end.row - range.start.row + 1)\n : table.getRowHeight(row);\n columnGroup.updateColumnHeight(height);\n y += height;\n } else {\n const cellGroup = createCell(\n type,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isMerge,\n range,\n cellTheme\n );\n columnGroup.updateColumnRowNumber(row);\n // const height = cellGroup.attribute.height;\n const height = isMerge\n ? cellGroup.attribute.height / (range.end.row - range.start.row + 1)\n : cellGroup.attribute.height;\n columnGroup.updateColumnHeight(height);\n y += height;\n }\n }\n if (rowLimit && row > rowLimit) {\n break;\n }\n }\n\n columnGroup.setAttribute('width', colWidth);\n return {\n width: colWidth,\n height: y\n };\n}\n\n/**\n * 获取列分组主题\n * @param col 列索引\n * @param colWidth 列宽\n * @param table 表格实例\n * @returns 列分组主题\n */\nexport function getColumnGroupTheme(\n col: number,\n colWidth: number,\n table: BaseTableAPI\n): { theme: IThemeSpec & { _vtable: any }; hasFunctionPros: boolean } {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { theme: columnTheme, hasFunctionPros } = getStyleTheme(\n style,\n table,\n col,\n table.columnHeaderLevelCount,\n getRawProp\n );\n\n // get column header style\n columnTheme.group.width = colWidth;\n columnTheme.group.height = 0;\n return { theme: columnTheme, hasFunctionPros };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/column-helper.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,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CAAC,GAAG,EAAE,CAAC,CAAC;IAC5G,IAAI,CAAC,WAAW,EAAE;QAChB,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC3D,SAAS,IAAI,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;SACrC;QAGD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YACrD,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;SACrC;QAED,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE;YACtF,SAAS;YACT,UAAU;SACX,CAAC,CAAC;KACJ;SAAM;QACL,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;QAClC,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;KACrC;IACD,OAAO;QACL,SAAS;QACT,UAAU;KACX,CAAC;AACJ,CAAC","file":"column-helper.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IGraphic, IThemeSpec } from '@visactor/vrender';\nimport type { CellLocation, CellRange, TextColumnDefine } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { getProp, getRawProp } from '../utils/get-prop';\nimport type { MergeMap } from '../scenegraph';\nimport { createCell } from './cell-helper';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { isArray } from '@visactor/vutils';\n/**\n * 创建复合列 同一列支持创建不同类型单元格\n * @param columnGroup 列Group\n * @param col\n * @param colWidth 配置列宽\n * @param rowStart\n * @param rowEnd\n * @param mergeMap merge单元格信息\n * @param defaultRowHeight\n * @param table\n * @param cellLocation\n * @param rowLimit\n * @param customRender\n * @param customLayout\n * @returns\n */\nexport function createComplexColumn(\n columnGroup: Group,\n col: number,\n colWidth: number,\n rowStart: number,\n rowEnd: number,\n mergeMap: MergeMap,\n defaultRowHeight: number | number[],\n table: BaseTableAPI,\n cellLocation: CellLocation,\n rowLimit?: number\n) {\n let padding;\n let textAlign;\n let textBaseline;\n /** useColumnTheme 判断是否可以使用columnTheme */\n // insert cell into column group top\n let y = 0;\n if (columnGroup.colHeight) {\n // insert cell into column group bottom\n y = columnGroup.colHeight;\n }\n\n for (let j = rowStart; j <= rowEnd; j++) {\n const row = j;\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n let value = table.getCellValue(col, row);\n\n // 处理单元格合并\n let cellWidth = colWidth;\n // let cellHeight = table.internalProps.autoRowHeight ? 0 : table.getRowHeight(row);\n let cellHeight = table.getRowHeight(row);\n let range;\n let isMerge;\n let customStyle;\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;\n range = customMergeRange;\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n value = customMergeText;\n customStyle = customMergeStyle;\n }\n }\n if (!range && (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell)) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n // 所有Merge单元格,只保留左上角一个真实的单元格,其他使用空Group占位\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n }\n\n const cellStyle = customStyle || table._getCellStyle(col, row);\n const cellTheme = getStyleTheme(\n cellStyle,\n table,\n range ? range.start.col : col,\n range ? range.start.row : row,\n getProp\n ).theme;\n cellTheme.group.width = colWidth;\n cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight;\n if (cellTheme._vtable.padding) {\n padding = cellTheme._vtable.padding;\n }\n if (cellTheme.text.textAlign) {\n textAlign = cellTheme.text.textAlign;\n }\n if (cellTheme.text.textBaseline) {\n textBaseline = cellTheme.text.textBaseline;\n }\n\n // enable clip body\n if (cellLocation !== 'body' && !cellTheme.group.fill) {\n cellTheme.group.fill = '#fff';\n }\n // margin = getProp('margin', headerStyle, col, 0, table)\n\n const type =\n (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||\n 'text';\n\n // deal with promise data\n if (isPromise(value)) {\n dealPromiseData(\n value,\n table,\n createCell.bind(\n null,\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isMerge,\n range,\n cellTheme\n )\n );\n columnGroup.updateColumnRowNumber(row);\n // const height = table.getRowHeight(row);\n const height = isMerge\n ? table.getRowHeight(row) / (range.end.row - range.start.row + 1)\n : table.getRowHeight(row);\n columnGroup.updateColumnHeight(height);\n y += height;\n } else {\n const cellGroup = createCell(\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n );\n columnGroup.updateColumnRowNumber(row);\n // // const height = cellGroup.attribute.height;\n // const height = isMerge\n // ? cellGroup.attribute.height / (range.end.row - range.start.row + 1)\n // : cellGroup.attribute.height;\n // columnGroup.updateColumnHeight(height);\n // y += height;\n if (isMerge) {\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n const { width: contentWidth } = cellGroup.attribute;\n const { height: contentHeight } = cellGroup.attribute;\n cellGroup.contentWidth = contentWidth;\n cellGroup.contentHeight = contentHeight;\n\n resizeCellGroup(cellGroup, rangeWidth, rangeHeight, range, table);\n columnGroup.updateColumnHeight(rangeHeight);\n y += rangeHeight;\n } else {\n columnGroup.updateColumnHeight(cellGroup.attribute.height);\n y += cellGroup.attribute.height;\n }\n }\n if (rowLimit && row > rowLimit) {\n break;\n }\n }\n\n columnGroup.setAttribute('width', colWidth);\n return {\n width: colWidth,\n height: y\n };\n}\n\n/**\n * 获取列分组主题\n * @param col 列索引\n * @param colWidth 列宽\n * @param table 表格实例\n * @returns 列分组主题\n */\nexport function getColumnGroupTheme(\n col: number,\n colWidth: number,\n table: BaseTableAPI\n): { theme: IThemeSpec & { _vtable: any }; hasFunctionPros: boolean } {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { theme: columnTheme, hasFunctionPros } = getStyleTheme(\n style,\n table,\n col,\n table.columnHeaderLevelCount,\n getRawProp\n );\n\n // get column header style\n columnTheme.group.width = colWidth;\n columnTheme.group.height = 0;\n return { theme: columnTheme, hasFunctionPros };\n}\n\nexport function resizeCellGroup(\n cellGroup: Group,\n rangeWidth: number,\n rangeHeight: number,\n range: CellRange,\n table: BaseTableAPI\n) {\n const { col, row } = cellGroup;\n const dx = -table.getColsWidth(range.start.col, col - 1);\n const dy = -table.getRowsHeight(range.start.row, row - 1);\n\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: (child.attribute.dx ?? 0) + dx,\n dy: (child.attribute.dy ?? 0) + dy\n });\n });\n\n const lineWidth = cellGroup.attribute.lineWidth;\n const isLineWidthArray = isArray(lineWidth);\n const newLineWidth = [0, 0, 0, 0];\n\n if (col === range.start.col) {\n newLineWidth[3] = isLineWidthArray ? lineWidth[3] : lineWidth;\n }\n if (row === range.start.row) {\n newLineWidth[0] = isLineWidthArray ? lineWidth[0] : lineWidth;\n }\n if (col === range.end.col) {\n newLineWidth[1] = isLineWidthArray ? lineWidth[1] : lineWidth;\n }\n if (row === range.end.row) {\n newLineWidth[2] = isLineWidthArray ? lineWidth[2] : lineWidth;\n }\n\n cellGroup.setAttributes({\n width: rangeWidth,\n height: rangeHeight,\n strokeArrayWidth: newLineWidth\n } as any);\n\n cellGroup.mergeStartCol = range.start.col;\n cellGroup.mergeStartRow = range.start.row;\n cellGroup.mergeEndCol = range.end.col;\n cellGroup.mergeEndRow = range.end.row;\n}\n\nfunction dealMerge(range: CellRange, mergeMap: MergeMap, table: BaseTableAPI) {\n let cellWidth = 0;\n let cellHeight = 0;\n const mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);\n if (!mergeResult) {\n for (let col = range.start.col; col <= range.end.col; col++) {\n cellWidth += table.getColWidth(col);\n }\n\n // let cellHeight = 0;\n for (let i = range.start.row; i <= range.end.row; i++) {\n cellHeight += table.getRowHeight(i);\n }\n\n mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {\n cellWidth,\n cellHeight\n });\n } else {\n cellWidth = mergeResult.cellWidth;\n cellHeight = mergeResult.cellHeight;\n }\n return {\n cellWidth,\n cellHeight\n };\n}\n"]}
|
|
@@ -150,7 +150,7 @@ export class SceneProxy {
|
|
|
150
150
|
computeColsWidth(this.table, this.currentCol + 1, endCol);
|
|
151
151
|
for (let row = 0; row < this.table.rowCount; row++) {
|
|
152
152
|
const cellGroup = this.highPerformanceGetCell(this.currentCol, row);
|
|
153
|
-
isNumber(cellGroup.
|
|
153
|
+
isNumber(cellGroup.mergeStartCol) && cellGroup.mergeStartCol > this.currentCol && this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);
|
|
154
154
|
}
|
|
155
155
|
if (this.table.columnHeaderLevelCount) {
|
|
156
156
|
const lastColumnGroup = this.table.scenegraph.colHeaderGroup.lastChild instanceof Group ? this.table.scenegraph.colHeaderGroup.lastChild : this.table.scenegraph.colHeaderGroup.lastChild._prev, xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width, yOrigin = lastColumnGroup.attribute.y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/progress/proxy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,OAAO,UAAU;IA8CrB,YAAY,KAAmB;QA5C/B,cAAS,GAAY,KAAK,CAAC;QAC3B,SAAI,GAA+B,QAAQ,CAAC;QAG5C,aAAQ,GAAG,GAAG,CAAC;QACf,eAAU,GAAG,CAAC,CAAC;QAIf,aAAQ,GAAG,CAAC,CAAC;QACb,WAAM,GAAG,CAAC,CAAC;QACX,iBAAY,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AAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC","file":"proxy.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { Group } from '../../graphic/group';\nimport { computeColsWidth } from '../../layout/compute-col-width';\nimport { computeRowsHeight } from '../../layout/compute-row-height';\nimport { emptyGroup } from '../../utils/empty-group';\nimport { createColGroup } from '../column';\nimport { createComplexColumn } from '../column-helper';\nimport { createGroupForFirstScreen } from './create-group-for-first-screen';\nimport { dynamicSetX, updateColContent } from './update-position/dynamic-set-x';\nimport { dynamicSetY, updateRowContent } from './update-position/dynamic-set-y';\nimport { updateAutoRow } from './update-position/update-auto-row';\nimport { sortVertical } from './update-position/sort-vertical';\nimport { sortHorizontal } from './update-position/sort-horizontal';\n\nexport class SceneProxy {\n table: BaseTableAPI;\n isRelease: boolean = false;\n mode: 'column' | 'row' | 'pivot' = 'column';\n isProgressing: boolean;\n\n rowLimit = 200;\n currentRow = 0; // 目前渐进生成的row number\n totalRow: number; // 渐进完成最后一行的row number\n yLimitTop: number; // y > yLimitTop动态更新,否则直接修改xy\n yLimitBottom: number; // y < yLimitBottom动态更新,否则直接修改xy\n rowStart = 0; // 当前维护的部分第一行的row number\n rowEnd = 0; // 当前维护的部分最后一行的row number\n referenceRow = 0; // 当前维护的部分中间一行的row number,认为referenceRow对应当前屏幕显示范围的第一行\n bodyTopRow: number; // table body部分的第一行row number\n bodyBottomRow: number; // table body部分的最后一行row number\n screenRowCount: number; // 预计屏幕范围内显示的row count\n firstScreenRowLimit: number; // 首屏同步加载部分最后一行的row number\n taskRowCount: number; // 一次任务生成/更新的row count\n rowUpdatePos: number; // 异步任务目前更新到的行的row number\n rowUpdateDirection: 'up' | 'down'; // 当前行更新的方向\n screenTopRow: number = 0; // 当前屏幕范围内显示的第一行的row number\n totalActualBodyRowCount: number; // 实际表格body部分的行数\n deltaY: number = 0;\n\n colLimit = 100;\n // bodyLeftCol: number; // table body部分的第一列col number\n bodyRightCol: number; // table body部分的最后一列col number\n totalCol: number; // 渐进完成最后一列的col number\n colStart: number; // 当前维护的部分第一列的col number\n colEnd: number; // 当前维护的部分最后一列的col number\n taskColCount: number; // 一次任务生成/更新的col count\n xLimitLeft: number; // x > xLimitLeft动态更新,否则直接修改xy\n xLimitRight: number; // x < xLimitRight动态更新,否则直接修改xy\n screenColCount: number; // 预计屏幕范围内显示的col count\n firstScreenColLimit: number; // 首屏同步加载部分最后一列的col number\n colUpdatePos: number; // 异步任务目前更新到的列的col number\n currentCol: number; // 目前渐进生成的col number\n referenceCol: number; // 当前维护的部分中间一列的col number,认为referenceCol对应当前屏幕显示范围的第一列\n screenLeftCol: number = 0; // 当前屏幕范围内显示的第一列的col number\n colUpdateDirection: 'left' | 'right'; // 当前列更新方向\n totalActualBodyColCount: number; // 实际表格body部分的列数\n deltaX: number = 0;\n\n cellCache: Map<number, Group> = new Map(); // 单元格位置快速查找缓存\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n\n if (this.table.isPivotChart()) {\n this.rowLimit = 100;\n this.colLimit = 100;\n } else if (this.table.heightMode === 'autoHeight') {\n this.rowLimit = 100;\n } else if (this.table.widthMode === 'autoWidth') {\n this.colLimit = 100;\n }\n\n if (this.table.internalProps.transpose) {\n this.mode = 'row';\n } else if (this.table.isPivotTable()) {\n this.mode = 'pivot';\n }\n if (this.table.options.maintainedDataCount) {\n this.rowLimit = this.table.options.maintainedDataCount;\n }\n }\n\n get bodyLeftCol(): number {\n return this.table.frozenColCount;\n }\n\n setParamsForColumn() {\n // this.bodyLeftCol = this.table.frozenColCount;\n this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;\n\n // compute the column info about progress creation\n const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);\n this.totalActualBodyColCount = totalActualBodyColCount;\n this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1; // 目标渐进完成的col\n this.colStart = this.bodyLeftCol;\n const defaultColWidth = this.table.defaultColWidth;\n this.taskColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth) * 1;\n\n // 确定动态更新限制\n const totalBodyWidth = defaultColWidth * totalActualBodyColCount;\n const totalWidth = defaultColWidth * (this.bodyRightCol - this.bodyLeftCol + 1);\n this.xLimitLeft = totalBodyWidth / 2;\n this.xLimitRight = totalWidth - totalBodyWidth / 2;\n\n // 确定首屏高度范围\n const widthLimit = this.table.tableNoFrameWidth * 5;\n this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);\n this.firstScreenColLimit = this.bodyLeftCol + Math.min(this.colLimit, Math.ceil(widthLimit / defaultColWidth));\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.colUpdatePos = this.bodyRightCol;\n }\n\n setParamsForRow() {\n this.bodyTopRow = this.table.columnHeaderLevelCount;\n this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;\n // this.bodyLeftCol = 0;\n // this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;\n\n // 计算渐进加载数量\n const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1); // 渐进加载总row数量\n this.totalActualBodyRowCount = totalActualBodyRowCount;\n this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1; // 目标渐进完成的row\n this.rowStart = this.bodyTopRow;\n const defaultRowHeight = this.table.defaultRowHeight;\n this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 1;\n\n // 确定动态更新限制\n const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount;\n const totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);\n this.yLimitTop = totalBodyHeight / 2;\n this.yLimitBottom = totalHeight - totalBodyHeight / 2;\n // this.bottomOffset = totalHeight - totalBodyHeight / 2;\n\n // 确定首屏高度范围\n const heightLimit = this.table.tableNoFrameHeight * 5;\n this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);\n this.firstScreenRowLimit = this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight));\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.rowUpdatePos = this.bodyBottomRow;\n }\n\n async createGroupForFirstScreen(\n cornerHeaderGroup: Group,\n colHeaderGroup: Group,\n rowHeaderGroup: Group,\n rightFrozenGroup: Group,\n bottomFrozenGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number\n ) {\n await createGroupForFirstScreen(\n cornerHeaderGroup,\n colHeaderGroup,\n rowHeaderGroup,\n rightFrozenGroup,\n bottomFrozenGroup,\n bodyGroup,\n xOrigin,\n yOrigin,\n this\n );\n }\n // async progress() {\n // if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // // 先更新\n // await this.updateCellGroupsAsync();\n // await this.progress();\n // } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // // 先更新没有需要更新的节点,在生成新节点\n // await this.createRow();\n // await this.progress();\n // }\n // }\n async progress() {\n if (this.isProgressing) {\n return;\n }\n this.isProgressing = true;\n return new Promise<void>((resolve, reject) => {\n setTimeout(async () => {\n this.isProgressing = false;\n if (this.isRelease) {\n return;\n }\n // console.log('progress col', this.colUpdatePos, this.colEnd, this.currentCol, this.totalCol);\n // console.log('progress row', this.rowUpdatePos, this.rowEnd, this.currentRow, this.totalRow);\n // console.log('before: createRow', table.scenegraph.bodyGroup.lastChild.attribute);\n // if (this.isSkipProgress) {\n // await this.progress();\n // } else\n if (this.colUpdatePos <= this.colEnd) {\n await this.updateColCellGroupsAsync();\n await this.progress();\n } else if (this.rowUpdatePos <= this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // 先更新\n await this.updateRowCellGroupsAsync();\n await this.progress();\n } else if (this.currentCol < this.totalCol) {\n await this.createCol();\n await this.progress();\n } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // 先更新没有需要更新的节点,在生成新节点\n await this.createRow();\n await this.progress();\n }\n resolve();\n }, 16);\n });\n }\n\n async createRow() {\n if (!this.taskRowCount) {\n return;\n }\n // console.log('createRow', this.currentRow, this.currentRow + this.taskRowCount);\n this.createRowCellGroup(this.taskRowCount);\n }\n\n async createCol() {\n if (!this.taskColCount) {\n return;\n }\n // console.log('createCol', this.currentCol, this.currentCol + this.taskColCount);\n this.createColGroup(this.taskRowCount);\n }\n\n createRowCellGroup(onceCount: number) {\n const endRow = Math.min(this.totalRow, this.currentRow + onceCount);\n // compute rows height\n computeRowsHeight(this.table, this.currentRow + 1, endRow, false);\n\n if (this.table.frozenColCount) {\n // create row header row cellGroup\n let maxHeight = 0;\n for (let col = 0; col < this.table.frozenColCount; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n this.table.scenegraph.rowHeaderGroup.setAttribute('height', maxHeight);\n }\n }\n\n if (this.table.rightFrozenColCount) {\n // create row header row cellGroup\n let maxHeight = 0;\n for (let col = this.table.colCount - this.table.rightFrozenColCount; col < this.table.colCount; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n this.table.scenegraph.rightFrozenGroup.setAttribute('height', maxHeight);\n }\n }\n\n // create body row cellGroup\n let maxHeight = 0;\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n const cellLocation = 'body';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n }\n this.table.scenegraph.bodyGroup.setAttribute('height', maxHeight);\n\n this.currentRow = endRow;\n this.rowEnd = endRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = this.rowStart + Math.floor((endRow - this.rowStart) / 2);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n createColGroup(onceCount: number) {\n // compute rows height\n const endCol = Math.min(this.totalCol, this.currentCol + onceCount);\n computeColsWidth(this.table, this.currentCol + 1, endCol);\n\n // update last merge cell\n for (let row = 0; row < this.table.rowCount; row++) {\n const cellGroup = this.highPerformanceGetCell(this.currentCol, row);\n if (isNumber(cellGroup.mergeCol) && cellGroup.mergeCol > this.currentCol) {\n this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n }\n }\n\n // create column\n if (this.table.columnHeaderLevelCount) {\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.colHeaderGroup.lastChild instanceof Group\n ? this.table.scenegraph.colHeaderGroup.lastChild\n : this.table.scenegraph.colHeaderGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create colHeaderGroup\n createColGroup(\n this.table.scenegraph.colHeaderGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n 0, // rowStart\n this.table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n this.table\n );\n }\n if (this.table.bottomFrozenRowCount) {\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.bottomFrozenGroup.lastChild instanceof Group\n ? this.table.scenegraph.bottomFrozenGroup.lastChild\n : this.table.scenegraph.bottomFrozenGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create bottomFrozenGroup\n createColGroup(\n this.table.scenegraph.bottomFrozenGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n this.table.rowCount - this.table.bottomFrozenRowCount, // rowStart\n this.table.rowCount - 1, // rowEnd\n 'columnHeader', // isHeader\n this.table\n );\n }\n // create colGroup\n let lastColumnGroup =\n this.table.scenegraph.bodyGroup.lastChild &&\n ((this.table.scenegraph.bodyGroup.lastChild instanceof Group\n ? this.table.scenegraph.bodyGroup.lastChild\n : this.table.scenegraph.bodyGroup.lastChild._prev) as Group);\n if (!lastColumnGroup) {\n lastColumnGroup =\n this.table.scenegraph.colHeaderGroup.lastChild &&\n ((this.table.scenegraph.colHeaderGroup.lastChild instanceof Group\n ? this.table.scenegraph.colHeaderGroup.lastChild\n : this.table.scenegraph.colHeaderGroup.lastChild._prev) as Group);\n }\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create bodyGroup\n createColGroup(\n this.table.scenegraph.bodyGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n this.rowStart, // rowStart\n this.rowEnd, // rowEnd\n 'body', // isHeader\n this.table\n );\n\n this.currentCol = endCol;\n this.colEnd = endCol;\n this.colUpdatePos = this.colEnd;\n this.referenceCol = this.colStart + Math.floor((endCol - this.colStart) / 2);\n console.log('async', this.referenceCol, this.colStart, this.colEnd);\n\n // update container group size and border\n // this.table.scenegraph.updateContainerAttrWidthAndX();\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n async setY(y: number) {\n const yLimitTop = this.table.getRowsHeight(this.bodyTopRow, this.bodyTopRow + this.totalActualBodyRowCount) / 2;\n const yLimitBottom = this.table.getAllRowsHeight() - yLimitTop;\n if (y < yLimitTop && this.rowStart === this.bodyTopRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else if (y > yLimitBottom && this.rowEnd === this.bodyBottomRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else {\n // 执行动态更新节点\n this.dynamicSetY(y);\n }\n }\n\n async setX(x: number) {\n const xLimitLeft = this.table.getColsWidth(this.bodyLeftCol, this.bodyLeftCol + this.totalActualBodyColCount) / 2;\n const xLimitRight = this.table.getAllColsWidth() - xLimitLeft;\n if (x < xLimitLeft && this.colStart === this.bodyLeftCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else if (x > xLimitRight && this.colEnd === this.bodyRightCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else {\n // 执行动态更新节点\n this.dynamicSetX(x);\n }\n }\n\n async dynamicSetY(y: number) {\n dynamicSetY(y, this);\n }\n async dynamicSetX(x: number) {\n dynamicSetX(x, this);\n }\n\n updateBody(y: number) {\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n }\n\n async updateRowCellGroupsAsync() {\n this.updateCellGroups(this.taskRowCount);\n }\n\n updateCellGroups(count: number) {\n const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);\n // console.log('updateCellGroups', this.rowUpdatePos, distRow);\n if (this.table.heightMode === 'autoHeight') {\n computeRowsHeight(this.table, this.rowUpdatePos, distRow, false);\n }\n\n updateRowContent(this.rowUpdatePos, distRow, this);\n\n if (this.table.heightMode === 'autoHeight') {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.rowUpdatePos, // rowStart\n distRow, // rowEnd\n this.table,\n this.rowUpdateDirection\n );\n }\n\n this.rowUpdatePos = distRow + 1;\n }\n\n async updateColCellGroupsAsync() {\n this.updateColGroups(this.taskRowCount);\n }\n\n updateColGroups(count: number) {\n const distCol = Math.min(this.bodyRightCol, this.colUpdatePos + count);\n // console.log('updateCellGroups', this.colUpdatePos, distCol);\n // for (let col = this.colUpdatePos; col <= distCol; col++) {\n // const colGroup = this.table.scenegraph.getColGroup(col);\n // if (colGroup) {\n // // colGroup.forEachChildren((cellGroup: Group) => {\n // // this.updateCellGroupContent(cellGroup);\n // // });\n // // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // // const cellGroup = this.highPerformanceGetCell(colGroup.col, row);\n // // this.updateCellGroupContent(cellGroup);\n // // }\n // let cellGroup = colGroup.firstChild;\n // while (cellGroup) {\n // // this.updateCellGroupContent(cellGroup as Group);\n // // cellGroup = cellGroup._next;\n // const newCellGroup = this.updateCellGroupContent(cellGroup as Group);\n // cellGroup = newCellGroup._next;\n // }\n // colGroup.needUpdate = false;\n // }\n // }\n computeColsWidth(this.table, this.colUpdatePos, distCol);\n updateColContent(this.colUpdatePos, distCol, this);\n this.colUpdatePos = distCol + 1;\n }\n\n updateCellGroupPosition(cellGroup: Group, newRow: number, y: number) {\n // 更新位置&row\n cellGroup.row = newRow;\n cellGroup.setAttribute('y', y);\n (cellGroup as any).needUpdate = true;\n (cellGroup as any).needUpdateForAutoRowHeight = true;\n }\n\n updateCellGroupContent(cellGroup: Group) {\n if (!cellGroup.needUpdate) {\n return cellGroup;\n }\n\n const newCellGroup = this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n // 更新内容\n // const textMark = cellGroup.firstChild as WrapText;\n // const autoWrapText = Array.isArray(textMark.attribute.text);\n // const textStr: string = this.table.getCellValue(cellGroup.col, cellGroup.row);\n // let text;\n // if (autoWrapText) {\n // text = String(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n // } else {\n // text = textStr;\n // }\n\n // textMark.setAttribute('text', text);\n\n cellGroup.needUpdate = false;\n return newCellGroup || cellGroup;\n }\n\n async sortCellVertical() {\n await sortVertical(this);\n }\n\n async sortCellHorizontal() {\n await sortHorizontal(this);\n }\n\n highPerformanceGetCell(\n col: number,\n row: number,\n // rowStart: number = this.rowStart,\n // rowEnd: number = this.rowEnd,\n getShadow?: boolean\n ) {\n // if (row < rowStart || row > rowEnd) {\n // return emptyGroup;\n // }\n // if (row < this.rowStart || row > this.rowEnd || col < this.colStart || col > this.colEnd) {\n // return emptyGroup;\n // }\n\n if (\n row >= this.table.columnHeaderLevelCount && // not column header\n row < this.table.rowCount - this.table.bottomFrozenRowCount && // not bottom frozen\n (row < this.rowStart || row > this.rowEnd) // not in proxy row range\n ) {\n return emptyGroup;\n }\n\n if (\n col >= this.table.frozenColCount && // not row header\n col < this.table.colCount - this.table.rightFrozenColCount && // not right frozen\n (col < this.colStart || col > this.colEnd) // not in proxy col range\n ) {\n return emptyGroup;\n }\n\n if (this.cellCache.get(col)) {\n const cacheCellGoup = this.cellCache.get(col);\n if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {\n // 由缓存单元格向前后查找要快于从头查找\n let cellGroup = getCellByCache(cacheCellGoup, row);\n if (!cellGroup || (!getShadow && cellGroup.role === 'shadow-cell')) {\n cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n }\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n // cellGroup.row && this.cellCache.set(col, cellGroup);\n if (cellGroup.col === col && cellGroup.row) {\n this.cellCache.set(col, cellGroup);\n }\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n // cellGroup.row && this.cellCache.set(col, cellGroup);\n if (cellGroup.col === col && cellGroup.row) {\n this.cellCache.set(col, cellGroup);\n }\n return cellGroup;\n }\n\n release() {\n this.isRelease = true;\n }\n}\n\nfunction getCellByCache(cacheCellGroup: Group, row: number): Group | null {\n if (!cacheCellGroup) {\n return null;\n }\n if (cacheCellGroup.row === row) {\n return cacheCellGroup;\n } else if (cacheCellGroup.row > row) {\n return getCellByCache(cacheCellGroup._prev as Group, row);\n }\n return getCellByCache(cacheCellGroup._next as Group, row);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/proxy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,OAAO,UAAU;IA8CrB,YAAY,KAAmB;QA5C/B,cAAS,GAAY,KAAK,CAAC;QAC3B,SAAI,GAA+B,QAAQ,CAAC;QAG5C,aAAQ,GAAG,GAAG,CAAC;QACf,eAAU,GAAG,CAAC,CAAC;QAIf,aAAQ,GAAG,CAAC,CAAC;QACb,WAAM,GAAG,CAAC,CAAC;QACX,iBAAY,GAAG,CAAC,CAAC;QAQjB,iBAAY,GAAW,CAAC,CAAC;QA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":"proxy.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { Group } from '../../graphic/group';\nimport { computeColsWidth } from '../../layout/compute-col-width';\nimport { computeRowsHeight } from '../../layout/compute-row-height';\nimport { emptyGroup } from '../../utils/empty-group';\nimport { createColGroup } from '../column';\nimport { createComplexColumn } from '../column-helper';\nimport { createGroupForFirstScreen } from './create-group-for-first-screen';\nimport { dynamicSetX, updateColContent } from './update-position/dynamic-set-x';\nimport { dynamicSetY, updateRowContent } from './update-position/dynamic-set-y';\nimport { updateAutoRow } from './update-position/update-auto-row';\nimport { sortVertical } from './update-position/sort-vertical';\nimport { sortHorizontal } from './update-position/sort-horizontal';\n\nexport class SceneProxy {\n table: BaseTableAPI;\n isRelease: boolean = false;\n mode: 'column' | 'row' | 'pivot' = 'column';\n isProgressing: boolean;\n\n rowLimit = 200;\n currentRow = 0; // 目前渐进生成的row number\n totalRow: number; // 渐进完成最后一行的row number\n yLimitTop: number; // y > yLimitTop动态更新,否则直接修改xy\n yLimitBottom: number; // y < yLimitBottom动态更新,否则直接修改xy\n rowStart = 0; // 当前维护的部分第一行的row number\n rowEnd = 0; // 当前维护的部分最后一行的row number\n referenceRow = 0; // 当前维护的部分中间一行的row number,认为referenceRow对应当前屏幕显示范围的第一行\n bodyTopRow: number; // table body部分的第一行row number\n bodyBottomRow: number; // table body部分的最后一行row number\n screenRowCount: number; // 预计屏幕范围内显示的row count\n firstScreenRowLimit: number; // 首屏同步加载部分最后一行的row number\n taskRowCount: number; // 一次任务生成/更新的row count\n rowUpdatePos: number; // 异步任务目前更新到的行的row number\n rowUpdateDirection: 'up' | 'down'; // 当前行更新的方向\n screenTopRow: number = 0; // 当前屏幕范围内显示的第一行的row number\n totalActualBodyRowCount: number; // 实际表格body部分的行数\n deltaY: number = 0;\n\n colLimit = 100;\n // bodyLeftCol: number; // table body部分的第一列col number\n bodyRightCol: number; // table body部分的最后一列col number\n totalCol: number; // 渐进完成最后一列的col number\n colStart: number; // 当前维护的部分第一列的col number\n colEnd: number; // 当前维护的部分最后一列的col number\n taskColCount: number; // 一次任务生成/更新的col count\n xLimitLeft: number; // x > xLimitLeft动态更新,否则直接修改xy\n xLimitRight: number; // x < xLimitRight动态更新,否则直接修改xy\n screenColCount: number; // 预计屏幕范围内显示的col count\n firstScreenColLimit: number; // 首屏同步加载部分最后一列的col number\n colUpdatePos: number; // 异步任务目前更新到的列的col number\n currentCol: number; // 目前渐进生成的col number\n referenceCol: number; // 当前维护的部分中间一列的col number,认为referenceCol对应当前屏幕显示范围的第一列\n screenLeftCol: number = 0; // 当前屏幕范围内显示的第一列的col number\n colUpdateDirection: 'left' | 'right'; // 当前列更新方向\n totalActualBodyColCount: number; // 实际表格body部分的列数\n deltaX: number = 0;\n\n cellCache: Map<number, Group> = new Map(); // 单元格位置快速查找缓存\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n\n if (this.table.isPivotChart()) {\n this.rowLimit = 100;\n this.colLimit = 100;\n } else if (this.table.heightMode === 'autoHeight') {\n this.rowLimit = 100;\n } else if (this.table.widthMode === 'autoWidth') {\n this.colLimit = 100;\n }\n\n if (this.table.internalProps.transpose) {\n this.mode = 'row';\n } else if (this.table.isPivotTable()) {\n this.mode = 'pivot';\n }\n if (this.table.options.maintainedDataCount) {\n this.rowLimit = this.table.options.maintainedDataCount;\n }\n }\n\n get bodyLeftCol(): number {\n return this.table.frozenColCount;\n }\n\n setParamsForColumn() {\n // this.bodyLeftCol = this.table.frozenColCount;\n this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;\n\n // compute the column info about progress creation\n const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);\n this.totalActualBodyColCount = totalActualBodyColCount;\n this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1; // 目标渐进完成的col\n this.colStart = this.bodyLeftCol;\n const defaultColWidth = this.table.defaultColWidth;\n this.taskColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth) * 1;\n\n // 确定动态更新限制\n const totalBodyWidth = defaultColWidth * totalActualBodyColCount;\n const totalWidth = defaultColWidth * (this.bodyRightCol - this.bodyLeftCol + 1);\n this.xLimitLeft = totalBodyWidth / 2;\n this.xLimitRight = totalWidth - totalBodyWidth / 2;\n\n // 确定首屏高度范围\n const widthLimit = this.table.tableNoFrameWidth * 5;\n this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);\n this.firstScreenColLimit = this.bodyLeftCol + Math.min(this.colLimit, Math.ceil(widthLimit / defaultColWidth));\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.colUpdatePos = this.bodyRightCol;\n }\n\n setParamsForRow() {\n this.bodyTopRow = this.table.columnHeaderLevelCount;\n this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;\n // this.bodyLeftCol = 0;\n // this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;\n\n // 计算渐进加载数量\n const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1); // 渐进加载总row数量\n this.totalActualBodyRowCount = totalActualBodyRowCount;\n this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1; // 目标渐进完成的row\n this.rowStart = this.bodyTopRow;\n const defaultRowHeight = this.table.defaultRowHeight;\n this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 1;\n\n // 确定动态更新限制\n const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount;\n const totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);\n this.yLimitTop = totalBodyHeight / 2;\n this.yLimitBottom = totalHeight - totalBodyHeight / 2;\n // this.bottomOffset = totalHeight - totalBodyHeight / 2;\n\n // 确定首屏高度范围\n const heightLimit = this.table.tableNoFrameHeight * 5;\n this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);\n this.firstScreenRowLimit = this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight));\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.rowUpdatePos = this.bodyBottomRow;\n }\n\n async createGroupForFirstScreen(\n cornerHeaderGroup: Group,\n colHeaderGroup: Group,\n rowHeaderGroup: Group,\n rightFrozenGroup: Group,\n bottomFrozenGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number\n ) {\n await createGroupForFirstScreen(\n cornerHeaderGroup,\n colHeaderGroup,\n rowHeaderGroup,\n rightFrozenGroup,\n bottomFrozenGroup,\n bodyGroup,\n xOrigin,\n yOrigin,\n this\n );\n }\n // async progress() {\n // if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // // 先更新\n // await this.updateCellGroupsAsync();\n // await this.progress();\n // } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // // 先更新没有需要更新的节点,在生成新节点\n // await this.createRow();\n // await this.progress();\n // }\n // }\n async progress() {\n if (this.isProgressing) {\n return;\n }\n this.isProgressing = true;\n return new Promise<void>((resolve, reject) => {\n setTimeout(async () => {\n this.isProgressing = false;\n if (this.isRelease) {\n return;\n }\n // console.log('progress col', this.colUpdatePos, this.colEnd, this.currentCol, this.totalCol);\n // console.log('progress row', this.rowUpdatePos, this.rowEnd, this.currentRow, this.totalRow);\n // console.log('before: createRow', table.scenegraph.bodyGroup.lastChild.attribute);\n // if (this.isSkipProgress) {\n // await this.progress();\n // } else\n if (this.colUpdatePos <= this.colEnd) {\n await this.updateColCellGroupsAsync();\n await this.progress();\n } else if (this.rowUpdatePos <= this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // 先更新\n await this.updateRowCellGroupsAsync();\n await this.progress();\n } else if (this.currentCol < this.totalCol) {\n await this.createCol();\n await this.progress();\n } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // 先更新没有需要更新的节点,在生成新节点\n await this.createRow();\n await this.progress();\n }\n resolve();\n }, 16);\n });\n }\n\n async createRow() {\n if (!this.taskRowCount) {\n return;\n }\n // console.log('createRow', this.currentRow, this.currentRow + this.taskRowCount);\n this.createRowCellGroup(this.taskRowCount);\n }\n\n async createCol() {\n if (!this.taskColCount) {\n return;\n }\n // console.log('createCol', this.currentCol, this.currentCol + this.taskColCount);\n this.createColGroup(this.taskRowCount);\n }\n\n createRowCellGroup(onceCount: number) {\n const endRow = Math.min(this.totalRow, this.currentRow + onceCount);\n // compute rows height\n computeRowsHeight(this.table, this.currentRow + 1, endRow, false);\n\n if (this.table.frozenColCount) {\n // create row header row cellGroup\n let maxHeight = 0;\n for (let col = 0; col < this.table.frozenColCount; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n this.table.scenegraph.rowHeaderGroup.setAttribute('height', maxHeight);\n }\n }\n\n if (this.table.rightFrozenColCount) {\n // create row header row cellGroup\n let maxHeight = 0;\n for (let col = this.table.colCount - this.table.rightFrozenColCount; col < this.table.colCount; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n this.table.scenegraph.rightFrozenGroup.setAttribute('height', maxHeight);\n }\n }\n\n // create body row cellGroup\n let maxHeight = 0;\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n const cellLocation = 'body';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n }\n this.table.scenegraph.bodyGroup.setAttribute('height', maxHeight);\n\n this.currentRow = endRow;\n this.rowEnd = endRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = this.rowStart + Math.floor((endRow - this.rowStart) / 2);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n createColGroup(onceCount: number) {\n // compute rows height\n const endCol = Math.min(this.totalCol, this.currentCol + onceCount);\n computeColsWidth(this.table, this.currentCol + 1, endCol);\n\n // update last merge cell size\n for (let row = 0; row < this.table.rowCount; row++) {\n const cellGroup = this.highPerformanceGetCell(this.currentCol, row);\n if (isNumber(cellGroup.mergeStartCol) && cellGroup.mergeStartCol > this.currentCol) {\n this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n }\n }\n\n // create column\n if (this.table.columnHeaderLevelCount) {\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.colHeaderGroup.lastChild instanceof Group\n ? this.table.scenegraph.colHeaderGroup.lastChild\n : this.table.scenegraph.colHeaderGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create colHeaderGroup\n createColGroup(\n this.table.scenegraph.colHeaderGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n 0, // rowStart\n this.table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n this.table\n );\n }\n if (this.table.bottomFrozenRowCount) {\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.bottomFrozenGroup.lastChild instanceof Group\n ? this.table.scenegraph.bottomFrozenGroup.lastChild\n : this.table.scenegraph.bottomFrozenGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create bottomFrozenGroup\n createColGroup(\n this.table.scenegraph.bottomFrozenGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n this.table.rowCount - this.table.bottomFrozenRowCount, // rowStart\n this.table.rowCount - 1, // rowEnd\n 'columnHeader', // isHeader\n this.table\n );\n }\n // create colGroup\n let lastColumnGroup =\n this.table.scenegraph.bodyGroup.lastChild &&\n ((this.table.scenegraph.bodyGroup.lastChild instanceof Group\n ? this.table.scenegraph.bodyGroup.lastChild\n : this.table.scenegraph.bodyGroup.lastChild._prev) as Group);\n if (!lastColumnGroup) {\n lastColumnGroup =\n this.table.scenegraph.colHeaderGroup.lastChild &&\n ((this.table.scenegraph.colHeaderGroup.lastChild instanceof Group\n ? this.table.scenegraph.colHeaderGroup.lastChild\n : this.table.scenegraph.colHeaderGroup.lastChild._prev) as Group);\n }\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create bodyGroup\n createColGroup(\n this.table.scenegraph.bodyGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n this.rowStart, // rowStart\n this.rowEnd, // rowEnd\n 'body', // isHeader\n this.table\n );\n\n this.currentCol = endCol;\n this.colEnd = endCol;\n this.colUpdatePos = this.colEnd;\n this.referenceCol = this.colStart + Math.floor((endCol - this.colStart) / 2);\n console.log('async', this.referenceCol, this.colStart, this.colEnd);\n\n // update container group size and border\n // this.table.scenegraph.updateContainerAttrWidthAndX();\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n async setY(y: number) {\n const yLimitTop = this.table.getRowsHeight(this.bodyTopRow, this.bodyTopRow + this.totalActualBodyRowCount) / 2;\n const yLimitBottom = this.table.getAllRowsHeight() - yLimitTop;\n if (y < yLimitTop && this.rowStart === this.bodyTopRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else if (y > yLimitBottom && this.rowEnd === this.bodyBottomRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else {\n // 执行动态更新节点\n this.dynamicSetY(y);\n }\n }\n\n async setX(x: number) {\n const xLimitLeft = this.table.getColsWidth(this.bodyLeftCol, this.bodyLeftCol + this.totalActualBodyColCount) / 2;\n const xLimitRight = this.table.getAllColsWidth() - xLimitLeft;\n if (x < xLimitLeft && this.colStart === this.bodyLeftCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else if (x > xLimitRight && this.colEnd === this.bodyRightCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else {\n // 执行动态更新节点\n this.dynamicSetX(x);\n }\n }\n\n async dynamicSetY(y: number) {\n dynamicSetY(y, this);\n }\n async dynamicSetX(x: number) {\n dynamicSetX(x, this);\n }\n\n updateBody(y: number) {\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n }\n\n async updateRowCellGroupsAsync() {\n this.updateCellGroups(this.taskRowCount);\n }\n\n updateCellGroups(count: number) {\n const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);\n // console.log('updateCellGroups', this.rowUpdatePos, distRow);\n if (this.table.heightMode === 'autoHeight') {\n computeRowsHeight(this.table, this.rowUpdatePos, distRow, false);\n }\n\n updateRowContent(this.rowUpdatePos, distRow, this);\n\n if (this.table.heightMode === 'autoHeight') {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.rowUpdatePos, // rowStart\n distRow, // rowEnd\n this.table,\n this.rowUpdateDirection\n );\n }\n\n this.rowUpdatePos = distRow + 1;\n }\n\n async updateColCellGroupsAsync() {\n this.updateColGroups(this.taskRowCount);\n }\n\n updateColGroups(count: number) {\n const distCol = Math.min(this.bodyRightCol, this.colUpdatePos + count);\n // console.log('updateCellGroups', this.colUpdatePos, distCol);\n // for (let col = this.colUpdatePos; col <= distCol; col++) {\n // const colGroup = this.table.scenegraph.getColGroup(col);\n // if (colGroup) {\n // // colGroup.forEachChildren((cellGroup: Group) => {\n // // this.updateCellGroupContent(cellGroup);\n // // });\n // // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // // const cellGroup = this.highPerformanceGetCell(colGroup.col, row);\n // // this.updateCellGroupContent(cellGroup);\n // // }\n // let cellGroup = colGroup.firstChild;\n // while (cellGroup) {\n // // this.updateCellGroupContent(cellGroup as Group);\n // // cellGroup = cellGroup._next;\n // const newCellGroup = this.updateCellGroupContent(cellGroup as Group);\n // cellGroup = newCellGroup._next;\n // }\n // colGroup.needUpdate = false;\n // }\n // }\n computeColsWidth(this.table, this.colUpdatePos, distCol);\n updateColContent(this.colUpdatePos, distCol, this);\n this.colUpdatePos = distCol + 1;\n }\n\n updateCellGroupPosition(cellGroup: Group, newRow: number, y: number) {\n // 更新位置&row\n cellGroup.row = newRow;\n cellGroup.setAttribute('y', y);\n (cellGroup as any).needUpdate = true;\n (cellGroup as any).needUpdateForAutoRowHeight = true;\n }\n\n updateCellGroupContent(cellGroup: Group) {\n if (!cellGroup.needUpdate) {\n return cellGroup;\n }\n\n const newCellGroup = this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n // 更新内容\n // const textMark = cellGroup.firstChild as WrapText;\n // const autoWrapText = Array.isArray(textMark.attribute.text);\n // const textStr: string = this.table.getCellValue(cellGroup.col, cellGroup.row);\n // let text;\n // if (autoWrapText) {\n // text = String(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n // } else {\n // text = textStr;\n // }\n\n // textMark.setAttribute('text', text);\n\n cellGroup.needUpdate = false;\n return newCellGroup || cellGroup;\n }\n\n async sortCellVertical() {\n await sortVertical(this);\n }\n\n async sortCellHorizontal() {\n await sortHorizontal(this);\n }\n\n highPerformanceGetCell(\n col: number,\n row: number,\n // rowStart: number = this.rowStart,\n // rowEnd: number = this.rowEnd,\n getShadow?: boolean\n ) {\n // if (row < rowStart || row > rowEnd) {\n // return emptyGroup;\n // }\n // if (row < this.rowStart || row > this.rowEnd || col < this.colStart || col > this.colEnd) {\n // return emptyGroup;\n // }\n\n if (\n row >= this.table.columnHeaderLevelCount && // not column header\n row < this.table.rowCount - this.table.bottomFrozenRowCount && // not bottom frozen\n (row < this.rowStart || row > this.rowEnd) // not in proxy row range\n ) {\n return emptyGroup;\n }\n\n if (\n col >= this.table.frozenColCount && // not row header\n col < this.table.colCount - this.table.rightFrozenColCount && // not right frozen\n (col < this.colStart || col > this.colEnd) // not in proxy col range\n ) {\n return emptyGroup;\n }\n\n if (this.cellCache.get(col)) {\n const cacheCellGoup = this.cellCache.get(col);\n if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {\n // 由缓存单元格向前后查找要快于从头查找\n let cellGroup = getCellByCache(cacheCellGoup, row);\n if (!cellGroup || (!getShadow && cellGroup.role === 'shadow-cell')) {\n cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n }\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n // cellGroup.row && this.cellCache.set(col, cellGroup);\n if (cellGroup.col === col && cellGroup.row) {\n this.cellCache.set(col, cellGroup);\n }\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n // cellGroup.row && this.cellCache.set(col, cellGroup);\n if (cellGroup.col === col && cellGroup.row) {\n this.cellCache.set(col, cellGroup);\n }\n return cellGroup;\n }\n\n release() {\n this.isRelease = true;\n }\n}\n\nfunction getCellByCache(cacheCellGroup: Group, row: number): Group | null {\n if (!cacheCellGroup) {\n return null;\n }\n if (cacheCellGroup.row === row) {\n return cacheCellGroup;\n } else if (cacheCellGroup.row > row) {\n return getCellByCache(cacheCellGroup._prev as Group, row);\n }\n return getCellByCache(cacheCellGroup._next as Group, row);\n}\n"]}
|
|
@@ -28,7 +28,7 @@ import { computeColsWidth } from "../../../layout/compute-col-width";
|
|
|
28
28
|
|
|
29
29
|
import { updateAutoColumn } from "./update-auto-column";
|
|
30
30
|
|
|
31
|
-
import {
|
|
31
|
+
import { getFirstChild, getLastChild } from "./util";
|
|
32
32
|
|
|
33
33
|
export function dynamicSetX(x, proxy) {
|
|
34
34
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
@@ -53,8 +53,7 @@ function moveColumn(count, direction, screenLeftCol, screenLeftX, proxy) {
|
|
|
53
53
|
const syncLeftCol = distStartCol, syncRightCol = distEndCol;
|
|
54
54
|
proxy.colStart = "left" === direction ? proxy.colStart + count : proxy.colStart - count,
|
|
55
55
|
proxy.colEnd = "left" === direction ? proxy.colEnd + count : proxy.colEnd - count,
|
|
56
|
-
updateColContent(syncLeftCol, syncRightCol, proxy),
|
|
57
|
-
updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, direction);
|
|
56
|
+
updateColContent(syncLeftCol, syncRightCol, proxy), updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, direction);
|
|
58
57
|
const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol) || proxy.table.scenegraph.getColGroup(screenLeftCol, !0), deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
|
|
59
58
|
proxy.table.scenegraph.proxy.deltaX += deltaX, proxy.currentCol = "left" === direction ? proxy.currentCol + count : proxy.currentCol - count,
|
|
60
59
|
proxy.totalCol = "left" === direction ? proxy.totalCol + count : proxy.totalCol - count,
|
|
@@ -66,7 +65,7 @@ function moveColumn(count, direction, screenLeftCol, screenLeftX, proxy) {
|
|
|
66
65
|
updateAllColPosition(proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1), count, direction, proxy);
|
|
67
66
|
const syncLeftCol = distStartCol, syncRightCol = distEndCol;
|
|
68
67
|
proxy.colStart = distStartCol, proxy.colEnd = distEndCol, updateColContent(syncLeftCol, syncRightCol, proxy),
|
|
69
|
-
|
|
68
|
+
updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? "right" : "left"),
|
|
70
69
|
proxy.table.scenegraph.proxy.deltaX = 0, proxy.currentCol = "left" === direction ? proxy.currentCol + count : proxy.currentCol - count,
|
|
71
70
|
proxy.totalCol = "left" === direction ? proxy.totalCol + count : proxy.totalCol - count,
|
|
72
71
|
proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-x.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEzE,MAAM,UAAgB,WAAW,CAAC,CAAS,EAAE,KAAiB;;QAC5D,MAAM,UAAU,GAAI,KAAK,CAAC,KAAsB,CAAC,cAAc,CAC7D,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAC1D,CAAC;QACF,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QACD,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC;QACrC,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC;QACpC,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;QACpC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QAE1D,IAAI,QA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AK,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,QAAe,EAAE,KAAa,EAAE,EAAE;QAClF,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;YAC7B,sBAAsB,CACpB,QAAQ,EACR,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,EAElE,KAAK,KAAK,CAAC;gBACT,CAAC,CAAC,aAAa;gBACf,CAAC,CAAE,QAAQ,CAAC,KAAe,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAE,QAAQ,CAAC,KAAe,CAAC,GAAG,CAAC,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"dynamic-set-x.js","sourcesContent":["import type { BaseTableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoColumn } from './update-auto-column';\nimport { checkFirstColMerge, getFirstChild, getLastChild } from './util';\n\nexport async function dynamicSetX(x: number, proxy: SceneProxy) {\n const screenLeft = (proxy.table as BaseTableAPI).getTargetColAt(\n x + proxy.table.scenegraph.rowHeaderGroup.attribute.width\n );\n if (!screenLeft) {\n return;\n }\n const screenLeftCol = screenLeft.col;\n const screenLeftX = screenLeft.left;\n proxy.screenLeftCol = screenLeftCol;\n const deltaCol = proxy.screenLeftCol - proxy.referenceCol;\n\n if (deltaCol > 0) {\n // 向右滚动,左部column group移到右部\n moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else if (deltaCol < 0) {\n // 向左滚动,右部cell group移到左部\n moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else {\n // 不改变row,更新body group范围\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveColumn(\n count: number,\n direction: 'left' | 'right',\n screenLeftCol: number,\n screenLeftX: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {\n count = proxy.bodyRightCol - proxy.colEnd;\n } else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {\n count = proxy.colStart - proxy.bodyLeftCol;\n }\n\n if (count <= 0) {\n return;\n }\n\n // 两种更新模式\n // 1. count < colEnd - colStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= colEnd - colStart:整体移动到目标位置\n if (count < proxy.colEnd - proxy.colStart) {\n // 计算更新区域\n const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;\n const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;\n const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n updatePartColPosition(startCol, endCol, direction, proxy);\n\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n updateColContent(syncLeftCol, syncRightCol, proxy);\n checkFirstColMerge(distStartCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n direction\n );\n\n const colGroup =\n proxy.table.scenegraph.getColGroup(screenLeftCol) || proxy.table.scenegraph.getColGroup(screenLeftCol, true);\n const deltaX =\n screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);\n proxy.table.scenegraph.proxy.deltaX += deltaX;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = distStartCol;\n proxy.colUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n\n // 开始异步任务\n // await proxy.progress();\n } else {\n const distStartCol = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);\n\n // 更新同步范围\n updateAllColPosition(distStartColY, count, direction, proxy);\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = distStartCol;\n proxy.colEnd = distEndCol;\n updateColContent(syncLeftCol, syncRightCol, proxy);\n checkFirstColMerge(distStartCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left' // 跳转到右侧时,从右向左对齐\n );\n proxy.table.scenegraph.proxy.deltaX = 0;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n\n proxy.table.scenegraph.updateNextFrame();\n // await proxy.progress();\n }\n}\n\nfunction updateColGroupPosition(colGroup: Group, newCol: number, x: number) {\n // 更新位置&col\n colGroup.col = newCol;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.col = newCol;\n cellGroup.needUpdate = true;\n });\n colGroup.setAttribute('x', x);\n colGroup.needUpdate = true;\n}\n\nfunction updateColGroupContent(colGroup: Group, proxy: SceneProxy) {\n if (!colGroup) {\n return;\n }\n // colGroup.forEachChildren((cellGroup: Group) => {\n // proxy.updateCellGroupContent(cellGroup);\n // });\n // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // const cellGroup = proxy.highPerformanceGetCell(colGroup.col, row);\n // proxy.updateCellGroupContent(cellGroup);\n // }\n let cellGroup = colGroup.firstChild;\n while (cellGroup) {\n const newCellGroup = proxy.updateCellGroupContent(cellGroup as Group);\n cellGroup = newCellGroup._next;\n }\n colGroup.needUpdate = false;\n colGroup.setAttribute('width', proxy.table.getColWidth(colGroup.col));\n}\n\nfunction updatePartColPosition(startCol: number, endCol: number, direction: 'left' | 'right', proxy: SceneProxy) {\n for (let col = startCol; col <= endCol; col++) {\n if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);\n }\n }\n}\n\nfunction updateColPosition(containerGroup: Group, direction: 'left' | 'right', proxy: SceneProxy) {\n if (direction === 'left') {\n const colGroup = getFirstChild(containerGroup);\n const lastChild = getLastChild(containerGroup);\n updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col));\n containerGroup.appendChild(colGroup);\n // console.log('after', colGroup.col, colGroup.attribute.x, containerGroup._uid);\n if (containerGroup.border) {\n containerGroup.appendChild(containerGroup.border);\n }\n } else {\n const colGroup = getLastChild(containerGroup);\n const firstChild = getFirstChild(containerGroup);\n updateColGroupPosition(\n colGroup,\n firstChild.col - 1,\n firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1)\n );\n containerGroup.insertBefore(colGroup, containerGroup.firstChild);\n }\n}\n\nexport function updateColContent(syncLeftCol: number, syncRightCol: number, proxy: SceneProxy) {\n for (let col = syncLeftCol; col <= syncRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup && updateColGroupContent(colGroup, proxy);\n\n const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);\n colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);\n\n const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);\n bottomColGroup && updateColGroupContent(bottomColGroup, proxy);\n }\n}\n\nfunction updateAllColPosition(distStartColY: number, count: number, direction: 'left' | 'right', proxy: SceneProxy) {\n proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-x.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAsB,aAAa,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEzE,MAAM,UAAgB,WAAW,CAAC,CAAS,EAAE,KAAiB;;QAC5D,MAAM,UAAU,GAAI,KAAK,CAAC,KAAsB,CAAC,cAAc,CAC7D,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAC1D,CAAC;QACF,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QACD,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC;QACrC,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC;QACpC,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;QACpC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QAE1D,IAAI,QAAQ,GAAG,CAAC,EAAE;YAEhB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,aAAa,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;YACtE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;SAChE;aAAM,IAAI,QAAQ,GAAG,CAAC,EAAE;YAEvB,UAAU,CAAC,CAAC,QAAQ,EAAE,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G,KAAK,CAAC,KAAK,CAAC,WAAW,CAAE,QAAQ,CAAC,KAAe,CAAC,GAAG,CAAC,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"dynamic-set-x.js","sourcesContent":["import type { BaseTableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoColumn } from './update-auto-column';\nimport { checkFirstColMerge, getFirstChild, getLastChild } from './util';\n\nexport async function dynamicSetX(x: number, proxy: SceneProxy) {\n const screenLeft = (proxy.table as BaseTableAPI).getTargetColAt(\n x + proxy.table.scenegraph.rowHeaderGroup.attribute.width\n );\n if (!screenLeft) {\n return;\n }\n const screenLeftCol = screenLeft.col;\n const screenLeftX = screenLeft.left;\n proxy.screenLeftCol = screenLeftCol;\n const deltaCol = proxy.screenLeftCol - proxy.referenceCol;\n\n if (deltaCol > 0) {\n // 向右滚动,左部column group移到右部\n moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else if (deltaCol < 0) {\n // 向左滚动,右部cell group移到左部\n moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else {\n // 不改变row,更新body group范围\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveColumn(\n count: number,\n direction: 'left' | 'right',\n screenLeftCol: number,\n screenLeftX: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {\n count = proxy.bodyRightCol - proxy.colEnd;\n } else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {\n count = proxy.colStart - proxy.bodyLeftCol;\n }\n\n if (count <= 0) {\n return;\n }\n\n // 两种更新模式\n // 1. count < colEnd - colStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= colEnd - colStart:整体移动到目标位置\n if (count < proxy.colEnd - proxy.colStart) {\n // 计算更新区域\n const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;\n const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;\n const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n updatePartColPosition(startCol, endCol, direction, proxy);\n\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n direction\n );\n\n const colGroup =\n proxy.table.scenegraph.getColGroup(screenLeftCol) || proxy.table.scenegraph.getColGroup(screenLeftCol, true);\n const deltaX =\n screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);\n proxy.table.scenegraph.proxy.deltaX += deltaX;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = distStartCol;\n proxy.colUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n\n // 开始异步任务\n // await proxy.progress();\n } else {\n const distStartCol = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);\n\n // 更新同步范围\n updateAllColPosition(distStartColY, count, direction, proxy);\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = distStartCol;\n proxy.colEnd = distEndCol;\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left' // 跳转到右侧时,从右向左对齐\n );\n proxy.table.scenegraph.proxy.deltaX = 0;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n\n proxy.table.scenegraph.updateNextFrame();\n // await proxy.progress();\n }\n}\n\nfunction updateColGroupPosition(colGroup: Group, newCol: number, x: number) {\n // 更新位置&col\n colGroup.col = newCol;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.col = newCol;\n cellGroup.needUpdate = true;\n });\n colGroup.setAttribute('x', x);\n colGroup.needUpdate = true;\n}\n\nfunction updateColGroupContent(colGroup: Group, proxy: SceneProxy) {\n if (!colGroup) {\n return;\n }\n // colGroup.forEachChildren((cellGroup: Group) => {\n // proxy.updateCellGroupContent(cellGroup);\n // });\n // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // const cellGroup = proxy.highPerformanceGetCell(colGroup.col, row);\n // proxy.updateCellGroupContent(cellGroup);\n // }\n let cellGroup = colGroup.firstChild;\n while (cellGroup) {\n const newCellGroup = proxy.updateCellGroupContent(cellGroup as Group);\n cellGroup = newCellGroup._next;\n }\n colGroup.needUpdate = false;\n colGroup.setAttribute('width', proxy.table.getColWidth(colGroup.col));\n}\n\nfunction updatePartColPosition(startCol: number, endCol: number, direction: 'left' | 'right', proxy: SceneProxy) {\n for (let col = startCol; col <= endCol; col++) {\n if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);\n }\n }\n}\n\nfunction updateColPosition(containerGroup: Group, direction: 'left' | 'right', proxy: SceneProxy) {\n if (direction === 'left') {\n const colGroup = getFirstChild(containerGroup);\n const lastChild = getLastChild(containerGroup);\n updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col));\n containerGroup.appendChild(colGroup);\n // console.log('after', colGroup.col, colGroup.attribute.x, containerGroup._uid);\n if (containerGroup.border) {\n containerGroup.appendChild(containerGroup.border);\n }\n } else {\n const colGroup = getLastChild(containerGroup);\n const firstChild = getFirstChild(containerGroup);\n updateColGroupPosition(\n colGroup,\n firstChild.col - 1,\n firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1)\n );\n containerGroup.insertBefore(colGroup, containerGroup.firstChild);\n }\n}\n\nexport function updateColContent(syncLeftCol: number, syncRightCol: number, proxy: SceneProxy) {\n for (let col = syncLeftCol; col <= syncRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup && updateColGroupContent(colGroup, proxy);\n\n const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);\n colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);\n\n const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);\n bottomColGroup && updateColGroupContent(bottomColGroup, proxy);\n }\n}\n\nfunction updateAllColPosition(distStartColY: number, count: number, direction: 'left' | 'right', proxy: SceneProxy) {\n proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n}\n"]}
|
|
@@ -28,8 +28,6 @@ import { computeRowsHeight } from "../../../layout/compute-row-height";
|
|
|
28
28
|
|
|
29
29
|
import { updateAutoRow } from "./update-auto-row";
|
|
30
30
|
|
|
31
|
-
import { checkFirstRowMerge } from "./util";
|
|
32
|
-
|
|
33
31
|
export function dynamicSetY(y, proxy) {
|
|
34
32
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
35
33
|
const screenTop = proxy.table.getTargetRowAt(y + proxy.table.scenegraph.colHeaderGroup.attribute.height);
|
|
@@ -55,8 +53,7 @@ function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
|
|
|
55
53
|
if (computeRowsHeight(proxy.table, syncTopRow, syncBottomRow), updatePartRowPosition(startRow, endRow, direction, proxy),
|
|
56
54
|
proxy.rowStart = "up" === direction ? proxy.rowStart + count : proxy.rowStart - count,
|
|
57
55
|
proxy.rowEnd = "up" === direction ? proxy.rowEnd + count : proxy.rowEnd - count,
|
|
58
|
-
updateRowContent(syncTopRow, syncBottomRow, proxy),
|
|
59
|
-
"autoHeight" === proxy.table.heightMode) {
|
|
56
|
+
updateRowContent(syncTopRow, syncBottomRow, proxy), "autoHeight" === proxy.table.heightMode) {
|
|
60
57
|
updateAutoRow(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, direction);
|
|
61
58
|
const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, screenTopRow, !0), delaY = screenTopY - (cellGroup.attribute.y + proxy.table.getFrozenRowsHeight() + proxy.table.scenegraph.proxy.deltaY);
|
|
62
59
|
proxy.table.scenegraph.proxy.deltaY += delaY;
|
|
@@ -72,8 +69,8 @@ function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
|
|
|
72
69
|
"autoHeight" === proxy.table.heightMode ? (syncTopRow = distStartRow, syncBottomRow = distEndRow) : (syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - 1 * proxy.screenRowCount),
|
|
73
70
|
syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + 2 * proxy.screenRowCount)),
|
|
74
71
|
computeRowsHeight(proxy.table, syncTopRow, syncBottomRow), updateAllRowPosition(distStartRowY, count, direction, proxy),
|
|
75
|
-
proxy.rowStart = distStartRow, proxy.rowEnd = distEndRow,
|
|
76
|
-
|
|
72
|
+
proxy.rowStart = distStartRow, proxy.rowEnd = distEndRow, updateRowContent(syncTopRow, syncBottomRow, proxy),
|
|
73
|
+
"autoHeight" === proxy.table.heightMode && updateAutoRow(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? "down" : "up"),
|
|
77
74
|
proxy.table.scenegraph.proxy.deltaY = 0, proxy.currentRow = "up" === direction ? proxy.currentRow + count : proxy.currentRow - count,
|
|
78
75
|
proxy.totalRow = Math.max(0, Math.min(proxy.table.rowCount - 1, "up" === direction ? proxy.totalRow + count : proxy.totalRow - count)),
|
|
79
76
|
proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2),
|