@cloudbase/weda-ui 1.0.24 → 2.0.8

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 (144) hide show
  1. package/package.json +2 -2
  2. package/src/configs/components/button.json +0 -2
  3. package/src/configs/components/calendar.json +5 -2
  4. package/src/configs/components/carousel.json +18 -9
  5. package/src/configs/components/chart/bar.json +12 -6
  6. package/src/configs/components/chart/line.json +8 -4
  7. package/src/configs/components/chart/pie.json +8 -4
  8. package/src/configs/components/dataView.json +10 -5
  9. package/src/configs/components/form/radio.json +27 -0
  10. package/src/configs/components/form/select.json +2 -2
  11. package/src/configs/components/graphicCard.json +6 -2
  12. package/src/configs/components/image.json +12 -6
  13. package/src/configs/components/link.json +6 -3
  14. package/src/configs/components/listView.json +20 -10
  15. package/src/configs/components/lottery.json +4 -2
  16. package/src/configs/components/navLayout.json +12 -6
  17. package/src/configs/components/richtextview.json +2 -1
  18. package/src/configs/components/scrollVeiw.json +24 -12
  19. package/src/configs/components/swiper.json +18 -9
  20. package/src/configs/components/tabs.json +4 -2
  21. package/src/configs/components/text.json +10 -5
  22. package/src/docs/common/format.tsx +112 -0
  23. package/src/docs/common/tableView.css +164 -0
  24. package/src/docs/common/tableView.tsx +273 -0
  25. package/src/docs/compsdocs/chart/Bar.mdx +159 -0
  26. package/src/docs/compsdocs/chart/Line.mdx +100 -0
  27. package/src/docs/compsdocs/chart/Pie.mdx +83 -0
  28. package/src/docs/compsdocs/chart/_category_.json +1 -0
  29. package/src/docs/compsdocs/chart/statisticsCard.mdx +51 -0
  30. package/src/docs/compsdocs/database/DataView.mdx +33 -0
  31. package/src/docs/compsdocs/database/ListView.mdx +33 -0
  32. package/src/docs/compsdocs/database/_category_.json +1 -0
  33. package/src/docs/compsdocs/form/Form.mdx +35 -0
  34. package/src/docs/compsdocs/form/FormCheckbox.mdx +35 -0
  35. package/src/docs/compsdocs/form/FormDate.mdx +30 -0
  36. package/src/docs/compsdocs/form/FormEmail.mdx +30 -0
  37. package/src/docs/compsdocs/form/FormImageUploader.mdx +31 -0
  38. package/src/docs/compsdocs/form/FormInput.mdx +30 -0
  39. package/src/docs/compsdocs/form/FormLocation.mdx +64 -0
  40. package/src/docs/compsdocs/form/FormPhone.mdx +30 -0
  41. package/src/docs/compsdocs/form/FormRadio.mdx +35 -0
  42. package/src/docs/compsdocs/form/FormRegion.mdx +30 -0
  43. package/src/docs/compsdocs/form/FormSelect.mdx +36 -0
  44. package/src/docs/compsdocs/form/FormSwitch.mdx +30 -0
  45. package/src/docs/compsdocs/form/FormTextarea.mdx +30 -0
  46. package/src/docs/compsdocs/form/FormTime.mdx +30 -0
  47. package/src/docs/compsdocs/form/FormUploadFile.mdx +30 -0
  48. package/src/docs/compsdocs/form/FormUrl.mdx +30 -0
  49. package/src/docs/compsdocs/form/_category_.json +1 -0
  50. package/src/docs/compsdocs/grid/Card.mdx +32 -0
  51. package/src/docs/compsdocs/grid/Container.mdx +42 -0
  52. package/src/docs/compsdocs/grid/Footer.mdx +31 -0
  53. package/src/docs/compsdocs/grid/GridLayout.mdx +32 -0
  54. package/src/docs/compsdocs/grid/Header.mdx +31 -0
  55. package/src/docs/compsdocs/grid/Layout.mdx +25 -0
  56. package/src/docs/compsdocs/grid/List.mdx +31 -0
  57. package/src/docs/compsdocs/grid/ScrollView.mdx +37 -0
  58. package/src/docs/compsdocs/grid/Swiper.mdx +58 -0
  59. package/src/docs/compsdocs/grid/_category_.json +1 -0
  60. package/src/docs/compsdocs/media/Icon.mdx +31 -0
  61. package/src/docs/compsdocs/media/Image.mdx +55 -0
  62. package/src/docs/compsdocs/media/_category_.json +1 -0
  63. package/src/docs/compsdocs/model/ModelCreate.mdx +20 -0
  64. package/src/docs/compsdocs/model/ModelDetail.mdx +20 -0
  65. package/src/docs/compsdocs/model/ModelTable.mdx +24 -0
  66. package/src/docs/compsdocs/model/ModelUpdate.mdx +21 -0
  67. package/src/docs/compsdocs/model/PageLayout.mdx +21 -0
  68. package/src/docs/compsdocs/model/_category_.json +1 -0
  69. package/src/docs/compsdocs/navmenu/Classification.mdx +38 -0
  70. package/src/docs/compsdocs/navmenu/NavBar.mdx +43 -0
  71. package/src/docs/compsdocs/navmenu/NavLayout.mdx +30 -0
  72. package/src/docs/compsdocs/navmenu/TabBar.mdx +43 -0
  73. package/src/docs/compsdocs/navmenu/TabBarItem.mdx +29 -0
  74. package/src/docs/compsdocs/navmenu/_category_.json +1 -0
  75. package/src/docs/compsdocs/senior/Lottery.mdx +48 -0
  76. package/src/docs/compsdocs/senior/Modal.mdx +58 -0
  77. package/src/docs/compsdocs/senior/SlotMachine.mdx +52 -0
  78. package/src/docs/compsdocs/senior/_category_.json +1 -0
  79. package/src/docs/compsdocs/show/Calendar.mdx +29 -0
  80. package/src/docs/compsdocs/show/Divider.mdx +31 -0
  81. package/src/docs/compsdocs/show/GraphicCard.mdx +30 -0
  82. package/src/docs/compsdocs/show/Item.mdx +32 -0
  83. package/src/docs/compsdocs/show/ItemList.mdx +47 -0
  84. package/src/docs/compsdocs/show/Media.mdx +25 -0
  85. package/src/docs/compsdocs/show/StatusTip.mdx +25 -0
  86. package/src/docs/compsdocs/show/Swiper.mdx +33 -0
  87. package/src/docs/compsdocs/show/Tabs.mdx +38 -0
  88. package/src/docs/compsdocs/show/_category_.json +1 -0
  89. package/src/docs/compsdocs/show/button.mdx +25 -0
  90. package/src/docs/compsdocs/text/Link.mdx +43 -0
  91. package/src/docs/compsdocs/text/RichTextView.mdx +36 -0
  92. package/src/docs/compsdocs/text/Text.mdx +31 -0
  93. package/src/docs/compsdocs/text/Title.mdx +32 -0
  94. package/src/docs/compsdocs/text/_category_.json +1 -0
  95. package/src/docs/compsdocs/wxOpen/Phone.mdx +60 -0
  96. package/src/docs/compsdocs/wxOpen/Share.mdx +46 -0
  97. package/src/docs/compsdocs/wxOpen/UserInfo.mdx +60 -0
  98. package/src/docs/compsdocs/wxOpen/_category_.json +4 -0
  99. package/src/mp/components/button/index.js +18 -2
  100. package/src/mp/components/button/index.wxml +6 -2
  101. package/src/mp/components/form/formcell/index.wxml +1 -1
  102. package/src/mp/components/form/formcell/index.wxss +17 -0
  103. package/src/mp/components/form/input/index.wxss +15 -0
  104. package/src/mp/components/form/location/index.wxss +4 -6
  105. package/src/mp/components/form/select/index.js +5 -3
  106. package/src/mp/components/form/select/index.wxss +4 -0
  107. package/src/mp/components/form/textarea/index.js +1 -1
  108. package/src/mp/components/form/textarea/index.wxss +4 -0
  109. package/src/mp/components/form/uploader/index.json +3 -2
  110. package/src/mp/components/form/uploader/index.wxml +11 -7
  111. package/src/mp/components/form/uploader/index.wxss +20 -2
  112. package/src/mp/components/form/uploader/weui-uploader.js +209 -0
  113. package/src/mp/components/form/uploader/weui-uploader.json +7 -0
  114. package/src/mp/components/form/uploader/weui-uploader.wxml +45 -0
  115. package/src/mp/components/form/uploader/weui-uploader.wxss +1 -0
  116. package/src/mp/components/form/uploaderFile/index.wxss +4 -4
  117. package/src/mp/components/image/index.wxss +3 -2
  118. package/src/mp/style/weda-ui.wxss +14 -0
  119. package/src/web/components/button/index.tsx +7 -7
  120. package/src/web/components/calendar/index.jsx +1 -1
  121. package/src/web/components/carousel/index.tsx +8 -8
  122. package/src/web/components/form/form/index.css +5 -1
  123. package/src/web/components/form/form/index.tsx +3 -1
  124. package/src/web/components/form/formcell/index.css +22 -1
  125. package/src/web/components/form/formcell/index.tsx +2 -2
  126. package/src/web/components/form/input/index.css +7 -12
  127. package/src/web/components/form/location/components/LocationH5/index.css +4 -7
  128. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +1 -1
  129. package/src/web/components/form/select/index.css +5 -0
  130. package/src/web/components/form/textarea/index.css +4 -0
  131. package/src/web/components/form/textarea/index.tsx +2 -2
  132. package/src/web/components/form/uploader/index.css +26 -2
  133. package/src/web/components/form/uploader/uploader.h5.tsx +81 -56
  134. package/src/web/components/form/uploaderFile/index.css +2 -4
  135. package/src/web/components/image/index.css +3 -3
  136. package/src/web/components/image/index.tsx +6 -7
  137. package/src/web/components/link/index.tsx +2 -2
  138. package/src/web/components/listView/index.tsx +2 -2
  139. package/src/web/components/navLayout/index.tsx +2 -2
  140. package/src/web/components/navigationBar/index.tsx +0 -1
  141. package/src/web/components/picker/timePicker.tsx +2 -2
  142. package/src/web/components/slot/index.tsx +1 -1
  143. package/src/web/components/text/index.tsx +6 -6
  144. package/src/web/weda-ui.css +5 -1
