@visactor/vtable 0.17.10-alpha.7 → 0.17.11-alpha.4

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 (423) 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 +6 -6
  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 +4 -0
  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/sparkline-event.js +1 -2
  27. package/cjs/event/util.d.ts +1 -1
  28. package/cjs/event/util.js.map +1 -1
  29. package/cjs/index.d.ts +2 -2
  30. package/cjs/index.js +3 -3
  31. package/cjs/index.js.map +1 -1
  32. package/cjs/layout/chart-helper/get-chart-spec.d.ts +1 -0
  33. package/cjs/layout/chart-helper/get-chart-spec.js +13 -2
  34. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  35. package/cjs/layout/pivot-header-layout.d.ts +1 -0
  36. package/cjs/layout/pivot-header-layout.js +5 -2
  37. package/cjs/layout/pivot-header-layout.js.map +1 -1
  38. package/cjs/layout/simple-header-layout.d.ts +1 -0
  39. package/cjs/layout/simple-header-layout.js +3 -0
  40. package/cjs/layout/simple-header-layout.js.map +1 -1
  41. package/cjs/render/jsx/index.d.ts +1 -1
  42. package/cjs/render/jsx/index.js +1 -1
  43. package/cjs/render/jsx/index.js.map +1 -1
  44. package/cjs/render/layout/arc.d.ts +2 -2
  45. package/cjs/render/layout/arc.js +1 -1
  46. package/cjs/render/layout/arc.js.map +1 -1
  47. package/cjs/render/layout/circle.d.ts +2 -2
  48. package/cjs/render/layout/circle.js +1 -1
  49. package/cjs/render/layout/circle.js.map +1 -1
  50. package/cjs/render/layout/container.d.ts +2 -2
  51. package/cjs/render/layout/container.js +1 -1
  52. package/cjs/render/layout/container.js.map +1 -1
  53. package/cjs/render/layout/group.d.ts +2 -2
  54. package/cjs/render/layout/group.js +1 -1
  55. package/cjs/render/layout/group.js.map +1 -1
  56. package/cjs/render/layout/icon.d.ts +2 -2
  57. package/cjs/render/layout/icon.js +1 -1
  58. package/cjs/render/layout/icon.js.map +1 -1
  59. package/cjs/render/layout/image.d.ts +2 -2
  60. package/cjs/render/layout/image.js +1 -1
  61. package/cjs/render/layout/image.js.map +1 -1
  62. package/cjs/render/layout/rect.d.ts +2 -2
  63. package/cjs/render/layout/rect.js +1 -1
  64. package/cjs/render/layout/rect.js.map +1 -1
  65. package/cjs/render/layout/text.d.ts +1 -1
  66. package/cjs/render/layout/text.js +1 -1
  67. package/cjs/render/layout/text.js.map +1 -1
  68. package/cjs/scenegraph/component/cell-content.d.ts +2 -2
  69. package/cjs/scenegraph/component/cell-content.js +1 -1
  70. package/cjs/scenegraph/component/cell-content.js.map +1 -1
  71. package/cjs/scenegraph/component/cell-mover.d.ts +1 -1
  72. package/cjs/scenegraph/component/cell-mover.js +1 -1
  73. package/cjs/scenegraph/component/cell-mover.js.map +1 -1
  74. package/cjs/scenegraph/component/custom.d.ts +1 -6
  75. package/cjs/scenegraph/component/custom.js +4 -21
  76. package/cjs/scenegraph/component/custom.js.map +1 -1
  77. package/cjs/scenegraph/component/drill-icon.js.map +1 -1
  78. package/cjs/scenegraph/component/menu.d.ts +1 -1
  79. package/cjs/scenegraph/component/menu.js +1 -1
  80. package/cjs/scenegraph/component/menu.js.map +1 -1
  81. package/cjs/scenegraph/component/table-component.d.ts +1 -1
  82. package/cjs/scenegraph/component/table-component.js +1 -1
  83. package/cjs/scenegraph/component/table-component.js.map +1 -1
  84. package/cjs/scenegraph/debug-tool/debug-tool.d.ts +1 -1
  85. package/cjs/scenegraph/debug-tool/debug-tool.js +1 -1
  86. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  87. package/cjs/scenegraph/debug-tool/index.d.ts +1 -1
  88. package/cjs/scenegraph/debug-tool/index.js.map +1 -1
  89. package/cjs/scenegraph/graphic/chart.d.ts +2 -2
  90. package/cjs/scenegraph/graphic/chart.js +1 -1
  91. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  92. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  93. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -1
  94. package/cjs/scenegraph/graphic/contributions/chart-render.js +1 -1
  95. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  96. package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +2 -2
  97. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +1 -1
  98. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  99. package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +2 -2
  100. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +1 -1
  101. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  102. package/cjs/scenegraph/graphic/contributions/index.d.ts +1 -1
  103. package/cjs/scenegraph/graphic/contributions/index.js +1 -1
  104. package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
  105. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +2 -2
  106. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  107. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  108. package/cjs/scenegraph/graphic/group.d.ts +2 -2
  109. package/cjs/scenegraph/graphic/group.js +1 -1
  110. package/cjs/scenegraph/graphic/group.js.map +1 -1
  111. package/cjs/scenegraph/graphic/icon.d.ts +2 -2
  112. package/cjs/scenegraph/graphic/icon.js +1 -1
  113. package/cjs/scenegraph/graphic/icon.js.map +1 -1
  114. package/cjs/scenegraph/graphic/text.d.ts +2 -2
  115. package/cjs/scenegraph/graphic/text.js +1 -1
  116. package/cjs/scenegraph/graphic/text.js.map +1 -1
  117. package/cjs/scenegraph/group-creater/cell-helper.d.ts +3 -6
  118. package/cjs/scenegraph/group-creater/cell-helper.js +39 -41
  119. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  120. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  121. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  122. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
  123. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  124. package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  125. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +68 -29
  126. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  127. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +1 -1
  128. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  129. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
  130. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  131. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  132. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -3
  133. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +3 -7
  134. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  135. package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  136. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  137. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  138. package/cjs/scenegraph/group-creater/column-helper.d.ts +1 -1
  139. package/cjs/scenegraph/group-creater/column-helper.js +7 -11
  140. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  141. package/cjs/scenegraph/icon/icon-update.js +1 -1
  142. package/cjs/scenegraph/icon/icon-update.js.map +1 -1
  143. package/cjs/scenegraph/layout/compute-col-width.js +3 -2
  144. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  145. package/cjs/scenegraph/layout/compute-row-height.js +1 -1
  146. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  147. package/cjs/scenegraph/layout/move-cell.js.map +1 -1
  148. package/cjs/scenegraph/layout/update-col.js.map +1 -1
  149. package/cjs/scenegraph/layout/update-height.js +16 -18
  150. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  151. package/cjs/scenegraph/layout/update-row.js +40 -7
  152. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  153. package/cjs/scenegraph/layout/update-width.js +17 -19
  154. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  155. package/cjs/scenegraph/refresh-node/update-chart.js +11 -1
  156. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  157. package/cjs/scenegraph/scenegraph.d.ts +1 -1
  158. package/cjs/scenegraph/scenegraph.js +2 -2
  159. package/cjs/scenegraph/scenegraph.js.map +1 -1
  160. package/cjs/scenegraph/select/create-select-border.js +1 -1
  161. package/cjs/scenegraph/select/create-select-border.js.map +1 -1
  162. package/cjs/scenegraph/select/delete-select-border.js.map +1 -1
  163. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  164. package/cjs/scenegraph/stick-text/index.js +14 -9
  165. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  166. package/cjs/scenegraph/style/corner-cell.js.map +1 -1
  167. package/cjs/scenegraph/style/frame-border.js +1 -1
  168. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  169. package/cjs/scenegraph/utils/get-cell-merge.js +0 -4
  170. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  171. package/cjs/scenegraph/utils/padding.js +1 -1
  172. package/cjs/scenegraph/utils/padding.js.map +1 -1
  173. package/cjs/scenegraph/utils/render-service.d.ts +1 -1
  174. package/cjs/scenegraph/utils/render-service.js +1 -1
  175. package/cjs/scenegraph/utils/render-service.js.map +1 -1
  176. package/cjs/scenegraph/utils/text-icon-layout.d.ts +4 -4
  177. package/cjs/scenegraph/utils/text-icon-layout.js +11 -13
  178. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  179. package/cjs/scenegraph/utils/text-measure.d.ts +2 -2
  180. package/cjs/scenegraph/utils/text-measure.js +1 -1
  181. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  182. package/cjs/scenegraph/utils/text-pos.d.ts +1 -1
  183. package/cjs/scenegraph/utils/text-pos.js.map +1 -1
  184. package/cjs/state/select/update-position.js +4 -10
  185. package/cjs/state/select/update-position.js.map +1 -1
  186. package/cjs/state/spark-line/index.js +1 -1
  187. package/cjs/state/spark-line/index.js.map +1 -1
  188. package/cjs/state/state.d.ts +1 -1
  189. package/cjs/state/state.js +1 -1
  190. package/cjs/state/state.js.map +1 -1
  191. package/cjs/themes/ARCO.js +1 -2
  192. package/cjs/themes/BRIGHT.js +2 -1
  193. package/cjs/tools/NumberMap.js +1 -1
  194. package/cjs/ts-types/base-table.d.ts +3 -3
  195. package/cjs/ts-types/base-table.js.map +1 -1
  196. package/cjs/ts-types/component/title.d.ts +1 -1
  197. package/cjs/ts-types/component/title.js.map +1 -1
  198. package/cjs/ts-types/events.d.ts +1 -1
  199. package/cjs/ts-types/events.js.map +1 -1
  200. package/cjs/ts-types/list-table/define/image-define.d.ts +2 -0
  201. package/cjs/ts-types/list-table/define/image-define.js.map +1 -1
  202. package/cjs/ts-types/pivot-table/dimension/image-dimension.d.ts +1 -0
  203. package/cjs/ts-types/pivot-table/dimension/image-dimension.js.map +1 -1
  204. package/cjs/ts-types/pivot-table/indicator/image-indicator.d.ts +2 -0
  205. package/cjs/ts-types/pivot-table/indicator/image-indicator.js.map +1 -1
  206. package/cjs/ts-types/table-engine.d.ts +1 -5
  207. package/cjs/ts-types/table-engine.js.map +1 -1
  208. package/cjs/vrender.d.ts +4 -0
  209. package/cjs/vrender.js +40 -0
  210. package/cjs/vrender.js.map +1 -0
  211. package/dist/vtable.js +1470 -1279
  212. package/dist/vtable.min.js +2 -2
  213. package/es/ListTable.js +11 -4
  214. package/es/ListTable.js.map +1 -1
  215. package/es/PivotTable.js +10 -3
  216. package/es/PivotTable.js.map +1 -1
  217. package/es/components/axis/axis.js +4 -1
  218. package/es/components/axis/axis.js.map +1 -1
  219. package/es/components/axis/label-overlap.js.map +1 -1
  220. package/es/core/BaseTable.d.ts +2 -2
  221. package/es/core/BaseTable.js +7 -6
  222. package/es/core/BaseTable.js.map +1 -1
  223. package/es/core/style.js +1 -2
  224. package/es/core/tableHelper.d.ts +1 -1
  225. package/es/core/tableHelper.js +2 -1
  226. package/es/core/tableHelper.js.map +1 -1
  227. package/es/event/event.d.ts +1 -1
  228. package/es/event/event.js +2 -2
  229. package/es/event/event.js.map +1 -1
  230. package/es/event/listener/scroll-bar.js.map +1 -1
  231. package/es/event/listener/table-group.js +1 -1
  232. package/es/event/listener/table-group.js.map +1 -1
  233. package/es/event/listener/touch.js.map +1 -1
  234. package/es/event/media-click.js +4 -0
  235. package/es/event/media-click.js.map +1 -1
  236. package/es/event/pivot-chart/axis-click.js.map +1 -1
  237. package/es/event/scroll.js +2 -1
  238. package/es/event/sparkline-event.js +1 -2
  239. package/es/event/util.d.ts +1 -1
  240. package/es/event/util.js.map +1 -1
  241. package/es/index.d.ts +2 -2
  242. package/es/index.js +4 -2
  243. package/es/index.js.map +1 -1
  244. package/es/layout/chart-helper/get-chart-spec.d.ts +1 -0
  245. package/es/layout/chart-helper/get-chart-spec.js +11 -0
  246. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  247. package/es/layout/pivot-header-layout.d.ts +1 -0
  248. package/es/layout/pivot-header-layout.js +6 -3
  249. package/es/layout/pivot-header-layout.js.map +1 -1
  250. package/es/layout/simple-header-layout.d.ts +1 -0
  251. package/es/layout/simple-header-layout.js +4 -1
  252. package/es/layout/simple-header-layout.js.map +1 -1
  253. package/es/render/jsx/index.d.ts +1 -1
  254. package/es/render/jsx/index.js +1 -1
  255. package/es/render/jsx/index.js.map +1 -1
  256. package/es/render/layout/arc.d.ts +2 -2
  257. package/es/render/layout/arc.js +1 -1
  258. package/es/render/layout/arc.js.map +1 -1
  259. package/es/render/layout/circle.d.ts +2 -2
  260. package/es/render/layout/circle.js +1 -1
  261. package/es/render/layout/circle.js.map +1 -1
  262. package/es/render/layout/container.d.ts +2 -2
  263. package/es/render/layout/container.js +1 -1
  264. package/es/render/layout/container.js.map +1 -1
  265. package/es/render/layout/group.d.ts +2 -2
  266. package/es/render/layout/group.js +1 -1
  267. package/es/render/layout/group.js.map +1 -1
  268. package/es/render/layout/icon.d.ts +2 -2
  269. package/es/render/layout/icon.js +1 -1
  270. package/es/render/layout/icon.js.map +1 -1
  271. package/es/render/layout/image.d.ts +2 -2
  272. package/es/render/layout/image.js +1 -1
  273. package/es/render/layout/image.js.map +1 -1
  274. package/es/render/layout/rect.d.ts +2 -2
  275. package/es/render/layout/rect.js +1 -1
  276. package/es/render/layout/rect.js.map +1 -1
  277. package/es/render/layout/text.d.ts +1 -1
  278. package/es/render/layout/text.js +1 -1
  279. package/es/render/layout/text.js.map +1 -1
  280. package/es/scenegraph/component/cell-content.d.ts +2 -2
  281. package/es/scenegraph/component/cell-content.js +1 -1
  282. package/es/scenegraph/component/cell-content.js.map +1 -1
  283. package/es/scenegraph/component/cell-mover.d.ts +1 -1
  284. package/es/scenegraph/component/cell-mover.js +1 -1
  285. package/es/scenegraph/component/cell-mover.js.map +1 -1
  286. package/es/scenegraph/component/custom.d.ts +1 -6
  287. package/es/scenegraph/component/custom.js +2 -20
  288. package/es/scenegraph/component/custom.js.map +1 -1
  289. package/es/scenegraph/component/drill-icon.js.map +1 -1
  290. package/es/scenegraph/component/menu.d.ts +1 -1
  291. package/es/scenegraph/component/menu.js +1 -1
  292. package/es/scenegraph/component/menu.js.map +1 -1
  293. package/es/scenegraph/component/table-component.d.ts +1 -1
  294. package/es/scenegraph/component/table-component.js +1 -1
  295. package/es/scenegraph/component/table-component.js.map +1 -1
  296. package/es/scenegraph/debug-tool/debug-tool.d.ts +1 -1
  297. package/es/scenegraph/debug-tool/debug-tool.js +1 -1
  298. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  299. package/es/scenegraph/debug-tool/index.d.ts +1 -1
  300. package/es/scenegraph/debug-tool/index.js.map +1 -1
  301. package/es/scenegraph/graphic/chart.d.ts +2 -2
  302. package/es/scenegraph/graphic/chart.js +1 -1
  303. package/es/scenegraph/graphic/chart.js.map +1 -1
  304. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  305. package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -1
  306. package/es/scenegraph/graphic/contributions/chart-render.js +1 -1
  307. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  308. package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +2 -2
  309. package/es/scenegraph/graphic/contributions/group-contribution-render.js +1 -1
  310. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  311. package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +2 -2
  312. package/es/scenegraph/graphic/contributions/image-contribution-render.js +1 -1
  313. package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -1
  314. package/es/scenegraph/graphic/contributions/index.d.ts +1 -1
  315. package/es/scenegraph/graphic/contributions/index.js +1 -1
  316. package/es/scenegraph/graphic/contributions/index.js.map +1 -1
  317. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +2 -2
  318. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  319. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  320. package/es/scenegraph/graphic/group.d.ts +2 -2
  321. package/es/scenegraph/graphic/group.js +1 -1
  322. package/es/scenegraph/graphic/group.js.map +1 -1
  323. package/es/scenegraph/graphic/icon.d.ts +2 -2
  324. package/es/scenegraph/graphic/icon.js +1 -1
  325. package/es/scenegraph/graphic/icon.js.map +1 -1
  326. package/es/scenegraph/graphic/text.d.ts +2 -2
  327. package/es/scenegraph/graphic/text.js +1 -1
  328. package/es/scenegraph/graphic/text.js.map +1 -1
  329. package/es/scenegraph/group-creater/cell-helper.d.ts +3 -6
  330. package/es/scenegraph/group-creater/cell-helper.js +37 -38
  331. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  332. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +1 -1
  333. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  334. package/es/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
  335. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  336. package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  337. package/es/scenegraph/group-creater/cell-type/image-cell.js +63 -27
  338. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  339. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +1 -1
  340. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  341. package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
  342. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  343. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  344. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -3
  345. package/es/scenegraph/group-creater/cell-type/text-cell.js +3 -7
  346. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  347. package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  348. package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  349. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  350. package/es/scenegraph/group-creater/column-helper.d.ts +1 -1
  351. package/es/scenegraph/group-creater/column-helper.js +6 -11
  352. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  353. package/es/scenegraph/icon/icon-update.js +1 -1
  354. package/es/scenegraph/icon/icon-update.js.map +1 -1
  355. package/es/scenegraph/layout/compute-col-width.js +3 -2
  356. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  357. package/es/scenegraph/layout/compute-row-height.js +1 -1
  358. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  359. package/es/scenegraph/layout/move-cell.js.map +1 -1
  360. package/es/scenegraph/layout/update-col.js.map +1 -1
  361. package/es/scenegraph/layout/update-height.js +15 -17
  362. package/es/scenegraph/layout/update-height.js.map +1 -1
  363. package/es/scenegraph/layout/update-row.js +40 -7
  364. package/es/scenegraph/layout/update-row.js.map +1 -1
  365. package/es/scenegraph/layout/update-width.js +16 -18
  366. package/es/scenegraph/layout/update-width.js.map +1 -1
  367. package/es/scenegraph/refresh-node/update-chart.js +11 -1
  368. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  369. package/es/scenegraph/scenegraph.d.ts +1 -1
  370. package/es/scenegraph/scenegraph.js +2 -2
  371. package/es/scenegraph/scenegraph.js.map +1 -1
  372. package/es/scenegraph/select/create-select-border.js +1 -1
  373. package/es/scenegraph/select/create-select-border.js.map +1 -1
  374. package/es/scenegraph/select/delete-select-border.js.map +1 -1
  375. package/es/scenegraph/select/update-select-border.js.map +1 -1
  376. package/es/scenegraph/stick-text/index.js +14 -9
  377. package/es/scenegraph/stick-text/index.js.map +1 -1
  378. package/es/scenegraph/style/corner-cell.js.map +1 -1
  379. package/es/scenegraph/style/frame-border.js +1 -1
  380. package/es/scenegraph/style/frame-border.js.map +1 -1
  381. package/es/scenegraph/utils/get-cell-merge.js +0 -4
  382. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  383. package/es/scenegraph/utils/padding.js +1 -1
  384. package/es/scenegraph/utils/padding.js.map +1 -1
  385. package/es/scenegraph/utils/render-service.d.ts +1 -1
  386. package/es/scenegraph/utils/render-service.js +1 -1
  387. package/es/scenegraph/utils/render-service.js.map +1 -1
  388. package/es/scenegraph/utils/text-icon-layout.d.ts +4 -4
  389. package/es/scenegraph/utils/text-icon-layout.js +11 -11
  390. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  391. package/es/scenegraph/utils/text-measure.d.ts +2 -2
  392. package/es/scenegraph/utils/text-measure.js +1 -1
  393. package/es/scenegraph/utils/text-measure.js.map +1 -1
  394. package/es/scenegraph/utils/text-pos.d.ts +1 -1
  395. package/es/scenegraph/utils/text-pos.js.map +1 -1
  396. package/es/state/select/update-position.js +4 -10
  397. package/es/state/select/update-position.js.map +1 -1
  398. package/es/state/spark-line/index.js +1 -1
  399. package/es/state/spark-line/index.js.map +1 -1
  400. package/es/state/state.d.ts +1 -1
  401. package/es/state/state.js +1 -1
  402. package/es/state/state.js.map +1 -1
  403. package/es/themes/ARCO.js +1 -2
  404. package/es/themes/BRIGHT.js +2 -1
  405. package/es/tools/NumberMap.js +1 -1
  406. package/es/ts-types/base-table.d.ts +3 -3
  407. package/es/ts-types/base-table.js.map +1 -1
  408. package/es/ts-types/component/title.d.ts +1 -1
  409. package/es/ts-types/component/title.js.map +1 -1
  410. package/es/ts-types/events.d.ts +1 -1
  411. package/es/ts-types/events.js.map +1 -1
  412. package/es/ts-types/list-table/define/image-define.d.ts +2 -0
  413. package/es/ts-types/list-table/define/image-define.js.map +1 -1
  414. package/es/ts-types/pivot-table/dimension/image-dimension.d.ts +1 -0
  415. package/es/ts-types/pivot-table/dimension/image-dimension.js.map +1 -1
  416. package/es/ts-types/pivot-table/indicator/image-indicator.d.ts +2 -0
  417. package/es/ts-types/pivot-table/indicator/image-indicator.js.map +1 -1
  418. package/es/ts-types/table-engine.d.ts +1 -5
  419. package/es/ts-types/table-engine.js.map +1 -1
  420. package/es/vrender.d.ts +4 -0
  421. package/es/vrender.js +22 -0
  422. package/es/vrender.js.map +1 -0
  423. 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,457 +31857,357 @@
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();
32142
+ else if (str.endsWith('%') && size) {
32143
+ return (parseInt(str, 10) / 100) * size;
32011
32144
  }
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();
32145
+ return parseInt(str, 10);
32146
+ }
32147
+ function dealPercentCalc(group, parentWidth, parentHeight) {
32148
+ if (!group) {
32149
+ return;
32036
32150
  }
32037
- updateColumnRowNumber(row) {
32038
- if (!this.rowNumber) {
32039
- this.rowNumber = row;
32151
+ group.forEachChildren((child) => {
32152
+ if (!child) {
32153
+ return;
32040
32154
  }
32041
- else {
32042
- this.rowNumber = Math.max(this.rowNumber, row);
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));
32043
32158
  }
32044
- }
32045
- updateColumnHeight(cellHeight) {
32046
- if (!this.colHeight) {
32047
- this.colHeight = cellHeight;
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));
32048
32162
  }
32049
- else {
32050
- this.colHeight += cellHeight;
32163
+ if (child.type === 'group') {
32164
+ dealPercentCalc(child, child.attribute.width, child.attribute.height);
32051
32165
  }
32166
+ });
32167
+ }
32168
+ function decodeReactDom(dom) {
32169
+ if (!dom || !dom.$$typeof) {
32170
+ return dom;
32052
32171
  }
32053
- };
32054
- function after(group, selfChange) {
32055
- if (!group.stage.dirtyBounds) {
32056
- return;
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;
32057
32178
  }
32058
- if (!(group.stage && group.stage.renderCount)) {
32059
- return;
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
+ });
32060
32186
  }
