@cloudbase/weda-ui 3.1.9 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (422) hide show
  1. package/dist/configs/components/chart/bar.json +3 -3
  2. package/dist/configs/components/chart/line.json +3 -3
  3. package/dist/configs/components/chart/pie.json +3 -3
  4. package/dist/configs/components/form/departTreeSelect.json +124 -0
  5. package/dist/configs/components/form/userTreeSelect.json +128 -0
  6. package/dist/configs/components/formdetail.json +105 -0
  7. package/dist/configs/components/listView.json +9 -1
  8. package/dist/configs/components/lottery.json +1 -1
  9. package/dist/configs/components/tabs.json +10 -9
  10. package/dist/configs/components/wxOpenApi/share.json +5 -2
  11. package/dist/configs/index.d.ts +6 -0
  12. package/dist/configs/index.js +6 -0
  13. package/dist/cypress/support/commands.d.ts +1 -0
  14. package/dist/cypress/support/commands.js +40 -0
  15. package/dist/cypress/support/e2e.d.ts +24 -0
  16. package/dist/cypress/support/e2e.js +22 -0
  17. package/dist/src/configs/actions/showModal.json +48 -0
  18. package/dist/src/configs/actions/showToast.json +41 -0
  19. package/dist/src/configs/components/auth.json +16 -0
  20. package/dist/src/configs/components/button.json +239 -0
  21. package/dist/src/configs/components/calendar.json +81 -0
  22. package/dist/src/configs/components/carousel.json +292 -0
  23. package/dist/src/configs/components/chart/bar.json +954 -0
  24. package/dist/src/configs/components/chart/line.json +870 -0
  25. package/dist/src/configs/components/chart/pie.json +677 -0
  26. package/dist/src/configs/components/chart/statisticsCard.json +376 -0
  27. package/dist/src/configs/components/container.json +50 -0
  28. package/dist/src/configs/components/dataView.json +247 -0
  29. package/dist/src/configs/components/drawer.json +115 -0
  30. package/dist/src/configs/components/form/checkbox.json +179 -0
  31. package/dist/src/configs/components/form/departTreeSelect.json +124 -0
  32. package/dist/src/configs/components/form/form.json +73 -0
  33. package/dist/src/configs/components/form/input.json +154 -0
  34. package/dist/src/configs/components/form/location.json +216 -0
  35. package/dist/src/configs/components/form/radio.json +203 -0
  36. package/dist/src/configs/components/form/richText.json +133 -0
  37. package/dist/src/configs/components/form/select.json +449 -0
  38. package/dist/src/configs/components/form/switch.json +58 -0
  39. package/dist/src/configs/components/form/textarea.json +116 -0
  40. package/dist/src/configs/components/form/tips.json +34 -0
  41. package/dist/src/configs/components/form/uploader.json +171 -0
  42. package/dist/src/configs/components/form/uploaderFile.json +158 -0
  43. package/dist/src/configs/components/form/userTreeSelect.json +128 -0
  44. package/dist/src/configs/components/formdetail.json +105 -0
  45. package/dist/src/configs/components/graphicCard.json +413 -0
  46. package/dist/src/configs/components/image.json +187 -0
  47. package/dist/src/configs/components/link.json +79 -0
  48. package/dist/src/configs/components/listView.json +378 -0
  49. package/dist/src/configs/components/lottery.json +163 -0
  50. package/dist/src/configs/components/modal.json +72 -0
  51. package/dist/src/configs/components/navLayout.json +368 -0
  52. package/dist/src/configs/components/navigationBar.json +62 -0
  53. package/dist/src/configs/components/richtextview.json +26 -0
  54. package/dist/src/configs/components/scrollVeiw.json +253 -0
  55. package/dist/src/configs/components/slot.json +17 -0
  56. package/dist/src/configs/components/swiper.json +90 -0
  57. package/dist/src/configs/components/tabs.json +122 -0
  58. package/dist/src/configs/components/text.json +95 -0
  59. package/dist/src/configs/components/wedaVideo.json +89 -0
  60. package/dist/src/configs/components/wxOpenApi/phone.json +127 -0
  61. package/dist/src/configs/components/wxOpenApi/phoneCode.json +109 -0
  62. package/dist/src/configs/components/wxOpenApi/share.json +160 -0
  63. package/dist/src/configs/components/wxOpenApi/userInfo.json +156 -0
  64. package/dist/src/configs/index.d.ts +103 -0
  65. package/dist/src/configs/index.js +111 -0
  66. package/dist/src/docs/common/format.d.ts +13 -0
  67. package/dist/src/docs/common/format.js +122 -0
  68. package/dist/src/docs/common/tableView.d.ts +30 -0
  69. package/dist/src/docs/common/tableView.js +156 -0
  70. package/dist/src/index.d.ts +2 -0
  71. package/dist/src/index.js +3 -0
  72. package/dist/src/setupTests.d.ts +2 -0
  73. package/dist/src/setupTests.js +19 -0
  74. package/dist/src/web/actions/index.d.ts +2 -0
  75. package/dist/src/web/actions/index.js +2 -0
  76. package/dist/src/web/actions/showModal/index.d.ts +4 -0
  77. package/dist/src/web/actions/showModal/index.js +67 -0
  78. package/dist/src/web/actions/showToast/index.d.ts +1 -0
  79. package/dist/src/web/actions/showToast/index.js +3 -0
  80. package/dist/src/web/components/button/index.d.ts +32 -0
  81. package/dist/src/web/components/button/index.js +48 -0
  82. package/dist/src/web/components/calendar/index.d.ts +19 -0
  83. package/dist/src/web/components/calendar/index.js +189 -0
  84. package/dist/src/web/components/calendar/util.d.ts +13 -0
  85. package/dist/src/web/components/calendar/util.js +74 -0
  86. package/dist/src/web/components/carousel/index.d.ts +41 -0
  87. package/dist/src/web/components/carousel/index.js +244 -0
  88. package/dist/src/web/components/chart/bar/index.d.ts +3 -0
  89. package/dist/src/web/components/chart/bar/index.js +41 -0
  90. package/dist/src/web/components/chart/bar/index.old.d.ts +40 -0
  91. package/dist/src/web/components/chart/bar/index.old.js +56 -0
  92. package/dist/src/web/components/chart/common/Chart.d.ts +9 -0
  93. package/dist/src/web/components/chart/common/Chart.js +23 -0
  94. package/dist/src/web/components/chart/common/chart-custom-connector.d.ts +6 -0
  95. package/dist/src/web/components/chart/common/chart-custom-connector.js +35 -0
  96. package/dist/src/web/components/chart/common/chart-error.d.ts +2 -0
  97. package/dist/src/web/components/chart/common/chart-error.js +2 -0
  98. package/dist/src/web/components/chart/common/config/bar.d.ts +48 -0
  99. package/dist/src/web/components/chart/common/config/bar.js +49 -0
  100. package/dist/src/web/components/chart/common/config/global.d.ts +13 -0
  101. package/dist/src/web/components/chart/common/config/global.js +16 -0
  102. package/dist/src/web/components/chart/common/config/line.d.ts +46 -0
  103. package/dist/src/web/components/chart/common/config/line.js +49 -0
  104. package/dist/src/web/components/chart/common/config/pie.d.ts +29 -0
  105. package/dist/src/web/components/chart/common/config/pie.js +36 -0
  106. package/dist/src/web/components/chart/common/core/eChartBar.d.ts +66 -0
  107. package/dist/src/web/components/chart/common/core/eChartBar.js +201 -0
  108. package/dist/src/web/components/chart/common/core/eChartBase.d.ts +127 -0
  109. package/dist/src/web/components/chart/common/core/eChartBase.js +394 -0
  110. package/dist/src/web/components/chart/common/core/eChartLine.d.ts +60 -0
  111. package/dist/src/web/components/chart/common/core/eChartLine.js +173 -0
  112. package/dist/src/web/components/chart/common/core/eChartPie.d.ts +48 -0
  113. package/dist/src/web/components/chart/common/core/eChartPie.js +135 -0
  114. package/dist/src/web/components/chart/common/core/type.d.ts +35 -0
  115. package/dist/src/web/components/chart/common/core/type.js +9 -0
  116. package/dist/src/web/components/chart/common/data-transform.d.ts +6 -0
  117. package/dist/src/web/components/chart/common/data-transform.js +246 -0
  118. package/dist/src/web/components/chart/common/echarts.d.ts +5 -0
  119. package/dist/src/web/components/chart/common/echarts.js +24 -0
  120. package/dist/src/web/components/chart/common/error-boundary.d.ts +5 -0
  121. package/dist/src/web/components/chart/common/error-boundary.js +26 -0
  122. package/dist/src/web/components/chart/common/useChart.d.ts +8 -0
  123. package/dist/src/web/components/chart/common/useChart.js +61 -0
  124. package/dist/src/web/components/chart/line/index.d.ts +3 -0
  125. package/dist/src/web/components/chart/line/index.js +42 -0
  126. package/dist/src/web/components/chart/line/index.old.d.ts +38 -0
  127. package/dist/src/web/components/chart/line/index.old.js +53 -0
  128. package/dist/src/web/components/chart/pie/index.d.ts +3 -0
  129. package/dist/src/web/components/chart/pie/index.js +42 -0
  130. package/dist/src/web/components/chart/pie/index.old.d.ts +27 -0
  131. package/dist/src/web/components/chart/pie/index.old.js +40 -0
  132. package/dist/src/web/components/chart/statisticsCard/index.d.ts +85 -0
  133. package/dist/src/web/components/chart/statisticsCard/index.js +203 -0
  134. package/dist/src/web/components/chart/statisticsCard/interface.d.ts +13 -0
  135. package/dist/src/web/components/chart/statisticsCard/interface.js +1 -0
  136. package/dist/src/web/components/common/portal.d.ts +7 -0
  137. package/dist/src/web/components/common/portal.js +14 -0
  138. package/dist/src/web/components/container/index.d.ts +6 -0
  139. package/dist/src/web/components/container/index.js +6 -0
  140. package/dist/src/web/components/dataView/index.d.ts +6 -0
  141. package/dist/src/web/components/dataView/index.js +8 -0
  142. package/dist/src/web/components/dataView/interface.d.ts +5 -0
  143. package/dist/src/web/components/dataView/interface.js +1 -0
  144. package/dist/src/web/components/drawer/index.d.ts +13 -0
  145. package/dist/src/web/components/drawer/index.js +12 -0
  146. package/dist/src/web/components/form/checkbox/index.d.ts +13 -0
  147. package/dist/src/web/components/form/checkbox/index.js +167 -0
  148. package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
  149. package/dist/src/web/components/form/enumSelect/MultipleSelect.js +52 -0
  150. package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
  151. package/dist/src/web/components/form/enumSelect/NormalSelect.js +52 -0
  152. package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
  153. package/dist/src/web/components/form/enumSelect/SelectContainer.js +30 -0
  154. package/dist/src/web/components/form/enumSelect/index.d.ts +82 -0
  155. package/dist/src/web/components/form/enumSelect/index.js +6 -0
  156. package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
  157. package/dist/src/web/components/form/enumSelect/props/defaultProps.js +40 -0
  158. package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
  159. package/dist/src/web/components/form/enumSelect/props/propsTypes.js +47 -0
  160. package/dist/src/web/components/form/form/index.d.ts +32 -0
  161. package/dist/src/web/components/form/form/index.js +141 -0
  162. package/dist/src/web/components/form/formcell/index.d.ts +8 -0
  163. package/dist/src/web/components/form/formcell/index.js +40 -0
  164. package/dist/src/web/components/form/input/index.d.ts +14 -0
  165. package/dist/src/web/components/form/input/index.js +86 -0
  166. package/dist/src/web/components/form/location/common/mapChoose.d.ts +15 -0
  167. package/dist/src/web/components/form/location/common/mapChoose.js +495 -0
  168. package/dist/src/web/components/form/location/common/mapView.d.ts +19 -0
  169. package/dist/src/web/components/form/location/common/mapView.js +172 -0
  170. package/dist/src/web/components/form/location/common/propsConfig.d.ts +59 -0
  171. package/dist/src/web/components/form/location/common/propsConfig.js +50 -0
  172. package/dist/src/web/components/form/location/common/selectModal.d.ts +21 -0
  173. package/dist/src/web/components/form/location/common/selectModal.js +44 -0
  174. package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +36 -0
  175. package/dist/src/web/components/form/location/common/useLocationInfo.js +104 -0
  176. package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
  177. package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +325 -0
  178. package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
  179. package/dist/src/web/components/form/location/components/LocationPC/Header.js +43 -0
  180. package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
  181. package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +224 -0
  182. package/dist/src/web/components/form/location/constants.d.ts +2 -0
  183. package/dist/src/web/components/form/location/constants.js +3 -0
  184. package/dist/src/web/components/form/location/index.d.ts +1 -0
  185. package/dist/src/web/components/form/location/index.js +17 -0
  186. package/dist/src/web/components/form/radio/index.d.ts +11 -0
  187. package/dist/src/web/components/form/radio/index.js +115 -0
  188. package/dist/src/web/components/form/renderDecorator.d.ts +6 -0
  189. package/dist/src/web/components/form/renderDecorator.js +20 -0
  190. package/dist/src/web/components/form/select/allTimePicker/calendar.d.ts +13 -0
  191. package/dist/src/web/components/form/select/allTimePicker/calendar.js +104 -0
  192. package/dist/src/web/components/form/select/allTimePicker/dataUtils.d.ts +24 -0
  193. package/dist/src/web/components/form/select/allTimePicker/dataUtils.js +265 -0
  194. package/dist/src/web/components/form/select/allTimePicker/index.d.ts +14 -0
  195. package/dist/src/web/components/form/select/allTimePicker/index.js +943 -0
  196. package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +15 -0
  197. package/dist/src/web/components/form/select/dropdown-select/ui.js +55 -0
  198. package/dist/src/web/components/form/select/h5.d.ts +16 -0
  199. package/dist/src/web/components/form/select/h5.js +452 -0
  200. package/dist/src/web/components/form/select/index.d.ts +66 -0
  201. package/dist/src/web/components/form/select/index.js +241 -0
  202. package/dist/src/web/components/form/select/region/index.d.ts +6 -0
  203. package/dist/src/web/components/form/select/region/index.js +147 -0
  204. package/dist/src/web/components/form/select/time.d.ts +9 -0
  205. package/dist/src/web/components/form/select/time.js +146 -0
  206. package/dist/src/web/components/form/select/use-options.d.ts +26 -0
  207. package/dist/src/web/components/form/select/use-options.js +103 -0
  208. package/dist/src/web/components/form/select/year.d.ts +7 -0
  209. package/dist/src/web/components/form/select/year.js +72 -0
  210. package/dist/src/web/components/form/switch/index.d.ts +6 -0
  211. package/dist/src/web/components/form/switch/index.js +58 -0
  212. package/dist/src/web/components/form/textarea/index.d.ts +12 -0
  213. package/dist/src/web/components/form/textarea/index.js +66 -0
  214. package/dist/src/web/components/form/tips/index.d.ts +8 -0
  215. package/dist/src/web/components/form/tips/index.js +17 -0
  216. package/dist/src/web/components/form/uploader/index.d.ts +3 -0
  217. package/dist/src/web/components/form/uploader/index.js +42 -0
  218. package/dist/src/web/components/form/uploader/uploader.h5.d.ts +20 -0
  219. package/dist/src/web/components/form/uploader/uploader.h5.js +199 -0
  220. package/dist/src/web/components/form/uploader/uploader.pc.d.ts +29 -0
  221. package/dist/src/web/components/form/uploader/uploader.pc.js +208 -0
  222. package/dist/src/web/components/form/uploaderFile/index.d.ts +4 -0
  223. package/dist/src/web/components/form/uploaderFile/index.js +19 -0
  224. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
  225. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +328 -0
  226. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
  227. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +299 -0
  228. package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +8 -0
  229. package/dist/src/web/components/form/userOrgSelect/comTool.js +107 -0
  230. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +19 -0
  231. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +247 -0
  232. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
  233. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +158 -0
  234. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
  235. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
  236. package/dist/src/web/components/form/userOrgSelect/index.d.ts +2 -0
  237. package/dist/src/web/components/form/userOrgSelect/index.js +17 -0
  238. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +26 -0
  239. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +258 -0
  240. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
  241. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +271 -0
  242. package/dist/src/web/components/form/userOrgSelect/utils.d.ts +35 -0
  243. package/dist/src/web/components/form/userOrgSelect/utils.js +72 -0
  244. package/dist/src/web/components/formdetail/index.d.ts +28 -0
  245. package/dist/src/web/components/formdetail/index.js +170 -0
  246. package/dist/src/web/components/graphicCard/index.d.ts +46 -0
  247. package/dist/src/web/components/graphicCard/index.js +179 -0
  248. package/dist/src/web/components/image/image.d.ts +9 -0
  249. package/dist/src/web/components/image/image.js +119 -0
  250. package/dist/src/web/components/image/index.d.ts +13 -0
  251. package/dist/src/web/components/image/index.js +77 -0
  252. package/dist/src/web/components/index.d.ts +50 -0
  253. package/dist/src/web/components/index.js +99 -0
  254. package/dist/src/web/components/link/index.d.ts +24 -0
  255. package/dist/src/web/components/link/index.js +71 -0
  256. package/dist/src/web/components/listView/index.d.ts +7 -0
  257. package/dist/src/web/components/listView/index.js +296 -0
  258. package/dist/src/web/components/listView/interface.d.ts +127 -0
  259. package/dist/src/web/components/listView/interface.js +1 -0
  260. package/dist/src/web/components/lottery/index.d.ts +22 -0
  261. package/dist/src/web/components/lottery/index.js +391 -0
  262. package/dist/src/web/components/lottery/lotteryUtil.d.ts +23 -0
  263. package/dist/src/web/components/lottery/lotteryUtil.js +181 -0
  264. package/dist/src/web/components/modal/index.d.ts +17 -0
  265. package/dist/src/web/components/modal/index.js +11 -0
  266. package/dist/src/web/components/modal/modal.h5.d.ts +4 -0
  267. package/dist/src/web/components/modal/modal.h5.js +46 -0
  268. package/dist/src/web/components/modal/modal.pc.d.ts +3 -0
  269. package/dist/src/web/components/modal/modal.pc.js +31 -0
  270. package/dist/src/web/components/navLayout/index.d.ts +61 -0
  271. package/dist/src/web/components/navLayout/index.js +127 -0
  272. package/dist/src/web/components/navigationBar/common.d.ts +15 -0
  273. package/dist/src/web/components/navigationBar/common.js +127 -0
  274. package/dist/src/web/components/navigationBar/h5Menu.d.ts +14 -0
  275. package/dist/src/web/components/navigationBar/h5Menu.js +72 -0
  276. package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +12 -0
  277. package/dist/src/web/components/navigationBar/horizontalMenu.js +99 -0
  278. package/dist/src/web/components/navigationBar/index.d.ts +13 -0
  279. package/dist/src/web/components/navigationBar/index.js +157 -0
  280. package/dist/src/web/components/navigationBar/verticalMenu.d.ts +13 -0
  281. package/dist/src/web/components/navigationBar/verticalMenu.js +38 -0
  282. package/dist/src/web/components/phone/index.d.ts +18 -0
  283. package/dist/src/web/components/phone/index.js +4 -0
  284. package/dist/src/web/components/phoneCode/index.d.ts +18 -0
  285. package/dist/src/web/components/phoneCode/index.js +4 -0
  286. package/dist/src/web/components/picker/datePicker.d.ts +10 -0
  287. package/dist/src/web/components/picker/datePicker.js +31 -0
  288. package/dist/src/web/components/picker/picker.d.ts +6 -0
  289. package/dist/src/web/components/picker/picker.js +45 -0
  290. package/dist/src/web/components/picker/timePicker.d.ts +7 -0
  291. package/dist/src/web/components/picker/timePicker.js +42 -0
  292. package/dist/src/web/components/richText/const.d.ts +1 -0
  293. package/dist/src/web/components/richText/const.js +2 -0
  294. package/dist/src/web/components/richText/index.d.ts +50 -0
  295. package/dist/src/web/components/richText/index.js +352 -0
  296. package/dist/src/web/components/richTextView/index.d.ts +7 -0
  297. package/dist/src/web/components/richTextView/index.js +44 -0
  298. package/dist/src/web/components/scrollView/index.d.ts +27 -0
  299. package/dist/src/web/components/scrollView/index.js +95 -0
  300. package/dist/src/web/components/share/index.d.ts +34 -0
  301. package/dist/src/web/components/share/index.js +4 -0
  302. package/dist/src/web/components/slot/index.d.ts +6 -0
  303. package/dist/src/web/components/slot/index.js +9 -0
  304. package/dist/src/web/components/swiper/index.d.ts +24 -0
  305. package/dist/src/web/components/swiper/index.js +153 -0
  306. package/dist/src/web/components/tabs/index.d.ts +13 -0
  307. package/dist/src/web/components/tabs/index.js +15 -0
  308. package/dist/src/web/components/tabs/tabs.h5.d.ts +4 -0
  309. package/dist/src/web/components/tabs/tabs.h5.js +42 -0
  310. package/dist/src/web/components/tabs/tabs.pc.d.ts +3 -0
  311. package/dist/src/web/components/tabs/tabs.pc.js +40 -0
  312. package/dist/src/web/components/text/index.d.ts +14 -0
  313. package/dist/src/web/components/text/index.js +17 -0
  314. package/dist/src/web/components/uploaderFileView/index.d.ts +10 -0
  315. package/dist/src/web/components/uploaderFileView/index.js +46 -0
  316. package/dist/src/web/components/uploaderView/index.d.ts +17 -0
  317. package/dist/src/web/components/uploaderView/index.js +48 -0
  318. package/dist/src/web/components/userInfo/index.d.ts +26 -0
  319. package/dist/src/web/components/userInfo/index.js +4 -0
  320. package/dist/src/web/components/wedaVideo/index.d.ts +17 -0
  321. package/dist/src/web/components/wedaVideo/index.js +144 -0
  322. package/dist/src/web/index.d.ts +8 -0
  323. package/dist/src/web/index.js +4 -0
  324. package/dist/src/web/utils/classnames.d.ts +2 -0
  325. package/dist/src/web/utils/classnames.js +37 -0
  326. package/dist/src/web/utils/constant.d.ts +23 -0
  327. package/dist/src/web/utils/constant.js +24 -0
  328. package/dist/src/web/utils/debounce.d.ts +2 -0
  329. package/dist/src/web/utils/debounce.js +92 -0
  330. package/dist/src/web/utils/getLocalCounter.d.ts +1 -0
  331. package/dist/src/web/utils/getLocalCounter.js +4 -0
  332. package/dist/src/web/utils/getUserService.d.ts +11 -0
  333. package/dist/src/web/utils/getUserService.js +156 -0
  334. package/dist/src/web/utils/isObjectEqual.d.ts +2 -0
  335. package/dist/src/web/utils/isObjectEqual.js +12 -0
  336. package/dist/src/web/utils/loading-fallback.d.ts +2 -0
  337. package/dist/src/web/utils/loading-fallback.js +2 -0
  338. package/dist/src/web/utils/lodash.d.ts +1 -0
  339. package/dist/src/web/utils/lodash.js +2 -0
  340. package/dist/src/web/utils/platform.d.ts +18 -0
  341. package/dist/src/web/utils/platform.js +193 -0
  342. package/dist/src/web/utils/tcb.d.ts +33 -0
  343. package/dist/src/web/utils/tcb.js +118 -0
  344. package/dist/src/web/utils/tmap.d.ts +3 -0
  345. package/dist/src/web/utils/tmap.js +21 -0
  346. package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +1 -0
  347. package/dist/src/web/utils/use-cloud-id-temp-url.js +15 -0
  348. package/dist/src/web/utils/useSetState.d.ts +1 -0
  349. package/dist/src/web/utils/useSetState.js +8 -0
  350. package/dist/src/web/utils/useSyncValue.d.ts +4 -0
  351. package/dist/src/web/utils/useSyncValue.js +15 -0
  352. package/dist/src/web/utils/weui.d.ts +1 -0
  353. package/dist/src/web/utils/weui.js +2 -0
  354. package/dist/web/components/calendar/index.js +10 -2
  355. package/dist/web/components/carousel/index.js +4 -0
  356. package/dist/web/components/chart/common/core/eChartBase.js +8 -2
  357. package/dist/web/components/form/form/index.js +10 -7
  358. package/dist/web/components/form/location/common/mapChoose.js +2 -0
  359. package/dist/web/components/form/location/common/mapView.js +2 -0
  360. package/dist/web/components/form/location/components/LocationH5/location.h5.js +3 -1
  361. package/dist/web/components/form/location/components/LocationH5/location.module.css +3 -0
  362. package/dist/web/components/form/select/allTimePicker/calendar.css +114 -0
  363. package/dist/web/components/form/select/allTimePicker/index.css +136 -0
  364. package/dist/web/components/form/select/h5.js +4 -0
  365. package/dist/web/components/form/select/index.js +2 -8
  366. package/dist/web/components/form/switch/index.js +3 -2
  367. package/dist/web/components/form/switch/switch.module.css +7 -0
  368. package/dist/web/components/form/uploader/uploader.h5.d.ts +1 -0
  369. package/dist/web/components/form/uploader/uploader.h5.js +14 -10
  370. package/dist/web/components/form/uploader/uploader.pc.js +1 -1
  371. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +14 -12
  372. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +8 -8
  373. package/dist/web/components/form/userOrgSelect/comTool.d.ts +7 -0
  374. package/dist/web/components/form/userOrgSelect/comTool.js +89 -0
  375. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +20 -0
  376. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +259 -0
  377. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
  378. package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +153 -0
  379. package/dist/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
  380. package/dist/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
  381. package/dist/web/components/form/userOrgSelect/index.d.ts +2 -0
  382. package/dist/web/components/form/userOrgSelect/index.js +17 -0
  383. package/dist/web/components/form/userOrgSelect/userOrgSelect.css +805 -0
  384. package/dist/web/components/form/userOrgSelect/userOrgSelect.less +643 -0
  385. package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +24 -0
  386. package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +276 -0
  387. package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
  388. package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +229 -0
  389. package/dist/web/components/form/userOrgSelect/utils.d.ts +35 -0
  390. package/dist/web/components/form/userOrgSelect/utils.js +72 -0
  391. package/dist/web/components/formdetail/index.css +115 -0
  392. package/dist/web/components/formdetail/index.d.ts +28 -0
  393. package/dist/web/components/formdetail/index.js +170 -0
  394. package/dist/web/components/index.d.ts +3 -0
  395. package/dist/web/components/index.js +3 -0
  396. package/dist/web/components/listView/index.css +35 -5
  397. package/dist/web/components/listView/index.js +92 -68
  398. package/dist/web/components/listView/interface.d.ts +5 -0
  399. package/dist/web/components/lottery/index.js +2 -1
  400. package/dist/web/components/lottery/lotteryUtil.js +1 -0
  401. package/dist/web/components/navigationBar/index.css +21 -29
  402. package/dist/web/components/richText/index.css +1 -0
  403. package/dist/web/components/swiper/index.js +5 -1
  404. package/dist/web/components/wedaVideo/index.js +1 -0
  405. package/dist/web/utils/getUserService.d.ts +17 -0
  406. package/dist/web/utils/getUserService.js +148 -0
  407. package/dist/web/utils/platform.js +2 -0
  408. package/dist/web/weda-ui.css +9 -0
  409. package/package.json +27 -13
  410. package/dist/asset-manifest.json +0 -17
  411. package/dist/index.html +0 -88
  412. package/dist/static/js/bundle.js +0 -963
  413. package/dist/static/js/bundle.js.map +0 -1
  414. package/dist/static/js/main.chunk.js +0 -8841
  415. package/dist/static/js/main.chunk.js.map +0 -1
  416. package/dist/static/js/vendors~main.chunk.js +0 -247885
  417. package/dist/static/js/vendors~main.chunk.js.map +0 -1
  418. package/dist/static/media/ef6fa527e24e354765d806b826b41391.fa67580a.svg +0 -627
  419. package/dist/web/components/auth/index.d.ts +0 -10
  420. package/dist/web/components/auth/index.js +0 -37
  421. package/dist/web/utils/events.d.ts +0 -1
  422. package/dist/web/utils/events.js +0 -2
