@cloudbase/weda-ui 3.2.0 → 3.3.0

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 (356) hide show
  1. package/dist/cypress/support/commands.d.ts +1 -0
  2. package/dist/cypress/support/commands.js +40 -0
  3. package/dist/cypress/support/e2e.d.ts +24 -0
  4. package/dist/cypress/support/e2e.js +22 -0
  5. package/dist/src/configs/actions/showModal.json +48 -0
  6. package/dist/src/configs/actions/showToast.json +41 -0
  7. package/dist/src/configs/components/auth.json +16 -0
  8. package/dist/src/configs/components/button.json +239 -0
  9. package/dist/src/configs/components/calendar.json +81 -0
  10. package/dist/src/configs/components/carousel.json +292 -0
  11. package/dist/src/configs/components/chart/bar.json +962 -0
  12. package/dist/src/configs/components/chart/line.json +878 -0
  13. package/dist/src/configs/components/chart/pie.json +685 -0
  14. package/dist/src/configs/components/chart/statisticsCard.json +376 -0
  15. package/dist/src/configs/components/container.json +50 -0
  16. package/dist/src/configs/components/dataView.json +247 -0
  17. package/dist/src/configs/components/drawer.json +115 -0
  18. package/dist/src/configs/components/form/checkbox.json +179 -0
  19. package/dist/src/configs/components/form/departTreeSelect.json +124 -0
  20. package/dist/src/configs/components/form/form.json +73 -0
  21. package/dist/src/configs/components/form/input.json +154 -0
  22. package/dist/src/configs/components/form/location.json +216 -0
  23. package/dist/src/configs/components/form/radio.json +203 -0
  24. package/dist/src/configs/components/form/richText.json +133 -0
  25. package/dist/src/configs/components/form/select.json +449 -0
  26. package/dist/src/configs/components/form/switch.json +58 -0
  27. package/dist/src/configs/components/form/textarea.json +116 -0
  28. package/dist/src/configs/components/form/tips.json +34 -0
  29. package/dist/src/configs/components/form/uploader.json +171 -0
  30. package/dist/src/configs/components/form/uploaderFile.json +158 -0
  31. package/dist/src/configs/components/form/userTreeSelect.json +128 -0
  32. package/dist/src/configs/components/formdetail.json +105 -0
  33. package/dist/src/configs/components/graphicCard.json +413 -0
  34. package/dist/src/configs/components/image.json +187 -0
  35. package/dist/src/configs/components/link.json +79 -0
  36. package/dist/src/configs/components/listView.json +378 -0
  37. package/dist/src/configs/components/lottery.json +163 -0
  38. package/dist/src/configs/components/modal.json +72 -0
  39. package/dist/src/configs/components/navLayout.json +368 -0
  40. package/dist/src/configs/components/navigationBar.json +62 -0
  41. package/dist/src/configs/components/richtextview.json +26 -0
  42. package/dist/src/configs/components/scrollVeiw.json +253 -0
  43. package/dist/src/configs/components/slot.json +17 -0
  44. package/dist/src/configs/components/swiper.json +90 -0
  45. package/dist/src/configs/components/tabs.json +122 -0
  46. package/dist/src/configs/components/text.json +95 -0
  47. package/dist/src/configs/components/wedaVideo.json +89 -0
  48. package/dist/src/configs/components/wxOpenApi/phone.json +127 -0
  49. package/dist/src/configs/components/wxOpenApi/phoneCode.json +109 -0
  50. package/dist/src/configs/components/wxOpenApi/share.json +160 -0
  51. package/dist/src/configs/components/wxOpenApi/userInfo.json +156 -0
  52. package/dist/src/configs/index.d.ts +103 -0
  53. package/dist/src/configs/index.js +111 -0
  54. package/dist/src/docs/common/format.d.ts +13 -0
  55. package/dist/src/docs/common/format.js +122 -0
  56. package/dist/src/docs/common/tableView.d.ts +30 -0
  57. package/dist/src/docs/common/tableView.js +156 -0
  58. package/dist/src/index.d.ts +2 -0
  59. package/dist/src/index.js +3 -0
  60. package/dist/src/setupTests.d.ts +2 -0
  61. package/dist/src/setupTests.js +19 -0
  62. package/dist/src/web/actions/index.d.ts +2 -0
  63. package/dist/src/web/actions/index.js +2 -0
  64. package/dist/src/web/actions/showModal/index.d.ts +4 -0
  65. package/dist/src/web/actions/showModal/index.js +66 -0
  66. package/dist/src/web/actions/showToast/index.d.ts +1 -0
  67. package/dist/src/web/actions/showToast/index.js +3 -0
  68. package/dist/src/web/components/button/index.d.ts +32 -0
  69. package/dist/src/web/components/button/index.js +48 -0
  70. package/dist/src/web/components/calendar/index.d.ts +19 -0
  71. package/dist/src/web/components/calendar/index.js +191 -0
  72. package/dist/src/web/components/calendar/util.d.ts +13 -0
  73. package/dist/src/web/components/calendar/util.js +74 -0
  74. package/dist/src/web/components/carousel/index.d.ts +41 -0
  75. package/dist/src/web/components/carousel/index.js +244 -0
  76. package/dist/src/web/components/chart/bar/index.d.ts +3 -0
  77. package/dist/src/web/components/chart/bar/index.js +45 -0
  78. package/dist/src/web/components/chart/bar/index.old.d.ts +40 -0
  79. package/dist/src/web/components/chart/bar/index.old.js +56 -0
  80. package/dist/src/web/components/chart/common/Chart.d.ts +10 -0
  81. package/dist/src/web/components/chart/common/Chart.js +31 -0
  82. package/dist/src/web/components/chart/common/chart-custom-connector.d.ts +6 -0
  83. package/dist/src/web/components/chart/common/chart-custom-connector.js +35 -0
  84. package/dist/src/web/components/chart/common/chart-error.d.ts +2 -0
  85. package/dist/src/web/components/chart/common/chart-error.js +2 -0
  86. package/dist/src/web/components/chart/common/config/bar.d.ts +48 -0
  87. package/dist/src/web/components/chart/common/config/bar.js +49 -0
  88. package/dist/src/web/components/chart/common/config/global.d.ts +13 -0
  89. package/dist/src/web/components/chart/common/config/global.js +16 -0
  90. package/dist/src/web/components/chart/common/config/line.d.ts +46 -0
  91. package/dist/src/web/components/chart/common/config/line.js +49 -0
  92. package/dist/src/web/components/chart/common/config/pie.d.ts +29 -0
  93. package/dist/src/web/components/chart/common/config/pie.js +36 -0
  94. package/dist/src/web/components/chart/common/core/eChartBar.d.ts +66 -0
  95. package/dist/src/web/components/chart/common/core/eChartBar.js +201 -0
  96. package/dist/src/web/components/chart/common/core/eChartBase.d.ts +127 -0
  97. package/dist/src/web/components/chart/common/core/eChartBase.js +394 -0
  98. package/dist/src/web/components/chart/common/core/eChartLine.d.ts +60 -0
  99. package/dist/src/web/components/chart/common/core/eChartLine.js +173 -0
  100. package/dist/src/web/components/chart/common/core/eChartPie.d.ts +48 -0
  101. package/dist/src/web/components/chart/common/core/eChartPie.js +135 -0
  102. package/dist/src/web/components/chart/common/core/type.d.ts +35 -0
  103. package/dist/src/web/components/chart/common/core/type.js +9 -0
  104. package/dist/src/web/components/chart/common/data-transform.d.ts +6 -0
  105. package/dist/src/web/components/chart/common/data-transform.js +248 -0
  106. package/dist/src/web/components/chart/common/echarts.d.ts +5 -0
  107. package/dist/src/web/components/chart/common/echarts.js +24 -0
  108. package/dist/src/web/components/chart/common/error-boundary.d.ts +5 -0
  109. package/dist/src/web/components/chart/common/error-boundary.js +26 -0
  110. package/dist/src/web/components/chart/common/useChart.d.ts +8 -0
  111. package/dist/src/web/components/chart/common/useChart.js +72 -0
  112. package/dist/src/web/components/chart/line/index.d.ts +3 -0
  113. package/dist/src/web/components/chart/line/index.js +42 -0
  114. package/dist/src/web/components/chart/line/index.old.d.ts +38 -0
  115. package/dist/src/web/components/chart/line/index.old.js +53 -0
  116. package/dist/src/web/components/chart/pie/index.d.ts +3 -0
  117. package/dist/src/web/components/chart/pie/index.js +42 -0
  118. package/dist/src/web/components/chart/pie/index.old.d.ts +27 -0
  119. package/dist/src/web/components/chart/pie/index.old.js +40 -0
  120. package/dist/src/web/components/chart/statisticsCard/index.d.ts +85 -0
  121. package/dist/src/web/components/chart/statisticsCard/index.js +203 -0
  122. package/dist/src/web/components/chart/statisticsCard/interface.d.ts +13 -0
  123. package/dist/src/web/components/chart/statisticsCard/interface.js +1 -0
  124. package/dist/src/web/components/common/error-boundary.d.ts +5 -0
  125. package/dist/src/web/components/common/error-boundary.js +33 -0
  126. package/dist/src/web/components/common/portal.d.ts +7 -0
  127. package/dist/src/web/components/common/portal.js +14 -0
  128. package/dist/src/web/components/common/use-loop-render-detect.d.ts +11 -0
  129. package/dist/src/web/components/common/use-loop-render-detect.js +124 -0
  130. package/dist/src/web/components/container/index.d.ts +6 -0
  131. package/dist/src/web/components/container/index.js +6 -0
  132. package/dist/src/web/components/dataView/index.d.ts +6 -0
  133. package/dist/src/web/components/dataView/index.js +8 -0
  134. package/dist/src/web/components/dataView/interface.d.ts +5 -0
  135. package/dist/src/web/components/dataView/interface.js +1 -0
  136. package/dist/src/web/components/drawer/index.d.ts +13 -0
  137. package/dist/src/web/components/drawer/index.js +12 -0
  138. package/dist/src/web/components/form/checkbox/index.d.ts +13 -0
  139. package/dist/src/web/components/form/checkbox/index.js +167 -0
  140. package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
  141. package/dist/src/web/components/form/enumSelect/MultipleSelect.js +52 -0
  142. package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
  143. package/dist/src/web/components/form/enumSelect/NormalSelect.js +52 -0
  144. package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
  145. package/dist/src/web/components/form/enumSelect/SelectContainer.js +30 -0
  146. package/dist/src/web/components/form/enumSelect/index.d.ts +82 -0
  147. package/dist/src/web/components/form/enumSelect/index.js +6 -0
  148. package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
  149. package/dist/src/web/components/form/enumSelect/props/defaultProps.js +40 -0
  150. package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
  151. package/dist/src/web/components/form/enumSelect/props/propsTypes.js +47 -0
  152. package/dist/src/web/components/form/form/index.d.ts +32 -0
  153. package/dist/src/web/components/form/form/index.js +150 -0
  154. package/dist/src/web/components/form/formcell/index.d.ts +8 -0
  155. package/dist/src/web/components/form/formcell/index.js +40 -0
  156. package/dist/src/web/components/form/input/index.d.ts +14 -0
  157. package/dist/src/web/components/form/input/index.js +94 -0
  158. package/dist/src/web/components/form/location/common/mapChoose.d.ts +15 -0
  159. package/dist/src/web/components/form/location/common/mapChoose.js +496 -0
  160. package/dist/src/web/components/form/location/common/mapView.d.ts +19 -0
  161. package/dist/src/web/components/form/location/common/mapView.js +175 -0
  162. package/dist/src/web/components/form/location/common/propsConfig.d.ts +59 -0
  163. package/dist/src/web/components/form/location/common/propsConfig.js +50 -0
  164. package/dist/src/web/components/form/location/common/selectModal.d.ts +21 -0
  165. package/dist/src/web/components/form/location/common/selectModal.js +44 -0
  166. package/dist/src/web/components/form/location/common/tmap.d.ts +3 -0
  167. package/dist/src/web/components/form/location/common/tmap.js +21 -0
  168. package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +36 -0
  169. package/dist/src/web/components/form/location/common/useLocationInfo.js +105 -0
  170. package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
  171. package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +328 -0
  172. package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
  173. package/dist/src/web/components/form/location/components/LocationPC/Header.js +43 -0
  174. package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
  175. package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +228 -0
  176. package/dist/src/web/components/form/location/constants.d.ts +2 -0
  177. package/dist/src/web/components/form/location/constants.js +3 -0
  178. package/dist/src/web/components/form/location/index.d.ts +1 -0
  179. package/dist/src/web/components/form/location/index.js +24 -0
  180. package/dist/src/web/components/form/radio/index.d.ts +11 -0
  181. package/dist/src/web/components/form/radio/index.js +115 -0
  182. package/dist/src/web/components/form/renderDecorator.d.ts +6 -0
  183. package/dist/src/web/components/form/renderDecorator.js +20 -0
  184. package/dist/src/web/components/form/select/allTimePicker/calendar.d.ts +13 -0
  185. package/dist/src/web/components/form/select/allTimePicker/calendar.js +104 -0
  186. package/dist/src/web/components/form/select/allTimePicker/dataUtils.d.ts +24 -0
  187. package/dist/src/web/components/form/select/allTimePicker/dataUtils.js +265 -0
  188. package/dist/src/web/components/form/select/allTimePicker/index.d.ts +14 -0
  189. package/dist/src/web/components/form/select/allTimePicker/index.js +944 -0
  190. package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +15 -0
  191. package/dist/src/web/components/form/select/dropdown-select/ui.js +55 -0
  192. package/dist/src/web/components/form/select/h5.d.ts +16 -0
  193. package/dist/src/web/components/form/select/h5.js +466 -0
  194. package/dist/src/web/components/form/select/index.d.ts +66 -0
  195. package/dist/src/web/components/form/select/index.js +255 -0
  196. package/dist/src/web/components/form/select/region/index.d.ts +6 -0
  197. package/dist/src/web/components/form/select/region/index.js +147 -0
  198. package/dist/src/web/components/form/select/time.d.ts +9 -0
  199. package/dist/src/web/components/form/select/time.js +146 -0
  200. package/dist/src/web/components/form/select/use-options.d.ts +26 -0
  201. package/dist/src/web/components/form/select/use-options.js +103 -0
  202. package/dist/src/web/components/form/select/year.d.ts +7 -0
  203. package/dist/src/web/components/form/select/year.js +72 -0
  204. package/dist/src/web/components/form/switch/index.d.ts +6 -0
  205. package/dist/src/web/components/form/switch/index.js +58 -0
  206. package/dist/src/web/components/form/textarea/index.d.ts +12 -0
  207. package/dist/src/web/components/form/textarea/index.js +66 -0
  208. package/dist/src/web/components/form/tips/index.d.ts +8 -0
  209. package/dist/src/web/components/form/tips/index.js +17 -0
  210. package/dist/src/web/components/form/uploader/index.d.ts +3 -0
  211. package/dist/src/web/components/form/uploader/index.js +42 -0
  212. package/dist/src/web/components/form/uploader/uploader.h5.d.ts +20 -0
  213. package/dist/src/web/components/form/uploader/uploader.h5.js +199 -0
  214. package/dist/src/web/components/form/uploader/uploader.pc.d.ts +29 -0
  215. package/dist/src/web/components/form/uploader/uploader.pc.js +208 -0
  216. package/dist/src/web/components/form/uploaderFile/index.d.ts +4 -0
  217. package/dist/src/web/components/form/uploaderFile/index.js +19 -0
  218. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
  219. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +330 -0
  220. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
  221. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +302 -0
  222. package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +8 -0
  223. package/dist/src/web/components/form/userOrgSelect/comTool.js +101 -0
  224. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +19 -0
  225. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +252 -0
  226. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
  227. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +157 -0
  228. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
  229. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
  230. package/dist/src/web/components/form/userOrgSelect/getUserService.d.ts +11 -0
  231. package/dist/src/web/components/form/userOrgSelect/getUserService.js +159 -0
  232. package/dist/src/web/components/form/userOrgSelect/index.d.ts +2 -0
  233. package/dist/src/web/components/form/userOrgSelect/index.js +17 -0
  234. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +27 -0
  235. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +276 -0
  236. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
  237. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +253 -0
  238. package/dist/src/web/components/form/userOrgSelect/utils.d.ts +36 -0
  239. package/dist/src/web/components/form/userOrgSelect/utils.js +80 -0
  240. package/dist/src/web/components/formdetail/index.d.ts +28 -0
  241. package/dist/src/web/components/formdetail/index.js +173 -0
  242. package/dist/src/web/components/graphicCard/index.d.ts +46 -0
  243. package/dist/src/web/components/graphicCard/index.js +178 -0
  244. package/dist/src/web/components/image/image.d.ts +9 -0
  245. package/dist/src/web/components/image/image.js +119 -0
  246. package/dist/src/web/components/image/index.d.ts +13 -0
  247. package/dist/src/web/components/image/index.js +77 -0
  248. package/dist/src/web/components/index.d.ts +50 -0
  249. package/dist/src/web/components/index.js +99 -0
  250. package/dist/src/web/components/link/index.d.ts +24 -0
  251. package/dist/src/web/components/link/index.js +71 -0
  252. package/dist/src/web/components/listView/index.d.ts +7 -0
  253. package/dist/src/web/components/listView/index.js +297 -0
  254. package/dist/src/web/components/listView/interface.d.ts +127 -0
  255. package/dist/src/web/components/listView/interface.js +1 -0
  256. package/dist/src/web/components/lottery/index.d.ts +22 -0
  257. package/dist/src/web/components/lottery/index.js +385 -0
  258. package/dist/src/web/components/lottery/lotteryUtil.d.ts +23 -0
  259. package/dist/src/web/components/lottery/lotteryUtil.js +181 -0
  260. package/dist/src/web/components/modal/index.d.ts +17 -0
  261. package/dist/src/web/components/modal/index.js +11 -0
  262. package/dist/src/web/components/modal/modal.h5.d.ts +4 -0
  263. package/dist/src/web/components/modal/modal.h5.js +46 -0
  264. package/dist/src/web/components/modal/modal.pc.d.ts +3 -0
  265. package/dist/src/web/components/modal/modal.pc.js +31 -0
  266. package/dist/src/web/components/navLayout/index.d.ts +61 -0
  267. package/dist/src/web/components/navLayout/index.js +127 -0
  268. package/dist/src/web/components/navigationBar/common.d.ts +15 -0
  269. package/dist/src/web/components/navigationBar/common.js +127 -0
  270. package/dist/src/web/components/navigationBar/h5Menu.d.ts +14 -0
  271. package/dist/src/web/components/navigationBar/h5Menu.js +72 -0
  272. package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +12 -0
  273. package/dist/src/web/components/navigationBar/horizontalMenu.js +99 -0
  274. package/dist/src/web/components/navigationBar/index.d.ts +13 -0
  275. package/dist/src/web/components/navigationBar/index.js +157 -0
  276. package/dist/src/web/components/navigationBar/verticalMenu.d.ts +13 -0
  277. package/dist/src/web/components/navigationBar/verticalMenu.js +38 -0
  278. package/dist/src/web/components/phone/index.d.ts +18 -0
  279. package/dist/src/web/components/phone/index.js +4 -0
  280. package/dist/src/web/components/phoneCode/index.d.ts +18 -0
  281. package/dist/src/web/components/phoneCode/index.js +4 -0
  282. package/dist/src/web/components/picker/datePicker.d.ts +10 -0
  283. package/dist/src/web/components/picker/datePicker.js +31 -0
  284. package/dist/src/web/components/picker/picker.d.ts +6 -0
  285. package/dist/src/web/components/picker/picker.js +45 -0
  286. package/dist/src/web/components/picker/timePicker.d.ts +7 -0
  287. package/dist/src/web/components/picker/timePicker.js +42 -0
  288. package/dist/src/web/components/richText/const.d.ts +1 -0
  289. package/dist/src/web/components/richText/const.js +2 -0
  290. package/dist/src/web/components/richText/index.d.ts +50 -0
  291. package/dist/src/web/components/richText/index.js +351 -0
  292. package/dist/src/web/components/richTextView/index.d.ts +7 -0
  293. package/dist/src/web/components/richTextView/index.js +46 -0
  294. package/dist/src/web/components/scrollView/index.d.ts +26 -0
  295. package/dist/src/web/components/scrollView/index.js +97 -0
  296. package/dist/src/web/components/share/index.d.ts +34 -0
  297. package/dist/src/web/components/share/index.js +4 -0
  298. package/dist/src/web/components/slot/index.d.ts +6 -0
  299. package/dist/src/web/components/slot/index.js +9 -0
  300. package/dist/src/web/components/swiper/index.d.ts +24 -0
  301. package/dist/src/web/components/swiper/index.js +153 -0
  302. package/dist/src/web/components/tabs/index.d.ts +13 -0
  303. package/dist/src/web/components/tabs/index.js +20 -0
  304. package/dist/src/web/components/tabs/tabs.h5.d.ts +4 -0
  305. package/dist/src/web/components/tabs/tabs.h5.js +44 -0
  306. package/dist/src/web/components/tabs/tabs.pc.d.ts +3 -0
  307. package/dist/src/web/components/tabs/tabs.pc.js +40 -0
  308. package/dist/src/web/components/text/index.d.ts +14 -0
  309. package/dist/src/web/components/text/index.js +19 -0
  310. package/dist/src/web/components/uploaderFileView/index.d.ts +10 -0
  311. package/dist/src/web/components/uploaderFileView/index.js +46 -0
  312. package/dist/src/web/components/uploaderView/index.d.ts +17 -0
  313. package/dist/src/web/components/uploaderView/index.js +48 -0
  314. package/dist/src/web/components/userInfo/index.d.ts +26 -0
  315. package/dist/src/web/components/userInfo/index.js +4 -0
  316. package/dist/src/web/components/wedaVideo/index.d.ts +17 -0
  317. package/dist/src/web/components/wedaVideo/index.js +156 -0
  318. package/dist/src/web/index.d.ts +8 -0
  319. package/dist/src/web/index.js +4 -0
  320. package/dist/src/web/utils/classnames.d.ts +2 -0
  321. package/dist/src/web/utils/classnames.js +37 -0
  322. package/dist/src/web/utils/console.d.ts +3 -0
  323. package/dist/src/web/utils/console.js +26 -0
  324. package/dist/src/web/utils/constant.d.ts +23 -0
  325. package/dist/src/web/utils/constant.js +24 -0
  326. package/dist/src/web/utils/debounce.d.ts +2 -0
  327. package/dist/src/web/utils/debounce.js +92 -0
  328. package/dist/src/web/utils/getLocalCounter.d.ts +1 -0
  329. package/dist/src/web/utils/getLocalCounter.js +4 -0
  330. package/dist/src/web/utils/getUserService.d.ts +11 -0
  331. package/dist/src/web/utils/getUserService.js +156 -0
  332. package/dist/src/web/utils/isObjectEqual.d.ts +2 -0
  333. package/dist/src/web/utils/isObjectEqual.js +12 -0
  334. package/dist/src/web/utils/loading-fallback.d.ts +2 -0
  335. package/dist/src/web/utils/loading-fallback.js +2 -0
  336. package/dist/src/web/utils/lodash.d.ts +1 -0
  337. package/dist/src/web/utils/lodash.js +2 -0
  338. package/dist/src/web/utils/platform.d.ts +18 -0
  339. package/dist/src/web/utils/platform.js +193 -0
  340. package/dist/src/web/utils/tcb.d.ts +33 -0
  341. package/dist/src/web/utils/tcb.js +118 -0
  342. package/dist/src/web/utils/tmap.d.ts +3 -0
  343. package/dist/src/web/utils/tmap.js +21 -0
  344. package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +1 -0
  345. package/dist/src/web/utils/use-cloud-id-temp-url.js +15 -0
  346. package/dist/src/web/utils/useSetState.d.ts +1 -0
  347. package/dist/src/web/utils/useSetState.js +8 -0
  348. package/dist/src/web/utils/useSyncValue.d.ts +4 -0
  349. package/dist/src/web/utils/useSyncValue.js +16 -0
  350. package/dist/src/web/utils/weui.d.ts +1 -0
  351. package/dist/src/web/utils/weui.js +2 -0
  352. package/dist/web/components/form/input/index.css +16 -0
  353. package/dist/web/components/form/select/allTimePicker/calendar.css +114 -0
  354. package/dist/web/components/form/select/allTimePicker/index.css +136 -0
  355. package/dist/web/components/form/userOrgSelect/userOrgSelect.css +809 -0
  356. package/package.json +34 -21