32061
- if (group.isContainer && !selfChange) {
32062
- return;
32187
+ else if (children) {
32188
+ g.add(decodeReactDom(children));
32063
32189
  }
32064
- group.stage.dirty(group.globalAABBBounds);
32190
+ return g;
32065
32191
  }
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();
32090
- }
32091
- else {
32092
- this.chartInstance = params.chartInstance;
32093
- }
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;
32094
32201
  }
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);
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]);
32139
32207
  }
32140
32208
  });
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
32209
  }
32176
32210
  }
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();
32190
- }
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();
32195
- }
32196
- else if (layoutMap.isRightFrozenColumn(col, row)) {
32197
- bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
32198
- bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
32199
- }
32200
- else if (layoutMap.isBottomFrozenRow(col, row)) {
32201
- bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
32202
- bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
32203
- }
32204
- return bodyBound;
32205
- }
32206
-
32207
- const chartTypes = {};
32208
-
32209
- const builtin = {};
32210
- function get$2() {
32211
- return extend(builtin, chartTypes);
32212
- }
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;
32221
- }
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
32237
- });
32238
- cellGroup.role = 'cell';
32239
- cellGroup.col = col;
32240
- cellGroup.row = row;
32241
- columnGroup?.addChild(cellGroup);
32242
- }
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
- }
32266
32211
 