@@ -0,0 +1,45 @@
1
+ <view class="weui-uploader {{extClass}}">
2
+ <view class="weui-uploader__hd {{layout}}">
3
+ <view class="weda-formcells__label weui-cell">
4
+ <block wx:if="{{layout === 'horizontal'}}">
5
+ <view class="">
6
+ <view class="weui-uploader__title">{{title}}</view>
7
+ <view class="weui-uploader__info" wx:if="{{maxCount > 1}}">{{currentFiles.length}}/{{maxCount}}</view>
8
+ </view>
9
+ <label wx:if="{{true}}" class="weda-formcells__flag">*</label>
10
+ </block>
11
+ <block wx:if="{{layout === 'vertical'}}">
12
+ <view class="weui-uploader__label">
13
+ <view class="weui-uploader__title">{{title}}</view>
14
+ <label wx:if="{{true}}" class="weda-formcells__flag">*</label>
15
+ </view>
16
+ <view class="weui-uploader__info" wx:if="{{maxCount > 1}}">{{currentFiles.length}}/{{maxCount}}</view>
17
+ </block>
18
+ </view>
19
+ </view>
20
+ <view class="weui-uploader__bd">
21
+ <view class="weui-uploader__files">
22
+ <block wx:for="{{currentFiles}}" wx:key="*this">
23
+ <view wx:if="{{item.error}}" data-index="{{index}}" bindtap="previewImage" class="weui-uploader__file weui-uploader__file_status">
24
+ <image class="weui-uploader__img" src="{{item.url}}" mode="aspectFill" />
25
+ <view class="weui-uploader__file-content">
26
+ <icon type="warn" size="23" color="#F43530"></icon>
27
+ </view>
28
+ </view>
29
+ <view wx:elif="{{item.loading}}" data-index="{{index}}" bindtap="previewImage" class="weui-uploader__file weui-uploader__file_status">
30
+ <image class="weui-uploader__img" src="{{item.url}}" mode="aspectFill" />
31
+ <view class="weui-uploader__file-content">
32
+ <view class="weui-loading"></view>
33
+ </view>
34
+ </view>
35
+ <view wx:else class="weui-uploader__file" data-index="{{index}}" bindtap="previewImage">
36
+ <image class="weui-uploader__img" src="{{item.url}}" mode="aspectFill" />
37
+ </view>
38
+ </block>
39
+ </view>
40
+ <view wx:if="{{currentFiles.length < maxCount}}" class="weui-uploader__input-box" hover-class="weui-active">
41
+ <view class="weui-uploader__input" bindtap="chooseImage"></view>
42
+ </view>
43
+ </view>
44
+ <mp-gallery class="gallery" hide-on-click="{{true}}" show-delete="{{showDelete}}" show="{{showPreview}}" binddelete="deletePic" img-urls="{{previewImageUrls}}" current="{{previewCurrent}}"></mp-gallery>
45
+ </view>
@@ -0,0 +1 @@
1
+ /* materials/gsd-h5-react/components/form/uploader/weui-uploader.wxss */
@@ -5,7 +5,8 @@
5
5
  }
