@cloudbase/weda-ui 3.3.0 → 3.3.2

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 (454) hide show
  1. package/dist/configs/components/chart/bar.json +281 -47
  2. package/dist/configs/components/chart/line.json +245 -48
  3. package/dist/configs/components/chart/pie.json +227 -42
  4. package/dist/configs/components/dataView.json +9 -1
  5. package/dist/configs/components/form/form.json +4 -0
  6. package/dist/configs/components/form/select.json +18 -0
  7. package/dist/docs/common/tableView.js +0 -3
  8. package/dist/setupTests.d.ts +2 -1
  9. package/dist/setupTests.js +6 -1
  10. package/dist/web/actions/showModal/index.js +0 -1
  11. package/dist/web/components/calendar/index.js +40 -38
  12. package/dist/web/components/carousel/index.js +62 -62
  13. package/dist/web/components/chart/bar/index.d.ts +2 -40
  14. package/dist/web/components/chart/bar/index.js +44 -55
  15. package/dist/{src/web → web}/components/chart/bar/index.old.d.ts +0 -0
  16. package/dist/{src/web → web}/components/chart/bar/index.old.js +0 -0
  17. package/dist/{src/web → web}/components/chart/common/Chart.d.ts +0 -0
  18. package/dist/{src/web → web}/components/chart/common/Chart.js +0 -0
  19. package/dist/{src/web → web}/components/chart/common/chart-custom-connector.d.ts +0 -0
  20. package/dist/{src/web → web}/components/chart/common/chart-custom-connector.js +0 -0
  21. package/dist/{src/web → web}/components/chart/common/chart-error.d.ts +0 -0
  22. package/dist/{src/web → web}/components/chart/common/chart-error.js +0 -0
  23. package/dist/web/components/chart/common/core/eChartBar.d.ts +1 -3
  24. package/dist/web/components/chart/common/core/eChartBar.js +6 -3
  25. package/dist/web/components/chart/common/core/eChartBase.d.ts +2 -3
  26. package/dist/web/components/chart/common/core/eChartBase.js +47 -5
  27. package/dist/web/components/chart/common/core/eChartLine.d.ts +1 -3
  28. package/dist/web/components/chart/common/core/eChartLine.js +6 -3
  29. package/dist/web/components/chart/common/core/eChartPie.d.ts +1 -3
  30. package/dist/web/components/chart/common/core/eChartPie.js +6 -3
  31. package/dist/{src/web → web}/components/chart/common/data-transform.d.ts +0 -0
  32. package/dist/{src/web → web}/components/chart/common/data-transform.js +0 -0
  33. package/dist/web/components/chart/common/echarts.d.ts +3 -0
  34. package/dist/web/components/chart/common/useChart.js +23 -11
  35. package/dist/web/components/chart/line/index.d.ts +2 -38
  36. package/dist/web/components/chart/line/index.js +41 -52
  37. package/dist/{src/web → web}/components/chart/line/index.old.d.ts +0 -0
  38. package/dist/{src/web → web}/components/chart/line/index.old.js +0 -0
  39. package/dist/web/components/chart/pie/index.d.ts +2 -26
  40. package/dist/web/components/chart/pie/index.js +41 -39
  41. package/dist/{src/web → web}/components/chart/pie/index.old.d.ts +0 -0
  42. package/dist/{src/web → web}/components/chart/pie/index.old.js +0 -0
  43. package/dist/{src/web → web}/components/common/error-boundary.d.ts +0 -0
  44. package/dist/{src/web → web}/components/common/error-boundary.js +0 -0
  45. package/dist/{src/web → web}/components/common/portal.d.ts +0 -0
  46. package/dist/{src/web → web}/components/common/portal.js +0 -0
  47. package/dist/{src/web → web}/components/common/use-loop-render-detect.d.ts +0 -0
  48. package/dist/{src/web → web}/components/common/use-loop-render-detect.js +0 -0
  49. package/dist/web/components/form/checkbox/index.js +29 -29
  50. package/dist/web/components/form/enumSelect/MultipleSelect.d.ts +2 -2
  51. package/dist/web/components/form/enumSelect/NormalSelect.d.ts +2 -2
  52. package/dist/web/components/form/enumSelect/index.d.ts +2 -2
  53. package/dist/web/components/form/enumSelect/props/propsTypes.d.ts +2 -2
  54. package/dist/web/components/form/form/index.js +46 -0
  55. package/dist/web/components/form/input/index.js +13 -5
  56. package/dist/web/components/form/location/common/mapChoose.js +7 -6
  57. package/dist/web/components/form/location/common/mapView.js +9 -6
  58. package/dist/web/components/form/location/common/propsConfig.d.ts +1 -1
  59. package/dist/{src/web → web}/components/form/location/common/tmap.d.ts +0 -0
  60. package/dist/{src/web → web}/components/form/location/common/tmap.js +0 -0
  61. package/dist/web/components/form/location/common/useLocationInfo.d.ts +1 -1
  62. package/dist/web/components/form/location/common/useLocationInfo.js +3 -2
  63. package/dist/web/components/form/location/components/LocationH5/location.h5.js +6 -3
  64. package/dist/web/components/form/location/components/LocationPC/location.PC.js +5 -1
  65. package/dist/web/components/form/location/index.js +7 -0
  66. package/dist/web/components/form/radio/index.js +3 -3
  67. package/dist/{src/web → web}/components/form/select/allTimePicker/calendar.d.ts +0 -0
  68. package/dist/{src/web → web}/components/form/select/allTimePicker/calendar.js +0 -0
  69. package/dist/{src/web → web}/components/form/select/allTimePicker/dataUtils.d.ts +0 -0
  70. package/dist/{src/web → web}/components/form/select/allTimePicker/dataUtils.js +0 -0
  71. package/dist/{src/web → web}/components/form/select/allTimePicker/index.d.ts +0 -0
  72. package/dist/{src/web → web}/components/form/select/allTimePicker/index.js +0 -0
  73. package/dist/web/components/form/select/h5.d.ts +1 -1
  74. package/dist/web/components/form/select/h5.js +63 -7
  75. package/dist/web/components/form/select/index.d.ts +3 -2
  76. package/dist/web/components/form/select/index.js +25 -2
  77. package/dist/web/components/form/select/use-options.js +1 -1
  78. package/dist/web/components/form/select/year.js +1 -1
  79. package/dist/web/components/form/switch/index.js +2 -2
  80. package/dist/web/components/form/textarea/index.js +1 -1
  81. package/dist/web/components/form/uploader/uploader.h5.js +17 -42
  82. package/dist/web/components/form/uploader/uploader.pc.js +22 -28
  83. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +18 -25
  84. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +12 -23
  85. package/dist/web/components/form/userOrgSelect/comTool.d.ts +1 -0
  86. package/dist/web/components/form/userOrgSelect/comTool.js +25 -13
  87. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +2 -3
  88. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +65 -64
  89. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +2 -2
  90. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +41 -37
  91. package/dist/{src/web → web}/components/form/userOrgSelect/getUserService.d.ts +0 -0
  92. package/dist/{src/web → web}/components/form/userOrgSelect/getUserService.js +0 -0
  93. package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +7 -4
  94. package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +62 -58
  95. package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +4 -4
  96. package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +133 -109
  97. package/dist/web/components/form/userOrgSelect/utils.d.ts +3 -2
  98. package/dist/web/components/form/userOrgSelect/utils.js +24 -16
  99. package/dist/web/components/formdetail/index.js +14 -11
  100. package/dist/web/components/graphicCard/index.d.ts +16 -1
  101. package/dist/web/components/graphicCard/index.js +42 -30
  102. package/dist/web/components/image/index.js +4 -18
  103. package/dist/web/components/index.js +3 -1
  104. package/dist/web/components/listView/index.js +20 -9
  105. package/dist/web/components/lottery/index.js +10 -16
  106. package/dist/web/components/lottery/lotteryUtil.js +1 -1
  107. package/dist/web/components/modal/index.js +1 -1
  108. package/dist/web/components/navLayout/index.d.ts +16 -1
  109. package/dist/web/components/navLayout/index.js +31 -20
  110. package/dist/web/components/navigationBar/horizontalMenu.js +1 -1
  111. package/dist/web/components/navigationBar/index.js +13 -8
  112. package/dist/web/components/richText/index.js +1 -2
  113. package/dist/web/components/richTextView/index.js +20 -18
  114. package/dist/web/components/scrollView/index.d.ts +1 -2
  115. package/dist/web/components/scrollView/index.js +7 -5
  116. package/dist/web/components/swiper/index.js +62 -62
  117. package/dist/web/components/tabs/index.js +6 -1
  118. package/dist/web/components/tabs/tabs.h5.js +2 -0
  119. package/dist/web/components/text/index.js +10 -8
  120. package/dist/web/components/uploaderFileView/index.js +3 -18
  121. package/dist/web/components/uploaderView/index.js +1 -1
  122. package/dist/web/components/wedaVideo/index.js +21 -25
  123. package/dist/{src/web → web}/utils/console.d.ts +0 -0
  124. package/dist/{src/web → web}/utils/console.js +0 -0
  125. package/dist/web/utils/platform.js +1 -1
  126. package/dist/web/utils/tcb.d.ts +12 -6
  127. package/dist/web/utils/tcb.js +13 -0
  128. package/dist/web/utils/use-cloud-id-temp-url.js +3 -1
  129. package/dist/web/utils/useSyncValue.js +1 -0
  130. package/package.json +1 -1
  131. package/dist/cypress/support/commands.d.ts +0 -1
  132. package/dist/cypress/support/commands.js +0 -40
  133. package/dist/cypress/support/e2e.d.ts +0 -24
  134. package/dist/cypress/support/e2e.js +0 -22
  135. package/dist/src/configs/actions/showModal.json +0 -48
  136. package/dist/src/configs/actions/showToast.json +0 -41
  137. package/dist/src/configs/components/auth.json +0 -16
  138. package/dist/src/configs/components/button.json +0 -239
  139. package/dist/src/configs/components/calendar.json +0 -81
  140. package/dist/src/configs/components/carousel.json +0 -292
  141. package/dist/src/configs/components/chart/bar.json +0 -962
  142. package/dist/src/configs/components/chart/line.json +0 -878
  143. package/dist/src/configs/components/chart/pie.json +0 -685
  144. package/dist/src/configs/components/chart/statisticsCard.json +0 -376
  145. package/dist/src/configs/components/container.json +0 -50
  146. package/dist/src/configs/components/dataView.json +0 -247
  147. package/dist/src/configs/components/drawer.json +0 -115
  148. package/dist/src/configs/components/form/checkbox.json +0 -179
  149. package/dist/src/configs/components/form/departTreeSelect.json +0 -124
  150. package/dist/src/configs/components/form/form.json +0 -73
  151. package/dist/src/configs/components/form/input.json +0 -154
  152. package/dist/src/configs/components/form/location.json +0 -216
  153. package/dist/src/configs/components/form/radio.json +0 -203
  154. package/dist/src/configs/components/form/richText.json +0 -133
  155. package/dist/src/configs/components/form/select.json +0 -449
  156. package/dist/src/configs/components/form/switch.json +0 -58
  157. package/dist/src/configs/components/form/textarea.json +0 -116
  158. package/dist/src/configs/components/form/tips.json +0 -34
  159. package/dist/src/configs/components/form/uploader.json +0 -171
  160. package/dist/src/configs/components/form/uploaderFile.json +0 -158
  161. package/dist/src/configs/components/form/userTreeSelect.json +0 -128
  162. package/dist/src/configs/components/formdetail.json +0 -105
  163. package/dist/src/configs/components/graphicCard.json +0 -413
  164. package/dist/src/configs/components/image.json +0 -187
  165. package/dist/src/configs/components/link.json +0 -79
  166. package/dist/src/configs/components/listView.json +0 -378
  167. package/dist/src/configs/components/lottery.json +0 -163
  168. package/dist/src/configs/components/modal.json +0 -72
  169. package/dist/src/configs/components/navLayout.json +0 -368
  170. package/dist/src/configs/components/navigationBar.json +0 -62
  171. package/dist/src/configs/components/richtextview.json +0 -26
  172. package/dist/src/configs/components/scrollVeiw.json +0 -253
  173. package/dist/src/configs/components/slot.json +0 -17
  174. package/dist/src/configs/components/swiper.json +0 -90
  175. package/dist/src/configs/components/tabs.json +0 -122
  176. package/dist/src/configs/components/text.json +0 -95
  177. package/dist/src/configs/components/wedaVideo.json +0 -89
  178. package/dist/src/configs/components/wxOpenApi/phone.json +0 -127
  179. package/dist/src/configs/components/wxOpenApi/phoneCode.json +0 -109
  180. package/dist/src/configs/components/wxOpenApi/share.json +0 -160
  181. package/dist/src/configs/components/wxOpenApi/userInfo.json +0 -156
  182. package/dist/src/configs/index.d.ts +0 -103
  183. package/dist/src/configs/index.js +0 -111
  184. package/dist/src/docs/common/format.d.ts +0 -13
  185. package/dist/src/docs/common/format.js +0 -122
  186. package/dist/src/docs/common/tableView.d.ts +0 -30
  187. package/dist/src/docs/common/tableView.js +0 -156
  188. package/dist/src/index.d.ts +0 -2
  189. package/dist/src/index.js +0 -3
  190. package/dist/src/setupTests.d.ts +0 -2
  191. package/dist/src/setupTests.js +0 -19
  192. package/dist/src/web/actions/index.d.ts +0 -2
  193. package/dist/src/web/actions/index.js +0 -2
  194. package/dist/src/web/actions/showModal/index.d.ts +0 -4
  195. package/dist/src/web/actions/showModal/index.js +0 -66
  196. package/dist/src/web/actions/showToast/index.d.ts +0 -1
  197. package/dist/src/web/actions/showToast/index.js +0 -3
  198. package/dist/src/web/components/button/index.d.ts +0 -32
  199. package/dist/src/web/components/button/index.js +0 -48
  200. package/dist/src/web/components/calendar/index.d.ts +0 -19
  201. package/dist/src/web/components/calendar/index.js +0 -191
  202. package/dist/src/web/components/calendar/util.d.ts +0 -13
  203. package/dist/src/web/components/calendar/util.js +0 -74
  204. package/dist/src/web/components/carousel/index.d.ts +0 -41
  205. package/dist/src/web/components/carousel/index.js +0 -244
  206. package/dist/src/web/components/chart/bar/index.d.ts +0 -3
  207. package/dist/src/web/components/chart/bar/index.js +0 -45
  208. package/dist/src/web/components/chart/common/config/bar.d.ts +0 -48
  209. package/dist/src/web/components/chart/common/config/bar.js +0 -49
  210. package/dist/src/web/components/chart/common/config/global.d.ts +0 -13
  211. package/dist/src/web/components/chart/common/config/global.js +0 -16
  212. package/dist/src/web/components/chart/common/config/line.d.ts +0 -46
  213. package/dist/src/web/components/chart/common/config/line.js +0 -49
  214. package/dist/src/web/components/chart/common/config/pie.d.ts +0 -29
  215. package/dist/src/web/components/chart/common/config/pie.js +0 -36
  216. package/dist/src/web/components/chart/common/core/eChartBar.d.ts +0 -66
  217. package/dist/src/web/components/chart/common/core/eChartBar.js +0 -201
  218. package/dist/src/web/components/chart/common/core/eChartBase.d.ts +0 -127
  219. package/dist/src/web/components/chart/common/core/eChartBase.js +0 -394
  220. package/dist/src/web/components/chart/common/core/eChartLine.d.ts +0 -60
  221. package/dist/src/web/components/chart/common/core/eChartLine.js +0 -173
  222. package/dist/src/web/components/chart/common/core/eChartPie.d.ts +0 -48
  223. package/dist/src/web/components/chart/common/core/eChartPie.js +0 -135
  224. package/dist/src/web/components/chart/common/core/type.d.ts +0 -35
  225. package/dist/src/web/components/chart/common/core/type.js +0 -9
  226. package/dist/src/web/components/chart/common/echarts.d.ts +0 -5
  227. package/dist/src/web/components/chart/common/echarts.js +0 -24
  228. package/dist/src/web/components/chart/common/error-boundary.d.ts +0 -5
  229. package/dist/src/web/components/chart/common/error-boundary.js +0 -26
  230. package/dist/src/web/components/chart/common/useChart.d.ts +0 -8
  231. package/dist/src/web/components/chart/common/useChart.js +0 -72
  232. package/dist/src/web/components/chart/line/index.d.ts +0 -3
  233. package/dist/src/web/components/chart/line/index.js +0 -42
  234. package/dist/src/web/components/chart/pie/index.d.ts +0 -3
  235. package/dist/src/web/components/chart/pie/index.js +0 -42
  236. package/dist/src/web/components/chart/statisticsCard/index.d.ts +0 -85
  237. package/dist/src/web/components/chart/statisticsCard/index.js +0 -203
  238. package/dist/src/web/components/chart/statisticsCard/interface.d.ts +0 -13
  239. package/dist/src/web/components/chart/statisticsCard/interface.js +0 -1
  240. package/dist/src/web/components/container/index.d.ts +0 -6
  241. package/dist/src/web/components/container/index.js +0 -6
  242. package/dist/src/web/components/dataView/index.d.ts +0 -6
  243. package/dist/src/web/components/dataView/index.js +0 -8
  244. package/dist/src/web/components/dataView/interface.d.ts +0 -5
  245. package/dist/src/web/components/dataView/interface.js +0 -1
  246. package/dist/src/web/components/drawer/index.d.ts +0 -13
  247. package/dist/src/web/components/drawer/index.js +0 -12
  248. package/dist/src/web/components/form/checkbox/index.d.ts +0 -13
  249. package/dist/src/web/components/form/checkbox/index.js +0 -167
  250. package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +0 -78
  251. package/dist/src/web/components/form/enumSelect/MultipleSelect.js +0 -52
  252. package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +0 -83
  253. package/dist/src/web/components/form/enumSelect/NormalSelect.js +0 -52
  254. package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +0 -16
  255. package/dist/src/web/components/form/enumSelect/SelectContainer.js +0 -30
  256. package/dist/src/web/components/form/enumSelect/index.d.ts +0 -82
  257. package/dist/src/web/components/form/enumSelect/index.js +0 -6
  258. package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +0 -34
  259. package/dist/src/web/components/form/enumSelect/props/defaultProps.js +0 -40
  260. package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +0 -39
  261. package/dist/src/web/components/form/enumSelect/props/propsTypes.js +0 -47
  262. package/dist/src/web/components/form/form/index.d.ts +0 -32
  263. package/dist/src/web/components/form/form/index.js +0 -150
  264. package/dist/src/web/components/form/formcell/index.d.ts +0 -8
  265. package/dist/src/web/components/form/formcell/index.js +0 -40
  266. package/dist/src/web/components/form/input/index.d.ts +0 -14
  267. package/dist/src/web/components/form/input/index.js +0 -94
  268. package/dist/src/web/components/form/location/common/mapChoose.d.ts +0 -15
  269. package/dist/src/web/components/form/location/common/mapChoose.js +0 -496
  270. package/dist/src/web/components/form/location/common/mapView.d.ts +0 -19
  271. package/dist/src/web/components/form/location/common/mapView.js +0 -175
  272. package/dist/src/web/components/form/location/common/propsConfig.d.ts +0 -59
  273. package/dist/src/web/components/form/location/common/propsConfig.js +0 -50
  274. package/dist/src/web/components/form/location/common/selectModal.d.ts +0 -21
  275. package/dist/src/web/components/form/location/common/selectModal.js +0 -44
  276. package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +0 -36
  277. package/dist/src/web/components/form/location/common/useLocationInfo.js +0 -105
  278. package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +0 -8
  279. package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +0 -328
  280. package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +0 -12
  281. package/dist/src/web/components/form/location/components/LocationPC/Header.js +0 -43
  282. package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +0 -8
  283. package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +0 -228
  284. package/dist/src/web/components/form/location/constants.d.ts +0 -2
  285. package/dist/src/web/components/form/location/constants.js +0 -3
  286. package/dist/src/web/components/form/location/index.d.ts +0 -1
  287. package/dist/src/web/components/form/location/index.js +0 -24
  288. package/dist/src/web/components/form/radio/index.d.ts +0 -11
  289. package/dist/src/web/components/form/radio/index.js +0 -115
  290. package/dist/src/web/components/form/renderDecorator.d.ts +0 -6
  291. package/dist/src/web/components/form/renderDecorator.js +0 -20
  292. package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +0 -15
  293. package/dist/src/web/components/form/select/dropdown-select/ui.js +0 -55
  294. package/dist/src/web/components/form/select/h5.d.ts +0 -16
  295. package/dist/src/web/components/form/select/h5.js +0 -466
  296. package/dist/src/web/components/form/select/index.d.ts +0 -66
  297. package/dist/src/web/components/form/select/index.js +0 -255
  298. package/dist/src/web/components/form/select/region/index.d.ts +0 -6
  299. package/dist/src/web/components/form/select/region/index.js +0 -147
  300. package/dist/src/web/components/form/select/time.d.ts +0 -9
  301. package/dist/src/web/components/form/select/time.js +0 -146
  302. package/dist/src/web/components/form/select/use-options.d.ts +0 -26
  303. package/dist/src/web/components/form/select/use-options.js +0 -103
  304. package/dist/src/web/components/form/select/year.d.ts +0 -7
  305. package/dist/src/web/components/form/select/year.js +0 -72
  306. package/dist/src/web/components/form/switch/index.d.ts +0 -6
  307. package/dist/src/web/components/form/switch/index.js +0 -58
  308. package/dist/src/web/components/form/textarea/index.d.ts +0 -12
  309. package/dist/src/web/components/form/textarea/index.js +0 -66
  310. package/dist/src/web/components/form/tips/index.d.ts +0 -8
  311. package/dist/src/web/components/form/tips/index.js +0 -17
  312. package/dist/src/web/components/form/uploader/index.d.ts +0 -3
  313. package/dist/src/web/components/form/uploader/index.js +0 -42
  314. package/dist/src/web/components/form/uploader/uploader.h5.d.ts +0 -20
  315. package/dist/src/web/components/form/uploader/uploader.h5.js +0 -199
  316. package/dist/src/web/components/form/uploader/uploader.pc.d.ts +0 -29
  317. package/dist/src/web/components/form/uploader/uploader.pc.js +0 -208
  318. package/dist/src/web/components/form/uploaderFile/index.d.ts +0 -4
  319. package/dist/src/web/components/form/uploaderFile/index.js +0 -19
  320. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +0 -23
  321. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +0 -330
  322. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +0 -24
  323. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +0 -302
  324. package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +0 -8
  325. package/dist/src/web/components/form/userOrgSelect/comTool.js +0 -101
  326. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +0 -19
  327. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +0 -252
  328. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +0 -4
  329. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +0 -157
  330. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +0 -2
  331. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +0 -17
  332. package/dist/src/web/components/form/userOrgSelect/index.d.ts +0 -2
  333. package/dist/src/web/components/form/userOrgSelect/index.js +0 -17
  334. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +0 -27
  335. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +0 -276
  336. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +0 -9
  337. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +0 -253
  338. package/dist/src/web/components/form/userOrgSelect/utils.d.ts +0 -36
  339. package/dist/src/web/components/form/userOrgSelect/utils.js +0 -80
  340. package/dist/src/web/components/formdetail/index.d.ts +0 -28
  341. package/dist/src/web/components/formdetail/index.js +0 -173
  342. package/dist/src/web/components/graphicCard/index.d.ts +0 -46
  343. package/dist/src/web/components/graphicCard/index.js +0 -178
  344. package/dist/src/web/components/image/image.d.ts +0 -9
  345. package/dist/src/web/components/image/image.js +0 -119
  346. package/dist/src/web/components/image/index.d.ts +0 -13
  347. package/dist/src/web/components/image/index.js +0 -77
  348. package/dist/src/web/components/index.d.ts +0 -50
  349. package/dist/src/web/components/index.js +0 -99
  350. package/dist/src/web/components/link/index.d.ts +0 -24
  351. package/dist/src/web/components/link/index.js +0 -71
  352. package/dist/src/web/components/listView/index.d.ts +0 -7
  353. package/dist/src/web/components/listView/index.js +0 -297
  354. package/dist/src/web/components/listView/interface.d.ts +0 -127
  355. package/dist/src/web/components/listView/interface.js +0 -1
  356. package/dist/src/web/components/lottery/index.d.ts +0 -22
  357. package/dist/src/web/components/lottery/index.js +0 -385
  358. package/dist/src/web/components/lottery/lotteryUtil.d.ts +0 -23
  359. package/dist/src/web/components/lottery/lotteryUtil.js +0 -181
  360. package/dist/src/web/components/modal/index.d.ts +0 -17
  361. package/dist/src/web/components/modal/index.js +0 -11
  362. package/dist/src/web/components/modal/modal.h5.d.ts +0 -4
  363. package/dist/src/web/components/modal/modal.h5.js +0 -46
  364. package/dist/src/web/components/modal/modal.pc.d.ts +0 -3
  365. package/dist/src/web/components/modal/modal.pc.js +0 -31
  366. package/dist/src/web/components/navLayout/index.d.ts +0 -61
  367. package/dist/src/web/components/navLayout/index.js +0 -127
  368. package/dist/src/web/components/navigationBar/common.d.ts +0 -15
  369. package/dist/src/web/components/navigationBar/common.js +0 -127
  370. package/dist/src/web/components/navigationBar/h5Menu.d.ts +0 -14
  371. package/dist/src/web/components/navigationBar/h5Menu.js +0 -72
  372. package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +0 -12
  373. package/dist/src/web/components/navigationBar/horizontalMenu.js +0 -99
  374. package/dist/src/web/components/navigationBar/index.d.ts +0 -13
  375. package/dist/src/web/components/navigationBar/index.js +0 -157
  376. package/dist/src/web/components/navigationBar/verticalMenu.d.ts +0 -13
  377. package/dist/src/web/components/navigationBar/verticalMenu.js +0 -38
  378. package/dist/src/web/components/phone/index.d.ts +0 -18
  379. package/dist/src/web/components/phone/index.js +0 -4
  380. package/dist/src/web/components/phoneCode/index.d.ts +0 -18
  381. package/dist/src/web/components/phoneCode/index.js +0 -4
  382. package/dist/src/web/components/picker/datePicker.d.ts +0 -10
  383. package/dist/src/web/components/picker/datePicker.js +0 -31
  384. package/dist/src/web/components/picker/picker.d.ts +0 -6
  385. package/dist/src/web/components/picker/picker.js +0 -45
  386. package/dist/src/web/components/picker/timePicker.d.ts +0 -7
  387. package/dist/src/web/components/picker/timePicker.js +0 -42
  388. package/dist/src/web/components/richText/const.d.ts +0 -1
  389. package/dist/src/web/components/richText/const.js +0 -2
  390. package/dist/src/web/components/richText/index.d.ts +0 -50
  391. package/dist/src/web/components/richText/index.js +0 -351
  392. package/dist/src/web/components/richTextView/index.d.ts +0 -7
  393. package/dist/src/web/components/richTextView/index.js +0 -46
  394. package/dist/src/web/components/scrollView/index.d.ts +0 -26
  395. package/dist/src/web/components/scrollView/index.js +0 -97
  396. package/dist/src/web/components/share/index.d.ts +0 -34
  397. package/dist/src/web/components/share/index.js +0 -4
  398. package/dist/src/web/components/slot/index.d.ts +0 -6
  399. package/dist/src/web/components/slot/index.js +0 -9
  400. package/dist/src/web/components/swiper/index.d.ts +0 -24
  401. package/dist/src/web/components/swiper/index.js +0 -153
  402. package/dist/src/web/components/tabs/index.d.ts +0 -13
  403. package/dist/src/web/components/tabs/index.js +0 -20
  404. package/dist/src/web/components/tabs/tabs.h5.d.ts +0 -4
  405. package/dist/src/web/components/tabs/tabs.h5.js +0 -44
  406. package/dist/src/web/components/tabs/tabs.pc.d.ts +0 -3
  407. package/dist/src/web/components/tabs/tabs.pc.js +0 -40
  408. package/dist/src/web/components/text/index.d.ts +0 -14
  409. package/dist/src/web/components/text/index.js +0 -19
  410. package/dist/src/web/components/uploaderFileView/index.d.ts +0 -10
  411. package/dist/src/web/components/uploaderFileView/index.js +0 -46
  412. package/dist/src/web/components/uploaderView/index.d.ts +0 -17
  413. package/dist/src/web/components/uploaderView/index.js +0 -48
  414. package/dist/src/web/components/userInfo/index.d.ts +0 -26
  415. package/dist/src/web/components/userInfo/index.js +0 -4
  416. package/dist/src/web/components/wedaVideo/index.d.ts +0 -17
  417. package/dist/src/web/components/wedaVideo/index.js +0 -156
  418. package/dist/src/web/index.d.ts +0 -8
  419. package/dist/src/web/index.js +0 -4
  420. package/dist/src/web/utils/classnames.d.ts +0 -2
  421. package/dist/src/web/utils/classnames.js +0 -37
  422. package/dist/src/web/utils/constant.d.ts +0 -23
  423. package/dist/src/web/utils/constant.js +0 -24
  424. package/dist/src/web/utils/debounce.d.ts +0 -2
  425. package/dist/src/web/utils/debounce.js +0 -92
  426. package/dist/src/web/utils/getLocalCounter.d.ts +0 -1
  427. package/dist/src/web/utils/getLocalCounter.js +0 -4
  428. package/dist/src/web/utils/getUserService.d.ts +0 -11
  429. package/dist/src/web/utils/getUserService.js +0 -156
  430. package/dist/src/web/utils/isObjectEqual.d.ts +0 -2
  431. package/dist/src/web/utils/isObjectEqual.js +0 -12
  432. package/dist/src/web/utils/loading-fallback.d.ts +0 -2
  433. package/dist/src/web/utils/loading-fallback.js +0 -2
  434. package/dist/src/web/utils/lodash.d.ts +0 -1
  435. package/dist/src/web/utils/lodash.js +0 -2
  436. package/dist/src/web/utils/platform.d.ts +0 -18
  437. package/dist/src/web/utils/platform.js +0 -193
  438. package/dist/src/web/utils/tcb.d.ts +0 -33
  439. package/dist/src/web/utils/tcb.js +0 -118
  440. package/dist/src/web/utils/tmap.d.ts +0 -3
  441. package/dist/src/web/utils/tmap.js +0 -21
  442. package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +0 -1
  443. package/dist/src/web/utils/use-cloud-id-temp-url.js +0 -15
  444. package/dist/src/web/utils/useSetState.d.ts +0 -1
  445. package/dist/src/web/utils/useSetState.js +0 -8
  446. package/dist/src/web/utils/useSyncValue.d.ts +0 -4
  447. package/dist/src/web/utils/useSyncValue.js +0 -16
  448. package/dist/src/web/utils/weui.d.ts +0 -1
  449. package/dist/src/web/utils/weui.js +0 -2
  450. package/dist/web/components/form/userOrgSelect/userOrgSelect.less +0 -643
  451. package/dist/web/utils/getUserService.d.ts +0 -17
  452. package/dist/web/utils/getUserService.js +0 -148
  453. package/dist/web/utils/tmap.d.ts +0 -3
  454. package/dist/web/utils/tmap.js +0 -21
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useState, useEffect, useRef } from 'react';
2
+ import { useState, useEffect, useRef, useCallback } from 'react';
3
3
  import classNames from '../../utils/classnames';
