@cloudbase/weda-ui 2.0.10 → 2.0.26

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 (297) hide show
  1. package/README.md +1 -0
  2. package/package.json +47 -36
  3. package/src/configs/components/button.json +60 -13
  4. package/src/configs/components/calendar.json +3 -3
  5. package/src/configs/components/carousel.json +57 -47
  6. package/src/configs/components/chart/bar.json +4 -13
  7. package/src/configs/components/chart/line.json +4 -13
  8. package/src/configs/components/chart/pie.json +3 -10
  9. package/src/configs/components/chart/statisticsCard.json +1 -4
  10. package/src/configs/components/container.json +1 -3
  11. package/src/configs/components/dataView.json +7 -15
  12. package/src/configs/components/drawer.json +24 -6
  13. package/src/configs/components/form/form.json +19 -0
  14. package/src/configs/components/form/input.json +20 -5
  15. package/src/configs/components/form/location.json +51 -48
  16. package/src/configs/components/form/radio.json +1 -3
  17. package/src/configs/components/form/richText.json +14 -14
  18. package/src/configs/components/form/select.json +62 -82
  19. package/src/configs/components/form/textarea.json +14 -1
  20. package/src/configs/components/form/uploader.json +64 -64
  21. package/src/configs/components/form/uploaderFile.json +1 -2
  22. package/src/configs/components/graphicCard.json +44 -45
  23. package/src/configs/components/image.json +44 -40
  24. package/src/configs/components/link.json +5 -10
  25. package/src/configs/components/listView.json +2 -8
  26. package/src/configs/components/lottery.json +7 -3
  27. package/src/configs/components/modal.json +26 -21
  28. package/src/configs/components/navLayout.json +68 -68
  29. package/src/configs/components/navigationBar.json +4 -1
  30. package/src/configs/components/richtextview.json +1 -1
  31. package/src/configs/components/scrollVeiw.json +14 -42
  32. package/src/configs/components/swiper.json +9 -9
  33. package/src/configs/components/wedaVideo.json +89 -0
  34. package/src/configs/components/wxOpenApi/phone.json +7 -21
  35. package/src/configs/components/wxOpenApi/phoneCode.json +7 -19
  36. package/src/configs/components/wxOpenApi/share.json +14 -24
  37. package/src/configs/components/wxOpenApi/userInfo.json +9 -27
  38. package/src/configs/index.js +2 -0
  39. package/src/mp/components/button/index.js +1 -1
  40. package/src/mp/components/button/index.wxml +19 -19
  41. package/src/mp/components/calendar/index.js +68 -38
  42. package/src/mp/components/calendar/index.json +3 -2
  43. package/src/mp/components/calendar/index.wxml +5 -7
  44. package/src/mp/components/calendar/index.wxss +17 -16
  45. package/src/mp/components/carousel/index.json +1 -1
  46. package/src/mp/components/carousel/index.wxml +2 -2
  47. package/src/mp/components/chart/bar/index.js +1 -2
  48. package/src/mp/components/chart/bar/index.wxml +1 -1
  49. package/src/mp/components/chart/common/config/bar.js +1 -1
  50. package/src/mp/components/chart/common/core/eChartBar.js +29 -34
  51. package/src/mp/components/chart/common/core/eChartBase.js +46 -32
  52. package/src/mp/components/chart/common/core/eChartLine.js +34 -40
  53. package/src/mp/components/chart/common/core/eChartPie.js +12 -9
  54. package/src/mp/components/chart/ec-canvas/ec-canvas.json +1 -1
  55. package/src/mp/components/chart/ec-canvas/wx-canvas.js +24 -22
  56. package/src/mp/components/chart/line/index.js +2 -2
  57. package/src/mp/components/chart/line/index.wxml +1 -1
  58. package/src/mp/components/chart/pie/index.js +1 -1
  59. package/src/mp/components/chart/pie/index.wxml +1 -2
  60. package/src/mp/components/chart/statisticsCard/index.wxss +7 -10
  61. package/src/mp/components/dataView/index.wxml +2 -14
  62. package/src/mp/components/form/checkbox/index.js +15 -7
  63. package/src/mp/components/form/checkbox/index.wxml +13 -25
  64. package/src/mp/components/form/form/index.wxml +3 -3
  65. package/src/mp/components/form/formcell/index.wxml +9 -9
  66. package/src/mp/components/form/formcell/index.wxss +6 -1
  67. package/src/mp/components/form/input/index.js +4 -4
  68. package/src/mp/components/form/input/index.wxml +24 -31
  69. package/src/mp/components/form/input/index.wxss +9 -3
  70. package/src/mp/components/form/location/components/mapChoose/index.json +1 -1
  71. package/src/mp/components/form/location/components/mapChoose/index.wxml +6 -6
  72. package/src/mp/components/form/location/index.js +7 -1
  73. package/src/mp/components/form/location/index.json +1 -1
  74. package/src/mp/components/form/location/index.wxml +6 -10
  75. package/src/mp/components/form/radio/index.js +14 -6
  76. package/src/mp/components/form/radio/index.wxml +12 -24
  77. package/src/mp/components/form/select/index.js +157 -98
  78. package/src/mp/components/form/select/index.wxml +11 -39
  79. package/src/mp/components/form/select/index.wxss +10 -1
  80. package/src/mp/components/form/select/region/index.js +18 -12
  81. package/src/mp/components/form/switch/index.wxml +11 -18
  82. package/src/mp/components/form/textarea/index.js +6 -0
  83. package/src/mp/components/form/textarea/index.wxml +2 -17
  84. package/src/mp/components/form/textarea/index.wxss +5 -0
  85. package/src/mp/components/form/tips/index.wxml +1 -3
  86. package/src/mp/components/form/uploader/index.js +1 -1
  87. package/src/mp/components/form/uploader/index.wxml +3 -20
  88. package/src/mp/components/form/uploader/weui-uploader.js +210 -200
  89. package/src/mp/components/form/uploader/weui-uploader.json +6 -6
  90. package/src/mp/components/form/uploader/weui-uploader.wxml +38 -38
  91. package/src/mp/components/form/uploaderFile/index.js +5 -4
  92. package/src/mp/components/form/uploaderFile/index.wxml +40 -41
  93. package/src/mp/components/graphicCard/index.js +35 -35
  94. package/src/mp/components/graphicCard/index.wxml +2 -6
  95. package/src/mp/components/graphicCard/index.wxss +6 -6
  96. package/src/mp/components/image/index.wxml +9 -20
  97. package/src/mp/components/image/index.wxss +3 -1
  98. package/src/mp/components/listView/index.wxml +5 -7
  99. package/src/mp/components/listView/index.wxss +2 -2
  100. package/src/mp/components/lottery/index.wxml +1 -3
  101. package/src/mp/components/lottery/index.wxss +31 -25
  102. package/src/mp/components/navLayout/index.js +9 -12
  103. package/src/mp/components/navLayout/index.wxml +2 -4
  104. package/src/mp/components/navLayout/index.wxss +10 -10
  105. package/src/mp/components/navigationBar/index.json +1 -2
  106. package/src/mp/components/navigationBar/index.wxml +43 -51
  107. package/src/mp/components/navigationBar/index.wxss +10 -10
  108. package/src/mp/components/richText/index.wxml +1 -1
  109. package/src/mp/components/richText/index.wxss +7 -5
  110. package/src/mp/components/swiper/index.wxml +1 -9
  111. package/src/mp/components/tabs/index.js +14 -10
  112. package/src/mp/components/tabs/index.json +1 -1
  113. package/src/mp/components/tabs/index.wxml +3 -21
  114. package/src/mp/components/tabs/index.wxss +1 -2
  115. package/src/mp/components/text/index.wxml +1 -6
  116. package/src/mp/components/text/index.wxss +1 -1
  117. package/src/mp/components/wedaVideo/index.js +86 -0
  118. package/src/mp/components/wedaVideo/index.json +4 -0
  119. package/src/mp/components/wedaVideo/index.wxml +4 -0
  120. package/src/mp/components/wedaVideo/index.wxss +20 -0
  121. package/src/mp/components/wxOpenApi/phone/index.js +1 -9
  122. package/src/mp/components/wxOpenApi/phone/index.wxml +3 -14
  123. package/src/mp/components/wxOpenApi/phoneCode/index.json +1 -1
  124. package/src/mp/components/wxOpenApi/phoneCode/index.wxml +3 -14
  125. package/src/mp/components/wxOpenApi/share/index.wxml +3 -14
  126. package/src/mp/components/wxOpenApi/userInfo/index.wxml +3 -13
  127. package/src/mp/index.json +1 -0
  128. package/src/mp/style/weda-ui.wxss +24 -9
  129. package/src/mp/utils/deepEqual.js +37 -37
  130. package/src/mp/utils/destr.js +41 -40
  131. package/src/mp/utils/dr_square_point.js +10 -6
  132. package/src/setupTests.js +13 -13
  133. package/src/web/actions/showModal/index.tsx +5 -4
  134. package/src/web/components/button/index.tsx +44 -40
  135. package/src/web/components/calendar/index.css +99 -65
  136. package/src/web/components/carousel/index.tsx +1 -1
  137. package/src/web/components/chart/common/config/bar.js +1 -1
  138. package/src/web/components/chart/common/core/eChartBar.js +28 -34
  139. package/src/web/components/chart/common/core/eChartBase.ts +55 -42
  140. package/src/web/components/chart/common/core/eChartLine.js +34 -40
  141. package/src/web/components/chart/common/core/eChartPie.js +12 -9
  142. package/src/web/components/chart/common/core/type.ts +23 -23
  143. package/src/web/components/chart/common/echart.css +12 -12
  144. package/src/web/components/chart/common/echarts.ts +3 -5
  145. package/src/web/components/chart/common/useChart.tsx +34 -16
  146. package/src/web/components/chart/statisticsCard/index.css +9 -8
  147. package/src/web/components/container/index.tsx +3 -4
  148. package/src/web/components/drawer/index.tsx +15 -4
  149. package/src/web/components/form/checkbox/index.tsx +32 -31
  150. package/src/web/components/form/enumSelect/NormalSelect.tsx +0 -2
  151. package/src/web/components/form/form/index.css +3 -6
  152. package/src/web/components/form/form/index.tsx +7 -6
  153. package/src/web/components/form/formcell/index.css +11 -18
  154. package/src/web/components/form/formcell/index.tsx +3 -7
  155. package/src/web/components/form/input/index.css +8 -4
  156. package/src/web/components/form/input/index.tsx +61 -53
  157. package/src/web/components/form/location/common/mapChoose.css +13 -11
  158. package/src/web/components/form/location/common/selectModal.jsx +2 -11
  159. package/src/web/components/form/location/common/useLocationInfo.js +4 -0
  160. package/src/web/components/form/location/components/LocationH5/index.css +19 -20
  161. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +11 -1
  162. package/src/web/components/form/location/components/LocationPC/Header.jsx +0 -13
  163. package/src/web/components/form/location/components/LocationPC/location.PC.jsx +14 -5
  164. package/src/web/components/form/radio/index.tsx +32 -26
  165. package/src/web/components/form/renderDecorator.tsx +23 -26
  166. package/src/web/components/form/select/h5.tsx +155 -104
  167. package/src/web/components/form/select/index.css +9 -3
  168. package/src/web/components/form/select/index.tsx +76 -49
  169. package/src/web/components/form/select/region/index.ts +101 -80
  170. package/src/web/components/form/select/year.tsx +2 -0
  171. package/src/web/components/form/switch/index.tsx +40 -40
  172. package/src/web/components/form/textarea/index.css +4 -0
  173. package/src/web/components/form/textarea/index.tsx +39 -26
  174. package/src/web/components/form/types.d.ts +10 -10
  175. package/src/web/components/form/uploader/index.css +10 -0
  176. package/src/web/components/form/uploader/uploader.h5.tsx +29 -26
  177. package/src/web/components/form/uploader/uploader.pc.tsx +3 -6
  178. package/src/web/components/form/uploaderFile/index.css +24 -23
  179. package/src/web/components/form/uploaderFile/index.jsx +0 -5
  180. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +24 -15
  181. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +21 -13
  182. package/src/web/components/graphicCard/index.css +6 -6
  183. package/src/web/components/image/image.tsx +2 -2
  184. package/src/web/components/image/index.css +9 -7
  185. package/src/web/components/image/index.tsx +29 -12
  186. package/src/web/components/index.js +1 -0
  187. package/src/web/components/link/index.tsx +13 -13
  188. package/src/web/components/listView/index.css +8 -8
  189. package/src/web/components/lottery/index.css +43 -37
  190. package/src/web/components/lottery/index.tsx +3 -3
  191. package/src/web/components/modal/index.tsx +34 -34
  192. package/src/web/components/navLayout/index.css +25 -25
  193. package/src/web/components/navLayout/index.tsx +1 -1
  194. package/src/web/components/navigationBar/index.css +26 -26
  195. package/src/web/components/navigationBar/index.tsx +2 -2
  196. package/src/web/components/picker/datePicker.tsx +3 -3
  197. package/src/web/components/picker/picker.tsx +3 -3
  198. package/src/web/components/picker/timePicker.tsx +1 -1
  199. package/src/web/components/richText/index.jsx +41 -46
  200. package/src/web/components/richTextView/index.css +7 -3
  201. package/src/web/components/richTextView/index.tsx +4 -6
  202. package/src/web/components/scrollView/index.tsx +2 -2
  203. package/src/web/components/slot/index.tsx +3 -4
  204. package/src/web/components/swiper/index.css +1 -1
  205. package/src/web/components/swiper/index.tsx +33 -15
  206. package/src/web/components/tabs/index.css +2 -3
  207. package/src/web/components/tabs/index.tsx +6 -6
  208. package/src/web/components/tabs/tabs.h5.tsx +17 -12
  209. package/src/web/components/tabs/tabs.pc.tsx +45 -34
  210. package/src/web/components/text/index.css +1 -1
  211. package/src/web/components/text/index.tsx +13 -14
  212. package/src/web/components/wedaVideo/index.css +42 -0
  213. package/src/web/components/wedaVideo/index.tsx +208 -0
  214. package/src/web/utils/constant.ts +2 -1
  215. package/src/web/utils/isObjectEqual.js +2 -1
  216. package/src/web/utils/loading-fallback.tsx +2 -2
  217. package/src/web/utils/lodash.ts +1 -1
  218. package/src/web/utils/platform.js +13 -0
  219. package/src/web/utils/useSetState.ts +6 -2
  220. package/src/web/weda-ui.css +23 -8
  221. package/src/docs/common/format.tsx +0 -112
  222. package/src/docs/common/tableView.css +0 -164
  223. package/src/docs/common/tableView.tsx +0 -273
  224. package/src/docs/compsdocs/chart/Bar.mdx +0 -159
  225. package/src/docs/compsdocs/chart/Line.mdx +0 -100
  226. package/src/docs/compsdocs/chart/Pie.mdx +0 -83
  227. package/src/docs/compsdocs/chart/_category_.json +0 -1
  228. package/src/docs/compsdocs/chart/statisticsCard.mdx +0 -51
  229. package/src/docs/compsdocs/database/DataView.mdx +0 -33
  230. package/src/docs/compsdocs/database/ListView.mdx +0 -33
  231. package/src/docs/compsdocs/database/_category_.json +0 -1
  232. package/src/docs/compsdocs/form/Form.mdx +0 -35
  233. package/src/docs/compsdocs/form/FormCheckbox.mdx +0 -35
  234. package/src/docs/compsdocs/form/FormDate.mdx +0 -30
  235. package/src/docs/compsdocs/form/FormEmail.mdx +0 -30
  236. package/src/docs/compsdocs/form/FormImageUploader.mdx +0 -31
  237. package/src/docs/compsdocs/form/FormInput.mdx +0 -30
  238. package/src/docs/compsdocs/form/FormLocation.mdx +0 -64
  239. package/src/docs/compsdocs/form/FormPhone.mdx +0 -30
  240. package/src/docs/compsdocs/form/FormRadio.mdx +0 -35
  241. package/src/docs/compsdocs/form/FormRegion.mdx +0 -30
  242. package/src/docs/compsdocs/form/FormSelect.mdx +0 -36
  243. package/src/docs/compsdocs/form/FormSwitch.mdx +0 -30
  244. package/src/docs/compsdocs/form/FormTextarea.mdx +0 -30
  245. package/src/docs/compsdocs/form/FormTime.mdx +0 -30
  246. package/src/docs/compsdocs/form/FormUploadFile.mdx +0 -30
  247. package/src/docs/compsdocs/form/FormUrl.mdx +0 -30
  248. package/src/docs/compsdocs/form/_category_.json +0 -1
  249. package/src/docs/compsdocs/grid/Card.mdx +0 -32
  250. package/src/docs/compsdocs/grid/Container.mdx +0 -42
  251. package/src/docs/compsdocs/grid/Footer.mdx +0 -31
  252. package/src/docs/compsdocs/grid/GridLayout.mdx +0 -32
  253. package/src/docs/compsdocs/grid/Header.mdx +0 -31
  254. package/src/docs/compsdocs/grid/Layout.mdx +0 -25
  255. package/src/docs/compsdocs/grid/List.mdx +0 -31
  256. package/src/docs/compsdocs/grid/ScrollView.mdx +0 -37
  257. package/src/docs/compsdocs/grid/Swiper.mdx +0 -58
  258. package/src/docs/compsdocs/grid/_category_.json +0 -1
  259. package/src/docs/compsdocs/media/Icon.mdx +0 -31
  260. package/src/docs/compsdocs/media/Image.mdx +0 -55
  261. package/src/docs/compsdocs/media/_category_.json +0 -1
  262. package/src/docs/compsdocs/model/ModelCreate.mdx +0 -20
  263. package/src/docs/compsdocs/model/ModelDetail.mdx +0 -20
  264. package/src/docs/compsdocs/model/ModelTable.mdx +0 -24
  265. package/src/docs/compsdocs/model/ModelUpdate.mdx +0 -21
  266. package/src/docs/compsdocs/model/PageLayout.mdx +0 -21
  267. package/src/docs/compsdocs/model/_category_.json +0 -1
  268. package/src/docs/compsdocs/navmenu/Classification.mdx +0 -38
  269. package/src/docs/compsdocs/navmenu/NavBar.mdx +0 -43
  270. package/src/docs/compsdocs/navmenu/NavLayout.mdx +0 -30
  271. package/src/docs/compsdocs/navmenu/TabBar.mdx +0 -43
  272. package/src/docs/compsdocs/navmenu/TabBarItem.mdx +0 -29
  273. package/src/docs/compsdocs/navmenu/_category_.json +0 -1
  274. package/src/docs/compsdocs/senior/Lottery.mdx +0 -48
  275. package/src/docs/compsdocs/senior/Modal.mdx +0 -58
  276. package/src/docs/compsdocs/senior/SlotMachine.mdx +0 -52
  277. package/src/docs/compsdocs/senior/_category_.json +0 -1
  278. package/src/docs/compsdocs/show/Calendar.mdx +0 -29
  279. package/src/docs/compsdocs/show/Divider.mdx +0 -31
  280. package/src/docs/compsdocs/show/GraphicCard.mdx +0 -30
  281. package/src/docs/compsdocs/show/Item.mdx +0 -32
  282. package/src/docs/compsdocs/show/ItemList.mdx +0 -47
  283. package/src/docs/compsdocs/show/Media.mdx +0 -25
  284. package/src/docs/compsdocs/show/StatusTip.mdx +0 -25
  285. package/src/docs/compsdocs/show/Swiper.mdx +0 -33
  286. package/src/docs/compsdocs/show/Tabs.mdx +0 -38
  287. package/src/docs/compsdocs/show/_category_.json +0 -1
  288. package/src/docs/compsdocs/show/button.mdx +0 -25
  289. package/src/docs/compsdocs/text/Link.mdx +0 -43
  290. package/src/docs/compsdocs/text/RichTextView.mdx +0 -36
  291. package/src/docs/compsdocs/text/Text.mdx +0 -31
  292. package/src/docs/compsdocs/text/Title.mdx +0 -32
  293. package/src/docs/compsdocs/text/_category_.json +0 -1
  294. package/src/docs/compsdocs/wxOpen/Phone.mdx +0 -60
  295. package/src/docs/compsdocs/wxOpen/Share.mdx +0 -46
  296. package/src/docs/compsdocs/wxOpen/UserInfo.mdx +0 -60
  297. package/src/docs/compsdocs/wxOpen/_category_.json +0 -4
