@visactor/vtable 0.17.10-alpha.7 → 0.17.10

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 (419) hide show
  1. package/cjs/ListTable.js +11 -4
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.js +10 -3
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/components/axis/axis.js +4 -1
  6. package/cjs/components/axis/axis.js.map +1 -1
  7. package/cjs/components/axis/label-overlap.js.map +1 -1
  8. package/cjs/core/BaseTable.d.ts +2 -2
  9. package/cjs/core/BaseTable.js +4 -4
  10. package/cjs/core/BaseTable.js.map +1 -1
  11. package/cjs/core/style.js +1 -2
  12. package/cjs/core/tableHelper.d.ts +1 -1
  13. package/cjs/core/tableHelper.js +2 -1
  14. package/cjs/core/tableHelper.js.map +1 -1
  15. package/cjs/event/event.d.ts +1 -1
  16. package/cjs/event/event.js +2 -2
  17. package/cjs/event/event.js.map +1 -1
  18. package/cjs/event/listener/scroll-bar.js.map +1 -1
  19. package/cjs/event/listener/table-group.js +1 -1
  20. package/cjs/event/listener/table-group.js.map +1 -1
  21. package/cjs/event/listener/touch.js.map +1 -1
  22. package/cjs/event/media-click.js +5 -2
  23. package/cjs/event/media-click.js.map +1 -1
  24. package/cjs/event/pivot-chart/axis-click.js.map +1 -1
  25. package/cjs/event/scroll.js +1 -0
  26. package/cjs/event/util.d.ts +1 -1
  27. package/cjs/event/util.js.map +1 -1
  28. package/cjs/index.d.ts +2 -2
  29. package/cjs/index.js +3 -3
  30. package/cjs/index.js.map +1 -1
  31. package/cjs/layout/chart-helper/get-chart-spec.d.ts +1 -0
  32. package/cjs/layout/chart-helper/get-chart-spec.js +13 -2
  33. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  34. package/cjs/layout/pivot-header-layout.d.ts +1 -0
  35. package/cjs/layout/pivot-header-layout.js +3 -0
  36. package/cjs/layout/pivot-header-layout.js.map +1 -1
  37. package/cjs/layout/simple-header-layout.d.ts +1 -0
  38. package/cjs/layout/simple-header-layout.js +3 -0
  39. package/cjs/layout/simple-header-layout.js.map +1 -1
  40. package/cjs/render/jsx/index.d.ts +1 -1
  41. package/cjs/render/jsx/index.js +1 -1
  42. package/cjs/render/jsx/index.js.map +1 -1
  43. package/cjs/render/layout/arc.d.ts +2 -2
  44. package/cjs/render/layout/arc.js +1 -1
  45. package/cjs/render/layout/arc.js.map +1 -1
  46. package/cjs/render/layout/circle.d.ts +2 -2
  47. package/cjs/render/layout/circle.js +1 -1
  48. package/cjs/render/layout/circle.js.map +1 -1
  49. package/cjs/render/layout/container.d.ts +2 -2
  50. package/cjs/render/layout/container.js +1 -1
  51. package/cjs/render/layout/container.js.map +1 -1
  52. package/cjs/render/layout/group.d.ts +2 -2
  53. package/cjs/render/layout/group.js +1 -1
  54. package/cjs/render/layout/group.js.map +1 -1
  55. package/cjs/render/layout/icon.d.ts +2 -2
  56. package/cjs/render/layout/icon.js +1 -1
  57. package/cjs/render/layout/icon.js.map +1 -1
  58. package/cjs/render/layout/image.d.ts +2 -2
  59. package/cjs/render/layout/image.js +1 -1
  60. package/cjs/render/layout/image.js.map +1 -1
  61. package/cjs/render/layout/rect.d.ts +2 -2
  62. package/cjs/render/layout/rect.js +1 -1
  63. package/cjs/render/layout/rect.js.map +1 -1
  64. package/cjs/render/layout/text.d.ts +1 -1
  65. package/cjs/render/layout/text.js +1 -1
  66. package/cjs/render/layout/text.js.map +1 -1
  67. package/cjs/scenegraph/component/cell-content.d.ts +2 -2
  68. package/cjs/scenegraph/component/cell-content.js +1 -1
  69. package/cjs/scenegraph/component/cell-content.js.map +1 -1
  70. package/cjs/scenegraph/component/cell-mover.d.ts +1 -1
  71. package/cjs/scenegraph/component/cell-mover.js +1 -1
  72. package/cjs/scenegraph/component/cell-mover.js.map +1 -1
  73. package/cjs/scenegraph/component/custom.d.ts +1 -6
  74. package/cjs/scenegraph/component/custom.js +4 -21
  75. package/cjs/scenegraph/component/custom.js.map +1 -1
  76. package/cjs/scenegraph/component/drill-icon.js.map +1 -1
  77. package/cjs/scenegraph/component/menu.d.ts +1 -1
  78. package/cjs/scenegraph/component/menu.js +1 -1
  79. package/cjs/scenegraph/component/menu.js.map +1 -1
  80. package/cjs/scenegraph/component/table-component.d.ts +1 -1
  81. package/cjs/scenegraph/component/table-component.js +1 -1
  82. package/cjs/scenegraph/component/table-component.js.map +1 -1
  83. package/cjs/scenegraph/debug-tool/debug-tool.d.ts +1 -1
  84. package/cjs/scenegraph/debug-tool/debug-tool.js +1 -1
  85. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  86. package/cjs/scenegraph/debug-tool/index.d.ts +1 -1
  87. package/cjs/scenegraph/debug-tool/index.js.map +1 -1
  88. package/cjs/scenegraph/graphic/chart.d.ts +2 -2
  89. package/cjs/scenegraph/graphic/chart.js +1 -1
  90. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  91. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  92. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -1
  93. package/cjs/scenegraph/graphic/contributions/chart-render.js +1 -1
  94. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  95. package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +2 -2
  96. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +1 -1
  97. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  98. package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +2 -2
  99. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +1 -1
  100. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  101. package/cjs/scenegraph/graphic/contributions/index.d.ts +1 -1
  102. package/cjs/scenegraph/graphic/contributions/index.js +1 -1
  103. package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
  104. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +2 -2
  105. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  106. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  107. package/cjs/scenegraph/graphic/group.d.ts +2 -2
  108. package/cjs/scenegraph/graphic/group.js +1 -1
  109. package/cjs/scenegraph/graphic/group.js.map +1 -1
  110. package/cjs/scenegraph/graphic/icon.d.ts +2 -2
  111. package/cjs/scenegraph/graphic/icon.js +1 -1
  112. package/cjs/scenegraph/graphic/icon.js.map +1 -1
  113. package/cjs/scenegraph/graphic/text.d.ts +2 -2
  114. package/cjs/scenegraph/graphic/text.js +1 -1
  115. package/cjs/scenegraph/graphic/text.js.map +1 -1
  116. package/cjs/scenegraph/group-creater/cell-helper.d.ts +3 -6
  117. package/cjs/scenegraph/group-creater/cell-helper.js +39 -41
  118. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  119. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  120. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  121. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
  122. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  123. package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  124. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +42 -18
  125. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  126. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +1 -1
  127. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  128. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
  129. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  130. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  131. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -3
  132. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +3 -7
  133. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  134. package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  135. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  136. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  137. package/cjs/scenegraph/group-creater/column-helper.d.ts +1 -1
  138. package/cjs/scenegraph/group-creater/column-helper.js +7 -11
  139. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  140. package/cjs/scenegraph/icon/icon-update.js +1 -1
  141. package/cjs/scenegraph/icon/icon-update.js.map +1 -1
  142. package/cjs/scenegraph/layout/compute-col-width.js +3 -2
  143. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  144. package/cjs/scenegraph/layout/compute-row-height.js +1 -1
  145. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  146. package/cjs/scenegraph/layout/move-cell.js.map +1 -1
  147. package/cjs/scenegraph/layout/update-col.js.map +1 -1
  148. package/cjs/scenegraph/layout/update-height.js +16 -18
  149. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  150. package/cjs/scenegraph/layout/update-row.js +40 -7
  151. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  152. package/cjs/scenegraph/layout/update-width.js +17 -19
  153. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  154. package/cjs/scenegraph/refresh-node/update-chart.js +11 -1
  155. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  156. package/cjs/scenegraph/scenegraph.d.ts +1 -1
  157. package/cjs/scenegraph/scenegraph.js +2 -2
  158. package/cjs/scenegraph/scenegraph.js.map +1 -1
  159. package/cjs/scenegraph/select/create-select-border.js +1 -1
  160. package/cjs/scenegraph/select/create-select-border.js.map +1 -1
  161. package/cjs/scenegraph/select/delete-select-border.js.map +1 -1
  162. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  163. package/cjs/scenegraph/stick-text/index.js +9 -4
  164. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  165. package/cjs/scenegraph/style/corner-cell.js.map +1 -1
  166. package/cjs/scenegraph/style/frame-border.js +1 -1
  167. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  168. package/cjs/scenegraph/utils/get-cell-merge.js +0 -4
  169. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  170. package/cjs/scenegraph/utils/padding.js +1 -1
  171. package/cjs/scenegraph/utils/padding.js.map +1 -1
  172. package/cjs/scenegraph/utils/render-service.d.ts +1 -1
  173. package/cjs/scenegraph/utils/render-service.js +1 -1
  174. package/cjs/scenegraph/utils/render-service.js.map +1 -1
  175. package/cjs/scenegraph/utils/text-icon-layout.d.ts +4 -4
  176. package/cjs/scenegraph/utils/text-icon-layout.js +11 -13
  177. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  178. package/cjs/scenegraph/utils/text-measure.d.ts +2 -2
  179. package/cjs/scenegraph/utils/text-measure.js +1 -1
  180. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  181. package/cjs/scenegraph/utils/text-pos.d.ts +1 -1
  182. package/cjs/scenegraph/utils/text-pos.js.map +1 -1
  183. package/cjs/state/select/update-position.js +4 -10
  184. package/cjs/state/select/update-position.js.map +1 -1
  185. package/cjs/state/spark-line/index.js +1 -1
  186. package/cjs/state/spark-line/index.js.map +1 -1
  187. package/cjs/state/state.d.ts +1 -1
  188. package/cjs/state/state.js.map +1 -1
  189. package/cjs/themes/ARCO.js +1 -2
  190. package/cjs/themes/BRIGHT.js +2 -1
  191. package/cjs/tools/NumberMap.js +1 -1
  192. package/cjs/ts-types/base-table.d.ts +2 -2
  193. package/cjs/ts-types/base-table.js.map +1 -1
  194. package/cjs/ts-types/component/title.d.ts +1 -1
  195. package/cjs/ts-types/component/title.js.map +1 -1
  196. package/cjs/ts-types/events.d.ts +1 -1
  197. package/cjs/ts-types/events.js.map +1 -1
  198. package/cjs/ts-types/list-table/define/image-define.d.ts +2 -0
  199. package/cjs/ts-types/list-table/define/image-define.js.map +1 -1
  200. package/cjs/ts-types/pivot-table/dimension/image-dimension.d.ts +1 -0
  201. package/cjs/ts-types/pivot-table/dimension/image-dimension.js.map +1 -1
  202. package/cjs/ts-types/pivot-table/indicator/image-indicator.d.ts +2 -0
  203. package/cjs/ts-types/pivot-table/indicator/image-indicator.js.map +1 -1
  204. package/cjs/ts-types/table-engine.d.ts +1 -5
  205. package/cjs/ts-types/table-engine.js.map +1 -1
  206. package/cjs/vrender.d.ts +4 -0
  207. package/cjs/vrender.js +40 -0
  208. package/cjs/vrender.js.map +1 -0
  209. package/dist/vtable.js +1389 -1234
  210. package/dist/vtable.min.js +2 -2
  211. package/es/ListTable.js +11 -4
  212. package/es/ListTable.js.map +1 -1
  213. package/es/PivotTable.js +10 -3
  214. package/es/PivotTable.js.map +1 -1
  215. package/es/components/axis/axis.js +4 -1
  216. package/es/components/axis/axis.js.map +1 -1
  217. package/es/components/axis/label-overlap.js.map +1 -1
  218. package/es/core/BaseTable.d.ts +2 -2
  219. package/es/core/BaseTable.js +4 -4
  220. package/es/core/BaseTable.js.map +1 -1
  221. package/es/core/style.js +1 -2
  222. package/es/core/tableHelper.d.ts +1 -1
  223. package/es/core/tableHelper.js +2 -1
  224. package/es/core/tableHelper.js.map +1 -1
  225. package/es/event/event.d.ts +1 -1
  226. package/es/event/event.js +2 -2
  227. package/es/event/event.js.map +1 -1
  228. package/es/event/listener/scroll-bar.js.map +1 -1
  229. package/es/event/listener/table-group.js +1 -1
  230. package/es/event/listener/table-group.js.map +1 -1
  231. package/es/event/listener/touch.js.map +1 -1
  232. package/es/event/media-click.js +5 -2
  233. package/es/event/media-click.js.map +1 -1
  234. package/es/event/pivot-chart/axis-click.js.map +1 -1
  235. package/es/event/scroll.js +2 -1
  236. package/es/event/util.d.ts +1 -1
  237. package/es/event/util.js.map +1 -1
  238. package/es/index.d.ts +2 -2
  239. package/es/index.js +4 -2
  240. package/es/index.js.map +1 -1
  241. package/es/layout/chart-helper/get-chart-spec.d.ts +1 -0
  242. package/es/layout/chart-helper/get-chart-spec.js +11 -0
  243. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  244. package/es/layout/pivot-header-layout.d.ts +1 -0
  245. package/es/layout/pivot-header-layout.js +4 -1
  246. package/es/layout/pivot-header-layout.js.map +1 -1
  247. package/es/layout/simple-header-layout.d.ts +1 -0
  248. package/es/layout/simple-header-layout.js +4 -1
  249. package/es/layout/simple-header-layout.js.map +1 -1
  250. package/es/render/jsx/index.d.ts +1 -1
  251. package/es/render/jsx/index.js +1 -1
  252. package/es/render/jsx/index.js.map +1 -1
  253. package/es/render/layout/arc.d.ts +2 -2
  254. package/es/render/layout/arc.js +1 -1
  255. package/es/render/layout/arc.js.map +1 -1
  256. package/es/render/layout/circle.d.ts +2 -2
  257. package/es/render/layout/circle.js +1 -1
  258. package/es/render/layout/circle.js.map +1 -1
  259. package/es/render/layout/container.d.ts +2 -2
  260. package/es/render/layout/container.js +1 -1
  261. package/es/render/layout/container.js.map +1 -1
  262. package/es/render/layout/group.d.ts +2 -2
  263. package/es/render/layout/group.js +1 -1
  264. package/es/render/layout/group.js.map +1 -1
  265. package/es/render/layout/icon.d.ts +2 -2
  266. package/es/render/layout/icon.js +1 -1
  267. package/es/render/layout/icon.js.map +1 -1
  268. package/es/render/layout/image.d.ts +2 -2
  269. package/es/render/layout/image.js +1 -1
  270. package/es/render/layout/image.js.map +1 -1
  271. package/es/render/layout/rect.d.ts +2 -2
  272. package/es/render/layout/rect.js +1 -1
  273. package/es/render/layout/rect.js.map +1 -1
  274. package/es/render/layout/text.d.ts +1 -1
  275. package/es/render/layout/text.js +1 -1
  276. package/es/render/layout/text.js.map +1 -1
  277. package/es/scenegraph/component/cell-content.d.ts +2 -2
  278. package/es/scenegraph/component/cell-content.js +1 -1
  279. package/es/scenegraph/component/cell-content.js.map +1 -1
  280. package/es/scenegraph/component/cell-mover.d.ts +1 -1
  281. package/es/scenegraph/component/cell-mover.js +1 -1
  282. package/es/scenegraph/component/cell-mover.js.map +1 -1
  283. package/es/scenegraph/component/custom.d.ts +1 -6
  284. package/es/scenegraph/component/custom.js +2 -20
  285. package/es/scenegraph/component/custom.js.map +1 -1
  286. package/es/scenegraph/component/drill-icon.js.map +1 -1
  287. package/es/scenegraph/component/menu.d.ts +1 -1
  288. package/es/scenegraph/component/menu.js +1 -1
  289. package/es/scenegraph/component/menu.js.map +1 -1
  290. package/es/scenegraph/component/table-component.d.ts +1 -1
  291. package/es/scenegraph/component/table-component.js +1 -1
  292. package/es/scenegraph/component/table-component.js.map +1 -1
  293. package/es/scenegraph/debug-tool/debug-tool.d.ts +1 -1
  294. package/es/scenegraph/debug-tool/debug-tool.js +1 -1
  295. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  296. package/es/scenegraph/debug-tool/index.d.ts +1 -1
  297. package/es/scenegraph/debug-tool/index.js.map +1 -1
  298. package/es/scenegraph/graphic/chart.d.ts +2 -2
  299. package/es/scenegraph/graphic/chart.js +1 -1
  300. package/es/scenegraph/graphic/chart.js.map +1 -1
  301. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  302. package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -1
  303. package/es/scenegraph/graphic/contributions/chart-render.js +1 -1
  304. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  305. package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +2 -2
  306. package/es/scenegraph/graphic/contributions/group-contribution-render.js +1 -1
  307. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  308. package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +2 -2
  309. package/es/scenegraph/graphic/contributions/image-contribution-render.js +1 -1
  310. package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  311. package/es/scenegraph/graphic/contributions/index.d.ts +1 -1
  312. package/es/scenegraph/graphic/contributions/index.js +1 -1
  313. package/es/scenegraph/graphic/contributions/index.js.map +1 -1
  314. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +2 -2
  315. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  316. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  317. package/es/scenegraph/graphic/group.d.ts +2 -2
  318. package/es/scenegraph/graphic/group.js +1 -1
  319. package/es/scenegraph/graphic/group.js.map +1 -1
  320. package/es/scenegraph/graphic/icon.d.ts +2 -2
  321. package/es/scenegraph/graphic/icon.js +1 -1
  322. package/es/scenegraph/graphic/icon.js.map +1 -1
  323. package/es/scenegraph/graphic/text.d.ts +2 -2
  324. package/es/scenegraph/graphic/text.js +1 -1
  325. package/es/scenegraph/graphic/text.js.map +1 -1
  326. package/es/scenegraph/group-creater/cell-helper.d.ts +3 -6
  327. package/es/scenegraph/group-creater/cell-helper.js +37 -38
  328. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  329. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  330. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  331. package/es/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
  332. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  333. package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  334. package/es/scenegraph/group-creater/cell-type/image-cell.js +37 -16
  335. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  336. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +1 -1
  337. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  338. package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
  339. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  340. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  341. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -3
  342. package/es/scenegraph/group-creater/cell-type/text-cell.js +3 -7
  343. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  344. package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  345. package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  346. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  347. package/es/scenegraph/group-creater/column-helper.d.ts +1 -1
  348. package/es/scenegraph/group-creater/column-helper.js +6 -11
  349. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  350. package/es/scenegraph/icon/icon-update.js +1 -1
  351. package/es/scenegraph/icon/icon-update.js.map +1 -1
  352. package/es/scenegraph/layout/compute-col-width.js +3 -2
  353. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  354. package/es/scenegraph/layout/compute-row-height.js +1 -1
  355. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  356. package/es/scenegraph/layout/move-cell.js.map +1 -1
  357. package/es/scenegraph/layout/update-col.js.map +1 -1
  358. package/es/scenegraph/layout/update-height.js +15 -17
  359. package/es/scenegraph/layout/update-height.js.map +1 -1
  360. package/es/scenegraph/layout/update-row.js +40 -7
  361. package/es/scenegraph/layout/update-row.js.map +1 -1
  362. package/es/scenegraph/layout/update-width.js +16 -18
  363. package/es/scenegraph/layout/update-width.js.map +1 -1
  364. package/es/scenegraph/refresh-node/update-chart.js +11 -1
  365. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  366. package/es/scenegraph/scenegraph.d.ts +1 -1
  367. package/es/scenegraph/scenegraph.js +2 -2
  368. package/es/scenegraph/scenegraph.js.map +1 -1
  369. package/es/scenegraph/select/create-select-border.js +1 -1
  370. package/es/scenegraph/select/create-select-border.js.map +1 -1
  371. package/es/scenegraph/select/delete-select-border.js.map +1 -1
  372. package/es/scenegraph/select/update-select-border.js.map +1 -1
  373. package/es/scenegraph/stick-text/index.js +9 -4
  374. package/es/scenegraph/stick-text/index.js.map +1 -1
  375. package/es/scenegraph/style/corner-cell.js.map +1 -1
  376. package/es/scenegraph/style/frame-border.js +1 -1
  377. package/es/scenegraph/style/frame-border.js.map +1 -1
  378. package/es/scenegraph/utils/get-cell-merge.js +0 -4
  379. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  380. package/es/scenegraph/utils/padding.js +1 -1
  381. package/es/scenegraph/utils/padding.js.map +1 -1
  382. package/es/scenegraph/utils/render-service.d.ts +1 -1
  383. package/es/scenegraph/utils/render-service.js +1 -1
  384. package/es/scenegraph/utils/render-service.js.map +1 -1
  385. package/es/scenegraph/utils/text-icon-layout.d.ts +4 -4
  386. package/es/scenegraph/utils/text-icon-layout.js +11 -11
  387. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  388. package/es/scenegraph/utils/text-measure.d.ts +2 -2
  389. package/es/scenegraph/utils/text-measure.js +1 -1
  390. package/es/scenegraph/utils/text-measure.js.map +1 -1
  391. package/es/scenegraph/utils/text-pos.d.ts +1 -1
  392. package/es/scenegraph/utils/text-pos.js.map +1 -1
  393. package/es/state/select/update-position.js +4 -10
  394. package/es/state/select/update-position.js.map +1 -1
  395. package/es/state/spark-line/index.js +1 -1
  396. package/es/state/spark-line/index.js.map +1 -1
  397. package/es/state/state.d.ts +1 -1
  398. package/es/state/state.js.map +1 -1
  399. package/es/themes/ARCO.js +1 -2
  400. package/es/themes/BRIGHT.js +2 -1
  401. package/es/tools/NumberMap.js +1 -1
  402. package/es/ts-types/base-table.d.ts +2 -2
  403. package/es/ts-types/base-table.js.map +1 -1
  404. package/es/ts-types/component/title.d.ts +1 -1
  405. package/es/ts-types/component/title.js.map +1 -1
  406. package/es/ts-types/events.d.ts +1 -1
  407. package/es/ts-types/events.js.map +1 -1
  408. package/es/ts-types/list-table/define/image-define.d.ts +2 -0
  409. package/es/ts-types/list-table/define/image-define.js.map +1 -1
  410. package/es/ts-types/pivot-table/dimension/image-dimension.d.ts +1 -0
  411. package/es/ts-types/pivot-table/dimension/image-dimension.js.map +1 -1
  412. package/es/ts-types/pivot-table/indicator/image-indicator.d.ts +2 -0
  413. package/es/ts-types/pivot-table/indicator/image-indicator.js.map +1 -1
  414. package/es/ts-types/table-engine.d.ts +1 -5
  415. package/es/ts-types/table-engine.js.map +1 -1
  416. package/es/vrender.d.ts +4 -0
  417. package/es/vrender.js +22 -0
  418. package/es/vrender.js.map +1 -0
  419. package/package.json +8 -7
package/dist/vtable.js CHANGED
@@ -5970,11 +5970,13 @@
5970
5970
  global: global,
5971
5971
  viewport: viewport,
5972
5972
  autoPreventDefault = !1,
5973
- clickInterval: clickInterval
5973
+ clickInterval: clickInterval,
5974
+ supportsTouchEvents = global.supportsTouchEvents,
5975
+ supportsPointerEvents = global.supportsPointerEvents
5974
5976
  } = params;
5975
5977
  this.manager = new EventManager$1(rootNode, {
5976
5978
  clickInterval: clickInterval
5977
- }), this.globalObj = global, this.supportsPointerEvents = global.supportsPointerEvents, this.supportsTouchEvents = global.supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.viewport = viewport, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
5979
+ }), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.viewport = viewport, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
5978
5980
  default: "inherit",
5979
5981
  pointer: "pointer"
5980
5982
  }, this.resolution = resolution, this.setTargetElement(targetElement);
@@ -6903,6 +6905,25 @@
6903
6905
  return lineHeight;
6904
6906
  };
6905
6907
 
6908
+ const normalizeRectAttributes = attribute => {
6909
+ if (!attribute) return {
6910
+ x: 0,
6911
+ y: 0,
6912
+ width: 0,
6913
+ height: 0
6914
+ };
6915
+ let width = isNil$1(attribute.width) ? attribute.x1 - attribute.x : attribute.width,
6916
+ height = isNil$1(attribute.height) ? attribute.y1 - attribute.y : attribute.height,
6917
+ x = 0,
6918
+ y = 0;
6919
+ return width < 0 ? (x = width, width = -width) : Number.isNaN(width) && (width = 0), height < 0 ? (y = height, height = -height) : Number.isNaN(height) && (height = 0), {
6920
+ x: x,
6921
+ y: y,
6922
+ width: width,
6923
+ height: height
6924
+ };
6925
+ };
6926
+
6906
6927
  var ColorType;
