@visactor/vtable 1.17.0-alpha.4 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/cjs/ListTable-all.js +3 -2
  2. package/cjs/ListTable-all.js.map +1 -1
  3. package/cjs/ListTable.d.ts +4 -0
  4. package/cjs/ListTable.js +13 -1
  5. package/cjs/ListTable.js.map +1 -1
  6. package/cjs/PivotChart.d.ts +2 -0
  7. package/cjs/PivotChart.js +90 -31
  8. package/cjs/PivotChart.js.map +1 -1
  9. package/cjs/PivotTable.d.ts +1 -0
  10. package/cjs/PivotTable.js +29 -26
  11. package/cjs/PivotTable.js.map +1 -1
  12. package/cjs/body-helper/body-helper.d.ts +3 -1
  13. package/cjs/body-helper/body-helper.js +7 -1
  14. package/cjs/body-helper/body-helper.js.map +1 -1
  15. package/cjs/body-helper/style/ButtonStyle.d.ts +45 -0
  16. package/cjs/body-helper/style/ButtonStyle.js +110 -0
  17. package/cjs/body-helper/style/ButtonStyle.js.map +1 -0
  18. package/cjs/body-helper/style/SwitchStyle.d.ts +36 -0
  19. package/cjs/body-helper/style/SwitchStyle.js +90 -0
  20. package/cjs/body-helper/style/SwitchStyle.js.map +1 -0
  21. package/cjs/body-helper/style.js +5 -4
  22. package/cjs/body-helper/style.js.map +1 -1
  23. package/cjs/components/axis/axis.d.ts +1 -1
  24. package/cjs/components/axis/axis.js +3 -3
  25. package/cjs/components/axis/axis.js.map +1 -1
  26. package/cjs/components/axis/get-axis-component-size.js.map +1 -1
  27. package/cjs/components/axis/label-overlap.d.ts +1 -1
  28. package/cjs/components/axis/label-overlap.js.map +1 -1
  29. package/cjs/components/legend/continue-legend/continue-legend.d.ts +1 -1
  30. package/cjs/components/legend/continue-legend/continue-legend.js +3 -3
  31. package/cjs/components/legend/continue-legend/continue-legend.js.map +1 -1
  32. package/cjs/components/legend/discrete-legend/discrete-legend.d.ts +2 -2
  33. package/cjs/components/legend/discrete-legend/discrete-legend.js +5 -5
  34. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  35. package/cjs/components/menu/dom/MenuHandler.js +10 -3
  36. package/cjs/components/menu/dom/MenuHandler.js.map +1 -1
  37. package/cjs/components/title/title.d.ts +2 -2
  38. package/cjs/components/title/title.js +2 -2
  39. package/cjs/components/title/title.js.map +1 -1
  40. package/cjs/core/BaseTable.d.ts +5 -1
  41. package/cjs/core/BaseTable.js +30 -27
  42. package/cjs/core/BaseTable.js.map +1 -1
  43. package/cjs/core/FouseInput.js +1 -2
  44. package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
  45. package/cjs/core/TABLE_EVENT_TYPE.js +3 -1
  46. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  47. package/cjs/core/utils/get-cell-position.js +2 -2
  48. package/cjs/core/utils/get-cell-position.js.map +1 -1
  49. package/cjs/dataset/dataset-pivot-table.js +2 -1
  50. package/cjs/edit/edit-manager.d.ts +6 -4
  51. package/cjs/edit/edit-manager.js +16 -13
  52. package/cjs/edit/edit-manager.js.map +1 -1
  53. package/cjs/event/component/button.d.ts +2 -0
  54. package/cjs/event/component/button.js +21 -0
  55. package/cjs/event/component/button.js.map +1 -0
  56. package/cjs/event/event.js +6 -6
  57. package/cjs/event/event.js.map +1 -1
  58. package/cjs/event/listener/container-dom.js +1 -1
  59. package/cjs/event/listener/container-dom.js.map +1 -1
  60. package/cjs/event/listener/table-group.js +20 -0
  61. package/cjs/event/listener/table-group.js.map +1 -1
  62. package/cjs/header-helper/header-helper.js +30 -8
  63. package/cjs/header-helper/header-helper.js.map +1 -1
  64. package/cjs/index.d.ts +1 -1
  65. package/cjs/index.js +1 -1
  66. package/cjs/index.js.map +1 -1
  67. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  68. package/cjs/render/jsx/index.d.ts +1 -1
  69. package/cjs/render/jsx/index.js +4 -4
  70. package/cjs/render/jsx/index.js.map +1 -1
  71. package/cjs/render/layout/index.d.ts +1 -1
  72. package/cjs/render/layout/index.js +3 -3
  73. package/cjs/render/layout/index.js.map +1 -1
  74. package/cjs/render/layout/tag.d.ts +2 -2
  75. package/cjs/render/layout/tag.js +2 -2
  76. package/cjs/render/layout/tag.js.map +1 -1
  77. package/cjs/render/layout/text.js.map +1 -1
  78. package/cjs/scenegraph/component/cell-content.d.ts +4 -4
  79. package/cjs/scenegraph/component/cell-content.js +1 -1
  80. package/cjs/scenegraph/component/cell-content.js.map +1 -1
  81. package/cjs/scenegraph/component/menu.js +6 -1
  82. package/cjs/scenegraph/component/menu.js.map +1 -1
  83. package/cjs/scenegraph/component/table-component.d.ts +1 -1
  84. package/cjs/scenegraph/component/table-component.js +3 -3
  85. package/cjs/scenegraph/component/table-component.js.map +1 -1
  86. package/cjs/scenegraph/graphic/chart.d.ts +2 -0
  87. package/cjs/scenegraph/graphic/chart.js +4 -4
  88. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  89. package/cjs/scenegraph/graphic/contributions/chart-render-helper.d.ts +2 -0
  90. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +11 -9
  91. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  92. package/cjs/scenegraph/graphic/contributions/chart-render.js +2 -2
  93. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  94. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
  95. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  96. package/cjs/scenegraph/graphic/icon.d.ts +8 -2
  97. package/cjs/scenegraph/graphic/icon.js +13 -1
  98. package/cjs/scenegraph/graphic/icon.js.map +1 -1
  99. package/cjs/scenegraph/group-creater/cell-helper.js +4 -0
  100. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  101. package/cjs/scenegraph/group-creater/cell-type/button-cell.d.ts +6 -0
  102. package/cjs/scenegraph/group-creater/cell-type/button-cell.js +144 -0
  103. package/cjs/scenegraph/group-creater/cell-type/button-cell.js.map +1 -0
  104. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -2
  105. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  106. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  107. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  108. package/cjs/scenegraph/group-creater/cell-type/index.d.ts +2 -0
  109. package/cjs/scenegraph/group-creater/cell-type/index.js +14 -2
  110. package/cjs/scenegraph/group-creater/cell-type/index.js.map +1 -1
  111. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  112. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  113. package/cjs/scenegraph/group-creater/cell-type/switch-cell.d.ts +6 -0
  114. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js +152 -0
  115. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -0
  116. package/cjs/scenegraph/layout/compute-col-width.js +23 -7
  117. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  118. package/cjs/scenegraph/layout/compute-row-height.js +4 -2
  119. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  120. package/cjs/scenegraph/layout/height-util.d.ts +2 -0
  121. package/cjs/scenegraph/layout/height-util.js +40 -3
  122. package/cjs/scenegraph/layout/height-util.js.map +1 -1
  123. package/cjs/scenegraph/scenegraph.d.ts +1 -1
  124. package/cjs/scenegraph/scenegraph.js +8 -7
  125. package/cjs/scenegraph/scenegraph.js.map +1 -1
  126. package/cjs/scenegraph/utils/cell-border-stroke-width.d.ts +1 -1
  127. package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  128. package/cjs/scenegraph/utils/text-icon-layout.d.ts +2 -2
  129. package/cjs/scenegraph/utils/text-icon-layout.js +7 -6
  130. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  131. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  132. package/cjs/state/radio/radio.js +1 -1
  133. package/cjs/state/radio/radio.js.map +1 -1
  134. package/cjs/state/select/custom-select.js +2 -2
  135. package/cjs/state/select/custom-select.js.map +1 -1
  136. package/cjs/state/state.js +6 -2
  137. package/cjs/state/state.js.map +1 -1
  138. package/cjs/themes/theme.d.ts +4 -0
  139. package/cjs/themes/theme.js +19 -2
  140. package/cjs/themes/theme.js.map +1 -1
  141. package/cjs/tools/icons.d.ts +2 -2
  142. package/cjs/tools/icons.js +1 -1
  143. package/cjs/tools/icons.js.map +1 -1
  144. package/cjs/ts-types/base-table.d.ts +23 -4
  145. package/cjs/ts-types/base-table.js.map +1 -1
  146. package/cjs/ts-types/column/style.d.ts +32 -0
  147. package/cjs/ts-types/column/style.js.map +1 -1
  148. package/cjs/ts-types/column/type.d.ts +1 -1
  149. package/cjs/ts-types/column/type.js.map +1 -1
  150. package/cjs/ts-types/component/legend.d.ts +1 -1
  151. package/cjs/ts-types/component/legend.js.map +1 -1
  152. package/cjs/ts-types/events.d.ts +10 -0
  153. package/cjs/ts-types/events.js.map +1 -1
  154. package/cjs/ts-types/icon.d.ts +6 -6
  155. package/cjs/ts-types/icon.js.map +1 -1
  156. package/cjs/ts-types/list-table/define/button-define.d.ts +9 -0
  157. package/cjs/ts-types/list-table/define/{Composite-define.js → button-define.js} +1 -1
  158. package/cjs/ts-types/list-table/define/button-define.js.map +1 -0
  159. package/cjs/ts-types/list-table/define/composite-define.js +6 -0
  160. package/{es/ts-types/list-table/define/Composite-define.js.map → cjs/ts-types/list-table/define/composite-define.js.map} +1 -1
  161. package/cjs/ts-types/list-table/define/index.d.ts +7 -3
  162. package/cjs/ts-types/list-table/define/index.js.map +1 -1
  163. package/cjs/ts-types/list-table/define/switch-define.d.ts +11 -0
  164. package/cjs/ts-types/list-table/define/switch-define.js +6 -0
  165. package/cjs/ts-types/list-table/define/switch-define.js.map +1 -0
  166. package/cjs/ts-types/list-table/layout-map/api.d.ts +5 -1
  167. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  168. package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +5 -1
  169. package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
  170. package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +5 -1
  171. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  172. package/cjs/ts-types/table-engine.d.ts +8 -0
  173. package/cjs/ts-types/table-engine.js.map +1 -1
  174. package/cjs/ts-types/theme.d.ts +4 -2
  175. package/cjs/ts-types/theme.js.map +1 -1
  176. package/cjs/vrender.js.map +1 -1
  177. package/dist/vtable.js +1160 -88
  178. package/dist/vtable.min.js +2 -2
  179. package/es/ListTable-all.js +3 -2
  180. package/es/ListTable-all.js.map +1 -1
  181. package/es/ListTable.d.ts +4 -0
  182. package/es/ListTable.js +13 -1
  183. package/es/ListTable.js.map +1 -1
  184. package/es/PivotChart.d.ts +2 -0
  185. package/es/PivotChart.js +91 -30
  186. package/es/PivotChart.js.map +1 -1
  187. package/es/PivotTable.d.ts +1 -0
  188. package/es/PivotTable.js +29 -26
  189. package/es/PivotTable.js.map +1 -1
  190. package/es/body-helper/body-helper.d.ts +3 -1
  191. package/es/body-helper/body-helper.js +10 -0
  192. package/es/body-helper/body-helper.js.map +1 -1
  193. package/es/body-helper/style/ButtonStyle.d.ts +45 -0
  194. package/es/body-helper/style/ButtonStyle.js +102 -0
  195. package/es/body-helper/style/ButtonStyle.js.map +1 -0
  196. package/es/body-helper/style/SwitchStyle.d.ts +36 -0
  197. package/es/body-helper/style/SwitchStyle.js +82 -0
  198. package/es/body-helper/style/SwitchStyle.js.map +1 -0
  199. package/es/body-helper/style.js +8 -3
  200. package/es/body-helper/style.js.map +1 -1
  201. package/es/components/axis/axis.d.ts +1 -1
  202. package/es/components/axis/axis.js +1 -1
  203. package/es/components/axis/axis.js.map +1 -1
  204. package/es/components/axis/get-axis-component-size.js.map +1 -1
  205. package/es/components/axis/label-overlap.d.ts +1 -1
  206. package/es/components/axis/label-overlap.js.map +1 -1
  207. package/es/components/legend/continue-legend/continue-legend.d.ts +1 -1
  208. package/es/components/legend/continue-legend/continue-legend.js +1 -1
  209. package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
  210. package/es/components/legend/discrete-legend/discrete-legend.d.ts +2 -2
  211. package/es/components/legend/discrete-legend/discrete-legend.js +1 -1
  212. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  213. package/es/components/menu/dom/MenuHandler.js +10 -3
  214. package/es/components/menu/dom/MenuHandler.js.map +1 -1
  215. package/es/components/title/title.d.ts +2 -2
  216. package/es/components/title/title.js +1 -1
  217. package/es/components/title/title.js.map +1 -1
  218. package/es/core/BaseTable.d.ts +5 -1
  219. package/es/core/BaseTable.js +30 -27
  220. package/es/core/BaseTable.js.map +1 -1
  221. package/es/core/FouseInput.js +1 -2
  222. package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
  223. package/es/core/TABLE_EVENT_TYPE.js +3 -1
  224. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  225. package/es/core/utils/get-cell-position.js +2 -2
  226. package/es/core/utils/get-cell-position.js.map +1 -1
  227. package/es/dataset/dataset-pivot-table.js +2 -1
  228. package/es/edit/edit-manager.d.ts +6 -4
  229. package/es/edit/edit-manager.js +17 -14
  230. package/es/edit/edit-manager.js.map +1 -1
  231. package/es/event/component/button.d.ts +2 -0
  232. package/es/event/component/button.js +13 -0
  233. package/es/event/component/button.js.map +1 -0
  234. package/es/event/event.js +7 -5
  235. package/es/event/event.js.map +1 -1
  236. package/es/event/listener/container-dom.js +1 -1
  237. package/es/event/listener/container-dom.js.map +1 -1
  238. package/es/event/listener/table-group.js +18 -0
  239. package/es/event/listener/table-group.js.map +1 -1
  240. package/es/header-helper/header-helper.js +30 -8
  241. package/es/header-helper/header-helper.js.map +1 -1
  242. package/es/index.d.ts +1 -1
  243. package/es/index.js +1 -1
  244. package/es/index.js.map +1 -1
  245. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  246. package/es/render/jsx/index.d.ts +1 -1
  247. package/es/render/jsx/index.js +1 -1
  248. package/es/render/jsx/index.js.map +1 -1
  249. package/es/render/layout/index.d.ts +1 -1
  250. package/es/render/layout/index.js +1 -1
  251. package/es/render/layout/index.js.map +1 -1
  252. package/es/render/layout/tag.d.ts +2 -2
  253. package/es/render/layout/tag.js +1 -1
  254. package/es/render/layout/tag.js.map +1 -1
  255. package/es/render/layout/text.js.map +1 -1
  256. package/es/scenegraph/component/cell-content.d.ts +4 -4
  257. package/es/scenegraph/component/cell-content.js +2 -2
  258. package/es/scenegraph/component/cell-content.js.map +1 -1
  259. package/es/scenegraph/component/menu.js +6 -1
  260. package/es/scenegraph/component/menu.js.map +1 -1
  261. package/es/scenegraph/component/table-component.d.ts +1 -1
  262. package/es/scenegraph/component/table-component.js +1 -1
  263. package/es/scenegraph/component/table-component.js.map +1 -1
  264. package/es/scenegraph/graphic/chart.d.ts +2 -0
  265. package/es/scenegraph/graphic/chart.js +4 -4
  266. package/es/scenegraph/graphic/chart.js.map +1 -1
  267. package/es/scenegraph/graphic/contributions/chart-render-helper.d.ts +2 -0
  268. package/es/scenegraph/graphic/contributions/chart-render-helper.js +9 -9
  269. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  270. package/es/scenegraph/graphic/contributions/chart-render.js +2 -2
  271. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  272. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  273. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  274. package/es/scenegraph/graphic/icon.d.ts +8 -2
  275. package/es/scenegraph/graphic/icon.js +11 -1
  276. package/es/scenegraph/graphic/icon.js.map +1 -1
  277. package/es/scenegraph/group-creater/cell-helper.js +4 -0
  278. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  279. package/es/scenegraph/group-creater/cell-type/button-cell.d.ts +6 -0
  280. package/es/scenegraph/group-creater/cell-type/button-cell.js +135 -0
  281. package/es/scenegraph/group-creater/cell-type/button-cell.js.map +1 -0
  282. package/es/scenegraph/group-creater/cell-type/chart-cell.js +4 -2
  283. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  284. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +1 -1
  285. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  286. package/es/scenegraph/group-creater/cell-type/index.d.ts +2 -0
  287. package/es/scenegraph/group-creater/cell-type/index.js +12 -0
  288. package/es/scenegraph/group-creater/cell-type/index.js.map +1 -1
  289. package/es/scenegraph/group-creater/cell-type/radio-cell.js +1 -1
  290. package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  291. package/es/scenegraph/group-creater/cell-type/switch-cell.d.ts +6 -0
  292. package/es/scenegraph/group-creater/cell-type/switch-cell.js +150 -0
  293. package/es/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -0
  294. package/es/scenegraph/layout/compute-col-width.js +24 -6
  295. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  296. package/es/scenegraph/layout/compute-row-height.js +2 -2
  297. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  298. package/es/scenegraph/layout/height-util.d.ts +2 -0
  299. package/es/scenegraph/layout/height-util.js +35 -2
  300. package/es/scenegraph/layout/height-util.js.map +1 -1
  301. package/es/scenegraph/scenegraph.d.ts +1 -1
  302. package/es/scenegraph/scenegraph.js +7 -6
  303. package/es/scenegraph/scenegraph.js.map +1 -1
  304. package/es/scenegraph/utils/cell-border-stroke-width.d.ts +1 -1
  305. package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  306. package/es/scenegraph/utils/text-icon-layout.d.ts +2 -2
  307. package/es/scenegraph/utils/text-icon-layout.js +9 -8
  308. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  309. package/es/scenegraph/utils/text-measure.js.map +1 -1
  310. package/es/state/radio/radio.js +1 -1
  311. package/es/state/radio/radio.js.map +1 -1
  312. package/es/state/select/custom-select.js +1 -1
  313. package/es/state/select/custom-select.js.map +1 -1
  314. package/es/state/state.js +6 -2
  315. package/es/state/state.js.map +1 -1
  316. package/es/themes/theme.d.ts +4 -0
  317. package/es/themes/theme.js +17 -2
  318. package/es/themes/theme.js.map +1 -1
  319. package/es/tools/icons.d.ts +2 -2
  320. package/es/tools/icons.js +1 -1
  321. package/es/tools/icons.js.map +1 -1
  322. package/es/ts-types/base-table.d.ts +23 -4
  323. package/es/ts-types/base-table.js.map +1 -1
  324. package/es/ts-types/column/style.d.ts +32 -0
  325. package/es/ts-types/column/style.js.map +1 -1
  326. package/es/ts-types/column/type.d.ts +1 -1
  327. package/es/ts-types/column/type.js.map +1 -1
  328. package/es/ts-types/component/legend.d.ts +1 -1
  329. package/es/ts-types/component/legend.js.map +1 -1
  330. package/es/ts-types/events.d.ts +10 -0
  331. package/es/ts-types/events.js.map +1 -1
  332. package/es/ts-types/icon.d.ts +6 -6
  333. package/es/ts-types/icon.js.map +1 -1
  334. package/es/ts-types/list-table/define/button-define.d.ts +9 -0
  335. package/es/ts-types/list-table/define/button-define.js +2 -0
  336. package/es/ts-types/list-table/define/button-define.js.map +1 -0
  337. package/es/ts-types/list-table/define/composite-define.js +2 -0
  338. package/{cjs/ts-types/list-table/define/Composite-define.js.map → es/ts-types/list-table/define/composite-define.js.map} +1 -1
  339. package/es/ts-types/list-table/define/index.d.ts +7 -3
  340. package/es/ts-types/list-table/define/index.js.map +1 -1
  341. package/es/ts-types/list-table/define/switch-define.d.ts +11 -0
  342. package/es/ts-types/list-table/define/switch-define.js +2 -0
  343. package/es/ts-types/list-table/define/switch-define.js.map +1 -0
  344. package/es/ts-types/list-table/layout-map/api.d.ts +5 -1
  345. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  346. package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +5 -1
  347. package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
  348. package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +5 -1
  349. package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  350. package/es/ts-types/table-engine.d.ts +8 -0
  351. package/es/ts-types/table-engine.js.map +1 -1
  352. package/es/ts-types/theme.d.ts +4 -2
  353. package/es/ts-types/theme.js.map +1 -1
  354. package/es/vrender.js.map +1 -1
  355. package/package.json +6 -6
  356. package/es/ts-types/list-table/define/Composite-define.js +0 -2
  357. /package/cjs/ts-types/list-table/define/{Composite-define.d.ts → composite-define.d.ts} +0 -0
  358. /package/es/ts-types/list-table/define/{Composite-define.d.ts → composite-define.d.ts} +0 -0
