@visactor/vtable 0.16.4-alpha.2 → 0.17.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.
Files changed (217) hide show
  1. package/cjs/ListTable.d.ts +1 -0
  2. package/cjs/ListTable.js +13 -2
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +1 -0
  5. package/cjs/PivotChart.js +20 -2
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/PivotTable.d.ts +1 -0
  8. package/cjs/PivotTable.js +20 -2
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/core/BaseTable.d.ts +1 -0
  11. package/cjs/core/BaseTable.js +39 -41
  12. package/cjs/core/BaseTable.js.map +1 -1
  13. package/cjs/core/tableHelper.d.ts +1 -1
  14. package/cjs/core/tableHelper.js +6 -5
  15. package/cjs/core/tableHelper.js.map +1 -1
  16. package/cjs/dataset/dataset.js +3 -8
  17. package/cjs/dataset/dataset.js.map +1 -1
  18. package/cjs/edit/edit-manager.js +0 -3
  19. package/cjs/edit/edit-manager.js.map +1 -1
  20. package/cjs/event/EventHandler.d.ts +1 -0
  21. package/cjs/event/EventHandler.js +1 -1
  22. package/cjs/event/EventHandler.js.map +1 -1
  23. package/cjs/event/event.d.ts +10 -0
  24. package/cjs/event/event.js +2 -1
  25. package/cjs/event/event.js.map +1 -1
  26. package/cjs/event/listener/container-dom.js +30 -4
  27. package/cjs/event/listener/container-dom.js.map +1 -1
  28. package/cjs/event/listener/scroll-bar.js +19 -5
  29. package/cjs/event/listener/scroll-bar.js.map +1 -1
  30. package/cjs/event/listener/table-group.js +45 -34
  31. package/cjs/event/listener/table-group.js.map +1 -1
  32. package/cjs/index.d.ts +1 -1
  33. package/cjs/index.js +1 -1
  34. package/cjs/index.js.map +1 -1
  35. package/cjs/layout/pivot-header-layout.d.ts +1 -0
  36. package/cjs/layout/pivot-header-layout.js +35 -18
  37. package/cjs/layout/pivot-header-layout.js.map +1 -1
  38. package/cjs/layout/pivot-layout-helper.d.ts +1 -1
  39. package/cjs/layout/pivot-layout-helper.js +12 -5
  40. package/cjs/layout/pivot-layout-helper.js.map +1 -1
  41. package/cjs/layout/simple-header-layout.js +9 -9
  42. package/cjs/layout/simple-header-layout.js.map +1 -1
  43. package/cjs/scenegraph/component/cell-content.d.ts +2 -3
  44. package/cjs/scenegraph/component/cell-content.js +3 -3
  45. package/cjs/scenegraph/component/cell-content.js.map +1 -1
  46. package/cjs/scenegraph/component/custom.js +10 -10
  47. package/cjs/scenegraph/component/custom.js.map +1 -1
  48. package/cjs/scenegraph/component/table-component.js.map +1 -1
  49. package/cjs/scenegraph/graphic/text.d.ts +1 -1
  50. package/cjs/scenegraph/graphic/text.js +1 -1
  51. package/cjs/scenegraph/graphic/text.js.map +1 -1
  52. package/cjs/scenegraph/group-creater/cell-helper.js +2 -1
  53. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  54. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +3 -2
  55. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  56. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +1 -1
  57. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  58. package/cjs/scenegraph/icon/icon-update.d.ts +2 -0
  59. package/cjs/scenegraph/icon/icon-update.js +16 -2
  60. package/cjs/scenegraph/icon/icon-update.js.map +1 -1
  61. package/cjs/scenegraph/layout/compute-col-width.d.ts +1 -0
  62. package/cjs/scenegraph/layout/compute-col-width.js +12 -8
  63. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  64. package/cjs/scenegraph/layout/compute-row-height.js +16 -8
  65. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  66. package/cjs/scenegraph/layout/update-col.js +6 -5
  67. package/cjs/scenegraph/layout/update-col.js.map +1 -1
  68. package/cjs/scenegraph/layout/update-row.js +7 -6
  69. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  70. package/cjs/scenegraph/scenegraph.d.ts +2 -0
  71. package/cjs/scenegraph/scenegraph.js +43 -59
  72. package/cjs/scenegraph/scenegraph.js.map +1 -1
  73. package/cjs/scenegraph/select/update-select-border.js +12 -6
  74. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  75. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  76. package/cjs/scenegraph/utils/text-icon-layout.js +13 -10
  77. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  78. package/cjs/scenegraph/utils/text-pos.js.map +1 -1
  79. package/cjs/state/hover/is-cell-hover.d.ts +1 -1
  80. package/cjs/state/hover/is-cell-hover.js +5 -4
  81. package/cjs/state/hover/is-cell-hover.js.map +1 -1
  82. package/cjs/state/select/update-position.js +65 -65
  83. package/cjs/state/select/update-position.js.map +1 -1
  84. package/cjs/state/spark-line/index.js +9 -5
  85. package/cjs/state/spark-line/index.js.map +1 -1
  86. package/cjs/state/state.js +2 -4
  87. package/cjs/state/state.js.map +1 -1
  88. package/cjs/themes/DARK.js +1 -1
  89. package/cjs/themes/DARK.js.map +1 -1
  90. package/cjs/themes/component.d.ts +27 -0
  91. package/cjs/themes/component.js +29 -2
  92. package/cjs/themes/component.js.map +1 -1
  93. package/cjs/themes/theme.d.ts +2 -0
  94. package/cjs/themes/theme.js +9 -1
  95. package/cjs/themes/theme.js.map +1 -1
  96. package/cjs/tools/NumberMap.d.ts +4 -0
  97. package/cjs/tools/NumberMap.js +16 -0
  98. package/cjs/tools/NumberMap.js.map +1 -1
  99. package/cjs/ts-types/base-table.d.ts +3 -0
  100. package/cjs/ts-types/base-table.js.map +1 -1
  101. package/cjs/ts-types/customElement.d.ts +1 -1
  102. package/cjs/ts-types/customElement.js.map +1 -1
  103. package/cjs/ts-types/table-engine.d.ts +3 -0
  104. package/cjs/ts-types/table-engine.js.map +1 -1
  105. package/cjs/ts-types/theme.d.ts +2 -0
  106. package/cjs/ts-types/theme.js.map +1 -1
  107. package/dist/vtable.js +21833 -23055
  108. package/dist/vtable.min.js +2 -2
  109. package/es/ListTable.d.ts +1 -0
  110. package/es/ListTable.js +12 -2
  111. package/es/ListTable.js.map +1 -1
  112. package/es/PivotChart.d.ts +1 -0
  113. package/es/PivotChart.js +20 -2
  114. package/es/PivotChart.js.map +1 -1
  115. package/es/PivotTable.d.ts +1 -0
  116. package/es/PivotTable.js +20 -2
  117. package/es/PivotTable.js.map +1 -1
  118. package/es/core/BaseTable.d.ts +1 -0
  119. package/es/core/BaseTable.js +41 -44
  120. package/es/core/BaseTable.js.map +1 -1
  121. package/es/core/tableHelper.d.ts +1 -1
  122. package/es/core/tableHelper.js +6 -5
  123. package/es/core/tableHelper.js.map +1 -1
  124. package/es/dataset/dataset.js +3 -8
  125. package/es/dataset/dataset.js.map +1 -1
  126. package/es/edit/edit-manager.js +0 -3
  127. package/es/edit/edit-manager.js.map +1 -1
  128. package/es/event/EventHandler.d.ts +1 -0
  129. package/es/event/EventHandler.js +1 -1
  130. package/es/event/EventHandler.js.map +1 -1
  131. package/es/event/event.d.ts +10 -0
  132. package/es/event/event.js +2 -1
  133. package/es/event/event.js.map +1 -1
  134. package/es/event/listener/container-dom.js +30 -4
  135. package/es/event/listener/container-dom.js.map +1 -1
  136. package/es/event/listener/scroll-bar.js +20 -4
  137. package/es/event/listener/scroll-bar.js.map +1 -1
  138. package/es/event/listener/table-group.js +45 -34
  139. package/es/event/listener/table-group.js.map +1 -1
  140. package/es/index.d.ts +1 -1
  141. package/es/index.js +1 -1
  142. package/es/index.js.map +1 -1
  143. package/es/layout/pivot-header-layout.d.ts +1 -0
  144. package/es/layout/pivot-header-layout.js +35 -18
  145. package/es/layout/pivot-header-layout.js.map +1 -1
  146. package/es/layout/pivot-layout-helper.d.ts +1 -1
  147. package/es/layout/pivot-layout-helper.js +12 -5
  148. package/es/layout/pivot-layout-helper.js.map +1 -1
  149. package/es/layout/simple-header-layout.js +9 -9
  150. package/es/layout/simple-header-layout.js.map +1 -1
  151. package/es/scenegraph/component/cell-content.d.ts +2 -3
  152. package/es/scenegraph/component/cell-content.js +3 -5
  153. package/es/scenegraph/component/cell-content.js.map +1 -1
  154. package/es/scenegraph/component/custom.js +10 -12
  155. package/es/scenegraph/component/custom.js.map +1 -1
  156. package/es/scenegraph/component/table-component.js.map +1 -1
  157. package/es/scenegraph/graphic/text.d.ts +1 -1
  158. package/es/scenegraph/graphic/text.js +1 -1
  159. package/es/scenegraph/graphic/text.js.map +1 -1
  160. package/es/scenegraph/group-creater/cell-helper.js +2 -1
  161. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  162. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +3 -2
  163. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  164. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +2 -2
  165. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  166. package/es/scenegraph/icon/icon-update.d.ts +2 -0
  167. package/es/scenegraph/icon/icon-update.js +13 -0
  168. package/es/scenegraph/icon/icon-update.js.map +1 -1
  169. package/es/scenegraph/layout/compute-col-width.d.ts +1 -0
  170. package/es/scenegraph/layout/compute-col-width.js +9 -6
  171. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  172. package/es/scenegraph/layout/compute-row-height.js +17 -11
  173. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  174. package/es/scenegraph/layout/update-col.js +6 -5
  175. package/es/scenegraph/layout/update-col.js.map +1 -1
  176. package/es/scenegraph/layout/update-row.js +7 -6
  177. package/es/scenegraph/layout/update-row.js.map +1 -1
  178. package/es/scenegraph/scenegraph.d.ts +2 -0
  179. package/es/scenegraph/scenegraph.js +45 -61
  180. package/es/scenegraph/scenegraph.js.map +1 -1
  181. package/es/scenegraph/select/update-select-border.js +12 -6
  182. package/es/scenegraph/select/update-select-border.js.map +1 -1
  183. package/es/scenegraph/stick-text/index.js.map +1 -1
  184. package/es/scenegraph/utils/text-icon-layout.js +13 -12
  185. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  186. package/es/scenegraph/utils/text-pos.js.map +1 -1
  187. package/es/state/hover/is-cell-hover.d.ts +1 -1
  188. package/es/state/hover/is-cell-hover.js +5 -4
  189. package/es/state/hover/is-cell-hover.js.map +1 -1
  190. package/es/state/select/update-position.js +65 -65
  191. package/es/state/select/update-position.js.map +1 -1
  192. package/es/state/spark-line/index.js +9 -5
  193. package/es/state/spark-line/index.js.map +1 -1
  194. package/es/state/state.js +2 -4
  195. package/es/state/state.js.map +1 -1
  196. package/es/themes/DARK.js +1 -1
  197. package/es/themes/DARK.js.map +1 -1
  198. package/es/themes/component.d.ts +27 -0
  199. package/es/themes/component.js +28 -0
  200. package/es/themes/component.js.map +1 -1
  201. package/es/themes/theme.d.ts +2 -0
  202. package/es/themes/theme.js +9 -2
  203. package/es/themes/theme.js.map +1 -1
  204. package/es/tools/NumberMap.d.ts +4 -0
  205. package/es/tools/NumberMap.js +16 -0
  206. package/es/tools/NumberMap.js.map +1 -1
  207. package/es/ts-types/base-table.d.ts +3 -0
  208. package/es/ts-types/base-table.js.map +1 -1
  209. package/es/ts-types/customElement.d.ts +1 -1
  210. package/es/ts-types/customElement.js.map +1 -1
  211. package/es/ts-types/table-engine.d.ts +3 -0
  212. package/es/ts-types/table-engine.js.map +1 -1
  213. package/es/ts-types/theme.d.ts +2 -0
  214. package/es/ts-types/theme.js.map +1 -1
  215. package/package.json +7 -7
  216. package/cjs/scenegraph/component/menu.d.ts +0 -41
  217. package/es/scenegraph/component/menu.d.ts +0 -41
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/layout/update-col.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,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xB,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"]}
1
+ {"version":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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 const colWidthsMap = table.colWidthsMap;\n removeCols.forEach(col => {\n colWidthsMap.delAndReorder(col);\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 colWidthsMap.addAndReorder(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"]}
@@ -8,16 +8,17 @@ import { getCellMergeInfo } from "../utils/get-cell-merge";
8
8
 
9
9
  export function updateRow(removeCells, addCells, updateCells, table) {
10
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
- let updateAfter;
12
11
  removeRows.forEach((row => {
13
12
  removeRow(row, scene);
14
- })), removeRows.forEach((row => {
15
- scene.table.rowHeightsMap.adjustOrder(row + 1, row, scene.table.rowHeightsMap.count() - row - 1),
16
- scene.table.rowHeightsMap.del(scene.table.rowHeightsMap.count() - 1);
13
+ }));
14
+ const rowHeightsMap = table.rowHeightsMap;
15
+ let updateAfter;
16
+ removeRows.forEach((row => {
17
+ rowHeightsMap.delAndReorder(row);
17
18
  })), removeRows.length && resetRowNumber(scene), scene.table._clearRowRangeHeightsMap(),
18
19
  addRows.forEach((row => {
19
20
  const needUpdateAfter = addRow(row, scene);
20
- updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, scene.table.rowHeightsMap.adjustOrder(row, row + 1, scene.table.rowHeightsMap.count() - row);
21
+ updateAfter = null != updateAfter ? updateAfter : needUpdateAfter, rowHeightsMap.addAndReorder(row);
21
22
  })), resetRowNumberAndY(scene);
22
23
  for (let col = 0; col < table.colCount; col++) updateRows.forEach((r => {
23
24
  const mergeInfo = getCellMergeInfo(scene.table, col, r);
@@ -33,7 +34,7 @@ export function updateRow(removeCells, addCells, updateCells, table) {
33
34
  if (addRows.length) {
34
35
  if (!isNumber(updateAfter)) {
35
36
  const minRow = Math.min(...addRows);
36
- scene.proxy.rowUpdatePos = minRow;
37
+ scene.proxy.rowUpdatePos = Math.min(minRow, scene.proxy.rowUpdatePos);
37
38
  }
38
39
  scene.proxy.rowUpdateDirection = "up", scene.proxy.updateCellGroups(2 * scene.proxy.screenRowCount),
39
40
  updateBottomFrozeCellGroups(), scene.proxy.progress();
@@ -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;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,CAAC,SAAmB,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;iBAQnG;aACF;SACF;KAQF;AACH,CAAC;AAED,SAAS,eAAe,CAAC,GAAW,EAAE,KAAiB;IACrD,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QAEnD,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,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';\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"]}
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,IA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\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 const rowHeightsMap = table.rowHeightsMap;\n removeRows.forEach(row => {\n rowHeightsMap.delAndReorder(row);\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 rowHeightsMap.addAndReorder(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 = Math.min(minRow, scene.proxy.rowUpdatePos);\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"]}
@@ -81,6 +81,8 @@ export declare class Scenegraph {
81
81
  updateFrozenIcon(col: number, oldFrozenCol: number): void;
82
82
  updateHierarchyIcon(col: number, row: number): void;
83
83
  setIconNormalStyle(icon: Icon, col: number, row: number): void;
84
+ residentHoverIcon(col: number, row: number): void;
85
+ resetResidentHoverIcon(col: number, row: number): void;
84
86
  deactivateChart(col: number, row: number): void;
85
87
  activateChart(col: number, row: number): void;
86
88
  removeInteractionBorder(col: number, row: number): void;
@@ -24,7 +24,7 @@ import { getProp } from "./utils/get-prop";
24
24
 
25
25
  import { SceneProxy } from "./group-creater/progress/proxy";
26
26
 
27
- import { computeColWidth, computeColsWidth } from "./layout/compute-col-width";
27
+ import { computeColWidth, computeColsWidth, getAdaptiveWidth } from "./layout/compute-col-width";
28
28
 
29
29
  import { moveHeaderPosition } from "./layout/move-cell";
30
30
 
@@ -58,7 +58,7 @@ import { loadPoptip, setPoptipTheme } from "@visactor/vrender-components";
58
58
 
59
59
  import textMeasureModule from "./utils/text-measure";
60
60
 
61
- import { getIconByXY, hideClickIcon, hideHoverIcon, setIconHoverStyle, setIconNormalStyle, showClickIcon, showHoverIcon, updateFrozenIcon, updateHierarchyIcon, updateSortIcon } from "./icon/icon-update";
61
+ import { getIconByXY, hideClickIcon, hideHoverIcon, resetResidentHoverIcon, residentHoverIcon, setIconHoverStyle, setIconNormalStyle, showClickIcon, showHoverIcon, updateFrozenIcon, updateHierarchyIcon, updateSortIcon } from "./icon/icon-update";
62
62
 
63
63
  import { Env } from "../tools/env";
64
64
 
@@ -68,39 +68,11 @@ import { updateCol } from "./layout/update-col";
68
68
 
69
69
  loadPoptip(), container.load(splitModule), container.load(textMeasureModule);
70
70
 
71
- const poptipStyle = {
72
- visible: !0,
73
- position: "auto",
74
- padding: 8,
75
- titleStyle: {
76
- fontSize: 12,
77
- fontWeight: "bold",
78
- fill: "#4E5969"
79
- },
80
- contentStyle: {
81
- fontSize: 12,
82
- fill: "#4E5969"
83
- },
84
- panel: {
85
- visible: !0,
86
- fill: "#fff",
87
- stroke: "#ffffff",
88
- lineWidth: 0,
89
- cornerRadius: 3,
90
- shadowBlur: 12,
91
- shadowOffsetX: 0,
92
- shadowOffsetY: 4,
93
- shadowColor: "rgba(0, 0, 0, 0.1)",
94
- size: 0,
95
- space: 12
96
- }
97
- };
98
-
99
71
  export class Scenegraph {
100
72
  constructor(table) {
101
73
  let width, height;
102
74
  this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map,
103
- setPoptipTheme(poptipStyle), "node" === Env.mode ? (vglobal.setEnv("node", table.options.modeParams),
75
+ setPoptipTheme(this.table.theme.textPopTipStyle), "node" === Env.mode ? (vglobal.setEnv("node", table.options.modeParams),
104
76
  width = table.canvasWidth, height = table.canvasHeight) : (vglobal.setEnv("browser"),
105
77
  width = table.canvas.width, height = table.canvas.height), this.stage = createStage({
106
78
  canvas: table.canvas,
@@ -110,7 +82,6 @@ export class Scenegraph {
110
82
  background: table.theme.underlayBackgroundColor,
111
83
  dpr: table.internalProps.pixelRatio,
112
84
  enableLayout: !0,
113
- pluginList: table.isPivotChart() ? [ "poptipForText" ] : void 0,
114
85
  afterRender: () => {
115
86
  this.table.fireListeners("after_render", null);
116
87
  }
@@ -164,7 +135,9 @@ export class Scenegraph {
164
135
  }
165
136
  clearCells() {
166
137
  var _a;
167
- this.clear = !0, this.hasFrozen = !1, this.mergeMap.clear(), this.colHeaderGroup.clear(),
138
+ (this.table.isPivotChart() || this.table.hasCustomRenderOrLayout()) && this.stage.pluginService.findPluginsByName("poptipForText").forEach((plugin => {
139
+ plugin.deactivate(this.stage.pluginService);
140
+ })), this.clear = !0, this.hasFrozen = !1, this.mergeMap.clear(), this.colHeaderGroup.clear(),
168
141
  this.rowHeaderGroup.clear(), this.cornerHeaderGroup.clear(), this.bodyGroup.clear(),
169
142
  this.bottomFrozenGroup.clear(), this.rightFrozenGroup.clear(), this.rightTopCornerGroup.clear(),
170
143
  this.rightBottomCornerGroup.clear(), this.leftBottomCornerGroup.clear(), this.colHeaderGroup.setAttributes({
@@ -231,7 +204,9 @@ export class Scenegraph {
231
204
  this.selectedRangeComponents = new Map, this.selectingRangeComponents = new Map;
232
205
  }
233
206
  createSceneGraph() {
234
- this.clear = !1, this.frozenColCount = this.table.frozenColCount, this.frozenRowCount = this.table.columnHeaderLevelCount,
207
+ (this.table.isPivotChart() || this.table.hasCustomRenderOrLayout()) && this.stage.pluginService.autoEnablePlugins.getContributions().forEach((p => {
208
+ "poptipForText" === p.name && this.stage.pluginService.register(p);
209
+ })), this.clear = !1, this.frozenColCount = this.table.frozenColCount, this.frozenRowCount = this.table.columnHeaderLevelCount,
235
210
  this.proxy = new SceneProxy(this.table), createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, void 0, !0),
236
211
  this.table.isPivotChart() && (createCornerCell(this.rightTopCornerGroup, this.table.theme.cornerRightTopCellStyle || this.table.theme.cornerHeaderStyle || {}),
237
212
  createCornerCell(this.leftBottomCornerGroup, this.table.theme.cornerLeftBottomCellStyle || this.table.theme.cornerHeaderStyle || {}),
@@ -257,7 +232,7 @@ export class Scenegraph {
257
232
  }
258
233
  getColGroup(col, isCornerOrColHeader = !1) {
259
234
  let element;
260
- return element = col < this.frozenColCount && isCornerOrColHeader ? this.cornerHeaderGroup.getColGroup(col) : col < this.frozenColCount ? this.rowHeaderGroup.getColGroup(col) : isCornerOrColHeader ? this.colHeaderGroup.getColGroup(col) : !isCornerOrColHeader && this.table.rightFrozenColCount > 0 && col > this.table.colCount - 1 - this.table.rightFrozenColCount ? this.rightFrozenGroup.getColGroup(col) : this.bodyGroup.getColGroup(col),
235
+ return element = col < this.frozenColCount && isCornerOrColHeader ? this.cornerHeaderGroup.getColGroup(col) : col < this.frozenColCount ? this.rowHeaderGroup.getColGroup(col) : isCornerOrColHeader && this.table.rightFrozenColCount > 0 && col > this.table.colCount - 1 - this.table.rightFrozenColCount ? this.rightTopCornerGroup.getColGroup(col) : !isCornerOrColHeader && this.table.rightFrozenColCount > 0 && col > this.table.colCount - 1 - this.table.rightFrozenColCount ? this.rightFrozenGroup.getColGroup(col) : isCornerOrColHeader ? this.colHeaderGroup.getColGroup(col) : this.bodyGroup.getColGroup(col),
261
236
  element || void 0;
262
237
  }
263
238
  getColGroupInBottom(col) {
@@ -318,6 +293,12 @@ export class Scenegraph {
318
293
  setIconNormalStyle(icon, col, row) {
319
294
  setIconNormalStyle(icon, col, row, this);
320
295
  }
296
+ residentHoverIcon(col, row) {
297
+ residentHoverIcon(col, row, this);
298
+ }
299
+ resetResidentHoverIcon(col, row) {
300
+ resetResidentHoverIcon(col, row, this);
301
+ }
321
302
  deactivateChart(col, row) {
322
303
  var _a, _b;
323
304
  if (-1 === col || -1 === row) return;
@@ -469,10 +450,10 @@ export class Scenegraph {
469
450
  }
470
451
  updateContainerHeight(row, detaY) {
471
452
  row < this.table.frozenRowCount ? (this.colHeaderGroup.setDeltaHeight(detaY), this.cornerHeaderGroup.setDeltaHeight(detaY),
472
- this.rowHeaderGroup.setDeltaY(detaY), this.bodyGroup.setDeltaY(detaY)) : row >= this.table.rowCount - this.table.bottomFrozenRowCount ? (this.leftBottomCornerGroup.setDeltaHeight(detaY),
453
+ this.rowHeaderGroup.setDeltaY(detaY), this.bodyGroup.setDeltaY(detaY), this.rightFrozenGroup.setDeltaY(detaY)) : row >= this.table.rowCount - this.table.bottomFrozenRowCount ? (this.leftBottomCornerGroup.setDeltaHeight(detaY),
473
454
  this.bottomFrozenGroup.setDeltaHeight(detaY), this.rightBottomCornerGroup.setDeltaHeight(detaY)) : (this.rowHeaderGroup.setDeltaHeight(detaY),
474
- this.bodyGroup.setDeltaHeight(detaY)), this.updateTableSize(), this.component.updateScrollBar(),
475
- this.updateNextFrame();
455
+ this.bodyGroup.setDeltaHeight(detaY), this.rightFrozenGroup.setDeltaHeight(detaY)),
456
+ this.updateTableSize(), this.component.updateScrollBar(), this.updateNextFrame();
476
457
  }
477
458
  setColWidth(col, width) {
478
459
  const oldWidth = this.table.getColWidth(col);
@@ -508,30 +489,27 @@ export class Scenegraph {
508
489
  dealWidthMode() {
509
490
  const table = this.table;
510
491
  if ("adaptive" === table.widthMode) {
511
- const totalDrawWidth = table.tableNoFrameWidth - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();
512
- let actualWidth = 0;
513
- for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) actualWidth += table.getColWidth(col);
514
- const factor = totalDrawWidth / actualWidth;
515
- for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
516
- let colWidth;
517
- colWidth = col === table.colCount - table.rightFrozenColCount - 1 ? totalDrawWidth - table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2) : Math.round(table.getColWidth(col) * factor),
518
- this.setColWidth(col, colWidth);
492
+ table._clearColRangeWidthsMap();
493
+ const canvasWidth = table.tableNoFrameWidth;
494
+ let actualHeaderWidth = 0;
495
+ for (let col = 0; col < table.colCount; col++) {
496
+ const colWidth = table.getColWidth(col);
497
+ (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth);
519
498
  }
499
+ const startCol = table.frozenColCount, endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
500
+ getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, !1, [], table, !0);
520
501
  } else if (table.autoFillWidth) {
502
+ table._clearColRangeWidthsMap();
521
503
  const canvasWidth = table.tableNoFrameWidth;
522
- let actualWidth = 0, actualHeaderWidth = 0;
504
+ let actualHeaderWidth = 0, actualWidth = 0;
523
505
  for (let col = 0; col < table.colCount; col++) {
524
506
  const colWidth = table.getColWidth(col);
525
- (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth),
507
+ (col < table.frozenColCount || table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount) && (actualHeaderWidth += colWidth),
526
508
  actualWidth += colWidth;
527
509
  }
528
- if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {
529
- const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);
530
- for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
531
- let colWidth;
532
- colWidth = col === table.colCount - table.rightFrozenColCount - 1 ? canvasWidth - actualHeaderWidth - table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2) : Math.round(table.getColWidth(col) * factor),
533
- this.setColWidth(col, colWidth);
534
- }
510
+ if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
511
+ const startCol = table.frozenColCount, endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
512
+ getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, !1, [], table, !0);
535
513
  }
536
514
  }
537
515
  let bodyWidth = 0;
@@ -560,21 +538,22 @@ export class Scenegraph {
560
538
  const table = this.table;
561
539
  if ("adaptive" === table.heightMode) {
562
540
  table._clearRowRangeHeightsMap();
563
- const totalDrawHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
541
+ const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1), bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0, totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight, startRow = table.columnHeaderLevelCount, endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;
564
542
  let actualHeight = 0;
565
- for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) actualHeight += table.getRowHeight(row);
543
+ for (let row = startRow; row < endRow; row++) actualHeight += table.getRowHeight(row);
566
544
  const factor = totalDrawHeight / actualHeight;
567
- for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {
545
+ for (let row = startRow; row < endRow; row++) {
568
546
  let rowHeight;
569
- rowHeight = row === table.rowCount - table.bottomFrozenRowCount - 1 ? totalDrawHeight - table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2) : Math.round(table.getRowHeight(row) * factor),
547
+ rowHeight = row === endRow - 1 ? totalDrawHeight - table.getRowsHeight(startRow, endRow - 2) : Math.round(table.getRowHeight(row) * factor),
570
548
  this.setRowHeight(row, rowHeight);
571
549
  }
572
550
  } else if (table.autoFillHeight) {
551
+ table._clearRowRangeHeightsMap();
573
552
  const canvasHeight = table.tableNoFrameHeight;
574
553
  let actualHeight = 0, actualHeaderHeight = 0;
575
554
  for (let row = 0; row < table.rowCount; row++) {
576
555
  const rowHeight = table.getRowHeight(row);
577
- (row < table.frozenRowCount || row >= table.rowCount - table.bottomFrozenRowCount) && (actualHeaderHeight += rowHeight),
556
+ (row < table.frozenRowCount || table.isPivotChart() && row >= table.rowCount - table.bottomFrozenRowCount) && (actualHeaderHeight += rowHeight),
578
557
  actualHeight += rowHeight;
579
558
  }
580
559
  if ((null !== (_a = this._dealAutoFillHeightOriginRowsHeight) && void 0 !== _a ? _a : actualHeight) < canvasHeight && actualHeight - actualHeaderHeight > 0) {
@@ -695,12 +674,17 @@ export class Scenegraph {
695
674
  getCellOverflowText(col, row) {
696
675
  var _a, _b;
697
676
  const text = this.getCell(col, row).getChildByName("text", !0);
698
- if (text) {
677
+ if (text && "text" === text.type) {
699
678
  const textAttributeStr = isArray(text.attribute.text) ? text.attribute.text.join("") : text.attribute.text;
700
679
  let cacheStr = "";
701
680
  if (isString(text.cache.clipedText) ? cacheStr = text.cache.clipedText : null === (_b = null === (_a = text.cache.layoutData) || void 0 === _a ? void 0 : _a.lines) || void 0 === _b || _b.forEach((line => {
702
681
  cacheStr += line.str;
703
682
  })), cacheStr !== textAttributeStr) return textAttributeStr;
683
+ } else if (text && "richtext" === text.type) {
684
+ const richtext = text;
685
+ if (richtext.attribute.ellipsis && richtext._frameCache && richtext.attribute.height < richtext._frameCache.actualHeight) {
686
+ return richtext.attribute.textConfig.find((item => item.text)).text;
687
+ }
704
688
  }
705
689
  return null;
706
690
  }