@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/stick-text/index.ts"],"names":[],"mappings":";;;AAEA,8FAA2F;AAI3F,SAAgB,eAAe,CAAC,KAAmB;IACjD,MAAM,YAAY,GAAmC,EAAE,CAAC;IACxD,KAAK,CAAC,MAAM,CAAC,+CAAsB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;;QAE9C,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAC7B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;IAChE,IAAI,CAAC,IAAI,EAAE;QACT,OAAO;KACR;IACD,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;IAE1C,IAAI,QAAQ,GAAG,UAAU,EAAE;QACzB,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;QAEzC,SAAS,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;YAC5C,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;KACJ;AACH,CAAC","file":"index.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { PIVOT_TABLE_EVENT_TYPE } from '../../ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE';\nimport type { Group } from '../graphic/group';\nimport type { WrapText } from '../graphic/text';\n\nexport function handleTextStick(table: BaseTableAPI) {\n const changedCells: { col: number; row: number }[] = [];\n table.listen(PIVOT_TABLE_EVENT_TYPE.SCROLL, e => {\n // reset all changed cell height\n changedCells.forEach(cellPos => {\n const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dy: 0,\n dx: 0\n });\n });\n });\n changedCells.length = 0;\n\n const { scrollTop, scrollLeft } = e;\n if (scrollTop) {\n const frozenRowsHeight = table.getFrozenRowsHeight();\n const { row } = table.getRowAt(scrollTop + frozenRowsHeight + 1);\n // ergodic all cells in this row, find the header cell with textStick style enabled\n for (let col = 0; col < table.colCount; col++) {\n if (table.isHeader(col, row) && table._getCellStyle(col, row)?.textStick) {\n // adjust cell vertical layout\n const cellGroup = table.scenegraph.getCell(col, row);\n adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight);\n\n // record cell info\n changedCells.push({ col, row });\n }\n }\n }\n\n if (scrollLeft) {\n const frozenRowsWidth = table.getFrozenColsWidth();\n const { col } = table.getColAt(scrollLeft + frozenRowsWidth + 1);\n // ergodic all cells in this col, find the header cell with textStick style enabled\n for (let row = 0; row < table.rowCount; row++) {\n if (table.isHeader(col, row) && table._getCellStyle(col, row)?.textStick) {\n // adjust cell horizontal layout\n const cellGroup = table.scenegraph.getCell(col, row);\n adjustCellContentHorizontalLayout(cellGroup, frozenRowsWidth);\n\n // record cell info\n changedCells.push({ col, row });\n }\n }\n }\n });\n}\n\n/*\n * adjust cell content vertical layout\n * @param {Group} cellGroup\n * @param {number} scrollTop\n */\nfunction adjustCellContentVerticalLayout(cellGroup: Group, scrollTop: number) {\n // get text element\n const text = cellGroup.getChildByName('text', true) as WrapText;\n if (!text) {\n return;\n }\n text.AABBBounds.width();\n const textTop = text.globalAABBBounds.y1;\n\n if (textTop < scrollTop) {\n const deltaHeight = textTop - scrollTop;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', -deltaHeight + 2); // 2 is the buffer\n });\n }\n}\n\n/*\n * adjust cell content horizontal layout\n * @param {Group} cellGroup\n * @param {number} scrollLeft\n */\nfunction adjustCellContentHorizontalLayout(cellGroup: Group, scrollLeft: number) {\n // get text element\n const text = cellGroup.getChildByName('text', true) as WrapText;\n if (!text) {\n return;\n }\n text.AABBBounds.width();\n const textLeft = text.globalAABBBounds.x1;\n\n if (textLeft < scrollLeft) {\n const deltaWidth = textLeft - scrollLeft;\n // text is out of view, move all elements right\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', -deltaWidth + 2); // 2 is the buffer\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/stick-text/index.ts"],"names":[],"mappings":";;;AAMA,MAAM,YAAY,GAAmC,EAAE,CAAC;AACxD,SAAgB,eAAe,CAAC,KAAmB;;IACjD,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC7B,MAAM,SAAS,GAAG,KAAK,C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G,MAAM,CAAC;QAExC,SAAS,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;YAC5C,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAOD,SAAS,iCAAiC,CAAC,SAAgB,EAAE,OAAe,EAAE,OAAe;IAE3F,MAAM,IAAI,GAAG,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAa,CAAC;IAChE,IAAI,CAAC,IAAI,EAAE;QACT,OAAO;KACR;IACD,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;IAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;IAC3C,IAAI,QAAQ,GAAG,OAAO,EAAE;QACtB,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;QAEtC,SAAS,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;YAC5C,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;KACJ;SAAM,IAAI,SAAS,GAAG,OAAO,EAAE;QAC9B,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;QAEvC,SAAS,CAAC,eAAe,CAAC,CAAC,KAAe,EAAE,EAAE;YAC5C,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;KACJ;AACH,CAAC","file":"index.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { PIVOT_TABLE_EVENT_TYPE } from '../../ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE';\nimport type { Group } from '../graphic/group';\nimport type { WrapText } from '../graphic/text';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nconst changedCells: { col: number; row: number }[] = [];\nexport function handleTextStick(table: BaseTableAPI) {\n changedCells.forEach(cellPos => {\n const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dy: 0,\n dx: 0\n });\n });\n });\n changedCells.length = 0;\n\n const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;\n const frozenRowsHeight = table.getFrozenRowsHeight();\n const frozenColsWidth = table.getFrozenColsWidth();\n // 计算非冻结\n const { row: rowStart } = table.getRowAt(scrollTop + frozenRowsHeight + 1);\n const { col: colStart } = table.getColAt(scrollLeft + frozenColsWidth + 1);\n const rowEnd =\n table.getAllRowsHeight() > table.tableNoFrameHeight\n ? table.getRowAt(scrollTop + table.tableNoFrameHeight - 1).row\n : table.rowCount - 1;\n const colEnd =\n table.getAllColsWidth() > table.tableNoFrameWidth\n ? table.getColAt(scrollLeft + table.tableNoFrameWidth - 1).col\n : table.colCount - 1;\n // 列表头单元格\n for (let row = 0; row < frozenRowCount; row++) {\n for (let col = 0; col <= colEnd; col++) {\n if (table._getCellStyle(col, row)?.textStick) {\n const cellGroup = table.scenegraph.getCell(col, row);\n // adjust cell Horizontal\n adjustCellContentHorizontalLayout(cellGroup, 0, table.tableNoFrameWidth);\n changedCells.push({ col, row });\n }\n }\n }\n\n if (rowStart === -1) {\n return;\n }\n // 行表头单元格\n for (let row = rowStart; row <= rowEnd; row++) {\n for (let col = 0; col < frozenColCount; col++) {\n if (\n table._getCellStyle(col, row)?.textStick &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).rowHierarchyType !== 'tree'\n ) {\n const cellGroup = table.scenegraph.getCell(col, row);\n // adjust cell vertical\n adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight, table.tableNoFrameHeight);\n changedCells.push({ col, row });\n }\n }\n }\n // body单元格\n for (let row = rowStart; row <= rowEnd; row++) {\n for (let col = colStart; col <= colEnd; col++) {\n if (table._getCellStyle(col, row)?.textStick) {\n const cellGroup = table.scenegraph.getCell(col, row);\n // adjust cell vertical\n adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight, table.tableNoFrameHeight);\n // adjust cell Horizontal\n adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth, table.tableNoFrameWidth);\n changedCells.push({ col, row });\n }\n }\n }\n}\n\n/*\n * adjust cell content vertical layout\n * @param {Group} cellGroup\n * @param {number} scrollTop\n */\nfunction adjustCellContentVerticalLayout(cellGroup: Group, minTop: number, maxTop: number) {\n // get text element\n const text = cellGroup.getChildByName('text', true) as WrapText;\n if (!text) {\n return;\n }\n text.AABBBounds.width();\n const textTop = text.globalAABBBounds.y1;\n const textBottom = text.globalAABBBounds.y2;\n\n if (textTop < minTop) {\n const deltaHeight = textTop - minTop;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', -deltaHeight + 2); // 2 is the buffer\n });\n } else if (textBottom > maxTop) {\n const deltaHeight = textBottom - maxTop;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dy', -deltaHeight); // 2 is the buffer\n });\n }\n}\n\n/*\n * adjust cell content horizontal layout\n * @param {Group} cellGroup\n * @param {number} scrollLeft\n */\nfunction adjustCellContentHorizontalLayout(cellGroup: Group, minLeft: number, maxLeft: number) {\n // get text element\n const text = cellGroup.getChildByName('text', true) as WrapText;\n if (!text) {\n return;\n }\n text.AABBBounds.width();\n const textLeft = text.globalAABBBounds.x1;\n const textRight = text.globalAABBBounds.x2;\n if (textLeft < minLeft) {\n const deltaWidth = textLeft - minLeft;\n // text is out of view, move all elements right\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', -deltaWidth + 2); // 2 is the buffer\n });\n } else if (textRight > maxLeft) {\n const deltaWidth = textRight - maxLeft;\n // text is out of view, move all elements down\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttribute('dx', -deltaWidth); // 2 is the buffer\n });\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { TableFrameStyle } from '../../ts-types';
2
2
  import type { Group } from '../graphic/group';
3
- export declare function createFrameBorder(group: Group, frameTheme: TableFrameStyle | undefined, role: string, strokeArray?: [boolean, boolean, boolean, boolean]): void;
3
+ export declare function createFrameBorder(group: Group, frameTheme: TableFrameStyle | undefined, role: string, strokeArray: [boolean, boolean, boolean, boolean] | undefined, justForXYPosition?: boolean): void;
4
4
  export declare function updateFrameBorder(group: Group, frameTheme: TableFrameStyle | undefined, strokeArray: [boolean, boolean, boolean, boolean]): void;
5
5
  export declare function updateFrameBorderSize(group: Group): void;
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
 
7
7
  const vrender_1 = require("@visactor/vrender"), vutils_1 = require("@visactor/vutils"), padding_1 = require("../utils/padding");
8
8
 
9
- function createFrameBorder(group, frameTheme, role, strokeArray) {
9
+ function createFrameBorder(group, frameTheme, role, strokeArray, justForXYPosition) {
10
10
  var _a, _b, _c, _d, _e, _f;
11
11
  if (!frameTheme) return;
12
- const isTableGroup = "table" === role, {shadowBlur: shadowBlur, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowColor: shadowColor, roundCornerRadius: roundCornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = frameTheme, groupAttributes = {}, rectAttributes = {
12
+ const isTableGroup = "table" === role, {shadowBlur: shadowBlur, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowColor: shadowColor, cornerRadius: cornerRadius, borderColor: borderColor, borderLineWidth: borderLineWidth, borderLineDash: borderLineDash} = frameTheme, groupAttributes = {}, rectAttributes = {
13
13
  pickable: !1
14
14
  };
15
15
  shadowBlur && isTableGroup && (rectAttributes.shadowBlur = shadowBlur, rectAttributes.shadowOffsetX = shadowOffsetX,
@@ -19,15 +19,15 @@ function createFrameBorder(group, frameTheme, role, strokeArray) {
19
19
  rectAttributes.fill = !1, rectAttributes.stroke = getStroke(borderColor, strokeArray),
20
20
  rectAttributes.lineWidth = borderLineWidth, borderLineDash && (rectAttributes.lineDash = borderLineDash),
21
21
  rectAttributes.lineCap = "square"), Array.isArray(borderColor) && (rectAttributes.strokeArrayColor = (0,
22
- padding_1.getPadding)(borderColor)), Array.isArray(borderLineWidth) && (rectAttributes.strokeArrayWidth = (0,
23
- padding_1.getPadding)(borderLineWidth), rectAttributes.lineWidth = 1), roundCornerRadius && (rectAttributes.borderRadius = roundCornerRadius,
24
- groupAttributes.borderRadius = roundCornerRadius);
22
+ padding_1.getQuadProps)(borderColor)), Array.isArray(borderLineWidth) && (rectAttributes.strokeArrayWidth = (0,
23
+ padding_1.getQuadProps)(borderLineWidth), rectAttributes.lineWidth = 1), cornerRadius && (rectAttributes.cornerRadius = cornerRadius,
24
+ groupAttributes.cornerRadius = cornerRadius);
25
25
  const borderTop = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[0] : null !== (_a = rectAttributes.lineWidth) && void 0 !== _a ? _a : 0, borderRight = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[1] : null !== (_b = rectAttributes.lineWidth) && void 0 !== _b ? _b : 0, borderBottom = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[2] : null !== (_c = rectAttributes.lineWidth) && void 0 !== _c ? _c : 0, borderLeft = rectAttributes.strokeArrayWidth ? rectAttributes.strokeArrayWidth[3] : null !== (_d = rectAttributes.lineWidth) && void 0 !== _d ? _d : 0;
26
26
  if (isTableGroup && (rectAttributes.shadowBlur || rectAttributes.lineWidth)) {
27
27
  const deltaX = (null !== (_e = rectAttributes.shadowBlur) && void 0 !== _e ? _e : 0) + (borderLeft + borderRight) / 2, deltaY = (null !== (_f = rectAttributes.shadowBlur) && void 0 !== _f ? _f : 0) + (borderTop + borderBottom) / 2;
28
- groupAttributes.x = group.attribute.x + deltaX, groupAttributes.y = group.attribute.y + deltaY;
28
+ groupAttributes.x = deltaX, groupAttributes.y = deltaY;
29
29
  }
30
- if (group.setAttributes(groupAttributes), rectAttributes.stroke) if (rectAttributes.x = borderLeft / 2,
30
+ if (group.setAttributes(groupAttributes), !justForXYPosition && rectAttributes.stroke) if (rectAttributes.x = borderLeft / 2,
31
31
  rectAttributes.y = borderTop / 2, rectAttributes.pickable = !1, isTableGroup) {
32
32
  rectAttributes.x = group.attribute.x - borderLeft / 2, rectAttributes.y = group.attribute.y - borderTop / 2,
33
33
  rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2,
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/style/frame-border.ts"],"names":[],"mappings":";;;AACA,+CAA+C;AAG/C,6CAA2C;AAC3C,8CAA8C;AAU9C,SAAgB,iBAAiB,CAC/B,KAAY,EACZ,UAAuC,EACvC,IAAY,EACZ,WAAkD;;IAElD,IAAI,CAAC,UAAU,EAAE;QACf,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAI,KAAK,OAAO,CAAC;IAEtC,MAAM,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,cAAc,EACf,GAAG,UAAU,CAAC;IAEf,MAAM,eAAe,GAA2B,EAAE,CAAC;IACnD,MAAM,cAAc,GAA0B;QAC5C,QAAQ,EAAE,KAAK;KAChB,CAAC;IAEF,IAAI,UAAU,IAAI,YAAY,EAAE;QAE9B,cAAc,CAAC,UAAU,GAAG,UAAU,CAAC;QACvC,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,aAAa,GAAG,aAAa,CAAC;QAC7C,cAAc,CAAC,WAAW,GAAG,WAAW,CAAC;QACzC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC;QAC7B,cAAc,CAAC,MAAM,GAAG,WAAW,CAAC;QACpC,cAAc,CAAC,SAAS,GAAG,CAAC,CAAC;QAE7B,cAAc,CAAC,IAAI,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CAAC,gBAAgB,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,MAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,SAAoB,mCAAI,CAAC,CAAC;IACtD,MAAM,UAAU,GAAI,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB;QACjE,CAAC,CAAE,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,MAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,SAAoB,mCAAI,CAAC,CAAC;IAEtD,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,GAAG,CAAC,GAAG,WAAW,GAAG,CAAC;QAC/D,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,GAAG,CAAC,GAAG,YAAY,GAAG,CAAC;KAClE,CAAC,CAAC;AACL,CAAC;AArBD,sDAqBC","file":"frame-border.js","sourcesContent":["import type { IGroupGraphicAttribute, IRectGraphicAttribute } from '@visactor/vrender';\nimport { createRect } from '@visactor/vrender';\nimport type { TableFrameStyle } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { isArray } from '@visactor/vutils';\nimport { getPadding } from '../utils/padding';\n\n/**\n * @description: create frame border\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {string} role\n * @param {[boolean, boolean, boolean, boolean]} strokeArray\n * @return {*}\n */\nexport function createFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n role: string,\n strokeArray?: [boolean, boolean, boolean, boolean] // to do 处理成0b001111形式\n) {\n if (!frameTheme) {\n return;\n }\n\n const isTableGroup = role === 'table';\n\n const {\n shadowBlur,\n shadowOffsetX,\n shadowOffsetY,\n shadowColor,\n roundCornerRadius,\n borderColor,\n borderLineWidth,\n borderLineDash\n } = frameTheme;\n\n const groupAttributes: IGroupGraphicAttribute = {};\n const rectAttributes: IRectGraphicAttribute = {\n pickable: false\n };\n // 处理shadow\n if (shadowBlur && isTableGroup) {\n // 只有table才能配置shadow\n rectAttributes.shadowBlur = shadowBlur;\n rectAttributes.shadowOffsetX = shadowOffsetX;\n rectAttributes.shadowOffsetY = shadowOffsetY;\n rectAttributes.shadowColor = shadowColor;\n rectAttributes.stroke = true;\n rectAttributes.stroke = shadowColor;\n rectAttributes.lineWidth = 1;\n\n rectAttributes.fill = true;\n rectAttributes.fillOpacity = 0.01;\n }\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = getStroke(borderColor, strokeArray);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'square';\n }\n\n if (Array.isArray(borderColor)) {\n (rectAttributes as any).strokeArrayColor = getPadding(borderColor as any);\n }\n if (Array.isArray(borderLineWidth)) {\n (rectAttributes as any).strokeArrayWidth = getPadding(borderLineWidth);\n (rectAttributes as any).lineWidth = 1;\n }\n\n if (roundCornerRadius) {\n rectAttributes.borderRadius = roundCornerRadius;\n groupAttributes.borderRadius = roundCornerRadius;\n }\n\n const borderTop = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[0]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderRight = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[1]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderBottom = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[2]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderLeft = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[3]\n : (rectAttributes.lineWidth as number) ?? 0;\n\n // 处理边框引起的宽度高度变化(只对最外层tableGroup生效)\n if (isTableGroup && (rectAttributes.shadowBlur || rectAttributes.lineWidth)) {\n const deltaX = (rectAttributes.shadowBlur ?? 0) + (borderLeft + borderRight) / 2;\n const deltaY = (rectAttributes.shadowBlur ?? 0) + (borderTop + borderBottom) / 2;\n\n groupAttributes.x = group.attribute.x + deltaX;\n groupAttributes.y = group.attribute.y + deltaY;\n // 宽度高度在tableNoFrameWidth&tableNoFrameHeight中处理\n // groupAttributes.width = group.attribute.width - deltaX - deltaX;\n // groupAttributes.height = group.attribute.height - deltaY - deltaY;\n }\n group.setAttributes(groupAttributes);\n\n if (rectAttributes.stroke) {\n rectAttributes.x = borderLeft / 2;\n rectAttributes.y = borderTop / 2;\n rectAttributes.pickable = false;\n if (isTableGroup) {\n rectAttributes.x = group.attribute.x - borderLeft / 2;\n rectAttributes.y = group.attribute.y - borderTop / 2;\n rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;\n rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'table-border-rect';\n group.parent.insertBefore(borderRect, group);\n (group as any).border = borderRect;\n } else {\n // rectAttributes.x = rectAttributes.lineWidth / 2;\n // rectAttributes.y = rectAttributes.lineWidth / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.addChild(borderRect);\n (group as any).border = borderRect;\n }\n }\n}\n\n/**\n * @description: update frame border stroke atrribute\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {array} strokeArray stroke boolean array\n * @return {*}\n */\nexport function updateFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n strokeArray: [boolean, boolean, boolean, boolean] // to do 处理成0b001111形式\n) {\n const { borderColor } = frameTheme;\n group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));\n}\n\nfunction getStroke(borderColor: string | string[], strokeArray: boolean[] | undefined) {\n let stroke: boolean | string | (boolean | string)[] = true;\n if (strokeArray && !isArray(borderColor)) {\n stroke = strokeArray.map(stroke => {\n if (stroke) {\n return borderColor;\n }\n return false;\n });\n } else if (strokeArray) {\n stroke = strokeArray;\n } else if (!strokeArray && !isArray(borderColor)) {\n stroke = borderColor;\n } else if (isArray(borderColor)) {\n stroke = true;\n }\n return stroke;\n}\n\n/**\n * @description: update frame border size when group size change\n * @param {Group} group\n * @return {*}\n */\nexport function updateFrameBorderSize(group: Group) {\n if (!group.border) {\n return;\n }\n const borderTop = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[0]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderRight = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[1]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderBottom = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[2]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderLeft = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[3]\n : (group.border.attribute.lineWidth as number) ?? 0;\n\n group.border.setAttributes({\n width: group.attribute.width - borderLeft / 2 - borderRight / 2,\n height: group.attribute.height - borderTop / 2 - borderBottom / 2\n });\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/style/frame-border.ts"],"names":[],"mappings":";;;AACA,+CAA+C;AAG/C,6CAA2C;AAC3C,8CAAgD;AAUhD,SAAgB,iBAAiB,CAC/B,KAAY,EACZ,UAAuC,EACvC,IAAY,EACZ,WAA6D,EAC7D,iBAA2B;;IAE3B,IAAI,CAAC,UAAU,EAAE;QACf,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAI,KAAK,OAAO,CAAC;IAEtC,MAAM,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACf,GAAG,UAAU,CAAC;IAEf,MAAM,eAAe,GAA2B,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CAAC,SAAS,CAAC,SAAoB,mCAAI,CAAC,CAAC;IACtD,MAAM,WAAW,GAAI,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB;QAClE,CAAC,CAAE,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,MAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,SAAoB,mCAAI,CAAC,CAAC;IACtD,MAAM,YAAY,GAAI,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB;QACnE,CAAC,CAAE,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,MAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,SAAoB,mCAAI,CAAC,CAAC;IACtD,MAAM,UAAU,GAAI,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB;QACjE,CAAC,CAAE,KAAK,CAAC,MAAM,CAAC,SAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,MAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,SAAoB,mCAAI,CAAC,CAAC;IAEtD,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,GAAG,CAAC,GAAG,WAAW,GAAG,CAAC;QAC/D,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,GAAG,CAAC,GAAG,YAAY,GAAG,CAAC;KAClE,CAAC,CAAC;AACL,CAAC;AArBD,sDAqBC","file":"frame-border.js","sourcesContent":["import type { IGroupGraphicAttribute, IRectGraphicAttribute } from '@visactor/vrender';\nimport { createRect } from '@visactor/vrender';\nimport type { TableFrameStyle } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { isArray } from '@visactor/vutils';\nimport { getQuadProps } from '../utils/padding';\n\n/**\n * @description: create frame border\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {string} role\n * @param {[boolean, boolean, boolean, boolean]} strokeArray\n * @return {*}\n */\nexport function createFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n role: string,\n strokeArray: [boolean, boolean, boolean, boolean] | undefined, // to do 处理成0b001111形式\n justForXYPosition?: boolean\n) {\n if (!frameTheme) {\n return;\n }\n\n const isTableGroup = role === 'table';\n\n const {\n shadowBlur,\n shadowOffsetX,\n shadowOffsetY,\n shadowColor,\n cornerRadius,\n borderColor,\n borderLineWidth,\n borderLineDash\n } = frameTheme;\n\n const groupAttributes: IGroupGraphicAttribute = {};\n const rectAttributes: IRectGraphicAttribute = {\n pickable: false\n };\n // 处理shadow\n if (shadowBlur && isTableGroup) {\n // 只有table才能配置shadow\n rectAttributes.shadowBlur = shadowBlur;\n rectAttributes.shadowOffsetX = shadowOffsetX;\n rectAttributes.shadowOffsetY = shadowOffsetY;\n rectAttributes.shadowColor = shadowColor;\n rectAttributes.stroke = true;\n rectAttributes.stroke = shadowColor;\n rectAttributes.lineWidth = 1;\n\n rectAttributes.fill = true;\n rectAttributes.fillOpacity = 0.01;\n }\n\n // 处理边框\n if (borderLineWidth) {\n rectAttributes.stroke = true;\n rectAttributes.fill = false;\n rectAttributes.stroke = getStroke(borderColor, strokeArray);\n rectAttributes.lineWidth = borderLineWidth as number;\n borderLineDash && (rectAttributes.lineDash = borderLineDash as number[]);\n rectAttributes.lineCap = 'square';\n }\n\n if (Array.isArray(borderColor)) {\n (rectAttributes as any).strokeArrayColor = getQuadProps(borderColor as any);\n }\n if (Array.isArray(borderLineWidth)) {\n (rectAttributes as any).strokeArrayWidth = getQuadProps(borderLineWidth);\n (rectAttributes as any).lineWidth = 1;\n }\n\n if (cornerRadius) {\n rectAttributes.cornerRadius = cornerRadius;\n groupAttributes.cornerRadius = cornerRadius;\n }\n\n const borderTop = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[0]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderRight = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[1]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderBottom = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[2]\n : (rectAttributes.lineWidth as number) ?? 0;\n const borderLeft = (rectAttributes as any).strokeArrayWidth\n ? (rectAttributes as any).strokeArrayWidth[3]\n : (rectAttributes.lineWidth as number) ?? 0;\n\n // 处理边框引起的宽度高度变化(只对最外层tableGroup生效)\n if (isTableGroup && (rectAttributes.shadowBlur || rectAttributes.lineWidth)) {\n const deltaX = (rectAttributes.shadowBlur ?? 0) + (borderLeft + borderRight) / 2;\n const deltaY = (rectAttributes.shadowBlur ?? 0) + (borderTop + borderBottom) / 2;\n\n groupAttributes.x = deltaX;\n groupAttributes.y = deltaY;\n // 宽度高度在tableNoFrameWidth&tableNoFrameHeight中处理\n // groupAttributes.width = group.attribute.width - deltaX - deltaX;\n // groupAttributes.height = group.attribute.height - deltaY - deltaY;\n }\n group.setAttributes(groupAttributes);\n\n if (justForXYPosition) {\n return;\n }\n\n if (rectAttributes.stroke) {\n rectAttributes.x = borderLeft / 2;\n rectAttributes.y = borderTop / 2;\n rectAttributes.pickable = false;\n if (isTableGroup) {\n rectAttributes.x = group.attribute.x - borderLeft / 2;\n rectAttributes.y = group.attribute.y - borderTop / 2;\n rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;\n rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'table-border-rect';\n group.parent.insertBefore(borderRect, group);\n (group as any).border = borderRect;\n } else {\n // rectAttributes.x = rectAttributes.lineWidth / 2;\n // rectAttributes.y = rectAttributes.lineWidth / 2;\n rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;\n rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;\n const borderRect = createRect(rectAttributes);\n borderRect.name = 'border-rect';\n group.addChild(borderRect);\n (group as any).border = borderRect;\n }\n }\n}\n\n/**\n * @description: update frame border stroke atrribute\n * @param {Group} group\n * @param {TableFrameStyle} frameTheme\n * @param {array} strokeArray stroke boolean array\n * @return {*}\n */\nexport function updateFrameBorder(\n group: Group,\n frameTheme: TableFrameStyle | undefined,\n strokeArray: [boolean, boolean, boolean, boolean] // to do 处理成0b001111形式\n) {\n const { borderColor } = frameTheme;\n group.border?.setAttribute('stroke', getStroke(borderColor, strokeArray));\n}\n\nfunction getStroke(borderColor: string | string[], strokeArray: boolean[] | undefined) {\n let stroke: boolean | string | (boolean | string)[] = true;\n if (strokeArray && !isArray(borderColor)) {\n stroke = strokeArray.map(stroke => {\n if (stroke) {\n return borderColor;\n }\n return false;\n });\n } else if (strokeArray) {\n stroke = strokeArray;\n } else if (!strokeArray && !isArray(borderColor)) {\n stroke = borderColor;\n } else if (isArray(borderColor)) {\n stroke = true;\n }\n return stroke;\n}\n\n/**\n * @description: update frame border size when group size change\n * @param {Group} group\n * @return {*}\n */\nexport function updateFrameBorderSize(group: Group) {\n if (!group.border) {\n return;\n }\n const borderTop = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[0]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderRight = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[1]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderBottom = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[2]\n : (group.border.attribute.lineWidth as number) ?? 0;\n const borderLeft = (group.border.attribute as any).strokeArrayWidth\n ? (group.border.attribute as any).strokeArrayWidth[3]\n : (group.border.attribute.lineWidth as number) ?? 0;\n\n group.border.setAttributes({\n width: group.attribute.width - borderLeft / 2 - borderRight / 2,\n height: group.attribute.height - borderTop / 2 - borderBottom / 2\n });\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { BaseTableAPI } from '../../ts-types/base-table';
2
+ export declare function dealPromiseData(dataPromise: Promise<null>, tabel: BaseTableAPI, callback: () => void): void;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ function dealPromiseData(dataPromise, tabel, callback) {
4
+ dataPromise.then((() => {
5
+ callback(), tabel.scenegraph.updateNextFrame();
6
+ })).catch((err => {
7
+ console.error(err);
8
+ }));
9
+ }
10
+
11
+ Object.defineProperty(exports, "__esModule", {
12
+ value: !0
13
+ }), exports.dealPromiseData = void 0, exports.dealPromiseData = dealPromiseData;
14
+ //# sourceMappingURL=deal-promise-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["scenegraph/utils/deal-promise-data.ts"],"names":[],"mappings":";;;AAEA,SAAgB,eAAe,CAAC,WAA0B,EAAE,KAAmB,EAAE,QAAoB;IACnG,WAAW;SACR,IAAI,CAAC,GAAG,EAAE;QACT,QAAQ,EAAE,CAAC;QACX,KAAK,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;IACrC,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;QACpB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACP,CAAC;AATD,0CASC","file":"deal-promise-data.js","sourcesContent":["import type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport function dealPromiseData(dataPromise: Promise<null>, tabel: BaseTableAPI, callback: () => void) {\n dataPromise\n .then(() => {\n callback();\n tabel.scenegraph.updateNextFrame();\n })\n .catch((err: Error) => {\n console.error(err);\n });\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { Group } from '../graphic/group';
2
+ export declare const emptyGroup: Group;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.emptyGroup = void 0;
6
+
7
+ const group_1 = require("../graphic/group");
8
+
9
+ exports.emptyGroup = new group_1.Group({}), exports.emptyGroup.role = "empty";
10
+ //# sourceMappingURL=empty-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["scenegraph/utils/empty-group.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAE5B,QAAA,UAAU,GAAG,IAAI,aAAK,CAAC,EAAE,CAAC,CAAC;AACxC,kBAAU,CAAC,IAAI,GAAG,OAAO,CAAC","file":"empty-group.js","sourcesContent":["import { Group } from '../graphic/group';\n\nexport const emptyGroup = new Group({});\nemptyGroup.role = 'empty';\n"]}
@@ -0,0 +1,2 @@
1
+ import type { BaseTableAPI } from '../../ts-types/base-table';
2
+ export declare function getHierarchyOffset(col: number, row: number, table: BaseTableAPI): number;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.getHierarchyOffset = void 0;
6
+
7
+ const ts_types_1 = require("../../ts-types");
8
+
9
+ function getHierarchyOffset(col, row, table) {
10
+ var _a, _b, _c;
11
+ let cellHierarchyIndent = 0;
12
+ const layoutMap = table.internalProps.layoutMap;
13
+ if (layoutMap.isHeader(col, row)) {
14
+ const hd = layoutMap.getHeader(col, row);
15
+ (null == hd ? void 0 : hd.hierarchyLevel) && (cellHierarchyIndent = (null !== (_a = hd.hierarchyLevel) && void 0 !== _a ? _a : 0) * (null !== (_b = layoutMap.rowHierarchyIndent) && void 0 !== _b ? _b : 0));
16
+ } else {
17
+ const define = table.getBodyColumnDefine(col, row);
18
+ if (null == define ? void 0 : define.tree) {
19
+ const indexArr = table.dataSource.getIndexKey(table.getRecordIndexByRow(col, row));
20
+ cellHierarchyIndent = Array.isArray(indexArr) && table.getHierarchyState(col, row) !== ts_types_1.HierarchyState.none ? (indexArr.length - 1) * (null !== (_c = layoutMap.hierarchyIndent) && void 0 !== _c ? _c : 0) : 0;
21
+ }
22
+ }
23
+ return cellHierarchyIndent;
24
+ }
25
+
26
+ exports.getHierarchyOffset = getHierarchyOffset;
27
+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,CAAC;AAC7B,CAAC;AAxBD,gDAwBC","file":"get-hierarchy-offset.js","sourcesContent":["import type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { HierarchyState } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport function getHierarchyOffset(col: number, row: number, table: BaseTableAPI): number {\n // 处理树形展开\n let cellHierarchyIndent = 0;\n const layoutMap = table.internalProps.layoutMap;\n //判断是否为表头\n if (layoutMap.isHeader(col, row)) {\n const hd = layoutMap.getHeader(col, row);\n if (hd?.hierarchyLevel) {\n cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * ((layoutMap as PivotHeaderLayoutMap).rowHierarchyIndent ?? 0);\n }\n } else {\n // 基本表格表身body单元格 如果是树形展开 需要考虑缩进值\n // const cellHierarchyState = table.getHierarchyState(col, row);\n const define = table.getBodyColumnDefine(col, row);\n if (define?.tree) {\n const indexArr = table.dataSource.getIndexKey(table.getRecordIndexByRow(col, row));\n cellHierarchyIndent =\n Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none\n ? (indexArr.length - 1) * ((layoutMap as SimpleHeaderLayoutMap).hierarchyIndent ?? 0)\n : 0;\n }\n }\n\n return cellHierarchyIndent;\n}\n"]}
@@ -1 +1 @@
1
- export declare function getPadding(paddingOrigin: number | number[]): [number, number, number, number];
1
+ export declare function getQuadProps(paddingOrigin: number | number[]): [number, number, number, number];
@@ -2,15 +2,15 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.getPadding = void 0;
5
+ }), exports.getQuadProps = void 0;
6
6
 
7
7
  const vrender_1 = require("@visactor/vrender");
8
8
 
9
- function getPadding(paddingOrigin) {
9
+ function getQuadProps(paddingOrigin) {
10
10
  let padding = (0, vrender_1.parsePadding)(paddingOrigin);
11
11
  return "number" == typeof padding || "string" == typeof padding ? padding = [ padding, padding, padding, padding ] : Array.isArray(padding) && (padding = padding.slice(0)),
12
12
  padding;
13
13
  }
14
14
 
15
- exports.getPadding = getPadding;
15
+ exports.getQuadProps = getQuadProps;
16
16
  //# sourceMappingURL=padding.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/utils/padding.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AAEjD,SAAgB,UAAU,CAAC,aAAgC;IACzD,IAAI,OAAO,GAAG,IAAA,sBAAY,EAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC9D,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACjC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAQ,CAAC;KACnC;IACD,OAAO,OAAc,CAAC;AACxB,CAAC;AARD,gCAQC","file":"padding.js","sourcesContent":["import { parsePadding } from '@visactor/vrender';\n\nexport function getPadding(paddingOrigin: number | number[]): [number, number, number, number] {\n let padding = parsePadding(paddingOrigin);\n if (typeof padding === 'number' || typeof padding === 'string') {\n padding = [padding, padding, padding, padding];\n } else if (Array.isArray(padding)) {\n padding = padding.slice(0) as any;\n }\n return padding as any;\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/utils/padding.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AAEjD,SAAgB,YAAY,CAAC,aAAgC;IAC3D,IAAI,OAAO,GAAG,IAAA,sBAAY,EAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC9D,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACjC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAQ,CAAC;KACnC;IACD,OAAO,OAAc,CAAC;AACxB,CAAC;AARD,oCAQC","file":"padding.js","sourcesContent":["import { parsePadding } from '@visactor/vrender';\n\nexport function getQuadProps(paddingOrigin: number | number[]): [number, number, number, number] {\n let padding = parsePadding(paddingOrigin);\n if (typeof padding === 'number' || typeof padding === 'string') {\n padding = [padding, padding, padding, padding];\n } else if (Array.isArray(padding)) {\n padding = padding.slice(0) as any;\n }\n return padding as any;\n}\n"]}
@@ -3,7 +3,8 @@ import type { ColumnIconOption } from '../../ts-types';
3
3
  import type { Group } from '../graphic/group';
4
4
  import { Icon } from '../graphic/icon';
5
5
  import type { Scenegraph } from '../scenegraph';
6
- export declare function createCellContent(cellGroup: Group, icons: ColumnIconOption[] | null, textStr: string, padding: [number, number, number, number], autoColWidth: boolean, autoRowHeight: boolean, autoWrapText: boolean, lineClamp: number | undefined, cellWidth: number, cellHeight: number, textAlign: CanvasTextAlign, textBaseline: CanvasTextBaseline, cellTheme?: IThemeSpec): void;
7
- export declare function dealWithIcon(icon: ColumnIconOption, mark?: Icon): Icon;
6
+ import type { BaseTableAPI } from '../../ts-types/base-table';
7
+ export declare function createCellContent(cellGroup: Group, icons: ColumnIconOption[] | null, textStr: string, padding: [number, number, number, number], autoColWidth: boolean, autoRowHeight: boolean, autoWrapText: boolean, lineClamp: number | undefined, cellWidth: number, cellHeight: number, textAlign: CanvasTextAlign, textBaseline: CanvasTextBaseline, table: BaseTableAPI, cellTheme?: IThemeSpec): void;
8
+ export declare function dealWithIcon(icon: ColumnIconOption, mark?: Icon, col?: number, row?: number, table?: BaseTableAPI): Icon;
8
9
  export declare function updateCellContentWidth(cellGroup: Group, distWidth: number, detaX: number, autoRowHeight: boolean, padding: [number, number, number, number], textAlign: CanvasTextAlign, textBaseline: CanvasTextBaseline, scene: Scenegraph): boolean;
9
10
  export declare function updateCellContentHeight(cellGroup: Group, distHeight: number, detaY: number, autoRowHeight: boolean, padding: [number, number, number, number], textAlign: CanvasTextAlign, textBaseline: CanvasTextBaseline): void;
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.updateCellContentHeight = exports.updateCellContentWidth = exports.dealWithIcon = exports.createCellContent = void 0;
6
6
 
7
- const vrender_1 = require("@visactor/vrender"), util_1 = require("../../tools/util"), ts_types_1 = require("../../ts-types"), cell_content_1 = require("../component/cell-content"), icon_1 = require("../graphic/icon"), text_1 = require("../graphic/text"), get_cell_merge_1 = require("./get-cell-merge");
7
+ const vrender_1 = require("@visactor/vrender"), util_1 = require("../../tools/util"), ts_types_1 = require("../../ts-types"), cell_content_1 = require("../component/cell-content"), icon_1 = require("../graphic/icon"), text_1 = require("../graphic/text"), get_cell_merge_1 = require("./get-cell-merge"), get_hierarchy_offset_1 = require("./get-hierarchy-offset"), vutils_1 = require("@visactor/vutils");
8
8
 
9
- function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, cellTheme) {
9
+ function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme) {
10
10
  var _a, _b, _c;
11
11
  const leftIcons = [], rightIcons = [], contentLeftIcons = [], contentRightIcons = [], inlineFrontIcons = [], inlineEndIcons = [], absoluteLeftIcons = [], absoluteRightIcons = [];
12
12
  let contentWidth, contentHeight, leftIconWidth = 0, leftIconHeight = 0, rightIconWidth = 0, rightIconHeight = 0, absoluteLeftIconWidth = 0, absoluteRightIconWidth = 0;
@@ -43,31 +43,31 @@ function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, aut
43
43
  }
44
44
  })), leftIcons.forEach((icon => {
45
45
  var _a, _b, _c;
46
- const iconMark = dealWithIcon(icon);
46
+ const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, table);
47
47
  iconMark.role = "icon-left", iconMark.name = icon.name, iconMark.setAttribute("x", leftIconWidth + (null !== (_a = iconMark.attribute.marginLeft) && void 0 !== _a ? _a : 0)),
48
48
  leftIconWidth += iconMark.AABBBounds.width() + (null !== (_b = iconMark.attribute.marginLeft) && void 0 !== _b ? _b : 0) + (null !== (_c = iconMark.attribute.marginRight) && void 0 !== _c ? _c : 0),
49
49
  leftIconHeight = Math.max(leftIconHeight, iconMark.AABBBounds.height()), cellGroup.appendChild(iconMark);
50
50
  })), rightIcons.forEach((icon => {
51
51
  var _a, _b, _c;
52
- const iconMark = dealWithIcon(icon);
52
+ const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, table);
53
53
  iconMark.role = "icon-right", iconMark.name = icon.name, iconMark.setAttribute("x", rightIconWidth + (null !== (_a = iconMark.attribute.marginLeft) && void 0 !== _a ? _a : 0)),
54
54
  rightIconWidth += iconMark.AABBBounds.width() + (null !== (_b = iconMark.attribute.marginLeft) && void 0 !== _b ? _b : 0) + (null !== (_c = iconMark.attribute.marginRight) && void 0 !== _c ? _c : 0),
55
55
  rightIconHeight = Math.max(rightIconHeight, iconMark.AABBBounds.height()), cellGroup.appendChild(iconMark);
56
56
  })), absoluteLeftIcons.forEach((icon => {
57
57
  var _a, _b, _c;
58
- const iconMark = dealWithIcon(icon);
58
+ const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, table);
59
59
  iconMark.role = "icon-absolute-left", iconMark.name = icon.name, iconMark.setAttribute("x", absoluteLeftIconWidth + (null !== (_a = iconMark.attribute.marginLeft) && void 0 !== _a ? _a : 0)),
60
60
  absoluteLeftIconWidth += iconMark.AABBBounds.width() + (null !== (_b = iconMark.attribute.marginLeft) && void 0 !== _b ? _b : 0) + (null !== (_c = iconMark.attribute.marginRight) && void 0 !== _c ? _c : 0),
61
61
  cellGroup.appendChild(iconMark);
62
62
  })), absoluteRightIcons.forEach((icon => {
63
63
  var _a, _b, _c;
64
- const iconMark = dealWithIcon(icon);
64
+ const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, table);
65
65
  iconMark.role = "icon-absolute-right", iconMark.name = icon.name, iconMark.setAttribute("x", absoluteRightIconWidth + (null !== (_a = iconMark.attribute.marginLeft) && void 0 !== _a ? _a : 0)),
66
66
  absoluteRightIconWidth += iconMark.AABBBounds.width() + (null !== (_b = iconMark.attribute.marginLeft) && void 0 !== _b ? _b : 0) + (null !== (_c = iconMark.attribute.marginRight) && void 0 !== _c ? _c : 0),
67
67
  cellGroup.appendChild(iconMark);
68
68
  })), 0 === inlineFrontIcons.length && 0 === inlineEndIcons.length) {
69
- const attribute = {
70
- text: (0, util_1.convertInternal)(textStr).replace(/\r?\n/g, "\n").replace(/\r/g, "\n").split("\n"),
69
+ const text = (0, util_1.convertInternal)(textStr).replace(/\r?\n/g, "\n").replace(/\r/g, "\n").split("\n"), attribute = {
70
+ text: 1 !== text.length || autoWrapText ? text : text[0],
71
71
  maxLineWidth: autoColWidth ? 1 / 0 : cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth,
72
72
  textBaseline: "top",
73
73
  heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),
@@ -106,24 +106,26 @@ function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, aut
106
106
  align: textAlign,
107
107
  baseline: textBaseline
108
108
  }), contentLeftIcons.forEach((icon => {
109
- const iconMark = dealWithIcon(icon);
109
+ const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, table);
110
110
  iconMark.role = "icon-content-left", iconMark.name = icon.name, cellContent.addLeftOccupyingIcon(iconMark);
111
111
  })), contentRightIcons.forEach((icon => {
112
- const iconMark = dealWithIcon(icon);
112
+ const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, table);
113
113
  iconMark.role = "icon-content-right", iconMark.name = icon.name, cellContent.addRightOccupyingIcon(iconMark);
114
114
  })), cellContent.addContent(textMark), cellGroup.appendChild(cellContent), cellContent.layout(),
