@visactor/vtable 0.9.3-alpha.6 → 0.10.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/ListTable.d.ts +2 -1
- package/cjs/ListTable.js +9 -7
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -0
- package/cjs/PivotChart.js +6 -5
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -0
- package/cjs/PivotTable.js +7 -5
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/axis/axis.d.ts +1 -0
- package/cjs/components/axis/axis.js +10 -1
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/components/axis/get-axis-component-size.js +13 -9
- package/cjs/components/axis/get-axis-component-size.js.map +1 -1
- package/cjs/components/legend/legend.js +5 -3
- package/cjs/components/legend/legend.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +8 -5
- package/cjs/core/BaseTable.js +40 -27
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/drill.d.ts +2 -0
- package/cjs/event/drill.js +15 -2
- package/cjs/event/drill.js.map +1 -1
- package/cjs/event/event.js +2 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +1 -1
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/scroll-bar.js +2 -0
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/event/pivot-chart/axis-click.js +3 -2
- package/cjs/event/pivot-chart/axis-click.js.map +1 -1
- package/cjs/event/scroll.js +8 -4
- package/cjs/event/scroll.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 +5 -5
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +2 -2
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-layout.js +4 -2
- package/cjs/layout/pivot-layout.js.map +1 -1
- package/cjs/render/layout/text.js +1 -0
- package/cjs/render/layout/text.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.d.ts +8 -0
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +66 -0
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -0
- package/cjs/scenegraph/graphic/contributions/chart-render.js +9 -35
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +6 -3
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/text.js +6 -4
- package/cjs/scenegraph/graphic/text.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +2 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +3 -3
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/init-scenegraph.d.ts +2 -0
- package/cjs/scenegraph/group-creater/init-scenegraph.js +61 -0
- package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -0
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +7 -2
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +12 -21
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +36 -44
- 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 +5 -19
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.d.ts +2 -0
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js +37 -0
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -0
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/util.d.ts +8 -0
- package/cjs/scenegraph/group-creater/progress/update-position/util.js +70 -0
- package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -0
- package/cjs/scenegraph/layout/compute-col-width.js +5 -3
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.d.ts +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +26 -13
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.d.ts +2 -0
- package/cjs/scenegraph/layout/frozen.js +139 -6
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +2 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +45 -66
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.js +8 -6
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +9 -4
- package/cjs/scenegraph/scenegraph.js +39 -102
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/style/corner-cell.d.ts +2 -2
- package/cjs/scenegraph/style/corner-cell.js +8 -9
- package/cjs/scenegraph/style/corner-cell.js.map +1 -1
- package/cjs/scenegraph/utils/measure-text.js +9 -8
- package/cjs/scenegraph/utils/measure-text.js.map +1 -1
- package/cjs/state/hover/update-position.js +1 -1
- package/cjs/state/hover/update-position.js.map +1 -1
- package/cjs/state/state.d.ts +1 -0
- package/cjs/state/state.js +4 -2
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +10 -2
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +1 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/dist/vtable.js +1244 -790
- package/dist/vtable.min.js +3 -3
- package/es/ListTable.d.ts +2 -1
- package/es/ListTable.js +9 -7
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -0
- package/es/PivotChart.js +6 -5
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +1 -0
- package/es/PivotTable.js +7 -5
- package/es/PivotTable.js.map +1 -1
- package/es/components/axis/axis.d.ts +1 -0
- package/es/components/axis/axis.js +10 -1
- package/es/components/axis/axis.js.map +1 -1
- package/es/components/axis/get-axis-component-size.js +13 -9
- package/es/components/axis/get-axis-component-size.js.map +1 -1
- package/es/components/legend/legend.js +5 -3
- package/es/components/legend/legend.js.map +1 -1
- package/es/core/BaseTable.d.ts +8 -5
- package/es/core/BaseTable.js +34 -20
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/drill.d.ts +2 -0
- package/es/event/drill.js +13 -0
- package/es/event/drill.js.map +1 -1
- package/es/event/event.js +3 -3
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +1 -1
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/scroll-bar.js +2 -0
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/event/pivot-chart/axis-click.js +3 -2
- package/es/event/pivot-chart/axis-click.js.map +1 -1
- package/es/event/scroll.js +4 -1
- package/es/event/scroll.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 +5 -5
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +2 -2
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-layout.js +4 -2
- package/es/layout/pivot-layout.js.map +1 -1
- package/es/render/layout/text.js +1 -0
- package/es/render/layout/text.js.map +1 -1
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.d.ts +8 -0
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +61 -0
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -0
- package/es/scenegraph/graphic/contributions/chart-render.js +9 -34
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +7 -2
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/text.js +6 -4
- package/es/scenegraph/graphic/text.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +2 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +3 -3
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/init-scenegraph.d.ts +2 -0
- package/es/scenegraph/group-creater/init-scenegraph.js +55 -0
- package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -0
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +6 -2
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +13 -18
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +37 -44
- 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 +6 -22
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/update-auto-column.d.ts +2 -0
- package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js +29 -0
- package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -0
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/util.d.ts +8 -0
- package/es/scenegraph/group-creater/progress/update-position/util.js +60 -0
- package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -0
- package/es/scenegraph/layout/compute-col-width.js +4 -2
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.d.ts +1 -1
- package/es/scenegraph/layout/compute-row-height.js +26 -13
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/frozen.d.ts +2 -0
- package/es/scenegraph/layout/frozen.js +137 -3
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +2 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +45 -66
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.js +9 -5
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +9 -4
- package/es/scenegraph/scenegraph.js +39 -104
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/style/corner-cell.d.ts +2 -2
- package/es/scenegraph/style/corner-cell.js +4 -7
- package/es/scenegraph/style/corner-cell.js.map +1 -1
- package/es/scenegraph/utils/measure-text.js +10 -9
- package/es/scenegraph/utils/measure-text.js.map +1 -1
- package/es/state/hover/update-position.js +1 -1
- package/es/state/hover/update-position.js.map +1 -1
- package/es/state/state.d.ts +1 -0
- package/es/state/state.js +5 -1
- package/es/state/state.js.map +1 -1
- package/es/ts-types/base-table.d.ts +10 -2
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +1 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/package.json +2 -2
|
@@ -30,50 +30,52 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
30
30
|
value: !0
|
|
31
31
|
}), exports.updateColContent = exports.dynamicSetX = void 0;
|
|
32
32
|
|
|
33
|
-
const compute_col_width_1 = require("../../../layout/compute-col-width"),
|
|
33
|
+
const compute_col_width_1 = require("../../../layout/compute-col-width"), update_auto_column_1 = require("./update-auto-column"), util_1 = require("./util");
|
|
34
34
|
|
|
35
35
|
function dynamicSetX(x, proxy) {
|
|
36
36
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
37
37
|
const screenLeft = proxy.table.getTargetColAt(x + proxy.table.scenegraph.rowHeaderGroup.attribute.width);
|
|
38
38
|
if (!screenLeft) return;
|
|
39
|
-
|
|
39
|
+
const screenLeftCol = screenLeft.col, screenLeftX = screenLeft.left;
|
|
40
|
+
proxy.screenLeftCol = screenLeftCol;
|
|
40
41
|
const deltaCol = proxy.screenLeftCol - proxy.referenceCol;
|
|
41
|
-
deltaCol > 0 ? (
|
|
42
|
-
|
|
42
|
+
deltaCol > 0 ? (moveColumn(deltaCol, "left", proxy.screenLeftCol, screenLeftX, proxy),
|
|
43
|
+
proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX)) : deltaCol < 0 ? (moveColumn(-deltaCol, "right", proxy.screenLeftCol, screenLeftX, proxy),
|
|
44
|
+
proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX)) : proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX),
|
|
43
45
|
proxy.table.scenegraph.updateNextFrame();
|
|
44
46
|
}));
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
function moveColumn(count, direction, screenLeftCol, proxy) {
|
|
49
|
+
function moveColumn(count, direction, screenLeftCol, screenLeftX, proxy) {
|
|
48
50
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
49
|
-
"left" === direction && proxy.colEnd + count > proxy.bodyRightCol ? count = proxy.bodyRightCol - proxy.colEnd : "right" === direction && proxy.colStart - count < proxy.bodyLeftCol && (count = proxy.colStart - proxy.bodyLeftCol)
|
|
50
|
-
proxy.
|
|
51
|
-
if (count < proxy.colEnd - proxy.colStart) {
|
|
51
|
+
if ("left" === direction && proxy.colEnd + count > proxy.bodyRightCol ? count = proxy.bodyRightCol - proxy.colEnd : "right" === direction && proxy.colStart - count < proxy.bodyLeftCol && (count = proxy.colStart - proxy.bodyLeftCol),
|
|
52
|
+
!(count <= 0)) if (count < proxy.colEnd - proxy.colStart) {
|
|
52
53
|
const startCol = "left" === direction ? proxy.colStart : proxy.colEnd - count + 1, endCol = "left" === direction ? proxy.colStart + count - 1 : proxy.colEnd, distStartCol = "left" === direction ? proxy.colEnd + 1 : proxy.colStart - count, distEndCol = "left" === direction ? proxy.colEnd + count : proxy.colStart - 1;
|
|
53
54
|
(0, compute_col_width_1.computeColsWidth)(proxy.table, distStartCol, distEndCol),
|
|
54
55
|
updatePartColPosition(startCol, endCol, direction, proxy);
|
|
55
|
-
const syncLeftCol =
|
|
56
|
+
const syncLeftCol = distStartCol, syncRightCol = distEndCol;
|
|
56
57
|
proxy.colStart = "left" === direction ? proxy.colStart + count : proxy.colStart - count,
|
|
57
58
|
proxy.colEnd = "left" === direction ? proxy.colEnd + count : proxy.colEnd - count,
|
|
58
|
-
checkFirstColMerge(distStartCol, proxy), updateColContent(syncLeftCol, syncRightCol, proxy),
|
|
59
|
-
|
|
59
|
+
(0, util_1.checkFirstColMerge)(distStartCol, !0, proxy), updateColContent(syncLeftCol, syncRightCol, proxy),
|
|
60
|
+
(0, update_auto_column_1.updateAutoColumn)(syncLeftCol, syncRightCol, proxy.table, direction);
|
|
61
|
+
const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol), deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
|
|
62
|
+
proxy.table.scenegraph.proxy.deltaX += deltaX, proxy.currentCol = "left" === direction ? proxy.currentCol + count : proxy.currentCol - count,
|
|
60
63
|
proxy.totalCol = "left" === direction ? proxy.totalCol + count : proxy.totalCol - count,
|
|
61
64
|
proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2),
|
|
62
|
-
proxy.colUpdatePos = distStartCol, proxy.colUpdateDirection = direction, proxy.table.scenegraph.
|
|
65
|
+
proxy.colUpdatePos = distStartCol, proxy.colUpdateDirection = direction, proxy.table.scenegraph.updateNextFrame(),
|
|
63
66
|
yield proxy.progress();
|
|
64
67
|
} else {
|
|
65
68
|
const distStartCol = "left" === direction ? proxy.colStart + count : proxy.colStart - count, distEndCol = "left" === direction ? proxy.colEnd + count : proxy.colEnd - count;
|
|
66
69
|
(0, compute_col_width_1.computeColsWidth)(proxy.table, distStartCol, distEndCol);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
proxy.
|
|
72
|
-
updateColContent(syncLeftCol, syncRightCol, proxy), proxy.currentCol = "left" === direction ? proxy.currentCol + count : proxy.currentCol - count,
|
|
70
|
+
updateAllColPosition(proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1), count, direction, proxy);
|
|
71
|
+
const syncLeftCol = distStartCol, syncRightCol = distEndCol;
|
|
72
|
+
proxy.colStart = distStartCol, proxy.colEnd = distEndCol, (0, util_1.checkFirstColMerge)(distStartCol, !1, proxy),
|
|
73
|
+
updateColContent(syncLeftCol, syncRightCol, proxy), (0, update_auto_column_1.updateAutoColumn)(syncLeftCol, syncRightCol, proxy.table, distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? "right" : "left"),
|
|
74
|
+
proxy.table.scenegraph.proxy.deltaX = 0, proxy.currentCol = "left" === direction ? proxy.currentCol + count : proxy.currentCol - count,
|
|
73
75
|
proxy.totalCol = "left" === direction ? proxy.totalCol + count : proxy.totalCol - count,
|
|
74
76
|
proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2),
|
|
75
77
|
proxy.colUpdatePos = proxy.colStart, proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? "right" : "left",
|
|
76
|
-
yield proxy.progress();
|
|
78
|
+
proxy.table.scenegraph.updateNextFrame(), yield proxy.progress();
|
|
77
79
|
}
|
|
78
80
|
}));
|
|
79
81
|
}
|
|
@@ -85,36 +87,40 @@ function updateColGroupPosition(colGroup, newCol, x) {
|
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
function updateColGroupContent(colGroup, proxy) {
|
|
90
|
+
if (!colGroup) return;
|
|
88
91
|
let cellGroup = colGroup.firstChild;
|
|
89
92
|
for (;cellGroup; ) {
|
|
90
93
|
cellGroup = proxy.updateCellGroupContent(cellGroup)._next;
|
|
91
94
|
}
|
|
92
|
-
colGroup.needUpdate = !1;
|
|
95
|
+
colGroup.needUpdate = !1, colGroup.setAttribute("width", proxy.table.getColWidth(colGroup.col));
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
function updatePartColPosition(startCol, endCol, direction, proxy) {
|
|
96
99
|
for (let col = startCol; col <= endCol; col++) proxy.table.scenegraph.bodyGroup.childrenCount > 0 && updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy),
|
|
97
|
-
proxy.table.scenegraph.colHeaderGroup.childrenCount > 0 && updateColPosition(proxy.table.scenegraph.
|
|
98
|
-
proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0 && updateColPosition(proxy.table.scenegraph.
|
|
100
|
+
proxy.table.scenegraph.colHeaderGroup.childrenCount > 0 && updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy),
|
|
101
|
+
proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0 && updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
function updateColPosition(containerGroup, direction, proxy) {
|
|
102
105
|
if ("left" === direction) {
|
|
103
|
-
const colGroup = containerGroup.
|
|
104
|
-
updateColGroupPosition(colGroup,
|
|
105
|
-
containerGroup.appendChild(colGroup);
|
|
106
|
+
const colGroup = (0, util_1.getFirstChild)(containerGroup), lastChild = (0, util_1.getLastChild)(containerGroup);
|
|
107
|
+
updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col)),
|
|
108
|
+
containerGroup.appendChild(colGroup), containerGroup.border && containerGroup.appendChild(containerGroup.border);
|
|
106
109
|
} else {
|
|
107
|
-
const colGroup = containerGroup.
|
|
108
|
-
updateColGroupPosition(colGroup,
|
|
110
|
+
const colGroup = (0, util_1.getLastChild)(containerGroup), firstChild = (0, util_1.getFirstChild)(containerGroup);
|
|
111
|
+
updateColGroupPosition(colGroup, firstChild.col - 1, firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1)),
|
|
109
112
|
containerGroup.insertBefore(colGroup, containerGroup.firstChild);
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
function updateColContent(syncLeftCol, syncRightCol, proxy) {
|
|
114
117
|
for (let col = syncLeftCol; col <= syncRightCol; col++) {
|
|
115
|
-
|
|
116
|
-
updateColGroupContent(
|
|
117
|
-
|
|
118
|
+
const colGroup = proxy.table.scenegraph.getColGroup(col);
|
|
119
|
+
colGroup && updateColGroupContent(colGroup, proxy);
|
|
120
|
+
const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, !0);
|
|
121
|
+
colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);
|
|
122
|
+
const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);
|
|
123
|
+
bottomColGroup && updateColGroupContent(bottomColGroup, proxy);
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
|
|
@@ -128,19 +134,5 @@ function updateAllColPosition(distStartColY, count, direction, proxy) {
|
|
|
128
134
|
}));
|
|
129
135
|
}
|
|
130
136
|
|
|
131
|
-
function checkFirstColMerge(col, proxy) {
|
|
132
|
-
for (let row = 0; row < proxy.table.rowCount; row++) {
|
|
133
|
-
if (row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart || row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount) continue;
|
|
134
|
-
const range = (0, get_cell_merge_1.getCellMergeInfo)(proxy.table, col, row);
|
|
135
|
-
if (range && range.start.row !== row) {
|
|
136
|
-
const oldCellGroup = proxy.highPerformanceGetCell(col, row, !0), newCellGroup = (0,
|
|
137
|
-
cell_helper_1.updateCell)(range.start.col, range.start.row, proxy.table, !0);
|
|
138
|
-
newCellGroup.col = col, newCellGroup.row = row, newCellGroup.setAttribute("x", proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1)),
|
|
139
|
-
oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup), oldCellGroup.parent.removeChild(oldCellGroup),
|
|
140
|
-
oldCellGroup.needUpdate = !1, newCellGroup.needUpdate = !1, proxy.cellCache.get(col) && proxy.cellCache.set(col, newCellGroup);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
137
|
exports.dynamicSetX = dynamicSetX, exports.updateColContent = updateColContent;
|
|
146
138
|
//# sourceMappingURL=dynamic-set-x.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-x.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yEAAqE;AACrE,kEAAiE;AACjE,mDAA+C;AAG/C,SAAsB,WAAW,CAAC,CAAS,EAAE,KAAiB;;QAC5D,MAAM,UAAU,GAAI,KAAK,CAAC,KAAsB,CAAC,cAAc,CAC7D,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAC1D,CAAC;QACF,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QAED,KAAK,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC;QACrC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QAE1D,IAAI,QAAQ,GAAG,CAAC,EAAE;YAEhB,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;YAChD,MAAM,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;SAChE;aAAM,IAAI,QAAQ,GAAG,CAAC,EAAE;YAEvB,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;YAChD,MAAM,UAAU,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,CA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,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;YAClE,MAAM,YAAY,GAAG,IAAA,wBAAU,EAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAErF,YAAY,CAAC,GAAG,GAAG,GAAG,CAAC;YACvB,YAAY,CAAC,GAAG,GAAG,GAAG,CAAC;YACvB,YAAY,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;YAE/G,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;YAC5D,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YAE9C,YAAY,CAAC,UAAU,GAAG,KAAK,CAAC;YAChC,YAAY,CAAC,UAAU,GAAG,KAAK,CAAC;YAGhC,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBAC5B,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;aACxC;SACF;KACF;AACH,CAAC","file":"dynamic-set-x.js","sourcesContent":["import type { BaseTableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport { getCellMergeInfo } from '../../../utils/get-cell-merge';\nimport { updateCell } from '../../cell-helper';\nimport type { SceneProxy } from '../proxy';\n\nexport async function dynamicSetX(x: number, proxy: SceneProxy) {\n const screenLeft = (proxy.table as BaseTableAPI).getTargetColAt(\n x + proxy.table.scenegraph.rowHeaderGroup.attribute.width\n );\n if (!screenLeft) {\n return;\n }\n\n proxy.screenLeftCol = screenLeft.col;\n const deltaCol = proxy.screenLeftCol - proxy.referenceCol;\n\n if (deltaCol > 0) {\n // 向右滚动,左部column group移到右部\n proxy.table.scenegraph.setBodyAndColHeaderX(-x);\n await moveColumn(deltaCol, 'left', proxy.screenLeftCol, proxy);\n } else if (deltaCol < 0) {\n // 向左滚动,右部cell group移到左部\n proxy.table.scenegraph.setBodyAndColHeaderX(-x);\n await moveColumn(-deltaCol, 'right', proxy.screenLeftCol, proxy);\n } else {\n // 不改变row,更新body group范围\n proxy.table.scenegraph.setBodyAndColHeaderX(-x);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveColumn(count: number, direction: 'left' | 'right', screenLeftCol: number, proxy: SceneProxy) {\n // 限制count范围\n if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {\n count = proxy.bodyRightCol - proxy.colEnd;\n } else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {\n count = proxy.colStart - proxy.bodyLeftCol;\n }\n\n const bodyGroup = proxy.table.scenegraph.bodyGroup;\n\n // 两种更新模式\n // 1. count < colEnd - colStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= colEnd - colStart:整体移动到目标位置\n if (count < proxy.colEnd - proxy.colStart) {\n // 计算更新区域\n const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;\n const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;\n const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n\n // console.log('move', startCol, endCol, direction);\n // for (let col = startCol; col <= endCol; col++) {\n // if (direction === 'left') {\n // const colGroup = bodyGroup.firstChild as Group;\n // updateColGroupPosition(\n // colGroup,\n // (bodyGroup.lastChild as Group).col + 1,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n // );\n // bodyGroup.appendChild(colGroup);\n // } else {\n // const colGroup = bodyGroup.lastChild as Group;\n // updateColGroupPosition(\n // colGroup,\n // (bodyGroup.firstChild as Group).col - 1,\n // (bodyGroup.firstChild as Group).attribute.x - proxy.table.getColWidth((bodyGroup.firstChild as Group).col - 1)\n // );\n // bodyGroup.insertBefore(colGroup, bodyGroup.firstChild);\n // }\n // }\n updatePartColPosition(startCol, endCol, direction, proxy);\n\n // 更新同步范围\n const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenColCount * 1);\n const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenColCount * 2);\n // for (let col = syncLeftCol; col <= syncRightCol; col++) {\n // const colGroup = proxy.table.scenegraph.getColGroup(col);\n // updateColGroupContent(colGroup, proxy);\n // }\n\n proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n checkFirstColMerge(distStartCol, proxy);\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = distStartCol;\n proxy.colUpdateDirection = direction;\n // console.log('col move end proxy', proxy.colStart, proxy.colEnd);\n // console.log(\n // 'col move end cell col',\n // (proxy.table as any).scenegraph.bodyGroup.firstChild.col,\n // (proxy.table as any).scenegraph.bodyGroup.lastChild.col\n // );\n // console.log('sync', proxy.referenceCol, proxy.colStart, proxy.colEnd);\n\n proxy.table.scenegraph.stage.render();\n\n // 开始异步任务\n await proxy.progress();\n } else {\n const distStartCol = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);\n console.log('distStartColY', proxy.bodyLeftCol, distStartCol - 1, distStartColY);\n\n // bodyGroup.forEachChildren((colGroup: Group, index) => {\n // if (colGroup.type === 'group') {\n // updateColGroupPosition(\n // colGroup,\n // direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n // index === 0 // row === proxy.rowStart\n // ? distStartColY\n // : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n // );\n // }\n // });\n\n // 更新同步范围\n updateAllColPosition(distStartColY, count, direction, proxy);\n const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenRowCount * 1);\n const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenRowCount * 2);\n // console.log('更新同步范围col', syncLeftCol, syncRightCol);\n // for (let col = syncLeftCol; col <= syncRightCol; col++) {\n // const colGroup = proxy.table.scenegraph.getColGroup(col);\n // updateColGroupContent(colGroup, proxy);\n // }\n\n proxy.colStart = distStartCol;\n proxy.colEnd = distEndCol;\n checkFirstColMerge(distStartCol, proxy);\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n // console.log('sync', proxy.referenceCol, proxy.colStart, proxy.colEnd);\n // console.log('move total end proxy col', proxy.colStart, proxy.colEnd);\n // console.log(\n // 'move total end cell col',\n // (proxy.table as any).scenegraph.bodyGroup.firstChild.row,\n // (proxy.table as any).scenegraph.bodyGroup.lastChild.row\n // );\n // proxy.table.scenegraph.stage.render();\n\n await proxy.progress();\n }\n}\n\nfunction updateColGroupPosition(colGroup: Group, newCol: number, x: number) {\n // 更新位置&col\n colGroup.col = newCol;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.col = newCol;\n cellGroup.needUpdate = true;\n });\n colGroup.setAttribute('x', x);\n colGroup.needUpdate = true;\n}\n\nfunction updateColGroupContent(colGroup: Group, proxy: SceneProxy) {\n // colGroup.forEachChildren((cellGroup: Group) => {\n // proxy.updateCellGroupContent(cellGroup);\n // });\n // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // const cellGroup = proxy.highPerformanceGetCell(colGroup.col, row);\n // proxy.updateCellGroupContent(cellGroup);\n // }\n let cellGroup = colGroup.firstChild;\n while (cellGroup) {\n const newCellGroup = proxy.updateCellGroupContent(cellGroup as Group);\n cellGroup = newCellGroup._next;\n }\n colGroup.needUpdate = false;\n}\n\nfunction updatePartColPosition(startCol: number, endCol: number, direction: 'left' | 'right', proxy: SceneProxy) {\n for (let col = startCol; col <= endCol; col++) {\n if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n }\n}\n\nfunction updateColPosition(containerGroup: Group, direction: 'left' | 'right', proxy: SceneProxy) {\n if (direction === 'left') {\n const colGroup = containerGroup.firstChild as Group;\n updateColGroupPosition(\n colGroup,\n (containerGroup.lastChild as Group).col + 1,\n (containerGroup.lastChild as Group).attribute.x + (containerGroup.lastChild as Group).attribute.width\n );\n containerGroup.appendChild(colGroup);\n } else {\n const colGroup = containerGroup.lastChild as Group;\n updateColGroupPosition(\n colGroup,\n (containerGroup.firstChild as Group).col - 1,\n (containerGroup.firstChild as Group).attribute.x -\n proxy.table.getColWidth((containerGroup.firstChild as Group).col - 1)\n );\n containerGroup.insertBefore(colGroup, containerGroup.firstChild);\n }\n}\n\nexport function updateColContent(syncLeftCol: number, syncRightCol: number, proxy: SceneProxy) {\n for (let col = syncLeftCol; col <= syncRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n updateColGroupContent(colGroup, proxy);\n\n const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);\n updateColGroupContent(colHeaderColGroup, proxy);\n\n const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);\n updateColGroupContent(bottomColGroup, proxy);\n }\n}\n\nfunction updateAllColPosition(distStartColY: number, count: number, direction: 'left' | 'right', proxy: SceneProxy) {\n proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n}\n\nfunction checkFirstColMerge(col: number, proxy: SceneProxy) {\n for (let row = 0; row < proxy.table.rowCount; row++) {\n if (\n (row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||\n (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)\n ) {\n continue;\n }\n\n const range = getCellMergeInfo(proxy.table, col, row);\n if (range && range.start.row !== row) {\n // 在row的位置添加range.start.row单元格\n const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);\n const newCellGroup = updateCell(range.start.col, range.start.row, proxy.table, true);\n\n newCellGroup.col = col;\n newCellGroup.row = row;\n newCellGroup.setAttribute('x', proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1));\n\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n oldCellGroup.needUpdate = false;\n newCellGroup.needUpdate = false;\n\n // update cache\n if (proxy.cellCache.get(col)) {\n proxy.cellCache.set(col, newCellGroup);\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-x.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yEAAqE;AAErE,6DAAwD;AACxD,iCAAyE;AAEzE,SAAsB,WAAW,CAAC,CAAS,EAAE,KAAiB;;QAC5D,MAAM,UAAU,GAAI,KAAK,CAAC,KAAsB,CAAC,cAAc,CAC7D,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAC1D,CAAC;QACF,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QACD,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC;QACrC,MAA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G,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,EAElE,KAAK,KAAK,CAAC;gBACT,CAAC,CAAC,aAAa;gBACf,CAAC,CAAE,QAAQ,CAAC,KAAe,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAE,QAAQ,CAAC,KAAe,CAAC,GAAG,CAAC,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,QAAe,EAAE,KAAa,EAAE,EAAE;QAClF,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;YAC7B,sBAAsB,CACpB,QAAQ,EACR,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,EAElE,KAAK,KAAK,CAAC;gBACT,CAAC,CAAC,aAAa;gBACf,CAAC,CAAE,QAAQ,CAAC,KAAe,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAE,QAAQ,CAAC,KAAe,CAAC,GAAG,CAAC,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"dynamic-set-x.js","sourcesContent":["import type { BaseTableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoColumn } from './update-auto-column';\nimport { checkFirstColMerge, getFirstChild, getLastChild } from './util';\n\nexport async function dynamicSetX(x: number, proxy: SceneProxy) {\n const screenLeft = (proxy.table as BaseTableAPI).getTargetColAt(\n x + proxy.table.scenegraph.rowHeaderGroup.attribute.width\n );\n if (!screenLeft) {\n return;\n }\n const screenLeftCol = screenLeft.col;\n const screenLeftX = screenLeft.left;\n proxy.screenLeftCol = screenLeftCol;\n const deltaCol = proxy.screenLeftCol - proxy.referenceCol;\n\n if (deltaCol > 0) {\n // 向右滚动,左部column group移到右部\n moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else if (deltaCol < 0) {\n // 向左滚动,右部cell group移到左部\n moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else {\n // 不改变row,更新body group范围\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveColumn(\n count: number,\n direction: 'left' | 'right',\n screenLeftCol: number,\n screenLeftX: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {\n count = proxy.bodyRightCol - proxy.colEnd;\n } else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {\n count = proxy.colStart - proxy.bodyLeftCol;\n }\n\n if (count <= 0) {\n return;\n }\n\n // 两种更新模式\n // 1. count < colEnd - colStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= colEnd - colStart:整体移动到目标位置\n if (count < proxy.colEnd - proxy.colStart) {\n // 计算更新区域\n const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;\n const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;\n const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n updatePartColPosition(startCol, endCol, direction, proxy);\n\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n checkFirstColMerge(distStartCol, true, proxy);\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n direction\n );\n\n const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol);\n const deltaX =\n screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);\n proxy.table.scenegraph.proxy.deltaX += deltaX;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = distStartCol;\n proxy.colUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n\n // 开始异步任务\n await proxy.progress();\n } else {\n const distStartCol = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);\n\n // 更新同步范围\n updateAllColPosition(distStartColY, count, direction, proxy);\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = distStartCol;\n proxy.colEnd = distEndCol;\n checkFirstColMerge(distStartCol, false, proxy);\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left' // 跳转到右侧时,从右向左对齐\n );\n proxy.table.scenegraph.proxy.deltaX = 0;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n\n proxy.table.scenegraph.updateNextFrame();\n await proxy.progress();\n }\n}\n\nfunction updateColGroupPosition(colGroup: Group, newCol: number, x: number) {\n // 更新位置&col\n colGroup.col = newCol;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.col = newCol;\n cellGroup.needUpdate = true;\n });\n colGroup.setAttribute('x', x);\n colGroup.needUpdate = true;\n}\n\nfunction updateColGroupContent(colGroup: Group, proxy: SceneProxy) {\n if (!colGroup) {\n return;\n }\n // colGroup.forEachChildren((cellGroup: Group) => {\n // proxy.updateCellGroupContent(cellGroup);\n // });\n // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // const cellGroup = proxy.highPerformanceGetCell(colGroup.col, row);\n // proxy.updateCellGroupContent(cellGroup);\n // }\n let cellGroup = colGroup.firstChild;\n while (cellGroup) {\n const newCellGroup = proxy.updateCellGroupContent(cellGroup as Group);\n cellGroup = newCellGroup._next;\n }\n colGroup.needUpdate = false;\n colGroup.setAttribute('width', proxy.table.getColWidth(colGroup.col));\n}\n\nfunction updatePartColPosition(startCol: number, endCol: number, direction: 'left' | 'right', proxy: SceneProxy) {\n for (let col = startCol; col <= endCol; col++) {\n if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);\n }\n }\n}\n\nfunction updateColPosition(containerGroup: Group, direction: 'left' | 'right', proxy: SceneProxy) {\n if (direction === 'left') {\n const colGroup = getFirstChild(containerGroup);\n const lastChild = getLastChild(containerGroup);\n updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col));\n containerGroup.appendChild(colGroup);\n if (containerGroup.border) {\n containerGroup.appendChild(containerGroup.border);\n }\n } else {\n const colGroup = getLastChild(containerGroup);\n const firstChild = getFirstChild(containerGroup);\n updateColGroupPosition(\n colGroup,\n firstChild.col - 1,\n firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1)\n );\n containerGroup.insertBefore(colGroup, containerGroup.firstChild);\n }\n}\n\nexport function updateColContent(syncLeftCol: number, syncRightCol: number, proxy: SceneProxy) {\n for (let col = syncLeftCol; col <= syncRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup && updateColGroupContent(colGroup, proxy);\n\n const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);\n colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);\n\n const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);\n bottomColGroup && updateColGroupContent(bottomColGroup, proxy);\n }\n}\n\nfunction updateAllColPosition(distStartColY: number, count: number, direction: 'left' | 'right', proxy: SceneProxy) {\n proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n}\n"]}
|
|
@@ -30,7 +30,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
30
30
|
value: !0
|
|
31
31
|
}), exports.updateRowContent = exports.dynamicSetY = void 0;
|
|
32
32
|
|
|
33
|
-
const compute_row_height_1 = require("../../../layout/compute-row-height"),
|
|
33
|
+
const compute_row_height_1 = require("../../../layout/compute-row-height"), update_auto_row_1 = require("./update-auto-row"), util_1 = require("./util");
|
|
34
34
|
|
|
35
35
|
function dynamicSetY(y, proxy) {
|
|
36
36
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
@@ -55,10 +55,10 @@ function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
|
|
|
55
55
|
const topRow = Math.max(proxy.bodyTopRow, screenTopRow - 1 * proxy.screenRowCount), BottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + 2 * proxy.screenRowCount);
|
|
56
56
|
syncTopRow = Math.max(distStartRow, topRow), syncBottomRow = Math.min(distEndRow, BottomRow);
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
58
|
+
if ((0, compute_row_height_1.computeRowsHeight)(proxy.table, syncTopRow, syncBottomRow),
|
|
59
59
|
proxy.rowStart = "up" === direction ? proxy.rowStart + count : proxy.rowStart - count,
|
|
60
60
|
proxy.rowEnd = "up" === direction ? proxy.rowEnd + count : proxy.rowEnd - count,
|
|
61
|
-
checkFirstRowMerge(syncTopRow, proxy), updateRowContent(syncTopRow, syncBottomRow, proxy),
|
|
61
|
+
(0, util_1.checkFirstRowMerge)(syncTopRow, proxy), updateRowContent(syncTopRow, syncBottomRow, proxy),
|
|
62
62
|
"autoHeight" === proxy.table.heightMode) {
|
|
63
63
|
(0, update_auto_row_1.updateAutoRow)(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, direction);
|
|
64
64
|
const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, screenTopRow, !0), delaY = screenTopY - (cellGroup.attribute.y + proxy.table.getFrozenRowsHeight() + proxy.table.scenegraph.proxy.deltaY);
|
|
@@ -75,8 +75,8 @@ function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
|
|
|
75
75
|
updateAllRowPosition(proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1), count, direction, proxy),
|
|
76
76
|
"autoHeight" === proxy.table.heightMode ? (syncTopRow = distStartRow, syncBottomRow = distEndRow) : (syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - 1 * proxy.screenRowCount),
|
|
77
77
|
syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + 2 * proxy.screenRowCount)),
|
|
78
|
-
|
|
79
|
-
proxy.rowStart = distStartRow, proxy.rowEnd = distEndRow, checkFirstRowMerge(syncTopRow, proxy),
|
|
78
|
+
(0, compute_row_height_1.computeRowsHeight)(proxy.table, syncTopRow, syncBottomRow),
|
|
79
|
+
proxy.rowStart = distStartRow, proxy.rowEnd = distEndRow, (0, util_1.checkFirstRowMerge)(syncTopRow, proxy),
|
|
80
80
|
updateRowContent(syncTopRow, syncBottomRow, proxy), "autoHeight" === proxy.table.heightMode && (0,
|
|
81
81
|
update_auto_row_1.updateAutoRow)(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? "down" : "up"),
|
|
82
82
|
proxy.table.scenegraph.proxy.deltaY = 0, proxy.currentRow = "up" === direction ? proxy.currentRow + count : proxy.currentRow - count,
|
|
@@ -151,19 +151,5 @@ function updateRowContent(syncTopRow, syncBottomRow, proxy) {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
function checkFirstRowMerge(row, proxy) {
|
|
155
|
-
for (let col = 0; col < proxy.table.colCount; col++) {
|
|
156
|
-
if (col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart || col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount) continue;
|
|
157
|
-
const range = (0, get_cell_merge_1.getCellMergeInfo)(proxy.table, col, row);
|
|
158
|
-
if (range && range.start.row !== row) {
|
|
159
|
-
const oldCellGroup = proxy.highPerformanceGetCell(col, row, !0), newCellGroup = (0,
|
|
160
|
-
cell_helper_1.updateCell)(range.start.col, range.start.row, proxy.table, !0);
|
|
161
|
-
newCellGroup.col = col, newCellGroup.row = row, newCellGroup.setAttribute("y", proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1)),
|
|
162
|
-
oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup), oldCellGroup.parent.removeChild(oldCellGroup),
|
|
163
|
-
oldCellGroup.needUpdate = !1, newCellGroup.needUpdate = !1, proxy.cellCache.get(col) && proxy.cellCache.set(col, newCellGroup);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
154
|
exports.dynamicSetY = dynamicSetY, exports.updateRowContent = updateRowContent;
|
|
169
155
|
//# sourceMappingURL=dynamic-set-y.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-y.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2EAAuE;AACvE,kEAAiE;AACjE,mDAA+C;AAE/C,uDAAkD;AAElD,SAAsB,WAAW,CAAC,CAAS,EAAE,KAAiB;;Q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,CAAC,GAAG,GAAG,GAAG,CAAC;YACvB,YAAY,CAAC,YAAY,CACvB,GAAG,EACH,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CACnF,CAAC;YAEF,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;YAC5D,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YAE9C,YAAY,CAAC,UAAU,GAAG,KAAK,CAAC;YAChC,YAAY,CAAC,UAAU,GAAG,KAAK,CAAC;YAGhC,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBAC5B,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;aACxC;SACF;KACF;AACH,CAAC","file":"dynamic-set-y.js","sourcesContent":["import type { Group } from '../../../graphic/group';\nimport { computeRowsHeight } from '../../../layout/compute-row-height';\nimport { getCellMergeInfo } from '../../../utils/get-cell-merge';\nimport { updateCell } from '../../cell-helper';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoRow } from './update-auto-row';\n\nexport async function dynamicSetY(y: number, proxy: SceneProxy) {\n // 计算变动row range\n // const screenTopRow = proxy.table.getRowAt(y).row;\n // proxy.deltaY = 0;\n const screenTop = (proxy.table as any).getTargetRowAt(y + proxy.table.scenegraph.colHeaderGroup.attribute.height);\n if (!screenTop) {\n return;\n }\n const screenTopRow = screenTop.row;\n const screenTopY = screenTop.top;\n proxy.screenTopRow = screenTopRow;\n const deltaRow = screenTopRow - proxy.referenceRow;\n if (deltaRow > 0) {\n // 向下滚动,顶部cell group移到底部\n moveCell(deltaRow, 'up', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n // if (proxy.rowEnd === proxy.table.scenegraph.proxy.bodyBottomRow) {\n // const totalHeight = proxy.table.getAllRowsHeight();\n // const top = totalHeight - proxy.table.scenegraph.height;\n // proxy.updateBody(top);\n // } else {\n // proxy.updateBody(y);\n // }\n } else if (deltaRow < 0) {\n // 向上滚动,底部cell group移到顶部\n moveCell(-deltaRow, 'down', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n // if (proxy.rowStart === proxy.bodyTopRow) {\n // proxy.updateBody(0);\n // } else {\n // proxy.updateBody(y);\n // }\n } else {\n // 不改变row,更新body group范围\n proxy.updateBody(y - proxy.deltaY);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveCell(\n count: number,\n direction: 'up' | 'down',\n screenTopRow: number,\n screenTopY: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'up' && proxy.rowEnd + count > proxy.bodyBottomRow) {\n count = proxy.bodyBottomRow - proxy.rowEnd;\n } else if (direction === 'down' && proxy.rowStart - count < proxy.bodyTopRow) {\n count = proxy.rowStart - proxy.bodyTopRow;\n }\n\n // 两种更新模式\n // 1. count < rowEnd - rowStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= rowEnd - rowStart:整体移动到目标位置\n if (count < proxy.rowEnd - proxy.rowStart) {\n // 计算更新区域\n const startRow = direction === 'up' ? proxy.rowStart : proxy.rowEnd - count + 1;\n const endRow = direction === 'up' ? proxy.rowStart + count - 1 : proxy.rowEnd;\n // console.log('move', startRow, endRow, direction);\n updatePartRowPosition(startRow, endRow, direction, proxy);\n const distStartRow = direction === 'up' ? proxy.rowEnd + 1 : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowStart - 1;\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n const topRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n const BottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n // get coincide of distStartRow&distEndRow and topRow&BottomRow\n syncTopRow = Math.max(distStartRow, topRow);\n syncBottomRow = Math.min(distEndRow, BottomRow);\n }\n\n // const syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n // const syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n if (proxy.table.heightMode === 'autoHeight') {\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n }\n\n proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n\n checkFirstRowMerge(syncTopRow, proxy);\n\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n if (proxy.table.heightMode === 'autoHeight') {\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n direction\n );\n\n const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, screenTopRow, true);\n // console.log('screenTopRow: ', screenTopRow);\n const delaY =\n screenTopY - (cellGroup.attribute.y + proxy.table.getFrozenRowsHeight() + proxy.table.scenegraph.proxy.deltaY);\n // console.log('screenTopY change: ', delaY);\n proxy.table.scenegraph.proxy.deltaY += delaY;\n // console.log('proxy deltaY', proxy.deltaY);\n // console.log('proxy scrollTop', proxy.table.getTargetRowAt(proxy.table.scrollTop + 104));\n }\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = distStartRow;\n proxy.rowUpdateDirection = direction;\n // console.log('move end proxy', proxy.rowStart, proxy.rowEnd);\n // console.log(\n // 'move end cell',\n // (proxy.table as any).scenegraph.bodyGroup.firstChild.firstChild.row,\n // (proxy.table as any).scenegraph.bodyGroup.firstChild.lastChild.row\n // );\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n } else {\n const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n const distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);\n // 更新distStartRow位置的merge单元格,避免distStartRow位置不是merge的起始位置造成的空白\n\n // 更新同步范围\n updateAllRowPosition(distStartRowY, count, direction, proxy);\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n }\n // console.log('更新同步范围', syncTopRow, syncBottomRow);\n if (proxy.table.heightMode === 'autoHeight') {\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n }\n proxy.rowStart = distStartRow;\n proxy.rowEnd = distEndRow;\n\n checkFirstRowMerge(syncTopRow, proxy);\n\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n // console.log(\n // 'updateAutoRow',\n // distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up'\n // );\n\n if (proxy.table.heightMode === 'autoHeight') {\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n\n proxy.table.scenegraph.proxy.deltaY = 0;\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = proxy.rowStart;\n proxy.rowUpdateDirection = distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up';\n // console.log('move total end proxy', proxy.rowStart, proxy.rowEnd);\n // console.log(\n // 'move total end cell',\n // (proxy.table as any).scenegraph.bodyGroup.firstChild.firstChild.row,\n // (proxy.table as any).scenegraph.bodyGroup.firstChild.lastChild.row\n // );\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n }\n}\n\nfunction updatePartRowPosition(startRow: number, endRow: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n}\n\nfunction updateCellGroupPosition(colGroup: Group, direction: 'up' | 'down', proxy: SceneProxy) {\n if (direction === 'up') {\n const cellGroup = colGroup.firstChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.lastChild as Group).row + 1,\n (colGroup.lastChild as Group).attribute.y + proxy.table.getRowHeight((colGroup.lastChild as Group).row) // (colGroup.lastChild as Group).attribute.height\n );\n colGroup.appendChild(cellGroup);\n } else {\n const cellGroup = colGroup.lastChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.firstChild as Group).row - 1,\n (colGroup.firstChild as Group).attribute.y - proxy.table.getRowHeight((cellGroup as Group).row) // cellGroup.attribute.height\n );\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n }\n}\n\nfunction updateAllRowPosition(distStartRowY: number, count: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n}\n\nexport function updateRowContent(syncTopRow: number, syncBottomRow: number, proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n}\n\nfunction checkFirstRowMerge(row: number, proxy: SceneProxy) {\n for (let col = 0; col < proxy.table.colCount; col++) {\n if (\n (col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart) ||\n (col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount)\n ) {\n continue;\n }\n const range = getCellMergeInfo(proxy.table, col, row);\n if (range && range.start.row !== row) {\n // 在row的位置添加range.start.row单元格\n const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);\n const newCellGroup = updateCell(range.start.col, range.start.row, proxy.table, true);\n\n newCellGroup.col = col;\n newCellGroup.row = row;\n newCellGroup.setAttribute(\n 'y',\n proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1)\n );\n\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n oldCellGroup.needUpdate = false;\n newCellGroup.needUpdate = false;\n\n // update cache\n if (proxy.cellCache.get(col)) {\n proxy.cellCache.set(col, newCellGroup);\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-y.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2EAAuE;AAEvE,uDAAkD;AAClD,iCAA4C;AAE5C,SAAsB,WAAW,CAAC,CAAS,EAAE,KAAiB;;QAI5D,MAAM,SAAS,GAAI,KAAK,CAAC,KAAa,CAAC,cAAc,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAClH,IAAI,CAAC,SAAS,EAAE;YACd,OAAO;SACR;QACD,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC;QACnC,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC;QACjC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;QAClC,MAAM,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QACnD,IAAI,QAAQ,GAAG,CAAC,EAAE;YAEhB,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;YAC1D,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;SACpC;aAAM,IAAI,QAAQ,GAAG,CAAC,EAAE;YAEvB,QAAQ,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;YAC7D,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,KAAK,CA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EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACxG,KAAK,IAAI,GAAG,GAAG,UAAU,EAAE,GAAG,IAAI,aAAa,EAAE,GAAG,EAAE,EAAE;YAEtD,MAAM,SAAS,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACzD,KAAK,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;SACzC;KACF;IAED,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE,EAAE;QAClE,KAAK,IAAI,GAAG,GAAG,UAAU,EAAE,GAAG,IAAI,aAAa,EAAE,GAAG,EAAE,EAAE;YAEtD,MAAM,SAAS,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACzD,KAAK,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;SACzC;KACF;AACH,CAAC;AAzBD,4CAyBC","file":"dynamic-set-y.js","sourcesContent":["import { isValid } from '../../../../tools/util';\nimport type { Group } from '../../../graphic/group';\nimport { computeRowsHeight } from '../../../layout/compute-row-height';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoRow } from './update-auto-row';\nimport { checkFirstRowMerge } from './util';\n\nexport async function dynamicSetY(y: number, proxy: SceneProxy) {\n // 计算变动row range\n // const screenTopRow = proxy.table.getRowAt(y).row;\n // proxy.deltaY = 0;\n const screenTop = (proxy.table as any).getTargetRowAt(y + proxy.table.scenegraph.colHeaderGroup.attribute.height);\n if (!screenTop) {\n return;\n }\n const screenTopRow = screenTop.row;\n const screenTopY = screenTop.top;\n proxy.screenTopRow = screenTopRow;\n const deltaRow = screenTopRow - proxy.referenceRow;\n if (deltaRow > 0) {\n // 向下滚动,顶部cell group移到底部\n moveCell(deltaRow, 'up', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else if (deltaRow < 0) {\n // 向上滚动,底部cell group移到顶部\n moveCell(-deltaRow, 'down', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else {\n // 不改变row,更新body group范围\n proxy.updateBody(y - proxy.deltaY);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveCell(\n count: number,\n direction: 'up' | 'down',\n screenTopRow: number,\n screenTopY: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'up' && proxy.rowEnd + count > proxy.bodyBottomRow) {\n count = proxy.bodyBottomRow - proxy.rowEnd;\n } else if (direction === 'down' && proxy.rowStart - count < proxy.bodyTopRow) {\n count = proxy.rowStart - proxy.bodyTopRow;\n }\n\n // 两种更新模式\n // 1. count < rowEnd - rowStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= rowEnd - rowStart:整体移动到目标位置\n if (count < proxy.rowEnd - proxy.rowStart) {\n // 计算更新区域\n const startRow = direction === 'up' ? proxy.rowStart : proxy.rowEnd - count + 1;\n const endRow = direction === 'up' ? proxy.rowStart + count - 1 : proxy.rowEnd;\n // console.log('move', startRow, endRow, direction);\n updatePartRowPosition(startRow, endRow, direction, proxy);\n const distStartRow = direction === 'up' ? proxy.rowEnd + 1 : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowStart - 1;\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n const topRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n const BottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n // get coincide of distStartRow&distEndRow and topRow&BottomRow\n syncTopRow = Math.max(distStartRow, topRow);\n syncBottomRow = Math.min(distEndRow, BottomRow);\n }\n\n // const syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n // const syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n\n checkFirstRowMerge(syncTopRow, proxy);\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n direction\n );\n\n const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, screenTopRow, true);\n const delaY =\n screenTopY - (cellGroup.attribute.y + proxy.table.getFrozenRowsHeight() + proxy.table.scenegraph.proxy.deltaY);\n proxy.table.scenegraph.proxy.deltaY += delaY;\n }\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = distStartRow;\n proxy.rowUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n } else {\n const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n const distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);\n // 更新distStartRow位置的merge单元格,避免distStartRow位置不是merge的起始位置造成的空白\n\n // 更新同步范围\n updateAllRowPosition(distStartRowY, count, direction, proxy);\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n }\n //console.log('更新同步范围', syncTopRow, syncBottomRow);\n\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n proxy.rowStart = distStartRow;\n proxy.rowEnd = distEndRow;\n\n checkFirstRowMerge(syncTopRow, proxy);\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n proxy.table.scenegraph.proxy.deltaY = 0;\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = proxy.rowStart;\n proxy.rowUpdateDirection = distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up';\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n }\n}\n\nfunction updatePartRowPosition(startRow: number, endRow: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n}\n\nfunction updateCellGroupPosition(colGroup: Group, direction: 'up' | 'down', proxy: SceneProxy) {\n if (direction === 'up') {\n const cellGroup = colGroup.firstChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.lastChild as Group).row + 1,\n (colGroup.lastChild as Group).attribute.y + proxy.table.getRowHeight((colGroup.lastChild as Group).row) // (colGroup.lastChild as Group).attribute.height\n );\n colGroup.appendChild(cellGroup);\n } else {\n const cellGroup = colGroup.lastChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.firstChild as Group).row - 1,\n (colGroup.firstChild as Group).attribute.y - proxy.table.getRowHeight((cellGroup as Group).row) // cellGroup.attribute.height\n );\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n }\n}\n\nfunction updateAllRowPosition(distStartRowY: number, count: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n}\n\nexport function updateRowContent(syncTopRow: number, syncBottomRow: number, proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.updateAutoColumn = void 0;
|
|
6
|
+
|
|
7
|
+
const util_1 = require("./util");
|
|
8
|
+
|
|
9
|
+
function updateAutoColumn(colStart, colEnd, table, direction = "left") {
|
|
10
|
+
for (let col = colStart; col <= colEnd; col++) {
|
|
11
|
+
const bodyColGroup = table.scenegraph.getColGroup(col);
|
|
12
|
+
bodyColGroup && moveColumnGroup(bodyColGroup, table, direction);
|
|
13
|
+
const columnHeaderColGroup = table.scenegraph.getColGroup(col, !0);
|
|
14
|
+
columnHeaderColGroup && moveColumnGroup(columnHeaderColGroup, table, direction);
|
|
15
|
+
const bottomColGroup = table.scenegraph.getColGroupInBottom(col);
|
|
16
|
+
bottomColGroup && moveColumnGroup(bottomColGroup, table, direction);
|
|
17
|
+
}
|
|
18
|
+
const totalActualBodyColumnCount = Math.min(table.scenegraph.proxy.colLimit, table.scenegraph.proxy.bodyRightCol - table.scenegraph.proxy.bodyLeftCol + 1), totalBodyWidth = table.getColsWidth(table.rowHeaderLevelCount, table.rowHeaderLevelCount + totalActualBodyColumnCount), totalWidth = table.getColsWidth(table.rowHeaderLevelCount, table.colCount - 1);
|
|
19
|
+
table.scenegraph.proxy.xLimitLeft = totalBodyWidth / 2, table.scenegraph.proxy.xLimitRight = totalWidth - totalBodyWidth / 2;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function moveColumnGroup(colGroup, table, direction = "left") {
|
|
23
|
+
if ("left" === direction) {
|
|
24
|
+
let x;
|
|
25
|
+
const prevCellGroup = (0, util_1.getPrevGroup)(colGroup);
|
|
26
|
+
x = prevCellGroup ? prevCellGroup.attribute.x + table.getColWidth(colGroup._prev.col) : table.getColsWidth(table.rowHeaderLevelCount, colGroup.col - 1),
|
|
27
|
+
colGroup.setAttribute("x", x);
|
|
28
|
+
} else {
|
|
29
|
+
let x;
|
|
30
|
+
const nextCellGroup = (0, util_1.getNextGroup)(colGroup);
|
|
31
|
+
x = nextCellGroup ? nextCellGroup.attribute.x - table.getColWidth(colGroup.col) : table.getColsWidth(table.rowHeaderLevelCount, colGroup.col - 1),
|
|
32
|
+
colGroup.setAttribute("x", x);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.updateAutoColumn = updateAutoColumn;
|
|
37
|
+
//# sourceMappingURL=update-auto-column.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/update-auto-column.ts"],"names":[],"mappings":";;;AAEA,iCAAoD;AAEpD,SAAgB,gBAAgB,CAC9B,QAAgB,EAChB,MAAc,EACd,KAAmB,EACnB,YAA8B,MAAM;IAGpC,KAAK,IAAI,GAAG,GAAG,QAAQ,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,EAAE;QAC7C,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACvD,IAAI,YAAY,EAAE;YAChB,eAAe,CAAC,YAAY,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;SACjD;QACD,MAAM,oBAAoB,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrE,IAAI,oBAAoB,EAAE;YACxB,eAAe,CAAC,oBAAoB,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;SACzD;QACD,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACjE,IAAI,cAAc,EAAE;YAClB,eAAe,CAAC,cAAc,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;SACnD;KACF;IAGD,MAAM,0BAA0B,GAAG,IAAI,CA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;QAC7C,IAAI,aAAa,EAAE;YACjB,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;SACjE;aAAM;YAEL,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;SACrE;QACD,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KAC/B;AACH,CAAC","file":"update-auto-column.js","sourcesContent":["import type { BaseTableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\nimport { getNextGroup, getPrevGroup } from './util';\n\nexport function updateAutoColumn(\n colStart: number,\n colEnd: number,\n table: BaseTableAPI,\n direction: 'left' | 'right' = 'left'\n) {\n // 更新y位置\n for (let col = colStart; col <= colEnd; col++) {\n const bodyColGroup = table.scenegraph.getColGroup(col);\n if (bodyColGroup) {\n moveColumnGroup(bodyColGroup, table, direction);\n }\n const columnHeaderColGroup = table.scenegraph.getColGroup(col, true);\n if (columnHeaderColGroup) {\n moveColumnGroup(columnHeaderColGroup, table, direction);\n }\n const bottomColGroup = table.scenegraph.getColGroupInBottom(col);\n if (bottomColGroup) {\n moveColumnGroup(bottomColGroup, table, direction);\n }\n }\n\n // update x limit in proxy\n const totalActualBodyColumnCount = Math.min(\n table.scenegraph.proxy.colLimit,\n table.scenegraph.proxy.bodyRightCol - table.scenegraph.proxy.bodyLeftCol + 1\n );\n // 渐进加载总column数量\n const totalBodyWidth = table.getColsWidth(\n table.rowHeaderLevelCount,\n table.rowHeaderLevelCount + totalActualBodyColumnCount\n );\n const totalWidth = table.getColsWidth(table.rowHeaderLevelCount, table.colCount - 1);\n table.scenegraph.proxy.xLimitLeft = totalBodyWidth / 2;\n table.scenegraph.proxy.xLimitRight = totalWidth - totalBodyWidth / 2;\n}\n\nfunction moveColumnGroup(colGroup: Group, table: BaseTableAPI, direction: 'left' | 'right' = 'left') {\n if (direction === 'left') {\n let x;\n const prevCellGroup = getPrevGroup(colGroup);\n if (prevCellGroup) {\n x = prevCellGroup.attribute.x + table.getColWidth((colGroup._prev as Group).col);\n } else {\n // 估计位置\n x = table.getColsWidth(table.rowHeaderLevelCount, colGroup.col - 1);\n }\n colGroup.setAttribute('x', x);\n } else {\n let x;\n const nextCellGroup = getNextGroup(colGroup);\n if (nextCellGroup) {\n x = nextCellGroup.attribute.x - table.getColWidth(colGroup.col);\n } else {\n // 估计位置\n x = table.getColsWidth(table.rowHeaderLevelCount, colGroup.col - 1);\n }\n colGroup.setAttribute('x', x);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/update-auto-row.ts"],"names":[],"mappings":";;;AAGA,SAAgB,aAAa,CAC3B,QAAgB,EAChB,MAAc,EACd,QAAgB,EAChB,MAAc,EACd,KAAmB,EACnB,YAA2B,IAAI;;
|
|
1
|
+
{"version":3,"sources":["scenegraph/group-creater/progress/update-position/update-auto-row.ts"],"names":[],"mappings":";;;AAGA,SAAgB,aAAa,CAC3B,QAAgB,EAChB,MAAc,EACd,QAAgB,EAChB,MAAc,EACd,KAAmB,EACnB,YAA2B,IAAI;;IAG/B,IAAI,SAAS,KAAK,IAAI,EAAE;QACtB,KAAK,IAAI,GAAG,GAAG,QAAQ,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,EAAE;YAC7C,KAAK,IAAI,GAAG,GAAG,QAAQ,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,EAAE;gBAC7C,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;gBAC1E,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE;oBAClB,SAAS;iBACV;gBACD,IAAI,CAAC,CAAC;gBACN,IAAI,SAAS,CAAC,KAAK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,UAAU,CAAC,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAC7E,CAAC;IAEF,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CACzC,KAAK,CAAC,sBAAsB,EAC5B,KAAK,CAAC,sBAAsB,GAAG,uBAAuB,CACvD,CAAC;IACF,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IAC1F,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,GAAG,CAAC,CAAC;IACvD,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,GAAG,WAAW,GAAG,eAAe,GAAG,CAAC,CAAC;AAC1E,CAAC;AA7DD,sCA6DC","file":"update-auto-row.js","sourcesContent":["import type { BaseTableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\n\nexport function updateAutoRow(\n colStart: number,\n colEnd: number,\n rowStart: number,\n rowEnd: number,\n table: BaseTableAPI,\n direction: 'up' | 'down' = 'up'\n) {\n // 更新y位置\n if (direction === 'up') {\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n if (!cellGroup.row) {\n continue;\n }\n let y;\n if (cellGroup._prev) {\n // y = ((cellGroup._prev as Group)?.attribute.y ?? 0) + ((cellGroup._prev as Group)?.attribute.height ?? 0);\n y = (cellGroup._prev as Group)?.attribute.y + table.getRowHeight((cellGroup._prev as Group).row);\n } else {\n // 估计位置\n y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row - 1);\n }\n cellGroup.setAttribute('y', y);\n }\n }\n } else {\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowEnd; row >= rowStart; row--) {\n const cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n if (!cellGroup.row) {\n continue;\n }\n let y;\n if (cellGroup._next) {\n // y = ((cellGroup._next as Group)?.attribute.y ?? 0) - (cellGroup.attribute.height ?? 0);\n y = (cellGroup._next as Group)?.attribute.y - table.getRowHeight(cellGroup.row);\n } else {\n // 估计位置\n y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row - 1);\n // console.log('估计位置', table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row));\n }\n cellGroup.setAttribute('y', y);\n }\n }\n }\n\n // update y limit in proxy\n const totalActualBodyRowCount = Math.min(\n table.scenegraph.proxy.rowLimit,\n table.scenegraph.proxy.bodyBottomRow - table.scenegraph.proxy.bodyTopRow + 1\n );\n // 渐进加载总row数量\n const totalBodyHeight = table.getRowsHeight(\n table.columnHeaderLevelCount,\n table.columnHeaderLevelCount + totalActualBodyRowCount\n );\n const totalHeight = table.getRowsHeight(table.columnHeaderLevelCount, table.rowCount - 1);\n table.scenegraph.proxy.yLimitTop = totalBodyHeight / 2;\n table.scenegraph.proxy.yLimitBottom = totalHeight - totalBodyHeight / 2;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Group } from '../../../graphic/group';
|
|
2
|
+
import type { SceneProxy } from '../proxy';
|
|
3
|
+
export declare function checkFirstRowMerge(row: number, proxy: SceneProxy): void;
|
|
4
|
+
export declare function checkFirstColMerge(col: number, scrolling: boolean, proxy: SceneProxy): void;
|
|
5
|
+
export declare function getFirstChild(containerGroup: Group): Group;
|
|
6
|
+
export declare function getLastChild(containerGroup: Group): Group;
|
|
7
|
+
export declare function getPrevGroup(group: Group): Group;
|
|
8
|
+
export declare function getNextGroup(group: Group): Group;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.getNextGroup = exports.getPrevGroup = exports.getLastChild = exports.getFirstChild = exports.checkFirstColMerge = exports.checkFirstRowMerge = void 0;
|
|
6
|
+
|
|
7
|
+
const get_cell_merge_1 = require("../../../utils/get-cell-merge"), cell_helper_1 = require("../../cell-helper");
|
|
8
|
+
|
|
9
|
+
function checkFirstRowMerge(row, proxy) {
|
|
10
|
+
for (let col = 0; col < proxy.table.colCount; col++) {
|
|
11
|
+
if (col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart || col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount) continue;
|
|
12
|
+
const range = (0, get_cell_merge_1.getCellMergeInfo)(proxy.table, col, row);
|
|
13
|
+
if (range && range.start.row !== row) {
|
|
14
|
+
const oldCellGroup = proxy.highPerformanceGetCell(col, row, !0), newCellGroup = (0,
|
|
15
|
+
cell_helper_1.updateCell)(range.start.col, range.start.row, proxy.table, !0);
|
|
16
|
+
newCellGroup.col = col, newCellGroup.row = row, newCellGroup.setAttribute("y", proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1)),
|
|
17
|
+
oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup), oldCellGroup.parent.removeChild(oldCellGroup),
|
|
18
|
+
oldCellGroup.needUpdate = !1, newCellGroup.needUpdate = !1, proxy.cellCache.get(col) && proxy.cellCache.set(col, newCellGroup);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function checkFirstColMerge(col, scrolling, proxy) {
|
|
24
|
+
for (let row = 0; row < proxy.table.rowCount; row++) {
|
|
25
|
+
if (row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart || row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount) continue;
|
|
26
|
+
const range = (0, get_cell_merge_1.getCellMergeInfo)(proxy.table, col, row);
|
|
27
|
+
if (range && range.start.col !== col) {
|
|
28
|
+
if (scrolling && checkHasColMerge(range.start.col, range.end.col, row, proxy)) continue;
|
|
29
|
+
const oldCellGroup = proxy.highPerformanceGetCell(col, row, !0), newCellGroup = (0,
|
|
30
|
+
cell_helper_1.updateCell)(range.start.col, range.start.row, proxy.table, !0);
|
|
31
|
+
newCellGroup.col = col, newCellGroup.row = row, newCellGroup.setAttribute("x", proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) - oldCellGroup.parent.attribute.x),
|
|
32
|
+
oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup), oldCellGroup.parent.removeChild(oldCellGroup),
|
|
33
|
+
oldCellGroup.needUpdate = !1, newCellGroup.needUpdate = !1, proxy.cellCache.get(col) && proxy.cellCache.set(col, newCellGroup);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function checkHasColMerge(colStart, colEnd, row, proxy) {
|
|
39
|
+
for (let col = colStart; col <= colEnd; col++) if ("shadow-cell" !== proxy.highPerformanceGetCell(col, row, !0).role && "empty" !== proxy.highPerformanceGetCell(col, row, !0).role) return !0;
|
|
40
|
+
return !1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getFirstChild(containerGroup) {
|
|
44
|
+
let child = containerGroup.firstChild;
|
|
45
|
+
for (;"group" !== child.type; ) child = child._next;
|
|
46
|
+
return child;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function getLastChild(containerGroup) {
|
|
50
|
+
let child = containerGroup.lastChild;
|
|
51
|
+
for (;"group" !== child.type; ) child = child._prev;
|
|
52
|
+
return child;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getPrevGroup(group) {
|
|
56
|
+
let child = group._prev;
|
|
57
|
+
for (;child && "group" !== child.type; ) child = child._prev;
|
|
58
|
+
return child;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function getNextGroup(group) {
|
|
62
|
+
let child = group._next;
|
|
63
|
+
for (;child && "group" !== child.type; ) child = child._next;
|
|
64
|
+
return child;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
exports.checkFirstRowMerge = checkFirstRowMerge, exports.checkFirstColMerge = checkFirstColMerge,
|
|
68
|
+
exports.getFirstChild = getFirstChild, exports.getLastChild = getLastChild, exports.getPrevGroup = getPrevGroup,
|
|
69
|
+
exports.getNextGroup = getNextGroup;
|
|
70
|
+
//# sourceMappingURL=util.js.map
|