@cloudbase/weda-ui 3.1.0 → 3.1.3

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 (333) hide show
  1. package/dist/asset-manifest.json +17 -0
  2. package/dist/configs/actions/showModal.json +48 -0
  3. package/dist/configs/actions/showToast.json +41 -0
  4. package/dist/configs/components/auth.json +16 -0
  5. package/dist/configs/components/button.json +239 -0
  6. package/dist/configs/components/calendar.json +81 -0
  7. package/dist/configs/components/carousel.json +292 -0
  8. package/dist/configs/components/chart/bar.json +721 -0
  9. package/dist/configs/components/chart/line.json +674 -0
  10. package/dist/configs/components/chart/pie.json +494 -0
  11. package/dist/configs/components/chart/statisticsCard.json +376 -0
  12. package/dist/configs/components/container.json +50 -0
  13. package/dist/configs/components/dataView.json +239 -0
  14. package/dist/configs/components/drawer.json +115 -0
  15. package/dist/configs/components/form/checkbox.json +178 -0
  16. package/dist/configs/components/form/form.json +45 -0
  17. package/dist/configs/components/form/input.json +154 -0
  18. package/dist/configs/components/form/location.json +216 -0
  19. package/dist/configs/components/form/radio.json +203 -0
  20. package/dist/configs/components/form/richText.json +125 -0
  21. package/dist/configs/components/form/select.json +430 -0
  22. package/dist/configs/components/form/switch.json +58 -0
  23. package/dist/configs/components/form/textarea.json +116 -0
  24. package/dist/configs/components/form/tips.json +34 -0
  25. package/dist/configs/components/form/uploader.json +171 -0
  26. package/dist/configs/components/form/uploaderFile.json +158 -0
  27. package/dist/configs/components/graphicCard.json +413 -0
  28. package/dist/configs/components/image.json +187 -0
  29. package/dist/configs/components/link.json +79 -0
  30. package/dist/configs/components/listView.json +370 -0
  31. package/dist/configs/components/lottery.json +163 -0
  32. package/dist/configs/components/modal.json +72 -0
  33. package/dist/configs/components/navLayout.json +368 -0
  34. package/dist/configs/components/navigationBar.json +62 -0
  35. package/dist/configs/components/richtextview.json +26 -0
  36. package/dist/configs/components/scrollVeiw.json +253 -0
  37. package/dist/configs/components/slot.json +17 -0
  38. package/dist/configs/components/swiper.json +90 -0
  39. package/dist/configs/components/tabs.json +121 -0
  40. package/dist/configs/components/text.json +95 -0
  41. package/dist/configs/components/wedaVideo.json +89 -0
  42. package/dist/configs/components/wxOpenApi/phone.json +127 -0
  43. package/dist/configs/components/wxOpenApi/phoneCode.json +109 -0
  44. package/dist/configs/components/wxOpenApi/share.json +157 -0
  45. package/dist/configs/components/wxOpenApi/userInfo.json +156 -0
  46. package/dist/configs/index.d.ts +97 -0
  47. package/dist/configs/index.js +105 -0
  48. package/dist/docs/common/format.d.ts +13 -0
  49. package/dist/docs/common/format.js +103 -0
  50. package/dist/docs/common/tableView.d.ts +30 -0
  51. package/dist/docs/common/tableView.js +159 -0
  52. package/dist/index.d.ts +2 -0
  53. package/dist/index.html +88 -0
  54. package/dist/index.js +3 -0
  55. package/dist/setupTests.d.ts +1 -0
  56. package/dist/setupTests.js +14 -0
  57. package/dist/static/js/bundle.js +963 -0
  58. package/dist/static/js/bundle.js.map +1 -0
  59. package/dist/static/js/main.chunk.js +8841 -0
  60. package/dist/static/js/main.chunk.js.map +1 -0
  61. package/dist/static/js/vendors~main.chunk.js +247885 -0
  62. package/dist/static/js/vendors~main.chunk.js.map +1 -0
  63. package/dist/static/media/ef6fa527e24e354765d806b826b41391.fa67580a.svg +627 -0
  64. package/dist/web/actions/index.d.ts +2 -0
  65. package/dist/web/actions/index.js +2 -0
  66. package/dist/web/actions/showModal/index.d.ts +3 -0
  67. package/dist/web/actions/showModal/index.js +66 -0
  68. package/dist/web/actions/showToast/index.d.ts +1 -0
  69. package/dist/web/actions/showToast/index.js +3 -0
  70. package/dist/web/components/auth/index.d.ts +10 -0
  71. package/dist/web/components/auth/index.js +37 -0
  72. package/dist/web/components/button/index.css +27 -0
  73. package/dist/web/components/button/index.d.ts +32 -0
  74. package/dist/web/components/button/index.js +48 -0
  75. package/dist/web/components/calendar/index.css +416 -0
  76. package/dist/web/components/calendar/index.d.ts +19 -0
  77. package/dist/web/components/calendar/index.js +181 -0
  78. package/dist/web/components/calendar/util.d.ts +13 -0
  79. package/dist/web/components/calendar/util.js +74 -0
  80. package/dist/web/components/carousel/index.css +119 -0
  81. package/dist/web/components/carousel/index.d.ts +41 -0
  82. package/dist/web/components/carousel/index.js +240 -0
  83. package/dist/web/components/chart/bar/index.d.ts +41 -0
  84. package/dist/web/components/chart/bar/index.js +56 -0
  85. package/dist/web/components/chart/common/config/bar.d.ts +48 -0
  86. package/dist/web/components/chart/common/config/bar.js +49 -0
  87. package/dist/web/components/chart/common/config/global.d.ts +13 -0
  88. package/dist/web/components/chart/common/config/global.js +16 -0
  89. package/dist/web/components/chart/common/config/line.d.ts +46 -0
  90. package/dist/web/components/chart/common/config/line.js +49 -0
  91. package/dist/web/components/chart/common/config/pie.d.ts +29 -0
  92. package/dist/web/components/chart/common/config/pie.js +36 -0
  93. package/dist/web/components/chart/common/core/eChartBar.d.ts +68 -0
  94. package/dist/web/components/chart/common/core/eChartBar.js +196 -0
  95. package/dist/web/components/chart/common/core/eChartBase.d.ts +128 -0
  96. package/dist/web/components/chart/common/core/eChartBase.js +346 -0
  97. package/dist/web/components/chart/common/core/eChartLine.d.ts +62 -0
  98. package/dist/web/components/chart/common/core/eChartLine.js +168 -0
  99. package/dist/web/components/chart/common/core/eChartPie.d.ts +50 -0
  100. package/dist/web/components/chart/common/core/eChartPie.js +132 -0
  101. package/dist/web/components/chart/common/core/type.d.ts +35 -0
  102. package/dist/web/components/chart/common/core/type.js +9 -0
  103. package/dist/web/components/chart/common/echarts.d.ts +2 -0
  104. package/dist/web/components/chart/common/echarts.js +24 -0
  105. package/dist/web/components/chart/common/useChart.d.ts +8 -0
  106. package/dist/web/components/chart/common/useChart.js +60 -0
  107. package/dist/web/components/chart/line/index.d.ts +39 -0
  108. package/dist/web/components/chart/line/index.js +53 -0
  109. package/dist/web/components/chart/pie/index.d.ts +27 -0
  110. package/dist/web/components/chart/pie/index.js +40 -0
  111. package/dist/web/components/chart/statisticsCard/index.css +63 -0
  112. package/dist/web/components/chart/statisticsCard/index.d.ts +85 -0
  113. package/dist/web/components/chart/statisticsCard/index.js +203 -0
  114. package/dist/web/components/chart/statisticsCard/interface.d.ts +13 -0
  115. package/dist/web/components/chart/statisticsCard/interface.js +1 -0
  116. package/dist/web/components/container/index.d.ts +6 -0
  117. package/dist/web/components/container/index.js +6 -0
  118. package/dist/web/components/dataView/index.d.ts +6 -0
  119. package/dist/web/components/dataView/index.js +8 -0
  120. package/dist/web/components/dataView/interface.d.ts +5 -0
  121. package/dist/web/components/dataView/interface.js +1 -0
  122. package/dist/web/components/drawer/index.d.ts +13 -0
  123. package/dist/web/components/drawer/index.js +12 -0
  124. package/dist/web/components/form/checkbox/index.d.ts +13 -0
  125. package/dist/web/components/form/checkbox/index.js +167 -0
  126. package/dist/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
  127. package/dist/web/components/form/enumSelect/MultipleSelect.js +52 -0
  128. package/dist/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
  129. package/dist/web/components/form/enumSelect/NormalSelect.js +52 -0
  130. package/dist/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
  131. package/dist/web/components/form/enumSelect/SelectContainer.js +30 -0
  132. package/dist/web/components/form/enumSelect/index.d.ts +82 -0
  133. package/dist/web/components/form/enumSelect/index.js +6 -0
  134. package/dist/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
  135. package/dist/web/components/form/enumSelect/props/defaultProps.js +40 -0
  136. package/dist/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
  137. package/dist/web/components/form/enumSelect/props/propsTypes.js +47 -0
  138. package/dist/web/components/form/form/index.css +9 -0
  139. package/dist/web/components/form/form/index.d.ts +13 -0
  140. package/dist/web/components/form/form/index.js +31 -0
  141. package/dist/web/components/form/formcell/index.css +85 -0
  142. package/dist/web/components/form/formcell/index.d.ts +8 -0
  143. package/dist/web/components/form/formcell/index.js +40 -0
  144. package/dist/web/components/form/input/index.css +40 -0
  145. package/dist/web/components/form/input/index.d.ts +14 -0
  146. package/dist/web/components/form/input/index.js +86 -0
  147. package/dist/web/components/form/location/common/mapChoose.css +477 -0
  148. package/dist/web/components/form/location/common/mapChoose.d.ts +15 -0
  149. package/dist/web/components/form/location/common/mapChoose.js +435 -0
  150. package/dist/web/components/form/location/common/mapView.d.ts +19 -0
  151. package/dist/web/components/form/location/common/mapView.js +170 -0
  152. package/dist/web/components/form/location/common/propsConfig.d.ts +59 -0
  153. package/dist/web/components/form/location/common/propsConfig.js +50 -0
  154. package/dist/web/components/form/location/common/selectModal.css +45 -0
  155. package/dist/web/components/form/location/common/selectModal.d.ts +21 -0
  156. package/dist/web/components/form/location/common/selectModal.js +44 -0
  157. package/dist/web/components/form/location/common/useLocationInfo.d.ts +36 -0
  158. package/dist/web/components/form/location/common/useLocationInfo.js +104 -0
  159. package/dist/web/components/form/location/components/LocationH5/index.css +100 -0
  160. package/dist/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
  161. package/dist/web/components/form/location/components/LocationH5/location.h5.js +323 -0
  162. package/dist/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
  163. package/dist/web/components/form/location/components/LocationPC/Header.js +43 -0
  164. package/dist/web/components/form/location/components/LocationPC/index.css +40 -0
  165. package/dist/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
  166. package/dist/web/components/form/location/components/LocationPC/location.PC.js +224 -0
  167. package/dist/web/components/form/location/constants.d.ts +2 -0
  168. package/dist/web/components/form/location/constants.js +3 -0
  169. package/dist/web/components/form/location/index.css +13 -0
  170. package/dist/web/components/form/location/index.d.ts +1 -0
  171. package/dist/web/components/form/location/index.js +17 -0
  172. package/dist/web/components/form/radio/index.css +12 -0
  173. package/dist/web/components/form/radio/index.d.ts +11 -0
  174. package/dist/web/components/form/radio/index.js +115 -0
  175. package/dist/web/components/form/renderDecorator.d.ts +6 -0
  176. package/dist/web/components/form/renderDecorator.js +20 -0
  177. package/dist/web/components/form/select/h5.d.ts +16 -0
  178. package/dist/web/components/form/select/h5.js +504 -0
  179. package/dist/web/components/form/select/index.css +27 -0
  180. package/dist/web/components/form/select/index.d.ts +65 -0
  181. package/dist/web/components/form/select/index.js +301 -0
  182. package/dist/web/components/form/select/region/index.d.ts +6 -0
  183. package/dist/web/components/form/select/region/index.js +147 -0
  184. package/dist/web/components/form/select/time.d.ts +9 -0
  185. package/dist/web/components/form/select/time.js +146 -0
  186. package/dist/web/components/form/select/year.d.ts +7 -0
  187. package/dist/web/components/form/select/year.js +72 -0
  188. package/dist/web/components/form/switch/index.d.ts +6 -0
  189. package/dist/web/components/form/switch/index.js +57 -0
  190. package/dist/web/components/form/textarea/index.css +11 -0
  191. package/dist/web/components/form/textarea/index.d.ts +12 -0
  192. package/dist/web/components/form/textarea/index.js +66 -0
  193. package/dist/web/components/form/tips/index.css +4 -0
  194. package/dist/web/components/form/tips/index.d.ts +8 -0
  195. package/dist/web/components/form/tips/index.js +17 -0
  196. package/dist/web/components/form/uploader/index.css +118 -0
  197. package/dist/web/components/form/uploader/index.d.ts +3 -0
  198. package/dist/web/components/form/uploader/index.js +42 -0
  199. package/dist/web/components/form/uploader/uploader.h5.d.ts +19 -0
  200. package/dist/web/components/form/uploader/uploader.h5.js +201 -0
  201. package/dist/web/components/form/uploader/uploader.pc.d.ts +29 -0
  202. package/dist/web/components/form/uploader/uploader.pc.js +182 -0
  203. package/dist/web/components/form/uploaderFile/index.css +422 -0
  204. package/dist/web/components/form/uploaderFile/index.d.ts +4 -0
  205. package/dist/web/components/form/uploaderFile/index.js +19 -0
  206. package/dist/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
  207. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +315 -0
  208. package/dist/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
  209. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +290 -0
  210. package/dist/web/components/graphicCard/index.css +159 -0
  211. package/dist/web/components/graphicCard/index.d.ts +31 -0
  212. package/dist/web/components/graphicCard/index.js +166 -0
  213. package/dist/web/components/image/image.d.ts +9 -0
  214. package/dist/web/components/image/image.js +119 -0
  215. package/dist/web/components/image/index.css +54 -0
  216. package/dist/web/components/image/index.d.ts +13 -0
  217. package/dist/web/components/image/index.js +91 -0
  218. package/dist/web/components/index.d.ts +47 -0
  219. package/dist/web/components/index.js +94 -0
  220. package/dist/web/components/link/index.css +8 -0
  221. package/dist/web/components/link/index.d.ts +24 -0
  222. package/dist/web/components/link/index.js +71 -0
  223. package/dist/web/components/listView/index.css +143 -0
  224. package/dist/web/components/listView/index.d.ts +7 -0
  225. package/dist/web/components/listView/index.js +262 -0
  226. package/dist/web/components/listView/interface.d.ts +122 -0
  227. package/dist/web/components/listView/interface.js +1 -0
  228. package/dist/web/components/lottery/index.css +359 -0
  229. package/dist/web/components/lottery/index.d.ts +22 -0
  230. package/dist/web/components/lottery/index.js +390 -0
  231. package/dist/web/components/lottery/lotteryUtil.d.ts +23 -0
  232. package/dist/web/components/lottery/lotteryUtil.js +180 -0
  233. package/dist/web/components/modal/h5.css +53 -0
  234. package/dist/web/components/modal/index.d.ts +17 -0
  235. package/dist/web/components/modal/index.js +11 -0
  236. package/dist/web/components/modal/modal.h5.d.ts +4 -0
  237. package/dist/web/components/modal/modal.h5.js +46 -0
  238. package/dist/web/components/modal/modal.pc.d.ts +3 -0
  239. package/dist/web/components/modal/modal.pc.js +31 -0
  240. package/dist/web/components/navLayout/index.css +332 -0
  241. package/dist/web/components/navLayout/index.d.ts +46 -0
  242. package/dist/web/components/navLayout/index.js +116 -0
  243. package/dist/web/components/navigationBar/common.d.ts +15 -0
  244. package/dist/web/components/navigationBar/common.js +127 -0
  245. package/dist/web/components/navigationBar/h5Menu.d.ts +14 -0
  246. package/dist/web/components/navigationBar/h5Menu.js +72 -0
  247. package/dist/web/components/navigationBar/horizontalMenu.d.ts +12 -0
  248. package/dist/web/components/navigationBar/horizontalMenu.js +99 -0
  249. package/dist/web/components/navigationBar/index.css +762 -0
  250. package/dist/web/components/navigationBar/index.d.ts +13 -0
  251. package/dist/web/components/navigationBar/index.js +157 -0
  252. package/dist/web/components/navigationBar/verticalMenu.d.ts +13 -0
  253. package/dist/web/components/navigationBar/verticalMenu.js +38 -0
  254. package/dist/web/components/phone/index.d.ts +18 -0
  255. package/dist/web/components/phone/index.js +4 -0
  256. package/dist/web/components/phoneCode/index.d.ts +18 -0
  257. package/dist/web/components/phoneCode/index.js +4 -0
  258. package/dist/web/components/picker/datePicker.d.ts +10 -0
  259. package/dist/web/components/picker/datePicker.js +31 -0
  260. package/dist/web/components/picker/picker.d.ts +6 -0
  261. package/dist/web/components/picker/picker.js +45 -0
  262. package/dist/web/components/picker/timePicker.d.ts +7 -0
  263. package/dist/web/components/picker/timePicker.js +42 -0
  264. package/dist/web/components/richText/const.d.ts +1 -0
  265. package/dist/web/components/richText/const.js +2 -0
  266. package/dist/web/components/richText/index.css +93 -0
  267. package/dist/web/components/richText/index.d.ts +51 -0
  268. package/dist/web/components/richText/index.js +298 -0
  269. package/dist/web/components/richTextView/index.css +63 -0
  270. package/dist/web/components/richTextView/index.d.ts +7 -0
  271. package/dist/web/components/richTextView/index.js +44 -0
  272. package/dist/web/components/scrollView/index.d.ts +27 -0
  273. package/dist/web/components/scrollView/index.js +95 -0
  274. package/dist/web/components/share/index.d.ts +34 -0
  275. package/dist/web/components/share/index.js +4 -0
  276. package/dist/web/components/slot/index.d.ts +6 -0
  277. package/dist/web/components/slot/index.js +9 -0
  278. package/dist/web/components/swiper/index.css +106 -0
  279. package/dist/web/components/swiper/index.d.ts +24 -0
  280. package/dist/web/components/swiper/index.js +149 -0
  281. package/dist/web/components/tabs/index.css +64 -0
  282. package/dist/web/components/tabs/index.d.ts +13 -0
  283. package/dist/web/components/tabs/index.js +15 -0
  284. package/dist/web/components/tabs/tabs.h5.d.ts +4 -0
  285. package/dist/web/components/tabs/tabs.h5.js +42 -0
  286. package/dist/web/components/tabs/tabs.pc.d.ts +3 -0
  287. package/dist/web/components/tabs/tabs.pc.js +40 -0
  288. package/dist/web/components/text/index.css +26 -0
  289. package/dist/web/components/text/index.d.ts +14 -0
  290. package/dist/web/components/text/index.js +17 -0
  291. package/dist/web/components/uploaderFileView/index.css +11 -0
  292. package/dist/web/components/uploaderFileView/index.d.ts +10 -0
  293. package/dist/web/components/uploaderFileView/index.js +61 -0
  294. package/dist/web/components/uploaderView/index.css +31 -0
  295. package/dist/web/components/uploaderView/index.d.ts +17 -0
  296. package/dist/web/components/uploaderView/index.js +48 -0
  297. package/dist/web/components/userInfo/index.d.ts +26 -0
  298. package/dist/web/components/userInfo/index.js +4 -0
  299. package/dist/web/components/wedaVideo/index.css +42 -0
  300. package/dist/web/components/wedaVideo/index.d.ts +17 -0
  301. package/dist/web/components/wedaVideo/index.js +159 -0
  302. package/dist/web/index.d.ts +8 -0
  303. package/dist/web/index.js +4 -0
  304. package/dist/web/utils/classnames.d.ts +2 -0
  305. package/dist/web/utils/classnames.js +37 -0
  306. package/dist/web/utils/constant.d.ts +23 -0
  307. package/dist/web/utils/constant.js +24 -0
  308. package/dist/web/utils/debounce.d.ts +2 -0
  309. package/dist/web/utils/debounce.js +92 -0
  310. package/dist/web/utils/events.d.ts +1 -0
  311. package/dist/web/utils/events.js +2 -0
  312. package/dist/web/utils/getLocalCounter.d.ts +1 -0
  313. package/dist/web/utils/getLocalCounter.js +4 -0
  314. package/dist/web/utils/isObjectEqual.d.ts +2 -0
  315. package/dist/web/utils/isObjectEqual.js +12 -0
  316. package/dist/web/utils/loading-fallback.d.ts +2 -0
  317. package/dist/web/utils/loading-fallback.js +2 -0
  318. package/dist/web/utils/lodash.d.ts +1 -0
  319. package/dist/web/utils/lodash.js +2 -0
  320. package/dist/web/utils/platform.d.ts +18 -0
  321. package/dist/web/utils/platform.js +191 -0
  322. package/dist/web/utils/tcb.d.ts +23 -0
  323. package/dist/web/utils/tcb.js +82 -0
  324. package/dist/web/utils/tmap.d.ts +3 -0
  325. package/dist/web/utils/tmap.js +21 -0
  326. package/dist/web/utils/useSetState.d.ts +1 -0
  327. package/dist/web/utils/useSetState.js +8 -0
  328. package/dist/web/utils/useSyncValue.d.ts +4 -0
  329. package/dist/web/utils/useSyncValue.js +15 -0
  330. package/dist/web/utils/weui.d.ts +1 -0
  331. package/dist/web/utils/weui.js +2 -0
  332. package/dist/web/weda-ui.css +90 -0
  333. package/package.json +12 -12