package/dist/vtable.js CHANGED
@@ -26370,6 +26370,110 @@
26370
26370
  }
26371
26371
  };
26372
26372
 
26373
+ function loadSwitchComponent() {
26374
+ registerGroup(), registerRect(), registerText(), registerCircle();
26375
+ }
26376
+
26377
+ loadSwitchComponent();
26378
+ class Switch extends AbstractComponent {
26379
+ constructor(attributes, options) {
26380
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Switch.defaultAttributes, attributes)), this._handlePointerUp = () => {
26381
+ this.attribute.disabled || (this.attribute.checked ? this.setAttribute("checked", !1) : this.setAttribute("checked", !0), this._dispatchEvent("switch_state_change", {
26382
+ eventType: "switch_state_change",
26383
+ checked: this.attribute.checked
26384
+ }), this.stage.renderNextFrame());
26385
+ }, this.renderGroup(), this.onBeforeAttributeUpdate = (val, attributes, key) => {
26386
+ "interactive" in val && this.setAttribute("pickable", val.interactive), "disabled" in val && this.setAttribute("cursor", val.disable ? this.attribute.disableCursor : this.attribute.cursor);
26387
+ }, this.addEventListener("pointerup", this._handlePointerUp);
26388
+ }
26389
+ render() {
26390
+ this.removeAllChild(!0), this.renderBox(), this.renderCircle(), this.renderText(), this.layout();
26391
+ }
26392
+ renderBox() {
26393
+ this._box = new Rect$2(merge$1({}, this.attribute.box)), this.attribute.disabled && this.attribute.checked ? this._box.setAttributes({
26394
+ fill: this.attribute.box.disableCheckedFill
26395
+ }) : this.attribute.disabled && !this.attribute.checked ? this._box.setAttributes({
26396
+ fill: this.attribute.box.disableUncheckedFill
26397
+ }) : this.attribute.checked ? this._box.setAttributes({
26398
+ fill: this.attribute.box.checkedFill
26399
+ }) : this._box.setAttributes({
26400
+ fill: this.attribute.box.uncheckedFill
26401
+ }), this.appendChild(this._box);
26402
+ }
26403
+ renderCircle() {
26404
+ this._circle = new Circle$1(merge$1({}, this.attribute.circle)), this.appendChild(this._circle);
26405
+ }
26406
+ renderText() {
26407
+ var _a, _b, _c;
26408
+ this._text = new Text$1(merge$1({}, null !== (_a = this.attribute.text) && void 0 !== _a ? _a : {})), this.attribute.checked && (null === (_b = this.attribute.text) || void 0 === _b ? void 0 : _b.checkedText) ? this._text.setAttributes({
26409
+ text: this.attribute.text.checkedText
26410
+ }) : (null === (_c = this.attribute.text) || void 0 === _c ? void 0 : _c.uncheckedText) && this._text.setAttributes({
26411
+ text: this.attribute.text.uncheckedText
26412
+ }), this.appendChild(this._text);
26413
+ }
26414
+ renderGroup() {
26415
+ this.attribute.interactive || this.setAttribute("pickable", !1), this.attribute.disabled && this.setAttribute("cursor", this.attribute.disableCursor);
26416
+ }
26417
+ layout() {
26418
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
26419
+ const space = this.attribute.spaceBetweenTextAndCircle,
26420
+ radius = this.attribute.circle.radius,
26421
+ boxHeight = this.attribute.box.height,
26422
+ circleHeight = 2 * radius,
26423
+ textHeight = this._text.AABBBounds.height(),
26424
+ maxHeight = Math.max(boxHeight, circleHeight, textHeight),
26425
+ circleY = maxHeight / 2 - circleHeight / 2 + radius,
26426
+ textY = maxHeight / 2 - textHeight / 2,
26427
+ boxWidth = this.attribute.box.width,
26428
+ circleWidth = 2 * radius,
26429
+ textWidth = measureTextSize((null !== (_c = null === (_b = null === (_a = this.attribute.text) || void 0 === _a ? void 0 : _a.checkedText) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) > (null !== (_f = null === (_e = null === (_d = this.attribute.text) || void 0 === _d ? void 0 : _d.uncheckedText) || void 0 === _e ? void 0 : _e.length) && void 0 !== _f ? _f : 0) ? null !== (_h = null === (_g = this.attribute.text) || void 0 === _g ? void 0 : _g.checkedText) && void 0 !== _h ? _h : "" : null !== (_k = null === (_j = this.attribute.text) || void 0 === _j ? void 0 : _j.uncheckedText) && void 0 !== _k ? _k : "", this._text.attribute).width,
26430
+ maxWidth = Math.max(boxWidth, circleWidth + textWidth + 3 * space),
26431
+ circleX = boxHeight / 2 - circleWidth / 2 + radius,
26432
+ textX = circleX + radius + space;
26433
+ this._box.setAttributes({
26434
+ width: maxWidth,
26435
+ height: maxHeight
26436
+ }), this._circle.setAttributes({
26437
+ y: circleY,
26438
+ x: this.attribute.checked ? circleX : maxWidth - circleX
26439
+ }), this._text.setAttributes({
26440
+ x: this.attribute.checked ? textX : maxWidth - textX - textWidth,
26441
+ y: textY
26442
+ });
26443
+ }
26444
+ initAttributes(params, options) {
26445
+ params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, Switch.defaultAttributes, params), super.initAttributes(params), this.renderGroup(), this.render();
26446
+ }
26447
+ }
26448
+ Switch.defaultAttributes = {
26449
+ interactive: !0,
26450
+ disabled: !1,
26451
+ checked: !1,
26452
+ cursor: "pointer",
26453
+ disableCursor: "not-allowed",
26454
+ circle: {
26455
+ radius: 8,
26456
+ fill: "#FFF",
26457
+ pickable: !1
26458
+ },
26459
+ box: {
26460
+ width: 40,
26461
+ height: 24,
26462
+ cornerRadius: 12,
26463
+ uncheckedFill: "rgb(201,205,212)",
26464
+ checkedFill: "#165DFF",
26465
+ disableUncheckedFill: "rgb(242,243,245)",
26466
+ disableCheckedFill: "rgb(148,191,255)",
26467
+ pickable: !1
26468
+ },
26469
+ text: {
26470
+ textAlign: "left",
26471
+ textBaseline: "top",
26472
+ pickable: !1
26473
+ },
26474
+ spaceBetweenTextAndCircle: 6
26475
+ };
26476
+
26373
26477
  let registed = false;
26374
26478
  function registerForVrender() {
26375
26479
  if (registed) {
@@ -27501,7 +27605,7 @@
27501
27605
  }
27502
27606
  };
27503
27607
 
27504
- let defaultStyle$9;
27608
+ let defaultStyle$b;
27505
27609
  const STYLE_EVENT_TYPE = {
27506
27610
  CHANGE_STYLE: 'change_style'
27507
27611
  };
@@ -27539,7 +27643,7 @@
27539
27643
  return STYLE_EVENT_TYPE;
27540
27644
  }
27541
27645
  static get DEFAULT() {
27542
- return defaultStyle$9 ? defaultStyle$9 : (defaultStyle$9 = new Style());
27646
+ return defaultStyle$b ? defaultStyle$b : (defaultStyle$b = new Style());
27543
27647
  }
27544
27648
  constructor(style = {}, bodyStyle = {}) {
27545
27649
  super();
@@ -27745,10 +27849,10 @@
27745
27849
  }
27746
27850
  };
27747
27851
 
