@visactor/vtable 1.16.3-alpha.3 → 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 (362) 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 +28 -26
  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/animation.js +17 -6
  48. package/cjs/core/animation.js.map +1 -1
  49. package/cjs/core/utils/get-cell-position.js +4 -3
  50. package/cjs/core/utils/get-cell-position.js.map +1 -1
  51. package/cjs/dataset/dataset-pivot-table.js +2 -1
  52. package/cjs/edit/edit-manager.d.ts +6 -4
  53. package/cjs/edit/edit-manager.js +16 -13
  54. package/cjs/edit/edit-manager.js.map +1 -1
  55. package/cjs/event/component/button.d.ts +2 -0
  56. package/cjs/event/component/button.js +21 -0
  57. package/cjs/event/component/button.js.map +1 -0
  58. package/cjs/event/event.js +6 -6
  59. package/cjs/event/event.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/icons.js +0 -18
  65. package/cjs/icons.js.map +1 -1
  66. package/cjs/index.d.ts +1 -1
  67. package/cjs/index.js +1 -1
  68. package/cjs/index.js.map +1 -1
  69. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  70. package/cjs/render/jsx/index.d.ts +1 -1
  71. package/cjs/render/jsx/index.js +4 -4
  72. package/cjs/render/jsx/index.js.map +1 -1
  73. package/cjs/render/layout/index.d.ts +1 -1
  74. package/cjs/render/layout/index.js +3 -3
  75. package/cjs/render/layout/index.js.map +1 -1
  76. package/cjs/render/layout/tag.d.ts +2 -2
  77. package/cjs/render/layout/tag.js +2 -2
  78. package/cjs/render/layout/tag.js.map +1 -1
  79. package/cjs/render/layout/text.js.map +1 -1
  80. package/cjs/scenegraph/component/cell-content.d.ts +4 -4
  81. package/cjs/scenegraph/component/cell-content.js +1 -1
  82. package/cjs/scenegraph/component/cell-content.js.map +1 -1
  83. package/cjs/scenegraph/component/menu.js +6 -1
  84. package/cjs/scenegraph/component/menu.js.map +1 -1
  85. package/cjs/scenegraph/component/table-component.d.ts +1 -1
  86. package/cjs/scenegraph/component/table-component.js +3 -3
  87. package/cjs/scenegraph/component/table-component.js.map +1 -1
  88. package/cjs/scenegraph/graphic/chart.d.ts +2 -0
  89. package/cjs/scenegraph/graphic/chart.js +4 -4
  90. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  91. package/cjs/scenegraph/graphic/contributions/chart-render-helper.d.ts +2 -0
  92. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +11 -9
  93. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  94. package/cjs/scenegraph/graphic/contributions/chart-render.js +2 -2
  95. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  96. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +2 -2
  97. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  98. package/cjs/scenegraph/graphic/icon.d.ts +8 -2
  99. package/cjs/scenegraph/graphic/icon.js +13 -1
  100. package/cjs/scenegraph/graphic/icon.js.map +1 -1
  101. package/cjs/scenegraph/group-creater/cell-helper.js +4 -0
  102. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  103. package/cjs/scenegraph/group-creater/cell-type/button-cell.d.ts +6 -0
  104. package/cjs/scenegraph/group-creater/cell-type/button-cell.js +144 -0
  105. package/cjs/scenegraph/group-creater/cell-type/button-cell.js.map +1 -0
  106. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -2
  107. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  108. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  109. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  110. package/cjs/scenegraph/group-creater/cell-type/index.d.ts +2 -0
  111. package/cjs/scenegraph/group-creater/cell-type/index.js +14 -2
  112. package/cjs/scenegraph/group-creater/cell-type/index.js.map +1 -1
  113. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  114. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  115. package/cjs/scenegraph/group-creater/cell-type/switch-cell.d.ts +6 -0
  116. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js +152 -0
  117. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -0
  118. package/cjs/scenegraph/layout/compute-col-width.js +23 -7
  119. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  120. package/cjs/scenegraph/layout/compute-row-height.js +4 -2
  121. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  122. package/cjs/scenegraph/layout/height-util.d.ts +2 -0
  123. package/cjs/scenegraph/layout/height-util.js +40 -3
  124. package/cjs/scenegraph/layout/height-util.js.map +1 -1
  125. package/cjs/scenegraph/scenegraph.d.ts +1 -1
  126. package/cjs/scenegraph/scenegraph.js +9 -8
  127. package/cjs/scenegraph/scenegraph.js.map +1 -1
  128. package/cjs/scenegraph/utils/cell-border-stroke-width.d.ts +1 -1
  129. package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  130. package/cjs/scenegraph/utils/text-icon-layout.d.ts +2 -2
  131. package/cjs/scenegraph/utils/text-icon-layout.js +7 -6
  132. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  133. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  134. package/cjs/state/radio/radio.js +1 -1
  135. package/cjs/state/radio/radio.js.map +1 -1
  136. package/cjs/state/select/custom-select.js +2 -2
  137. package/cjs/state/select/custom-select.js.map +1 -1
  138. package/cjs/state/state.js +6 -2
  139. package/cjs/state/state.js.map +1 -1
  140. package/cjs/themes/theme.d.ts +4 -0
  141. package/cjs/themes/theme.js +19 -2
  142. package/cjs/themes/theme.js.map +1 -1
  143. package/cjs/tools/icons.d.ts +2 -2
  144. package/cjs/tools/icons.js +1 -1
  145. package/cjs/tools/icons.js.map +1 -1
  146. package/cjs/ts-types/base-table.d.ts +23 -4
  147. package/cjs/ts-types/base-table.js.map +1 -1
  148. package/cjs/ts-types/column/style.d.ts +32 -0
  149. package/cjs/ts-types/column/style.js.map +1 -1
  150. package/cjs/ts-types/column/type.d.ts +1 -1
  151. package/cjs/ts-types/column/type.js.map +1 -1
  152. package/cjs/ts-types/component/legend.d.ts +1 -1
  153. package/cjs/ts-types/component/legend.js.map +1 -1
  154. package/cjs/ts-types/events.d.ts +10 -0
  155. package/cjs/ts-types/events.js.map +1 -1
  156. package/cjs/ts-types/icon.d.ts +6 -6
  157. package/cjs/ts-types/icon.js.map +1 -1
  158. package/cjs/ts-types/list-table/define/button-define.d.ts +9 -0
  159. package/cjs/ts-types/list-table/define/{Composite-define.js → button-define.js} +1 -1
  160. package/cjs/ts-types/list-table/define/button-define.js.map +1 -0
  161. package/cjs/ts-types/list-table/define/composite-define.js +6 -0
  162. package/{es/ts-types/list-table/define/Composite-define.js.map → cjs/ts-types/list-table/define/composite-define.js.map} +1 -1
  163. package/cjs/ts-types/list-table/define/index.d.ts +7 -3
  164. package/cjs/ts-types/list-table/define/index.js.map +1 -1
  165. package/cjs/ts-types/list-table/define/switch-define.d.ts +11 -0
  166. package/cjs/ts-types/list-table/define/switch-define.js +6 -0
  167. package/cjs/ts-types/list-table/define/switch-define.js.map +1 -0
  168. package/cjs/ts-types/list-table/layout-map/api.d.ts +5 -1
  169. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  170. package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +5 -1
  171. package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
  172. package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +5 -1
  173. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  174. package/cjs/ts-types/table-engine.d.ts +8 -0
  175. package/cjs/ts-types/table-engine.js.map +1 -1
  176. package/cjs/ts-types/theme.d.ts +4 -2
  177. package/cjs/ts-types/theme.js.map +1 -1
  178. package/cjs/vrender.js.map +1 -1
  179. package/dist/vtable.js +1185 -109
  180. package/dist/vtable.min.js +2 -2
  181. package/es/ListTable-all.js +3 -2
  182. package/es/ListTable-all.js.map +1 -1
  183. package/es/ListTable.d.ts +4 -0
  184. package/es/ListTable.js +13 -1
  185. package/es/ListTable.js.map +1 -1
  186. package/es/PivotChart.d.ts +2 -0
  187. package/es/PivotChart.js +91 -30
  188. package/es/PivotChart.js.map +1 -1
  189. package/es/PivotTable.d.ts +1 -0
  190. package/es/PivotTable.js +29 -26
  191. package/es/PivotTable.js.map +1 -1
  192. package/es/body-helper/body-helper.d.ts +3 -1
  193. package/es/body-helper/body-helper.js +10 -0
  194. package/es/body-helper/body-helper.js.map +1 -1
  195. package/es/body-helper/style/ButtonStyle.d.ts +45 -0
  196. package/es/body-helper/style/ButtonStyle.js +102 -0
  197. package/es/body-helper/style/ButtonStyle.js.map +1 -0
  198. package/es/body-helper/style/SwitchStyle.d.ts +36 -0
  199. package/es/body-helper/style/SwitchStyle.js +82 -0
  200. package/es/body-helper/style/SwitchStyle.js.map +1 -0
  201. package/es/body-helper/style.js +8 -3
  202. package/es/body-helper/style.js.map +1 -1
  203. package/es/components/axis/axis.d.ts +1 -1
  204. package/es/components/axis/axis.js +1 -1
  205. package/es/components/axis/axis.js.map +1 -1
  206. package/es/components/axis/get-axis-component-size.js.map +1 -1
  207. package/es/components/axis/label-overlap.d.ts +1 -1
  208. package/es/components/axis/label-overlap.js.map +1 -1
  209. package/es/components/legend/continue-legend/continue-legend.d.ts +1 -1
  210. package/es/components/legend/continue-legend/continue-legend.js +1 -1
  211. package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
  212. package/es/components/legend/discrete-legend/discrete-legend.d.ts +2 -2
  213. package/es/components/legend/discrete-legend/discrete-legend.js +1 -1
  214. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  215. package/es/components/menu/dom/MenuHandler.js +10 -3
  216. package/es/components/menu/dom/MenuHandler.js.map +1 -1
  217. package/es/components/title/title.d.ts +2 -2
  218. package/es/components/title/title.js +1 -1
  219. package/es/components/title/title.js.map +1 -1
  220. package/es/core/BaseTable.d.ts +5 -1
  221. package/es/core/BaseTable.js +28 -26
  222. package/es/core/BaseTable.js.map +1 -1
  223. package/es/core/FouseInput.js +1 -2
  224. package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
  225. package/es/core/TABLE_EVENT_TYPE.js +3 -1
  226. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  227. package/es/core/animation.js +16 -5
  228. package/es/core/animation.js.map +1 -1
  229. package/es/core/utils/get-cell-position.js +4 -3
  230. package/es/core/utils/get-cell-position.js.map +1 -1
  231. package/es/dataset/dataset-pivot-table.js +2 -1
  232. package/es/edit/edit-manager.d.ts +6 -4
  233. package/es/edit/edit-manager.js +17 -14
  234. package/es/edit/edit-manager.js.map +1 -1
  235. package/es/event/component/button.d.ts +2 -0
  236. package/es/event/component/button.js +13 -0
  237. package/es/event/component/button.js.map +1 -0
  238. package/es/event/event.js +7 -5
  239. package/es/event/event.js.map +1 -1
  240. package/es/event/listener/table-group.js +18 -0
  241. package/es/event/listener/table-group.js.map +1 -1
  242. package/es/header-helper/header-helper.js +30 -8
  243. package/es/header-helper/header-helper.js.map +1 -1
  244. package/es/icons.js +0 -18
  245. package/es/icons.js.map +1 -1
  246. package/es/index.d.ts +1 -1
  247. package/es/index.js +1 -1
  248. package/es/index.js.map +1 -1
  249. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  250. package/es/render/jsx/index.d.ts +1 -1
  251. package/es/render/jsx/index.js +1 -1
  252. package/es/render/jsx/index.js.map +1 -1
  253. package/es/render/layout/index.d.ts +1 -1
  254. package/es/render/layout/index.js +1 -1
  255. package/es/render/layout/index.js.map +1 -1
  256. package/es/render/layout/tag.d.ts +2 -2
  257. package/es/render/layout/tag.js +1 -1
  258. package/es/render/layout/tag.js.map +1 -1
  259. package/es/render/layout/text.js.map +1 -1
  260. package/es/scenegraph/component/cell-content.d.ts +4 -4
  261. package/es/scenegraph/component/cell-content.js +2 -2
  262. package/es/scenegraph/component/cell-content.js.map +1 -1
  263. package/es/scenegraph/component/menu.js +6 -1
  264. package/es/scenegraph/component/menu.js.map +1 -1
  265. package/es/scenegraph/component/table-component.d.ts +1 -1
  266. package/es/scenegraph/component/table-component.js +1 -1
  267. package/es/scenegraph/component/table-component.js.map +1 -1
  268. package/es/scenegraph/graphic/chart.d.ts +2 -0
  269. package/es/scenegraph/graphic/chart.js +4 -4
  270. package/es/scenegraph/graphic/chart.js.map +1 -1
  271. package/es/scenegraph/graphic/contributions/chart-render-helper.d.ts +2 -0
  272. package/es/scenegraph/graphic/contributions/chart-render-helper.js +9 -9
  273. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  274. package/es/scenegraph/graphic/contributions/chart-render.js +2 -2
  275. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  276. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  277. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  278. package/es/scenegraph/graphic/icon.d.ts +8 -2
  279. package/es/scenegraph/graphic/icon.js +11 -1
  280. package/es/scenegraph/graphic/icon.js.map +1 -1
  281. package/es/scenegraph/group-creater/cell-helper.js +4 -0
  282. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  283. package/es/scenegraph/group-creater/cell-type/button-cell.d.ts +6 -0
  284. package/es/scenegraph/group-creater/cell-type/button-cell.js +135 -0
  285. package/es/scenegraph/group-creater/cell-type/button-cell.js.map +1 -0
  286. package/es/scenegraph/group-creater/cell-type/chart-cell.js +4 -2
  287. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  288. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +1 -1
  289. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  290. package/es/scenegraph/group-creater/cell-type/index.d.ts +2 -0
  291. package/es/scenegraph/group-creater/cell-type/index.js +12 -0
  292. package/es/scenegraph/group-creater/cell-type/index.js.map +1 -1
  293. package/es/scenegraph/group-creater/cell-type/radio-cell.js +1 -1
  294. package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  295. package/es/scenegraph/group-creater/cell-type/switch-cell.d.ts +6 -0
  296. package/es/scenegraph/group-creater/cell-type/switch-cell.js +150 -0
  297. package/es/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -0
  298. package/es/scenegraph/layout/compute-col-width.js +24 -6
  299. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  300. package/es/scenegraph/layout/compute-row-height.js +2 -2
  301. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  302. package/es/scenegraph/layout/height-util.d.ts +2 -0
  303. package/es/scenegraph/layout/height-util.js +35 -2
  304. package/es/scenegraph/layout/height-util.js.map +1 -1
  305. package/es/scenegraph/scenegraph.d.ts +1 -1
  306. package/es/scenegraph/scenegraph.js +8 -7
  307. package/es/scenegraph/scenegraph.js.map +1 -1
  308. package/es/scenegraph/utils/cell-border-stroke-width.d.ts +1 -1
  309. package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  310. package/es/scenegraph/utils/text-icon-layout.d.ts +2 -2
  311. package/es/scenegraph/utils/text-icon-layout.js +9 -8
  312. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  313. package/es/scenegraph/utils/text-measure.js.map +1 -1
  314. package/es/state/radio/radio.js +1 -1
  315. package/es/state/radio/radio.js.map +1 -1
  316. package/es/state/select/custom-select.js +1 -1
  317. package/es/state/select/custom-select.js.map +1 -1
  318. package/es/state/state.js +6 -2
  319. package/es/state/state.js.map +1 -1
  320. package/es/themes/theme.d.ts +4 -0
  321. package/es/themes/theme.js +17 -2
  322. package/es/themes/theme.js.map +1 -1
  323. package/es/tools/icons.d.ts +2 -2
  324. package/es/tools/icons.js +1 -1
  325. package/es/tools/icons.js.map +1 -1
  326. package/es/ts-types/base-table.d.ts +23 -4
  327. package/es/ts-types/base-table.js.map +1 -1
  328. package/es/ts-types/column/style.d.ts +32 -0
  329. package/es/ts-types/column/style.js.map +1 -1
  330. package/es/ts-types/column/type.d.ts +1 -1
  331. package/es/ts-types/column/type.js.map +1 -1
  332. package/es/ts-types/component/legend.d.ts +1 -1
  333. package/es/ts-types/component/legend.js.map +1 -1
  334. package/es/ts-types/events.d.ts +10 -0
  335. package/es/ts-types/events.js.map +1 -1
  336. package/es/ts-types/icon.d.ts +6 -6
  337. package/es/ts-types/icon.js.map +1 -1
  338. package/es/ts-types/list-table/define/button-define.d.ts +9 -0
  339. package/es/ts-types/list-table/define/button-define.js +2 -0
  340. package/es/ts-types/list-table/define/button-define.js.map +1 -0
  341. package/es/ts-types/list-table/define/composite-define.js +2 -0
  342. package/{cjs/ts-types/list-table/define/Composite-define.js.map → es/ts-types/list-table/define/composite-define.js.map} +1 -1
  343. package/es/ts-types/list-table/define/index.d.ts +7 -3
  344. package/es/ts-types/list-table/define/index.js.map +1 -1
  345. package/es/ts-types/list-table/define/switch-define.d.ts +11 -0
  346. package/es/ts-types/list-table/define/switch-define.js +2 -0
  347. package/es/ts-types/list-table/define/switch-define.js.map +1 -0
  348. package/es/ts-types/list-table/layout-map/api.d.ts +5 -1
  349. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  350. package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +5 -1
  351. package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
  352. package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +5 -1
  353. package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  354. package/es/ts-types/table-engine.d.ts +8 -0
  355. package/es/ts-types/table-engine.js.map +1 -1
  356. package/es/ts-types/theme.d.ts +4 -2
  357. package/es/ts-types/theme.js.map +1 -1
  358. package/es/vrender.js.map +1 -1
  359. package/package.json +6 -6
  360. package/es/ts-types/list-table/define/Composite-define.js +0 -2
  361. /package/cjs/ts-types/list-table/define/{Composite-define.d.ts → composite-define.d.ts} +0 -0
  362. /package/es/ts-types/list-table/define/{Composite-define.d.ts → composite-define.d.ts} +0 -0