@@ -6,6 +6,7 @@
6
6
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1);
7
7
  border-radius: 6px;
8
8
  box-sizing: border-box;
9
+ font-size: 14px;
9
10
  }
10
11
  .weda-statistics-card.weda-statistics-card-pc {
11
12
  width: 276px;
@@ -18,8 +19,8 @@
18
19
  }
19
20
 
20
21
  .weda-statistics-card .weda-statistics-card__title {
21
- font-size: 14px;
22
- line-height: 22px;
22
+ font-size: 1em;
23
+ line-height: 1.57142em;
23
24
  color: rgba(0, 0, 0, 0.6);
24
25
  }
25
26
 
@@ -28,15 +29,15 @@
28
29
  }
29
30
 
30
31
  .weda-statistics-card .weda-statistics-card__count {
31
- font-size: 32px;
32
- line-height: 44px;
32
+ font-size: 2.28571em;
33
+ line-height: 3.14285em;
33
34
  color: rgba(0, 0, 0, 0.9);
34
35
  word-break: break-all;
35
36
  }
36
37
 
37
38
  .weda-statistics-card .weda-statistics-card__unit {
38
- font-size: 14px;
39
- line-height: 22px;
39
+ font-size: 1em;
40
+ line-height: 1.57142em;
40
41
  color: rgba(0, 0, 0, 0.4);
41
42
  margin-left: 4px;
42
43
  vertical-align: middle;
@@ -57,6 +58,6 @@
57
58
  }
