@cloudbase/weda-ui 2.0.11 → 2.0.27

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 (262) hide show
  1. package/README.md +1 -0
  2. package/package.json +39 -35
  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/calendar/index.js +4 -1
  40. package/src/mp/components/calendar/index.json +3 -2
  41. package/src/mp/components/calendar/index.wxml +6 -28
  42. package/src/mp/components/calendar/index.wxss +17 -16
  43. package/src/mp/components/carousel/index.json +1 -1
  44. package/src/mp/components/carousel/index.wxml +3 -30
  45. package/src/mp/components/chart/bar/index.wxml +1 -6
  46. package/src/mp/components/chart/ec-canvas/ec-canvas.json +1 -1
  47. package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +2 -19
  48. package/src/mp/components/chart/line/index.wxml +1 -6
  49. package/src/mp/components/chart/pie/index.wxml +1 -6
  50. package/src/mp/components/chart/statisticsCard/index.wxml +1 -5
  51. package/src/mp/components/chart/statisticsCard/index.wxss +7 -10
  52. package/src/mp/components/dataView/index.wxml +1 -13
  53. package/src/mp/components/form/checkbox/index.js +5 -1
  54. package/src/mp/components/form/checkbox/index.wxml +3 -18
  55. package/src/mp/components/form/formcell/index.wxss +5 -0
  56. package/src/mp/components/form/input/index.js +1 -1
  57. package/src/mp/components/form/input/index.wxml +3 -16
  58. package/src/mp/components/form/input/index.wxss +7 -1
  59. package/src/mp/components/form/location/components/mapChoose/index.json +1 -1
  60. package/src/mp/components/form/location/components/mapChoose/index.wxml +11 -58
  61. package/src/mp/components/form/location/index.js +7 -1
  62. package/src/mp/components/form/location/index.json +1 -1
  63. package/src/mp/components/form/location/index.wxml +7 -43
  64. package/src/mp/components/form/radio/index.js +5 -1
  65. package/src/mp/components/form/radio/index.wxml +2 -14
  66. package/src/mp/components/form/select/index.js +2 -2
  67. package/src/mp/components/form/select/index.wxml +3 -33
  68. package/src/mp/components/form/select/index.wxss +9 -0
  69. package/src/mp/components/form/switch/index.wxml +2 -13
  70. package/src/mp/components/form/textarea/index.js +6 -0
  71. package/src/mp/components/form/textarea/index.wxml +4 -23
  72. package/src/mp/components/form/textarea/index.wxss +5 -0
  73. package/src/mp/components/form/uploader/index.wxml +2 -20
  74. package/src/mp/components/form/uploader/weui-uploader.json +6 -6
  75. package/src/mp/components/form/uploader/weui-uploader.wxml +10 -53
  76. package/src/mp/components/form/uploaderFile/index.wxml +14 -71
  77. package/src/mp/components/graphicCard/index.js +9 -11
  78. package/src/mp/components/graphicCard/index.wxml +6 -34
  79. package/src/mp/components/graphicCard/index.wxss +6 -6
  80. package/src/mp/components/image/index.wxml +3 -21
  81. package/src/mp/components/listView/index.wxml +8 -33
  82. package/src/mp/components/listView/index.wxss +2 -2
  83. package/src/mp/components/lottery/index.wxml +7 -31
  84. package/src/mp/components/navLayout/index.js +9 -12
  85. package/src/mp/components/navLayout/index.wxml +6 -30
  86. package/src/mp/components/navLayout/index.wxss +10 -10
  87. package/src/mp/components/navigationBar/index.json +1 -2
  88. package/src/mp/components/navigationBar/index.wxml +29 -146
  89. package/src/mp/components/navigationBar/index.wxss +10 -10
  90. package/src/mp/components/richText/index.wxml +1 -1
  91. package/src/mp/components/richText/index.wxss +7 -5
  92. package/src/mp/components/swiper/index.wxml +1 -14
  93. package/src/mp/components/tabs/index.json +1 -1
  94. package/src/mp/components/tabs/index.wxml +3 -22
  95. package/src/mp/components/tabs/index.wxss +1 -2
  96. package/src/mp/components/text/index.wxml +1 -7
  97. package/src/mp/components/wedaVideo/index.js +86 -0
  98. package/src/mp/components/wedaVideo/index.json +4 -0
  99. package/src/mp/components/wedaVideo/index.wxml +4 -0
  100. package/src/mp/components/wedaVideo/index.wxss +20 -0
  101. package/src/mp/components/wxOpenApi/phone/index.js +1 -9
  102. package/src/mp/components/wxOpenApi/phone/index.wxml +1 -11
  103. package/src/mp/components/wxOpenApi/phoneCode/index.json +1 -1
  104. package/src/mp/components/wxOpenApi/phoneCode/index.wxml +1 -11
  105. package/src/mp/components/wxOpenApi/share/index.wxml +1 -11
  106. package/src/mp/components/wxOpenApi/userInfo/index.wxml +1 -10
  107. package/src/mp/index.json +1 -0
  108. package/src/mp/style/weda-ui.wxss +16 -6
  109. package/src/web/actions/showModal/index.tsx +5 -4
  110. package/src/web/components/calendar/index.css +99 -65
  111. package/src/web/components/chart/common/core/eChartBase.ts +55 -42
  112. package/src/web/components/chart/common/core/type.ts +23 -23
  113. package/src/web/components/chart/common/echart.css +12 -12
  114. package/src/web/components/chart/common/echarts.ts +3 -5
  115. package/src/web/components/chart/common/useChart.tsx +34 -16
  116. package/src/web/components/chart/statisticsCard/index.css +9 -8
  117. package/src/web/components/container/index.tsx +3 -4
  118. package/src/web/components/drawer/index.tsx +15 -4
  119. package/src/web/components/form/checkbox/index.tsx +32 -31
  120. package/src/web/components/form/enumSelect/NormalSelect.tsx +0 -2
  121. package/src/web/components/form/form/index.css +3 -6
  122. package/src/web/components/form/form/index.tsx +2 -1
  123. package/src/web/components/form/formcell/index.css +6 -17
  124. package/src/web/components/form/formcell/index.tsx +2 -6
  125. package/src/web/components/form/input/index.css +8 -4
  126. package/src/web/components/form/input/index.tsx +61 -53
  127. package/src/web/components/form/location/common/mapChoose.css +13 -11
  128. package/src/web/components/form/location/common/selectModal.jsx +2 -11
  129. package/src/web/components/form/location/common/useLocationInfo.js +4 -0
  130. package/src/web/components/form/location/components/LocationH5/index.css +19 -20
  131. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +11 -1
  132. package/src/web/components/form/location/components/LocationPC/Header.jsx +0 -13
  133. package/src/web/components/form/location/components/LocationPC/location.PC.jsx +14 -5
  134. package/src/web/components/form/radio/index.tsx +32 -26
  135. package/src/web/components/form/renderDecorator.tsx +23 -26
  136. package/src/web/components/form/select/h5.tsx +2 -2
  137. package/src/web/components/form/select/index.css +9 -0
  138. package/src/web/components/form/select/index.tsx +76 -49
  139. package/src/web/components/form/select/region/index.ts +101 -80
  140. package/src/web/components/form/select/year.tsx +2 -0
  141. package/src/web/components/form/switch/index.tsx +40 -40
  142. package/src/web/components/form/textarea/index.css +4 -0
  143. package/src/web/components/form/textarea/index.tsx +38 -25
  144. package/src/web/components/form/types.d.ts +10 -10
  145. package/src/web/components/form/uploader/index.css +10 -0
  146. package/src/web/components/form/uploader/uploader.h5.tsx +3 -6
  147. package/src/web/components/form/uploader/uploader.pc.tsx +3 -6
  148. package/src/web/components/form/uploaderFile/index.css +24 -23
  149. package/src/web/components/form/uploaderFile/index.jsx +0 -5
  150. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +24 -15
  151. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +21 -13
  152. package/src/web/components/graphicCard/index.css +6 -6
  153. package/src/web/components/image/image.tsx +2 -2
  154. package/src/web/components/image/index.css +9 -7
  155. package/src/web/components/image/index.tsx +28 -11
  156. package/src/web/components/index.js +1 -0
  157. package/src/web/components/link/index.tsx +12 -12
  158. package/src/web/components/listView/index.css +8 -8
  159. package/src/web/components/lottery/index.css +43 -37
  160. package/src/web/components/lottery/index.tsx +3 -3
  161. package/src/web/components/modal/index.tsx +34 -34
  162. package/src/web/components/navLayout/index.css +25 -25
  163. package/src/web/components/navigationBar/index.css +26 -26
  164. package/src/web/components/picker/datePicker.tsx +3 -3
  165. package/src/web/components/picker/picker.tsx +3 -3
  166. package/src/web/components/richText/index.jsx +41 -46
  167. package/src/web/components/richTextView/index.css +7 -3
  168. package/src/web/components/richTextView/index.tsx +4 -6
  169. package/src/web/components/scrollView/index.tsx +2 -2
  170. package/src/web/components/slot/index.tsx +3 -4
  171. package/src/web/components/swiper/index.css +1 -1
  172. package/src/web/components/swiper/index.tsx +33 -15
  173. package/src/web/components/tabs/index.css +2 -3
  174. package/src/web/components/tabs/index.tsx +6 -6
  175. package/src/web/components/tabs/tabs.h5.tsx +17 -12
  176. package/src/web/components/tabs/tabs.pc.tsx +45 -34
  177. package/src/web/components/text/index.css +1 -1
  178. package/src/web/components/wedaVideo/index.css +42 -0
  179. package/src/web/components/wedaVideo/index.tsx +208 -0
  180. package/src/web/utils/constant.ts +2 -1
  181. package/src/web/utils/loading-fallback.tsx +2 -2
  182. package/src/web/utils/lodash.ts +1 -1
  183. package/src/web/utils/platform.js +13 -0
  184. package/src/web/utils/useSetState.ts +6 -2
  185. package/src/web/weda-ui.css +23 -8
  186. package/src/docs/common/format.tsx +0 -112
  187. package/src/docs/common/tableView.css +0 -164
  188. package/src/docs/common/tableView.tsx +0 -273
  189. package/src/docs/compsdocs/chart/Bar.mdx +0 -159
  190. package/src/docs/compsdocs/chart/Line.mdx +0 -100
  191. package/src/docs/compsdocs/chart/Pie.mdx +0 -83
  192. package/src/docs/compsdocs/chart/_category_.json +0 -1
  193. package/src/docs/compsdocs/chart/statisticsCard.mdx +0 -51
  194. package/src/docs/compsdocs/database/DataView.mdx +0 -33
  195. package/src/docs/compsdocs/database/ListView.mdx +0 -33
  196. package/src/docs/compsdocs/database/_category_.json +0 -1
  197. package/src/docs/compsdocs/form/Form.mdx +0 -35
  198. package/src/docs/compsdocs/form/FormCheckbox.mdx +0 -35
  199. package/src/docs/compsdocs/form/FormDate.mdx +0 -30
  200. package/src/docs/compsdocs/form/FormEmail.mdx +0 -30
  201. package/src/docs/compsdocs/form/FormImageUploader.mdx +0 -31
  202. package/src/docs/compsdocs/form/FormInput.mdx +0 -30
  203. package/src/docs/compsdocs/form/FormLocation.mdx +0 -64
  204. package/src/docs/compsdocs/form/FormPhone.mdx +0 -30
  205. package/src/docs/compsdocs/form/FormRadio.mdx +0 -35
  206. package/src/docs/compsdocs/form/FormRegion.mdx +0 -30
  207. package/src/docs/compsdocs/form/FormSelect.mdx +0 -36
  208. package/src/docs/compsdocs/form/FormSwitch.mdx +0 -30
  209. package/src/docs/compsdocs/form/FormTextarea.mdx +0 -30
  210. package/src/docs/compsdocs/form/FormTime.mdx +0 -30
  211. package/src/docs/compsdocs/form/FormUploadFile.mdx +0 -30
  212. package/src/docs/compsdocs/form/FormUrl.mdx +0 -30
  213. package/src/docs/compsdocs/form/_category_.json +0 -1
  214. package/src/docs/compsdocs/grid/Card.mdx +0 -32
  215. package/src/docs/compsdocs/grid/Container.mdx +0 -42
  216. package/src/docs/compsdocs/grid/Footer.mdx +0 -31
  217. package/src/docs/compsdocs/grid/GridLayout.mdx +0 -32
  218. package/src/docs/compsdocs/grid/Header.mdx +0 -31
  219. package/src/docs/compsdocs/grid/Layout.mdx +0 -25
  220. package/src/docs/compsdocs/grid/List.mdx +0 -31
  221. package/src/docs/compsdocs/grid/ScrollView.mdx +0 -37
  222. package/src/docs/compsdocs/grid/Swiper.mdx +0 -58
  223. package/src/docs/compsdocs/grid/_category_.json +0 -1
  224. package/src/docs/compsdocs/media/Icon.mdx +0 -31
  225. package/src/docs/compsdocs/media/Image.mdx +0 -55
  226. package/src/docs/compsdocs/media/_category_.json +0 -1
  227. package/src/docs/compsdocs/model/ModelCreate.mdx +0 -20
  228. package/src/docs/compsdocs/model/ModelDetail.mdx +0 -20
  229. package/src/docs/compsdocs/model/ModelTable.mdx +0 -24
  230. package/src/docs/compsdocs/model/ModelUpdate.mdx +0 -21
  231. package/src/docs/compsdocs/model/PageLayout.mdx +0 -21
  232. package/src/docs/compsdocs/model/_category_.json +0 -1
  233. package/src/docs/compsdocs/navmenu/Classification.mdx +0 -38
  234. package/src/docs/compsdocs/navmenu/NavBar.mdx +0 -43
  235. package/src/docs/compsdocs/navmenu/NavLayout.mdx +0 -30
  236. package/src/docs/compsdocs/navmenu/TabBar.mdx +0 -43
  237. package/src/docs/compsdocs/navmenu/TabBarItem.mdx +0 -29
  238. package/src/docs/compsdocs/navmenu/_category_.json +0 -1
  239. package/src/docs/compsdocs/senior/Lottery.mdx +0 -48
  240. package/src/docs/compsdocs/senior/Modal.mdx +0 -58
  241. package/src/docs/compsdocs/senior/SlotMachine.mdx +0 -52
  242. package/src/docs/compsdocs/senior/_category_.json +0 -1
  243. package/src/docs/compsdocs/show/Calendar.mdx +0 -29
  244. package/src/docs/compsdocs/show/Divider.mdx +0 -31
  245. package/src/docs/compsdocs/show/GraphicCard.mdx +0 -30
  246. package/src/docs/compsdocs/show/Item.mdx +0 -32
  247. package/src/docs/compsdocs/show/ItemList.mdx +0 -47
  248. package/src/docs/compsdocs/show/Media.mdx +0 -25
  249. package/src/docs/compsdocs/show/StatusTip.mdx +0 -25
  250. package/src/docs/compsdocs/show/Swiper.mdx +0 -33
  251. package/src/docs/compsdocs/show/Tabs.mdx +0 -38
  252. package/src/docs/compsdocs/show/_category_.json +0 -1
  253. package/src/docs/compsdocs/show/button.mdx +0 -25
  254. package/src/docs/compsdocs/text/Link.mdx +0 -43
  255. package/src/docs/compsdocs/text/RichTextView.mdx +0 -36
  256. package/src/docs/compsdocs/text/Text.mdx +0 -31
  257. package/src/docs/compsdocs/text/Title.mdx +0 -32
  258. package/src/docs/compsdocs/text/_category_.json +0 -1
  259. package/src/docs/compsdocs/wxOpen/Phone.mdx +0 -60
  260. package/src/docs/compsdocs/wxOpen/Share.mdx +0 -46
  261. package/src/docs/compsdocs/wxOpen/UserInfo.mdx +0 -60
  262. package/src/docs/compsdocs/wxOpen/_category_.json +0 -4
