@visactor/vtable 0.15.5-alpha.4 → 0.16.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.
Files changed (161) hide show
  1. package/cjs/ListTable.d.ts +5 -2
  2. package/cjs/ListTable.js +163 -17
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +1 -1
  5. package/cjs/PivotChart.js +8 -8
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/PivotTable.d.ts +1 -1
  8. package/cjs/PivotTable.js +8 -8
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/components/axis/axis.d.ts +1 -1
  11. package/cjs/components/axis/axis.js +16 -7
  12. package/cjs/components/axis/axis.js.map +1 -1
  13. package/cjs/components/axis/get-axis-attributes.d.ts +1 -0
  14. package/cjs/components/axis/get-axis-attributes.js +29 -2
  15. package/cjs/components/axis/get-axis-attributes.js.map +1 -1
  16. package/cjs/components/menu/dom/logic/MenuElement.js +3 -3
  17. package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
  18. package/cjs/core/BaseTable.d.ts +1 -1
  19. package/cjs/core/BaseTable.js +6 -6
  20. package/cjs/core/BaseTable.js.map +1 -1
  21. package/cjs/core/tableHelper.d.ts +2 -0
  22. package/cjs/core/tableHelper.js +18 -3
  23. package/cjs/core/tableHelper.js.map +1 -1
  24. package/cjs/data/DataSource.d.ts +8 -1
  25. package/cjs/data/DataSource.js +59 -2
  26. package/cjs/data/DataSource.js.map +1 -1
  27. package/cjs/event/event.d.ts +2 -0
  28. package/cjs/event/event.js +10 -2
  29. package/cjs/event/event.js.map +1 -1
  30. package/cjs/index.d.ts +1 -1
  31. package/cjs/index.js +1 -1
  32. package/cjs/index.js.map +1 -1
  33. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +6 -2
  34. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  35. package/cjs/scenegraph/graphic/contributions/index.js +9 -9
  36. package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
  37. package/cjs/scenegraph/group-creater/cell-helper.js +1 -1
  38. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  39. package/cjs/scenegraph/group-creater/column.d.ts +0 -4
  40. package/cjs/scenegraph/group-creater/column.js +1 -19
  41. package/cjs/scenegraph/group-creater/column.js.map +1 -1
  42. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +2 -0
  43. package/cjs/scenegraph/group-creater/progress/proxy.js +15 -1
  44. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  45. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +4 -0
  46. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  47. package/cjs/scenegraph/layout/auto-height.d.ts +1 -2
  48. package/cjs/scenegraph/layout/auto-height.js +1 -36
  49. package/cjs/scenegraph/layout/auto-height.js.map +1 -1
  50. package/cjs/scenegraph/layout/compute-col-width.js +1 -1
  51. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  52. package/cjs/scenegraph/layout/update-col.d.ts +3 -0
  53. package/cjs/scenegraph/layout/update-col.js +203 -0
  54. package/cjs/scenegraph/layout/update-col.js.map +1 -0
  55. package/cjs/scenegraph/layout/update-height.js +1 -1
  56. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  57. package/cjs/scenegraph/layout/update-row.js +94 -49
  58. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  59. package/cjs/scenegraph/layout/update-width.js +1 -1
  60. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  61. package/cjs/scenegraph/refresh-node/update-chart.js +1 -1
  62. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  63. package/cjs/scenegraph/scenegraph.d.ts +5 -0
  64. package/cjs/scenegraph/scenegraph.js +24 -3
  65. package/cjs/scenegraph/scenegraph.js.map +1 -1
  66. package/cjs/scenegraph/utils/get-hierarchy-offset.js +1 -1
  67. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  68. package/cjs/state/resize/update-resize-column.js +1 -1
  69. package/cjs/state/resize/update-resize-column.js.map +1 -1
  70. package/cjs/state/state.d.ts +2 -0
  71. package/cjs/state/state.js +47 -2
  72. package/cjs/state/state.js.map +1 -1
  73. package/cjs/themes/DARK.js.map +1 -1
  74. package/cjs/tools/diff-cell.js +1 -1
  75. package/cjs/tools/diff-cell.js.map +1 -1
  76. package/cjs/ts-types/base-table.d.ts +1 -1
  77. package/cjs/ts-types/base-table.js.map +1 -1
  78. package/cjs/ts-types/table-engine.d.ts +3 -0
  79. package/cjs/ts-types/table-engine.js.map +1 -1
  80. package/dist/vtable.js +20208 -3499
  81. package/dist/vtable.min.js +2 -2
  82. package/es/ListTable.d.ts +5 -2
  83. package/es/ListTable.js +163 -18
  84. package/es/ListTable.js.map +1 -1
  85. package/es/PivotChart.d.ts +1 -1
  86. package/es/PivotChart.js +8 -8
  87. package/es/PivotChart.js.map +1 -1
  88. package/es/PivotTable.d.ts +1 -1
  89. package/es/PivotTable.js +8 -8
  90. package/es/PivotTable.js.map +1 -1
  91. package/es/components/axis/axis.d.ts +1 -1
  92. package/es/components/axis/axis.js +16 -8
  93. package/es/components/axis/axis.js.map +1 -1
  94. package/es/components/axis/get-axis-attributes.d.ts +1 -0
  95. package/es/components/axis/get-axis-attributes.js +26 -0
  96. package/es/components/axis/get-axis-attributes.js.map +1 -1
  97. package/es/components/menu/dom/logic/MenuElement.js +3 -3
  98. package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
  99. package/es/core/BaseTable.d.ts +1 -1
  100. package/es/core/BaseTable.js +5 -5
  101. package/es/core/BaseTable.js.map +1 -1
  102. package/es/core/tableHelper.d.ts +2 -0
  103. package/es/core/tableHelper.js +16 -0
  104. package/es/core/tableHelper.js.map +1 -1
  105. package/es/data/DataSource.d.ts +8 -1
  106. package/es/data/DataSource.js +59 -2
  107. package/es/data/DataSource.js.map +1 -1
  108. package/es/event/event.d.ts +2 -0
  109. package/es/event/event.js +10 -2
  110. package/es/event/event.js.map +1 -1
  111. package/es/index.d.ts +1 -1
  112. package/es/index.js +1 -1
  113. package/es/index.js.map +1 -1
  114. package/es/scenegraph/graphic/contributions/group-contribution-render.js +6 -2
  115. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  116. package/es/scenegraph/graphic/contributions/index.js +9 -9
  117. package/es/scenegraph/graphic/contributions/index.js.map +1 -1
  118. package/es/scenegraph/group-creater/cell-helper.js +1 -1
  119. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  120. package/es/scenegraph/group-creater/column.d.ts +0 -4
  121. package/es/scenegraph/group-creater/column.js +0 -16
  122. package/es/scenegraph/group-creater/column.js.map +1 -1
  123. package/es/scenegraph/group-creater/progress/proxy.d.ts +2 -0
  124. package/es/scenegraph/group-creater/progress/proxy.js +14 -0
  125. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  126. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +4 -0
  127. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  128. package/es/scenegraph/layout/auto-height.d.ts +1 -2
  129. package/es/scenegraph/layout/auto-height.js +0 -33
  130. package/es/scenegraph/layout/auto-height.js.map +1 -1
  131. package/es/scenegraph/layout/compute-col-width.js +1 -1
  132. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  133. package/es/scenegraph/layout/update-col.d.ts +3 -0
  134. package/es/scenegraph/layout/update-col.js +200 -0
  135. package/es/scenegraph/layout/update-col.js.map +1 -0
  136. package/es/scenegraph/layout/update-height.js +1 -1
  137. package/es/scenegraph/layout/update-height.js.map +1 -1
  138. package/es/scenegraph/layout/update-row.js +94 -49
  139. package/es/scenegraph/layout/update-row.js.map +1 -1
  140. package/es/scenegraph/layout/update-width.js +1 -1
  141. package/es/scenegraph/layout/update-width.js.map +1 -1
  142. package/es/scenegraph/refresh-node/update-chart.js +1 -1
  143. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  144. package/es/scenegraph/scenegraph.d.ts +5 -0
  145. package/es/scenegraph/scenegraph.js +25 -2
  146. package/es/scenegraph/scenegraph.js.map +1 -1
  147. package/es/scenegraph/utils/get-hierarchy-offset.js +1 -1
  148. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  149. package/es/state/resize/update-resize-column.js +1 -1
  150. package/es/state/resize/update-resize-column.js.map +1 -1
  151. package/es/state/state.d.ts +2 -0
  152. package/es/state/state.js +47 -2
  153. package/es/state/state.js.map +1 -1
  154. package/es/themes/DARK.js.map +1 -1
  155. package/es/tools/diff-cell.js +1 -1
  156. package/es/tools/diff-cell.js.map +1 -1
  157. package/es/ts-types/base-table.d.ts +1 -1
  158. package/es/ts-types/base-table.js.map +1 -1
  159. package/es/ts-types/table-engine.d.ts +3 -0
  160. package/es/ts-types/table-engine.js.map +1 -1
  161. package/package.json +6 -6
