@visactor/vtable 0.9.2 → 0.9.3-alpha.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 (647) hide show
  1. package/cjs/ListTable.d.ts +2 -1
  2. package/cjs/ListTable.js +17 -13
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +69 -0
  5. package/cjs/PivotChart.js +435 -0
  6. package/cjs/PivotChart.js.map +1 -0
  7. package/cjs/PivotTable.d.ts +2 -1
  8. package/cjs/PivotTable.js +18 -13
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/body-helper/style/MultilineTextStyle.js +2 -2
  11. package/cjs/body-helper/style/MultilineTextStyle.js.map +1 -1
  12. package/cjs/body-helper/style/ProgressBarStyle.js +15 -15
  13. package/cjs/body-helper/style/ProgressBarStyle.js.map +1 -1
  14. package/cjs/body-helper/style/Style.d.ts +0 -1
  15. package/cjs/body-helper/style/Style.js +25 -28
  16. package/cjs/body-helper/style/Style.js.map +1 -1
  17. package/cjs/chartModule.js +14 -0
  18. package/cjs/chartModule.js.map +1 -0
  19. package/cjs/components/axis/axis.d.ts +45 -0
  20. package/cjs/components/axis/axis.js +146 -0
  21. package/cjs/components/axis/axis.js.map +1 -0
  22. package/cjs/components/axis/band-scale.d.ts +18 -0
  23. package/cjs/components/axis/band-scale.js +54 -0
  24. package/cjs/components/axis/band-scale.js.map +1 -0
  25. package/cjs/components/axis/get-axis-attributes.d.ts +136 -0
  26. package/cjs/components/axis/get-axis-attributes.js +169 -0
  27. package/cjs/components/axis/get-axis-attributes.js.map +1 -0
  28. package/cjs/components/axis/label-overlap.d.ts +3 -0
  29. package/cjs/components/axis/label-overlap.js +46 -0
  30. package/cjs/components/axis/label-overlap.js.map +1 -0
  31. package/cjs/components/axis/linear-scale.d.ts +45 -0
  32. package/cjs/components/axis/linear-scale.js +120 -0
  33. package/cjs/components/axis/linear-scale.js.map +1 -0
  34. package/cjs/components/legend/get-legend-attributes.d.ts +5 -0
  35. package/cjs/components/legend/get-legend-attributes.js +90 -0
  36. package/cjs/components/legend/get-legend-attributes.js.map +1 -0
  37. package/cjs/components/legend/legend.d.ts +23 -0
  38. package/cjs/components/legend/legend.js +94 -0
  39. package/cjs/components/legend/legend.js.map +1 -0
  40. package/{es → cjs/components}/menu/dom/BaseMenu.d.ts +2 -2
  41. package/cjs/components/menu/dom/BaseMenu.js.map +1 -0
  42. package/cjs/components/menu/dom/Menu.js.map +1 -0
  43. package/cjs/{menu → components/menu}/dom/MenuHandler.d.ts +2 -2
  44. package/cjs/{menu → components/menu}/dom/MenuHandler.js +1 -1
  45. package/cjs/components/menu/dom/MenuHandler.js.map +1 -0
  46. package/cjs/{menu → components/menu}/dom/logic/MenuContainer.d.ts +2 -2
  47. package/cjs/{menu → components/menu}/dom/logic/MenuContainer.js +2 -2
  48. package/cjs/components/menu/dom/logic/MenuContainer.js.map +1 -0
  49. package/cjs/{menu → components/menu}/dom/logic/MenuElement.d.ts +2 -2
  50. package/cjs/{menu → components/menu}/dom/logic/MenuElement.js +4 -4
  51. package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -0
  52. package/cjs/components/menu/dom/logic/MenuElementStyle.js.map +1 -0
  53. package/cjs/components/title/title.d.ts +12 -0
  54. package/cjs/components/title/title.js +66 -0
  55. package/cjs/components/title/title.js.map +1 -0
  56. package/{es → cjs/components}/tooltip/BaseTooltip.d.ts +3 -3
  57. package/cjs/components/tooltip/BaseTooltip.js.map +1 -0
  58. package/cjs/components/tooltip/Tooltip.js.map +1 -0
  59. package/cjs/{tooltip → components/tooltip}/TooltipHandler.d.ts +4 -4
  60. package/cjs/{tooltip → components/tooltip}/TooltipHandler.js +1 -1
  61. package/cjs/components/tooltip/TooltipHandler.js.map +1 -0
  62. package/{es → cjs/components}/tooltip/logic/BubbleTooltipElement.d.ts +4 -4
  63. package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElement.js +1 -1
  64. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  65. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -0
  66. package/cjs/components/util/orient.d.ts +3 -0
  67. package/cjs/components/util/orient.js +14 -0
  68. package/cjs/components/util/orient.js.map +1 -0
  69. package/cjs/components/util/register.d.ts +3 -0
  70. package/cjs/components/util/register.js +15 -0
  71. package/cjs/components/util/register.js.map +1 -0
  72. package/cjs/components/util/tick-data/config.d.ts +1 -0
  73. package/cjs/components/util/tick-data/config.js +6 -0
  74. package/cjs/components/util/tick-data/config.js.map +1 -0
  75. package/cjs/components/util/tick-data/continuous.d.ts +2 -0
  76. package/cjs/components/util/tick-data/continuous.js +39 -0
  77. package/cjs/components/util/tick-data/continuous.js.map +1 -0
  78. package/cjs/components/util/tick-data/discrete/linear.d.ts +2 -0
  79. package/cjs/components/util/tick-data/discrete/linear.js +66 -0
  80. package/cjs/components/util/tick-data/discrete/linear.js.map +1 -0
  81. package/cjs/components/util/tick-data/discrete/polar-angle.d.ts +2 -0
  82. package/cjs/components/util/tick-data/discrete/polar-angle.js +46 -0
  83. package/cjs/components/util/tick-data/discrete/polar-angle.js.map +1 -0
  84. package/cjs/components/util/tick-data/index.d.ts +2 -0
  85. package/cjs/components/util/tick-data/index.js +17 -0
  86. package/cjs/components/util/tick-data/index.js.map +1 -0
  87. package/cjs/components/util/tick-data/util.d.ts +21 -0
  88. package/cjs/components/util/tick-data/util.js +115 -0
  89. package/cjs/components/util/tick-data/util.js.map +1 -0
  90. package/cjs/components/util/transform.d.ts +5 -0
  91. package/cjs/components/util/transform.js +45 -0
  92. package/cjs/components/util/transform.js.map +1 -0
  93. package/cjs/core/BaseTable.d.ts +18 -5
  94. package/cjs/core/BaseTable.js +115 -41
  95. package/cjs/core/BaseTable.js.map +1 -1
  96. package/cjs/core/TABLE_EVENT_TYPE.d.ts +5 -0
  97. package/cjs/core/TABLE_EVENT_TYPE.js +6 -1
  98. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  99. package/cjs/core/style.js +1 -1
  100. package/cjs/core/style.js.map +1 -1
  101. package/cjs/core/tableHelper.js +1 -2
  102. package/cjs/data/CachedDataSource.js +2 -1
  103. package/cjs/data/DataSource.js +2 -2
  104. package/cjs/data/DataSource.js.map +1 -1
  105. package/cjs/dataset/dataset-pivot-table.d.ts +60 -0
  106. package/cjs/dataset/dataset-pivot-table.js +387 -0
  107. package/cjs/dataset/dataset-pivot-table.js.map +1 -0
  108. package/cjs/dataset/dataset.d.ts +14 -19
  109. package/cjs/dataset/dataset.js +183 -200
  110. package/cjs/dataset/dataset.js.map +1 -1
  111. package/cjs/dataset/statistics-helper.d.ts +68 -0
  112. package/cjs/dataset/statistics-helper.js +173 -0
  113. package/cjs/dataset/statistics-helper.js.map +1 -0
  114. package/cjs/dataset/util/zero-align.d.ts +10 -0
  115. package/cjs/dataset/util/zero-align.js +119 -0
  116. package/cjs/dataset/util/zero-align.js.map +1 -0
  117. package/cjs/event/EventHandler.js.map +1 -1
  118. package/cjs/event/EventTarget.d.ts +5 -5
  119. package/cjs/event/EventTarget.js +2 -2
  120. package/cjs/event/EventTarget.js.map +1 -1
  121. package/cjs/event/VChartEventProxy.d.ts +1 -0
  122. package/cjs/event/VChartEventProxy.js +1 -0
  123. package/cjs/event/VChartEventProxy.js.map +1 -0
  124. package/cjs/event/event.js +7 -4
  125. package/cjs/event/event.js.map +1 -1
  126. package/cjs/event/listener/table-group.js +8 -6
  127. package/cjs/event/listener/table-group.js.map +1 -1
  128. package/cjs/event/pivot-chart/axis-click.d.ts +2 -0
  129. package/cjs/event/pivot-chart/axis-click.js +42 -0
  130. package/cjs/event/pivot-chart/axis-click.js.map +1 -0
  131. package/cjs/event/pivot-chart/axis-hover.d.ts +2 -0
  132. package/cjs/event/pivot-chart/axis-hover.js +41 -0
  133. package/cjs/event/pivot-chart/axis-hover.js.map +1 -0
  134. package/cjs/event/scroll.js +4 -3
  135. package/cjs/event/scroll.js.map +1 -1
  136. package/cjs/event/sparkline-event.js +1 -2
  137. package/cjs/event/sparkline-event.js.map +1 -1
  138. package/cjs/header-helper/header-helper.js +1 -1
  139. package/cjs/header-helper/header-helper.js.map +1 -1
  140. package/cjs/header-helper/style/MultilineTextHeaderStyle.js +2 -2
  141. package/cjs/header-helper/style/MultilineTextHeaderStyle.js.map +1 -1
  142. package/cjs/header-helper/style/Style.d.ts +0 -1
  143. package/cjs/header-helper/style/Style.js +25 -28
  144. package/cjs/header-helper/style/Style.js.map +1 -1
  145. package/cjs/index.d.ts +4 -3
  146. package/cjs/index.js +11 -2
  147. package/cjs/index.js.map +1 -1
  148. package/cjs/layout/chart-helper/get-axis-config.d.ts +2 -0
  149. package/cjs/layout/chart-helper/get-axis-config.js +118 -0
  150. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -0
  151. package/cjs/layout/chart-helper/get-chart-spec.d.ts +7 -0
  152. package/cjs/layout/chart-helper/get-chart-spec.js +135 -0
  153. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -0
  154. package/cjs/layout/index.js +2 -1
  155. package/cjs/layout/pivot-header-layout.d.ts +13 -5
  156. package/cjs/layout/pivot-header-layout.js +50 -14
  157. package/cjs/layout/pivot-header-layout.js.map +1 -1
  158. package/cjs/layout/pivot-layout.d.ts +54 -8
  159. package/cjs/layout/pivot-layout.js +399 -91
  160. package/cjs/layout/pivot-layout.js.map +1 -1
  161. package/cjs/layout/simple-header-layout.d.ts +10 -0
  162. package/cjs/layout/simple-header-layout.js +43 -2
  163. package/cjs/layout/simple-header-layout.js.map +1 -1
  164. package/cjs/plugins/{chartTypes.js → chartModules.js} +1 -1
  165. package/cjs/plugins/chartModules.js.map +1 -0
  166. package/cjs/register.d.ts +1 -1
  167. package/cjs/register.js +6 -6
  168. package/cjs/register.js.map +1 -1
  169. package/cjs/render/layout/text.d.ts +33 -4
  170. package/cjs/render/layout/text.js +9 -3
  171. package/cjs/render/layout/text.js.map +1 -1
  172. package/cjs/scenegraph/component/custom.js +17 -16
  173. package/cjs/scenegraph/component/custom.js.map +1 -1
  174. package/cjs/scenegraph/component/menu.d.ts +41 -0
  175. package/cjs/scenegraph/component/table-component.js +3 -3
  176. package/cjs/scenegraph/component/table-component.js.map +1 -1
  177. package/cjs/scenegraph/graphic/chart.d.ts +4 -1
  178. package/cjs/scenegraph/graphic/chart.js +29 -17
  179. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  180. package/cjs/scenegraph/graphic/contributions/chart-render.js +22 -3
  181. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  182. package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +9 -9
  183. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +48 -29
  184. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  185. package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +3 -3
  186. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +2 -2
  187. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  188. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +3 -3
  189. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
  190. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  191. package/cjs/scenegraph/graphic/text.d.ts +15 -0
  192. package/cjs/scenegraph/group-creater/cell-helper.js +9 -3
  193. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  194. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  195. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +6 -5
  196. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  197. package/cjs/scenegraph/group-creater/column.js.map +1 -1
  198. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.d.ts +3 -0
  199. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +71 -0
  200. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -0
  201. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
  202. package/cjs/scenegraph/group-creater/progress/proxy.js +29 -35
  203. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  204. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +6 -6
  205. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  206. package/cjs/scenegraph/layout/compute-col-width.js +23 -15
  207. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  208. package/cjs/scenegraph/layout/compute-row-height.js +20 -9
  209. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  210. package/cjs/scenegraph/layout/move-cell.js +1 -1
  211. package/cjs/scenegraph/layout/move-cell.js.map +1 -1
  212. package/cjs/scenegraph/layout/update-cell.js +3 -2
  213. package/cjs/scenegraph/layout/update-cell.js.map +1 -1
  214. package/cjs/scenegraph/layout/update-height.js +1 -1
  215. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  216. package/cjs/scenegraph/layout/update-row.js +1 -1
  217. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  218. package/cjs/scenegraph/layout/update-width.js +33 -3
  219. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  220. package/cjs/scenegraph/refresh-node/update-chart.d.ts +3 -0
  221. package/cjs/scenegraph/refresh-node/update-chart.js +76 -7
  222. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  223. package/cjs/scenegraph/scenegraph.d.ts +8 -0
  224. package/cjs/scenegraph/scenegraph.js +115 -19
  225. package/cjs/scenegraph/scenegraph.js.map +1 -1
  226. package/cjs/scenegraph/stick-text/index.js +10 -8
  227. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  228. package/cjs/scenegraph/style/corner-cell.d.ts +3 -0
  229. package/cjs/scenegraph/style/corner-cell.js +29 -0
  230. package/cjs/scenegraph/style/corner-cell.js.map +1 -0
  231. package/cjs/scenegraph/style/frame-border.d.ts +1 -0
  232. package/cjs/scenegraph/style/frame-border.js +3 -7
  233. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  234. package/cjs/scenegraph/utils/get-cell-merge.js +2 -1
  235. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  236. package/cjs/state/state.js +1 -1
  237. package/cjs/state/state.js.map +1 -1
  238. package/cjs/themes/DARK.js +1 -2
  239. package/cjs/themes/theme.d.ts +10 -0
  240. package/cjs/themes/theme.js +50 -4
  241. package/cjs/themes/theme.js.map +1 -1
  242. package/cjs/tools/LimitPromiseQueue.js +2 -1
  243. package/cjs/tools/calc.d.ts +3 -0
  244. package/cjs/tools/calc.js +11 -3
  245. package/cjs/tools/calc.js.map +1 -1
  246. package/cjs/tools/debounce.js +1 -1
  247. package/cjs/tools/diff-cell.js +2 -2
  248. package/cjs/tools/dom.js +1 -1
  249. package/cjs/tools/env.js +1 -1
  250. package/cjs/ts-types/base-table.d.ts +29 -12
  251. package/cjs/ts-types/base-table.js.map +1 -1
  252. package/cjs/ts-types/column/style.d.ts +0 -1
  253. package/cjs/ts-types/column/style.js.map +1 -1
  254. package/cjs/ts-types/component/axis.d.ts +12 -0
  255. package/cjs/ts-types/component/axis.js +6 -0
  256. package/cjs/ts-types/component/axis.js.map +1 -0
  257. package/cjs/ts-types/component/legend.d.ts +5 -0
  258. package/cjs/ts-types/component/legend.js +6 -0
  259. package/cjs/ts-types/component/legend.js.map +1 -0
  260. package/cjs/ts-types/component/title.d.ts +47 -0
  261. package/cjs/ts-types/component/title.js +6 -0
  262. package/cjs/ts-types/component/title.js.map +1 -0
  263. package/cjs/ts-types/component/util.d.ts +1 -0
  264. package/cjs/ts-types/component/util.js +6 -0
  265. package/cjs/ts-types/component/util.js.map +1 -0
  266. package/cjs/ts-types/customElement.d.ts +2 -0
  267. package/cjs/ts-types/customElement.js.map +1 -1
  268. package/cjs/ts-types/events.d.ts +108 -83
  269. package/cjs/ts-types/events.js.map +1 -1
  270. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
  271. package/cjs/ts-types/list-table/define/chart-define.d.ts +1 -1
  272. package/cjs/ts-types/list-table/define/chart-define.js.map +1 -1
  273. package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -2
  274. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  275. package/cjs/ts-types/new-data-set.d.ts +19 -5
  276. package/cjs/ts-types/new-data-set.js +2 -2
  277. package/cjs/ts-types/new-data-set.js.map +1 -1
  278. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +4 -0
  279. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +3 -1
  280. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -1
  281. package/cjs/ts-types/pivot-table/corner.d.ts +3 -3
  282. package/cjs/ts-types/pivot-table/corner.js.map +1 -1
  283. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  284. package/cjs/ts-types/pivot-table/indicator/chart-indicator.d.ts +1 -1
  285. package/cjs/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -1
  286. package/cjs/ts-types/pivot-table/indicator/index.d.ts +1 -0
  287. package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -1
  288. package/cjs/ts-types/pivot-table/title.d.ts +1 -1
  289. package/cjs/ts-types/pivot-table/title.js.map +1 -1
  290. package/cjs/ts-types/table-engine.d.ts +27 -3
  291. package/cjs/ts-types/table-engine.js.map +1 -1
  292. package/cjs/ts-types/theme.d.ts +5 -0
  293. package/cjs/ts-types/theme.js.map +1 -1
  294. package/dist/vtable.js +37522 -24362
  295. package/dist/vtable.min.js +4 -2
  296. package/es/ListTable.d.ts +2 -1
  297. package/es/ListTable.js +17 -13
  298. package/es/ListTable.js.map +1 -1
  299. package/es/PivotChart.d.ts +69 -0
  300. package/es/PivotChart.js +445 -0
  301. package/es/PivotChart.js.map +1 -0
  302. package/es/PivotTable.d.ts +2 -1
  303. package/es/PivotTable.js +19 -14
  304. package/es/PivotTable.js.map +1 -1
  305. package/es/body-helper/style/MultilineTextStyle.js +2 -2
  306. package/es/body-helper/style/MultilineTextStyle.js.map +1 -1
  307. package/es/body-helper/style/ProgressBarStyle.js +15 -15
  308. package/es/body-helper/style/ProgressBarStyle.js.map +1 -1
  309. package/es/body-helper/style/Style.d.ts +0 -1
  310. package/es/body-helper/style/Style.js +25 -28
  311. package/es/body-helper/style/Style.js.map +1 -1
  312. package/es/{chartType.js → chartModule.js} +2 -2
  313. package/es/chartModule.js.map +1 -0
  314. package/es/components/axis/axis.d.ts +45 -0
  315. package/es/components/axis/axis.js +155 -0
  316. package/es/components/axis/axis.js.map +1 -0
  317. package/es/components/axis/band-scale.d.ts +18 -0
  318. package/es/components/axis/band-scale.js +46 -0
  319. package/es/components/axis/band-scale.js.map +1 -0
  320. package/es/components/axis/get-axis-attributes.d.ts +136 -0
  321. package/es/components/axis/get-axis-attributes.js +166 -0
  322. package/es/components/axis/get-axis-attributes.js.map +1 -0
  323. package/es/components/axis/label-overlap.d.ts +3 -0
  324. package/es/components/axis/label-overlap.js +39 -0
  325. package/es/components/axis/label-overlap.js.map +1 -0
  326. package/es/components/axis/linear-scale.d.ts +45 -0
  327. package/es/components/axis/linear-scale.js +104 -0
  328. package/es/components/axis/linear-scale.js.map +1 -0
  329. package/es/components/legend/get-legend-attributes.d.ts +5 -0
  330. package/es/components/legend/get-legend-attributes.js +84 -0
  331. package/es/components/legend/get-legend-attributes.js.map +1 -0
  332. package/es/components/legend/legend.d.ts +23 -0
  333. package/es/components/legend/legend.js +93 -0
  334. package/es/components/legend/legend.js.map +1 -0
  335. package/{cjs → es/components}/menu/dom/BaseMenu.d.ts +2 -2
  336. package/es/components/menu/dom/BaseMenu.js.map +1 -0
  337. package/es/components/menu/dom/Menu.js.map +1 -0
  338. package/es/{menu → components/menu}/dom/MenuHandler.d.ts +2 -2
  339. package/es/{menu → components/menu}/dom/MenuHandler.js +2 -2
  340. package/es/components/menu/dom/MenuHandler.js.map +1 -0
  341. package/es/{menu → components/menu}/dom/logic/MenuContainer.d.ts +2 -2
  342. package/es/{menu → components/menu}/dom/logic/MenuContainer.js +4 -4
  343. package/es/components/menu/dom/logic/MenuContainer.js.map +1 -0
  344. package/es/{menu → components/menu}/dom/logic/MenuElement.d.ts +2 -2
  345. package/es/{menu → components/menu}/dom/logic/MenuElement.js +9 -9
  346. package/es/components/menu/dom/logic/MenuElement.js.map +1 -0
  347. package/es/components/menu/dom/logic/MenuElementStyle.js.map +1 -0
  348. package/es/components/title/title.d.ts +12 -0
  349. package/es/components/title/title.js +61 -0
  350. package/es/components/title/title.js.map +1 -0
  351. package/{cjs → es/components}/tooltip/BaseTooltip.d.ts +3 -3
  352. package/es/components/tooltip/BaseTooltip.js.map +1 -0
  353. package/es/components/tooltip/Tooltip.js.map +1 -0
  354. package/es/{tooltip → components/tooltip}/TooltipHandler.d.ts +4 -4
  355. package/es/{tooltip → components/tooltip}/TooltipHandler.js +4 -4
  356. package/es/components/tooltip/TooltipHandler.js.map +1 -0
  357. package/{cjs → es/components}/tooltip/logic/BubbleTooltipElement.d.ts +4 -4
  358. package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElement.js +4 -4
  359. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  360. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -0
  361. package/es/components/util/orient.d.ts +3 -0
  362. package/es/components/util/orient.js +8 -0
  363. package/es/components/util/orient.js.map +1 -0
  364. package/es/components/util/register.d.ts +3 -0
  365. package/es/components/util/register.js +8 -0
  366. package/es/components/util/register.js.map +1 -0
  367. package/es/components/util/tick-data/config.d.ts +1 -0
  368. package/es/components/util/tick-data/config.js +2 -0
  369. package/es/components/util/tick-data/config.js.map +1 -0
  370. package/es/components/util/tick-data/continuous.d.ts +2 -0
  371. package/es/components/util/tick-data/continuous.js +38 -0
  372. package/es/components/util/tick-data/continuous.js.map +1 -0
  373. package/es/components/util/tick-data/discrete/linear.d.ts +2 -0
  374. package/es/components/util/tick-data/discrete/linear.js +59 -0
  375. package/es/components/util/tick-data/discrete/linear.js.map +1 -0
  376. package/es/components/util/tick-data/discrete/polar-angle.d.ts +2 -0
  377. package/es/components/util/tick-data/discrete/polar-angle.js +39 -0
  378. package/es/components/util/tick-data/discrete/polar-angle.js.map +1 -0
  379. package/es/components/util/tick-data/index.d.ts +2 -0
  380. package/es/components/util/tick-data/index.js +19 -0
  381. package/es/components/util/tick-data/index.js.map +1 -0
  382. package/es/components/util/tick-data/util.d.ts +21 -0
  383. package/es/components/util/tick-data/util.js +104 -0
  384. package/es/components/util/tick-data/util.js.map +1 -0
  385. package/es/components/util/transform.d.ts +5 -0
  386. package/es/components/util/transform.js +34 -0
  387. package/es/components/util/transform.js.map +1 -0
  388. package/es/core/BaseTable.d.ts +18 -5
  389. package/es/core/BaseTable.js +119 -43
  390. package/es/core/BaseTable.js.map +1 -1
  391. package/es/core/TABLE_EVENT_TYPE.d.ts +5 -0
  392. package/es/core/TABLE_EVENT_TYPE.js +6 -1
  393. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  394. package/es/core/style.js +1 -1
  395. package/es/core/style.js.map +1 -1
  396. package/es/core/tableHelper.js +1 -2
  397. package/es/data/CachedDataSource.js +2 -1
  398. package/es/data/DataSource.js +2 -2
  399. package/es/data/DataSource.js.map +1 -1
  400. package/es/dataset/dataset-pivot-table.d.ts +60 -0
  401. package/es/dataset/dataset-pivot-table.js +378 -0
  402. package/es/dataset/dataset-pivot-table.js.map +1 -0
  403. package/es/dataset/dataset.d.ts +14 -19
  404. package/es/dataset/dataset.js +175 -190
  405. package/es/dataset/dataset.js.map +1 -1
  406. package/es/dataset/statistics-helper.d.ts +68 -0
  407. package/es/dataset/statistics-helper.js +152 -0
  408. package/es/dataset/statistics-helper.js.map +1 -0
  409. package/es/dataset/util/zero-align.d.ts +10 -0
  410. package/es/dataset/util/zero-align.js +111 -0
  411. package/es/dataset/util/zero-align.js.map +1 -0
  412. package/es/event/EventHandler.js.map +1 -1
  413. package/es/event/EventTarget.d.ts +5 -5
  414. package/es/event/EventTarget.js +2 -2
  415. package/es/event/EventTarget.js.map +1 -1
  416. package/es/event/VChartEventProxy.d.ts +1 -0
  417. package/es/event/VChartEventProxy.js +1 -0
  418. package/es/event/VChartEventProxy.js.map +1 -0
  419. package/es/event/event.js +10 -3
  420. package/es/event/event.js.map +1 -1
  421. package/es/event/listener/table-group.js +8 -6
  422. package/es/event/listener/table-group.js.map +1 -1
  423. package/es/event/pivot-chart/axis-click.d.ts +2 -0
  424. package/es/event/pivot-chart/axis-click.js +36 -0
  425. package/es/event/pivot-chart/axis-click.js.map +1 -0
  426. package/es/event/pivot-chart/axis-hover.d.ts +2 -0
  427. package/es/event/pivot-chart/axis-hover.js +33 -0
  428. package/es/event/pivot-chart/axis-hover.js.map +1 -0
  429. package/es/event/scroll.js +4 -3
  430. package/es/event/scroll.js.map +1 -1
  431. package/es/event/sparkline-event.js +1 -2
  432. package/es/event/sparkline-event.js.map +1 -1
  433. package/es/header-helper/header-helper.js +1 -1
  434. package/es/header-helper/header-helper.js.map +1 -1
  435. package/es/header-helper/style/MultilineTextHeaderStyle.js +2 -2
  436. package/es/header-helper/style/MultilineTextHeaderStyle.js.map +1 -1
  437. package/es/header-helper/style/Style.d.ts +0 -1
  438. package/es/header-helper/style/Style.js +25 -28
  439. package/es/header-helper/style/Style.js.map +1 -1
  440. package/es/index.d.ts +4 -3
  441. package/es/index.js +4 -2
  442. package/es/index.js.map +1 -1
  443. package/es/layout/chart-helper/get-axis-config.d.ts +2 -0
  444. package/es/layout/chart-helper/get-axis-config.js +110 -0
  445. package/es/layout/chart-helper/get-axis-config.js.map +1 -0
  446. package/es/layout/chart-helper/get-chart-spec.d.ts +7 -0
  447. package/es/layout/chart-helper/get-chart-spec.js +126 -0
  448. package/es/layout/chart-helper/get-chart-spec.js.map +1 -0
  449. package/es/layout/index.js +2 -1
  450. package/es/layout/pivot-header-layout.d.ts +13 -5
  451. package/es/layout/pivot-header-layout.js +50 -12
  452. package/es/layout/pivot-header-layout.js.map +1 -1
  453. package/es/layout/pivot-layout.d.ts +54 -8
  454. package/es/layout/pivot-layout.js +402 -89
  455. package/es/layout/pivot-layout.js.map +1 -1
  456. package/es/layout/simple-header-layout.d.ts +10 -0
  457. package/es/layout/simple-header-layout.js +44 -1
  458. package/es/layout/simple-header-layout.js.map +1 -1
  459. package/es/plugins/chartModules.js +2 -0
  460. package/es/plugins/chartModules.js.map +1 -0
  461. package/es/register.d.ts +1 -1
  462. package/es/register.js +3 -3
  463. package/es/register.js.map +1 -1
  464. package/es/render/layout/text.d.ts +33 -4
  465. package/es/render/layout/text.js +9 -3
  466. package/es/render/layout/text.js.map +1 -1
  467. package/es/scenegraph/component/custom.js +17 -16
  468. package/es/scenegraph/component/custom.js.map +1 -1
  469. package/es/scenegraph/component/menu.d.ts +41 -0
  470. package/es/scenegraph/component/table-component.js +3 -3
  471. package/es/scenegraph/component/table-component.js.map +1 -1
  472. package/es/scenegraph/graphic/chart.d.ts +4 -1
  473. package/es/scenegraph/graphic/chart.js +29 -15
  474. package/es/scenegraph/graphic/chart.js.map +1 -1
  475. package/es/scenegraph/graphic/contributions/chart-render.js +22 -3
  476. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  477. package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +9 -9
  478. package/es/scenegraph/graphic/contributions/group-contribution-render.js +48 -29
  479. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  480. package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +3 -3
  481. package/es/scenegraph/graphic/contributions/image-contribution-render.js +2 -2
  482. package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  483. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +3 -3
  484. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
  485. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  486. package/es/scenegraph/graphic/text.d.ts +15 -0
  487. package/es/scenegraph/group-creater/cell-helper.js +10 -2
  488. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  489. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  490. package/es/scenegraph/group-creater/cell-type/chart-cell.js +6 -5
  491. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  492. package/es/scenegraph/group-creater/column.js.map +1 -1
  493. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.d.ts +3 -0
  494. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +65 -0
  495. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -0
  496. package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
  497. package/es/scenegraph/group-creater/progress/proxy.js +27 -34
  498. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  499. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +6 -6
  500. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  501. package/es/scenegraph/layout/compute-col-width.js +23 -15
  502. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  503. package/es/scenegraph/layout/compute-row-height.js +20 -9
  504. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  505. package/es/scenegraph/layout/move-cell.js +1 -1
  506. package/es/scenegraph/layout/move-cell.js.map +1 -1
  507. package/es/scenegraph/layout/update-cell.js +3 -1
  508. package/es/scenegraph/layout/update-cell.js.map +1 -1
  509. package/es/scenegraph/layout/update-height.js +1 -1
  510. package/es/scenegraph/layout/update-height.js.map +1 -1
  511. package/es/scenegraph/layout/update-row.js +1 -1
  512. package/es/scenegraph/layout/update-row.js.map +1 -1
  513. package/es/scenegraph/layout/update-width.js +34 -2
  514. package/es/scenegraph/layout/update-width.js.map +1 -1
  515. package/es/scenegraph/refresh-node/update-chart.d.ts +3 -0
  516. package/es/scenegraph/refresh-node/update-chart.js +70 -4
  517. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  518. package/es/scenegraph/scenegraph.d.ts +8 -0
  519. package/es/scenegraph/scenegraph.js +117 -19
  520. package/es/scenegraph/scenegraph.js.map +1 -1
  521. package/es/scenegraph/stick-text/index.js +10 -8
  522. package/es/scenegraph/stick-text/index.js.map +1 -1
  523. package/es/scenegraph/style/corner-cell.d.ts +3 -0
  524. package/es/scenegraph/style/corner-cell.js +25 -0
  525. package/es/scenegraph/style/corner-cell.js.map +1 -0
  526. package/es/scenegraph/style/frame-border.d.ts +1 -0
  527. package/es/scenegraph/style/frame-border.js +2 -6
  528. package/es/scenegraph/style/frame-border.js.map +1 -1
  529. package/es/scenegraph/utils/get-cell-merge.js +2 -1
  530. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  531. package/es/state/state.js +1 -1
  532. package/es/state/state.js.map +1 -1
  533. package/es/themes/DARK.js +1 -2
  534. package/es/themes/theme.d.ts +10 -0
  535. package/es/themes/theme.js +50 -4
  536. package/es/themes/theme.js.map +1 -1
  537. package/es/tools/LimitPromiseQueue.js +2 -1
  538. package/es/tools/calc.d.ts +3 -0
  539. package/es/tools/calc.js +10 -0
  540. package/es/tools/calc.js.map +1 -1
  541. package/es/tools/debounce.js +1 -1
  542. package/es/tools/diff-cell.js +1 -1
  543. package/es/tools/dom.js +1 -1
  544. package/es/tools/env.js +1 -1
  545. package/es/ts-types/base-table.d.ts +29 -12
  546. package/es/ts-types/base-table.js.map +1 -1
  547. package/es/ts-types/column/style.d.ts +0 -1
  548. package/es/ts-types/column/style.js.map +1 -1
  549. package/es/ts-types/component/axis.d.ts +12 -0
  550. package/es/ts-types/component/axis.js +2 -0
  551. package/es/ts-types/component/axis.js.map +1 -0
  552. package/es/ts-types/component/legend.d.ts +5 -0
  553. package/es/ts-types/component/legend.js +2 -0
  554. package/es/ts-types/component/legend.js.map +1 -0
  555. package/es/ts-types/component/title.d.ts +47 -0
  556. package/es/ts-types/component/title.js +2 -0
  557. package/es/ts-types/component/title.js.map +1 -0
  558. package/es/ts-types/component/util.d.ts +1 -0
  559. package/es/ts-types/component/util.js +2 -0
  560. package/es/ts-types/component/util.js.map +1 -0
  561. package/es/ts-types/customElement.d.ts +2 -0
  562. package/es/ts-types/customElement.js.map +1 -1
  563. package/es/ts-types/events.d.ts +108 -83
  564. package/es/ts-types/events.js.map +1 -1
  565. package/es/ts-types/list-table/define/basic-define.js.map +1 -1
  566. package/es/ts-types/list-table/define/chart-define.d.ts +1 -1
  567. package/es/ts-types/list-table/define/chart-define.js.map +1 -1
  568. package/es/ts-types/list-table/layout-map/api.d.ts +4 -2
  569. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  570. package/es/ts-types/new-data-set.d.ts +19 -5
  571. package/es/ts-types/new-data-set.js +2 -2
  572. package/es/ts-types/new-data-set.js.map +1 -1
  573. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +4 -0
  574. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +4 -0
  575. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -1
  576. package/es/ts-types/pivot-table/corner.d.ts +3 -3
  577. package/es/ts-types/pivot-table/corner.js.map +1 -1
  578. package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  579. package/es/ts-types/pivot-table/indicator/chart-indicator.d.ts +1 -1
  580. package/es/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -1
  581. package/es/ts-types/pivot-table/indicator/index.d.ts +1 -0
  582. package/es/ts-types/pivot-table/indicator/index.js.map +1 -1
  583. package/es/ts-types/pivot-table/title.d.ts +1 -1
  584. package/es/ts-types/pivot-table/title.js.map +1 -1
  585. package/es/ts-types/table-engine.d.ts +27 -3
  586. package/es/ts-types/table-engine.js.map +1 -1
  587. package/es/ts-types/theme.d.ts +5 -0
  588. package/es/ts-types/theme.js.map +1 -1
  589. package/package.json +16 -10
  590. package/cjs/chartType.js +0 -14
  591. package/cjs/chartType.js.map +0 -1
  592. package/cjs/menu/dom/BaseMenu.js.map +0 -1
  593. package/cjs/menu/dom/Menu.js.map +0 -1
  594. package/cjs/menu/dom/MenuHandler.js.map +0 -1
  595. package/cjs/menu/dom/logic/MenuContainer.js.map +0 -1
  596. package/cjs/menu/dom/logic/MenuElement.js.map +0 -1
  597. package/cjs/menu/dom/logic/MenuElementStyle.js.map +0 -1
  598. package/cjs/plugins/chartTypes.js.map +0 -1
  599. package/cjs/scenegraph/layout/auto-width.d.ts +0 -2
  600. package/cjs/scenegraph/layout/auto-width.js +0 -85
  601. package/cjs/scenegraph/layout/auto-width.js.map +0 -1
  602. package/cjs/tooltip/BaseTooltip.js.map +0 -1
  603. package/cjs/tooltip/Tooltip.js.map +0 -1
  604. package/cjs/tooltip/TooltipHandler.js.map +0 -1
  605. package/cjs/tooltip/logic/BubbleTooltipElement.js.map +0 -1
  606. package/cjs/tooltip/logic/BubbleTooltipElementStyle.js.map +0 -1
  607. package/es/chartType.js.map +0 -1
  608. package/es/menu/dom/BaseMenu.js.map +0 -1
  609. package/es/menu/dom/Menu.js.map +0 -1
  610. package/es/menu/dom/MenuHandler.js.map +0 -1
  611. package/es/menu/dom/logic/MenuContainer.js.map +0 -1
  612. package/es/menu/dom/logic/MenuElement.js.map +0 -1
  613. package/es/menu/dom/logic/MenuElementStyle.js.map +0 -1
  614. package/es/plugins/chartTypes.js +0 -2
  615. package/es/plugins/chartTypes.js.map +0 -1
  616. package/es/scenegraph/layout/auto-width.d.ts +0 -2
  617. package/es/scenegraph/layout/auto-width.js +0 -82
  618. package/es/scenegraph/layout/auto-width.js.map +0 -1
  619. package/es/tooltip/BaseTooltip.js.map +0 -1
  620. package/es/tooltip/Tooltip.js.map +0 -1
  621. package/es/tooltip/TooltipHandler.js.map +0 -1
  622. package/es/tooltip/logic/BubbleTooltipElement.js.map +0 -1
  623. package/es/tooltip/logic/BubbleTooltipElementStyle.js.map +0 -1
  624. /package/cjs/{chartType.d.ts → chartModule.d.ts} +0 -0
  625. /package/cjs/{menu → components/menu}/dom/BaseMenu.js +0 -0
  626. /package/cjs/{menu → components/menu}/dom/Menu.d.ts +0 -0
  627. /package/cjs/{menu → components/menu}/dom/Menu.js +0 -0
  628. /package/cjs/{menu → components/menu}/dom/logic/MenuElementStyle.d.ts +0 -0
  629. /package/cjs/{menu → components/menu}/dom/logic/MenuElementStyle.js +0 -0
  630. /package/cjs/{tooltip → components/tooltip}/BaseTooltip.js +0 -0
  631. /package/cjs/{tooltip → components/tooltip}/Tooltip.d.ts +0 -0
  632. /package/cjs/{tooltip → components/tooltip}/Tooltip.js +0 -0
  633. /package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.d.ts +0 -0
  634. /package/cjs/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.js +0 -0
  635. /package/cjs/plugins/{chartTypes.d.ts → chartModules.d.ts} +0 -0
  636. /package/es/{chartType.d.ts → chartModule.d.ts} +0 -0
  637. /package/es/{menu → components/menu}/dom/BaseMenu.js +0 -0
  638. /package/es/{menu → components/menu}/dom/Menu.d.ts +0 -0
  639. /package/es/{menu → components/menu}/dom/Menu.js +0 -0
  640. /package/es/{menu → components/menu}/dom/logic/MenuElementStyle.d.ts +0 -0
  641. /package/es/{menu → components/menu}/dom/logic/MenuElementStyle.js +0 -0
  642. /package/es/{tooltip → components/tooltip}/BaseTooltip.js +0 -0
  643. /package/es/{tooltip → components/tooltip}/Tooltip.d.ts +0 -0
  644. /package/es/{tooltip → components/tooltip}/Tooltip.js +0 -0
  645. /package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.d.ts +0 -0
  646. /package/es/{tooltip → components/tooltip}/logic/BubbleTooltipElementStyle.js +0 -0
  647. /package/es/plugins/{chartTypes.d.ts → chartModules.d.ts} +0 -0
