@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.
- package/package.json +2 -2
- package/src/configs/components/button.json +0 -2
- package/src/configs/components/calendar.json +5 -2
- package/src/configs/components/carousel.json +18 -9
- package/src/configs/components/chart/bar.json +12 -6
- package/src/configs/components/chart/line.json +8 -4
- package/src/configs/components/chart/pie.json +8 -4
- package/src/configs/components/dataView.json +10 -5
- package/src/configs/components/form/radio.json +27 -0
- package/src/configs/components/form/select.json +2 -2
- package/src/configs/components/graphicCard.json +6 -2
- package/src/configs/components/image.json +12 -6
- package/src/configs/components/link.json +6 -3
- package/src/configs/components/listView.json +20 -10
- package/src/configs/components/lottery.json +4 -2
- package/src/configs/components/navLayout.json +12 -6
- package/src/configs/components/richtextview.json +2 -1
- package/src/configs/components/scrollVeiw.json +24 -12
- package/src/configs/components/swiper.json +18 -9
- package/src/configs/components/tabs.json +4 -2
- package/src/configs/components/text.json +10 -5
- package/src/docs/common/format.tsx +112 -0
- package/src/docs/common/tableView.css +164 -0
- package/src/docs/common/tableView.tsx +273 -0
- package/src/docs/compsdocs/chart/Bar.mdx +159 -0
- package/src/docs/compsdocs/chart/Line.mdx +100 -0
- package/src/docs/compsdocs/chart/Pie.mdx +83 -0
- package/src/docs/compsdocs/chart/_category_.json +1 -0
- package/src/docs/compsdocs/chart/statisticsCard.mdx +51 -0
- package/src/docs/compsdocs/database/DataView.mdx +33 -0
- package/src/docs/compsdocs/database/ListView.mdx +33 -0
- package/src/docs/compsdocs/database/_category_.json +1 -0
- package/src/docs/compsdocs/form/Form.mdx +35 -0
- package/src/docs/compsdocs/form/FormCheckbox.mdx +35 -0
- package/src/docs/compsdocs/form/FormDate.mdx +30 -0
- package/src/docs/compsdocs/form/FormEmail.mdx +30 -0
- package/src/docs/compsdocs/form/FormImageUploader.mdx +31 -0
- package/src/docs/compsdocs/form/FormInput.mdx +30 -0
- package/src/docs/compsdocs/form/FormLocation.mdx +64 -0
- package/src/docs/compsdocs/form/FormPhone.mdx +30 -0
- package/src/docs/compsdocs/form/FormRadio.mdx +35 -0
- package/src/docs/compsdocs/form/FormRegion.mdx +30 -0
- package/src/docs/compsdocs/form/FormSelect.mdx +36 -0
- package/src/docs/compsdocs/form/FormSwitch.mdx +30 -0
- package/src/docs/compsdocs/form/FormTextarea.mdx +30 -0
- package/src/docs/compsdocs/form/FormTime.mdx +30 -0
- package/src/docs/compsdocs/form/FormUploadFile.mdx +30 -0
- package/src/docs/compsdocs/form/FormUrl.mdx +30 -0
- package/src/docs/compsdocs/form/_category_.json +1 -0
- package/src/docs/compsdocs/grid/Card.mdx +32 -0
- package/src/docs/compsdocs/grid/Container.mdx +42 -0
- package/src/docs/compsdocs/grid/Footer.mdx +31 -0
- package/src/docs/compsdocs/grid/GridLayout.mdx +32 -0
- package/src/docs/compsdocs/grid/Header.mdx +31 -0
- package/src/docs/compsdocs/grid/Layout.mdx +25 -0
- package/src/docs/compsdocs/grid/List.mdx +31 -0
- package/src/docs/compsdocs/grid/ScrollView.mdx +37 -0
- package/src/docs/compsdocs/grid/Swiper.mdx +58 -0
- package/src/docs/compsdocs/grid/_category_.json +1 -0
- package/src/docs/compsdocs/media/Icon.mdx +31 -0
- package/src/docs/compsdocs/media/Image.mdx +55 -0
- package/src/docs/compsdocs/media/_category_.json +1 -0
- package/src/docs/compsdocs/model/ModelCreate.mdx +20 -0
- package/src/docs/compsdocs/model/ModelDetail.mdx +20 -0
- package/src/docs/compsdocs/model/ModelTable.mdx +24 -0
- package/src/docs/compsdocs/model/ModelUpdate.mdx +21 -0
- package/src/docs/compsdocs/model/PageLayout.mdx +21 -0
- package/src/docs/compsdocs/model/_category_.json +1 -0
- package/src/docs/compsdocs/navmenu/Classification.mdx +38 -0
- package/src/docs/compsdocs/navmenu/NavBar.mdx +43 -0
- package/src/docs/compsdocs/navmenu/NavLayout.mdx +30 -0
- package/src/docs/compsdocs/navmenu/TabBar.mdx +43 -0
- package/src/docs/compsdocs/navmenu/TabBarItem.mdx +29 -0
- package/src/docs/compsdocs/navmenu/_category_.json +1 -0
- package/src/docs/compsdocs/senior/Lottery.mdx +48 -0
- package/src/docs/compsdocs/senior/Modal.mdx +58 -0
- package/src/docs/compsdocs/senior/SlotMachine.mdx +52 -0
- package/src/docs/compsdocs/senior/_category_.json +1 -0
- package/src/docs/compsdocs/show/Calendar.mdx +29 -0
- package/src/docs/compsdocs/show/Divider.mdx +31 -0
- package/src/docs/compsdocs/show/GraphicCard.mdx +30 -0
- package/src/docs/compsdocs/show/Item.mdx +32 -0
- package/src/docs/compsdocs/show/ItemList.mdx +47 -0
- package/src/docs/compsdocs/show/Media.mdx +25 -0
- package/src/docs/compsdocs/show/StatusTip.mdx +25 -0
- package/src/docs/compsdocs/show/Swiper.mdx +33 -0
- package/src/docs/compsdocs/show/Tabs.mdx +38 -0
- package/src/docs/compsdocs/show/_category_.json +1 -0
- package/src/docs/compsdocs/show/button.mdx +25 -0
- package/src/docs/compsdocs/text/Link.mdx +43 -0
- package/src/docs/compsdocs/text/RichTextView.mdx +36 -0
- package/src/docs/compsdocs/text/Text.mdx +31 -0
- package/src/docs/compsdocs/text/Title.mdx +32 -0
- package/src/docs/compsdocs/text/_category_.json +1 -0
- package/src/docs/compsdocs/wxOpen/Phone.mdx +60 -0
- package/src/docs/compsdocs/wxOpen/Share.mdx +46 -0
- package/src/docs/compsdocs/wxOpen/UserInfo.mdx +60 -0
- package/src/docs/compsdocs/wxOpen/_category_.json +4 -0
- package/src/mp/components/button/index.js +18 -2
- package/src/mp/components/button/index.wxml +6 -2
- package/src/mp/components/form/formcell/index.wxml +1 -1
- package/src/mp/components/form/formcell/index.wxss +17 -0
- package/src/mp/components/form/input/index.wxss +15 -0
- package/src/mp/components/form/location/index.wxss +4 -6
- package/src/mp/components/form/select/index.js +5 -3
- package/src/mp/components/form/select/index.wxss +4 -0
- package/src/mp/components/form/textarea/index.js +1 -1
- package/src/mp/components/form/textarea/index.wxss +4 -0
- package/src/mp/components/form/uploader/index.json +3 -2
- package/src/mp/components/form/uploader/index.wxml +11 -7
- package/src/mp/components/form/uploader/index.wxss +20 -2
- package/src/mp/components/form/uploader/weui-uploader.js +209 -0
- package/src/mp/components/form/uploader/weui-uploader.json +7 -0
- package/src/mp/components/form/uploader/weui-uploader.wxml +45 -0
- package/src/mp/components/form/uploader/weui-uploader.wxss +1 -0
- package/src/mp/components/form/uploaderFile/index.wxss +4 -4
- package/src/mp/components/image/index.wxss +3 -2
- package/src/mp/style/weda-ui.wxss +14 -0
- package/src/web/components/button/index.tsx +7 -7
- package/src/web/components/calendar/index.jsx +1 -1
- package/src/web/components/carousel/index.tsx +8 -8
- package/src/web/components/form/form/index.css +5 -1
- package/src/web/components/form/form/index.tsx +3 -1
- package/src/web/components/form/formcell/index.css +22 -1
- package/src/web/components/form/formcell/index.tsx +2 -2
- package/src/web/components/form/input/index.css +7 -12
- package/src/web/components/form/location/components/LocationH5/index.css +4 -7
- package/src/web/components/form/location/components/LocationH5/location.h5.jsx +1 -1
- package/src/web/components/form/select/index.css +5 -0
- package/src/web/components/form/textarea/index.css +4 -0
- package/src/web/components/form/textarea/index.tsx +2 -2
- package/src/web/components/form/uploader/index.css +26 -2
- package/src/web/components/form/uploader/uploader.h5.tsx +81 -56
- package/src/web/components/form/uploaderFile/index.css +2 -4
- package/src/web/components/image/index.css +3 -3
- package/src/web/components/image/index.tsx +6 -7
- package/src/web/components/link/index.tsx +2 -2
- package/src/web/components/listView/index.tsx +2 -2
- package/src/web/components/navLayout/index.tsx +2 -2
- package/src/web/components/navigationBar/index.tsx +0 -1
- package/src/web/components/picker/timePicker.tsx +2 -2
- package/src/web/components/slot/index.tsx +1 -1
- package/src/web/components/text/index.tsx +6 -6
- 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:
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
padding-top: 6px;
|
|
24
|
+
padding: 16px;
|
|
25
|
+
width: 130px;
|
|
26
26
|
}
|
|
27
27
|
.weda-uploader-files__btn {
|
|
28
28
|
margin: 0;
|
|
@@ -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
|
|
13
|
-
type
|
|
11
|
+
text,
|
|
12
|
+
size,
|
|
13
|
+
type,
|
|
14
14
|
contentSlot,
|
|
15
15
|
formType,
|
|
16
|
-
loading
|
|
17
|
-
disabled
|
|
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;
|
|
@@ -50,15 +50,15 @@ export interface PropsType extends CommonPropsType {
|
|
|
50
50
|
export default function Carousel({
|
|
51
51
|
className,
|
|
52
52
|
style = {},
|
|
53
|
-
autoplay
|
|
54
|
-
circular
|
|
55
|
-
vertical
|
|
53
|
+
autoplay,
|
|
54
|
+
circular,
|
|
55
|
+
vertical,
|
|
56
56
|
indicatorDots,
|
|
57
|
-
indicatorColor
|
|
58
|
-
indicatorActiveColor
|
|
59
|
-
duration
|
|
60
|
-
interval
|
|
61
|
-
current
|
|
57
|
+
indicatorColor,
|
|
58
|
+
indicatorActiveColor,
|
|
59
|
+
duration,
|
|
60
|
+
interval,
|
|
61
|
+
current,
|
|
62
62
|
events = {},
|
|
63
63
|
id,
|
|
64
64
|
images,
|
|
@@ -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
|
|
11
|
-
padding: 28px
|
|
10
|
+
.weda-ui input.weui-input {
|
|
11
|
+
padding: 28px 0;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.weda-ui.weda-input .weui-
|
|
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-
|
|
25
|
-
|
|
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:
|
|
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">
|
|
@@ -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
|
-
|
|
83
|
-
|
|
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=
|
|
134
|
-
<div className=
|
|
135
|
-
<
|
|
136
|
-
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
|
27
|
-
alt
|
|
28
|
-
mode
|
|
29
|
-
lazyLoad
|
|
30
|
-
imgPreview
|
|
31
|
-
maskClosable
|
|
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
|
|
33
|
+
isOpenInNewWindow,
|
|
34
34
|
}: PropsType) {
|
|
35
35
|
url = url.trim();
|
|
36
36
|
const cls = classNames({
|