@@ -0,0 +1,200 @@
1
+ import { isNumber } from "@visactor/vutils";
2
+
3
+ import { Group } from "../graphic/group";
4
+
5
+ import { updateCell } from "../group-creater/cell-helper";
6
+
7
+ import { getCellMergeInfo } from "../utils/get-cell-merge";
8
+
9
+ export function updateCol(removeCells, addCells, updateCells, table) {
10
+ const scene = table.scenegraph, removeCols = deduplication(removeCells.map((cell => cell.col))).sort(((a, b) => b - a)), addCols = deduplication(addCells.map((cell => cell.col))).sort(((a, b) => a - b)), updateCols = deduplication(updateCells.map((cell => cell.col))).sort(((a, b) => a - b));
11
+ let updateAfter;
12
+ if (removeCols.forEach((col => {
13
+ removeCol(col, scene);
14
+ })), removeCols.forEach((col => {
15
+ scene.table.colWidthsMap.adjustOrder(col + 1, col, scene.table.colWidthsMap.count() - col - 1),
16
+ scene.table.colWidthsMap.del(scene.table.colWidthsMap.count() - 1);
17
+ })), removeCols.length && resetColNumber(scene), scene.table._clearColRangeWidthsMap(),
18
+ addCols.forEach((col => {
19
+ const needUpdateAfter = addCol(col, scene);
20
+ resetColNumber(scene), updateAfter = null != updateAfter ? updateAfter : needUpdateAfter,
21
+ scene.table.colWidthsMap.adjustOrder(col, col + 1, scene.table.colWidthsMap.count() - col);
22
+ })), resetColNumberAndX(scene), updateCols.forEach((col => {
23
+ for (let row = 0; row < table.rowCount; row++) {
24
+ const mergeInfo = getCellMergeInfo(scene.table, col, row);
25
+ if (mergeInfo) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) updateCell(col, row, scene.table, !1); else updateCell(col, row, scene.table, !1);
26
+ }
27
+ })), isNumber(updateAfter)) {
28
+ for (let col = updateAfter; col < table.colCount; col++) for (let row = 0; row < table.rowCount; row++) {
29
+ const cellGroup = scene.highPerformanceGetCell(col, row, !0);
30
+ cellGroup && (cellGroup.needUpdate = !0);
31
+ }
32
+ scene.proxy.colUpdatePos = updateAfter;
33
+ }
34
+ if (addCols.length) {
35
+ if (!isNumber(updateAfter)) {
36
+ const minCol = Math.min(...addCols);
37
+ scene.proxy.colUpdatePos = minCol;
38
+ }
39
+ scene.proxy.colUpdateDirection = "left", scene.proxy.updateColGroups(2 * scene.proxy.screenColCount),
40
+ updateRightFrozeCellGroups(), scene.proxy.progress();
41
+ } else removeCols.length && (scene.proxy.updateColGroups(2 * scene.proxy.screenColCount),
42
+ updateRightFrozeCellGroups(), scene.proxy.progress());
43
+ const newTotalWidth = table.getColsWidth(table.frozenColCount, table.colCount - 1);
44
+ function updateRightFrozeCellGroups() {
45
+ if ((null == addCols ? void 0 : addCols[(null == addCols ? void 0 : addCols.length) - 1]) >= table.colCount - table.rightFrozenColCount || (null == updateCols ? void 0 : updateCols[(null == updateCols ? void 0 : updateCols.length) - 1]) >= table.colCount - table.rightFrozenColCount || (null == removeCols ? void 0 : removeCols[0]) >= table.colCount - table.rightFrozenColCount) {
46
+ for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) for (let row = 0; row < table.rowCount; row++) {
47
+ const cellGroup = scene.highPerformanceGetCell(col, row, !0);
48
+ cellGroup && (cellGroup.needUpdate = !0);
49
+ }
50
+ scene.proxy.updateRightFrozenCellGroups();
51
+ }
52
+ }
53
+ scene.updateContainerWidth(scene.table.frozenColCount, newTotalWidth - scene.bodyGroup.attribute.width);
54
+ }
55
+
56
+ function removeCol(col, scene) {
57
+ const proxy = scene.proxy;
58
+ if (col >= scene.table.rowHeaderLevelCount) if (col >= scene.table.colCount - scene.table.rightFrozenColCount) ; else {
59
+ const colGroup = scene.getColGroup(col, !1);
60
+ colGroup && colGroup.parent === scene.bodyGroup && scene.bodyGroup.removeChild(colGroup);
61
+ const bottomColGroup = scene.getColGroupInBottom(col);
62
+ bottomColGroup && bottomColGroup.parent === scene.bottomFrozenGroup && scene.bottomFrozenGroup.removeChild(bottomColGroup);
63
+ }
64
+ col >= proxy.colStart && col <= proxy.colEnd && (proxy.colEnd--, proxy.currentCol--),
65
+ proxy.bodyRightCol--;
66
+ const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1);
67
+ proxy.totalActualBodyColCount = totalActualBodyColCount, proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1;
68
+ }
69
+
70
+ function addCol(col, scene) {
71
+ const proxy = scene.proxy;
72
+ proxy.bodyRightCol++;
73
+ const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1);
74
+ if (proxy.totalActualBodyColCount = totalActualBodyColCount, proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1,
75
+ !(col < proxy.colStart)) return col > proxy.colEnd ? proxy.colEnd - proxy.colStart + 1 < proxy.colLimit ? (proxy.colEnd++,
76
+ proxy.currentCol++, addColGroup(col, scene), col) : void 0 : proxy.colEnd - proxy.colStart + 1 < proxy.colLimit ? (proxy.colEnd++,
77
+ proxy.currentCol++, addColGroup(col, scene), col) : col;
78
+ }
79
+
80
+ function deduplication(array) {
81
+ const result = [];
82
+ for (let i = 0; i < array.length; i++) -1 === result.indexOf(array[i]) && result.push(array[i]);
83
+ return result;
84
+ }
85
+
86
+ function resetColNumber(scene) {
87
+ let colIndex = scene.bodyColStart;
88
+ function processCell(cellGroup) {
89
+ cellGroup.col = colIndex;
90
+ const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
91
+ merge && (cellGroup.mergeStartCol = merge.start.col, cellGroup.mergeStartCol = merge.start.col,
92
+ cellGroup.mergeEndCol = merge.end.col, cellGroup.mergeEndCol = merge.end.col), cellGroup.role;
93
+ }
94
+ scene.bodyGroup.forEachChildren((colGroup => {
95
+ colGroup.col = colIndex, null == colGroup || colGroup.forEachChildren((cellGroup => {
96
+ processCell(cellGroup);
97
+ })), colIndex++;
98
+ })), colIndex = scene.bodyColStart, scene.colHeaderGroup.forEachChildren((colGroup => {
99
+ colGroup.col = colIndex, null == colGroup || colGroup.forEachChildren((cellGroup => {
100
+ processCell(cellGroup);
101
+ })), colIndex++;
102
+ })), colIndex = scene.bodyColStart, scene.bottomFrozenGroup.forEachChildren((colGroup => {
103
+ colGroup.col = colIndex, null == colGroup || colGroup.forEachChildren((cellGroup => {
104
+ processCell(cellGroup);
105
+ })), colIndex++;
106
+ }));
107
+ }
108
+
109
+ function resetColNumberAndX(scene) {
110
+ let colIndex = scene.bodyColStart, x = scene.getCellGroupX(colIndex);
111
+ function processCell(cellGroup) {
112
+ cellGroup.col = colIndex;
113
+ const merge = getCellMergeInfo(scene.table, cellGroup.col, cellGroup.row);
114
+ merge && (cellGroup.mergeStartCol = merge.start.col, cellGroup.mergeStartCol = merge.start.col,
115
+ cellGroup.mergeEndCol = merge.end.col, cellGroup.mergeEndCol = merge.end.col), cellGroup.role;
116
+ }
117
+ scene.bodyGroup.forEachChildren((colGroup => {
118
+ colGroup.col = colIndex, null == colGroup || colGroup.forEachChildren((cellGroup => {
119
+ processCell(cellGroup);
120
+ })), colGroup.setAttribute("x", x), x += colGroup.attribute.width, colIndex++;
121
+ })), colIndex = scene.bodyColStart, x = scene.getCellGroupX(colIndex), scene.colHeaderGroup.forEachChildren((colGroup => {
122
+ colGroup.col = colIndex, null == colGroup || colGroup.forEachChildren((cellGroup => {
123
+ processCell(cellGroup);
124
+ })), colGroup.setAttribute("x", x), x += colGroup.attribute.width, colIndex++;
125
+ })), colIndex = scene.bodyColStart, x = scene.getCellGroupX(colIndex), scene.bottomFrozenGroup.forEachChildren((colGroup => {
126
+ colGroup.col = colIndex, null == colGroup || colGroup.forEachChildren((cellGroup => {
127
+ processCell(cellGroup);
128
+ })), colGroup.setAttribute("x", x), x += colGroup.attribute.width, colIndex++;
129
+ })), colIndex = scene.table.colCount - scene.table.rightFrozenColCount, x = 0, scene.rightFrozenGroup.forEachChildren((colGroup => {
130
+ colGroup.col = colIndex, null == colGroup || colGroup.forEachChildren((cellGroup => {
131
+ processCell(cellGroup);
132
+ })), colGroup.setAttribute("x", x), x += colGroup.attribute.width, colIndex++;
133
+ })), colIndex = scene.table.colCount - scene.table.rightFrozenColCount, x = 0, scene.rightTopCornerGroup.forEachChildren((colGroup => {
134
+ colGroup.col = colIndex, null == colGroup || colGroup.forEachChildren((cellGroup => {
135
+ processCell(cellGroup);
136
+ })), colGroup.setAttribute("x", x), x += colGroup.attribute.width, colIndex++;
137
+ })), colIndex = scene.table.colCount - scene.table.rightFrozenColCount, x = 0, scene.rightBottomCornerGroup.forEachChildren((colGroup => {
138
+ colGroup.col = colIndex, null == colGroup || colGroup.forEachChildren((cellGroup => {
139
+ processCell(cellGroup);
140
+ })), colGroup.setAttribute("x", x), x += colGroup.attribute.width, colIndex++;
141
+ }));
142
+ }
143
+
144
+ function addColGroup(col, scene) {
145
+ if (scene.colHeaderGroup && scene.table.columnHeaderLevelCount > 0) {
146
+ const columnGroup = new Group({
147
+ x: 0,
148
+ y: 0,
149
+ width: scene.table.getColWidth(col),
150
+ height: 0,
151
+ clip: !1,
152
+ pickable: !1
153
+ });
154
+ columnGroup.role = "column", columnGroup.col = col;
155
+ const colAfter = scene.getColGroup(col, !0);
156
+ colAfter ? scene.colHeaderGroup.insertBefore(columnGroup, colAfter) : scene.colHeaderGroup.appendChild(columnGroup),
157
+ generateCellGroup(columnGroup, col, 0, scene.table.columnHeaderLevelCount - 1);
158
+ }
159
+ if (scene.bodyGroup) {
160
+ const columnGroup = new Group({
161
+ x: 0,
162
+ y: 0,
163
+ width: scene.table.getColWidth(col),
164
+ height: 0,
165
+ clip: !1,
166
+ pickable: !1
167
+ });
168
+ columnGroup.role = "column", columnGroup.col = col;
169
+ const colAfter = scene.getColGroup(col, !1);
170
+ colAfter ? scene.bodyGroup.insertBefore(columnGroup, colAfter) : scene.bodyGroup.appendChild(columnGroup),
171
+ generateCellGroup(columnGroup, col, scene.bodyRowStart, scene.bodyRowEnd);
172
+ }
173
+ if (scene.bottomFrozenGroup && scene.table.bottomFrozenRowCount > 0) {
174
+ const columnGroup = new Group({
175
+ x: 0,
176
+ y: 0,
177
+ width: scene.table.getColWidth(col),
178
+ height: 0,
179
+ clip: !1,
180
+ pickable: !1
181
+ });
182
+ columnGroup.role = "column", columnGroup.col = col;
183
+ const colAfter = scene.getColGroupInBottom(col);
184
+ colAfter ? scene.bottomFrozenGroup.insertBefore(columnGroup, colAfter) : scene.bottomFrozenGroup.appendChild(columnGroup),
185
+ generateCellGroup(columnGroup, col, scene.table.rowCount - scene.table.bottomFrozenRowCount, scene.table.rowCount - 1);
186
+ }
187
+ function generateCellGroup(group, col, rowStart, rowEnd) {
188
+ for (let row = rowStart; row <= rowEnd; row++) {
189
+ const cellGroup = new Group({
190
+ x: 0,
191
+ y: 0,
192
+ width: scene.table.getColWidth(col),
193
+ height: scene.table.getRowHeight(row)
194
+ });
195
+ cellGroup.role = "cell", cellGroup.col = col, cellGroup.row = row, cellGroup.needUpdate = !0,
196
+ group.appendChild(cellGroup);
197
+ }
198
+ }
199
+ }
200
+ //# sourceMappingURL=update-col.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scenegraph/layout/update-col.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ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AAK,CAAC,WAAW,CAAC,GAAG,CAAC;gBACnC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;aACtC,CAAC,CAAC;YACH,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC;YACxB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC;YACpB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC;YACpB,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC;YAC5B,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;SAC9B;IACH,CAAC;AACH,CAAC","file":"update-col.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';\nimport type { IGroup } from '@visactor/vrender';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateCol(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeCols = deduplication(removeCells.map(cell => cell.col)).sort((a, b) => b - a);\n const addCols = deduplication(addCells.map(cell => cell.col)).sort((a, b) => a - b);\n const updateCols = deduplication(updateCells.map(cell => cell.col)).sort((a, b) => a - b);\n\n // remove cells\n removeCols.forEach(col => {\n removeCol(col, scene);\n });\n\n removeCols.forEach(col => {\n scene.table.colWidthsMap.adjustOrder(col + 1, col, scene.table.colWidthsMap.count() - col - 1);\n scene.table.colWidthsMap.del(scene.table.colWidthsMap.count() - 1);\n });\n\n if (removeCols.length) {\n resetColNumber(scene);\n }\n\n scene.table._clearColRangeWidthsMap();\n\n // add cells\n let updateAfter: number;\n addCols.forEach(col => {\n const needUpdateAfter = addCol(col, scene);\n resetColNumber(scene);\n updateAfter = updateAfter ?? needUpdateAfter;\n scene.table.colWidthsMap.adjustOrder(col, col + 1, scene.table.colWidthsMap.count() - col);\n });\n\n // reset attribute y and col number in CellGroup\n // const newTotalHeight = resetColNumberAndY(scene);\n resetColNumberAndX(scene);\n // add cells\n updateCols.forEach(col => {\n for (let row = 0; row < table.rowCount; row++) {\n // updateColAttr(col, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {\n updateCell(col, row, scene.table, false);\n }\n }\n } else {\n updateCell(col, row, scene.table, false);\n }\n }\n });\n\n if (isNumber(updateAfter)) {\n for (let col = updateAfter; col < table.colCount; col++) {\n for (let row = 0; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.colUpdatePos = updateAfter;\n }\n if (addCols.length) {\n if (!isNumber(updateAfter)) {\n const minCol = Math.min(...addCols);\n scene.proxy.colUpdatePos = minCol;\n }\n scene.proxy.colUpdateDirection = 'left';\n scene.proxy.updateColGroups(scene.proxy.screenColCount * 2);\n updateRightFrozeCellGroups();\n scene.proxy.progress();\n } else if (removeCols.length) {\n scene.proxy.updateColGroups(scene.proxy.screenColCount * 2);\n updateRightFrozeCellGroups();\n scene.proxy.progress();\n }\n\n // update table size\n const newTotalWidth = table.getColsWidth(table.frozenColCount, table.colCount - 1);\n scene.updateContainerWidth(scene.table.frozenColCount, newTotalWidth - scene.bodyGroup.attribute.width);\n\n function updateRightFrozeCellGroups() {\n if (\n addCols?.[addCols?.length - 1] >= table.colCount - table.rightFrozenColCount ||\n updateCols?.[updateCols?.length - 1] >= table.colCount - table.rightFrozenColCount ||\n removeCols?.[0] >= table.colCount - table.rightFrozenColCount\n ) {\n for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {\n for (let row = 0; row < table.rowCount; row++) {\n const cellGroup = scene.highPerformanceGetCell(col, row, true);\n cellGroup && (cellGroup.needUpdate = true);\n }\n }\n scene.proxy.updateRightFrozenCellGroups();\n }\n }\n}\n\nfunction removeCol(col: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n // removeCellGroup(col, scene);\n //先考虑非表头部分删除情况\n if (col >= scene.table.rowHeaderLevelCount) {\n if (col >= scene.table.colCount - scene.table.rightFrozenColCount) {\n // 如果是删除的右侧固定列 这里不做真正的删除,只需要后面将相应列做更新\n // scene.bodyGroup.removeChild(scene.bodyGroup.lastChild as any);\n // scene.bottomFrozenGroup.removeChild(scene.bottomFrozenGroup.lastChild as any);\n } else {\n const colGroup = scene.getColGroup(col, false);\n if (colGroup && colGroup.parent === scene.bodyGroup) {\n scene.bodyGroup.removeChild(colGroup);\n }\n const bottomColGroup = scene.getColGroupInBottom(col);\n if (bottomColGroup && bottomColGroup.parent === scene.bottomFrozenGroup) {\n scene.bottomFrozenGroup.removeChild(bottomColGroup);\n }\n }\n }\n\n // TODO 需要整体更新proxy的状态\n if (col >= proxy.colStart && col <= proxy.colEnd) {\n proxy.colEnd--;\n proxy.currentCol--;\n }\n proxy.bodyRightCol--;\n // proxy.totalCol--;\n const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1); // 渐进加载总col数量\n proxy.totalActualBodyColCount = totalActualBodyColCount;\n proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1; // 目标渐进完成的col\n}\n\nfunction addCol(col: number, scene: Scenegraph) {\n const proxy = scene.proxy;\n proxy.bodyRightCol++;\n // proxy.totalCol++;\n const totalActualBodyColCount = Math.min(proxy.colLimit, proxy.bodyRightCol - proxy.bodyLeftCol + 1); // 渐进加载总col数量\n proxy.totalActualBodyColCount = totalActualBodyColCount;\n proxy.totalCol = proxy.colStart + totalActualBodyColCount - 1; // 目标渐进完成的col\n\n if (col < proxy.colStart) {\n return undefined;\n } else if (col > proxy.colEnd) {\n if (proxy.colEnd - proxy.colStart + 1 < proxy.colLimit) {\n // can add col\n proxy.colEnd++;\n proxy.currentCol++;\n\n addColGroup(col, scene);\n return col;\n }\n return undefined;\n }\n if (proxy.colEnd - proxy.colStart + 1 < proxy.colLimit) {\n // can add col\n proxy.colEnd++;\n proxy.currentCol++;\n\n addColGroup(col, scene);\n return col;\n }\n return col;\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 resetColNumber(scene: Scenegraph) {\n let colIndex = scene.bodyColStart;\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n scene.colHeaderGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colIndex++;\n });\n function processCell(cellGroup: Group) {\n cellGroup.col = colIndex;\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 if (cellGroup.role !== 'cell') {\n return;\n }\n }\n}\n\nfunction resetColNumberAndX(scene: Scenegraph) {\n let colIndex = scene.bodyColStart;\n let x = scene.getCellGroupX(colIndex);\n scene.bodyGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n x = scene.getCellGroupX(colIndex);\n scene.colHeaderGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.bodyColStart;\n x = scene.getCellGroupX(colIndex);\n scene.bottomFrozenGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n colIndex = scene.table.colCount - scene.table.rightFrozenColCount;\n x = 0;\n scene.rightFrozenGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.table.colCount - scene.table.rightFrozenColCount;\n x = 0;\n scene.rightTopCornerGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n\n colIndex = scene.table.colCount - scene.table.rightFrozenColCount;\n x = 0;\n scene.rightBottomCornerGroup.forEachChildren((colGroup: Group) => {\n colGroup.col = colIndex;\n colGroup?.forEachChildren((cellGroup: Group) => {\n processCell(cellGroup);\n });\n colGroup.setAttribute('x', x);\n x += colGroup.attribute.width;\n colIndex++;\n });\n function processCell(cellGroup: Group) {\n cellGroup.col = colIndex;\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 if (cellGroup.role !== 'cell') {\n return;\n }\n }\n}\n\nfunction addColGroup(col: number, scene: Scenegraph) {\n if (scene.colHeaderGroup && scene.table.columnHeaderLevelCount > 0) {\n const columnGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = col;\n\n const colAfter = scene.getColGroup(col, true);\n if (colAfter) {\n scene.colHeaderGroup.insertBefore(columnGroup, colAfter);\n } else {\n scene.colHeaderGroup.appendChild(columnGroup);\n }\n generateCellGroup(columnGroup, col, 0, scene.table.columnHeaderLevelCount - 1);\n }\n\n if (scene.bodyGroup) {\n const columnGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = col;\n\n const colAfter = scene.getColGroup(col, false);\n if (colAfter) {\n scene.bodyGroup.insertBefore(columnGroup, colAfter);\n } else {\n scene.bodyGroup.appendChild(columnGroup);\n }\n generateCellGroup(columnGroup, col, scene.bodyRowStart, scene.bodyRowEnd);\n }\n if (scene.bottomFrozenGroup && scene.table.bottomFrozenRowCount > 0) {\n const columnGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = col;\n\n const colAfter = scene.getColGroupInBottom(col);\n if (colAfter) {\n scene.bottomFrozenGroup.insertBefore(columnGroup, colAfter);\n } else {\n scene.bottomFrozenGroup.appendChild(columnGroup);\n }\n\n generateCellGroup(\n columnGroup,\n col,\n scene.table.rowCount - scene.table.bottomFrozenRowCount,\n scene.table.rowCount - 1\n );\n }\n\n function generateCellGroup(group: IGroup, col: number, rowStart: number, rowEnd: number) {\n for (let row = rowStart; row <= rowEnd; row++) {\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 group.appendChild(cellGroup);\n }\n }\n}\n"]}
@@ -30,7 +30,7 @@ export function updateRowHeight(scene, row, detaY) {
30
30
  }
