@cloudbase/weda-ui-mp 3.6.3 → 3.7.1
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/components/form/form/wd-form.wxss +15 -0
- package/components/form/uploader/index.js +3 -3
- package/components/form/uploader/weui-uploader.wxml +1 -1
- package/components/form/uploader/weui-uploader.wxss +4 -0
- package/components/form-field-behavior/form-field-behavior.js +38 -7
- package/components/form-field-behavior/validator.js +3 -2
- package/components/form-phone/index.wxml +1 -1
- package/components/formdetail/wd-form-detail.wxss +5 -0
- package/components/tooltip/wd-tooltip.wxss +6 -0
- package/components/wd-button/wd-button.wxss +6 -0
- package/components/wd-card/wd-card.wxss +6 -0
- package/components/wd-cascader/index.js +198 -0
- package/components/wd-cascader/index.json +12 -0
- package/components/wd-cascader/index.wxml +59 -0
- package/components/wd-cascader/index.wxss +2 -0
- package/components/wd-cascader/utils.js +70 -0
- package/components/wd-cascader/wd-cascader.wxss +284 -0
- package/components/wd-checkbox-list/wd-checkbox-list.wxss +6 -0
- package/components/wd-date/modal/index.js +4 -1
- package/components/wd-date/modal/index.wxml +1 -1
- package/components/wd-date/wd-date.wxss +5 -0
- package/components/wd-date-range/wd-date-range.wxss +5 -0
- package/components/wd-divider/wd-divider.wxss +6 -0
- package/components/wd-form/form-utils.js +4 -0
- package/components/wd-form/wd-form.wxss +15 -0
- package/components/wd-form-arr/index.js +330 -0
- package/components/wd-form-arr/index.json +7 -0
- package/components/wd-form-arr/index.wxml +5 -0
- package/components/wd-form-arr/index.wxss +2 -0
- package/components/wd-form-arr/wd-form-obj.wxss +51 -0
- package/components/wd-form-item/wd-form-item.wxss +15 -0
- package/components/wd-form-item-obj/index.js +113 -0
- package/components/wd-form-item-obj/index.json +8 -0
- package/components/wd-form-item-obj/index.wxml +51 -0
- package/components/wd-form-item-obj/index.wxss +2 -0
- package/components/wd-form-item-obj/wd-form-item.wxss +1106 -0
- package/components/wd-form-obj/index.js +305 -0
- package/components/wd-form-obj/index.json +7 -0
- package/components/wd-form-obj/index.wxml +5 -0
- package/components/wd-form-obj/index.wxss +2 -0
- package/components/wd-form-obj/wd-form-obj.wxss +51 -0
- package/components/wd-icon/index.json +1 -1
- package/components/wd-icon/wd-icon.wxss +6 -0
- package/components/wd-image/wd-image.wxss +6 -0
- package/components/wd-input/inner-input/wd-input.wxss +15 -0
- package/components/wd-input-group/wd-input-group.wxss +6 -0
- package/components/wd-input-number/wd-input-number.wxss +6 -0
- package/components/wd-input-wrap/wd-input-wrap.wxss +6 -0
- package/components/wd-layout/wd-layout.wxss +6 -0
- package/components/wd-menu-layout/wd-menu-layout.wxss +5 -0
- package/components/wd-menu-list/wd-menu-list.wxss +5 -0
- package/components/wd-modal/wd-modal.wxss +6 -0
- package/components/wd-progress/wd-progress.wxss +15 -0
- package/components/wd-radio-list/wd-radio-list.wxss +6 -0
- package/components/wd-rating/wd-rating.wxss +15 -0
- package/components/wd-select/select.wxss +14 -3
- package/components/wd-switch/wd-switch.wxss +15 -0
- package/components/wd-tabbar/wd-tabbar.wxss +6 -0
- package/components/wd-tabs/wd-tabs.wxss +6 -0
- package/components/wd-tag/wd-tag.wxss +6 -0
- package/components/wd-tag-select/wd-tag-select.wxss +15 -0
- package/components/wd-text/wd-text.wxss +5 -0
- package/components/wd-textarea/wd-textarea.wxss +6 -0
- package/components/wd-time/wd-time.wxss +5 -0
- package/components/wd-unified-link/wd-link.wxss +6 -0
- package/components/web-view/index.js +3 -0
- package/index.json +2 -0
- package/package.json +1 -1
- package/style/utils.wxss +5 -0
- package/style/wd-design.wxss +5 -0
- package/utils/enum.js +13 -0
- package/components/dataView/index.wxss +0 -0
- package/components/wd-audio/index.wxss +0 -0
- package/components/wd-date/calendar/index.wxss +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<block wx:if="{{visible}}">
|
|
2
|
+
<wd-form-item-obj id="{{id}}" className="{{className}}" style="{{style}}" label="{{label}}" labelVisible="{{labelVisible}}" labelTips="{{labelTips}}" labelWidth="{{labelWidth}}" labelAlign="{{labelAlign}}" labelWrap="{{labelWrap}}" extra="{{extra}}" classRoot="{{classRoot}}" layout="{{_layout}}">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</wd-form-item-obj>
|
|
5
|
+
</block>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
._B00_Xa {
|
|
3
|
+
/* 如果生成的wxss 为空文件似乎会导致IDE编译报错, 所以这里给他弄个占位 */
|
|
4
|
+
word-break: inherit;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.wd-form-obj-root {
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
.wd-form-obj-root .wd-form-obj-root {
|
|
11
|
+
margin-top: 10px;
|
|
12
|
+
}
|
|
13
|
+
.wd-form-obj-root.wd-form-item--weui.wd-form-item {
|
|
14
|
+
padding: 0;
|
|
15
|
+
}
|
|
16
|
+
.wd-form-obj-root .wd-form-obj {
|
|
17
|
+
min-width: 200px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
.wd-form-obj-root.size-width-sm {
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
.wd-form-obj-root.size-width-md {
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
.wd-form-obj-root.size-width-lg {
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
.wd-form-obj-root .wd-form-item-wrap {
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
.wd-form-obj-root .wd-form-item-wrap .wd-form-item-wrap__control {
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
.wd-form-obj-root .wd-form-item-wrap .wd-card-root {
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
.wd-form-obj-root .wd-form-item-wrap .wd-card-root.wd-card-content__hidden .wd-card__body {
|
|
39
|
+
height: 0;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
padding: 0;
|
|
42
|
+
}
|
|
43
|
+
.wd-form-obj-root .wd-form-item-wrap__label.wd-form-obj__label {
|
|
44
|
+
height: unset;
|
|
45
|
+
line-height: unset;
|
|
46
|
+
padding: unset;
|
|
47
|
+
margin-left: var(--wd-form-item-label-mr);
|
|
48
|
+
}
|
|
49
|
+
.wd-form-obj-root .wd-form-item-wrap .is-nowrap.wd-form-item-wrap__label.wd-form-obj__label > label {
|
|
50
|
+
line-height: unset;
|
|
51
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
|
+
._B00_Xa {
|
|
3
|
+
/* 如果生成的wxss 为空文件似乎会导致IDE编译报错, 所以这里给他弄个占位 */
|
|
4
|
+
word-break: inherit;
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
.wd-form,
|
|
3
8
|
.wd-form-item,
|
|
4
9
|
.gsd-h5-react-formitem {
|
|
@@ -1088,4 +1093,14 @@ textarea {
|
|
|
1088
1093
|
}
|
|
1089
1094
|
.wd-form.size-width-hundred {
|
|
1090
1095
|
width: 100%;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
.wd-mp-form-item-obj .wd-form-obj-card-header {
|
|
1099
|
+
display: flex;
|
|
1100
|
+
}
|
|
1101
|
+
.wd-mp-form-item-obj .wd-form-obj-item-wrap__control-wrap {
|
|
1102
|
+
flex-direction: column;
|
|
1103
|
+
}
|
|
1104
|
+
.wd-mp-form-item-obj .wd-form-item--weui.wd-form-item {
|
|
1105
|
+
width: 100%;
|
|
1091
1106
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { WD_PREFIX } from '../../utils/constant';
|
|
2
|
+
import { textToString } from '../../utils/platform';
|
|
3
|
+
import classNames from '../../utils/classnames';
|
|
4
|
+
import itemBehavior from '../form-field-behavior/item-behavior';
|
|
5
|
+
import {
|
|
6
|
+
convertSize,
|
|
7
|
+
convertLayout,
|
|
8
|
+
convertLabelAlign,
|
|
9
|
+
convertPx,
|
|
10
|
+
} from '../../utils/getFormLegacy';
|
|
11
|
+
|
|
12
|
+
Component({
|
|
13
|
+
options: { virtualHost: true, styleIsolation: 'shared' },
|
|
14
|
+
behaviors: [itemBehavior],
|
|
15
|
+
data: {
|
|
16
|
+
item: `${WD_PREFIX}-form-item`,
|
|
17
|
+
itemWrap: `${WD_PREFIX}-form-item-wrap`,
|
|
18
|
+
classPrefix: WD_PREFIX,
|
|
19
|
+
labelStyle: '',
|
|
20
|
+
cls: '',
|
|
21
|
+
labelCls: '',
|
|
22
|
+
controlWrapCls: '',
|
|
23
|
+
labelRoot: '',
|
|
24
|
+
root: '',
|
|
25
|
+
_before: '',
|
|
26
|
+
_after: '',
|
|
27
|
+
_readValue: '',
|
|
28
|
+
iconName: 'chevronup',
|
|
29
|
+
},
|
|
30
|
+
methods: {
|
|
31
|
+
setIconName() {
|
|
32
|
+
this.setData({
|
|
33
|
+
iconName:
|
|
34
|
+
this.data.iconName === 'chevrondown' ? 'chevronup' : 'chevrondown',
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
observers: {
|
|
39
|
+
'className,labelWidth,labelAlign,labelWrap,layout,required,requiredFlag,size,classRoot,borderedH5,disabled,controlAlign':
|
|
40
|
+
function (
|
|
41
|
+
className,
|
|
42
|
+
_labelWidth,
|
|
43
|
+
_labelAlign,
|
|
44
|
+
labelWrap,
|
|
45
|
+
_layout,
|
|
46
|
+
required,
|
|
47
|
+
requiredFlag,
|
|
48
|
+
_size,
|
|
49
|
+
classRoot,
|
|
50
|
+
borderedH5,
|
|
51
|
+
disabled,
|
|
52
|
+
controlAlign
|
|
53
|
+
) {
|
|
54
|
+
const { item, itemWrap, classPrefix } = this.data;
|
|
55
|
+
const sizeTemp = convertSize(_size);
|
|
56
|
+
const size = sizeTemp === 'xs' ? 'xs' : 'lg';
|
|
57
|
+
const labelAlign = convertLabelAlign(_labelAlign);
|
|
58
|
+
const layout = convertLayout(_layout);
|
|
59
|
+
const root = `${classPrefix}-${classRoot}`;
|
|
60
|
+
const labelRoot = `${root}__label`;
|
|
61
|
+
const labelWidth = convertPx(_labelWidth);
|
|
62
|
+
const labelStyle = labelWidth ? `width:${labelWidth}` : '';
|
|
63
|
+
const itemLayout = this.properties.isWdFormDetail
|
|
64
|
+
? `${classPrefix}-form-item--detail`
|
|
65
|
+
: `${item}-`;
|
|
66
|
+
const cls = classNames(
|
|
67
|
+
item,
|
|
68
|
+
className,
|
|
69
|
+
`${classPrefix}-mp-form-item ${item}--weui item-size-height-${size} ${root}-root ${classPrefix}-mp-${classRoot}-root ${classPrefix}-mp-form-item-obj`,
|
|
70
|
+
{
|
|
71
|
+
'is-required': requiredFlag && required,
|
|
72
|
+
'is-borderless': !borderedH5,
|
|
73
|
+
[`${itemLayout}-horizontal-left`]:
|
|
74
|
+
layout === 'horizontal' && labelAlign === 'left',
|
|
75
|
+
[`${itemLayout}-horizontal-right`]:
|
|
76
|
+
layout === 'horizontal' && labelAlign === 'right',
|
|
77
|
+
[`${itemLayout}-vertical-left`]:
|
|
78
|
+
layout === 'vertical' && labelAlign === 'left',
|
|
79
|
+
[`${itemLayout}-vertical-right`]:
|
|
80
|
+
layout === 'vertical' && labelAlign === 'right',
|
|
81
|
+
[`${item}--label-${labelAlign}`]: !!labelAlign,
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
const labelCls = classNames(`${itemWrap}__label`, labelRoot, {
|
|
85
|
+
'is-nowrap': !labelWrap,
|
|
86
|
+
'is-disabled': disabled,
|
|
87
|
+
});
|
|
88
|
+
const controlWrapCls = classNames(`${itemWrap}__control-wrap`, {
|
|
89
|
+
[`${itemWrap}__control-wrap--right`]: controlAlign === 'right',
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
this.setData({
|
|
93
|
+
labelStyle,
|
|
94
|
+
cls,
|
|
95
|
+
labelCls,
|
|
96
|
+
labelRoot,
|
|
97
|
+
root,
|
|
98
|
+
controlWrapCls,
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
'readBeforeAfter,before,after,readValue': function (
|
|
102
|
+
readBeforeAfter,
|
|
103
|
+
before,
|
|
104
|
+
after,
|
|
105
|
+
readValue
|
|
106
|
+
) {
|
|
107
|
+
const _readValue = textToString(readValue);
|
|
108
|
+
const _before = readBeforeAfter && textToString(before);
|
|
109
|
+
const _after = readBeforeAfter && textToString(after);
|
|
110
|
+
this.setData({ _readValue, _before, _after });
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<view class="{{cls}}" id="{{id}}" style="{{style}}">
|
|
2
|
+
<view class="{{itemWrap}}">
|
|
3
|
+
<wd-card className="{{iconName === 'chevrondown' ? 'wd-card-content__hidden' : ''}}" showContent="{{true}}">
|
|
4
|
+
<view slot="headerSlot" class="wd-form-obj-card-header">
|
|
5
|
+
<wd-icon name="{{iconName}}" bind:tap="setIconName"></wd-icon>
|
|
6
|
+
<!-- Label -->
|
|
7
|
+
<block wx:if="{{labelVisible}}">
|
|
8
|
+
<view class="{{labelCls}}" style="{{labelStyle}}">
|
|
9
|
+
<label>
|
|
10
|
+
<text class="{{itemWrap}}__label-text {{labelRoot}}-text">{{label}}</text>
|
|
11
|
+
<block wx:if="{{labelTips}}">
|
|
12
|
+
<text class="{{itemWrap}}__label-explain">
|
|
13
|
+
<wd-icon name="td:help-circle"></wd-icon>
|
|
14
|
+
</text>
|
|
15
|
+
</block>
|
|
16
|
+
</label>
|
|
17
|
+
</view>
|
|
18
|
+
</block>
|
|
19
|
+
</view>
|
|
20
|
+
<view slot="contentSlot">
|
|
21
|
+
<!-- Item -->
|
|
22
|
+
<view class="{{itemWrap}}__control">
|
|
23
|
+
<view class="{{controlWrapCls}} wd-form-obj-item-wrap__control-wrap">
|
|
24
|
+
<block wx:if="{{readOnly}}">
|
|
25
|
+
<view class="{{item}}__readonly">
|
|
26
|
+
<text class="{{item}}__readonly-before" wx:if="{{_before}}">{{_before}}</text>
|
|
27
|
+
<text class="{{item}}__readonly-value">{{_readValue}}</text>
|
|
28
|
+
<text class="{{item}}__readonly-after" wx:if="{{_after}}">{{_after}}</text>
|
|
29
|
+
</view>
|
|
30
|
+
</block>
|
|
31
|
+
<block wx:else>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
</block>
|
|
34
|
+
</view>
|
|
35
|
+
</view>
|
|
36
|
+
</view>
|
|
37
|
+
</wd-card>
|
|
38
|
+
</view>
|
|
39
|
+
<!-- Message -->
|
|
40
|
+
<block wx:if="{{validateErrorMsg}}">
|
|
41
|
+
<view class="{{item}}__help">
|
|
42
|
+
<text class="{{classPrefix}}-g-text-error {{root}}__error">{{validateErrorMsg}}</text>
|
|
43
|
+
</view>
|
|
44
|
+
</block>
|
|
45
|
+
<!-- Help -->
|
|
46
|
+
<block wx:if="{{extra}}">
|
|
47
|
+
<view class="{{item}}__help">
|
|
48
|
+
<text class="{{item}}__help-text {{root}}__help">{{extra}}</text>
|
|
49
|
+
</view>
|
|
50
|
+
</block>
|
|
51
|
+
</view>
|