115
115
  contentWidth = cellContent.AABBBounds.width(), contentHeight = cellContent.AABBBounds.height();
116
116
  } else cellGroup.firstChild ? cellGroup.insertBefore(textMark, cellGroup.firstChild) : cellGroup.appendChild(textMark),
117
117
  contentWidth = textMark.AABBBounds.width(), contentHeight = textMark.AABBBounds.height();
118
118
  } else {
119
- const attribute = {
120
- text: (0, util_1.convertInternal)(textStr).replace(/\r?\n/g, "\n").replace(/\r/g, "\n").split("\n"),
121
- maxLineWidth: autoColWidth ? 1 / 0 : cellWidth - (padding[1] + padding[3]),
119
+ const text = (0, util_1.convertInternal)(textStr).replace(/\r?\n/g, "\n").replace(/\r/g, "\n").split("\n"), hierarchyOffset = (0,
120
+ get_hierarchy_offset_1.getHierarchyOffset)(cellGroup.col, cellGroup.row, table), attribute = {
121
+ text: 1 !== text.length || autoWrapText ? text : text[0],
122
+ maxLineWidth: autoColWidth ? 1 / 0 : cellWidth - (padding[1] + padding[3] + hierarchyOffset),
122
123
  textBaseline: "top",
123
124
  autoWrapText: autoWrapText,
124
125
  lineClamp: lineClamp,
125
126
  heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),
126
- pickable: !1
127
+ pickable: !1,
128
+ dx: hierarchyOffset
127
129
  }, wrapText = new text_1.WrapText(cellTheme && cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
128
130
  wrapText.name = "text", cellGroup.appendChild(wrapText), contentWidth = wrapText.AABBBounds.width(),
129
131
  contentHeight = wrapText.AABBBounds.height();
@@ -139,12 +141,15 @@ function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, aut
139
141
  });