27748
- let defaultStyle$8;
27852
+ let defaultStyle$a;
27749
27853
  let ImageStyle$1 = class ImageStyle extends Style$1 {
27750
27854
  static get DEFAULT() {
27751
- return defaultStyle$8 ? defaultStyle$8 : (defaultStyle$8 = new ImageStyle());
27855
+ return defaultStyle$a ? defaultStyle$a : (defaultStyle$a = new ImageStyle());
27752
27856
  }
27753
27857
  constructor(style = {}, bodyStyle = {}) {
27754
27858
  super(style, bodyStyle);
@@ -27758,12 +27862,12 @@
27758
27862
  }
27759
27863
  };
27760
27864
 
27761
- let defaultStyle$7;
27865
+ let defaultStyle$9;
27762
27866
  class TextStyle extends Style$1 {
27763
27867
  _autoWrapText;
27764
27868
  _lineClamp;
27765
27869
  static get DEFAULT() {
27766
- return defaultStyle$7 ? defaultStyle$7 : (defaultStyle$7 = new TextStyle());
27870
+ return defaultStyle$9 ? defaultStyle$9 : (defaultStyle$9 = new TextStyle());
27767
27871
  }
27768
27872
  constructor(style = {}, bodyStyle = {}) {
27769
27873
  super(style, bodyStyle);
@@ -27787,7 +27891,7 @@
27787
27891
  }
27788
27892
  }
27789
27893
 
27790
- let defaultStyle$6;
27894
+ let defaultStyle$8;
27791
27895
  let CheckboxStyle$1 = class CheckboxStyle extends Style$1 {
27792
27896
  _size;
27793
27897
  _spaceBetweenTextAndIcon;
@@ -27801,7 +27905,7 @@
27801
27905
  _checkIconImage;
27802
27906
  _indeterminateIconImage;
27803
27907
  static get DEFAULT() {
27804
- return defaultStyle$6 ? defaultStyle$6 : (defaultStyle$6 = new CheckboxStyle());
27908
+ return defaultStyle$8 ? defaultStyle$8 : (defaultStyle$8 = new CheckboxStyle());
27805
27909
  }
27806
27910
  constructor(style = {}, headerStyle = {}, checkboxThemeStyle = {}) {
27807
27911
  super(style, headerStyle);
@@ -27896,7 +28000,7 @@
27896
28000
  }
27897
28001
  };
27898
28002
 
27899
- let defaultStyle$5;
28003
+ let defaultStyle$7;
27900
28004
  class RadioStyle extends Style$1 {
27901
28005
  _size;
27902
28006
  _spaceBetweenTextAndIcon;
@@ -27911,7 +28015,7 @@
27911
28015
  _disableCheckedFill;
27912
28016
  _disableCheckedStroke;
27913
28017
  static get DEFAULT() {
27914
- return defaultStyle$5 ? defaultStyle$5 : (defaultStyle$5 = new RadioStyle());
28018
+ return defaultStyle$7 ? defaultStyle$7 : (defaultStyle$7 = new RadioStyle());
27915
28019
  }
27916
28020
  constructor(style = {}, headerStyle = {}, radioThemeStyle = {}) {
27917
28021
  super(style, headerStyle);
@@ -28013,6 +28117,216 @@
28013
28117
  }
28014
28118
  }
28015
28119
 
28120
+ let defaultStyle$6;
28121
+ class SwitchStyle extends Style$1 {
28122
+ _spaceBetweenTextAndCircle;
28123
+ _circleRadius;
28124
+ _boxWidth;
28125
+ _boxHeight;
28126
+ _checkedFill;
28127
+ _uncheckedFill;
28128
+ _disableCheckedFill;
28129
+ _disableUncheckedFill;
28130
+ _circleFill;
28131
+ static get DEFAULT() {
28132
+ return defaultStyle$6 ? defaultStyle$6 : (defaultStyle$6 = new SwitchStyle());
28133
+ }
28134
+ constructor(style = {}, headerStyle = {}, switchThemeStyle = {}) {
28135
+ super(style, headerStyle);
28136
+ this._spaceBetweenTextAndCircle =
28137
+ (style?.spaceBetweenTextAndCircle ??
28138
+ headerStyle?.spaceBetweenTextAndCircle ??
28139
+ switchThemeStyle?.spaceBetweenTextAndCircle) ||
28140
+ 6;
28141
+ this._circleRadius = (style?.switchStyle?.circleRadius ?? switchThemeStyle?.circleRadius) || 8;
28142
+ this._boxWidth = (style?.switchStyle?.boxWidth ?? switchThemeStyle?.boxWidth) || 40;
28143
+ this._boxHeight = (style?.switchStyle?.boxHeight ?? switchThemeStyle?.boxHeight) || 24;
28144
+ this._checkedFill = (style?.switchStyle?.checkedFill ?? switchThemeStyle?.checkedFill) || '#165DFF';
28145
+ this._uncheckedFill = (style?.switchStyle?.uncheckedFill ?? switchThemeStyle?.uncheckedFill) || '#c9cdd4';
28146
+ this._disableCheckedFill =
28147
+ (style?.switchStyle?.disableCheckedFill ?? switchThemeStyle?.disableCheckedFill) || '#94bfff';
28148
+ this._disableUncheckedFill =
28149
+ (style?.switchStyle?.disableUncheckedFill ?? switchThemeStyle?.disableUncheckedFill) || '#f2f3f5';
28150
+ this._circleFill = (style?.switchStyle?.circleFill ?? switchThemeStyle?.circleFill) || '#FFF';
28151
+ }
28152
+ get spaceBetweenTextAndCircle() {
28153
+ return this._spaceBetweenTextAndCircle;
28154
+ }
28155
+ set spaceBetweenTextAndCircle(spaceBetweenTextAndCircle) {
28156
+ this._spaceBetweenTextAndCircle = spaceBetweenTextAndCircle;
28157
+ }
28158
+ get circleRadius() {
28159
+ return this._circleRadius;
28160
+ }
28161
+ set circleRadius(circleRadius) {
28162
+ this._circleRadius = circleRadius;
28163
+ }
28164
+ get boxWidth() {
28165
+ return this._boxWidth;
28166
+ }
28167
+ set boxWidth(boxWidth) {
28168
+ this._boxWidth = boxWidth;
28169
+ }
28170
+ get boxHeight() {
28171
+ return this._boxHeight;
28172
+ }
28173
+ set boxHeight(boxHeight) {
28174
+ this._boxHeight = boxHeight;
28175
+ }
28176
+ get checkedFill() {
28177
+ return this._checkedFill;
28178
+ }
28179
+ set checkedFill(checkedFill) {
28180
+ this._checkedFill = checkedFill;
28181
+ }
28182
+ get uncheckedFill() {
28183
+ return this._uncheckedFill;
28184
+ }
28185
+ set uncheckedFill(uncheckedFill) {
28186
+ this._uncheckedFill = uncheckedFill;
28187
+ }
28188
+ get disableCheckedFill() {
28189
+ return this._disableCheckedFill;
28190
+ }
28191
+ set disableCheckedFill(disableCheckedFill) {
28192
+ this._disableCheckedFill = disableCheckedFill;
28193
+ }
28194
+ get disableUncheckedFill() {
28195
+ return this._disableUncheckedFill;
28196
+ }
28197
+ set disableUncheckedFill(disableUncheckedFill) {
28198
+ this._disableUncheckedFill = disableUncheckedFill;
28199
+ }
28200
+ get circleFill() {
28201
+ return this._circleFill;
28202
+ }
28203
+ set circleFill(circleFill) {
28204
+ this._circleFill = circleFill;
28205
+ }
28206
+ getStyle(style) {
28207
+ return new SwitchStyle(style, this);
28208
+ }
28209
+ clone() {
28210
+ return new SwitchStyle(this);
28211
+ }
28212
+ }
28213
+
28214
+ let defaultStyle$5;
28215
+ class ButtonStyle extends Style$1 {
28216
+ _buttonColor;
28217
+ _buttonBorderColor;
28218
+ _buttonLineWidth;
28219
+ _buttonBorderRadius;
28220
+ _buttonHoverColor;
28221
+ _buttonHoverBorderColor;
28222
+ _buttonTextHoverColor;
28223
+ _buttonDisableColor;
28224
+ _buttonDisableBorderColor;
28225
+ _buttonTextDisableColor;
28226
+ _buttonTextHoverBorderColor;
28227
+ _buttonPadding;
28228
+ static get DEFAULT() {
28229
+ return defaultStyle$5 ? defaultStyle$5 : (defaultStyle$5 = new ButtonStyle());
28230
+ }
28231
+ constructor(style = {}, headerStyle = {}, buttonThemeStyle = {}) {
28232
+ super(style, headerStyle);
28233
+ this._buttonColor = (style?.buttonStyle?.buttonColor ?? buttonThemeStyle?.buttonColor) || '#165DFF';
28234
+ this._buttonBorderColor =
28235
+ (style?.buttonStyle?.buttonBorderColor ?? buttonThemeStyle?.buttonBorderColor) || '#165DFF';
28236
+ this._buttonLineWidth = (style?.buttonStyle?.buttonLineWidth ?? buttonThemeStyle?.buttonLineWidth) || 1;
28237
+ this._buttonBorderRadius = (style?.buttonStyle?.buttonBorderRadius ?? buttonThemeStyle?.buttonBorderRadius) || 2;
28238
+ this._buttonHoverColor = (style?.buttonStyle?.buttonHoverColor ?? buttonThemeStyle?.buttonHoverColor) || '#4080FF';
28239
+ this._buttonHoverBorderColor =
28240
+ (style?.buttonStyle?.buttonHoverBorderColor ?? buttonThemeStyle?.buttonHoverBorderColor) || '#4080FF';
28241
+ this._buttonTextHoverColor = style?.buttonStyle?.buttonTextHoverColor ?? buttonThemeStyle?.buttonTextHoverColor;
28242
+ this._buttonDisableColor =
28243
+ (style?.buttonStyle?.buttonDisableColor ?? buttonThemeStyle?.buttonDisableColor) || '#94bfff';
28244
+ this._buttonDisableBorderColor =
28245
+ (style?.buttonStyle?.buttonDisableBorderColor ?? buttonThemeStyle?.buttonDisableBorderColor) || '#94bfff';
28246
+ this._buttonTextDisableColor =
28247
+ style?.buttonStyle?.buttonTextDisableColor ?? buttonThemeStyle?.buttonTextDisableColor;
28248
+ this._buttonPadding = (style?.buttonStyle?.buttonPadding ?? buttonThemeStyle?.buttonPadding) || 10;
28249
+ }
28250
+ get buttonColor() {
28251
+ return this._buttonColor;
28252
+ }
28253
+ set buttonColor(buttonColor) {
28254
+ this._buttonColor = buttonColor;
28255
+ }
28256
+ get buttonBorderColor() {
28257
+ return this._buttonBorderColor;
28258
+ }
28259
+ set buttonBorderColor(buttonBorderColor) {
28260
+ this._buttonBorderColor = buttonBorderColor;
28261
+ }
28262
+ get buttonLineWidth() {
28263
+ return this._buttonLineWidth;
28264
+ }
28265
+ set buttonLineWidth(buttonLineWidth) {
28266
+ this._buttonLineWidth = buttonLineWidth;
28267
+ }
28268
+ get buttonBorderRadius() {
28269
+ return this._buttonBorderRadius;
28270
+ }
28271
+ set buttonBorderRadius(buttonBorderRadius) {
28272
+ this._buttonBorderRadius = buttonBorderRadius;
28273
+ }
28274
+ get buttonHoverColor() {
28275
+ return this._buttonHoverColor;
28276
+ }
28277
+ set buttonHoverColor(buttonHoverColor) {
28278
+ this._buttonHoverColor = buttonHoverColor;
28279
+ }
28280
+ get buttonHoverBorderColor() {
28281
+ return this._buttonHoverBorderColor;
28282
+ }
28283
+ set buttonHoverBorderColor(buttonHoverBorderColor) {
28284
+ this._buttonHoverBorderColor = buttonHoverBorderColor;
28285
+ }
28286
+ get buttonTextHoverColor() {
28287
+ return this._buttonTextHoverColor;
28288
+ }
28289
+ set buttonTextHoverColor(buttonTextHoverColor) {
28290
+ this._buttonTextHoverColor = buttonTextHoverColor;
28291
+ }
28292
+ get buttonDisableColor() {
28293
+ return this._buttonDisableColor;
28294
+ }
28295
+ set buttonDisableColor(buttonDisableColor) {
28296
+ this._buttonDisableColor = buttonDisableColor;
28297
+ }
28298
+ get buttonDisableBorderColor() {
28299
+ return this._buttonDisableBorderColor;
28300
+ }
28301
+ set buttonDisableBorderColor(buttonDisableBorderColor) {
28302
+ this._buttonDisableBorderColor = buttonDisableBorderColor;
28303
+ }
28304
+ get buttonTextDisableColor() {
28305
+ return this._buttonTextDisableColor;
28306
+ }
28307
+ set buttonTextDisableColor(buttonTextDisableColor) {
28308
+ this._buttonTextDisableColor = buttonTextDisableColor;
28309
+ }
28310
+ get buttonTextHoverBorderColor() {
28311
+ return this._buttonTextHoverBorderColor;
28312
+ }
28313
+ set buttonTextHoverBorderColor(buttonTextHoverBorderColor) {
28314
+ this._buttonTextHoverBorderColor = buttonTextHoverBorderColor;
28315
+ }
28316
+ get buttonPadding() {
28317
+ return this._buttonPadding;
28318
+ }
28319
+ set buttonPadding(buttonPadding) {
28320
+ this._buttonPadding = buttonPadding;
28321
+ }
28322
+ getStyle(style) {
28323
+ return new ButtonStyle(style, this);
28324
+ }
28325
+ clone() {
28326
+ return new ButtonStyle(this);
28327
+ }
28328
+ }
28329
+
28016
28330
  function of$2(columnStyle, bodyStyle, styleArg, StyleClassDef = Style$1, globalAutoWrapText, theme) {
28017
28331
  if (columnStyle || bodyStyle) {
28018
28332
  if (columnStyle instanceof Style$1) {
@@ -28033,6 +28347,12 @@
28033
28347
  else if (StyleClassDef === RadioStyle) {
28034
28348
  return new RadioStyle(columnStyle ?? {}, (bodyStyle ?? {}), (theme.radioStyle ?? {}));
28035
28349
  }
28350
+ else if (StyleClassDef === SwitchStyle) {
28351
+ return new SwitchStyle(columnStyle ?? {}, (bodyStyle ?? {}), (theme.switchStyle ?? {}));
28352
+ }
28353
+ else if (StyleClassDef === ButtonStyle) {
28354
+ return new ButtonStyle(columnStyle ?? {}, (bodyStyle ?? {}), (theme.buttonStyle ?? {}));
28355
+ }
28036
28356
  return new StyleClassDef((columnStyle ?? {}), (bodyStyle ?? {}));
28037
28357
  }
28038
28358
  return StyleClassDef.DEFAULT;
@@ -28707,6 +29027,7 @@
28707
29027
  MOUSELEAVE_AXIS: 'mouseleave_axis',
28708
29028
  CHECKBOX_STATE_CHANGE: 'checkbox_state_change',
28709
29029
  RADIO_STATE_CHANGE: 'radio_state_change',
29030
+ SWITCH_STATE_CHANGE: 'switch_state_change',
28710
29031
  AFTER_RENDER: 'after_render',
28711
29032
  INITIALIZED: 'initialized',
28712
29033
  CHANGE_CELL_VALUE: 'change_cell_value',
@@ -28714,7 +29035,8 @@
28714
29035
  MOUSEDOWN_FILL_HANDLE: 'mousedown_fill_handle',
28715
29036
  DBLCLICK_FILL_HANDLE: 'dblclick_fill_handle',
28716
29037
  EMPTY_TIP_CLICK: 'empty_tip_click',
28717
- EMPTY_TIP_DBLCLICK: 'empty_tip_dblclick'
29038
+ EMPTY_TIP_DBLCLICK: 'empty_tip_dblclick',
29039
+ BUTTON_CLICK: 'button_click'
28718
29040
  };
28719
29041
 
28720
29042
  const judgeType = (value) => {
@@ -29813,6 +30135,8 @@
29813
30135
  _axisStyle = null;
29814
30136
  _checkboxStyle = null;
29815
30137
  _radioStyle = null;
30138
+ _switchStyle = null;
30139
+ _buttonStyle = null;
29816
30140
  _textPopTipStyle = null;
29817
30141
  _internalIconsStyle = null;
29818
30142
  isPivot = false;
@@ -30352,6 +30676,22 @@
30352
30676
  }
30353
30677
  return this._radioStyle;
30354
30678
  }