@@ -3,13 +3,15 @@ import { Style } from './style/Style';
3
3
  import type { BaseTableAPI } from '../ts-types/base-table';
4
4
  import { CheckboxStyle } from './style/CheckboxStyle';
5
5
  import { RadioStyle } from './style/RadioStyle';
6
+ import { SwitchStyle } from './style/SwitchStyle';
7
+ import { ButtonStyle } from './style/ButtonStyle';
6
8
  export declare class BodyHelper {
7
9
  expandIcon: SvgIcon;
8
10
  collapseIcon: SvgIcon;
9
11
  _table: BaseTableAPI;
10
12
  constructor(_table: BaseTableAPI);
11
13
  getIcons(col: number, row: number, cellValue: any, dataValue: any, context: CanvasRenderingContext2D): ColumnIconOption[];
12
- getStyleClass(cellType: 'text' | 'link' | 'image' | 'video' | 'chart' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox' | 'radio'): typeof Style | typeof RadioStyle | typeof CheckboxStyle;
14
+ getStyleClass(cellType: 'text' | 'link' | 'image' | 'video' | 'chart' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox' | 'radio' | 'switch' | 'button'): typeof Style | typeof RadioStyle | typeof SwitchStyle | typeof ButtonStyle | typeof CheckboxStyle;
13
15
  getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;
14
16
  getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];
15
17
  getCellIconFromRecordValue(icon: ColumnIconOption | ColumnIconOption[], col: number, row: number): ColumnIconOption | ColumnIconOption[];
@@ -29,7 +29,7 @@ Object.defineProperty(exports, "__esModule", {
29
29
  value: !0
30
30
  }), exports.BodyHelper = void 0;
31
31
 
32
- const ts_types_1 = require("../ts-types"), registerIcons = __importStar(require("../icons")), Style_1 = require("./style/Style"), MultilineTextStyle_1 = require("./style/MultilineTextStyle"), ProgressBarStyle_1 = require("./style/ProgressBarStyle"), ImageStyle_1 = require("./style/ImageStyle"), icons = __importStar(require("../tools/icons")), helper_1 = require("../tools/helper"), CheckboxStyle_1 = require("./style/CheckboxStyle"), RadioStyle_1 = require("./style/RadioStyle"), vutils_1 = require("@visactor/vutils");
32
+ const ts_types_1 = require("../ts-types"), registerIcons = __importStar(require("../icons")), Style_1 = require("./style/Style"), MultilineTextStyle_1 = require("./style/MultilineTextStyle"), ProgressBarStyle_1 = require("./style/ProgressBarStyle"), ImageStyle_1 = require("./style/ImageStyle"), icons = __importStar(require("../tools/icons")), helper_1 = require("../tools/helper"), CheckboxStyle_1 = require("./style/CheckboxStyle"), RadioStyle_1 = require("./style/RadioStyle"), vutils_1 = require("@visactor/vutils"), SwitchStyle_1 = require("./style/SwitchStyle"), ButtonStyle_1 = require("./style/ButtonStyle");
33
33
 
34
34
  class BodyHelper {
35
35
  constructor(_table) {
@@ -86,6 +86,12 @@ class BodyHelper {
86
86
 
87
87
  case "radio":
88
88
  return RadioStyle_1.RadioStyle;
89
+
90
+ case "switch":
91
+ return SwitchStyle_1.SwitchStyle;
92
+
93
+ case "button":
94
+ return ButtonStyle_1.ButtonStyle;
89
95
  }
90
96
  return MultilineTextStyle_1.TextStyle;
91
97
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/body-helper/body-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA+D;AAC/D,wDAA0C;AAC1C,yCAAsC;AACtC,mEAAuD;AACvD,+DAA4D;AAC5D,mDAAgD;AAE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I,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/D,IAAI,cAAc,KAAK,yBAAc,CAAC,MAAM,EAAE;YAE5C,OAAO,IAAI,CAAC,UAAU,CAAC;SACxB;aAAM,IAAI,cAAc,KAAK,yBAAc,CAAC,QAAQ,EAAE;YAErD,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,qBAAqB;;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC;IACxG,CAAC;CACF;AA9JD,gCA8JC","file":"body-helper.js","sourcesContent":["import type { ColumnIconOption, ImageIcon, ListTableAPI, SvgIcon } from '../ts-types';\nimport { HierarchyState, InternalIconName } from '../ts-types';\nimport * as registerIcons from '../icons';\nimport { Style } from './style/Style';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { ProgressBarStyle } from './style/ProgressBarStyle';\nimport { ImageStyle } from './style/ImageStyle';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport * as icons from '../tools/icons';\nimport { obj } from '../tools/helper';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\nimport { isValid } from '@visactor/vutils';\nexport class BodyHelper {\n expandIcon: SvgIcon;\n collapseIcon: SvgIcon;\n _table: BaseTableAPI;\n constructor(_table: BaseTableAPI) {\n this._table = _table;\n const regedIcons = registerIcons.get();\n //展开折叠按钮\n this.expandIcon = regedIcons[InternalIconName.expandIconName] as SvgIcon;\n this.collapseIcon = regedIcons[InternalIconName.collapseIconName] as SvgIcon;\n }\n getIcons(\n col: number,\n row: number,\n cellValue: any,\n dataValue: any,\n context: CanvasRenderingContext2D\n ): ColumnIconOption[] {\n //加入固定列图标 排序 文本中元素\n const iconArr: ColumnIconOption[] = [];\n\n const hierarchyIcon = this.getHierarchyIcon(col, row);\n if (hierarchyIcon) {\n iconArr.push(hierarchyIcon);\n }\n\n const { icon: iconDefine } = this._table.getBodyColumnDefine(col, row);\n\n if (iconDefine) {\n let iconResults;\n if (typeof iconDefine === 'function') {\n const arg = {\n col,\n row,\n value: cellValue,\n dataValue,\n table: this._table\n };\n iconResults = iconDefine(arg);\n } else {\n iconResults = iconDefine;\n }\n const regedIcons = registerIcons.get();\n const addIcon = (columnIcon: string | ColumnIconOption) => {\n let icon;\n if (typeof columnIcon === 'string') {\n icon = regedIcons[columnIcon];\n } else {\n icon = columnIcon;\n }\n if (icon) {\n iconArr.push(icon);\n }\n };\n if (Array.isArray(iconResults)) {\n iconResults.forEach((columnIcon: string | ColumnIconOption, index: number) => {\n addIcon(columnIcon);\n });\n } else {\n addIcon(iconResults);\n }\n }\n\n context &&\n iconArr.forEach((i, index) => {\n if ((i as any).content || (<ImageIcon>i).src) {\n iconArr[index] = this.getCellIconFromRecordValue(i, col, row);\n // if ((<FontIcon>i).font)\n // helper.testFontLoad((<FontIcon>i).font, (<FontIcon>i).content, col, row);\n }\n });\n\n return iconArr;\n }\n getStyleClass(\n cellType:\n | 'text'\n | 'link'\n | 'image'\n | 'video'\n | 'chart'\n | 'sparkline'\n | 'progressbar'\n | 'chart'\n | 'checkbox'\n | 'radio'\n ) {\n switch (cellType) {\n case 'text':\n return TextStyle;\n case 'image':\n return ImageStyle;\n case 'video':\n return ImageStyle;\n case 'link':\n return TextStyle;\n case 'chart':\n return Style;\n case 'sparkline':\n return Style;\n case 'progressbar':\n return ProgressBarStyle;\n case 'checkbox':\n return CheckboxStyle;\n case 'radio':\n return RadioStyle;\n }\n return TextStyle;\n }\n getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;\n getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[] {\n if (Array.isArray(icon)) {\n return icon.map(i => this.getCellIconFromRecordValue(i, col, row));\n }\n // icon.positionType = IconPosition.inlineFront;\n if (!obj.isObject(icon) || typeof icon === 'function') {\n return (this._table as ListTableAPI).getFieldData(icon, col, row);\n }\n // 新建对象 挨个属性赋值\n const retIcon: any = {};\n const iconOpt: any = icon;\n icons.iconPropKeys.forEach(k => {\n if (typeof iconOpt[k] !== 'undefined') {\n const f = (this._table as ListTableAPI).getFieldData(iconOpt[k], col, row);\n if (isValid(f)) {\n retIcon[k] = f;\n } else if (!this._table._hasField?.(iconOpt[k], col, row)) {\n retIcon[k] = iconOpt[k];\n }\n }\n });\n return retIcon;\n }\n\n getHierarchyIcon(col: number, row: number) {\n const hierarchyState = this._table.getHierarchyState(col, row);\n if (hierarchyState === HierarchyState.expand) {\n //展开状态 应该显示-号\n return this.expandIcon;\n } else if (hierarchyState === HierarchyState.collapse) {\n //折叠状态 应该显示-号\n return this.collapseIcon;\n }\n return undefined;\n }\n getHierarchyIconWidth() {\n return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/body-helper/body-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA+D;AAC/D,wDAA0C;AAC1C,yCAAsC;AACtC,mEAAuD;AACvD,+DAA4D;AAC5D,mDAAgD;AAEhD,sDAAwC;AACxC,4CAAsC;AACtC,yDAAsD;AACtD,mDAAgD;AAChD,6CAA2C;AAC3C,qDAAkD;AAClD,qDAAkD;AAClD,MAAa,UAAU;IAIrB,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,MAAM,UAA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cAAc,KAAK,yBAAc,CAAC,MAAM,EAAE;YAE5C,OAAO,IAAI,CAAC,UAAU,CAAC;SACxB;aAAM,IAAI,cAAc,KAAK,yBAAc,CAAC,QAAQ,EAAE;YAErD,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,qBAAqB;;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC;IACxG,CAAC;CACF;AApKD,gCAoKC","file":"body-helper.js","sourcesContent":["import type { ColumnIconOption, ImageIcon, ListTableAPI, SvgIcon } from '../ts-types';\nimport { HierarchyState, InternalIconName } from '../ts-types';\nimport * as registerIcons from '../icons';\nimport { Style } from './style/Style';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { ProgressBarStyle } from './style/ProgressBarStyle';\nimport { ImageStyle } from './style/ImageStyle';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport * as icons from '../tools/icons';\nimport { obj } from '../tools/helper';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\nimport { isValid } from '@visactor/vutils';\nimport { SwitchStyle } from './style/SwitchStyle';\nimport { ButtonStyle } from './style/ButtonStyle';\nexport class BodyHelper {\n expandIcon: SvgIcon;\n collapseIcon: SvgIcon;\n _table: BaseTableAPI;\n constructor(_table: BaseTableAPI) {\n this._table = _table;\n const regedIcons = registerIcons.get();\n //展开折叠按钮\n this.expandIcon = regedIcons[InternalIconName.expandIconName] as SvgIcon;\n this.collapseIcon = regedIcons[InternalIconName.collapseIconName] as SvgIcon;\n }\n getIcons(\n col: number,\n row: number,\n cellValue: any,\n dataValue: any,\n context: CanvasRenderingContext2D\n ): ColumnIconOption[] {\n //加入固定列图标 排序 文本中元素\n const iconArr: ColumnIconOption[] = [];\n\n const hierarchyIcon = this.getHierarchyIcon(col, row);\n if (hierarchyIcon) {\n iconArr.push(hierarchyIcon);\n }\n\n const { icon: iconDefine } = this._table.getBodyColumnDefine(col, row);\n\n if (iconDefine) {\n let iconResults;\n if (typeof iconDefine === 'function') {\n const arg = {\n col,\n row,\n value: cellValue,\n dataValue,\n table: this._table\n };\n iconResults = iconDefine(arg);\n } else {\n iconResults = iconDefine;\n }\n const regedIcons = registerIcons.get();\n const addIcon = (columnIcon: string | ColumnIconOption) => {\n let icon;\n if (typeof columnIcon === 'string') {\n icon = regedIcons[columnIcon];\n } else {\n icon = columnIcon;\n }\n if (icon) {\n iconArr.push(icon);\n }\n };\n if (Array.isArray(iconResults)) {\n iconResults.forEach((columnIcon: string | ColumnIconOption, index: number) => {\n addIcon(columnIcon);\n });\n } else {\n addIcon(iconResults);\n }\n }\n\n context &&\n iconArr.forEach((i, index) => {\n if ((i as any).content || (<ImageIcon>i).src) {\n iconArr[index] = this.getCellIconFromRecordValue(i, col, row);\n // if ((<FontIcon>i).font)\n // helper.testFontLoad((<FontIcon>i).font, (<FontIcon>i).content, col, row);\n }\n });\n\n return iconArr;\n }\n getStyleClass(\n cellType:\n | 'text'\n | 'link'\n | 'image'\n | 'video'\n | 'chart'\n | 'sparkline'\n | 'progressbar'\n | 'chart'\n | 'checkbox'\n | 'radio'\n | 'switch'\n | 'button'\n ) {\n switch (cellType) {\n case 'text':\n return TextStyle;\n case 'image':\n return ImageStyle;\n case 'video':\n return ImageStyle;\n case 'link':\n return TextStyle;\n case 'chart':\n return Style;\n case 'sparkline':\n return Style;\n case 'progressbar':\n return ProgressBarStyle;\n case 'checkbox':\n return CheckboxStyle;\n case 'radio':\n return RadioStyle;\n case 'switch':\n return SwitchStyle;\n case 'button':\n return ButtonStyle;\n }\n return TextStyle;\n }\n getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;\n getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[] {\n if (Array.isArray(icon)) {\n return icon.map(i => this.getCellIconFromRecordValue(i, col, row));\n }\n // icon.positionType = IconPosition.inlineFront;\n if (!obj.isObject(icon) || typeof icon === 'function') {\n return (this._table as ListTableAPI).getFieldData(icon, col, row);\n }\n // 新建对象 挨个属性赋值\n const retIcon: any = {};\n const iconOpt: any = icon;\n icons.iconPropKeys.forEach(k => {\n if (typeof iconOpt[k] !== 'undefined') {\n const f = (this._table as ListTableAPI).getFieldData(iconOpt[k], col, row);\n if (isValid(f)) {\n retIcon[k] = f;\n } else if (!this._table._hasField?.(iconOpt[k], col, row)) {\n retIcon[k] = iconOpt[k];\n }\n }\n });\n return retIcon;\n }\n\n getHierarchyIcon(col: number, row: number) {\n const hierarchyState = this._table.getHierarchyState(col, row);\n if (hierarchyState === HierarchyState.expand) {\n //展开状态 应该显示-号\n return this.expandIcon;\n } else if (hierarchyState === HierarchyState.collapse) {\n //折叠状态 应该显示-号\n return this.collapseIcon;\n }\n return undefined;\n }\n getHierarchyIconWidth() {\n return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);\n }\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import type { IStyleOption, ButtonStyleOption } from '../../ts-types';
2
+ import { Style } from '../style';
3
+ import type { ButtonStyle as ButtonStyleThemeOption } from '../../ts-types/column/style';
4
+ export declare class ButtonStyle extends Style {
5
+ private _buttonColor;
6
+ private _buttonBorderColor;
7
+ private _buttonLineWidth;
8
+ private _buttonBorderRadius;
9
+ private _buttonHoverColor;
10
+ private _buttonHoverBorderColor;
11
+ private _buttonTextHoverColor;
12
+ private _buttonDisableColor;
13
+ private _buttonDisableBorderColor;
14
+ private _buttonTextDisableColor;
15
+ private _buttonTextHoverBorderColor;
16
+ private _buttonPadding;
17
+ static get DEFAULT(): ButtonStyle;
18
+ constructor(style?: ButtonStyleOption, headerStyle?: ButtonStyleOption, buttonThemeStyle?: ButtonStyleThemeOption);
19
+ get buttonColor(): string;
20
+ set buttonColor(buttonColor: string);
21
+ get buttonBorderColor(): string;
22
+ set buttonBorderColor(buttonBorderColor: string);
23
+ get buttonLineWidth(): number;
24
+ set buttonLineWidth(buttonLineWidth: number);
25
+ get buttonBorderRadius(): number;
26
+ set buttonBorderRadius(buttonBorderRadius: number);
27
+ get buttonHoverColor(): string;
28
+ set buttonHoverColor(buttonHoverColor: string);
29
+ get buttonHoverBorderColor(): string;
30
+ set buttonHoverBorderColor(buttonHoverBorderColor: string);
31
+ get buttonTextHoverColor(): string;
32
+ set buttonTextHoverColor(buttonTextHoverColor: string);
33
+ get buttonDisableColor(): string;
34
+ set buttonDisableColor(buttonDisableColor: string);
35
+ get buttonDisableBorderColor(): string;
36
+ set buttonDisableBorderColor(buttonDisableBorderColor: string);
37
+ get buttonTextDisableColor(): string;
38
+ set buttonTextDisableColor(buttonTextDisableColor: string);
39
+ get buttonTextHoverBorderColor(): string;
40
+ set buttonTextHoverBorderColor(buttonTextHoverBorderColor: string);
41
+ get buttonPadding(): number;
42
+ set buttonPadding(buttonPadding: number);
43
+ getStyle(style: IStyleOption): ButtonStyle;
44
+ clone(): ButtonStyle;
45
+ }
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.ButtonStyle = void 0;
6
+
7
+ const style_1 = require("../style");
8
+
9
+ let defaultStyle;
10
+
11
+ class ButtonStyle extends style_1.Style {
12
+ static get DEFAULT() {
13
+ return defaultStyle || (defaultStyle = new ButtonStyle);
14
+ }
15
+ constructor(style = {}, headerStyle = {}, buttonThemeStyle = {}) {
16
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
17
+ super(style, headerStyle), this._buttonColor = (null !== (_b = null === (_a = null == style ? void 0 : style.buttonStyle) || void 0 === _a ? void 0 : _a.buttonColor) && void 0 !== _b ? _b : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonColor) || "#165DFF",
18
+ this._buttonBorderColor = (null !== (_d = null === (_c = null == style ? void 0 : style.buttonStyle) || void 0 === _c ? void 0 : _c.buttonBorderColor) && void 0 !== _d ? _d : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonBorderColor) || "#165DFF",
19
+ this._buttonLineWidth = (null !== (_f = null === (_e = null == style ? void 0 : style.buttonStyle) || void 0 === _e ? void 0 : _e.buttonLineWidth) && void 0 !== _f ? _f : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonLineWidth) || 1,
20
+ this._buttonBorderRadius = (null !== (_h = null === (_g = null == style ? void 0 : style.buttonStyle) || void 0 === _g ? void 0 : _g.buttonBorderRadius) && void 0 !== _h ? _h : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonBorderRadius) || 2,
21
+ this._buttonHoverColor = (null !== (_k = null === (_j = null == style ? void 0 : style.buttonStyle) || void 0 === _j ? void 0 : _j.buttonHoverColor) && void 0 !== _k ? _k : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonHoverColor) || "#4080FF",
22
+ this._buttonHoverBorderColor = (null !== (_m = null === (_l = null == style ? void 0 : style.buttonStyle) || void 0 === _l ? void 0 : _l.buttonHoverBorderColor) && void 0 !== _m ? _m : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonHoverBorderColor) || "#4080FF",
23
+ this._buttonTextHoverColor = null !== (_p = null === (_o = null == style ? void 0 : style.buttonStyle) || void 0 === _o ? void 0 : _o.buttonTextHoverColor) && void 0 !== _p ? _p : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonTextHoverColor,
24
+ this._buttonDisableColor = (null !== (_r = null === (_q = null == style ? void 0 : style.buttonStyle) || void 0 === _q ? void 0 : _q.buttonDisableColor) && void 0 !== _r ? _r : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonDisableColor) || "#94bfff",
25
+ this._buttonDisableBorderColor = (null !== (_t = null === (_s = null == style ? void 0 : style.buttonStyle) || void 0 === _s ? void 0 : _s.buttonDisableBorderColor) && void 0 !== _t ? _t : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonDisableBorderColor) || "#94bfff",
26
+ this._buttonTextDisableColor = null !== (_v = null === (_u = null == style ? void 0 : style.buttonStyle) || void 0 === _u ? void 0 : _u.buttonTextDisableColor) && void 0 !== _v ? _v : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonTextDisableColor,
27
+ this._buttonPadding = (null !== (_x = null === (_w = null == style ? void 0 : style.buttonStyle) || void 0 === _w ? void 0 : _w.buttonPadding) && void 0 !== _x ? _x : null == buttonThemeStyle ? void 0 : buttonThemeStyle.buttonPadding) || 10;
28
+ }
29
+ get buttonColor() {
30
+ return this._buttonColor;
31
+ }
32
+ set buttonColor(buttonColor) {
33
+ this._buttonColor = buttonColor;
34
+ }
35
+ get buttonBorderColor() {
36
+ return this._buttonBorderColor;
37
+ }
38
+ set buttonBorderColor(buttonBorderColor) {
39
+ this._buttonBorderColor = buttonBorderColor;
40
+ }
41
+ get buttonLineWidth() {
42
+ return this._buttonLineWidth;
43
+ }
44
+ set buttonLineWidth(buttonLineWidth) {
45
+ this._buttonLineWidth = buttonLineWidth;
46
+ }
47
+ get buttonBorderRadius() {
48
+ return this._buttonBorderRadius;
49
+ }
50
+ set buttonBorderRadius(buttonBorderRadius) {
51
+ this._buttonBorderRadius = buttonBorderRadius;
52
+ }
53
+ get buttonHoverColor() {
54
+ return this._buttonHoverColor;
55
+ }
56
+ set buttonHoverColor(buttonHoverColor) {
57
+ this._buttonHoverColor = buttonHoverColor;
58
+ }
59
+ get buttonHoverBorderColor() {
60
+ return this._buttonHoverBorderColor;
61
+ }
62
+ set buttonHoverBorderColor(buttonHoverBorderColor) {
63
+ this._buttonHoverBorderColor = buttonHoverBorderColor;
64
+ }
65
+ get buttonTextHoverColor() {
66
+ return this._buttonTextHoverColor;
67
+ }
68
+ set buttonTextHoverColor(buttonTextHoverColor) {
69
+ this._buttonTextHoverColor = buttonTextHoverColor;
70
+ }
71
+ get buttonDisableColor() {
72
+ return this._buttonDisableColor;
73
+ }
74
+ set buttonDisableColor(buttonDisableColor) {
75
+ this._buttonDisableColor = buttonDisableColor;
76
+ }
77
+ get buttonDisableBorderColor() {
78
+ return this._buttonDisableBorderColor;
79
+ }
80
+ set buttonDisableBorderColor(buttonDisableBorderColor) {
81
+ this._buttonDisableBorderColor = buttonDisableBorderColor;
82
+ }
83
+ get buttonTextDisableColor() {
84
+ return this._buttonTextDisableColor;
85
+ }
86
+ set buttonTextDisableColor(buttonTextDisableColor) {
87
+ this._buttonTextDisableColor = buttonTextDisableColor;
88
+ }
89
+ get buttonTextHoverBorderColor() {
90
+ return this._buttonTextHoverBorderColor;
91
+ }
92
+ set buttonTextHoverBorderColor(buttonTextHoverBorderColor) {
93
+ this._buttonTextHoverBorderColor = buttonTextHoverBorderColor;
94
+ }
95
+ get buttonPadding() {
96
+ return this._buttonPadding;
97
+ }
98
+ set buttonPadding(buttonPadding) {
99
+ this._buttonPadding = buttonPadding;
100
+ }
101
+ getStyle(style) {
102
+ return new ButtonStyle(style, this);
103
+ }
104
+ clone() {
105
+ return new ButtonStyle(this);
106
+ }
107
+ }
108
+
109
+ exports.ButtonStyle = ButtonStyle;
110
+ //# sourceMappingURL=ButtonStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/body-helper/style/ButtonStyle.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AAGjC,IAAI,YAAyB,CAAC;AAE9B,MAAa,WAAY,SAAQ,aAAK;IAcpC,MAAM,KAAK,OAAO;QAChB,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,GA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wBAAwB,CAAC;IAC5D,CAAC;IAED,IAAI,sBAAsB;QACxB,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACtC,CAAC;IACD,IAAI,sBAAsB,CAAC,sBAA8B;QACvD,IAAI,CAAC,uBAAuB,GAAG,sBAAsB,CAAC;IACxD,CAAC;IAED,IAAI,0BAA0B;QAC5B,OAAO,IAAI,CAAC,2BAA2B,CAAC;IAC1C,CAAC;IACD,IAAI,0BAA0B,CAAC,0BAAkC;QAC/D,IAAI,CAAC,2BAA2B,GAAG,0BAA0B,CAAC;IAChE,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IACD,IAAI,aAAa,CAAC,aAAqB;QACrC,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAED,QAAQ,CAAC,KAAmB;QAC1B,OAAO,IAAI,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,KAAK;QACH,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AAtID,kCAsIC","file":"ButtonStyle.js","sourcesContent":["import type { IStyleOption, ButtonStyleOption } from '../../ts-types';\nimport { Style } from '../style';\nimport type { ButtonStyle as ButtonStyleThemeOption } from '../../ts-types/column/style';\n\nlet defaultStyle: ButtonStyle;\n\nexport class ButtonStyle extends Style {\n private _buttonColor: string;\n private _buttonBorderColor: string;\n private _buttonLineWidth: number;\n private _buttonBorderRadius: number;\n private _buttonHoverColor: string;\n private _buttonHoverBorderColor: string;\n private _buttonTextHoverColor: string;\n private _buttonDisableColor: string;\n private _buttonDisableBorderColor: string;\n private _buttonTextDisableColor: string;\n private _buttonTextHoverBorderColor: string;\n private _buttonPadding: number;\n\n static get DEFAULT(): ButtonStyle {\n return defaultStyle ? defaultStyle : (defaultStyle = new ButtonStyle());\n }\n\n constructor(\n style: ButtonStyleOption = {},\n headerStyle: ButtonStyleOption = {},\n buttonThemeStyle: ButtonStyleThemeOption = {}\n ) {\n super(style, headerStyle);\n\n this._buttonColor = (style?.buttonStyle?.buttonColor ?? buttonThemeStyle?.buttonColor) || '#165DFF';\n this._buttonBorderColor =\n (style?.buttonStyle?.buttonBorderColor ?? buttonThemeStyle?.buttonBorderColor) || '#165DFF';\n this._buttonLineWidth = (style?.buttonStyle?.buttonLineWidth ?? buttonThemeStyle?.buttonLineWidth) || 1;\n this._buttonBorderRadius = (style?.buttonStyle?.buttonBorderRadius ?? buttonThemeStyle?.buttonBorderRadius) || 2;\n this._buttonHoverColor = (style?.buttonStyle?.buttonHoverColor ?? buttonThemeStyle?.buttonHoverColor) || '#4080FF';\n this._buttonHoverBorderColor =\n (style?.buttonStyle?.buttonHoverBorderColor ?? buttonThemeStyle?.buttonHoverBorderColor) || '#4080FF';\n this._buttonTextHoverColor = style?.buttonStyle?.buttonTextHoverColor ?? buttonThemeStyle?.buttonTextHoverColor;\n this._buttonDisableColor =\n (style?.buttonStyle?.buttonDisableColor ?? buttonThemeStyle?.buttonDisableColor) || '#94bfff';\n this._buttonDisableBorderColor =\n (style?.buttonStyle?.buttonDisableBorderColor ?? buttonThemeStyle?.buttonDisableBorderColor) || '#94bfff';\n this._buttonTextDisableColor =\n style?.buttonStyle?.buttonTextDisableColor ?? buttonThemeStyle?.buttonTextDisableColor;\n this._buttonPadding = (style?.buttonStyle?.buttonPadding ?? buttonThemeStyle?.buttonPadding) || 10;\n }\n\n get buttonColor(): string {\n return this._buttonColor;\n }\n set buttonColor(buttonColor: string) {\n this._buttonColor = buttonColor;\n }\n\n get buttonBorderColor(): string {\n return this._buttonBorderColor;\n }\n set buttonBorderColor(buttonBorderColor: string) {\n this._buttonBorderColor = buttonBorderColor;\n }\n\n get buttonLineWidth(): number {\n return this._buttonLineWidth;\n }\n set buttonLineWidth(buttonLineWidth: number) {\n this._buttonLineWidth = buttonLineWidth;\n }\n\n get buttonBorderRadius(): number {\n return this._buttonBorderRadius;\n }\n set buttonBorderRadius(buttonBorderRadius: number) {\n this._buttonBorderRadius = buttonBorderRadius;\n }\n\n get buttonHoverColor(): string {\n return this._buttonHoverColor;\n }\n set buttonHoverColor(buttonHoverColor: string) {\n this._buttonHoverColor = buttonHoverColor;\n }\n\n get buttonHoverBorderColor(): string {\n return this._buttonHoverBorderColor;\n }\n set buttonHoverBorderColor(buttonHoverBorderColor: string) {\n this._buttonHoverBorderColor = buttonHoverBorderColor;\n }\n\n get buttonTextHoverColor(): string {\n return this._buttonTextHoverColor;\n }\n set buttonTextHoverColor(buttonTextHoverColor: string) {\n this._buttonTextHoverColor = buttonTextHoverColor;\n }\n\n get buttonDisableColor(): string {\n return this._buttonDisableColor;\n }\n set buttonDisableColor(buttonDisableColor: string) {\n this._buttonDisableColor = buttonDisableColor;\n }\n\n get buttonDisableBorderColor(): string {\n return this._buttonDisableBorderColor;\n }\n set buttonDisableBorderColor(buttonDisableBorderColor: string) {\n this._buttonDisableBorderColor = buttonDisableBorderColor;\n }\n\n get buttonTextDisableColor(): string {\n return this._buttonTextDisableColor;\n }\n set buttonTextDisableColor(buttonTextDisableColor: string) {\n this._buttonTextDisableColor = buttonTextDisableColor;\n }\n\n get buttonTextHoverBorderColor(): string {\n return this._buttonTextHoverBorderColor;\n }\n set buttonTextHoverBorderColor(buttonTextHoverBorderColor: string) {\n this._buttonTextHoverBorderColor = buttonTextHoverBorderColor;\n }\n\n get buttonPadding(): number {\n return this._buttonPadding;\n }\n set buttonPadding(buttonPadding: number) {\n this._buttonPadding = buttonPadding;\n }\n\n getStyle(style: IStyleOption): ButtonStyle {\n return new ButtonStyle(style, this);\n }\n\n clone(): ButtonStyle {\n return new ButtonStyle(this);\n }\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import type { IStyleOption, SwitchStyleOption } from '../../ts-types';
2
+ import { Style } from '../style';
3
+ import type { SwitchStyle as SwitchStyleThemeOption } from '../../ts-types/column/style';
4
+ export declare class SwitchStyle extends Style {
5
+ private _spaceBetweenTextAndCircle;
6
+ private _circleRadius;
7
+ private _boxWidth;
8
+ private _boxHeight;
9
+ private _checkedFill;
10
+ private _uncheckedFill;
11
+ private _disableCheckedFill;
12
+ private _disableUncheckedFill;
13
+ private _circleFill;
14
+ static get DEFAULT(): SwitchStyle;
15
+ constructor(style?: SwitchStyleOption, headerStyle?: SwitchStyleOption, switchThemeStyle?: SwitchStyleThemeOption);
16
+ get spaceBetweenTextAndCircle(): number;
17
+ set spaceBetweenTextAndCircle(spaceBetweenTextAndCircle: number);
18
+ get circleRadius(): number;
19
+ set circleRadius(circleRadius: number);
20
+ get boxWidth(): number;
21
+ set boxWidth(boxWidth: number);
22
+ get boxHeight(): number;
23
+ set boxHeight(boxHeight: number);
24
+ get checkedFill(): string;
25
+ set checkedFill(checkedFill: string);
26
+ get uncheckedFill(): string;
27
+ set uncheckedFill(uncheckedFill: string);
28
+ get disableCheckedFill(): string;
29
+ set disableCheckedFill(disableCheckedFill: string);
30
+ get disableUncheckedFill(): string;
31
+ set disableUncheckedFill(disableUncheckedFill: string);
32
+ get circleFill(): string;
33
+ set circleFill(circleFill: string);
34
+ getStyle(style: IStyleOption): SwitchStyle;
35
+ clone(): SwitchStyle;
36
+ }
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.SwitchStyle = void 0;
6
+
7
+ const style_1 = require("../style");
8
+
9
+ let defaultStyle;
10
+
11
+ class SwitchStyle extends style_1.Style {
12
+ static get DEFAULT() {
13
+ return defaultStyle || (defaultStyle = new SwitchStyle);
14
+ }
15
+ constructor(style = {}, headerStyle = {}, switchThemeStyle = {}) {
16
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
17
+ super(style, headerStyle), this._spaceBetweenTextAndCircle = (null !== (_b = null !== (_a = null == style ? void 0 : style.spaceBetweenTextAndCircle) && void 0 !== _a ? _a : null == headerStyle ? void 0 : headerStyle.spaceBetweenTextAndCircle) && void 0 !== _b ? _b : null == switchThemeStyle ? void 0 : switchThemeStyle.spaceBetweenTextAndCircle) || 6,
18
+ this._circleRadius = (null !== (_d = null === (_c = null == style ? void 0 : style.switchStyle) || void 0 === _c ? void 0 : _c.circleRadius) && void 0 !== _d ? _d : null == switchThemeStyle ? void 0 : switchThemeStyle.circleRadius) || 8,
19
+ this._boxWidth = (null !== (_f = null === (_e = null == style ? void 0 : style.switchStyle) || void 0 === _e ? void 0 : _e.boxWidth) && void 0 !== _f ? _f : null == switchThemeStyle ? void 0 : switchThemeStyle.boxWidth) || 40,
20
+ this._boxHeight = (null !== (_h = null === (_g = null == style ? void 0 : style.switchStyle) || void 0 === _g ? void 0 : _g.boxHeight) && void 0 !== _h ? _h : null == switchThemeStyle ? void 0 : switchThemeStyle.boxHeight) || 24,
21
+ this._checkedFill = (null !== (_k = null === (_j = null == style ? void 0 : style.switchStyle) || void 0 === _j ? void 0 : _j.checkedFill) && void 0 !== _k ? _k : null == switchThemeStyle ? void 0 : switchThemeStyle.checkedFill) || "#165DFF",
22
+ this._uncheckedFill = (null !== (_m = null === (_l = null == style ? void 0 : style.switchStyle) || void 0 === _l ? void 0 : _l.uncheckedFill) && void 0 !== _m ? _m : null == switchThemeStyle ? void 0 : switchThemeStyle.uncheckedFill) || "#c9cdd4",
23
+ this._disableCheckedFill = (null !== (_p = null === (_o = null == style ? void 0 : style.switchStyle) || void 0 === _o ? void 0 : _o.disableCheckedFill) && void 0 !== _p ? _p : null == switchThemeStyle ? void 0 : switchThemeStyle.disableCheckedFill) || "#94bfff",
24
+ this._disableUncheckedFill = (null !== (_r = null === (_q = null == style ? void 0 : style.switchStyle) || void 0 === _q ? void 0 : _q.disableUncheckedFill) && void 0 !== _r ? _r : null == switchThemeStyle ? void 0 : switchThemeStyle.disableUncheckedFill) || "#f2f3f5",
25
+ this._circleFill = (null !== (_t = null === (_s = null == style ? void 0 : style.switchStyle) || void 0 === _s ? void 0 : _s.circleFill) && void 0 !== _t ? _t : null == switchThemeStyle ? void 0 : switchThemeStyle.circleFill) || "#FFF";
26
+ }
27
+ get spaceBetweenTextAndCircle() {
28
+ return this._spaceBetweenTextAndCircle;
29
+ }
30
+ set spaceBetweenTextAndCircle(spaceBetweenTextAndCircle) {
31
+ this._spaceBetweenTextAndCircle = spaceBetweenTextAndCircle;
32
+ }
33
+ get circleRadius() {
34
+ return this._circleRadius;
35
+ }
36
+ set circleRadius(circleRadius) {
37
+ this._circleRadius = circleRadius;
38
+ }
39
+ get boxWidth() {
40
+ return this._boxWidth;
41
+ }
42
+ set boxWidth(boxWidth) {
43
+ this._boxWidth = boxWidth;
44
+ }
45
+ get boxHeight() {
46
+ return this._boxHeight;
47
+ }
48
+ set boxHeight(boxHeight) {
49
+ this._boxHeight = boxHeight;
50
+ }
51
+ get checkedFill() {
52
+ return this._checkedFill;
53
+ }
54
+ set checkedFill(checkedFill) {
55
+ this._checkedFill = checkedFill;
56
+ }
57
+ get uncheckedFill() {
58
+ return this._uncheckedFill;
59
+ }
60
+ set uncheckedFill(uncheckedFill) {
61
+ this._uncheckedFill = uncheckedFill;
62
+ }
63
+ get disableCheckedFill() {
64
+ return this._disableCheckedFill;
65
+ }
66
+ set disableCheckedFill(disableCheckedFill) {
67
+ this._disableCheckedFill = disableCheckedFill;
68
+ }
69
+ get disableUncheckedFill() {
70
+ return this._disableUncheckedFill;
71
+ }
72
+ set disableUncheckedFill(disableUncheckedFill) {
73
+ this._disableUncheckedFill = disableUncheckedFill;
74
+ }
75
+ get circleFill() {
76
+ return this._circleFill;
77
+ }
78
+ set circleFill(circleFill) {
79
+ this._circleFill = circleFill;
80
+ }
81
+ getStyle(style) {
82
+ return new SwitchStyle(style, this);
83
+ }
84
+ clone() {
85
+ return new SwitchStyle(this);
86
+ }
87
+ }
88
+
89
+ exports.SwitchStyle = SwitchStyle;
90
+ //# sourceMappingURL=SwitchStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/body-helper/style/SwitchStyle.ts"],"names":[],"m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AlGD,kCAkGC","file":"SwitchStyle.js","sourcesContent":["import type { IStyleOption, SwitchStyleOption } from '../../ts-types';\nimport { Style } from '../style';\nimport type { SwitchStyle as SwitchStyleThemeOption } from '../../ts-types/column/style';\n\nlet defaultStyle: SwitchStyle;\n\nexport class SwitchStyle extends Style {\n private _spaceBetweenTextAndCircle: number;\n private _circleRadius: number;\n private _boxWidth: number;\n private _boxHeight: number;\n private _checkedFill: string;\n private _uncheckedFill: string;\n private _disableCheckedFill: string;\n private _disableUncheckedFill: string;\n private _circleFill: string;\n\n static get DEFAULT(): SwitchStyle {\n return defaultStyle ? defaultStyle : (defaultStyle = new SwitchStyle());\n }\n constructor(\n style: SwitchStyleOption = {},\n headerStyle: SwitchStyleOption = {},\n switchThemeStyle: SwitchStyleThemeOption = {}\n ) {\n super(style, headerStyle);\n\n this._spaceBetweenTextAndCircle =\n (style?.spaceBetweenTextAndCircle ??\n headerStyle?.spaceBetweenTextAndCircle ??\n switchThemeStyle?.spaceBetweenTextAndCircle) ||\n 6;\n this._circleRadius = (style?.switchStyle?.circleRadius ?? switchThemeStyle?.circleRadius) || 8;\n this._boxWidth = (style?.switchStyle?.boxWidth ?? switchThemeStyle?.boxWidth) || 40;\n this._boxHeight = (style?.switchStyle?.boxHeight ?? switchThemeStyle?.boxHeight) || 24;\n this._checkedFill = (style?.switchStyle?.checkedFill ?? switchThemeStyle?.checkedFill) || '#165DFF';\n this._uncheckedFill = (style?.switchStyle?.uncheckedFill ?? switchThemeStyle?.uncheckedFill) || '#c9cdd4';\n this._disableCheckedFill =\n (style?.switchStyle?.disableCheckedFill ?? switchThemeStyle?.disableCheckedFill) || '#94bfff';\n this._disableUncheckedFill =\n (style?.switchStyle?.disableUncheckedFill ?? switchThemeStyle?.disableUncheckedFill) || '#f2f3f5';\n this._circleFill = (style?.switchStyle?.circleFill ?? switchThemeStyle?.circleFill) || '#FFF';\n }\n\n get spaceBetweenTextAndCircle(): number {\n return this._spaceBetweenTextAndCircle;\n }\n set spaceBetweenTextAndCircle(spaceBetweenTextAndCircle: number) {\n this._spaceBetweenTextAndCircle = spaceBetweenTextAndCircle;\n }\n get circleRadius(): number {\n return this._circleRadius;\n }\n set circleRadius(circleRadius: number) {\n this._circleRadius = circleRadius;\n }\n get boxWidth(): number {\n return this._boxWidth;\n }\n set boxWidth(boxWidth: number) {\n this._boxWidth = boxWidth;\n }\n get boxHeight(): number {\n return this._boxHeight;\n }\n set boxHeight(boxHeight: number) {\n this._boxHeight = boxHeight;\n }\n get checkedFill(): string {\n return this._checkedFill;\n }\n set checkedFill(checkedFill: string) {\n this._checkedFill = checkedFill;\n }\n get uncheckedFill(): string {\n return this._uncheckedFill;\n }\n set uncheckedFill(uncheckedFill: string) {\n this._uncheckedFill = uncheckedFill;\n }\n get disableCheckedFill(): string {\n return this._disableCheckedFill;\n }\n set disableCheckedFill(disableCheckedFill: string) {\n this._disableCheckedFill = disableCheckedFill;\n }\n get disableUncheckedFill(): string {\n return this._disableUncheckedFill;\n }\n set disableUncheckedFill(disableUncheckedFill: string) {\n this._disableUncheckedFill = disableUncheckedFill;\n }\n get circleFill(): string {\n return this._circleFill;\n }\n set circleFill(circleFill: string) {\n this._circleFill = circleFill;\n }\n getStyle(style: IStyleOption): SwitchStyle {\n return new SwitchStyle(style, this);\n }\n clone(): SwitchStyle {\n return new SwitchStyle(this);\n }\n}\n"]}
@@ -40,13 +40,14 @@ Object.defineProperty(exports, "Style", {
40
40
  }
41
41
  });
42
42
 
43
- const CheckboxStyle_1 = require("./style/CheckboxStyle"), RadioStyle_1 = require("./style/RadioStyle"), {EVENT_TYPE: EVENT_TYPE} = Style_1.Style;
43
+ const CheckboxStyle_1 = require("./style/CheckboxStyle"), RadioStyle_1 = require("./style/RadioStyle"), SwitchStyle_1 = require("./style/SwitchStyle"), ButtonStyle_1 = require("./style/ButtonStyle"), {EVENT_TYPE: EVENT_TYPE} = Style_1.Style;
44
44
 
45
45
  function of(columnStyle, bodyStyle, styleArg, StyleClassDef = Style_1.Style, globalAutoWrapText, theme) {
46
- var _a, _b;
46
+ var _a, _b, _c, _d;
47
47
  return columnStyle || bodyStyle ? columnStyle instanceof Style_1.Style ? columnStyle : "function" == typeof columnStyle ? of(columnStyle(styleArg), bodyStyle, styleArg, StyleClassDef, globalAutoWrapText, theme) : (columnStyle || (columnStyle = {}),
48
48
  globalAutoWrapText && !(0, vutils_1.isValid)(columnStyle.autoWrapText) && (columnStyle.autoWrapText = !0),
49
- StyleClassDef === CheckboxStyle_1.CheckboxStyle ? new CheckboxStyle_1.CheckboxStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : StyleClassDef === RadioStyle_1.RadioStyle ? new RadioStyle_1.RadioStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_b = theme.radioStyle) && void 0 !== _b ? _b : {}) : new StyleClassDef(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {})) : StyleClassDef.DEFAULT;
49
+ StyleClassDef === CheckboxStyle_1.CheckboxStyle ? new CheckboxStyle_1.CheckboxStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : StyleClassDef === RadioStyle_1.RadioStyle ? new RadioStyle_1.RadioStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_b = theme.radioStyle) && void 0 !== _b ? _b : {}) : StyleClassDef === SwitchStyle_1.SwitchStyle ? new SwitchStyle_1.SwitchStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_c = theme.switchStyle) && void 0 !== _c ? _c : {}) : StyleClassDef === ButtonStyle_1.ButtonStyle ? new ButtonStyle_1.ButtonStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_d = theme.buttonStyle) && void 0 !== _d ? _d : {}) : new StyleClassDef(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {})) : StyleClassDef.DEFAULT;
50
50
  }