140
142
  }
141
143
 
142
- function dealWithIcon(icon, mark) {
144
+ function dealWithIcon(icon, mark, col, row, table) {
143
145
  var _a, _b, _c, _d, _e, _f;
144
146
  const iconAttribute = {};
145
- if ("image" === icon.type ? iconAttribute.image = icon.src : ("svg" === icon.type || "svg" in icon) && (iconAttribute.image = icon.svg),
147
+ "image" === icon.type ? iconAttribute.image = icon.src : ("svg" === icon.type || "svg" in icon) && (iconAttribute.image = icon.svg),
146
148
  iconAttribute.width = icon.width, iconAttribute.height = icon.height, iconAttribute.visibleTime = null !== (_a = icon.visibleTime) && void 0 !== _a ? _a : "always",
147
- iconAttribute.funcType = icon.funcType, iconAttribute.marginLeft = null !== (_b = icon.marginLeft) && void 0 !== _b ? _b : 0,
149
+ iconAttribute.funcType = icon.funcType;
150
+ let hierarchyOffset = 0;
151
+ if ((0, vutils_1.isNumber)(col) && (0, vutils_1.isNumber)(row) && table && (icon.funcType === ts_types_1.IconFuncTypeEnum.collapse || icon.funcType === ts_types_1.IconFuncTypeEnum.expand) && (hierarchyOffset = (0,
152
+ get_hierarchy_offset_1.getHierarchyOffset)(col, row, table)), iconAttribute.marginLeft = (null !== (_b = icon.marginLeft) && void 0 !== _b ? _b : 0) + hierarchyOffset,
148
153
  iconAttribute.marginRight = null !== (_c = icon.marginRight) && void 0 !== _c ? _c : 0,
149
154
  icon.interactive && (iconAttribute.pickable = !1), icon.hover && (iconAttribute.backgroundWidth = null !== (_d = icon.hover.width) && void 0 !== _d ? _d : icon.width,
150
155
  iconAttribute.backgroundHeight = null !== (_e = icon.hover.width) && void 0 !== _e ? _e : icon.width,
@@ -196,10 +201,10 @@ function updateCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, padd
196
201
  let newHeight = Math.max(leftIconHeight, contentHeight, rightIconHeight);
197
202
  if (isCellHeightUpdate(scene, cellGroup, newHeight + padding[0] + padding[2], oldCellHeight)) return !0;
198
203
  newHeight = cellGroup.attribute.height - (padding[0] + padding[2]), cellGroup.forEachChildren((child => {
199
- "rect" !== child.type && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", padding[0] + (newHeight - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", padding[0] + newHeight - child.AABBBounds.height()) : child.setAttribute("y", padding[0]));
204
+ "rect" !== child.type && "chart" !== child.type && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", padding[0] + (newHeight - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", padding[0] + newHeight - child.AABBBounds.height()) : child.setAttribute("y", padding[0]));
200
205
  }));
201
206
  } else "middle" !== textBaseline && "bottom" !== textBaseline || cellGroup.forEachChildren((child => {
202
- "rect" !== child.type && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", (cellGroup.attribute.height - padding[2] + padding[0] - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", cellGroup.attribute.height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]));
207
+ "rect" !== child.type && "chart" !== child.type && ("mark" === child.name ? child.setAttribute("y", 0) : "middle" === textBaseline ? child.setAttribute("y", (cellGroup.attribute.height - padding[2] + padding[0] - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", cellGroup.attribute.height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]));
203
208
  }));
204
209
  return !1;
205
210
  }