4
4
  import Swipe from 'react-easy-swipe';
5
5
  import { useDebouncedCallback, useEventListener, useResizeObserver, } from '@react-hookz/web';
@@ -13,6 +13,15 @@ export default function Carousel({ className, style, autoplay, circular, vertica
13
13
  const [swipeStyle, setSwipeStyle] = useState(null);
14
14
  const [height, setHeight] = useState(0);
15
15
  const { change = () => { } } = events;
16
+ const setIndex = useCallback((index) => {
17
+ if (index >= itemCount) {
18
+ index = 0;
19
+ }
20
+ if (index < 0) {
21
+ index = itemCount - 1;
22
+ }
23
+ setCurrentIndex(index);
24
+ }, [itemCount, setCurrentIndex]);
16
25
  // 自动切换
17
26
  useEffect(() => {
18
27
  if (autoplay) {
@@ -23,10 +32,60 @@ export default function Carousel({ className, style, autoplay, circular, vertica
23
32
  }, interval);
24
33
  return () => clearInterval(timer);
25
34
  }
26
- }, [currentIndex, autoplay]);
35
+ }, [currentIndex, autoplay, interval, setIndex]);
27
36
  // 触发切换
28
37
  const pre = useRef({ index: currentIndex }).current;
29
38
  useEffect(() => {
39
+ // 设置容器样式、动画
40
+ // TODO fix settimeout mess
41
+ const updateSwipeStyle = (to, cur, length) => {
42
+ let style = {};
43
+ // 最后向前到最开始
44
+ if (to === 0 && cur === length - 1) {
45
+ circular &&
46
+ setSwipeStyle({
47
+ transform: `translate3d(0, 0, 0)`,
48
+ });
49
+ // eslint-disable-next-line rulesdir/no-timer
50
+ setTimeout(() => {
51
+ setSwipeStyle({
52
+ transform: vertical
53
+ ? `translate3d(0, -100%, 0)`
54
+ : `translate3d(-100%, 0, 0)`,
55
+ transitionDuration: `${duration}ms`,
56
+ });
57
+ }, 50);
58
+ return;
59
+ }
60
+ // 第一个后退到最后
61
+ if (to === length - 1 && cur === 0) {
62
+ circular &&
63
+ setSwipeStyle({
64
+ transform: vertical
65
+ ? `translate3d(0, -${(to + 2) * 100}%, 0)`
66
+ : `translate3d(-${(to + 2) * 100}%, 0, 0)`,
67
+ });
68
+ // eslint-disable-next-line rulesdir/no-timer
69
+ setTimeout(() => {
70
+ setSwipeStyle({
71
+ transform: vertical
72
+ ? `translate3d(0, -${(to + 1) * 100}%, 0)`
73
+ : `translate3d(-${(to + 1) * 100}%, 0, 0)`,
74
+ transitionDuration: `${duration}ms`,
75
+ });
76
+ }, 50);
77
+ return;
78
+ }
79
+ style = {
80
+ transform: vertical
81
+ ? `translate3d(0, -${(to + 1) * 100}%, 0)`
82
+ : `translate3d(-${(to + 1) * 100}%, 0, 0)`,
83
+ };
84
+ if (to !== cur) {
85
+ style.transitionDuration = `${duration}ms`;
86
+ }
87
+ setSwipeStyle(style);
88
+ };
30
89
  updateSwipeStyle(currentIndex, pre.index, itemCount);
31
90
  change({
32
91
  current: currentIndex,
@@ -34,7 +93,7 @@ export default function Carousel({ className, style, autoplay, circular, vertica
34
93
  return () => {
35
94
  pre.index = currentIndex;
36
95
  };
37
- }, [currentIndex, vertical]);
96
+ }, [currentIndex, vertical, pre, change, itemCount, circular, duration]);
38
97
  const outerWrapRef = useRef();
39
98
  useEventListener(outerWrapRef, 'load', (e) => {
40
99
  setHeight(e.target.clientHeight);
@@ -46,65 +105,6 @@ export default function Carousel({ className, style, autoplay, circular, vertica
46
105
  width: x.width ? x.width : '100%',
47
106
  } })));
48
107
  });