31
31
  let rowStart = 0, rowEnd = 0;
32
32
  row < scene.table.columnHeaderLevelCount ? (rowStart = row + 1, rowEnd = scene.table.columnHeaderLevelCount - 1) : (rowStart = row + 1,
33
- rowEnd = scene.bodyRowEnd - scene.table.bottomFrozenRowCount);
33
+ rowEnd = scene.bodyRowEnd);
34
34
  for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {
35
35
  const cellGroup = scene.getCell(colIndex, rowIndex);
36
36
  "cell" === cellGroup.role && cellGroup.setAttribute("y", cellGroup.attribute.y + detaY);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/layout/update-height.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AA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AAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBAC3D,eAAe,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;oBAClD,KAAK,CAAC,aAAa,CAAC;wBAClB,EAAE,EAAE,CAAC;wBACL,EAAE,EAAE,CAAC;qBACN,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;gBACH,uBAAuB,CAAC,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;gBAC7G,MAAM,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;gBAG1C,eAAe,CAAC,aAAa,GAAG,UAAU,CAAC;gBAE3C,eAAe,CACb,eAAe,EACf,UAAU,EACV,WAAW,EACX;oBACE,KAAK,EAAE;wBACL,GAAG,EAAE,SAAS,CAAC,aAAa;wBAC5B,GAAG,EAAE,SAAS,CAAC,aAAa;qBAC7B;oBACD,GAAG,EAAE;wBACH,GAAG,EAAE,SAAS,CAAC,WAAW;wBAC1B,GAAG,EAAE,SAAS,CAAC,WAAW;qBAC3B;iBACF,EACD,KAAK,CACN,CAAC;aACH;SACF;KACF;SAAM;QACL,uBAAuB,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;KACxG;AACH,CAAC","file":"update-height.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { Group } from '../graphic/group';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentHeight } from '../utils/text-icon-layout';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { resizeCellGroup } from '../group-creater/column-helper';\nimport type { IGraphic } from '@visactor/vrender';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number) {\n // 更新table行高存储\n scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.start.col !== col) {\n continue;\n }\n const height = cell.attribute.height;\n // cell.setAttribute('height', height);\n // (cell.firstChild as Rect).setAttribute('height', cell.attribute.height);\n updateCellHeightForRow(scene, cell, col, row, height + detaY, detaY, scene.table.isHeader(col, row));\n\n scene.updateCellContentWhileResize(col, row);\n }\n\n let rowStart = 0;\n let rowEnd = 0;\n // 更新header 高度\n if (row < scene.table.columnHeaderLevelCount) {\n // scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n // scene.rowHeaderGroup.setAttribute('y', scene.rowHeaderGroup.attribute.y + detaY);\n // scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.columnHeaderLevelCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = scene.bodyRowEnd - scene.table.bottomFrozenRowCount;\n }\n\n // 更新以下行位置\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n const cellGroup = scene.getCell(colIndex, rowIndex);\n if (cellGroup.role === 'cell') {\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n }\n}\n\n/**\n * @description: 更新单个单元格高度\n * @return {*}\n */\nexport function updateCellHeightForRow(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n // autoRowHeight: boolean\n) {\n cell.setAttribute('height', height);\n const cellGroup = cell;\n const distHeight = height;\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n updateCellHeight(scene, cellGroup, col, row, distHeight, detaY, isHeader);\n}\n\nexport function updateCellHeightForColumn(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n) {\n cell.setAttribute('height', height);\n const cellGroup = cell;\n updateCellHeight(scene, cellGroup, col, row, height, 0, isHeader);\n}\n\nexport function updateCellHeight(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n distHeight: number,\n detaY: number,\n isHeader: boolean\n) {\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cell.attribute.width,\n // cell.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cell.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cell.insertBefore(newBarCell, oldBarCell);\n cell.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cell.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cell,\n cell.parent,\n cell.attribute.x,\n cell.attribute.y,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, scene.table);\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n let renderDefault = true;\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellLocation = scene.table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n false,\n scene.table.heightMode === 'autoHeight',\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n\n if (cell.childrenCount > 0) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customElementsGroup);\n }\n }\n\n if (renderDefault) {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateMergeCellContentHeight(\n cell,\n distHeight,\n detaY,\n // scene.table.internalProps.autoRowHeight,\n scene.table.heightMode === 'autoHeight',\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene.table\n );\n }\n }\n}\n\nfunction updateMergeCellContentHeight(\n cellGroup: Group,\n distHeight: number,\n detaY: number,\n autoRowHeight: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n distHeight += table.getRowHeight(row);\n }\n for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n updateCellContentHeight(singleCellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { height: contentHeight } = cellGroup.attribute;\n singleCellGroup.contentHeight = distHeight;\n\n resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n }\n }\n } else {\n updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/layout/update-height.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B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ressBarStyle';\nimport type { Group } from '../graphic/group';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentHeight } from '../utils/text-icon-layout';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { resizeCellGroup } from '../group-creater/column-helper';\nimport type { IGraphic } from '@visactor/vrender';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number) {\n // 更新table行高存储\n scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.start.col !== col) {\n continue;\n }\n const height = cell.attribute.height;\n // cell.setAttribute('height', height);\n // (cell.firstChild as Rect).setAttribute('height', cell.attribute.height);\n updateCellHeightForRow(scene, cell, col, row, height + detaY, detaY, scene.table.isHeader(col, row));\n\n scene.updateCellContentWhileResize(col, row);\n }\n\n let rowStart = 0;\n let rowEnd = 0;\n // 更新header 高度\n if (row < scene.table.columnHeaderLevelCount) {\n // scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n // scene.rowHeaderGroup.setAttribute('y', scene.rowHeaderGroup.attribute.y + detaY);\n // scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.columnHeaderLevelCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = scene.bodyRowEnd; //- scene.table.bottomFrozenRowCount;\n }\n\n // 更新以下行位置\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n const cellGroup = scene.getCell(colIndex, rowIndex);\n if (cellGroup.role === 'cell') {\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n }\n}\n\n/**\n * @description: 更新单个单元格高度\n * @return {*}\n */\nexport function updateCellHeightForRow(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n // autoRowHeight: boolean\n) {\n cell.setAttribute('height', height);\n const cellGroup = cell;\n const distHeight = height;\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n updateCellHeight(scene, cellGroup, col, row, distHeight, detaY, isHeader);\n}\n\nexport function updateCellHeightForColumn(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n) {\n cell.setAttribute('height', height);\n const cellGroup = cell;\n updateCellHeight(scene, cellGroup, col, row, height, 0, isHeader);\n}\n\nexport function updateCellHeight(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n distHeight: number,\n detaY: number,\n isHeader: boolean\n) {\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cell.attribute.width,\n // cell.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cell.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cell.insertBefore(newBarCell, oldBarCell);\n cell.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cell.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cell,\n cell.parent,\n cell.attribute.x,\n cell.attribute.y,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, scene.table);\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n let renderDefault = true;\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellLocation = scene.table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n false,\n scene.table.heightMode === 'autoHeight',\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n\n if (cell.childrenCount > 0) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customElementsGroup);\n }\n }\n\n if (renderDefault) {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateMergeCellContentHeight(\n cell,\n distHeight,\n detaY,\n // scene.table.internalProps.autoRowHeight,\n scene.table.heightMode === 'autoHeight',\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene.table\n );\n }\n }\n}\n\nfunction updateMergeCellContentHeight(\n cellGroup: Group,\n distHeight: number,\n detaY: number,\n autoRowHeight: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n distHeight += table.getRowHeight(row);\n }\n for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n updateCellContentHeight(singleCellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { height: contentHeight } = cellGroup.attribute;\n singleCellGroup.contentHeight = distHeight;\n\n resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n }\n }\n } else {\n updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);\n }\n}\n"]}
@@ -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
- if (removeRows.forEach((row => {
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 || needUpdateAfter, scene.table.rowHeightsMap.adjustOrder(row, row + 1, scene.table.rowHeightsMap.count() - row);
21
- })), resetRowNumberAndY(scene), updateCells.forEach((cell => {
22
- if (!cell) return;
23
- const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
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(cell.col, cell.row, scene.table, !1);
25
- })), isNumber(updateAfter)) {
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).needUpdate = !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
- var _a, _b;
71
- for (let col = 0; col < scene.table.colCount; col++) {
72
- const headerColGroup = scene.getColGroup(col, !0), colGroup = scene.getColGroup(col, !1);
73
- if (!headerColGroup || !colGroup) continue;
74
- let rowIndex = null === (_a = headerColGroup.firstChild) || void 0 === _a ? void 0 : _a.row;
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
- var _a, _b;
92
- scene.table;
93
- let newTotalHeight = 0;
94
- for (let col = 0; col < scene.table.colCount; col++) {
95
- const headerColGroup = scene.getColGroup(col, !0), colGroup = scene.getColGroup(col, !1), bottomGroup = scene.getColGroupInBottom(col) || scene.getColGroupInLeftBottomCorner(col) || scene.getColGroupInRightTopCorner(col);
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
- return newTotalHeight;
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) {