30679
+ get switchStyle() {
30680
+ if (!this._switchStyle) {
30681
+ const { obj, superTheme } = this.internalTheme;
30682
+ const switchStyle = ingoreNoneValueMerge({}, superTheme.switchStyle, obj.switchStyle);
30683
+ this._switchStyle = switchStyle;
30684
+ }
30685
+ return this._switchStyle;
30686
+ }
30687
+ get buttonStyle() {
30688
+ if (!this._buttonStyle) {
30689
+ const { obj, superTheme } = this.internalTheme;
30690
+ const buttonStyle = ingoreNoneValueMerge({}, superTheme.buttonStyle, obj.buttonStyle);
30691
+ this._buttonStyle = buttonStyle;
30692
+ }
30693
+ return this._buttonStyle;
30694
+ }
30355
30695
  get textPopTipStyle() {
30356
30696
  if (!this._textPopTipStyle) {
30357
30697
  const { obj, superTheme } = this.internalTheme;
@@ -34401,6 +34741,18 @@
34401
34741
  }
34402
34742
  }
34403
34743
  };
34744
+ class TextIcon extends Text$1 {
34745
+ role;
34746
+ tooltip;
34747
+ constructor(params) {
34748
+ params.fill = params.fill ?? '#00F';
34749
+ params.fontSize = params.fontSize ?? 12;
34750
+ params.underline = params.underline ?? 1;
34751
+ params.textBaseline = params.textBaseline ?? 'top';
34752
+ params.cursor = params.cursor ?? 'pointer';
34753
+ super(params);
34754
+ }
34755
+ }
34404
34756
 
34405
34757
  function emptyCustomLayout(args) {
34406
34758
  const group = new Group$2({});
@@ -35943,7 +36295,7 @@
35943
36295
  updateCenterLayout(contentWidth) {
35944
36296
  let textWidth = contentWidth;
35945
36297
  this._centerGroup.forEachChildren(child => {
35946
- if (child instanceof Icon$1) {
36298
+ if (child instanceof Icon$1 || child instanceof TextIcon) {
35947
36299
  textWidth -= child.AABBBounds.width();
35948
36300
  }
35949
36301
  });
@@ -36366,9 +36718,19 @@
36366
36718
  mark.name = icon.name;
36367
36719
  return mark;
36368
36720
  }
36369
- const iconMark = new Icon$1(iconAttribute);
36370
- iconMark.tooltip = icon.tooltip;
36371
- iconMark.name = icon.name;
36721
+ let iconMark;
36722
+ if (icon.type === 'text') {
36723
+ iconAttribute.text = icon.content;
36724
+ merge$1(iconAttribute, icon.style);
36725
+ iconMark = new TextIcon(iconAttribute);
36726
+ iconMark.tooltip = icon.tooltip;
36727
+ iconMark.name = icon.name;
36728
+ }
36729
+ else {
36730
+ iconMark = new Icon$1(iconAttribute);
36731
+ iconMark.tooltip = icon.tooltip;
36732
+ iconMark.name = icon.name;
36733
+ }
36372
36734
  return iconMark;
36373
36735
  }
36374
36736
  function dealWithRichTextIcon(icon) {
@@ -37201,6 +37563,14 @@
37201
37563
  const createRadioCellGroup = Factory.getFunction('createRadioCellGroup');
37202
37564
  cellGroup = createRadioCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
37203
37565
  }
37566
+ else if (type === 'switch') {
37567
+ const createSwitchCellGroup = Factory.getFunction('createSwitchCellGroup');
37568
+ cellGroup = createSwitchCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
37569
+ }
37570
+ else if (type === 'button') {
37571
+ const createButtonCellGroup = Factory.getFunction('createButtonCellGroup');
37572
+ cellGroup = createButtonCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
37573
+ }
37204
37574
  cellGroup.onBeforeAttributeUpdate = onBeforeAttributeUpdateForInvertHighlight;
37205
37575
  return cellGroup;
37206
37576
  }
@@ -37645,6 +38015,7 @@
37645
38015
 
37646
38016
  const utilCheckBoxMark = new CheckBox({});
37647
38017
  const utilRadioMark = new Radio({});
38018
+ const utilButtonMark = new Tag$1({});
37648
38019
  function computeCheckboxCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table) {
37649
38020
  const text = isObject$7(cellValue) ? cellValue.text : cellValue;
37650
38021
  const lines = validToString(text).split('\n') || [];
@@ -37748,6 +38119,47 @@
37748
38119
  }
37749
38120
  return maxHeight;
37750
38121
  }
38122
+ function computeSwitchCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table) {
38123
+ const boxWidth = getProp('boxWidth', actStyle, col, row, table);
38124
+ return boxWidth;
38125
+ }
38126
+ function computeButtonCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table) {
38127
+ const text = isObject$7(cellValue) ? cellValue.text : cellValue;
38128
+ const lines = validToString(text).split('\n') || [];
38129
+ const cellWidth = table.getColsWidth(col, endCol);
38130
+ const buttonPadding = getProp('buttonPadding', actStyle, col, row, table);
38131
+ const buttonLineWidth = getProp('buttonLineWidth', actStyle, col, row, table);
38132
+ let maxHeight = 0;
38133
+ if (autoWrapText) {
38134
+ const maxLineWidth = cellWidth - (padding[1] + padding[3]);
38135
+ utilButtonMark.setAttributes({
38136
+ text: lines,
38137
+ textStyle: {
38138
+ maxLineWidth,
38139
+ fontSize,
38140
+ fontStyle,
38141
+ fontWeight,
38142
+ fontFamily,
38143
+ lineHeight,
38144
+ wordBreak: 'break-word',
38145
+ lineClamp
38146
+ },
38147
+ padding: buttonPadding,
38148
+ panel: {
38149
+ visible: true,
38150
+ fill: 'red',
38151
+ stroke: 'red',
38152
+ lineWidth: buttonLineWidth
38153
+ }
38154
+ });
38155
+ utilRadioMark.render();
38156
+ maxHeight = utilRadioMark.AABBBounds.height();
38157
+ }
38158
+ else {
38159
+ maxHeight = lines.length * lineHeight + buttonPadding * 2;
38160
+ }
38161
+ return maxHeight;
38162
+ }
37751
38163
 
37752
38164
  let customAlphabetCharSet = '';
37753
38165
  let textMeasureMode = 'quick';
@@ -38443,7 +38855,9 @@
38443
38855
  cellType !== 'link' &&
38444
38856
  cellType !== 'progressbar' &&
38445
38857
  cellType !== 'checkbox' &&
38446
- cellType !== 'radio') {
38858
+ cellType !== 'radio' &&
38859
+ cellType !== 'switch' &&
38860
+ cellType !== 'button') {
38447
38861
  maxHeight = lineHeight;
38448
38862
  }
38449
38863
  else if (cellType === 'checkbox') {
@@ -38452,6 +38866,12 @@
38452
38866
  else if (cellType === 'radio') {
38453
38867
  maxHeight = computeRadioCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table);
38454
38868
  }
38869
+ else if (cellType === 'switch') {
38870
+ maxHeight = computeSwitchCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table);
38871
+ }
38872
+ else if (cellType === 'button') {
38873
+ maxHeight = computeButtonCellHeight(cellValue, col, row, endCol, actStyle, autoWrapText, iconWidth, fontSize, fontStyle, fontWeight, fontFamily, lineHeight, lineClamp, padding, table);
38874
+ }
38455
38875
  else {
38456
38876
  text = cellValue;
38457
38877
  const lines = breakString(text, table).text;
@@ -39406,7 +39826,11 @@
39406
39826
  }
39407
39827
  getMenuInfo(col, row, type) {
39408
39828
  if (type === MenuType.dropDown) {
39409
- const { dropDownMenu = this._table.globalDropDownMenu, pivotInfo } = this._table._getHeaderLayoutMap(col, row);
39829
+ let dropDownMenu = this._table.globalDropDownMenu;
39830
+ dropDownMenu = this._table._getHeaderLayoutMap(col, row).dropDownMenu;
39831
+ if (typeof dropDownMenu === 'function') {
39832
+ dropDownMenu = dropDownMenu({ row, col, table: this._table });
39833
+ }
39410
39834
  let highlightIndex = -1;
39411
39835
  if (Array.isArray(dropDownMenu)) {
39412
39836
  for (let i = 0; i < dropDownMenu.length; i++) {
@@ -40756,6 +41180,7 @@
40756
41180
  y1: y1 - table.scrollTop,
40757
41181
  y2: y2 - table.scrollTop
40758
41182
  });
41183
+ this.activeChartInstance?.release();
40759
41184
  this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge$1({}, this.attribute.tableChartOption, {
40760
41185
  renderCanvas: this.attribute.canvas,
40761
41186
  mode: 'desktop-browser',
@@ -40943,11 +41368,11 @@
40943
41368
  const { table } = chart.getRootNode();
40944
41369
  let updateSpec = false;
40945
41370
  if (table.options.specFormat) {
40946
- const formatResult = table.options.specFormat(chart.attribute.spec);
41371
+ const formatResult = table.options.specFormat(chart.attribute.spec, chartInstance, chart);
40947
41372
  if (formatResult.needFormatSpec && formatResult.spec) {
40948
41373
  const spec = formatResult.spec;
40949
41374
  chartInstance.updateSpecSync(spec);
40950
- updateSpec = true;
41375
+ updateSpec = formatResult.updateSpec ?? true;
40951
41376
  }
40952
41377
  }
40953
41378
  if (!updateSpec) {
@@ -41125,11 +41550,10 @@
41125
41550
  }
41126
41551
  else if (activeChartInstance) {
41127
41552
  if (table.options.specFormat) {
41128
- const formatResult = table.options.specFormat(chart.attribute.spec);
41553
+ const formatResult = table.options.specFormat(chart.attribute.spec, activeChartInstance, chart);
41129
41554
  if (formatResult.needFormatSpec && formatResult.spec) {
41130
41555
  const spec = formatResult.spec;
41131
41556
  activeChartInstance.updateSpecSync(spec);
41132
- return;
41133
41557
  }
41134
41558
  }
41135
41559
  const viewBox = chart.getViewBox();
@@ -42701,14 +43125,14 @@
42701
43125
  let actualWidth = 0;
42702
43126
  for (let col = 0; col < table.colCount; col++) {
42703
43127
  const colWidth = update ? newWidths[col] ?? table.getColWidth(col) : table.getColWidth(col);
42704
- if (col < table.rowHeaderLevelCount ||
43128
+ if (col < table.rowHeaderLevelCount + table.leftRowSeriesNumberCount ||
42705
43129
  (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)) {
42706
43130
  actualHeaderWidth += colWidth;
42707
43131
  }
42708
43132
  actualWidth += colWidth;
42709
43133
  }
42710
43134
  if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {
42711
- const startCol = table.rowHeaderLevelCount;
43135
+ const startCol = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount;
42712
43136
  const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
42713
43137
  getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);
42714
43138
  }
@@ -42809,7 +43233,9 @@
42809
43233
  cellType !== 'link' &&
42810
43234
  cellType !== 'progressbar' &&
42811
43235
  cellType !== 'checkbox' &&
42812
- cellType !== 'radio') {
43236
+ cellType !== 'radio' &&
43237
+ cellType !== 'switch' &&
43238
+ cellType !== 'button') {
42813
43239
  maxWidth = Math.max(maxWidth, table.getColWidthDefinedNumber(col) || 0);
42814
43240
  continue;
42815
43241
  }
@@ -42995,6 +43421,18 @@
42995
43421
  text = isObject$7(cellValue) ? cellValue.text : cellValue;
42996
43422
  }
42997
43423
  }
43424
+ else if (cellType === 'button') {
43425
+ const define = table.getBodyColumnDefine(col, row);
43426
+ const buttonTextValue = getOrApply(define.text, {
43427
+ col,
43428
+ row,
43429
+ table,
43430
+ context: null,
43431
+ value: cellValue,
43432
+ dataValue: table.getCellOriginValue(col, row)
43433
+ });
43434
+ text = buttonTextValue ?? cellValue ?? '';
43435
+ }
42998
43436
  else {
42999
43437
  text = cellValue;
43000
43438
  }
@@ -43048,6 +43486,14 @@
43048
43486
  }
43049
43487
  }