49
- const setIndex = (index) => {
50
- if (index >= itemCount) {
51
- index = 0;
52
- }
53
- if (index < 0) {
54
- index = itemCount - 1;
55
- }
56
- setCurrentIndex(index);
57
- };
58
- // 设置容器样式、动画
59
- // TODO fix settimeout mess
60
- const updateSwipeStyle = (to, cur, length) => {
61
- let style = {};
62
- // 最后向前到最开始
63
- if (to === 0 && cur === length - 1) {
64
- circular &&
65
- setSwipeStyle({
66
- transform: `translate3d(0, 0, 0)`,
67
- });
68
- // eslint-disable-next-line rulesdir/no-timer
69
- setTimeout(() => {
70
- setSwipeStyle({
71
- transform: vertical
72
- ? `translate3d(0, -100%, 0)`
73
- : `translate3d(-100%, 0, 0)`,
74
- transitionDuration: `${duration}ms`,
75
- });
76
- }, 50);
77
- return;
78
- }
79
- // 第一个后退到最后
80
- if (to === length - 1 && cur === 0) {
81
- circular &&
82
- setSwipeStyle({
83
- transform: vertical
84
- ? `translate3d(0, -${(to + 2) * 100}%, 0)`
85
- : `translate3d(-${(to + 2) * 100}%, 0, 0)`,
86
- });
87
- // eslint-disable-next-line rulesdir/no-timer
88
- setTimeout(() => {
89
- setSwipeStyle({
90
- transform: vertical
91
- ? `translate3d(0, -${(to + 1) * 100}%, 0)`
92
- : `translate3d(-${(to + 1) * 100}%, 0, 0)`,
93
- transitionDuration: `${duration}ms`,
94
- });
95
- }, 50);
96
- return;
97
- }
98
- style = {
99
- transform: vertical
100
- ? `translate3d(0, -${(to + 1) * 100}%, 0)`
101
- : `translate3d(-${(to + 1) * 100}%, 0, 0)`,
102
- };
103
- if (to !== cur) {
104
- style.transitionDuration = `${duration}ms`;
105
- }
106
- setSwipeStyle(style);
107
- };
108
108
  return (React.createElement("div", { className: classNames('g-swiper weda-ui g-carousel', className, {
109
109
  vertical: vertical,
110
110
  }), style: { height: height ? height : 'auto', ...style }, ref: outerWrapRef, id: id, "data-testid": "carousel" },
@@ -1,41 +1,3 @@
1
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 {};
2
+ import type { PropsType } from '../common/types';
3
+ export default function Bar(props: PropsType<'bar'>): JSX.Element;
@@ -1,56 +1,45 @@
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
- }) }));
1
+ import React from 'react';
2
+ import OldBar from './index.old';
3
+ import { checkIsNewData, transform } from '../common/data-transform';
4
+ import { Chart } from '../common/Chart';
5
+ import { emptyArray } from '../../../utils/constant';
6
+ import { ChartCustomConnector } from '../common/chart-custom-connector';
7
+ import { CommonErrorBoundary } from '../../common/error-boundary';
8
+ import { debug } from '../../../utils/console';
9
+ const logger = debug('bar:impl');
10
+ function BarImpl(props) {
11
+ logger.log(props, checkIsNewData(props));
12
+ if (props.dataSourceType === 'data-model') {
13
+ if (checkIsNewData(props)) {
14
+ props.dataSource = {
15
+ name: props['dataModel'].name,
16
+ type: 'database',
17
+ subType: 'database',
18
+ methodName: 'wedaAggregateData',
19
+ };
20
+ }
21
+ const oldBarProps = { ...props };
22
+ oldBarProps['dataModel'] = undefined;
23
+ oldBarProps['datasourceVariable'] = undefined;
24
+ oldBarProps['connectorMethod'] = undefined;
25
+ oldBarProps['connectorParams'] = undefined;
26
+ oldBarProps['connector'] = undefined;
27
+ debug('bar:old').log('OldBar', oldBarProps);
28
+ return React.createElement(OldBar, { ...oldBarProps });
29
+ }
30
+ else if (props.dataSourceType === 'variable') {
31
+ const { datasourceVariable = emptyArray, id, style, className, events, ...rest } = props;
32
+ const chartOptions = transform('bar', datasourceVariable, rest);
33
+ return (React.createElement(Chart, { id: id, "data-testid": "bar", className: className, style: style, events: events, chartOptions: chartOptions }));
34
+ }
35
+ else if (props.dataSourceType === 'custom-connector') {
36
+ return React.createElement(ChartCustomConnector, { "data-testid": "bar", type: "bar", ...props });
37
+ }
38
+ else {
39
+ return React.createElement(OldBar, { ...props });
40
+ }
41
+ }
42
+ export default function Bar(props) {
43
+ return (React.createElement(CommonErrorBoundary, { ...props },
44
+ React.createElement(BarImpl, { ...props })));
56
45
  }