@@ -13,15 +13,15 @@ const vrender_1 = require("@visactor/vrender"), util_1 = require("../../tools/ut
13
13
  });
14
14
 
15
15
  function computeRowsHeight(table, rowStart, rowEnd) {
16
- if (!table.internalProps.autoRowHeight) return;
17
- rowStart = null != rowStart ? rowStart : 0, rowEnd = null != rowEnd ? rowEnd : table.rowCount - 1;
18
16
  const time = "undefined" != typeof window ? window.performance.now() : 0;
19
- if (0 === rowStart && rowEnd === table.rowCount - 1) table._clearRowRangeHeightsMap(); else for (let row = rowStart; row <= rowEnd; row++) table._clearRowRangeHeightsMap(row);
20
- for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {
21
- const height = computeRowHeight(row, 0, table.colCount - 1, table);
22
- table.setRowHeight(row, height);
23
- }
24
- if (!(rowEnd < table.columnHeaderLevelCount)) {
17
+ if ("autoHeight" === table.heightMode) {
18
+ if (rowStart = null != rowStart ? rowStart : 0, rowEnd = null != rowEnd ? rowEnd : table.rowCount - 1,
19
+ 0 === rowStart && rowEnd === table.rowCount - 1) table._clearRowRangeHeightsMap(); else for (let row = rowStart; row <= rowEnd; row++) table._clearRowRangeHeightsMap(row);
20
+ for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {
21
+ const height = computeRowHeight(row, 0, table.colCount - 1, table);
22
+ table.setRowHeight(row, height);
23
+ }
24
+ if (rowEnd < table.columnHeaderLevelCount) return;
25
25
  if (table.internalProps.transpose || table.isPivotTable() && table.internalProps.layoutMap.indicatorsAsCol || !checkFixedStyleAndNoWrap(table)) if ((table.internalProps.transpose || table.isPivotTable() && !table.internalProps.layoutMap.indicatorsAsCol) && checkFixedStyleAndNoWrap(table)) for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {
26
26
  table._clearRowRangeHeightsMap(row);
27
27
  const height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);
@@ -33,8 +33,19 @@ function computeRowsHeight(table, rowStart, rowEnd) {
33
33
  } else {
34
34
  fillRowsHeight(computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table), table.columnHeaderLevelCount, table.rowCount - 1, table);
35
35
  }
36
- console.log("computeRowsHeight time:", ("undefined" != typeof window ? window.performance.now() : 0) - time);
36
+ } else if ("adaptive" === table.heightMode) {
37
+ table._clearRowRangeHeightsMap();
38
+ const totalDrawHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
39
+ let actualHeight = 0;
40
+ for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) actualHeight += table.getRowHeight(row);
41
+ const factor = totalDrawHeight / actualHeight;
42
+ for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {
43
+ let rowHeight;
44
+ rowHeight = row === table.rowCount - table.bottomFrozenRowCount - 1 ? totalDrawHeight - table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2) : Math.round(table.getRowHeight(row) * factor),
45
+ table.setRowHeight(row, rowHeight, !1);
46
+ }
37
47
  }
