@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,50 +0,0 @@
1
- export { default as Button } from "./button";
2
- export const Text: any;
3
- export { default as Container } from "./container";
4
- export const Image: any;
5
- export { default as Slot } from "./slot";
6
- export { default as ScrollView } from "./scrollView";
7
- export { default as Swiper } from "./swiper";
8
- export { default as Carousel } from "./carousel";
9
- export { default as Modal } from "./modal";
10
- export const RichText: any;
11
- export { default as RichTextView } from "./richTextView";
12
- export { default as Link } from "./link";
13
- export { default as Drawer } from "./drawer";
14
- export { default as UploaderView } from "./uploaderView";
15
- export { default as UploaderFileView } from "./uploaderFileView";
16
- export const WedaVideo: any;
17
- export { default as Picker } from "./picker/picker";
18
- export { default as DatePicker } from "./picker/datePicker";
19
- export { default as TimePicker } from "./picker/timePicker";
20
- export { default as Form } from "./form/form";
21
- export { default as Input } from "./form/input";
22
- export { default as Textarea } from "./form/textarea";
23
- export { default as Checkbox } from "./form/checkbox";
24
- export { default as Radio } from "./form/radio";
25
- export { default as Switch } from "./form/switch";
26
- export { default as Select } from "./form/select";
27
- export { default as Uploader } from "./form/uploader";
28
- export { default as UploaderFile } from "./form/uploaderFile";
29
- export { default as Tips } from "./form/tips";
30
- export { default as Tabs } from "./tabs";
31
- export { default as Location } from "./form/location";
32
- export const EnumSelect: any;
33
- export const Calendar: any;
34
- export { default as NavLayout } from "./navLayout";
35
- export { default as ListView } from "./listView";
36
- export { default as NavigationBar } from "./navigationBar";
37
- export const Line: any;
38
- export const Bar: any;
39
- export const Pie: any;
40
- export { default as DataView } from "./dataView";
41
- export { default as StatisticsCard } from "./chart/statisticsCard";
42
- export { default as GraphicCard } from "./graphicCard";
43
- export { default as UserInfo } from "./userInfo";
44
- export { default as Phone } from "./phone";
45
- export { default as PhoneCode } from "./phoneCode";
46
- export { default as Share } from "./share";
47
- export { default as Lottery } from "./lottery";
48
- export { default as UserTreeSelect } from "./form/userOrgSelect/index";
49
- export { default as DepartTreeSelect } from "./form/userOrgSelect/departTreeSelect/index";
50
- export { default as FormDetail } from "./formdetail";
@@ -1,99 +0,0 @@
1
- import '@tcwd/style-wedatheme/index.css';
2
- import loadable from '@loadable/component';
3
- import { fallback } from '../utils/loading-fallback';
4
- // export const Button = loadable(() => import('./button'), {fallback});
5
- // export const Container = loadable(() => import('./container'), {fallback});
6
- // export const Slot = loadable(() => import('./slot'), {fallback});
7
- // export const ScrollView = loadable(() => import('./scrollView'), {fallback});
8
- // export const Swiper = loadable(() => import('./swiper'), {fallback});
9
- // export const Modal = loadable(() => import('./modal'), {fallback});
10
- // export const RichText = loadable(() => import('./richText'), {fallback});
11
- // export const RichTextView = loadable(() => import('./richTextView'), {fallback});
12
- // export const Link = loadable(() => import('./link'), {fallback});
13
- // export const Drawer = loadable(() => import('./drawer'), {fallback});
14
- // export const UploaderView = loadable(() => import('./uploaderView'), {fallback});
15
- // // picker
16
- // export const Picker = loadable(() => import('./picker/picker'), {fallback});
17
- // export const DatePicker = loadable(() => import('./picker/datePicker'), {fallback});
18
- // export const TimePicker = loadable(() => import('./picker/timePicker'), {fallback});
19
- // // form
20
- // export const Form = loadable(() => import('./form/form'), {fallback});
21
- // export const Input = loadable(() => import('./form/input'), {fallback});
22
- // export const Textarea = loadable(() => import('./form/textarea'), {fallback});
23
- // export const Checkbox = loadable(() => import('./form/checkbox'), {fallback});
24
- // export const Radio = loadable(() => import('./form/radio'), {fallback});
25
- // export const Switch = loadable(() => import('./form/switch'), {fallback});
26
- // export const Uploader = loadable(() => import('./form/uploader'), {fallback});
27
- // export const Tips = loadable(() => import('./form/tips'), {fallback});
28
- // export const EnumSelect = loadable(() => import('./form/enumSelect'), {fallback});
29
- // export const Tabs = loadable(() => import('./tabs'), {fallback});
30
- export { default as Button } from './button';
31
- // export { default as Text } from './text';
32
- export const Text = loadable(() => import('./text'), { fallback });
33
- export { default as Container } from './container';
34
- // export { default as Image } from './image';
35
- export const Image = loadable(() => import('./image'), { fallback });
36
- export { default as Slot } from './slot';
37
- export { default as ScrollView } from './scrollView';
38
- export { default as Swiper } from './swiper';
39
- export { default as Carousel } from './carousel';
40
- export { default as Modal } from './modal';
41
- // export { default as RichText } from './richText';
42
- export const RichText = loadable(() => import('./richText'), { fallback });
43
- export { default as RichTextView } from './richTextView';
44
- export { default as Link } from './link';
45
- export { default as Drawer } from './drawer';
46
- export { default as UploaderView } from './uploaderView';
47
- export { default as UploaderFileView } from './uploaderFileView';
48
- // export { default as WedaVideo } from './wedaVideo/index';
49
- export const WedaVideo = loadable(() => import('./wedaVideo/index'), {
50
- fallback,
51
- });
52
- export { default as Picker } from './picker/picker';
53
- export { default as DatePicker } from './picker/datePicker';
54
- export { default as TimePicker } from './picker/timePicker';
55
- // form
56
- export { default as Form } from './form/form';
57
- export { default as Input } from './form/input';
58
- export { default as Textarea } from './form/textarea';
59
- export { default as Checkbox } from './form/checkbox';
60
- export { default as Radio } from './form/radio';
61
- export { default as Switch } from './form/switch';
62
- export { default as Select } from './form/select';
63
- // export const Select = loadable(() => import('./form/select'), { fallback });
64
- export { default as Uploader } from './form/uploader';
65
- export { default as UploaderFile } from './form/uploaderFile';
66
- export { default as Tips } from './form/tips';
67
- export { default as Tabs } from './tabs';
68
- export { default as Location } from './form/location';
69
- // export { default as EnumSelect } from './form/enumSelect';
70
- export const EnumSelect = loadable(() => import('./form/enumSelect'), {
71
- fallback,
72
- });
73
- // export { default as Calendar } from './calendar';
74
- export const Calendar = loadable(() => import('./calendar'), { fallback });
75
- export { default as NavLayout } from './navLayout';
76
- // Data Contaier
77
- export { default as ListView } from './listView';
78
- export { default as NavigationBar } from './navigationBar';
79
- // export { default as Line } from './chart/line';
80
- // export { default as Bar } from './chart/bar';
81
- // export { default as Pie } from './chart/pie';
82
- export const Line = loadable(() => import('./chart/line'), { fallback });
83
- export const Bar = loadable(() => import('./chart/bar/index'), {
84
- fallback,
85
- });
86
- export const Pie = loadable(() => import('./chart/pie'), { fallback });
87
- export { default as DataView } from './dataView';
88
- export { default as StatisticsCard } from './chart/statisticsCard';
89
- export { default as GraphicCard } from './graphicCard';
90
- export { default as UserInfo } from './userInfo';
91
- export { default as Phone } from './phone';
92
- export { default as PhoneCode } from './phoneCode';
93
- export { default as Share } from './share';
94
- export { default as Lottery } from './lottery';
95
- export { default as UserTreeSelect } from './form/userOrgSelect/index';
96
- export { default as DepartTreeSelect } from './form/userOrgSelect/departTreeSelect/index';
97
- export { default as FormDetail } from './formdetail';
98
- import 'weui/dist/style/weui.css';
99
- import '../weda-ui.css';
@@ -1,24 +0,0 @@
1
- import * as React from 'react';
2
- import type { CommonPropsType } from '../../types';
3
- import './index.css';
4
- export interface PropsType extends CommonPropsType {
5
- /**
6
- * 内容
7
- */
8
- content?: string;
9
- /**
10
- * 链接地址
11
- */
12
- url?: string;
13
- /**
14
- * 参数
15
- */
16
- params?: Readonly<{
17
- key: string;
18
- value: string;
19
- }[]>;
20
- contentSlot?: React.ReactNode;
21
- isOpenInNewWindow?: boolean;
22
- }
23
- export default function Link({ content, url, events, style, className, contentSlot, params, // TODO 格式定义,
24
- isOpenInNewWindow, }: PropsType): JSX.Element;
@@ -1,71 +0,0 @@
1
- import * as React from 'react';
2
- import classNames from '../../utils/classnames';
3
- import { emptyArray, emptyObject } from '../../utils/constant';
4
- import './index.css';
5
- // 所有绝对地址直接交由浏览器,新开窗口交由浏览器
6
- // 当前窗口相对地址交给平台
7
- export default function Link({ content, url = '', events = emptyObject, style, className, contentSlot, params = emptyArray, // TODO 格式定义,
8
- isOpenInNewWindow, }) {
9
- url = url.trim();
10
- const cls = classNames({
11
- 'weda-link': true,
12
- 'weda-ui': true,
13
- [className]: className,
14
- });
15
- // URL 构造函数不支持 '//xxx.com' 的格式
16
- if (url.indexOf('//') === 0) {
17
- url = location.protocol + url;
18
- }
19
- // "proto:" 或 "//" 起头的是绝对路径
20
- let isAbosolutePath = /^(?:[a-z]+:)/i.test(url);
21
- let base, path, href, paramObj = {}, urlObj;
22
- if (!isAbosolutePath) {
23
- // 相对地址使用站位域名,不实际使用
24
- base =
25
- location.origin && location.origin !== 'null'
26
- ? location.origin
27
- : 'https://we.da';
28
- }
29
- try {
30
- urlObj = new URL(url, base);
31
- params.forEach((x) => {
32
- urlObj.searchParams.append(x.key, x.value);
33
- });
34
- href = urlObj.href;
35
- path = urlObj.pathname;
36
- for (const [key, value] of urlObj.searchParams) {
37
- paramObj[key] = value;
38
- }
39
- // 相对地址去掉站位域名
40
- if (!isAbosolutePath) {
41
- href = urlObj.pathname + urlObj.search + urlObj.hash;
42
- href = href.replace(/^\//, '');
43
- }
44
- }
45
- catch (e) {
46
- // 非法 url
47
- isAbosolutePath = true;
48
- href = url;
49
- path = '';
50
- paramObj = params.reduce((p, x) => {
51
- p[x.key] = x.value;
52
- return p;
53
- }, {});
54
- }
55
- return (React.createElement("a", { style: { ...style }, className: cls, target: isOpenInNewWindow ? '_blank' : '_self', href: href, onClick: (e) => {
56
- events.tap && events.tap({}, { originEvent: e });
57
- if (!e.defaultPrevented) {
58
- if (!isAbosolutePath) {
59
- e.preventDefault();
60
- app.navigateTo({
61
- pageId: path,
62
- packageName: '',
63
- mode: 'weDa',
64
- params: paramObj,
65
- });
66
- }
67
- }
68
- }, rel: "noopener noreferrer" },
69
- contentSlot && React.createElement("div", { className: "weda-link-slot" }, contentSlot),
70
- content));
71
- }
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { IListView } from './interface';
3
- import './index.css';
4
- /**
5
- * 数据容器-列表视图
6
- */
7
- export default function ListView(props: IListView): JSX.Element;
@@ -1,297 +0,0 @@
1
- /* eslint-disable react-hooks/exhaustive-deps */
2
- import React, { useState, useEffect, useRef, useCallback } from 'react';
3
- import { callDataSource } from '../../utils/tcb';
4
- import { isInIde, getWhereList } from '../../utils/platform';
5
- import classNames from '../../utils/classnames';
6
- import isequal from 'lodash.isequal';
7
- import './index.css';
8
- import { isNil } from '../../utils/lodash';
9
- const ORDERTYPE = ['asc', 'desc'];
10
- const BLOCK_NAME = 'weda-list-view';
11
- const getIdeMockData = (length = 3) => Array.from({ length }).map(() => Object.create(null));
12
- /**
13
- * 数据容器-列表视图
14
- */
15
- export default function ListView(props) {
16
- var _a, _b, _c;
17
- const { dataSourceType, bindConnectMetadata, connectorMethod, connectorParams, datasource, orderBy, orderType, where, template, pageSize = 5, pagination, events, className, children, isRecords = true, //是否展示回调recoreds字段
18
- isSetStatus = false, //是否开启加载状态
19
- appCloud = { callDataSource, isInIde }, beforeDataChange = (v) => v, ...rest } = props;
20
- const isModel = dataSourceType !== 'custom-connector';
21
- const methodName = isModel
22
- ? ((_a = datasource === null || datasource === void 0 ? void 0 : datasource.extra) === null || _a === void 0 ? void 0 : _a.methodName) || 'wedaGetRecords'
23
- : connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name; // 默认方法名
24
- const dataSourceName = isModel
25
- ? datasource === null || datasource === void 0 ? void 0 : datasource.name
26
- : (_b = bindConnectMetadata === null || bindConnectMetadata === void 0 ? void 0 : bindConnectMetadata.datasource) === null || _b === void 0 ? void 0 : _b.name;
27
- const [pageNo, setPageNo] = useState(1); // 分页状态
28
- const [entry, setEntry] = useState(null); // 触底的observer对象
29
- const [status, setStatus] = useState(''); // 查询状态
30
- const paramRef = useRef({
31
- dataSourceName,
32
- methodName,
33
- params: { orderBy, orderType, where, pageNo: 1, pageSize, connectorParams },
34
- pagination,
35
- }); // 最新请求参数
36
- const dataRef = useRef({ total: 0, records: [] }); // 最新数据列表
37
- const observeRef = useRef(null); // 当前监听对象
38
- const isIdeMockData = !(dataSourceName && methodName) && ((_c = appCloud === null || appCloud === void 0 ? void 0 : appCloud.isInIde) === null || _c === void 0 ? void 0 : _c.call(appCloud)); // 在ide环境且未绑定数据源时,存在mock数据逻辑
39
- const shouldBottomLoad = pagination === 'bottomLoad' &&
40
- (entry === null || entry === void 0 ? void 0 : entry.isIntersecting) &&
41
- ['', 'success'].includes(status); // 能否触底加载
42
- // 组件卸载时触发
43
- useEffect(() => {
44
- return () => {
45
- var _a, _b;
46
- (_a = observeRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
47
- (_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, { data: beforeDataChange([]) });
48
- };
49
- }, []);
50
- // props 基本类型监听,需重新分页;处于 ide 且未绑定数据源时返回mock数据
51
- useEffect(() => {
52
- var _a, _b;
53
- dataRef.current = { total: 0, records: [] };
54
- if (!isIdeMockData) {
55
- fetchData({
56
- dataSourceName,
57
- methodName,
58
- params: {
59
- ...(_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params,
60
- orderBy,
61
- orderType,
62
- pageNo: 1,
63
- pageSize,
64
- },
65
- pagination,
66
- });
67
- }
68
- else {
69
- (_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, {
70
- data: beforeDataChange(getIdeMockData(pageSize)),
71
- });
72
- }
73
- }, [
74
- methodName,
75
- dataSourceName,
76
- pageSize,
77
- pagination,
78
- orderBy,
79
- orderType,
80
- isModel,
81
- ]);
82
- // props 对象类型监听,需重新分页
83
- useEffect(() => {
84
- var _a, _b, _c, _d;
85
- if (isModel) {
86
- if (!isequal((_b = (_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.where, where)) {
87
- dataRef.current = { total: 0, records: [] };
88
- fetchData({
89
- params: { pageNo: 1, where },
90
- });
91
- }
92
- }
93
- else {
94
- if (!isequal((_d = (_c = paramRef.current) === null || _c === void 0 ? void 0 : _c.params) === null || _d === void 0 ? void 0 : _d.connectorParams, connectorParams)) {
95
- dataRef.current = { total: 0, records: [] };
96
- fetchData({
97
- params: { pageNo: 1, connectorParams },
98
- });
99
- }
100
- }
101
- });
102
- // 监听触底加载事件
103
- useEffect(() => {
104
- var _a, _b;
105
- if (shouldBottomLoad && hasNextPage()) {
106
- fetchData({
107
- params: { pageNo: (((_b = (_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.pageNo) || 1) + 1 },
108
- });
109
- }
110
- }, [shouldBottomLoad]);
111
- // 触底监控对象
112
- const nodeRefCallback = useCallback((node) => {
113
- var _a;
114
- if (node) {
115
- (_a = observeRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
116
- observeRef.current = new IntersectionObserver((entries) => {
117
- setEntry(entries === null || entries === void 0 ? void 0 : entries[0]);
118
- });
119
- observeRef.current.observe(node);
120
- }
121
- }, []);
122
- // 能否点击下一页
123
- const hasNextPage = () => {
124
- var _a;
125
- const { pageNo = 1, pageSize = 5 } = ((_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) || {};
126
- const { total = 0 } = dataRef.current || {};
127
- return pageNo * pageSize < total;
128
- };
129
- /**
130
- * 列表视图拉取数据
131
- * 方法仅依赖入参和paramRef的参数
132
- */
133
- const fetchData = async (param) => {
134
- var _a;
135
- // 合并参数
136
- const fetchParam = {
137
- ...paramRef.current,
138
- ...param,
139
- params: { ...paramRef.current.params, ...param === null || param === void 0 ? void 0 : param.params },
140
- };
141
- const { dataSourceName, methodName, params } = fetchParam;
142
- const { orderBy, orderType, pageNo, pageSize, where, connectorParams } = params || {};
143
- if (status === 'loading' || !(dataSourceName && methodName))
144
- return;
145
- setStatus('loading');
146
- let tcbParams = {};
147
- // tcb分页参数
148
- if (!isNil(pageNo) && !isNil(pageSize)) {
149
- tcbParams['pageNo'] = pageNo;
150
- tcbParams['pageSize'] = pageSize;
151
- }
152
- if (isModel) {
153
- // tcb排序参数
154
- if (orderBy && ORDERTYPE.includes(orderType)) {
155
- tcbParams['orderBy'] = orderBy;
156
- tcbParams['orderType'] = orderType;
157
- }
158
- // tcb过滤参数
159
- const whereEffected = [].concat(getWhereList(where));
160
- whereEffected.length > 0 && (tcbParams['where'] = whereEffected);
161
- }
162
- else {
163
- tcbParams = Object.assign({}, tcbParams, connectorParams);
164
- }
165
- // tcb结果和事件
166
- let data = [];
167
- const eventDatasource = isModel
168
- ? datasource
169
- : { ...bindConnectMetadata, ...connectorMethod };
170
- try {
171
- data = await (appCloud === null || appCloud === void 0 ? void 0 : appCloud.callDataSource({
172
- dataSourceName,
173
- methodName,
174
- params: tcbParams,
175
- }, true));
176
- paramRef.current = fetchParam;
177
- onEnvets(data, eventDatasource);
178
- }
179
- catch (e) {
180
- setStatus(isModel ? 'fail' : '');
181
- (_a = events === null || events === void 0 ? void 0 : events.queryFail) === null || _a === void 0 ? void 0 : _a.call(events, { datasource: eventDatasource, data: null });
182
- }
183
- };
184
- /**
185
- * 根据fetchData方法返回值,回调给外部事件
186
- */
187
- const onEnvets = (data, datasource) => {
188
- var _a, _b, _c, _d, _e;
189
- const bottomLoadTimer = 150;
190
- const fetchRecords = [].concat(!isRecords && !isModel ? data : (data === null || data === void 0 ? void 0 : data.records) || []);
191
- const total = (_a = data === null || data === void 0 ? void 0 : data.total) !== null && _a !== void 0 ? _a : fetchRecords.length;
192
- if (['loadMoreButton', 'bottomLoad'].includes(paramRef.current.pagination)) {
193
- dataRef.current = {
194
- total,
195
- records: [...dataRef.current.records, ...fetchRecords],
196
- };
197
- }
198
- else {
199
- dataRef.current = { total, records: fetchRecords };
200
- }
201
- (_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, {
202
- data: beforeDataChange(dataRef.current.records || []),
203
- });
204
- if (total === 0) {
205
- setStatus(isModel ? 'empty' : '');
206
- (_c = events === null || events === void 0 ? void 0 : events.queryEmpty) === null || _c === void 0 ? void 0 : _c.call(events, {
207
- datasource,
208
- data: beforeDataChange([]),
209
- });
210
- }
211
- else {
212
- const statusCb = () => setStatus('success');
213
- pagination === 'bottomLoad'
214
- ? window.setTimeout(statusCb, bottomLoadTimer)
215
- : statusCb();
216
- }
217
- const successCb = () => {
218
- var _a;
219
- (_a = events === null || events === void 0 ? void 0 : events.querySuccess) === null || _a === void 0 ? void 0 : _a.call(events, {
220
- datasource,
221
- data: beforeDataChange(dataRef.current.records),
222
- });
223
- };
224
- pagination === 'bottomLoad'
225
- ? window.setTimeout(successCb, bottomLoadTimer + 50)
226
- : successCb();
227
- setPageNo(((_e = (_d = paramRef.current) === null || _d === void 0 ? void 0 : _d.params) === null || _e === void 0 ? void 0 : _e.pageNo) || 1);
228
- };
229
- /**
230
- * 分页,加载更多
231
- */
232
- const renderLoadMore = () => {
233
- let disabled = !hasNextPage();
234
- if (isIdeMockData) {
235
- disabled = false;
236
- }
237
- if (status === 'loading')
238
- return LoadingSymbol;
239
- return (!disabled && (React.createElement("div", { className: `${BLOCK_NAME}__more-text`, onClick: () => fetchData({ params: { pageNo: pageNo + 1 } }) }, "\u52A0\u8F7D\u66F4\u591A")));
240
- };
241
- /**
242
- * 分页,底部刷新
243
- */
244
- const renderBottomLoad = () => {
245
- return (React.createElement("div", { ref: nodeRefCallback, className: `${BLOCK_NAME}__bottom-load` }, status === 'loading' ? LoadingSymbol : !hasNextPage() && LoadEnd));
246
- };
247
- /**
248
- * 分页,分页器,含ideMockData的判断
249
- */
250
- const renderPagination = () => {
251
- var _a, _b;
252
- const preDisabeld = pageNo <= 1;
253
- const nextDisabeld = !hasNextPage();
254
- const total = (_b = (_a = dataRef.current) === null || _a === void 0 ? void 0 : _a.total) !== null && _b !== void 0 ? _b : 0;
255
- return (React.createElement("div", { className: `${BLOCK_NAME}__more-pagination` },
256
- React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-pre`, preDisabeld ? '' : 'active'), onClick: () => !preDisabeld && fetchData({ params: { pageNo: pageNo - 1 } }) }, "\u4E0A\u4E00\u9875"),
257
- React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-text`) },
258
- React.createElement("span", { className: "active" }, isIdeMockData ? 1 : total ? pageNo : 0),
259
- "/",
260
- isIdeMockData ? 1 : Math.ceil(total / pageSize)),
261
- React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-next`, nextDisabeld ? '' : 'active'), onClick: () => !nextDisabeld && fetchData({ params: { pageNo: pageNo + 1 } }) }, "\u4E0B\u4E00\u9875")));
262
- };
263
- /**
264
- * 查询状态展示
265
- */
266
- const renderStatus = () => {
267
- switch (status) {
268
- case 'empty':
269
- return React.createElement("div", { className: `${BLOCK_NAME}__empty` }, "\u6682\u65E0\u6570\u636E");
270
- case 'fail':
271
- return React.createElement("div", { className: `${BLOCK_NAME}__fail` }, "\u52A0\u8F7D\u5931\u8D25");
272
- case 'loading':
273
- return (pagination === 'pagination' && (React.createElement("div", { className: classNames(`${BLOCK_NAME}__more`, `${BLOCK_NAME}__content-loading`) }, LoadingSymbol)));
274
- }
275
- };
276
- /**
277
- * 加载中状态组件
278
- */
279
- const LoadingSymbol = (React.createElement("div", { className: `${BLOCK_NAME}__more-symbol` },
280
- React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` }),
281
- React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` }),
282
- React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` })));
283
- /**
284
- * 加载到底状态组件
285
- */
286
- const LoadEnd = React.createElement("div", null);
287
- return (React.createElement("div", { ...rest, className: classNames('weda-ui', `${BLOCK_NAME}__containor`, className) },
288
- children && (React.createElement("div", { className: classNames(template === 'cardList' ? `${BLOCK_NAME}-card` : '', `${BLOCK_NAME}__content`, ['empty', 'fail'].includes(status) && isSetStatus
289
- ? `${BLOCK_NAME}__content-blank`
290
- : '') },
291
- children,
292
- isSetStatus && renderStatus())),
293
- React.createElement("div", { className: classNames(`${BLOCK_NAME}__more`, `${BLOCK_NAME}__more-${pagination}`) },
294
- pagination === 'bottomLoad' && renderBottomLoad(),
295
- pagination === 'loadMoreButton' && renderLoadMore(),
296
- pagination === 'pagination' && renderPagination())));
297
- }