32267
32212
  const icons = {};
32268
32213
  class IconCache {
@@ -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);
@@ -32626,31 +32823,28 @@
32626
32823
  image.name = 'image';
32627
32824
  image.keepAspectRatio = keepAspectRatio;
32628
32825
  if (keepAspectRatio || imageAutoSizing) {
32629
- image.successCallback = () => {
32630
- const originImage = image.resources.get(image.attribute.image).data;
32631
- if (imageAutoSizing) {
32632
- _adjustWidthHeight(col, row, originImage.width, originImage.height, table.scenegraph, padding);
32633
- }
32634
- 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);
32637
- image.setAttributes({
32638
- x: pos.x,
32639
- y: pos.y,
32640
- width: imageWidth,
32641
- height: imageHeight
32642
- });
32643
- }
32644
- table.scenegraph.updateNextFrame();
32645
- };
32826
+ if (image.resources.has(image.attribute.image) && image.resources.get(image.attribute.image).state === 'success') {
32827
+ updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
32828
+ }
32829
+ else {
32830
+ image.successCallback = () => {
32831
+ updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
32832
+ table.scenegraph.updateNextFrame();
32833
+ };
32834
+ }
32646
32835
  }
32647
32836
  else {
32648
- image.successCallback = () => {
32837
+ if (image.resources.has(image.attribute.image) && image.resources.get(image.attribute.image).state === 'success') {
32649
32838
  updateImageCellContentWhileResize(cellGroup, col, row, table);
32650
- };
32839
+ }
32840
+ else {
32841
+ image.successCallback = () => {
32842
+ updateImageCellContentWhileResize(cellGroup, col, row, table);
32843
+ };
32844
+ }
32651
32845
  }
32652
32846
  image.failCallback = () => {
32653
- const regedIcons = get$1();
32847
+ const regedIcons = get$2();
32654
32848
  image.image = regedIcons.damage_pic.svg;
32655
32849
  };
32656
32850
  cellGroup.appendChild(image);
@@ -32660,20 +32854,36 @@
32660
32854
  let needInvalidate = false;
32661
32855
  let targetWidth = null;
32662
32856
  let targetHeight = null;
32663
- if (scene.table.getColWidth(col) < width + padding[1] + padding[3]) {
32857
+ const cellGroup = scene.getCell(col, row, true);
32858
+ const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, scene.table);
32859
+ if (cellWidth < width + padding[1] + padding[3]) {
32664
32860
  targetWidth = width + padding[1] + padding[3];
32665
32861
  needInvalidate = true;
32666
32862
  }
32667
- if (scene.table.getRowHeight(row) < height + padding[2] + padding[0]) {
32863
+ if (cellHeight < height + padding[2] + padding[0]) {
32668
32864
  targetHeight = height + padding[2] + padding[0];
32669
32865
  needInvalidate = true;
32670
32866
  }
32671
32867
  if (needInvalidate) {
32672
32868
  if (typeof targetWidth === 'number') {
32673
- scene.setColWidth(col, targetWidth);
32869
+ if (isMerge) {
32870
+ for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
32871
+ scene.setColWidth(col, targetWidth / (cellGroup.mergeEndCol - cellGroup.mergeStartCol + 1));
32872
+ }
32873
+ }
32874
+ else {
32875
+ scene.setColWidth(col, targetWidth);
32876
+ }
32674
32877
  }
32675
32878
  if (typeof targetHeight === 'number') {
32676
- scene.setRowHeight(row, targetHeight);
32879
+ if (isMerge) {
32880
+ for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
32881
+ scene.setRowHeight(row, targetHeight / (cellGroup.mergeEndRow - cellGroup.mergeStartRow + 1));
32882
+ }
32883
+ }
32884
+ else {
32885
+ scene.setRowHeight(row, targetHeight);
32886
+ }
32677
32887
  }
32678
32888
  scene.component.updateScrollBar();
32679
32889
  return true;
@@ -32692,8 +32902,9 @@
32692
32902
  const textBaseline = getProp('textBaseline', headerStyle, col, row, table) ?? 'middle';
32693
32903
  const padding = getQuadProps(getProp('padding', headerStyle, col, row, table)) ?? [0, 0, 0, 0];
32694
32904
  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);
32905
+ const { width: cellWidth, height: cellHeight } = getCellRange(cellGroup, table);
32906
+ const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width || originImage.videoWidth, originImage.height || originImage.videoHeight, cellWidth - (padding[1] + padding[3]), cellHeight - (padding[0] + padding[2]));
32907
+ const pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
32697
32908
  image.setAttributes({
32698
32909
  x: pos.x,
32699
32910
  y: pos.y,
@@ -32702,19 +32913,19 @@
32702
32913
  });
32703
32914
  }
32704
32915
  else {
32916
+ const { width: cellWidth, height: cellHeight } = getCellRange(cellGroup, table);
32705
32917
  image.setAttributes({
32706
32918
  x: padding[3],
32707
32919
  y: padding[0],
32708
- width: cellGroup.attribute.width - padding[1] - padding[3],
32709
- height: cellGroup.attribute.height - padding[0] - padding[2]
32920
+ width: cellWidth - padding[1] - padding[3],
32921
+ height: cellHeight - padding[0] - padding[2]
32710
32922
  });
32711
32923
  }
32712
32924
  const playIcon = cellGroup.getChildByName('play-icon');
32713
32925
  if (playIcon) {
32714
32926
  const left = 0;
32715
32927
  const top = 0;
32716
- const width = cellGroup.attribute.width;
32717
- const height = cellGroup.attribute.height;
32928
+ const { width, height } = getCellRange(cellGroup, table);
32718
32929
  const iconSize = Math.floor(Math.min(width - padding[1] - padding[3], height - padding[2] - padding[0]) / 2);
32719
32930
  const anchorX = left + (width > image.attribute.width ? image.attribute.x - left + image.attribute.width / 2 : width / 2);
32720
32931
  const anchorY = top + (height > image.attribute.height ? image.attribute.y - top + image.attribute.height / 2 : height / 2);
@@ -32726,6 +32937,60 @@
32726
32937
  });
32727
32938
  }
32728
32939
  }