43050
43488
  }
43489
+ else if (cellType === 'switch') {
43490
+ const boxWidth = getProp('boxWidth', actStyle, col, row, table);
43491
+ maxWidth = boxWidth;
43492
+ }
43493
+ else if (cellType === 'button') {
43494
+ const buttonPadding = getProp('buttonPadding', actStyle, col, row, table);
43495
+ maxWidth += buttonPadding * 2;
43496
+ }
43051
43497
  return maxWidth;
43052
43498
  }
43053
43499
  function getCellRect(col, row, table) {
@@ -47920,16 +48366,16 @@
47920
48366
  setPoptipTheme(this.table.theme.textPopTipStyle);
47921
48367
  let width;
47922
48368
  let height;
47923
- if (table.options.canvas && table.options.viewBox) {
47924
- vglobal.setEnv('browser');
47925
- width = table.options.viewBox.x2 - table.options.viewBox.x1;
47926
- height = table.options.viewBox.y2 - table.options.viewBox.y1;
47927
- }
47928
- else if (Env.mode === 'node') {
48369
+ if (Env.mode === 'node') {
47929
48370
  vglobal.setEnv('node', table.options.modeParams);
47930
48371
  width = table.canvasWidth;
47931
48372
  height = table.canvasHeight;
47932
48373
  }
48374
+ else if (table.options.canvas && table.options.viewBox) {
48375
+ vglobal.setEnv('browser');
48376
+ width = table.options.viewBox.x2 - table.options.viewBox.x1;
48377
+ height = table.options.viewBox.y2 - table.options.viewBox.y1;
48378
+ }
47933
48379
  else {
47934
48380
  vglobal.setEnv('browser');
47935
48381
  width = table.canvas.width;
@@ -48305,6 +48751,7 @@
48305
48751
  }
48306
48752
  const cellGroup = this.getCell(col, row);
48307
48753
  cellGroup?.firstChild?.activate?.(this.table);
48754
+ return cellGroup?.firstChild?.activeChartInstance;
48308
48755
  }
48309
48756
  removeInteractionBorder(col, row) {
48310
48757
  const cellGroup = this.getCell(col, row);
@@ -50689,7 +51136,7 @@
50689
51136
  const define = table.getBodyColumnDefine(col, row);
50690
51137
  const field = define?.field;
50691
51138
  const cellType = table.getCellType(col, row);
50692
- if (isValid$3(field) && cellType === 'checkbox') {
51139
+ if (isValid$3(field) && cellType === 'radio') {
50693
51140
  const dataIndex = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));
50694
51141
  const columnState = table.stateManager.radioState?.[field];
50695
51142
  if (isNumber$4(columnState)) {
@@ -52151,7 +52598,10 @@
52151
52598
  }
52152
52599
  if (isValid$3(col) && isValid$3(row) && this.table.isCellRangeEqual(colNow, rowNow, col, row)) {
52153
52600
  const headerC = this.table._getHeaderLayoutMap(col ?? colNow, row ?? rowNow);
52154
- const dropDownMenu = headerC.dropDownMenu || this.table.globalDropDownMenu;
52601
+ let dropDownMenu = headerC.dropDownMenu || this.table.globalDropDownMenu;
52602
+ if (typeof dropDownMenu === 'function') {
52603
+ dropDownMenu = dropDownMenu({ row, col, table: this.table });
52604
+ }
52155
52605
  if (dropDownMenu) {
52156
52606
  for (let i = 0; i < dropDownMenu.length; i++) {
52157
52607
  const item = dropDownMenu[i];
@@ -53445,6 +53895,36 @@
53445
53895
  table.fireListeners(TABLE_EVENT_TYPE.RADIO_STATE_CHANGE, cellsEvent);
53446
53896
  table.scenegraph.updateNextFrame();
53447
53897
  });
53898
+ table.scenegraph.tableGroup.addEventListener('switch_state_change', (e) => {
53899
+ const eventArgsSet = getCellEventArgsSet(e);
53900
+ const { col, row, target } = eventArgsSet.eventArgs;
53901
+ const cellInfo = table.getCellInfo(col, row);
53902
+ const mergeRange = getCellMergeInfo(table, col, row);
53903
+ if (mergeRange) {
53904
+ for (let col = mergeRange.start.col; col <= mergeRange.end.col; col++) {
53905
+ for (let row = mergeRange.start.row; row <= mergeRange.end.row; row++) {
53906
+ const cellGroup = table.scenegraph.getCell(col, row);
53907
+ cellGroup.forEachChildren((switchComponent) => {
53908
+ if (switchComponent.name === 'switch') {
53909
+ switchComponent.setAttributes({
53910
+ checked: e.target.attribute.checked
53911
+ });
53912
+ }
53913
+ });
53914
+ }
53915
+ }
53916
+ }
53917
+ const cellsEvent = {
53918
+ ...cellInfo,
53919
+ event: e.nativeEvent,
53920
+ target: eventArgsSet?.eventArgs?.target,
53921
+ mergeCellInfo: eventArgsSet?.eventArgs?.mergeInfo,
53922
+ checked: e.detail.checked
53923
+ };
53924
+ table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked);
53925
+ table.fireListeners(TABLE_EVENT_TYPE.SWITCH_STATE_CHANGE, cellsEvent);
53926
+ table.scenegraph.updateNextFrame();
53927
+ });
53448
53928
  table.scenegraph.stage.addEventListener('wheel', (e) => {
53449
53929
  const legend = e.path.find(node => node.name === 'legend');
53450
53930
  if (!legend) {
@@ -53982,6 +54462,9 @@
53982
54462
  });
53983
54463
  if (!table.options.canvas) {
53984
54464
  handler.on(table.getContainer(), 'resize', e => {
54465
+ if (table.isReleased) {
54466
+ return;
54467
+ }
53985
54468
  if (e.width === 0 && e.height === 0) {
53986
54469
  return;
53987
54470
  }
@@ -54708,6 +55191,17 @@
54708
55191
  });
54709
55192
  }
54710
55193
 
55194
+ function bindButtonClickEvent(table) {
55195
+ table.on(TABLE_EVENT_TYPE.CLICK_CELL, (e) => {
55196
+ const { col, row, target } = e;
55197
+ if (target.name === 'button' && !target.attribute.disable) {
55198
+ if (table.hasListeners(TABLE_EVENT_TYPE.BUTTON_CLICK)) {
55199
+ table.fireListeners(TABLE_EVENT_TYPE.BUTTON_CLICK, { col, row, event: e.event });
55200
+ }
55201
+ }
55202
+ });
55203
+ }
55204
+
54711
55205
  class EventManager {
54712
55206
  table;
54713
55207
  isTouchdown;
@@ -54807,12 +55301,14 @@
54807
55301
  if (e.federatedEvent) {
54808
55302
  const eventArgsSet = getCellEventArgsSet(e.federatedEvent);
54809
55303
  const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgsSet.eventArgs?.targetCell);
55304
+ const disableDblclickAutoResizeColWidth = this.table.options.disableDblclickAutoResizeColWidth ??
55305
+ this.table.options.resize?.disableDblclickAutoResizeColWidth;
54810
55306
  if (this.table.eventManager.checkCellFillhandle(eventArgsSet)) {
54811
55307
  this.table.fireListeners(TABLE_EVENT_TYPE.DBLCLICK_FILL_HANDLE, {});
54812
55308
  }
54813
55309
  else if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) &&
54814
55310
  resizeCol.col >= 0 &&
54815
- !this.table.options.disableDblclickAutoResizeColWidth) {
55311
+ !disableDblclickAutoResizeColWidth) {
54816
55312
  this.table.scenegraph.updateAutoColWidth(resizeCol.col);
54817
55313
  this.table.internalProps._widthResizedColMap.add(resizeCol.col);
54818
55314
  this.table.scenegraph.updateChartSizeForResizeColWidth(resizeCol.col);
@@ -54840,6 +55336,7 @@
54840
55336
  bindAxisClickEvent(this.table);
54841
55337
  bindAxisHoverEvent(this.table);
54842
55338
  bindGroupTitleCheckboxChange(this.table);
55339
+ bindButtonClickEvent(this.table);
54843
55340
  }
54844
55341
  dealTableHover(eventArgsSet) {
54845
55342
  if (!eventArgsSet) {
@@ -54872,7 +55369,10 @@
54872
55369
  }
54873
55370
  const { eventArgs } = eventArgsSet;
54874
55371
  if (eventArgs) {
54875
- if (eventArgs.target.name === 'checkbox' || eventArgs.target.name === 'radio') {
55372
+ if (eventArgs.target.name === 'checkbox' ||
55373
+ eventArgs.target.name === 'radio' ||
55374
+ eventArgs.target.name === 'switch' ||
55375
+ eventArgs.target.name === 'button') {
54876
55376
  return false;
54877
55377
  }
54878
55378
  if (this.table.isHeader(eventArgs.col, eventArgs.row) &&
@@ -55254,7 +55754,7 @@
55254
55754
  const ICON_PROP_KEYS = [
55255
55755
  'type',
55256
55756
  'content',
55257
- 'font',
55757
+ 'style',
55258
55758
  'color',
55259
55759
  'width',
55260
55760
  'height',
@@ -55356,6 +55856,10 @@
55356
55856
  return CheckboxStyle$1;
55357
55857
  case 'radio':
55358
55858
  return RadioStyle;
55859
+ case 'switch':
55860
+ return SwitchStyle;
55861
+ case 'button':
55862
+ return ButtonStyle;
55359
55863
  }
55360
55864
  return TextStyle;
55361
55865
  }
@@ -56635,11 +57139,18 @@
56635
57139
  getDropDownStateIcons(_table, col, row) {
56636
57140
  const headerC = _table.getHeaderDefine(col, row);
56637
57141
  const headerL = _table._getHeaderLayoutMap(col, row);
56638
- const { dropDownMenu } = headerL;
57142
+ let { dropDownMenu } = headerL;
57143
+ if (typeof dropDownMenu === 'function') {
57144
+ dropDownMenu = dropDownMenu({ row, col, table: _table });
57145
+ }
57146
+ let globalDropDownMenu = _table.globalDropDownMenu;
57147
+ if (typeof globalDropDownMenu === 'function') {
57148
+ globalDropDownMenu = globalDropDownMenu({ row, col, table: _table });
57149
+ }
56639
57150
  const results = [];
56640
57151
  if ((Array.isArray(dropDownMenu) && dropDownMenu.length) ||
56641
- (Array.isArray(_table.globalDropDownMenu) && _table.globalDropDownMenu.length && !headerC?.columns?.length)) {
56642
- const menus = dropDownMenu || _table.globalDropDownMenu;
57152
+ (Array.isArray(globalDropDownMenu) && globalDropDownMenu.length && !headerC?.columns?.length)) {
57153
+ const menus = dropDownMenu || globalDropDownMenu;
56643
57154
  let highlightIndex = -1;
56644
57155
  let subHighlightIndex = -1;
56645
57156
  for (let i = 0; i < menus.length; i++) {
@@ -56663,10 +57174,10 @@
56663
57174
  if (highlightIndex !== -1) {
56664
57175
  let menu;
56665
57176
  if (subHighlightIndex !== -1) {
56666
- menu = (dropDownMenu || _table.globalDropDownMenu)[highlightIndex].children[subHighlightIndex];
57177
+ menu = menus[highlightIndex].children[subHighlightIndex];
56667
57178
  }
56668
57179
  else {
56669
- menu = (dropDownMenu || _table.globalDropDownMenu)[highlightIndex];
57180
+ menu = menus[highlightIndex];
56670
57181
  }
56671
57182
  if (menu.stateIcon) {
56672
57183
  if (menu.stateIcon.svg) {
@@ -56746,17 +57257,26 @@
56746
57257
  checkDropDownIcon(_table, col, row) {
56747
57258
  if (_table.isPivotTable()) {
56748
57259
  const headerC = _table._getHeaderLayoutMap(col, row);
56749
- if (Array.isArray(headerC.dropDownMenu) &&
56750
- headerC.dropDownMenu.length) {
57260
+ let dropDownMenu = headerC.dropDownMenu;
57261
+ if (typeof dropDownMenu === 'function') {
57262
+ dropDownMenu = dropDownMenu({ row, col, table: _table });
57263
+ }
57264
+ if (Array.isArray(dropDownMenu) &&
57265
+ dropDownMenu.length) {
56751
57266
  return true;
56752
57267
  }
56753
57268
  }
56754
57269
  else {
56755
57270
  const headerC = _table.getHeaderDefine(col, row);
56756
- if ((Array.isArray(headerC.dropDownMenu) && headerC.dropDownMenu.length) ||
57271
+ const dropDownMenu = headerC.dropDownMenu;
57272
+ let globalDropDownMenu = _table.globalDropDownMenu;
57273
+ if (typeof globalDropDownMenu === 'function') {
57274
+ globalDropDownMenu = globalDropDownMenu({ row, col, table: _table });
57275
+ }
57276
+ if ((Array.isArray(dropDownMenu) && dropDownMenu.length) ||
56757
57277
  ((!Array.isArray(headerC.dropDownMenu) || headerC.dropDownMenu.length !== 0) &&
56758
- Array.isArray(_table.globalDropDownMenu) &&
56759
- _table.globalDropDownMenu.length &&
57278
+ Array.isArray(globalDropDownMenu) &&
57279
+ globalDropDownMenu.length &&
56760
57280
  !headerC?.columns?.length)) {
56761
57281
  return true;
56762
57282
  }
@@ -58194,6 +58714,7 @@
58194
58714
  if (absoluteX === 0) {
58195
58715
  return { left: 0, col: 0, right: 0, width: 0 };
58196
58716
  }
58717
+ absoluteX = absoluteX - _this.tableX;
58197
58718
  if (isConsider &&
58198
58719
  absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() &&
58199
58720
  absoluteX < _this.tableNoFrameWidth &&
@@ -58282,8 +58803,8 @@
58282
58803
  x <= _this.getAllColsWidth()) {
58283
58804
  rightFrozen = true;
58284
58805
  }
58285
- const colInfo = getTargetColAtConsiderRightFrozen(leftFrozen || rightFrozen ? x : x + _this.scrollLeft, rightFrozen, _this);
58286
- const rowInfo = getTargetRowAtConsiderBottomFrozen(topFrozen || bottomFrozen ? y : y + _this.scrollTop, bottomFrozen, _this);
58806
+ const colInfo = getTargetColAtConsiderRightFrozen((leftFrozen || rightFrozen ? x : x + _this.scrollLeft) + _this.tableX, rightFrozen, _this);
58807
+ const rowInfo = getTargetRowAtConsiderBottomFrozen((topFrozen || bottomFrozen ? y : y + _this.scrollTop) + _this.tableY, bottomFrozen, _this);
58287
58808
  if (colInfo && rowInfo) {
58288
58809
  const { row, top, bottom, height } = rowInfo;
58289
58810
  const { col, left, right, width } = colInfo;
@@ -59609,7 +60130,7 @@
59609
60130
  return TABLE_EVENT_TYPE;
59610
60131
  }
59611
60132
  options;
59612
- version = "1.17.0-alpha.4";
60133
+ version = "1.17.0";
59613
60134
  pagination;
59614
60135
  id = `VTable${Date.now()}`;
59615
60136
  headerStyleCache;
@@ -59631,7 +60152,7 @@
59631
60152
  if (options.customConfig?.imageAnonymous === false) {
59632
60153
  vglobal.isImageAnonymous = false;
59633
60154
  }
59634
- const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, frozenRowCount, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, rowResizeMode = 'none', dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight, clearDOM = true } = options;
60155
+ const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, frozenRowCount, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight, clearDOM = true } = options;
59635
60156
  this.container = container;
59636
60157
  this.options = options;
59637
60158
  this._widthMode = widthMode;
@@ -59670,8 +60191,10 @@
59670
60191
  this.showFrozenIcon = false;
59671
60192
  }
59672
60193
  if (this.options.canvas) {
59673
- internalProps.element = this.options.canvas.parentElement;
59674
- internalProps.element.style.position = 'relative';
60194
+ if (Env.mode !== 'node') {
60195
+ internalProps.element = this.options.canvas.parentElement;
60196
+ internalProps.element.style.position = 'relative';
60197
+ }
59675
60198
  internalProps.focusControl = new FocusInput(this, internalProps.element);
59676
60199
  internalProps.canvas = this.options.canvas;
59677
60200
  internalProps.context = internalProps.canvas.getContext('2d');
@@ -59701,8 +60224,8 @@
59701
60224
  internalProps.keyboardOptions = keyboardOptions;
59702
60225
  internalProps.eventOptions = eventOptions;
59703
60226
  internalProps.rowSeriesNumber = rowSeriesNumber;
59704
- internalProps.columnResizeMode = columnResizeMode;
59705
- internalProps.rowResizeMode = rowResizeMode;
60227
+ internalProps.columnResizeMode = resize?.columnResizeMode ?? columnResizeMode;
60228
+ internalProps.rowResizeMode = resize?.rowResizeMode ?? rowResizeMode;
59706
60229
  internalProps.dragHeaderMode = dragHeaderMode ?? 'none';
59707
60230
  internalProps.renderChartAsync = renderChartAsync;
59708
60231
  setBatchRenderChartCount(renderChartAsyncBatchCount);
@@ -59803,7 +60326,8 @@
59803
60326
  }, options.menu);
59804
60327
  Array.isArray(options.menu?.dropDownMenuHighlight) &&
59805
60328
  this.setDropDownMenuHighlight(options.menu?.dropDownMenuHighlight);
59806
- Array.isArray(options.menu?.defaultHeaderMenuItems) &&
60329
+ (Array.isArray(options.menu?.defaultHeaderMenuItems) ||
60330
+ typeof options.menu?.defaultHeaderMenuItems === 'function') &&
59807
60331
  (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems);
59808
60332
  if (internalProps.menu.renderMode === 'html') {
59809
60333
  const MenuHandler = Factory.getComponent('menuHandler');
@@ -60156,7 +60680,7 @@
60156
60680
  return this.internalProps.pixelRatio;
60157
60681
  }
60158
60682
  setPixelRatio(pixelRatio) {
60159
- if (pixelRatio !== this.internalProps.pixelRatio) {
60683
+ if (pixelRatio !== this.internalProps?.pixelRatio) {
60160
60684
  this.internalProps.pixelRatio = pixelRatio;
60161
60685
  const canvasWidth = this.canvasWidth;
60162
60686
  this.internalProps.calcWidthContext = {
@@ -60985,7 +61509,7 @@
60985
61509
  updateOption(options) {
60986
61510
  this.options = options;
60987
61511
  this._hasAutoImageColumn = undefined;
60988
- const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, rowResizeMode = 'none', dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, widthAdaptiveMode, heightAdaptiveMode, customRender, renderChartAsync, renderChartAsyncBatchCount, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight } = options;
61512
+ const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, widthAdaptiveMode, heightAdaptiveMode, customRender, renderChartAsync, renderChartAsyncBatchCount, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight } = options;
60989
61513
  if (pixelRatio && pixelRatio !== this.internalProps.pixelRatio) {
60990
61514
  this.internalProps.pixelRatio = pixelRatio;
60991
61515
  }
@@ -61030,8 +61554,8 @@
61030
61554
  internalProps.keyboardOptions = keyboardOptions;
61031
61555
  internalProps.eventOptions = eventOptions;
61032
61556
  internalProps.rowSeriesNumber = rowSeriesNumber;
61033
- internalProps.columnResizeMode = columnResizeMode;
61034
- internalProps.rowResizeMode = rowResizeMode;
61557
+ internalProps.columnResizeMode = resize?.columnResizeMode ?? columnResizeMode;
61558
+ internalProps.rowResizeMode = resize?.rowResizeMode ?? rowResizeMode;
61035
61559
  internalProps.dragHeaderMode = dragHeaderMode ?? 'none';
61036
61560
  internalProps.renderChartAsync = renderChartAsync;
61037
61561
  setBatchRenderChartCount(renderChartAsyncBatchCount);
@@ -61119,7 +61643,8 @@
61119
61643
  }, options.menu);
61120
61644
  Array.isArray(options.menu?.dropDownMenuHighlight) &&
61121
61645
  this.setDropDownMenuHighlight(options.menu?.dropDownMenuHighlight);
61122
- Array.isArray(options.menu?.defaultHeaderMenuItems) &&
61646
+ (Array.isArray(options.menu?.defaultHeaderMenuItems) ||
61647
+ typeof options.menu?.defaultHeaderMenuItems === 'function') &&
61123
61648
  (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems);
61124
61649
  if (internalProps.menu.renderMode === 'html' && !internalProps.menuHandler) {
61125
61650
  const MenuHandler = Factory.getComponent('menuHandler');
@@ -65578,32 +66103,34 @@
65578
66103
  editingEditor;
65579
66104
  isValidatingValue = false;
65580
66105
  editCell;
66106
+ listenersId = [];
65581
66107
  constructor(table) {
65582
66108
  this.table = table;
65583
66109
  this.bindEvent();
65584
66110
  }
65585
66111
  bindEvent() {
65586
- this.table.internalProps.handler;
65587
- const editCellTrigger = this.table.options.editCellTrigger;
65588
- this.table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, e => {
65589
- if (!editCellTrigger ||
65590
- editCellTrigger === 'doubleclick' ||
65591
- (Array.isArray(editCellTrigger) && editCellTrigger.includes('doubleclick'))) {
65592
- const { col, row } = e;
65593
- const eventArgsSet = getCellEventArgsSet(e.federatedEvent);
65594
- const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgsSet.eventArgs?.targetCell);
65595
- if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
65596
- return;
65597
- }
65598
- this.startEditCell(col, row);
66112
+ const table = this.table;
66113
+ const doubleClickEventId = table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, e => {
66114
+ const { editCellTrigger = 'doubleclick' } = table.options;
66115
+ if (!editCellTrigger.includes('doubleclick')) {
66116
+ return;
66117
+ }
66118
+ const { col, row } = e;
66119
+ const eventArgsSet = getCellEventArgsSet(e.federatedEvent);
66120
+ const resizeCol = table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgsSet.eventArgs?.targetCell);
66121
+ if (table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
66122
+ return;
65599
66123
  }
66124
+ this.startEditCell(col, row);
65600
66125
  });
65601
- this.table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
66126
+ const clickEventId = table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
66127
+ const { editCellTrigger = 'doubleclick' } = table.options;
65602
66128
  if (editCellTrigger === 'click' || (Array.isArray(editCellTrigger) && editCellTrigger.includes('click'))) {
65603
66129
  const { col, row } = e;
65604
66130
  this.startEditCell(col, row);
65605
66131
  }
65606
66132
  });
66133
+ this.listenersId.push(doubleClickEventId, clickEventId);
65607
66134
  }
65608
66135
  startEditCell(col, row, value) {
65609
66136
  if (this.editingEditor) {
@@ -65641,9 +66168,9 @@
65641
66168
  },
65642
66169
  referencePosition,
65643
66170
  container: this.table.getElement(),
65644
- table: this.table,
65645
66171
  col,
65646
- row
66172
+ row,
66173
+ table: this.table
65647
66174
  });
65648
66175
  }
65649
66176
  }
@@ -65715,6 +66242,11 @@
65715
66242
  this.editingEditor = null;
65716
66243
  }
65717
66244
  }
66245
+ release() {
66246
+ this.listenersId.forEach(id => {
66247
+ this.table.off(id);
66248
+ });
66249
+ }
65718
66250
  }
65719
66251
  function dealWithValidateValue(validateValue, editManager, oldValue, resolve) {
65720
66252
  editManager.isValidatingValue = false;
@@ -67263,7 +67795,7 @@
67263
67795
  const define = this.getBodyColumnDefine(col, row);
67264
67796
  const field = define?.field;
67265
67797
  const cellType = this.getCellType(col, row);
67266
- if (isValid$3(field) && cellType === 'checkbox') {
67798
+ if (isValid$3(field) && (cellType === 'checkbox' || cellType === 'switch')) {
67267
67799
  const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row)).toString();
67268
67800
  return this.stateManager.checkedState.get(dataIndex)?.[field];
67269
67801
  }
@@ -67284,6 +67816,15 @@
67284
67816
  setCellRadioState(col, row, index) {
67285
67817
  setCellRadioState(col, row, index, this);
67286
67818
  }
67819
+ getSwitchState(field) {
67820
+ return this.getCheckboxState(field);
67821
+ }
67822
+ getCellSwitchState(col, row) {
67823
+ return this.getCellCheckboxState(col, row);
67824
+ }
67825
+ setCellSwitchState(col, row, checked) {
67826
+ this.setCellCheckboxState(col, row, checked);
67827
+ }
67287
67828
  setRecords(records, option) {
67288
67829
  this.internalProps.dataSource?.release();
67289
67830
  this.internalProps.releaseList = this.internalProps.releaseList?.filter((item) => !item.dataSourceObj);
@@ -67520,6 +68061,10 @@
67520
68061
  }
67521
68062
  }
67522
68063
  }
68064
+ release() {
68065
+ this.editorManager.release();
68066
+ super.release();
68067
+ }
67523
68068
  }
