@cloudbase/weda-ui 3.1.9 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (422) hide show
  1. package/dist/configs/components/chart/bar.json +3 -3
  2. package/dist/configs/components/chart/line.json +3 -3
  3. package/dist/configs/components/chart/pie.json +3 -3
  4. package/dist/configs/components/form/departTreeSelect.json +124 -0
  5. package/dist/configs/components/form/userTreeSelect.json +128 -0
  6. package/dist/configs/components/formdetail.json +105 -0
  7. package/dist/configs/components/listView.json +9 -1
  8. package/dist/configs/components/lottery.json +1 -1
  9. package/dist/configs/components/tabs.json +10 -9
  10. package/dist/configs/components/wxOpenApi/share.json +5 -2
  11. package/dist/configs/index.d.ts +6 -0
  12. package/dist/configs/index.js +6 -0
  13. package/dist/cypress/support/commands.d.ts +1 -0
  14. package/dist/cypress/support/commands.js +40 -0
  15. package/dist/cypress/support/e2e.d.ts +24 -0
  16. package/dist/cypress/support/e2e.js +22 -0
  17. package/dist/src/configs/actions/showModal.json +48 -0
  18. package/dist/src/configs/actions/showToast.json +41 -0
  19. package/dist/src/configs/components/auth.json +16 -0
  20. package/dist/src/configs/components/button.json +239 -0
  21. package/dist/src/configs/components/calendar.json +81 -0
  22. package/dist/src/configs/components/carousel.json +292 -0
  23. package/dist/src/configs/components/chart/bar.json +954 -0
  24. package/dist/src/configs/components/chart/line.json +870 -0
  25. package/dist/src/configs/components/chart/pie.json +677 -0
  26. package/dist/src/configs/components/chart/statisticsCard.json +376 -0
  27. package/dist/src/configs/components/container.json +50 -0
  28. package/dist/src/configs/components/dataView.json +247 -0
  29. package/dist/src/configs/components/drawer.json +115 -0
  30. package/dist/src/configs/components/form/checkbox.json +179 -0
  31. package/dist/src/configs/components/form/departTreeSelect.json +124 -0
  32. package/dist/src/configs/components/form/form.json +73 -0
  33. package/dist/src/configs/components/form/input.json +154 -0
  34. package/dist/src/configs/components/form/location.json +216 -0
  35. package/dist/src/configs/components/form/radio.json +203 -0
  36. package/dist/src/configs/components/form/richText.json +133 -0
  37. package/dist/src/configs/components/form/select.json +449 -0
  38. package/dist/src/configs/components/form/switch.json +58 -0
  39. package/dist/src/configs/components/form/textarea.json +116 -0
  40. package/dist/src/configs/components/form/tips.json +34 -0
  41. package/dist/src/configs/components/form/uploader.json +171 -0
  42. package/dist/src/configs/components/form/uploaderFile.json +158 -0
  43. package/dist/src/configs/components/form/userTreeSelect.json +128 -0
  44. package/dist/src/configs/components/formdetail.json +105 -0
  45. package/dist/src/configs/components/graphicCard.json +413 -0
  46. package/dist/src/configs/components/image.json +187 -0
  47. package/dist/src/configs/components/link.json +79 -0
  48. package/dist/src/configs/components/listView.json +378 -0
  49. package/dist/src/configs/components/lottery.json +163 -0
  50. package/dist/src/configs/components/modal.json +72 -0
  51. package/dist/src/configs/components/navLayout.json +368 -0
  52. package/dist/src/configs/components/navigationBar.json +62 -0
  53. package/dist/src/configs/components/richtextview.json +26 -0
  54. package/dist/src/configs/components/scrollVeiw.json +253 -0
  55. package/dist/src/configs/components/slot.json +17 -0
  56. package/dist/src/configs/components/swiper.json +90 -0
  57. package/dist/src/configs/components/tabs.json +122 -0
  58. package/dist/src/configs/components/text.json +95 -0
  59. package/dist/src/configs/components/wedaVideo.json +89 -0
  60. package/dist/src/configs/components/wxOpenApi/phone.json +127 -0
  61. package/dist/src/configs/components/wxOpenApi/phoneCode.json +109 -0
  62. package/dist/src/configs/components/wxOpenApi/share.json +160 -0
  63. package/dist/src/configs/components/wxOpenApi/userInfo.json +156 -0
  64. package/dist/src/configs/index.d.ts +103 -0
  65. package/dist/src/configs/index.js +111 -0
  66. package/dist/src/docs/common/format.d.ts +13 -0
  67. package/dist/src/docs/common/format.js +122 -0
  68. package/dist/src/docs/common/tableView.d.ts +30 -0
  69. package/dist/src/docs/common/tableView.js +156 -0
  70. package/dist/src/index.d.ts +2 -0
  71. package/dist/src/index.js +3 -0
  72. package/dist/src/setupTests.d.ts +2 -0
  73. package/dist/src/setupTests.js +19 -0
  74. package/dist/src/web/actions/index.d.ts +2 -0
  75. package/dist/src/web/actions/index.js +2 -0
  76. package/dist/src/web/actions/showModal/index.d.ts +4 -0
  77. package/dist/src/web/actions/showModal/index.js +67 -0
  78. package/dist/src/web/actions/showToast/index.d.ts +1 -0
  79. package/dist/src/web/actions/showToast/index.js +3 -0
  80. package/dist/src/web/components/button/index.d.ts +32 -0
  81. package/dist/src/web/components/button/index.js +48 -0
  82. package/dist/src/web/components/calendar/index.d.ts +19 -0
  83. package/dist/src/web/components/calendar/index.js +189 -0
  84. package/dist/src/web/components/calendar/util.d.ts +13 -0
  85. package/dist/src/web/components/calendar/util.js +74 -0
  86. package/dist/src/web/components/carousel/index.d.ts +41 -0
  87. package/dist/src/web/components/carousel/index.js +244 -0
  88. package/dist/src/web/components/chart/bar/index.d.ts +3 -0
  89. package/dist/src/web/components/chart/bar/index.js +41 -0
  90. package/dist/src/web/components/chart/bar/index.old.d.ts +40 -0
  91. package/dist/src/web/components/chart/bar/index.old.js +56 -0
  92. package/dist/src/web/components/chart/common/Chart.d.ts +9 -0
  93. package/dist/src/web/components/chart/common/Chart.js +23 -0
  94. package/dist/src/web/components/chart/common/chart-custom-connector.d.ts +6 -0
  95. package/dist/src/web/components/chart/common/chart-custom-connector.js +35 -0
  96. package/dist/src/web/components/chart/common/chart-error.d.ts +2 -0
  97. package/dist/src/web/components/chart/common/chart-error.js +2 -0
  98. package/dist/src/web/components/chart/common/config/bar.d.ts +48 -0
  99. package/dist/src/web/components/chart/common/config/bar.js +49 -0
  100. package/dist/src/web/components/chart/common/config/global.d.ts +13 -0
  101. package/dist/src/web/components/chart/common/config/global.js +16 -0
  102. package/dist/src/web/components/chart/common/config/line.d.ts +46 -0
  103. package/dist/src/web/components/chart/common/config/line.js +49 -0
  104. package/dist/src/web/components/chart/common/config/pie.d.ts +29 -0
  105. package/dist/src/web/components/chart/common/config/pie.js +36 -0
  106. package/dist/src/web/components/chart/common/core/eChartBar.d.ts +66 -0
  107. package/dist/src/web/components/chart/common/core/eChartBar.js +201 -0
  108. package/dist/src/web/components/chart/common/core/eChartBase.d.ts +127 -0
  109. package/dist/src/web/components/chart/common/core/eChartBase.js +394 -0
  110. package/dist/src/web/components/chart/common/core/eChartLine.d.ts +60 -0
  111. package/dist/src/web/components/chart/common/core/eChartLine.js +173 -0
  112. package/dist/src/web/components/chart/common/core/eChartPie.d.ts +48 -0
  113. package/dist/src/web/components/chart/common/core/eChartPie.js +135 -0
  114. package/dist/src/web/components/chart/common/core/type.d.ts +35 -0
  115. package/dist/src/web/components/chart/common/core/type.js +9 -0
  116. package/dist/src/web/components/chart/common/data-transform.d.ts +6 -0
  117. package/dist/src/web/components/chart/common/data-transform.js +246 -0
  118. package/dist/src/web/components/chart/common/echarts.d.ts +5 -0
  119. package/dist/src/web/components/chart/common/echarts.js +24 -0
  120. package/dist/src/web/components/chart/common/error-boundary.d.ts +5 -0
  121. package/dist/src/web/components/chart/common/error-boundary.js +26 -0
  122. package/dist/src/web/components/chart/common/useChart.d.ts +8 -0
  123. package/dist/src/web/components/chart/common/useChart.js +61 -0
  124. package/dist/src/web/components/chart/line/index.d.ts +3 -0
  125. package/dist/src/web/components/chart/line/index.js +42 -0
  126. package/dist/src/web/components/chart/line/index.old.d.ts +38 -0
  127. package/dist/src/web/components/chart/line/index.old.js +53 -0
  128. package/dist/src/web/components/chart/pie/index.d.ts +3 -0
  129. package/dist/src/web/components/chart/pie/index.js +42 -0
  130. package/dist/src/web/components/chart/pie/index.old.d.ts +27 -0
  131. package/dist/src/web/components/chart/pie/index.old.js +40 -0
  132. package/dist/src/web/components/chart/statisticsCard/index.d.ts +85 -0
  133. package/dist/src/web/components/chart/statisticsCard/index.js +203 -0
  134. package/dist/src/web/components/chart/statisticsCard/interface.d.ts +13 -0
  135. package/dist/src/web/components/chart/statisticsCard/interface.js +1 -0
  136. package/dist/src/web/components/common/portal.d.ts +7 -0
  137. package/dist/src/web/components/common/portal.js +14 -0
  138. package/dist/src/web/components/container/index.d.ts +6 -0
  139. package/dist/src/web/components/container/index.js +6 -0
  140. package/dist/src/web/components/dataView/index.d.ts +6 -0
  141. package/dist/src/web/components/dataView/index.js +8 -0
  142. package/dist/src/web/components/dataView/interface.d.ts +5 -0
  143. package/dist/src/web/components/dataView/interface.js +1 -0
  144. package/dist/src/web/components/drawer/index.d.ts +13 -0
  145. package/dist/src/web/components/drawer/index.js +12 -0
  146. package/dist/src/web/components/form/checkbox/index.d.ts +13 -0
  147. package/dist/src/web/components/form/checkbox/index.js +167 -0
  148. package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
  149. package/dist/src/web/components/form/enumSelect/MultipleSelect.js +52 -0
  150. package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
  151. package/dist/src/web/components/form/enumSelect/NormalSelect.js +52 -0
  152. package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
  153. package/dist/src/web/components/form/enumSelect/SelectContainer.js +30 -0
  154. package/dist/src/web/components/form/enumSelect/index.d.ts +82 -0
  155. package/dist/src/web/components/form/enumSelect/index.js +6 -0
  156. package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
  157. package/dist/src/web/components/form/enumSelect/props/defaultProps.js +40 -0
  158. package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
  159. package/dist/src/web/components/form/enumSelect/props/propsTypes.js +47 -0
  160. package/dist/src/web/components/form/form/index.d.ts +32 -0
  161. package/dist/src/web/components/form/form/index.js +141 -0
  162. package/dist/src/web/components/form/formcell/index.d.ts +8 -0
  163. package/dist/src/web/components/form/formcell/index.js +40 -0
  164. package/dist/src/web/components/form/input/index.d.ts +14 -0
  165. package/dist/src/web/components/form/input/index.js +86 -0
  166. package/dist/src/web/components/form/location/common/mapChoose.d.ts +15 -0
  167. package/dist/src/web/components/form/location/common/mapChoose.js +495 -0
  168. package/dist/src/web/components/form/location/common/mapView.d.ts +19 -0
  169. package/dist/src/web/components/form/location/common/mapView.js +172 -0
  170. package/dist/src/web/components/form/location/common/propsConfig.d.ts +59 -0
  171. package/dist/src/web/components/form/location/common/propsConfig.js +50 -0
  172. package/dist/src/web/components/form/location/common/selectModal.d.ts +21 -0
  173. package/dist/src/web/components/form/location/common/selectModal.js +44 -0
  174. package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +36 -0
  175. package/dist/src/web/components/form/location/common/useLocationInfo.js +104 -0
  176. package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
  177. package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +325 -0
  178. package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
  179. package/dist/src/web/components/form/location/components/LocationPC/Header.js +43 -0
  180. package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
  181. package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +224 -0
  182. package/dist/src/web/components/form/location/constants.d.ts +2 -0
  183. package/dist/src/web/components/form/location/constants.js +3 -0
  184. package/dist/src/web/components/form/location/index.d.ts +1 -0
  185. package/dist/src/web/components/form/location/index.js +17 -0
  186. package/dist/src/web/components/form/radio/index.d.ts +11 -0
  187. package/dist/src/web/components/form/radio/index.js +115 -0
  188. package/dist/src/web/components/form/renderDecorator.d.ts +6 -0
  189. package/dist/src/web/components/form/renderDecorator.js +20 -0
  190. package/dist/src/web/components/form/select/allTimePicker/calendar.d.ts +13 -0
  191. package/dist/src/web/components/form/select/allTimePicker/calendar.js +104 -0
  192. package/dist/src/web/components/form/select/allTimePicker/dataUtils.d.ts +24 -0
  193. package/dist/src/web/components/form/select/allTimePicker/dataUtils.js +265 -0
  194. package/dist/src/web/components/form/select/allTimePicker/index.d.ts +14 -0
  195. package/dist/src/web/components/form/select/allTimePicker/index.js +943 -0
  196. package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +15 -0
  197. package/dist/src/web/components/form/select/dropdown-select/ui.js +55 -0
  198. package/dist/src/web/components/form/select/h5.d.ts +16 -0
  199. package/dist/src/web/components/form/select/h5.js +452 -0
  200. package/dist/src/web/components/form/select/index.d.ts +66 -0
  201. package/dist/src/web/components/form/select/index.js +241 -0
  202. package/dist/src/web/components/form/select/region/index.d.ts +6 -0
  203. package/dist/src/web/components/form/select/region/index.js +147 -0
  204. package/dist/src/web/components/form/select/time.d.ts +9 -0
  205. package/dist/src/web/components/form/select/time.js +146 -0
  206. package/dist/src/web/components/form/select/use-options.d.ts +26 -0
  207. package/dist/src/web/components/form/select/use-options.js +103 -0
  208. package/dist/src/web/components/form/select/year.d.ts +7 -0
  209. package/dist/src/web/components/form/select/year.js +72 -0
  210. package/dist/src/web/components/form/switch/index.d.ts +6 -0
  211. package/dist/src/web/components/form/switch/index.js +58 -0
  212. package/dist/src/web/components/form/textarea/index.d.ts +12 -0
  213. package/dist/src/web/components/form/textarea/index.js +66 -0
  214. package/dist/src/web/components/form/tips/index.d.ts +8 -0
  215. package/dist/src/web/components/form/tips/index.js +17 -0
  216. package/dist/src/web/components/form/uploader/index.d.ts +3 -0
  217. package/dist/src/web/components/form/uploader/index.js +42 -0
  218. package/dist/src/web/components/form/uploader/uploader.h5.d.ts +20 -0
  219. package/dist/src/web/components/form/uploader/uploader.h5.js +199 -0
  220. package/dist/src/web/components/form/uploader/uploader.pc.d.ts +29 -0
  221. package/dist/src/web/components/form/uploader/uploader.pc.js +208 -0
  222. package/dist/src/web/components/form/uploaderFile/index.d.ts +4 -0
  223. package/dist/src/web/components/form/uploaderFile/index.js +19 -0
  224. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
  225. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +328 -0
  226. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
  227. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +299 -0
  228. package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +8 -0
  229. package/dist/src/web/components/form/userOrgSelect/comTool.js +107 -0
  230. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +19 -0
  231. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +247 -0
  232. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
  233. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +158 -0
  234. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
  235. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
  236. package/dist/src/web/components/form/userOrgSelect/index.d.ts +2 -0
  237. package/dist/src/web/components/form/userOrgSelect/index.js +17 -0
  238. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +26 -0
  239. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +258 -0
  240. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
  241. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +271 -0
  242. package/dist/src/web/components/form/userOrgSelect/utils.d.ts +35 -0
  243. package/dist/src/web/components/form/userOrgSelect/utils.js +72 -0
  244. package/dist/src/web/components/formdetail/index.d.ts +28 -0
  245. package/dist/src/web/components/formdetail/index.js +170 -0
  246. package/dist/src/web/components/graphicCard/index.d.ts +46 -0
  247. package/dist/src/web/components/graphicCard/index.js +179 -0
  248. package/dist/src/web/components/image/image.d.ts +9 -0
  249. package/dist/src/web/components/image/image.js +119 -0
  250. package/dist/src/web/components/image/index.d.ts +13 -0
  251. package/dist/src/web/components/image/index.js +77 -0
  252. package/dist/src/web/components/index.d.ts +50 -0
  253. package/dist/src/web/components/index.js +99 -0
  254. package/dist/src/web/components/link/index.d.ts +24 -0
  255. package/dist/src/web/components/link/index.js +71 -0
  256. package/dist/src/web/components/listView/index.d.ts +7 -0
  257. package/dist/src/web/components/listView/index.js +296 -0
  258. package/dist/src/web/components/listView/interface.d.ts +127 -0
  259. package/dist/src/web/components/listView/interface.js +1 -0
  260. package/dist/src/web/components/lottery/index.d.ts +22 -0
  261. package/dist/src/web/components/lottery/index.js +391 -0
  262. package/dist/src/web/components/lottery/lotteryUtil.d.ts +23 -0
  263. package/dist/src/web/components/lottery/lotteryUtil.js +181 -0
  264. package/dist/src/web/components/modal/index.d.ts +17 -0
  265. package/dist/src/web/components/modal/index.js +11 -0
  266. package/dist/src/web/components/modal/modal.h5.d.ts +4 -0
  267. package/dist/src/web/components/modal/modal.h5.js +46 -0
  268. package/dist/src/web/components/modal/modal.pc.d.ts +3 -0
  269. package/dist/src/web/components/modal/modal.pc.js +31 -0
  270. package/dist/src/web/components/navLayout/index.d.ts +61 -0
  271. package/dist/src/web/components/navLayout/index.js +127 -0
  272. package/dist/src/web/components/navigationBar/common.d.ts +15 -0
  273. package/dist/src/web/components/navigationBar/common.js +127 -0
  274. package/dist/src/web/components/navigationBar/h5Menu.d.ts +14 -0
  275. package/dist/src/web/components/navigationBar/h5Menu.js +72 -0
  276. package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +12 -0
  277. package/dist/src/web/components/navigationBar/horizontalMenu.js +99 -0
  278. package/dist/src/web/components/navigationBar/index.d.ts +13 -0
  279. package/dist/src/web/components/navigationBar/index.js +157 -0
  280. package/dist/src/web/components/navigationBar/verticalMenu.d.ts +13 -0
  281. package/dist/src/web/components/navigationBar/verticalMenu.js +38 -0
  282. package/dist/src/web/components/phone/index.d.ts +18 -0
  283. package/dist/src/web/components/phone/index.js +4 -0
  284. package/dist/src/web/components/phoneCode/index.d.ts +18 -0
  285. package/dist/src/web/components/phoneCode/index.js +4 -0
  286. package/dist/src/web/components/picker/datePicker.d.ts +10 -0
  287. package/dist/src/web/components/picker/datePicker.js +31 -0
  288. package/dist/src/web/components/picker/picker.d.ts +6 -0
  289. package/dist/src/web/components/picker/picker.js +45 -0
  290. package/dist/src/web/components/picker/timePicker.d.ts +7 -0
  291. package/dist/src/web/components/picker/timePicker.js +42 -0
  292. package/dist/src/web/components/richText/const.d.ts +1 -0
  293. package/dist/src/web/components/richText/const.js +2 -0
  294. package/dist/src/web/components/richText/index.d.ts +50 -0
  295. package/dist/src/web/components/richText/index.js +352 -0
  296. package/dist/src/web/components/richTextView/index.d.ts +7 -0
  297. package/dist/src/web/components/richTextView/index.js +44 -0
  298. package/dist/src/web/components/scrollView/index.d.ts +27 -0
  299. package/dist/src/web/components/scrollView/index.js +95 -0
  300. package/dist/src/web/components/share/index.d.ts +34 -0
  301. package/dist/src/web/components/share/index.js +4 -0
  302. package/dist/src/web/components/slot/index.d.ts +6 -0
  303. package/dist/src/web/components/slot/index.js +9 -0
  304. package/dist/src/web/components/swiper/index.d.ts +24 -0
  305. package/dist/src/web/components/swiper/index.js +153 -0
  306. package/dist/src/web/components/tabs/index.d.ts +13 -0
  307. package/dist/src/web/components/tabs/index.js +15 -0
  308. package/dist/src/web/components/tabs/tabs.h5.d.ts +4 -0
  309. package/dist/src/web/components/tabs/tabs.h5.js +42 -0
  310. package/dist/src/web/components/tabs/tabs.pc.d.ts +3 -0
  311. package/dist/src/web/components/tabs/tabs.pc.js +40 -0
  312. package/dist/src/web/components/text/index.d.ts +14 -0
  313. package/dist/src/web/components/text/index.js +17 -0
  314. package/dist/src/web/components/uploaderFileView/index.d.ts +10 -0
  315. package/dist/src/web/components/uploaderFileView/index.js +46 -0
  316. package/dist/src/web/components/uploaderView/index.d.ts +17 -0
  317. package/dist/src/web/components/uploaderView/index.js +48 -0
  318. package/dist/src/web/components/userInfo/index.d.ts +26 -0
  319. package/dist/src/web/components/userInfo/index.js +4 -0
  320. package/dist/src/web/components/wedaVideo/index.d.ts +17 -0
  321. package/dist/src/web/components/wedaVideo/index.js +144 -0
  322. package/dist/src/web/index.d.ts +8 -0
  323. package/dist/src/web/index.js +4 -0
  324. package/dist/src/web/utils/classnames.d.ts +2 -0
  325. package/dist/src/web/utils/classnames.js +37 -0
  326. package/dist/src/web/utils/constant.d.ts +23 -0
  327. package/dist/src/web/utils/constant.js +24 -0
  328. package/dist/src/web/utils/debounce.d.ts +2 -0
  329. package/dist/src/web/utils/debounce.js +92 -0
  330. package/dist/src/web/utils/getLocalCounter.d.ts +1 -0
  331. package/dist/src/web/utils/getLocalCounter.js +4 -0
  332. package/dist/src/web/utils/getUserService.d.ts +11 -0
  333. package/dist/src/web/utils/getUserService.js +156 -0
  334. package/dist/src/web/utils/isObjectEqual.d.ts +2 -0
  335. package/dist/src/web/utils/isObjectEqual.js +12 -0
  336. package/dist/src/web/utils/loading-fallback.d.ts +2 -0
  337. package/dist/src/web/utils/loading-fallback.js +2 -0
  338. package/dist/src/web/utils/lodash.d.ts +1 -0
  339. package/dist/src/web/utils/lodash.js +2 -0
  340. package/dist/src/web/utils/platform.d.ts +18 -0
  341. package/dist/src/web/utils/platform.js +193 -0
  342. package/dist/src/web/utils/tcb.d.ts +33 -0
  343. package/dist/src/web/utils/tcb.js +118 -0
  344. package/dist/src/web/utils/tmap.d.ts +3 -0
  345. package/dist/src/web/utils/tmap.js +21 -0
  346. package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +1 -0
  347. package/dist/src/web/utils/use-cloud-id-temp-url.js +15 -0
  348. package/dist/src/web/utils/useSetState.d.ts +1 -0
  349. package/dist/src/web/utils/useSetState.js +8 -0
  350. package/dist/src/web/utils/useSyncValue.d.ts +4 -0
  351. package/dist/src/web/utils/useSyncValue.js +15 -0
  352. package/dist/src/web/utils/weui.d.ts +1 -0
  353. package/dist/src/web/utils/weui.js +2 -0
  354. package/dist/web/components/calendar/index.js +10 -2
  355. package/dist/web/components/carousel/index.js +4 -0
  356. package/dist/web/components/chart/common/core/eChartBase.js +8 -2
  357. package/dist/web/components/form/form/index.js +10 -7
  358. package/dist/web/components/form/location/common/mapChoose.js +2 -0
  359. package/dist/web/components/form/location/common/mapView.js +2 -0
  360. package/dist/web/components/form/location/components/LocationH5/location.h5.js +3 -1
  361. package/dist/web/components/form/location/components/LocationH5/location.module.css +3 -0
  362. package/dist/web/components/form/select/allTimePicker/calendar.css +114 -0
  363. package/dist/web/components/form/select/allTimePicker/index.css +136 -0
  364. package/dist/web/components/form/select/h5.js +4 -0
  365. package/dist/web/components/form/select/index.js +2 -8
  366. package/dist/web/components/form/switch/index.js +3 -2
  367. package/dist/web/components/form/switch/switch.module.css +7 -0
  368. package/dist/web/components/form/uploader/uploader.h5.d.ts +1 -0
  369. package/dist/web/components/form/uploader/uploader.h5.js +14 -10
  370. package/dist/web/components/form/uploader/uploader.pc.js +1 -1
  371. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +14 -12
  372. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +8 -8
  373. package/dist/web/components/form/userOrgSelect/comTool.d.ts +7 -0
  374. package/dist/web/components/form/userOrgSelect/comTool.js +89 -0
  375. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +20 -0
  376. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +259 -0
  377. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
  378. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +153 -0
  379. package/dist/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
  380. package/dist/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
  381. package/dist/web/components/form/userOrgSelect/index.d.ts +2 -0
  382. package/dist/web/components/form/userOrgSelect/index.js +17 -0
  383. package/dist/web/components/form/userOrgSelect/userOrgSelect.css +805 -0
  384. package/dist/web/components/form/userOrgSelect/userOrgSelect.less +643 -0
  385. package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +24 -0
  386. package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +276 -0
  387. package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
  388. package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +229 -0
  389. package/dist/web/components/form/userOrgSelect/utils.d.ts +35 -0
  390. package/dist/web/components/form/userOrgSelect/utils.js +72 -0
  391. package/dist/web/components/formdetail/index.css +115 -0
  392. package/dist/web/components/formdetail/index.d.ts +28 -0
  393. package/dist/web/components/formdetail/index.js +170 -0
  394. package/dist/web/components/index.d.ts +3 -0
  395. package/dist/web/components/index.js +3 -0
  396. package/dist/web/components/listView/index.css +35 -5
  397. package/dist/web/components/listView/index.js +92 -68
  398. package/dist/web/components/listView/interface.d.ts +5 -0
  399. package/dist/web/components/lottery/index.js +2 -1
  400. package/dist/web/components/lottery/lotteryUtil.js +1 -0
  401. package/dist/web/components/navigationBar/index.css +21 -29
  402. package/dist/web/components/richText/index.css +1 -0
  403. package/dist/web/components/swiper/index.js +5 -1
  404. package/dist/web/components/wedaVideo/index.js +1 -0
  405. package/dist/web/utils/getUserService.d.ts +17 -0
  406. package/dist/web/utils/getUserService.js +148 -0
  407. package/dist/web/utils/platform.js +2 -0
  408. package/dist/web/weda-ui.css +9 -0
  409. package/package.json +27 -13
  410. package/dist/asset-manifest.json +0 -17
  411. package/dist/index.html +0 -88
  412. package/dist/static/js/bundle.js +0 -963
  413. package/dist/static/js/bundle.js.map +0 -1
  414. package/dist/static/js/main.chunk.js +0 -8841
  415. package/dist/static/js/main.chunk.js.map +0 -1
  416. package/dist/static/js/vendors~main.chunk.js +0 -247885
  417. package/dist/static/js/vendors~main.chunk.js.map +0 -1
  418. package/dist/static/media/ef6fa527e24e354765d806b826b41391.fa67580a.svg +0 -627
  419. package/dist/web/components/auth/index.d.ts +0 -10
  420. package/dist/web/components/auth/index.js +0 -37
  421. package/dist/web/utils/events.d.ts +0 -1
  422. package/dist/web/utils/events.js +0 -2
