@visactor/vtable 0.9.1-alpha.4 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/cjs/ListTable.js +15 -4
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.d.ts +2 -1
  4. package/cjs/PivotTable.js +15 -3
  5. package/cjs/PivotTable.js.map +1 -1
  6. package/cjs/body-helper/body-helper.d.ts +1 -0
  7. package/cjs/body-helper/body-helper.js +6 -3
  8. package/cjs/body-helper/body-helper.js.map +1 -1
  9. package/cjs/body-helper/style/ProgressBarStyle.js +14 -8
  10. package/cjs/body-helper/style/ProgressBarStyle.js.map +1 -1
  11. package/cjs/body-helper/style/Style.d.ts +3 -0
  12. package/cjs/body-helper/style/Style.js +21 -14
  13. package/cjs/body-helper/style/Style.js.map +1 -1
  14. package/cjs/core/BaseTable.d.ts +4 -1
  15. package/cjs/core/BaseTable.js +31 -20
  16. package/cjs/core/BaseTable.js.map +1 -1
  17. package/cjs/core/tableHelper.js +11 -6
  18. package/cjs/core/tableHelper.js.map +1 -1
  19. package/cjs/data/DataSource.d.ts +4 -1
  20. package/cjs/data/DataSource.js +3 -3
  21. package/cjs/data/DataSource.js.map +1 -1
  22. package/cjs/event/event.d.ts +14 -19
  23. package/cjs/event/event.js +12 -329
  24. package/cjs/event/event.js.map +1 -1
  25. package/cjs/event/listener/container-dom.d.ts +2 -0
  26. package/cjs/event/listener/container-dom.js +42 -0
  27. package/cjs/event/listener/container-dom.js.map +1 -0
  28. package/cjs/event/listener/scroll-bar.d.ts +2 -0
  29. package/cjs/event/listener/scroll-bar.js +44 -0
  30. package/cjs/event/listener/scroll-bar.js.map +1 -0
  31. package/cjs/event/listener/table-group.d.ts +2 -0
  32. package/cjs/event/listener/table-group.js +262 -0
  33. package/cjs/event/listener/table-group.js.map +1 -0
  34. package/cjs/event/listener/touch.d.ts +2 -0
  35. package/cjs/event/listener/touch.js +76 -0
  36. package/cjs/event/listener/touch.js.map +1 -0
  37. package/cjs/event/scroll.d.ts +2 -0
  38. package/cjs/event/scroll.js +32 -4
  39. package/cjs/event/scroll.js.map +1 -1
  40. package/cjs/event/util.d.ts +16 -0
  41. package/cjs/event/util.js +30 -0
  42. package/cjs/event/util.js.map +1 -0
  43. package/cjs/header-helper/header-helper.d.ts +5 -6
  44. package/cjs/header-helper/header-helper.js +19 -22
  45. package/cjs/header-helper/header-helper.js.map +1 -1
  46. package/cjs/icons.js +11 -11
  47. package/cjs/icons.js.map +1 -1
  48. package/cjs/index.d.ts +1 -1
  49. package/cjs/index.js +1 -1
  50. package/cjs/index.js.map +1 -1
  51. package/cjs/layout/index.js +1 -2
  52. package/cjs/layout/pivot-header-layout.d.ts +4 -1
  53. package/cjs/layout/pivot-header-layout.js +15 -14
  54. package/cjs/layout/pivot-header-layout.js.map +1 -1
  55. package/cjs/layout/simple-header-layout.d.ts +13 -1
  56. package/cjs/layout/simple-header-layout.js +12 -1
  57. package/cjs/layout/simple-header-layout.js.map +1 -1
  58. package/cjs/render/layout/container.js +1 -1
  59. package/cjs/render/layout/container.js.map +1 -1
  60. package/cjs/render/layout/element.d.ts +1 -1
  61. package/cjs/render/layout/element.js.map +1 -1
  62. package/cjs/render/layout/rect.d.ts +2 -2
  63. package/cjs/render/layout/rect.js +2 -2
  64. package/cjs/render/layout/rect.js.map +1 -1
  65. package/cjs/scenegraph/component/custom.js +18 -7
  66. package/cjs/scenegraph/component/custom.js.map +1 -1
  67. package/cjs/scenegraph/component/menu.js +2 -2
  68. package/cjs/scenegraph/component/menu.js.map +1 -1
  69. package/cjs/scenegraph/component/table-component.d.ts +3 -3
  70. package/cjs/scenegraph/component/table-component.js +36 -26
  71. package/cjs/scenegraph/component/table-component.js.map +1 -1
  72. package/cjs/scenegraph/graphic/chart.d.ts +1 -0
  73. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  74. package/cjs/scenegraph/graphic/contributions/chart-render.js +7 -2
  75. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  76. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  77. package/cjs/scenegraph/graphic/group.d.ts +4 -0
  78. package/cjs/scenegraph/graphic/group.js +6 -0
  79. package/cjs/scenegraph/graphic/group.js.map +1 -1
  80. package/cjs/scenegraph/graphic/text.js +7 -7
  81. package/cjs/scenegraph/graphic/text.js.map +1 -1
  82. package/cjs/scenegraph/group-creater/cell-helper.d.ts +3 -4
  83. package/cjs/scenegraph/group-creater/cell-helper.js +25 -18
  84. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  85. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +6 -4
  86. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  87. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +11 -1
  88. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  89. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +12 -9
  90. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  91. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
  92. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +7 -4
  93. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  94. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  95. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  96. package/cjs/scenegraph/group-creater/column-helper.d.ts +3 -3
  97. package/cjs/scenegraph/group-creater/column-helper.js +22 -11
  98. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  99. package/cjs/scenegraph/group-creater/column.d.ts +0 -6
  100. package/cjs/scenegraph/group-creater/column.js +3 -12
  101. package/cjs/scenegraph/group-creater/column.js.map +1 -1
  102. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +0 -2
  103. package/cjs/scenegraph/group-creater/progress/proxy.js +23 -19
  104. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  105. package/cjs/scenegraph/layout/auto-height.js +1 -1
  106. package/cjs/scenegraph/layout/auto-height.js.map +1 -1
  107. package/cjs/scenegraph/layout/auto-width.js +1 -1
  108. package/cjs/scenegraph/layout/auto-width.js.map +1 -1
  109. package/cjs/scenegraph/layout/compute-col-width.d.ts +1 -1
  110. package/cjs/scenegraph/layout/compute-col-width.js +28 -8
  111. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  112. package/cjs/scenegraph/layout/frozen.d.ts +3 -0
  113. package/cjs/scenegraph/layout/frozen.js +66 -0
  114. package/cjs/scenegraph/layout/frozen.js.map +1 -0
  115. package/cjs/scenegraph/layout/move-cell.js +5 -1
  116. package/cjs/scenegraph/layout/move-cell.js.map +1 -1
  117. package/cjs/scenegraph/layout/update-cell.js +3 -3
  118. package/cjs/scenegraph/layout/update-cell.js.map +1 -1
  119. package/cjs/scenegraph/layout/update-height.js +4 -4
  120. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  121. package/cjs/scenegraph/layout/update-row.d.ts +3 -0
  122. package/cjs/scenegraph/layout/update-row.js +81 -0
  123. package/cjs/scenegraph/layout/update-row.js.map +1 -0
  124. package/cjs/scenegraph/layout/update-width.js +5 -5
  125. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  126. package/cjs/scenegraph/refresh-node/update-chart.d.ts +2 -0
  127. package/cjs/scenegraph/refresh-node/update-chart.js +26 -0
  128. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -0
  129. package/cjs/scenegraph/scenegraph.d.ts +15 -3
  130. package/cjs/scenegraph/scenegraph.js +86 -95
  131. package/cjs/scenegraph/scenegraph.js.map +1 -1
  132. package/cjs/scenegraph/select/create-select-border.js +1 -0
  133. package/cjs/scenegraph/select/create-select-border.js.map +1 -1
  134. package/cjs/scenegraph/stick-text/index.js +52 -40
  135. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  136. package/cjs/scenegraph/style/frame-border.d.ts +1 -1
  137. package/cjs/scenegraph/style/frame-border.js +7 -7
  138. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  139. package/cjs/scenegraph/utils/deal-promise-data.d.ts +2 -0
  140. package/cjs/scenegraph/utils/deal-promise-data.js +14 -0
  141. package/cjs/scenegraph/utils/deal-promise-data.js.map +1 -0
  142. package/cjs/scenegraph/utils/empty-group.d.ts +2 -0
  143. package/cjs/scenegraph/utils/empty-group.js +10 -0
  144. package/cjs/scenegraph/utils/empty-group.js.map +1 -0
  145. package/cjs/scenegraph/utils/get-hierarchy-offset.d.ts +2 -0
  146. package/cjs/scenegraph/utils/get-hierarchy-offset.js +27 -0
  147. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -0
  148. package/cjs/scenegraph/utils/padding.d.ts +1 -1
  149. package/cjs/scenegraph/utils/padding.js +3 -3
  150. package/cjs/scenegraph/utils/padding.js.map +1 -1
  151. package/cjs/scenegraph/utils/text-icon-layout.d.ts +3 -2
  152. package/cjs/scenegraph/utils/text-icon-layout.js +24 -19
  153. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  154. package/cjs/scenegraph/utils/text-pos.js +1 -1
  155. package/cjs/scenegraph/utils/text-pos.js.map +1 -1
  156. package/cjs/state/cell-move/adjust-header.js +9 -2
  157. package/cjs/state/cell-move/adjust-header.js.map +1 -1
  158. package/cjs/state/cell-move/index.js +9 -3
  159. package/cjs/state/cell-move/index.js.map +1 -1
  160. package/cjs/state/frozen/index.d.ts +2 -0
  161. package/cjs/state/{pin → frozen}/index.js +2 -2
  162. package/cjs/state/frozen/index.js.map +1 -0
  163. package/cjs/state/state.d.ts +1 -1
  164. package/cjs/state/state.js +16 -12
  165. package/cjs/state/state.js.map +1 -1
  166. package/cjs/themes/ARCO.js +1 -1
  167. package/cjs/themes/ARCO.js.map +1 -1
  168. package/cjs/themes/BRIGHT.js +1 -1
  169. package/cjs/themes/BRIGHT.js.map +1 -1
  170. package/cjs/themes/DARK.js +1 -1
  171. package/cjs/themes/DARK.js.map +1 -1
  172. package/cjs/themes/DEFAULT.js +1 -1
  173. package/cjs/themes/DEFAULT.js.map +1 -1
  174. package/cjs/themes/theme.d.ts +1 -1
  175. package/cjs/themes/theme.js +6 -6
  176. package/cjs/themes/theme.js.map +1 -1
  177. package/cjs/tools/LimitPromiseQueue.js +1 -2
  178. package/cjs/tools/NumberMap.js +1 -1
  179. package/cjs/tools/Rect.js +1 -1
  180. package/cjs/tools/calc.js +1 -1
  181. package/cjs/tools/debounce.js +1 -1
  182. package/cjs/tools/diff-cell.d.ts +10 -0
  183. package/cjs/tools/diff-cell.js +49 -0
  184. package/cjs/tools/diff-cell.js.map +1 -0
  185. package/cjs/tools/dom.js +1 -1
  186. package/cjs/tools/env.js +1 -1
  187. package/cjs/tools/helper.d.ts +11 -0
  188. package/cjs/tools/helper.js +7 -2
  189. package/cjs/tools/helper.js.map +1 -1
  190. package/cjs/tooltip/BaseTooltip.js +1 -1
  191. package/cjs/tooltip/Tooltip.js +2 -1
  192. package/cjs/tooltip/TooltipHandler.js +1 -1
  193. package/cjs/ts-types/base-table.d.ts +8 -2
  194. package/cjs/ts-types/base-table.js +1 -1
  195. package/cjs/ts-types/base-table.js.map +1 -1
  196. package/cjs/ts-types/common.js +1 -1
  197. package/cjs/ts-types/customElement.d.ts +11 -2
  198. package/cjs/ts-types/customElement.js +1 -1
  199. package/cjs/ts-types/customElement.js.map +1 -1
  200. package/cjs/ts-types/customLayout.js +1 -1
  201. package/cjs/ts-types/events.js +1 -1
  202. package/cjs/ts-types/icon.d.ts +4 -5
  203. package/cjs/ts-types/icon.js +6 -6
  204. package/cjs/ts-types/icon.js.map +1 -1
  205. package/cjs/ts-types/list-table/define/basic-define.d.ts +4 -1
  206. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
  207. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  208. package/cjs/ts-types/theme.d.ts +1 -1
  209. package/cjs/ts-types/theme.js.map +1 -1
  210. package/dist/vtable.es5.js +53155 -0
  211. package/dist/vtable.es5.min.js +3 -0
  212. package/dist/vtable.js +17155 -21633
  213. package/dist/vtable.min.js +15 -3
  214. package/es/ListTable.js +16 -3
  215. package/es/ListTable.js.map +1 -1
  216. package/es/PivotTable.d.ts +2 -1
  217. package/es/PivotTable.js +16 -2
  218. package/es/PivotTable.js.map +1 -1
  219. package/es/body-helper/body-helper.d.ts +1 -0
  220. package/es/body-helper/body-helper.js +6 -3
  221. package/es/body-helper/body-helper.js.map +1 -1
  222. package/es/body-helper/style/ProgressBarStyle.js +14 -8
  223. package/es/body-helper/style/ProgressBarStyle.js.map +1 -1
  224. package/es/body-helper/style/Style.d.ts +3 -0
  225. package/es/body-helper/style/Style.js +21 -14
  226. package/es/body-helper/style/Style.js.map +1 -1
  227. package/es/core/BaseTable.d.ts +4 -1
  228. package/es/core/BaseTable.js +31 -21
  229. package/es/core/BaseTable.js.map +1 -1
  230. package/es/core/tableHelper.js +11 -7
  231. package/es/core/tableHelper.js.map +1 -1
  232. package/es/data/DataSource.d.ts +4 -1
  233. package/es/data/DataSource.js +4 -2
  234. package/es/data/DataSource.js.map +1 -1
  235. package/es/event/event.d.ts +14 -19
  236. package/es/event/event.js +16 -333
  237. package/es/event/event.js.map +1 -1
  238. package/es/event/listener/container-dom.d.ts +2 -0
  239. package/es/event/listener/container-dom.js +40 -0
  240. package/es/event/listener/container-dom.js.map +1 -0
  241. package/es/event/listener/scroll-bar.d.ts +2 -0
  242. package/es/event/listener/scroll-bar.js +37 -0
  243. package/es/event/listener/scroll-bar.js.map +1 -0
  244. package/es/event/listener/table-group.d.ts +2 -0
  245. package/es/event/listener/table-group.js +265 -0
  246. package/es/event/listener/table-group.js.map +1 -0
  247. package/es/event/listener/touch.d.ts +2 -0
  248. package/es/event/listener/touch.js +67 -0
  249. package/es/event/listener/touch.js.map +1 -0
  250. package/es/event/scroll.d.ts +2 -0
  251. package/es/event/scroll.js +29 -3
  252. package/es/event/scroll.js.map +1 -1
  253. package/es/event/util.d.ts +16 -0
  254. package/es/event/util.js +24 -0
  255. package/es/event/util.js.map +1 -0
  256. package/es/header-helper/header-helper.d.ts +5 -6
  257. package/es/header-helper/header-helper.js +22 -24
  258. package/es/header-helper/header-helper.js.map +1 -1
  259. package/es/icons.js +11 -11
  260. package/es/icons.js.map +1 -1
  261. package/es/index.d.ts +1 -1
  262. package/es/index.js +1 -1
  263. package/es/index.js.map +1 -1
  264. package/es/layout/index.js +1 -2
  265. package/es/layout/pivot-header-layout.d.ts +4 -1
  266. package/es/layout/pivot-header-layout.js +17 -13
  267. package/es/layout/pivot-header-layout.js.map +1 -1
  268. package/es/layout/simple-header-layout.d.ts +13 -1
  269. package/es/layout/simple-header-layout.js +12 -1
  270. package/es/layout/simple-header-layout.js.map +1 -1
  271. package/es/render/layout/container.js +1 -1
  272. package/es/render/layout/container.js.map +1 -1
  273. package/es/render/layout/element.d.ts +1 -1
  274. package/es/render/layout/element.js.map +1 -1
  275. package/es/render/layout/rect.d.ts +2 -2
  276. package/es/render/layout/rect.js +2 -2
  277. package/es/render/layout/rect.js.map +1 -1
  278. package/es/scenegraph/component/custom.js +20 -9
  279. package/es/scenegraph/component/custom.js.map +1 -1
  280. package/es/scenegraph/component/menu.js +2 -2
  281. package/es/scenegraph/component/menu.js.map +1 -1
  282. package/es/scenegraph/component/table-component.d.ts +3 -3
  283. package/es/scenegraph/component/table-component.js +36 -26
  284. package/es/scenegraph/component/table-component.js.map +1 -1
  285. package/es/scenegraph/graphic/chart.d.ts +1 -0
  286. package/es/scenegraph/graphic/chart.js.map +1 -1
  287. package/es/scenegraph/graphic/contributions/chart-render.js +7 -2
  288. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  289. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  290. package/es/scenegraph/graphic/group.d.ts +4 -0
  291. package/es/scenegraph/graphic/group.js +6 -0
  292. package/es/scenegraph/graphic/group.js.map +1 -1
  293. package/es/scenegraph/graphic/text.js +7 -7
  294. package/es/scenegraph/graphic/text.js.map +1 -1
  295. package/es/scenegraph/group-creater/cell-helper.d.ts +3 -4
  296. package/es/scenegraph/group-creater/cell-helper.js +28 -17
  297. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  298. package/es/scenegraph/group-creater/cell-type/chart-cell.js +6 -4
  299. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  300. package/es/scenegraph/group-creater/cell-type/image-cell.js +12 -2
  301. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  302. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +13 -10
  303. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  304. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
  305. package/es/scenegraph/group-creater/cell-type/text-cell.js +7 -4
  306. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  307. package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  308. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  309. package/es/scenegraph/group-creater/column-helper.d.ts +3 -3
  310. package/es/scenegraph/group-creater/column-helper.js +25 -10
  311. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  312. package/es/scenegraph/group-creater/column.d.ts +0 -6
  313. package/es/scenegraph/group-creater/column.js +3 -12
  314. package/es/scenegraph/group-creater/column.js.map +1 -1
  315. package/es/scenegraph/group-creater/progress/proxy.d.ts +0 -2
  316. package/es/scenegraph/group-creater/progress/proxy.js +22 -21
  317. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  318. package/es/scenegraph/layout/auto-height.js +1 -1
  319. package/es/scenegraph/layout/auto-height.js.map +1 -1
  320. package/es/scenegraph/layout/auto-width.js +2 -2
  321. package/es/scenegraph/layout/auto-width.js.map +1 -1
  322. package/es/scenegraph/layout/compute-col-width.d.ts +1 -1
  323. package/es/scenegraph/layout/compute-col-width.js +30 -10
  324. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  325. package/es/scenegraph/layout/frozen.d.ts +3 -0
  326. package/es/scenegraph/layout/frozen.js +58 -0
  327. package/es/scenegraph/layout/frozen.js.map +1 -0
  328. package/es/scenegraph/layout/move-cell.js +5 -1
  329. package/es/scenegraph/layout/move-cell.js.map +1 -1
  330. package/es/scenegraph/layout/update-cell.js +4 -4
  331. package/es/scenegraph/layout/update-cell.js.map +1 -1
  332. package/es/scenegraph/layout/update-height.js +5 -5
  333. package/es/scenegraph/layout/update-height.js.map +1 -1
  334. package/es/scenegraph/layout/update-row.d.ts +3 -0
  335. package/es/scenegraph/layout/update-row.js +73 -0
  336. package/es/scenegraph/layout/update-row.js.map +1 -0
  337. package/es/scenegraph/layout/update-width.js +6 -6
  338. package/es/scenegraph/layout/update-width.js.map +1 -1
  339. package/es/scenegraph/refresh-node/update-chart.d.ts +2 -0
  340. package/es/scenegraph/refresh-node/update-chart.js +20 -0
  341. package/es/scenegraph/refresh-node/update-chart.js.map +1 -0
  342. package/es/scenegraph/scenegraph.d.ts +15 -3
  343. package/es/scenegraph/scenegraph.js +92 -94
  344. package/es/scenegraph/scenegraph.js.map +1 -1
  345. package/es/scenegraph/select/create-select-border.js +1 -0
  346. package/es/scenegraph/select/create-select-border.js.map +1 -1
  347. package/es/scenegraph/stick-text/index.js +52 -40
  348. package/es/scenegraph/stick-text/index.js.map +1 -1
  349. package/es/scenegraph/style/frame-border.d.ts +1 -1
  350. package/es/scenegraph/style/frame-border.js +9 -9
  351. package/es/scenegraph/style/frame-border.js.map +1 -1
  352. package/es/scenegraph/utils/deal-promise-data.d.ts +2 -0
  353. package/es/scenegraph/utils/deal-promise-data.js +8 -0
  354. package/es/scenegraph/utils/deal-promise-data.js.map +1 -0
  355. package/es/scenegraph/utils/empty-group.d.ts +2 -0
  356. package/es/scenegraph/utils/empty-group.js +6 -0
  357. package/es/scenegraph/utils/empty-group.js.map +1 -0
  358. package/es/scenegraph/utils/get-hierarchy-offset.d.ts +2 -0
  359. package/es/scenegraph/utils/get-hierarchy-offset.js +19 -0
  360. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -0
  361. package/es/scenegraph/utils/padding.d.ts +1 -1
  362. package/es/scenegraph/utils/padding.js +1 -1
  363. package/es/scenegraph/utils/padding.js.map +1 -1
  364. package/es/scenegraph/utils/text-icon-layout.d.ts +3 -2
  365. package/es/scenegraph/utils/text-icon-layout.js +27 -19
  366. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  367. package/es/scenegraph/utils/text-pos.js +2 -2
  368. package/es/scenegraph/utils/text-pos.js.map +1 -1
  369. package/es/state/cell-move/adjust-header.js +9 -2
  370. package/es/state/cell-move/adjust-header.js.map +1 -1
  371. package/es/state/cell-move/index.js +9 -3
  372. package/es/state/cell-move/index.js.map +1 -1
  373. package/es/state/frozen/index.d.ts +2 -0
  374. package/es/state/{pin → frozen}/index.js +1 -1
  375. package/es/state/frozen/index.js.map +1 -0
  376. package/es/state/state.d.ts +1 -1
  377. package/es/state/state.js +16 -12
  378. package/es/state/state.js.map +1 -1
  379. package/es/themes/ARCO.js +1 -1
  380. package/es/themes/ARCO.js.map +1 -1
  381. package/es/themes/BRIGHT.js +1 -1
  382. package/es/themes/BRIGHT.js.map +1 -1
  383. package/es/themes/DARK.js +1 -1
  384. package/es/themes/DARK.js.map +1 -1
  385. package/es/themes/DEFAULT.js +1 -1
  386. package/es/themes/DEFAULT.js.map +1 -1
  387. package/es/themes/theme.d.ts +1 -1
  388. package/es/themes/theme.js +6 -6
  389. package/es/themes/theme.js.map +1 -1
  390. package/es/tools/LimitPromiseQueue.js +1 -2
  391. package/es/tools/NumberMap.js +1 -1
  392. package/es/tools/Rect.js +1 -1
  393. package/es/tools/calc.js +1 -1
  394. package/es/tools/debounce.js +1 -1
  395. package/es/tools/diff-cell.d.ts +10 -0
  396. package/es/tools/diff-cell.js +42 -0
  397. package/es/tools/diff-cell.js.map +1 -0
  398. package/es/tools/dom.js +1 -1
  399. package/es/tools/env.js +1 -1
  400. package/es/tools/helper.d.ts +11 -0
  401. package/es/tools/helper.js +4 -0
  402. package/es/tools/helper.js.map +1 -1
  403. package/es/tooltip/BaseTooltip.js +1 -1
  404. package/es/tooltip/Tooltip.js +2 -1
  405. package/es/tooltip/TooltipHandler.js +1 -1
  406. package/es/ts-types/base-table.d.ts +8 -2
  407. package/es/ts-types/base-table.js +1 -1
  408. package/es/ts-types/base-table.js.map +1 -1
  409. package/es/ts-types/common.js +1 -1
  410. package/es/ts-types/customElement.d.ts +11 -2
  411. package/es/ts-types/customElement.js +1 -1
  412. package/es/ts-types/customElement.js.map +1 -1
  413. package/es/ts-types/customLayout.js +1 -1
  414. package/es/ts-types/events.js +1 -1
  415. package/es/ts-types/icon.d.ts +4 -5
  416. package/es/ts-types/icon.js +6 -6
  417. package/es/ts-types/icon.js.map +1 -1
  418. package/es/ts-types/list-table/define/basic-define.d.ts +4 -1
  419. package/es/ts-types/list-table/define/basic-define.js.map +1 -1
  420. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  421. package/es/ts-types/theme.d.ts +1 -1
  422. package/es/ts-types/theme.js.map +1 -1
  423. package/package.json +9 -9
  424. package/cjs/scenegraph/component/menu.d.ts +0 -41
  425. package/cjs/scenegraph/graphic/text.d.ts +0 -16
  426. package/cjs/state/pin/index.d.ts +0 -2
  427. package/cjs/state/pin/index.js.map +0 -1
  428. package/es/scenegraph/component/menu.d.ts +0 -41
  429. package/es/scenegraph/graphic/text.d.ts +0 -16
  430. package/es/state/pin/index.d.ts +0 -2
  431. package/es/state/pin/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/group-creater/cell-type/video-cell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAA4D;AAC5D,sDAAwC;AACxC,+CAA4C;AAC5C,qEAAwE;AACxE,6CAA0C;AAC1C,mDAAyD;AACzD,6CAAkD;AAClD,mDAAkE;AAClE,8CAA8C;AAC9C,2CAA2C;AAG3C,MAAM,UAAU,GAAG,KAAK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,EAAE,OAAO,CAAC,CAAC,CAAC;QACb,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QACb,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;QACtC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;QACxC,KAAK,EAAE,KAAY;QACnB,MAAM,EAAE,SAAmB;KAC5B,CAAC,CAAC;IACH,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC;IACrB,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAE7B,OAAO,SAAS,CAAC;AACnB,CAAC;AAlID,oDAkIC","file":"video-cell.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { Cursor, IImage, IThemeSpec } from '@visactor/vrender';\nimport { createRect, createImage } from '@visactor/vrender';\nimport * as icons from '../../../icons';\nimport { Group } from '../../graphic/group';\nimport { calcKeepAspectRatioSize } from '../../utils/keep-aspect-ratio';\nimport { Icon } from '../../graphic/icon';\nimport { calcStartPosition } from '../../utils/cell-pos';\nimport { _adjustWidthHeight } from './image-cell';\nimport { getFunctionalProp, getProp } from '../../utils/get-prop';\nimport { isValid } from '../../../tools/util';\nimport { getCellTheme } from './text-cell';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\n\nconst regedIcons = icons.get();\n\nexport function createVideoCellGroup(\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n keepAspectRatio: boolean,\n imageAutoSizing: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme?: IThemeSpec\n) {\n cellTheme = getCellTheme(table, col, row, cellTheme);\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n // const margin = getProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n if (cellTheme?.text?.textAlign) {\n textAlign = cellTheme?.text?.textAlign;\n }\n if (cellTheme?.text?.textBaseline) {\n textBaseline = cellTheme?.text?.textBaseline;\n }\n\n // cell\n const cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n // childrenPickable: false,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup.addChild(cellGroup);\n\n // video\n const value = table.getCellValue(col, row);\n const video = document.createElement('video');\n video.addEventListener('loadeddata', (): void => {\n if (imageAutoSizing) {\n _adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, table.scenegraph, padding);\n }\n const width = cellGroup.attribute.width;\n const height = cellGroup.attribute.height;\n // 更新宽高\n if (keepAspectRatio) {\n const { width: videoWidth, height: videoHeight } = calcKeepAspectRatioSize(\n video.videoWidth,\n video.videoHeight,\n width - padding[1] - padding[3],\n height - padding[0] - padding[2]\n );\n const pos = calcStartPosition(0, 0, width, height, videoWidth, videoHeight, textAlign, textBaseline, padding);\n\n image.setAttributes({\n width: videoWidth,\n height: videoHeight,\n x: pos.x,\n y: pos.y\n });\n } else {\n image.setAttributes({\n x: padding[3],\n y: padding[0],\n width: width - padding[1] - padding[3],\n height: height - padding[2] - padding[0]\n });\n }\n\n const left = 0;\n const top = 0;\n // 播放按钮\n const iconSize = Math.floor(Math.min(width - padding[1] - padding[3], height - padding[2] - padding[0]) / 2);\n const anchorX =\n left + (width > image.attribute.width ? image.attribute.x - left + image.attribute.width / 2 : width / 2);\n const anchorY =\n top + (height > image.attribute.height ? image.attribute.y - top + image.attribute.height / 2 : height / 2);\n\n const playIcon: Icon = new Icon({\n x: anchorX - iconSize / 2,\n y: anchorY - iconSize / 2,\n width: iconSize,\n height: iconSize,\n image: (regedIcons.play as any).svg,\n cursor: (regedIcons.play as any).cursor\n });\n playIcon.role = 'play-icon';\n cellGroup.appendChild(playIcon);\n // 触发重绘\n table.scenegraph.updateNextFrame();\n });\n video.onerror = (): void => {\n // image.setAttribute('image', (regedIcons.damage_pic as any).svg);\n (image as any).image = (regedIcons.damage_pic as any).svg;\n };\n video.src = value;\n video.setAttribute('preload', 'auto');\n\n const image: IImage = createImage({\n x: padding[3],\n y: padding[0],\n width: width - padding[1] - padding[3],\n height: height - padding[2] - padding[0],\n image: video as any,\n cursor: 'pointer' as Cursor\n });\n image.name = 'image';\n cellGroup.appendChild(image);\n\n return cellGroup;\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/group-creater/cell-type/video-cell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAA4D;AAC5D,sDAAwC;AACxC,+CAA4C;AAC5C,qEAAwE;AACxE,6CAA0C;AAC1C,mDAAyD;AACzD,6CAAkD;AAClD,mDAAkE;AAClE,8CAA8C;AAC9C,2CAA2C;AAG3C,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;AAE/B,SAAgB,oBAAoB,CAClC,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,eAAwB,EACxB,eAAwB,EACxB,OAAyC,EACzC,SAA0B,EAC1B,YAAgC,EAChC,KAAmB,EACnB,SAAsB;;IAEtB,SAAS,GAAG,IAAA,wBAAY,EAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IACrD,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAA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,KAAK,CAAC,CAAC;IAE7B,OAAO,SAAS,CAAC;AACnB,CAAC;AAlID,oDAkIC","file":"video-cell.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { Cursor, IImage, IThemeSpec } from '@visactor/vrender';\nimport { createRect, createImage } from '@visactor/vrender';\nimport * as icons from '../../../icons';\nimport { Group } from '../../graphic/group';\nimport { calcKeepAspectRatioSize } from '../../utils/keep-aspect-ratio';\nimport { Icon } from '../../graphic/icon';\nimport { calcStartPosition } from '../../utils/cell-pos';\nimport { _adjustWidthHeight } from './image-cell';\nimport { getFunctionalProp, getProp } from '../../utils/get-prop';\nimport { isValid } from '../../../tools/util';\nimport { getCellTheme } from './text-cell';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\n\nconst regedIcons = icons.get();\n\nexport function createVideoCellGroup(\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n keepAspectRatio: boolean,\n imageAutoSizing: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme?: IThemeSpec\n) {\n cellTheme = getCellTheme(table, col, row, cellTheme);\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n // const margin = getProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n if (cellTheme?.text?.textAlign) {\n textAlign = cellTheme?.text?.textAlign;\n }\n if (cellTheme?.text?.textBaseline) {\n textBaseline = cellTheme?.text?.textBaseline;\n }\n\n // cell\n const cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n // childrenPickable: false,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup.addChild(cellGroup);\n\n // video\n const value = table.getCellValue(col, row);\n const video = document.createElement('video');\n video.addEventListener('loadeddata', (): void => {\n if (imageAutoSizing) {\n _adjustWidthHeight(col, row, video.videoWidth, video.videoHeight, table.scenegraph, padding);\n }\n const width = cellGroup.attribute.width;\n const height = cellGroup.attribute.height;\n // 更新宽高\n if (keepAspectRatio) {\n const { width: videoWidth, height: videoHeight } = calcKeepAspectRatioSize(\n video.videoWidth,\n video.videoHeight,\n width - padding[1] - padding[3],\n height - padding[0] - padding[2]\n );\n const pos = calcStartPosition(0, 0, width, height, videoWidth, videoHeight, textAlign, textBaseline, padding);\n\n image.setAttributes({\n width: videoWidth,\n height: videoHeight,\n x: pos.x,\n y: pos.y\n });\n } else {\n image.setAttributes({\n x: padding[3],\n y: padding[0],\n width: width - padding[1] - padding[3],\n height: height - padding[2] - padding[0]\n });\n }\n\n const left = 0;\n const top = 0;\n // 播放按钮\n const iconSize = Math.floor(Math.min(width - padding[1] - padding[3], height - padding[2] - padding[0]) / 2);\n const anchorX =\n left + (width > image.attribute.width ? image.attribute.x - left + image.attribute.width / 2 : width / 2);\n const anchorY =\n top + (height > image.attribute.height ? image.attribute.y - top + image.attribute.height / 2 : height / 2);\n\n const playIcon: Icon = new Icon({\n x: anchorX - iconSize / 2,\n y: anchorY - iconSize / 2,\n width: iconSize,\n height: iconSize,\n image: (regedIcons.play as any).svg,\n cursor: (regedIcons.play as any).cursor\n });\n playIcon.name = 'play-icon';\n cellGroup.appendChild(playIcon);\n // 触发重绘\n table.scenegraph.updateNextFrame();\n });\n video.onerror = (): void => {\n // image.setAttribute('image', (regedIcons.damage_pic as any).svg);\n (image as any).image = (regedIcons.damage_pic as any).svg;\n };\n video.src = value;\n video.setAttribute('preload', 'auto');\n\n const image: IImage = createImage({\n x: padding[3],\n y: padding[0],\n width: width - padding[1] - padding[3],\n height: height - padding[2] - padding[0],\n image: video as any,\n cursor: 'pointer' as Cursor\n });\n image.name = 'image';\n cellGroup.appendChild(image);\n\n return cellGroup;\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  import type { IThemeSpec } from '@visactor/vrender';
2
- import type { CellType, ICustomLayout, ICustomRender } from '../../ts-types';
2
+ import type { CellType } from '../../ts-types';
3
3
  import { Group } from '../graphic/group';
4
- import type { MergeMap } from './column';
4
+ import type { MergeMap } from '../scenegraph';
5
5
  import type { BaseTableAPI } from '../../ts-types/base-table';
6
- export declare function createComplexColumn(columnGroup: Group, col: number, colWidth: number, rowStart: number, rowEnd: number, mergeMap: MergeMap, defaultRowHeight: number | number[], table: BaseTableAPI, cellType: CellType, rowLimit?: number, customRender?: ICustomRender, customLayout?: ICustomLayout): {
6
+ export declare function createComplexColumn(columnGroup: Group, col: number, colWidth: number, rowStart: number, rowEnd: number, mergeMap: MergeMap, defaultRowHeight: number | number[], table: BaseTableAPI, cellType: CellType, rowLimit?: number): {
7
7
  width: number;
8
8
  height: number;
9
9
  };
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.getColumnGroupTheme = exports.createComplexColumn = void 0;
6
6
 
7
- const group_1 = require("../graphic/group"), get_prop_1 = require("../utils/get-prop"), cell_helper_1 = require("./cell-helper"), tableHelper_1 = require("../../core/tableHelper");
7
+ const group_1 = require("../graphic/group"), get_prop_1 = require("../utils/get-prop"), cell_helper_1 = require("./cell-helper"), tableHelper_1 = require("../../core/tableHelper"), helper_1 = require("../../tools/helper"), deal_promise_data_1 = require("../utils/deal-promise-data");
8
8
 
9
- function createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, mergeMap, defaultRowHeight, table, cellType, rowLimit, customRender, customLayout) {
10
- var _a, _b, _c, _d, _e, _f;
9
+ function createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, mergeMap, defaultRowHeight, table, cellType, rowLimit) {
10
+ var _a, _b, _c, _d, _e;
11
11
  let padding, textAlign, textBaseline, maxWidth = 0, isfunctionalProps = !1;
12
12
  const useColumnTheme = (table.isListTable() && !table.scenegraph.transpose || table.isPivotTable() && table.internalProps.layoutMap.indicatorsAsCol) && "body" === cellType;
13
13
  if (useColumnTheme) if (columnGroup.childrenCount) {
@@ -30,9 +30,9 @@ function createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, merge
30
30
  mappingRule.bgColor && (bgColorFunc = mappingRule.bgColor.mapping);
31
31
  })));