32940
+ function getCellRange(cellGroup, table) {
32941
+ if (isValid$1(cellGroup.mergeStartCol) &&
32942
+ isValid$1(cellGroup.mergeEndCol) &&
32943
+ isValid$1(cellGroup.mergeStartRow) &&
32944
+ isValid$1(cellGroup.mergeEndRow)) {
32945
+ return {
32946
+ width: table.getColsWidth(cellGroup.mergeStartCol, cellGroup.mergeEndCol),
32947
+ height: table.getRowsHeight(cellGroup.mergeStartRow, cellGroup.mergeEndRow),
32948
+ isMerge: true
32949
+ };
32950
+ }
32951
+ return {
32952
+ width: cellGroup.attribute.width,
32953
+ height: cellGroup.attribute.height,
32954
+ isMerge: false
32955
+ };
32956
+ }
32957
+ function updateImageDxDy(startCol, endCol, startRow, endRow, table) {
32958
+ for (let col = startCol; col <= endCol; col++) {
32959
+ for (let row = startRow; row <= endRow; row++) {
32960
+ const cellGroup = table.scenegraph.getCell(col, row);
32961
+ if (cellGroup) {
32962
+ const image = cellGroup.getChildByName('image');
32963
+ if (image) {
32964
+ image.setAttributes({
32965
+ dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
32966
+ dy: -table.getRowsHeight(cellGroup.mergeStartRow, row - 1)
32967
+ });
32968
+ }
32969
+ }
32970
+ }
32971
+ }
32972
+ }
32973
+ function updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table) {
32974
+ const originImage = image.resources.get(image.attribute.image).data;
32975
+ const { col, row } = cellGroup;
32976
+ if (imageAutoSizing) {
32977
+ _adjustWidthHeight(col, row, originImage.width, originImage.height, table.scenegraph, padding);
32978
+ }
32979
+ if (keepAspectRatio) {
32980
+ const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, table);
32981
+ const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width, originImage.height, cellWidth - padding[1] - padding[3], cellHeight - padding[0] - padding[2]);
32982
+ const pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
32983
+ image.setAttributes({
32984
+ x: pos.x,
32985
+ y: pos.y,
32986
+ width: imageWidth,
32987
+ height: imageHeight
32988
+ });
32989
+ if (isMerge) {
32990
+ updateImageDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
32991
+ }
32992
+ }
32993
+ }
32729
32994
 
32730
32995
  function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table) {
32731
32996
  if (progressBarDefine.dependField) {
@@ -33390,6 +33655,206 @@
33390
33655
  return group;
33391
33656
  }
33392
33657
 
33658
+ const CHART_NUMBER_TYPE = genNumberType();
33659
+ class Chart extends Group$2 {
33660
+ type = 'chart';
33661
+ chartInstance;
33662
+ activeChartInstance;
33663
+ active;
33664
+ cacheCanvas;
33665
+ constructor(params) {
33666
+ super(params);
33667
+ this.numberType = CHART_NUMBER_TYPE;
33668
+ if (!params.chartInstance) {
33669
+ params.chartInstance = this.chartInstance = new params.ClassType(params.spec, {
33670
+ renderCanvas: params.canvas,
33671
+ mode: this.attribute.mode === 'node' ? 'node' : 'desktop-browser',
33672
+ modeParams: this.attribute.modeParams,
33673
+ canvasControled: false,
33674
+ viewBox: { x1: 0, x2: 0, y1: 0, y2: 0 },
33675
+ dpr: params.dpr,
33676
+ interactive: false,
33677
+ animation: false,
33678
+ autoFit: false
33679
+ });
33680
+ this.chartInstance.renderSync();
33681
+ }
33682
+ else {
33683
+ this.chartInstance = params.chartInstance;
33684
+ }
33685
+ }
33686
+ activate(table) {
33687
+ this.active = true;
33688
+ const { col, row } = this.parent;
33689
+ const { x1, y1, x2, y2 } = this.getViewBox();
33690
+ const tableBound = getTableBounds(col, row, table);
33691
+ const clipBound = tableBound.intersect({
33692
+ x1: x1 - table.scrollLeft,
33693
+ x2: x2 - table.scrollLeft,
33694
+ y1: y1 - table.scrollTop,
33695
+ y2: y2 - table.scrollTop
33696
+ });
33697
+ this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, {
33698
+ renderCanvas: this.attribute.canvas,
33699
+ mode: 'desktop-browser',
33700
+ canvasControled: false,
33701
+ viewBox: {
33702
+ x1: x1 - table.scrollLeft,
33703
+ x2: x2 - table.scrollLeft,
33704
+ y1: y1 - table.scrollTop,
33705
+ y2: y2 - table.scrollTop
33706
+ },
33707
+ dpr: table.internalProps.pixelRatio,
33708
+ animation: false,
33709
+ interactive: true,
33710
+ autoFit: false,
33711
+ beforeRender: (stage) => {
33712
+ const ctx = stage.window.getContext();
33713
+ ctx.inuse = true;
33714
+ ctx.clearMatrix();
33715
+ ctx.setTransformForCurrent(true);
33716
+ ctx.beginPath();
33717
+ ctx.rect(clipBound.x1, clipBound.y1, clipBound.x2 - clipBound.x1, clipBound.y2 - clipBound.y1);
33718
+ ctx.clip();
33719
+ },
33720
+ afterRender(stage) {
33721
+ const ctx = stage.window.getContext();
33722
+ ctx.inuse = false;
33723
+ }
33724
+ });
33725
+ this.activeChartInstance.renderSync();
33726
+ table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
33727
+ this.activeChartInstance.on('click', (params) => {
33728
+ if (Chart.temp) {
33729
+ table.scenegraph.updateChartState(params?.datum);
33730
+ }
33731
+ });
33732
+ this.activeChartInstance.on('brushEnd', (params) => {
33733
+ table.scenegraph.updateChartState(params?.value?.inBrushData);
33734
+ Chart.temp = 0;
33735
+ setTimeout(() => {
33736
+ Chart.temp = 1;
33737
+ }, 0);
33738
+ });
33739
+ table._bindChartEvent?.(this.activeChartInstance);
33740
+ }
33741
+ static temp = 1;
33742
+ deactivate() {
33743
+ this.active = false;
33744
+ this.activeChartInstance?.updateViewBox({
33745
+ x1: -1000,
33746
+ x2: -800,
33747
+ y1: -1000,
33748
+ y2: -800
33749
+ }, false, false);
33750
+ this.activeChartInstance?.release();
33751
+ this.activeChartInstance = null;
33752
+ }
33753
+ updateData(data) {
33754
+ this.attribute.data = data;
33755
+ }
33756
+ getViewBox() {
33757
+ const cellGroup = this.parent;
33758
+ const padding = this.attribute.cellPadding;
33759
+ const table = this.stage.table;
33760
+ return {
33761
+ x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
33762
+ x2: Math.ceil(cellGroup.globalAABBBounds.x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft),
33763
+ y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
33764
+ y2: Math.ceil(cellGroup.globalAABBBounds.y1 + cellGroup.attribute.height - padding[2] + table.scrollTop)
33765
+ };
33766
+ }
33767
+ }
33768
+ function getTableBounds(col, row, table) {
33769
+ const { layoutMap } = table.internalProps;
33770
+ const bodyBound = new Bounds();
33771
+ const tableBound = table.scenegraph.tableGroup.globalAABBBounds;
33772
+ bodyBound.x1 = tableBound.x1;
33773
+ bodyBound.x2 = tableBound.x2;
33774
+ bodyBound.y1 = tableBound.y1;
33775
+ bodyBound.y2 = tableBound.y2;
33776
+ if (!layoutMap.isFrozenColumn(col, row) && !layoutMap.isRightFrozenColumn(col, row)) {
33777
+ bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
33778
+ bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
33779
+ bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
33780
+ bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
33781
+ }
33782
+ else if (layoutMap.isLeftBottomCorner(col, row) || layoutMap.isRightTopCorner(col, row)) ;
33783
+ else if (layoutMap.isFrozenColumn(col, row)) {
33784
+ bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
33785
+ bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
33786
+ }
33787
+ else if (layoutMap.isRightFrozenColumn(col, row)) {
33788
+ bodyBound.y1 = tableBound.y1 + table.getFrozenRowsHeight();
33789
+ bodyBound.y2 = tableBound.y2 - table.getBottomFrozenRowsHeight();
33790
+ }
33791
+ else if (layoutMap.isBottomFrozenRow(col, row)) {
33792
+ bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
33793
+ bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
33794
+ }
33795
+ return bodyBound;
33796
+ }
33797
+
33798
+ const chartTypes = {};
33799
+
33800
+ const builtin = {};
33801
+ function get$1() {
33802
+ return extend(builtin, chartTypes);
33803
+ }
33804
+
33805
+ function createChartCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, dataValue, chartModule, chartSpec, chartInstance, dataId, table, cellTheme) {
33806
+ const registerCharts = get$1();
33807
+ const ClassType = registerCharts[chartModule];
33808
+ const headerStyle = table._getCellStyle(col, row);
33809
+ const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
33810
+ if (isValid$1(functionalPadding)) {
33811
+ padding = functionalPadding;
33812
+ }
33813
+ if (!cellGroup) {
33814
+ cellGroup = new Group$1({
33815
+ x: xOrigin,
33816
+ y: yOrigin,
33817
+ width,
33818
+ height,
33819
+ lineWidth: cellTheme?.group?.lineWidth ?? undefined,
33820
+ fill: cellTheme?.group?.fill ?? undefined,
33821
+ stroke: cellTheme?.group?.stroke ?? undefined,
33822
+ strokeArrayWidth: cellTheme?.group?.strokeArrayWidth ?? undefined,
33823
+ strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
33824
+ cursor: cellTheme?.group?.cursor ?? undefined,
33825
+ lineCap: 'square',
33826
+ clip: true,
33827
+ cornerRadius: cellTheme.group.cornerRadius
33828
+ });
33829
+ cellGroup.role = 'cell';
33830
+ cellGroup.col = col;
33831
+ cellGroup.row = row;
33832
+ columnGroup?.addChild(cellGroup);
33833
+ }
33834
+ cellGroup.AABBBounds.width();
33835
+ const chartGroup = new Chart({
33836
+ stroke: false,
33837
+ x: padding[3],
33838
+ y: padding[0],
33839
+ canvas: table.canvas ?? table.scenegraph.stage.window.getContext().canvas,
33840
+ mode: table.options.mode,
33841
+ modeParams: table.options.modeParams,
33842
+ spec: chartSpec,
33843
+ ClassType,
33844
+ width: width - padding[3] - padding[1],
33845
+ height: height - padding[2] - padding[0],
33846
+ chartInstance,
33847
+ dataId,
33848
+ data: table.getCellValue(col, row),
33849
+ cellPadding: padding,
33850
+ dpr: table.internalProps.pixelRatio,
33851
+ axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
33852
+ });
33853
+ cellGroup.appendChild(chartGroup);
33854
+ table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
33855
+ return cellGroup;
33856
+ }
33857
+
33393
33858
  class CellContent extends Group$1 {
33394
33859
  _leftGroup;
33395
33860
  _rightGroup;
@@ -33583,7 +34048,7 @@
33583
34048
  return cellHierarchyIndent;
33584
34049
  }
33585
34050
 
33586
- function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme, range) {
34051
+ function createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, lineClamp, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme) {
33587
34052
  const leftIcons = [];
33588
34053
  const rightIcons = [];
33589
34054
  const contentLeftIcons = [];
@@ -33602,9 +34067,7 @@
33602
34067
  if (!Array.isArray(icons) || icons.length === 0) {
33603
34068
  if (isValid$1(textStr)) {
33604
34069
  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);
34070
+ const hierarchyOffset = getHierarchyOffset(cellGroup.col, cellGroup.row, table);
33608
34071
  const attribute = {
33609
34072
  text: text.length === 1 ? text[0] : text,
33610
34073
  maxLineWidth: autoColWidth ? Infinity : cellWidth - (padding[1] + padding[3] + hierarchyOffset),
@@ -33651,7 +34114,7 @@
33651
34114
  }
33652
34115
  });