@@ -17,17 +17,17 @@
17
17
  }
18
18
  .weda-ui-echart .echart-light-box {
19
19
  position: relative;
20
- background-color: #F4F5F6;
20
+ background-color: #f4f5f6;
21
21
  }
22
22
  .weda-ui-echart .echart-light-body {
23
23
  background-color: #ffffff;
24
24
  }
25
25
  .weda-ui-echart .echart-dark-box {
26
26
  position: relative;
27
- background-color: #4B5D6C;
27
+ background-color: #4b5d6c;
28
28
  }
29
29
  .weda-ui-echart .echart-dark-body {
30
- background-color: #1D1F24;
30
+ background-color: #1d1f24;
31
31
  margin: 6px;
32
32
  }
33
33
  .weda-ui-echart .btn-grounp {
@@ -67,20 +67,20 @@
67
67
  user-select: none;
68
68
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
69
69
  position: relative;
70
- color: #4B5D6C;
70
+ color: #4b5d6c;
71
71
  background-color: #fff;
72
- border-color: #CCD2D8;
72
+ border-color: #ccd2d8;
73
73
  }
74
74
  .weda-ui-echart .button,
75
- .weda-ui-echart html [type="button"],
76
- .weda-ui-echart [type="reset"],
77
- .weda-ui-echart [type="submit"] {
75
+ .weda-ui-echart html [type='button'],
76
+ .weda-ui-echart [type='reset'],
77
+ .weda-ui-echart [type='submit'] {
78
78
  -webkit-appearance: button;
79
79
  }
80
80
  .weda-ui-echart .ant-btn-primary {
81
81
  color: #fff;
82
- background-color: #4A62E7;
83
- border-color: #4A62E7;
82
+ background-color: #4a62e7;
83
+ border-color: #4a62e7;
84
84
  }
85
85
  .weda-ui-echart .ant-btn:not([disabled]):hover {
86
86
  text-decoration: none;
@@ -94,9 +94,9 @@
94
94
  }
95
95
  .weda-ui-echart .ant-btn:hover,
96
96
  .weda-ui-echart .ant-btn:focus {
97
- color: #4A62E7;
97
+ color: #4a62e7;
98
98
  background-color: #fff;
99
- border-color: #4A62E7;
99
+ border-color: #4a62e7;
100
100
  }
101
101
  .weda-ui-echart .ant-btn-primary:hover,
102
102
  .weda-ui-echart .ant-btn-primary:focus {
@@ -7,7 +7,7 @@ import {
7
7
  TitleComponent,
8
8
  TooltipComponent,
9
9
  LegendComponent,
10
- GridComponent
10
+ GridComponent,
11
11
  } from 'echarts/components';
12
12
  // 标签自动布局,全局过渡动画等特性
13
13
  import { LabelLayout, UniversalTransition } from 'echarts/features';
@@ -25,9 +25,7 @@ echarts.use([
25
25
  CanvasRenderer,
26
26
  BarChart,
27
27
  LineChart,
28
- PieChart
28
+ PieChart,
29
29
  ]);
30
30
 
31
- export {
32
- echarts
33
- };
31
+ export { echarts };
@@ -1,14 +1,28 @@
1
- import { useAsync, useDeepCompareEffect, useEventListener, useIsMounted, useMountEffect } from "@react-hookz/web";
2
- import { MutableRefObject, RefObject, useCallback, useEffect, useMemo, useRef } from "react";
3
- import { IEchartModalBase } from "./core/eChartBase";
4
- import { echarts } from "./echarts";
1
+ import {
2
+ useAsync,
3
+ useDeepCompareEffect,
4
+ useEventListener,
5
+ useIsMounted,
6
+ useMountEffect,
7
+ } from '@react-hookz/web';
8
+ import {
9
+ MutableRefObject,
10
+ RefObject,
11
+ useCallback,
12
+ useEffect,
13
+ useMemo,
14
+ useRef,
15
+ } from 'react';
16
+ import { IEchartModalBase } from './core/eChartBase';
17
+ import { echarts } from './echarts';
5
18
 
6
- export function useChart(ref: RefObject<HTMLElement> | MutableRefObject<HTMLElement>) {
19
+ export function useChart(
20
+ ref: RefObject<HTMLElement> | MutableRefObject<HTMLElement>
21
+ ) {
7
22
  const chartRef = useRef<echarts.ECharts>();
8
23
  const isMounted = useIsMounted();
9
24
  useMountEffect(() => {
10
-
11
- if(!ref.current || !isMounted) {
25
+ if (!ref.current || !isMounted) {
12
26
  return;
13
27
  }
14
28
 
@@ -28,16 +42,19 @@ export function useChart(ref: RefObject<HTMLElement> | MutableRefObject<HTMLElem
28
42
  return chartRef.current;
29
43
  }
30
44
 
31
-
32
45
  /**
33
46
  * @deprecated The method should not be used
34
47
  */
35
- export function useWedaChart(domRef, ModalClass: IEchartModalBase, options: echarts.EChartsCoreOption) {
48
+ export function useWedaChart(
49
+ domRef,
50
+ ModalClass: IEchartModalBase,
51
+ options: echarts.EChartsCoreOption
52
+ ) {
36
53
  const chart = useChart(domRef);
37
- const getOptions = async() => {
54
+ const getOptions = async () => {
38
55
  const chartModal = new ModalClass();
39
56
  let finalOptions: any = await chartModal.setOptions(options);
40
- if(!finalOptions) {
57
+ if (!finalOptions) {
41
58
  finalOptions = chartModal.getOptions() as any;
42
59
  }
43
60
  return finalOptions;
@@ -50,18 +67,19 @@ export function useWedaChart(domRef, ModalClass: IEchartModalBase, options: echa
50
67
  useDeepCompareEffect(() => {
51
68
  actions.execute();
52
69
  }, [
53
- // options 变化,包含所有配置项,包括纯前端的配置项变化都会触发setOptions里发请求,但改不动了
54
- options,
55
- actions]);
70
+ // options 变化,包含所有配置项,包括纯前端的配置项变化都会触发setOptions里发请求,但改不动了
71
+ options,
72
+ actions,
73
+ ]);
56
74
  useEffect(() => {
57
- if(state.status === 'success' && chart) {
75
+ if (state.status === 'success' && chart) {
58
76
  console.log(ModalClass.name, options, state.result, window.location.href);
59
77
  chart.setOption(
60
78
  state.result,
61
79
  true // noMerge 全刷
62
80
  );
63
81
  } else {
64
- if(state.status === 'error') {
82
+ if (state.status === 'error') {
65
83
  console.error(state.error);
66
84
  }
67
85
  }
@@ -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
  }
@@ -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({
@@ -30,7 +31,7 @@ export default function Form({
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
36
  </TeaForm>
36
37
  </ConfigProvider>
@@ -16,11 +16,16 @@
16
16
  }
17
17
  .weda-formcells.weui-flex .weda-formcells__label {
18
18
  width: 130px;
19
+ padding-bottom: 16px;
19
20
  }
20
21
  .weui-cells__group_form .weui-cell {
21
22
  padding: 16px 16px;
22
23
  }
23
24
 
25
+ .weda-formcells .weda-formcells__label {
26
+ padding-bottom: 8px;
27
+ }
28
+
24
29
  .weda-formcells__content.weui-flex__item .weui-cell_form {
25
30
  padding: 0;
26
31
  }
@@ -29,7 +34,6 @@
29
34
  padding-right: 16px;
30
35
  }
31
36
 
32
-
33
37
  /* formcell 在 form container 外部兼容 and 独立 layout 适配 */
34
38
 
35
39
  .weda-formcells__pc.vertical .wedatea2td-form__controls,
@@ -39,14 +43,10 @@
39
43
  .weda-formcells__pc.vertical .wedatea2td-form__label {
40
44
  padding-bottom: 0;
41
45
  padding-top: 0;
42
- font-size: 1rem;
43
46
  width: auto;
44
47
  margin-bottom: 10px;
45
48
  }
46
49
 
47
- .weda-formcells__pc.vertical .wedatea2td-form__label label {
48
- color: rgba(0, 0, 0, 0.9);
49
- }
50
50
  .weda-formcells__pc.vertical .wedatea2td-form__help-text {
51
51
  margin-top: 4px;
52
52
  }
@@ -62,11 +62,8 @@
62
62
  .weda-formcells__pc .wedatea2td-form__label {
63
63
  display: table-cell; /*container 外适配*/
64
64
  vertical-align: baseline;
65
- color: rgba(0, 0, 0, 0.9);
66
- padding-right: 20px;
67
65
  padding-top: 7px;
68
66
  padding-bottom: 7px;
69
- width: 1px;
70
67
  }
71
68
  .wedatea2td-form .wedatea2td-form__label .wedatea2td-icon {
72
69
  vertical-align: -4px;
@@ -74,23 +71,15 @@
74
71
  .weda-formcells__pc .wedatea2td-form__label label,
75
72
  .weda-formcells__pc .wedatea2td-form__label legend {
76
73
  display: inline-block;
77
- white-space: nowrap;
78
- font-size: 1rem;
79
74
  transform: translateZ(0);
75
+ width: 98px;
80
76
  }
81
77
 
82
78
  /*formcell*/
83
- .wedatea2td-form__item.weda-ui {
84
- display: block;
85
- }
86
79
 
87
- .wedatea2td-form .wedatea2td-form__item {
88
- display: table-row;
89
- }
90
80
  .weda-formcells__full-width .wedatea2td-form__controls {
91
81
  width: 100%;
92
82
  }
93
83
  /*formcell end*/
94
84
 
95
-
96
85
  /* formcell 在 form container 外部兼容 */
@@ -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
+ }