6907
6928
  !function (ColorType) {
6908
6929
  ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
@@ -7134,7 +7155,8 @@
7134
7155
  }
7135
7156
  constructor() {
7136
7157
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7137
- super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), params.background && this.loadImage(params.background, !0);
7158
+ var _a;
7159
+ super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0);
7138
7160
  }
7139
7161
  setMode(mode) {
7140
7162
  "3d" === mode ? this.set3dMode() : this.set2dMode();
@@ -8004,7 +8026,7 @@
8004
8026
  const SYMBOL_NUMBER_TYPE = genNumberType();
8005
8027
  const TEXT_NUMBER_TYPE = genNumberType();
8006
8028
  const GraphicService = Symbol.for("GraphicService");
8007
- const GraphicCreator$2 = Symbol.for("GraphicCreator");
8029
+ const GraphicCreator$1 = Symbol.for("GraphicCreator");
8008
8030
  const SVG_PARSE_ATTRIBUTE_MAP = {
8009
8031
  "stroke-linecap": "lineCap",
8010
8032
  "stroke-linejoin": "lineJoin",
@@ -10157,13 +10179,14 @@
10157
10179
  return super.needUpdateTag(key, RECT_UPDATE_TAG_KEY);
10158
10180
  }
10159
10181
  toCustomPath() {
10160
- const attribute = this.attribute;
10161
- let width = isNil$1(attribute.width) ? attribute.x1 - attribute.x : attribute.width,
10162
- height = isNil$1(attribute.height) ? attribute.y1 - attribute.y : attribute.height,
10163
- x = 0,
10164
- y = 0;
10165
- width < 0 && (x = width, width = -width), height < 0 && (y = height, height = -height);
10166
- const path = new CustomPath2D();
10182
+ const attribute = this.attribute,
10183
+ {
10184
+ x: x,
10185
+ y: y,
10186
+ width: width,
10187
+ height: height
10188
+ } = normalizeRectAttributes(attribute),
10189
+ path = new CustomPath2D();
10167
10190
  return path.moveTo(x, y), path.rect(x, y, width, height), path;
10168
10191
  }
10169
10192
  clone() {
@@ -12230,9 +12253,9 @@
12230
12253
  return !!visible || (aabbBounds.clear(), !1);
12231
12254
  }
12232
12255
  };
12233
- DefaultGraphicService = __decorate$19([injectable(), __param$F(0, inject(GraphicCreator$2)), __metadata$S("design:paramtypes", [Object])], DefaultGraphicService);
12256
+ DefaultGraphicService = __decorate$19([injectable(), __param$F(0, inject(GraphicCreator$1)), __metadata$S("design:paramtypes", [Object])], DefaultGraphicService);
12234
12257
 
12235
- let GraphicCreator$1 = class GraphicCreator {
12258
+ class GraphicCreator {
12236
12259
  constructor() {
12237
12260
  this.store = new Map();
12238
12261
  }
@@ -12243,12 +12266,12 @@
12243
12266
  const cb = this.store.get(name);
12244
12267
  return cb ? cb(params) : null;
12245
12268
  }
12246
- };
12247
- const graphicCreator$1 = new GraphicCreator$1();
12269
+ }
12270
+ const graphicCreator = new GraphicCreator();
12248
12271
 
12249
- let text$1;
12250
- function getTextBounds$1(params) {
12251
- return text$1 || (text$1 = graphicCreator$1.CreateGraphic("text", {})), text$1.setAttributes(params), text$1.AABBBounds;
12272
+ let text;
12273
+ function getTextBounds(params) {
12274
+ return text || (text = graphicCreator.CreateGraphic("text", {})), text.setAttributes(params), text.AABBBounds;
12252
12275
  }
12253
12276
 
12254
12277
  const result = {
@@ -12518,20 +12541,22 @@
12518
12541
  const resW = data.width,
12519
12542
  resH = data.height;
12520
12543
  if ("repeat-x" === backgroundMode) {
12521
- w = resW * (targetH / resH);
12544
+ w = resW * (targetH / resH), h = targetH;
12522
12545
  } else if ("repeat-y" === backgroundMode) {
12523
- h = resH * (targetW / resW);
12546
+ h = resH * (targetW / resW), w = targetW;
12524
12547
  }
12525
- const canvas = canvasAllocate.allocate({
12548
+ const dpr = context.dpr,
12549
+ canvas = canvasAllocate.allocate({
12526
12550
  width: w,
12527
12551
  height: h,
12528
- dpr: context.dpr
12552
+ dpr: dpr
12529
12553
  }),
12530
12554
  ctx = canvas.getContext("2d");
12531
- ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), document.body.appendChild(data), canvasAllocate.free(canvas);
12555
+ ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), canvasAllocate.free(canvas);
12532
12556
  }
12533
- const pattern = context.createPattern(data, backgroundMode);
12534
- context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, targetW, targetH), context.translate(-b.x1, -b.y1);
12557
+ const dpr = context.dpr,
12558
+ pattern = context.createPattern(data, backgroundMode);
12559
+ pattern.setTransform && pattern.setTransform(new DOMMatrix([1 / dpr, 0, 0, 1 / dpr, 0, 0])), context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, targetW, targetH), context.translate(-b.x1, -b.y1);
12535
12560
  }
12536
12561
  }
12537
12562
  }
@@ -14177,23 +14202,68 @@
14177
14202
  };
14178
14203
  DefaultCanvasSymbolRender = __decorate$10([injectable(), __param$y(0, inject(ContributionProvider)), __param$y(0, named(SymbolRenderContribution)), __metadata$L("design:paramtypes", [Object])], DefaultCanvasSymbolRender);
14179
14204
 
14205
+ class DefaultBoundsAllocate {
14206
+ constructor() {
14207
+ this.pools = [];
14208
+ for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds());
14209
+ }
14210
+ allocate(x1, y1, x2, y2) {
14211
+ if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
14212
+ const b = this.pools.pop();
14213
+ return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
14214
+ }
14215
+ allocateByObj(b) {
14216
+ if (!this.pools.length) return new AABBBounds(b);
14217
+ const _b = this.pools.pop();
14218
+ return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
14219
+ }
14220
+ free(b) {
14221
+ this.pools.push(b);
14222
+ }
14223
+ get length() {
14224
+ return this.pools.length;
14225
+ }
14226
+ release() {
14227
+ this.pools = [];
14228
+ }
14229
+ }
14230
+ const boundsAllocate = new DefaultBoundsAllocate();
14231
+
14180
14232
  class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution {
14181
14233
  constructor() {
14182
14234
  super(...arguments), this.time = BaseRenderContributionTime.beforeFillStroke;
14183
14235
  }
14184
14236
  drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
14237
+ var _a, _c, _d, _e, _f, _g, _h, _j, _k, _l;
14185
14238
  const {
14186
- background: background,
14187
14239
  backgroundMode = graphicAttribute.backgroundMode,
14188
14240
  backgroundFit = graphicAttribute.backgroundFit
14189
14241
  } = graphic.attribute;
14242
+ let b,
14243
+ {
14244
+ background: background
14245
+ } = graphic.attribute;
14190
14246
  if (!background) return;
14191
- const b = graphic.AABBBounds;
14247
+ const shouldReCalBounds = isObject$4(background) && background.background,
14248
+ onlyTranslate = graphic.transMatrix.onlyTranslate();
14249
+ if (shouldReCalBounds) {
14250
+ const _b = graphic.AABBBounds,
14251
+ x = (null !== (_a = background.x) && void 0 !== _a ? _a : _b.x1) + (null !== (_c = background.dx) && void 0 !== _c ? _c : 0),
14252
+ y = (null !== (_d = background.y) && void 0 !== _d ? _d : _b.y1) + (null !== (_e = background.dy) && void 0 !== _e ? _e : 0),
14253
+ w = null !== (_f = background.width) && void 0 !== _f ? _f : _b.width(),
14254
+ h = null !== (_g = background.height) && void 0 !== _g ? _g : _b.height();
14255
+ if (b = boundsAllocate.allocate(x, y, x + w, y + h), background = background.background, !onlyTranslate) {
14256
+ const w = b.width(),
14257
+ h = b.height();
14258
+ b.set((null !== (_h = background.x) && void 0 !== _h ? _h : 0) + (null !== (_j = background.dx) && void 0 !== _j ? _j : 0), (null !== (_k = background.y) && void 0 !== _k ? _k : 0) + (null !== (_l = background.dy) && void 0 !== _l ? _l : 0), w, h);
14259
+ }
14260
+ } else b = graphic.AABBBounds, onlyTranslate || b.set(0, 0, b.width(), b.height());
14192
14261
  if (graphic.backgroundImg && graphic.resources) {
14193
14262
  const res = graphic.resources.get(background);
14194
14263
  if ("success" !== res.state || !res.data) return;
14195
- context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
14196
- } else context.highPerformanceSave(), context.fillStyle = background, context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
14264
+ context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
14265
+ } else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
14266
+ shouldReCalBounds && boundsAllocate.free(b);
14197
14267
  }
14198
14268
  }
14199
14269
  const defaultTextBackgroundRenderContribution = new DefaultTextBackgroundRenderContribution();
@@ -14767,7 +14837,7 @@
14767
14837
  });
14768
14838
 
14769
14839
  var graphicModule = new ContainerModule(bind => {
14770
- bind(GraphicService).to(DefaultGraphicService).inSingletonScope(), bind(GraphicCreator$2).toConstantValue(graphicCreator$1);
14840
+ bind(GraphicService).to(DefaultGraphicService).inSingletonScope(), bind(GraphicCreator$1).toConstantValue(graphicCreator);
14771
14841
  });
14772
14842
 
14773
14843
  const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
@@ -15258,7 +15328,7 @@
15258
15328
  getShadowRoot(interactiveLayer) {
15259
15329
  var _a;
15260
15330
  let group = interactiveLayer.getElementById("_interactive_group");
15261
- return group || (group = graphicCreator$1.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
15331
+ return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
15262
15332
  }
15263
15333
  }
15264
15334
  class Canvas3DDrawItemInterceptor {
@@ -15336,33 +15406,6 @@
15336
15406
  }
15337
15407
  }
15338
15408
 
15339
- class DefaultBoundsAllocate {
15340
- constructor() {
15341
- this.pools = [];
15342
- for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds());
15343
- }
15344
- allocate(x1, y1, x2, y2) {
15345
- if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
15346
- const b = this.pools.pop();
15347
- return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
15348
- }
15349
- allocateByObj(b) {
15350
- if (!this.pools.length) return new AABBBounds(b);
15351
- const _b = this.pools.pop();
15352
- return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
15353
- }
15354
- free(b) {
15355
- this.pools.push(b);
15356
- }
15357
- get length() {
15358
- return this.pools.length;
15359
- }
15360
- release() {
15361
- this.pools = [];
15362
- }
15363
- }
15364
- const boundsAllocate = new DefaultBoundsAllocate();
15365
-
15366
15409
  var __decorate$R = undefined && undefined.__decorate || function (decorators, target, key, desc) {
15367
15410
  var d,
15368
15411
  c = arguments.length,
@@ -15534,7 +15577,7 @@
15534
15577
  return this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
15535
15578
  }