33653
34116
  leftIcons.forEach(icon => {
33654
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34117
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33655
34118
  iconMark.role = 'icon-left';
33656
34119
  iconMark.name = icon.name;
33657
34120
  iconMark.setAttribute('x', leftIconWidth + (iconMark.attribute.marginLeft ?? 0));
@@ -33661,7 +34124,7 @@
33661
34124
  cellGroup.appendChild(iconMark);
33662
34125
  });
33663
34126
  rightIcons.forEach(icon => {
33664
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34127
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33665
34128
  iconMark.role = 'icon-right';
33666
34129
  iconMark.name = icon.name;
33667
34130
  iconMark.setAttribute('x', rightIconWidth + (iconMark.attribute.marginLeft ?? 0));
@@ -33671,7 +34134,7 @@
33671
34134
  cellGroup.appendChild(iconMark);
33672
34135
  });
33673
34136
  absoluteLeftIcons.forEach(icon => {
33674
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34137
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33675
34138
  iconMark.role = 'icon-absolute-left';
33676
34139
  iconMark.name = icon.name;
33677
34140
  iconMark.setAttribute('x', absoluteLeftIconWidth + (iconMark.attribute.marginLeft ?? 0));
@@ -33680,7 +34143,7 @@
33680
34143
  cellGroup.appendChild(iconMark);
33681
34144
  });
33682
34145
  absoluteRightIcons.forEach(icon => {
33683
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34146
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33684
34147
  iconMark.role = 'icon-absolute-right';
33685
34148
  iconMark.name = icon.name;
33686
34149
  iconMark.setAttribute('x', absoluteRightIconWidth + (iconMark.attribute.marginLeft ?? 0));
@@ -33748,13 +34211,13 @@
33748
34211
  baseline: textBaseline
33749
34212
  });
33750
34213
  contentLeftIcons.forEach(icon => {
33751
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34214
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33752
34215
  iconMark.role = 'icon-content-left';
33753
34216
  iconMark.name = icon.name;
33754
34217
  cellContent.addLeftOccupyingIcon(iconMark);
33755
34218
  });
33756
34219
  contentRightIcons.forEach(icon => {
33757
- const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);
34220
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, table);
33758
34221
  iconMark.role = 'icon-content-right';
33759
34222
  iconMark.name = icon.name;
33760
34223
  cellContent.addRightOccupyingIcon(iconMark);
@@ -33818,7 +34281,7 @@
33818
34281
  height: height + padding[0] + padding[2]
33819
34282
  });
33820
34283
  }
33821
- function dealWithIcon(icon, mark, col, row, range, table) {
34284
+ function dealWithIcon(icon, mark, col, row, table) {
33822
34285
  const iconAttribute = {};
33823
34286
  if (icon.type === 'image') {
33824
34287
  iconAttribute.image = icon.src;
@@ -33836,9 +34299,7 @@
33836
34299
  isNumber$3(row) &&
33837
34300
  table &&
33838
34301
  (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);
34302
+ hierarchyOffset = getHierarchyOffset(col, row, table);
33842
34303
  }
33843
34304
  iconAttribute.marginLeft = (icon.marginLeft ?? 0) + hierarchyOffset;
33844
34305
  iconAttribute.marginRight = icon.marginRight ?? 0;
@@ -34060,7 +34521,7 @@
34060
34521
  return false;
34061
34522
  }
34062
34523
 
34063
- function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range) {
34524
+ function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme) {
34064
34525
  const headerStyle = table._getCellStyle(col, row);
34065
34526
  const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
34066
34527
  if (isValid$1(functionalPadding)) {
@@ -34102,15 +34563,9 @@
34102
34563
  const textStr = value;
34103
34564
  let icons;
34104
34565
  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);
34566
+ icons = table.getCellIcons(col, row);
34112
34567
  }
34113
- createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, typeof lineClamp === 'number' ? lineClamp : undefined, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme, range);
34568
+ createCellContent(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, typeof lineClamp === 'number' ? lineClamp : undefined, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme);
34114
34569
  if (cellTheme?._vtable?.marked) {
34115
34570
  const mark = createArc({
34116
34571
  x: cellGroup.attribute.width,
@@ -34134,7 +34589,7 @@
34134
34589
  return cellGroup;
34135
34590
  }
34136
34591
 
34137
- const regedIcons$1 = get$1();
34592
+ const regedIcons$1 = get$2();
34138
34593
  function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme) {
34139
34594
  const headerStyle = table._getCellStyle(col, row);
34140
34595
  const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
@@ -34389,7 +34844,7 @@
34389
34844
  return checkbox;
34390
34845
  }
34391
34846
 
34392
- function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult) {
34847
+ function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme) {
34393
34848
  if (isPromise(value)) {
34394
34849
  value = table.getCellValue(col, row);
34395
34850
  }
@@ -34446,29 +34901,23 @@
34446
34901
  }
34447
34902
  let customElementsGroup;
34448
34903
  let renderDefault = true;
34449
- if (customResult) {
34450
- customElementsGroup = customResult.elementsGroup;
34451
- renderDefault = customResult.renderDefault;
34904
+ let customRender;
34905
+ let customLayout;
34906
+ const cellLocation = table.getCellLocation(col, row);
34907
+ if (cellLocation !== 'body') {
34908
+ customRender = define?.headerCustomRender;
34909
+ customLayout = define?.headerCustomLayout;
34452
34910
  }
34453
34911
  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
- }
34912
+ customRender = define?.customRender || table.customRender;
34913
+ customLayout = define?.customLayout;
34914
+ }
34915
+ if (customLayout || customRender) {
34916
+ const customResult = dealWithCustom(customLayout, customRender, col, row, cellWidth, cellHeight, false, table.heightMode === 'autoHeight', padding, table);
34917
+ customElementsGroup = customResult.elementsGroup;
34918
+ renderDefault = customResult.renderDefault;
34470
34919
  }
34471
- cellGroup = createCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range);
34920
+ cellGroup = createCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme);
34472
34921
  const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
34473
34922
  if (axisConfig) {
34474
34923
  const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, table);
@@ -34488,21 +34937,21 @@
34488
34937
  }
34489
34938
  }
34490
34939
  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);
34940
+ cellGroup = createImageCellGroup(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme);
34492
34941
  }
34493
34942
  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);
34943
+ cellGroup = createVideoCellGroup(columnGroup, 0, y, col, row, cellWidth, cellHeight, define.keepAspectRatio, define.imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme);
34495
34944
  }
34496
34945
  else if (type === 'chart') {
34497
34946
  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()
34947
+ cellGroup = createChartCellGroup(null, columnGroup, 0, y, col, row, cellWidth, cellHeight, padding, value, define.chartModule, table.isPivotChart()
34499
34948
  ? table.internalProps.layoutMap.getChartSpec(col, row)
34500
34949
  : define.chartSpec, chartInstance, table.internalProps.layoutMap?.getChartDataId(col, row) ?? 'data', table, cellTheme);
34501
34950
  }
34502
34951
  else if (type === 'progressbar') {
34503
34952
  const style = table._getCellStyle(col, row);
34504
34953
  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);
34954
+ cellGroup = createCellGroup(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, false, null, true, cellTheme);
34506
34955
  const progressBarGroup = createProgressBarCell(define, style, colWidth, value, dataValue, col, row, padding, table);
34507
34956
  if (cellGroup.firstChild) {
34508
34957
  cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild);
@@ -34524,45 +34973,14 @@
34524
34973
  const cellStyle = table._getCellStyle(col, row);
34525
34974
  const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;
34526
34975
  const cellLocation = table.getCellLocation(col, row);
34527
- let value = table.getCellValue(col, row);
34976
+ const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);
34528
34977
  let isMerge;
34529
34978
  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)) {
34979
+ if (cellLocation !== 'body' || define?.mergeCell || table.internalProps.customMergeCell) {
34560
34980
  range = table.getCellRange(col, row);
34561
34981
  isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
34562
34982
  }
34563
- if (!cellTheme) {
34564
- cellTheme = getStyleTheme(cellStyle, table, isMerge ? range.start.col : col, isMerge ? range.start.row : row, getProp).theme;
34565
- }
34983
+ let cellTheme = getStyleTheme(cellStyle, table, isMerge ? range.start.col : col, isMerge ? range.start.row : row, getProp).theme;
34566
34984
  cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);
34567
34985
  if (!addNew && !isMerge && canUseFastUpdate(col, row, oldCellGroup, autoWrapText, table)) {
34568
34986
  const cellWidth = table.getColWidth(col);
@@ -34637,11 +35055,27 @@
34637
35055
  const type = table.isHeader(col, row)
34638
35056
  ? table._getHeaderLayoutMap(col, row).headerType
34639
35057
  : table.getBodyColumnType(col, row);
35058
+ let value = table.getCellValue(col, row);
35059
+ let customStyle;
35060
+ if (table.internalProps.customMergeCell) {
35061
+ const customMerge = table.getCustomMerge(col, row);
35062
+ if (customMerge) {
35063
+ const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;
35064
+ range = customMergeRange;
35065
+ isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
35066
+ value = customMergeText;
35067
+ customStyle = customMergeStyle;
35068
+ if (customStyle) {
35069
+ cellTheme = getStyleTheme(customStyle, table, range.start.col, range.start.row, getProp).theme;
35070
+ cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);
35071
+ }
35072
+ }
35073
+ }
35074
+ let newCellGroup;
34640
35075
  const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;
34641
35076
  const padding = cellTheme._vtable.padding;
34642
35077
  const textAlign = cellTheme._vtable.textAlign;
34643
35078
  const textBaseline = cellTheme._vtable.textBaseline;
34644
- let newCellGroup;
34645
35079
  let bgColorFunc;
34646
35080
  if (table.internalProps?.dataConfig?.mappingRules && !table.isHeader(col, row)) {
34647
35081
  table.internalProps?.dataConfig?.mappingRules?.forEach((mappingRule, i) => {
@@ -34652,6 +35086,14 @@
34652
35086
  }
34653
35087
  });
34654
35088
  }
35089
+ if (cellLocation !== 'body') {
35090
+ define?.headerCustomRender;
35091
+ define?.headerCustomLayout;
35092
+ }
35093
+ else {
35094
+ define?.customRender || table.customRender;
35095
+ define?.customLayout;
35096
+ }
34655
35097
  let cellWidth;
34656
35098
  let cellHeight;
34657
35099
  if (range) {
@@ -34664,10 +35106,10 @@
34664
35106
  }
