@cloudbase/weda-ui-mp 3.6.5 → 3.7.2

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 (42) hide show
  1. package/components/form/form/wd-form.wxss +10 -0
  2. package/components/form/uploader/index.js +3 -3
  3. package/components/form/uploader/weui-uploader.wxml +1 -1
  4. package/components/form/uploader/weui-uploader.wxss +4 -0
  5. package/components/form-field-behavior/form-field-behavior.js +29 -3
  6. package/components/wd-cascader/index.js +198 -0
  7. package/components/wd-cascader/index.json +12 -0
  8. package/components/wd-cascader/index.wxml +59 -0
  9. package/components/wd-cascader/index.wxss +2 -0
  10. package/components/wd-cascader/utils.js +70 -0
  11. package/components/wd-cascader/wd-cascader.wxss +284 -0
  12. package/components/wd-date/modal/index.js +4 -1
  13. package/components/wd-date/modal/index.wxml +1 -1
  14. package/components/wd-form/form-utils.js +4 -0
  15. package/components/wd-form/wd-form.wxss +10 -0
  16. package/components/wd-form-arr/index.js +330 -0
  17. package/components/wd-form-arr/index.json +7 -0
  18. package/components/wd-form-arr/index.wxml +5 -0
  19. package/components/wd-form-arr/index.wxss +2 -0
  20. package/components/wd-form-arr/wd-form-obj.wxss +51 -0
  21. package/components/wd-form-item/wd-form-item.wxss +10 -0
  22. package/components/wd-form-item-obj/index.js +113 -0
  23. package/components/wd-form-item-obj/index.json +8 -0
  24. package/components/wd-form-item-obj/index.wxml +51 -0
  25. package/components/wd-form-item-obj/index.wxss +2 -0
  26. package/components/wd-form-item-obj/wd-form-item.wxss +1106 -0
  27. package/components/wd-form-obj/index.js +305 -0
  28. package/components/wd-form-obj/index.json +7 -0
  29. package/components/wd-form-obj/index.wxml +5 -0
  30. package/components/wd-form-obj/index.wxss +2 -0
  31. package/components/wd-form-obj/wd-form-obj.wxss +51 -0
  32. package/components/wd-icon/index.json +1 -1
  33. package/components/wd-input/inner-input/wd-input.wxss +10 -0
  34. package/components/wd-progress/wd-progress.wxss +10 -0
  35. package/components/wd-rating/wd-rating.wxss +10 -0
  36. package/components/wd-select/select.wxss +9 -3
  37. package/components/wd-switch/wd-switch.wxss +10 -0
  38. package/components/wd-tag-select/wd-tag-select.wxss +10 -0
  39. package/components/web-view/index.js +3 -0
  40. package/index.json +2 -0
  41. package/package.json +1 -1
  42. package/utils/enum.js +13 -0
@@ -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
+ }
@@ -1093,4 +1093,14 @@ textarea {
1093
1093
  }
1094
1094
  .wd-form.size-width-hundred {
1095
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%;
1096
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,8 @@
1
+ {
2
+ "component": true,
3
+ "styleIsolation": "shared",
4
+ "usingComponents": {
5
+ "wd-icon": "../wd-icon/index",
6
+ "wd-card": "../wd-card/index"
7
+ }
8
+ }
@@ -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>
@@ -0,0 +1,2 @@
1
+ @import '../../style/wd-design.wxss';
2
+ @import './wd-form-item.wxss';