51
51
 
52
- exports.EVENT_TYPE = EVENT_TYPE, exports.of = of;
52
+ exports.EVENT_TYPE = EVENT_TYPE, exports.of = of;
53
+ //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/body-helper/style.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAW3C,mDAAgD;AAa9C,2FAbO,uBAAU,OAaP;AAZZ,mEAAuD;AAarD,0FAbO,8BAAS,OAaP;AAZX,qDAAkD;AAUhD,4FAVO,yBAAW,OAUP;AATb,yCAAsC;AAQpC,sFARO,aAAK,OAQP;AANP,yDAAsD;AACtD,mDAAgD;AAEhD,MAAM,EAAE,UAAU,EAAE,GAAG,aAAK,CAAC;AAE3B,gCAAU;AAUZ,SAAgB,EAAE,CAChB,WAA8B,EAC9B,SAA4B,EAC5B,QAAkC,EAClC,gBAA8B,aAAK,EACnC,kBAA2B,EAC3B,KAAiB;;IAEjB,IAAI,WAAW,IAAI,SAAS,EAAE;QAC5B,IAAI,WAAW,YAAY,aAAK,EAAE;YAChC,OAAO,WAAW,CAAC;SACpB;aAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;YAC5C,OAAO,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;SACjG;QACD,IAAI,CAAC,WAAW,EAAE;YAChB,WAAW,GAAG,EAAE,CAAC;SAClB;QACD,IAAI,kBAAkB,IAAI,CAAC,IAAA,gBAAO,EAAE,WAAmB,CAAC,YAAY,CAAC,EAAE;YACpE,WAAmB,CAAC,YAAY,GAAG,IAAI,CAAC;SAC1C;QACD,IAAI,aAAa,KAAK,6BAAa,EAAE;YACnC,OAAO,IAAI,6BAAa,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,EAAE,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAQ,EAAE,CAAC,MAAA,KAAK,CAAC,aAAa,mCAAI,EAAE,CAAQ,CAAC,CAAC;SAC3G;aAAM,IAAI,aAAa,KAAK,uBAAU,EAAE;YACvC,OAAO,IAAI,uBAAU,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,EAAE,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAQ,EAAE,CAAC,MAAA,KAAK,CAAC,UAAU,mCAAI,EAAE,CAAQ,CAAC,CAAC;SACrG;QACD,OAAO,IAAI,aAAa,CAAC,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAQ,EAAE,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAQ,CAAC,CAAC;KAChF;IACD,OAAO,aAAa,CAAC,OAAO,CAAC;AAC/B,CAAC;AA5BD,gBA4BC","file":"style.js","sourcesContent":["import { isValid } from '@visactor/vutils';\nimport type {\n ColumnStyle,\n ColumnStyleOption,\n FullExtendStyle,\n IImageStyleOption,\n ITextStyleOption,\n IStyleOption,\n StylePropertyFunctionArg\n} from '../ts-types';\n\nimport { ImageStyle } from './style/ImageStyle';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { NumberStyle } from './style/NumberStyle';\nimport { Style } from './style/Style';\nimport type { TableTheme } from '../themes/theme';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\n\nconst { EVENT_TYPE } = Style;\nexport {\n EVENT_TYPE,\n Style,\n NumberStyle,\n ImageStyle,\n TextStyle,\n // types\n IStyleOption,\n IImageStyleOption,\n ITextStyleOption\n};\nexport function of(\n columnStyle: ColumnStyleOption,\n bodyStyle: ColumnStyleOption,\n styleArg: StylePropertyFunctionArg,\n StyleClassDef: typeof Style = Style,\n globalAutoWrapText: boolean,\n theme: TableTheme\n): FullExtendStyle {\n if (columnStyle || bodyStyle) {\n if (columnStyle instanceof Style) {\n return columnStyle;\n } else if (typeof columnStyle === 'function') {\n return of(columnStyle(styleArg), bodyStyle, styleArg, StyleClassDef, globalAutoWrapText, theme);\n }\n if (!columnStyle) {\n columnStyle = {};\n }\n if (globalAutoWrapText && !isValid((columnStyle as any).autoWrapText)) {\n (columnStyle as any).autoWrapText = true;\n }\n if (StyleClassDef === CheckboxStyle) {\n return new CheckboxStyle(columnStyle ?? {}, (bodyStyle ?? {}) as any, (theme.checkboxStyle ?? {}) as any);\n } else if (StyleClassDef === RadioStyle) {\n return new RadioStyle(columnStyle ?? {}, (bodyStyle ?? {}) as any, (theme.radioStyle ?? {}) as any);\n }\n return new StyleClassDef((columnStyle ?? {}) as any, (bodyStyle ?? {}) as any);\n }\n return StyleClassDef.DEFAULT;\n}\n"]}
1
+ {"version":3,"sources":["../src/body-helper/style.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAW3C,mDAAgD;AAe9C,2FAfO,uBAAU,OAeP;AAdZ,mEAAuD;AAerD,0FAfO,8BAAS,OAeP;AAdX,qDAAkD;AAYhD,4FAZO,yBAAW,OAYP;AAXb,yCAAsC;AAUpC,sFAVO,aAAK,OAUP;AARP,yDAAsD;AACtD,mDAAgD;AAChD,qDAAkD;AAClD,qDAAkD;AAElD,MAAM,EAAE,UAAU,EAAE,GAAG,aAAK,CAAC;AAE3B,gCAAU;AAUZ,SAAgB,EAAE,CAChB,WAA8B,EAC9B,SAA4B,EAC5B,QAAkC,EAClC,gBAA8B,aAAK,EACnC,kBAA2B,EAC3B,KAAiB;;IAEjB,IAAI,WAAW,IAAI,SAAS,EAAE;QAC5B,IAAI,WAAW,YAAY,aAAK,EAAE;YAChC,OAAO,WAAW,CAAC;SACpB;aAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;YAC5C,OAAO,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,kBAAkB,EAAE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CAAC,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAQ,EAAE,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAQ,CAAC,CAAC;KAChF;IACD,OAAO,aAAa,CAAC,OAAO,CAAC;AAC/B,CAAC;AAhCD,gBAgCC","file":"style.js","sourcesContent":["import { isValid } from '@visactor/vutils';\nimport type {\n ColumnStyle,\n ColumnStyleOption,\n FullExtendStyle,\n IImageStyleOption,\n ITextStyleOption,\n IStyleOption,\n StylePropertyFunctionArg\n} from '../ts-types';\n\nimport { ImageStyle } from './style/ImageStyle';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { NumberStyle } from './style/NumberStyle';\nimport { Style } from './style/Style';\nimport type { TableTheme } from '../themes/theme';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\nimport { SwitchStyle } from './style/SwitchStyle';\nimport { ButtonStyle } from './style/ButtonStyle';\n\nconst { EVENT_TYPE } = Style;\nexport {\n EVENT_TYPE,\n Style,\n NumberStyle,\n ImageStyle,\n TextStyle,\n // types\n IStyleOption,\n IImageStyleOption,\n ITextStyleOption\n};\nexport function of(\n columnStyle: ColumnStyleOption,\n bodyStyle: ColumnStyleOption,\n styleArg: StylePropertyFunctionArg,\n StyleClassDef: typeof Style = Style,\n globalAutoWrapText: boolean,\n theme: TableTheme\n): FullExtendStyle {\n if (columnStyle || bodyStyle) {\n if (columnStyle instanceof Style) {\n return columnStyle;\n } else if (typeof columnStyle === 'function') {\n return of(columnStyle(styleArg), bodyStyle, styleArg, StyleClassDef, globalAutoWrapText, theme);\n }\n if (!columnStyle) {\n columnStyle = {};\n }\n if (globalAutoWrapText && !isValid((columnStyle as any).autoWrapText)) {\n (columnStyle as any).autoWrapText = true;\n }\n if (StyleClassDef === CheckboxStyle) {\n return new CheckboxStyle(columnStyle ?? {}, (bodyStyle ?? {}) as any, (theme.checkboxStyle ?? {}) as any);\n } else if (StyleClassDef === RadioStyle) {\n return new RadioStyle(columnStyle ?? {}, (bodyStyle ?? {}) as any, (theme.radioStyle ?? {}) as any);\n } else if (StyleClassDef === SwitchStyle) {\n return new SwitchStyle(columnStyle ?? {}, (bodyStyle ?? {}) as any, (theme.switchStyle ?? {}) as any);\n } else if (StyleClassDef === ButtonStyle) {\n return new ButtonStyle(columnStyle ?? {}, (bodyStyle ?? {}) as any, (theme.buttonStyle ?? {}) as any);\n }\n return new StyleClassDef((columnStyle ?? {}) as any, (bodyStyle ?? {}) as any);\n }\n return StyleClassDef.DEFAULT;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { BaseTableAPI } from '../../ts-types/base-table';
2
2
  import type { ICellAxisOption } from '../../ts-types/component/axis';
3
- import { LineAxis, type LineAxisAttributes } from '@visactor/vrender-components';
3
+ import { LineAxis, type LineAxisAttributes } from './../../vrender';
4
4
  import type { IOrientType } from '../../ts-types/component/util';
5
5
  import { BandAxisScale } from './band-scale';
6
6
  import { DataView } from '@visactor/vdataset';
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.CartesianAxis = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), vrender_components_1 = require("@visactor/vrender-components"), get_axis_attributes_1 = require("./get-axis-attributes"), orient_1 = require("../util/orient"), band_scale_1 = require("./band-scale"), register_1 = require("../util/register"), vdataset_1 = require("@visactor/vdataset"), vrender_1 = require("./../../vrender"), linear_scale_1 = require("./linear-scale"), label_overlap_1 = require("./label-overlap"), DEFAULT_BAND_INNER_PADDING = .1, DEFAULT_BAND_OUTER_PADDING = .3, scaleParser = scale => scale;
7
+ const vutils_1 = require("@visactor/vutils"), vrender_1 = require("./../../vrender"), get_axis_attributes_1 = require("./get-axis-attributes"), orient_1 = require("../util/orient"), band_scale_1 = require("./band-scale"), register_1 = require("../util/register"), vdataset_1 = require("@visactor/vdataset"), vrender_2 = require("./../../vrender"), linear_scale_1 = require("./linear-scale"), label_overlap_1 = require("./label-overlap"), DEFAULT_BAND_INNER_PADDING = .1, DEFAULT_BAND_OUTER_PADDING = .3, scaleParser = scale => scale;
8
8
 
9
9
  class CartesianAxis {
10
10
  constructor(option, width, height, padding, table) {
@@ -36,7 +36,7 @@ class CartesianAxis {
36
36
  }
37
37
  initData() {
38
38
  this.table._vDataSet || (this.table._vDataSet = new vdataset_1.DataSet), (0, register_1.registerDataSetInstanceParser)(this.table._vDataSet, "scale", scaleParser),
39
- (0, register_1.registerDataSetInstanceTransform)(this.table._vDataSet, "ticks", vrender_1.ticks);
39
+ (0, register_1.registerDataSetInstanceTransform)(this.table._vDataSet, "ticks", vrender_2.ticks);
40
40
  const label = this.option.label || {}, tick = this.option.tick || {}, tickData = new vdataset_1.DataView(this.table._vDataSet).parse(this.scale._scale, {
41
41
  type: "scale"
42
42
  }).transform({
@@ -66,7 +66,7 @@ class CartesianAxis {
66
66
  createComponent() {
67
67
  const axisStylrAttrs = (0, get_axis_attributes_1.getAxisAttributes)(this.option), attrs = this.getUpdateAttribute();
68
68
  attrs.verticalFactor = "top" === this.orient || "right" === this.orient ? -1 : 1,
69
- this.component = new vrender_components_1.LineAxis((0, vutils_1.merge)({
69
+ this.component = new vrender_1.LineAxis((0, vutils_1.merge)({
70
70
  disableTriggerEvent: this.table.options.disableInteraction
71
71
  }, axisStylrAttrs, attrs)), this.component.setAttributes(this.setLayoutStartPosition({
72
72
  x: this.x,