34665
35107
  if (isPromise(value)) {
34666
35108
  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));
35109
+ dealPromiseData(value, table, updateCellContent.bind(null, type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme));
34668
35110
  }
34669
35111
  else {
34670
- newCellGroup = updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult);
35112
+ newCellGroup = updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme);
34671
35113
  }
34672
35114
  if (isMerge) {
34673
35115
  const rangeHeight = table.getRowHeight(row);
@@ -34680,14 +35122,14 @@
34680
35122
  }
34681
35123
  return newCellGroup;
34682
35124
  }
34683
- function updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult) {
35125
+ function updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme) {
34684
35126
  if (isPromise(value)) {
34685
35127
  value = table.getCellValue(col, row);
34686
35128
  }
34687
35129
  if (!addNew && (oldCellGroup.row !== row || oldCellGroup.col !== col)) {
34688
35130
  return null;
34689
35131
  }
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);
35132
+ 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
35133
  if (!addNew && oldCellGroup.parent) {
34692
35134
  oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
34693
35135
  oldCellGroup.parent.removeChild(oldCellGroup);
@@ -34729,17 +35171,18 @@
34729
35171
  }
34730
35172
  for (let j = rowStart; j <= rowEnd; j++) {
34731
35173
  const row = j;
35174
+ const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);
35175
+ const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;
34732
35176
  let value = table.getCellValue(col, row);
34733
35177
  let cellWidth = colWidth;
34734
35178
  let cellHeight = table.getRowHeight(row);
34735
35179
  let range;
34736
35180
  let isMerge;
34737
35181
  let customStyle;
34738
- let customResult;
34739
35182
  if (table.internalProps.customMergeCell) {
34740
35183
  const customMerge = table.getCustomMerge(col, row);
34741
35184
  if (customMerge) {
34742
- const { range: customMergeRange, text: customMergeText, style: customMergeStyle, customLayout, customRender } = customMerge;
35185
+ const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;
34743
35186
  range = customMergeRange;
34744
35187
  isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
34745
35188
  if (isMerge) {
@@ -34749,21 +35192,8 @@
34749
35192
  }
34750
35193
  value = customMergeText;
34751
35194
  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
35195
  }
34756
35196
  }
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
35197
  if (!range && (cellLocation !== 'body' || define?.mergeCell)) {
34768
35198
  range = table.getCellRange(col, row);
34769
35199
  isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
@@ -34793,14 +35223,14 @@
34793
35223
  const type = (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||
34794
35224
  'text';
34795
35225
  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));
35226
+ dealPromiseData(value, table, createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme));
34797
35227
  columnGroup.updateColumnRowNumber(row);
34798
35228
  const height = table.getRowHeight(row);
34799
35229
  columnGroup.updateColumnHeight(height);
34800
35230
  y += height;
34801
35231
  }
34802
35232
  else {
34803
- const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult);
35233
+ const cellGroup = createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme);
34804
35234
  columnGroup.updateColumnRowNumber(row);
34805
35235
  if (isMerge) {
34806
35236
  const rangeHeight = table.getRowHeight(row);
@@ -34895,385 +35325,6 @@
34895
35325
  };
34896
35326
  }
34897
35327
 
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
35328
  function isMergeCellGroup(cellGroup) {
35278
35329
  if (cellGroup.role === 'cell' &&
35279
35330
  isNumber$3(cellGroup.mergeStartCol) &&
@@ -36833,33 +36884,31 @@
36833
36884
  let customElementsGroup;
36834
36885
  customContainer.removeAllChild();
36835
36886
  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
- }
36887
+ let customRender;
36888
+ let customLayout;
36889
+ const cellLocation = scene.table.getCellLocation(col, row);
36890
+ if (cellLocation !== 'body') {
36891
+ const define = scene.table.getHeaderDefine(col, row);
36892
+ customRender = define?.headerCustomRender;
36893
+ customLayout = define?.headerCustomLayout;
36894
+ }
36895
+ else {
36896
+ const define = scene.table.getBodyColumnDefine(col, row);
36897
+ customRender = define?.customRender || scene.table.customRender;
36898
+ customLayout = define?.customLayout;
36899
+ }
36900
+ if (customLayout || customRender) {
36901
+ const style = scene.table._getCellStyle(col, row);
36902
+ const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
36903
+ const customResult = dealWithCustom(customLayout, customRender, col, row, cell.attribute.width, cell.attribute.height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
36904
+ customElementsGroup = customResult.elementsGroup;
36905
+ renderDefault = customResult.renderDefault;
36906
+ }
36907
+ if (cell.childrenCount > 0) {
36908
+ cell.insertBefore(customElementsGroup, cell.firstChild);
36909
+ }
36910
+ else {
36911
+ cell.appendChild(customElementsGroup);
36863
36912
  }
36864
36913
  }
36865
36914
  if (renderDefault) {
@@ -37108,34 +37157,32 @@
37108
37157
  let customElementsGroup;
37109
37158
  customContainer.removeAllChild();
37110
37159
  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
- }
37160
+ let customRender;
37161
+ let customLayout;
37162
+ const cellType = scene.table.getCellLocation(col, row);
37163
+ if (cellType !== 'body') {
37164
+ const define = scene.table.getHeaderDefine(col, row);
37165
+ customRender = define?.headerCustomRender;
37166
+ customLayout = define?.headerCustomLayout;
37167
+ }
37168
+ else {
37169
+ const define = scene.table.getBodyColumnDefine(col, row);
37170
+ customRender = define?.customRender || scene.table.customRender;
37171
+ customLayout = define?.customLayout;
37172
+ }
37173
+ if (customLayout || customRender) {
37174
+ const style = scene.table._getCellStyle(col, row);
37175
+ const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
37176
+ const customResult = dealWithCustom(customLayout, customRender, col, row, cellGroup.attribute.width, cellGroup.attribute.height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
37177
+ customElementsGroup = customResult.elementsGroup;
37178
+ renderDefault = customResult.renderDefault;
37179
+ isHeightChange = true;
37180
+ }
37181
+ if (cell.childrenCount > 0) {
37182
+ cell.insertBefore(customElementsGroup, cell.firstChild);
37183
+ }
37184
+ else {
37185
+ cell.appendChild(customElementsGroup);
37139
37186
  }
37140
37187
  }
37141
37188
  if (renderDefault) {
@@ -37488,7 +37535,7 @@
37488
37535
  }
37489
37536
  };
37490
37537
 
37491
- const regedIcons = get$1();
37538
+ const regedIcons = get$2();
37492
37539
  class DrillIcon {
37493
37540
  icon;
37494
37541
  constructor() {
@@ -39308,9 +39355,10 @@
39308
39355
  for (let col = 0; col < table.colCount; col++) {
39309
39356
  const newColWidth = newWidths[col] ?? table.getColWidth(col);
39310
39357
  if (newColWidth !== oldColWidths[col]) {
39311
- table._setColWidth(col, newColWidth);
39358
+ table._setColWidth(col, newColWidth, false, true);
39312
39359
  }
39313
39360
  }
39361
+ table.stateManager.checkFrozen();
39314
39362
  for (let col = 0; col < table.colCount; col++) {
39315
39363
  const newColWidth = table.getColWidth(col);
39316
39364
  if (newColWidth !== oldColWidths[col]) {
@@ -41337,6 +41385,10 @@
41337
41385
  });
41338
41386
  if (removeRows.length) {
41339
41387
  resetRowNumber(scene);
41388
+ const beforeRow = removeRows[removeRows.length - 1] - 1;
41389
+ const afterRow = removeRows[0] - removeRows.length + 1;
41390
+ const rowUpdatePos = updateMergeCellGroup(beforeRow, afterRow, scene);
41391
+ isNumber$3(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
41340
41392
  }
41341
41393
  scene.table._clearRowRangeHeightsMap();
41342
41394
  let updateAfter;
@@ -41346,6 +41398,12 @@
41346
41398
  rowHeightsMap.addAndReorder(row);
41347
41399
  });
41348
41400
  resetRowNumberAndY(scene);
41401
+ if (addRows.length) {
41402
+ const beforeRow = addRows[0] - 1;
41403
+ const afterRow = addRows[addRows.length - 1] + 1;
41404
+ const rowUpdatePos = updateMergeCellGroup(beforeRow, afterRow, scene);
41405
+ isNumber$3(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
41406
+ }
41349
41407
  for (let col = 0; col < table.colCount; col++) {
41350
41408
  updateRows.forEach(r => {
41351
41409
  const mergeInfo = getCellMergeInfo(scene.table, col, r);
@@ -41361,6 +41419,12 @@
41361
41419
  }
41362
41420
  });
41363
41421
  }
41422
+ if (updateRows.length) {
41423
+ const beforeRow = updateRows[0] - 1;
41424
+ const afterRow = updateRows[updateRows.length - 1] + 1;
41425
+ const rowUpdatePos = updateMergeCellGroup(beforeRow, afterRow, scene);
41426
+ isNumber$3(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
41427
+ }
41364
41428
  if (isNumber$3(updateAfter)) {
41365
41429
  for (let col = 0; col < table.colCount; col++) {
41366
41430
  for (let row = updateAfter; row < table.rowCount; row++) {
@@ -41368,7 +41432,7 @@
41368
41432
  cellGroup && (cellGroup.needUpdate = true);
41369
41433
  }
41370
41434
  }
41371
- scene.proxy.rowUpdatePos = updateAfter;
41435
+ scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, updateAfter);
41372
41436
  }
41373
41437
  if (addRows.length) {
41374
41438
  if (!isNumber$3(updateAfter)) {
@@ -41378,13 +41442,13 @@
41378
41442
  scene.proxy.rowUpdateDirection = 'up';
41379
41443
  scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
41380
41444
  updateBottomFrozeCellGroups();
41381
- scene.proxy.progress();
41382
41445
  }
41383
41446
  else if (removeRows.length) {
41384
41447
  scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
41385
41448
  updateBottomFrozeCellGroups();
41386
41449
  scene.proxy.progress();
41387
41450
  }
41451
+ scene.proxy.progress();
41388
41452
  const newTotalHeight = table.getRowsHeight(table.frozenRowCount, table.rowCount - 1 - table.bottomFrozenRowCount);
41389
41453
  scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
41390
41454
  function updateBottomFrozeCellGroups() {
@@ -41639,6 +41703,34 @@
41639
41703
  }
41640
41704
  }
41641
41705
  }