67524
68069
 
67525
68070
  function isXAxis(orient) {
@@ -70358,7 +70903,13 @@
70358
70903
  };
70359
70904
  }
70360
70905
  else if (type === 'dropdown-menu') {
70361
- const { dropDownMenu = table.globalDropDownMenu, pivotInfo } = table._getHeaderLayoutMap(col, row);
70906
+ let dropDownMenu = table.globalDropDownMenu;
70907
+ const headerData = table._getHeaderLayoutMap(col, row);
70908
+ dropDownMenu = headerData.dropDownMenu ?? dropDownMenu;
70909
+ const pivotInfo = headerData.pivotInfo;
70910
+ if (typeof dropDownMenu === 'function') {
70911
+ dropDownMenu = dropDownMenu({ row, col, table });
70912
+ }
70362
70913
  return {
70363
70914
  type,
70364
70915
  referencePosition: {
@@ -71603,7 +72154,7 @@
71603
72154
  canvas: table.canvas ?? table.scenegraph.stage.window.getContext().canvas,
71604
72155
  mode: table.options.mode,
71605
72156
  modeParams: table.options.modeParams,
71606
- spec: chartSpec,
72157
+ spec: table.options.specTransformInCell ? table.options.specTransformInCell(chartSpec, col, row) : chartSpec,
71607
72158
  ClassType,
71608
72159
  width: width - padding[3] - padding[1],
71609
72160
  height: height - padding[2] - padding[0],
@@ -71613,7 +72164,9 @@
71613
72164
  cellPadding: padding,
71614
72165
  dpr: table.internalProps.pixelRatio,
71615
72166
  axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : [],
71616
- tableChartOption: table.options.chartOption
72167
+ tableChartOption: table.options.chartOption,
72168
+ col,
72169
+ row
71617
72170
  });
71618
72171
  cellGroup.appendChild(chartGroup);
71619
72172
  table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
@@ -72046,6 +72599,230 @@
72046
72599
  return isDisabled ?? globalDisable ?? false;
72047
72600
  }
72048
72601
 
