@visactor/vtable 0.15.5 → 0.16.1
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 +5 -2
- package/cjs/ListTable.js +161 -16
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +1 -1
- package/cjs/PivotChart.js +1 -1
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -1
- package/cjs/PivotTable.js +1 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +3 -3
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -1
- package/cjs/core/BaseTable.js +4 -4
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +2 -0
- package/cjs/core/tableHelper.js +18 -3
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/DataSource.d.ts +8 -1
- package/cjs/data/DataSource.js +59 -2
- package/cjs/data/DataSource.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/scenegraph/group-creater/column.d.ts +0 -4
- package/cjs/scenegraph/group-creater/column.js +1 -19
- package/cjs/scenegraph/group-creater/column.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +2 -0
- package/cjs/scenegraph/group-creater/progress/proxy.js +17 -3
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +4 -0
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/layout/auto-height.d.ts +1 -2
- package/cjs/scenegraph/layout/auto-height.js +1 -36
- package/cjs/scenegraph/layout/auto-height.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/update-col.d.ts +3 -0
- package/cjs/scenegraph/layout/update-col.js +203 -0
- package/cjs/scenegraph/layout/update-col.js.map +1 -0
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +94 -49
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +5 -0
- package/cjs/scenegraph/scenegraph.js +24 -3
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/cjs/state/resize/update-resize-column.js +1 -1
- package/cjs/state/resize/update-resize-column.js.map +1 -1
- package/cjs/state/state.d.ts +2 -0
- package/cjs/state/state.js +47 -2
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/DARK.js.map +1 -1
- package/cjs/tools/diff-cell.js +1 -1
- package/cjs/tools/diff-cell.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +3 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/dist/vtable.js +981 -118
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +5 -2
- package/es/ListTable.js +161 -17
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +1 -1
- package/es/PivotChart.js +1 -1
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +1 -1
- package/es/PivotTable.js +1 -1
- package/es/PivotTable.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +3 -3
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -1
- package/es/core/BaseTable.js +4 -4
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/tableHelper.d.ts +2 -0
- package/es/core/tableHelper.js +16 -0
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/DataSource.d.ts +8 -1
- package/es/data/DataSource.js +59 -2
- package/es/data/DataSource.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/scenegraph/group-creater/column.d.ts +0 -4
- package/es/scenegraph/group-creater/column.js +0 -16
- package/es/scenegraph/group-creater/column.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +2 -0
- package/es/scenegraph/group-creater/progress/proxy.js +16 -2
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +4 -0
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/layout/auto-height.d.ts +1 -2
- package/es/scenegraph/layout/auto-height.js +0 -33
- package/es/scenegraph/layout/auto-height.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/update-col.d.ts +3 -0
- package/es/scenegraph/layout/update-col.js +200 -0
- package/es/scenegraph/layout/update-col.js.map +1 -0
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +94 -49
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +5 -0
- package/es/scenegraph/scenegraph.js +25 -2
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/es/state/resize/update-resize-column.js +1 -1
- package/es/state/resize/update-resize-column.js.map +1 -1
- package/es/state/state.d.ts +2 -0
- package/es/state/state.js +47 -2
- package/es/state/state.js.map +1 -1
- package/es/themes/DARK.js.map +1 -1
- package/es/tools/diff-cell.js +1 -1
- package/es/tools/diff-cell.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +3 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/package.json +4 -4
|
@@ -7,9 +7,9 @@ import { updateCell } from "../group-creater/cell-helper";
|
|
|
7
7
|
import { getCellMergeInfo } from "../utils/get-cell-merge";
|
|
8
8
|
|
|
9
9
|
export function updateRow(removeCells, addCells, updateCells, table) {
|
|
10
|
-
const scene = table.scenegraph, removeRows = deduplication(removeCells.map((cell => cell.row))).sort(((a, b) => b - a)), addRows = deduplication(addCells.map((cell => cell.row))).sort(((a, b) => a - b));
|
|
10
|
+
const scene = table.scenegraph, removeRows = deduplication(removeCells.map((cell => cell.row))).sort(((a, b) => b - a)), addRows = deduplication(addCells.map((cell => cell.row))).sort(((a, b) => a - b)), updateRows = deduplication(updateCells.map((cell => cell.row))).sort(((a, b) => a - b));
|
|
11
11
|
let updateAfter;
|
|
12
|
-
|
|
12
|
+
removeRows.forEach((row => {
|
|
13
13
|
removeRow(row, scene);
|
|
14
14
|
})), removeRows.forEach((row => {
|
|
15
15
|
scene.table.rowHeightsMap.adjustOrder(row + 1, row, scene.table.rowHeightsMap.count() - row - 1),
|
|
@@ -17,14 +17,16 @@ export function updateRow(removeCells, addCells, updateCells, table) {
|
|
|
17
17
|
})), removeRows.length && resetRowNumber(scene), scene.table._clearRowRangeHeightsMap(),
|
|
18
18
|
addRows.forEach((row => {
|
|
19
19
|
const needUpdateAfter = addRow(row, scene);
|
|
20
|
-
updateAfter = updateAfter
|
|
21
|
-
})), resetRowNumberAndY(scene)
|
|
22
|
-
|
|
23
|
-
const mergeInfo = getCellMergeInfo(scene.table,
|
|
24
|
-
if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) updateCell(col, row, scene.table, !1); else updateCell(
|
|
25
|
-
}))
|
|
20
|
+
updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, scene.table.rowHeightsMap.adjustOrder(row, row + 1, scene.table.rowHeightsMap.count() - row);
|
|
21
|
+
})), resetRowNumberAndY(scene);
|
|
22
|
+
for (let col = 0; col < table.colCount; col++) updateRows.forEach((r => {
|
|
23
|
+
const mergeInfo = getCellMergeInfo(scene.table, col, r);
|
|
24
|
+
if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) updateCell(col, row, scene.table, !1); else updateCell(col, r, scene.table, !1);
|
|
25
|
+
}));
|
|
26
|
+
if (isNumber(updateAfter)) {
|
|
26
27
|
for (let col = 0; col < table.colCount; col++) for (let row = updateAfter; row < table.rowCount; row++) {
|
|
27
|
-
scene.highPerformanceGetCell(col, row, !0)
|
|
28
|
+
const cellGroup = scene.highPerformanceGetCell(col, row, !0);
|
|
29
|
+
cellGroup && (cellGroup.needUpdate = !0);
|
|
28
30
|
}
|
|
29
31
|
scene.proxy.rowUpdatePos = updateAfter;
|
|
30
32
|
}
|
|
@@ -34,10 +36,19 @@ export function updateRow(removeCells, addCells, updateCells, table) {
|
|
|
34
36
|
scene.proxy.rowUpdatePos = minRow;
|
|
35
37
|
}
|
|
36
38
|
scene.proxy.rowUpdateDirection = "up", scene.proxy.updateCellGroups(2 * scene.proxy.screenRowCount),
|
|
37
|
-
scene.proxy.progress();
|
|
39
|
+
updateBottomFrozeCellGroups(), scene.proxy.progress();
|
|
38
40
|
} else removeRows.length && (scene.proxy.updateCellGroups(2 * scene.proxy.screenRowCount),
|
|
39
|
-
scene.proxy.progress());
|
|
41
|
+
updateBottomFrozeCellGroups(), scene.proxy.progress());
|
|
40
42
|
const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);
|
|
43
|
+
function updateBottomFrozeCellGroups() {
|
|
44
|
+
if ((null == addRows ? void 0 : addRows[(null == addRows ? void 0 : addRows.length) - 1]) >= table.rowCount - table.bottomFrozenRowCount || (null == updateRows ? void 0 : updateRows[(null == updateRows ? void 0 : updateRows.length) - 1]) >= table.rowCount - table.bottomFrozenRowCount || (null == removeRows ? void 0 : removeRows[0]) >= table.rowCount - table.bottomFrozenRowCount) {
|
|
45
|
+
for (let col = 0; col < table.colCount; col++) for (let row = table.rowCount - table.bottomFrozenRowCount; row < table.rowCount; row++) {
|
|
46
|
+
const cellGroup = scene.highPerformanceGetCell(col, row, !0);
|
|
47
|
+
cellGroup && (cellGroup.needUpdate = !0);
|
|
48
|
+
}
|
|
49
|
+
scene.proxy.updateBottomFrozenCellGroups();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
41
52
|
scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
|
|
42
53
|
}
|
|
43
54
|
|
|
@@ -67,49 +78,83 @@ function deduplication(array) {
|
|
|
67
78
|
}
|
|
68
79
|
|
|
69
80
|
function resetRowNumber(scene) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
headerColGroup.forEachChildren((cellGroup => {
|
|
76
|
-
cellGroup.row = rowIndex;
|
|
77
|
-
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
78
|
-
merge && (cellGroup.mergeStartCol = merge.start.col, cellGroup.mergeStartRow = merge.start.row,
|
|
79
|
-
cellGroup.mergeEndCol = merge.end.col, cellGroup.mergeEndRow = merge.end.row), rowIndex++;
|
|
80
|
-
})), rowIndex = null === (_b = colGroup.firstChild) || void 0 === _b ? void 0 : _b.row,
|
|
81
|
-
colGroup.forEachChildren((cellGroup => {
|
|
82
|
-
cellGroup.row = rowIndex;
|
|
83
|
-
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
84
|
-
merge && (cellGroup.mergeStartCol = merge.start.col, cellGroup.mergeStartRow = merge.start.row,
|
|
85
|
-
cellGroup.mergeEndCol = merge.end.col, cellGroup.mergeEndRow = merge.end.row), rowIndex++;
|
|
86
|
-
}));
|
|
81
|
+
function processCell(cellGroup, rowIndex) {
|
|
82
|
+
cellGroup.row = rowIndex;
|
|
83
|
+
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
84
|
+
merge && (cellGroup.mergeStartCol = merge.start.col, cellGroup.mergeStartCol = merge.start.col,
|
|
85
|
+
cellGroup.mergeEndCol = merge.end.col, cellGroup.mergeEndCol = merge.end.col);
|
|
87
86
|
}
|
|
87
|
+
scene.bodyGroup.forEachChildren((colGroup => {
|
|
88
|
+
let rowIndex = scene.bodyRowStart;
|
|
89
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
90
|
+
processCell(cellGroup, rowIndex), rowIndex++;
|
|
91
|
+
}));
|
|
92
|
+
})), scene.rowHeaderGroup.forEachChildren((colGroup => {
|
|
93
|
+
let rowIndex = scene.bodyRowStart;
|
|
94
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
95
|
+
processCell(cellGroup, rowIndex), rowIndex++;
|
|
96
|
+
}));
|
|
97
|
+
})), scene.rightFrozenGroup.forEachChildren((colGroup => {
|
|
98
|
+
let rowIndex = scene.bodyRowStart;
|
|
99
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
100
|
+
processCell(cellGroup, rowIndex), rowIndex++;
|
|
101
|
+
}));
|
|
102
|
+
})), scene.bottomFrozenGroup.forEachChildren((colGroup => {
|
|
103
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
104
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
105
|
+
processCell(cellGroup, rowIndex), rowIndex++;
|
|
106
|
+
}));
|
|
107
|
+
})), scene.leftBottomCornerGroup.forEachChildren((colGroup => {
|
|
108
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
109
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
110
|
+
processCell(cellGroup, rowIndex), rowIndex++;
|
|
111
|
+
}));
|
|
112
|
+
})), scene.rightBottomCornerGroup.forEachChildren((colGroup => {
|
|
113
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
114
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
115
|
+
processCell(cellGroup, rowIndex), rowIndex++;
|
|
116
|
+
}));
|
|
117
|
+
}));
|
|
88
118
|
}
|
|
89
119
|
|
|
90
120
|
function resetRowNumberAndY(scene) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (!headerColGroup || !colGroup) continue;
|
|
97
|
-
let rowIndex = null === (_a = headerColGroup.firstChild) || void 0 === _a ? void 0 : _a.row, y = 0;
|
|
98
|
-
rowIndex = null === (_b = colGroup.firstChild) || void 0 === _b ? void 0 : _b.row;
|
|
99
|
-
y = scene.getCellGroupY(rowIndex), colGroup.forEachChildren((cellGroup => {
|
|
100
|
-
cellGroup.row = rowIndex;
|
|
101
|
-
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
102
|
-
merge && (cellGroup.mergeStartCol = merge.start.col, cellGroup.mergeStartRow = merge.start.row,
|
|
103
|
-
cellGroup.mergeEndCol = merge.end.col, cellGroup.mergeEndRow = merge.end.row), rowIndex++,
|
|
104
|
-
"cell" === cellGroup.role && (cellGroup.setAttribute("y", y), y += cellGroup.attribute.height);
|
|
105
|
-
})), newTotalHeight = y, null == bottomGroup || bottomGroup.forEachChildren((cellGroup => {
|
|
106
|
-
cellGroup.row = rowIndex;
|
|
107
|
-
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
108
|
-
merge && (cellGroup.mergeStartCol = merge.start.col, cellGroup.mergeStartRow = merge.start.row,
|
|
109
|
-
cellGroup.mergeEndCol = merge.end.col, cellGroup.mergeEndRow = merge.end.row), rowIndex++;
|
|
110
|
-
}));
|
|
121
|
+
function processCell(cellGroup, rowIndex, y) {
|
|
122
|
+
cellGroup.row = rowIndex, cellGroup.setAttribute("y", y);
|
|
123
|
+
const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
|
|
124
|
+
merge && (cellGroup.mergeStartCol = merge.start.col, cellGroup.mergeStartCol = merge.start.col,
|
|
125
|
+
cellGroup.mergeEndCol = merge.end.col, cellGroup.mergeEndCol = merge.end.col);
|
|
111
126
|
}
|
|
112
|
-
|
|
127
|
+
scene.bodyGroup.forEachChildren((colGroup => {
|
|
128
|
+
let rowIndex = scene.bodyRowStart, y = scene.getCellGroupY(rowIndex);
|
|
129
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
130
|
+
processCell(cellGroup, rowIndex, y), rowIndex++, y += cellGroup.attribute.height;
|
|
131
|
+
}));
|
|
132
|
+
})), scene.rowHeaderGroup.forEachChildren((colGroup => {
|
|
133
|
+
let rowIndex = scene.bodyRowStart, y = scene.getCellGroupY(rowIndex);
|
|
134
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
135
|
+
processCell(cellGroup, rowIndex, y), rowIndex++, y += cellGroup.attribute.height;
|
|
136
|
+
}));
|
|
137
|
+
})), scene.rightFrozenGroup.forEachChildren((colGroup => {
|
|
138
|
+
let rowIndex = scene.bodyRowStart, y = scene.getCellGroupY(rowIndex);
|
|
139
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
140
|
+
processCell(cellGroup, rowIndex, y), rowIndex++, y += cellGroup.attribute.height;
|
|
141
|
+
}));
|
|
142
|
+
})), scene.bottomFrozenGroup.forEachChildren((colGroup => {
|
|
143
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount, y = 0;
|
|
144
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
145
|
+
processCell(cellGroup, rowIndex, y), rowIndex++, y += cellGroup.attribute.height;
|
|
146
|
+
}));
|
|
147
|
+
})), scene.leftBottomCornerGroup.forEachChildren((colGroup => {
|
|
148
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount, y = 0;
|
|
149
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
150
|
+
processCell(cellGroup, rowIndex, y), rowIndex++, y += cellGroup.attribute.height;
|
|
151
|
+
}));
|
|
152
|
+
})), scene.rightBottomCornerGroup.forEachChildren((colGroup => {
|
|
153
|
+
let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount, y = 0;
|
|
154
|
+
null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
155
|
+
processCell(cellGroup, rowIndex, y), rowIndex++, y += cellGroup.attribute.height;
|
|
156
|
+
}));
|
|
157
|
+
}));
|
|
113
158
|
}
|
|
114
159
|
|
|
115
160
|
function addRowCellGroup(row, scene) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/layout/update-row.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,MAAM,UAAU,SAAS,CACvB,WAA0B,EAC1B,QAAuB,EACvB,WAA0B,EAC1B,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,E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CAAC,CAAC;QAC/C,IAAI,CAAC,QAAQ,EAAE;YACb,SAAS;SACV;QAeD,IAAI,SAAS,CAAC;QACd,QAAQ,CAAC,eAAe,CAAC,CAAC,IAAW,EAAE,EAAE;YACvC,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,EAAE;gBACpB,SAAS,GAAG,IAAI,CAAC;gBACjB,OAAO,IAAI,CAAC;aACb;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACH,IAAI,SAAS,EAAE;YACb,QAAQ,CAAC,kBAAkB,CAAC,CAAE,SAAmB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACpE,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;SACjC;KACF;AACH,CAAC","file":"update-row.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\nimport type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => b - a);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n // const updateRows = deduplication(updateCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n removeRows.forEach(row => {\n scene.table.rowHeightsMap.adjustOrder(row + 1, row, scene.table.rowHeightsMap.count() - row - 1);\n scene.table.rowHeightsMap.del(scene.table.rowHeightsMap.count() - 1);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n scene.table._clearRowRangeHeightsMap();\n\n // add cells\n let updateAfter: number;\n addRows.forEach(row => {\n const needUpdateAfter = addRow(row, scene);\n updateAfter = updateAfter || needUpdateAfter;\n scene.table.rowHeightsMap.adjustOrder(row, row + 1, scene.table.rowHeightsMap.count() - row);\n });\n\n // reset attribute y and row number in CellGroup\n // const newTotalHeight = resetRowNumberAndY(scene);\n resetRowNumberAndY(scene);\n\n // add cells\n updateCells.forEach(cell => {\n // updateRowAttr(row, scene);\n if (!cell) {\n return;\n }\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n updateCell(col, row, scene.table, false);\n }\n }\n } else {\n updateCell(cell.col, cell.row, scene.table, false);\n }\n });\n\n if (isNumber(updateAfter)) {\n for (let col = 0; col < table.colCount; col++) {\n for (let row = updateAfter; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup.needUpdate = true;\n }\n }\n scene.proxy.rowUpdatePos = updateAfter;\n }\n\n if (addRows.length) {\n if (!isNumber(updateAfter)) {\n const minRow = Math.min(...addRows);\n scene.proxy.rowUpdatePos = minRow;\n }\n scene.proxy.rowUpdateDirection = 'up';\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n scene.proxy.progress();\n } else if (removeRows.length) {\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n scene.proxy.progress();\n }\n\n // update table size\n const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n}\n\nfunction removeRow(row: number, scene: Scenegraph) {\n removeCellGroup(row, scene);\n const proxy = scene.proxy;\n\n // TODO 需要整体更新proxy的状态\n if (row >= proxy.rowStart && row <= proxy.rowEnd) {\n proxy.rowEnd--;\n proxy.currentRow--;\n }\n proxy.bodyBottomRow--;\n // proxy.totalRow--;\n const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1); // 渐进加载总row数量\n proxy.totalActualBodyRowCount = totalActualBodyRowCount;\n proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n proxy.bodyBottomRow++;\n // proxy.totalRow++;\n const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1); // 渐进加载总row数量\n proxy.totalActualBodyRowCount = totalActualBodyRowCount;\n proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row\n\n if (row < proxy.rowStart) {\n return undefined;\n } else if (row > proxy.rowEnd) {\n if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {\n // can add row\n proxy.rowEnd++;\n proxy.currentRow++;\n\n addRowCellGroup(row, scene);\n return row;\n }\n return undefined;\n }\n if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {\n // can add row\n proxy.rowEnd++;\n proxy.currentRow++;\n\n addRowCellGroup(row, scene);\n return row;\n }\n // update rows after\n return row;\n\n // return undefined;\n\n // // TODO 需要整体更新proxy的状态\n // scene.proxy.bodyBottomRow++;\n // scene.proxy.totalRow++;\n // scene.proxy.rowEnd++;\n // scene.proxy.currentRow++;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\nfunction resetRowNumber(scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!headerColGroup || !colGroup) {\n continue;\n }\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n headerColGroup.forEachChildren((cellGroup: Group) => {\n // const oldRow = cellGroup.row;\n // if (isNumber(cellGroup.mergeStartRow)) {\n // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n // }\n // if (isNumber(cellGroup.mergeEndRow)) {\n // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n // }\n cellGroup.row = rowIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartRow = merge.start.row;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndRow = merge.end.row;\n }\n rowIndex++;\n });\n rowIndex = (colGroup.firstChild as Group)?.row;\n colGroup.forEachChildren((cellGroup: Group) => {\n // const oldRow = cellGroup.row;\n // if (isNumber(cellGroup.mergeStartRow)) {\n // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n // }\n // if (isNumber(cellGroup.mergeEndRow)) {\n // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n // }\n cellGroup.row = rowIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartRow = merge.start.row;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndRow = merge.end.row;\n }\n rowIndex++;\n });\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n const table = scene.table;\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false); // body, row header, right frozen\n const bottomGroup =\n scene.getColGroupInBottom(col) ||\n scene.getColGroupInLeftBottomCorner(col) ||\n scene.getColGroupInRightTopCorner(col);\n if (!headerColGroup || !colGroup) {\n continue;\n }\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n let y = 0;\n rowIndex = (colGroup.firstChild as Group)?.row;\n const rowStart = rowIndex;\n y = scene.getCellGroupY(rowIndex);\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartRow = merge.start.row;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndRow = merge.end.row;\n }\n rowIndex++;\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n\n // update bottom frozen cell row index\n bottomGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartRow = merge.start.row;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndRow = merge.end.row;\n }\n rowIndex++;\n });\n }\n return newTotalHeight;\n}\n\nfunction addRowCellGroup(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n // const cellGroup = updateCell(col, row, scene.table, true);\n const cellGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: scene.table.getRowHeight(row)\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.needUpdate = true;\n\n if (!cellGroup) {\n // TODO: deal with data promise situation\n continue;\n }\n\n // insert cellGroup in colGroup\n const colGroup = scene.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n\n if (colGroup.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n (colGroup.firstChild as Group).row = (colGroup.firstChild as Group).row + 1;\n // if (\n // isNumber((colGroup.firstChild as Group).mergeStartRow) &&\n // isNumber((colGroup.firstChild as Group).mergeEndRow)\n // ) {\n // (colGroup.firstChild as Group).mergeStartRow = (colGroup.firstChild as Group).mergeStartRow + 1;\n // (colGroup.firstChild as Group).mergeEndRow = (colGroup.firstChild as Group).mergeEndRow + 1;\n // }\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n // let cellBefore: Group;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // cellBefore = cellGroup;\n // return true;\n // }\n // return false;\n // });\n\n const cellBefore = scene.highPerformanceGetCell(col, row, true);\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\n cellBefore && (cellBefore.row = cellBefore.row + 1);\n // if (isNumber(cellBefore.mergeStartRow) && isNumber(cellBefore.mergeEndRow)) {\n // cellBefore.mergeStartRow = cellBefore.mergeStartRow + 1;\n // cellBefore.mergeEndRow = cellBefore.mergeEndRow + 1;\n // }\n if (cellBefore !== colGroup.lastChild) {\n colGroup.lastChild && ((colGroup.lastChild as Group).row = (colGroup.lastChild as Group).row + 1);\n // if (\n // isNumber((colGroup.lastChild as Group).mergeStartRow) &&\n // isNumber((colGroup.lastChild as Group).mergeEndRow)\n // ) {\n // (colGroup.lastChild as Group).mergeStartRow = (colGroup.lastChild as Group).mergeStartRow + 1;\n // (colGroup.lastChild as Group).mergeEndRow = (colGroup.lastChild as Group).mergeEndRow + 1;\n // }\n }\n }\n }\n\n // // reset row number\n // let rowIndex = (colGroup.firstChild as Group)?.row;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // });\n }\n}\n\nfunction removeCellGroup(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!colGroup) {\n continue;\n }\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.updateColumnHeight(-(cellGroup as Group).attribute.height);\n colGroup.removeChild(cellGroup);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/layout/update-row.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAM3D,MAAM,UAAU,SAAS,CACvB,WAA0B,EAC1B,QAAuB,EACvB,WAA0B,EAC1B,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,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port type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { IGraphic } from '@visactor/vrender';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => b - a);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n const updateRows = deduplication(updateCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n removeRows.forEach(row => {\n scene.table.rowHeightsMap.adjustOrder(row + 1, row, scene.table.rowHeightsMap.count() - row - 1);\n scene.table.rowHeightsMap.del(scene.table.rowHeightsMap.count() - 1);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n scene.table._clearRowRangeHeightsMap();\n\n // add cells\n let updateAfter: number;\n addRows.forEach(row => {\n const needUpdateAfter = addRow(row, scene);\n updateAfter = updateAfter ?? needUpdateAfter;\n scene.table.rowHeightsMap.adjustOrder(row, row + 1, scene.table.rowHeightsMap.count() - row);\n });\n\n // reset attribute y and row number in CellGroup\n // const newTotalHeight = resetRowNumberAndY(scene);\n resetRowNumberAndY(scene);\n\n for (let col = 0; col < table.colCount; col++) {\n // add cells\n updateRows.forEach(r => {\n // updateRowAttr(row, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, r);\n if (mergeInfo) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n updateCell(col, row, scene.table, false);\n }\n }\n } else {\n updateCell(col, r, scene.table, false);\n }\n });\n }\n if (isNumber(updateAfter)) {\n for (let col = 0; col < table.colCount; col++) {\n for (let row = updateAfter; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.rowUpdatePos = updateAfter;\n }\n\n if (addRows.length) {\n if (!isNumber(updateAfter)) {\n const minRow = Math.min(...addRows);\n scene.proxy.rowUpdatePos = minRow;\n }\n scene.proxy.rowUpdateDirection = 'up';\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n updateBottomFrozeCellGroups();\n scene.proxy.progress();\n } else if (removeRows.length) {\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n\n updateBottomFrozeCellGroups();\n scene.proxy.progress();\n }\n\n // update table size\n const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n\n function updateBottomFrozeCellGroups() {\n if (\n addRows?.[addRows?.length - 1] >= table.rowCount - table.bottomFrozenRowCount ||\n updateRows?.[updateRows?.length - 1] >= table.rowCount - table.bottomFrozenRowCount ||\n removeRows?.[0] >= table.rowCount - table.bottomFrozenRowCount\n ) {\n for (let col = 0; col < table.colCount; col++) {\n for (let row = table.rowCount - table.bottomFrozenRowCount; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.updateBottomFrozenCellGroups();\n }\n }\n}\nfunction removeRow(row: number, scene: Scenegraph) {\n removeCellGroup(row, scene);\n const proxy = scene.proxy;\n\n // TODO 需要整体更新proxy的状态\n if (row >= proxy.rowStart && row <= proxy.rowEnd) {\n proxy.rowEnd--;\n proxy.currentRow--;\n }\n proxy.bodyBottomRow--;\n // proxy.totalRow--;\n const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1); // 渐进加载总row数量\n proxy.totalActualBodyRowCount = totalActualBodyRowCount;\n proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n proxy.bodyBottomRow++;\n // proxy.totalRow++;\n const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1); // 渐进加载总row数量\n proxy.totalActualBodyRowCount = totalActualBodyRowCount;\n proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row\n\n if (row < proxy.rowStart) {\n return undefined;\n } else if (row > proxy.rowEnd) {\n if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {\n // can add row\n proxy.rowEnd++;\n proxy.currentRow++;\n\n addRowCellGroup(row, scene);\n return row;\n }\n return undefined;\n }\n if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {\n // can add row\n proxy.rowEnd++;\n proxy.currentRow++;\n\n addRowCellGroup(row, scene);\n return row;\n }\n // update rows after\n return row;\n\n // return undefined;\n\n // // TODO 需要整体更新proxy的状态\n // scene.proxy.bodyBottomRow++;\n // scene.proxy.totalRow++;\n // scene.proxy.rowEnd++;\n // scene.proxy.currentRow++;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\n// function resetRowNumber(scene: Scenegraph) {\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const headerColGroup = scene.getColGroup(col, true);\n// const colGroup = scene.getColGroup(col, false);\n// if (!headerColGroup && !colGroup) {\n// continue;\n// }\n// // reset row number\n// let rowIndex = 0; //(headerColGroup.firstChild as Group)?.row;\n// headerColGroup?.forEachChildren((cellGroup: Group) => {\n// // const oldRow = cellGroup.row;\n// // if (isNumber(cellGroup.mergeStartRow)) {\n// // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n// // }\n// // if (isNumber(cellGroup.mergeEndRow)) {\n// // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n// // }\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// });\n// // rowIndex = (colGroup.firstChild as Group)?.row;\n// // rowIndex = scene.table.columnHeaderLevelCount;\n// rowIndex = scene.bodyRowStart;\n// colGroup?.forEachChildren((cellGroup: Group) => {\n// // const oldRow = cellGroup.row;\n// // if (isNumber(cellGroup.mergeStartRow)) {\n// // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n// // }\n// // if (isNumber(cellGroup.mergeEndRow)) {\n// // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n// // }\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// });\n// }\n// }\n\n// function resetRowNumberAndY(scene: Scenegraph) {\n// const table = scene.table;\n// let newTotalHeight = 0;\n// for (let col = 0; col < scene.table.colCount; col++) {\n// const headerColGroup = scene.getColGroup(col, true);\n// const colGroup = scene.getColGroup(col, false); // body, row header, right frozen\n// const bottomGroup =\n// scene.getColGroupInBottom(col) ||\n// scene.getColGroupInLeftBottomCorner(col) ||\n// scene.getColGroupInRightTopCorner(col);\n// if (!headerColGroup && !colGroup && !bottomGroup) {\n// continue;\n// }\n// let y = 0;\n// // reset row number\n// // let rowIndex = (headerColGroup.firstChild as Group)?.row;\n// // headerColGroup.forEachChildren((cellGroup: Group) => {\n// // cellGroup.row = rowIndex;\n// // rowIndex++;\n// // if (cellGroup.role !== 'cell') {\n// // return;\n// // }\n// // cellGroup.setAttribute('y', y);\n// // y+= cellGroup.attribute.height;\n// // });\n// // let rowIndex = (colGroup.firstChild as Group)?.row;\n// let rowIndex = scene.bodyRowStart;\n// y = scene.getCellGroupY(rowIndex);\n// colGroup?.forEachChildren((cellGroup: Group) => {\n// // const oldRow = cellGroup.row;\n// // if (isNumber(cellGroup.mergeStartRow)) {\n// // cellGroup.mergeStartRow = cellGroup.mergeStartRow - oldRow + rowIndex;\n// // }\n// // if (isNumber(cellGroup.mergeEndRow)) {\n// // cellGroup.mergeEndRow = cellGroup.mergeEndRow - oldRow + rowIndex;\n// // }\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// if (cellGroup.role !== 'cell') {\n// return;\n// }\n// cellGroup.setAttribute('y', y);\n// y += cellGroup.attribute.height;\n// });\n// newTotalHeight = y;\n\n// rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n// // update bottom frozen cell row index\n// bottomGroup?.forEachChildren((cellGroup: Group) => {\n// cellGroup.row = rowIndex;\n// const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n// if (merge) {\n// cellGroup.mergeStartCol = merge.start.col;\n// cellGroup.mergeStartRow = merge.start.row;\n// cellGroup.mergeEndCol = merge.end.col;\n// cellGroup.mergeEndRow = merge.end.row;\n// }\n// rowIndex++;\n// });\n// }\n// return newTotalHeight;\n// }\nfunction resetRowNumber(scene: Scenegraph) {\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n\n scene.rowHeaderGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n\n scene.rightFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n scene.leftBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n scene.rightBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex);\n rowIndex++;\n });\n });\n function processCell(cellGroup: Group, rowIndex: number) {\n cellGroup.row = rowIndex;\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n // let y = (colGroup.firstChild as IGraphic).attribute.y;\n let y = scene.getCellGroupY(rowIndex);\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n\n scene.rowHeaderGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n // let y = (colGroup.firstChild as IGraphic).attribute.y;\n let y = scene.getCellGroupY(rowIndex);\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n\n scene.rightFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.bodyRowStart;\n // let y = (colGroup.firstChild as IGraphic).attribute.y;\n let y = scene.getCellGroupY(rowIndex);\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n let y = 0;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n scene.leftBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n let y = 0;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n scene.rightBottomCornerGroup.forEachChildren((colGroup: Group) => {\n let rowIndex = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n let y = 0;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup, rowIndex, y);\n rowIndex++;\n y += cellGroup.attribute.height;\n });\n });\n function processCell(cellGroup: Group, rowIndex: number, y: number) {\n cellGroup.row = rowIndex;\n cellGroup.setAttribute('y', y);\n const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);\n if (merge) {\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeStartCol = merge.start.col;\n cellGroup.mergeEndCol = merge.end.col;\n cellGroup.mergeEndCol = merge.end.col;\n }\n }\n}\nfunction addRowCellGroup(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n // const cellGroup = updateCell(col, row, scene.table, true);\n const cellGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: scene.table.getRowHeight(row)\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.needUpdate = true;\n\n if (!cellGroup) {\n // TODO: deal with data promise situation\n continue;\n }\n\n // insert cellGroup in colGroup\n const colGroup = scene.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n\n if (colGroup.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n (colGroup.firstChild as Group).row = (colGroup.firstChild as Group).row + 1;\n // if (\n // isNumber((colGroup.firstChild as Group).mergeStartRow) &&\n // isNumber((colGroup.firstChild as Group).mergeEndRow)\n // ) {\n // (colGroup.firstChild as Group).mergeStartRow = (colGroup.firstChild as Group).mergeStartRow + 1;\n // (colGroup.firstChild as Group).mergeEndRow = (colGroup.firstChild as Group).mergeEndRow + 1;\n // }\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n // let cellBefore: Group;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // cellBefore = cellGroup;\n // return true;\n // }\n // return false;\n // });\n\n const cellBefore = scene.highPerformanceGetCell(col, row, true);\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\n cellBefore && (cellBefore.row = cellBefore.row + 1);\n // if (isNumber(cellBefore.mergeStartRow) && isNumber(cellBefore.mergeEndRow)) {\n // cellBefore.mergeStartRow = cellBefore.mergeStartRow + 1;\n // cellBefore.mergeEndRow = cellBefore.mergeEndRow + 1;\n // }\n if (cellBefore !== colGroup.lastChild) {\n colGroup.lastChild && ((colGroup.lastChild as Group).row = (colGroup.lastChild as Group).row + 1);\n // if (\n // isNumber((colGroup.lastChild as Group).mergeStartRow) &&\n // isNumber((colGroup.lastChild as Group).mergeEndRow)\n // ) {\n // (colGroup.lastChild as Group).mergeStartRow = (colGroup.lastChild as Group).mergeStartRow + 1;\n // (colGroup.lastChild as Group).mergeEndRow = (colGroup.lastChild as Group).mergeEndRow + 1;\n // }\n }\n }\n }\n\n // // reset row number\n // let rowIndex = (colGroup.firstChild as Group)?.row;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // });\n }\n}\n\nfunction removeCellGroup(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n if (!colGroup) {\n continue;\n }\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.updateColumnHeight(-(cellGroup as Group).attribute.height);\n colGroup.removeChild(cellGroup);\n }\n }\n}\n"]}
|
|
@@ -49,6 +49,8 @@ export declare class Scenegraph {
|
|
|
49
49
|
get y(): number;
|
|
50
50
|
get bodyRowStart(): number;
|
|
51
51
|
get bodyRowEnd(): number;
|
|
52
|
+
get bodyColStart(): number;
|
|
53
|
+
get bodyColEnd(): number;
|
|
52
54
|
initSceneGraph(): void;
|
|
53
55
|
clearCells(): void;
|
|
54
56
|
updateStageBackground(): void;
|
|
@@ -86,6 +88,7 @@ export declare class Scenegraph {
|
|
|
86
88
|
deleteLastSelectedRangeComponents(): void;
|
|
87
89
|
deleteAllSelectBorder(): void;
|
|
88
90
|
updateCellSelectBorder(newStartCol: number, newStartRow: number, newEndCol: number, newEndRow: number): void;
|
|
91
|
+
recreateAllSelectRangeComponents(): void;
|
|
89
92
|
updateColWidth(col: number, detaX: number, skipUpdateContainer?: boolean): void;
|
|
90
93
|
updateChartSize(col: number): void;
|
|
91
94
|
updateChartState(datum: any): void;
|
|
@@ -132,6 +135,8 @@ export declare class Scenegraph {
|
|
|
132
135
|
updateCellContent(col: number, row: number): Group;
|
|
133
136
|
setPixelRatio(pixelRatio: number): void;
|
|
134
137
|
updateRow(removeCells: CellAddress[], addCells: CellAddress[], updateCells?: CellAddress[]): void;
|
|
138
|
+
updateCol(removeCells: CellAddress[], addCells: CellAddress[], updateCells?: CellAddress[]): void;
|
|
135
139
|
getColumnGroupX(col: number): number;
|
|
136
140
|
getCellGroupY(row: number): number;
|
|
141
|
+
getCellGroupX(col: number): number;
|
|
137
142
|
}
|
|
@@ -64,6 +64,8 @@ import { Env } from "../tools/env";
|
|
|
64
64
|
|
|
65
65
|
import { createCornerCell } from "./style/corner-cell";
|
|
66
66
|
|
|
67
|
+
import { updateCol } from "./layout/update-col";
|
|
68
|
+
|
|
67
69
|
loadPoptip(), container.load(splitModule), container.load(textMeasureModule);
|
|
68
70
|
|
|
69
71
|
const poptipStyle = {
|
|
@@ -142,11 +144,19 @@ export class Scenegraph {
|
|
|
142
144
|
}
|
|
143
145
|
get bodyRowStart() {
|
|
144
146
|
var _a;
|
|
145
|
-
return
|
|
147
|
+
return null !== (_a = this.proxy.rowStart) && void 0 !== _a ? _a : 0;
|
|
146
148
|
}
|
|
147
149
|
get bodyRowEnd() {
|
|
148
150
|
var _a;
|
|
149
|
-
return
|
|
151
|
+
return null !== (_a = this.proxy.rowEnd) && void 0 !== _a ? _a : this.table.rowCount - 1;
|
|
152
|
+
}
|
|
153
|
+
get bodyColStart() {
|
|
154
|
+
var _a;
|
|
155
|
+
return null !== (_a = this.proxy.colStart) && void 0 !== _a ? _a : 0;
|
|
156
|
+
}
|
|
157
|
+
get bodyColEnd() {
|
|
158
|
+
var _a;
|
|
159
|
+
return null !== (_a = this.proxy.colEnd) && void 0 !== _a ? _a : this.table.colCount - 1;
|
|
150
160
|
}
|
|
151
161
|
initSceneGraph() {
|
|
152
162
|
this.isPivot = this.table.isPivotTable(), this.transpose = this.table.options.transpose,
|
|
@@ -340,6 +350,11 @@ export class Scenegraph {
|
|
|
340
350
|
updateCellSelectBorder(newStartCol, newStartRow, newEndCol, newEndRow) {
|
|
341
351
|
updateCellSelectBorder(this, newStartCol, newStartRow, newEndCol, newEndRow);
|
|
342
352
|
}
|
|
353
|
+
recreateAllSelectRangeComponents() {
|
|
354
|
+
deleteAllSelectBorder(this), this.table.stateManager.select.ranges.forEach((cellRange => {
|
|
355
|
+
updateCellSelectBorder(this, cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row);
|
|
356
|
+
})), moveSelectingRangeComponentsToSelectedRangeComponents(this);
|
|
357
|
+
}
|
|
343
358
|
updateColWidth(col, detaX, skipUpdateContainer) {
|
|
344
359
|
updateColWidth(this, col, Math.round(detaX)), skipUpdateContainer || this.updateContainer();
|
|
345
360
|
}
|
|
@@ -703,11 +718,19 @@ export class Scenegraph {
|
|
|
703
718
|
this.recalculateRowHeights(), this.table.stateManager.checkFrozen(), this.isPivot || this.transpose || this.component.setFrozenColumnShadow(this.table.frozenColCount - 1),
|
|
704
719
|
this.component.updateScrollBar(), this.updateNextFrame();
|
|
705
720
|
}
|
|
721
|
+
updateCol(removeCells, addCells, updateCells = []) {
|
|
722
|
+
updateCol(removeCells, addCells, updateCells, this.table), this.recalculateColWidths(),
|
|
723
|
+
this.recalculateRowHeights(), this.table.stateManager.checkFrozen(), this.isPivot || this.transpose || this.component.setFrozenColumnShadow(this.table.frozenColCount - 1),
|
|
724
|
+
this.component.updateScrollBar(), this.updateNextFrame();
|
|
725
|
+
}
|
|
706
726
|
getColumnGroupX(col) {
|
|
707
727
|
return col < this.table.rowHeaderLevelCount ? this.table.getColsWidth(0, col - 1) : col < this.table.colCount - this.table.rightFrozenColCount ? this.table.getColsWidth(this.table.rowHeaderLevelCount, col - 1) : col < this.table.colCount ? this.table.getColsWidth(this.table.colCount - this.table.bottomFrozenRowCount, col - 1) : 0;
|
|
708
728
|
}
|
|
709
729
|
getCellGroupY(row) {
|
|
710
730
|
return row < this.table.columnHeaderLevelCount ? this.table.getRowsHeight(0, row - 1) : row < this.table.rowCount - this.table.bottomFrozenRowCount ? this.table.getRowsHeight(this.table.columnHeaderLevelCount, row - 1) : row < this.table.rowCount ? this.table.getRowsHeight(this.table.rowCount - this.table.bottomFrozenRowCount, row - 1) : 0;
|
|
711
731
|
}
|
|
732
|
+
getCellGroupX(col) {
|
|
733
|
+
return col < this.table.rowHeaderLevelCount ? this.table.getColsWidth(0, col - 1) : col < this.table.colCount - this.table.rightFrozenColCount ? this.table.getColsWidth(this.table.rowHeaderLevelCount, col - 1) : col < this.table.colCount ? this.table.getColsWidth(this.table.colCount - this.table.rightFrozenColCount, col - 1) : 0;
|
|
734
|
+
}
|
|
712
735
|
}
|
|
713
736
|
//# sourceMappingURL=scenegraph.js.map
|