41706
+ function updateMergeCellGroup(beforeRow, afterRow, scene) {
41707
+ let updateRow;
41708
+ for (let col = 0; col < scene.table.colCount; col++) {
41709
+ const rangeBefore = scene.table.getCellRange(col, beforeRow);
41710
+ if (rangeBefore.start.row <= beforeRow + 1 && rangeBefore.end.row >= beforeRow + 1) {
41711
+ updateCellGroup(rangeBefore, scene);
41712
+ updateRow = rangeBefore.start.row;
41713
+ }
41714
+ const rangeAfter = scene.table.getCellRange(col, afterRow);
41715
+ if (rangeAfter.start.row <= afterRow - 1 && rangeAfter.end.row >= afterRow - 1) {
41716
+ updateCellGroup(rangeAfter, scene);
41717
+ updateRow = rangeBefore.start.row;
41718
+ }
41719
+ }
41720
+ return updateRow;
41721
+ }
41722
+ function updateCellGroup(range, scene) {
41723
+ const { start, end } = range;
41724
+ for (let col = start.col; col <= end.col; col++) {
41725
+ for (let row = start.row; row <= end.row; row++) {
41726
+ const cellGroup = scene.highPerformanceGetCell(col, row, true);
41727
+ if (!cellGroup) {
41728
+ continue;
41729
+ }
41730
+ cellGroup.needUpdate = true;
41731
+ }
41732
+ }
41733
+ }
41642
41734
 
41643
41735
  function handleTextStick(table) {
41644
41736
  const { changedCells } = table.internalProps.stick;
@@ -41651,7 +41743,7 @@
41651
41743
  });
41652
41744
  });
41653
41745
  });
41654
- changedCells.length = 0;
41746
+ changedCells.clear();
41655
41747
  const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;
41656
41748
  const frozenRowsHeight = table.getFrozenRowsHeight();
41657
41749
  const frozenColsWidth = table.getFrozenColsWidth();
@@ -41731,33 +41823,45 @@
41731
41823
  }
41732
41824
  }
41733
41825
  function dealVertical(cellGroup, minTop, maxTop, changedCells) {
41734
- const text = cellGroup.getChildByName('text', true);
41735
- if (!text) {
41826
+ const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
41827
+ if (!graphic) {
41736
41828
  return;
41737
41829
  }
41738
- text.AABBBounds.width();
41739
- const textTop = text.globalAABBBounds.y1;
41740
- const textBottom = text.globalAABBBounds.y2;
41830
+ if (graphic.type === 'image') {
41831
+ const { image: url } = graphic.attribute;
41832
+ if (!url || !graphic.resources) {
41833
+ return;
41834
+ }
41835
+ const res = graphic.resources.get(url);
41836
+ if (res.state !== 'success') {
41837
+ return;
41838
+ }
41839
+ }
41840
+ graphic.AABBBounds.width();
41841
+ const textTop = graphic.globalAABBBounds.y1;
41842
+ const textBottom = graphic.globalAABBBounds.y2;
41741
41843
  if (textTop < minTop) {
41742
41844
  const deltaHeight = textTop - minTop;
41743
- changedCells.push({
41744
- col: cellGroup.col,
41745
- row: cellGroup.row,
41746
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
41747
- dy: cellGroup.firstChild?.attribute.dy ?? 0
41748
- });
41845
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
41846
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
41847
+ col: cellGroup.col,
41848
+ row: cellGroup.row,
41849
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
41850
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
41851
+ });
41749
41852
  cellGroup.forEachChildren((child) => {
41750
41853
  child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight + 2);
41751
41854
  });
41752
41855
  }
41753
41856
  else if (textBottom > maxTop) {
41754
41857
  const deltaHeight = textBottom - maxTop;
41755
- changedCells.push({
41756
- col: cellGroup.col,
41757
- row: cellGroup.row,
41758
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
41759
- dy: cellGroup.firstChild?.attribute.dy ?? 0
41760
- });
41858
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
41859
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
41860
+ col: cellGroup.col,
41861
+ row: cellGroup.row,
41862
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
41863
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
41864
+ });
41761
41865
  cellGroup.forEachChildren((child) => {
41762
41866
  child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight);
41763
41867
  });
@@ -41789,24 +41893,26 @@
41789
41893
  const textRight = text.globalAABBBounds.x2;
41790
41894
  if (textLeft < minLeft) {
41791
41895
  const deltaWidth = textLeft - minLeft;
41792
- changedCells.push({
41793
- col: cellGroup.col,
41794
- row: cellGroup.row,
41795
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
41796
- dy: cellGroup.firstChild?.attribute.dy ?? 0
41797
- });
41896
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
41897
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
41898
+ col: cellGroup.col,
41899
+ row: cellGroup.row,
41900
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
41901
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
41902
+ });
41798
41903
  cellGroup.forEachChildren((child) => {
41799
41904
  child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth + 2);
41800
41905
  });
41801
41906
  }
41802
41907
  else if (textRight > maxLeft) {
41803
41908
  const deltaWidth = textRight - maxLeft;
41804
- changedCells.push({
41805
- col: cellGroup.col,
41806
- row: cellGroup.row,
41807
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
41808
- dy: cellGroup.firstChild?.attribute.dy ?? 0
41809
- });
41909
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
41910
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
41911
+ col: cellGroup.col,
41912
+ row: cellGroup.row,
41913
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
41914
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
41915
+ });
41810
41916
  cellGroup.forEachChildren((child) => {
41811
41917
  child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth);
41812
41918
  });
@@ -42162,6 +42268,22 @@
42162
42268
  });
42163
42269
  });
42164
42270
  }
42271
+ if (!scenegraph.table.isPivotChart() && scenegraph.table.rightFrozenColCount >= 1) {
42272
+ for (let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount; c <= scenegraph.table.colCount - 1; c++) {
42273
+ const columnGroup = scenegraph.getColGroup(c);
42274
+ columnGroup?.getChildren()?.forEach((cellNode) => {
42275
+ const width = scenegraph.table.getColWidth(cellNode.col);
42276
+ const height = scenegraph.table.getRowHeight(cellNode.row);
42277
+ cellNode.children.forEach((node) => {
42278
+ if (node.type === 'chart') {
42279
+ node.cacheCanvas = null;
42280
+ node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));
42281
+ node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));
42282
+ }
42283
+ });
42284
+ });
42285
+ }
42286
+ }
42165
42287
  }
42166
42288
  function clearChartCacheImage(scenegraph) {
42167
42289
  for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
@@ -42341,7 +42463,7 @@
42341
42463
  fontFamily: DefaultTextStyle.fontFamily,
42342
42464
  fontSize: DefaultTextStyle.fontSize
42343
42465
  },
42344
- getTextBounds: useNaiveCanvas ? undefined : getTextBounds$1,
42466
+ getTextBounds: useNaiveCanvas ? undefined : getTextBounds,
42345
42467
  specialCharSet: `{}()//&-/: .,@%'"~…${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789`,
42346
42468
  ...(option ?? {})
42347
42469
  }, textSpec);
@@ -43080,6 +43202,7 @@
43080
43202
  }
43081
43203
  }
43082
43204
 
43205
+ registerForVrender();
43083
43206
  loadPoptip();
43084
43207
  container.load(splitModule);
43085
43208
  container.load(textMeasureModule);
@@ -44558,10 +44681,8 @@
44558
44681
  });
44559
44682
  }
44560
44683
  else if (col >= 0 && row >= 0) {
44561
- state.select.ranges.push({
44562
- start: { col, row },
44563
- end: { col, row }
44564
- });
44684
+ const cellRange = table.getCellRange(col, row);
44685
+ state.select.ranges.push(cellRange);
44565
44686
  }
44566
44687
  cellPos.col = col;
44567
44688
  cellPos.row = row;
@@ -45496,7 +45617,7 @@
45496
45617
  const totalHeight = this.table.getAllRowsHeight();
45497
45618
  top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height));
45498
45619
  top = Math.ceil(top);
45499
- if (top !== this.scroll.verticalBarPos) {
45620
+ if (top !== this.scroll.verticalBarPos || this.table.isPivotChart()) {
45500
45621
  this.table.stateManager.updateHoverPos(-1, -1);
45501
45622
  }
45502
45623
  this.scroll.verticalBarPos = top;
@@ -45962,6 +46083,10 @@
45962
46083
  window.open(url);
45963
46084
  }
45964
46085
  else if (cellType === 'image') {
46086
+ const { clickToPreview } = columnDefine;
46087
+ if (clickToPreview === false) {
46088
+ return;
46089
+ }
45965
46090
  const overlay = document.createElement('div');
45966
46091
  overlay.style.width = '100%';
45967
46092
  overlay.style.height = '100%';
@@ -45987,6 +46112,10 @@
45987
46112
  document.body.appendChild(overlay);
45988
46113
  }
45989
46114
  else if (cellType === 'video') {
46115
+ const { clickToPreview } = columnDefine;
46116
+ if (clickToPreview === false) {
46117
+ return;
46118
+ }
45990
46119
  const overlay = document.createElement('div');
45991
46120
  overlay.style.width = '100%';
45992
46121
  overlay.style.height = '100%';
@@ -47364,9 +47493,7 @@
47364
47493
  const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgsSet.eventArgs?.targetCell);
47365
47494
  if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
47366
47495
  this.table.scenegraph.updateAutoColWidth(resizeCol.col);
47367
- if (this.table.isPivotChart()) {
47368
- this.table.scenegraph.updateChartSize(resizeCol.col);
47369
- }
47496
+ this.table.scenegraph.updateChartSize(resizeCol.col);
47370
47497
  const state = this.table.stateManager;