48
+ console.log("computeRowsHeight time:", ("undefined" != typeof window ? window.performance.now() : 0) - time);
38
49
  }
39
50
 
40
51
  function computeRowHeight(row, startCol, endCol, table) {
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAE7C,2CAAiD;AAEjD,6CAA8C;AAG9C,0CAA2C;AAC3C,gDAA4C;AAC5C,8CAAgD;AAChD,2DAAkD;AAClD,gEAAiE;AAEjE,MAAM,YAAY,GAAG,IAAI,eAAQ,CAAC;IAChC,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,IAAI,kBAAQ,CAAC;IACpC,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,EAAE;CACf,CAAC,CAAC;AAEH,SAAgB,iBAAiB,CAAC,KAAmB,EAAE,QAAiB,EAAE,MAAe;IACvF,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE;QAEtC,OAAO;KACR;IACD,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,CAAC,CAAC;IACzB,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC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utMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { WrapText } from '../graphic/text';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { getCellRect } from './compute-col-width';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\n\nconst utilTextMark = new WrapText({\n autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\n\nexport function computeRowsHeight(table: BaseTableAPI, rowStart?: number, rowEnd?: number): void {\n if (!table.internalProps.autoRowHeight) {\n // autoRowHeight false use default height\n return;\n }\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n\n // clear rowRangeHeightsMap\n if (rowStart === 0 && rowEnd === table.rowCount - 1) {\n table._clearRowRangeHeightsMap();\n } else {\n for (let row = rowStart; row <= rowEnd; row++) {\n table._clearRowRangeHeightsMap(row);\n }\n }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n table.setRowHeight(row, height);\n }\n\n if (rowEnd < table.columnHeaderLevelCount) {\n return;\n }\n\n // compute body row\n if (\n !table.internalProps.transpose &&\n !(table.isPivotTable() && (table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(height, table.columnHeaderLevelCount, table.rowCount - 1, table);\n } else if (\n (table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n table._clearRowRangeHeightsMap(row);\n const height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n table.setRowHeight(row, height);\n }\n } else {\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n table._clearRowRangeHeightsMap(row);\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n table.setRowHeight(row, height);\n }\n }\n\n console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (typeof customHeight === 'number') {\n maxHeight = Math.max(customHeight, maxHeight);\n continue;\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n for (let col = 0; col < table.colCount; col++) {\n const isHeader = layoutMap.isHeader(col, row);\n const cellDefine = isHeader ? layoutMap.getHeader(col, row) : layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n typeof (cellDefine as HeaderData).headerIcon === 'function' ||\n (isHeader ? cellDefine.define?.headerCustomRender : cellDefine.define?.customRender) ||\n (isHeader ? typeof cellDefine.define?.headerIcon === 'function' : typeof cellDefine.define?.icon === 'function')\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction fillRowsHeight(height: number, startRow: number, endRow: number, table: BaseTableAPI) {\n for (let row = startRow; row <= endRow; row++) {\n table.setRowHeight(row, height);\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanCol = 1;\n let height = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n height = size.height ?? 0;\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n } else {\n height = customRender?.expectedHeight ?? 0;\n }\n return height / spanCol;\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellType(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n const lines = validToString(cellValue).split('\\n') || [];\n\n if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: table.getColWidth(col) - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = table.getColWidth(col) - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAE7C,2CAAiD;AAEjD,6CAA8C;AAG9C,0CAA2C;AAC3C,gDAA4C;AAC5C,8CAAgD;AAChD,2DAAkD;AAClD,gEAAiE;AAEjE,MAAM,YAAY,GAAG,IAAI,eAAQ,CAAC;IAChC,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,IAAI,kBAAQ,CAAC;IACpC,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,EAAE;CACf,CAAC,CAAC;AAEH,SAAgB,iBAAiB,CAAC,KAAmB,EAAE,QAAiB,EAAE,MAAe;IACvF,MAAM,IAAI,GAAG,OAAO,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row-height.js","sourcesContent":["import { RichText } from '@visactor/vrender';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { WrapText } from '../graphic/text';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { getCellRect } from './compute-col-width';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\n\nconst utilTextMark = new WrapText({\n autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\n\nexport function computeRowsHeight(table: BaseTableAPI, rowStart?: number, rowEnd?: number): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n if (table.heightMode === 'autoHeight') {\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n\n // clear rowRangeHeightsMap\n if (rowStart === 0 && rowEnd === table.rowCount - 1) {\n table._clearRowRangeHeightsMap();\n } else {\n for (let row = rowStart; row <= rowEnd; row++) {\n table._clearRowRangeHeightsMap(row);\n }\n }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n table.setRowHeight(row, height);\n }\n\n if (rowEnd < table.columnHeaderLevelCount) {\n return;\n }\n\n // compute body row\n if (\n !table.internalProps.transpose &&\n !(table.isPivotTable() && (table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(height, table.columnHeaderLevelCount, table.rowCount - 1, table);\n } else if (\n (table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n table._clearRowRangeHeightsMap(row);\n const height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n table.setRowHeight(row, height);\n }\n } else {\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n table._clearRowRangeHeightsMap(row);\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n table.setRowHeight(row, height);\n }\n }\n }\n // 处理adaptive宽度\n else if (table.heightMode === 'adaptive') {\n table._clearRowRangeHeightsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const totalDrawHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();\n let actualHeight = 0;\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n actualHeight += table.getRowHeight(row);\n }\n const factor = totalDrawHeight / actualHeight;\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n let rowHeight;\n if (row === table.rowCount - table.bottomFrozenRowCount - 1) {\n rowHeight =\n totalDrawHeight - table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2);\n } else {\n rowHeight = Math.round(table.getRowHeight(row) * factor);\n }\n table.setRowHeight(row, rowHeight, false);\n }\n }\n\n console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (typeof customHeight === 'number') {\n maxHeight = Math.max(customHeight, maxHeight);\n continue;\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n for (let col = 0; col < table.colCount; col++) {\n const isHeader = layoutMap.isHeader(col, row);\n const cellDefine = isHeader ? layoutMap.getHeader(col, row) : layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n typeof (cellDefine as HeaderData).headerIcon === 'function' ||\n (isHeader ? cellDefine.define?.headerCustomRender : cellDefine.define?.customRender) ||\n (isHeader ? typeof cellDefine.define?.headerIcon === 'function' : typeof cellDefine.define?.icon === 'function')\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction fillRowsHeight(height: number, startRow: number, endRow: number, table: BaseTableAPI) {\n for (let row = startRow; row <= endRow; row++) {\n table.setRowHeight(row, height);\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanCol = 1;\n let height = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n height = size.height ?? 0;\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n } else {\n height = customRender?.expectedHeight ?? 0;\n }\n return height / spanCol;\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellType(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine).mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n const lines = validToString(cellValue).split('\\n') || [];\n\n if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: table.getColWidth(col) - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = table.getColWidth(col) - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n"]}
@@ -19,7 +19,7 @@ function moveHeaderPosition(colSource, rowSource, colTarget, rowTarget, table) {
19
19
  sourceRowEnd = table.rowCount - 1, targetRowStart = rowTarget, targetRowEnd = table.rowCount - 1;
20
20
  } else if ("row" === direction) {
21
21
  const sourceMergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(table, colSource, rowSource), targetMergeInfo = (0,
22
- get_cell_merge_1.getCellMergeInfo)(table, colSource, rowSource);
22
+ get_cell_merge_1.getCellMergeInfo)(table, colTarget, rowTarget);
23
23
  sourceMergeInfo && targetMergeInfo ? (sourceRowStart = sourceMergeInfo.start.row,
24
24
  sourceRowEnd = sourceMergeInfo.end.row, targetRowStart = targetMergeInfo.start.row,
25
25
  targetRowEnd = targetMergeInfo.end.row) : (sourceRowStart = rowSource, sourceRowEnd = rowSource,
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/layout/move-cell.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,4DAA2D;AAG3D,MAAM,gBAAgB,GAAG,IAAI,eAAK,CAAC,EAAE,CAAC,CAAC;AAEvC,SAAgB,kBAAkB,CAChC,SAAiB,EACjB,SAAiB,EACjB,SAAiB,EACjB,SAAiB,EACjB,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAG/B,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,QAAQ,KAAK,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAExG,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,YAAY,GAAG,CAAC,CAAC;IACr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ChC,eAAe,CAAC,GAAG,GAAG,SAAS,CAAC;IAChC,IAAI,OAAO,cAAc,KAAK,QAAQ,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QAC5E,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,GAAG,GAAG,cAAc,CAAC;QAChE,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,GAAG,GAAG,cAAc,CAAC;KACjE;IACD,IAAI,OAAO,cAAc,KAAK,QAAQ,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QAC5E,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,GAAG,GAAG,cAAc,CAAC;QAChE,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,GAAG,GAAG,cAAc,CAAC;KACjE;AACH,CAAC","file":"move-cell.js","sourcesContent":["import { Group } from '@visactor/vrender';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nconst groupForPosition = new Group({});\n\nexport function moveHeaderPosition(\n colSource: number,\n rowSource: number,\n colTarget: number,\n rowTarget: number,\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n\n // 判断方向\n const cellType = table.getCellType(colTarget, rowTarget);\n const direction = cellType === 'columnHeader' ? 'column' : cellType === 'rowHeader' ? 'row' : undefined;\n\n let sourceColStart = 0;\n let sourceRowStart = 0;\n let sourceColEnd = 0;\n let sourceRowEnd = 0;\n let targetColStart = 0;\n let targetRowStart = 0;\n let targetColEnd = 0;\n let targetRowEnd = 0;\n if (direction === 'column') {\n const sourceMergeInfo = getCellMergeInfo(table, colSource, rowSource);\n const targetMergeInfo = getCellMergeInfo(table, colTarget, rowTarget);\n if (sourceMergeInfo && targetMergeInfo) {\n sourceColStart = sourceMergeInfo.start.col;\n sourceColEnd = sourceMergeInfo.end.col;\n targetColStart = targetMergeInfo.start.col;\n targetColEnd = targetMergeInfo.end.col;\n } else {\n sourceColStart = colSource;\n sourceColEnd = colSource;\n targetColStart = colTarget;\n targetColEnd = colTarget;\n }\n sourceRowStart = rowSource;\n sourceRowEnd = table.rowCount - 1;\n targetRowStart = rowTarget;\n targetRowEnd = table.rowCount - 1;\n } else if (direction === 'row') {\n const sourceMergeInfo = getCellMergeInfo(table, colSource, rowSource);\n const targetMergeInfo = getCellMergeInfo(table, colSource, rowSource);\n if (sourceMergeInfo && targetMergeInfo) {\n sourceRowStart = sourceMergeInfo.start.row;\n sourceRowEnd = sourceMergeInfo.end.row;\n targetRowStart = targetMergeInfo.start.row;\n targetRowEnd = targetMergeInfo.end.row;\n } else {\n sourceRowStart = rowSource;\n sourceRowEnd = rowSource;\n targetRowStart = rowTarget;\n targetRowEnd = rowTarget;\n }\n sourceColStart = colSource;\n sourceColEnd = table.colCount - 1;\n targetColStart = colTarget;\n targetColEnd = table.colCount - 1;\n }\n\n const updateColStart = Math.min(sourceColStart, targetColStart);\n const updateColEnd = Math.max(sourceColEnd, targetColEnd);\n const updateRowStart = Math.min(sourceRowStart, targetRowStart);\n const updateRowEnd = Math.max(sourceRowEnd, targetRowEnd);\n\n // 更新columnGroup列宽\n for (let col = updateColStart; col <= updateColEnd; col++) {\n const columnHeaderGroup = table.scenegraph.getColGroup(col, true);\n const columnGroup = table.scenegraph.getColGroup(col);\n if (columnHeaderGroup) {\n columnHeaderGroup.setAttribute('width', table.getColWidth(col));\n }\n if (columnGroup) {\n columnGroup.setAttribute('width', table.getColWidth(col));\n }\n }\n\n // 更新容器尺寸\n scene.updateContainer();\n\n for (let col = updateColStart; col <= updateColEnd; col++) {\n // 将该列的chartInstance清除掉\n const columnGroup = table.scenegraph.getColGroup(col);\n columnGroup?.setAttribute('chartInstance', undefined);\n // 更新单元格记录全量属性,不更新column theme\n for (let row = updateRowStart; row <= updateRowEnd; row++) {\n scene.updateCellContent(col, row);\n }\n }\n}\n\nfunction changeCell(colSource: number, rowSource: number, colTarget: number, rowTarget: number, table: BaseTableAPI) {\n // 记录基础属性\n const scene = table.scenegraph;\n const sourceCellGroup = scene.getCell(colSource, rowSource, true);\n const targetCellGroup = scene.getCell(colTarget, rowTarget, true);\n if (sourceCellGroup.role === 'empty' || targetCellGroup.role === 'empty') {\n return;\n }\n const sourceParent = sourceCellGroup.parent as Group;\n const targetParent = targetCellGroup.parent as Group;\n const { x: sourceX, y: sourceY } = sourceCellGroup.attribute;\n const { x: targetX, y: targetY } = targetCellGroup.attribute;\n\n // 判断merge属性\n let sourceDeltaCol;\n let sourceDeltaRow;\n let targetDeltaCol;\n let targetDeltaRow;\n const sourceMergeCol = sourceCellGroup.mergeCol;\n const sourceMergeRow = sourceCellGroup.mergeRow;\n const targetMergeCol = targetCellGroup.mergeCol;\n const targetMergeRow = targetCellGroup.mergeRow;\n if (typeof sourceMergeCol === 'number' && typeof sourceMergeRow === 'number') {\n sourceDeltaCol = sourceMergeCol - colSource;\n sourceDeltaRow = sourceMergeRow - rowSource;\n }\n if (typeof targetMergeCol === 'number' && typeof targetMergeRow === 'number') {\n targetDeltaCol = targetMergeCol - colTarget;\n targetDeltaRow = targetMergeRow - rowTarget;\n }\n\n // 更新位置\n targetParent.insertAfter(groupForPosition, targetCellGroup);\n sourceParent.insertAfter(targetCellGroup, sourceCellGroup);\n targetParent.insertAfter(sourceCellGroup, groupForPosition);\n targetParent.removeChild(groupForPosition);\n\n // 更新属性\n sourceCellGroup.setAttributes({\n x: targetX,\n y: targetY\n });\n sourceCellGroup.col = colTarget;\n sourceCellGroup.row = rowTarget;\n\n targetCellGroup.setAttributes({\n x: sourceX,\n y: sourceY\n });\n targetCellGroup.col = colSource;\n targetCellGroup.row = rowSource;\n if (typeof sourceDeltaCol === 'number' && typeof sourceDeltaRow === 'number') {\n sourceCellGroup.mergeCol = sourceCellGroup.col + sourceDeltaCol;\n sourceCellGroup.mergeRow = sourceCellGroup.row + sourceDeltaRow;\n }\n if (typeof targetDeltaCol === 'number' && typeof targetDeltaRow === 'number') {\n targetCellGroup.mergeCol = targetCellGroup.col + targetDeltaCol;\n targetCellGroup.mergeRow = target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';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nconst groupForPosition = new Group({});\n\nexport function moveHeaderPosition(\n colSource: number,\n rowSource: number,\n colTarget: number,\n rowTarget: number,\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n\n // 判断方向\n const cellType = table.getCellType(colTarget, rowTarget);\n const direction = cellType === 'columnHeader' ? 'column' : cellType === 'rowHeader' ? 'row' : undefined;\n\n let sourceColStart = 0;\n let sourceRowStart = 0;\n let sourceColEnd = 0;\n let sourceRowEnd = 0;\n let targetColStart = 0;\n let targetRowStart = 0;\n let targetColEnd = 0;\n let targetRowEnd = 0;\n if (direction === 'column') {\n const sourceMergeInfo = getCellMergeInfo(table, colSource, rowSource);\n const targetMergeInfo = getCellMergeInfo(table, colTarget, rowTarget);\n if (sourceMergeInfo && targetMergeInfo) {\n sourceColStart = sourceMergeInfo.start.col;\n sourceColEnd = sourceMergeInfo.end.col;\n targetColStart = targetMergeInfo.start.col;\n targetColEnd = targetMergeInfo.end.col;\n } else {\n sourceColStart = colSource;\n sourceColEnd = colSource;\n targetColStart = colTarget;\n targetColEnd = colTarget;\n }\n sourceRowStart = rowSource;\n sourceRowEnd = table.rowCount - 1;\n targetRowStart = rowTarget;\n targetRowEnd = table.rowCount - 1;\n } else if (direction === 'row') {\n const sourceMergeInfo = getCellMergeInfo(table, colSource, rowSource);\n const targetMergeInfo = getCellMergeInfo(table, colTarget, rowTarget);\n if (sourceMergeInfo && targetMergeInfo) {\n sourceRowStart = sourceMergeInfo.start.row;\n sourceRowEnd = sourceMergeInfo.end.row;\n targetRowStart = targetMergeInfo.start.row;\n targetRowEnd = targetMergeInfo.end.row;\n } else {\n sourceRowStart = rowSource;\n sourceRowEnd = rowSource;\n targetRowStart = rowTarget;\n targetRowEnd = rowTarget;\n }\n sourceColStart = colSource;\n sourceColEnd = table.colCount - 1;\n targetColStart = colTarget;\n targetColEnd = table.colCount - 1;\n }\n\n const updateColStart = Math.min(sourceColStart, targetColStart);\n const updateColEnd = Math.max(sourceColEnd, targetColEnd);\n const updateRowStart = Math.min(sourceRowStart, targetRowStart);\n const updateRowEnd = Math.max(sourceRowEnd, targetRowEnd);\n\n // 更新columnGroup列宽\n for (let col = updateColStart; col <= updateColEnd; col++) {\n const columnHeaderGroup = table.scenegraph.getColGroup(col, true);\n const columnGroup = table.scenegraph.getColGroup(col);\n if (columnHeaderGroup) {\n columnHeaderGroup.setAttribute('width', table.getColWidth(col));\n }\n if (columnGroup) {\n columnGroup.setAttribute('width', table.getColWidth(col));\n }\n }\n\n // 更新容器尺寸\n scene.updateContainer();\n\n for (let col = updateColStart; col <= updateColEnd; col++) {\n // 将该列的chartInstance清除掉\n const columnGroup = table.scenegraph.getColGroup(col);\n columnGroup?.setAttribute('chartInstance', undefined);\n // 更新单元格记录全量属性,不更新column theme\n for (let row = updateRowStart; row <= updateRowEnd; row++) {\n scene.updateCellContent(col, row);\n }\n }\n}\n\nfunction changeCell(colSource: number, rowSource: number, colTarget: number, rowTarget: number, table: BaseTableAPI) {\n // 记录基础属性\n const scene = table.scenegraph;\n const sourceCellGroup = scene.getCell(colSource, rowSource, true);\n const targetCellGroup = scene.getCell(colTarget, rowTarget, true);\n if (sourceCellGroup.role === 'empty' || targetCellGroup.role === 'empty') {\n return;\n }\n const sourceParent = sourceCellGroup.parent as Group;\n const targetParent = targetCellGroup.parent as Group;\n const { x: sourceX, y: sourceY } = sourceCellGroup.attribute;\n const { x: targetX, y: targetY } = targetCellGroup.attribute;\n\n // 判断merge属性\n let sourceDeltaCol;\n let sourceDeltaRow;\n let targetDeltaCol;\n let targetDeltaRow;\n const sourceMergeCol = sourceCellGroup.mergeCol;\n const sourceMergeRow = sourceCellGroup.mergeRow;\n const targetMergeCol = targetCellGroup.mergeCol;\n const targetMergeRow = targetCellGroup.mergeRow;\n if (typeof sourceMergeCol === 'number' && typeof sourceMergeRow === 'number') {\n sourceDeltaCol = sourceMergeCol - colSource;\n sourceDeltaRow = sourceMergeRow - rowSource;\n }\n if (typeof targetMergeCol === 'number' && typeof targetMergeRow === 'number') {\n targetDeltaCol = targetMergeCol - colTarget;\n targetDeltaRow = targetMergeRow - rowTarget;\n }\n\n // 更新位置\n targetParent.insertAfter(groupForPosition, targetCellGroup);\n sourceParent.insertAfter(targetCellGroup, sourceCellGroup);\n targetParent.insertAfter(sourceCellGroup, groupForPosition);\n targetParent.removeChild(groupForPosition);\n\n // 更新属性\n sourceCellGroup.setAttributes({\n x: targetX,\n y: targetY\n });\n sourceCellGroup.col = colTarget;\n sourceCellGroup.row = rowTarget;\n\n targetCellGroup.setAttributes({\n x: sourceX,\n y: sourceY\n });\n targetCellGroup.col = colSource;\n targetCellGroup.row = rowSource;\n if (typeof sourceDeltaCol === 'number' && typeof sourceDeltaRow === 'number') {\n sourceCellGroup.mergeCol = sourceCellGroup.col + sourceDeltaCol;\n sourceCellGroup.mergeRow = sourceCellGroup.row + sourceDeltaRow;\n }\n if (typeof targetDeltaCol === 'number' && typeof targetDeltaRow === 'number') {\n targetCellGroup.mergeCol = targetCellGroup.col + targetDeltaCol;\n targetCellGroup.mergeRow = targetCellGroup.row + targetDeltaRow;\n }\n}\n"]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.updateCellLayout = void 0;
6
6
 
7
- const custom_1 = require("../component/custom"), progress_bar_cell_1 = require("../group-creater/cell-type/progress-bar-cell"), spark_line_cell_1 = require("../group-creater/cell-type/spark-line-cell"), get_cell_merge_1 = require("../utils/get-cell-merge"), get_prop_1 = require("../utils/get-prop"), padding_1 = require("../utils/padding"), text_icon_layout_1 = require("../utils/text-icon-layout");
7
+ const tableHelper_1 = require("../../core/tableHelper"), custom_1 = require("../component/custom"), progress_bar_cell_1 = require("../group-creater/cell-type/progress-bar-cell"), spark_line_cell_1 = require("../group-creater/cell-type/spark-line-cell"), get_cell_merge_1 = require("../utils/get-cell-merge"), get_prop_1 = require("../utils/get-prop"), padding_1 = require("../utils/padding"), text_icon_layout_1 = require("../utils/text-icon-layout");
8
8
 
9
9
  function updateCellLayout(scene, cell, col, row, width, height, detaX, detaY, isHeader, autoColWidth, autoRowHeight) {
10
10
  let cellGroup, distWidth;
@@ -28,7 +28,8 @@ function updateCellLayout(scene, cell, col, row, width, height, detaX, detaY, is
28
28
  cell.removeAllChild();
29
29
  const headerStyle = scene.table._getCellStyle(col, row), padding = (0, padding_1.getQuadProps)((0,
30
30
  get_prop_1.getProp)("padding", headerStyle, col, row, scene.table));
31
- (0, spark_line_cell_1.createSparkLineCellGroup)(cell, cell.parent, cell.attribute.x, cell.attribute.y, col, row, cell.attribute.width, cell.attribute.height, padding, scene.table);
31
+ (0, spark_line_cell_1.createSparkLineCellGroup)(cell, cell.parent, cell.attribute.x, cell.attribute.y, col, row, cell.attribute.width, cell.attribute.height, padding, scene.table, (0,
32
+ tableHelper_1.getStyleTheme)(headerStyle, scene.table, col, row, get_prop_1.getProp).theme);
32
33
  } else if ("image" === type || "video" === type) ; else {
33
34
  const style = scene.table._getCellStyle(col, row);
34
35
  (0, text_icon_layout_1.updateCellContentWidth)(cell, distWidth, detaX, autoRowHeight, (0,
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/layout/update-cell.ts"],"names":[],"mappings":";;;AAEA,gDAAqD;AAErD,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAmE;AAMnE,SAAgB,gBAAgB,CAC9B,KAAiB,EACjB,IAAW,EACX,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,KAAa,EACb,KAAa,EACb,QAAiB,EACjB,YAAqB,EACrB,aAAsB;IAEtB,IAAI,SAAS,CAAC;IACd,IAAI,SAAS,CAAC;IACd,MAAM,SAAS,GAAG,IAAA,iCAAgB,EAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAG1D,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG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BACL,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;gBAC7E,YAAY,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,KAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;gBAChE,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC;aACrC;YACD,MAAM,YAAY,GAAG,IAAA,uBAAc,EACjC,YAAY,EACZ,YAAY,EACZ,SAAS,CAAC,GAAG,EACb,SAAS,CAAC,GAAG,EACb,SAAS,CAAC,SAAS,CAAC,KAAK,EACzB,SAAS,CAAC,SAAS,CAAC,MAAM,EAC1B,KAAK,EACL,KAAK,EACL,KAAK,CAAC,KAAK,CACZ,CAAC;YACF,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;SACnD;KACF;AACH,CAAC;AA9ID,4CA8IC","file":"update-cell.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\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 { updateCellContentWidth } from '../utils/text-icon-layout';\n\n/**\n * @description: 更新单个单元格宽度/高度\n * @return {*}\n */\nexport function updateCellLayout(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n width: number,\n height: number,\n detaX: number,\n detaY: number,\n isHeader: boolean,\n autoColWidth: boolean,\n autoRowHeight: boolean\n) {\n let cellGroup;\n let distWidth;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {\n // 更新横向merge cell width\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellWidth = mergeCell.attribute.width;\n mergeCell.setAttribute('width', mergeCellWidth + detaX);\n\n cellGroup = mergeCell;\n distWidth = mergeCell.attribute.width;\n } else if (mergeInfo && mergeInfo.start.row === row) {\n // 更新纵向merge cell width,只更新一次\n cell.setAttribute('width', width + detaX);\n\n cellGroup = cell;\n distWidth = width + detaX;\n } else if (!mergeInfo) {\n cell.setAttribute('width', width + detaX);\n cellGroup = cell;\n distWidth = width + detaX;\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n // 更新单元格布局\n\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n 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 );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateCellContentWidth(\n cell,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n\n // 处理自定义渲染\n const customContainer = cellGroup.getChildByName('custom-container') as Group;\n if (customContainer) {\n customContainer.clear();\n cellGroup.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellType(cellGroup.col, cellGroup.row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(cellGroup.col, cellGroup.row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(cellGroup.col, cellGroup.row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n cellGroup.col,\n cellGroup.row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n false,\n false,\n scene.table\n );\n cellGroup.appendChild(customResult.elementsGroup);\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/layout/update-cell.ts"],"names":[],"mappings":";;;AACA,wDAAuD;AAEvD,gDAAqD;AAErD,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAmE;AAMnE,SAAgB,gBAAgB,CAC9B,KAAiB,EACjB,IAAW,EACX,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,KAAa,EACb,KAAa,EACb,QAAiB,EACjB,YAAqB,EACrB,aAAsB;IAEtB,IAAI,SAAS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AQ,KAAK,MAAM,EAAE;gBACvB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;gBACzE,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;gBAC1C,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;aAC3C;iBAAM;gBACL,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;gBAC7E,YAAY,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,KAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;gBAChE,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC;aACrC;YACD,MAAM,YAAY,GAAG,IAAA,uBAAc,EACjC,YAAY,EACZ,YAAY,EACZ,SAAS,CAAC,GAAG,EACb,SAAS,CAAC,GAAG,EACb,SAAS,CAAC,SAAS,CAAC,KAAK,EACzB,SAAS,CAAC,SAAS,CAAC,MAAM,EAC1B,KAAK,EACL,KAAK,EACL,KAAK,CAAC,KAAK,CACZ,CAAC;YACF,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;SACnD;KACF;AACH,CAAC;AA/ID,4CA+IC","file":"update-cell.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\n\n/**\n * @description: 更新单个单元格宽度/高度\n * @return {*}\n */\nexport function updateCellLayout(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n width: number,\n height: number,\n detaX: number,\n detaY: number,\n isHeader: boolean,\n autoColWidth: boolean,\n autoRowHeight: boolean\n) {\n let cellGroup;\n let distWidth;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {\n // 更新横向merge cell width\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellWidth = mergeCell.attribute.width;\n mergeCell.setAttribute('width', mergeCellWidth + detaX);\n\n cellGroup = mergeCell;\n distWidth = mergeCell.attribute.width;\n } else if (mergeInfo && mergeInfo.start.row === row) {\n // 更新纵向merge cell width,只更新一次\n cell.setAttribute('width', width + detaX);\n\n cellGroup = cell;\n distWidth = width + detaX;\n } else if (!mergeInfo) {\n cell.setAttribute('width', width + detaX);\n cellGroup = cell;\n distWidth = width + detaX;\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n // 更新单元格布局\n\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n 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 // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateCellContentWidth(\n cell,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n\n // 处理自定义渲染\n const customContainer = cellGroup.getChildByName('custom-container') as Group;\n if (customContainer) {\n customContainer.clear();\n cellGroup.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellType(cellGroup.col, cellGroup.row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(cellGroup.col, cellGroup.row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(cellGroup.col, cellGroup.row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n cellGroup.col,\n cellGroup.row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n false,\n false,\n scene.table\n );\n cellGroup.appendChild(customResult.elementsGroup);\n }\n }\n}\n"]}
@@ -66,7 +66,7 @@ function updateCellHeight(scene, cell, col, row, distHeight, detaY, isHeader) {
66
66
  tableHelper_1.getStyleTheme)(headerStyle, scene.table, col, row, get_prop_1.getProp).theme);
67
67
  } else if ("image" === type || "video" === type) (0, image_cell_1.updateImageCellContentWhileResize)(cell, col, row, scene.table); else {
68
68
  const style = scene.table._getCellStyle(col, row);
69
- (0, text_icon_layout_1.updateCellContentHeight)(cell, distHeight, detaY, scene.table.internalProps.autoRowHeight, (0,
69
+ (0, text_icon_layout_1.updateCellContentHeight)(cell, distHeight, detaY, "autoHeight" === scene.table.heightMode, (0,
70
70
  padding_1.getQuadProps)(style.padding), style.textAlign, style.textBaseline);
71
71
  const customContainer = cell.getChildByName("custom-container");
72
72
  if (customContainer) {
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/layout/update-height.ts"],"names":[],"mappings":";;;AAEA,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAoE;AAEpE,gDAAqD;AACrD,sEAA0F;AAC1F,wDAAuD;AAEvD,SAAgB,eAAe,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAC3E,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,IAAA,iCAAgB,EAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1D,IAAI,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE;YAC5C,SAAS;SACV;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QAGrC,sBAAsB,CAAC,KAAK,EAAE,IAAI,EA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AM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;gBAC1C,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;aAC3C;iBAAM;gBACL,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBACzD,YAAY,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,KAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;gBAChE,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC;aACrC;YACD,MAAM,YAAY,GAAG,IAAA,uBAAc,EACjC,YAAY,EACZ,YAAY,EACZ,GAAG,EACH,GAAG,EACH,IAAI,CAAC,SAAS,CAAC,KAAK,EACpB,IAAI,CAAC,SAAS,CAAC,MAAM,EACrB,KAAK,EACL,KAAK,EACL,KAAK,CAAC,KAAK,CACZ,CAAC;YACF,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE;gBAC1B,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;aAChE;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;aAC9C;SACF;KACF;AACH,CAAC;AA7GD,4CA6GC","file":"update-height.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { Group } from '../graphic/group';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentHeight } from '../utils/text-icon-layout';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.start.col !== col) {\n continue;\n }\n const height = cell.attribute.height;\n // cell.setAttribute('height', height);\n // (cell.firstChild as Rect).setAttribute('height', cell.attribute.height);\n updateCellHeightForRow(scene, cell, col, row, height, detaY, scene.table.isHeader(col, row));\n\n scene.updateCellContentWhileResize(col, row);\n }\n\n let rowStart = 0;\n let rowEnd = 0;\n // 更新header 高度\n if (row < scene.table.columnHeaderLevelCount) {\n scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n scene.rowHeaderGroup.setAttribute('y', scene.colHeaderGroup.attribute.y + detaY);\n scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.columnHeaderLevelCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = scene.bodyRowEnd;\n }\n\n // 更新以下行位置\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n // if (rowIndex === 2) debugger;\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n const cellGroup = scene.getCell(colIndex, rowIndex);\n const mergeInfo = getCellMergeInfo(scene.table, colIndex, rowIndex);\n if (mergeInfo && (mergeInfo.start.col !== colIndex || mergeInfo.start.row !== rowIndex)) {\n continue;\n }\n\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n}\n\n/**\n * @description: 更新单个单元格高度\n * @return {*}\n */\nexport function updateCellHeightForRow(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n // autoRowHeight: boolean\n) {\n let cellGroup;\n let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col && mergeInfo.start.col === col) {\n // 更新横向merge cell height,只更新一次\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellheight = mergeCell.attribute.height;\n mergeCell.setAttribute('height', mergeCellheight + detaY);\n\n cellGroup = mergeCell;\n distHeight = mergeCell.attribute.height;\n } else if (mergeInfo) {\n // 更新纵向merge cell width\n cell.setAttribute('height', height + detaY);\n\n cellGroup = cell;\n distHeight = height + detaY;\n } else if (!mergeInfo) {\n cell.setAttribute('height', height + detaY);\n cellGroup = cell;\n distHeight = height + detaY;\n // cell.setTheme({\n // rect: {\n // height: cell.attribute.height,\n // },\n // });\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n updateCellHeight(scene, cellGroup, col, row, distHeight, detaY, isHeader);\n}\n\nexport function updateCellHeightForColumn(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n) {\n let cellGroup;\n // let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n if (row === mergeInfo.start.row) {\n // 初始化高度\n (cell as any)._tempHeight = height;\n return;\n } else if (row === mergeInfo.end.row) {\n cell.setAttribute('height', (cell as any)._tempHeight + height);\n cellGroup = cell;\n height = cell.attribute.height;\n // updateCellHeight(scene, cellGroup, col, row, cell.attribute.height, 0, isHeader);\n } else {\n // 累加高度\n (cell as any)._tempHeight += height;\n return;\n }\n } else if (mergeInfo) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n cell.setAttribute('height', height);\n cellGroup = cell;\n\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('height', cell.attribute.height);\n } else {\n cell.setAttribute('height', height);\n cellGroup = cell;\n }\n updateCellHeight(scene, cellGroup, col, row, height, 0, isHeader);\n}\n\nexport function updateCellHeight(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n distHeight: number,\n detaY: number,\n isHeader: boolean\n) {\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cell.attribute.width,\n // cell.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cell.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cell.insertBefore(newBarCell, oldBarCell);\n cell.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cell.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cell,\n cell.parent,\n cell.attribute.x,\n cell.attribute.y,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, scene.table);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateCellContentHeight(\n cell,\n distHeight,\n detaY,\n scene.table.internalProps.autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline\n );\n\n // 处理自定义渲染\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n customContainer.clear();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellType(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n false,\n false,\n scene.table\n );\n if (cell.childrenCount > 0) {\n cell.insertBefore(customResult.elementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customResult.elementsGroup);\n }\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/layout/update-height.ts"],"names":[],"mappings":";;;AAEA,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAoE;AAEpE,gDAAqD;AACrD,sEAA0F;AAC1F,wDAAuD;AAEvD,SAAgB,eAAe,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAC3E,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,IAAA,iCAAgB,EAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1D,IAAI,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK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M,EAAE;gBACvB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBACrD,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;gBAC1C,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,kBAAkB,CAAC;aAC3C;iBAAM;gBACL,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBACzD,YAAY,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,KAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;gBAChE,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC;aACrC;YACD,MAAM,YAAY,GAAG,IAAA,uBAAc,EACjC,YAAY,EACZ,YAAY,EACZ,GAAG,EACH,GAAG,EACH,IAAI,CAAC,SAAS,CAAC,KAAK,EACpB,IAAI,CAAC,SAAS,CAAC,MAAM,EACrB,KAAK,EACL,KAAK,EACL,KAAK,CAAC,KAAK,CACZ,CAAC;YACF,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE;gBAC1B,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;aAChE;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;aAC9C;SACF;KACF;AACH,CAAC;AA9GD,4CA8GC","file":"update-height.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { Group } from '../graphic/group';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentHeight } from '../utils/text-icon-layout';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { getStyleTheme } from '../../core/tableHelper';\n\nexport function updateRowHeight(scene: Scenegraph, row: number, detaY: number) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.getCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.start.col !== col) {\n continue;\n }\n const height = cell.attribute.height;\n // cell.setAttribute('height', height);\n // (cell.firstChild as Rect).setAttribute('height', cell.attribute.height);\n updateCellHeightForRow(scene, cell, col, row, height, detaY, scene.table.isHeader(col, row));\n\n scene.updateCellContentWhileResize(col, row);\n }\n\n let rowStart = 0;\n let rowEnd = 0;\n // 更新header 高度\n if (row < scene.table.columnHeaderLevelCount) {\n scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + detaY);\n scene.rowHeaderGroup.setAttribute('y', scene.colHeaderGroup.attribute.y + detaY);\n scene.bodyGroup.setAttribute('y', scene.bodyGroup.attribute.y + detaY);\n\n rowStart = row + 1;\n rowEnd = scene.table.columnHeaderLevelCount - 1;\n } else {\n rowStart = row + 1;\n // rowEnd = scene.table.rowCount - 1;\n rowEnd = scene.bodyRowEnd;\n }\n\n // 更新以下行位置\n for (let rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {\n // if (rowIndex === 2) debugger;\n for (let colIndex = 0; colIndex < scene.table.colCount; colIndex++) {\n const cellGroup = scene.getCell(colIndex, rowIndex);\n const mergeInfo = getCellMergeInfo(scene.table, colIndex, rowIndex);\n if (mergeInfo && (mergeInfo.start.col !== colIndex || mergeInfo.start.row !== rowIndex)) {\n continue;\n }\n\n cellGroup.setAttribute('y', cellGroup.attribute.y + detaY);\n }\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);\n}\n\n/**\n * @description: 更新单个单元格高度\n * @return {*}\n */\nexport function updateCellHeightForRow(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n // autoRowHeight: boolean\n) {\n let cellGroup;\n let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col && mergeInfo.start.col === col) {\n // 更新横向merge cell height,只更新一次\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellheight = mergeCell.attribute.height;\n mergeCell.setAttribute('height', mergeCellheight + detaY);\n\n cellGroup = mergeCell;\n distHeight = mergeCell.attribute.height;\n } else if (mergeInfo) {\n // 更新纵向merge cell width\n cell.setAttribute('height', height + detaY);\n\n cellGroup = cell;\n distHeight = height + detaY;\n } else if (!mergeInfo) {\n cell.setAttribute('height', height + detaY);\n cellGroup = cell;\n distHeight = height + detaY;\n // cell.setTheme({\n // rect: {\n // height: cell.attribute.height,\n // },\n // });\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return;\n }\n\n updateCellHeight(scene, cellGroup, col, row, distHeight, detaY, isHeader);\n}\n\nexport function updateCellHeightForColumn(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n height: number,\n detaY: number,\n isHeader: boolean\n) {\n let cellGroup;\n // let distHeight;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n if (row === mergeInfo.start.row) {\n // 初始化高度\n (cell as any)._tempHeight = height;\n return;\n } else if (row === mergeInfo.end.row) {\n cell.setAttribute('height', (cell as any)._tempHeight + height);\n cellGroup = cell;\n height = cell.attribute.height;\n // updateCellHeight(scene, cellGroup, col, row, cell.attribute.height, 0, isHeader);\n } else {\n // 累加高度\n (cell as any)._tempHeight += height;\n return;\n }\n } else if (mergeInfo) {\n cell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n cell.setAttribute('height', height);\n cellGroup = cell;\n\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('height', cell.attribute.height);\n } else {\n cell.setAttribute('height', height);\n cellGroup = cell;\n }\n updateCellHeight(scene, cellGroup, col, row, height, 0, isHeader);\n}\n\nexport function updateCellHeight(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n distHeight: number,\n detaY: number,\n isHeader: boolean\n) {\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cell.attribute.width,\n // cell.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cell.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cell.insertBefore(newBarCell, oldBarCell);\n cell.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cell.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cell,\n cell.parent,\n cell.attribute.x,\n cell.attribute.y,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n updateImageCellContentWhileResize(cell, col, row, scene.table);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n updateCellContentHeight(\n cell,\n distHeight,\n detaY,\n // scene.table.internalProps.autoRowHeight,\n scene.table.heightMode === 'autoHeight',\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline\n );\n\n // 处理自定义渲染\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n customContainer.clear();\n cell.removeChild(customContainer);\n\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellType(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = define?.customRender || scene.table.customRender;\n customLayout = define?.customLayout;\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cell.attribute.width,\n cell.attribute.height,\n false,\n false,\n scene.table\n );\n if (cell.childrenCount > 0) {\n cell.insertBefore(customResult.elementsGroup, cell.firstChild);\n } else {\n cell.appendChild(customResult.elementsGroup);\n }\n }\n }\n}\n"]}
@@ -68,7 +68,7 @@ function resetRowNumberAndY(scene) {
68
68
  for (let col = 0; col < scene.table.colCount; col++) {
69
69
  const headerColGroup = scene.getColGroup(col, !0), colGroup = scene.getColGroup(col, !1);
70
70
  let rowIndex = null === (_a = headerColGroup.firstChild) || void 0 === _a ? void 0 : _a.row, y = 0;
71
- rowIndex = null === (_b = colGroup.firstChild) || void 0 === _b ? void 0 : _b.row,
71
+ rowIndex = null === (_b = colGroup.firstChild) || void 0 === _b ? void 0 : _b.row;
72
72
  y = 0, colGroup.forEachChildren((cellGroup => {
73
73
  cellGroup.row = rowIndex, rowIndex++, "cell" === cellGroup.role && (cellGroup.setAttribute("y", y),
74
74
  y += cellGroup.attribute.height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c,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC7G,CAAC","file":"update-row.js","sourcesContent":["import type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(removeCells: CellAddress[], addCells: CellAddress[], table: BaseTableAPI) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => a - b);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n // add cells\n addRows.forEach(row => {\n addRow(row, scene);\n });\n\n // reset attribute y and row number in CellGroup\n resetRowNumberAndY(scene);\n}\n\nfunction removeRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.removeChild(cellGroup);\n }\n }\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n const cellGroup = updateCell(col, row, scene.table, true);\n\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.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n let cellBefore;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.row === row) {\n cellBefore = cellGroup;\n return true;\n }\n return false;\n });\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\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\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\nfunction resetRowNumber(scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n headerColGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n rowIndex = (colGroup.firstChild as Group)?.row;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n let y = 0;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // if (cellGroup.role !== 'cell') {\n // return;\n // }\n // cellGroup.setAttribute('y', y);\n // y+= cellGroup.attribute.height;\n // });\n rowIndex = (colGroup.firstChild as Group)?.row;\n y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n\n // update table size\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/layout/update-row.ts"],"names":[],"mappings":";;;AAGA,8DAA0D;AAM1D,SAAgB,SAAS,CAAC,WAA0B,EAAE,QAAuB,EAAE,KAAmB;IAChG,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAGpF,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACvB,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,IAAI,UAAU,CAAC,MAAM,EAAE;QACrB,cAAc,CAAC,KAAK,CAAC,CAAC;KACvB;IAGD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACpB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IAGH,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAtBD,8BAsBC;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K,MAAM,EAAE;gBAC7B,OAAO;aACR;YACD,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAC/B,CAAC,IAAI,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;QAClC,CAAC,CAAC,CAAC;QACH,cAAc,GAAG,CAAC,CAAC;KAOpB;IAGD,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC7G,CAAC","file":"update-row.js","sourcesContent":["import type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(removeCells: CellAddress[], addCells: CellAddress[], table: BaseTableAPI) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => a - b);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n // add cells\n addRows.forEach(row => {\n addRow(row, scene);\n });\n\n // reset attribute y and row number in CellGroup\n resetRowNumberAndY(scene);\n}\n\nfunction removeRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.removeChild(cellGroup);\n }\n }\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n const cellGroup = updateCell(col, row, scene.table, true);\n\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.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n let cellBefore;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.row === row) {\n cellBefore = cellGroup;\n return true;\n }\n return false;\n });\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\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\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\nfunction resetRowNumber(scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n headerColGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n rowIndex = (colGroup.firstChild as Group)?.row;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n let y = 0;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // if (cellGroup.role !== 'cell') {\n // return;\n // }\n // cellGroup.setAttribute('y', y);\n // y+= cellGroup.attribute.height;\n // });\n rowIndex = (colGroup.firstChild as Group)?.row;\n const rowStart = rowIndex;\n y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n\n // const rowCount = rowIndex - rowStart;\n // if (col === 0 && scene.proxy.rowEnd - scene.proxy.rowStart + 1 !== rowCount) {\n // scene.proxy.rowEnd = scene.proxy.rowStart + rowCount - 1;\n // scene.proxy.referenceRow = scene.proxy.rowStart + Math.floor((scene.proxy.rowEnd - scene.proxy.rowStart) / 2);\n // }\n }\n\n // update table size\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n}\n"]}
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.updateColWidth = void 0;
6
6
 
7
- const tableHelper_1 = require("../../core/tableHelper"), image_cell_1 = require("../group-creater/cell-type/image-cell"), progress_bar_cell_1 = require("../group-creater/cell-type/progress-bar-cell"), spark_line_cell_1 = require("../group-creater/cell-type/spark-line-cell"), get_cell_merge_1 = require("../utils/get-cell-merge"), get_prop_1 = require("../utils/get-prop"), padding_1 = require("../utils/padding"), text_icon_layout_1 = require("../utils/text-icon-layout"), update_height_1 = require("./update-height");
7
+ const axis_1 = require("../../components/axis/axis"), tableHelper_1 = require("../../core/tableHelper"), image_cell_1 = require("../group-creater/cell-type/image-cell"), progress_bar_cell_1 = require("../group-creater/cell-type/progress-bar-cell"), spark_line_cell_1 = require("../group-creater/cell-type/spark-line-cell"), get_cell_merge_1 = require("../utils/get-cell-merge"), get_prop_1 = require("../utils/get-prop"), padding_1 = require("../utils/padding"), text_icon_layout_1 = require("../utils/text-icon-layout"), update_height_1 = require("./update-height");
8
8
 
9
9
  function updateColWidth(scene, col, detaX) {
10
- const {autoRowHeight: autoRowHeight} = scene.table.internalProps;
10
+ const autoRowHeight = "autoHeight" === scene.table.heightMode;
11
11
  let needRerangeRow = !1;
12
12
  const colOrCornerHeaderColumn = scene.getColGroup(col, !0), oldColOrCornerHeaderColumnWidth = null == colOrCornerHeaderColumn ? void 0 : colOrCornerHeaderColumn.attribute.width;
13
13
  if (null == colOrCornerHeaderColumn || colOrCornerHeaderColumn.setAttribute("width", oldColOrCornerHeaderColumnWidth + detaX),
@@ -48,6 +48,28 @@ function updateColWidth(scene, col, detaX) {
48
48
  }
49
49
  scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
50
50
  }
51
+ const bottomColumn = scene.getColGroupInBottom(col);
52
+ if (bottomColumn) {
53
+ const oldBottomColumnWidth = bottomColumn.attribute.width;
54
+ if (null == bottomColumn || bottomColumn.setAttribute("width", oldBottomColumnWidth + detaX),
55
+ null == bottomColumn || bottomColumn.forEachChildren(((cell, index) => {
56
+ if (updateCellWidth(scene, cell, cell.col, cell.row, oldBottomColumnWidth, detaX, col < scene.table.rowHeaderLevelCount, autoRowHeight)) {
57
+ const mergeInfo = (0, get_cell_merge_1.getCellMergeInfo)(scene.table, cell.col, cell.row);
58
+ if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) resetRowHeight(scene, row); else resetRowHeight(scene, cell.row);
59
+ needRerangeRow = !0;
60
+ }
61
+ })), needRerangeRow) {
62
+ let newTotalHeight = 0;
63
+ for (let col = 0; col < scene.table.colCount; col++) {
64
+ const colGroup = scene.getColGroup(col, !1);
65
+ let y = 0;
66
+ colGroup.forEachChildren((cellGroup => {
67
+ "cell" === cellGroup.role && (cellGroup.setAttribute("y", y), y += cellGroup.attribute.height);
68
+ })), newTotalHeight = y;
69
+ }
70
+ scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
71
+ }
72
+ }
51
73
  col < scene.frozenColCount ? (scene.cornerHeaderGroup.forEachChildrenSkipChild(((column, index) => {
52
74
  column.col > col && column.setAttribute("x", column.attribute.x + detaX);
53
75
  })), scene.rowHeaderGroup.forEachChildrenSkipChild(((column, index) => {
@@ -56,6 +78,8 @@ function updateColWidth(scene, col, detaX) {
56
78
  column.col > col && column.setAttribute("x", column.attribute.x + detaX);
57
79
  })), scene.bodyGroup.forEachChildrenSkipChild(((column, index) => {
58
80
  column.col > col && column.setAttribute("x", column.attribute.x + detaX);
81
+ })), bottomColumn && scene.bottomFrozenGroup.forEachChildrenSkipChild(((column, index) => {
82
+ column.col > col && column.setAttribute("x", column.attribute.x + detaX);
59
83
  }))), scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, !0);
60
84
  }
61
85
 
@@ -84,7 +108,13 @@ function updateCellWidth(scene, cell, col, row, width, detaX, isHeader, autoRowH
84
108
  get_prop_1.getProp)("padding", headerStyle, col, row, scene.table));
85
109
  (0, spark_line_cell_1.createSparkLineCellGroup)(cellGroup, cellGroup.parent, cellGroup.attribute.x, cellGroup.attribute.y, col, row, cellGroup.attribute.width, cellGroup.attribute.height, padding, scene.table, (0,
86
110
  tableHelper_1.getStyleTheme)(headerStyle, scene.table, col, row, get_prop_1.getProp).theme);
87
- } else if ("image" === type || "video" === type) (0, image_cell_1.updateImageCellContentWhileResize)(cellGroup, col, row, scene.table); else {
111
+ } else if ("image" === type || "video" === type) (0, image_cell_1.updateImageCellContentWhileResize)(cellGroup, col, row, scene.table); else if ("axis" === cellGroup.firstChild.name) {
112
+ const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
113
+ if (axisConfig) {
114
+ const axis = new axis_1.CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, scene.table);
115
+ cellGroup.clear(), cellGroup.appendChild(axis.component), axis.overlap();
116
+ }
117
+ } else {
88
118
  const style = scene.table._getCellStyle(col, row);
89
119
  isHeightChange = (0, text_icon_layout_1.updateCellContentWidth)(cellGroup, distWidth, detaX, autoRowHeight, (0,
90
120
  padding_1.getQuadProps)(style.padding), style.textAlign, style.textBaseline, scene);