72602
+ function createSwitchCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync) {
72603
+ if (!cellGroup) {
72604
+ const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
72605
+ if (isAsync) {
72606
+ cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);
72607
+ if (cellGroup && cellGroup.role === 'cell') {
72608
+ cellGroup.setAttributes({
72609
+ x: xOrigin,
72610
+ y: yOrigin,
72611
+ width,
72612
+ height,
72613
+ lineWidth: cellTheme?.group?.lineWidth ?? undefined,
72614
+ fill: cellTheme?.group?.fill ?? undefined,
72615
+ stroke: cellTheme?.group?.stroke ?? undefined,
72616
+ strokeArrayWidth: strokeArrayWidth,
72617
+ strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
72618
+ cursor: cellTheme?.group?.cursor ?? undefined,
72619
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
72620
+ lineCap: 'butt',
72621
+ clip: true,
72622
+ cornerRadius: cellTheme.group.cornerRadius
72623
+ });
72624
+ }
72625
+ }
72626
+ if (!cellGroup || cellGroup.role !== 'cell') {
72627
+ cellGroup = new Group$1({
72628
+ x: xOrigin,
72629
+ y: yOrigin,
72630
+ width,
72631
+ height,
72632
+ lineWidth: cellTheme?.group?.lineWidth ?? undefined,
72633
+ fill: cellTheme?.group?.fill ?? undefined,
72634
+ stroke: cellTheme?.group?.stroke ?? undefined,
72635
+ strokeArrayWidth: strokeArrayWidth,
72636
+ strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
72637
+ cursor: cellTheme?.group?.cursor ?? undefined,
72638
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
72639
+ lineCap: 'butt',
72640
+ clip: true,
72641
+ cornerRadius: cellTheme.group.cornerRadius
72642
+ });
72643
+ cellGroup.role = 'cell';
72644
+ cellGroup.col = col;
72645
+ cellGroup.row = row;
72646
+ columnGroup?.addCellGroup(cellGroup);
72647
+ }
72648
+ }
72649
+ let icons;
72650
+ if (mayHaveIcon) {
72651
+ let iconCol = col;
72652
+ let iconRow = row;
72653
+ if (range) {
72654
+ iconCol = range.start.col;
72655
+ iconRow = range.start.row;
72656
+ }
72657
+ icons = table.getCellIcons(iconCol, iconRow);
72658
+ }
72659
+ let iconWidth = 0;
72660
+ let cellLeftIconWidth = 0;
72661
+ if (Array.isArray(icons) && icons.length !== 0) {
72662
+ const { leftIconWidth, rightIconWidth, absoluteLeftIconWidth, absoluteRightIconWidth } = dealWithIconLayout(icons, cellGroup, range, table);
72663
+ iconWidth = leftIconWidth + rightIconWidth;
72664
+ cellLeftIconWidth = leftIconWidth;
72665
+ cellGroup.forEachChildren((child) => {
72666
+ if (child.role === 'icon-left') {
72667
+ child.setAttribute('x', child.attribute.x + padding[3]);
72668
+ }
72669
+ else if (child.role === 'icon-right') {
72670
+ child.setAttribute('x', child.attribute.x + width - rightIconWidth - padding[1]);
72671
+ }
72672
+ else if (child.role === 'icon-absolute-right') {
72673
+ child.setAttribute('x', child.attribute.x + width - absoluteRightIconWidth - padding[1]);
72674
+ }
72675
+ });
72676
+ cellGroup.forEachChildren((child) => {
72677
+ if (textBaseline === 'middle') {
72678
+ child.setAttribute('y', (height - child.AABBBounds.height()) / 2);
72679
+ }
72680
+ else if (textBaseline === 'bottom') {
72681
+ child.setAttribute('y', height - child.AABBBounds.height() - padding[2]);
72682
+ }
72683
+ else {
72684
+ child.setAttribute('y', padding[0]);
72685
+ }
72686
+ });
72687
+ }
72688
+ const switchComponent = createSwitch(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
72689
+ if (switchComponent) {
72690
+ cellGroup.appendChild(switchComponent);
72691
+ }
72692
+ switchComponent.render();
72693
+ width -= padding[1] + padding[3] + iconWidth;
72694
+ height -= padding[0] + padding[2];
72695
+ if (textAlign === 'center') {
72696
+ switchComponent.setAttribute('x', padding[3] + cellLeftIconWidth + (width - switchComponent.AABBBounds.width()) / 2);
72697
+ }
72698
+ else if (textAlign === 'right') {
72699
+ switchComponent.setAttribute('x', padding[3] + cellLeftIconWidth + width - switchComponent.AABBBounds.width());
72700
+ }
72701
+ else {
72702
+ switchComponent.setAttribute('x', padding[3] + cellLeftIconWidth);
72703
+ }
72704
+ if (textBaseline === 'middle') {
72705
+ switchComponent.setAttribute('y', padding[0] + (height - switchComponent.AABBBounds.height()) / 2);
72706
+ }
72707
+ else if (textBaseline === 'bottom') {
72708
+ switchComponent.setAttribute('y', padding[0] + height - switchComponent.AABBBounds.height());
72709
+ }
72710
+ else {
72711
+ switchComponent.setAttribute('y', padding[0]);
72712
+ }
72713
+ return cellGroup;
72714
+ }
72715
+ function createSwitch(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
72716
+ const style = table._getCellStyle(col, row);
72717
+ const spaceBetweenTextAndCircle = getProp('spaceBetweenTextAndCircle', style, col, row, table);
72718
+ const circleRadius = getProp('circleRadius', style, col, row, table);
72719
+ const boxWidth = getProp('boxWidth', style, col, row, table);
72720
+ const boxHeight = getProp('boxHeight', style, col, row, table);
72721
+ const checkedFill = getProp('checkedFill', style, col, row, table);
72722
+ const uncheckedFill = getProp('uncheckedFill', style, col, row, table);
72723
+ const disableCheckedFill = getProp('disableCheckedFill', style, col, row, table);
72724
+ const disableUncheckedFill = getProp('disableUncheckedFill', style, col, row, table);
72725
+ const circleFill = getProp('circleFill', style, col, row, table);
72726
+ const value = table.getCellValue(col, row);
72727
+ const dataValue = table.getCellOriginValue(col, row);
72728
+ let isChecked;
72729
+ let isDisabled;
72730
+ let text = value ?? '';
72731
+ if (isObject$7(value)) {
72732
+ isChecked = value.checked;
72733
+ isDisabled = value.disable;
72734
+ text = value.text ?? '';
72735
+ }
72736
+ else if (typeof value === 'boolean') {
72737
+ isChecked = value;
72738
+ text = '';
72739
+ }
72740
+ isChecked = table.stateManager.syncCheckedState(col, row, define.field, isChecked);
72741
+ const hierarchyOffset = getHierarchyOffset(col, row, table);
72742
+ const cellStyle = table._getCellStyle(col, row);
72743
+ const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;
72744
+ const { lineClamp } = cellStyle;
72745
+ const { checked, disable, uncheckedText, checkedText } = define;
72746
+ if (isChecked === undefined || isChecked === null || typeof isChecked === 'function') {
72747
+ const globalChecked = getOrApply(checked, {
72748
+ col,
72749
+ row,
72750
+ table,
72751
+ context: null,
72752
+ value,
72753
+ dataValue
72754
+ });
72755
+ isChecked = table.stateManager.syncCheckedState(col, row, define.field, globalChecked);
72756
+ }
72757
+ const globalDisable = getOrApply(disable, {
72758
+ col,
72759
+ row,
72760
+ table,
72761
+ context: null,
72762
+ value,
72763
+ dataValue
72764
+ });
72765
+ const checkedTextString = getOrApply(checkedText, {
72766
+ col,
72767
+ row,
72768
+ table,
72769
+ context: null,
72770
+ value,
72771
+ dataValue
72772
+ });
72773
+ const uncheckedTextString = getOrApply(uncheckedText, {
72774
+ col,
72775
+ row,
72776
+ table,
72777
+ context: null,
72778
+ value,
72779
+ dataValue
72780
+ });
72781
+ const autoColWidth = colWidth === 'auto';
72782
+ const autoRowHeight = table.isAutoRowHeight(row);
72783
+ const attribute = {
72784
+ text: text.length === 1 ? text[0] : text,
72785
+ maxLineWidth: autoColWidth
72786
+ ? Infinity
72787
+ : cellWidth - (padding[1] + padding[3] + hierarchyOffset) - circleRadius * 2 - spaceBetweenTextAndCircle,
72788
+ textAlign: 'left',
72789
+ textBaseline: 'top',
72790
+ autoWrapText,
72791
+ lineClamp,
72792
+ wordBreak: 'break-word',
72793
+ heightLimit: autoRowHeight ? -1 : cellHeight - Math.floor(padding[0] + padding[2]),
72794
+ pickable: false,
72795
+ dx: hierarchyOffset,
72796
+ whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal',
72797
+ checkedText: checkedTextString,
72798
+ uncheckedText: uncheckedTextString
72799
+ };
72800
+ const testAttribute = cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute;
72801
+ const switchAttributes = {
72802
+ x: 0,
72803
+ y: 0,
72804
+ text: testAttribute,
72805
+ circle: {
72806
+ radius: circleRadius
72807
+ },
72808
+ box: {
72809
+ width: boxWidth,
72810
+ height: boxHeight
72811
+ },
72812
+ spaceBetweenTextAndCircle,
72813
+ disabled: isDisabled ?? globalDisable ?? false
72814
+ };
72815
+ switchAttributes.checked = isChecked;
72816
+ uncheckedFill && (switchAttributes.box.uncheckedFill = uncheckedFill);
72817
+ disableUncheckedFill && (switchAttributes.box.disableUncheckedFill = disableUncheckedFill);
72818
+ checkedFill && (switchAttributes.box.checkedFill = checkedFill);
72819
+ disableCheckedFill && (switchAttributes.box.disableCheckedFill = disableCheckedFill);
72820
+ circleFill && (switchAttributes.circle.fill = circleFill);
72821
+ const switchComponent = new Switch(switchAttributes);
72822
+ switchComponent.name = 'switch';
72823
+ return switchComponent;
72824
+ }
72825
+
72049
72826
  const xScale = new PointScale();
72050
72827
  const yScale = new LinearScale();
72051
72828
  function createSparkLineCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, width, height, padding, table, cellTheme, isAsync) {
@@ -73148,6 +73925,213 @@
73148
73925
  scale.niceMax(target.targetTicks.length);
73149
73926
  }
73150
73927
 