47371
47498
  if (state.columnResize.col < state.table.frozenColCount &&
47372
47499
  !state.table.isPivotTable() &&
@@ -47726,7 +47853,7 @@
47726
47853
  _table;
47727
47854
  constructor(_table) {
47728
47855
  this._table = _table;
47729
- const regedIcons = get$1();
47856
+ const regedIcons = get$2();
47730
47857
  this.expandIcon = regedIcons[InternalIconName.expandIconName];
47731
47858
  this.collapseIcon = regedIcons[InternalIconName.collapseIconName];
47732
47859
  }
@@ -47748,7 +47875,7 @@
47748
47875
  else {
47749
47876
  iconResults = iconDefine;
47750
47877
  }
47751
- const regedIcons = get$1();
47878
+ const regedIcons = get$2();
47752
47879
  const addIcon = (columnIcon) => {
47753
47880
  let icon;
47754
47881
  if (typeof columnIcon === 'string') {
@@ -48493,7 +48620,7 @@
48493
48620
  _table;
48494
48621
  constructor(_table) {
48495
48622
  this._table = _table;
48496
- const regedIcons = get$1();
48623
+ const regedIcons = get$2();
48497
48624
  this.freezeIcon = regedIcons[InternalIconName.freezeIconName];
48498
48625
  this.frozenIcon = regedIcons[InternalIconName.frozenIconName];
48499
48626
  this.frozenCurrentIcon = regedIcons[InternalIconName.frozenCurrentIconName];
@@ -48578,7 +48705,7 @@
48578
48705
  else {
48579
48706
  headerIconStrs = headerIcon;
48580
48707
  }
48581
- const regedIcons = get$1();
48708
+ const regedIcons = get$2();
48582
48709
  const addIcon = (headerIcon) => {
48583
48710
  let icon;
48584
48711
  if (typeof headerIcon === 'string') {
@@ -50372,7 +50499,7 @@
50372
50499
  return TABLE_EVENT_TYPE;
50373
50500
  }
50374
50501
  options;
50375
- version = "0.17.10-alpha.7";
50502
+ version = "0.17.11-alpha.4";
50376
50503
  pagination;
50377
50504
  id = `VTable${Date.now()}`;
50378
50505
  headerStyleCache;
@@ -50474,7 +50601,7 @@
50474
50601
  internalProps.bodyHelper = new BodyHelper(this);
50475
50602
  internalProps.headerHelper = new HeaderHelper(this);
50476
50603
  internalProps.autoWrapText = options.autoWrapText;
50477
- internalProps.allowFrozenColCount = options.allowFrozenColCount ?? internalProps.colCount;
50604
+ internalProps.allowFrozenColCount = options.allowFrozenColCount ?? 0;
50478
50605
  internalProps.limitMaxAutoWidth = options.limitMaxAutoWidth ?? 450;
50479
50606
  internalProps.limitMinWidth =
50480
50607
  limitMinWidth !== null && limitMinWidth !== undefined
@@ -50516,7 +50643,7 @@
50516
50643
  this.headerStyleCache = new Map();
50517
50644
  this.bodyStyleCache = new Map();
50518
50645
  this.bodyBottomStyleCache = new Map();
50519
- internalProps.stick = { changedCells: [] };
50646
+ internalProps.stick = { changedCells: new Map() };
50520
50647
  internalProps.customMergeCell = options.customMergeCell;
50521
50648
  }
50522
50649
  throttleInvalidate = throttle2(this.render.bind(this), 200);
@@ -51475,10 +51602,11 @@
51475
51602
  this.colWidthsMap = new NumberMap();
51476
51603
  this.colContentWidthsMap = new NumberMap();
51477
51604
  this.colWidthsLimit = {};
51605
+ internalProps.stick.changedCells.clear();
51478
51606
  internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
51479
51607
  this.scenegraph.updateStageBackground();
51480
51608
  internalProps.autoWrapText = options.autoWrapText;
51481
- internalProps.allowFrozenColCount = options.allowFrozenColCount ?? internalProps.colCount;
51609
+ internalProps.allowFrozenColCount = options.allowFrozenColCount ?? 0;
51482
51610
  internalProps.limitMaxAutoWidth = options.limitMaxAutoWidth ?? 450;
51483
51611
  internalProps.limitMinWidth =
51484
51612
  limitMinWidth !== null && limitMinWidth !== undefined
@@ -51894,7 +52022,7 @@
51894
52022
  getCustomMerge(col, row) {
51895
52023
  if (this.internalProps.customMergeCell) {
51896
52024
  const customMerge = this.internalProps.customMergeCell(col, row, this);
51897
- if (customMerge && customMerge.range && (customMerge.text || customMerge.customLayout || this.customRender)) {
52025
+ if (customMerge && customMerge.range && customMerge.text) {
51898
52026
  if (customMerge.style) {
51899
52027
  const styleClass = this.internalProps.bodyHelper.getStyleClass('text');
51900
52028
  const style = customMerge.style;
@@ -53020,6 +53148,17 @@
53020
53148
  axisOption
53021
53149
  };
53022
53150
  }
53151
+ function checkHasChart(layout) {
53152
+ let isHasChart = false;
53153
+ for (let i = 0; i < layout.columnObjects.length; i++) {
53154
+ const columnObj = layout.columnObjects[i];
53155
+ if (columnObj.chartSpec) {
53156
+ isHasChart = true;
53157
+ break;
53158
+ }
53159
+ }
53160
+ return isHasChart;
53161
+ }
53023
53162
 
53024
53163
  class SimpleHeaderLayoutMap {
53025
53164
  seqId = 0;
@@ -53781,6 +53920,9 @@
53781
53920
  const columnObj = this.transpose ? this._columns[_row] : this._columns[_col];
53782
53921
  return columnObj.chartInstance;
53783
53922
  }
53923
+ checkHasChart() {
53924
+ return checkHasChart(this);
53925
+ }
53784
53926
  getAxisConfigInPivotChart(col, row) {
53785
53927
  return undefined;
53786
53928
  }
@@ -54492,13 +54634,36 @@
54492
54634
  }
54493
54635
  }
54494
54636
  _refreshHierarchyState(col, row) {
54637
+ let notFillWidth = false;
54638
+ let notFillHeight = false;
54639
+ const checkHasChart = this.internalProps.layoutMap.checkHasChart();
54640
+ if (checkHasChart) {
54641
+ if (this.autoFillWidth) {
54642
+ notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
54643
+ }
54644
+ if (this.autoFillHeight) {
54645
+ notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
54646
+ }
54647
+ }
54495
54648
  const index = this.getRecordShowIndexByCell(col, row);
54496
54649
  const diffDataIndices = this.dataSource.toggleHierarchyState(index);
54497
54650
  const diffPositions = this.internalProps.layoutMap.toggleHierarchyState(diffDataIndices);
54498
54651
  this.refreshRowColCount();
54499
54652
  this.clearCellStyleCache();
54653
+ this.internalProps.layoutMap.clearCellRangeMap();
54500
54654
  this.scenegraph.updateHierarchyIcon(col, row);
54501
54655
  this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions);
54656
+ if (checkHasChart) {
54657
+ if (this.autoFillWidth && !notFillWidth) {
54658
+ notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
54659
+ }
54660
+ if (this.autoFillHeight && !notFillHeight) {
54661
+ notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
54662
+ }
54663
+ if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
54664
+ this.scenegraph.updateChartSize(0);
54665
+ }
54666
+ }
54502
54667
  }
54503
54668
  _hasHierarchyTreeHeader() {
54504
54669
  return (this.options.columns ?? this.options.header)?.some((column, i) => column.tree);
@@ -54759,8 +54924,8 @@
54759
54924
  this.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, this);
54760
54925
  }
54761
54926
  this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
54762
- col: startCol,
54763
- row: startRow,
54927
+ col: startCol + j,
54928
+ row: startRow + i,
54764
54929
  rawValue: beforeChangeValue,
54765
54930
  changedValue: this.getCellOriginValue(startCol + j, startRow + i)
54766
54931
  });
@@ -55707,7 +55872,7 @@
55707
55872
  if (indicatorObject?.style?.padding) {
55708
55873
  this._chartPadding = indicatorObject.style.padding;
55709
55874
  }
55710
- if (indicatorObject.chartSpec?.barWidth) {
55875
+ if (indicatorObject.chartSpec?.barWidth && typeof indicatorObject.chartSpec.barWidth === 'number') {
55711
55876
  this._chartItemSpanSize = indicatorObject.chartSpec?.barWidth;
55712
55877
  }
55713
55878
  const bandAxisConfig = indicatorObject.chartSpec?.axes?.find((axis) => {
@@ -55724,7 +55889,7 @@
55724
55889
  return true;
55725
55890
  }
55726
55891
  indicatorObject.chartSpec.series?.find((seriesObject) => {
55727
- if (seriesObject.barWidth) {
55892
+ if (seriesObject.barWidth && typeof seriesObject.barWidth === 'number') {
55728
55893
  this._chartItemSpanSize = seriesObject.barWidth;
55729
55894
  }
55730
55895
  if (this._chartItemSpanSize > 0) {
@@ -57117,6 +57282,9 @@
57117
57282
  }
57118
57283
  return indicatorObj?.chartInstance;
57119
57284
  }
57285
+ checkHasChart() {
57286
+ return checkHasChart(this);
57287
+ }
57120
57288
  getDimension(dimensionKey, type) {
57121
57289
  if (type === 'column') {
57122
57290
  return this.columnsDefine?.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === dimensionKey);
@@ -59689,6 +59857,17 @@
59689
59857
  return false;
59690
59858
  }
59691
59859
  toggleHierarchyState(col, row) {
59860
+ let notFillWidth = false;
59861
+ let notFillHeight = false;
59862
+ const checkHasChart = this.internalProps.layoutMap.checkHasChart();
59863
+ if (checkHasChart) {
59864
+ if (this.autoFillWidth) {
59865
+ notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
59866
+ }
59867
+ if (this.autoFillHeight) {
59868
+ notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
59869
+ }
59870
+ }
59692
59871
  const hierarchyState = this.getHierarchyState(col, row);
59693
59872
  if (hierarchyState === HierarchyState.expand) {
59694
59873
  this.fireListeners(PIVOT_TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
@@ -59710,6 +59889,17 @@
59710
59889
  this.clearCellStyleCache();
59711
59890
  this.scenegraph.updateHierarchyIcon(col, row);
59712
59891
  this.scenegraph.updateRow(result.removeCellPositions, result.addCellPositions, result.updateCellPositions);
59892
+ if (checkHasChart) {
59893
+ if (this.autoFillWidth && !notFillWidth) {
59894
+ notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
59895
+ }
59896
+ if (this.autoFillHeight && !notFillHeight) {
59897
+ notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
59898
+ }
59899
+ if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
59900
+ this.scenegraph.updateChartSize(0);
59901
+ }
59902
+ }
59713
59903
  }
59714
59904
  getHeaderCellAddressByPath(dimensionPaths) {
59715
59905
  const cellAddress = this.internalProps.layoutMap.getPivotCellAdress(dimensionPaths);
@@ -59875,8 +60065,8 @@
59875
60065
  }
59876
60066
  this._changeCellValueToDataSet(startCol + j, startRow + i, newValue);
59877
60067
  this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
59878
- col: startCol,
59879
- row: startRow,
60068
+ col: startCol + j,
60069
+ row: startRow + i,
59880
60070
  rawValue,
59881
60071
  changedValue: this.getCellOriginValue(startCol + j, startRow + i)
59882
60072
  });
@@ -60921,7 +61111,7 @@
60921
61111
  constructor(options) {
60922
61112
  let cache;
60923
61113
  if (isString$2(options.iconName)) {
60924
- const regedIcons = get$1();
61114
+ const regedIcons = get$2();
60925
61115
  cache = regedIcons[options.iconName];
60926
61116
  if (cache) {
60927
61117
  options.width = options.width ?? cache.width;
@@ -61345,9 +61535,10 @@
61345
61535
  return new Tag$1(params ? params.attribute : {});
61346
61536
  }
61347
61537
 
61348
- const version = "0.17.10-alpha.7";
61538
+ registerForVrender();
61539
+ const version = "0.17.11-alpha.4";
61349
61540
  function getIcons() {
61350
- return get$1();
61541
+ return get$2();
61351
61542
  }
61352
61543
  function clearGlobal() {
61353
61544
  clearAll();