@@ -0,0 +1,328 @@
1
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+ // @ts-nocheck
3
+ import * as React from 'react';
4
+ import classNames from '../../../../../utils/classnames';
5
+ import weui from '../../../../../utils/weui';
6
+ import './index.css';
7
+ import { renderDecorator } from '../../../renderDecorator';
8
+ import MapView from '../../common/mapView';
9
+ import SelectModal from '../../common/selectModal';
10
+ import { propTypes, defaultProps } from '../../common/propsConfig';
11
+ import { callDataSource } from '../../../../../utils/tcb';
12
+ import { inH5IsMobile } from '../../../../../utils/platform';
13
+ import styles from './location.module.css';
14
+ const { useEffect, useState, useRef } = React;
15
+ export default function LocationH5(props) {
16
+ const {
17
+ // 系统属性
18
+ id, className, style, events,
19
+ // 组件属性
20
+ value, label, labelVisible, showLngLat, showMap, drag, zoom, disabled, requiredFlag, decorator, locationType, dataSource, layout, locationRange, customRange, } = props;
21
+ const cls = classNames({
22
+ 'weda-ui': true,
23
+ cloudbase_standard: true,
24
+ [className]: className,
25
+ });
26
+ const [isSelectMapVisible, setIsSelectMapVisible] = useState(false);
27
+ const [currentLocStatus, setCurrentLocStatus] = useState(false);
28
+ const [dataSourceStatus, setDataSourceStatus] = useState({
29
+ status: false,
30
+ message: '定位功能初始化中,请稍后重试',
31
+ });
32
+ const [APIKEY, setAPIKEY] = useState('');
33
+ const [apiKeyStatus, setApiKeyStatus] = useState({
34
+ status: false,
35
+ message: '定位功能初始化中,请稍后重试',
36
+ });
37
+ const [location, setLocation] = useState({
38
+ detailedAddress: '',
39
+ poiname: '',
40
+ latlng: { lat: 39.98410411, lng: 116.307503 },
41
+ });
42
+ const currentLocations = useRef();
43
+ const customLocation = useRef();
44
+ useEffect(() => {
45
+ if (value || !currentLocations.current)
46
+ return;
47
+ // 重置表单时
48
+ const { poiname, detailedAddress, latlng: { lat, lng }, } = currentLocations.current;
49
+ let location = {
50
+ poiname,
51
+ detailedAddress,
52
+ latlng: { lat, lng },
53
+ };
54
+ if (locationType === 1) {
55
+ location.locationType = 1;
56
+ events.change({ value: {} });
57
+ }
58
+ else if (locationType === 2) {
59
+ let res = {
60
+ value: {
61
+ address: poiname,
62
+ detailedAddress,
63
+ geopoint: {
64
+ coordinates: [lng, lat],
65
+ type: 'Point',
66
+ },
67
+ },
68
+ };
69
+ events.change && events.change(res);
70
+ }
71
+ setLocation(location);
72
+ // eslint-disable-next-line react-hooks/exhaustive-deps
73
+ }, [value, locationType]);
74
+ useEffect(() => {
75
+ let loc = {
76
+ latlng: {
77
+ lat: 39.98410411,
78
+ lng: 116.307503,
79
+ },
80
+ poiname: '',
81
+ detailedAddress: '',
82
+ locationType,
83
+ };
84
+ setLocation(loc);
85
+ // 暂不支持自定位置,初始化表单值都是{}
86
+ events.change({ value: {} });
87
+ // eslint-disable-next-line react-hooks/exhaustive-deps
88
+ }, [locationType]);
89
+ useEffect(() => {
90
+ if (checkCustomLocation(value)) {
91
+ // 表单为新增时回传点位信息
92
+ const { address, detailedAddress, geopoint } = value;
93
+ const coordinates = (geopoint === null || geopoint === void 0 ? void 0 : geopoint.coordinates) || [];
94
+ let loc = {
95
+ poiname: address,
96
+ detailedAddress: detailedAddress,
97
+ latlng: { lng: coordinates[0], lat: coordinates[1] },
98
+ };
99
+ customLocation.current = value;
100
+ setLocation(loc);
101
+ }
102
+ }, [value]);
103
+ // 获取定位信息
104
+ useEffect(() => {
105
+ if (!dataSourceStatus.status ||
106
+ !APIKEY ||
107
+ new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(APIKEY))
108
+ return;
109
+ function loadScript() {
110
+ // 移除之前的
111
+ if (document.getElementById('form-location-plug')) {
112
+ document.body.removeChild(document.getElementById('form-location-plug'));
113
+ }
114
+ const script = document.createElement('script');
115
+ script.type = 'text/javascript';
116
+ script.src = `https://apis.map.qq.com/tools/geolocation/min?key=${APIKEY}&referer=myapp`;
117
+ script.setAttribute('id', 'form-location-plug');
118
+ script.onload = () => {
119
+ let geolocation = new window.qq.maps.Geolocation();
120
+ let getLocationType = inH5IsMobile() ? 'getLocation' : 'getIpLocation';
121
+ geolocation[getLocationType]((ipLocation) => {
122
+ const { city, lat, lng, addr } = ipLocation;
123
+ setApiKeyStatus({
124
+ status: true,
125
+ message: '',
126
+ });
127
+ setCurrentLocStatus(true);
128
+ let loc = {
129
+ poiname: city + addr,
130
+ detailedAddress: city + addr,
131
+ latlng: { lat, lng },
132
+ };
133
+ if (locationType === 1) {
134
+ loc.locationType = 1;
135
+ }
136
+ currentLocations.current = loc;
137
+ // 表单为新增时检查是否为回传点位信息
138
+ if (checkCustomLocation(customLocation.current))
139
+ return;
140
+ setLocation(loc);
141
+ if (locationType === 2) {
142
+ events.change &&
143
+ events.change({
144
+ value: {
145
+ address: city + addr,
146
+ detailedAddress: city + addr,
147
+ geopoint: {
148
+ coordinates: [lng, lat],
149
+ type: 'Point',
150
+ },
151
+ },
152
+ });
153
+ }
154
+ }, (error) => {
155
+ console.error('error loc', error);
156
+ currentLocations.current = null;
157
+ setApiKeyStatus({
158
+ status: false,
159
+ message: error.code === 1
160
+ ? '请打开定位权限'
161
+ : error.message || '定位失败',
162
+ });
163
+ setCurrentLocStatus(false);
164
+ });
165
+ };
166
+ script.onerror = (error) => {
167
+ console.error('Geolocation script onerror', error);
168
+ setApiKeyStatus({
169
+ status: false,
170
+ message: '定位失败',
171
+ });
172
+ setLocation({
173
+ poiname: '',
174
+ detailedAddress: '',
175
+ latlng: { lat: 39.98410411, lng: 116.307503 },
176
+ });
177
+ showToast('定位失败');
178
+ };
179
+ document.body.appendChild(script);
180
+ }
181
+ loadScript();
182
+ // eslint-disable-next-line react-hooks/exhaustive-deps
183
+ }, [APIKEY, locationType, dataSourceStatus]);
184
+ useEffect(() => {
185
+ // 调用连接器数据源方法
186
+ if (dataSource.name) {
187
+ callDataSource({
188
+ dataSourceName: dataSource.name,
189
+ methodName: 'getApiKey',
190
+ })
191
+ .then((res) => {
192
+ if (res.apiKey) {
193
+ setAPIKEY(res.apiKey);
194
+ setDataSourceStatus({
195
+ status: true,
196
+ message: '',
197
+ });
198
+ setApiKeyStatus({
199
+ status: true,
200
+ message: '',
201
+ });
202
+ }
203
+ })
204
+ .catch((error) => {
205
+ console.error('datasources error', error);
206
+ setDataSourceStatus({
207
+ status: false,
208
+ message: error,
209
+ });
210
+ });
211
+ }
212
+ else {
213
+ setDataSourceStatus({
214
+ status: false,
215
+ message: '请配置地图连接器',
216
+ });
217
+ showToast('请配置地图连接器');
218
+ }
219
+ }, [dataSource]);
220
+ const checkCustomLocation = (params) => {
221
+ var _a;
222
+ let status = true;
223
+ if (!(params === null || params === void 0 ? void 0 : params.address) || !(params === null || params === void 0 ? void 0 : params.detailedAddress)) {
224
+ status = false;
225
+ }
226
+ else if (((_a = params === null || params === void 0 ? void 0 : params.geopoint) === null || _a === void 0 ? void 0 : _a.type) != 'Point') {
227
+ status = false;
228
+ }
229
+ return status;
230
+ };
231
+ const showToast = (message) => {
232
+ weui.toast(message, {
233
+ duration: 2000,
234
+ className: 'weui-form-location_toast',
235
+ });
236
+ };
237
+ const handleChooseLocation = () => {
238
+ if (disabled)
239
+ return;
240
+ if (!dataSourceStatus.status)
241
+ return showToast(dataSourceStatus.message);
242
+ if (!apiKeyStatus.status)
243
+ return showToast(apiKeyStatus.message);
244
+ if (!currentLocStatus)
245
+ return showToast('获取位置信息中,请稍后重试');
246
+ setIsSelectMapVisible(true);
247
+ };
248
+ const onChangeLocation = (value) => {
249
+ const { poiname, latlng, detailedAddress } = value;
250
+ let res = {
251
+ value: {
252
+ address: poiname,
253
+ detailedAddress,
254
+ geopoint: {
255
+ coordinates: [latlng.lng, latlng.lat],
256
+ type: 'Point',
257
+ },
258
+ },
259
+ };
260
+ events.change && events.change(res);
261
+ };
262
+ const getIsShowMap = () => {
263
+ let status = showMap;
264
+ if (locationType === 1 && location.locationType === 1) {
265
+ status = false;
266
+ }
267
+ else if (locationType === 2 && !dataSourceStatus.status) {
268
+ status = false;
269
+ }
270
+ else if (locationType === 2 && !apiKeyStatus.status) {
271
+ status = false;
272
+ }
273
+ else if (!currentLocStatus) {
274
+ status = false;
275
+ }
276
+ return status;
277
+ };
278
+ const getIsShowAddr = () => {
279
+ let status = true;
280
+ if (locationType === 1 && location.locationType === 1) {
281
+ status = false;
282
+ }
283
+ else if (locationType === 2 && !dataSourceStatus.status) {
284
+ status = false;
285
+ }
286
+ else if (locationType === 2 && !apiKeyStatus.status) {
287
+ status = false;
288
+ }
289
+ else if (!currentLocStatus) {
290
+ status = false;
291
+ }
292
+ return status;
293
+ };
294
+ const LocationEl = (React.createElement("div", { className: "form-location weda-ui_form-location", "data-testid": "form-location" },
295
+ React.createElement("div", { className: `form-location-warp ${styles.locationDisabled}`, style: { display: layout === 'vertical' ? 'block' : 'flex' } },
296
+ labelVisible && (React.createElement("div", { className: "form-location-label" },
297
+ React.createElement("label", null, label),
298
+ requiredFlag && React.createElement("span", null, "*"))),
299
+ React.createElement("div", { className: classNames({
300
+ 'form-location-con': true,
301
+ [styles.locationContent]: true,
302
+ 'form-location-con_vertical': layout === 'vertical',
303
+ }) },
304
+ React.createElement("img", { src: "https://qcloudimg.tencent-cloud.cn/raw/6542e1ce1dd36a90085b2eb979801df9.png", alt: "" }),
305
+ React.createElement("span", { className: classNames({ 'form-location-con_disabled': disabled }), onClick: handleChooseLocation }, "\u9009\u62E9\u5730\u7406\u4F4D\u7F6E"))),
306
+ getIsShowAddr() && (React.createElement("div", { className: classNames({
307
+ 'form-location-addr': true,
308
+ 'form-location-addr-vertical': layout === 'vertical',
309
+ }) },
310
+ React.createElement("img", { src: "https://qcloudimg.tencent-cloud.cn/raw/f9729e0b091f394110a6e12d3f4e7290.png", alt: "" }),
311
+ React.createElement("div", null,
312
+ location.poiname && (React.createElement("div", { className: "form-location-addr-title" }, location.poiname)),
313
+ showLngLat && (React.createElement("div", { className: "form-location-addr-lat" }, location.latlng
314
+ ? `${location.latlng.lat}N,${location.latlng.lng}E`
315
+ : ''))))),
316
+ getIsShowMap() && (React.createElement("div", { className: "form-map-container", style: { height: '200px' } },
317
+ React.createElement(MapView, { APIKEY: APIKEY, drag: drag, zoom: zoom, latlng: location.latlng }))),
318
+ React.createElement(SelectModal, { isSelectMapVisible: isSelectMapVisible, setIsSelectMapVisible: setIsSelectMapVisible, location: location, currentLocations: currentLocations.current, setLocation: setLocation, chooseLocation: onChangeLocation, APIKEY: APIKEY, locationRange: locationRange, customRange: customRange })));
319
+ return renderDecorator(LocationEl, decorator)({
320
+ id,
321
+ className: cls,
322
+ style,
323
+ multiCell: false,
324
+ requiredFlag,
325
+ });
326
+ }
327
+ LocationH5.propTypes = propTypes;
328
+ LocationH5.defaultProps = defaultProps;
@@ -0,0 +1,12 @@
1
+ export default Header;
2
+ declare function Header({ onClick, isEdit, info, disabled, showLngLat, locationType, dataSourceStatus, apiKeyStatus, currentLocStatus, }: {
3
+ onClick: any;
4
+ isEdit: any;
5
+ info: any;
6
+ disabled: any;
7
+ showLngLat: any;
8
+ locationType: any;
9
+ dataSourceStatus: any;
10
+ apiKeyStatus: any;
11
+ currentLocStatus: any;
12
+ }): JSX.Element;
@@ -0,0 +1,43 @@
1
+ import * as React from 'react';
2
+ import { Button } from 'tea-component';
3
+ import classNames from '../../../../../utils/classnames';
4
+ const Header = ({ onClick, isEdit, info, disabled, showLngLat, locationType, dataSourceStatus, apiKeyStatus, currentLocStatus, }) => {
5
+ const { poiname, latlng } = info || {};
6
+ const buttonType = isEdit ? 'weak' : 'primary';
7
+ const buttonText = isEdit ? '重新定位' : '选择地理位置';
8
+ const getIsShowAddr = () => {
9
+ let status = true;
10
+ // 默认显示位置 无
11
+ if (locationType === 1 && info.locationType === 1) {
12
+ status = false;
13
+ }
14
+ else if (locationType === 2 && !dataSourceStatus) {
15
+ status = false;
16
+ }
17
+ else if (locationType === 2 && !apiKeyStatus.status) {
18
+ status = false;
19
+ }
20
+ else if (!currentLocStatus) {
21
+ status = false;
22
+ }
23
+ return status;
24
+ };
25
+ return (React.createElement("div", { className: classNames({
26
+ 'wedatea2td-justify-grid _weda-fn-map__local': true,
27
+ 'weda-fn-map__local_loc': true,
28
+ 'weda-fn-map__local_edit': isEdit,
29
+ }) },
30
+ isEdit ? (React.createElement(React.Fragment, null,
31
+ React.createElement("div", { className: "wedatea2td-justify-grid__col wedatea2td-justify-grid__col--right weda-fn-map__local_loc_btn" },
32
+ React.createElement(Button, { type: buttonType, onClick: onClick, disabled: disabled }, buttonText)))) : (React.createElement("div", { className: "wedatea2td-justify-grid__col wedatea2td-justify-grid__col--left weda-fn-map__local_loc_btn_left" },
33
+ React.createElement(Button, { type: buttonType, onClick: onClick, disabled: disabled }, buttonText))),
34
+ getIsShowAddr() && (React.createElement("div", { className: classNames('wedatea2td-justify-grid__col', 'wedatea2td-justify-grid__col--left', 'weda-fn-map__local_wrap') },
35
+ React.createElement("i", { className: "wedatea2td-icon _weda-fn-icon-local weda-fn-map__local_wrap_icon" }),
36
+ React.createElement("div", { className: "weda-fn-map__local_wrap_addr" },
37
+ poiname && (React.createElement("span", { className: classNames('wedatea2td-fz-reset', 'form-location-map-pc-address') }, poiname)),
38
+ showLngLat ? (React.createElement("div", { className: classNames({
39
+ 'form-location-addr-lat': true,
40
+ 'form-location-map-pc-latlng': true,
41
+ }) }, latlng.lat ? `${latlng.lat}N,${latlng.lng}E` : '')) : null)))));
42
+ };
43
+ export default Header;
@@ -0,0 +1,8 @@
1
+ declare function LocationPC(props: any): JSX.Element;
2
+ declare namespace LocationPC {
3
+ export { propTypes };
4
+ export { defaultProps };
5
+ }
6
+ export default LocationPC;
7
+ import { propTypes } from "../../common/propsConfig";
8
+ import { defaultProps } from "../../common/propsConfig";
@@ -0,0 +1,228 @@
1
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+ // @ts-nocheck
3
+ import * as React from 'react';
4
+ import { ConfigProvider } from 'tea-component';
5
+ import classNames from '../../../../../utils/classnames';
6
+ import weui from '../../../../../utils/weui';
7
+ import { renderDecorator } from '../../../renderDecorator';
8
+ import MapView from '../../common/mapView';
9
+ import SelectModal from '../../common/selectModal';
10
+ import useLocationInfo from '../../common/useLocationInfo';
11
+ import { propTypes, defaultProps } from '../../common/propsConfig';
12
+ import { callDataSource } from '../../../../../utils/tcb';
13
+ import Header from './Header';
14
+ import './index.css';
15
+ const { useState, useEffect } = React;
16
+ export default function LocationPC(props) {
17
+ // 属性、变量
18
+ const {
19
+ // 系统属性
20
+ id, className, style, events,
21
+ // 组件属性
22
+ value, label, labelVisible, locationType, showLngLat, showMap, drag, zoom, disabled, requiredFlag, decorator, dataSource, layout, locationRange, customRange, } = props;
23
+ const cls = classNames({
24
+ 'weda-ui': true,
25
+ cloudbase_standard: true,
26
+ [className]: className,
27
+ });
28
+ const [isSelectMapVisible, setIsSelectMapVisible] = useState(false);
29
+ const [dataSourceStatus, setDataSourceStatus] = useState({
30
+ status: false,
31
+ message: '定位功能初始化中,请稍后重试',
32
+ });
33
+ const [userSelectStatus, setUserSelectStatus] = useState('default');
34
+ const [APIKEY, setAPIKEY] = useState('');
35
+ const eventsChange = (value, noaddr) => {
36
+ const { poiname, detailedAddress, latitude, longitude } = value;
37
+ let res = {
38
+ address: poiname,
39
+ detailedAddress,
40
+ geopoint: {
41
+ coordinates: [longitude, latitude],
42
+ type: 'Point',
43
+ },
44
+ };
45
+ events.change &&
46
+ events.change({
47
+ value: noaddr ? {} : res,
48
+ });
49
+ };
50
+ const { location, setLocation, apiKeyStatus, setApiKeyStatus, currentLocStatus, currentLocations, customLocation, checkCustomLocation, } = useLocationInfo({
51
+ apiKey: APIKEY,
52
+ locationType,
53
+ dataSourceStatus,
54
+ eventsChange,
55
+ });
56
+ useEffect(() => {
57
+ if (checkCustomLocation(value)) {
58
+ // 表单为新增时回传点位信息
59
+ const { address, detailedAddress, geopoint } = value;
60
+ const coordinates = (geopoint === null || geopoint === void 0 ? void 0 : geopoint.coordinates) || [];
61
+ let loc = {
62
+ poiname: address,
63
+ detailedAddress: detailedAddress,
64
+ latlng: { lng: coordinates[0], lat: coordinates[1] },
65
+ };
66
+ customLocation.current = value;
67
+ setLocation(loc);
68
+ }
69
+ // eslint-disable-next-line react-hooks/exhaustive-deps
70
+ }, [value]);
71
+ useEffect(() => {
72
+ if (value || !currentLocations.current)
73
+ return;
74
+ setUserSelectStatus('default');
75
+ // 重置表单时
76
+ const { poiname, detailedAddress, latlng: { lat, lng }, } = currentLocations.current;
77
+ let location = {
78
+ poiname,
79
+ detailedAddress,
80
+ latlng: { lat, lng },
81
+ };
82
+ if (locationType === 1) {
83
+ location.locationType = 1;
84
+ eventsChange({}, true);
85
+ }
86
+ else if (locationType === 2) {
87
+ eventsChange({
88
+ latitude: lat,
89
+ longitude: lng,
90
+ poiname,
91
+ detailedAddress,
92
+ });
93
+ }
94
+ setLocation(location);
95
+ // eslint-disable-next-line react-hooks/exhaustive-deps
96
+ }, [value, locationType]);
97
+ const showToast = (message) => {
98
+ weui.toast(message, {
99
+ duration: 2000,
100
+ className: 'weui-form-location_toast',
101
+ });
102
+ };
103
+ const handleChooseLocation = () => {
104
+ if (disabled)
105
+ return;
106
+ if (!dataSourceStatus.status)
107
+ return showToast(dataSourceStatus.message);
108
+ if (!apiKeyStatus.status)
109
+ return showToast(apiKeyStatus.message);
110
+ if (!currentLocStatus)
111
+ return showToast('获取位置信息中,请稍后重试');
112
+ setIsSelectMapVisible(true);
113
+ };
114
+ const onChangeLocation = (value) => {
115
+ const { poiname, latlng, detailedAddress } = value;
116
+ events.change &&
117
+ events.change({
118
+ value: {
119
+ address: poiname,
120
+ detailedAddress,
121
+ geopoint: {
122
+ coordinates: [latlng.lng, latlng.lat],
123
+ type: 'Point',
124
+ },
125
+ },
126
+ });
127
+ setUserSelectStatus('selected');
128
+ };
129
+ useEffect(() => {
130
+ // 调用连接器数据源方法
131
+ if (dataSource.name) {
132
+ callDataSource({
133
+ dataSourceName: dataSource.name,
134
+ methodName: 'getApiKey',
135
+ })
136
+ .then((res) => {
137
+ if (res.apiKey) {
138
+ setAPIKEY(res.apiKey);
139
+ setDataSourceStatus({
140
+ status: true,
141
+ message: '',
142
+ });
143
+ setApiKeyStatus({ status: true, message: '' });
144
+ }
145
+ })
146
+ .catch((error) => {
147
+ console.error('datasources error', error);
148
+ setDataSourceStatus({
149
+ status: false,
150
+ message: error,
151
+ });
152
+ });
153
+ }
154
+ else {
155
+ setDataSourceStatus({
156
+ status: false,
157
+ message: '请配置地图连接器',
158
+ });
159
+ showToast('请配置地图连接器');
160
+ }
161
+ // eslint-disable-next-line react-hooks/exhaustive-deps
162
+ }, [dataSource]);
163
+ useEffect(() => {
164
+ let loc = {
165
+ latlng: {
166
+ lat: 39.98410411,
167
+ lng: 116.307503,
168
+ },
169
+ poiname: '',
170
+ detailedAddress: '',
171
+ locationType,
172
+ };
173
+ switch (locationType) {
174
+ case 2:
175
+ loc = {
176
+ latlng: {
177
+ lat: location.latlng.lat,
178
+ lng: location.latlng.lng,
179
+ },
180
+ poiname: location.poiname,
181
+ detailedAddress: location.detailedAddress,
182
+ };
183
+ break;
184
+ }
185
+ setLocation(loc);
186
+ // 暂不支持自定位置,初始化表单值都是{}
187
+ eventsChange({
188
+ latitude: loc.latlng.lat,
189
+ longitude: loc.latlng.lng,
190
+ poiname: loc.poiname,
191
+ detailedAddress: loc.detailedAddress,
192
+ }, true);
193
+ // eslint-disable-next-line react-hooks/exhaustive-deps
194
+ }, [locationType]);
195
+ const getIsShowMap = () => {
196
+ let status = showMap;
197
+ if (locationType === 1 && location.locationType === 1) {
198
+ status = false;
199
+ }
200
+ else if (locationType === 2 && !dataSourceStatus.status) {
201
+ status = false;
202
+ }
203
+ else if (locationType === 2 && !apiKeyStatus.status) {
204
+ status = false;
205
+ }
206
+ else if (!currentLocStatus) {
207
+ status = false;
208
+ }
209
+ return status;
210
+ };
211
+ const LocationEl = (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
212
+ React.createElement("div", { className: classNames('_weda-fn-map', className), "data-testid": "_weda-fn-map", style: style },
213
+ React.createElement(Header, { isEdit: userSelectStatus === 'selected', info: location, onClick: handleChooseLocation, disabled: disabled, showLngLat: showLngLat, locationType: locationType, apiKeyStatus: apiKeyStatus, currentLocStatus: currentLocStatus, dataSourceStatus: dataSourceStatus.status }),
214
+ getIsShowMap() ? (React.createElement("div", { className: classNames('form-location-map-pc') },
215
+ React.createElement(MapView, { APIKEY: APIKEY, drag: drag, zoom: zoom, latlng: location.latlng }))) : null),
216
+ React.createElement(SelectModal, { currentLocations: currentLocations.current, isSelectMapVisible: isSelectMapVisible, setIsSelectMapVisible: setIsSelectMapVisible, location: location, setLocation: setLocation, APIKEY: APIKEY, chooseLocation: onChangeLocation, locationRange: locationRange, customRange: customRange })));
217
+ return renderDecorator(LocationEl, decorator)({
218
+ id,
219
+ className: cls,
220
+ style,
221
+ label: labelVisible ? label : null,
222
+ layout,
223
+ multiCell: false,
224
+ requiredFlag,
225
+ });
226
+ }
227
+ LocationPC.propTypes = propTypes;
228
+ LocationPC.defaultProps = defaultProps;
@@ -0,0 +1,2 @@
1
+ export const KEY: "XX5BZ-UJLKR-B7WWP-WURRR-UYBGS-4VBMM";
2
+ export const tmapApiUrl: "https://map.qq.com/api/gljs";
@@ -0,0 +1,3 @@
1
+ const KEY = 'XX5BZ-UJLKR-B7WWP-WURRR-UYBGS-4VBMM';
2
+ const tmapApiUrl = 'https://map.qq.com/api/gljs';
3
+ export { KEY, tmapApiUrl };
@@ -0,0 +1 @@
1
+ export default function Location(props: any): JSX.Element;
@@ -0,0 +1,24 @@
1
+ import * as React from 'react';
2
+ import { ConfigProvider } from 'tea-component';
3
+ import './index.css';
4
+ import { usePlatform } from '../../../utils/platform';
5
+ import LocationH5 from './components/LocationH5/location.h5';
6
+ import LocationPC from './components/LocationPC/location.PC';
7
+ import { CommonErrorBoundary } from '../../common/error-boundary';
8
+ import { useLoopRenderDetect } from '../../common/use-loop-render-detect';
9
+ export default function Location(props) {
10
+ return (React.createElement(CommonErrorBoundary, null,
11
+ React.createElement(LocationImpl, { ...props })));
12
+ }
13
+ function LocationImpl(props) {
14
+ const platform = usePlatform();
15
+ useLoopRenderDetect();
16
+ if ((props === null || props === void 0 ? void 0 : props.showType) === 'pc') {
17
+ return React.createElement(LocationPC, { ...props });
18
+ }
19
+ if ((props === null || props === void 0 ? void 0 : props.showType) === 'h5') {
20
+ return React.createElement(LocationH5, { ...props });
21
+ }
22
+ return platform === 'h5' ? (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
23
+ React.createElement(LocationH5, { ...props }))) : (React.createElement(LocationPC, { ...props }));
24
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import './index.css';
3
+ import type { CommonFormPropsType } from '../types';
4
+ export default function Radio({ id, className, style, events, label, labelVisible, format, enumName, name, range, layout, disabled, requiredFlag, decorator, }: PropsType): JSX.Element;
5
+ export interface PropsType extends CommonFormPropsType {
6
+ range?: Readonly<({
7
+ label: string;
8
+ } & Record<string, any>)[]>;
9
+ format?: string;
10
+ enumName?: string;
11
+ }