@cloudbase/weda-ui 3.1.0 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/dist/asset-manifest.json +17 -0
  2. package/dist/configs/actions/showModal.json +48 -0
  3. package/dist/configs/actions/showToast.json +41 -0
  4. package/dist/configs/components/auth.json +16 -0
  5. package/dist/configs/components/button.json +239 -0
  6. package/dist/configs/components/calendar.json +81 -0
  7. package/dist/configs/components/carousel.json +292 -0
  8. package/dist/configs/components/chart/bar.json +721 -0
  9. package/dist/configs/components/chart/line.json +674 -0
  10. package/dist/configs/components/chart/pie.json +494 -0
  11. package/dist/configs/components/chart/statisticsCard.json +376 -0
  12. package/dist/configs/components/container.json +50 -0
  13. package/dist/configs/components/dataView.json +239 -0
  14. package/dist/configs/components/drawer.json +115 -0
  15. package/dist/configs/components/form/checkbox.json +178 -0
  16. package/dist/configs/components/form/form.json +45 -0
  17. package/dist/configs/components/form/input.json +154 -0
  18. package/dist/configs/components/form/location.json +216 -0
  19. package/dist/configs/components/form/radio.json +203 -0
  20. package/dist/configs/components/form/richText.json +125 -0
  21. package/dist/configs/components/form/select.json +430 -0
  22. package/dist/configs/components/form/switch.json +58 -0
  23. package/dist/configs/components/form/textarea.json +116 -0
  24. package/dist/configs/components/form/tips.json +34 -0
  25. package/dist/configs/components/form/uploader.json +171 -0
  26. package/dist/configs/components/form/uploaderFile.json +158 -0
  27. package/dist/configs/components/graphicCard.json +413 -0
  28. package/dist/configs/components/image.json +187 -0
  29. package/dist/configs/components/link.json +79 -0
  30. package/dist/configs/components/listView.json +370 -0
  31. package/dist/configs/components/lottery.json +163 -0
  32. package/dist/configs/components/modal.json +72 -0
  33. package/dist/configs/components/navLayout.json +368 -0
  34. package/dist/configs/components/navigationBar.json +62 -0
  35. package/dist/configs/components/richtextview.json +26 -0
  36. package/dist/configs/components/scrollVeiw.json +253 -0
  37. package/dist/configs/components/slot.json +17 -0
  38. package/dist/configs/components/swiper.json +90 -0
  39. package/dist/configs/components/tabs.json +121 -0
  40. package/dist/configs/components/text.json +95 -0
  41. package/dist/configs/components/wedaVideo.json +89 -0
  42. package/dist/configs/components/wxOpenApi/phone.json +127 -0
  43. package/dist/configs/components/wxOpenApi/phoneCode.json +109 -0
  44. package/dist/configs/components/wxOpenApi/share.json +157 -0
  45. package/dist/configs/components/wxOpenApi/userInfo.json +156 -0
  46. package/dist/configs/index.d.ts +97 -0
  47. package/dist/configs/index.js +105 -0
  48. package/dist/docs/common/format.d.ts +13 -0
  49. package/dist/docs/common/format.js +103 -0
  50. package/dist/docs/common/tableView.d.ts +30 -0
  51. package/dist/docs/common/tableView.js +159 -0
  52. package/dist/index.d.ts +2 -0
  53. package/dist/index.html +88 -0
  54. package/dist/index.js +3 -0
  55. package/dist/setupTests.d.ts +1 -0
  56. package/dist/setupTests.js +14 -0
  57. package/dist/static/js/bundle.js +963 -0
  58. package/dist/static/js/bundle.js.map +1 -0
  59. package/dist/static/js/main.chunk.js +8841 -0
  60. package/dist/static/js/main.chunk.js.map +1 -0
  61. package/dist/static/js/vendors~main.chunk.js +247885 -0
  62. package/dist/static/js/vendors~main.chunk.js.map +1 -0
  63. package/dist/static/media/ef6fa527e24e354765d806b826b41391.fa67580a.svg +627 -0
  64. package/dist/web/actions/index.d.ts +2 -0
  65. package/dist/web/actions/index.js +2 -0
  66. package/dist/web/actions/showModal/index.d.ts +3 -0
  67. package/dist/web/actions/showModal/index.js +66 -0
  68. package/dist/web/actions/showToast/index.d.ts +1 -0
  69. package/dist/web/actions/showToast/index.js +3 -0
  70. package/dist/web/components/auth/index.d.ts +10 -0
  71. package/dist/web/components/auth/index.js +37 -0
  72. package/dist/web/components/button/index.css +27 -0
  73. package/dist/web/components/button/index.d.ts +32 -0
  74. package/dist/web/components/button/index.js +48 -0
  75. package/dist/web/components/calendar/index.css +416 -0
  76. package/dist/web/components/calendar/index.d.ts +19 -0
  77. package/dist/web/components/calendar/index.js +181 -0
  78. package/dist/web/components/calendar/util.d.ts +13 -0
  79. package/dist/web/components/calendar/util.js +74 -0
  80. package/dist/web/components/carousel/index.css +119 -0
  81. package/dist/web/components/carousel/index.d.ts +41 -0
  82. package/dist/web/components/carousel/index.js +240 -0
  83. package/dist/web/components/chart/bar/index.d.ts +41 -0
  84. package/dist/web/components/chart/bar/index.js +56 -0
  85. package/dist/web/components/chart/common/config/bar.d.ts +48 -0
  86. package/dist/web/components/chart/common/config/bar.js +49 -0
  87. package/dist/web/components/chart/common/config/global.d.ts +13 -0
  88. package/dist/web/components/chart/common/config/global.js +16 -0
  89. package/dist/web/components/chart/common/config/line.d.ts +46 -0
  90. package/dist/web/components/chart/common/config/line.js +49 -0
  91. package/dist/web/components/chart/common/config/pie.d.ts +29 -0
  92. package/dist/web/components/chart/common/config/pie.js +36 -0
  93. package/dist/web/components/chart/common/core/eChartBar.d.ts +68 -0
  94. package/dist/web/components/chart/common/core/eChartBar.js +196 -0
  95. package/dist/web/components/chart/common/core/eChartBase.d.ts +128 -0
  96. package/dist/web/components/chart/common/core/eChartBase.js +346 -0
  97. package/dist/web/components/chart/common/core/eChartLine.d.ts +62 -0
  98. package/dist/web/components/chart/common/core/eChartLine.js +168 -0
  99. package/dist/web/components/chart/common/core/eChartPie.d.ts +50 -0
  100. package/dist/web/components/chart/common/core/eChartPie.js +132 -0
  101. package/dist/web/components/chart/common/core/type.d.ts +35 -0
  102. package/dist/web/components/chart/common/core/type.js +9 -0
  103. package/dist/web/components/chart/common/echarts.d.ts +2 -0
  104. package/dist/web/components/chart/common/echarts.js +24 -0
  105. package/dist/web/components/chart/common/useChart.d.ts +8 -0
  106. package/dist/web/components/chart/common/useChart.js +60 -0
  107. package/dist/web/components/chart/line/index.d.ts +39 -0
  108. package/dist/web/components/chart/line/index.js +53 -0
  109. package/dist/web/components/chart/pie/index.d.ts +27 -0
  110. package/dist/web/components/chart/pie/index.js +40 -0
  111. package/dist/web/components/chart/statisticsCard/index.css +63 -0
  112. package/dist/web/components/chart/statisticsCard/index.d.ts +85 -0
  113. package/dist/web/components/chart/statisticsCard/index.js +203 -0
  114. package/dist/web/components/chart/statisticsCard/interface.d.ts +13 -0
  115. package/dist/web/components/chart/statisticsCard/interface.js +1 -0
  116. package/dist/web/components/container/index.d.ts +6 -0
  117. package/dist/web/components/container/index.js +6 -0
  118. package/dist/web/components/dataView/index.d.ts +6 -0
  119. package/dist/web/components/dataView/index.js +8 -0
  120. package/dist/web/components/dataView/interface.d.ts +5 -0
  121. package/dist/web/components/dataView/interface.js +1 -0
  122. package/dist/web/components/drawer/index.d.ts +13 -0
  123. package/dist/web/components/drawer/index.js +12 -0
  124. package/dist/web/components/form/checkbox/index.d.ts +13 -0
  125. package/dist/web/components/form/checkbox/index.js +167 -0
  126. package/dist/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
  127. package/dist/web/components/form/enumSelect/MultipleSelect.js +52 -0
  128. package/dist/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
  129. package/dist/web/components/form/enumSelect/NormalSelect.js +52 -0
  130. package/dist/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
  131. package/dist/web/components/form/enumSelect/SelectContainer.js +30 -0
  132. package/dist/web/components/form/enumSelect/index.d.ts +82 -0
  133. package/dist/web/components/form/enumSelect/index.js +6 -0
  134. package/dist/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
  135. package/dist/web/components/form/enumSelect/props/defaultProps.js +40 -0
  136. package/dist/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
  137. package/dist/web/components/form/enumSelect/props/propsTypes.js +47 -0
  138. package/dist/web/components/form/form/index.css +9 -0
  139. package/dist/web/components/form/form/index.d.ts +13 -0
  140. package/dist/web/components/form/form/index.js +31 -0
  141. package/dist/web/components/form/formcell/index.css +85 -0
  142. package/dist/web/components/form/formcell/index.d.ts +8 -0
  143. package/dist/web/components/form/formcell/index.js +40 -0
  144. package/dist/web/components/form/input/index.css +40 -0
  145. package/dist/web/components/form/input/index.d.ts +14 -0
  146. package/dist/web/components/form/input/index.js +86 -0
  147. package/dist/web/components/form/location/common/mapChoose.css +477 -0
  148. package/dist/web/components/form/location/common/mapChoose.d.ts +15 -0
  149. package/dist/web/components/form/location/common/mapChoose.js +435 -0
  150. package/dist/web/components/form/location/common/mapView.d.ts +19 -0
  151. package/dist/web/components/form/location/common/mapView.js +170 -0
  152. package/dist/web/components/form/location/common/propsConfig.d.ts +59 -0
  153. package/dist/web/components/form/location/common/propsConfig.js +50 -0
  154. package/dist/web/components/form/location/common/selectModal.css +45 -0
  155. package/dist/web/components/form/location/common/selectModal.d.ts +21 -0
  156. package/dist/web/components/form/location/common/selectModal.js +44 -0
  157. package/dist/web/components/form/location/common/useLocationInfo.d.ts +36 -0
  158. package/dist/web/components/form/location/common/useLocationInfo.js +104 -0
  159. package/dist/web/components/form/location/components/LocationH5/index.css +100 -0
  160. package/dist/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
  161. package/dist/web/components/form/location/components/LocationH5/location.h5.js +323 -0
  162. package/dist/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
  163. package/dist/web/components/form/location/components/LocationPC/Header.js +43 -0
  164. package/dist/web/components/form/location/components/LocationPC/index.css +40 -0
  165. package/dist/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
  166. package/dist/web/components/form/location/components/LocationPC/location.PC.js +224 -0
  167. package/dist/web/components/form/location/constants.d.ts +2 -0
  168. package/dist/web/components/form/location/constants.js +3 -0
  169. package/dist/web/components/form/location/index.css +13 -0
  170. package/dist/web/components/form/location/index.d.ts +1 -0
  171. package/dist/web/components/form/location/index.js +17 -0
  172. package/dist/web/components/form/radio/index.css +12 -0
  173. package/dist/web/components/form/radio/index.d.ts +11 -0
  174. package/dist/web/components/form/radio/index.js +115 -0
  175. package/dist/web/components/form/renderDecorator.d.ts +6 -0
  176. package/dist/web/components/form/renderDecorator.js +20 -0
  177. package/dist/web/components/form/select/h5.d.ts +16 -0
  178. package/dist/web/components/form/select/h5.js +504 -0
  179. package/dist/web/components/form/select/index.css +27 -0
  180. package/dist/web/components/form/select/index.d.ts +65 -0
  181. package/dist/web/components/form/select/index.js +301 -0
  182. package/dist/web/components/form/select/region/index.d.ts +6 -0
  183. package/dist/web/components/form/select/region/index.js +147 -0
  184. package/dist/web/components/form/select/time.d.ts +9 -0
  185. package/dist/web/components/form/select/time.js +146 -0
  186. package/dist/web/components/form/select/year.d.ts +7 -0
  187. package/dist/web/components/form/select/year.js +72 -0
  188. package/dist/web/components/form/switch/index.d.ts +6 -0
  189. package/dist/web/components/form/switch/index.js +57 -0
  190. package/dist/web/components/form/textarea/index.css +11 -0
  191. package/dist/web/components/form/textarea/index.d.ts +12 -0
  192. package/dist/web/components/form/textarea/index.js +66 -0
  193. package/dist/web/components/form/tips/index.css +4 -0
  194. package/dist/web/components/form/tips/index.d.ts +8 -0
  195. package/dist/web/components/form/tips/index.js +17 -0
  196. package/dist/web/components/form/uploader/index.css +118 -0
  197. package/dist/web/components/form/uploader/index.d.ts +3 -0
  198. package/dist/web/components/form/uploader/index.js +42 -0
  199. package/dist/web/components/form/uploader/uploader.h5.d.ts +19 -0
  200. package/dist/web/components/form/uploader/uploader.h5.js +201 -0
  201. package/dist/web/components/form/uploader/uploader.pc.d.ts +29 -0
  202. package/dist/web/components/form/uploader/uploader.pc.js +182 -0
  203. package/dist/web/components/form/uploaderFile/index.css +422 -0
  204. package/dist/web/components/form/uploaderFile/index.d.ts +4 -0
  205. package/dist/web/components/form/uploaderFile/index.js +19 -0
  206. package/dist/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
  207. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +315 -0
  208. package/dist/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
  209. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +290 -0
  210. package/dist/web/components/graphicCard/index.css +159 -0
  211. package/dist/web/components/graphicCard/index.d.ts +31 -0
  212. package/dist/web/components/graphicCard/index.js +166 -0
  213. package/dist/web/components/image/image.d.ts +9 -0
  214. package/dist/web/components/image/image.js +119 -0
  215. package/dist/web/components/image/index.css +54 -0
  216. package/dist/web/components/image/index.d.ts +13 -0
  217. package/dist/web/components/image/index.js +91 -0
  218. package/dist/web/components/index.d.ts +47 -0
  219. package/dist/web/components/index.js +94 -0
  220. package/dist/web/components/link/index.css +8 -0
  221. package/dist/web/components/link/index.d.ts +24 -0
  222. package/dist/web/components/link/index.js +71 -0
  223. package/dist/web/components/listView/index.css +143 -0
  224. package/dist/web/components/listView/index.d.ts +7 -0
  225. package/dist/web/components/listView/index.js +262 -0
  226. package/dist/web/components/listView/interface.d.ts +122 -0
  227. package/dist/web/components/listView/interface.js +1 -0
  228. package/dist/web/components/lottery/index.css +359 -0
  229. package/dist/web/components/lottery/index.d.ts +22 -0
  230. package/dist/web/components/lottery/index.js +390 -0
  231. package/dist/web/components/lottery/lotteryUtil.d.ts +23 -0
  232. package/dist/web/components/lottery/lotteryUtil.js +180 -0
  233. package/dist/web/components/modal/h5.css +53 -0
  234. package/dist/web/components/modal/index.d.ts +17 -0
  235. package/dist/web/components/modal/index.js +11 -0
  236. package/dist/web/components/modal/modal.h5.d.ts +4 -0
  237. package/dist/web/components/modal/modal.h5.js +46 -0
  238. package/dist/web/components/modal/modal.pc.d.ts +3 -0
  239. package/dist/web/components/modal/modal.pc.js +31 -0
  240. package/dist/web/components/navLayout/index.css +332 -0
  241. package/dist/web/components/navLayout/index.d.ts +46 -0
  242. package/dist/web/components/navLayout/index.js +116 -0
  243. package/dist/web/components/navigationBar/common.d.ts +15 -0
  244. package/dist/web/components/navigationBar/common.js +127 -0
  245. package/dist/web/components/navigationBar/h5Menu.d.ts +14 -0
  246. package/dist/web/components/navigationBar/h5Menu.js +72 -0
  247. package/dist/web/components/navigationBar/horizontalMenu.d.ts +12 -0
  248. package/dist/web/components/navigationBar/horizontalMenu.js +99 -0
  249. package/dist/web/components/navigationBar/index.css +762 -0
  250. package/dist/web/components/navigationBar/index.d.ts +13 -0
  251. package/dist/web/components/navigationBar/index.js +157 -0
  252. package/dist/web/components/navigationBar/verticalMenu.d.ts +13 -0
  253. package/dist/web/components/navigationBar/verticalMenu.js +38 -0
  254. package/dist/web/components/phone/index.d.ts +18 -0
  255. package/dist/web/components/phone/index.js +4 -0
  256. package/dist/web/components/phoneCode/index.d.ts +18 -0
  257. package/dist/web/components/phoneCode/index.js +4 -0
  258. package/dist/web/components/picker/datePicker.d.ts +10 -0
  259. package/dist/web/components/picker/datePicker.js +31 -0
  260. package/dist/web/components/picker/picker.d.ts +6 -0
  261. package/dist/web/components/picker/picker.js +45 -0
  262. package/dist/web/components/picker/timePicker.d.ts +7 -0
  263. package/dist/web/components/picker/timePicker.js +42 -0
  264. package/dist/web/components/richText/const.d.ts +1 -0
  265. package/dist/web/components/richText/const.js +2 -0
  266. package/dist/web/components/richText/index.css +93 -0
  267. package/dist/web/components/richText/index.d.ts +51 -0
  268. package/dist/web/components/richText/index.js +298 -0
  269. package/dist/web/components/richTextView/index.css +63 -0
  270. package/dist/web/components/richTextView/index.d.ts +7 -0
  271. package/dist/web/components/richTextView/index.js +44 -0
  272. package/dist/web/components/scrollView/index.d.ts +27 -0
  273. package/dist/web/components/scrollView/index.js +95 -0
  274. package/dist/web/components/share/index.d.ts +34 -0
  275. package/dist/web/components/share/index.js +4 -0
  276. package/dist/web/components/slot/index.d.ts +6 -0
  277. package/dist/web/components/slot/index.js +9 -0
  278. package/dist/web/components/swiper/index.css +106 -0
  279. package/dist/web/components/swiper/index.d.ts +24 -0
  280. package/dist/web/components/swiper/index.js +149 -0
  281. package/dist/web/components/tabs/index.css +64 -0
  282. package/dist/web/components/tabs/index.d.ts +13 -0
  283. package/dist/web/components/tabs/index.js +15 -0
  284. package/dist/web/components/tabs/tabs.h5.d.ts +4 -0
  285. package/dist/web/components/tabs/tabs.h5.js +42 -0
  286. package/dist/web/components/tabs/tabs.pc.d.ts +3 -0
  287. package/dist/web/components/tabs/tabs.pc.js +40 -0
  288. package/dist/web/components/text/index.css +26 -0
  289. package/dist/web/components/text/index.d.ts +14 -0
  290. package/dist/web/components/text/index.js +17 -0
  291. package/dist/web/components/uploaderFileView/index.css +11 -0
  292. package/dist/web/components/uploaderFileView/index.d.ts +10 -0
  293. package/dist/web/components/uploaderFileView/index.js +61 -0
  294. package/dist/web/components/uploaderView/index.css +31 -0
  295. package/dist/web/components/uploaderView/index.d.ts +17 -0
  296. package/dist/web/components/uploaderView/index.js +48 -0
  297. package/dist/web/components/userInfo/index.d.ts +26 -0
  298. package/dist/web/components/userInfo/index.js +4 -0
  299. package/dist/web/components/wedaVideo/index.css +42 -0
  300. package/dist/web/components/wedaVideo/index.d.ts +17 -0
  301. package/dist/web/components/wedaVideo/index.js +159 -0
  302. package/dist/web/index.d.ts +8 -0
  303. package/dist/web/index.js +4 -0
  304. package/dist/web/utils/classnames.d.ts +2 -0
  305. package/dist/web/utils/classnames.js +37 -0
  306. package/dist/web/utils/constant.d.ts +23 -0
  307. package/dist/web/utils/constant.js +24 -0
  308. package/dist/web/utils/debounce.d.ts +2 -0
  309. package/dist/web/utils/debounce.js +92 -0
  310. package/dist/web/utils/events.d.ts +1 -0
  311. package/dist/web/utils/events.js +2 -0
  312. package/dist/web/utils/getLocalCounter.d.ts +1 -0
  313. package/dist/web/utils/getLocalCounter.js +4 -0
  314. package/dist/web/utils/isObjectEqual.d.ts +2 -0
  315. package/dist/web/utils/isObjectEqual.js +12 -0
  316. package/dist/web/utils/loading-fallback.d.ts +2 -0
  317. package/dist/web/utils/loading-fallback.js +2 -0
  318. package/dist/web/utils/lodash.d.ts +1 -0
  319. package/dist/web/utils/lodash.js +2 -0
  320. package/dist/web/utils/platform.d.ts +18 -0
  321. package/dist/web/utils/platform.js +191 -0
  322. package/dist/web/utils/tcb.d.ts +23 -0
  323. package/dist/web/utils/tcb.js +82 -0
  324. package/dist/web/utils/tmap.d.ts +3 -0
  325. package/dist/web/utils/tmap.js +21 -0
  326. package/dist/web/utils/useSetState.d.ts +1 -0
  327. package/dist/web/utils/useSetState.js +8 -0
  328. package/dist/web/utils/useSyncValue.d.ts +4 -0
  329. package/dist/web/utils/useSyncValue.js +15 -0
  330. package/dist/web/utils/weui.d.ts +1 -0
  331. package/dist/web/utils/weui.js +2 -0
  332. package/dist/web/weda-ui.css +90 -0
  333. package/package.json +12 -12
