@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
|
@@ -4,50 +4,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.updateCellHeight = exports.updateCellHeightForColumn = exports.updateCellHeightForRow = exports.updateRowHeight = void 0;
|
|
6
6
|
|
|
7
|
-
const progress_bar_cell_1 = require("../group-creater/cell-type/progress-bar-cell"), spark_line_cell_1 = require("../group-creater/cell-type/spark-line-cell"), get_cell_merge_1 = require("../utils/get-cell-merge"), get_prop_1 = require("../utils/get-prop"), padding_1 = require("../utils/padding"), text_icon_layout_1 = require("../utils/text-icon-layout"), custom_1 = require("../component/custom"), image_cell_1 = require("../group-creater/cell-type/image-cell"), tableHelper_1 = require("../../core/tableHelper");
|
|
7
|
+
const progress_bar_cell_1 = require("../group-creater/cell-type/progress-bar-cell"), spark_line_cell_1 = require("../group-creater/cell-type/spark-line-cell"), get_cell_merge_1 = require("../utils/get-cell-merge"), get_prop_1 = require("../utils/get-prop"), padding_1 = require("../utils/padding"), text_icon_layout_1 = require("../utils/text-icon-layout"), custom_1 = require("../component/custom"), image_cell_1 = require("../group-creater/cell-type/image-cell"), tableHelper_1 = require("../../core/tableHelper"), is_merge_cell_group_1 = require("../utils/is-merge-cell-group"), column_helper_1 = require("../group-creater/column-helper");
|
|
8
8
|
|
|
9
9
|
function updateRowHeight(scene, row, detaY) {
|
|
10
10
|
scene.table.setRowHeight(row, scene.table.getRowHeight(row) + detaY, !0);
|
|
11
11
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
12
12
|
const cell = scene.getCell(col, row), mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, col, row);
|
|
13
13
|
if (mergeInfo && mergeInfo.start.col !== col) continue;
|
|
14
|
-
updateCellHeightForRow(scene, cell, col, row, cell.attribute.height, detaY, scene.table.isHeader(col, row)),
|
|
14
|
+
updateCellHeightForRow(scene, cell, col, row, cell.attribute.height + detaY, detaY, scene.table.isHeader(col, row)),
|
|
15
15
|
scene.updateCellContentWhileResize(col, row);
|
|
16
16
|
}
|
|
17
17
|
let rowStart = 0, rowEnd = 0;
|
|
18
|
-
row < scene.table.columnHeaderLevelCount ? (
|
|
19
|
-
scene.
|
|
20
|
-
scene.bodyGroup.setAttribute("y", scene.bodyGroup.attribute.y + detaY), rowStart = row + 1,
|
|
21
|
-
rowEnd = scene.table.columnHeaderLevelCount - 1) : (rowStart = row + 1, rowEnd = scene.bodyRowEnd - scene.table.bottomFrozenRowCount);
|
|
18
|
+
row < scene.table.columnHeaderLevelCount ? (rowStart = row + 1, rowEnd = scene.table.columnHeaderLevelCount - 1) : (rowStart = row + 1,
|
|
19
|
+
rowEnd = scene.bodyRowEnd - scene.table.bottomFrozenRowCount);
|
|
22
20
|
for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {
|
|
23
|
-
const cellGroup = scene.getCell(colIndex, rowIndex)
|
|
24
|
-
|
|
21
|
+
const cellGroup = scene.getCell(colIndex, rowIndex);
|
|
22
|
+
"cell" === cellGroup.role && cellGroup.setAttribute("y", cellGroup.attribute.y + detaY);
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
function updateCellHeightForRow(scene, cell, col, row, height, detaY, isHeader) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col && mergeInfo.start.col === col) {
|
|
32
|
-
const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row), mergeCellheight = mergeCell.attribute.height;
|
|
33
|
-
mergeCell.setAttribute("height", mergeCellheight + detaY), cellGroup = mergeCell,
|
|
34
|
-
distHeight = mergeCell.attribute.height;
|
|
35
|
-
} else mergeInfo ? (cell.setAttribute("height", height + detaY), cellGroup = cell,
|
|
36
|
-
distHeight = height + detaY) : mergeInfo || (cell.setAttribute("height", height + detaY),
|
|
37
|
-
cellGroup = cell, distHeight = height + detaY);
|
|
38
|
-
cellGroup && updateCellHeight(scene, cellGroup, col, row, distHeight, detaY, isHeader);
|
|
27
|
+
cell.setAttribute("height", height);
|
|
28
|
+
cell && updateCellHeight(scene, cell, col, row, height, detaY, isHeader);
|
|
39
29
|
}
|
|
40
30
|
|
|
41
31
|
function updateCellHeightForColumn(scene, cell, col, row, height, detaY, isHeader) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
|
|
45
|
-
if (cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row), row === mergeInfo.start.row) return void (cell._tempHeight = height);
|
|
46
|
-
if (row !== mergeInfo.end.row) return void (cell._tempHeight += height);
|
|
47
|
-
cell.setAttribute("height", cell._tempHeight + height), cellGroup = cell, height = cell.attribute.height;
|
|
48
|
-
} else mergeInfo ? ((cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row)).setAttribute("height", height),
|
|
49
|
-
cellGroup = cell) : (cell.setAttribute("height", height), cellGroup = cell);
|
|
50
|
-
updateCellHeight(scene, cellGroup, col, row, height, 0, isHeader);
|
|
32
|
+
cell.setAttribute("height", height);
|
|
33
|
+
updateCellHeight(scene, cell, col, row, height, 0, isHeader);
|
|
51
34
|
}
|
|
52
35
|
|
|
53
36
|
function updateCellHeight(scene, cell, col, row, distHeight, detaY, isHeader) {
|
|
@@ -87,12 +70,39 @@ function updateCellHeight(scene, cell, col, row, distHeight, detaY, isHeader) {
|
|
|
87
70
|
}
|
|
88
71
|
if (renderDefault) {
|
|
89
72
|
const style = scene.table._getCellStyle(col, row);
|
|
90
|
-
(
|
|
91
|
-
padding_1.getQuadProps)(style.padding), style.textAlign, style.textBaseline);
|
|
73
|
+
updateMergeCellContentHeight(cell, distHeight, detaY, "autoHeight" === scene.table.heightMode, (0,
|
|
74
|
+
padding_1.getQuadProps)(style.padding), style.textAlign, style.textBaseline, scene.table);
|
|
92
75
|
}
|
|
93
76
|
}
|
|
94
77
|
}
|
|
95
78
|
|
|
79
|
+
function updateMergeCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline, table) {
|
|
80
|
+
if ((0, is_merge_cell_group_1.isMergeCellGroup)(cellGroup)) {
|
|
81
|
+
distHeight = 0;
|
|
82
|
+
for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) distHeight += table.getRowHeight(row);
|
|
83
|
+
for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
|
|
84
|
+
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
85
|
+
singleCellGroup.forEachChildren((child => {
|
|
86
|
+
child.setAttributes({
|
|
87
|
+
dx: 0,
|
|
88
|
+
dy: 0
|
|
89
|
+
});
|
|
90
|
+
})), (0, text_icon_layout_1.updateCellContentHeight)(singleCellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);
|
|
91
|
+
const rangeHeight = table.getRowHeight(row), rangeWidth = table.getColWidth(col);
|
|
92
|
+
singleCellGroup.contentHeight = distHeight, (0, column_helper_1.resizeCellGroup)(singleCellGroup, rangeWidth, rangeHeight, {
|
|
93
|
+
start: {
|
|
94
|
+
col: cellGroup.mergeStartCol,
|
|
95
|
+
row: cellGroup.mergeStartRow
|
|
96
|
+
},
|
|
97
|
+
end: {
|
|
98
|
+
col: cellGroup.mergeEndCol,
|
|
99
|
+
row: cellGroup.mergeEndRow
|
|
100
|
+
}
|
|
101
|
+
}, table);
|
|
102
|
+
}
|
|
103
|
+
} else (0, text_icon_layout_1.updateCellContentHeight)(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);
|
|
104
|
+
}
|
|
105
|
+
|
|
96
106
|
exports.updateRowHeight = updateRowHeight, exports.updateCellHeightForRow = updateCellHeightForRow,
|
|
97
107
|
exports.updateCellHeightForColumn = updateCellHeightForColumn, exports.updateCellHeight = updateCellHeight;
|
|
98
108
|
//# sourceMappingURL=update-height.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/update-height.ts"],"names":[],"mappings":";;;AAEA,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAoE;AAEpE,gDAAqD;AACrD,sEAA0F;AAC1F,wDAAuD;AAEvD,SAAgB,eAAe,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAE3E,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC;IAE3E,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,IAAA,iCAAgB,EAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1D,IAAI,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE;YAC5C,SAAS;SACV;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QAGrC,sBAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,C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Y,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,KAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;gBAChE,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC;aACrC;YAED,IAAI,YAAY,IAAI,YAAY,EAAE;gBAEhC,MAAM,YAAY,GAAG,IAAA,uBAAc,EACjC,YAAY,EACZ,YAAY,EACZ,GAAG,EACH,GAAG,EACH,IAAI,CAAC,SAAS,CAAC,KAAK,EACpB,IAAI,CAAC,SAAS,CAAC,MAAM,EACrB,KAAK,EACL,KAAK,CAAC,KAAK,CAAC,UAAU,KAAK,YAAY,EACvC,KAAK,CAAC,KAAK,CACZ,CAAC;gBACF,mBAAmB,GAAG,YAAY,CAAC,aAAa,CAAC;gBACjD,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC;aAC5C;YAED,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE;gBAC1B,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;aACzD;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;aACvC;SACF;QAED,IAAI,aAAa,EAAE;YAEjB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAClD,IAAA,0CAAuB,EACrB,IAAI,EACJ,UAAU,EACV,KAAK,EAEL,KAAK,CAAC,KAAK,CAAC,UAAU,KAAK,YAAY,EACvC,IAAA,sBAAY,EAAC,KAAK,CAAC,OAAiB,CAAC,EACrC,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,YAAY,CACnB,CAAC;SACH;KAqCF;AACH,CAAC;AA9JD,4CA8JC","file":"update-height.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { Group } from '../graphic/group';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentHeight } from '../utils/text-icon-layout';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number) {\n // 更新table行高存储\n scene.table.setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.start.col !== col) {\n continue;\n }\n const height = cell.attribute.height;\n // cell.setAttribute('height', height);\n // (cell.firstChild as Rect).setAttribute('height', cell.attribute.height);\n updateCellHeightForRow(scene, cell, col, row, height, detaY, scene.table.isHeader(col, row));\n\n scene.updateCellContentWhileResize(col, row);\n }\n\n let rowStart = 0;\n let rowEnd = 0;\n // 更新header 高度\n if (row < scene.table.columnHeaderLevelCount) {\n scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n scene.rowHeaderGroup.setAttribute('y', scene.colHeaderGroup.attribute.y + detaY);\n scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.columnHeaderLevelCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = scene.bodyRowEnd - scene.table.bottomFrozenRowCount;\n }\n\n // 更新以下行位置\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n // if (rowIndex === 2) debugger;\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n const cellGroup = scene.getCell(colIndex, rowIndex);\n const mergeInfo = getCellMergeInfo(scene.table, colIndex, rowIndex);\n if (mergeInfo && (mergeInfo.start.col !== colIndex || mergeInfo.start.row !== rowIndex)) {\n continue;\n }\n\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n}\n\n/**\n * @description: 更新单个单元格高度\n * @return {*}\n */\nexport function updateCellHeightForRow(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n // autoRowHeight: boolean\n) {\n let cellGroup;\n let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col && mergeInfo.start.col === col) {\n // 更新横向merge cell height,只更新一次\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellheight = mergeCell.attribute.height;\n mergeCell.setAttribute('height', mergeCellheight + detaY);\n\n cellGroup = mergeCell;\n distHeight = mergeCell.attribute.height;\n } else if (mergeInfo) {\n // 更新纵向merge cell width\n cell.setAttribute('height', height + detaY);\n\n cellGroup = cell;\n distHeight = height + detaY;\n } else if (!mergeInfo) {\n cell.setAttribute('height', height + detaY);\n cellGroup = cell;\n distHeight = height + detaY;\n // cell.setTheme({\n // rect: {\n // height: cell.attribute.height,\n // },\n // });\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n updateCellHeight(scene, cellGroup, col, row, distHeight, detaY, isHeader);\n}\n\nexport function updateCellHeightForColumn(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n) {\n let cellGroup;\n // let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n if (row === mergeInfo.start.row) {\n // 初始化高度\n (cell as any)._tempHeight = height;\n return;\n } else if (row === mergeInfo.end.row) {\n cell.setAttribute('height', (cell as any)._tempHeight + height);\n cellGroup = cell;\n height = cell.attribute.height;\n // updateCellHeight(scene, cellGroup, col, row, cell.attribute.height, 0, isHeader);\n } else {\n // 累加高度\n (cell as any)._tempHeight += height;\n return;\n }\n } else if (mergeInfo) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n cell.setAttribute('height', height);\n cellGroup = cell;\n\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('height', cell.attribute.height);\n } else {\n cell.setAttribute('height', height);\n cellGroup = cell;\n }\n updateCellHeight(scene, cellGroup, col, row, height, 0, isHeader);\n}\n\nexport function updateCellHeight(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n distHeight: number,\n detaY: number,\n isHeader: boolean\n) {\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cell.attribute.width,\n // cell.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cell.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cell.insertBefore(newBarCell, oldBarCell);\n cell.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cell.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cell,\n cell.parent,\n cell.attribute.x,\n cell.attribute.y,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, scene.table);\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n let renderDefault = true;\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellLocation = scene.table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n false,\n scene.table.heightMode === 'autoHeight',\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n\n if (cell.childrenCount > 0) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customElementsGroup);\n }\n }\n\n if (renderDefault) {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateCellContentHeight(\n cell,\n distHeight,\n detaY,\n // scene.table.internalProps.autoRowHeight,\n scene.table.heightMode === 'autoHeight',\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline\n );\n }\n\n // // 处理自定义渲染\n // const customContainer = cell.getChildByName('custom-container') as Group;\n // if (customContainer) {\n // customContainer.removeAllChild();\n // cell.removeChild(customContainer);\n\n // let customRender;\n // let customLayout;\n // const cellType = scene.table.getCellLocation(col, row);\n // if (cellType !== 'body') {\n // const define = scene.table.getHeaderDefine(col, row);\n // customRender = define?.headerCustomRender;\n // customLayout = define?.headerCustomLayout;\n // } else {\n // const define = scene.table.getBodyColumnDefine(col, row);\n // customRender = define?.customRender || scene.table.customRender;\n // customLayout = define?.customLayout;\n // }\n // const customResult = dealWithCustom(\n // customLayout,\n // customRender,\n // col,\n // row,\n // cell.attribute.width,\n // cell.attribute.height,\n // false,\n // false,\n // scene.table\n // );\n // if (cell.childrenCount > 0) {\n // cell.insertBefore(customResult.elementsGroup, cell.firstChild);\n // } else {\n // cell.appendChild(customResult.elementsGroup);\n // }\n // }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/update-height.ts"],"names":[],"mappings":";;;AAEA,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAoE;AAEpE,gDAAqD;AACrD,sEAA0F;AAC1F,wDAAuD;AACvD,sEAAgE;AAEhE,kEAAiE;AAGjE,SAAgB,eAAe,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAE3E,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC;IAE3E,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,IAAA,iCAAgB,EAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1D,IAAI,SAAS,IAAI,SAAS,CAAC,KAAK,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,CAAC;gBAC5C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;gBAG1C,eAAe,CAAC,aAAa,GAAG,UAAU,CAAC;gBAE3C,IAAA,+BAAe,EACb,eAAe,EACf,UAAU,EACV,WAAW,EACX;oBACE,KAAK,EAAE;wBACL,GAAG,EAAE,SAAS,CAAC,aAAa;wBAC5B,GAAG,EAAE,SAAS,CAAC,aAAa;qBAC7B;oBACD,GAAG,EAAE;wBACH,GAAG,EAAE,SAAS,CAAC,WAAW;wBAC1B,GAAG,EAAE,SAAS,CAAC,WAAW;qBAC3B;iBACF,EACD,KAAK,CACN,CAAC;aACH;SACF;KACF;SAAM;QACL,IAAA,0CAAuB,EAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;KACxG;AACH,CAAC","file":"update-height.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { Group } from '../graphic/group';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentHeight } from '../utils/text-icon-layout';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { resizeCellGroup } from '../group-creater/column-helper';\nimport type { IGraphic } from '@visactor/vrender';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number) {\n // 更新table行高存储\n scene.table.setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.start.col !== col) {\n continue;\n }\n const height = cell.attribute.height;\n // cell.setAttribute('height', height);\n // (cell.firstChild as Rect).setAttribute('height', cell.attribute.height);\n updateCellHeightForRow(scene, cell, col, row, height + detaY, detaY, scene.table.isHeader(col, row));\n\n scene.updateCellContentWhileResize(col, row);\n }\n\n let rowStart = 0;\n let rowEnd = 0;\n // 更新header 高度\n if (row < scene.table.columnHeaderLevelCount) {\n // scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n // scene.rowHeaderGroup.setAttribute('y', scene.rowHeaderGroup.attribute.y + detaY);\n // scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.columnHeaderLevelCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = scene.bodyRowEnd - scene.table.bottomFrozenRowCount;\n }\n\n // 更新以下行位置\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n const cellGroup = scene.getCell(colIndex, rowIndex);\n if (cellGroup.role === 'cell') {\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n }\n}\n\n/**\n * @description: 更新单个单元格高度\n * @return {*}\n */\nexport function updateCellHeightForRow(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n // autoRowHeight: boolean\n) {\n cell.setAttribute('height', height);\n const cellGroup = cell;\n const distHeight = height;\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n updateCellHeight(scene, cellGroup, col, row, distHeight, detaY, isHeader);\n}\n\nexport function updateCellHeightForColumn(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n) {\n cell.setAttribute('height', height);\n const cellGroup = cell;\n updateCellHeight(scene, cellGroup, col, row, height, 0, isHeader);\n}\n\nexport function updateCellHeight(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n distHeight: number,\n detaY: number,\n isHeader: boolean\n) {\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cell.attribute.width,\n // cell.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cell.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cell.insertBefore(newBarCell, oldBarCell);\n cell.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cell.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cell,\n cell.parent,\n cell.attribute.x,\n cell.attribute.y,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, scene.table);\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n let renderDefault = true;\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellLocation = scene.table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n false,\n scene.table.heightMode === 'autoHeight',\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n\n if (cell.childrenCount > 0) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customElementsGroup);\n }\n }\n\n if (renderDefault) {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateMergeCellContentHeight(\n cell,\n distHeight,\n detaY,\n // scene.table.internalProps.autoRowHeight,\n scene.table.heightMode === 'autoHeight',\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene.table\n );\n }\n }\n}\n\nfunction updateMergeCellContentHeight(\n cellGroup: Group,\n distHeight: number,\n detaY: number,\n autoRowHeight: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n distHeight += table.getRowHeight(row);\n }\n for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n updateCellContentHeight(singleCellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { height: contentHeight } = cellGroup.attribute;\n singleCellGroup.contentHeight = distHeight;\n\n resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n }\n }\n } else {\n updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.updateRow = void 0;
|
|
6
6
|
|
|
7
|
-
const group_1 = require("../graphic/group"), cell_helper_1 = require("../group-creater/cell-helper");
|
|
7
|
+
const group_1 = require("../graphic/group"), cell_helper_1 = require("../group-creater/cell-helper"), get_cell_merge_1 = require("../utils/get-cell-merge");
|
|
8
8
|
|
|
9
9
|
function updateRow(removeCells, addCells, updateCells, table) {
|
|
10
10
|
const scene = table.scenegraph, removeRows = deduplication(removeCells.map((cell => cell.row))).sort(((a, b) => a - b)), addRows = deduplication(addCells.map((cell => cell.row))).sort(((a, b) => a - b));
|
|
@@ -13,7 +13,10 @@ function updateRow(removeCells, addCells, updateCells, table) {
|
|
|
13
13
|
})), removeRows.length && resetRowNumber(scene), addRows.forEach((row => {
|
|
14
14
|
addRow(row, scene);
|
|
15
15
|
})), updateCells.forEach((cell => {
|
|
16
|
-
|
|
16
|
+
if (!cell) return;
|
|
17
|
+
const mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, cell.col, cell.row);
|
|
18
|
+
if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) (0,
|
|
19
|
+
cell_helper_1.updateCell)(col, row, scene.table, !1); else (0, cell_helper_1.updateCell)(cell.col, cell.row, scene.table, !1);
|
|
17
20
|
}));
|
|
18
21
|
const newTotalHeight = resetRowNumberAndY(scene);
|
|
19
22
|
addRows.length && (scene.proxy.rowUpdatePos = scene.proxy.rowStart, scene.proxy.rowUpdateDirection = "up",
|
|
@@ -76,6 +79,7 @@ function resetRowNumber(scene) {
|
|
|
76
79
|
|
|
77
80
|
function resetRowNumberAndY(scene) {
|
|
78
81
|
var _a, _b;
|
|
82
|
+
scene.table;
|
|
79
83
|
let newTotalHeight = 0;
|
|
80
84
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
81
85
|
const headerColGroup = scene.getColGroup(col, !0), colGroup = scene.getColGroup(col, !1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/update-row.ts"],"names":[],"mappings":";;;AAEA,4CAAyC;AACzC,8DAA0D;AAM1D,SAAgB,SAAS,CACvB,WAA0B,EAC1B,QAAuB,EACvB,WAA0B,EAC1B,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAIpF,UAAU,CAAC,OAAO,CAAC,GAAG,CA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,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,cAAc,IAAI,CAAC,QAAQ,EAAE;YAChC,SAAS;SACV;QAED,IAAI,QAAQ,GAAG,MAAC,cAAc,CAAC,UAAoB,0CAAE,GAAG,CAAC;QACzD,IAAI,CAAC,GAAG,CAAC,CAAC;QAUV,QAAQ,GAAG,MAAC,QAAQ,CAAC,UAAoB,0CAAE,GAAG,CAAC;QAC/C,MAAM,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC,GAAG,CAAC,CAAC;QACN,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAgB,EAAE,EAAE;YAC5C,SAAS,CAAC,GAAG,GAAG,QAAQ,CAAC;YACzB,QAAQ,EAAE,CAAC;YACX,IAAI,SAAS,CAAC,IAAI,KAAK,MAAM,EAAE;gBAC7B,OAAO;aACR;YACD,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAC/B,CAAC,IAAI,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;QAClC,CAAC,CAAC,CAAC;QACH,cAAc,GAAG,CAAC,CAAC;KAOpB;IACD,OAAO,cAAc,CAAC;AACxB,CAAC","file":"update-row.js","sourcesContent":["import type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => a - b);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n // const updateRows = deduplication(updateCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n // add cells\n addRows.forEach(row => {\n addRow(row, scene);\n });\n\n // add cells\n updateCells.forEach(cell => {\n // updateRowAttr(row, scene);\n cell && updateCell(cell.col, cell.row, scene.table, false);\n });\n\n // reset attribute y and row number in CellGroup\n const newTotalHeight = resetRowNumberAndY(scene);\n\n if (addRows.length) {\n scene.proxy.rowUpdatePos = scene.proxy.rowStart;\n scene.proxy.rowUpdateDirection = 'up';\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n scene.proxy.progress();\n }\n\n // update table size\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n}\n\nfunction removeRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!colGroup) {\n continue;\n }\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.removeChild(cellGroup);\n }\n }\n // TODO 需要整体更新proxy的状态\n scene.proxy.rowEnd--;\n scene.proxy.bodyBottomRow--;\n scene.proxy.currentRow--;\n scene.proxy.totalRow--;\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n // const cellGroup = updateCell(col, row, scene.table, true);\n const cellGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: scene.table.getRowHeight(row)\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.needUpdate = true;\n\n if (!cellGroup) {\n // TODO: deal with data promise situation\n continue;\n }\n\n // insert cellGroup in colGroup\n const colGroup = scene.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n\n if (colGroup.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n (colGroup.firstChild as Group).row = (colGroup.firstChild as Group).row + 1;\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n // let cellBefore: Group;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // cellBefore = cellGroup;\n // return true;\n // }\n // return false;\n // });\n\n const cellBefore = scene.highPerformanceGetCell(col, row, true);\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\n cellBefore && (cellBefore.row = cellBefore.row + 1);\n if (cellBefore !== colGroup.lastChild) {\n colGroup.lastChild && ((colGroup.lastChild as Group).row = (colGroup.lastChild as Group).row + 1);\n }\n }\n }\n\n // // reset row number\n // let rowIndex = (colGroup.firstChild as Group)?.row;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // });\n }\n // TODO 需要整体更新proxy的状态\n scene.proxy.rowEnd++;\n scene.proxy.bodyBottomRow++;\n scene.proxy.currentRow++;\n scene.proxy.totalRow++;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\nfunction resetRowNumber(scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!headerColGroup || !colGroup) {\n continue;\n }\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n headerColGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n rowIndex = (colGroup.firstChild as Group)?.row;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!headerColGroup || !colGroup) {\n continue;\n }\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n let y = 0;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // if (cellGroup.role !== 'cell') {\n // return;\n // }\n // cellGroup.setAttribute('y', y);\n // y+= cellGroup.attribute.height;\n // });\n rowIndex = (colGroup.firstChild as Group)?.row;\n const rowStart = rowIndex;\n y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n\n // const rowCount = rowIndex - rowStart;\n // if (col === 0 && scene.proxy.rowEnd - scene.proxy.rowStart + 1 !== rowCount) {\n // scene.proxy.rowEnd = scene.proxy.rowStart + rowCount - 1;\n // scene.proxy.referenceRow = scene.proxy.rowStart + Math.floor((scene.proxy.rowEnd - scene.proxy.rowStart) / 2);\n // }\n }\n return newTotalHeight;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/update-row.ts"],"names":[],"mappings":";;;AAGA,4CAAyC;AACzC,8DAA0D;AA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E,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,cAAc,IAAI,CAAC,QAAQ,EAAE;YAChC,SAAS;SACV;QAED,IAAI,QAAQ,GAAG,MAAC,cAAc,CAAC,UAAoB,0CAAE,GAAG,CAAC;QACzD,IAAI,CAAC,GAAG,CAAC,CAAC;QAUV,QAAQ,GAAG,MAAC,QAAQ,CAAC,UAAoB,0CAAE,GAAG,CAAC;QAC/C,MAAM,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC,GAAG,CAAC,CAAC;QACN,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAgB,EAAE,EAAE;YAC5C,SAAS,CAAC,GAAG,GAAG,QAAQ,CAAC;YACzB,QAAQ,EAAE,CAAC;YACX,IAAI,SAAS,CAAC,IAAI,KAAK,MAAM,EAAE;gBAC7B,OAAO;aACR;YACD,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAC/B,CAAC,IAAI,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;QAoBlC,CAAC,CAAC,CAAC;QACH,cAAc,GAAG,CAAC,CAAC;KAOpB;IACD,OAAO,cAAc,CAAC;AACxB,CAAC","file":"update-row.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender';\nimport type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport { resizeCellGroup } from '../group-creater/column-helper';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => a - b);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n // const updateRows = deduplication(updateCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n // add cells\n addRows.forEach(row => {\n addRow(row, scene);\n });\n\n // add cells\n updateCells.forEach(cell => {\n // updateRowAttr(row, scene);\n if (!cell) {\n return;\n }\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n updateCell(col, row, scene.table, false);\n }\n }\n } else {\n updateCell(cell.col, cell.row, scene.table, false);\n }\n });\n\n // reset attribute y and row number in CellGroup\n const newTotalHeight = resetRowNumberAndY(scene);\n\n if (addRows.length) {\n scene.proxy.rowUpdatePos = scene.proxy.rowStart;\n scene.proxy.rowUpdateDirection = 'up';\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n scene.proxy.progress();\n }\n\n // update table size\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n}\n\nfunction removeRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!colGroup) {\n continue;\n }\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.removeChild(cellGroup);\n }\n }\n // TODO 需要整体更新proxy的状态\n scene.proxy.rowEnd--;\n scene.proxy.bodyBottomRow--;\n scene.proxy.currentRow--;\n scene.proxy.totalRow--;\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n // const cellGroup = updateCell(col, row, scene.table, true);\n const cellGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: scene.table.getRowHeight(row)\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.needUpdate = true;\n\n if (!cellGroup) {\n // TODO: deal with data promise situation\n continue;\n }\n\n // insert cellGroup in colGroup\n const colGroup = scene.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n\n if (colGroup.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n (colGroup.firstChild as Group).row = (colGroup.firstChild as Group).row + 1;\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n // let cellBefore: Group;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // cellBefore = cellGroup;\n // return true;\n // }\n // return false;\n // });\n\n const cellBefore = scene.highPerformanceGetCell(col, row, true);\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\n cellBefore && (cellBefore.row = cellBefore.row + 1);\n if (cellBefore !== colGroup.lastChild) {\n colGroup.lastChild && ((colGroup.lastChild as Group).row = (colGroup.lastChild as Group).row + 1);\n }\n }\n }\n\n // // reset row number\n // let rowIndex = (colGroup.firstChild as Group)?.row;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // });\n }\n // TODO 需要整体更新proxy的状态\n scene.proxy.rowEnd++;\n scene.proxy.bodyBottomRow++;\n scene.proxy.currentRow++;\n scene.proxy.totalRow++;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\nfunction resetRowNumber(scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!headerColGroup || !colGroup) {\n continue;\n }\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n headerColGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n rowIndex = (colGroup.firstChild as Group)?.row;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n const table = scene.table;\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!headerColGroup || !colGroup) {\n continue;\n }\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n let y = 0;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // if (cellGroup.role !== 'cell') {\n // return;\n // }\n // cellGroup.setAttribute('y', y);\n // y+= cellGroup.attribute.height;\n // });\n rowIndex = (colGroup.firstChild as Group)?.row;\n const rowStart = rowIndex;\n y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n\n // const { col, row } = cellGroup;\n // const mergeInfo = getCellMergeInfo(table, col, row);\n // if (mergeInfo) {\n // cellGroup.mergeStartCol = mergeInfo.start.col;\n // cellGroup.mergeStartRow = mergeInfo.start.row;\n // cellGroup.mergeEndCol = mergeInfo.end.col;\n // cellGroup.mergeEndRow = mergeInfo.end.row;\n\n // const rangeHeight = table.getRowHeight(row);\n // const rangeWidth = table.getColWidth(col);\n // cellGroup.forEachChildren((child: IGraphic) => {\n // child.setAttributes({\n // dx: 0,\n // dy: 0\n // });\n // });\n // resizeCellGroup(cellGroup, rangeWidth, rangeHeight, mergeInfo, table);\n // }\n });\n newTotalHeight = y;\n\n // const rowCount = rowIndex - rowStart;\n // if (col === 0 && scene.proxy.rowEnd - scene.proxy.rowStart + 1 !== rowCount) {\n // scene.proxy.rowEnd = scene.proxy.rowStart + rowCount - 1;\n // scene.proxy.referenceRow = scene.proxy.rowStart + Math.floor((scene.proxy.rowEnd - scene.proxy.rowStart) / 2);\n // }\n }\n return newTotalHeight;\n}\n"]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.updateColWidth = void 0;
|
|
6
6
|
|
|
7
|
-
const axis_1 = require("../../components/axis/axis"), tableHelper_1 = require("../../core/tableHelper"), custom_1 = require("../component/custom"), image_cell_1 = require("../group-creater/cell-type/image-cell"), progress_bar_cell_1 = require("../group-creater/cell-type/progress-bar-cell"), spark_line_cell_1 = require("../group-creater/cell-type/spark-line-cell"), get_cell_merge_1 = require("../utils/get-cell-merge"), get_prop_1 = require("../utils/get-prop"), padding_1 = require("../utils/padding"), text_icon_layout_1 = require("../utils/text-icon-layout"), compute_row_height_1 = require("./compute-row-height"), update_height_1 = require("./update-height");
|
|
7
|
+
const axis_1 = require("../../components/axis/axis"), tableHelper_1 = require("../../core/tableHelper"), custom_1 = require("../component/custom"), image_cell_1 = require("../group-creater/cell-type/image-cell"), progress_bar_cell_1 = require("../group-creater/cell-type/progress-bar-cell"), spark_line_cell_1 = require("../group-creater/cell-type/spark-line-cell"), column_helper_1 = require("../group-creater/column-helper"), get_cell_merge_1 = require("../utils/get-cell-merge"), get_prop_1 = require("../utils/get-prop"), is_merge_cell_group_1 = require("../utils/is-merge-cell-group"), padding_1 = require("../utils/padding"), text_icon_layout_1 = require("../utils/text-icon-layout"), compute_row_height_1 = require("./compute-row-height"), update_height_1 = require("./update-height");
|
|
8
8
|
|
|
9
9
|
function updateColWidth(scene, col, detaX) {
|
|
10
10
|
scene.table.setColWidth(col, scene.table.getColWidth(col) + detaX, !0);
|
|
@@ -41,7 +41,7 @@ function updateColunmWidth(columnGroup, detaX, autoRowHeight, mode, scene) {
|
|
|
41
41
|
const oldColumnWidth = null !== (_a = null == columnGroup ? void 0 : columnGroup.attribute.width) && void 0 !== _a ? _a : 0;
|
|
42
42
|
if (null == columnGroup || columnGroup.setAttribute("width", oldColumnWidth + detaX),
|
|
43
43
|
null == columnGroup || columnGroup.forEachChildren(((cell, index) => {
|
|
44
|
-
if (updateCellWidth(scene, cell, cell.col, cell.row, oldColumnWidth, detaX, "row-body" !== mode || cell.col < scene.table.rowHeaderLevelCount, autoRowHeight)) {
|
|
44
|
+
if (updateCellWidth(scene, cell, cell.col, cell.row, oldColumnWidth, oldColumnWidth + detaX, detaX, "row-body" !== mode || cell.col < scene.table.rowHeaderLevelCount, autoRowHeight)) {
|
|
45
45
|
const mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, cell.col, cell.row);
|
|
46
46
|
if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) resetRowHeight(scene, row); else resetRowHeight(scene, cell.row);
|
|
47
47
|
needRerangeRow = !0;
|
|
@@ -64,17 +64,11 @@ function updateColunmWidth(columnGroup, detaX, autoRowHeight, mode, scene) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
function updateCellWidth(scene, cell, col, row,
|
|
67
|
+
function updateCellWidth(scene, cell, col, row, oldWidth, distWidth, detaX, isHeader, autoRowHeight) {
|
|
68
68
|
var _a, _b, _c;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row), mergeCellWidth = mergeCell.attribute.width;
|
|
73
|
-
mergeCell.setAttribute("width", mergeCellWidth + detaX), cellGroup = mergeCell,
|
|
74
|
-
distWidth = mergeCell.attribute.width, col = cellGroup.col, row = cellGroup.row;
|
|
75
|
-
} else mergeInfo && mergeInfo.start.row === row ? (cell.setAttribute("width", width + detaX),
|
|
76
|
-
cellGroup = cell, distWidth = width + detaX, col = cellGroup.col, row = cellGroup.row) : mergeInfo || (cell.setAttribute("width", width + detaX),
|
|
77
|
-
cellGroup = cell, distWidth = width + detaX);
|
|
69
|
+
if (cell.attribute.width === distWidth) return !1;
|
|
70
|
+
cell.setAttribute("width", distWidth);
|
|
71
|
+
const cellGroup = cell;
|
|
78
72
|
if (!cellGroup) return !1;
|
|
79
73
|
const type = scene.table.isHeader(col, row) ? scene.table._getHeaderLayoutMap(col, row).headerType : scene.table.getBodyColumnType(col, row);
|
|
80
74
|
let isHeightChange = !1;
|
|
@@ -119,33 +113,53 @@ function updateCellWidth(scene, cell, col, row, width, detaX, isHeader, autoRowH
|
|
|
119
113
|
}
|
|
120
114
|
if (renderDefault) {
|
|
121
115
|
const style = scene.table._getCellStyle(col, row);
|
|
122
|
-
isHeightChange = (
|
|
123
|
-
padding_1.getQuadProps)(style.padding), style.textAlign, style.textBaseline, scene);
|
|
116
|
+
isHeightChange = updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, (0,
|
|
117
|
+
padding_1.getQuadProps)(style.padding), style.textAlign, style.textBaseline, scene.table);
|
|
124
118
|
}
|
|
125
119
|
}
|
|
126
120
|
return !!autoRowHeight && isHeightChange;
|
|
127
121
|
}
|
|
128
122
|
|
|
123
|
+
function updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, padding, textAlign, textBaseline, table) {
|
|
124
|
+
if ((0, is_merge_cell_group_1.isMergeCellGroup)(cellGroup)) {
|
|
125
|
+
distWidth = 0;
|
|
126
|
+
let isHeightChange = !1;
|
|
127
|
+
for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) distWidth += table.getColWidth(col);
|
|
128
|
+
let cellHeight = 0;
|
|
129
|
+
for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) cellHeight += table.getRowHeight(row);
|
|
130
|
+
for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
|
|
131
|
+
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
132
|
+
singleCellGroup.forEachChildren((child => {
|
|
133
|
+
child.setAttributes({
|
|
134
|
+
dx: 0,
|
|
135
|
+
dy: 0
|
|
136
|
+
});
|
|
137
|
+
}));
|
|
138
|
+
const changed = (0, text_icon_layout_1.updateCellContentWidth)(singleCellGroup, distWidth, cellHeight, detaX, autoRowHeight, padding, textAlign, textBaseline, table.scenegraph), rangeHeight = table.getRowHeight(row), rangeWidth = table.getColWidth(col);
|
|
139
|
+
singleCellGroup.contentWidth = distWidth, (0, column_helper_1.resizeCellGroup)(singleCellGroup, rangeWidth, rangeHeight, {
|
|
140
|
+
start: {
|
|
141
|
+
col: cellGroup.mergeStartCol,
|
|
142
|
+
row: cellGroup.mergeStartRow
|
|
143
|
+
},
|
|
144
|
+
end: {
|
|
145
|
+
col: cellGroup.mergeEndCol,
|
|
146
|
+
row: cellGroup.mergeEndRow
|
|
147
|
+
}
|
|
148
|
+
}, table), isHeightChange = isHeightChange || changed;
|
|
149
|
+
}
|
|
150
|
+
return isHeightChange;
|
|
151
|
+
}
|
|
152
|
+
return (0, text_icon_layout_1.updateCellContentWidth)(cellGroup, distWidth, table.getRowHeight(cellGroup.row), detaX, autoRowHeight, padding, textAlign, textBaseline, table.scenegraph);
|
|
153
|
+
}
|
|
154
|
+
|
|
129
155
|
function resetRowHeight(scene, row) {
|
|
130
156
|
const maxHeight = (0, compute_row_height_1.computeRowHeight)(row, 0, scene.table.colCount - 1, scene.table);
|
|
157
|
+
scene.table.setRowHeight(row, maxHeight, !0);
|
|
131
158
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
132
|
-
|
|
133
|
-
const cell = scene.highPerformanceGetCell(col, row);
|
|
159
|
+
const distHeight = maxHeight, cell = scene.highPerformanceGetCell(col, row);
|
|
134
160
|
if ("empty" === cell.role) return;
|
|
135
|
-
|
|
136
|
-
if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) rowIndex !== row && (distHeight += scene.table.getRowHeight(rowIndex));
|
|
137
|
-
(0, update_height_1.updateCellHeightForRow)(scene, cell, col, row, distHeight, 0, scene.table.isHeader(col, row));
|
|
161
|
+
(0, update_height_1.updateCellHeightForRow)(scene, cell, col, row, distHeight, distHeight - cell.attribute.height, scene.table.isHeader(col, row));
|
|
138
162
|
}
|
|
139
|
-
scene.table.setRowHeight(row, maxHeight, !0);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function getCleanCellHeight(cell, scene) {
|
|
143
|
-
let maxHeight = 0;
|
|
144
|
-
cell.forEachChildren((child => {
|
|
145
|
-
"icon-left" !== child.role && "icon-right" !== child.role && "text" !== child.name && "content" !== child.name || (maxHeight = Math.max(maxHeight, child.AABBBounds.height()));
|
|
146
|
-
}));
|
|
147
|
-
const padding = (0, padding_1.getQuadProps)(scene.table._getCellStyle(cell.col, cell.row).padding);
|
|
148
|
-
return maxHeight + padding[0] + padding[2];
|
|
149
163
|
}
|
|
150
164
|
|
|
151
165
|
exports.updateColWidth = updateColWidth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/update-width.ts"],"names":[],"mappings":";;;AACA,qDAA2D;AAC3D,wDA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sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport type { Icon } from '../graphic/icon';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { computeRowHeight, computeRowsHeight } from './compute-row-height';\nimport { updateCellHeightForRow } from './update-height';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number) {\n scene.table.setColWidth(col, scene.table.getColWidth(col) + detaX, true);\n\n const autoRowHeight = scene.table.heightMode === 'autoHeight';\n // deal with corner header or column header\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n if (colOrCornerHeaderColumn) {\n updateColunmWidth(colOrCornerHeaderColumn, detaX, autoRowHeight, 'col-corner', scene);\n }\n // deal with row header or body or right frozen cells\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n if (rowHeaderOrBodyColumn) {\n updateColunmWidth(rowHeaderOrBodyColumn, detaX, autoRowHeight, 'row-body', scene);\n }\n\n const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);\n // deal with left bottom frozen cells\n if (leftBottomColumn) {\n updateColunmWidth(leftBottomColumn, detaX, autoRowHeight, 'left-bottom', scene);\n }\n // deal with bottom frozen cells\n const bottomColumn = scene.getColGroupInBottom(col);\n if (bottomColumn) {\n updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'bottom', scene);\n }\n // deal with right bottom frozen cells\n const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);\n if (rightBottomColumn) {\n updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'right-bottom', scene);\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n if (leftBottomColumn) {\n scene.leftBottomCornerGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n if (bottomColumn) {\n scene.bottomFrozenGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n if (rightBottomColumn) {\n scene.rightBottomCornerGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n // scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\nfunction updateColunmWidth(\n columnGroup: Group,\n detaX: number,\n autoRowHeight: boolean,\n mode: 'col-corner' | 'row-body' | 'bottom' | 'left-bottom' | 'right-bottom',\n scene: Scenegraph\n) {\n let needRerangeRow = false;\n // const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColumnWidth = columnGroup?.attribute.width ?? 0;\n columnGroup?.setAttribute('width', oldColumnWidth + detaX);\n // 更新单元格宽度\n columnGroup?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n cell.col,\n cell.row,\n oldColumnWidth,\n detaX,\n mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n let colGroup;\n let oldContainerHeight;\n let row;\n for (let col = 0; col < scene.table.colCount; col++) {\n // const colGroup = scene.getColGroup(col, true);\n if (mode === 'col-corner') {\n row = 0;\n colGroup = scene.getColGroup(col, true);\n oldContainerHeight = scene.colHeaderGroup.attribute.height ?? 0;\n } else if (mode === 'row-body') {\n row = scene.table.frozenRowCount;\n colGroup = scene.getColGroup(col, false);\n oldContainerHeight = scene.bodyGroup.attribute.height ?? 0;\n } else if (mode === 'bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInBottom(col);\n oldContainerHeight = scene.bottomFrozenGroup.attribute.height ?? 0;\n } else if (mode === 'left-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInLeftBottomCorner(col);\n oldContainerHeight = scene.leftBottomCornerGroup.attribute.height ?? 0;\n } else if (mode === 'right-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInRightBottomCorner(col);\n oldContainerHeight = scene.rightBottomCornerGroup.attribute.height ?? 0;\n }\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.role !== 'cell') {\n // cellGroup.setAttribute('y', y);\n // y += scene.table.getRowHeight(cellGroup.row) ?? 0;\n // return;\n // }\n // y += cellGroup.attribute.height ?? 0;\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row) ?? 0;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);\n }\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n width: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean\n): boolean {\n let cellGroup;\n let distWidth;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {\n // 更新横向merge cell width\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellWidth = mergeCell.attribute.width;\n mergeCell.setAttribute('width', mergeCellWidth + detaX);\n\n cellGroup = mergeCell;\n distWidth = mergeCell.attribute.width;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (mergeInfo && mergeInfo.start.row === row) {\n // 更新纵向merge cell width,只更新一次\n cell.setAttribute('width', width + detaX);\n\n cellGroup = cell;\n distWidth = width + detaX;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (!mergeInfo) {\n cell.setAttribute('width', width + detaX);\n cellGroup = cell;\n distWidth = width + detaX;\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else if (cellGroup.firstChild?.name === 'axis') {\n // recreate axis component\n const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, scene.table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n }\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n let renderDefault = true;\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellLocation(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n false,\n scene.table.heightMode === 'autoHeight',\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n isHeightChange = true;\n }\n\n if (cell.childrenCount > 0) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customElementsGroup);\n }\n }\n\n if (renderDefault) {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n isHeightChange = updateCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n }\n }\n\n return autoRowHeight ? isHeightChange : false;\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n // let maxHeight = 0;\n // 获取高度\n const maxHeight = computeRowHeight(row, 0, scene.table.colCount - 1, scene.table);\n // for (let col = 0; col < scene.table.colCount; col++) {\n // const cell = scene.highPerformanceGetCell(col, row);\n // if (cell.role === 'empty') {\n // return;\n // }\n // let cellHeight = scene.table.getRowHeight(row);\n // const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n // cellHeight = cellHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n // }\n // maxHeight = Math.max(maxHeight, cellHeight);\n // }\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n let distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {\n if (rowIndex !== row) {\n distHeight += scene.table.getRowHeight(rowIndex);\n }\n }\n }\n updateCellHeightForRow(scene, cell, col, row, distHeight, 0, scene.table.isHeader(col, row));\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, maxHeight, true);\n}\n\nfunction getCleanCellHeight(cell: Group, scene: Scenegraph) {\n let maxHeight = 0;\n cell.forEachChildren((child: Icon) => {\n if (\n child.role === 'icon-left' ||\n child.role === 'icon-right' ||\n child.name === 'text' ||\n child.name === 'content'\n ) {\n maxHeight = Math.max(maxHeight, child.AABBBounds.height());\n }\n });\n\n const padding = getQuadProps(scene.table._getCellStyle(cell.col, cell.row).padding as number);\n return maxHeight + padding[0] + padding[2];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/update-width.ts"],"names":[],"mappings":";;;AAEA,qDAA2D;AAC3D,wDAAuD;AAGvD,gDAAqD;AAGrD,sEAA0F;AAC1F,oFAAqF;AACrF,gFAAsF;AACtF,kEAAiE;AAEjE,4DAA2D;AAC3D,gDAA4C;AAC5C,sEAAgE;AAChE,8CAAgD;AAChD,gEAAmE;AACnE,6DAA2E;AAC3E,mDAAyD;AAUzD,SAAgB,cAAc,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAC1E,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC;IAEzE,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,KAAK,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;AACJ,CAAC;AAQD,SAAS,cAAc,CAAC,KAAiB,EAAE,GAAW;IAEpD,MAAM,SAAS,GAAG,IAAA,qCAAgB,EAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAElF,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAG/C,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,UAAU,GAAG,SAAS,CAAC;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;YACzB,OAAO;SACR;QAED,IAAA,sCAAsB,EACpB,KAAK,EACL,IAAI,EACJ,GAAG,EACH,GAAG,EACH,UAAU,EACV,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAClC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAC/B,CAAC;KACH;AACH,CAAC","file":"update-width.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport type { Icon } from '../graphic/icon';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport { resizeCellGroup } from '../group-creater/column-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { computeRowHeight, computeRowsHeight } from './compute-row-height';\nimport { updateCellHeightForRow } from './update-height';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number) {\n scene.table.setColWidth(col, scene.table.getColWidth(col) + detaX, true);\n\n const autoRowHeight = scene.table.heightMode === 'autoHeight';\n // deal with corner header or column header\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n if (colOrCornerHeaderColumn) {\n updateColunmWidth(colOrCornerHeaderColumn, detaX, autoRowHeight, 'col-corner', scene);\n }\n // deal with row header or body or right frozen cells\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n if (rowHeaderOrBodyColumn) {\n updateColunmWidth(rowHeaderOrBodyColumn, detaX, autoRowHeight, 'row-body', scene);\n }\n\n const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);\n // deal with left bottom frozen cells\n if (leftBottomColumn) {\n updateColunmWidth(leftBottomColumn, detaX, autoRowHeight, 'left-bottom', scene);\n }\n // deal with bottom frozen cells\n const bottomColumn = scene.getColGroupInBottom(col);\n if (bottomColumn) {\n updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'bottom', scene);\n }\n // deal with right bottom frozen cells\n const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);\n if (rightBottomColumn) {\n updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'right-bottom', scene);\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n if (leftBottomColumn) {\n scene.leftBottomCornerGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n if (bottomColumn) {\n scene.bottomFrozenGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n if (rightBottomColumn) {\n scene.rightBottomCornerGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n // scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\nfunction updateColunmWidth(\n columnGroup: Group,\n detaX: number,\n autoRowHeight: boolean,\n mode: 'col-corner' | 'row-body' | 'bottom' | 'left-bottom' | 'right-bottom',\n scene: Scenegraph\n) {\n let needRerangeRow = false;\n // const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColumnWidth = columnGroup?.attribute.width ?? 0;\n columnGroup?.setAttribute('width', oldColumnWidth + detaX);\n // 更新单元格宽度\n columnGroup?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n cell.col,\n cell.row,\n oldColumnWidth,\n oldColumnWidth + detaX,\n detaX,\n mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n let colGroup;\n let oldContainerHeight;\n let row;\n for (let col = 0; col < scene.table.colCount; col++) {\n // const colGroup = scene.getColGroup(col, true);\n if (mode === 'col-corner') {\n row = 0;\n colGroup = scene.getColGroup(col, true);\n oldContainerHeight = scene.colHeaderGroup.attribute.height ?? 0;\n } else if (mode === 'row-body') {\n row = scene.table.frozenRowCount;\n colGroup = scene.getColGroup(col, false);\n oldContainerHeight = scene.bodyGroup.attribute.height ?? 0;\n } else if (mode === 'bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInBottom(col);\n oldContainerHeight = scene.bottomFrozenGroup.attribute.height ?? 0;\n } else if (mode === 'left-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInLeftBottomCorner(col);\n oldContainerHeight = scene.leftBottomCornerGroup.attribute.height ?? 0;\n } else if (mode === 'right-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInRightBottomCorner(col);\n oldContainerHeight = scene.rightBottomCornerGroup.attribute.height ?? 0;\n }\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.role !== 'cell') {\n // cellGroup.setAttribute('y', y);\n // y += scene.table.getRowHeight(cellGroup.row) ?? 0;\n // return;\n // }\n // y += cellGroup.attribute.height ?? 0;\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row) ?? 0;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);\n }\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n oldWidth: number, // old width, not dist\n distWidth: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean\n): boolean {\n if (cell.attribute.width === distWidth) {\n return false;\n }\n\n cell.setAttribute('width', distWidth);\n // const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // if (mergeInfo && mergeInfo.start.row !== row) {\n // return false;\n // }\n const cellGroup = cell;\n // const distWidth = width + detaX;\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else if (cellGroup.firstChild?.name === 'axis') {\n // recreate axis component\n const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, scene.table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n }\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n let renderDefault = true;\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellLocation(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n false,\n scene.table.heightMode === 'autoHeight',\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n isHeightChange = true;\n }\n\n if (cell.childrenCount > 0) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customElementsGroup);\n }\n }\n\n if (renderDefault) {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n isHeightChange = updateMergeCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene.table\n );\n }\n }\n\n return autoRowHeight ? isHeightChange : false;\n}\n\nfunction updateMergeCellContentWidth(\n cellGroup: Group,\n distWidth: number,\n detaX: number,\n autoRowHeight: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distWidth = 0;\n let isHeightChange = false;\n for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {\n distWidth += table.getColWidth(col);\n }\n let cellHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n cellHeight += table.getRowHeight(row);\n }\n\n for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n const changed = updateCellContentWidth(\n singleCellGroup,\n distWidth,\n cellHeight,\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { width: contentWidth } = cellGroup.attribute;\n singleCellGroup.contentWidth = distWidth;\n\n resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n isHeightChange = isHeightChange || changed;\n }\n }\n return isHeightChange;\n }\n return updateCellContentWidth(\n cellGroup,\n distWidth,\n table.getRowHeight(cellGroup.row),\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n // 获取高度\n const maxHeight = computeRowHeight(row, 0, scene.table.colCount - 1, scene.table);\n // 更新table行高存储\n scene.table.setRowHeight(row, maxHeight, true);\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n\n updateCellHeightForRow(\n scene,\n cell,\n col,\n row,\n distHeight,\n distHeight - cell.attribute.height,\n scene.table.isHeader(col, row)\n );\n }\n}\n"]}
|