@@ -0,0 +1,41 @@
1
+ /// <reference types="react" />
2
+ import type { CommonPropsType } from '../../../types';
3
+ import { DataSource, Xfield, Yfield } from '../common/core/type';
4
+ interface PropsType extends Omit<CommonPropsType, 'children'> {
5
+ directionType?: string;
6
+ isPile?: boolean;
7
+ isTitle?: boolean;
8
+ title?: string;
9
+ titleLocation?: string;
10
+ dataSource?: DataSource;
11
+ filterData?: string;
12
+ setColor?: Array<string>;
13
+ xField?: Xfield;
14
+ xStatistics?: string;
15
+ groupKey?: Xfield;
16
+ groupKeyTimeSpan?: string;
17
+ xIsCountEmpty?: boolean;
18
+ yField?: Yfield;
19
+ isLegend?: boolean;
20
+ legend?: string;
21
+ legend2?: string;
22
+ isXaxisName?: boolean;
23
+ xAxisName?: string;
24
+ isXaxisAxisLabelShow?: boolean;
25
+ isXaxisAxisTickShow?: boolean;
26
+ isXaxisAxisLabelRotate?: boolean;
27
+ isYAxisSplitlineLinestyleWidth?: boolean;
28
+ yAxisSplitlineLinestyleType?: string;
29
+ yAxisMax?: number;
30
+ yAxisMin?: number;
31
+ isYAxisName?: boolean;
32
+ yAxisName?: string;
33
+ isSeriesShowSymbol?: boolean;
34
+ isYAxisShow?: boolean;
35
+ isUnit?: boolean;
36
+ unit?: string;
37
+ decimalDigits?: number;
38
+ suffix?: string;
39
+ }
40
+ export default function Bar(opts: PropsType): JSX.Element;
41
+ export {};
@@ -0,0 +1,56 @@
1
+ import React, { useRef } from 'react';
2
+ import EchartBar from '../common/core/eChartBar';
3
+ import { useWedaChart } from '../common/useChart';
4
+ import classNames from '../../../utils/classnames';
5
+ export default function Bar(opts) {
6
+ const { directionType, isPile, id, style, className, isTitle, title, titleLocation, dataSource, setColor, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, legend2, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, } = opts;
7
+ const domRef = useRef();
8
+ useWedaChart(domRef, EchartBar, {
9
+ directionType,
10
+ isPile,
11
+ setColor,
12
+ isTitle,
13
+ title,
14
+ titleLocation,
15
+ dataSource,
16
+ filterData,
17
+ xField,
18
+ xStatistics,
19
+ groupKey,
20
+ groupKeyTimeSpan,
21
+ xIsCountEmpty,
22
+ yField,
23
+ isLegend,
24
+ legend,
25
+ legend2,
26
+ isXaxisName,
27
+ xAxisName,
28
+ isXaxisAxisLabelShow,
29
+ isXaxisAxisTickShow,
30
+ isXaxisAxisLabelRotate,
31
+ isYAxisSplitlineLinestyleWidth,
32
+ yAxisSplitlineLinestyleType,
33
+ yAxisMax,
34
+ yAxisMin,
35
+ isYAxisName,
36
+ yAxisName,
37
+ isSeriesShowSymbol,
38
+ isYAxisShow,
39
+ isUnit,
40
+ unit,
41
+ decimalDigits,
42
+ suffix,
43
+ });
44
+ const inlineStyle = {
45
+ height: '380px',
46
+ width: '100%',
47
+ backgroundColor: '#ffffff',
48
+ ...style,
49
+ };
50
+ return (React.createElement("div", { id: id, "data-testid": "bar", ref: domRef, style: inlineStyle, className: classNames({
51
+ 'weda-ui-chart-bar': true,
52
+ 'echart-wrapper-canvas': true,
53
+ 'echart-dark-body': true,
54
+ [className]: className,
55
+ }) }));
56
+ }
@@ -0,0 +1,48 @@
1
+ export default getConfig;
2
+ /** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
3
+ declare function getConfig(): {
4
+ xAxis: {
5
+ name: string;
6
+ nameTextStyle: {
7
+ align: string;
8
+ };
9
+ axisLabel: {
10
+ show: boolean;
11
+ rotate: number;
12
+ };
13
+ axisTick: {
14
+ show: boolean;
15
+ };
16
+ inverse: boolean;
17
+ type: string;
18
+ data: string[];
19
+ };
20
+ yAxis: {
21
+ type: string;
22
+ show: boolean;
23
+ name: string;
24
+ splitLine: {
25
+ lineStyle: {
26
+ width: number;
27
+ type: string;
28
+ };
29
+ };
30
+ axisLabel: {
31
+ padding: number[];
32
+ };
33
+ min: any;
34
+ max: any;
35
+ };
36
+ series: {
37
+ name: string;
38
+ data: number[];
39
+ type: string;
40
+ itemStyle: {
41
+ color: string;
42
+ };
43
+ showSymbol: boolean;
44
+ label: {
45
+ show: boolean;
46
+ };
47
+ }[];
48
+ };
@@ -0,0 +1,49 @@
1
+ /** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
2
+ const getConfig = () => {
3
+ const barH5 = {
4
+ xAxis: {
5
+ name: 'X轴名',
6
+ nameTextStyle: { align: 'center' },
7
+ axisLabel: {
8
+ show: true,
9
+ rotate: 0, // 字体倾斜
10
+ },
11
+ axisTick: {
12
+ show: true, // 刻度显示
13
+ },
14
+ inverse: false,
15
+ type: 'category',
16
+ data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
17
+ },
18
+ yAxis: {
19
+ type: 'value',
20
+ show: true,
21
+ name: 'Y轴名',
22
+ splitLine: {
23
+ lineStyle: {
24
+ width: 1,
25
+ type: 'dashed', //solid,dashed,dotted
26
+ },
27
+ },
28
+ axisLabel: { padding: [0, -10, 0, 0] },
29
+ min: null,
30
+ max: null,
31
+ },
32
+ series: [
33
+ {
34
+ name: 'demo',
35
+ data: [0, 932, 901, 934, 1290, 1330, 1320],
36
+ type: 'bar',
37
+ itemStyle: {
38
+ color: 'green',
39
+ },
40
+ showSymbol: true,
41
+ label: {
42
+ show: true, // 显示线条上的数据
43
+ },
44
+ },
45
+ ],
46
+ };
47
+ return barH5;
48
+ };
49
+ export default getConfig;
@@ -0,0 +1,13 @@
1
+ export default getConfig;
2
+ /** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
3
+ declare function getConfig(): {
4
+ title: {
5
+ text: string;
6
+ show: boolean;
7
+ left: string;
8
+ };
9
+ legend: {
10
+ top: string;
11
+ };
12
+ tooltip: {};
13
+ };
@@ -0,0 +1,16 @@
1
+ /** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
2
+ const getConfig = () => {
3
+ const globalH5 = {
4
+ title: {
5
+ text: 'demo实例',
6
+ show: true,
7
+ left: '50%',
8
+ },
9
+ legend: {
10
+ top: '88%',
11
+ },
12
+ tooltip: {},
13
+ };
14
+ return globalH5;
15
+ };
16
+ export default getConfig;
@@ -0,0 +1,46 @@
1
+ export default getConfig;
2
+ /** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
3
+ declare function getConfig(): {
4
+ xAxis: {
5
+ name: string;
6
+ nameTextStyle: {
7
+ align: string;
8
+ };
9
+ axisLabel: {
10
+ show: boolean;
11
+ rotate: number;
12
+ };
13
+ axisTick: {
14
+ show: boolean;
15
+ };
16
+ type: string;
17
+ data: string[];
18
+ };
19
+ yAxis: {
20
+ type: string;
21
+ show: boolean;
22
+ name: string;
23
+ splitLine: {
24
+ lineStyle: {
25
+ width: number;
26
+ type: string;
27
+ };
28
+ };
29
+ axisLabel: {
30
+ padding: number[];
31
+ };
32
+ min: any;
33
+ max: any;
34
+ };
35
+ series: {
36
+ name: string;
37
+ connectNulls: boolean;
38
+ data: number[];
39
+ type: string;
40
+ smooth: boolean;
41
+ showSymbol: boolean;
42
+ label: {
43
+ show: boolean;
44
+ };
45
+ }[];
46
+ };
@@ -0,0 +1,49 @@
1
+ /** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
2
+ const getConfig = () => {
3
+ const lineH5 = {
4
+ xAxis: {
5
+ name: 'X轴名',
6
+ nameTextStyle: { align: 'center' },
7
+ axisLabel: {
8
+ show: true,
9
+ rotate: 0, // 字体倾斜
10
+ },
11
+ axisTick: {
12
+ show: true, // 刻度显示
13
+ },
14
+ type: 'category',
15
+ data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
16
+ },
17
+ yAxis: {
18
+ type: 'value',
19
+ show: true,
20
+ name: 'Y轴名',
21
+ splitLine: {
22
+ lineStyle: {
23
+ width: 1,
24
+ type: 'dashed', //solid,dashed,dotted
25
+ },
26
+ },
27
+ axisLabel: {
28
+ padding: [0, -10, 0, 0],
29
+ },
30
+ min: null,
31
+ max: null,
32
+ },
33
+ series: [
34
+ {
35
+ name: 'demo',
36
+ connectNulls: true,
37
+ data: [820, 932, 901, 934, 1290, 1330, 1320],
38
+ type: 'line',
39
+ smooth: true,
40
+ showSymbol: true,
41
+ label: {
42
+ show: true, // 显示线条上的数据
43
+ },
44
+ },
45
+ ],
46
+ };
47
+ return lineH5;
48
+ };
49
+ export default getConfig;
@@ -0,0 +1,29 @@
1
+ export default getConfig;
2
+ /** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
3
+ declare function getConfig(): {
4
+ series: {
5
+ data: {
6
+ value: number;
7
+ name: string;
8
+ tooltip: {};
9
+ itemStyle: {};
10
+ }[];
11
+ label: {
12
+ show: boolean;
13
+ position: string;
14
+ normal: {
15
+ formatter: any;
16
+ position: string;
17
+ };
18
+ };
19
+ type: string;
20
+ radius: string;
21
+ emphasis: {
22
+ itemStyle: {
23
+ shadowBlur: number;
24
+ shadowOffsetX: number;
25
+ shadowColor: string;
26
+ };
27
+ };
28
+ }[];
29
+ };
@@ -0,0 +1,36 @@
1
+ /** 根据当前环境获取 pc 上配置,还是 H5上的配置 */
2
+ const getConfig = () => {
3
+ const pieH5 = {
4
+ series: [
5
+ {
6
+ // name: 'demo',
7
+ data: [
8
+ { value: 820, name: '实例数据1', tooltip: {}, itemStyle: {} },
9
+ { value: 932, name: '实例数据2', tooltip: {}, itemStyle: {} },
10
+ { value: 901, name: '实例数据3', tooltip: {}, itemStyle: {} },
11
+ { value: 934, name: '实例数据4', tooltip: {}, itemStyle: {} },
12
+ { value: 1290, name: '实例数据5', tooltip: {}, itemStyle: {} },
13
+ ],
14
+ label: {
15
+ show: true,
16
+ position: 'inner',
17
+ normal: {
18
+ formatter: null,
19
+ position: 'inner',
20
+ },
21
+ },
22
+ type: 'pie',
23
+ radius: '70%',
24
+ emphasis: {
25
+ itemStyle: {
26
+ shadowBlur: 10,
27
+ shadowOffsetX: 0,
28
+ shadowColor: 'rgba(0, 0, 0, 0.5)',
29
+ },
30
+ },
31
+ },
32
+ ],
33
+ };
34
+ return pieH5;
35
+ };
36
+ export default getConfig;
@@ -0,0 +1,68 @@
1
+ export default EchartBar;
2
+ /**
3
+ * 柱状图表
4
+ * @author loonglong
5
+ **/
6
+ declare class EchartBar extends EchartBase {
7
+ setSourceData({ dataSource, filterData, xField, xStatistics, xIsCountEmpty, groupKey, groupKeyTimeSpan, yField, isPile, }: {
8
+ dataSource: any;
9
+ filterData: any;
10
+ xField: any;
11
+ xStatistics: any;
12
+ xIsCountEmpty: any;
13
+ groupKey: any;
14
+ groupKeyTimeSpan: any;
15
+ yField: any;
16
+ isPile: any;
17
+ }): Promise<void>;
18
+ setColor({ setColor }: {
19
+ setColor: any;
20
+ }): void;
21
+ setIsSeriesShowSymbol({ isSeriesShowSymbol, isUnit, unit, decimalDigits, suffix, }: {
22
+ isSeriesShowSymbol: any;
23
+ isUnit: any;
24
+ unit: any;
25
+ decimalDigits: any;
26
+ suffix: any;
27
+ }): void;
28
+ setDirectionType({ directionType }: {
29
+ directionType: any;
30
+ }): void;
31
+ setOptions({ directionType, isPile, setColor, isTitle, title, titleLocation, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, legend2, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }: {
32
+ directionType: any;
33
+ isPile: any;
34
+ setColor: any;
35
+ isTitle: any;
36
+ title: any;
37
+ titleLocation: any;
38
+ dataSource: any;
39
+ filterData: any;
40
+ xField: any;
41
+ xStatistics: any;
42
+ groupKey: any;
43
+ groupKeyTimeSpan: any;
44
+ xIsCountEmpty: any;
45
+ yField: any;
46
+ isLegend: any;
47
+ legend: any;
48
+ legend2: any;
49
+ isXaxisName: any;
50
+ xAxisName: any;
51
+ isXaxisAxisLabelShow: any;
52
+ isXaxisAxisTickShow: any;
53
+ isXaxisAxisLabelRotate: any;
54
+ isYAxisSplitlineLinestyleWidth: any;
55
+ yAxisSplitlineLinestyleType: any;
56
+ yAxisMax: any;
57
+ yAxisMin: any;
58
+ isYAxisName: any;
59
+ yAxisName: any;
60
+ isSeriesShowSymbol: any;
61
+ isYAxisShow: any;
62
+ isUnit: any;
63
+ unit: any;
64
+ decimalDigits: any;
65
+ suffix: any;
66
+ }): Promise<any>;
67
+ }
68
+ import EchartBase from "./eChartBase";
@@ -0,0 +1,196 @@
1
+ import EchartBase from './eChartBase';
2
+ import getConfig from '../config/bar';
3
+ /**
4
+ * 柱状图表
5
+ * @author loonglong
6
+ **/
7
+ class EchartBar extends EchartBase {
8
+ constructor() {
9
+ super();
10
+ const config = getConfig();
11
+ this.config = { ...this.config, ...config };
12
+ }
13
+ async setSourceData({ dataSource, filterData, xField, xStatistics, xIsCountEmpty, groupKey, groupKeyTimeSpan, yField, isPile, }) {
14
+ const { name = '', type = '', methodName = '' } = dataSource;
15
+ if (name !== '') {
16
+ const params = this.createWhere({
17
+ filterData,
18
+ xField,
19
+ xStatistics,
20
+ xIsCountEmpty,
21
+ groupKey,
22
+ groupKeyTimeSpan,
23
+ yField,
24
+ });
25
+ const arrSourData = await this.getSourceData(name, methodName, type, params);
26
+ // 获取 x 轴数据
27
+ const sortedXAxisData = this.sortXAxisData(arrSourData, xField.format);
28
+ const arrXaxisData = this.setXaxis(sortedXAxisData, xField.format);
29
+ const arrXisCountEmptyIndex = []; // 记录空值的key
30
+ if (Object.keys(groupKey !== null && groupKey !== void 0 ? groupKey : {}).length === 0) {
31
+ const numLine = sortedXAxisData[0].YLabels.length;
32
+ if (numLine > 0) {
33
+ for (let j = 0; j < numLine; j++) {
34
+ this.config.series[j] = {
35
+ type: 'bar',
36
+ name: '',
37
+ stack: isPile ? 'pile' : null,
38
+ itemStyle: { color: null },
39
+ showSymbol: true,
40
+ label: {
41
+ show: true,
42
+ },
43
+ data: [],
44
+ };
45
+ sortedXAxisData.forEach((itemSource, index) => {
46
+ this.config.series[j].name = itemSource.YLabels[j].Cn_Name;
47
+ if ((itemSource.YLabels[j].Value === undefined ||
48
+ itemSource.YLabels[j].Value === null) &&
49
+ !xIsCountEmpty) {
50
+ arrXisCountEmptyIndex.push(index);
51
+ }
52
+ else {
53
+ const value = itemSource.YLabels[j].Value
54
+ ? itemSource.YLabels[j].Value
55
+ : 0;
56
+ this.config.series[j].data.push(value);
57
+ }
58
+ });
59
+ }
60
+ }
61
+ // 处理显示空值问题
62
+ this.setEmptyValue(xIsCountEmpty);
63
+ }
64
+ else if (groupKey) {
65
+ // 如果是分组,则这里需要特殊处理
66
+ // 按groupKey分组存放数据值
67
+ const objGroupKey = {}; // {'分组字段':[{value:'统计的值', dimensionality:'维度名', name:'统计的数值字段名'}]}
68
+ sortedXAxisData.forEach((itemSourData) => {
69
+ itemSourData.YLabels.forEach((yLabel) => {
70
+ if (!objGroupKey[yLabel.Group_Name]) {
71
+ objGroupKey[yLabel.Group_Name] = [];
72
+ }
73
+ objGroupKey[yLabel.Group_Name].push({
74
+ value: yLabel.Value,
75
+ dimensionality: itemSourData.XLabel.Value,
76
+ name: yLabel.Cn_Name,
77
+ });
78
+ });
79
+ });
80
+ // 组装图表需要的数据
81
+ const arrGroupKey = Object.keys(objGroupKey);
82
+ this.config.series = arrGroupKey.map((groupKey) => {
83
+ // groupKey分组字段中文名
84
+ const serie = {
85
+ name: groupKey,
86
+ type: 'bar',
87
+ itemStyle: {
88
+ color: null,
89
+ },
90
+ showSymbol: true,
91
+ label: {
92
+ show: true,
93
+ },
94
+ data: this.getSeriesDataGroup(arrXaxisData, objGroupKey[groupKey]),
95
+ stack: isPile ? 'pile' : null,
96
+ };
97
+ return serie;
98
+ });
99
+ this.config.tooltip.formatter = (params) => `${params.data.dimensionality}\r\n${params.data.name}\r\n${params.seriesName}:${params.value}`;
100
+ }
101
+ }
102
+ }
103
+ setColor({ setColor }) {
104
+ if (this.config.series.length > 0 && setColor && setColor.length > 0) {
105
+ let i = 0;
106
+ this.config.series.forEach((itemSeries) => {
107
+ itemSeries.itemStyle.color = setColor[i % 6];
108
+ i = i + 1;
109
+ });
110
+ }
111
+ }
112
+ // 显示图表上的数据标签 单位,标签,小数位数,后缀
113
+ setIsSeriesShowSymbol({ isSeriesShowSymbol, isUnit, unit, decimalDigits, suffix, }) {
114
+ decimalDigits = Math.max(0, decimalDigits);
115
+ this.config.series.length > 0 &&
116
+ this.config.series.forEach((itemSeries) => {
117
+ itemSeries.showSymbol = isSeriesShowSymbol;
118
+ itemSeries.label.show = isSeriesShowSymbol;
119
+ if (isUnit) {
120
+ itemSeries.label.formatter = (params) => {
121
+ const objNewValue = this.getValueByUnit(params.value, unit);
122
+ return `${objNewValue.toFixed(decimalDigits)}${suffix}`;
123
+ };
124
+ }
125
+ });
126
+ if (isUnit) {
127
+ this.config.yAxis.axisLabel.formatter = (value) => {
128
+ const objNewValue = this.getValueByUnit(value, unit);
129
+ return `${objNewValue.toFixed(decimalDigits)}${suffix}`;
130
+ };
131
+ }
132
+ else {
133
+ this.config.yAxis.axisLabel.formatter = null;
134
+ }
135
+ }
136
+ // 设置柱状图X,Y倒转
137
+ setDirectionType({ directionType }) {
138
+ let temAxis = {};
139
+ if (directionType === 'crosswise') {
140
+ // 横向
141
+ temAxis = this.config.xAxis;
142
+ this.config.xAxis = this.config.yAxis;
143
+ this.config.yAxis = temAxis;
144
+ this.config.yAxis.inverse = true;
145
+ }
146
+ else {
147
+ // 纵向
148
+ if (this.config.yAxis.inverse) {
149
+ temAxis = this.config.yAxis;
150
+ this.config.yAxis = this.config.xAxis;
151
+ this.config.xAxis = temAxis;
152
+ this.config.xAxis.inverse = false;
153
+ }
154
+ }
155
+ }
156
+ async setOptions({ directionType, isPile, setColor, isTitle, title, titleLocation, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, legend2, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }) {
157
+ legend = document.body.clientWidth < 1024 ? legend : legend2;
158
+ if (dataSource) {
159
+ await this.setSourceData({
160
+ dataSource,
161
+ filterData,
162
+ xField,
163
+ xStatistics,
164
+ xIsCountEmpty,
165
+ groupKey,
166
+ groupKeyTimeSpan,
167
+ yField,
168
+ isPile,
169
+ });
170
+ }
171
+ this.setColor({ setColor });
172
+ this.setTitle({ isTitle, title, titleLocation });
173
+ this.setLegend({ isLegend, legend });
174
+ this.setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow });
175
+ this.setIsXaxisName({ isXaxisName, xAxisName });
176
+ this.setIsXaxisAxisTickShow({ isXaxisAxisTickShow });
177
+ this.setIsXaxisAxisLabelRotate({ isXaxisAxisLabelRotate, xStatistics });
178
+ this.setIsYAxisSplitlineLinestyleWidth({
179
+ isYAxisSplitlineLinestyleWidth,
180
+ yAxisSplitlineLinestyleType,
181
+ });
182
+ this.setYAxisMaxMin({ yAxisMax, yAxisMin });
183
+ this.setIsYAxisName({ isYAxisName, yAxisName });
184
+ this.setIsYAxisShow({ isYAxisShow });
185
+ this.setIsSeriesShowSymbol({
186
+ isSeriesShowSymbol,
187
+ isUnit,
188
+ unit,
189
+ decimalDigits,
190
+ suffix,
191
+ });
192
+ this.setDirectionType({ directionType });
193
+ return this.config;
194
+ }
195
+ }
196
+ export default EchartBar;