58
59
 
59
60
  .weda-statistics-card-mobile .weda-statistics-card__count {
60
- font-size: 28px;
61
- line-height: 34px;
61
+ font-size: 2em;
62
+ line-height: 2.42857em;
62
63
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { CommonPropsType } from '../../types';
2
+ import type { CommonPropsType } from '../../types';
3
3
  import classNames from '../../utils/classnames';
4
4
 
5
5
  export default function Container({
@@ -8,7 +8,7 @@ export default function Container({
8
8
  events = {},
9
9
  className,
10
10
  style,
11
- id
11
+ id,
12
12
  }: PropsType) {
13
13
  return (
14
14
  <div
@@ -31,5 +31,4 @@ export default function Container({
31
31
 
32
32
  export interface PropsType extends CommonPropsType {
33
33
  title?: string;
34
-
35
- }
34
+ }
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ConfigProvider, Drawer, DrawerProps } from 'tea-component';
3
- import { CommonPropsType } from '../../types';
3
+ import type { CommonPropsType } from '../../types';
4
4
 
5
5
  const TeaDrawer = ({
6
6
  size,
@@ -38,19 +38,30 @@ const TeaDrawer = ({
38
38
  disableCloseIcon={disableCloseIcon}
39
39
  outerClickClosable={outerClickClosable}
40
40
  {...eventsList}
41
- >
41
+ >
42
42
  {childrenSlot}
43
43
  </Drawer>
44
44
  </ConfigProvider>
45
45
  );
46
46
  };
47
47
 
48
- export interface PropsType extends CommonPropsType, Pick<DrawerProps, 'size'|'title'|'showMask'|'placement'|'disableCloseIcon'|'outerClickClosable'|'subtitle'> {
48
+ export interface PropsType
49
+ extends CommonPropsType,
50
+ Pick<
51
+ DrawerProps,
52
+ | 'size'
53
+ | 'title'
54
+ | 'showMask'
55
+ | 'placement'
56
+ | 'disableCloseIcon'
57
+ | 'outerClickClosable'
58
+ | 'subtitle'
59
+ > {
49
60
  visible: boolean;
50
61
  title?: string;
51
62
  extraSlot?: React.ReactNode;
52
63
  footerSlot?: React.ReactNode;
53
- childrenSlot?: React.ReactNode;
64
+ childrenSlot?: React.ReactNode;
54
65
  }
55
66
 
56
67
  export default TeaDrawer;
@@ -7,7 +7,7 @@ import isObjectEqual from '../../../utils/isObjectEqual';
7
7
  import fromEntries from 'object.fromentries';
8
8
  import { usePlatform } from '../../../utils/platform';
9
9
  import { renderDecorator } from '../renderDecorator';
10
- import { CommonFormPropsType } from '../types';
10
+ import type { CommonFormPropsType } from '../types';
11
11
  import { callWedaApi } from '../../../utils/tcb';
12
12
  import destr from 'destr';
13
13
 
@@ -27,7 +27,7 @@ export default function Checkbox({
27
27
  layout = 'horizontal',
28
28
  disabled = false,
29
29
  requiredFlag = false,
30
- decorator
30
+ decorator,
31
31
  }: PropsType) {
32
32
  const cls = classNames({
33
33
  'weda-ui': true,
@@ -46,7 +46,8 @@ export default function Checkbox({
46
46
 
47
47
  const [option, setOption] = useState(range);
48
48
  const [checkedItems, setCheckedItems] = React.useState(
49
- platform === 'h5' ? fromEntries(option.map(({ value, checked }) => [value, !!checked]))
49
+ platform === 'h5'
50
+ ? fromEntries(option.map(({ value, checked }) => [value, !!checked]))
50
51
  : option.filter(({ checked }) => checked).map(({ value }) => value)
51
52
  );
52
53
  // 两次range不同时, 需要刷新checkedItems
@@ -69,23 +70,25 @@ export default function Checkbox({
69
70
 
70
71
  useEffect(() => {
71
72
  if (format !== 'x-enum') {
72
- setOption(range)
73
+ setOption(range);
73
74
  }
74
75
  }, [range]);
75
76
 
76
- const fetchData = async (param:
77
- { OptNameList?: object, PageIndex?: number, PageSize?: number }
78
- ) => {
77
+ const fetchData = async (param: {
78
+ OptNameList?: object;
79
+ PageIndex?: number;
80
+ PageSize?: number;
81
+ }) => {
79
82
  let data = await callWedaApi({
80
83
  action: 'DescribeGeneralOptionsDetailList',
81
84
  data: param,
82
85
  });
83
86
  const config = destr(data?.Items?.[0]?.Config) ?? [];
84
- const enumOption = config.map(item => {
87
+ const enumOption = config.map((item) => {
85
88
  return {
86
89
  label: item.value,
87
90
  value: item.key,
88
- checked: false
91
+ checked: false,
89
92
  };
90
93
  });
91
94
  setOption(enumOption);
@@ -153,9 +156,8 @@ export default function Checkbox({
153
156
  disabled={disabled}
154
157
  value={Object.entries(checkedItems)
155
158
  .filter(([, checked]) => checked)
156
- .map(([value]) => value)
157
- }
158
- onChange={value => {
159
+ .map(([value]) => value)}
160
+ onChange={(value) => {
159
161
  const newMap = option
160
162
  .map((opt) => opt.value)
161
163
  .reduce((acc, cur) => {
@@ -168,13 +170,11 @@ export default function Checkbox({
168
170
  return acc;
169
171
  }, {});
170
172
  setCheckedItems(newMap);
171
- events.change(
172
- {
173
- value: Object.entries(newMap)
174
- .filter(([, checked]) => checked)
175
- .map(([value]) => value),
176
- },
177
- );
173
+ events.change({
174
+ value: Object.entries(newMap)
175
+ .filter(([, checked]) => checked)
176
+ .map(([value]) => value),
177
+ });
178
178
  }}
179
179
  >
180
180
  {option.map(({ value, label }, index) => {
@@ -189,21 +189,22 @@ export default function Checkbox({
189
189
  </ConfigProvider>
190
190
  );
191
191
  }
192
- return renderDecorator(checkboxElement, decorator)(
193
- {
194
- id,
195
- className: cls,
196
- style,
197
- label: labelVisible ? label : null,
198
- layout,
199
- multiCell: true,
200
- requiredFlag,
201
- }
202
- );
192
+ return renderDecorator(
193
+ checkboxElement,
194
+ decorator
195
+ )({
196
+ id,
197
+ className: cls,
198
+ style,
199
+ label: labelVisible ? label : null,
200
+ layout,
201
+ multiCell: true,
202
+ requiredFlag,
203
+ });
203
204
  }
204
205
 
205
206
  export interface PropsType extends CommonFormPropsType {
206
- range?: { label: string, value: any;[key: string]: any }[];
207
+ range?: { label: string; value: any; [key: string]: any }[];
207
208
  format?: string;
208
209
  enumName?: string;
209
210
  }
@@ -9,8 +9,6 @@ import { useSyncValue } from '../../../utils/useSyncValue';
9
9
 
10
10
  const { useState, useEffect } = React;
11
11
 
12
-
13
-
14
12
  const NormalSelect = ({
15
13
  // 系统属性
16
14
  id,
@@ -2,11 +2,8 @@
2
2
  color: inherit;
3
3
  }
4
4
 
5
- .wedatea2td-form > .gsd-h5-react-formitem,
6
- .wedatea2td-form > div > .gsd-h5-react-formitem {
7
- padding-left: 32px;
8
- }
9
-
10
- .weda-ui.weda-form-pc, .weda-ui.gsd-h5-react-form-pc {
5
+ .weda-ui.weda-form-pc,
6
+ .weda-ui.gsd-h5-react-form-pc {
11
7
  padding-left: 24px;
8
+ padding-right: 24px;
12
9
  }
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import classNames from '../../../utils/classnames';
3
3
  import './index.css';
4
- import {ConfigProvider, Form as TeaForm} from 'tea-component';
4
+ import { ConfigProvider, Form as TeaForm } from 'tea-component';
5
5
  import { usePlatform } from '../../../utils/platform';
6
- import { CommonFormPropsType } from '../types';
6
+ import type { CommonFormPropsType } from '../types';
7
7
 
8
8
  export default function Form({
9
9
  // 系统属性
@@ -16,6 +16,7 @@ export default function Form({
16
16
  // buttonSlot,
17
17
  style,
18
18
  id,
19
+ layout,
19
20
  }) {
20
21
  const platform = usePlatform();
21
22
  const cls = classNames({
@@ -26,14 +27,14 @@ export default function Form({
26
27
  'gsd-h5-react-form-pc': platform === 'pc',
27
28
  [className]: className,
28
29
  });
29
- if(platform === 'pc') {
30
+ if (platform === 'pc') {
30
31
  return (
31
32
  <ConfigProvider classPrefix="wedatea2td">
32
33
  {/** @ts-expect-error tea form id */}
33
- <TeaForm className={cls} style={style} id={id}>
34
+ <TeaForm layout={layout} className={cls} style={style} id={id}>
34
35
  {contentSlot}
35
- </TeaForm>
36
- </ConfigProvider>
36
+ </TeaForm>
37
+ </ConfigProvider>
37
38
  );
38
39
  }
39
40
  return (
@@ -1,22 +1,31 @@
1
1
  .weda-formcells__flag {
2
2
  display: inline-block;
3
- margin-right: 4px;
3
+ margin-left: 4px;
4
4
  font-family: SimSun;
5
5
  font-size: 12px;
6
6
  color: #f60;
7
7
  align-self: flex-start;
8
8
  }
9
9
 
10
+ .weda-formcells__label.weui-cell {
11
+ align-items: flex-start;
12
+ }
13
+
10
14
  .weda-ui .weui-cells__group_form .weui-cells {
11
15
  margin: 0;
12
16
  }
13
17
  .weda-formcells.weui-flex .weda-formcells__label {
14
18
  width: 130px;
19
+ padding-bottom: 16px;
15
20
  }
16
21
  .weui-cells__group_form .weui-cell {
17
22
  padding: 16px 16px;
18
23
  }
19
24
 
25
+ .weda-formcells .weda-formcells__label {
26
+ padding-bottom: 8px;
27
+ }
28
+
20
29
  .weda-formcells__content.weui-flex__item .weui-cell_form {
21
30
  padding: 0;
22
31
  }
@@ -25,7 +34,6 @@
25
34
  padding-right: 16px;
26
35
  }
27
36
 
28
-
29
37
  /* formcell 在 form container 外部兼容 and 独立 layout 适配 */
30
38
 
31
39
  .weda-formcells__pc.vertical .wedatea2td-form__controls,
@@ -35,14 +43,10 @@
35
43
  .weda-formcells__pc.vertical .wedatea2td-form__label {
36
44
  padding-bottom: 0;
37
45
  padding-top: 0;
38
- font-size: 1rem;
39
46
  width: auto;
40
47
  margin-bottom: 10px;
41
48
  }
42
49
 
43
- .weda-formcells__pc.vertical .wedatea2td-form__label label {
44
- color: rgba(0, 0, 0, 0.9);
45
- }
46
50
  .weda-formcells__pc.vertical .wedatea2td-form__help-text {
47
51
  margin-top: 4px;
48
52
  }
@@ -58,11 +62,8 @@
58
62
  .weda-formcells__pc .wedatea2td-form__label {
59
63
  display: table-cell; /*container 外适配*/
60
64
  vertical-align: baseline;
61
- color: rgba(0, 0, 0, 0.9);
62
- padding-right: 20px;
63
65
  padding-top: 7px;
64
66
  padding-bottom: 7px;
65
- width: 1px;
66
67
  }
67
68
  .wedatea2td-form .wedatea2td-form__label .wedatea2td-icon {
68
69
  vertical-align: -4px;
@@ -70,23 +71,15 @@
70
71
  .weda-formcells__pc .wedatea2td-form__label label,
71
72
  .weda-formcells__pc .wedatea2td-form__label legend {
72
73
  display: inline-block;
73
- white-space: nowrap;
74
- font-size: 1rem;
75
74
  transform: translateZ(0);
75
+ width: 98px;
76
76
  }
77
77
 
78
78
  /*formcell*/
79
- .wedatea2td-form__item.weda-ui {
80
- display: block;
81
- }
82
79
 
83
- .wedatea2td-form .wedatea2td-form__item {
84
- display: table-row;
85
- }
86
80
  .weda-formcells__full-width .wedatea2td-form__controls {
87
81
  width: 100%;
88
82
  }
89
83
  /*formcell end*/
90
84
 
91
-
92
85
  /* formcell 在 form container 外部兼容 */
@@ -4,7 +4,7 @@ import classNames from '../../../utils/classnames';
4
4
  import './index.css';
5
5
  import { usePlatform } from '../../../utils/platform';
6
6
  import { ConfigProvider, Form as TeaForm } from 'tea-component';
7
- import { CommonFormPropsType } from '../types';
7
+ import type { CommonFormPropsType } from '../types';
8
8
 
9
9
  export default function FormCell({
10
10
  className,
@@ -33,12 +33,8 @@ export default function FormCell({
33
33
  [layout]: layout,
34
34
  [className]: [className],
35
35
  })}
36
- label={
37
- <>
38
- {label}
39
- {requiredFlag && <span className="weda-formcells__flag">*</span>}
40
- </>
41
- }
36
+ label={label}
37
+ required={requiredFlag}
42
38
  >
43
39
  {children}
44
40
  </TeaForm.Item>
@@ -8,12 +8,12 @@
8
8
  把weui-cell 的padding还回到input
9
9
  */
10
10
  .weda-ui input.weui-input {
11
- padding: 28px 0;
11
+ padding: 28px 0;
12
12
  }
13
13
 
14
14
  .weda-ui.weda-input .weui-flex__item .weui-cell_form {
15
- padding: 0;
16
- padding-right: 16px;
15
+ padding: 0;
16
+ padding-right: 16px;
17
17
  }
18
18
 
19
19
  .weda-ui.weda-input .weui-cell_form {
@@ -29,8 +29,12 @@
29
29
  START
30
30
  */
31
31
  .weda-ui .wedatea2td-input {
32
- background: inherit;
32
+ background: inherit;
33
33
  }
34
34
  /**
35
35
  * END
36
36
  */
37
+
38
+ .weda-input .weui-input {
39
+ font-weight: inherit;
40
+ }
@@ -5,7 +5,7 @@ import { Input as TeaInput, ConfigProvider } from 'tea-component';
5
5
  import { renderDecorator } from '../renderDecorator';
6
6
  import { useSyncValue } from '../../../utils/useSyncValue';
7
7
  import './index.css';
8
- import { CommonFormPropsType } from '../types';
8
+ import type { CommonFormPropsType } from '../types';
9
9
 
10
10
  export default function Input({
11
11
  id,
@@ -80,69 +80,77 @@ export default function Input({
80
80
  const onBlur = function (e) {
81
81
  events.blur({ value: e.target.value }, { originEvent: e });
82
82
  };
83
- const fieldEl = platform === 'h5' ? <div className={subCls}>
84
- <div className="weui-cell__bd weui-flex">
85
- <input
86
- className="weui-input"
87
- type={inputType}
88
- placeholder={placeholder}
89
- value={value}
90
- disabled={disabled}
91
- name={name}
92
- autoFocus={autoFocus}
93
- onChange={onChange}
94
- onFocus={onFocus}
95
- onBlur={onBlur}
96
- onKeyDown={onKeyDown}
97
- role="input"
98
- />
99
- {clearable &&
100
- <button
101
- className="weui-btn_reset weui-btn_icon weui-btn_input-clear"
102
- onMouseDown={onClear}
103
- >
104
- <i className="weui-icon-clear"></i>
105
- </button>
106
- }
107
- </div>
108
- </div> : <ConfigProvider classPrefix="wedatea2td">
109
- <TeaInput
110
- size={size}
111
- type={inputType}
112
- placeholder={placeholder}
113
- value={value}
114
- disabled={disabled}
115
- name={name}
116
- autoFocus={autoFocus}
117
- onChange={onChange}
118
- onFocus={onFocus}
119
- onBlur={onBlur}
120
- onKeyDown={onKeyDown}
121
- /></ConfigProvider>;
122
- return renderDecorator(fieldEl, decorator)({
123
- id,
124
- className: cls,
125
- style,
126
- label: labelVisible ? label : null,
127
- layout,
128
- multiCell: false,
129
- requiredFlag,
130
- size
131
- });
83
+ const fieldEl =
84
+ platform === 'h5' ? (
85
+ <div className={subCls}>
86
+ <div className="weui-cell__bd weui-flex">
87
+ <input
88
+ className="weui-input"
89
+ type={inputType}
90
+ placeholder={placeholder}
91
+ value={value}
92
+ disabled={disabled}
93
+ name={name}
94
+ autoFocus={autoFocus}
95
+ onChange={onChange}
96
+ onFocus={onFocus}
97
+ onBlur={onBlur}
98
+ onKeyDown={onKeyDown}
99
+ role="input"
100
+ />
101
+ {clearable && (
102
+ <button
103
+ className="weui-btn_reset weui-btn_icon weui-btn_input-clear"
104
+ onMouseDown={onClear}
105
+ >
106
+ <i className="weui-icon-clear"></i>
107
+ </button>
108
+ )}
109
+ </div>
110
+ </div>
111
+ ) : (
112
+ <ConfigProvider classPrefix="wedatea2td">
113
+ <TeaInput
114
+ size={size}
115
+ type={inputType}
116
+ placeholder={placeholder}
117
+ value={value}
118
+ disabled={disabled}
119
+ name={name}
120
+ autoFocus={autoFocus}
121
+ onChange={onChange}
122
+ onFocus={onFocus}
123
+ onBlur={onBlur}
124
+ onKeyDown={onKeyDown}
125
+ />
126
+ </ConfigProvider>
127
+ );
128
+ return renderDecorator(
129
+ fieldEl,
130
+ decorator
131
+ )({
132
+ id,
133
+ className: cls,
134
+ style,
135
+ label: labelVisible ? label : null,
136
+ layout,
137
+ multiCell: false,
138
+ requiredFlag,
139
+ size,
140
+ });
132
141
  }
133
142
 
134
143
  export interface PropsType extends CommonFormPropsType {
135
144
  defaultValue?: string;
136
145
  password?: boolean;
137
146
  placeholder?: string;
138
- type?: "text" | "number" | "idcard" | "digit";
147
+ type?: 'text' | 'number' | 'idcard' | 'digit';
139
148
  maxLength?: number;
140
149
  focus?: boolean;
141
- size?: "s" | "m" | "l" | "full";
150
+ size?: 's' | 'm' | 'l' | 'full';
142
151
  clearable?: boolean;
143
152
  }
144
153
 
145
-
146
154
  function getInputType(type, password) {
147
155
  if (password) {
148
156
  return 'password';
@@ -1,4 +1,6 @@
1
1
  /* mapChoose组件 */
2
+
3
+ /* em = 16px */
2
4
  .weda-ui_map-choose {
3
5
  width: 100%;
4
6
  height: 100%;
@@ -35,8 +37,8 @@
35
37
  padding-left: 10px;
36
38
  padding-right: 10px;
37
39
  color: #b4b4b4;
38
- font-size: 15px;
39
- line-height: 31px;
40
+ font-size: 1em;
41
+ line-height: 2em;
40
42
  border-radius: 5px;
41
43
  overflow: hidden;
42
44
  white-space: nowrap;
@@ -57,9 +59,9 @@
57
59
  right: 0;
58
60
  width: 55px;
59
61
  height: 46px;
60
- line-height: 46px;
62
+ line-height: 2.875em;
61
63
  text-align: center;
62
- font-size: 16px;
64
+ font-size: 1em;
63
65
  color: #0079ff;
64
66
  background-color: #fff;
65
67
  cursor: pointer;
@@ -76,8 +78,8 @@
76
78
  padding-top: 6px;
77
79
  padding-bottom: 6px;
78
80
  border: 0;
79
- font-size: 14px;
80
- line-height: 18px;
81
+ font-size: 0.875em;
82
+ line-height: 1.125em;
81
83
  background: 0 0;
82
84
  position: relative;
83
85
  z-index: 1;
@@ -143,11 +145,11 @@
143
145
  }
144
146
  .map-choose-warp_sugges_choosed span {
145
147
  position: absolute;
146
- right: 20px;
148
+ right: 1.25em;
147
149
  top: 50%;
148
150
  transform: translate(0, -50%);
149
- width: 16px;
150
- height: 16px;
151
+ width: 1em;
152
+ height: 1em;
151
153
  display: block !important;
152
154
  background-image: url('https://qcloudimg.tencent-cloud.cn/raw/354c15c0cb845120ac3e9c474e6737b3.png');
153
155
  background-size: 100% 100%;
@@ -162,8 +164,8 @@
162
164
  }
163
165
  .map-choose-warp_sugges_title,
164
166
  .map-choose-explore_title {
165
- font-size: 14px;
166
- line-height: 27px;
167
+ font-size: 0.875em;
168
+ line-height: 1.6875em;
167
169
  color: #333;
168
170
  font-weight: 400;
169
171
  display: block;
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { Modal, Button } from 'tea-component';
3
- import * as PropTypes from 'prop-types';
4
3
  import { usePlatform } from '../../../../utils/platform';
5
4
  import classNames from '../../../../utils/classnames';
6
5
  import MapChoose from './mapChoose';
@@ -32,9 +31,10 @@ export default function SelectModal({
32
31
  };
33
32
 
34
33
  const getPosition = (value) => {
35
- const { title, location } = value;
34
+ const { title, location, address } = value;
36
35
  let loc = {
37
36
  poiname: title,
37
+ detailedAddress: address,
38
38
  latlng: { lat: location.lat, lng: location.lng },
39
39
  };
40
40
  positionRef.current = loc;
@@ -71,12 +71,3 @@ export default function SelectModal({
71
71
  </Modal>
72
72
  );
73
73
  }
74
-
75
- SelectModal.propTypes = {
76
- location: PropTypes.object,
77
- isSelectMapVisible: PropTypes.bool,
78
- APIKEY: PropTypes.string,
79
- setLocation: PropTypes.func,
80
- setIsSelectMapVisible: PropTypes.func,
81
- chooseLocation: PropTypes.func,
82
- };