6
6
  .weda-uploader-files__hd {
7
7
  width: 100%;
8
- padding: 24px 20px 8px 20px;
8
+ padding: 16px;
9
+ padding-left: 0;
9
10
  display: flex;
10
11
  background-color: #ffffff;
11
12
  }
@@ -20,9 +21,8 @@
20
21
  .weda-uploader-files__title {
21
22
  font-size: 14px;
22
23
  line-height: 20px;
23
- color: #000;
24
- margin-right: 20px;
25
- padding-top: 6px;
24
+ padding: 16px;
25
+ width: 130px;
26
26
  }
27
27
  .weda-uploader-files__btn {
28
28
  margin: 0;
@@ -32,7 +32,8 @@
32
32
  }
33
33
 
34
34
  .weda-image-error {
35
- position: relative;
35
+ position: relative !important;
36
+ display: inline-block !important;
36
37
  }
37
38
 
38
39
  .weda-image-error::before {
@@ -43,4 +44,4 @@
43
44
  top: 0;
44
45
  width: 100%;
45
46
  height: 100%;
46
- }
47
+ }
@@ -40,3 +40,17 @@ page .weda-ui {
40
40
  .weda-ui.weda-picker .weui-btn_primary:not(.weui-btn_disabled):active {
41
41
  background-color: var(--weui-TAG-TEXT-BLUE);
42
42
  }
43
+
44
+ .weda-ui .weui-cell {
45
+ font-size: 16px; /* 修改默认weui的17为16 */
46
+ }
47
+
48
+ .weui-cells__group_form .weui-cell::before, .weui-cells__group_form .weui-cells::before {
49
+ left: 16px;
50
+ right: 16px;
51
+ }
52
+
53
+ .weui-cells__group_form .weui-cells::after {
54
+ left: 16px;
55
+ right: 16px;
56
+ }
@@ -8,13 +8,13 @@ import './index.css';
8
8
 
9
9
  // 不用 react-weui 而直接用底层实现的原因是 react-weui 不能支持表单类型
10
10
  const Button = ({
11
- text = '按钮',
12
- size = 'default',
13
- type = 'primary',
11
+ text,
12
+ size,
13
+ type,
14
14
  contentSlot,
15
15
  formType,
16
- loading = false,
17
- disabled = false,
16
+ loading,
17
+ disabled,
18
18
  events = ({} as Record<string, unknownFunction>),
19
19
  className,
20
20
  style,
@@ -61,7 +61,7 @@ const Button = ({
61
61
  return (
62
62
  <ConfigProvider classPrefix="wedatea2td">
63
63
  <TeaButton
64
- loading={loading}
64
+ loading={loading}
65
65
  onClick={onClick}
66
66
  disabled={disabled}
67
67
  htmlType={formType}
@@ -112,4 +112,4 @@ export interface PropsType extends CommonPropsType {
112
112
  contentSlot?: string;
113
113
  }
114
114
 
115
- export default Button;
115
+ export default Button;
@@ -19,7 +19,7 @@ const isShowWeekend = true; // 是否显示周末
19
19
  export default function Calendar({
20
20
  className,
21
21
  style,
22
- initVisible = true,
22
+ initVisible,
23
23
  initValue,
24
24
  configData = [],
25
25
  }) {
@@ -50,15 +50,15 @@ export interface PropsType extends CommonPropsType {
50
50
  export default function Carousel({
51
51
  className,
52
52
  style = {},
53
- autoplay = true,
54
- circular = true,
55
- vertical = false,
53
+ autoplay,
54
+ circular,
55
+ vertical,
56
56
  indicatorDots,
57
- indicatorColor = 'rgba(200, 200, 200, 0.9)',
58
- indicatorActiveColor = 'rgba(0, 0, 0, 0.9)',
59
- duration = 500,
60
- interval = 5000,
61
- current = 0,
57
+ indicatorColor,
58
+ indicatorActiveColor,
59
+ duration,
60
+ interval,
61
+ current,
62
62
  events = {},
63
63
  id,
64
64
  images,
@@ -5,4 +5,8 @@
5
5
  .wedatea2td-form > .gsd-h5-react-formitem,
6
6
  .wedatea2td-form > div > .gsd-h5-react-formitem {
7
7
  padding-left: 32px;
8
- }
8
+ }
9
+
10
+ .weda-ui.weda-form-pc, .weda-ui.gsd-h5-react-form-pc {
11
+ padding-left: 24px;
12
+ }
@@ -22,6 +22,8 @@ export default function Form({
22
22
  'weda-ui': true,
23
23
  'weda-form': true,
24
24
  'weui-form': platform === 'h5',
25
+ 'weda-form-pc': platform === 'pc',
26
+ 'gsd-h5-react-form-pc': platform === 'pc',
25
27
  [className]: className,
26
28
  });
27
29
  if(platform === 'pc') {
@@ -45,4 +47,4 @@ export default function Form({
45
47
 
46
48
  export interface PropsType extends CommonFormPropsType {
47
49
  contentSlot?: any;
48
- }
50
+ }
@@ -4,7 +4,28 @@
4
4
  font-family: SimSun;
5
5
  font-size: 12px;
6
6
  color: #f60;
7
+ align-self: flex-start;
7
8
  }
9
+
10
+ .weda-ui .weui-cells__group_form .weui-cells {
11
+ margin: 0;
12
+ }
13
+ .weda-formcells.weui-flex .weda-formcells__label {
14
+ width: 130px;
15
+ }
16
+ .weui-cells__group_form .weui-cell {
17
+ padding: 16px 16px;
18
+ }
19
+
20
+ .weda-formcells__content.weui-flex__item .weui-cell_form {
21
+ padding: 0;
22
+ }
23
+
24
+ .weda-formcells__content.weui-flex__item .weui-cell_form {
25
+ padding-right: 16px;
26
+ }
27
+
28
+
8
29
  /* formcell 在 form container 外部兼容 and 独立 layout 适配 */
9
30
 
10
31
  .weda-formcells__pc.vertical .wedatea2td-form__controls,
@@ -68,4 +89,4 @@
68
89
  /*formcell end*/
69
90
 
70
91
 
71
- /* formcell 在 form container 外部兼容 */
92
+ /* formcell 在 form container 外部兼容 */
@@ -35,8 +35,8 @@ export default function FormCell({
35
35
  })}
36
36
  label={
37
37
  <>
38
- {requiredFlag && <span className="weda-formcells__flag">*</span>}
39
38
  {label}
39
+ {requiredFlag && <span className="weda-formcells__flag">*</span>}
40
40
  </>
41
41
  }
42
42
  >
@@ -64,10 +64,10 @@ export default function FormCell({
64
64
  'weui-cell': true,
65
65
  })}
66
66
  >
67
+ <label>{label}</label>
67
68
  {requiredFlag ? (
68
69
  <label className="weda-formcells__flag">*</label>
69
70
  ) : null}
70
- <label>{label}</label>
71
71
  </div>
72
72
  ) : null}
73
73
  <div
@@ -7,22 +7,17 @@
7
7
  /*
8
8
  把weui-cell 的padding还回到input
9
9
  */
10
- .weda-ui.weda-input input.weui-input {
11
- padding: 28px 16px;
10
+ .weda-ui input.weui-input {
11
+ padding: 28px 0;
12
12
  }
13
13
 
14
- .weda-ui.weda-input .weui-cell.weda-formcells__label {
15
- padding: 16px;
16
- }
17
- .weda-ui.weda-input .weda-formcells__label.weui-cell label {
18
- padding: 0;
19
- }
20
- .weda-ui.weda-input .weui-cell {
14
+ .weda-ui.weda-input .weui-flex__item .weui-cell_form {
21
15
  padding: 0;
16
+ padding-right: 16px;
22
17
  }
23
18
 
24
- .weda-ui.weda-input .weui-btn_input-clear {
25
- padding-right: 16px;
19
+ .weda-ui.weda-input .weui-cell_form {
20
+ padding: 0 16px;
26
21
  }
27
22
 
28
23
  /**
@@ -38,4 +33,4 @@
38
33
  }
39
34
  /**
40
35
  * END
41
- */
36
+ */
@@ -1,7 +1,3 @@
1
- .weda-ui_form-location {
2
- padding: 1.14286rem 0;
3
- }
4
-
5
1
  .form-location-warp {
6
2
  display: flex;
7
3
  white-space: nowrap;
@@ -10,7 +6,9 @@
10
6
  .form-location-label {
11
7
  display: flex;
12
8
  align-items: center;
13
- padding: 0 1.14286rem;
9
+ padding: 16px;
10
+ width: 130px;
11
+
14
12
  }
15
13
  .form-location-label > span {
16
14
  margin-right: 0.28571rem;
@@ -19,8 +17,7 @@
19
17
  color: #f60;
20
18
  }
21
19
 
22
- .form-location-con {
23
- padding-left: 1.14286rem;
20
+ .weda-ui .form-location-con {
24
21
  display: flex;
25
22
  align-items: center;
26
23
  }
@@ -329,8 +329,8 @@ export default function LocationH5(props) {
329
329
  <div className="form-location-warp">
330
330
  {labelVisible && (
331
331
  <div className="form-location-label">
332
- {requiredFlag && <span>*</span>}
333
332
  {label}
333
+ {requiredFlag && <span>*</span>}
334
334
  </div>
335
335
  )}
336
336
  <div className="form-location-con">
@@ -1,3 +1,8 @@
1
+ .weda-ui .weui-cell.weui-check__label {
2
+ padding: 16px;
3
+ padding-left: 0;
4
+ }
5
+
1
6
  .year-picker__overlay {
2
7
  width: 300px;
3
8
  }
@@ -1,3 +1,7 @@
1
1
  .weda-textarea textarea {
2
2
  height: 8.6rem;
3
3
  }
4
+
5
+ .weda-ui .weda-textarea .weui-cell_form {
6
+ padding: 16px;
7
+ }
@@ -45,7 +45,7 @@ export default function Textarea({
45
45
  // 两次默认值不同时, 需要刷新value
46
46
  const [value, setValue] = useSyncValue(defaultValue);
47
47
  const counter = React.useMemo(() => (value?.length || 0), [value]);
48
-
48
+
49
49
  const onChange = function (e) {
50
50
  const text = typeof e === 'string' ? e : e.target.value;
51
51
  setValue(text);
@@ -111,4 +111,4 @@ export interface PropsType extends CommonFormPropsType {
111
111
  focus?: boolean;
112
112
  counterVisible?: boolean;
113
113
  size?: 's' | 'm' | 'l' | 'full';
114
- }
114
+ }
@@ -79,6 +79,30 @@
79
79
  display: flex;
80
80
  justify-content: space-between;
81
81
  }
82
- .weui-uploader.horizontal .weui-uploader__bd {
83
- padding-left: 2.28571rem;
82
+
83
+ .weui-uploader.horizontal .weda-formcells__label {
84
+ width: 130px;
85
+ }
86
+
87
+ .weda-ui .weui-uploader__hd {
88
+ display: block;
89
+ }
90
+
91
+ .weui-uploader__label {
92
+ display: flex;
93
+ flex: 1;
94
+ }
95
+ .weui-uploader.vertical .weui-uploader__title {
96
+ flex: unset;
97
+ }
98
+
99
+ .weda-ui .weui-uploader.horizontal .weui-uploader__bd {
100
+ padding: 16px 0;
101
+ }
102
+ .weda-ui .weui-uploader.vertical .weui-uploader__bd {
103
+ padding: 16px;
104
+ }
105
+
106
+ .weui-uploader__hd.vertical {
107
+ padding-bottom: 0;
84
108
  }
@@ -130,65 +130,55 @@ export function ImageUploaderH5({
130
130
  }, [fileIdList, single, maxUploadCount]);
131
131
  return (
132
132
  <div className={cls} id={id} style={style}>
133
- <div className="weui-cell">
134
- <div className="weui-cell__bd">
135
- <div className={classNames('weui-uploader', layout)}>
136
- <div className={classNames('weui-uploader__hd', layout)}>
137
- {requiredFlag && (
138
- <label className="weda-formcells__flag">*</label>
139
- )}
140
- <p className="weui-uploader__title">{title}</p>
141
- <div className="weui-uploader__info">
142
- <span id="uploadCount">{fileIdList.length}</span>
143
- {`/${finalMaxImgCount}`}
144
- </div>
145
- </div>
146
- <div className="weui-uploader__bd">
147
- <ul className="weui-uploader__files" id="uploaderFiles">
148
- {(fileIdList ?? []).map((f) => (
149
- <SingleImage key={f} src={f} deleteBySrc={deleteFile} />
150
- ))}
151
- {uploading && (
152
- <li className="weui-uploader__file weui-uploader__file_status">
153
- <div className="weui-uploader__file-content">
154
- {progress}%
155
- </div>
156
- </li>
157
- )}
158
- </ul>
159
- {showAdd && (
160
- <div className="weui-uploader__input-box">
161
- <input
162
- id="uploaderInput"
163
- className="weui-uploader__input"
164
- type="file"
165
- accept={accepts.join(',')}
166
- multiple
167
- onChange={(e) => {
168
- const files = [...e.target.files];
169
- if (files.some((f) => f.size > maxSize * 1024 * 1024)) {
170
- weui.alert('请上传不超过10M的图片');
171
- return false;
172
- }
133
+ <div className={classNames('weui-uploader', layout)}>
134
+ <div className={classNames('weui-uploader__hd', layout)}>
135
+ <UploaderLabel layout={layout} title={title} currentCount={fileIdList.length} maxCount={finalMaxImgCount} requiredFlag={requiredFlag} />
136
+ </div>
173
137
 
174
- if (files.length > finalMaxImgCount) {
175
- // 防止一下子选择过多文件
176
- weui.alert(
177
- `最多只能上传${finalMaxImgCount}张图片,请重新选择`
178
- );
179
- return false;
180
- }
181
- if (fileIdList.length + files.length > finalMaxImgCount) {
182
- weui.alert(`最多只能上传${finalMaxImgCount}张图片`);
183
- return false;
184
- }
185
- files.forEach((f) => uploadToTcb(f));
186
- }}
187
- />
138
+ <div className="weui-uploader__bd">
139
+ <ul className="weui-uploader__files" id="uploaderFiles">
140
+ {(fileIdList ?? []).map((f) => (
141
+ <SingleImage key={f} src={f} deleteBySrc={deleteFile} />
142
+ ))}
143
+ {uploading && (
144
+ <li className="weui-uploader__file weui-uploader__file_status">
145
+ <div className="weui-uploader__file-content">
146
+ {progress}%
188
147
  </div>
189
- )}
148
+ </li>
149
+ )}
150
+ </ul>
151
+ {showAdd && (
152
+ <div className="weui-uploader__input-box">
153
+ <input
154
+ id="uploaderInput"
155
+ className="weui-uploader__input"
156
+ type="file"
157
+ accept={accepts.join(',')}
158
+ multiple
159
+ onChange={(e) => {
160
+ const files = [...e.target.files];
161
+ if (files.some((f) => f.size > maxSize * 1024 * 1024)) {
162
+ weui.alert('请上传不超过10M的图片');
163
+ return false;
164
+ }
165
+
166
+ if (files.length > finalMaxImgCount) {
167
+ // 防止一下子选择过多文件
168
+ weui.alert(
169
+ `最多只能上传${finalMaxImgCount}张图片,请重新选择`
170
+ );
171
+ return false;
172
+ }
173
+ if (fileIdList.length + files.length > finalMaxImgCount) {
174
+ weui.alert(`最多只能上传${finalMaxImgCount}张图片`);
175
+ return false;
176
+ }
177
+ files.forEach((f) => uploadToTcb(f));
178
+ }}
179
+ />
190
180
  </div>
191
- </div>
181
+ )}
192
182
  </div>
193
183
  </div>
194
184
  </div>
@@ -260,3 +250,38 @@ export interface H5UploaderProps extends CommonFormPropsType {
260
250
  single?: boolean; // 单张上传还是多张上传,对应 onChange 参数为字符串还是字符串数组,value 在处理过程统一转为字符串数组;
261
251
  onChange?: (v: any) => void;
262
252
  }
253
+
254
+ const UploaderLabel = ({layout, title, currentCount, maxCount, requiredFlag}) => {
255
+ if(layout === 'horizontal') {
256
+ return (
257
+ <React.Fragment>
258
+ <div className='weda-formcells__label weui-cell'>
259
+ <div>
260
+ <p className="weui-uploader__title">{title}</p>
261
+ <div className="weui-uploader__info">
262
+ <span id="uploadCount">{currentCount}</span>
263
+ {`/${maxCount}`}
264
+ </div>
265
+ </div>
266
+ {requiredFlag && (
267
+ <label className="weda-formcells__flag">*</label>
268
+ )}
269
+ </div>
270
+ </React.Fragment>
271
+ )
272
+ }
273
+ return (
274
+ <div className='weda-formcells__label weui-cell'>
275
+ <div className='weui-uploader__label'>
276
+ <p className="weui-uploader__title">{title}</p>
277
+ {requiredFlag && (
278
+ <label className="weda-formcells__flag">*</label>
279
+ )}
280
+ </div>
281
+ <div className="weui-uploader__info">
282
+ <span id="uploadCount">{currentCount}</span>
283
+ {`/${maxCount}`}
284
+ </div>
285
+ </div>
286
+ )
287
+ }
@@ -76,9 +76,6 @@
76
76
  display: flex;
77
77
  justify-content: space-between;
78
78
  }
79
- .weui-uploader.horizontal .weui-uploader__bd {
80
- padding-left: 2.28571rem;
81
- }
82
79
 
83
80
  /* ----上传文件---- pc */
84
81
  .weda-upload-file-pc .weda-upload-file-pc__file-item {
@@ -230,7 +227,8 @@
230
227
 
231
228
  .weda-upload-file-mobile .weda-upload-file-mobile__hd {
232
229
  width: 100%;
233
- padding: 24px 20px 8px 20px;
230
+ padding: 16px;
231
+ padding-left: 0;
234
232
  display: flex;
235
233
  background-color: #fff;
236
234
  }
@@ -36,8 +36,8 @@
36
36
  }
37
37
 
38
38
  .weda-image.weda-image-error {
39
- position: relative;
40
- display: inline-block;
39
+ position: relative !important;
40
+ display: inline-block !important;
41
41
  }
42
42
 
43
43
  .weda-image:not([src]):before,
@@ -49,4 +49,4 @@
49
49
  top: 0;
50
50
  width: 100%;
51
51
  height: 100%;
52
- }
52
+ }
@@ -23,12 +23,12 @@ export default function Image({
23
23
  events = {},
24
24
  style = {},
25
25
  // 组件属性
26
- src = defaultSrc,
27
- alt = '[图片]',
28
- mode = 'scaleToFill',
29
- lazyLoad = false,
30
- imgPreview = false,
31
- maskClosable = true,
26
+ src,
27
+ alt,
28
+ mode,
29
+ lazyLoad,
30
+ imgPreview,
31
+ maskClosable,
32
32
  fit,
33
33
  }: PropsType) {
34
34
  const [isError, setIsError] = useState(false);
@@ -102,4 +102,3 @@ function getObjectFitByWxImageMode(mode: TMode): React.CSSProperties['objectFit'
102
102
  const item = array.find((item) => item.mode === mode);
103
103
  return item?.h5;
104
104
  }
105
-
@@ -23,14 +23,14 @@ export interface PropsType extends CommonPropsType {
23
23
  // 所有绝对地址直接交由浏览器,新开窗口交由浏览器
24
24
  // 当前窗口相对地址交给平台
25
25
  export default function Link({
26
- content = '这是一个链接',
26
+ content,
27
27
  url = '',
28
28
  events = {},
29
29
  style,
30
30
  className,
31
31
  contentSlot,
32
32
  params = [], // TODO 格式定义,
33
- isOpenInNewWindow = false,
33
+ isOpenInNewWindow,
34
34
  }: PropsType) {
35
35
  url = url.trim();
36
36
  const cls = classNames({
@@ -50,9 +50,9 @@ export default function ListView(props: IListView) {
50
50
  orderBy,
51
51
  orderType,
52
52
  where,
53
- template = 'simpleList',
53
+ template,
54
54
  pageSize = 5,
55
- pagination = 'loadMoreButton',
55
+ pagination,
56
56
  events,
57
57
  className,
58
58
  children,
@@ -14,8 +14,8 @@ const CLASS_PREFIX = 'weda-grid-navigation';
14
14
 
15
15
  export default function NavLayout({
16
16
  navOption,
17
- mobileCol = 4,
18
- pcCol = 4,
17
+ mobileCol,
18
+ pcCol,
19
19
  iconSize,
20
20
  textColor,
21
21
  fontSize,
@@ -1,4 +1,3 @@
1
- /* eslint-disable react/jsx-key */
2
1
  import React, { useState, useEffect } from 'react';
3
2
  import { CommonPropsType } from '../../types';
4
3
  import classNames from '../../utils/classnames';