@@ -0,0 +1,47 @@
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";
@@ -0,0 +1,94 @@
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'), { fallback });
84
+ export const Pie = loadable(() => import('./chart/pie'), { fallback });
85
+ export { default as DataView } from './dataView';
86
+ export { default as StatisticsCard } from './chart/statisticsCard';
87
+ export { default as GraphicCard } from './graphicCard';
88
+ export { default as UserInfo } from './userInfo';
89
+ export { default as Phone } from './phone';
90
+ export { default as PhoneCode } from './phoneCode';
91
+ export { default as Share } from './share';
92
+ export { default as Lottery } from './lottery';
93
+ import 'weui/dist/style/weui.css';
94
+ import '../weda-ui.css';
@@ -0,0 +1,8 @@
1
+ .weda-link {
2
+ text-align: center;
3
+ display: inline-block;
4
+ vertical-align: middle;
5
+ }
6
+
7
+ .weda-link-slot {
8
+ }
@@ -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,143 @@
1
+ .weda-list-view__containor {
2
+ overflow-y: auto;
3
+ max-height: 100%;
4
+ overflow-x: hidden;
5
+ }
6
+
7
+ .weda-list-view-card {
8
+ display: flex;
9
+ flex-wrap: wrap;
10
+ margin-right: 0.21429rem;
11
+ }
12
+
13
+ /* 加载更多 */
14
+ .weda-list-view__containor .weda-list-view__more {
15
+ width: 100%;
16
+ }
17
+
18
+ .weda-list-view__containor .weda-list-view__more .weda-list-view__bottom-load {
19
+ padding-top: 0.07143rem;
20
+ }
21
+
22
+ .weda-list-view__containor .weda-list-view__more .weda-list-view__more-text {
23
+ padding-top: 0.71429rem;
24
+ padding-bottom: 1rem;
25
+ font-size: 0.85714em;
26
+ line-height: 0.85714em;
27
+ color: rgba(0, 0, 0, 0.4);
28
+ text-align: center;
29
+ box-sizing: border-box;
30
+ cursor: pointer;
31
+ }
32
+
33
+ /* 加载更多 ... */
34
+ .weda-list-view__containor .weda-list-view__more .weda-list-view__more-symbol {
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ padding-top: 1.42857rem;
39
+ padding-bottom: 1.28571rem;
40
+ box-sizing: border-box;
41
+ }
42
+
43
+ .weda-list-view__containor .weda-list-view__more .weda-list-view__symbol-item {
44
+ width: 0.57143rem;
45
+ height: 0.57143rem;
46
+ background: #c4c4c4;
47
+ margin-left: 0.42857rem;
48
+ border-radius: 50%;
49
+ }
50
+
51
+ .weda-list-view__containor
52
+ .weda-list-view__more
53
+ .weda-list-view__symbol-item:first-child {
54
+ width: 0.42857rem;
55
+ height: 0.42857rem;
56
+ margin-left: 0;
57
+ }
58
+
59
+ /* 加载更多 分页 */
60
+ .weda-list-view__containor .weda-list-view__more {
61
+ background-color: #fff;
62
+ }
63
+ .weda-list-view__containor
64
+ .weda-list-view__more.weda-list-view__more-bottomLoad {
65
+ background-color: transparent;
66
+ }
67
+ .weda-list-view__containor
68
+ .weda-list-view__more
69
+ .weda-list-view__more-pagination {
70
+ display: flex;
71
+ align-items: center;
72
+ justify-content: space-between;
73
+ position: relative;
74
+ padding: 0.71429rem 1.28571rem 0.85714rem 1.14286rem;
75
+ box-sizing: border-box;
76
+ }
77
+
78
+ .weda-list-view__containor
79
+ .weda-list-view__more
80
+ .weda-list-view__pagination-pre,
81
+ .weda-list-view__containor
82
+ .weda-list-view__more
83
+ .weda-list-view__pagination-next {
84
+ font-size: 0.85714em;
85
+ line-height: 1.71428em;
86
+ color: rgba(0, 0, 0, 0.4);
87
+ padding: 0 1.71429rem;
88
+ cursor: pointer;
89
+ }
90
+
91
+ .weda-list-view__containor
92
+ .weda-list-view__more
93
+ .weda-list-view__pagination-pre.active,
94
+ .weda-list-view__containor
95
+ .weda-list-view__more
96
+ .weda-list-view__pagination-next.active {
97
+ color: rgba(0, 0, 0, 0.9);
98
+ }
99
+
100
+ .weda-list-view__containor
101
+ .weda-list-view__more
102
+ .weda-list-view__pagination-pre::before,
103
+ .weda-list-view__containor
104
+ .weda-list-view__more
105
+ .weda-list-view__pagination-next::after {
106
+ position: absolute;
107
+ content: '';
108
+ width: 1.71428em;
109
+ height: 1.71428em;
110
+ top: 0.71429rem;
111
+ opacity: 0.2;
112
+ background-image: url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjE3MTkgMTIuMDAwMkw4LjIyMTkyIDcuMDUwMjNMOS42MzU5MiA1LjYzNjIzTDE1Ljk5OTkgMTIuMDAwMkw5LjYzNTkyIDE4LjM2NDJMOC4yMjE5MiAxNi45NTAyTDEzLjE3MTkgMTIuMDAwMloiIGZpbGw9IiMwOTEyMUYiLz4KPC9zdmc+Cg==);
113
+ }
114
+
115
+ .weda-list-view__containor
116
+ .weda-list-view__more
117
+ .active.weda-list-view__pagination-pre::before,
118
+ .weda-list-view__containor
119
+ .weda-list-view__more
120
+ .active.weda-list-view__pagination-next::after {
121
+ opacity: 1;
122
+ }
123
+
124
+ .weda-list-view__containor
125
+ .weda-list-view__more
126
+ .weda-list-view__pagination-pre::before {
127
+ left: 1.14286rem;
128
+ transform: rotate(180deg);
129
+ }
130
+
131
+ .weda-list-view__containor
132
+ .weda-list-view__more
133
+ .weda-list-view__pagination-next::after {
134
+ right: 1.28571rem;
135
+ }
136
+
137
+ .weda-list-view__containor
138
+ .weda-list-view__more
139
+ .weda-list-view__pagination-text {
140
+ font-size: 0.85714em;
141
+ line-height: 1.71428em;
142
+ color: rgba(0, 0, 0, 0.4);
143
+ }
@@ -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,262 @@
1
+ import React, { useState, useEffect, useRef, useMemo, 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, _d;
16
+ const { dataSourceType, bindConnectMetadata, connectorMethod, connectorParams, datasource, orderBy, orderType, where, template, pageSize = 5, pagination, events, className, children, isRecords = true, //是否展示回调recoreds字段
17
+ appCloud = { callDataSource, isInIde }, beforeDataChange = (v) => v, ...rest } = props;
18
+ const isModel = useMemo(() => dataSourceType !== 'custom-connector', [dataSourceType]);
19
+ const methodName = useMemo(() => {
20
+ var _a;
21
+ if (isModel) {
22
+ return ((_a = datasource === null || datasource === void 0 ? void 0 : datasource.extra) === null || _a === void 0 ? void 0 : _a.methodName) || 'wedaGetRecords';
23
+ }
24
+ else {
25
+ return (connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name) || 'wedaGetRecords';
26
+ }
27
+ }, [(_a = datasource === null || datasource === void 0 ? void 0 : datasource.extra) === null || _a === void 0 ? void 0 : _a.methodName, connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name, isModel]); // 默认方法名
28
+ const [pageNo, setPageNo] = useState(1); // 分页状态
29
+ const [loading, setLoading] = useState(false); // 触底刷新加载状态
30
+ const [entry, setEntry] = useState(null); // 触底的observer对象
31
+ const paramRef = useRef({
32
+ dataSourceName: datasource === null || datasource === void 0 ? void 0 : datasource.name,
33
+ bindConnectMetaName: (_b = bindConnectMetadata === null || bindConnectMetadata === void 0 ? void 0 : bindConnectMetadata.datasource) === null || _b === void 0 ? void 0 : _b.name,
34
+ methodName,
35
+ params: { orderBy, orderType, where, pageNo: 1, pageSize, connectorParams },
36
+ pagination,
37
+ }); // 最新请求参数
38
+ const dataRef = useRef({ total: 0, records: [] }); // 最新数据列表
39
+ const observeRef = useRef(null); // 当前监听对象
40
+ const isIdeMockData = (!(datasource === null || datasource === void 0 ? void 0 : datasource.name) || !((_c = bindConnectMetadata === null || bindConnectMetadata === void 0 ? void 0 : bindConnectMetadata.datasource) === null || _c === void 0 ? void 0 : _c.name)) &&
41
+ ((_d = appCloud === null || appCloud === void 0 ? void 0 : appCloud.isInIde) === null || _d === void 0 ? void 0 : _d.call(appCloud)); // 在ide环境且未绑定数据源时,存在mock数据逻辑
42
+ const shouldBottomLoad = pagination === 'bottomLoad' && (entry === null || entry === void 0 ? void 0 : entry.isIntersecting) && !loading; // 能否触底加载
43
+ // 组件卸载时触发
44
+ useEffect(() => {
45
+ return () => {
46
+ var _a, _b;
47
+ (_a = observeRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
48
+ (_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, { data: beforeDataChange([]) });
49
+ };
50
+ }, []);
51
+ // props 基本类型监听,需重新分页;处于 ide 且未绑定数据源时返回mock数据
52
+ useEffect(() => {
53
+ var _a, _b, _c;
54
+ dataRef.current = { total: 0, records: [] };
55
+ if ((isModel && (datasource === null || datasource === void 0 ? void 0 : datasource.name)) || (!isModel && (connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name))) {
56
+ fetchData({
57
+ dataSourceName: isModel
58
+ ? datasource === null || datasource === void 0 ? void 0 : datasource.name
59
+ : (_a = bindConnectMetadata === null || bindConnectMetadata === void 0 ? void 0 : bindConnectMetadata.datasource) === null || _a === void 0 ? void 0 : _a.name,
60
+ methodName,
61
+ params: {
62
+ ...(_b = paramRef.current) === null || _b === void 0 ? void 0 : _b.params,
63
+ orderBy,
64
+ orderType,
65
+ pageNo: 1,
66
+ pageSize,
67
+ },
68
+ pagination,
69
+ });
70
+ }
71
+ else {
72
+ if (isIdeMockData) {
73
+ (_c = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _c === void 0 ? void 0 : _c.call(events, {
74
+ data: beforeDataChange(getIdeMockData(pageSize)),
75
+ });
76
+ }
77
+ }
78
+ }, [methodName, pageSize, pagination, orderBy, orderType, datasource === null || datasource === void 0 ? void 0 : datasource.name]);
79
+ // props 对象类型监听,需重新分页
80
+ useEffect(() => {
81
+ var _a, _b, _c, _d;
82
+ if (isModel) {
83
+ if (!isequal((_b = (_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.where, where)) {
84
+ dataRef.current = { total: 0, records: [] };
85
+ fetchData({
86
+ params: { pageNo: 1, where },
87
+ });
88
+ }
89
+ }
90
+ else {
91
+ if (!isequal((_d = (_c = paramRef.current) === null || _c === void 0 ? void 0 : _c.params) === null || _d === void 0 ? void 0 : _d.connectorParams, connectorParams)) {
92
+ dataRef.current = { total: 0, records: [] };
93
+ fetchData({
94
+ params: { pageNo: 1, connectorParams },
95
+ });
96
+ }
97
+ }
98
+ });
99
+ // 监听触底加载事件,这里面的 setLoading 用 setTimeout包裹起来,所以会先执行新的children渲染,再执行 loading
100
+ useEffect(() => {
101
+ var _a, _b;
102
+ if (shouldBottomLoad && hasNextPage()) {
103
+ fetchData({
104
+ params: { pageNo: (((_b = (_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.pageNo) || 1) + 1 },
105
+ });
106
+ }
107
+ }, [shouldBottomLoad]);
108
+ // 触底监控对象
109
+ const nodeRefCallback = useCallback((node) => {
110
+ var _a;
111
+ if (node) {
112
+ (_a = observeRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
113
+ observeRef.current = new IntersectionObserver((entries) => {
114
+ setEntry(entries === null || entries === void 0 ? void 0 : entries[0]);
115
+ });
116
+ observeRef.current.observe(node);
117
+ }
118
+ }, []);
119
+ // 能否点击下一页
120
+ const hasNextPage = () => {
121
+ var _a;
122
+ const { pageNo = 1, pageSize = 5 } = ((_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) || {};
123
+ const { total = 0 } = dataRef.current || {};
124
+ return pageNo * pageSize < total;
125
+ };
126
+ /**
127
+ * 列表视图拉取数据
128
+ * 方法仅依赖入参和paramRef的参数
129
+ */
130
+ const fetchData = async (param) => {
131
+ if (loading)
132
+ return;
133
+ setLoading(true);
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
+ let tcbParams = {};
143
+ // tcb分页参数
144
+ if (!isNil(pageNo) && !isNil(pageSize)) {
145
+ tcbParams['pageNo'] = pageNo;
146
+ tcbParams['pageSize'] = pageSize;
147
+ }
148
+ if (isModel) {
149
+ // tcb排序参数
150
+ if (orderBy && ORDERTYPE.includes(orderType)) {
151
+ tcbParams['orderBy'] = orderBy;
152
+ tcbParams['orderType'] = orderType;
153
+ }
154
+ // tcb过滤参数
155
+ const whereEffected = [].concat(getWhereList(where));
156
+ whereEffected.length > 0 && (tcbParams['where'] = whereEffected);
157
+ }
158
+ else {
159
+ tcbParams = Object.assign({}, tcbParams, connectorParams);
160
+ }
161
+ // tcb结果和事件
162
+ let data = [];
163
+ data = await (appCloud === null || appCloud === void 0 ? void 0 : appCloud.callDataSource({
164
+ dataSourceName,
165
+ methodName,
166
+ params: tcbParams,
167
+ }));
168
+ paramRef.current = fetchParam;
169
+ onEnvets(data);
170
+ };
171
+ /**
172
+ * 根据fetchData方法返回值,回调给外部事件
173
+ * datasource 是对象类型,所以总能拿到最新的值
174
+ */
175
+ const onEnvets = (data) => {
176
+ var _a, _b, _c, _d, _e, _f;
177
+ const fetchRecords = [].concat(!isRecords && !isModel ? data : (data === null || data === void 0 ? void 0 : data.records) || []); //当数据详情调用连接器时,获取回调data数据
178
+ const total = (data === null || data === void 0 ? void 0 : data.total) || fetchRecords.length;
179
+ if (['loadMoreButton', 'bottomLoad'].includes(paramRef.current.pagination)) {
180
+ dataRef.current = {
181
+ total,
182
+ records: [...dataRef.current.records, ...fetchRecords],
183
+ };
184
+ }
185
+ else {
186
+ dataRef.current = { total, records: fetchRecords };
187
+ }
188
+ (_a = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _a === void 0 ? void 0 : _a.call(events, {
189
+ data: beforeDataChange(dataRef.current.records || []),
190
+ });
191
+ const eventDatSource = isModel
192
+ ? datasource
193
+ : { ...bindConnectMetadata, ...connectorMethod };
194
+ if (JSON.stringify(data) === '{}') {
195
+ (_b = events === null || events === void 0 ? void 0 : events.queryFail) === null || _b === void 0 ? void 0 : _b.call(events, { datasource: eventDatSource });
196
+ }
197
+ else {
198
+ if (total === 0) {
199
+ (_c = events === null || events === void 0 ? void 0 : events.queryEmpty) === null || _c === void 0 ? void 0 : _c.call(events, {
200
+ datasource: eventDatSource,
201
+ data: beforeDataChange([]),
202
+ });
203
+ }
204
+ (_d = events === null || events === void 0 ? void 0 : events.querySuccess) === null || _d === void 0 ? void 0 : _d.call(events, {
205
+ datasource: eventDatSource,
206
+ data: beforeDataChange(dataRef.current.records),
207
+ });
208
+ }
209
+ setPageNo(((_f = (_e = paramRef.current) === null || _e === void 0 ? void 0 : _e.params) === null || _f === void 0 ? void 0 : _f.pageNo) || 1);
210
+ window.setTimeout(() => setLoading(false));
211
+ };
212
+ /**
213
+ * 分页,加载更多
214
+ */
215
+ const renderLoadMore = () => {
216
+ let disabled = !hasNextPage();
217
+ if (isIdeMockData) {
218
+ disabled = false;
219
+ }
220
+ return (!disabled &&
221
+ (loading ? (LoadingSymbol) : (React.createElement("div", { className: `${BLOCK_NAME}__more-text`, onClick: () => fetchData({ params: { pageNo: pageNo + 1 } }) }, "\u52A0\u8F7D\u66F4\u591A"))));
222
+ };
223
+ /**
224
+ * 分页,底部刷新
225
+ */
226
+ const renderBottomLoad = () => {
227
+ return (React.createElement("div", { ref: nodeRefCallback, className: `${BLOCK_NAME}__bottom-load` }, loading ? LoadingSymbol : !hasNextPage() && LoadEnd));
228
+ };
229
+ /**
230
+ * 分页,分页器,含ideMockData的判断
231
+ */
232
+ const renderPagination = () => {
233
+ var _a;
234
+ const preDisabeld = pageNo <= 1;
235
+ const nextDisabeld = !hasNextPage();
236
+ const total = ((_a = dataRef.current) === null || _a === void 0 ? void 0 : _a.total) || 0;
237
+ return (React.createElement("div", { className: `${BLOCK_NAME}__more-pagination` },
238
+ React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-pre`, preDisabeld ? '' : 'active'), onClick: () => !preDisabeld && fetchData({ params: { pageNo: pageNo - 1 } }) }, "\u4E0A\u4E00\u9875"),
239
+ React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-text`) },
240
+ React.createElement("span", { className: "active" }, isIdeMockData ? 1 : total ? pageNo : 0),
241
+ "/",
242
+ isIdeMockData ? 1 : Math.ceil(total / pageSize)),
243
+ React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-next`, nextDisabeld ? '' : 'active'), onClick: () => !nextDisabeld && fetchData({ params: { pageNo: pageNo + 1 } }) }, "\u4E0B\u4E00\u9875")));
244
+ };
245
+ /**
246
+ * 加载中状态组件
247
+ */
248
+ const LoadingSymbol = (React.createElement("div", { className: `${BLOCK_NAME}__more-symbol` },
249
+ React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` }),
250
+ React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` }),
251
+ React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` })));
252
+ /**
253
+ * 加载到底状态组件
254
+ */
255
+ const LoadEnd = React.createElement("div", null);
256
+ return (React.createElement("div", { ...rest, className: classNames('weda-ui', `${BLOCK_NAME}__containor`, className) },
257
+ children && (React.createElement("div", { className: template === 'cardList' ? `${BLOCK_NAME}-card` : '' }, children)),
258
+ React.createElement("div", { className: classNames(`${BLOCK_NAME}__more`, `${BLOCK_NAME}__more-${pagination}`) },
259
+ pagination === 'bottomLoad' && renderBottomLoad(),
260
+ pagination === 'loadMoreButton' && renderLoadMore(),
261
+ pagination === 'pagination' && renderPagination())));
262
+ }