32
32
  let y = 0;
33
- (null === (_f = columnGroup.lastChild) || void 0 === _f ? void 0 : _f.attribute) && (y = columnGroup.lastChild.attribute.y + columnGroup.lastChild.attribute.height);
33
+ columnGroup.colHeight && (y = columnGroup.colHeight);
34
34
  for (let j = rowStart; j <= rowEnd; j++) {
35
- const row = j, define = "body" !== cellType ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row), mayHaveIcon = "body" !== cellType || !!(null == define ? void 0 : define.icon);
35
+ const row = j, define = "body" !== cellType ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row), mayHaveIcon = "body" !== cellType || (!!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree));
36
36
  let cellTheme;
37
37
  if (!useColumnTheme) {
38
38
  const headerStyle = table._getCellStyle(col, row);
@@ -58,20 +58,31 @@ function createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, merge
58
58
  });
59
59
  }
60
60
  if (mergeResult) {
61
- const cellGroup = new group_1.Group({
61
+ const height = mergeResult.cellHeight / (range.end.row - range.start.row + 1), cellGroup = new group_1.Group({
62
62
  x: 0,
63
63
  y: y,
64
64
  width: 0,
65
- height: 0,
65
+ height: height,
66
66
  visible: !1,
67
67
  pickable: !1
68
68
  });
69
69
  cellGroup.role = "shadow-cell", cellGroup.col = col, cellGroup.row = row, cellGroup.mergeCol = range.start.col,
70
- cellGroup.mergeRow = range.start.row, columnGroup.addChild(cellGroup), range = table.getCellRange(col, row),
71
- y += mergeResult.cellHeight / (range.end.row - range.start.row + 1), maxWidth = Math.max(maxWidth, mergeResult.cellWidth);
70
+ cellGroup.mergeRow = range.start.row, columnGroup.addChild(cellGroup), columnGroup.updateColumnRowNumber(row),
71
+ columnGroup.updateColumnHeight(height), range = table.getCellRange(col, row), y += height,
72
+ maxWidth = Math.max(maxWidth, mergeResult.cellWidth);
72
73
  } else {
73
- const height = (0, cell_helper_1.createCell)(type, define, table, col, row, colWidth, bgColorFunc, customRender, customLayout, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, isfunctionalProps, isMerge, range, cellTheme).attribute.height;
74
- y += isMerge ? height / (range.end.row - range.start.row + 1) : height;
74
+ const value = table.getCellValue(col, row);
75
+ if ((0, helper_1.isPromise)(value)) {
76
+ (0, deal_promise_data_1.dealPromiseData)(value, table, cell_helper_1.createCell.bind(null, type, define, table, col, row, colWidth, bgColorFunc, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, isfunctionalProps, isMerge, range, cellTheme)),
77
+ columnGroup.updateColumnRowNumber(row);
78
+ const height = isMerge ? table.getRowHeight(row) / (range.end.row - range.start.row + 1) : table.getRowHeight(row);
79
+ columnGroup.updateColumnHeight(height), y += height;
80
+ } else {
81
+ const cellGroup = (0, cell_helper_1.createCell)(type, define, table, col, row, colWidth, bgColorFunc, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, isfunctionalProps, isMerge, range, cellTheme);
82
+ columnGroup.updateColumnRowNumber(row);
83
+ const height = isMerge ? cellGroup.attribute.height / (range.end.row - range.start.row + 1) : cellGroup.attribute.height;
84
+ columnGroup.updateColumnHeight(height), y += height;
85
+ }
75
86
  }
76
87
  if (rowLimit && row > rowLimit) break;
77
88
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/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AAC,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACrE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,IAAA,2BAAa,EAC3D,KAAK,EACL,KAAK,EACL,GAAG,EACH,KAAK,CAAC,sBAAsB,EAC5B,qBAAU,CACX,CAAC;IAGF,WAAW,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAC;IACnC,WAAW,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AACjD,CAAC;AAlBD,kDAkBC","file":"column-helper.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IThemeSpec } from '@visactor/vrender';\nimport type {\n CellType,\n FullExtendStyle,\n ICustomLayout,\n ICustomRender,\n MappingRule,\n TextColumnDefine\n} from '../../ts-types';\nimport { Group } from '../graphic/group';\nimport { getProp, getRawProp } from '../utils/get-prop';\nimport type { MergeMap } from './column';\nimport { getPadding } from '../utils/padding';\nimport { parseFont } from '../utils/font';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { createCell } from './cell-helper';\nimport type { BaseTableAPI, PivotTableProtected } from '../../ts-types/base-table';\nimport { getStyleTheme } from '../../core/tableHelper';\n/**\n * 创建复合列 同一列支持创建不同类型单元格\n * @param columnGroup 列Group\n * @param col\n * @param colWidth 配置列宽\n * @param rowStart\n * @param rowEnd\n * @param mergeMap merge单元格信息\n * @param defaultRowHeight\n * @param table\n * @param cellType\n * @param rowLimit\n * @param customRender\n * @param customLayout\n * @returns\n */\nexport function createComplexColumn(\n columnGroup: Group,\n col: number,\n colWidth: number,\n rowStart: number,\n rowEnd: number,\n mergeMap: MergeMap,\n defaultRowHeight: number | number[],\n table: BaseTableAPI,\n cellType: CellType,\n rowLimit?: number,\n customRender?: ICustomRender,\n customLayout?: ICustomLayout\n) {\n let maxWidth = 0;\n let padding;\n let textAlign;\n let textBaseline;\n let isfunctionalProps = false;\n /** useColumnTheme 判断是否可以使用columnTheme */\n const useColumnTheme =\n ((table.isListTable() && !table.scenegraph.transpose) ||\n (table.isPivotTable() && (table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)) &&\n cellType === 'body';\n\n if (useColumnTheme) {\n if (!columnGroup.childrenCount) {\n // 只在首屏生效\n const { theme: columnTheme, hasFunctionPros } = getColumnGroupTheme(col, colWidth, table);\n isfunctionalProps = hasFunctionPros;\n // get column header style\n if (columnTheme._vtable.padding) {\n padding = columnTheme._vtable.padding;\n }\n if (columnTheme.text.textAlign) {\n textAlign = columnTheme.text.textAlign;\n }\n if (columnTheme.text.textBaseline) {\n textBaseline = columnTheme.text.textBaseline;\n }\n columnGroup.setTheme(columnTheme);\n } else if (columnGroup.theme) {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { hasFunctionPros } = getStyleTheme(style, table, col, table.columnHeaderLevelCount, getRawProp, false);\n isfunctionalProps = hasFunctionPros;\n const columnTheme = columnGroup.theme.userTheme as any;\n // 渐进加载时获取\n if (columnTheme._vtable.padding) {\n padding = columnTheme._vtable.padding;\n }\n if (columnTheme.text.textAlign) {\n textAlign = columnTheme.text.textAlign;\n }\n if (columnTheme.text.textBaseline) {\n textBaseline = columnTheme.text.textBaseline;\n }\n }\n }\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && cellType === 'body') {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (mappingRule.bgColor) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n let y = 0;\n if ((columnGroup.lastChild as Group)?.attribute) {\n // 支持插入单元格\n y = (columnGroup.lastChild as Group).attribute.y + (columnGroup.lastChild as Group).attribute.height;\n }\n\n for (let j = rowStart; j <= rowEnd; j++) {\n const row = j;\n const define = cellType !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n const mayHaveIcon = cellType !== 'body' ? true : !!define?.icon;\n let cellTheme;\n if (!useColumnTheme) {\n const headerStyle = table._getCellStyle(col, row);\n cellTheme = getStyleTheme(headerStyle, table, col, row, getProp).theme;\n cellTheme.group.width = colWidth;\n cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight;\n if (cellTheme._vtable.padding) {\n padding = cellTheme._vtable.padding;\n }\n if (cellTheme.text.textAlign) {\n textAlign = cellTheme.text.textAlign;\n }\n if (cellTheme.text.textBaseline) {\n textBaseline = cellTheme.text.textBaseline;\n }\n }\n // margin = getProp('margin', headerStyle, col, 0, table)\n\n let cellGroup;\n let cellWidth = colWidth;\n let cellHeight = table.internalProps.autoRowHeight ? 0 : table.getRowHeight(row);\n const type =\n (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||\n 'text';\n // 处理单元格合并\n let mergeResult;\n let range;\n let isMerge;\n if (cellType !== 'body' || (define as TextColumnDefine)?.mergeCell) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n // 所有Merge单元格,只保留左上角一个真实的单元格,其他使用空Group占位\n if (isMerge) {\n cellWidth = 0;\n cellHeight = 0;\n mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);\n if (!mergeResult) {\n for (let col = range.start.col; col <= range.end.col; col++) {\n cellWidth += table.getColWidth(col);\n }\n\n // let cellHeight = 0;\n for (let i = range.start.row; i <= range.end.row; i++) {\n cellHeight += table.getRowHeight(i);\n }\n\n mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {\n x: 0,\n y,\n cellWidth,\n cellHeight\n });\n }\n }\n }\n\n // let cellWidth = 0;\n // let cellHeight = 0;\n if (mergeResult) {\n // 已有Merge单元格,使用空Group占位\n const cellGroup = new Group({\n x: 0,\n y,\n width: 0,\n height: 0,\n visible: false,\n pickable: false\n });\n cellGroup.role = 'shadow-cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.mergeCol = range.start.col;\n cellGroup.mergeRow = range.start.row;\n columnGroup.addChild(cellGroup);\n range = table.getCellRange(col, row);\n y += mergeResult.cellHeight / (range.end.row - range.start.row + 1);\n maxWidth = Math.max(maxWidth, mergeResult.cellWidth);\n } else {\n const cellGroup = createCell(\n type,\n define,\n table,\n col,\n row,\n colWidth,\n bgColorFunc,\n customRender,\n customLayout,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isfunctionalProps,\n isMerge,\n range,\n cellTheme\n );\n const height = cellGroup.attribute.height;\n y += isMerge ? height / (range.end.row - range.start.row + 1) : height;\n }\n if (rowLimit && row > rowLimit) {\n break;\n }\n }\n\n columnGroup.setAttribute('width', colWidth);\n return {\n width: colWidth,\n height: y\n };\n}\n\n/**\n * 获取列分组主题\n * @param col 列索引\n * @param colWidth 列宽\n * @param table 表格实例\n * @returns 列分组主题\n */\nexport function getColumnGroupTheme(\n col: number,\n colWidth: number,\n table: BaseTableAPI\n): { theme: IThemeSpec & { _vtable: any }; hasFunctionPros: boolean } {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { theme: columnTheme, hasFunctionPros } = getStyleTheme(\n style,\n table,\n col,\n table.columnHeaderLevelCount,\n getRawProp\n );\n\n // get column header style\n columnTheme.group.width = colWidth;\n columnTheme.group.height = 0;\n return { theme: columnTheme, hasFunctionPros };\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/group-creater/column-helper.ts"],"names":[],"mappings":";;;AAUA,4CAAyC;AACzC,gDAAwD;AAGxD,+CAA2C;AAE3C,wDAAuD;AACvD,+CAA+C;AAC/C,kEAA6D;AAiB7D,SAAgB,mBAAmB,CACjC,WAAkB,EAClB,GAA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K,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AACjD,CAAC;AAlBD,kDAkBC","file":"column-helper.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IThemeSpec } from '@visactor/vrender';\nimport type {\n CellType,\n FullExtendStyle,\n ICustomLayout,\n ICustomRender,\n MappingRule,\n TextColumnDefine\n} from '../../ts-types';\nimport { Group } from '../graphic/group';\nimport { getProp, getRawProp } from '../utils/get-prop';\nimport type { MergeMap } from '../scenegraph';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { createCell } from './cell-helper';\nimport type { BaseTableAPI, PivotTableProtected } from '../../ts-types/base-table';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\n/**\n * 创建复合列 同一列支持创建不同类型单元格\n * @param columnGroup 列Group\n * @param col\n * @param colWidth 配置列宽\n * @param rowStart\n * @param rowEnd\n * @param mergeMap merge单元格信息\n * @param defaultRowHeight\n * @param table\n * @param cellType\n * @param rowLimit\n * @param customRender\n * @param customLayout\n * @returns\n */\nexport function createComplexColumn(\n columnGroup: Group,\n col: number,\n colWidth: number,\n rowStart: number,\n rowEnd: number,\n mergeMap: MergeMap,\n defaultRowHeight: number | number[],\n table: BaseTableAPI,\n cellType: CellType,\n rowLimit?: number\n) {\n let maxWidth = 0;\n let padding;\n let textAlign;\n let textBaseline;\n let isfunctionalProps = false;\n /** useColumnTheme 判断是否可以使用columnTheme */\n const useColumnTheme =\n ((table.isListTable() && !table.scenegraph.transpose) ||\n (table.isPivotTable() && (table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)) &&\n cellType === 'body';\n\n if (useColumnTheme) {\n if (!columnGroup.childrenCount) {\n // 只在首屏生效\n const { theme: columnTheme, hasFunctionPros } = getColumnGroupTheme(col, colWidth, table);\n isfunctionalProps = hasFunctionPros;\n // get column header style\n if (columnTheme._vtable.padding) {\n padding = columnTheme._vtable.padding;\n }\n if (columnTheme.text.textAlign) {\n textAlign = columnTheme.text.textAlign;\n }\n if (columnTheme.text.textBaseline) {\n textBaseline = columnTheme.text.textBaseline;\n }\n columnGroup.setTheme(columnTheme);\n } else if (columnGroup.theme) {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { hasFunctionPros } = getStyleTheme(style, table, col, table.columnHeaderLevelCount, getRawProp, false);\n isfunctionalProps = hasFunctionPros;\n const columnTheme = columnGroup.theme.userTheme as any;\n // 渐进加载时获取\n if (columnTheme._vtable.padding) {\n padding = columnTheme._vtable.padding;\n }\n if (columnTheme.text.textAlign) {\n textAlign = columnTheme.text.textAlign;\n }\n if (columnTheme.text.textBaseline) {\n textBaseline = columnTheme.text.textBaseline;\n }\n }\n }\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && cellType === 'body') {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (mappingRule.bgColor) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n // insert cell into column group top\n let y = 0;\n if (columnGroup.colHeight) {\n // insert cell into column group bottom\n y = columnGroup.colHeight;\n }\n\n for (let j = rowStart; j <= rowEnd; j++) {\n const row = j;\n const define = cellType !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n const mayHaveIcon = cellType !== 'body' ? true : !!define?.icon || !!define?.tree;\n let cellTheme;\n if (!useColumnTheme) {\n const headerStyle = table._getCellStyle(col, row);\n cellTheme = getStyleTheme(headerStyle, table, col, row, getProp).theme;\n cellTheme.group.width = colWidth;\n cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight;\n if (cellTheme._vtable.padding) {\n padding = cellTheme._vtable.padding;\n }\n if (cellTheme.text.textAlign) {\n textAlign = cellTheme.text.textAlign;\n }\n if (cellTheme.text.textBaseline) {\n textBaseline = cellTheme.text.textBaseline;\n }\n }\n // margin = getProp('margin', headerStyle, col, 0, table)\n\n let cellGroup;\n let cellWidth = colWidth;\n let cellHeight = table.internalProps.autoRowHeight ? 0 : table.getRowHeight(row);\n const type =\n (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||\n 'text';\n // 处理单元格合并\n let mergeResult;\n let range;\n let isMerge;\n if (cellType !== 'body' || (define as TextColumnDefine)?.mergeCell) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n // 所有Merge单元格,只保留左上角一个真实的单元格,其他使用空Group占位\n if (isMerge) {\n cellWidth = 0;\n cellHeight = 0;\n mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);\n if (!mergeResult) {\n for (let col = range.start.col; col <= range.end.col; col++) {\n cellWidth += table.getColWidth(col);\n }\n\n // let cellHeight = 0;\n for (let i = range.start.row; i <= range.end.row; i++) {\n cellHeight += table.getRowHeight(i);\n }\n\n mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {\n x: 0,\n y,\n cellWidth,\n cellHeight\n });\n }\n }\n }\n\n // let cellWidth = 0;\n // let cellHeight = 0;\n if (mergeResult) {\n const height = mergeResult.cellHeight / (range.end.row - range.start.row + 1);\n // 已有Merge单元格,使用空Group占位\n const cellGroup = new Group({\n x: 0,\n y,\n width: 0,\n height,\n visible: false,\n pickable: false\n });\n cellGroup.role = 'shadow-cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.mergeCol = range.start.col;\n cellGroup.mergeRow = range.start.row;\n columnGroup.addChild(cellGroup);\n columnGroup.updateColumnRowNumber(row);\n columnGroup.updateColumnHeight(height);\n range = table.getCellRange(col, row);\n y += height;\n maxWidth = Math.max(maxWidth, mergeResult.cellWidth);\n } else {\n // deal with promise data\n const value = table.getCellValue(col, row);\n if (isPromise(value)) {\n dealPromiseData(\n value,\n table,\n createCell.bind(\n null,\n type,\n define,\n table,\n col,\n row,\n colWidth,\n bgColorFunc,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isfunctionalProps,\n isMerge,\n range,\n cellTheme\n )\n );\n columnGroup.updateColumnRowNumber(row);\n // const height = table.getRowHeight(row);\n const height = isMerge\n ? table.getRowHeight(row) / (range.end.row - range.start.row + 1)\n : table.getRowHeight(row);\n columnGroup.updateColumnHeight(height);\n y += height;\n } else {\n const cellGroup = createCell(\n type,\n define,\n table,\n col,\n row,\n colWidth,\n bgColorFunc,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n isfunctionalProps,\n isMerge,\n range,\n cellTheme\n );\n columnGroup.updateColumnRowNumber(row);\n // const height = cellGroup.attribute.height;\n const height = isMerge\n ? cellGroup.attribute.height / (range.end.row - range.start.row + 1)\n : cellGroup.attribute.height;\n columnGroup.updateColumnHeight(height);\n y += height;\n }\n }\n if (rowLimit && row > rowLimit) {\n break;\n }\n }\n\n columnGroup.setAttribute('width', colWidth);\n return {\n width: colWidth,\n height: y\n };\n}\n\n/**\n * 获取列分组主题\n * @param col 列索引\n * @param colWidth 列宽\n * @param table 表格实例\n * @returns 列分组主题\n */\nexport function getColumnGroupTheme(\n col: number,\n colWidth: number,\n table: BaseTableAPI\n): { theme: IThemeSpec & { _vtable: any }; hasFunctionPros: boolean } {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { theme: columnTheme, hasFunctionPros } = getStyleTheme(\n style,\n table,\n col,\n table.columnHeaderLevelCount,\n getRawProp\n );\n\n // get column header style\n columnTheme.group.width = colWidth;\n columnTheme.group.height = 0;\n return { theme: columnTheme, hasFunctionPros };\n}\n"]}
@@ -1,12 +1,6 @@
1
1
  import type { CellType } from '../../ts-types';
2
2
  import type { BaseTableAPI } from '../../ts-types/base-table';
3
3
  import { Group } from '../graphic/group';
4
- export type MergeMap = Map<string, {
5
- x: number;
6
- y: number;
7
- cellWidth: number;
8
- cellHeight: number;
9
- }>;
10
4
  export declare function createCornerHeaderColGroup(cornerHeaderGroup: Group, xOrigin: number, yOrigin: number, table: BaseTableAPI): void;
11
5
  export declare function createColHeaderColGroup(colHeaderGroup: Group, xOrigin: number, yOrigin: number, table: BaseTableAPI): void;
12
6
  export declare function createRowHeaderColGroup(rowHeaderGroup: Group, xOrigin: number, yOrigin: number, table: BaseTableAPI): void;
@@ -24,7 +24,7 @@ function createBodyColGroup(bodyGroup, xOrigin, yOrigin, table) {
24
24
 
25
25
  function createColGroup(containerGroup, xOrigin, yOrigin, colStart, colEnd, rowStart, rowEnd, cellType, table, rowLimit) {
26
26
  if (colStart > colEnd || rowStart > rowEnd) return;
27
- const {layoutMap: layoutMap, defaultRowHeight: defaultRowHeight, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth} = table.internalProps, mergeMap = new Map;
27
+ const {layoutMap: layoutMap, defaultRowHeight: defaultRowHeight, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth} = table.internalProps;
28
28
  let x = 0, heightMax = 0;
29
29
  for (let i = colStart; i <= colEnd; i++) {
30
30
  const col = i, colWidth = table.getColWidth(col), columnGroup = new group_1.Group({
@@ -35,17 +35,8 @@ function createColGroup(containerGroup, xOrigin, yOrigin, colStart, colEnd, rowS
35
35
  clip: !1,
36
36
  pickable: !1
37
37
  });
38
- let customRender, customLayout;
39
- if (columnGroup.role = "column", columnGroup.col = i, containerGroup.addChild(columnGroup),
40
- "body" !== cellType) {
41
- const define = table.getHeaderDefine(col, rowStart);
42
- customRender = null == define ? void 0 : define.headerCustomRender, customLayout = null == define ? void 0 : define.headerCustomLayout;
43
- } else {
44
- const define = table.getBodyColumnDefine(col, rowStart);
45
- customRender = (null == define ? void 0 : define.customRender) || table.customRender,
46
- customLayout = null == define ? void 0 : define.customLayout;
47
- }
48
- const {width: default2Width, height: default2Height} = (0, column_helper_1.createComplexColumn)(columnGroup, col, colWidth, rowStart, rowEnd, mergeMap, "columnHeader" === cellType && null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, table, cellType, rowLimit, customRender, customLayout);
38
+ columnGroup.role = "column", columnGroup.col = i, containerGroup.addChild(columnGroup);
39
+ const {width: default2Width, height: default2Height} = (0, column_helper_1.createComplexColumn)(columnGroup, col, colWidth, rowStart, rowEnd, table.scenegraph.mergeMap, "columnHeader" === cellType && null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, table, cellType, rowLimit);
49
40
  x += default2Width, heightMax = Math.max(heightMax, default2Height);
50
41
  }
51
42
  containerGroup.setAttribute("width", x), containerGroup.setAttribute("height", heightMax);
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/group-creater/column.ts"],"names":[],"mappings":";;;AAEA,4CAAyC;AACzC,mDAAsD;AAmBtD,SAAgB,0BAA0B,CACxC,iBAAwB,EACxB,OAAe,EACf,OAAe,EACf,KAAmB;IAEnB,cAAc,CACZ,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,CAAC,EACD,KAAK,CAAC,mBAAmB,GAAG,CAAC,EAC7B,CAAC,EACD,KAAK,CAAC,sBAAsB,GAAG,CAAC,EAChC,cAAc,EACd,KAAK,CACN,CAAC;AACJ,CAAC;AAjBD,gEAiBC;AAUD,SAAgB,uBAAuB,CAAC,cAAqB,EAAE,OAAe,EAAE,OAAe,EAAE,KAAmB;IAClH,cAAc,CACZ,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,QAAQ,GAAG,CAAC,EAClB,CAAC,EACD,KAAK,CAAC,sBAAsB,GAAG,CAAC,EAChC,cAAc,EACd,KAAK,CACN,CAAC;AACJ,CAAC;AAZD,0DAYC;AAUD,SAAgB,uBAAuB,CAAC,cAAqB,EAAE,OAAe,EAAE,OAAe,E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CAAC;QACnB,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;KACjD;IAED,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACxC,cAAc,CAAC,YAAY,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AACnD,CAAC;AA7ED,wCA6EC","file":"column.js","sourcesContent":["import type { CellType } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { createComplexColumn } from './column-helper';\n\nexport type MergeMap = Map<\n string,\n {\n x: number;\n y: number;\n cellWidth: number;\n cellHeight: number;\n }\n>;\n/**\n * @description: 处理全部角表头\n * @param {Group} colHeaderGroup 列表头容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createCornerHeaderColGroup(\n cornerHeaderGroup: Group,\n xOrigin: number,\n yOrigin: number,\n table: BaseTableAPI\n) {\n createColGroup(\n cornerHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.rowHeaderLevelCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'cornerHeader', // CellType\n table\n );\n}\n\n/**\n * @description: 处理全部列表头\n * @param {Group} colHeaderGroup 列表头容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createColHeaderColGroup(colHeaderGroup: Group, xOrigin: number, yOrigin: number, table: BaseTableAPI) {\n createColGroup(\n colHeaderGroup,\n xOrigin,\n yOrigin,\n table.rowHeaderLevelCount, // colStart\n table.colCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n table\n );\n}\n\n/**\n * @description: 处理全部行表头\n * @param {Group} rowHeaderGroup 行表头容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createRowHeaderColGroup(rowHeaderGroup: Group, xOrigin: number, yOrigin: number, table: BaseTableAPI) {\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.rowHeaderLevelCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'rowHeader', // isHeader\n table\n );\n}\n\n/**\n * @description: 处理内容单元格\n * @param {Group} bodyGroup 内容容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createBodyColGroup(bodyGroup: Group, xOrigin: number, yOrigin: number, table: BaseTableAPI) {\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n table.rowHeaderLevelCount, // colStart\n table.colCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'body', // isHeader\n table\n );\n}\n\n/**\n * @description: 生成一个列的场景节点\n * @param {Group} containerGroup 列容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {number} colStart 起始col\n * @param {number} colEnd 结束col\n * @param {number} rowStart 起始row\n * @param {number} rowEnd 结束row\n * @param {boolean} isHeader 是否是表头\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createColGroup(\n containerGroup: Group,\n xOrigin: number,\n yOrigin: number,\n colStart: number,\n colEnd: number,\n rowStart: number,\n rowEnd: number,\n cellType: CellType,\n table: BaseTableAPI,\n rowLimit?: number\n) {\n if (colStart > colEnd || rowStart > rowEnd) {\n return;\n }\n const { layoutMap, defaultRowHeight, defaultHeaderRowHeight, defaultColWidth } = table.internalProps;\n const mergeMap: MergeMap = new Map();\n let x = 0;\n let heightMax = 0;\n for (let i = colStart; i <= colEnd; i++) {\n const col = i;\n\n // 宽度模式\n // const { width: defineWidth } = layoutMap.columnWidths?.[col] || { width: defaultColWidth };\n // const width = table.getColWidth(col);\n // const colWidth: number | 'auto' =\n // defineWidth === 'auto' ||\n // table.scenegraph.transpose ||\n // (table.widthMode === 'autoWidth' && !defineWidth)\n // ? 'auto'\n // : width;\n const colWidth = table.getColWidth(col);\n\n const columnGroup = new Group({\n x: xOrigin + x,\n y: yOrigin,\n width: colWidth,\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = i;\n containerGroup.addChild(columnGroup);\n\n let customRender;\n let customLayout;\n\n if (cellType !== 'body') {\n const define = table.getHeaderDefine(col, rowStart);\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n const define = table.getBodyColumnDefine(col, rowStart);\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n const { width: default2Width, height: default2Height } = createComplexColumn(\n columnGroup,\n col,\n colWidth,\n rowStart,\n rowEnd,\n mergeMap,\n cellType === 'columnHeader' ? defaultHeaderRowHeight ?? defaultRowHeight : defaultRowHeight,\n table,\n cellType,\n rowLimit,\n customRender,\n customLayout\n );\n x += default2Width;\n heightMax = Math.max(heightMax, default2Height);\n }\n // 更新containerGroup尺寸\n containerGroup.setAttribute('width', x);\n containerGroup.setAttribute('height', heightMax);\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/group-creater/column.ts"],"names":[],"mappings":";;;AAEA,4CAAyC;AACzC,mDAAsD;AAUtD,SAAgB,0BAA0B,CACxC,iBAAwB,EACxB,OAAe,EACf,OAAe,EACf,KAAmB;IAEnB,cAAc,CACZ,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,CAAC,EACD,KAAK,CAAC,mBAAmB,GAAG,CAAC,EAC7B,CAAC,EACD,KAAK,CAAC,sBAAsB,GAAG,CAAC,EAChC,cAAc,EACd,KAAK,CACN,CAAC;AACJ,CAAC;AAjBD,gEAiBC;AAUD,SAAgB,uBAAuB,CAAC,cAAqB,EAAE,OAAe,EAAE,OAAe,EAAE,KAAmB;IAClH,cAAc,C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EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,MAAM,GAAG,GAAG,CAAC,CAAC;QAWd,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAExC,MAAM,WAAW,GAAG,IAAI,aAAK,CAAC;YAC5B,CAAC,EAAE,OAAO,GAAG,CAAC;YACd,CAAC,EAAE,OAAO;YACV,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;QACH,WAAW,CAAC,IAAI,GAAG,QAAQ,CAAC;QAC5B,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC;QACpB,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACrC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,mCAAmB,EAC1E,WAAW,EACX,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,CAAC,UAAU,CAAC,QAAQ,EACzB,QAAQ,KAAK,cAAc,CAAC,CAAC,CAAC,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,EAC3F,KAAK,EACL,QAAQ,EACR,QAAQ,CACT,CAAC;QACF,CAAC,IAAI,aAAa,CAAC;QACnB,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;KACjD;IAED,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACxC,cAAc,CAAC,YAAY,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AACnD,CAAC;AA7DD,wCA6DC","file":"column.js","sourcesContent":["import type { CellType } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { createComplexColumn } from './column-helper';\n\n/**\n * @description: 处理全部角表头\n * @param {Group} colHeaderGroup 列表头容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createCornerHeaderColGroup(\n cornerHeaderGroup: Group,\n xOrigin: number,\n yOrigin: number,\n table: BaseTableAPI\n) {\n createColGroup(\n cornerHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.rowHeaderLevelCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'cornerHeader', // CellType\n table\n );\n}\n\n/**\n * @description: 处理全部列表头\n * @param {Group} colHeaderGroup 列表头容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createColHeaderColGroup(colHeaderGroup: Group, xOrigin: number, yOrigin: number, table: BaseTableAPI) {\n createColGroup(\n colHeaderGroup,\n xOrigin,\n yOrigin,\n table.rowHeaderLevelCount, // colStart\n table.colCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n table\n );\n}\n\n/**\n * @description: 处理全部行表头\n * @param {Group} rowHeaderGroup 行表头容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createRowHeaderColGroup(rowHeaderGroup: Group, xOrigin: number, yOrigin: number, table: BaseTableAPI) {\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.rowHeaderLevelCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'rowHeader', // isHeader\n table\n );\n}\n\n/**\n * @description: 处理内容单元格\n * @param {Group} bodyGroup 内容容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createBodyColGroup(bodyGroup: Group, xOrigin: number, yOrigin: number, table: BaseTableAPI) {\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n table.rowHeaderLevelCount, // colStart\n table.colCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'body', // isHeader\n table\n );\n}\n\n/**\n * @description: 生成一个列的场景节点\n * @param {Group} containerGroup 列容器Group\n * @param {number} xOrigin x起始坐标\n * @param {number} yOrigin y起始坐标\n * @param {number} colStart 起始col\n * @param {number} colEnd 结束col\n * @param {number} rowStart 起始row\n * @param {number} rowEnd 结束row\n * @param {boolean} isHeader 是否是表头\n * @param {BaseTableAPI} table\n * @return {*}\n */\nexport function createColGroup(\n containerGroup: Group,\n xOrigin: number,\n yOrigin: number,\n colStart: number,\n colEnd: number,\n rowStart: number,\n rowEnd: number,\n cellType: CellType,\n table: BaseTableAPI,\n rowLimit?: number\n) {\n if (colStart > colEnd || rowStart > rowEnd) {\n return;\n }\n const { layoutMap, defaultRowHeight, defaultHeaderRowHeight, defaultColWidth } = table.internalProps;\n let x = 0;\n let heightMax = 0;\n for (let i = colStart; i <= colEnd; i++) {\n const col = i;\n\n // 宽度模式\n // const { width: defineWidth } = layoutMap.columnWidths?.[col] || { width: defaultColWidth };\n // const width = table.getColWidth(col);\n // const colWidth: number | 'auto' =\n // defineWidth === 'auto' ||\n // table.scenegraph.transpose ||\n // (table.widthMode === 'autoWidth' && !defineWidth)\n // ? 'auto'\n // : width;\n const colWidth = table.getColWidth(col);\n\n const columnGroup = new Group({\n x: xOrigin + x,\n y: yOrigin,\n width: colWidth,\n height: 0,\n clip: false,\n pickable: false\n });\n columnGroup.role = 'column';\n columnGroup.col = i;\n containerGroup.addChild(columnGroup);\n const { width: default2Width, height: default2Height } = createComplexColumn(\n columnGroup,\n col,\n colWidth,\n rowStart,\n rowEnd,\n table.scenegraph.mergeMap,\n cellType === 'columnHeader' ? defaultHeaderRowHeight ?? defaultRowHeight : defaultRowHeight,\n table,\n cellType,\n rowLimit\n );\n x += default2Width;\n heightMax = Math.max(heightMax, default2Height);\n }\n // 更新containerGroup尺寸\n containerGroup.setAttribute('width', x);\n containerGroup.setAttribute('height', heightMax);\n}\n"]}
@@ -1,9 +1,7 @@
1
1
  import type { BaseTableAPI } from '../../../ts-types/base-table';
2
2
  import type { Group } from '../../graphic/group';
3
- import type { Scenegraph } from '../../scenegraph';
4
3
  export declare class SceneProxy {
5
4
  table: BaseTableAPI;
6
- scenegraph: Scenegraph;
7
5
  currentRow: number;
8
6
  totalRow: number;
9
7
  rowLimit: number;
@@ -30,13 +30,13 @@ Object.defineProperty(exports, "__esModule", {
30
30
  value: !0
31
31
  }), exports.SceneProxy = void 0;
32
32
 
33
- const update_height_1 = require("../../layout/update-height"), scenegraph_1 = require("../../scenegraph"), get_prop_1 = require("../../utils/get-prop"), padding_1 = require("../../utils/padding"), column_1 = require("../column"), column_helper_1 = require("../column-helper"), mergeMap = new Map;
33
+ const update_height_1 = require("../../layout/update-height"), empty_group_1 = require("../../utils/empty-group"), get_prop_1 = require("../../utils/get-prop"), padding_1 = require("../../utils/padding"), column_1 = require("../column"), column_helper_1 = require("../column-helper");
34
34
 
35
35
  class SceneProxy {
36
36
  constructor(table) {
37
37
  this.currentRow = 0, this.rowLimit = 1e3, this.accurateY = 0, this.rowStart = 0,
38
38
  this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0, this.cellCache = new Map,
39
- this.table = table, this.scenegraph = table.scenegraph;
39
+ this.table = table, this.table.options.maintainedDataCount && (this.rowLimit = this.table.options.maintainedDataCount);
40
40
  }
41
41
  setParams() {
42
42
  this.bodyTopRow = this.table.columnHeaderLevelCount, this.bodyBottomRow = this.table.rowCount - 1,
@@ -53,11 +53,12 @@ class SceneProxy {
53
53
  this.rowUpdatePos = this.bodyBottomRow;
54
54
  }
55
55
  createColGroupForFirstScreen(rowHeaderGroup, bodyGroup, xOrigin, yOrigin, table) {
56
+ var _a, _b;
56
57
  return __awaiter(this, void 0, void 0, (function*() {
57
58
  this.setParams(), (0, column_1.createColGroup)(rowHeaderGroup, xOrigin, yOrigin, 0, table.rowHeaderLevelCount - 1, table.columnHeaderLevelCount, table.rowCount - 1, "rowHeader", table, this.firstScreenRowLimit),
58
59
  (0, column_1.createColGroup)(bodyGroup, xOrigin, yOrigin, table.rowHeaderLevelCount, table.colCount - 1, table.columnHeaderLevelCount, table.rowCount - 1, "body", table, this.firstScreenRowLimit),
59
- bodyGroup.firstChild ? (this.currentRow = bodyGroup.firstChild.lastChild.row, this.rowEnd = this.currentRow,
60
- this.rowUpdatePos = this.rowEnd, this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2),
60
+ bodyGroup.firstChild ? (this.currentRow = null !== (_b = null === (_a = bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.rowNumber) && void 0 !== _b ? _b : this.totalRow,
61
+ this.rowEnd = this.currentRow, this.rowUpdatePos = this.rowEnd, this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2),
61
62
  yield this.progress()) : (this.currentRow = this.totalRow, this.rowEnd = this.currentRow,
62
63
  this.rowUpdatePos = this.rowEnd, this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2));
63
64
  }));
@@ -80,17 +81,20 @@ class SceneProxy {
80
81
  }
81
82
  createRowCellGroup(onceCount) {
82
83
  const endRow = Math.min(this.totalRow, this.currentRow + onceCount);
84
+ let maxHeight = 0;
83
85
  for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {
84
- const colGroup = this.scenegraph.getColGroup(col), cellType = col < this.table.rowHeaderLevelCount ? "rowHeader" : "body";
85
- (0, column_helper_1.createComplexColumn)(colGroup, col, colGroup.attribute.width, this.currentRow + 1, endRow, mergeMap, this.table.internalProps.defaultRowHeight, this.table, cellType);
86
+ const colGroup = this.table.scenegraph.getColGroup(col), cellType = col < this.table.rowHeaderLevelCount ? "rowHeader" : "body", {height: height} = (0,
87
+ column_helper_1.createComplexColumn)(colGroup, col, colGroup.attribute.width, this.currentRow + 1, endRow, this.table.scenegraph.mergeMap, this.table.internalProps.defaultRowHeight, this.table, cellType);
88
+ maxHeight = Math.max(maxHeight, height);
86
89
  }
87
- this.table.internalProps.autoRowHeight && updateAutoRow(this.bodyLeftCol, this.bodyRightCol, this.currentRow + 1, endRow, this.table),
90
+ this.table.scenegraph.bodyGroup.setAttribute("height", maxHeight), this.table.internalProps.autoRowHeight && updateAutoRow(this.bodyLeftCol, this.bodyRightCol, this.currentRow + 1, endRow, this.table),
88
91
  this.currentRow = endRow, this.rowEnd = endRow, this.rowUpdatePos = this.rowEnd,
89
- this.referenceRow = Math.floor((endRow - this.rowStart) / 2);
92
+ this.referenceRow = Math.floor((endRow - this.rowStart) / 2), this.table.scenegraph.updateContainer(),
93
+ this.table.scenegraph.updateBorderSizeAndPosition();
90
94
  }
91
95
  setY(y) {
92
96
  return __awaiter(this, void 0, void 0, (function*() {
93
- y < this.yLimitTop && this.rowStart === this.bodyTopRow || y > this.yLimitBottom && this.rowEnd === this.bodyBottomRow ? this.scenegraph.setBodyAndRowHeaderY(-y) : this.dynamicSetY(y);
97
+ y < this.yLimitTop && this.rowStart === this.bodyTopRow || y > this.yLimitBottom && this.rowEnd === this.bodyBottomRow ? this.table.scenegraph.setBodyAndRowHeaderY(-y) : this.dynamicSetY(y);
94
98
  }));
95
99
  }
96
100
  dynamicSetY(y) {
@@ -101,11 +105,11 @@ class SceneProxy {
101
105
  this.y = y, this.screenTopRow = screenTopRow;
102
106
  const deltaRow = screenTopRow - this.referenceRow;
103
107
  deltaRow > 0 ? (this.moveCell(deltaRow, "up", screenTopRow), this.updateBody(y)) : deltaRow < 0 ? (this.moveCell(-deltaRow, "down", screenTopRow),
104
- this.updateBody(y)) : this.updateBody(y), this.scenegraph.updateNextFrame();
108
+ this.updateBody(y)) : this.updateBody(y), this.table.scenegraph.updateNextFrame();
105
109
  }));
106
110
  }
107
111
  updateBody(y) {
108
- this.scenegraph.setBodyAndRowHeaderY(-y);
112
+ this.table.scenegraph.setBodyAndRowHeaderY(-y);
109
113
  }
110
114
  moveCell(count, direction, screenTopRow) {
111
115
  return __awaiter(this, void 0, void 0, (function*() {
@@ -113,7 +117,7 @@ class SceneProxy {
113
117
  count < this.rowEnd - this.rowStart) {
114
118
  const startRow = "up" === direction ? this.rowStart : this.rowEnd - count + 1, endRow = "up" === direction ? this.rowStart + count - 1 : this.rowEnd;
115
119
  for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {
116
- const colGroup = this.scenegraph.getColGroup(col);
120
+ const colGroup = this.table.scenegraph.getColGroup(col);
117
121
  for (let row = startRow; row <= endRow; row++) if ("up" === direction) {
118
122
  const cellGroup = colGroup.firstChild;
119
123
  this.updateCellGroupPosition(cellGroup, colGroup.lastChild.row + 1, colGroup.lastChild.attribute.y + colGroup.lastChild.attribute.height),
@@ -140,7 +144,7 @@ class SceneProxy {
140
144
  } else {
141
145
  const distStartRow = "up" === direction ? this.rowStart + count : this.rowStart - count, distEndRow = "up" === direction ? this.rowEnd + count : this.rowEnd - count, distStartRowY = this.table.getRowsHeight(this.bodyTopRow, distStartRow - 1);
142
146
  for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {
143
- this.scenegraph.getColGroup(col).forEachChildren(((cellGroup, index) => {
147
+ this.table.scenegraph.getColGroup(col).forEachChildren(((cellGroup, index) => {
144
148
  this.updateCellGroupPosition(cellGroup, "up" === direction ? cellGroup.row + count : cellGroup.row - count, 0 === index ? distStartRowY : cellGroup._prev.attribute.y + cellGroup._prev.attribute.height);
145
149
  }));
146
150
  }
@@ -183,7 +187,7 @@ class SceneProxy {
183
187
  cellGroup.needUpdateForAutoRowHeight = !0;
184
188
  }
185
189
  updateCellGroupContent(cellGroup) {
186
- cellGroup.needUpdate && (this.scenegraph.updateCellContent(cellGroup.col, cellGroup.row),
190
+ cellGroup.needUpdate && (this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row),
187
191
  cellGroup.needUpdate = !1);
188
192
  }
189
193
  sortCell() {
@@ -210,18 +214,18 @@ class SceneProxy {
210
214
  }));
211
215
  }
212
216
  highPerformanceGetCell(col, row, rowStart = this.rowStart, rowEnd = this.rowEnd) {
213
- if (row < rowStart || row > rowEnd) return scenegraph_1.emptyGroup;
217
+ if (row < rowStart || row > rowEnd) return empty_group_1.emptyGroup;
214
218
  if (this.cellCache.get(col)) {
215
219
  const cacheCellGoup = this.cellCache.get(col);
216
220
  if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {
217
221
  let cellGroup = getCellByCache(cacheCellGoup, row);
218
- return cellGroup || (cellGroup = this.scenegraph.getCell(col, row)), cellGroup.row && this.cellCache.set(col, cellGroup),
222
+ return cellGroup || (cellGroup = this.table.scenegraph.getCell(col, row)), cellGroup.row && this.cellCache.set(col, cellGroup),
219
223
  cellGroup;
220
224
  }
221
- const cellGroup = this.scenegraph.getCell(col, row);
225
+ const cellGroup = this.table.scenegraph.getCell(col, row);
222
226
  return cellGroup.row && this.cellCache.set(col, cellGroup), cellGroup;
223
227
  }
224
- const cellGroup = this.scenegraph.getCell(col, row);
228
+ const cellGroup = this.table.scenegraph.getCell(col, row);
225
229
  return cellGroup.row && this.cellCache.set(col, cellGroup), cellGroup;
226
230
  }
227
231
  }
@@ -234,7 +238,7 @@ function updateAutoRow(colStart, colEnd, rowStart, rowEnd, table, direction = "u
234
238
  const cellGroup = table.scenegraph.getCell(col, row);
235
239
  if (!cellGroup.row) continue;
236
240
  const text = cellGroup.getChildByName("text") || cellGroup.getChildByName("content"), headerStyle = table._getCellStyle(col, row), padding = (0,
237
- padding_1.getPadding)((0, get_prop_1.getProp)("padding", headerStyle, col, row, table)), height = text.AABBBounds.height() + (padding[0] + padding[2]);
241
+ padding_1.getQuadProps)((0, get_prop_1.getProp)("padding", headerStyle, col, row, table)), height = text.AABBBounds.height() + (padding[0] + padding[2]);
238
242
  maxRowHeight = Math.max(maxRowHeight, height), cellGroup.needUpdateForAutoRowHeight = !1;
239
243
  }
240
244
  for (let col = colStart; col <= colEnd; col++) {