@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 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import './index.css';
3
+ import type { CommonPropsType, ICompRef } from '../../types';
4
+ declare type TCompRef = ICompRef<{
5
+ start: () => void;
6
+ }>;
7
+ declare const _default: React.ForwardRefExoticComponent<PropsType & React.RefAttributes<TCompRef>>;
8
+ export default _default;
9
+ export interface PropsType extends CommonPropsType {
10
+ /**
11
+ * 奖品列表
12
+ */
13
+ prizeList: any;
14
+ /**
15
+ * 启动抽奖
16
+ */
17
+ enablePrize: boolean;
18
+ /**
19
+ * 抽奖结果
20
+ */
21
+ prizeResult: string;
22
+ }
@@ -0,0 +1,391 @@
1
+ /* eslint-disable react/jsx-key */
2
+ import React, { useState, useEffect, useCallback, useImperativeHandle, } from 'react';
3
+ import { usePlatform } from '../../utils/platform';
4
+ import classNames from '../../utils/classnames';
5
+ import './index.css';
6
+ import { ConfigProvider } from 'tea-component';
7
+ import LotteryAction from './lotteryUtil';
8
+ const CLASS_PREFIX = 'weda-lottery';
9
+ const lotteryAction = new LotteryAction();
10
+ export default React.forwardRef(function Lottery({ className, id, style, prizeList, enablePrize, prizeResult, events }, ref) {
11
+ const platform = usePlatform();
12
+ const [activedId, setActivedId] = useState(-1);
13
+ const [isStartLottery, setIsStartLottery] = useState(false);
14
+ const [lotteryList, setLotteryList] = useState([]);
15
+ const [btnActived, setBtnActived] = useState(false);
16
+ //获取初始化默认数据,数据不足8条设置默认,超过8条获取前8条
17
+ const lotteryListDefault = () => {
18
+ const list = [];
19
+ if (prizeList == null) {
20
+ return list;
21
+ }
22
+ for (let i = 0; i < 8; i++) {
23
+ if (i < prizeList.length) {
24
+ const prize = prizeList[i];
25
+ list.push({
26
+ idx: i + 1,
27
+ selected: false,
28
+ desc: prize.title,
29
+ src: prize.image,
30
+ });
31
+ }
32
+ else {
33
+ list.push({
34
+ idx: i + 1,
35
+ selected: false,
36
+ desc: '',
37
+ src: '',
38
+ });
39
+ }
40
+ }
41
+ return list;
42
+ };
43
+ const startLottery = useCallback(() => {
44
+ setLotteryList(lotteryListDefault());
45
+ setBtnActived(true);
46
+ if (lotteryAction.isStart)
47
+ return;
48
+ events === null || events === void 0 ? void 0 : events.clickLotteryButton();
49
+ setIsStartLottery(true);
50
+ }, [
51
+ lotteryAction.isStart,
52
+ setIsStartLottery,
53
+ setBtnActived,
54
+ lotteryListDefault,
55
+ setLotteryList,
56
+ ]);
57
+ useImperativeHandle(ref, () => {
58
+ return {
59
+ methods: {
60
+ start: startLottery,
61
+ },
62
+ };
63
+ }, [startLottery]);
64
+ useEffect(() => {
65
+ setLotteryList(lotteryListDefault());
66
+ }, [prizeList]);
67
+ useEffect(() => {
68
+ lotteryAction.animationCallback = ({ idx, isEnd }) => {
69
+ setActivedId(idx == -1 ? 0 : idx);
70
+ if (isEnd) {
71
+ setBtnActived(false);
72
+ const list = lotteryList.map((item, index) => {
73
+ if (index === idx - 1) {
74
+ item.selected = true;
75
+ }
76
+ else {
77
+ item.selected = false;
78
+ }
79
+ return item;
80
+ });
81
+ setLotteryList(list);
82
+ setActivedId(-1);
83
+ // eslint-disable-next-line rulesdir/no-timer
84
+ setTimeout(() => {
85
+ events.finishLottery({
86
+ prize: idx,
87
+ result: list[idx - 1],
88
+ });
89
+ // 延迟700毫秒显示的视觉效果更好,否则看不清结果就弹出dialog盖住了
90
+ }, 700);
91
+ }
92
+ };
93
+ }, [lotteryList]);
94
+ useEffect(() => {
95
+ // 当满足开启抽奖条件并且点击了开奖开关时,启用抽奖
96
+ if (enablePrize && isStartLottery) {
97
+ lotteryAction.start(prizeResult, () => {
98
+ window.app.showToast({
99
+ title: '网络异常',
100
+ icon: 'none',
101
+ });
102
+ });
103
+ // 当不选取变量作为结果的时候,按照设置给定结果
104
+ lotteryAction.end(prizeResult);
105
+ setIsStartLottery(false);
106
+ }
107
+ else if (!enablePrize) {
108
+ //立马停止抽奖
109
+ lotteryAction.stop();
110
+ }
111
+ }, [isStartLottery, enablePrize]);
112
+ useEffect(() => {
113
+ // 设置抽奖结果
114
+ lotteryAction.end(prizeResult);
115
+ }, [prizeResult]);
116
+ const [widthRatio, setWidthRatio] = useState(1);
117
+ const [heightRatio, setHeightRatio] = useState(1);
118
+ // 上下5个球的宽度
119
+ const [dotWidth, setDotWidth] = useState(217 / 14);
120
+ // 左右5个球的高度
121
+ const [dotHeight, setDotHeight] = useState(217 / 14);
122
+ const standardWidth = 326;
123
+ const standardHeight = 326;
124
+ const cls = classNames({
125
+ [CLASS_PREFIX]: true,
126
+ [className]: className,
127
+ [`${CLASS_PREFIX}-mobile`]: platform === 'h5',
128
+ });
129
+ // 将获取的style 转化为 px, 用户输入的单位可能有(纯数字,px, rem, %, rpx)
130
+ // 注: 前端输入宽高,不带单位和带rem单位,code 中获取的都是rem 单位,也就是输入1304,输出‘46.5714rem’; 输入‘1304rem’, 输出‘1304rem’, 所以rem目前不支持正常的比列
131
+ // 带上px单位和不带单位,输出的都是rem,且转化的值一样的,所以不需要特殊处理,也就是 输入 1304 和 1304px ,前端拿到的都是‘46.5714rem’
132
+ // rpx 是小程序的单位,并且在pc 上加病没作用,所以rpx 不处理
133
+ // % 暂时也不处理,因为不确定用户的百分比是以什么为标准的
134
+ const getStyleUnit = (targetValue) => {
135
+ if (!targetValue)
136
+ return -1;
137
+ const value = targetValue.toString();
138
+ // 获取单位
139
+ const fotData = value.match(/^\d+(?:\.\d+)?([a-zA-Z%]+)?$/);
140
+ let unit = 'rem';
141
+ if (fotData && fotData[1]) {
142
+ unit = fotData[1];
143
+ }
144
+ return unit;
145
+ };
146
+ const getRatio = (value, unit) => {
147
+ let actualValue;
148
+ if (unit.toString() === 'rem') {
149
+ actualValue = value * 14 * 2;
150
+ }
151
+ return actualValue;
152
+ };
153
+ // 通过页面配置拿到用户设置的宽,高,直接获取的宽和高,会被转化为rem, 需要将rem 转为 px. 规则: e/2/14
154
+ // css 输出的px到页面rem, 转化规则为: e/14
155
+ useEffect(() => {
156
+ if (!style || style == undefined || platform === 'h5') {
157
+ setWidthRatio(1);
158
+ setDotWidth(217 / 14);
159
+ setHeightRatio(1);
160
+ setDotHeight(217 / 14);
161
+ return;
162
+ }
163
+ if (style && style !== undefined) {
164
+ // 如果宽和高不存在,则还远吗比例为默认值-1,也就是保持视觉稿默认的宽和高
165
+ if (!style.width) {
166
+ setWidthRatio(1);
167
+ setDotWidth(217 / 14);
168
+ }
169
+ if (!style.height) {
170
+ setHeightRatio(1);
171
+ setDotHeight(217 / 14);
172
+ }
173
+ if (style.width) {
174
+ // 现将获取的rem 转化为px
175
+ const actualValue = getRatio(parseFloat(style.width.toString()), getStyleUnit(style.width));
176
+ // setWidthRatio();
177
+ const setValue = Math.floor((actualValue / (standardWidth * 2)) * 1000) / 1000;
178
+ setWidthRatio(setValue);
179
+ const dotWidth = (setValue * 43 * 4 + setValue * 9 * 5) / 14;
180
+ setDotWidth(dotWidth);
181
+ }
182
+ if (style.height) {
183
+ // 现将获取的rem 转化为px
184
+ const actualValue = getRatio(parseFloat(style.height.toString()), getStyleUnit(style.height));
185
+ const setValue = Math.floor((actualValue / (standardHeight * 2)) * 1000) / 1000;
186
+ setHeightRatio(setValue);
187
+ const dotHeight = (setValue * 43 * 4 + setValue * 9 * 5) / 14;
188
+ setDotHeight(dotHeight);
189
+ }
190
+ }
191
+ }, [style]);
192
+ const renderDot = (direction, list) => {
193
+ return (React.createElement(React.Fragment, null,
194
+ React.createElement("div", { className: classNames(`${CLASS_PREFIX}__dot`, `${CLASS_PREFIX}__dot-${direction}`) }, list.map((item, index) => {
195
+ return (React.createElement("div", { key: index, className: `${CLASS_PREFIX}__dot-item`, style: {
196
+ width: `${(9 * widthRatio) / 14}rem`,
197
+ height: `${(9 * heightRatio) / 14}rem`,
198
+ marginBottom: `${direction}` === 'vertical'
199
+ ? `${(43 * heightRatio) / 14}rem`
200
+ : '0',
201
+ marginRight: `${direction}` === 'horizontal'
202
+ ? `${(43 * widthRatio) / 14}rem`
203
+ : '0',
204
+ } }));
205
+ }))));
206
+ };
207
+ const dotList = [
208
+ {
209
+ single: true,
210
+ position: 'left-top',
211
+ direction: '',
212
+ list: [],
213
+ },
214
+ {
215
+ single: true,
216
+ position: 'left-bottom',
217
+ direction: '',
218
+ list: [],
219
+ },
220
+ {
221
+ single: true,
222
+ position: 'right-top',
223
+ direction: '',
224
+ list: [],
225
+ },
226
+ {
227
+ single: true,
228
+ position: 'right-bottom',
229
+ direction: '',
230
+ list: [],
231
+ },
232
+ {
233
+ single: false,
234
+ position: 'top',
235
+ direction: 'horizontal',
236
+ list: ['1', '2', '3', '4', '5'],
237
+ },
238
+ {
239
+ single: false,
240
+ position: 'bottom',
241
+ direction: 'horizontal',
242
+ list: ['1', '2', '3', '4', '5'],
243
+ },
244
+ {
245
+ single: false,
246
+ position: 'left',
247
+ direction: 'vertical',
248
+ list: ['1', '2', '3', '4', '5'],
249
+ },
250
+ {
251
+ single: false,
252
+ position: 'right',
253
+ direction: 'vertical',
254
+ list: ['1', '2', '3', '4', '5'],
255
+ },
256
+ ];
257
+ return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
258
+ React.createElement("div", { className: "body", key: "lottery", "data-testid": "lottery" },
259
+ React.createElement("div", { className: cls, id: id, style: style },
260
+ React.createElement("div", { className: `${CLASS_PREFIX}__wrap` },
261
+ dotList.map((dot, index) => {
262
+ return (React.createElement("div", { key: index },
263
+ dot.single && (React.createElement("div", { key: `${dot.direction}-${index}`, className: classNames(`${CLASS_PREFIX}__dot-single`, `${CLASS_PREFIX}__dot-${dot.position}`), style: {
264
+ width: `${(9 * widthRatio) / 14}rem`,
265
+ height: `${(9 * heightRatio) / 14}rem`,
266
+ top: `${dot.position}` === 'left-top' ||
267
+ `${dot.position}` === 'right-top'
268
+ ? `${(9 * heightRatio) / 14}rem`
269
+ : '',
270
+ bottom: `${dot.position}` === 'left-bottom' ||
271
+ `${dot.position}` === 'right-bottom'
272
+ ? `${(9 * heightRatio) / 14}rem`
273
+ : '',
274
+ left: `${dot.position}` === 'left-top' ||
275
+ `${dot.position}` === 'left-bottom'
276
+ ? `${(6 * widthRatio) / 14}rem`
277
+ : '',
278
+ right: `${dot.position}` === 'right-top' ||
279
+ `${dot.position}` === 'right-bottom'
280
+ ? `${(6 * widthRatio) / 14}rem`
281
+ : '',
282
+ } })),
283
+ !dot.single && (React.createElement("div", { key: `${dot.direction}-${index}`, className: `${CLASS_PREFIX}__dot-${dot.position}`, style: {
284
+ left: `${dot.position}` === 'top' ||
285
+ `${dot.position}` === 'bottom'
286
+ ? `calc((${'100%'} - ${dotWidth}rem) / 2)`
287
+ : `${dot.position}` === 'left'
288
+ ? `${(widthRatio * 18 - widthRatio * 9) / 2 / 14}rem`
289
+ : '',
290
+ top: `${dot.position}` === 'left' ||
291
+ `${dot.position}` === 'right'
292
+ ? `calc((100% - ${dotHeight}rem) / 2)`
293
+ : `${dot.position}` === 'top'
294
+ ? `${(heightRatio * 18 - heightRatio * 9) / 2 / 14}rem`
295
+ : '',
296
+ bottom: `${dot.position}` === 'bottom'
297
+ ? `${(heightRatio * 18 - heightRatio * 9) / 2 / 14}rem`
298
+ : '',
299
+ right: `${dot.position}` === 'right'
300
+ ? `${(widthRatio * 18 - widthRatio * 9) / 2 / 14}rem`
301
+ : '',
302
+ } }, true && renderDot(dot.direction, dot.list)))));
303
+ }),
304
+ React.createElement("div", { className: `${CLASS_PREFIX}__inner`, style: {
305
+ paddingTop: `${(18 * heightRatio) / 14}rem`,
306
+ paddingBottom: `${(18 * heightRatio) / 14}rem`,
307
+ paddingLeft: `${(18 * widthRatio) / 14}rem`,
308
+ paddingRight: `${(18 * widthRatio) / 14}rem`,
309
+ } },
310
+ React.createElement("div", { className: `${CLASS_PREFIX}__inner-wrap` },
311
+ React.createElement("ul", { className: `${CLASS_PREFIX}__list` }, lotteryList.map((item, index) => {
312
+ return (React.createElement("li", { "data-testid": "lottery-item", key: index, className: classNames(`${CLASS_PREFIX}__turntable-item`, item.idx === activedId ? 'is-actived' : '', item.selected ? 'is-selected' : ''), style: {
313
+ width: `calc((${'100%'} - ${(widthRatio * 8 * 4) / 14}rem) / 3)`,
314
+ height: `calc((${'100%'} - ${(heightRatio * 8 * 4) / 14}rem) / 3)`,
315
+ top: `${index}` == '0' ||
316
+ `${index}` == '1' ||
317
+ `${index}` == '2'
318
+ ? `${(heightRatio * 8) / 14}rem`
319
+ : `${index}` == '3'
320
+ ? `calc((${'100%'} - ${(heightRatio * 8 * 4) / 14}rem) / 3 + ${(heightRatio * 8 * 2) / 14}rem)`
321
+ : '',
322
+ bottom: `${index}` == '4' ||
323
+ `${index}` == '5' ||
324
+ `${index}` == '6'
325
+ ? `${(heightRatio * 8) / 14}rem`
326
+ : `${index}` == '7'
327
+ ? `calc((${'100%'} - ${(heightRatio * 8 * 4) / 14}rem) / 3 + ${(heightRatio * 8 * 2) / 14}rem)`
328
+ : '',
329
+ right: `${index}` == '2' ||
330
+ `${index}` == '3' ||
331
+ `${index}` == '4'
332
+ ? `${(widthRatio * 8) / 14}rem`
333
+ : '',
334
+ left: `${index}` == '0' ||
335
+ `${index}` == '6' ||
336
+ `${index}` == '7'
337
+ ? `${(widthRatio * 8) / 14}rem`
338
+ : `${index}` == '1' || `${index}` == '5'
339
+ ? `calc((${'100%'} - ${(widthRatio * 8 * 4) / 14}rem) / 3 + ${(widthRatio * 8 * 2) / 14}rem)`
340
+ : '',
341
+ } },
342
+ React.createElement("div", { className: `${CLASS_PREFIX}__turntable-cell`, style: {
343
+ borderLeftWidth: `${(4 * widthRatio) / 14}rem`,
344
+ borderRightWidth: `${(4 * widthRatio) / 14}rem`,
345
+ borderTopWidth: `${(4 * heightRatio) / 14}rem`,
346
+ borderBottomWidth: `${(4 * heightRatio) / 14}rem`,
347
+ paddingTop: `${(8 * heightRatio) / 14}rem`,
348
+ paddingBottom: `${(8 * heightRatio) / 14}rem`,
349
+ paddingLeft: `${(2 * widthRatio) / 14}rem`,
350
+ paddingRight: `${(2 * widthRatio) / 14}rem`,
351
+ } },
352
+ item.src && (React.createElement("div", { className: `${CLASS_PREFIX}__turntable-cell-image`, style: {
353
+ height: `${(heightRatio * 40) / 14}rem`,
354
+ } },
355
+ React.createElement("img", { src: item.src, alt: item.desc, className: `${CLASS_PREFIX}__turntable-cell-icon`, style: {
356
+ width: `${(widthRatio * 40) / 14}rem`,
357
+ height: `${(heightRatio * 40) / 14}rem`,
358
+ } }))),
359
+ item.desc && (React.createElement("div", { className: `${CLASS_PREFIX}__turntable-cell-desc`, style: {
360
+ marginTop: `${(heightRatio * 6) / 14}rem`,
361
+ fontSize: `${(widthRatio * 12) / 14}rem`,
362
+ lineHeight: `${(heightRatio * 17) / 14}rem`,
363
+ } }, item.desc)))));
364
+ })),
365
+ React.createElement("div", { className: classNames(`${CLASS_PREFIX}__turntable-btn`, btnActived ? 'is-actived' : ''), style: {
366
+ width: `calc((${'100%'} - ${(widthRatio * 8 * 4) / 14}rem) / 3)`,
367
+ height: `calc((${'100%'} - ${(heightRatio * 8 * 4) / 14}rem) / 3)`,
368
+ top: `calc((${'100%'} - ${(heightRatio * 8 * 4) / 14}rem) / 3 + ${(heightRatio * 8 * 2) / 14}rem)`,
369
+ left: `calc((${'100%'} - ${(heightRatio * 8 * 4) / 14}rem) / 3 + ${(heightRatio * 8 * 2) / 14}rem)`,
370
+ } },
371
+ React.createElement("div", { className: `${CLASS_PREFIX}__btn-inner`, style: {
372
+ paddingTop: `${(9 * heightRatio) / 14}rem`,
373
+ paddingBottom: `${(9 * heightRatio) / 14}rem`,
374
+ paddingLeft: `${(9 * widthRatio) / 14}rem`,
375
+ paddingRight: `${(9 * widthRatio) / 14}rem`,
376
+ } },
377
+ React.createElement("div", { className: `${CLASS_PREFIX}__btn` },
378
+ React.createElement("a", { "data-testid": "start-lottery", className: `${CLASS_PREFIX}__btn-image`, style: {
379
+ paddingTop: `${(11 * heightRatio) / 14}rem`,
380
+ paddingBottom: `${(11 * heightRatio) / 14}rem`,
381
+ paddingLeft: `${(15 * widthRatio) / 14}rem`,
382
+ paddingRight: `${(15 * widthRatio) / 14}rem`,
383
+ }, onClick: startLottery },
384
+ React.createElement("p", { className: `${CLASS_PREFIX}__btn-text`, style: {
385
+ fontSize: `${(widthRatio * 18) / 14}rem`,
386
+ lineHeight: `${(widthRatio * 22) / 14}rem`,
387
+ } },
388
+ "\u5F00\u59CB",
389
+ React.createElement("br", null),
390
+ "\u62BD\u5956"))))))))))));
391
+ });
@@ -0,0 +1,23 @@
1
+ export default class LotteryAction {
2
+ idx: number;
3
+ isStart: boolean;
4
+ endId: any;
5
+ speed: number;
6
+ duration: number;
7
+ maxIdx: number;
8
+ animationCallback: ({ idx, isEnd }: {
9
+ idx: any;
10
+ isEnd: any;
11
+ }) => void;
12
+ isError: boolean;
13
+ isSpeedUp: boolean;
14
+ timeout: number;
15
+ timer: any;
16
+ constructor();
17
+ start(prizeResult: any, errorCallback: any): void;
18
+ end(prizeResult: any): void;
19
+ error(): void;
20
+ stop(): void;
21
+ pointOnCubicBezier(cp: any, t: any): number;
22
+ loop(): void;
23
+ }
@@ -0,0 +1,181 @@
1
+ /* eslint-disable rulesdir/no-timer */
2
+ export default class LotteryAction {
3
+ constructor() {
4
+ Object.defineProperty(this, "idx", {
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true,
8
+ value: void 0
9
+ });
10
+ // 开始抽奖
11
+ Object.defineProperty(this, "isStart", {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value: void 0
16
+ });
17
+ // 结束位置
18
+ Object.defineProperty(this, "endId", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: void 0
23
+ });
24
+ // 抽奖速度
25
+ Object.defineProperty(this, "speed", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: void 0
30
+ });
31
+ // 持续时长
32
+ Object.defineProperty(this, "duration", {
33
+ enumerable: true,
34
+ configurable: true,
35
+ writable: true,
36
+ value: void 0
37
+ });
38
+ Object.defineProperty(this, "maxIdx", {
39
+ enumerable: true,
40
+ configurable: true,
41
+ writable: true,
42
+ value: void 0
43
+ });
44
+ // 回调动作
45
+ Object.defineProperty(this, "animationCallback", {
46
+ enumerable: true,
47
+ configurable: true,
48
+ writable: true,
49
+ value: void 0
50
+ });
51
+ // 是否异常
52
+ Object.defineProperty(this, "isError", {
53
+ enumerable: true,
54
+ configurable: true,
55
+ writable: true,
56
+ value: void 0
57
+ });
58
+ // 是否加速
59
+ Object.defineProperty(this, "isSpeedUp", {
60
+ enumerable: true,
61
+ configurable: true,
62
+ writable: true,
63
+ value: void 0
64
+ });
65
+ // 超时时间
66
+ Object.defineProperty(this, "timeout", {
67
+ enumerable: true,
68
+ configurable: true,
69
+ writable: true,
70
+ value: void 0
71
+ });
72
+ Object.defineProperty(this, "timer", {
73
+ enumerable: true,
74
+ configurable: true,
75
+ writable: true,
76
+ value: void 0
77
+ });
78
+ // 当前位置
79
+ this.idx = -1;
80
+ // 开始抽奖
81
+ this.isStart = false;
82
+ // 结束位置
83
+ this.endId = undefined;
84
+ // 抽奖速度
85
+ this.speed = 0;
86
+ // 持续时长
87
+ this.duration = 2000;
88
+ // 长度
89
+ this.maxIdx = 8;
90
+ // 回调动作
91
+ this.animationCallback = () => { };
92
+ // 是否异常
93
+ this.isError = false;
94
+ // 是否加速
95
+ this.isSpeedUp = false;
96
+ //超时时间
97
+ this.timeout = 6000;
98
+ }
99
+ start(prizeResult, errorCallback) {
100
+ setTimeout(() => {
101
+ this.isStart = false;
102
+ const reg = /^\+?[1-9]\d*$/;
103
+ if (!reg.test(prizeResult)) {
104
+ this.isError = true;
105
+ if (errorCallback) {
106
+ errorCallback();
107
+ }
108
+ }
109
+ }, this.duration);
110
+ // 在转动时长的一半,开始减速转动
111
+ setTimeout(() => {
112
+ this.isSpeedUp = false;
113
+ }, this.duration / 2);
114
+ // 超时,当出现一些意外的情况终止动画
115
+ setTimeout(() => {
116
+ if (this.endId === undefined) {
117
+ this.end(prizeResult);
118
+ }
119
+ }, this.timeout);
120
+ this.isStart = true;
121
+ this.isError = false;
122
+ this.isSpeedUp = true;
123
+ this.loop();
124
+ }
125
+ end(prizeResult) {
126
+ this.endId = prizeResult;
127
+ }
128
+ error() {
129
+ this.isError = true;
130
+ }
131
+ stop() {
132
+ this.isStart = false;
133
+ this.end(-1);
134
+ clearTimeout(this.timer);
135
+ }
136
+ pointOnCubicBezier(cp, t) {
137
+ const x = Math.pow(1 - t, 2) * cp[0] +
138
+ 2 * t * (1 - t) * cp[1] +
139
+ Math.pow(t, 2) * cp[2];
140
+ return x;
141
+ }
142
+ loop() {
143
+ const { animationCallback } = this;
144
+ this.timer = setTimeout(() => {
145
+ const over = !this.isStart && this.endId !== undefined;
146
+ // emit
147
+ animationCallback({ idx: this.idx, isEnd: false });
148
+ // compare
149
+ if (this.idx < this.maxIdx) {
150
+ this.idx++;
151
+ }
152
+ else {
153
+ this.idx = 1;
154
+ }
155
+ // continue
156
+ if (!(over && String(this.idx) === String(this.endId)) && !this.isError) {
157
+ if (this.isSpeedUp) {
158
+ const point = this.pointOnCubicBezier([500, 50, 100], 1 / 10);
159
+ this.speed = point;
160
+ if (this.speed < 100) {
161
+ this.speed = 100;
162
+ }
163
+ }
164
+ else {
165
+ const point = this.pointOnCubicBezier([100, 50, 500], 1 / 10);
166
+ this.speed = point;
167
+ if (this.speed > 1000) {
168
+ this.speed = 1000;
169
+ }
170
+ }
171
+ this.loop();
172
+ }
173
+ else {
174
+ if (this.isError)
175
+ return;
176
+ animationCallback({ idx: this.idx, isEnd: true });
177
+ this.idx = -1;
178
+ }
179
+ }, this.speed);
180
+ }
181
+ }
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { ModalProps } from 'tea-component';
3
+ import type { CommonPropsType, ICompRef } from '../../types';
4
+ export interface PropTypes extends ModalProps, CommonPropsType {
5
+ content: string;
6
+ customButton: React.ReactNode;
7
+ customContent: React.ReactNode;
8
+ isDefaultButton: boolean;
9
+ outerRef: React.Ref<TCompRef>;
10
+ }
11
+ declare type TCompRef = ICompRef<{
12
+ close: () => void;
13
+ open: () => void;
14
+ toggle: () => void;
15
+ }>;
16
+ declare const _default: React.ForwardRefExoticComponent<PropTypes & React.RefAttributes<TCompRef>>;
17
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { usePlatform } from '../../utils/platform';
3
+ import { ModalPc } from './modal.pc';
4
+ import { ModalH5 } from './modal.h5';
5
+ export default React.forwardRef(function WeDaModal(props, ref) {
6
+ const platform = usePlatform();
7
+ if (platform === 'h5') {
8
+ return React.createElement(ModalH5, { ...props, outerRef: ref });
9
+ }
10
+ return React.createElement(ModalPc, { size: "auto", ...props, outerRef: ref });
11
+ });
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { PropTypes } from '../modal';
3
+ import './h5.css';
4
+ export declare function ModalH5(props: PropTypes): JSX.Element;