@@ -0,0 +1,135 @@
1
+ import EchartBase from './eChartBase';
2
+ import getConfig from '../config/pie';
3
+ /**
4
+ * 饼状图表
5
+ * @author loonglong
6
+ **/
7
+ class EchartPie extends EchartBase {
8
+ constructor() {
9
+ super();
10
+ const config = getConfig();
11
+ this.config = { ...this.config, ...config };
12
+ }
13
+ async setSourceData({ dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, }) {
14
+ const { name = '', type = '', methodName = '' } = dataSource;
15
+ if (name !== '') {
16
+ const params = this.createWhere({
17
+ filterData,
18
+ xField,
19
+ xStatistics,
20
+ xIsCountEmpty,
21
+ yField,
22
+ });
23
+ const arrSourData = await this.getSourceData(name, methodName, type, params);
24
+ // 获取 x 轴数据
25
+ if (arrSourData.length > 0) {
26
+ const numPie = arrSourData[0].YLabels.length;
27
+ if (numPie > 0) {
28
+ const arrData = [];
29
+ let i = 0;
30
+ arrSourData.forEach((itemSource) => {
31
+ const numc = setColor ? setColor.length : 0;
32
+ const strColor = numc > 0 ? { color: setColor[i % numc] } : {};
33
+ arrData.push({
34
+ value: itemSource.YLabels[0].Value,
35
+ name: itemSource.XLabel.Value,
36
+ tooltip: {},
37
+ itemStyle: strColor,
38
+ });
39
+ i = i + 1;
40
+ });
41
+ this.config.series[0].data = arrData;
42
+ }
43
+ }
44
+ else {
45
+ // this.config['series'][0].data = [];
46
+ }
47
+ }
48
+ }
49
+ setChartType({ chartType }) {
50
+ this.config.series.length > 0 &&
51
+ this.config.series.forEach((itemSeries) => {
52
+ if (chartType === 'pie') {
53
+ itemSeries.radius = '70%';
54
+ }
55
+ else {
56
+ // @ts-ignore no type
57
+ itemSeries.radius = ['40%', '70%'];
58
+ }
59
+ });
60
+ }
61
+ // 显示图表上的数据标签 单位,标签,小数位数,后缀
62
+ setIsSeriesShowSymbol({ isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
63
+ decimalDigits = decimalDigits < 0 ? 0 : decimalDigits;
64
+ let show = false;
65
+ let position = 'inner';
66
+ let formatter = null;
67
+ if (isSeriesShowSymbol || isPercent || isUnit) {
68
+ formatter = '';
69
+ }
70
+ this.config.series[0].label.show = show;
71
+ this.config.series[0].label.position = position;
72
+ if (formatter === null) {
73
+ this.config.series[0].label.normal = null;
74
+ }
75
+ else {
76
+ this.config.series[0].label.normal.formatter = (objValue) => {
77
+ let reData = '';
78
+ if (isSeriesShowSymbol) {
79
+ // 显示数值
80
+ reData = objValue.value;
81
+ }
82
+ if (isUnit) {
83
+ // 显示单位
84
+ if (unit) {
85
+ const objNewValue = this.getValueByUnit(objValue.value, unit);
86
+ reData = `${objNewValue.toFixed(decimalDigits)}${suffix}`;
87
+ }
88
+ else {
89
+ reData = `${objValue.value.toFixed(decimalDigits)}`;
90
+ }
91
+ this.config.series[0].data.forEach((itemData) => {
92
+ itemData.tooltip.formatter = (objVal) => {
93
+ const objItemData = this.getValueByUnit(objVal.value, unit);
94
+ return `${objItemData.toFixed(decimalDigits)}${suffix}`;
95
+ };
96
+ });
97
+ }
98
+ if (isPercent) {
99
+ // 显示百分比
100
+ reData = `${reData}(${objValue.percent}%)`;
101
+ }
102
+ return reData;
103
+ };
104
+ }
105
+ }
106
+ async setOptions({ chartType, isTitle, title,
107
+ // titleLocation,
108
+ dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend,
109
+ // legend2,
110
+ isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
111
+ if (dataSource) {
112
+ await this.setSourceData({
113
+ dataSource,
114
+ filterData,
115
+ setColor,
116
+ xField,
117
+ xStatistics,
118
+ xIsCountEmpty,
119
+ yField,
120
+ });
121
+ }
122
+ this.setChartType({ chartType });
123
+ this.setTitle({ isTitle, title });
124
+ this.setLegend({ isLegend, legend });
125
+ this.setIsSeriesShowSymbol({
126
+ isSeriesShowSymbol,
127
+ isPercent,
128
+ isUnit,
129
+ unit,
130
+ decimalDigits,
131
+ suffix,
132
+ });
133
+ }
134
+ }
135
+ export default EchartPie;
@@ -0,0 +1,35 @@
1
+ export interface DataSource {
2
+ name: string;
3
+ type: string;
4
+ subType: string;
5
+ provider?: string;
6
+ methodName: string;
7
+ }
8
+ export interface ObjSource {
9
+ dataSourceName: string;
10
+ dataSourceType: string;
11
+ dataSourceMethodName: string;
12
+ }
13
+ export interface Xfield {
14
+ format: string;
15
+ type: string;
16
+ title: string;
17
+ name: string;
18
+ }
19
+ declare enum CountType {
20
+ 'count' = 0,
21
+ 'sum' = 1,
22
+ 'avg' = 2,
23
+ 'max' = 3,
24
+ 'min' = 4
25
+ }
26
+ export interface YfieldOne {
27
+ key: string;
28
+ operationType: CountType;
29
+ title?: string;
30
+ }
31
+ export interface Yfield {
32
+ groupKey?: string;
33
+ numValue?: Array<YfieldOne>;
34
+ }
35
+ export {};
@@ -0,0 +1,9 @@
1
+ var CountType;
2
+ (function (CountType) {
3
+ CountType[CountType["count"] = 0] = "count";
4
+ CountType[CountType["sum"] = 1] = "sum";
5
+ CountType[CountType["avg"] = 2] = "avg";
6
+ CountType[CountType["max"] = 3] = "max";
7
+ CountType[CountType["min"] = 4] = "min";
8
+ })(CountType || (CountType = {}));
9
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { ECOption } from './echarts';
2
+ import type { IDataInputItem, IChartInput, IPieChartInput, IChartType, PropsType } from './types';
3
+ export declare const checkIsNewData: (props: PropsType) => boolean;
4
+ export declare function transform(chartType: 'pie', dataInput: Readonly<IDataInputItem[]>, chartInput: IPieChartInput): ECOption;
5
+ export declare function transform(chartType: 'bar' | 'line', dataInput: Readonly<IDataInputItem[]>, chartInput: IChartInput): ECOption;
6
+ export declare function transform(chartType: IChartType, dataInput: Readonly<IDataInputItem[]>, chartInput: Readonly<typeof chartType extends 'bar' | 'line' ? IChartInput : typeof chartType extends 'pie' ? IPieChartInput : IPieChartInput & IChartInput>): ECOption;
@@ -0,0 +1,246 @@
1
+ import { ChartError } from './chart-error';
2
+ export const checkIsNewData = (props) => {
3
+ var _a, _b;
4
+ return (Object.keys((_a = props.dataSource) !== null && _a !== void 0 ? _a : {}).length === 0 &&
5
+ Object.keys((_b = props['dataModel']) !== null && _b !== void 0 ? _b : {}).length > 0);
6
+ };
7
+ export function transform(chartType, dataInput, chartInput) {
8
+ var _a;
9
+ if (!Array.isArray(dataInput)) {
10
+ throw new ChartError('Chart 数据输入应该是数组类型');
11
+ }
12
+ const title = {
13
+ text: chartInput.title,
14
+ show: chartInput.isTitle,
15
+ left: '35%',
16
+ top: '-1%',
17
+ right: null,
18
+ };
19
+ const legend = {
20
+ show: chartInput.isLegend,
21
+ };
22
+ switch (chartInput.legend) {
23
+ case 'top':
24
+ legend.orient = 'horizontal';
25
+ legend.top = '6%';
26
+ break;
27
+ /* istanbul ignore next */
28
+ case 'left':
29
+ legend.orient = 'vertical';
30
+ legend.top = '30%';
31
+ legend.left = '1%';
32
+ break;
33
+ /* istanbul ignore next */
34
+ case 'right':
35
+ legend.orient = 'vertical';
36
+ legend.top = '30%';
37
+ legend.right = '6%';
38
+ break;
39
+ default:
40
+ legend.top = '89%';
41
+ legend.orient = 'horizontal';
42
+ break;
43
+ }
44
+ // const numberOfYAxis = dataInput?.[0]?.YLabels.length ?? 0;
45
+ // const sortedDataInput = dataInput.sort((a, b) => {
46
+ // // if (['datetime', 'date', 'time'].includes(formatType)) {
47
+ // });
48
+ // 自定义连接器或者变量不用前端排序
49
+ // 是否显示空值
50
+ const finalDataInput = (_a = (dataInput !== null && dataInput !== void 0 ? dataInput : [])) === null || _a === void 0 ? void 0 : _a.filter((item) => {
51
+ if (!chartInput.xIsCountEmpty) {
52
+ return (item.XLabel['Value'] !== undefined && item.XLabel['Value'] !== null);
53
+ }
54
+ return true;
55
+ });
56
+ const unitFormatter = (value) => {
57
+ let val = Number(value);
58
+ if (chartInput.isUnit) {
59
+ val = val / chartInput.unit;
60
+ }
61
+ return `${val.toFixed(chartInput.decimalDigits)}${chartInput.suffix}`;
62
+ };
63
+ const series = [];
64
+ const groups = [];
65
+ finalDataInput.forEach((eachAxis) => {
66
+ eachAxis.YLabels.forEach((yLabel) => {
67
+ if (yLabel.Group_Name && groups.indexOf(yLabel.Group_Name) < 0) {
68
+ // 去重且保留顺序
69
+ groups.push(yLabel.Group_Name);
70
+ }
71
+ });
72
+ });
73
+ //
74
+ if (chartType === 'pie' && groups.length > 0) {
75
+ throw new ChartError('饼图不支持分组功能');
76
+ }
77
+ if (groups.length <= 0) {
78
+ finalDataInput.forEach((item) => {
79
+ item.YLabels.forEach((eachYaxis, idx) => {
80
+ var _a, _b, _c;
81
+ if (!series[idx]) {
82
+ series[idx] = {
83
+ type: chartType,
84
+ name: chartType === 'pie'
85
+ ? undefined
86
+ : (_a = eachYaxis.Cn_Name) !== null && _a !== void 0 ? _a : eachYaxis.Name,
87
+ stack: chartInput.isPile ? 'pile' : undefined,
88
+ showSymbol: chartType === 'pie' ? undefined : chartInput.isSeriesShowSymbol,
89
+ label: {
90
+ show: chartInput.isSeriesShowSymbol, // 老逻辑这么来的
91
+ },
92
+ itemStyle: chartType === 'pie'
93
+ ? undefined
94
+ : {
95
+ color: (_c = (_b = chartInput === null || chartInput === void 0 ? void 0 : chartInput.setColor) === null || _b === void 0 ? void 0 : _b[idx % 6]) !== null && _c !== void 0 ? _c : null,
96
+ },
97
+ data: chartType === 'pie'
98
+ ? [
99
+ {
100
+ value: eachYaxis.Value,
101
+ name: item.XLabel.Value.toString(),
102
+ },
103
+ ]
104
+ : [eachYaxis.Value],
105
+ };
106
+ if (chartInput.isUnit) {
107
+ series[idx].label.formatter = (params) => unitFormatter(params.value);
108
+ }
109
+ }
110
+ else {
111
+ if (chartType === 'pie') {
112
+ series[idx].data.push({
113
+ value: eachYaxis.Value,
114
+ name: item.XLabel.Value.toString(),
115
+ });
116
+ }
117
+ else {
118
+ series[idx].data.push(eachYaxis.Value);
119
+ }
120
+ }
121
+ if (chartType === 'pie') {
122
+ // series[idx].label.position = 'inner';
123
+ series[idx].label['normal'] = {
124
+ position: 'inner',
125
+ };
126
+ series[idx]['radius'] = '70%';
127
+ series[idx]['emphasis'] = {
128
+ itemStyle: {
129
+ shadowBlur: 10,
130
+ shadowOffsetX: 0,
131
+ shadowColor: 'rgba(0, 0, 0, 0.5)',
132
+ },
133
+ };
134
+ }
135
+ });
136
+ });
137
+ }
138
+ else {
139
+ // 先给每个分组留位置
140
+ groups.forEach((groupName, idx) => {
141
+ var _a, _b;
142
+ series.push({
143
+ type: chartType,
144
+ name: groupName,
145
+ stack: chartInput.isPile ? 'pile' : undefined,
146
+ showSymbol: chartType === 'pie' ? undefined : chartInput.isSeriesShowSymbol,
147
+ label: {
148
+ show: chartInput.isSeriesShowSymbol, // 老逻辑这么来的
149
+ },
150
+ itemStyle: chartType === 'pie'
151
+ ? undefined
152
+ : {
153
+ color: (_b = (_a = chartInput === null || chartInput === void 0 ? void 0 : chartInput.setColor) === null || _a === void 0 ? void 0 : _a[idx % 6]) !== null && _b !== void 0 ? _b : null,
154
+ },
155
+ data: [],
156
+ });
157
+ });
158
+ // 然后再往data里放东西
159
+ finalDataInput.forEach((item) => {
160
+ item.YLabels.forEach((eachYaxis) => {
161
+ var _a;
162
+ if (eachYaxis.Group_Name) {
163
+ series[groups.indexOf(eachYaxis.Group_Name)].data.push({
164
+ value: eachYaxis.Value,
165
+ name: (_a = eachYaxis.Cn_Name) !== null && _a !== void 0 ? _a : eachYaxis.Name,
166
+ });
167
+ for (let i = 0; i < groups.length; i++) {
168
+ if (groups.indexOf(eachYaxis.Group_Name) !== i) {
169
+ series[i].data.push({ value: null });
170
+ }
171
+ }
172
+ }
173
+ });
174
+ });
175
+ }
176
+ console.log(dataInput, chartInput, 'TRANSFORM');
177
+ if (chartType === 'bar' || chartType === 'line') {
178
+ const xAxis = {
179
+ name: chartInput.isXaxisName ? chartInput.xAxisName : '',
180
+ nameTextStyle: { align: 'center' },
181
+ axisLabel: {
182
+ show: chartInput.isXaxisAxisLabelShow,
183
+ // 禁用默认的小屏幕自适应隐藏列
184
+ interval: 0,
185
+ rotate: chartInput.isXaxisAxisLabelRotate ? 30 : 0,
186
+ },
187
+ axisTick: {
188
+ show: chartInput.isXaxisAxisTickShow,
189
+ },
190
+ // 老逻辑是这样的,但看不懂为啥
191
+ inverse: chartInput.directionType === 'crosswise',
192
+ type: 'category',
193
+ data: [],
194
+ };
195
+ const yAxis = {
196
+ show: chartInput.isYAxisShow,
197
+ name: chartInput.isYAxisName ? chartInput.yAxisName : '',
198
+ splitLine: {
199
+ lineStyle: {
200
+ width: chartInput.isYAxisSplitlineLinestyleWidth ? 1 : 0,
201
+ type: chartInput.yAxisSplitlineLinestyleType,
202
+ },
203
+ },
204
+ axisLabel: {
205
+ padding: [0, -10, 0, 0],
206
+ formatter: null,
207
+ },
208
+ min: chartInput.yAxisMin || null,
209
+ max: chartInput.yAxisMax || null,
210
+ type: 'value',
211
+ };
212
+ xAxis.data = finalDataInput.map((item) => {
213
+ var _a;
214
+ return (_a = item.XLabel.Value) !== null && _a !== void 0 ? _a : null;
215
+ });
216
+ if (chartInput.isUnit) {
217
+ yAxis.axisLabel.formatter = unitFormatter;
218
+ }
219
+ if (chartInput.directionType === 'crosswise') {
220
+ return {
221
+ title,
222
+ legend,
223
+ xAxis: yAxis,
224
+ yAxis: xAxis,
225
+ series,
226
+ };
227
+ }
228
+ return {
229
+ title,
230
+ legend,
231
+ xAxis,
232
+ yAxis,
233
+ series,
234
+ };
235
+ }
236
+ if (chartType === 'pie') {
237
+ return {
238
+ title,
239
+ legend,
240
+ series,
241
+ tooltip: {
242
+ trigger: 'item',
243
+ },
244
+ };
245
+ }
246
+ }
@@ -0,0 +1,5 @@
1
+ import * as echarts from 'echarts/core';
2
+ import type { BarSeriesOption, LineSeriesOption, PieSeriesOption } from 'echarts/charts';
3
+ import type { TitleComponentOption, TooltipComponentOption, LegendComponentOption, GridComponentOption } from 'echarts/components';
4
+ export default echarts;
5
+ export declare type ECOption = echarts.ComposeOption<BarSeriesOption | LineSeriesOption | PieSeriesOption | TitleComponentOption | TooltipComponentOption | GridComponentOption | LegendComponentOption>;
@@ -0,0 +1,24 @@
1
+ // 引入 echarts 核心模块,核心模块提供了 echarts 使用必须要的接口。
2
+ import * as echarts from 'echarts/core';
3
+ // 引入图表,图表后缀都为 Chart
4
+ import { BarChart, LineChart, PieChart } from 'echarts/charts';
5
+ //组件,组件后缀都为 Component
6
+ import { TitleComponent, TooltipComponent, LegendComponent, GridComponent, } from 'echarts/components';
7
+ // 标签自动布局,全局过渡动画等特性
8
+ import { LabelLayout, UniversalTransition } from 'echarts/features';
9
+ // 引入 Canvas 渲染器,注意引入 CanvasRenderer 或者 SVGRenderer 是必须的一步
10
+ import { CanvasRenderer } from 'echarts/renderers';
11
+ // 注册必须的组件
12
+ echarts.use([
13
+ TitleComponent,
14
+ TooltipComponent,
15
+ GridComponent,
16
+ LegendComponent,
17
+ LabelLayout,
18
+ UniversalTransition,
19
+ CanvasRenderer,
20
+ BarChart,
21
+ LineChart,
22
+ PieChart,
23
+ ]);
24
+ export default echarts;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { CommonPropsType } from '../../../types';
3
+ export declare const ChartErrorBoundary: (props: CommonPropsType & {
4
+ children: React.ReactNode;
5
+ }) => JSX.Element;
@@ -0,0 +1,26 @@
1
+ import React, { useMemo } from 'react';
2
+ import { ErrorBoundary } from 'react-error-boundary';
3
+ import { ChartError } from './chart-error';
4
+ export const ChartErrorBoundary = (props) => {
5
+ return (React.createElement(ErrorBoundary, { FallbackComponent: ({ error, resetErrorBoundary }) => {
6
+ const errorMsg = useMemo(() => {
7
+ var _a;
8
+ if (error instanceof ChartError) {
9
+ return error.message;
10
+ }
11
+ else {
12
+ return (_a = error.stack) !== null && _a !== void 0 ? _a : error.message;
13
+ }
14
+ }, [error]);
15
+ return (React.createElement("div", { style: props.style, id: props.id, className: props.className },
16
+ React.createElement("code", null,
17
+ React.createElement("pre", { style: { display: 'inline' } }, errorMsg)),
18
+ React.createElement("a", { href: "#", style: {
19
+ padding: '0 8px',
20
+ textDecoration: 'none',
21
+ }, onClick: (ev) => {
22
+ ev.preventDefault();
23
+ resetErrorBoundary();
24
+ } }, "\u91CD\u8BD5")));
25
+ } }, props.children));
26
+ };
@@ -0,0 +1,8 @@
1
+ import { MutableRefObject, RefObject } from 'react';
2
+ import { IEchartModalBase } from './core/eChartBase';
3
+ import type IEcharts from './echarts';
4
+ export declare function useChart(ref: RefObject<HTMLElement> | MutableRefObject<HTMLElement>): IEcharts.ECharts;
5
+ /**
6
+ * @deprecated The method should not be used
7
+ */
8
+ export declare function useWedaChart(domRef: any, ModalClass: IEchartModalBase, options: IEcharts.EChartsCoreOption): void;
@@ -0,0 +1,61 @@
1
+ import { useAsync, useDeepCompareEffect, useEventListener, useIsMounted, useMountEffect, useResizeObserver, } from '@react-hookz/web';
2
+ import { useEffect, useState } from 'react';
3
+ export function useChart(ref) {
4
+ const [chartRef, setChartRef] = useState(null);
5
+ const isMounted = useIsMounted();
6
+ useMountEffect(async () => {
7
+ if (!ref.current || !isMounted) {
8
+ return;
9
+ }
10
+ const echarts = (await import(/* webpackChunkName: "echarts" */ './echarts')).default;
11
+ const echartDom = ref.current;
12
+ setChartRef(echarts.init(echartDom));
13
+ return () => {
14
+ chartRef.dispose();
15
+ };
16
+ });
17
+ useEventListener(window, 'resize', () => {
18
+ chartRef && chartRef.resize();
19
+ });
20
+ useResizeObserver(ref, () => {
21
+ chartRef && chartRef.resize();
22
+ });
23
+ return chartRef;
24
+ }
25
+ /**
26
+ * @deprecated The method should not be used
27
+ */
28
+ export function useWedaChart(domRef, ModalClass, options) {
29
+ const chart = useChart(domRef);
30
+ const getOptions = async () => {
31
+ const chartModal = new ModalClass();
32
+ let finalOptions = await chartModal.setOptions(options);
33
+ if (!finalOptions) {
34
+ finalOptions = chartModal.getOptions();
35
+ }
36
+ return finalOptions;
37
+ };
38
+ const [state, actions] = useAsync(getOptions);
39
+ useMountEffect(() => {
40
+ actions.execute();
41
+ });
42
+ useDeepCompareEffect(() => {
43
+ actions.execute();
44
+ }, [
45
+ // options 变化,包含所有配置项,包括纯前端的配置项变化都会触发setOptions里发请求,但改不动了
46
+ options,
47
+ actions,
48
+ ]);
49
+ useEffect(() => {
50
+ if (state.status === 'success' && chart) {
51
+ console.log(ModalClass.name, options, state.result, window.location.href);
52
+ chart.setOption(state.result, true // noMerge 全刷
53
+ );
54
+ }
55
+ else {
56
+ if (state.status === 'error') {
57
+ console.error(state.error);
58
+ }
59
+ }
60
+ }, [state]);
61
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { PropsType } from '../common/types';
3
+ export default function Line(props: PropsType<'line'>): JSX.Element;
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import OldLine from './index.old';
3
+ import { checkIsNewData, transform } from '../common/data-transform';
4
+ import { emptyArray } from '../../../utils/constant';
5
+ import { Chart } from '../common/Chart';
6
+ import { ChartCustomConnector } from '../common/chart-custom-connector';
7
+ import { ChartErrorBoundary } from '../common/error-boundary';
8
+ function LineImpl(props) {
9
+ if (props.dataSourceType === 'data-model') {
10
+ if (checkIsNewData(props)) {
11
+ props.dataSource = {
12
+ name: props['dataModel'].name,
13
+ type: 'database',
14
+ subType: 'database',
15
+ methodName: 'wedaAggregateData',
16
+ };
17
+ }
18
+ const oldLineProps = { ...props };
19
+ oldLineProps['dataModel'] = undefined;
20
+ oldLineProps['datasourceVariable'] = undefined;
21
+ oldLineProps['connectorMethod'] = undefined;
22
+ oldLineProps['connectorParams'] = undefined;
23
+ oldLineProps['connector'] = undefined;
24
+ return React.createElement(OldLine, { ...oldLineProps });
25
+ }
26
+ else if (props.dataSourceType === 'variable') {
27
+ const { datasourceVariable = emptyArray, id, style, className, events, ...rest } = props;
28
+ const chartOptions = transform('line', datasourceVariable, rest);
29
+ return (React.createElement(Chart, { id: id, "data-testid": "line", className: className, style: style, events: events, chartOptions: chartOptions }));
30
+ }
31
+ else if (props.dataSourceType === 'custom-connector') {
32
+ return React.createElement(ChartCustomConnector, { "data-testid": "line", type: "line", ...props });
33
+ }
34
+ else {
35
+ // 老逻辑
36
+ return React.createElement(OldLine, { ...props });
37
+ }
38
+ }
39
+ export default function Line(props) {
40
+ return (React.createElement(ChartErrorBoundary, { ...props },
41
+ React.createElement(LineImpl, { ...props })));
42
+ }
@@ -0,0 +1,38 @@
1
+ /// <reference types="react" />
2
+ import type { CommonPropsType } from '../../../types';
3
+ import { DataSource, Xfield, Yfield } from '../common/core/type';
4
+ export interface PropsType extends Omit<CommonPropsType, 'children'> {
5
+ chartType?: string;
6
+ isTitle?: boolean;
7
+ title?: string;
8
+ titleLocation?: string;
9
+ dataSource?: DataSource;
10
+ filterData?: string;
11
+ xField?: Xfield;
12
+ groupKey?: Xfield;
13
+ groupKeyTimeSpan?: string;
14
+ xStatistics?: string;
15
+ xIsCountEmpty?: boolean;
16
+ yField?: Yfield;
17
+ isLegend?: boolean;
18
+ legend?: string;
19
+ legend2?: string;
20
+ isXaxisName?: boolean;
21
+ xAxisName?: string;
22
+ isXaxisAxisLabelShow?: boolean;
23
+ isXaxisAxisTickShow?: boolean;
24
+ isXaxisAxisLabelRotate?: boolean;
25
+ isYAxisSplitlineLinestyleWidth?: boolean;
26
+ yAxisSplitlineLinestyleType?: string;
27
+ yAxisMax?: number;
28
+ yAxisMin?: number;
29
+ isYAxisName?: boolean;
30
+ yAxisName?: string;
31
+ isSeriesShowSymbol?: boolean;
32
+ isYAxisShow?: boolean;
33
+ isUnit?: boolean;
34
+ unit?: number;
35
+ decimalDigits?: number;
36
+ suffix?: string;
37
+ }
38
+ export default function Line(opts: PropsType): JSX.Element;