@@ -0,0 +1,50 @@
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";
@@ -0,0 +1,99 @@
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';
@@ -0,0 +1,24 @@
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;
@@ -0,0 +1,71 @@
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
+ }
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,296 @@
1
+ import React, { useState, useEffect, useRef, useCallback } from 'react';
2
+ import { callDataSource } from '../../utils/tcb';
3
+ import { isInIde, getWhereList } from '../../utils/platform';
4
+ import classNames from '../../utils/classnames';
5
+ import isequal from 'lodash.isequal';
6
+ import './index.css';
7
+ import { isNil } from '../../utils/lodash';
8
+ const ORDERTYPE = ['asc', 'desc'];
9
+ const BLOCK_NAME = 'weda-list-view';
10
+ const getIdeMockData = (length = 3) => Array.from({ length }).map(() => Object.create(null));
11
+ /**
12
+ * 数据容器-列表视图
13
+ */
14
+ export default function ListView(props) {
15
+ var _a, _b, _c;
16
+ const { dataSourceType, bindConnectMetadata, connectorMethod, connectorParams, datasource, orderBy, orderType, where, template, pageSize = 5, pagination, events, className, children, isRecords = true, //是否展示回调recoreds字段
17
+ isSetStatus = false, //是否开启加载状态
18
+ appCloud = { callDataSource, isInIde }, beforeDataChange = (v) => v, ...rest } = props;
19
+ const isModel = dataSourceType !== 'custom-connector';
20
+ const methodName = isModel
21
+ ? ((_a = datasource === null || datasource === void 0 ? void 0 : datasource.extra) === null || _a === void 0 ? void 0 : _a.methodName) || 'wedaGetRecords'
22
+ : connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name; // 默认方法名
23
+ const dataSourceName = isModel
24
+ ? datasource === null || datasource === void 0 ? void 0 : datasource.name
25
+ : (_b = bindConnectMetadata === null || bindConnectMetadata === void 0 ? void 0 : bindConnectMetadata.datasource) === null || _b === void 0 ? void 0 : _b.name;
26
+ const [pageNo, setPageNo] = useState(1); // 分页状态
27
+ const [entry, setEntry] = useState(null); // 触底的observer对象
28
+ const [status, setStatus] = useState(''); // 查询状态
29
+ const paramRef = useRef({
30
+ dataSourceName,
31
+ methodName,
32
+ params: { orderBy, orderType, where, pageNo: 1, pageSize, connectorParams },
33
+ pagination,
34
+ }); // 最新请求参数
35
+ const dataRef = useRef({ total: 0, records: [] }); // 最新数据列表
36
+ const observeRef = useRef(null); // 当前监听对象
37
+ 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数据逻辑
38
+ const shouldBottomLoad = pagination === 'bottomLoad' &&
39
+ (entry === null || entry === void 0 ? void 0 : entry.isIntersecting) &&
40
+ ['', 'success'].includes(status); // 能否触底加载
41
+ // 组件卸载时触发
42
+ useEffect(() => {
43
+ return () => {
44
+ var _a, _b;
45
+ (_a = observeRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
46
+ (_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, { data: beforeDataChange([]) });
47
+ };
48
+ }, []);
49
+ // props 基本类型监听,需重新分页;处于 ide 且未绑定数据源时返回mock数据
50
+ useEffect(() => {
51
+ var _a, _b;
52
+ dataRef.current = { total: 0, records: [] };
53
+ if (!isIdeMockData) {
54
+ fetchData({
55
+ dataSourceName,
56
+ methodName,
57
+ params: {
58
+ ...(_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params,
59
+ orderBy,
60
+ orderType,
61
+ pageNo: 1,
62
+ pageSize,
63
+ },
64
+ pagination,
65
+ });
66
+ }
67
+ else {
68
+ (_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, {
69
+ data: beforeDataChange(getIdeMockData(pageSize)),
70
+ });
71
+ }
72
+ }, [
73
+ methodName,
74
+ dataSourceName,
75
+ pageSize,
76
+ pagination,
77
+ orderBy,
78
+ orderType,
79
+ isModel,
80
+ ]);
81
+ // props 对象类型监听,需重新分页
82
+ useEffect(() => {
83
+ var _a, _b, _c, _d;
84
+ if (isModel) {
85
+ if (!isequal((_b = (_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.where, where)) {
86
+ dataRef.current = { total: 0, records: [] };
87
+ fetchData({
88
+ params: { pageNo: 1, where },
89
+ });
90
+ }
91
+ }
92
+ else {
93
+ if (!isequal((_d = (_c = paramRef.current) === null || _c === void 0 ? void 0 : _c.params) === null || _d === void 0 ? void 0 : _d.connectorParams, connectorParams)) {
94
+ dataRef.current = { total: 0, records: [] };
95
+ fetchData({
96
+ params: { pageNo: 1, connectorParams },
97
+ });
98
+ }
99
+ }
100
+ });
101
+ // 监听触底加载事件
102
+ useEffect(() => {
103
+ var _a, _b;
104
+ if (shouldBottomLoad && hasNextPage()) {
105
+ fetchData({
106
+ params: { pageNo: (((_b = (_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.pageNo) || 1) + 1 },
107
+ });
108
+ }
109
+ }, [shouldBottomLoad]);
110
+ // 触底监控对象
111
+ const nodeRefCallback = useCallback((node) => {
112
+ var _a;
113
+ if (node) {
114
+ (_a = observeRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
115
+ observeRef.current = new IntersectionObserver((entries) => {
116
+ setEntry(entries === null || entries === void 0 ? void 0 : entries[0]);
117
+ });
118
+ observeRef.current.observe(node);
119
+ }
120
+ }, []);
121
+ // 能否点击下一页
122
+ const hasNextPage = () => {
123
+ var _a;
124
+ const { pageNo = 1, pageSize = 5 } = ((_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) || {};
125
+ const { total = 0 } = dataRef.current || {};
126
+ return pageNo * pageSize < total;
127
+ };
128
+ /**
129
+ * 列表视图拉取数据
130
+ * 方法仅依赖入参和paramRef的参数
131
+ */
132
+ const fetchData = async (param) => {
133
+ var _a;
134
+ // 合并参数
135
+ const fetchParam = {
136
+ ...paramRef.current,
137
+ ...param,
138
+ params: { ...paramRef.current.params, ...param === null || param === void 0 ? void 0 : param.params },
139
+ };
140
+ const { dataSourceName, methodName, params } = fetchParam;
141
+ const { orderBy, orderType, pageNo, pageSize, where, connectorParams } = params || {};
142
+ if (status === 'loading' || !(dataSourceName && methodName))
143
+ return;
144
+ setStatus('loading');
145
+ let tcbParams = {};
146
+ // tcb分页参数
147
+ if (!isNil(pageNo) && !isNil(pageSize)) {
148
+ tcbParams['pageNo'] = pageNo;
149
+ tcbParams['pageSize'] = pageSize;
150
+ }
151
+ if (isModel) {
152
+ // tcb排序参数
153
+ if (orderBy && ORDERTYPE.includes(orderType)) {
154
+ tcbParams['orderBy'] = orderBy;
155
+ tcbParams['orderType'] = orderType;
156
+ }
157
+ // tcb过滤参数
158
+ const whereEffected = [].concat(getWhereList(where));
159
+ whereEffected.length > 0 && (tcbParams['where'] = whereEffected);
160
+ }
161
+ else {
162
+ tcbParams = Object.assign({}, tcbParams, connectorParams);
163
+ }
164
+ // tcb结果和事件
165
+ let data = [];
166
+ const eventDatasource = isModel
167
+ ? datasource
168
+ : { ...bindConnectMetadata, ...connectorMethod };
169
+ try {
170
+ data = await (appCloud === null || appCloud === void 0 ? void 0 : appCloud.callDataSource({
171
+ dataSourceName,
172
+ methodName,
173
+ params: tcbParams,
174
+ }, true));
175
+ paramRef.current = fetchParam;
176
+ onEnvets(data, eventDatasource);
177
+ }
178
+ catch (e) {
179
+ setStatus(isModel ? 'fail' : '');
180
+ (_a = events === null || events === void 0 ? void 0 : events.queryFail) === null || _a === void 0 ? void 0 : _a.call(events, { datasource: eventDatasource, data: null });
181
+ }
182
+ };
183
+ /**
184
+ * 根据fetchData方法返回值,回调给外部事件
185
+ */
186
+ const onEnvets = (data, datasource) => {
187
+ var _a, _b, _c, _d, _e;
188
+ const bottomLoadTimer = 150;
189
+ const fetchRecords = [].concat(!isRecords && !isModel ? data : (data === null || data === void 0 ? void 0 : data.records) || []);
190
+ const total = (_a = data === null || data === void 0 ? void 0 : data.total) !== null && _a !== void 0 ? _a : fetchRecords.length;
191
+ if (['loadMoreButton', 'bottomLoad'].includes(paramRef.current.pagination)) {
192
+ dataRef.current = {
193
+ total,
194
+ records: [...dataRef.current.records, ...fetchRecords],
195
+ };
196
+ }
197
+ else {
198
+ dataRef.current = { total, records: fetchRecords };
199
+ }
200
+ (_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, {
201
+ data: beforeDataChange(dataRef.current.records || []),
202
+ });
203
+ if (total === 0) {
204
+ setStatus(isModel ? 'empty' : '');
205
+ (_c = events === null || events === void 0 ? void 0 : events.queryEmpty) === null || _c === void 0 ? void 0 : _c.call(events, {
206
+ datasource,
207
+ data: beforeDataChange([]),
208
+ });
209
+ }
210
+ else {
211
+ const statusCb = () => setStatus('success');
212
+ pagination === 'bottomLoad'
213
+ ? window.setTimeout(statusCb, bottomLoadTimer)
214
+ : statusCb();
215
+ }
216
+ const successCb = () => {
217
+ var _a;
218
+ (_a = events === null || events === void 0 ? void 0 : events.querySuccess) === null || _a === void 0 ? void 0 : _a.call(events, {
219
+ datasource,
220
+ data: beforeDataChange(dataRef.current.records),
221
+ });
222
+ };
223
+ pagination === 'bottomLoad'
224
+ ? window.setTimeout(successCb, bottomLoadTimer + 50)
225
+ : successCb();
226
+ setPageNo(((_e = (_d = paramRef.current) === null || _d === void 0 ? void 0 : _d.params) === null || _e === void 0 ? void 0 : _e.pageNo) || 1);
227
+ };
228
+ /**
229
+ * 分页,加载更多
230
+ */
231
+ const renderLoadMore = () => {
232
+ let disabled = !hasNextPage();
233
+ if (isIdeMockData) {
234
+ disabled = false;
235
+ }
236
+ if (status === 'loading')
237
+ return LoadingSymbol;
238
+ return (!disabled && (React.createElement("div", { className: `${BLOCK_NAME}__more-text`, onClick: () => fetchData({ params: { pageNo: pageNo + 1 } }) }, "\u52A0\u8F7D\u66F4\u591A")));
239
+ };
240
+ /**
241
+ * 分页,底部刷新
242
+ */
243
+ const renderBottomLoad = () => {
244
+ return (React.createElement("div", { ref: nodeRefCallback, className: `${BLOCK_NAME}__bottom-load` }, status === 'loading' ? LoadingSymbol : !hasNextPage() && LoadEnd));
245
+ };
246
+ /**
247
+ * 分页,分页器,含ideMockData的判断
248
+ */
249
+ const renderPagination = () => {
250
+ var _a, _b;
251
+ const preDisabeld = pageNo <= 1;
252
+ const nextDisabeld = !hasNextPage();
253
+ const total = (_b = (_a = dataRef.current) === null || _a === void 0 ? void 0 : _a.total) !== null && _b !== void 0 ? _b : 0;
254
+ return (React.createElement("div", { className: `${BLOCK_NAME}__more-pagination` },
255
+ React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-pre`, preDisabeld ? '' : 'active'), onClick: () => !preDisabeld && fetchData({ params: { pageNo: pageNo - 1 } }) }, "\u4E0A\u4E00\u9875"),
256
+ React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-text`) },
257
+ React.createElement("span", { className: "active" }, isIdeMockData ? 1 : total ? pageNo : 0),
258
+ "/",
259
+ isIdeMockData ? 1 : Math.ceil(total / pageSize)),
260
+ React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-next`, nextDisabeld ? '' : 'active'), onClick: () => !nextDisabeld && fetchData({ params: { pageNo: pageNo + 1 } }) }, "\u4E0B\u4E00\u9875")));
261
+ };
262
+ /**
263
+ * 查询状态展示
264
+ */
265
+ const renderStatus = () => {
266
+ switch (status) {
267
+ case 'empty':
268
+ return React.createElement("div", { className: `${BLOCK_NAME}__empty` }, "\u6682\u65E0\u6570\u636E");
269
+ case 'fail':
270
+ return React.createElement("div", { className: `${BLOCK_NAME}__fail` }, "\u52A0\u8F7D\u5931\u8D25");
271
+ case 'loading':
272
+ return (pagination === 'pagination' && (React.createElement("div", { className: classNames(`${BLOCK_NAME}__more`, `${BLOCK_NAME}__content-loading`) }, LoadingSymbol)));
273
+ }
274
+ };
275
+ /**
276
+ * 加载中状态组件
277
+ */
278
+ const LoadingSymbol = (React.createElement("div", { className: `${BLOCK_NAME}__more-symbol` },
279
+ React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` }),
280
+ React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` }),
281
+ React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` })));
282
+ /**
283
+ * 加载到底状态组件
284
+ */
285
+ const LoadEnd = React.createElement("div", null);
286
+ return (React.createElement("div", { ...rest, className: classNames('weda-ui', `${BLOCK_NAME}__containor`, className) },
287
+ children && (React.createElement("div", { className: classNames(template === 'cardList' ? `${BLOCK_NAME}-card` : '', `${BLOCK_NAME}__content`, ['empty', 'fail'].includes(status) && isSetStatus
288
+ ? `${BLOCK_NAME}__content-blank`
289
+ : '') },
290
+ children,
291
+ isSetStatus && renderStatus())),
292
+ React.createElement("div", { className: classNames(`${BLOCK_NAME}__more`, `${BLOCK_NAME}__more-${pagination}`) },
293
+ pagination === 'bottomLoad' && renderBottomLoad(),
294
+ pagination === 'loadMoreButton' && renderLoadMore(),
295
+ pagination === 'pagination' && renderPagination())));
296
+ }
@@ -0,0 +1,127 @@
1
+ import React from 'react';
2
+ /**
3
+ * 数据容器公共属性
4
+ */
5
+ export interface IDataContainer {
6
+ /**
7
+ * 数据源类型
8
+ */
9
+ dataSourceType: 'data-model' | 'connector' | 'custom-connector';
10
+ /**
11
+ * 连接器
12
+ */
13
+ bindConnectMetadata?: {
14
+ datasource: {
15
+ name?: string;
16
+ };
17
+ };
18
+ /**
19
+ * 连接器方法
20
+ */
21
+ connectorMethod?: {
22
+ name?: string;
23
+ inParams?: string[];
24
+ outParams?: string[];
25
+ title?: string;
26
+ };
27
+ /**
28
+ * 数据模型
29
+ */
30
+ datasource?: {
31
+ name?: string;
32
+ extra?: {
33
+ viewId?: string;
34
+ methodName?: string;
35
+ };
36
+ };
37
+ /**
38
+ * 连接器查询入参
39
+ */
40
+ connectorParams?: object;
41
+ /**
42
+ * 数据筛选
43
+ */
44
+ where?: {
45
+ groupLogic?: null | 'or' | 'and';
46
+ logicData?: {
47
+ keyType?: 'field' | 'var-font';
48
+ key: string;
49
+ rel: 'eq' | 'neq' | 'lt' | 'gt' | 'gte' | 'lte' | 'in' | 'nin' | 'search';
50
+ value: any;
51
+ valueType?: 'const' | 'var-font' | 'relative-amount' | 'field';
52
+ expression?: string | boolean;
53
+ logic?: null | 'or' | 'and' | string;
54
+ extra?: {
55
+ type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | string;
56
+ format?: string | null;
57
+ isExpression?: boolean;
58
+ };
59
+ }[];
60
+ }[];
61
+ /**
62
+ * 容器事件
63
+ */
64
+ events?: {
65
+ queryEmpty?: any;
66
+ querySuccess?: any;
67
+ queryFail?: any;
68
+ onDataChange?: (param: any) => any;
69
+ };
70
+ /**
71
+ * 类
72
+ */
73
+ className?: string;
74
+ /**
75
+ * app.cloud 对象依赖,默认会从 window.app 取值
76
+ */
77
+ appCloud?: {
78
+ callDataSource?: any;
79
+ isInIde?: any;
80
+ };
81
+ /**
82
+ * 子元素
83
+ */
84
+ children?: React.ReactNode | undefined;
85
+ /**
86
+ * 其他属性
87
+ */
88
+ [key: string]: any;
89
+ }
90
+ /**
91
+ * 数据容器-列表视图
92
+ */
93
+ export interface IListView extends IDataContainer {
94
+ /**
95
+ * 数据字段
96
+ */
97
+ orderBy?: string;
98
+ /**
99
+ * 数据类型
100
+ */
101
+ orderType?: 'desc' | 'asc';
102
+ /**
103
+ * 模板
104
+ */
105
+ template?: 'simpleList' | 'detailList' | 'imageTextList' | 'cardList' | 'none';
106
+ /**
107
+ * 显示行数
108
+ */
109
+ pageSize?: number;
110
+ /**
111
+ * 分页类型,加载更多|底部刷新|分页器
112
+ */
113
+ pagination?: 'loadMoreButton' | 'bottomLoad' | 'pagination' | 'none';
114
+ /**
115
+ * 调用 onDataChange 之前的数据转换,如列表视图需要接受 array,而数据视图需要接受 object
116
+ */
117
+ beforeDataChange?: (param: any) => any;
118
+ /**
119
+ * 是否展示回调recoreds字段
120
+ */
121
+ isRecords?: boolean;
122
+ }
123
+ /**
124
+ * 查询状态
125
+ * 成功|失败|空|加载中|初始化
126
+ */
127
+ export declare type IStatus = 'success' | 'fail' | 'empty' | 'loading' | '';