15536
15579
  clearScreen(renderService, context, drawContext) {
15537
- var _a;
15580
+ var _a, _b;
15538
15581
  const {
15539
15582
  clear: clear
15540
15583
  } = drawContext;
@@ -15548,7 +15591,7 @@
15548
15591
  y = 0;
15549
15592
  context.clearRect(x, y, width, height);
15550
15593
  const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
15551
- if (stage && stage.backgroundImg && stage.resources) {
15594
+ if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
15552
15595
  const res = stage.resources.get(clear);
15553
15596
  res && "success" === res.state && res.data && context.drawImage(res.data, x, y, width, height);
15554
15597
  } else context.fillStyle = createColor(context, clear, {
@@ -15804,10 +15847,7 @@
15804
15847
  constructor(contributions, lineRender, areaRender, drawItemInterceptorContributions) {
15805
15848
  super(contributions, drawItemInterceptorContributions), this.contributions = contributions, this.lineRender = lineRender, this.areaRender = areaRender, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.rendering = !1, this.currFrameStartAt = 0, this.currentIdx = 0, this.status = STATUS.NORMAL, this.checkingForDrawPromise = null, this.hooks = {
15806
15849
  completeDraw: new SyncHook([])
15807
- };
15808
- }
15809
- init() {
15810
- super.init(), this.defaultRenderMap.set(this.lineRender.numberType, this.lineRender), this.defaultRenderMap.set(this.areaRender.numberType, this.areaRender);
15850
+ }, this.defaultRenderMap.set(this.lineRender.numberType, this.lineRender), this.defaultRenderMap.set(this.areaRender.numberType, this.areaRender);
15811
15851
  }
15812
15852
  draw(renderService, drawContext) {
15813
15853
  return __awaiter(this, void 0, void 0, function* () {
@@ -16090,13 +16130,11 @@
16090
16130
  })), wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
16091
16131
  let left = 0,
16092
16132
  top = 0;
16093
- if ("position" === anchorType) {
16133
+ const b = graphic.globalAABBBounds;
16134
+ if ("position" === anchorType || b.empty()) {
16094
16135
  const matrix = graphic.globalTransMatrix;
16095
16136
  left = matrix.e, top = matrix.f;
16096
- } else {
16097
- const b = graphic.globalAABBBounds;
16098
- left = b.x1, top = b.y1;
16099
- }
16137
+ } else left = b.x1, top = b.y1;
16100
16138
  const containerTL = application.global.getElementTopLeft(nativeContainer, !1),
16101
16139
  windowTL = stage.window.getTopLeft(!1),
16102
16140
  offsetX = left + windowTL.left - containerTL.left,
@@ -16456,24 +16494,21 @@
16456
16494
 
16457
16495
  let _isBrowserEnv;
16458
16496
  function initIsBrowserEnv() {
16459
- if (null == _isBrowserEnv) {
16460
- try {
16461
- _isBrowserEnv = !!window;
16462
- } catch (err) {
16463
- _isBrowserEnv = !1;
16464
- }
16465
- if (_isBrowserEnv) try {
16466
- _isBrowserEnv = !tt;
16467
- } catch (err) {
16468
- _isBrowserEnv = !0;
16469
- }
16497
+ if (null == _isBrowserEnv) try {
16498
+ _isBrowserEnv = globalThis === window, _isBrowserEnv && (_isBrowserEnv = !!document.createElement);
16499
+ } catch (err) {
16500
+ _isBrowserEnv = !1;
16470
16501
  }
16471
16502
  }
16472
16503
  function isBrowserEnv() {
16473
- return initIsBrowserEnv(), _isBrowserEnv;
16504
+ initIsBrowserEnv();
16505
+ const env = application.global && application.global.env;
16506
+ return env ? "browser" === env : _isBrowserEnv;
16474
16507
  }
16475
16508
  function isNodeEnv() {
16476
- return initIsBrowserEnv(), !_isBrowserEnv;
16509
+ initIsBrowserEnv();
16510
+ const env = application.global && application.global.env;
16511
+ return env ? "node" === env : !_isBrowserEnv;
16477
16512
  }
16478
16513
 
16479
16514
  const DefaultConfig$1 = {
@@ -16577,6 +16612,8 @@
16577
16612
  resolution: this.window.dpr || this.global.devicePixelRatio,
16578
16613
  rootNode: this,
16579
16614
  global: this.global,
16615
+ supportsPointerEvents: this.params.supportsPointerEvents,
16616
+ supportsTouchEvents: this.params.supportsTouchEvents,
16580
16617
  viewport: {
16581
16618
  viewBox: this._viewBox,
16582
16619
  get x() {
@@ -17799,75 +17836,75 @@
17799
17836
  });
17800
17837
 
17801
17838
  function registerArcGraphic() {
17802
- graphicCreator$1.RegisterGraphicCreator("arc", createArc);
17839
+ graphicCreator.RegisterGraphicCreator("arc", createArc);
17803
17840
  }
17804
17841
 
17805
17842
  function registerArc3dGraphic() {
17806
- graphicCreator$1.RegisterGraphicCreator("arc3d", createArc3d);
17843
+ graphicCreator.RegisterGraphicCreator("arc3d", createArc3d);
17807
17844
  }
17808
17845
 
17809
17846
  function registerAreaGraphic() {
17810
- graphicCreator$1.RegisterGraphicCreator("area", createArea);
17847
+ graphicCreator.RegisterGraphicCreator("area", createArea);
17811
17848
  }
17812
17849
 
17813
17850
  function registerCircleGraphic() {
17814
- graphicCreator$1.RegisterGraphicCreator("circle", createCircle);
17851
+ graphicCreator.RegisterGraphicCreator("circle", createCircle);
17815
17852
  }
17816
17853
 
17817
17854
  function registerGlyphGraphic() {
17818
- graphicCreator$1.RegisterGraphicCreator("glyph", createGlyph);
17855
+ graphicCreator.RegisterGraphicCreator("glyph", createGlyph);
17819
17856
  }
17820
17857
 
17821
17858
  function registerGroupGraphic() {
17822
- graphicCreator$1.RegisterGraphicCreator("group", createGroup);
17859
+ graphicCreator.RegisterGraphicCreator("group", createGroup);
17823
17860
  }
17824
17861
 
17825
17862
  function registerImageGraphic() {
17826
- graphicCreator$1.RegisterGraphicCreator("image", createImage);
17863
+ graphicCreator.RegisterGraphicCreator("image", createImage);
17827
17864
  }
17828
17865
 
17829
17866
  function registerLineGraphic() {
17830
- graphicCreator$1.RegisterGraphicCreator("line", createLine);
17867
+ graphicCreator.RegisterGraphicCreator("line", createLine);
17831
17868
  }
17832
17869
 
17833
17870
  function registerPathGraphic() {
17834
- graphicCreator$1.RegisterGraphicCreator("path", createPath);
17871
+ graphicCreator.RegisterGraphicCreator("path", createPath);
17835
17872
  }
17836
17873
 
17837
17874
  function registerPolygonGraphic() {
17838
- graphicCreator$1.RegisterGraphicCreator("polygon", createPolygon);
17875
+ graphicCreator.RegisterGraphicCreator("polygon", createPolygon);
17839
17876
  }
17840
17877
 
17841
17878
  function registerPyramid3dGraphic() {
17842
- graphicCreator$1.RegisterGraphicCreator("pyramid3d", createPyramid3d);
17879
+ graphicCreator.RegisterGraphicCreator("pyramid3d", createPyramid3d);
17843
17880
  }
17844
17881
 
17845
17882
  function registerRectGraphic() {
17846
- graphicCreator$1.RegisterGraphicCreator("rect", createRect);
17883
+ graphicCreator.RegisterGraphicCreator("rect", createRect);
17847
17884
  }
17848
17885
 
17849
17886
  function registerRect3dGraphic() {
17850
- graphicCreator$1.RegisterGraphicCreator("rect3d", createRect3d);
17887
+ graphicCreator.RegisterGraphicCreator("rect3d", createRect3d);
17851
17888
  }
17852
17889
 
17853
17890
  function registerRichtextGraphic() {
17854
- graphicCreator$1.RegisterGraphicCreator("richtext", createRichText);
17891
+ graphicCreator.RegisterGraphicCreator("richtext", createRichText);
17855
17892
  }
17856
17893
 
17857
17894
  function registerSymbolGraphic() {
17858
- graphicCreator$1.RegisterGraphicCreator("symbol", createSymbol);
17895
+ graphicCreator.RegisterGraphicCreator("symbol", createSymbol);
17859
17896
  }
17860
17897
 
17861
17898
  function registerTextGraphic() {
17862
- graphicCreator$1.RegisterGraphicCreator("text", createText);
17899
+ graphicCreator.RegisterGraphicCreator("text", createText);
17863
17900
  }
17864
17901
 
17865
17902
  function registerShadowRootGraphic() {
17866
- graphicCreator$1.RegisterGraphicCreator("shadowRoot", createShadowRoot);
17903
+ graphicCreator.RegisterGraphicCreator("shadowRoot", createShadowRoot);
17867
17904
  }
17868
17905
 
17869
17906
  function registerWrapTextGraphic() {
17870
- graphicCreator$1.RegisterGraphicCreator("wrapText", createWrapText);
17907
+ graphicCreator.RegisterGraphicCreator("wrapText", createWrapText);
17871
17908
  }
17872
17909
 
17873
17910
  const REACT_TO_CANOPUS_EVENTS = {
@@ -17918,40 +17955,40 @@
17918
17955
  onDblClick: "dblclick"
17919
17956
  };
17920
17957
  function VArc(params) {
17921
- return graphicCreator$1.arc(params ? params.attribute : {});
17958
+ return graphicCreator.arc(params ? params.attribute : {});
17922
17959
  }
17923
17960
  function VArea(params) {
17924
- return graphicCreator$1.area(params ? params.attribute : {});
17961
+ return graphicCreator.area(params ? params.attribute : {});
17925
17962
  }
17926
17963
  function VCircle(params) {
17927
- return graphicCreator$1.circle(params ? params.attribute : {});
17964
+ return graphicCreator.circle(params ? params.attribute : {});
17928
17965
  }
17929
17966
  function VGroup(params) {
17930
- return graphicCreator$1.group(params ? params.attribute : {});
17967
+ return graphicCreator.group(params ? params.attribute : {});
17931
17968
  }
17932
17969
  function VGlyph(params) {
17933
- return graphicCreator$1.glyph(params ? params.attribute : {});
17970
+ return graphicCreator.glyph(params ? params.attribute : {});
17934
17971
  }
17935
17972
  function VImage(params) {
17936
- return graphicCreator$1.image(params ? params.attribute : {});
17973
+ return graphicCreator.image(params ? params.attribute : {});
17937
17974
  }
17938
17975
  function VLine(params) {
17939
- return graphicCreator$1.line(params ? params.attribute : {});
17976
+ return graphicCreator.line(params ? params.attribute : {});
17940
17977
  }
17941
17978
  function VPath(params) {
17942
- return graphicCreator$1.path(params ? params.attribute : {});
17979
+ return graphicCreator.path(params ? params.attribute : {});
17943
17980
  }
17944
17981
  function VPolygon(params) {
17945
- return graphicCreator$1.polygon(params ? params.attribute : {});
17982
+ return graphicCreator.polygon(params ? params.attribute : {});
17946
17983
  }
17947
17984
  function VRect(params) {
17948
- return graphicCreator$1.rect(params ? params.attribute : {});
17985
+ return graphicCreator.rect(params ? params.attribute : {});
17949
17986
  }
17950
17987
  function VSymbol(params) {
17951
- return graphicCreator$1.symbol(params ? params.attribute : {});
17988
+ return graphicCreator.symbol(params ? params.attribute : {});
17952
17989
  }
17953
17990
  function VText(params) {
17954
- return graphicCreator$1.text(params ? params.attribute : {});
17991
+ return graphicCreator.text(params ? params.attribute : {});
17955
17992
  }
17956
17993
 
17957
17994
  var __rest$4 = undefined && undefined.__rest || function (s, e) {
@@ -17976,7 +18013,7 @@
17976
18013
  } = _a,
17977
18014
  props = __rest$4(_a, ["key", "attribute", "stateProxy"]);
17978
18015
  let c = type;
17979
- isString$2(type) && (c = graphicCreator$1[type]);
18016
+ isString$2(type) && (c = graphicCreator[type]);
17980
18017
  const childrenList = [];
17981
18018
  for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
17982
18019
  children[_key - 2] = arguments[_key];
@@ -20958,7 +20995,38 @@
20958
20995
  loaded || (loaded = !0, registerWrapTextGraphic());
20959
20996
  }
20960
20997
 
20961
- preLoadAllModule(), isBrowserEnv() ? loadBrowserEnv(container) : isNodeEnv() && loadNodeEnv(container), registerArc(), registerArc3d(), registerArea(), registerCircle(), registerGlyph(), registerGroup(), registerImage(), registerLine(), registerPath(), registerPolygon(), registerPyramid3d(), registerRect(), registerRect3d(), registerRichtext(), registerShadowRoot(), registerSymbol(), registerText(), registerWrapText();
20998
+ let registed = false;
20999
+ function registerForVrender() {
21000
+ if (registed) {
21001
+ return;
21002
+ }
21003
+ registed = true;
21004
+ preLoadAllModule();
21005
+ if (isBrowserEnv()) {
21006
+ loadBrowserEnv(container);
21007
+ }
21008
+ else if (isNodeEnv()) {
21009
+ loadNodeEnv(container);
21010
+ }
21011
+ registerArc();
21012
+ registerArc3d();
21013
+ registerArea();
21014
+ registerCircle();
21015
+ registerGlyph();
21016
+ registerGroup();
21017
+ registerImage();
21018
+ registerLine();
21019
+ registerPath();
21020
+ registerPolygon();
21021
+ registerPyramid3d();
21022
+ registerRect();
21023
+ registerRect3d();
21024
+ registerRichtext();
21025
+ registerShadowRoot();
21026
+ registerSymbol();
21027
+ registerText();
21028
+ registerWrapText();
21029
+ }
20962
21030
 
20963
21031
  var InteractionState;
20964
21032
  (function (InteractionState) {
@@ -23928,12 +23996,6 @@
23928
23996
  });
23929
23997
 
23930
23998
  function getCellMergeInfo(table, col, row) {
23931
- if (table.internalProps.customMergeCell) {
23932
- const customMerge = table.getCustomMerge(col, row);
23933
- if (customMerge) {
23934
- return customMerge.range;
23935
- }
23936
- }
23937
23999
  if (!table.isHeader(col, row) && !table.getBodyColumnDefine(col, row)?.mergeCell) {
23938
24000
  return false;
23939
24001
  }
@@ -24261,6 +24323,7 @@
24261
24323
  return direct ? angleLargeThanPI ? 2 * Math.PI - ang : ang : angleLargeThanPI ? ang : 2 * Math.PI - ang;
24262
24324
  }
24263
24325
 
24326
+ const DEFAULT_TEXT_FONT_FAMILY$1 = "PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";
24264
24327
  var StateValue;
24265
24328
  !function (StateValue) {
24266
24329
  StateValue.selected = "selected", StateValue.selectedReverse = "selected_reverse", StateValue.hover = "hover", StateValue.hoverReverse = "hover_reverse";
@@ -24279,17 +24342,18 @@
24279
24342
  };
24280
24343
 
24281
24344
  function measureTextSize(text, textSpec) {
24282
- var _a;
24345
+ let fontFamily = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_TEXT_FONT_FAMILY$1;
24346
+ var _a, _b;
24283
24347
  if (!text) return {
24284
24348
  width: 0,
24285
24349
  height: 0
24286
24350
  };
24287
- const bounds = getTextBounds$1({
24351
+ const bounds = getTextBounds({
24288
24352
  text: text,
24289
- fontFamily: textSpec.fontFamily,
24353
+ fontFamily: null !== (_a = textSpec.fontFamily) && void 0 !== _a ? _a : fontFamily,
24290
24354
  fontSize: textSpec.fontSize || 12,
24291
24355
  fontWeight: textSpec.fontWeight,
24292
- textAlign: null !== (_a = textSpec.textAlign) && void 0 !== _a ? _a : "center",
24356
+ textAlign: null !== (_b = textSpec.textAlign) && void 0 !== _b ? _b : "center",
24293
24357
  textBaseline: textSpec.textBaseline,
24294
24358
  ellipsis: !!textSpec.ellipsis,
24295
24359
  maxLineWidth: textSpec.maxLineWidth || 1 / 0,
@@ -24320,7 +24384,7 @@
24320
24384
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, Tag.defaultAttributes, attributes)), this.name = "tag";
24321
24385
  }
24322
24386
  render() {
24323
- var _a, _b, _c;
24387
+ var _a, _b, _c, _d;
24324
24388
  const {
24325
24389
  text = "",
24326
24390
  textStyle = {},
@@ -24425,11 +24489,11 @@
24425
24489
  y: 0
24426
24490
  });
24427
24491
  isNil$1(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text"), isEmpty(null == state ? void 0 : state.text) || (textShape.states = state.text);
24428
- const textBounds = measureTextSize(textAttrs.text, textStyle),
24492
+ const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_c = this.stage) || void 0 === _c ? void 0 : _c.getTheme().text.fontFamily),
24429
24493
  textWidth = textBounds.width,
24430
24494
  textHeight = textBounds.height;
24431
24495
  tagWidth += textWidth;
24432
- const size = null !== (_c = shape.size) && void 0 !== _c ? _c : 10,
24496
+ const size = null !== (_d = shape.size) && void 0 !== _d ? _d : 10,
24433
24497
  maxSize = isNumber$3(size) ? size : Math.max(size[0], size[1]);
24434
24498
  tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
24435
24499
  const {
@@ -24932,7 +24996,7 @@
24932
24996
  }
24933
24997
  points.forEach((point, index) => {
24934
24998
  var _a, _b;
24935
- const line = graphicCreator$1.line(Object.assign(Object.assign({
24999
+ const line = graphicCreator.line(Object.assign(Object.assign({
24936
25000
  points: point
24937
25001
  }, isArray$1(lineStyle) ? null !== (_a = lineStyle[index]) && void 0 !== _a ? _a : lineStyle[lineStyle.length - 1] : lineStyle), {
24938
25002
  fill: !1
@@ -24940,7 +25004,7 @@
24940
25004
  line.name = `${this.name}-line`, line.id = this._getNodeId("line" + index), isEmpty(null == state ? void 0 : state.line) || (line.states = isArray$1(state.line) ? null !== (_b = state.line[index]) && void 0 !== _b ? _b : state.line[state.line.length - 1] : state.line), this.add(line);
24941
25005
  });
24942
25006
  } else {
24943
- const line = graphicCreator$1.polygon(Object.assign(Object.assign({
25007
+ const line = graphicCreator.polygon(Object.assign(Object.assign({
24944
25008
  points: this._clipPoints(this.attribute.points)
24945
25009
  }, array$1(lineStyle)[0]), {
24946
25010
  fill: !1,
@@ -24979,7 +25043,7 @@
24979
25043
  }, rotate = startAngle + Math.PI / 2) : (position = {
24980
25044
  x: end.x + (isValidNumber$1(endAngle) ? refX * Math.cos(endAngle) + refY * Math.cos(endAngle - Math.PI / 2) : 0),
24981
25045
  y: end.y + (isValidNumber$1(endAngle) ? refX * Math.sin(endAngle) + refY * Math.sin(endAngle - Math.PI / 2) : 0)
24982
- }, rotate = endAngle + Math.PI / 2), symbol = graphicCreator$1.symbol(Object.assign(Object.assign(Object.assign({}, position), {
25046
+ }, rotate = endAngle + Math.PI / 2), symbol = graphicCreator.symbol(Object.assign(Object.assign(Object.assign({}, position), {
24983
25047
  symbolType: symbolType,
24984
25048
  size: size,
24985
25049
  angle: autoRotate ? rotate + refAngle : 0,
@@ -25172,14 +25236,14 @@
25172
25236
  getBoundsWithoutRender(attributes) {
25173
25237
  const currentAttribute = cloneDeep(this.attribute);
25174
25238
  merge(this.attribute, attributes);
25175
- const offscreenGroup = graphicCreator$1.group({
25239
+ const offscreenGroup = graphicCreator.group({
25176
25240
  x: this.attribute.x,
25177
25241
  y: this.attribute.y
25178
25242
  });
25179
25243
  return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup), this.attribute = currentAttribute, offscreenGroup.AABBBounds;
25180
25244
  }
25181
25245
  render() {
25182
- this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator$1.group({
25246
+ this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
25183
25247
  x: 0,
25184
25248
  y: 0,
25185
25249
  pickable: !1
@@ -25201,13 +25265,13 @@
25201
25265
  line: line,
25202
25266
  items: items
25203
25267
  } = this.attribute,
25204
- axisContainer = graphicCreator$1.group({
25268
+ axisContainer = graphicCreator.group({
25205
25269
  x: 0,
25206
25270
  y: 0,
25207
25271
  zIndex: 1
25208
25272
  });
25209
25273
  if (axisContainer.name = AXIS_ELEMENT_NAME.axisContainer, axisContainer.id = this._getNodeId("container"), axisContainer.setMode(this.mode), this.axisContainer = axisContainer, container.add(axisContainer), line && line.visible && this.renderLine(axisContainer), items && items.length && (this.data = this._transformItems(items[0]), tick && tick.visible && this.renderTicks(axisContainer), label && label.visible)) {
25210
- const labelGroup = graphicCreator$1.group({
25274
+ const labelGroup = graphicCreator.group({
25211
25275
  x: 0,
25212
25276
  y: 0,
25213
25277
  pickable: !1
@@ -25240,14 +25304,14 @@
25240
25304
  }
25241
25305
  renderTicks(container) {
25242
25306
  const tickLineItems = this.getTickLineItems(),
25243
- tickLineGroup = graphicCreator$1.group({
25307
+ tickLineGroup = graphicCreator.group({
25244
25308
  x: 0,
25245
25309
  y: 0,
25246
25310
  pickable: !1
25247
25311
  });
25248
25312
  tickLineGroup.name = AXIS_ELEMENT_NAME.tickContainer, tickLineGroup.id = this._getNodeId("tick-container"), container.add(tickLineGroup), tickLineItems.forEach((item, index) => {
25249
25313
  var _a;
25250
- const line = graphicCreator$1.line(Object.assign({}, this._getTickLineAttribute("tick", item, index, tickLineItems)));
25314
+ const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("tick", item, index, tickLineItems)));
25251
25315
  if (line.name = AXIS_ELEMENT_NAME.tick, line.id = this._getNodeId(item.id), isEmpty(null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.state)) line.states = DEFAULT_STATES$2;else {
25252
25316
  const data = this.data[index],
25253
25317
  tickLineState = merge({}, DEFAULT_STATES$2, this.attribute.tick.state);
@@ -25263,7 +25327,7 @@
25263
25327
  if (subTick && subTick.visible) {
25264
25328
  const subTickLineItems = this.getSubTickLineItems();
25265
25329
  subTickLineItems.length && subTickLineItems.forEach((item, index) => {
25266
- const line = graphicCreator$1.line(Object.assign({}, this._getTickLineAttribute("subTick", item, index, tickLineItems)));
25330
+ const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("subTick", item, index, tickLineItems)));
25267
25331
  if (line.name = AXIS_ELEMENT_NAME.subTick, line.id = this._getNodeId(`${index}`), isEmpty(subTick.state)) line.states = DEFAULT_STATES$2;else {
25268
25332
  const subTickLineState = merge({}, DEFAULT_STATES$2, subTick.state);
25269
25333
  Object.keys(subTickLineState).forEach(key => {
@@ -25280,7 +25344,7 @@
25280
25344
  } = this.attribute.label;
25281
25345
  dataFilter && isFunction$1(dataFilter) && (items = dataFilter(items, layer));
25282
25346
  const data = this._transformItems(items),
25283
- labelGroup = graphicCreator$1.group({
25347
+ labelGroup = graphicCreator.group({
25284
25348
  x: 0,
25285
25349
  y: 0,
25286
25350
  pickable: !1
@@ -25289,9 +25353,9 @@
25289
25353
  var _a, _b, _c;
25290
25354
  const labelStyle = this._getLabelAttribute(item, index, data, layer);
25291
25355
  let text;
25292
- if ("rich" === labelStyle.type ? (labelStyle.textConfig = labelStyle.text, labelStyle.width = null !== (_a = labelStyle.width) && void 0 !== _a ? _a : 0, labelStyle.height = null !== (_b = labelStyle.height) && void 0 !== _b ? _b : 0, text = graphicCreator$1.richtext(labelStyle)) : "html" === labelStyle.type ? (labelStyle.textConfig = [], labelStyle.html = Object.assign(Object.assign({
25356
+ if ("rich" === labelStyle.type ? (labelStyle.textConfig = labelStyle.text, labelStyle.width = null !== (_a = labelStyle.width) && void 0 !== _a ? _a : 0, labelStyle.height = null !== (_b = labelStyle.height) && void 0 !== _b ? _b : 0, text = graphicCreator.richtext(labelStyle)) : "html" === labelStyle.type ? (labelStyle.textConfig = [], labelStyle.html = Object.assign(Object.assign({
25293
25357
  dom: labelStyle.text
25294
- }, DEFAULT_HTML_TEXT_SPEC), labelStyle), text = graphicCreator$1.richtext(labelStyle)) : text = graphicCreator$1.text(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_c = this.attribute.label) || void 0 === _c ? void 0 : _c.state)) text.states = DEFAULT_STATES$2;else {
25358
+ }, DEFAULT_HTML_TEXT_SPEC), labelStyle), text = graphicCreator.richtext(labelStyle)) : text = graphicCreator.text(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_c = this.attribute.label) || void 0 === _c ? void 0 : _c.state)) text.states = DEFAULT_STATES$2;else {
25295
25359
  const labelState = merge({}, DEFAULT_STATES$2, this.attribute.label.state);
25296
25360
  Object.keys(labelState).forEach(key => {
25297
25361
  isFunction$1(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
@@ -25747,7 +25811,7 @@
25747
25811
  if (panel && panel.visible) {
25748
25812
  const axisContainer = this.axisContainer,
25749
25813
  axisContainerBounds = axisContainer.AABBBounds,
25750
- bgRect = graphicCreator$1.rect(Object.assign({
25814
+ bgRect = graphicCreator.rect(Object.assign({
25751
25815
  x: axisContainerBounds.x1,
25752
25816
  y: axisContainerBounds.y1,
25753
25817
  width: axisContainerBounds.width(),
@@ -25886,6 +25950,7 @@
25886
25950
  };
25887
25951
  }
25888
25952
  beforeLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
25953
+ var _a, _b, _c, _d;
25889
25954
  const {
25890
25955
  flush = !1
25891
25956
  } = this.attribute.label || {};
@@ -25900,55 +25965,51 @@
25900
25965
  last$1 = last(labelShapes),
25901
25966
  isInverse = isX ? first.attribute.x > last$1.attribute.x : first.attribute.y < last$1.attribute.y;
25902
25967
  if (isX) {
25903
- if (isInverse) {
25904
- const start = axisEnd.x,
25905
- end = axisStart.x,
25906
- startBound = first.AABBBounds.x2,
25907
- endBound = last$1.AABBBounds.x1;
25908
- startBound > start && first.setAttributes({
25909
- x: start,
25910
- textAlign: "right"
25911
- }), endBound < end && last$1.setAttributes({
25912
- x: end,
25968
+ const leftMostLabel = isInverse ? last$1 : first,
25969
+ rightMostLabel = isInverse ? first : last$1,
25970
+ left = axisStart.x,
25971
+ right = axisEnd.x,
25972
+ leftBound = leftMostLabel.AABBBounds.x1,
25973
+ rightBound = rightMostLabel.AABBBounds.x2;
25974
+ if (leftBound < left) {
25975
+ leftMostLabel.attribute.angle ? leftMostLabel.setAttributes({
25976
+ dx: (null !== (_a = leftMostLabel.attribute.dx) && void 0 !== _a ? _a : 0) + left - leftBound
25977
+ }) : leftMostLabel.setAttributes({
25978
+ x: left,
25913
25979
  textAlign: "left"
25914
25980
  });
25915
- } else {
25916
- const start = axisStart.x,
25917
- end = axisEnd.x,
25918
- startBound = first.AABBBounds.x1,
25919
- endBound = last$1.AABBBounds.x2;
25920
- startBound < start && first.setAttributes({
25921
- x: start,
25922
- textAlign: "left"
25923
- }), endBound > end && last$1.setAttributes({
25924
- x: end,
25981
+ }
25982
+ if (rightBound > right) {
25983
+ rightMostLabel.attribute.angle ? rightMostLabel.setAttributes({
25984
+ dx: (null !== (_b = rightMostLabel.attribute.dx) && void 0 !== _b ? _b : 0) + right - rightBound
25985
+ }) : rightMostLabel.setAttributes({
25986
+ x: right,
25925
25987
  textAlign: "right"
25926
25988
  });
25927
25989
  }
25928
- } else if (isInverse) {
25929
- const startBound = first.AABBBounds.y1,
25930
- endBound = last$1.AABBBounds.y2,
25931
- start = axisStart.y,
25932
- end = axisEnd.y;
25933
- startBound < start && first.setAttributes({
25934
- y: start,
25935
- textBaseline: "top"
25936
- }), endBound > end && last$1.setAttributes({
25937
- y: end,
25938
- textBaseline: "bottom"
25939
- });
25940
25990
  } else {
25941
- const start = axisEnd.y,
25942
- end = axisStart.y,
25943
- startBound = first.AABBBounds.y2,
25944
- endBound = last$1.AABBBounds.y1;
25945
- startBound > start && first.setAttributes({
25946
- y: start,
25947
- textBaseline: "bottom"
25948
- }), endBound < end && last$1.setAttributes({
25949
- y: end,
25950
- textBaseline: "top"
25951
- });
25991
+ const bottomMostLabel = isInverse ? last$1 : first,
25992
+ topMostLabel = isInverse ? first : last$1,
25993
+ bottomBound = bottomMostLabel.AABBBounds.y2,
25994
+ topBound = topMostLabel.AABBBounds.y1,
25995
+ top = axisStart.y,
25996
+ bottom = axisEnd.y;
25997
+ if (topBound < top) {
25998
+ topMostLabel.attribute.angle ? topMostLabel.setAttributes({
25999
+ dy: (null !== (_c = topMostLabel.attribute.dy) && void 0 !== _c ? _c : 0) + top - topBound
26000
+ }) : topMostLabel.setAttributes({
26001
+ y: top,
26002
+ textBaseline: "top"
26003
+ });
26004
+ }
26005
+ if (bottomBound > bottom) {
26006
+ bottomMostLabel.attribute.angle ? bottomMostLabel.setAttributes({
26007
+ dy: (null !== (_d = bottomMostLabel.attribute.dy) && void 0 !== _d ? _d : 0) + bottom - bottomBound
26008
+ }) : bottomMostLabel.setAttributes({
26009
+ y: bottom,
26010
+ textBaseline: "bottom"
26011
+ });
26012
+ }
25952
26013
  }
25953
26014
  }
25954
26015
  }
@@ -26007,7 +26068,7 @@
26007
26068
  const minSize = this._getAxisLabelLimitLength(verticalMinSize, layerCount);
26008
26069
  let x, y;
26009
26070
  axisLabelContainerSize = Math.max(axisLabelContainerSize, minSize), "left" === orient ? (x = axisLabelContainerBounds.x2 - axisLabelContainerSize, y = axisLabelContainerBounds.y1) : "right" === orient ? (x = axisLabelContainerBounds.x1, y = axisLabelContainerBounds.y1) : "top" === orient ? (x = axisLabelContainerBounds.x1, y = axisLabelContainerBounds.y2 - axisLabelContainerSize) : "bottom" === orient && (x = axisLabelContainerBounds.x1, y = axisLabelContainerBounds.y1);
26010
- const bgRect = graphicCreator$1.rect({
26071
+ const bgRect = graphicCreator.rect({
26011
26072
  x: x,
26012
26073
  y: y,
26013
26074
  width: isHorizontal ? axisLabelContainerBounds.width() : axisLabelContainerSize,
@@ -26022,7 +26083,7 @@
26022
26083
  }
26023
26084
  }
26024
26085
  _getAxisLabelLimitLength(limitSize, layerCount) {
26025
- var _a, _b, _c;
26086
+ var _a, _b, _c, _d;
26026
26087
  const {
26027
26088
  label: label,
26028
26089
  title: title,
@@ -26036,7 +26097,7 @@
26036
26097
  const axisLineWidth = line && line.visible ? null !== (_b = line.style.lineWidth) && void 0 !== _b ? _b : 1 : 0,
26037
26098
  tickLength = tick && tick.visible ? null !== (_c = tick.length) && void 0 !== _c ? _c : 4 : 0;
26038
26099
  if (title && title.visible && "string" == typeof title.text) {
26039
- titleHeight = measureTextSize(title.text, title.textStyle).height;
26100
+ titleHeight = measureTextSize(title.text, title.textStyle, null === (_d = this.stage) || void 0 === _d ? void 0 : _d.getTheme().text.fontFamily).height;
26040
26101
  const padding = normalizePadding(title.padding);
26041
26102
  titleSpacing = title.space + padding[0] + padding[2];
26042
26103
  }
@@ -26099,7 +26160,7 @@
26099
26160
  };
26100
26161
  }
26101
26162
  render() {
26102
- var _a;
26163
+ var _a, _b;
26103
26164
  this._reset();
26104
26165
  const {
26105
26166
  layout = "horizontal",
@@ -26112,7 +26173,7 @@
26112
26173
  this._current = defaultCurrent;
26113
26174
  const parsedPadding = normalizePadding(padding),
26114
26175
  isHorizontal = "horizontal" === layout,
26115
- container = graphicCreator$1.group({
26176
+ container = graphicCreator.group({
26116
26177
  x: 0,
26117
26178
  y: 0
26118
26179
  }),
@@ -26125,7 +26186,7 @@
26125
26186
  nextShape: nextShape
26126
26187
  } = handler;
26127
26188
  preShape || (preShape = isHorizontal ? "triangleLeft" : "triangleUp"), nextShape || (nextShape = isHorizontal ? "triangleRight" : "triangleDown");
26128
- const preHandler = graphicCreator$1.symbol(Object.assign(Object.assign({
26189
+ const preHandler = graphicCreator.symbol(Object.assign(Object.assign({
26129
26190
  strokeBoundsBuffer: 0,
26130
26191
  pickMode: "imprecise"
26131
26192
  }, handlerStyle), {
@@ -26141,10 +26202,10 @@
26141
26202
  } = measureTextSize(`${total}/${total}`, Object.assign({
26142
26203
  textAlign: "center",
26143
26204
  textBaseline: "middle"
26144
- }, textStyle)),
26205
+ }, textStyle), null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme().text.fontFamily),
26145
26206
  handlerSizeX = isNumber$3(handlerSize) ? handlerSize : handlerSize[0],
26146
26207
  handlerSizeY = isNumber$3(handlerSize) ? handlerSize : handlerSize[1],
26147
- text = graphicCreator$1.text(Object.assign({
26208
+ text = graphicCreator.text(Object.assign({
26148
26209
  x: isHorizontal ? handlerSizeX / 2 + handlerSpace + maxTextWidth / 2 : 0,
26149
26210
  y: isHorizontal ? 0 : handlerSizeY / 2 + handlerSpace + maxTextHeight / 2,
26150
26211
  text: `${defaultCurrent}/${total}`,
@@ -26153,7 +26214,7 @@
26153
26214
  lineHeight: null == textStyle ? void 0 : textStyle.fontSize
26154
26215
  }, textStyle));
26155
26216
  this.text = text, container.add(text);
26156
- const nextHandler = graphicCreator$1.symbol(Object.assign(Object.assign({
26217
+ const nextHandler = graphicCreator.symbol(Object.assign(Object.assign({
26157
26218
  strokeBoundsBuffer: 0,
26158
26219
  pickMode: "imprecise"
26159
26220
  }, handlerStyle), {
@@ -26216,7 +26277,7 @@
26216
26277
  padding = 0
26217
26278
  } = this.attribute,
26218
26279
  parsedPadding = normalizePadding(padding),
26219
- innerView = graphicCreator$1.group({
26280
+ innerView = graphicCreator.group({
26220
26281
  x: parsedPadding[3],
26221
26282
  y: parsedPadding[0],
26222
26283
  pickable: interactive,
@@ -26363,7 +26424,7 @@
26363
26424
  if (!1 === item.visible || isEmpty(items)) return;
26364
26425
  let legendItems = items;
26365
26426
  reversed && (legendItems = null == items ? void 0 : items.reverse());
26366
- const itemsContainer = graphicCreator$1.group({
26427
+ const itemsContainer = graphicCreator.group({
26367
26428
  x: 0,
26368
26429
  y: 0
26369
26430
  });
@@ -26440,15 +26501,15 @@
26440
26501
  backgroundStyle = this._handleStyle(background, item, isSelected, index, items),
26441
26502
  parsedPadding = normalizePadding(padding);
26442
26503
  let itemGroup;
26443
- !1 === background.visible ? (itemGroup = graphicCreator$1.group({
26504
+ !1 === background.visible ? (itemGroup = graphicCreator.group({
26444
26505
  x: 0,
26445
26506
  y: 0,
26446
26507
  cursor: null === (_a = backgroundStyle.style) || void 0 === _a ? void 0 : _a.cursor
26447
- }), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup)) : (itemGroup = graphicCreator$1.group(Object.assign({
26508
+ }), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup)) : (itemGroup = graphicCreator.group(Object.assign({
26448
26509
  x: 0,
26449
26510
  y: 0
26450
26511
  }, backgroundStyle.style)), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state)), itemGroup.id = `${null != id ? id : label}-${index}`, itemGroup.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);
26451
- const innerGroup = graphicCreator$1.group({
26512
+ const innerGroup = graphicCreator.group({
26452
26513
  x: 0,
26453
26514
  y: 0,
26454
26515
  pickable: !1
@@ -26461,7 +26522,7 @@
26461
26522
  if (shapeAttr && !1 !== shapeAttr.visible) {
26462
26523
  const s = get$5(shapeStyle, "style.size", DEFAULT_SHAPE_SIZE);
26463
26524
  shapeSize = isArray$1(s) ? s[0] || 0 : s, shapeSpace = get$5(shapeAttr, "space", DEFAULT_SHAPE_SPACE);
26464
- const itemShape = graphicCreator$1.symbol(Object.assign(Object.assign({
26525
+ const itemShape = graphicCreator.symbol(Object.assign(Object.assign({
26465
26526
  x: 0,
26466
26527
  y: 0,
26467
26528
  symbolType: "circle",
@@ -26475,7 +26536,7 @@
26475
26536
  let focusSpace = 0;
26476
26537
  if (focus) {
26477
26538
  const focusSize = get$5(focusIconStyle, "size", DEFAULT_SHAPE_SIZE);
26478
- focusShape = graphicCreator$1.symbol(Object.assign(Object.assign({
26539
+ focusShape = graphicCreator.symbol(Object.assign(Object.assign({
26479
26540
  x: 0,
26480
26541
  y: -focusSize / 2 - 1,
26481
26542
  strokeBoundsBuffer: 0
@@ -26485,7 +26546,7 @@
26485
26546
  boundsPadding: parsedPadding
26486
26547
  })), this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup), focusSpace = focusSize;
26487
26548
  }
26488
- const labelShape = graphicCreator$1.text(Object.assign(Object.assign({
26549
+ const labelShape = graphicCreator.text(Object.assign(Object.assign({
26489
26550
  x: shapeSize / 2 + shapeSpace,
26490
26551
  y: 0,
26491
26552
  textAlign: "start",
@@ -26498,7 +26559,7 @@
26498
26559
  const labelSpace = get$5(labelAttr, "space", DEFAULT_LABEL_SPACE);
26499
26560
  if (isValid$1(value)) {
26500
26561
  const valueSpace = get$5(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
26501
- valueShape = graphicCreator$1.text(Object.assign(Object.assign({
26562
+ valueShape = graphicCreator.text(Object.assign(Object.assign({
26502
26563
  x: 0,
26503
26564
  y: 0,
26504
26565
  textAlign: "start",
@@ -26605,7 +26666,7 @@
26605
26666
  });
26606
26667
  }
26607
26668
  pager.defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("y", -(pager.defaultCurrent - 1) * (pageHeight + spaceRow)) : itemsContainer.setAttribute("x", -(pager.defaultCurrent - 1) * (pageWidth + spaceCol)));
26608
- const clipGroup = graphicCreator$1.group({
26669
+ const clipGroup = graphicCreator.group({
26609
26670
  x: 0,
26610
26671
  y: renderStartY,
26611
26672
  width: pageWidth,
@@ -27910,7 +27971,7 @@
27910
27971
  };
27911
27972
  const isHorizontal = "horizontal" === layout;
27912
27973
  this._isHorizontal = isHorizontal;
27913
- const innerView = graphicCreator$1.group({
27974
+ const innerView = graphicCreator.group({
27914
27975
  x: 0,
27915
27976
  y: 0
27916
27977
  });
@@ -27918,7 +27979,7 @@
27918
27979
  let startTextShape,
27919
27980
  startLen = 0;
27920
27981
  if (startText && startText.visible) {
27921
- startTextShape = graphicCreator$1.text(Object.assign({
27982
+ startTextShape = graphicCreator.text(Object.assign({
27922
27983
  x: isHorizontal ? 0 : railWidth / 2,
27923
27984
  y: isHorizontal ? railHeight / 2 : 0,
27924
27985
  textAlign: isHorizontal ? "start" : "center",
@@ -27929,19 +27990,19 @@
27929
27990
  const space = isValid$1(startText.space) ? startText.space : 0;
27930
27991
  startLen += (isHorizontal ? startTextShape.AABBBounds.width() : startTextShape.AABBBounds.height()) + space;
27931
27992
  }
27932
- const mainContainer = graphicCreator$1.group({
27993
+ const mainContainer = graphicCreator.group({
27933
27994
  x: isHorizontal ? startLen : 0,
27934
27995
  y: isHorizontal ? 0 : startLen
27935
27996
  });
27936
27997
  innerView.add(mainContainer);
27937
- const railContainer = graphicCreator$1.group({
27998
+ const railContainer = graphicCreator.group({
27938
27999
  x: 0,
27939
28000
  y: 0
27940
28001
  });
27941
28002
  let endTextShape;
27942
28003
  if (railContainer.name = SLIDER_ELEMENT_NAME.railContainer, this._railContainer = railContainer, mainContainer.add(railContainer), this._renderRail(railContainer), startLen += isHorizontal ? railWidth : railHeight, endText && endText.visible) {
27943
28004
  const space = isValid$1(endText.space) ? endText.space : 0;
27944
- endTextShape = graphicCreator$1.text(Object.assign({
28005
+ endTextShape = graphicCreator.text(Object.assign({
27945
28006
  x: isHorizontal ? startLen + space : railWidth / 2,
27946
28007
  y: isHorizontal ? railHeight / 2 : startLen + space,
27947
28008
  textAlign: isHorizontal ? "start" : "center",
@@ -27961,7 +28022,7 @@
27961
28022
  } = this.attribute;
27962
28023
  let cursor = "default";
27963
28024
  !1 !== slidable && (cursor = "pointer");
27964
- const railShape = graphicCreator$1.rect(Object.assign({
28025
+ const railShape = graphicCreator.rect(Object.assign({
27965
28026
  x: 0,
27966
28027
  y: 0,
27967
28028
  width: railWidth,
@@ -28037,7 +28098,7 @@
28037
28098
  const isHorizontal = this._isHorizontal,
28038
28099
  railLen = isHorizontal ? railWidth : railHeight;
28039
28100
  range || (startValue = min);
28040
- const trackContainer = graphicCreator$1.group({
28101
+ const trackContainer = graphicCreator.group({
28041
28102
  x: 0,
28042
28103
  y: 0,
28043
28104
  width: railWidth,
@@ -28052,7 +28113,7 @@
28052
28113
  cursor = !1 === slidable ? "default" : !1 === range || !1 === draggableTrack ? "pointer" : getDefaultCursor(isHorizontal);
28053
28114
  const trackWidth = max === min ? railLen : (endValue - startValue) / (max - min) * railLen,
28054
28115
  startPos = max === min ? 0 : (startValue - min) / (max - min) * railLen,
28055
- track = graphicCreator$1.rect(Object.assign({
28116
+ track = graphicCreator.rect(Object.assign({
28056
28117
  x: isHorizontal ? startPos : 0,
28057
28118
  y: isHorizontal ? 0 : startPos,
28058
28119
  width: isHorizontal ? trackWidth : railWidth,
@@ -28062,7 +28123,7 @@
28062
28123
  track.name = SLIDER_ELEMENT_NAME.track, this._track = track, trackContainer.add(track), container.add(trackContainer);
28063
28124
  }
28064
28125
  _renderHandler(style) {
28065
- return graphicCreator$1.symbol(style);
28126
+ return graphicCreator.symbol(style);
28066
28127
  }
28067
28128
  _renderHandlerText(value, position) {
28068
28129
  var _a, _b, _c;
@@ -28086,7 +28147,7 @@
28086
28147
  cursor: !1 === slidable ? "default" : getDefaultCursor(isHorizontal)
28087
28148
  };
28088
28149
  isHorizontal ? "top" === align ? (textStyle.textBaseline = "bottom", textStyle.textAlign = "center", textStyle.x = handlerStart, textStyle.y = (railHeight - handlerSize) / 2 - textSpace) : (textStyle.textBaseline = "top", textStyle.textAlign = "center", textStyle.x = handlerStart, textStyle.y = (railHeight + handlerSize) / 2 + textSpace) : "left" === align ? (textStyle.textBaseline = "middle", textStyle.textAlign = "end", textStyle.x = (railWidth - handlerSize) / 2 - textSpace, textStyle.y = handlerStart) : (textStyle.textBaseline = "middle", textStyle.textAlign = "start", textStyle.x = (railWidth + handlerSize) / 2 + textSpace, textStyle.y = handlerStart);
28089
- return graphicCreator$1.text(Object.assign(Object.assign({}, textStyle), handlerText.style));
28150
+ return graphicCreator.text(Object.assign(Object.assign({}, textStyle), handlerText.style));
28090
28151
  }
28091
28152
  _bindEvents() {
28092
28153
  if (this.attribute.disableTriggerEvent) return;
@@ -28429,7 +28490,7 @@
28429
28490
  sizeBackground: sizeBackground,
28430
28491
  disableTriggerEvent: disableTriggerEvent
28431
28492
  } = this.attribute,
28432
- mainContainer = graphicCreator$1.group({
28493
+ mainContainer = graphicCreator.group({
28433
28494
  x: 0,
28434
28495
  y: 0
28435
28496
  });
@@ -28467,7 +28528,7 @@
28467
28528
  let path,
28468
28529
  start = 0;
28469
28530
  "horizontal" === layout ? "top" === align ? (path = `M0,0L${railWidth},0L${railWidth},12Z`, start = railHeight) : (path = `M0,12L${railWidth},12L${railWidth},0Z`, slider.setAttribute("y", 12)) : "left" === align ? path = `M${railWidth},0L${railWidth},0L${railWidth + 12},${railHeight}L${railWidth},${railHeight}Z` : (path = `M0,${railHeight}L12,${railHeight}L12,0Z`, slider.setAttribute("x", 12));
28470
- const background = graphicCreator$1.path(Object.assign(Object.assign({
28531
+ const background = graphicCreator.path(Object.assign(Object.assign({
28471
28532
  x: 0,
28472
28533
  y: start,
28473
28534
  path: path
@@ -29397,25 +29458,6 @@
29397
29458
 
29398
29459
  const DEFAULT_CONTINUOUS_TICK_COUNT$1 = 5;
29399
29460
 
29400
- class GraphicCreator {
29401
- constructor() {
29402
- this.store = new Map();
29403
- }
29404
- RegisterGraphicCreator(name, cb) {
29405
- this.store.set(name, cb), this[name] = cb;
29406
- }
29407
- CreateGraphic(name, params) {
29408
- const cb = this.store.get(name);
29409
- return cb ? cb(params) : null;
29410
- }
29411
- }
29412
- const graphicCreator = new GraphicCreator();
29413
-
29414
- let text;
29415
- function getTextBounds(params) {
29416
- return text || (text = graphicCreator.CreateGraphic("text", {})), text.setAttributes(params), text.AABBBounds;
29417
- }
29418
-
29419
29461
  const initTextMeasure$1 = (textSpec, option, useNaiveCanvas, defaultFontParams) => new TextMeasure(Object.assign({
29420
29462
  defaultFontParams: Object.assign({
29421
29463
  fontFamily: "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",
@@ -30248,6 +30290,7 @@
30248
30290
  end = { x: 0, y: height };
30249
30291
  axisLength = height;
30250
30292
  }
30293
+ const size = this.orient === 'top' || this.orient === 'bottom' ? height : width;
30251
30294
  const attrs = {
30252
30295
  start: { x: this.x, y: this.y },
30253
30296
  end,
@@ -30255,7 +30298,9 @@
30255
30298
  text: this.option.title.text,
30256
30299
  maxWidth: this._getTitleLimit(isX)
30257
30300
  },
30258
- items: this.getLabelItems(axisLength)
30301
+ items: this.getLabelItems(axisLength),
30302
+ verticalLimitSize: size,
30303
+ verticalMinSize: size
30259
30304
  };
30260
30305
  return attrs;
30261
30306
  }
@@ -31812,456 +31857,356 @@
31812
31857
  }
31813
31858
  };
31814
31859
 
31815
- function getProp(name, cellStyle, col, row, _table) {
31816
- const prop = cellStyle && isValid$1(cellStyle[name]) ? cellStyle[name] : null;
31817
- if (typeof prop === 'function') {
31860
+ function dealWithCustom(customLayout, customRender, col, row, width, height, autoWidth, autoHeight, padding, table) {
31861
+ let renderDefault = true;
31862
+ let enableCellPadding = false;
31863
+ let expectedWidth;
31864
+ let expectedHeight;
31865
+ let customElements;
31866
+ let elementsGroup;
31867
+ if (typeof customLayout === 'function') {
31818
31868
  const arg = {
31819
31869
  col,
31820
31870
  row,
31821
- table: _table,
31822
- value: _table.getCellValue(col, row),
31823
- dataValue: _table.getCellOriginValue(col, row),
31824
- cellHeaderPaths: _table.getCellHeaderPaths(col, row)
31871
+ dataValue: table.getCellOriginValue(col, row),
31872
+ value: table.getCellValue(col, row) || '',
31873
+ rect: {
31874
+ left: 0,
31875
+ top: 0,
31876
+ right: width,
31877
+ bottom: height,
31878
+ width,
31879
+ height
31880
+ },
31881
+ table
31825
31882
  };
31826
- return prop(arg);
31883
+ const customRenderObj = customLayout(arg);
31884
+ if (customRenderObj.rootContainer) {
31885
+ customRenderObj.rootContainer = decodeReactDom(customRenderObj.rootContainer);
31886
+ }
31887
+ if (customRenderObj.rootContainer instanceof Group$2) {
31888
+ elementsGroup = customRenderObj.rootContainer;
31889
+ elementsGroup.name = 'custom-container';
31890
+ }
31891
+ renderDefault = customRenderObj.renderDefault;
31892
+ enableCellPadding = customRenderObj.enableCellPadding;
31827
31893
  }
31828
- return prop;
31829
- }
31830
- function getFunctionalProp(name, cellStyle, col, row, _table) {
31831
- const prop = cellStyle && isValid$1(cellStyle[name]) ? cellStyle[name] : null;
31832
- if (typeof prop === 'function') {
31894
+ else if (typeof customRender === 'function') {
31833
31895
  const arg = {
31834
31896
  col,
31835
31897
  row,
31836
- table: _table,
31837
- value: _table.getCellValue(col, row),
31838
- dataValue: _table.getCellOriginValue(col, row),
31839
- cellHeaderPaths: _table.getCellHeaderPaths(col, row)
31898
+ dataValue: table.getCellOriginValue(col, row),
31899
+ value: table.getCellValue(col, row) || '',
31900
+ rect: {
31901
+ left: 0,
31902
+ top: 0,
31903
+ right: width,
31904
+ bottom: height,
31905
+ width,
31906
+ height
31907
+ },
31908
+ table
31840
31909
  };
31841
- return prop(arg);
31910
+ const customRenderObj = customRender(arg);
31911
+ if (customRenderObj) {
31912
+ customElements = customRenderObj.elements;
31913
+ renderDefault = customRenderObj.renderDefault;
31914
+ expectedWidth = customRenderObj.expectedWidth;
31915
+ expectedHeight = customRenderObj.expectedHeight;
31916
+ }
31842
31917
  }
31843
- return undefined;
31844
- }
31845
-
31846
- let Group$1 = class Group extends Group$2 {
31847
- role;
31848
- col;
31849
- row;
31850
- mergeStartCol;
31851
- mergeStartRow;
31852
- mergeEndCol;
31853
- mergeEndRow;
31854
- contentWidth;
31855
- contentHeight;
31856
- rowNumber;
31857
- colHeight;
31858
- border;
31859
- needUpdate;
31860
- needUpdateWidth;
31861
- needUpdateHeight;
31862
- clear() {
31863
- this.removeAllChild();
31918
+ else if (customRender) {
31919
+ expectedWidth = customRender.expectedWidth;
31920
+ expectedHeight = customRender.expectedHeight;
31921
+ customElements = customRender.elements;
31922
+ renderDefault = customRender.renderDefault;
31864
31923
  }
31865
- getChildByName(name, deep) {
31866
- let result = null;
31867
- this.forEachChildren((child) => {
31868
- if (child.name === name) {
31869
- result = child;
31870
- return true;
31871
- }
31872
- return false;
31924
+ if (customElements) {
31925
+ const value = table.getCellValue(col, row);
31926
+ elementsGroup = adjustElementToGroup(customElements, autoWidth ? expectedWidth : width, autoHeight ? expectedHeight : height, value);
31927
+ }
31928
+ if (enableCellPadding) {
31929
+ elementsGroup.setAttributes({
31930
+ x: padding[3],
31931
+ y: padding[0],
31932
+ width: width - padding[1] - padding[3],
31933
+ height: height - padding[0] - padding[2]
31873
31934
  });
31874
- if (deep) {
31875
- this.forEachChildren((child) => {
31876
- if (child.getChildByName) {
31877
- const target = child.getChildByName(name, true);
31878
- if (target) {
31879
- result = target;
31880
- return true;
31881
- }
31935
+ }
31936
+ dealPercentCalc(elementsGroup, width, height);
31937
+ return {
31938
+ elementsGroup,
31939
+ renderDefault
31940
+ };
31941
+ }
31942
+ function adjustElementToGroup(elements, width, height, value) {
31943
+ const customGroup = new Group$2({
31944
+ x: 0,
31945
+ y: 0,
31946
+ width,
31947
+ height,
31948
+ fill: false,
31949
+ stroke: false,
31950
+ pickable: false
31951
+ });
31952
+ customGroup.name = 'custom-container';
31953
+ const elementsAdjusted = adjustElementsPos(elements, width, height, value);
31954
+ elementsAdjusted.forEach(element => {
31955
+ if (element.clickable) {
31956
+ element.pickable = element.clickable;
31957
+ }
31958
+ switch (element.type) {
31959
+ case 'arc':
31960
+ const arc = createArc({
31961
+ x: element.x,
31962
+ y: element.y,
31963
+ dx: (element.dx ?? 0),
31964
+ dy: (element.dy ?? 0),
31965
+ fill: element.fill,
31966
+ stroke: element.stroke,
31967
+ outerRadius: element.radius,
31968
+ startAngle: element.startAngle,
31969
+ endAngle: element.endAngle,
31970
+ pickable: !!element.pickable,
31971
+ cursor: element.cursor
31972
+ });
31973
+ customGroup.appendChild(arc);
31974
+ break;
31975
+ case 'text':
31976
+ if (element.background) {
31977
+ const expandX = element.background?.expandX ?? 0;
31978
+ const expandY = element.background?.expandY ?? 0;
31979
+ const textBackRect = createRect({
31980
+ x: element.x - expandX,
31981
+ y: element.y - expandY,
31982
+ dx: (element.dx ?? 0),
31983
+ dy: (element.dy ?? 0),
31984
+ width: element.width + expandX * 2,
31985
+ height: element.height + expandY * 2,
31986
+ cornerRadius: element.background?.cornerRadius ?? 0,
31987
+ fill: element.background?.fill ?? '#888'
31988
+ });
31989
+ customGroup.appendChild(textBackRect);
31882
31990
  }
31883
- return false;
31884
- });
31991
+ const text = new Text$1(Object.assign({
31992
+ pickable: !!element.pickable,
31993
+ fill: element.color ?? element.fill
31994
+ }, element));
31995
+ customGroup.appendChild(text);
31996
+ break;
31997
+ case 'rect':
31998
+ const rect = createRect({
31999
+ x: element.x,
32000
+ y: element.y,
32001
+ dx: (element.dx ?? 0),
32002
+ dy: (element.dy ?? 0),
32003
+ width: element.width,
32004
+ height: element.height,
32005
+ cornerRadius: element.radius,
32006
+ fill: element.fill,
32007
+ stroke: element.stroke,
32008
+ pickable: !!element.pickable,
32009
+ cursor: element.cursor
32010
+ });
32011
+ customGroup.appendChild(rect);
32012
+ break;
32013
+ case 'circle':
32014
+ const circle = createCircle({
32015
+ x: element.x,
32016
+ y: element.y,
32017
+ dx: (element.dx ?? 0),
32018
+ dy: (element.dy ?? 0),
32019
+ radius: element.radius,
32020
+ fill: element.fill,
32021
+ stroke: element.stroke,
32022
+ pickable: !!element.pickable,
32023
+ cursor: element.cursor
32024
+ });
32025
+ customGroup.appendChild(circle);
32026
+ break;
32027
+ case 'icon':
32028
+ const icon = new Icon$1({
32029
+ x: element.x,
32030
+ y: element.y,
32031
+ dx: (element.dx ?? 0),
32032
+ dy: (element.dy ?? 0),
32033
+ width: element.width,
32034
+ height: element.height,
32035
+ image: element.svg,
32036
+ backgroundWidth: element.hover ? (element.hover.width ?? element.width) : undefined,
32037
+ backgroundHeight: element.hover ? (element.hover.width ?? element.width) : undefined,
32038
+ backgroundColor: element.hover ? element.hover.bgColor ?? 'rgba(22,44,66,0.2)' : undefined,
32039
+ pickable: !!element.pickable,
32040
+ cursor: element.cursor
32041
+ });
32042
+ icon.role = 'icon-custom';
32043
+ customGroup.appendChild(icon);
32044
+ break;
32045
+ case 'image':
32046
+ const image = new Icon$1({
32047
+ x: element.x,
32048
+ y: element.y,
32049
+ dx: (element.dx ?? 0),
32050
+ dy: (element.dy ?? 0),
32051
+ width: element.width,
32052
+ height: element.height,
32053
+ image: element.src,
32054
+ backgroundWidth: element.hover ? (element.hover.width ?? element.width) : undefined,
32055
+ backgroundHeight: element.hover ? (element.hover.width ?? element.width) : undefined,
32056
+ backgroundColor: element.hover ? element.hover.bgColor ?? 'rgba(22,44,66,0.2)' : undefined,
32057
+ pickable: !!element.pickable,
32058
+ cursor: element.cursor,
32059
+ shape: element.shape
32060
+ });
32061
+ image.role = 'image-custom';
32062
+ customGroup.appendChild(image);
32063
+ break;
32064
+ case 'line':
32065
+ const line = createLine({
32066
+ points: element.points,
32067
+ stroke: element.stroke,
32068
+ pickable: !!element.pickable,
32069
+ cursor: element.cursor
32070
+ });
32071
+ customGroup.appendChild(line);
32072
+ break;
31885
32073
  }
31886
- return result;
31887
- }
31888
- get width() {
31889
- let width = this.AABBBounds.width();
31890
- if (width === Infinity || width === -Infinity) {
31891
- width = 0;
32074
+ });
32075
+ return customGroup;
32076
+ }
32077
+ function adjustElementsPos(originalElements, width, height, value) {
32078
+ const result = [];
32079
+ const left = 0;
32080
+ const top = 0;
32081
+ const borderLineWidths = [0, 0, 0, 0];
32082
+ for (let i = 0; i < originalElements.length; i++) {
32083
+ const originalElement = originalElements[i];
32084
+ const element = Object.assign({}, originalElement);
32085
+ for (const name in element) {
32086
+ if (element.hasOwnProperty(name) && isFunction$1(element[name])) {
32087
+ element[name] = element[name](value);
32088
+ }
31892
32089
  }
31893
- return Math.max(width, this.attribute.width ?? 0);
31894
- }
31895
- get height() {
31896
- let height = this.AABBBounds.height();
31897
- if (height === Infinity || height === -Infinity) {
31898
- height = 0;
32090
+ const rect = element;
32091
+ if (isValid$1(rect.x)) {
32092
+ rect.x = isString$2(rect.x)
32093
+ ? transformString(rect.x, width - borderLineWidths[1])
32094
+ : Number(rect.x);
31899
32095
  }
31900
- return Math.max(height, this.attribute.height ?? 0);
31901
- }
31902
- setDeltaWidth(deltaX) {
31903
- if (deltaX === 0) {
31904
- return;
32096
+ if (isValid$1(rect.y)) {
32097
+ rect.y = isString$2(rect.y)
32098
+ ? transformString(rect.y, height - borderLineWidths[2])
32099
+ : Number(rect.y);
31905
32100
  }
31906
- this.setAttribute('width', (this.attribute.width ?? 0) + deltaX);
31907
- if (this.border) {
31908
- this.border.setAttribute('width', this.border.attribute.width + deltaX);
31909
- if (this.border.type === 'group') {
31910
- this.border.firstChild.setAttribute('width', this.border.firstChild.attribute.width + deltaX);
31911
- }
32101
+ if ('width' in element) {
32102
+ element.width = isString$2(element.width)
32103
+ ? transformString(element.width, width - borderLineWidths[1])
32104
+ : Number(element.width);
31912
32105
  }
31913
- }
31914
- setDeltaHeight(deltaY) {
31915
- if (deltaY === 0) {
31916
- return;
32106
+ if ('height' in element) {
32107
+ element.height = isString$2(element.height)
32108
+ ? transformString(element.height, height - borderLineWidths[2])
32109
+ : Number(element.height);
31917
32110
  }
31918
- this.setAttribute('height', (this.attribute.height ?? 0) + deltaY);
31919
- if (this.border) {
31920
- this.border.setAttribute('height', this.border.attribute.height + deltaY);
31921
- if (this.border.type === 'group') {
31922
- this.border.firstChild.setAttribute('width', this.border.firstChild.attribute.height + deltaY);
31923
- }
32111
+ if ('radius' in element) {
32112
+ element.radius = isString$2(element.radius)
32113
+ ? transformString(element.radius, Math.min(width - borderLineWidths[1], height - borderLineWidths[2]))
32114
+ : Number(element.radius);
31924
32115
  }
31925
- }
31926
- setDeltaX(deltaX) {
31927
- if (deltaX === 0) {
31928
- return;
32116
+ if ('hover' in element) {
32117
+ element.hover.x = isString$2(element.hover.x)
32118
+ ? transformString(element.hover.x, width - borderLineWidths[1])
32119
+ : Number(element.hover.x);
32120
+ element.hover.y = isString$2(element.hover.y)
32121
+ ? transformString(element.hover.y, height - borderLineWidths[2])
32122
+ : Number(element.hover.y);
32123
+ element.hover.width = isString$2(element.hover.width)
32124
+ ? transformString(element.hover.width, width - borderLineWidths[1])
32125
+ : Number(element.hover.width);
32126
+ element.hover.height = isString$2(element.hover.height)
32127
+ ? transformString(element.hover.height, height - borderLineWidths[2])
32128
+ : Number(element.hover.height);
32129
+ element.hover.x += left;
32130
+ element.hover.y += top;
31929
32131
  }
31930
- this.setAttribute('x', this.attribute.x + deltaX);
32132
+ rect.x = rect.x + left;
32133
+ rect.y = rect.y + top;
32134
+ result.push(element);
31931
32135
  }
31932
- setDeltaY(deltaY) {
31933
- if (deltaY === 0) {
31934
- return;
31935
- }
31936
- this.setAttribute('y', this.attribute.y + deltaY);
32136
+ return result;
32137
+ }
32138
+ function transformString(str, size) {
32139
+ if (str.endsWith('px')) {
32140
+ return parseInt(str, 10);
31937
32141
  }
31938
- forEachChildrenSkipChild(cb, skipChildName = 'border-rect', reverse = false) {
31939
- if (reverse) {
31940
- let child = this._lastChild;
31941
- let i = 0;
31942
- while (child) {
31943
- if (child.name !== skipChildName) {
31944
- const breakTag = cb(child, i++);
31945
- if (breakTag) {
31946
- return;
31947
- }
31948
- }
31949
- child = child._prev;
31950
- }
31951
- }
31952
- else {
31953
- let child = this._firstChild;
31954
- let i = 0;
31955
- while (child) {
31956
- if (child.name !== skipChildName) {
31957
- const breakTag = cb(child, i++);
31958
- if (breakTag) {
31959
- return;
31960
- }
31961
- }
31962
- child = child._next;
31963
- }
31964
- }
31965
- }
31966
- getColGroup(col) {
31967
- let c = this._firstChild;
31968
- if (!c) {
31969
- return null;
31970
- }
31971
- for (let i = 0; i < this.childrenCount; i++) {
31972
- if (c.col === col) {
31973
- return c;
31974
- }
31975
- c = c._next;
31976
- }
31977
- return null;
31978
- }
31979
- getRowGroup(row) {
31980
- let c = this._firstChild;
31981
- if (!c) {
31982
- return null;
31983
- }
31984
- for (let i = 0; i < this.childrenCount; i++) {
31985
- if (c.row === row) {
31986
- return c;
31987
- }
31988
- c = c._next;
31989
- }
31990
- return null;
31991
- }
31992
- getChildAt(index) {
31993
- const child = super.getChildAt(index);
31994
- if (child && child.name === 'border-rect') {
31995
- return child._next;
31996
- }
31997
- return child;
31998
- }
31999
- tryUpdateAABBBounds() {
32000
- if (this.role === 'cell') {
32001
- if (!this.shouldUpdateAABBBounds()) {
32002
- return this._AABBBounds;
32003
- }
32004
- const selfChange = this.shouldSelfChangeUpdateAABBBounds();
32005
- const bounds = this.doUpdateAABBBounds();
32006
- this.addUpdateLayoutTag();
32007
- after(this, selfChange);
32008
- return bounds;
32009
- }
32010
- return super.tryUpdateAABBBounds();
32011
- }
32012
- doUpdateAABBBounds() {
32013
- if (this.role === 'cell') {
32014
- const attribute = this.attribute;
32015
- const { x, y, width, height } = attribute;
32016
- this._AABBBounds.setValue(x, y, x + width, y + height);
32017
- this.parent && this.parent.addChildUpdateBoundTag();
32018
- this.clearUpdateBoundTag();
32019
- return this._AABBBounds;
32020
- }
32021
- else if (this.role === 'body' ||
32022
- this.role === 'row-header' ||
32023
- this.role === 'col-header' ||
32024
- this.role === 'right-frozen' ||
32025
- this.role === 'bottom-frozen' ||
32026
- this.role === 'corner-header' ||
32027
- this.role === 'corner-right-top-header' ||
32028
- this.role === 'corner-right-bottom-header' ||
32029
- this.role === 'corner-left-bottom-header') {
32030
- this._AABBBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);
32031
- this.parent && this.parent.addChildUpdateBoundTag();
32032
- this.clearUpdateBoundTag();
32033
- return this._AABBBounds;
32034
- }
32035
- return super.doUpdateAABBBounds();
32142
+ else if (str.endsWith('%') && size) {
32143
+ return (parseInt(str, 10) / 100) * size;
32036
32144
  }
32037
- updateColumnRowNumber(row) {
32038
- if (!this.rowNumber) {
32039
- this.rowNumber = row;
32040
- }
32041
- else {
32042
- this.rowNumber = Math.max(this.rowNumber, row);
32043
- }
32145
+ return parseInt(str, 10);
32146
+ }
32147
+ function dealPercentCalc(group, parentWidth, parentHeight) {
32148
+ if (!group) {
32149
+ return;
32044
32150
  }
32045
- updateColumnHeight(cellHeight) {
32046
- if (!this.colHeight) {
32047
- this.colHeight = cellHeight;
32151
+ group.forEachChildren((child) => {
32152
+ if (!child) {
32153
+ return;
32048
32154
  }
32049
- else {
32050
- this.colHeight += cellHeight;
32155
+ if (isObject$4(child.attribute.width) && child.attribute.width.percent) {
32156
+ child.setAttribute('width', (child.attribute.width.percent / 100) * parentWidth +
32157
+ (child.attribute.width.delta ?? 0));
32051
32158
  }
32052
- }
32053
- };
32054
- function after(group, selfChange) {
32055
- if (!group.stage.dirtyBounds) {
32056
- return;
32057
- }
32058
- if (!(group.stage && group.stage.renderCount)) {
32059
- return;
32060
- }
32061
- if (group.isContainer && !selfChange) {
32062
- return;
32063
- }
32064
- group.stage.dirty(group.globalAABBBounds);
32065
- }
32066
-
32067
- const CHART_NUMBER_TYPE = genNumberType();
32068
- class Chart extends Group$2 {
32069
- type = 'chart';
32070
- chartInstance;
32071
- activeChartInstance;
32072
- active;
32073
- cacheCanvas;
32074
- constructor(params) {
32075
- super(params);
32076
- this.numberType = CHART_NUMBER_TYPE;
32077
- if (!params.chartInstance) {
32078
- params.chartInstance = this.chartInstance = new params.ClassType(params.spec, {
32079
- renderCanvas: params.canvas,
32080
- mode: this.attribute.mode === 'node' ? 'node' : 'desktop-browser',
32081
- modeParams: this.attribute.modeParams,
32082
- canvasControled: false,
32083
- viewBox: { x1: 0, x2: 0, y1: 0, y2: 0 },
32084
- dpr: params.dpr,
32085
- interactive: false,
32086
- animation: false,
32087
- autoFit: false
32088
- });
32089
- this.chartInstance.renderSync();
32159
+ if (isObject$4(child.attribute.height) && child.attribute.height.percent) {
32160
+ child.setAttribute('height', (child.attribute.height.percent / 100) * parentHeight +
32161
+ (child.attribute.height.delta ?? 0));
32090
32162
  }
32091
- else {
32092
- this.chartInstance = params.chartInstance;
32163
+ if (child.type === 'group') {
32164
+ dealPercentCalc(child, child.attribute.width, child.attribute.height);
32093
32165
  }
32094
- }
32095
- activate(table) {
32096
- this.active = true;
32097
- const { col, row } = this.parent;
32098
- const { x1, y1, x2, y2 } = this.getViewBox();
32099
- const tableBound = getTableBounds(col, row, table);
32100
- const clipBound = tableBound.intersect({
32101
- x1: x1 - table.scrollLeft,
32102
- x2: x2 - table.scrollLeft,
32103
- y1: y1 - table.scrollTop,
32104
- y2: y2 - table.scrollTop
32105
- });
32106
- this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, {
32107
- renderCanvas: this.attribute.canvas,
32108
- mode: 'desktop-browser',
32109
- canvasControled: false,
32110
- viewBox: {
32111
- x1: x1 - table.scrollLeft,
32112
- x2: x2 - table.scrollLeft,
32113
- y1: y1 - table.scrollTop,
32114
- y2: y2 - table.scrollTop
32115
- },
32116
- dpr: table.internalProps.pixelRatio,
32117
- animation: false,
32118
- interactive: true,
32119
- autoFit: false,
32120
- beforeRender: (stage) => {
32121
- const ctx = stage.window.getContext();
32122
- ctx.inuse = true;
32123
- ctx.clearMatrix();
32124
- ctx.setTransformForCurrent(true);
32125
- ctx.beginPath();
32126
- ctx.rect(clipBound.x1, clipBound.y1, clipBound.x2 - clipBound.x1, clipBound.y2 - clipBound.y1);
32127
- ctx.clip();
32128
- },
32129
- afterRender(stage) {
32130
- const ctx = stage.window.getContext();
32131
- ctx.inuse = false;
32132
- }
32133
- });
32134
- this.activeChartInstance.renderSync();
32135
- table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
32136
- this.activeChartInstance.on('click', (params) => {
32137
- if (Chart.temp) {
32138
- table.scenegraph.updateChartState(params?.datum);
32139
- }
32140
- });
32141
- this.activeChartInstance.on('brushEnd', (params) => {
32142
- table.scenegraph.updateChartState(params?.value?.inBrushData);
32143
- Chart.temp = 0;
32144
- setTimeout(() => {
32145
- Chart.temp = 1;
32146
- }, 0);
32147
- });
32148
- table._bindChartEvent?.(this.activeChartInstance);
32149
- }
32150
- static temp = 1;
32151
- deactivate() {
32152
- this.active = false;
32153
- this.activeChartInstance?.updateViewBox({
32154
- x1: -1000,
32155
- x2: -800,
32156
- y1: -1000,
32157
- y2: -800
32158
- }, false, false);
32159
- this.activeChartInstance?.release();
32160
- this.activeChartInstance = null;
32161
- }
32162
- updateData(data) {
32163
- this.attribute.data = data;
32164
- }
32165
- getViewBox() {
32166
- const cellGroup = this.parent;
32167
- const padding = this.attribute.cellPadding;
32168
- const table = this.stage.table;
32169
- return {
32170
- x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
32171
- x2: Math.ceil(cellGroup.globalAABBBounds.x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft),
32172
- y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
32173
- y2: Math.ceil(cellGroup.globalAABBBounds.y1 + cellGroup.attribute.height - padding[2] + table.scrollTop)
32174
- };
32175
- }
32166
+ });
32176
32167
  }
32177
- function getTableBounds(col, row, table) {
32178
- const { layoutMap } = table.internalProps;
32179
- const bodyBound = new Bounds();
32180
- const tableBound = table.scenegraph.tableGroup.globalAABBBounds;
32181
- bodyBound.x1 = tableBound.x1;
32182
- bodyBound.x2 = tableBound.x2;
32183
- bodyBound.y1 = tableBound.y1;
32184
- bodyBound.y2 = tableBound.y2;
32185
- if (!layoutMap.isFrozenColumn(col, row) && !layoutMap.isRightFrozenColumn(col, row)) {
32186
- bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
32187
- bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
32188
- bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
32189
- bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
32168
+ function decodeReactDom(dom) {
32169
+ if (!dom || !dom.$$typeof) {
32170
+ return dom;
32190
32171
  }
32191
- else if (layoutMap.isLeftBottomCorner(col, row) || layoutMap.isRightTopCorner(col, row)) ;
32192
- else if (layoutMap.isFrozenColumn(col, row)) {
32193
- bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
32194
- bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
32172
+ const type = dom.type;
32173
+ const { attribute, children, stateProxy } = dom.props;
32174
+ const g = type({ attribute });
32175
+ parseToGraphic(g, dom.props);
32176
+ if (stateProxy) {
32177
+ g.stateProxy = stateProxy;
32195
32178
  }
32196
- else if (layoutMap.isRightFrozenColumn(col, row)) {
32197
- bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
32198
- bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
32179
+ g.id = attribute.id;
32180
+ g.name = attribute.name;
32181
+ if (isArray$1(children)) {
32182
+ children.forEach((item) => {
32183
+ const c = decodeReactDom(item);
32184
+ c && c.type && g.add(c);
32185
+ });
32199
32186
  }
32200
- else if (layoutMap.isBottomFrozenRow(col, row)) {
32201
- bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
32202
- bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
32187
+ else if (children) {
32188
+ g.add(decodeReactDom(children));
32203
32189
  }
32204
- return bodyBound;
32205
- }
32206
-
32207
- const chartTypes = {};
32208
-
32209
- const builtin = {};
32210
- function get$2() {
32211
- return extend(builtin, chartTypes);
32190
+ return g;
32212
32191
  }
32213
-
32214
- function createChartCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, dataValue, chartModule, chartSpec, chartInstance, dataId, table, cellTheme) {
32215
- const registerCharts = get$2();
32216
- const ClassType = registerCharts[chartModule];
32217
- const headerStyle = table._getCellStyle(col, row);
32218
- const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
32219
- if (isValid$1(functionalPadding)) {
32220
- padding = functionalPadding;
32192
+ function parseToGraphic(g, props) {
32193
+ let isGraphic = false;
32194
+ switch (g.type) {
32195
+ case 'richtext':
32196
+ break;
32197
+ case 'rich/image':
32198
+ break;
32199
+ default:
32200
+ isGraphic = true;
32221
32201
  }
32222
- if (!cellGroup) {
32223
- cellGroup = new Group$1({
32224
- x: xOrigin,
32225
- y: yOrigin,
32226
- width,
32227
- height,
32228
- lineWidth: cellTheme?.group?.lineWidth ?? undefined,
32229
- fill: cellTheme?.group?.fill ?? undefined,
32230
- stroke: cellTheme?.group?.stroke ?? undefined,
32231
- strokeArrayWidth: cellTheme?.group?.strokeArrayWidth ?? undefined,
32232
- strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
32233
- cursor: cellTheme?.group?.cursor ?? undefined,
32234
- lineCap: 'square',
32235
- clip: true,
32236
- cornerRadius: cellTheme.group.cornerRadius
32202
+ if (isGraphic) {
32203
+ Object.keys(props).forEach(k => {
32204
+ const en = REACT_TO_CANOPUS_EVENTS[k];
32205
+ if (en) {
32206
+ g.on(en, props[k]);
32207
+ }
32237
32208
  });
32238
- cellGroup.role = 'cell';
32239
- cellGroup.col = col;
32240
- cellGroup.row = row;
32241
- columnGroup?.addChild(cellGroup);
32242
32209
  }
32243
- cellGroup.AABBBounds.width();
32244
- const chartGroup = new Chart({
32245
- stroke: false,
32246
- x: padding[3],
32247
- y: padding[0],
32248
- canvas: table.canvas ?? table.scenegraph.stage.window.getContext().canvas,
32249
- mode: table.options.mode,
32250
- modeParams: table.options.modeParams,
32251
- spec: chartSpec,
32252
- ClassType,
32253
- width: width - padding[3] - padding[1],
32254
- height: height - padding[2] - padding[0],
32255
- chartInstance,
32256
- dataId,
32257
- data: table.getCellValue(col, row),
32258
- cellPadding: padding,
32259
- dpr: table.internalProps.pixelRatio,
32260
- axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
32261
- });
32262
- cellGroup.appendChild(chartGroup);
32263
- table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
32264
- return cellGroup;
32265
32210
  }
32266
32211
 
32267
32212
  const icons = {};
@@ -32541,10 +32486,231 @@
32541
32486
  };
32542
32487
  }
32543
32488
  };
32544
- function get$1() {
32489
+ function get$2() {
32545
32490
  return extend(builtins, icons);
32546
32491
  }
32547
32492
 
32493
+ let Group$1 = class Group extends Group$2 {
32494
+ role;
32495
+ col;
32496
+ row;
32497
+ mergeStartCol;
32498
+ mergeStartRow;
32499
+ mergeEndCol;
32500
+ mergeEndRow;
32501
+ contentWidth;
32502
+ contentHeight;
32503
+ rowNumber;
32504
+ colHeight;
32505
+ border;
32506
+ needUpdate;
32507
+ needUpdateWidth;
32508
+ needUpdateHeight;
32509
+ clear() {
32510
+ this.removeAllChild();
32511
+ }
32512
+ getChildByName(name, deep) {
32513
+ let result = null;
32514
+ this.forEachChildren((child) => {
32515
+ if (child.name === name) {
32516
+ result = child;
32517
+ return true;
32518
+ }
32519
+ return false;
32520
+ });
32521
+ if (deep) {
32522
+ this.forEachChildren((child) => {
32523
+ if (child.getChildByName) {
32524
+ const target = child.getChildByName(name, true);
32525
+ if (target) {
32526
+ result = target;
32527
+ return true;
32528
+ }
32529
+ }
32530
+ return false;
32531
+ });
32532
+ }
32533
+ return result;
32534
+ }
32535
+ get width() {
32536
+ let width = this.AABBBounds.width();
32537
+ if (width === Infinity || width === -Infinity) {
32538
+ width = 0;
32539
+ }
32540
+ return Math.max(width, this.attribute.width ?? 0);
32541
+ }
32542
+ get height() {
32543
+ let height = this.AABBBounds.height();
32544
+ if (height === Infinity || height === -Infinity) {
32545
+ height = 0;
32546
+ }
32547
+ return Math.max(height, this.attribute.height ?? 0);
32548
+ }
32549
+ setDeltaWidth(deltaX) {
32550
+ if (deltaX === 0) {
32551
+ return;
32552
+ }
32553
+ this.setAttribute('width', (this.attribute.width ?? 0) + deltaX);
32554
+ if (this.border) {
32555
+ this.border.setAttribute('width', this.border.attribute.width + deltaX);
32556
+ if (this.border.type === 'group') {
32557
+ this.border.firstChild.setAttribute('width', this.border.firstChild.attribute.width + deltaX);
32558
+ }
32559
+ }
32560
+ }
32561
+ setDeltaHeight(deltaY) {
32562
+ if (deltaY === 0) {
32563
+ return;
32564
+ }
32565
+ this.setAttribute('height', (this.attribute.height ?? 0) + deltaY);
32566
+ if (this.border) {
32567
+ this.border.setAttribute('height', this.border.attribute.height + deltaY);
32568
+ if (this.border.type === 'group') {
32569
+ this.border.firstChild.setAttribute('width', this.border.firstChild.attribute.height + deltaY);
32570
+ }
32571
+ }
32572
+ }
32573
+ setDeltaX(deltaX) {
32574
+ if (deltaX === 0) {
32575
+ return;
32576
+ }
32577
+ this.setAttribute('x', this.attribute.x + deltaX);
32578
+ }
32579
+ setDeltaY(deltaY) {
32580
+ if (deltaY === 0) {
32581
+ return;
32582
+ }
32583
+ this.setAttribute('y', this.attribute.y + deltaY);
32584
+ }
32585
+ forEachChildrenSkipChild(cb, skipChildName = 'border-rect', reverse = false) {
32586
+ if (reverse) {
32587
+ let child = this._lastChild;
32588
+ let i = 0;
32589
+ while (child) {
32590
+ if (child.name !== skipChildName) {
32591
+ const breakTag = cb(child, i++);
32592
+ if (breakTag) {
32593
+ return;
32594
+ }
32595
+ }
32596
+ child = child._prev;
32597
+ }
32598
+ }
32599
+ else {
32600
+ let child = this._firstChild;
32601
+ let i = 0;
32602
+ while (child) {
32603
+ if (child.name !== skipChildName) {
32604
+ const breakTag = cb(child, i++);
32605
+ if (breakTag) {
32606
+ return;
32607
+ }
32608
+ }
32609
+ child = child._next;
32610
+ }
32611
+ }
32612
+ }
32613
+ getColGroup(col) {
32614
+ let c = this._firstChild;
32615
+ if (!c) {
32616
+ return null;
32617
+ }
32618
+ for (let i = 0; i < this.childrenCount; i++) {
32619
+ if (c.col === col) {
32620
+ return c;
32621
+ }
32622
+ c = c._next;
32623
+ }
32624
+ return null;
32625
+ }
32626
+ getRowGroup(row) {
32627
+ let c = this._firstChild;
32628
+ if (!c) {
32629
+ return null;
32630
+ }
32631
+ for (let i = 0; i < this.childrenCount; i++) {
32632
+ if (c.row === row) {
32633
+ return c;
32634
+ }
32635
+ c = c._next;
32636
+ }
32637
+ return null;
32638
+ }
32639
+ getChildAt(index) {
32640
+ const child = super.getChildAt(index);
32641
+ if (child && child.name === 'border-rect') {
32642
+ return child._next;
32643
+ }
32644
+ return child;
32645
+ }
32646
+ tryUpdateAABBBounds() {
32647
+ if (this.role === 'cell') {
32648
+ if (!this.shouldUpdateAABBBounds()) {
32649
+ return this._AABBBounds;
32650
+ }
32651
+ const selfChange = this.shouldSelfChangeUpdateAABBBounds();
32652
+ const bounds = this.doUpdateAABBBounds();
32653
+ this.addUpdateLayoutTag();
32654
+ after(this, selfChange);
32655
+ return bounds;
32656
+ }
32657
+ return super.tryUpdateAABBBounds();
32658
+ }
32659
+ doUpdateAABBBounds() {
32660
+ if (this.role === 'cell') {
32661
+ const attribute = this.attribute;
32662
+ const { x, y, width, height } = attribute;
32663
+ this._AABBBounds.setValue(x, y, x + width, y + height);
32664
+ this.parent && this.parent.addChildUpdateBoundTag();
32665
+ this.clearUpdateBoundTag();
32666
+ return this._AABBBounds;
32667
+ }
32668
+ else if (this.role === 'body' ||
32669
+ this.role === 'row-header' ||
32670
+ this.role === 'col-header' ||
32671
+ this.role === 'right-frozen' ||
32672
+ this.role === 'bottom-frozen' ||
32673
+ this.role === 'corner-header' ||
32674
+ this.role === 'corner-right-top-header' ||
32675
+ this.role === 'corner-right-bottom-header' ||
32676
+ this.role === 'corner-left-bottom-header') {
32677
+ this._AABBBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);
32678
+ this.parent && this.parent.addChildUpdateBoundTag();
32679
+ this.clearUpdateBoundTag();
32680
+ return this._AABBBounds;
32681
+ }
32682
+ return super.doUpdateAABBBounds();
32683
+ }
32684
+ updateColumnRowNumber(row) {
32685
+ if (!this.rowNumber) {
32686
+ this.rowNumber = row;
32687
+ }
32688
+ else {
32689
+ this.rowNumber = Math.max(this.rowNumber, row);
32690
+ }
32691
+ }
32692
+ updateColumnHeight(cellHeight) {
32693
+ if (!this.colHeight) {
32694
+ this.colHeight = cellHeight;
32695
+ }
32696
+ else {
32697
+ this.colHeight += cellHeight;
32698
+ }
32699
+ }
32700
+ };
32701
+ function after(group, selfChange) {
32702
+ if (!group.stage.dirtyBounds) {
32703
+ return;
32704
+ }
32705
+ if (!(group.stage && group.stage.renderCount)) {
32706
+ return;
32707
+ }
32708
+ if (group.isContainer && !selfChange) {
32709
+ return;
32710
+ }
32711
+ group.stage.dirty(group.globalAABBBounds);
32712
+ }
32713
+
32548
32714
  function calcKeepAspectRatioSize(width, height, maxWidth, maxHeight) {
32549
32715
  let newWidth = width;
32550
32716
  let newHeight = height;
@@ -32582,7 +32748,38 @@
32582
32748
  return { x, y };
32583
32749
  }
32584
32750
 
32585
- get$1();
32751
+ function getProp(name, cellStyle, col, row, _table) {
32752
+ const prop = cellStyle && isValid$1(cellStyle[name]) ? cellStyle[name] : null;
32753
+ if (typeof prop === 'function') {
32754
+ const arg = {
32755
+ col,
32756
+ row,
32757
+ table: _table,
32758
+ value: _table.getCellValue(col, row),
32759
+ dataValue: _table.getCellOriginValue(col, row),
32760
+ cellHeaderPaths: _table.getCellHeaderPaths(col, row)
32761
+ };
32762
+ return prop(arg);
32763
+ }
32764
+ return prop;
32765
+ }
32766
+ function getFunctionalProp(name, cellStyle, col, row, _table) {
32767
+ const prop = cellStyle && isValid$1(cellStyle[name]) ? cellStyle[name] : null;
32768
+ if (typeof prop === 'function') {
32769
+ const arg = {
32770
+ col,
32771
+ row,
32772
+ table: _table,
32773
+ value: _table.getCellValue(col, row),
32774
+ dataValue: _table.getCellOriginValue(col, row),
32775
+ cellHeaderPaths: _table.getCellHeaderPaths(col, row)
32776
+ };
32777
+ return prop(arg);
32778
+ }
32779
+ return undefined;
32780
+ }
32781
+
32782
+ get$2();
32586
32783
  function createImageCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme) {
32587
32784
  const headerStyle = table._getCellStyle(col, row);
32588
32785
  const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
@@ -32632,13 +32829,16 @@
32632
32829
  _adjustWidthHeight(col, row, originImage.width, originImage.height, table.scenegraph, padding);
32633
32830
  }
32634
32831
  if (keepAspectRatio) {
32635
- const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width, originImage.height, cellGroup.attribute.width - padding[1] - padding[3], cellGroup.attribute.height - padding[0] - padding[2]);
32636
- const pos = calcStartPosition(0, 0, cellGroup.attribute.width, cellGroup.attribute.height, imageWidth, imageHeight, textAlign, textBaseline, padding);
32832
+ const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, table);
32833
+ const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width, originImage.height, cellWidth - padding[1] - padding[3], cellHeight - padding[0] - padding[2]);
32834
+ const pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
32637
32835
  image.setAttributes({
32638
32836
  x: pos.x,
32639
32837
  y: pos.y,
32640
32838
  width: imageWidth,
32641
- height: imageHeight
32839
+ height: imageHeight,
32840
+ dx: isMerge ? -table.getColsWidth(cellGroup.mergeStartCol, col - 1) : 0,
32841
+ dy: isMerge ? -table.getRowsHeight(cellGroup.mergeStartRow, row - 1) : 0
32642
32842
  });
32643
32843
  }
32644
32844
  table.scenegraph.updateNextFrame();
@@ -32650,7 +32850,7 @@
32650
32850
  };
32651
32851
  }
32652
32852
  image.failCallback = () => {
32653
- const regedIcons = get$1();
32853
+ const regedIcons = get$2();
32654
32854
  image.image = regedIcons.damage_pic.svg;
32655
32855
  };
32656
32856
  cellGroup.appendChild(image);
@@ -32660,20 +32860,36 @@
32660
32860
  let needInvalidate = false;
32661
32861
  let targetWidth = null;
32662
32862
  let targetHeight = null;
32663
- if (scene.table.getColWidth(col) < width + padding[1] + padding[3]) {
32863
+ const cellGroup = scene.getCell(col, row, true);
32864
+ const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, scene.table);
32865
+ if (cellWidth < width + padding[1] + padding[3]) {
32664
32866
  targetWidth = width + padding[1] + padding[3];
32665
32867
  needInvalidate = true;
32666
32868
  }
32667
- if (scene.table.getRowHeight(row) < height + padding[2] + padding[0]) {
32869
+ if (cellHeight < height + padding[2] + padding[0]) {
32668
32870
  targetHeight = height + padding[2] + padding[0];
32669
32871
  needInvalidate = true;
32670
32872
  }
32671
32873
  if (needInvalidate) {
32672
32874
  if (typeof targetWidth === 'number') {
32673
- scene.setColWidth(col, targetWidth);
32875
+ if (isMerge) {
32876
+ for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
32877
+ scene.setColWidth(col, targetWidth / (cellGroup.mergeEndCol - cellGroup.mergeStartCol + 1));
32878
+ }
32879
+ }
32880
+ else {
32881
+ scene.setColWidth(col, targetWidth);
32882
+ }
32674
32883
  }
32675
32884
  if (typeof targetHeight === 'number') {
32676
- scene.setRowHeight(row, targetHeight);
32885
+ if (isMerge) {
32886
+ for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
32887
+ scene.setRowHeight(row, targetHeight / (cellGroup.mergeEndRow - cellGroup.mergeStartRow + 1));
32888
+ }
32889
+ }
32890
+ else {
32891
+ scene.setRowHeight(row, targetHeight);
32892
+ }
32677
32893
  }
32678
32894
  scene.component.updateScrollBar();
32679
32895
  return true;
@@ -32692,8 +32908,9 @@
32692
32908
  const textBaseline = getProp('textBaseline', headerStyle, col, row, table) ?? 'middle';
32693
32909
  const padding = getQuadProps(getProp('padding', headerStyle, col, row, table)) ?? [0, 0, 0, 0];
32694
32910
  if (image.keepAspectRatio) {
32695
- const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width || originImage.videoWidth, originImage.height || originImage.videoHeight, cellGroup.attribute.width - (padding[1] + padding[3]), cellGroup.attribute.height - (padding[0] + padding[2]));
32696
- const pos = calcStartPosition(0, 0, cellGroup.attribute.width, cellGroup.attribute.height, imageWidth, imageHeight, textAlign, textBaseline, padding);
32911
+ const { width: cellWidth, height: cellHeight } = getCellRange(cellGroup, table);
32912
+ const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width || originImage.videoWidth, originImage.height || originImage.videoHeight, cellWidth - (padding[1] + padding[3]), cellHeight - (padding[0] + padding[2]));
32913
+ const pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
32697
32914
  image.setAttributes({
32698
32915
  x: pos.x,
32699
32916
  y: pos.y,
@@ -32702,19 +32919,19 @@
32702
32919
  });
32703
32920
  }
32704
32921
  else {
32922
+ const { width: cellWidth, height: cellHeight } = getCellRange(cellGroup, table);
32705
32923
  image.setAttributes({
32706
32924
  x: padding[3],
32707
32925
  y: padding[0],
32708
- width: cellGroup.attribute.width - padding[1] - padding[3],
32709
- height: cellGroup.attribute.height - padding[0] - padding[2]
32926
+ width: cellWidth - padding[1] - padding[3],
32927
+ height: cellHeight - padding[0] - padding[2]
32710
32928
  });
32711
32929
  }
32712
32930
  const playIcon = cellGroup.getChildByName('play-icon');
32713
32931
  if (playIcon) {
32714
32932
  const left = 0;
32715
32933
  const top = 0;
32716
- const width = cellGroup.attribute.width;
32717
- const height = cellGroup.attribute.height;
32934
+ const { width, height } = getCellRange(cellGroup, table);
32718
32935
  const iconSize = Math.floor(Math.min(width - padding[1] - padding[3], height - padding[2] - padding[0]) / 2);
32719
32936
  const anchorX = left + (width > image.attribute.width ? image.attribute.x - left + image.attribute.width / 2 : width / 2);
32720
32937
  const anchorY = top + (height > image.attribute.height ? image.attribute.y - top + image.attribute.height / 2 : height / 2);
@@ -32726,6 +32943,23 @@
32726
32943
  });
32727
32944
  }
32728
32945
  }
32946
+ function getCellRange(cellGroup, table) {
32947
+ if (isValid$1(cellGroup.mergeStartCol) &&
32948
+ isValid$1(cellGroup.mergeEndCol) &&
32949
+ isValid$1(cellGroup.mergeStartRow) &&
32950
+ isValid$1(cellGroup.mergeEndRow)) {
32951
+ return {
32952
+ width: table.getColsWidth(cellGroup.mergeStartCol, cellGroup.mergeEndCol),
32953
+ height: table.getRowsHeight(cellGroup.mergeStartRow, cellGroup.mergeEndRow),
32954
+ isMerge: true
32955
+ };
32956
+ }
32957
+ return {
32958
+ width: cellGroup.attribute.width,
32959
+ height: cellGroup.attribute.height,
32960
+ isMerge: false
32961
+ };
32962
+ }
32729
32963
 
32730
32964
  function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table) {
32731
32965
  if (progressBarDefine.dependField) {
@@ -33390,6 +33624,206 @@
33390
33624
  return group;
33391
33625
  }
33392
33626
 
33627
+ const CHART_NUMBER_TYPE = genNumberType();
33628
+ class Chart extends Group$2 {
33629
+ type = 'chart';
33630
+ chartInstance;
33631
+ activeChartInstance;
33632
+ active;
33633
+ cacheCanvas;
33634
+ constructor(params) {
33635
+ super(params);
33636
+ this.numberType = CHART_NUMBER_TYPE;
33637
+ if (!params.chartInstance) {
33638
+ params.chartInstance = this.chartInstance = new params.ClassType(params.spec, {
33639
+ renderCanvas: params.canvas,
33640
+ mode: this.attribute.mode === 'node' ? 'node' : 'desktop-browser',
33641
+ modeParams: this.attribute.modeParams,
33642
+ canvasControled: false,
33643
+ viewBox: { x1: 0, x2: 0, y1: 0, y2: 0 },
33644
+ dpr: params.dpr,
33645
+ interactive: false,
33646
+ animation: false,
33647
+ autoFit: false
33648
+ });
33649
+ this.chartInstance.renderSync();
33650
+ }
33651
+ else {
33652
+ this.chartInstance = params.chartInstance;
33653
+ }
33654
+ }
33655
+ activate(table) {
33656
+ this.active = true;
33657
+ const { col, row } = this.parent;
33658
+ const { x1, y1, x2, y2 } = this.getViewBox();
33659
+ const tableBound = getTableBounds(col, row, table);
33660
+ const clipBound = tableBound.intersect({
33661
+ x1: x1 - table.scrollLeft,
33662
+ x2: x2 - table.scrollLeft,
33663
+ y1: y1 - table.scrollTop,
33664
+ y2: y2 - table.scrollTop
33665
+ });
33666
+ this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, {
33667
+ renderCanvas: this.attribute.canvas,
33668
+ mode: 'desktop-browser',
33669
+ canvasControled: false,
33670
+ viewBox: {
33671
+ x1: x1 - table.scrollLeft,
33672
+ x2: x2 - table.scrollLeft,
33673
+ y1: y1 - table.scrollTop,
33674
+ y2: y2 - table.scrollTop
33675
+ },
33676
+ dpr: table.internalProps.pixelRatio,
33677
+ animation: false,
33678
+ interactive: true,
33679
+ autoFit: false,
33680
+ beforeRender: (stage) => {
33681
+ const ctx = stage.window.getContext();
33682
+ ctx.inuse = true;
33683
+ ctx.clearMatrix();
33684
+ ctx.setTransformForCurrent(true);
33685
+ ctx.beginPath();
33686
+ ctx.rect(clipBound.x1, clipBound.y1, clipBound.x2 - clipBound.x1, clipBound.y2 - clipBound.y1);
33687
+ ctx.clip();
33688
+ },
33689
+ afterRender(stage) {
33690
+ const ctx = stage.window.getContext();
33691
+ ctx.inuse = false;
33692
+ }
33693
+ });
33694
+ this.activeChartInstance.renderSync();
33695
+ table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
33696
+ this.activeChartInstance.on('click', (params) => {
33697
+ if (Chart.temp) {
33698
+ table.scenegraph.updateChartState(params?.datum);
33699
+ }
33700
+ });
33701
+ this.activeChartInstance.on('brushEnd', (params) => {
33702
+ table.scenegraph.updateChartState(params?.value?.inBrushData);
33703
+ Chart.temp = 0;
33704
+ setTimeout(() => {
33705
+ Chart.temp = 1;
33706
+ }, 0);
33707
+ });
33708
+ table._bindChartEvent?.(this.activeChartInstance);
33709
+ }
33710
+ static temp = 1;
33711
+ deactivate() {
33712
+ this.active = false;
33713
+ this.activeChartInstance?.updateViewBox({
33714
+ x1: -1000,
33715
+ x2: -800,
33716
+ y1: -1000,
33717
+ y2: -800
33718
+ }, false, false);
33719
+ this.activeChartInstance?.release();
33720
+ this.activeChartInstance = null;
33721
+ }
33722
+ updateData(data) {
33723
+ this.attribute.data = data;
33724
+ }
33725
+ getViewBox() {
33726
+ const cellGroup = this.parent;
33727
+ const padding = this.attribute.cellPadding;
33728
+ const table = this.stage.table;
33729
+ return {
33730
+ x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
33731
+ x2: Math.ceil(cellGroup.globalAABBBounds.x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft),
33732
+ y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
33733
+ y2: Math.ceil(cellGroup.globalAABBBounds.y1 + cellGroup.attribute.height - padding[2] + table.scrollTop)
33734
+ };
33735
+ }
33736
+ }
33737
+ function getTableBounds(col, row, table) {
33738
+ const { layoutMap } = table.internalProps;
33739
+ const bodyBound = new Bounds();
33740
+ const tableBound = table.scenegraph.tableGroup.globalAABBBounds;
33741
+ bodyBound.x1 = tableBound.x1;
33742
+ bodyBound.x2 = tableBound.x2;
33743
+ bodyBound.y1 = tableBound.y1;
33744
+ bodyBound.y2 = tableBound.y2;
33745
+ if (!layoutMap.isFrozenColumn(col, row) && !layoutMap.isRightFrozenColumn(col, row)) {
33746
+ bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
33747
+ bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
33748
+ bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
33749
+ bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
33750
+ }
33751
+ else if (layoutMap.isLeftBottomCorner(col, row) || layoutMap.isRightTopCorner(col, row)) ;
33752
+ else if (layoutMap.isFrozenColumn(col, row)) {
33753
+ bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
33754
+ bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
33755
+ }
33756
+ else if (layoutMap.isRightFrozenColumn(col, row)) {
33757
+ bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
33758
+ bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
33759
+ }
33760
+ else if (layoutMap.isBottomFrozenRow(col, row)) {
33761
+ bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
33762
+ bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
33763
+ }
33764
+ return bodyBound;
33765
+ }
33766
+
33767
+ const chartTypes = {};
33768
+
33769
+ const builtin = {};
33770
+ function get$1() {
33771
+ return extend(builtin, chartTypes);
33772
+ }
33773
+
33774
+ function createChartCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, dataValue, chartModule, chartSpec, chartInstance, dataId, table, cellTheme) {
33775
+ const registerCharts = get$1();
33776
+ const ClassType = registerCharts[chartModule];
33777
+ const headerStyle = table._getCellStyle(col, row);
33778
+ const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
33779
+ if (isValid$1(functionalPadding)) {
33780
+ padding = functionalPadding;
33781
+ }
33782
+ if (!cellGroup) {
33783
+ cellGroup = new Group$1({
33784
+ x: xOrigin,
33785
+ y: yOrigin,
33786
+ width,
33787
+ height,
33788
+ lineWidth: cellTheme?.group?.lineWidth ?? undefined,
33789
+ fill: cellTheme?.group?.fill ?? undefined,
33790
+ stroke: cellTheme?.group?.stroke ?? undefined,
33791
+ strokeArrayWidth: cellTheme?.group?.strokeArrayWidth ?? undefined,
33792
+ strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
33793
+ cursor: cellTheme?.group?.cursor ?? undefined,
33794
+ lineCap: 'square',
33795
+ clip: true,
33796
+ cornerRadius: cellTheme.group.cornerRadius
33797
+ });
33798
+ cellGroup.role = 'cell';
33799
+ cellGroup.col = col;
33800
+ cellGroup.row = row;
33801
+ columnGroup?.addChild(cellGroup);
33802
+ }
33803
+ cellGroup.AABBBounds.width();
33804
+ const chartGroup = new Chart({
33805
+ stroke: false,
33806
+ x: padding[3],
33807
+ y: padding[0],
33808
+ canvas: table.canvas ?? table.scenegraph.stage.window.getContext().canvas,
33809
+ mode: table.options.mode,
33810
+ modeParams: table.options.modeParams,
33811
+ spec: chartSpec,
33812
+ ClassType,
33813
+ width: width - padding[3] - padding[1],
33814
+ height: height - padding[2] - padding[0],
33815
+ chartInstance,
33816
+ dataId,
33817
+ data: table.getCellValue(col, row),
33818
+ cellPadding: padding,
33819
+ dpr: table.internalProps.pixelRatio,
33820
+ axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
33821
+ });
33822
+ cellGroup.appendChild(chartGroup);
33823
+ table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
33824
+ return cellGroup;
33825
+ }
33826
+
33393
33827
  class CellContent extends Group$1 {
33394
33828
  _leftGroup;
33395
33829
  _rightGroup;
@@ -33583,7 +34017,7 @@
33583
34017
  return cellHierarchyIndent;
33584
34018
  }
33585
34019
 
33586
- function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme, range) {
34020
+ function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme) {
33587
34021
  const leftIcons = [];
33588
34022
  const rightIcons = [];
33589
34023
  const contentLeftIcons = [];
@@ -33602,9 +34036,7 @@
33602
34036
  if (!Array.isArray(icons) || icons.length === 0) {
33603
34037
  if (isValid$1(textStr)) {
33604
34038
  const text = convertInternal(textStr).replace(/\r?\n/g, '\n').replace(/\r/g, '\n').split('\n');
33605
- const hierarchyOffset = range
33606
- ? getHierarchyOffset(range.start.col, range.start.row, table)
33607
- : getHierarchyOffset(cellGroup.col, cellGroup.row, table);
34039
+ const hierarchyOffset = getHierarchyOffset(cellGroup.col, cellGroup.row, table);
33608
34040
  const attribute = {
33609
34041
  text: text.length === 1 ? text[0] : text,
33610
34042
  maxLineWidth: autoColWidth ? Infinity : cellWidth - (padding[1] + padding[3] + hierarchyOffset),
@@ -33651,7 +34083,7 @@
33651
34083
  }
33652
34084
  });
33653
34085
  leftIcons.forEach(icon => {
33654
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34086
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33655
34087
  iconMark.role = 'icon-left';
33656
34088
  iconMark.name = icon.name;
33657
34089
  iconMark.setAttribute('x', leftIconWidth + (iconMark.attribute.marginLeft ?? 0));
@@ -33661,7 +34093,7 @@
33661
34093
  cellGroup.appendChild(iconMark);
33662
34094
  });
33663
34095
  rightIcons.forEach(icon => {
33664
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34096
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33665
34097
  iconMark.role = 'icon-right';
33666
34098
  iconMark.name = icon.name;
33667
34099
  iconMark.setAttribute('x', rightIconWidth + (iconMark.attribute.marginLeft ?? 0));
@@ -33671,7 +34103,7 @@
33671
34103
  cellGroup.appendChild(iconMark);
33672
34104
  });
33673
34105
  absoluteLeftIcons.forEach(icon => {
33674
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34106
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33675
34107
  iconMark.role = 'icon-absolute-left';
33676
34108
  iconMark.name = icon.name;
33677
34109
  iconMark.setAttribute('x', absoluteLeftIconWidth + (iconMark.attribute.marginLeft ?? 0));
@@ -33680,7 +34112,7 @@
33680
34112
  cellGroup.appendChild(iconMark);
33681
34113
  });
33682
34114
  absoluteRightIcons.forEach(icon => {
33683
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34115
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33684
34116
  iconMark.role = 'icon-absolute-right';
33685
34117
  iconMark.name = icon.name;
33686
34118
  iconMark.setAttribute('x', absoluteRightIconWidth + (iconMark.attribute.marginLeft ?? 0));
@@ -33748,13 +34180,13 @@
33748
34180
  baseline: textBaseline
33749
34181
  });
33750
34182
  contentLeftIcons.forEach(icon => {
33751
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34183
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33752
34184
  iconMark.role = 'icon-content-left';
33753
34185
  iconMark.name = icon.name;
33754
34186
  cellContent.addLeftOccupyingIcon(iconMark);
33755
34187
  });
33756
34188
  contentRightIcons.forEach(icon => {
33757
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34189
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33758
34190
  iconMark.role = 'icon-content-right';
33759
34191
  iconMark.name = icon.name;
33760
34192
  cellContent.addRightOccupyingIcon(iconMark);
@@ -33818,7 +34250,7 @@
33818
34250
  height: height + padding[0] + padding[2]
33819
34251
  });
33820
34252
  }
33821
- function dealWithIcon(icon, mark, col, row, range, table) {
34253
+ function dealWithIcon(icon, mark, col, row, table) {
33822
34254
  const iconAttribute = {};
33823
34255
  if (icon.type === 'image') {
33824
34256
  iconAttribute.image = icon.src;
@@ -33836,9 +34268,7 @@
33836
34268
  isNumber$3(row) &&
33837
34269
  table &&
33838
34270
  (icon.funcType === IconFuncTypeEnum.collapse || icon.funcType === IconFuncTypeEnum.expand)) {
33839
- hierarchyOffset = range
33840
- ? getHierarchyOffset(range.start.col, range.start.row, table)
33841
- : getHierarchyOffset(col, row, table);
34271
+ hierarchyOffset = getHierarchyOffset(col, row, table);
33842
34272
  }
33843
34273
  iconAttribute.marginLeft = (icon.marginLeft ?? 0) + hierarchyOffset;
33844
34274
  iconAttribute.marginRight = icon.marginRight ?? 0;
@@ -34060,7 +34490,7 @@
34060
34490
  return false;
34061
34491
  }
34062
34492
 
34063
- function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range) {
34493
+ function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme) {
34064
34494
  const headerStyle = table._getCellStyle(col, row);
34065
34495
  const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
34066
34496
  if (isValid$1(functionalPadding)) {
@@ -34102,15 +34532,9 @@
34102
34532
  const textStr = value;
34103
34533
  let icons;
34104
34534
  if (mayHaveIcon) {
34105
- let iconCol = col;
34106
- let iconRow = row;
34107
- if (range) {
34108
- iconCol = range.start.col;
34109
- iconRow = range.start.row;
34110
- }
34111
- icons = table.getCellIcons(iconCol, iconRow);
34535
+ icons = table.getCellIcons(col, row);
34112
34536
  }
34113
- createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, typeof lineClamp === 'number' ? lineClamp : undefined, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme, range);
34537
+ createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, typeof lineClamp === 'number' ? lineClamp : undefined, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme);
34114
34538
  if (cellTheme?._vtable?.marked) {
34115
34539
  const mark = createArc({
34116
34540
  x: cellGroup.attribute.width,
@@ -34134,7 +34558,7 @@
34134
34558
  return cellGroup;
34135
34559
  }
34136
34560
 
34137
- const regedIcons$1 = get$1();
34561
+ const regedIcons$1 = get$2();
34138
34562
  function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme) {
34139
34563
  const headerStyle = table._getCellStyle(col, row);
34140
34564
  const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
@@ -34389,7 +34813,7 @@
34389
34813
  return checkbox;
34390
34814
  }
34391
34815
 
34392
- function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult) {
34816
+ function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme) {
34393
34817
  if (isPromise(value)) {
34394
34818
  value = table.getCellValue(col, row);
34395
34819
  }
@@ -34446,29 +34870,23 @@
34446
34870
  }
34447
34871
  let customElementsGroup;
34448
34872
  let renderDefault = true;
34449
- if (customResult) {
34450
- customElementsGroup = customResult.elementsGroup;
34451
- renderDefault = customResult.renderDefault;
34873
+ let customRender;
34874
+ let customLayout;
34875
+ const cellLocation = table.getCellLocation(col, row);
34876
+ if (cellLocation !== 'body') {
34877
+ customRender = define?.headerCustomRender;
34878
+ customLayout = define?.headerCustomLayout;
34452
34879
  }
34453
34880
  else {
34454
- let customRender;
34455
- let customLayout;
34456
- const cellLocation = table.getCellLocation(col, row);
34457
- if (cellLocation !== 'body') {
34458
- customRender = define?.headerCustomRender;
34459
- customLayout = define?.headerCustomLayout;
34460
- }
34461
- else {
34462
- customRender = define?.customRender || table.customRender;
34463
- customLayout = define?.customLayout;
34464
- }
34465
- if (customLayout || customRender) {
34466
- const customResult = dealWithCustom(customLayout, customRender, col, row, cellWidth, cellHeight, false, table.heightMode === 'autoHeight', padding, table);
34467
- customElementsGroup = customResult.elementsGroup;
34468
- renderDefault = customResult.renderDefault;
34469
- }
34881
+ customRender = define?.customRender || table.customRender;
34882
+ customLayout = define?.customLayout;
34883
+ }
34884
+ if (customLayout || customRender) {
34885
+ const customResult = dealWithCustom(customLayout, customRender, col, row, cellWidth, cellHeight, false, table.heightMode === 'autoHeight', padding, table);
34886
+ customElementsGroup = customResult.elementsGroup;
34887
+ renderDefault = customResult.renderDefault;
34470
34888
  }
34471
- cellGroup = createCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range);
34889
+ cellGroup = createCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme);
34472
34890
  const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
34473
34891
  if (axisConfig) {
34474
34892
  const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, table);
@@ -34488,21 +34906,21 @@
34488
34906
  }
34489
34907
  }
34490
34908
  else if (type === 'image') {
34491
- cellGroup = createImageCellGroup(columnGroup, 0, y, col, row, table.getColWidth(col), table.getRowHeight(row), define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme);
34909
+ cellGroup = createImageCellGroup(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme);
34492
34910
  }
34493
34911
  else if (type === 'video') {
34494
- cellGroup = createVideoCellGroup(columnGroup, 0, y, col, row, table.getColWidth(col), table.getRowHeight(row), define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme);
34912
+ cellGroup = createVideoCellGroup(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme);
34495
34913
  }
34496
34914
  else if (type === 'chart') {
34497
34915
  const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);
34498
- cellGroup = createChartCellGroup(null, columnGroup, 0, y, col, row, table.getColWidth(col), table.getRowHeight(row), padding, value, define.chartModule, table.isPivotChart()
34916
+ cellGroup = createChartCellGroup(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, value, define.chartModule, table.isPivotChart()
34499
34917
  ? table.internalProps.layoutMap.getChartSpec(col, row)
34500
34918
  : define.chartSpec, chartInstance, table.internalProps.layoutMap?.getChartDataId(col, row) ?? 'data', table, cellTheme);
34501
34919
  }
34502
34920
  else if (type === 'progressbar') {
34503
34921
  const style = table._getCellStyle(col, row);
34504
34922
  const dataValue = table.getCellOriginValue(col, row);
34505
- cellGroup = createCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, false, null, true, cellTheme, range);
34923
+ cellGroup = createCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, false, null, true, cellTheme);
34506
34924
  const progressBarGroup = createProgressBarCell(define, style, colWidth, value, dataValue, col, row, padding, table);
34507
34925
  if (cellGroup.firstChild) {
34508
34926
  cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild);
@@ -34524,45 +34942,14 @@
34524
34942
  const cellStyle = table._getCellStyle(col, row);
34525
34943
  const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;
34526
34944
  const cellLocation = table.getCellLocation(col, row);
34527
- let value = table.getCellValue(col, row);
34945
+ const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);
34528
34946
  let isMerge;
34529
34947
  let range;
34530
- let cellTheme;
34531
- let customStyle;
34532
- let customResult;
34533
- if (table.internalProps.customMergeCell) {
34534
- const customMerge = table.getCustomMerge(col, row);
34535
- if (customMerge) {
34536
- const { range: customMergeRange, text: customMergeText, style: customMergeStyle, customLayout, customRender } = customMerge;
34537
- range = customMergeRange;
34538
- isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
34539
- value = customMergeText;
34540
- customStyle = customMergeStyle;
34541
- if (customStyle) {
34542
- cellTheme = getStyleTheme(customStyle, table, range.start.col, range.start.row, getProp).theme;
34543
- cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);
34544
- }
34545
- if (customLayout || customRender) {
34546
- customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.heightMode === 'autoHeight', [0, 0, 0, 0], table);
34547
- }
34548
- }
34549
- }
34550
- let colForDefine = col;
34551
- let rowForDefine = row;
34552
- if (range) {
34553
- colForDefine = range.start.col;
34554
- rowForDefine = range.start.row;
34555
- }
34556
- const define = cellLocation !== 'body'
34557
- ? table.getHeaderDefine(colForDefine, rowForDefine)
34558
- : table.getBodyColumnDefine(colForDefine, rowForDefine);
34559
- if (!range && (cellLocation !== 'body' || define?.mergeCell)) {
34948
+ if (cellLocation !== 'body' || define?.mergeCell || table.internalProps.customMergeCell) {
34560
34949
  range = table.getCellRange(col, row);
34561
34950
  isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
34562
34951
  }
34563
- if (!cellTheme) {
34564
- cellTheme = getStyleTheme(cellStyle, table, isMerge ? range.start.col : col, isMerge ? range.start.row : row, getProp).theme;
34565
- }
34952
+ let cellTheme = getStyleTheme(cellStyle, table, isMerge ? range.start.col : col, isMerge ? range.start.row : row, getProp).theme;
34566
34953
  cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);
34567
34954
  if (!addNew && !isMerge && canUseFastUpdate(col, row, oldCellGroup, autoWrapText, table)) {
34568
34955
  const cellWidth = table.getColWidth(col);
@@ -34637,11 +35024,27 @@
34637
35024
  const type = table.isHeader(col, row)
34638
35025
  ? table._getHeaderLayoutMap(col, row).headerType
34639
35026
  : table.getBodyColumnType(col, row);
35027
+ let value = table.getCellValue(col, row);
35028
+ let customStyle;
35029
+ if (table.internalProps.customMergeCell) {
35030
+ const customMerge = table.getCustomMerge(col, row);
35031
+ if (customMerge) {
35032
+ const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;
35033
+ range = customMergeRange;
35034
+ isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
35035
+ value = customMergeText;
35036
+ customStyle = customMergeStyle;
35037
+ if (customStyle) {
35038
+ cellTheme = getStyleTheme(customStyle, table, range.start.col, range.start.row, getProp).theme;
35039
+ cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);
35040
+ }
35041
+ }
35042
+ }
35043
+ let newCellGroup;
34640
35044
  const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;
34641
35045
  const padding = cellTheme._vtable.padding;
34642
35046
  const textAlign = cellTheme._vtable.textAlign;
34643
35047
  const textBaseline = cellTheme._vtable.textBaseline;
34644
- let newCellGroup;
34645
35048
  let bgColorFunc;
34646
35049
  if (table.internalProps?.dataConfig?.mappingRules && !table.isHeader(col, row)) {
34647
35050
  table.internalProps?.dataConfig?.mappingRules?.forEach((mappingRule, i) => {
@@ -34652,6 +35055,14 @@
34652
35055
  }
34653
35056
  });
34654
35057
  }
35058
+ if (cellLocation !== 'body') {
35059
+ define?.headerCustomRender;
35060
+ define?.headerCustomLayout;
35061
+ }
35062
+ else {
35063
+ define?.customRender || table.customRender;
35064
+ define?.customLayout;
35065
+ }
34655
35066
  let cellWidth;
34656
35067
  let cellHeight;
34657
35068
  if (range) {
@@ -34664,10 +35075,10 @@
34664
35075
  }
34665
35076
  if (isPromise(value)) {
34666
35077
  oldCellGroup.removeAllChild();
34667
- dealPromiseData(value, table, updateCellContent.bind(null, type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult));
35078
+ dealPromiseData(value, table, updateCellContent.bind(null, type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme));
34668
35079
  }
34669
35080
  else {
34670
- newCellGroup = updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult);
35081
+ newCellGroup = updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme);
34671
35082
  }
34672
35083
  if (isMerge) {
34673
35084
  const rangeHeight = table.getRowHeight(row);
@@ -34680,14 +35091,14 @@
34680
35091
  }
34681
35092
  return newCellGroup;
34682
35093
  }
34683
- function updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult) {
35094
+ function updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme) {
34684
35095
  if (isPromise(value)) {
34685
35096
  value = table.getCellValue(col, row);
34686
35097
  }
34687
35098
  if (!addNew && (oldCellGroup.row !== row || oldCellGroup.col !== col)) {
34688
35099
  return null;
34689
35100
  }
34690
- const newCellGroup = createCell(type, value, define, table, col, row, table.getColWidth(col), cellWidth, cellHeight, addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent, addNew ? 0 : table.scenegraph.getCellGroupY(row), padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult);
35101
+ const newCellGroup = createCell(type, value, define, table, col, row, table.getColWidth(col), cellWidth, cellHeight, addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent, addNew ? 0 : table.scenegraph.getCellGroupY(row), padding, textAlign, textBaseline, mayHaveIcon, cellTheme);
34691
35102
  if (!addNew && oldCellGroup.parent) {
34692
35103
  oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
34693
35104
  oldCellGroup.parent.removeChild(oldCellGroup);
@@ -34729,17 +35140,18 @@
34729
35140
  }
34730
35141
  for (let j = rowStart; j <= rowEnd; j++) {
34731
35142
  const row = j;
35143
+ const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);
35144
+ const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;
34732
35145
  let value = table.getCellValue(col, row);
34733
35146
  let cellWidth = colWidth;
34734
35147
  let cellHeight = table.getRowHeight(row);
34735
35148
  let range;
34736
35149
  let isMerge;
34737
35150
  let customStyle;
34738
- let customResult;
34739
35151
  if (table.internalProps.customMergeCell) {
34740
35152
  const customMerge = table.getCustomMerge(col, row);
34741
35153
  if (customMerge) {
34742
- const { range: customMergeRange, text: customMergeText, style: customMergeStyle, customLayout, customRender } = customMerge;
35154
+ const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;
34743
35155
  range = customMergeRange;
34744
35156
  isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
34745
35157
  if (isMerge) {
@@ -34749,21 +35161,8 @@
34749
35161
  }
34750
35162
  value = customMergeText;
34751
35163
  customStyle = customMergeStyle;
34752
- if (customLayout || customRender) {
34753
- customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.heightMode === 'autoHeight', [0, 0, 0, 0], table);
34754
- }
34755
35164
  }
34756
35165
  }
34757
- let colForDefine = col;
34758
- let rowForDefine = row;
34759
- if (range) {
34760
- colForDefine = range.start.col;
34761
- rowForDefine = range.start.row;
34762
- }
34763
- const define = cellLocation !== 'body'
34764
- ? table.getHeaderDefine(colForDefine, rowForDefine)
34765
- : table.getBodyColumnDefine(colForDefine, rowForDefine);
34766
- const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;
34767
35166
  if (!range && (cellLocation !== 'body' || define?.mergeCell)) {
34768
35167
  range = table.getCellRange(col, row);
34769
35168
  isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
@@ -34793,14 +35192,14 @@
34793
35192
  const type = (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||
34794
35193
  'text';
34795
35194
  if (isPromise(value)) {
34796
- dealPromiseData(value, table, createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult));
35195
+ dealPromiseData(value, table, createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme));
34797
35196
  columnGroup.updateColumnRowNumber(row);
34798
35197
  const height = table.getRowHeight(row);
34799
35198
  columnGroup.updateColumnHeight(height);
34800
35199
  y += height;
34801
35200
  }
34802
35201
  else {
34803
- const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult);
35202
+ const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme);
34804
35203
  columnGroup.updateColumnRowNumber(row);
34805
35204
  if (isMerge) {
34806
35205
  const rangeHeight = table.getRowHeight(row);
@@ -34895,385 +35294,6 @@
34895
35294
  };
34896
35295
  }
34897
35296
 
34898
- function dealWithCustom(customLayout, customRender, col, row, width, height, autoWidth, autoHeight, padding, table) {
34899
- let renderDefault = true;
34900
- let enableCellPadding = false;
34901
- let expectedWidth;
34902
- let expectedHeight;
34903
- let customElements;
34904
- let elementsGroup;
34905
- if (typeof customLayout === 'function') {
34906
- const arg = {
34907
- col,
34908
- row,
34909
- dataValue: table.getCellOriginValue(col, row),
34910
- value: table.getCellValue(col, row) || '',
34911
- rect: {
34912
- left: 0,
34913
- top: 0,
34914
- right: width,
34915
- bottom: height,
34916
- width,
34917
- height
34918
- },
34919
- table
34920
- };
34921
- const customRenderObj = customLayout(arg);
34922
- if (customRenderObj.rootContainer) {
34923
- customRenderObj.rootContainer = decodeReactDom(customRenderObj.rootContainer);
34924
- }
34925
- if (customRenderObj.rootContainer instanceof Group$2) {
34926
- elementsGroup = customRenderObj.rootContainer;
34927
- elementsGroup.name = 'custom-container';
34928
- }
34929
- renderDefault = customRenderObj.renderDefault;
34930
- enableCellPadding = customRenderObj.enableCellPadding;
34931
- }
34932
- else if (typeof customRender === 'function') {
34933
- const arg = {
34934
- col,
34935
- row,
34936
- dataValue: table.getCellOriginValue(col, row),
34937
- value: table.getCellValue(col, row) || '',
34938
- rect: {
34939
- left: 0,
34940
- top: 0,
34941
- right: width,
34942
- bottom: height,
34943
- width,
34944
- height
34945
- },
34946
- table
34947
- };
34948
- const customRenderObj = customRender(arg);
34949
- if (customRenderObj) {
34950
- customElements = customRenderObj.elements;
34951
- renderDefault = customRenderObj.renderDefault;
34952
- expectedWidth = customRenderObj.expectedWidth;
34953
- expectedHeight = customRenderObj.expectedHeight;
34954
- }
34955
- }
34956
- else if (customRender) {
34957
- expectedWidth = customRender.expectedWidth;
34958
- expectedHeight = customRender.expectedHeight;
34959
- customElements = customRender.elements;
34960
- renderDefault = customRender.renderDefault;
34961
- }
34962
- if (customElements) {
34963
- const value = table.getCellValue(col, row);
34964
- elementsGroup = adjustElementToGroup(customElements, autoWidth ? expectedWidth : width, autoHeight ? expectedHeight : height, value);
34965
- }
34966
- if (enableCellPadding) {
34967
- elementsGroup.setAttributes({
34968
- x: padding[3],
34969
- y: padding[0],
34970
- width: width - padding[1] - padding[3],
34971
- height: height - padding[0] - padding[2]
34972
- });
34973
- }
34974
- dealPercentCalc(elementsGroup, width, height);
34975
- return {
34976
- elementsGroup,
34977
- renderDefault
34978
- };
34979
- }
34980
- function adjustElementToGroup(elements, width, height, value) {
34981
- const customGroup = new Group$2({
34982
- x: 0,
34983
- y: 0,
34984
- width,
34985
- height,
34986
- fill: false,
34987
- stroke: false,
34988
- pickable: false
34989
- });
34990
- customGroup.name = 'custom-container';
34991
- const elementsAdjusted = adjustElementsPos(elements, width, height, value);
34992
- elementsAdjusted.forEach(element => {
34993
- if (element.clickable) {
34994
- element.pickable = element.clickable;
34995
- }
34996
- switch (element.type) {
34997
- case 'arc':
34998
- const arc = createArc({
34999
- x: element.x,
35000
- y: element.y,
35001
- dx: (element.dx ?? 0),
35002
- dy: (element.dy ?? 0),
35003
- fill: element.fill,
35004
- stroke: element.stroke,
35005
- outerRadius: element.radius,
35006
- startAngle: element.startAngle,
35007
- endAngle: element.endAngle,
35008
- pickable: !!element.pickable,
35009
- cursor: element.cursor
35010
- });
35011
- customGroup.appendChild(arc);
35012
- break;
35013
- case 'text':
35014
- if (element.background) {
35015
- const expandX = element.background?.expandX ?? 0;
35016
- const expandY = element.background?.expandY ?? 0;
35017
- const textBackRect = createRect({
35018
- x: element.x - expandX,
35019
- y: element.y - expandY,
35020
- dx: (element.dx ?? 0),
35021
- dy: (element.dy ?? 0),
35022
- width: element.width + expandX * 2,
35023
- height: element.height + expandY * 2,
35024
- cornerRadius: element.background?.cornerRadius ?? 0,
35025
- fill: element.background?.fill ?? '#888'
35026
- });
35027
- customGroup.appendChild(textBackRect);
35028
- }
35029
- const text = new Text$1(Object.assign({
35030
- pickable: !!element.pickable,
35031
- fill: element.color ?? element.fill
35032
- }, element));
35033
- customGroup.appendChild(text);
35034
- break;
35035
- case 'rect':
35036
- const rect = createRect({
35037
- x: element.x,
35038
- y: element.y,
35039
- dx: (element.dx ?? 0),
35040
- dy: (element.dy ?? 0),
35041
- width: element.width,
35042
- height: element.height,
35043
- cornerRadius: element.radius,
35044
- fill: element.fill,
35045
- stroke: element.stroke,
35046
- pickable: !!element.pickable,
35047
- cursor: element.cursor
35048
- });
35049
- customGroup.appendChild(rect);
35050
- break;
35051
- case 'circle':
35052
- const circle = createCircle({
35053
- x: element.x,
35054
- y: element.y,
35055
- dx: (element.dx ?? 0),
35056
- dy: (element.dy ?? 0),
35057
- radius: element.radius,
35058
- fill: element.fill,
35059
- stroke: element.stroke,
35060
- pickable: !!element.pickable,
35061
- cursor: element.cursor
35062
- });
35063
- customGroup.appendChild(circle);
35064
- break;
35065
- case 'icon':
35066
- const icon = new Icon$1({
35067
- x: element.x,
35068
- y: element.y,
35069
- dx: (element.dx ?? 0),
35070
- dy: (element.dy ?? 0),
35071
- width: element.width,
35072
- height: element.height,
35073
- image: element.svg,
35074
- backgroundWidth: element.hover ? (element.hover.width ?? element.width) : undefined,
35075
- backgroundHeight: element.hover ? (element.hover.width ?? element.width) : undefined,
35076
- backgroundColor: element.hover ? element.hover.bgColor ?? 'rgba(22,44,66,0.2)' : undefined,
35077
- pickable: !!element.pickable,
35078
- cursor: element.cursor
35079
- });
35080
- icon.role = 'icon-custom';
35081
- customGroup.appendChild(icon);
35082
- break;
35083
- case 'image':
35084
- const image = new Icon$1({
35085
- x: element.x,
35086
- y: element.y,
35087
- dx: (element.dx ?? 0),
35088
- dy: (element.dy ?? 0),
35089
- width: element.width,
35090
- height: element.height,
35091
- image: element.src,
35092
- backgroundWidth: element.hover ? (element.hover.width ?? element.width) : undefined,
35093
- backgroundHeight: element.hover ? (element.hover.width ?? element.width) : undefined,
35094
- backgroundColor: element.hover ? element.hover.bgColor ?? 'rgba(22,44,66,0.2)' : undefined,
35095
- pickable: !!element.pickable,
35096
- cursor: element.cursor,
35097
- shape: element.shape
35098
- });
35099
- image.role = 'image-custom';
35100
- customGroup.appendChild(image);
35101
- break;
35102
- case 'line':
35103
- const line = createLine({
35104
- points: element.points,
35105
- stroke: element.stroke,
35106
- pickable: !!element.pickable,
35107
- cursor: element.cursor
35108
- });
35109
- customGroup.appendChild(line);
35110
- break;
35111
- }
35112
- });
35113
- return customGroup;
35114
- }
35115
- function adjustElementsPos(originalElements, width, height, value) {
35116
- const result = [];
35117
- const left = 0;
35118
- const top = 0;
35119
- const borderLineWidths = [0, 0, 0, 0];
35120
- for (let i = 0; i < originalElements.length; i++) {
35121
- const originalElement = originalElements[i];
35122
- const element = Object.assign({}, originalElement);
35123
- for (const name in element) {
35124
- if (element.hasOwnProperty(name) && isFunction$1(element[name])) {
35125
- element[name] = element[name](value);
35126
- }
35127
- }
35128
- const rect = element;
35129
- if (isValid$1(rect.x)) {
35130
- rect.x = isString$2(rect.x)
35131
- ? transformString(rect.x, width - borderLineWidths[1])
35132
- : Number(rect.x);
35133
- }
35134
- if (isValid$1(rect.y)) {
35135
- rect.y = isString$2(rect.y)
35136
- ? transformString(rect.y, height - borderLineWidths[2])
35137
- : Number(rect.y);
35138
- }
35139
- if ('width' in element) {
35140
- element.width = isString$2(element.width)
35141
- ? transformString(element.width, width - borderLineWidths[1])
35142
- : Number(element.width);
35143
- }
35144
- if ('height' in element) {
35145
- element.height = isString$2(element.height)
35146
- ? transformString(element.height, height - borderLineWidths[2])
35147
- : Number(element.height);
35148
- }
35149
- if ('radius' in element) {
35150
- element.radius = isString$2(element.radius)
35151
- ? transformString(element.radius, Math.min(width - borderLineWidths[1], height - borderLineWidths[2]))
35152
- : Number(element.radius);
35153
- }
35154
- if ('hover' in element) {
35155
- element.hover.x = isString$2(element.hover.x)
35156
- ? transformString(element.hover.x, width - borderLineWidths[1])
35157
- : Number(element.hover.x);
35158
- element.hover.y = isString$2(element.hover.y)
35159
- ? transformString(element.hover.y, height - borderLineWidths[2])
35160
- : Number(element.hover.y);
35161
- element.hover.width = isString$2(element.hover.width)
35162
- ? transformString(element.hover.width, width - borderLineWidths[1])
35163
- : Number(element.hover.width);
35164
- element.hover.height = isString$2(element.hover.height)
35165
- ? transformString(element.hover.height, height - borderLineWidths[2])
35166
- : Number(element.hover.height);
35167
- element.hover.x += left;
35168
- element.hover.y += top;
35169
- }
35170
- rect.x = rect.x + left;
35171
- rect.y = rect.y + top;
35172
- result.push(element);
35173
- }
35174
- return result;
35175
- }
35176
- function transformString(str, size) {
35177
- if (str.endsWith('px')) {
35178
- return parseInt(str, 10);
35179
- }
35180
- else if (str.endsWith('%') && size) {
35181
- return (parseInt(str, 10) / 100) * size;
35182
- }
35183
- return parseInt(str, 10);
35184
- }
35185
- function dealPercentCalc(group, parentWidth, parentHeight) {
35186
- if (!group) {
35187
- return;
35188
- }
35189
- group.forEachChildren((child) => {
35190
- if (!child) {
35191
- return;
35192
- }
35193
- if (isObject$4(child.attribute.width) && child.attribute.width.percent) {
35194
- child.setAttribute('width', (child.attribute.width.percent / 100) * parentWidth +
35195
- (child.attribute.width.delta ?? 0));
35196
- }
35197
- if (isObject$4(child.attribute.height) && child.attribute.height.percent) {
35198
- child.setAttribute('height', (child.attribute.height.percent / 100) * parentHeight +
35199
- (child.attribute.height.delta ?? 0));
35200
- }
35201
- if (child.type === 'group') {
35202
- dealPercentCalc(child, child.attribute.width, child.attribute.height);
35203
- }
35204
- });
35205
- }
35206
- function decodeReactDom(dom) {
35207
- if (!dom || !dom.$$typeof) {
35208
- return dom;
35209
- }
35210
- const type = dom.type;
35211
- const { attribute, children, stateProxy } = dom.props;
35212
- const g = type({ attribute });
35213
- parseToGraphic(g, dom.props);
35214
- if (stateProxy) {
35215
- g.stateProxy = stateProxy;
35216
- }
35217
- g.id = attribute.id;
35218
- g.name = attribute.name;
35219
- if (isArray$1(children)) {
35220
- children.forEach((item) => {
35221
- const c = decodeReactDom(item);
35222
- g.add(c);
35223
- });
35224
- }
35225
- else if (children) {
35226
- g.add(decodeReactDom(children));
35227
- }
35228
- return g;
35229
- }
35230
- function parseToGraphic(g, props) {
35231
- let isGraphic = false;
35232
- switch (g.type) {
35233
- case 'richtext':
35234
- break;
35235
- case 'rich/image':
35236
- break;
35237
- default:
35238
- isGraphic = true;
35239
- }
35240
- if (isGraphic) {
35241
- Object.keys(props).forEach(k => {
35242
- const en = REACT_TO_CANOPUS_EVENTS[k];
35243
- if (en) {
35244
- g.on(en, props[k]);
35245
- }
35246
- });
35247
- }
35248
- }
35249
- function getCustomCellMergeCustom(col, row, cellGroup, table) {
35250
- if (table.internalProps.customMergeCell) {
35251
- const customMerge = table.getCustomMerge(col, row);
35252
- if (customMerge) {
35253
- const { range: customMergeRange, text: customMergeText, style: customMergeStyle, customLayout: customMergeLayout, customRender: customMergeRender } = customMerge;
35254
- if (customMergeLayout || customMergeRender) {
35255
- const customResult = dealWithCustom(customMergeLayout, customMergeRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.heightMode === 'autoHeight', [0, 0, 0, 0], table);
35256
- const customElementsGroup = customResult.elementsGroup;
35257
- if (cellGroup.childrenCount > 0 && customElementsGroup) {
35258
- cellGroup.insertBefore(customElementsGroup, cellGroup.firstChild);
35259
- }
35260
- else if (customElementsGroup) {
35261
- cellGroup.appendChild(customElementsGroup);
35262
- }
35263
- const rangeHeight = table.getRowHeight(row);
35264
- const rangeWidth = table.getColWidth(col);
35265
- const { width: contentWidth } = cellGroup.attribute;
35266
- const { height: contentHeight } = cellGroup.attribute;
35267
- cellGroup.contentWidth = contentWidth;
35268
- cellGroup.contentHeight = contentHeight;
35269
- resizeCellGroup(cellGroup, rangeWidth, rangeHeight, customMergeRange, table);
35270
- return customResult;
35271
- }
35272
- }
35273
- }
35274
- return undefined;
35275
- }
35276
-
35277
35297
  function isMergeCellGroup(cellGroup) {
35278
35298
  if (cellGroup.role === 'cell' &&
35279
35299
  isNumber$3(cellGroup.mergeStartCol) &&
@@ -36833,33 +36853,31 @@
36833
36853
  let customElementsGroup;
36834
36854
  customContainer.removeAllChild();
36835
36855
  cell.removeChild(customContainer);
36836
- if (!getCustomCellMergeCustom(col, row, cell, scene.table)) {
36837
- let customRender;
36838
- let customLayout;
36839
- const cellLocation = scene.table.getCellLocation(col, row);
36840
- if (cellLocation !== 'body') {
36841
- const define = scene.table.getHeaderDefine(col, row);
36842
- customRender = define?.headerCustomRender;
36843
- customLayout = define?.headerCustomLayout;
36844
- }
36845
- else {
36846
- const define = scene.table.getBodyColumnDefine(col, row);
36847
- customRender = define?.customRender || scene.table.customRender;
36848
- customLayout = define?.customLayout;
36849
- }
36850
- if (customLayout || customRender) {
36851
- const style = scene.table._getCellStyle(col, row);
36852
- const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
36853
- const customResult = dealWithCustom(customLayout, customRender, col, row, cell.attribute.width, cell.attribute.height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
36854
- customElementsGroup = customResult.elementsGroup;
36855
- renderDefault = customResult.renderDefault;
36856
- }
36857
- if (cell.childrenCount > 0 && customElementsGroup) {
36858
- cell.insertBefore(customElementsGroup, cell.firstChild);
36859
- }
36860
- else if (customElementsGroup) {
36861
- cell.appendChild(customElementsGroup);
36862
- }
36856
+ let customRender;
36857
+ let customLayout;
36858
+ const cellLocation = scene.table.getCellLocation(col, row);
36859
+ if (cellLocation !== 'body') {
36860
+ const define = scene.table.getHeaderDefine(col, row);
36861
+ customRender = define?.headerCustomRender;
36862
+ customLayout = define?.headerCustomLayout;
36863
+ }
36864
+ else {
36865
+ const define = scene.table.getBodyColumnDefine(col, row);
36866
+ customRender = define?.customRender || scene.table.customRender;
36867
+ customLayout = define?.customLayout;
36868
+ }
36869
+ if (customLayout || customRender) {
36870
+ const style = scene.table._getCellStyle(col, row);
36871
+ const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
36872
+ const customResult = dealWithCustom(customLayout, customRender, col, row, cell.attribute.width, cell.attribute.height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
36873
+ customElementsGroup = customResult.elementsGroup;
36874
+ renderDefault = customResult.renderDefault;
36875
+ }
36876
+ if (cell.childrenCount > 0) {
36877
+ cell.insertBefore(customElementsGroup, cell.firstChild);
36878
+ }
36879
+ else {
36880
+ cell.appendChild(customElementsGroup);
36863
36881
  }
36864
36882
  }
36865
36883
  if (renderDefault) {
@@ -37108,34 +37126,32 @@
37108
37126
  let customElementsGroup;
37109
37127
  customContainer.removeAllChild();
37110
37128
  cell.removeChild(customContainer);
37111
- if (!getCustomCellMergeCustom(col, row, cell, scene.table)) {
37112
- let customRender;
37113
- let customLayout;
37114
- const cellType = scene.table.getCellLocation(col, row);
37115
- if (cellType !== 'body') {
37116
- const define = scene.table.getHeaderDefine(col, row);
37117
- customRender = define?.headerCustomRender;
37118
- customLayout = define?.headerCustomLayout;
37119
- }
37120
- else {
37121
- const define = scene.table.getBodyColumnDefine(col, row);
37122
- customRender = define?.customRender || scene.table.customRender;
37123
- customLayout = define?.customLayout;
37124
- }
37125
- if (customLayout || customRender) {
37126
- const style = scene.table._getCellStyle(col, row);
37127
- const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
37128
- const customResult = dealWithCustom(customLayout, customRender, col, row, cellGroup.attribute.width, cellGroup.attribute.height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
37129
- customElementsGroup = customResult.elementsGroup;
37130
- renderDefault = customResult.renderDefault;
37131
- isHeightChange = true;
37132
- }
37133
- if (cell.childrenCount > 0 && customElementsGroup) {
37134
- cell.insertBefore(customElementsGroup, cell.firstChild);
37135
- }
37136
- else if (customElementsGroup) {
37137
- cell.appendChild(customElementsGroup);
37138
- }
37129
+ let customRender;
37130
+ let customLayout;
37131
+ const cellType = scene.table.getCellLocation(col, row);
37132
+ if (cellType !== 'body') {
37133
+ const define = scene.table.getHeaderDefine(col, row);
37134
+ customRender = define?.headerCustomRender;
37135
+ customLayout = define?.headerCustomLayout;
37136
+ }
37137
+ else {
37138
+ const define = scene.table.getBodyColumnDefine(col, row);
37139
+ customRender = define?.customRender || scene.table.customRender;
37140
+ customLayout = define?.customLayout;
37141
+ }
37142
+ if (customLayout || customRender) {
37143
+ const style = scene.table._getCellStyle(col, row);
37144
+ const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
37145
+ const customResult = dealWithCustom(customLayout, customRender, col, row, cellGroup.attribute.width, cellGroup.attribute.height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
37146
+ customElementsGroup = customResult.elementsGroup;
37147
+ renderDefault = customResult.renderDefault;
37148
+ isHeightChange = true;
37149
+ }
37150
+ if (cell.childrenCount > 0) {
37151
+ cell.insertBefore(customElementsGroup, cell.firstChild);
37152
+ }
37153
+ else {
37154
+ cell.appendChild(customElementsGroup);
37139
37155
  }
37140
37156
  }
37141
37157
  if (renderDefault) {
@@ -37488,7 +37504,7 @@
37488
37504
  }
37489
37505
  };
37490
37506
 
37491
- const regedIcons = get$1();
37507
+ const regedIcons = get$2();
37492
37508
  class DrillIcon {
37493
37509
  icon;
37494
37510
  constructor() {
@@ -39308,9 +39324,10 @@
39308
39324
  for (let col = 0; col < table.colCount; col++) {
39309
39325
  const newColWidth = newWidths[col] ?? table.getColWidth(col);
39310
39326
  if (newColWidth !== oldColWidths[col]) {
39311
- table._setColWidth(col, newColWidth);
39327
+ table._setColWidth(col, newColWidth, false, true);
39312
39328
  }
39313
39329
  }
39330
+ table.stateManager.checkFrozen();
39314
39331
  for (let col = 0; col < table.colCount; col++) {
39315
39332
  const newColWidth = table.getColWidth(col);
39316
39333
  if (newColWidth !== oldColWidths[col]) {
@@ -41337,6 +41354,10 @@
41337
41354
  });
41338
41355
  if (removeRows.length) {
41339
41356
  resetRowNumber(scene);
41357
+ const beforeRow = removeRows[removeRows.length - 1] - 1;
41358
+ const afterRow = removeRows[0] - removeRows.length + 1;
41359
+ const rowUpdatePos = updateMergeCellGroup(beforeRow, afterRow, scene);
41360
+ isNumber$3(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
41340
41361
  }
41341
41362
  scene.table._clearRowRangeHeightsMap();
41342
41363
  let updateAfter;
@@ -41346,6 +41367,12 @@
41346
41367
  rowHeightsMap.addAndReorder(row);
41347
41368
  });
41348
41369
  resetRowNumberAndY(scene);
41370
+ if (addRows.length) {
41371
+ const beforeRow = addRows[0] - 1;
41372
+ const afterRow = addRows[addRows.length - 1] + 1;
41373
+ const rowUpdatePos = updateMergeCellGroup(beforeRow, afterRow, scene);
41374
+ isNumber$3(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
41375
+ }
41349
41376
  for (let col = 0; col < table.colCount; col++) {
41350
41377
  updateRows.forEach(r => {
41351
41378
  const mergeInfo = getCellMergeInfo(scene.table, col, r);
@@ -41361,6 +41388,12 @@
41361
41388
  }
41362
41389
  });
41363
41390
  }
41391
+ if (updateRows.length) {
41392
+ const beforeRow = updateRows[0] - 1;
41393
+ const afterRow = updateRows[updateRows.length - 1] + 1;
41394
+ const rowUpdatePos = updateMergeCellGroup(beforeRow, afterRow, scene);
41395
+ isNumber$3(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
41396
+ }
41364
41397
  if (isNumber$3(updateAfter)) {
41365
41398
  for (let col = 0; col < table.colCount; col++) {
41366
41399
  for (let row = updateAfter; row < table.rowCount; row++) {
@@ -41368,7 +41401,7 @@
41368
41401
  cellGroup && (cellGroup.needUpdate = true);
41369
41402
  }
41370
41403
  }
41371
- scene.proxy.rowUpdatePos = updateAfter;
41404
+ scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, updateAfter);
41372
41405
  }
41373
41406
  if (addRows.length) {
41374
41407
  if (!isNumber$3(updateAfter)) {
@@ -41378,13 +41411,13 @@
41378
41411
  scene.proxy.rowUpdateDirection = 'up';
41379
41412
  scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
41380
41413
  updateBottomFrozeCellGroups();
41381
- scene.proxy.progress();
41382
41414
  }
41383
41415
  else if (removeRows.length) {
41384
41416
  scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
41385
41417
  updateBottomFrozeCellGroups();
41386
41418
  scene.proxy.progress();
41387
41419
  }
41420
+ scene.proxy.progress();
41388
41421
  const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);
41389
41422
  scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
41390
41423
  function updateBottomFrozeCellGroups() {
@@ -41639,6 +41672,34 @@
41639
41672
  }
41640
41673
  }
41641
41674
  }
41675
+ function updateMergeCellGroup(beforeRow, afterRow, scene) {
41676
+ let updateRow;
41677
+ for (let col = 0; col < scene.table.colCount; col++) {
41678
+ const rangeBefore = scene.table.getCellRange(col, beforeRow);
41679
+ if (rangeBefore.start.row <= beforeRow + 1 && rangeBefore.end.row >= beforeRow + 1) {
41680
+ updateCellGroup(rangeBefore, scene);
41681
+ updateRow = rangeBefore.start.row;
41682
+ }
41683
+ const rangeAfter = scene.table.getCellRange(col, afterRow);
41684
+ if (rangeAfter.start.row <= afterRow - 1 && rangeAfter.end.row >= afterRow - 1) {
41685
+ updateCellGroup(rangeAfter, scene);
41686
+ updateRow = rangeBefore.start.row;
41687
+ }
41688
+ }
41689
+ return updateRow;
41690
+ }
41691
+ function updateCellGroup(range, scene) {
41692
+ const { start, end } = range;
41693
+ for (let col = start.col; col <= end.col; col++) {
41694
+ for (let row = start.row; row <= end.row; row++) {
41695
+ const cellGroup = scene.highPerformanceGetCell(col, row, true);
41696
+ if (!cellGroup) {
41697
+ continue;
41698
+ }
41699
+ cellGroup.needUpdate = true;
41700
+ }
41701
+ }
41702
+ }
41642
41703
 
41643
41704
  function handleTextStick(table) {
41644
41705
  const { changedCells } = table.internalProps.stick;
@@ -41731,13 +41792,23 @@
41731
41792
  }
41732
41793
  }
41733
41794
  function dealVertical(cellGroup, minTop, maxTop, changedCells) {
41734
- const text = cellGroup.getChildByName('text', true);
41735
- if (!text) {
41795
+ const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
41796
+ if (!graphic) {
41736
41797
  return;
41737
41798
  }
41738
- text.AABBBounds.width();
41739
- const textTop = text.globalAABBBounds.y1;
41740
- const textBottom = text.globalAABBBounds.y2;
41799
+ if (graphic.type === 'image') {
41800
+ const { image: url } = graphic.attribute;
41801
+ if (!url || !graphic.resources) {
41802
+ return;
41803
+ }
41804
+ const res = graphic.resources.get(url);
41805
+ if (res.state !== 'success') {
41806
+ return;
41807
+ }
41808
+ }
41809
+ graphic.AABBBounds.width();
41810
+ const textTop = graphic.globalAABBBounds.y1;
41811
+ const textBottom = graphic.globalAABBBounds.y2;
41741
41812
  if (textTop < minTop) {
41742
41813
  const deltaHeight = textTop - minTop;
41743
41814
  changedCells.push({
@@ -42162,6 +42233,22 @@
42162
42233
  });
42163
42234
  });
42164
42235
  }
42236
+ if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) {
42237
+ for (let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount; c <= scenegraph.table.colCount - 1; c++) {
42238
+ const columnGroup = scenegraph.getColGroup(c);
42239
+ columnGroup?.getChildren()?.forEach((cellNode) => {
42240
+ const width = scenegraph.table.getColWidth(cellNode.col);
42241
+ const height = scenegraph.table.getRowHeight(cellNode.row);
42242
+ cellNode.children.forEach((node) => {
42243
+ if (node.type === 'chart') {
42244
+ node.cacheCanvas = null;
42245
+ node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));
42246
+ node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));
42247
+ }
42248
+ });
42249
+ });
42250
+ }
42251
+ }
42165
42252
  }
42166
42253
  function clearChartCacheImage(scenegraph) {
42167
42254
  for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
@@ -42341,7 +42428,7 @@
42341
42428
  fontFamily: DefaultTextStyle.fontFamily,
42342
42429
  fontSize: DefaultTextStyle.fontSize
42343
42430
  },
42344
- getTextBounds: useNaiveCanvas ? undefined : getTextBounds$1,
42431
+ getTextBounds: useNaiveCanvas ? undefined : getTextBounds,
42345
42432
  specialCharSet: `{}()//&-/: .,@%'"~…${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789`,
42346
42433
  ...(option ?? {})
42347
42434
  }, textSpec);
@@ -43080,6 +43167,7 @@
43080
43167
  }
43081
43168
  }
43082
43169
 
43170
+ registerForVrender();
43083
43171
  loadPoptip();
43084
43172
  container.load(splitModule);
43085
43173
  container.load(textMeasureModule);
@@ -44558,10 +44646,8 @@
44558
44646
  });
44559
44647
  }
44560
44648
  else if (col >= 0 && row >= 0) {
44561
- state.select.ranges.push({
44562
- start: { col, row },
44563
- end: { col, row }
44564
- });
44649
+ const cellRange = table.getCellRange(col, row);
44650
+ state.select.ranges.push(cellRange);
44565
44651
  }
44566
44652
  cellPos.col = col;
44567
44653
  cellPos.row = row;
@@ -45962,6 +46048,10 @@
45962
46048
  window.open(url);
45963
46049
  }
45964
46050
  else if (cellType === 'image') {
46051
+ const { clickToPreview } = columnDefine;
46052
+ if (clickToPreview === false) {
46053
+ return;
46054
+ }
45965
46055
  const overlay = document.createElement('div');
45966
46056
  overlay.style.width = '100%';
45967
46057
  overlay.style.height = '100%';
@@ -45987,6 +46077,10 @@
45987
46077
  document.body.appendChild(overlay);
45988
46078
  }
45989
46079
  else if (cellType === 'video') {
46080
+ const { clickToPreview } = columnDefine;
46081
+ if (clickToPreview === false) {
46082
+ return;
46083
+ }
45990
46084
  const overlay = document.createElement('div');
45991
46085
  overlay.style.width = '100%';
45992
46086
  overlay.style.height = '100%';
@@ -47364,9 +47458,7 @@
47364
47458
  const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgsSet.eventArgs?.targetCell);
47365
47459
  if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
47366
47460
  this.table.scenegraph.updateAutoColWidth(resizeCol.col);
47367
- if (this.table.isPivotChart()) {
47368
- this.table.scenegraph.updateChartSize(resizeCol.col);
47369
- }
47461
+ this.table.scenegraph.updateChartSize(resizeCol.col);
47370
47462
  const state = this.table.stateManager;
47371
47463
  if (state.columnResize.col < state.table.frozenColCount &&
47372
47464
  !state.table.isPivotTable() &&
@@ -47726,7 +47818,7 @@
47726
47818
  _table;
47727
47819
  constructor(_table) {
47728
47820
  this._table = _table;
47729
- const regedIcons = get$1();
47821
+ const regedIcons = get$2();
47730
47822
  this.expandIcon = regedIcons[InternalIconName.expandIconName];
47731
47823
  this.collapseIcon = regedIcons[InternalIconName.collapseIconName];
47732
47824
  }
@@ -47748,7 +47840,7 @@
47748
47840
  else {
47749
47841
  iconResults = iconDefine;
47750
47842
  }
47751
- const regedIcons = get$1();
47843
+ const regedIcons = get$2();
47752
47844
  const addIcon = (columnIcon) => {
47753
47845
  let icon;
47754
47846
  if (typeof columnIcon === 'string') {
@@ -48493,7 +48585,7 @@
48493
48585
  _table;
48494
48586
  constructor(_table) {
48495
48587
  this._table = _table;
48496
- const regedIcons = get$1();
48588
+ const regedIcons = get$2();
48497
48589
  this.freezeIcon = regedIcons[InternalIconName.freezeIconName];
48498
48590
  this.frozenIcon = regedIcons[InternalIconName.frozenIconName];
48499
48591
  this.frozenCurrentIcon = regedIcons[InternalIconName.frozenCurrentIconName];
@@ -48578,7 +48670,7 @@
48578
48670
  else {
48579
48671
  headerIconStrs = headerIcon;
48580
48672
  }
48581
- const regedIcons = get$1();
48673
+ const regedIcons = get$2();
48582
48674
  const addIcon = (headerIcon) => {
48583
48675
  let icon;
48584
48676
  if (typeof headerIcon === 'string') {
@@ -50372,7 +50464,7 @@
50372
50464
  return TABLE_EVENT_TYPE;
50373
50465
  }
50374
50466
  options;
50375
- version = "0.17.10-alpha.7";
50467
+ version = "0.17.10";
50376
50468
  pagination;
50377
50469
  id = `VTable${Date.now()}`;
50378
50470
  headerStyleCache;
@@ -50474,7 +50566,7 @@
50474
50566
  internalProps.bodyHelper = new BodyHelper(this);
50475
50567
  internalProps.headerHelper = new HeaderHelper(this);
50476
50568
  internalProps.autoWrapText = options.autoWrapText;
50477
- internalProps.allowFrozenColCount = options.allowFrozenColCount ?? internalProps.colCount;
50569
+ internalProps.allowFrozenColCount = options.allowFrozenColCount ?? 0;
50478
50570
  internalProps.limitMaxAutoWidth = options.limitMaxAutoWidth ?? 450;
50479
50571
  internalProps.limitMinWidth =
50480
50572
  limitMinWidth !== null && limitMinWidth !== undefined
@@ -51478,7 +51570,7 @@
51478
51570
  internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
51479
51571
  this.scenegraph.updateStageBackground();
51480
51572
  internalProps.autoWrapText = options.autoWrapText;
51481
- internalProps.allowFrozenColCount = options.allowFrozenColCount ?? internalProps.colCount;
51573
+ internalProps.allowFrozenColCount = options.allowFrozenColCount ?? 0;
51482
51574
  internalProps.limitMaxAutoWidth = options.limitMaxAutoWidth ?? 450;
51483
51575
  internalProps.limitMinWidth =
51484
51576
  limitMinWidth !== null && limitMinWidth !== undefined
@@ -51894,7 +51986,7 @@
51894
51986
  getCustomMerge(col, row) {
51895
51987
  if (this.internalProps.customMergeCell) {
51896
51988
  const customMerge = this.internalProps.customMergeCell(col, row, this);
51897
- if (customMerge && customMerge.range && (customMerge.text || customMerge.customLayout || this.customRender)) {
51989
+ if (customMerge && customMerge.range && customMerge.text) {
51898
51990
  if (customMerge.style) {
51899
51991
  const styleClass = this.internalProps.bodyHelper.getStyleClass('text');
51900
51992
  const style = customMerge.style;
@@ -53020,6 +53112,17 @@
53020
53112
  axisOption
53021
53113
  };
53022
53114
  }
53115
+ function checkHasChart(layout) {
53116
+ let isHasChart = false;
53117
+ for (let i = 0; i < layout.columnObjects.length; i++) {
53118
+ const columnObj = layout.columnObjects[i];
53119
+ if (columnObj.chartSpec) {
53120
+ isHasChart = true;
53121
+ break;
53122
+ }
53123
+ }
53124
+ return isHasChart;
53125
+ }
53023
53126
 
53024
53127
  class SimpleHeaderLayoutMap {
53025
53128
  seqId = 0;
@@ -53781,6 +53884,9 @@
53781
53884
  const columnObj = this.transpose ? this._columns[_row] : this._columns[_col];
53782
53885
  return columnObj.chartInstance;
53783
53886
  }
53887
+ checkHasChart() {
53888
+ return checkHasChart(this);
53889
+ }
53784
53890
  getAxisConfigInPivotChart(col, row) {
53785
53891
  return undefined;
53786
53892
  }
@@ -54492,13 +54598,36 @@
54492
54598
  }
54493
54599
  }
54494
54600
  _refreshHierarchyState(col, row) {
54601
+ let notFillWidth = false;
54602
+ let notFillHeight = false;
54603
+ const checkHasChart = this.internalProps.layoutMap.checkHasChart();
54604
+ if (checkHasChart) {
54605
+ if (this.autoFillWidth) {
54606
+ notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
54607
+ }
54608
+ if (this.autoFillHeight) {
54609
+ notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
54610
+ }
54611
+ }
54495
54612
  const index = this.getRecordShowIndexByCell(col, row);
54496
54613
  const diffDataIndices = this.dataSource.toggleHierarchyState(index);
54497
54614
  const diffPositions = this.internalProps.layoutMap.toggleHierarchyState(diffDataIndices);
54498
54615
  this.refreshRowColCount();
54499
54616
  this.clearCellStyleCache();
54617
+ this.internalProps.layoutMap.clearCellRangeMap();
54500
54618
  this.scenegraph.updateHierarchyIcon(col, row);
54501
54619
  this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions);
54620
+ if (checkHasChart) {
54621
+ if (this.autoFillWidth && !notFillWidth) {
54622
+ notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
54623
+ }
54624
+ if (this.autoFillHeight && !notFillHeight) {
54625
+ notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
54626
+ }
54627
+ if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
54628
+ this.scenegraph.updateChartSize(0);
54629
+ }
54630
+ }
54502
54631
  }
54503
54632
  _hasHierarchyTreeHeader() {
54504
54633
  return (this.options.columns ?? this.options.header)?.some((column, i) => column.tree);
@@ -54759,8 +54888,8 @@
54759
54888
  this.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, this);
54760
54889
  }
54761
54890
  this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
54762
- col: startCol,
54763
- row: startRow,
54891
+ col: startCol + j,
54892
+ row: startRow + i,
54764
54893
  rawValue: beforeChangeValue,
54765
54894
  changedValue: this.getCellOriginValue(startCol + j, startRow + i)
54766
54895
  });
@@ -57117,6 +57246,9 @@
57117
57246
  }
57118
57247
  return indicatorObj?.chartInstance;
57119
57248
  }
57249
+ checkHasChart() {
57250
+ return checkHasChart(this);
57251
+ }
57120
57252
  getDimension(dimensionKey, type) {
57121
57253
  if (type === 'column') {
57122
57254
  return this.columnsDefine?.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === dimensionKey);
@@ -59689,6 +59821,17 @@
59689
59821
  return false;
59690
59822
  }
59691
59823
  toggleHierarchyState(col, row) {
59824
+ let notFillWidth = false;
59825
+ let notFillHeight = false;
59826
+ const checkHasChart = this.internalProps.layoutMap.checkHasChart();
59827
+ if (checkHasChart) {
59828
+ if (this.autoFillWidth) {
59829
+ notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
59830
+ }
59831
+ if (this.autoFillHeight) {
59832
+ notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
59833
+ }
59834
+ }
59692
59835
  const hierarchyState = this.getHierarchyState(col, row);
59693
59836
  if (hierarchyState === HierarchyState.expand) {
59694
59837
  this.fireListeners(PIVOT_TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
@@ -59710,6 +59853,17 @@
59710
59853
  this.clearCellStyleCache();
59711
59854
  this.scenegraph.updateHierarchyIcon(col, row);
59712
59855
  this.scenegraph.updateRow(result.removeCellPositions, result.addCellPositions, result.updateCellPositions);
59856
+ if (checkHasChart) {
59857
+ if (this.autoFillWidth && !notFillWidth) {
59858
+ notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
59859
+ }
59860
+ if (this.autoFillHeight && !notFillHeight) {
59861
+ notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
59862
+ }
59863
+ if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
59864
+ this.scenegraph.updateChartSize(0);
59865
+ }
59866
+ }
59713
59867
  }
59714
59868
  getHeaderCellAddressByPath(dimensionPaths) {
59715
59869
  const cellAddress = this.internalProps.layoutMap.getPivotCellAdress(dimensionPaths);
@@ -59875,8 +60029,8 @@
59875
60029
  }
59876
60030
  this._changeCellValueToDataSet(startCol + j, startRow + i, newValue);
59877
60031
  this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
59878
- col: startCol,
59879
- row: startRow,
60032
+ col: startCol + j,
60033
+ row: startRow + i,
59880
60034
  rawValue,
59881
60035
  changedValue: this.getCellOriginValue(startCol + j, startRow + i)
59882
60036
  });
@@ -60921,7 +61075,7 @@
60921
61075
  constructor(options) {
60922
61076
  let cache;
60923
61077
  if (isString$2(options.iconName)) {
60924
- const regedIcons = get$1();
61078
+ const regedIcons = get$2();
60925
61079
  cache = regedIcons[options.iconName];
60926
61080
  if (cache) {
60927
61081
  options.width = options.width ?? cache.width;
@@ -61345,9 +61499,10 @@
61345
61499
  return new Tag$1(params ? params.attribute : {});
61346
61500
  }
61347
61501
 
61348
- const version = "0.17.10-alpha.7";
61502
+ registerForVrender();
61503
+ const version = "0.17.10";
61349
61504
  function getIcons() {
61350
- return get$1();
61505
+ return get$2();
61351
61506
  }
61352
61507
  function clearGlobal() {
61353
61508
  clearAll();