@@ -28,13 +28,12 @@ declare class EchartBar extends EchartBase {
28
28
  setDirectionType({ directionType }: {
29
29
  directionType: any;
30
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, }: {
31
+ setOptions({ directionType, isPile, setColor, isTitle, title, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }: {
32
32
  directionType: any;
33
33
  isPile: any;
34
34
  setColor: any;
35
35
  isTitle: any;
36
36
  title: any;
37
- titleLocation: any;
38
37
  dataSource: any;
39
38
  filterData: any;
40
39
  xField: any;
@@ -45,7 +44,6 @@ declare class EchartBar extends EchartBase {
45
44
  yField: any;
46
45
  isLegend: any;
47
46
  legend: any;
48
- legend2: any;
49
47
  isXaxisName: any;
50
48
  xAxisName: any;
51
49
  isXaxisAxisLabelShow: any;
@@ -155,8 +155,11 @@ class EchartBar extends EchartBase {
155
155
  }
156
156
  }
157
157
  }
158
- 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, }) {
159
- legend = document.body.clientWidth < 1024 ? legend : legend2;
158
+ async setOptions({ directionType, isPile, setColor, isTitle, title,
159
+ // titleLocation,
160
+ dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend,
161
+ // legend2,
162
+ isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }) {
160
163
  if (dataSource) {
161
164
  await this.setSourceData({
162
165
  dataSource,
@@ -171,7 +174,7 @@ class EchartBar extends EchartBase {
171
174
  });
172
175
  }
173
176
  this.setColor({ setColor });
174
- this.setTitle({ isTitle, title, titleLocation });
177
+ this.setTitle({ isTitle, title });
175
178
  this.setLegend({ isLegend, legend });
176
179
  this.setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow });
177
180
  this.setIsXaxisName({ isXaxisName, xAxisName });
@@ -26,7 +26,7 @@ declare type IReturnData = {
26
26
  declare class EchartBase extends AbstractEchartBaseModal {
27
27
  config: any;
28
28
  constructor();
29
- setOptions(options: any): Promise<void>;
29
+ setOptions(_options: any): Promise<void>;
30
30
  /** 获取所有配置好的图表数据 */
31
31
  getOptions(): any;
32
32
  /** 生成后台查询条件 */
@@ -44,10 +44,9 @@ declare class EchartBase extends AbstractEchartBaseModal {
44
44
  *
45
45
  **/
46
46
  protected getSourceData(sourceName: string, methods: string, dataSourceType: string, params: any): Promise<any>;
47
- protected setTitle({ isTitle, title, titleLocation }: {
47
+ protected setTitle({ isTitle, title }: {
48
48
  isTitle: any;
49
49
  title: any;
50
- titleLocation?: string;
51
50
  }): void;
52
51
  protected setLegend({ isLegend, legend }: {
53
52
  isLegend: any;
@@ -19,7 +19,8 @@ class EchartBase extends AbstractEchartBaseModal {
19
19
  });
20
20
  this.config = getConfig();
21
21
  }
22
- async setOptions(options) { }
22
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
23
+ async setOptions(_options) { }
23
24
  /** 获取所有配置好的图表数据 */
24
25
  getOptions() {
25
26
  return this.config;
@@ -91,9 +92,10 @@ class EchartBase extends AbstractEchartBaseModal {
91
92
  **/
92
93
  async getSourceData(sourceName = '', methods = '', dataSourceType = '', params) {
93
94
  var _a, _b, _c;
94
- if (!sourceName ||
95
- Object.keys((_a = params === null || params === void 0 ? void 0 : params.dimension) !== null && _a !== void 0 ? _a : {}).length <= 0 ||
96
- ((_b = params.value) !== null && _b !== void 0 ? _b : []).length <= 0) {
95
+ if (dataSourceType === 'database' &&
96
+ (!sourceName ||
97
+ Object.keys((_a = params === null || params === void 0 ? void 0 : params.dimension) !== null && _a !== void 0 ? _a : {}).length <= 0 ||
98
+ ((_b = params.value) !== null && _b !== void 0 ? _b : []).length <= 0)) {
97
99
  console.warn('charts 参数不完整');
98
100
  return [];
99
101
  }
@@ -121,7 +123,7 @@ class EchartBase extends AbstractEchartBaseModal {
121
123
  return [];
122
124
  }
123
125
  }
124
- setTitle({ isTitle, title, titleLocation = '' }) {
126
+ setTitle({ isTitle, title }) {
125
127
  this.config.title;
126
128
  this.config.title.show = isTitle;
127
129
  this.config.title.text = title;
@@ -182,8 +184,46 @@ class EchartBase extends AbstractEchartBaseModal {
182
184
  sortXAxisData(arrData, formatType = '') {
183
185
  const xFields = [...arrData];
184
186
  if (['datetime', 'date', 'time'].includes(formatType)) {
187
+ const monthRegex = /^(\d{4}(?:-\d{2}){0,2}) {0,1}(\d{2})$/;
188
+ const weekRegex = /^(\d{4})W(\d+)$/;
185
189
  xFields.sort((a, b) => {
186
190
  if (a.XLabel.Value && b.XLabel.Value) {
191
+ const monthMathcA = monthRegex.exec(a.XLabel.Value);
192
+ const monthMatchB = monthRegex.exec(b.XLabel.Value);
193
+ if (monthMatchB &&
194
+ monthMatchB &&
195
+ monthMathcA[1] &&
196
+ monthMatchB[1] &&
197
+ monthMathcA[2] &&
198
+ monthMatchB[2]) {
199
+ // 月的 格式 YYYY-MM-DD HH
200
+ const aDate = new Date(monthMathcA[1]).getTime();
201
+ const bDate = new Date(monthMatchB[1]).getTime();
202
+ const aHour = parseInt(monthMathcA[2], 10);
203
+ const bHour = parseInt(monthMatchB[2], 10);
204
+ if (aDate !== bDate) {
205
+ return aDate - bDate;
206
+ }
207
+ return aHour - bHour;
208
+ }
209
+ const weekMathcA = weekRegex.exec(a.XLabel.Value);
210
+ const weekMatchB = weekRegex.exec(b.XLabel.Value);
211
+ if (weekMatchB &&
212
+ weekMatchB &&
213
+ weekMathcA[1] &&
214
+ weekMatchB[1] &&
215
+ weekMathcA[2] &&
216
+ weekMatchB[2]) {
217
+ // 月的格式 2022W5
218
+ const aYear = parseInt(weekMathcA[1], 10);
219
+ const bYear = parseInt(weekMatchB[1], 10);
220
+ const aWeek = parseInt(weekMathcA[2], 10);
221
+ const bWeek = parseInt(weekMatchB[2], 10);
222
+ if (aYear !== bYear) {
223
+ return aYear - bYear;
224
+ }
225
+ return aWeek - bWeek;
226
+ }
187
227
  return (new Date(a.XLabel.Value).getTime() -
188
228
  new Date(b.XLabel.Value).getTime());
189
229
  }
@@ -267,6 +307,8 @@ class EchartBase extends AbstractEchartBaseModal {
267
307
  // 显示 X 轴标签名
268
308
  setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow }) {
269
309
  this.config.xAxis.axisLabel.show = isXaxisAxisLabelShow;
310
+ // 阻止自动隐藏
311
+ this.config.xAxis.axisLabel.interval = 0;
270
312
  }
271
313
  // 显示 X 轴名
272
314
  setIsXaxisName({ isXaxisName, xAxisName }) {
@@ -24,11 +24,10 @@ declare class EchartLine extends EchartBase {
24
24
  decimalDigits: any;
25
25
  suffix: any;
26
26
  }): void;
27
- setOptions({ chartType, 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, }: {
27
+ setOptions({ chartType, isTitle, title, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }: {
28
28
  chartType: any;
29
29
  isTitle: any;
30
30
  title: any;
31
- titleLocation: any;
32
31
  dataSource: any;
33
32
  filterData: any;
34
33
  xField: any;
@@ -39,7 +38,6 @@ declare class EchartLine extends EchartBase {
39
38
  yField: any;
40
39
  isLegend: any;
41
40
  legend: any;
42
- legend2: any;
43
41
  isXaxisName: any;
44
42
  xAxisName: any;
45
43
  isXaxisAxisLabelShow: any;
@@ -130,7 +130,11 @@ class EchartLine extends EchartBase {
130
130
  this.config.yAxis.axisLabel.formatter = null;
131
131
  }
132
132
  }
133
- async setOptions({ chartType, 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, }) {
133
+ async setOptions({ chartType, isTitle, title,
134
+ // titleLocation,
135
+ dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend,
136
+ // legend2,
137
+ isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }) {
134
138
  if (dataSource) {
135
139
  await this.setSourceData({
136
140
  dataSource,
@@ -143,9 +147,8 @@ class EchartLine extends EchartBase {
143
147
  groupKeyTimeSpan,
144
148
  });
145
149
  }
146
- legend = document.body.clientWidth < 1024 ? legend : legend2;
147
150
  this.setChartType({ chartType });
148
- this.setTitle({ isTitle, title, titleLocation });
151
+ this.setTitle({ isTitle, title });
149
152
  this.setLegend({ isLegend, legend });
150
153
  this.setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow });
151
154
  this.setIsXaxisName({ isXaxisName, xAxisName });
@@ -24,11 +24,10 @@ declare class EchartPie extends EchartBase {
24
24
  decimalDigits: any;
25
25
  suffix: any;
26
26
  }): void;
27
- setOptions({ chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
27
+ setOptions({ chartType, isTitle, title, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
28
28
  chartType: any;
29
29
  isTitle: any;
30
30
  title: any;
31
- titleLocation: any;
32
31
  dataSource: any;
33
32
  filterData: any;
34
33
  setColor: any;
@@ -38,7 +37,6 @@ declare class EchartPie extends EchartBase {
38
37
  yField: any;
39
38
  isLegend: any;
40
39
  legend: any;
41
- legend2: any;
42
40
  isSeriesShowSymbol: any;
43
41
  isPercent: any;
44
42
  isUnit: any;
@@ -103,8 +103,11 @@ class EchartPie extends EchartBase {
103
103
  };
104
104
  }
105
105
  }
106
- async setOptions({ chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
107
- legend = document.body.clientWidth < 1024 ? legend : legend2;
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, }) {
108
111
  if (dataSource) {
109
112
  await this.setSourceData({
110
113
  dataSource,
@@ -117,7 +120,7 @@ class EchartPie extends EchartBase {
117
120
  });
118
121
  }
119
122
  this.setChartType({ chartType });
120
- this.setTitle({ isTitle, title, titleLocation });
123
+ this.setTitle({ isTitle, title });
121
124
  this.setLegend({ isLegend, legend });
122
125
  this.setIsSeriesShowSymbol({
123
126
  isSeriesShowSymbol,
@@ -1,2 +1,5 @@
1
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';
2
4
  export default echarts;
5
+ export declare type ECOption = echarts.ComposeOption<BarSeriesOption | LineSeriesOption | PieSeriesOption | TitleComponentOption | TooltipComponentOption | GridComponentOption | LegendComponentOption>;
@@ -1,7 +1,9 @@
1
- import { useAsync, useDeepCompareEffect, useEventListener, useIsMounted, useMountEffect, } from '@react-hookz/web';
2
- import { useEffect, useRef, } from 'react';
1
+ import { useAsync, useDeepCompareEffect, useEventListener, useIsMounted, useMountEffect, useResizeObserver, } from '@react-hookz/web';
2
+ import { useEffect, useState } from 'react';
3
+ import { debug } from '../../../utils/console';
4
+ const logger = debug('chart:use-chart');
3
5
  export function useChart(ref) {
4
- const chartRef = useRef();
6
+ const [chartRef, setChartRef] = useState(null);
5
7
  const isMounted = useIsMounted();
6
8
  useMountEffect(async () => {
7
9
  if (!ref.current || !isMounted) {
@@ -9,17 +11,18 @@ export function useChart(ref) {
9
11
  }
10
12
  const echarts = (await import(/* webpackChunkName: "echarts" */ './echarts')).default;
11
13
  const echartDom = ref.current;
12
- const chart = echarts.init(echartDom);
13
- chartRef.current = chart;
14
+ setChartRef(echarts.init(echartDom));
14
15
  return () => {
15
- chart.dispose();
16
- chartRef.current = null;
16
+ chartRef.dispose();
17
17
  };
18
18
  });
19
19
  useEventListener(window, 'resize', () => {
20
- chartRef.current && chartRef.current.resize();
20
+ chartRef && chartRef.resize();
21
21
  });
22
- return chartRef.current;
22
+ useResizeObserver(ref, () => {
23
+ chartRef && chartRef.resize();
24
+ });
25
+ return chartRef;
23
26
  }
24
27
  /**
25
28
  * @deprecated The method should not be used
@@ -29,6 +32,7 @@ export function useWedaChart(domRef, ModalClass, options) {
29
32
  const getOptions = async () => {
30
33
  const chartModal = new ModalClass();
31
34
  let finalOptions = await chartModal.setOptions(options);
35
+ logger.log(options, finalOptions);
32
36
  if (!finalOptions) {
33
37
  finalOptions = chartModal.getOptions();
34
38
  }
@@ -46,8 +50,16 @@ export function useWedaChart(domRef, ModalClass, options) {
46
50
  actions,
47
51
  ]);
48
52
  useEffect(() => {
53
+ if (state.status === 'loading' || state.status === 'not-executed') {
54
+ chart === null || chart === void 0 ? void 0 : chart.showLoading();
55
+ return;
56
+ }
57
+ chart === null || chart === void 0 ? void 0 : chart.hideLoading();
58
+ }, [chart, state.status]);
59
+ useEffect(() => {
60
+ logger.log(state, state.result);
49
61
  if (state.status === 'success' && chart) {
50
- console.log(ModalClass.name, options, state.result, window.location.href);
62
+ logger.log(options, state.result, window.location.href);
51
63
  chart.setOption(state.result, true // noMerge 全刷
52
64
  );
53
65
  }
@@ -56,5 +68,5 @@ export function useWedaChart(domRef, ModalClass, options) {
56
68
  console.error(state.error);
57
69
  }
58
70
  }
59
- }, [state]);
71
+ }, [state, chart, options]);
60
72
  }