73928
+ function createButtonCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync) {
73929
+ if (!cellGroup) {
73930
+ const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
73931
+ if (isAsync) {
73932
+ cellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);
73933
+ if (cellGroup && cellGroup.role === 'cell') {
73934
+ cellGroup.setAttributes({
73935
+ x: xOrigin,
73936
+ y: yOrigin,
73937
+ width,
73938
+ height,
73939
+ lineWidth: cellTheme?.group?.lineWidth ?? undefined,
73940
+ fill: cellTheme?.group?.fill ?? undefined,
73941
+ stroke: cellTheme?.group?.stroke ?? undefined,
73942
+ strokeArrayWidth: strokeArrayWidth,
73943
+ strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
73944
+ cursor: cellTheme?.group?.cursor ?? undefined,
73945
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
73946
+ lineCap: 'butt',
73947
+ clip: true,
73948
+ cornerRadius: cellTheme.group.cornerRadius
73949
+ });
73950
+ }
73951
+ }
73952
+ if (!cellGroup || cellGroup.role !== 'cell') {
73953
+ cellGroup = new Group$1({
73954
+ x: xOrigin,
73955
+ y: yOrigin,
73956
+ width,
73957
+ height,
73958
+ lineWidth: cellTheme?.group?.lineWidth ?? undefined,
73959
+ fill: cellTheme?.group?.fill ?? undefined,
73960
+ stroke: cellTheme?.group?.stroke ?? undefined,
73961
+ strokeArrayWidth: strokeArrayWidth,
73962
+ strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
73963
+ cursor: cellTheme?.group?.cursor ?? undefined,
73964
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
73965
+ lineCap: 'butt',
73966
+ clip: true,
73967
+ cornerRadius: cellTheme.group.cornerRadius
73968
+ });
73969
+ cellGroup.role = 'cell';
73970
+ cellGroup.col = col;
73971
+ cellGroup.row = row;
73972
+ columnGroup?.addCellGroup(cellGroup);
73973
+ }
73974
+ }
73975
+ let icons;
73976
+ if (mayHaveIcon) {
73977
+ let iconCol = col;
73978
+ let iconRow = row;
73979
+ if (range) {
73980
+ iconCol = range.start.col;
73981
+ iconRow = range.start.row;
73982
+ }
73983
+ icons = table.getCellIcons(iconCol, iconRow);
73984
+ }
73985
+ let iconWidth = 0;
73986
+ let cellLeftIconWidth = 0;
73987
+ if (Array.isArray(icons) && icons.length !== 0) {
73988
+ const { leftIconWidth, rightIconWidth, absoluteLeftIconWidth, absoluteRightIconWidth } = dealWithIconLayout(icons, cellGroup, range, table);
73989
+ iconWidth = leftIconWidth + rightIconWidth;
73990
+ cellLeftIconWidth = leftIconWidth;
73991
+ cellGroup.forEachChildren((child) => {
73992
+ if (child.role === 'icon-left') {
73993
+ child.setAttribute('x', child.attribute.x + padding[3]);
73994
+ }
73995
+ else if (child.role === 'icon-right') {
73996
+ child.setAttribute('x', child.attribute.x + width - rightIconWidth - padding[1]);
73997
+ }
73998
+ else if (child.role === 'icon-absolute-right') {
73999
+ child.setAttribute('x', child.attribute.x + width - absoluteRightIconWidth - padding[1]);
74000
+ }
74001
+ });
74002
+ cellGroup.forEachChildren((child) => {
74003
+ if (textBaseline === 'middle') {
74004
+ child.setAttribute('y', (height - child.AABBBounds.height()) / 2);
74005
+ }
74006
+ else if (textBaseline === 'bottom') {
74007
+ child.setAttribute('y', height - child.AABBBounds.height() - padding[2]);
74008
+ }
74009
+ else {
74010
+ child.setAttribute('y', padding[0]);
74011
+ }
74012
+ });
74013
+ }
74014
+ const buttonComponent = createButton(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
74015
+ if (buttonComponent) {
74016
+ cellGroup.appendChild(buttonComponent);
74017
+ }
74018
+ width -= padding[1] + padding[3] + iconWidth;
74019
+ height -= padding[0] + padding[2];
74020
+ if (textAlign === 'center') {
74021
+ buttonComponent.setAttribute('x', padding[3] + cellLeftIconWidth + (width - buttonComponent.AABBBounds.width()) / 2);
74022
+ }
74023
+ else if (textAlign === 'right') {
74024
+ buttonComponent.setAttribute('x', padding[3] + cellLeftIconWidth + width - buttonComponent.AABBBounds.width());
74025
+ }
74026
+ else {
74027
+ buttonComponent.setAttribute('x', padding[3] + cellLeftIconWidth);
74028
+ }
74029
+ if (textBaseline === 'middle') {
74030
+ buttonComponent.setAttribute('y', padding[0] + (height - buttonComponent.AABBBounds.height()) / 2);
74031
+ }
74032
+ else if (textBaseline === 'bottom') {
74033
+ buttonComponent.setAttribute('y', padding[0] + height - buttonComponent.AABBBounds.height());
74034
+ }
74035
+ else {
74036
+ buttonComponent.setAttribute('y', padding[0]);
74037
+ }
74038
+ return cellGroup;
74039
+ }
74040
+ function createButton(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
74041
+ const style = table._getCellStyle(col, row);
74042
+ const buttonColor = getProp('buttonColor', style, col, row, table);
74043
+ const buttonBorderColor = getProp('buttonBorderColor', style, col, row, table);
74044
+ const buttonLineWidth = getProp('buttonLineWidth', style, col, row, table);
74045
+ const buttonBorderRadius = getProp('buttonBorderRadius', style, col, row, table);
74046
+ const buttonHoverColor = getProp('buttonHoverColor', style, col, row, table);
74047
+ const buttonHoverBorderColor = getProp('buttonHoverBorderColor', style, col, row, table);
74048
+ const buttonPadding = getProp('buttonPadding', style, col, row, table);
74049
+ const buttonTextHoverColor = getProp('buttonTextHoverColor', style, col, row, table);
74050
+ const buttonDisableColor = getProp('buttonDisableColor', style, col, row, table);
74051
+ const buttonDisableBorderColor = getProp('buttonDisableBorderColor', style, col, row, table);
74052
+ const buttonTextDisableColor = getProp('buttonTextDisableColor', style, col, row, table);
74053
+ const value = table.getCellValue(col, row);
74054
+ const dataValue = table.getCellOriginValue(col, row);
74055
+ const hierarchyOffset = getHierarchyOffset(col, row, table);
74056
+ const cellStyle = table._getCellStyle(col, row);
74057
+ const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;
74058
+ const { lineClamp } = cellStyle;
74059
+ const autoColWidth = colWidth === 'auto';
74060
+ const autoRowHeight = table.isAutoRowHeight(row);
74061
+ const { disable, text } = define;
74062
+ const isDisable = getOrApply(disable, {
74063
+ col,
74064
+ row,
74065
+ table,
74066
+ context: null,
74067
+ value,
74068
+ dataValue
74069
+ });
74070
+ const buttonTextValue = getOrApply(text, {
74071
+ col,
74072
+ row,
74073
+ table,
74074
+ context: null,
74075
+ value,
74076
+ dataValue
74077
+ });
74078
+ const buttonText = buttonTextValue ?? value ?? '';
74079
+ const attribute = {
74080
+ maxLineWidth: autoColWidth ? Infinity : cellWidth - (padding[1] + padding[3] + hierarchyOffset),
74081
+ textAlign: 'left',
74082
+ textBaseline: 'top',
74083
+ autoWrapText,
74084
+ lineClamp,
74085
+ wordBreak: 'break-word',
74086
+ heightLimit: autoRowHeight ? -1 : cellHeight - Math.floor(padding[0] + padding[2]),
74087
+ pickable: false,
74088
+ dx: hierarchyOffset,
74089
+ whiteSpace: buttonText.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
74090
+ };
74091
+ const testAttribute = cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute;
74092
+ const buttonAttributes = {
74093
+ x: 0,
74094
+ y: 0,
74095
+ cursor: isDisable ? 'not-allowed' : 'pointer',
74096
+ disable: isDisable,
74097
+ childrenPickable: false,
74098
+ text: buttonText.length === 1 ? buttonText[0] : buttonText,
74099
+ textStyle: testAttribute,
74100
+ padding: buttonPadding,
74101
+ panel: {
74102
+ visible: true,
74103
+ fill: isDisable ? buttonDisableColor : buttonColor,
74104
+ stroke: isDisable ? buttonDisableBorderColor : buttonBorderColor,
74105
+ lineWidth: buttonLineWidth,
74106
+ cornerRadius: buttonBorderRadius
74107
+ },
74108
+ state: {
74109
+ text: {},
74110
+ panel: {
74111
+ hover: {
74112
+ fill: buttonHoverColor,
74113
+ stroke: buttonHoverBorderColor
74114
+ }
74115
+ }
74116
+ }
74117
+ };
74118
+ buttonTextDisableColor && (buttonAttributes.state.text.fill = buttonTextDisableColor);
74119
+ buttonTextHoverColor && (buttonAttributes.state.text.hover.fill = buttonTextHoverColor);
74120
+ const buttonComponent = new Tag$1(buttonAttributes);
74121
+ buttonComponent.name = 'button';
74122
+ if (!isDisable) {
74123
+ buttonComponent.addEventListener('mouseenter', () => {
74124
+ buttonComponent.addState('hover', true, false);
74125
+ buttonComponent.stage.renderNextFrame();
74126
+ });
74127
+ buttonComponent.addEventListener('mouseleave', () => {
74128
+ buttonComponent.removeState('hover', false);
74129
+ buttonComponent.stage.renderNextFrame();
74130
+ });
74131
+ }
74132
+ return buttonComponent;
74133
+ }
74134
+
73151
74135
  const registerChartCell = () => {
73152
74136
  Factory.registerFunction('createChartCellGroup', createChartCellGroup);
73153
74137
  Factory.registerFunction('getAxisDomainRangeAndLabels', getAxisDomainRangeAndLabels);
@@ -73164,6 +74148,12 @@
73164
74148
  const registerRadioCell = () => {
73165
74149
  Factory.registerFunction('createRadioCellGroup', createRadioCellGroup);
73166
74150
  };
74151
+ const registerSwitchCell = () => {
74152
+ Factory.registerFunction('createSwitchCellGroup', createSwitchCellGroup);
74153
+ };
74154
+ const registerButtonCell = () => {
74155
+ Factory.registerFunction('createButtonCellGroup', createButtonCellGroup);
74156
+ };
73167
74157
  const registerSparkLineCell = () => {
73168
74158
  Factory.registerFunction('createSparkLineCellGroup', createSparkLineCellGroup);
73169
74159
  };
@@ -73187,6 +74177,8 @@
73187
74177
  registerImageCell();
73188
74178
  registerProgressBarCell();
73189
74179
  registerRadioCell();
74180
+ registerSwitchCell();
74181
+ registerButtonCell();
73190
74182
  registerSparkLineCell();
73191
74183
  registerTextCell();
73192
74184
  registerVideoCell();
@@ -78389,8 +79381,8 @@
78389
79381
  !options.indicatorsAsCol && !options.rows?.length && !options.rowTree ? [] : cloneDeep$1(options.rowTree);
78390
79382
  this.internalProps.records = options.records;
78391
79383
  this.pagination = options.pagination;
78392
- this.internalProps.columnResizeType = options.columnResizeType ?? 'column';
78393
- this.internalProps.rowResizeType = options.rowResizeType ?? 'row';
79384
+ this.internalProps.columnResizeType = options.resize?.columnResizeType ?? options.columnResizeType ?? 'column';
79385
+ this.internalProps.rowResizeType = options.resize?.rowResizeType ?? options.rowResizeType ?? 'row';
78394
79386
  this.internalProps.dataConfig = cloneDeep$1(options.dataConfig);
78395
79387
  this.internalProps.columnWidthConfig = options.columnWidthConfig;
78396
79388
  this.internalProps.columnWidthConfigForRowHeader = options.columnWidthConfigForRowHeader;
@@ -78541,8 +79533,8 @@
78541
79533
  this.stateManager.initCheckedState(this.internalProps.records);
78542
79534
  this.stateManager.updateDrillState(undefined, undefined, false, false, -1, -1);
78543
79535
  this.pagination = options.pagination;
78544
- internalProps.columnResizeType = options.columnResizeType ?? 'column';
78545
- internalProps.rowResizeType = options.rowResizeType ?? 'row';
79536
+ internalProps.columnResizeType = options.resize?.columnResizeType ?? options.columnResizeType ?? 'column';
79537
+ internalProps.rowResizeType = options.resize?.rowResizeType ?? options.rowResizeType ?? 'row';
78546
79538
  internalProps.dataConfig = cloneDeep$1(options.dataConfig);
78547
79539
  this.internalProps.columnWidthConfig = options.columnWidthConfig;
78548
79540
  this.internalProps.columnWidthConfigForRowHeader = options.columnWidthConfigForRowHeader;
@@ -79924,6 +80916,10 @@
79924
80916
  getFilteredRecords() {
79925
80917
  return this.dataset?.filterRules;
79926
80918
  }
80919
+ release() {
80920
+ this.editorManager.release();
80921
+ super.release();
80922
+ }
79927
80923
  }
79928
80924
 
79929
80925
  registerAxis();
@@ -79996,8 +80992,8 @@
79996
80992
  !options.indicatorsAsCol && !options.rows?.length && !options.rowTree ? [] : cloneDeep$1(options.rowTree);
79997
80993
  this.internalProps.records = options.records;
79998
80994
  this.setCustomStateNameToSpec();
79999
- this.internalProps.columnResizeType = options.columnResizeType ?? 'column';
80000
- this.internalProps.rowResizeType = options.rowResizeType ?? 'row';
80995
+ this.internalProps.columnResizeType = options.resize?.columnResizeType ?? options.columnResizeType ?? 'column';
80996
+ this.internalProps.rowResizeType = options.resize?.rowResizeType ?? options.rowResizeType ?? 'row';
80001
80997
  this.internalProps.dataConfig = { isPivotChart: true };
80002
80998
  this._axes = isArray$7(options.axes) ? options.axes : [];
80003
80999
  let columnDimensionTree;
@@ -80156,8 +81152,8 @@
80156
81152
  options.records && (this.internalProps.records = options.records);
80157
81153
  this.setCustomStateNameToSpec();
80158
81154
  this._selectedDataItemsInChart = [];
80159
- internalProps.columnResizeType = options.columnResizeType ?? 'column';
80160
- internalProps.rowResizeType = options.rowResizeType ?? 'row';
81155
+ internalProps.columnResizeType = options.resize?.columnResizeType ?? options.columnResizeType ?? 'column';
81156
+ internalProps.rowResizeType = options.resize?.rowResizeType ?? options.rowResizeType ?? 'row';
80161
81157
  internalProps.dataConfig = { isPivotChart: true };
80162
81158
  this._axes = isArray$7(options.axes) ? options.axes : [];
80163
81159
  let columnDimensionTree;
@@ -80927,6 +81923,80 @@
80927
81923
  }
80928
81924
  return {};
80929
81925
  }
81926
+ activateChartInstance(cellHeaderPaths) {
81927
+ const cellAddr = this.getCellAddressByHeaderPaths(cellHeaderPaths);
81928
+ if (cellAddr) {
81929
+ const col = cellAddr.col;
81930
+ const row = cellAddr.row;
81931
+ const cellGroup = this.scenegraph.getCell(col, row);
81932
+ const chartNode = cellGroup?.getChildren()?.[0];
81933
+ const activeChartInstance = this.scenegraph.activateChart(col, row);
81934
+ const { dataId, data, axes, spec } = chartNode.attribute;
81935
+ const viewBox = chartNode.getViewBox();
81936
+ axes?.forEach((axis, index) => {
81937
+ if (axis.type === 'linear') {
81938
+ activeChartInstance.updateModelSpecSync({ type: 'axes', index }, {
81939
+ min: axis.range?.min ?? 0,
81940
+ max: axis.range?.max ?? 0,
81941
+ tick: {
81942
+ tickMode: axis.tick?.tickMode
81943
+ }
81944
+ }, true);
81945
+ }
81946
+ else if (axis.type === 'band') {
81947
+ activeChartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
81948
+ }
81949
+ });
81950
+ activeChartInstance.updateViewBox({
81951
+ x1: 0,
81952
+ x2: viewBox.x2 - viewBox.x1,
81953
+ y1: 0,
81954
+ y2: viewBox.y2 - viewBox.y1
81955
+ }, false, false);
81956
+ const chartStage = activeChartInstance.getStage();
81957
+ chartStage.needRender = true;
81958
+ const matrix = chartNode.globalTransMatrix.clone();
81959
+ const stageMatrix = chartNode.stage.window.getViewBoxTransform().clone();
81960
+ stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
81961
+ chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
81962
+ if (typeof dataId === 'string') {
81963
+ activeChartInstance.updateDataSync(dataId, data ?? []);
81964
+ }
81965
+ else {
81966
+ const dataBatch = [];
81967
+ for (const dataIdStr in dataId) {
81968
+ const dataIdAndField = dataId[dataIdStr];
81969
+ const series = spec.series.find((item) => item?.data?.id === dataIdStr);
81970
+ dataBatch.push({
81971
+ id: dataIdStr,
81972
+ values: dataIdAndField
81973
+ ? data?.filter((item) => {
81974
+ return item.hasOwnProperty(dataIdAndField);
81975
+ }) ?? []
81976
+ : data ?? [],
81977
+ fields: series?.data?.fields
81978
+ });
81979
+ if (!activeChartInstance.updateFullDataSync) {
81980
+ activeChartInstance.updateDataSync(dataIdStr, dataIdAndField
81981
+ ? data?.filter((item) => {
81982
+ return item.hasOwnProperty(dataIdAndField);
81983
+ }) ?? []
81984
+ : data ?? []);
81985
+ }
81986
+ }
81987
+ activeChartInstance.updateFullDataSync?.(dataBatch);
81988
+ }
81989
+ return activeChartInstance;
81990
+ }
81991
+ }
81992
+ replaceChartCacheImage(cellHeaderPaths, chartInstance) {
81993
+ const cellAddr = this.getCellAddressByHeaderPaths(cellHeaderPaths);
81994
+ if (cellAddr) {
81995
+ const cellGroup = this.scenegraph.getCell(cellAddr.col, cellAddr.row);
81996
+ const chartNode = cellGroup?.getChildren()?.[0];
81997
+ cacheStageCanvas(chartInstance.getStage(), chartNode);
81998
+ }
81999
+ }
80930
82000
  _getDimensionSortArray() {
80931
82001
  if (this.options?.axes?.length) {
80932
82002
  const dimensionAxisOrient = this.options.indicatorsAsCol ? 'left' : 'bottom';
@@ -81589,7 +82659,7 @@
81589
82659
  }
81590
82660
 
81591
82661
  registerForVrender();
81592
- const version = "1.17.0-alpha.4";
82662
+ const version = "1.17.0";
81593
82663
  function getIcons() {
81594
82664
  return get$2();
81595
82665
  }
@@ -81635,6 +82705,7 @@
81635
82705
  exports.jsx = jsx;
81636
82706
  exports.register = register$1;
81637
82707
  exports.registerAxis = registerAxis;
82708
+ exports.registerButtonCell = registerButtonCell;
81638
82709
  exports.registerChartCell = registerChartCell;
81639
82710
  exports.registerCheckboxCell = registerCheckboxCell;
81640
82711
  exports.registerEmptyTip = registerEmptyTip;
@@ -81644,6 +82715,7 @@
81644
82715
  exports.registerProgressBarCell = registerProgressBarCell;
81645
82716
  exports.registerRadioCell = registerRadioCell;
81646
82717
  exports.registerSparkLineCell = registerSparkLineCell;
82718
+ exports.registerSwitchCell = registerSwitchCell;
81647
82719
  exports.registerTextCell = registerTextCell;
81648
82720
  exports.registerTitle = registerTitle;
81649
82721
  exports.registerTooltip = registerTooltip;