@cloudbase/weda-ui-mp 3.6.3 → 3.6.6
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 +5 -0
- package/components/form/select/dropdown-select/index.js +12 -7
- package/components/form/select/index.js +11 -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 +9 -4
- 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 +10 -0
- package/components/wd-card/wd-card.wxss +6 -0
- package/components/wd-checkbox-list/wd-checkbox-list.wxss +6 -0
- 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/index.js +28 -5
- package/components/wd-form/index.wxml +15 -13
- package/components/wd-form/index.wxss +15 -0
- package/components/wd-form/wd-form.wxss +5 -0
- package/components/wd-form-item/wd-form-item.wxss +5 -0
- 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 +5 -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 +5 -0
- package/components/wd-radio-list/wd-radio-list.wxss +6 -0
- package/components/wd-rating/wd-rating.wxss +5 -0
- package/components/wd-select/select.wxss +5 -0
- package/components/wd-switch/wd-switch.wxss +5 -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 +5 -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/package.json +1 -1
- package/style/utils.wxss +5 -0
- package/style/wd-design.wxss +5 -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
|
@@ -227,9 +227,11 @@ Component({
|
|
|
227
227
|
option,
|
|
228
228
|
loadStatus,
|
|
229
229
|
searchOption,
|
|
230
|
-
searchStatus
|
|
230
|
+
searchStatus,
|
|
231
|
+
_needFetch
|
|
231
232
|
) {
|
|
232
233
|
if (this.data.searchValue === '') {
|
|
234
|
+
// 初始化会走到这
|
|
233
235
|
const { chooseIndexValue } = this.properties;
|
|
234
236
|
let index = -1;
|
|
235
237
|
if (chooseIndexValue !== '') {
|
|
@@ -250,12 +252,15 @@ Component({
|
|
|
250
252
|
clickIndex: index,
|
|
251
253
|
});
|
|
252
254
|
} else {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
if (_needFetch) {
|
|
256
|
+
// 只有needFetch 才设置searchOption
|
|
257
|
+
this.setData({
|
|
258
|
+
status: searchStatus,
|
|
259
|
+
showOption: searchOption,
|
|
260
|
+
isFinish: true,
|
|
261
|
+
index: -1,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
259
264
|
}
|
|
260
265
|
},
|
|
261
266
|
},
|
|
@@ -659,9 +659,20 @@ Component({
|
|
|
659
659
|
searchRecords.findIndex((r) => r._id === item._id) < 0
|
|
660
660
|
) || []
|
|
661
661
|
),
|
|
662
|
+
records: records.concat(
|
|
663
|
+
(results ?? []).filter(
|
|
664
|
+
(item) => records.findIndex((r) => r._id === item._id) < 0
|
|
665
|
+
) || []
|
|
666
|
+
),
|
|
662
667
|
searchStatus: status,
|
|
663
668
|
}
|
|
664
669
|
: {
|
|
670
|
+
searchRecords: searchRecords.concat(
|
|
671
|
+
(results ?? []).filter(
|
|
672
|
+
(item) =>
|
|
673
|
+
searchRecords.findIndex((r) => r._id === item._id) < 0
|
|
674
|
+
) || []
|
|
675
|
+
),
|
|
665
676
|
records: records.concat(
|
|
666
677
|
(results ?? []).filter(
|
|
667
678
|
(item) => records.findIndex((r) => r._id === item._id) < 0
|
|
@@ -227,14 +227,14 @@ Component({
|
|
|
227
227
|
urls: newUrls,
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
this.handleChange(newUrls);
|
|
230
|
+
this.handleChange(newUrls, true);
|
|
231
231
|
},
|
|
232
|
-
handleChange: function (values) {
|
|
232
|
+
handleChange: function (values, isDelete = false) {
|
|
233
233
|
let value = values;
|
|
234
234
|
if (this.properties.single) {
|
|
235
235
|
value = values[0] ?? '';
|
|
236
236
|
}
|
|
237
|
-
this.triggerEvent('change', { value });
|
|
237
|
+
this.triggerEvent('change', { value, isDelete });
|
|
238
238
|
},
|
|
239
239
|
},
|
|
240
240
|
observers: {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<view wx:if="{{currentFiles.length < maxCount && !readOnly}}" class="weui-uploader__input-box {{shapeClass}}" hover-class="weui-active">
|
|
41
41
|
<view wx:if="{{!disabled&&!isChooseAvatar}}" class="weui-uploader__input" bindtap="chooseImage"></view>
|
|
42
42
|
|
|
43
|
-
<button class="weui-uploader__input" wx:if="{{!disabled&&isChooseAvatar}}" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"></button>
|
|
43
|
+
<button class="weui-uploader__input weui-uploader__input-button" wx:if="{{!disabled&&isChooseAvatar}}" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"></button>
|
|
44
44
|
|
|
45
45
|
<view wx:if="{{disabled}}" class="weui-uploader__uploader_disabled"></view>
|
|
46
46
|
</view>
|
|
@@ -390,11 +390,16 @@ export default Behavior({
|
|
|
390
390
|
if (status === this.data._status) return;
|
|
391
391
|
this.data._status = status;
|
|
392
392
|
const { disabled: _disabled, readOnly: _readOnly } = this.data;
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
_readOnly
|
|
393
|
+
const statusParams = convertStatus(status, _disabled, _readOnly);
|
|
394
|
+
const form = this?.$widget?.closest(
|
|
395
|
+
(w) => w.getConfig?.()?.componentType === 'form'
|
|
397
396
|
);
|
|
397
|
+
let disabled = statusParams.disabled;
|
|
398
|
+
let readOnly = statusParams.readOnly;
|
|
399
|
+
if (form) {
|
|
400
|
+
disabled = statusParams.disabled || form.formType === 'read';
|
|
401
|
+
readOnly = statusParams.readOnly || form.formType === 'read';
|
|
402
|
+
}
|
|
398
403
|
this.setData({ disabled, readOnly });
|
|
399
404
|
},
|
|
400
405
|
'required,before,after,requiredMsg,isUnionValue': function (
|
|
@@ -13,8 +13,9 @@ const pattern = {
|
|
|
13
13
|
userName: /^[\da-zA-Z\u2E80-\uFE4F \s]{2,}$/,
|
|
14
14
|
carId:
|
|
15
15
|
/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/,
|
|
16
|
-
mobile:
|
|
17
|
-
|
|
16
|
+
mobile:
|
|
17
|
+
/^(\+\d{1,4}[\s-]?)?(\(?\d{1,4}\)?[\s-]?)?(\d{1,4}[\s-]?)?(\d{1,4})?\d{1,9}(\s?(x|ext)\s?\d{1,6})?$/,
|
|
18
|
+
tel: /^(\+\d{1,4}[\s-]?)?(\(?\d{1,4}\)?[\s-]?)?(\d{1,4}[\s-]?)?(\d{1,4})?\d{1,9}(\s?(x|ext)\s?\d{1,6})?$/,
|
|
18
19
|
address: /^[\da-zA-Z\u2E80-\uFE4F \s-]{4,400}$/,
|
|
19
20
|
date: /((^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(10|12|0?[13578])([-\/\._])(3[01]|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(11|0?[469])([-\/\._])(30|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(0?2)([-\/\._])(2[0-8]|1[0-9]|0?[1-9])$)|(^([2468][048]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([3579][26]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][13579][26])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][13579][26])([-\/\._])(0?2)([-\/\._])(29)$))/,
|
|
20
21
|
numVcode: /^[0-9]{4,8}$/,
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
._B00_Xa {
|
|
3
|
+
/* 如果生成的wxss 为空文件似乎会导致IDE编译报错, 所以这里给他弄个占位 */
|
|
4
|
+
word-break: inherit;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.wd-btn {
|
|
2
8
|
--wd-btn-sm-padding: 0.0625rem calc(var(--wd-space-base) * 2);
|
|
3
9
|
--wd-btn-md-padding: 0.25rem calc(var(--wd-space-base) * 4);
|
|
@@ -500,4 +506,8 @@ button::after {
|
|
|
500
506
|
button:not([size=mini]) {
|
|
501
507
|
margin: 0;
|
|
502
508
|
width: auto;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
button:not([size=mini]).wd-btn--block {
|
|
512
|
+
width: 100%;
|
|
503
513
|
}
|
|
@@ -112,6 +112,18 @@ Component({
|
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
114
|
},
|
|
115
|
+
setReadOnly() {
|
|
116
|
+
Object.keys(this.data._formItemMap).forEach((name) => {
|
|
117
|
+
const items = this.data._formItemMap[name];
|
|
118
|
+
items.forEach((item) => {
|
|
119
|
+
if (!item.setReadOnly) {
|
|
120
|
+
console.error('表单组件缺少setReadOnly方法:', item);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
item.setReadOnly(true);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
},
|
|
115
127
|
async validate() {
|
|
116
128
|
const validatePromise = [];
|
|
117
129
|
const validateKey = [];
|
|
@@ -617,14 +629,25 @@ Component({
|
|
|
617
629
|
paramGetItem,
|
|
618
630
|
value
|
|
619
631
|
) {
|
|
632
|
+
if (formType === 'read') {
|
|
633
|
+
this.setReadOnly();
|
|
634
|
+
}
|
|
635
|
+
const isDataModel = ![
|
|
636
|
+
'connector',
|
|
637
|
+
'custom-connector',
|
|
638
|
+
'expression',
|
|
639
|
+
].includes(datasourceType);
|
|
640
|
+
if (
|
|
641
|
+
isDataModel &&
|
|
642
|
+
formTypeWithInitValue &&
|
|
643
|
+
_id &&
|
|
644
|
+
!equal(_id, this.data._preDataId)
|
|
645
|
+
) {
|
|
646
|
+
this.setData({ isLoadingData: true });
|
|
647
|
+
}
|
|
620
648
|
clearTimeout(this.data._delayRef.current.initTimer);
|
|
621
649
|
// eslint-disable-next-line rulesdir/no-timer
|
|
622
650
|
this.data._delayRef.current.initTimer = setTimeout(() => {
|
|
623
|
-
const isDataModel = ![
|
|
624
|
-
'connector',
|
|
625
|
-
'custom-connector',
|
|
626
|
-
'expression',
|
|
627
|
-
].includes(datasourceType);
|
|
628
651
|
if (!dataSourceName) {
|
|
629
652
|
this.setData({ loadingStatus: 'done' });
|
|
630
653
|
if (datasourceType !== 'expression') {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
<
|
|
2
|
-
<block wx:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</block>
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<view class="weui-form weda-ui wd-form wd-mp-form {{className}}" id="{{id}}" style="{{style}}">
|
|
2
|
+
<block wx:if="{{loadingStatus === 'loading'}}">
|
|
3
|
+
<view class="wedatea2td-action-state">
|
|
4
|
+
<view class="wedatea2td-mr-2n wedatea2td-icon wedatea2td-icon-loading" role="img" aria-label="loading"></view>
|
|
5
|
+
<view class="wedatea2td-action-state__text" title="数据加载中...">数据加载中...</view>
|
|
6
|
+
</view>
|
|
7
|
+
</block>
|
|
8
|
+
|
|
9
|
+
<block wx:if="{{errorObj.message}}">
|
|
10
|
+
<status-content errorObj="{{errorObj}}"></status-content>
|
|
11
|
+
</block>
|
|
12
|
+
<block wx:if="{{!errorObj.message}}">
|
|
13
|
+
<slot name="contentSlot" />
|
|
14
|
+
</block>
|
|
15
|
+
</view>
|
|
@@ -18,6 +18,21 @@
|
|
|
18
18
|
padding-bottom: 8px;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
.wd-mp-form {
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
.wd-mp-form .wedatea2td-action-state {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
height: 100%;
|
|
28
|
+
width: 100%;
|
|
29
|
+
margin: 0 auto;
|
|
30
|
+
text-align: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
z-index: 9999;
|
|
34
|
+
background: #fff;
|
|
35
|
+
}
|
|
21
36
|
/*
|
|
22
37
|
表单模版内置样式 END }}}
|
|
23
38
|
*/
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
._B00_Xa {
|
|
3
|
+
/* 如果生成的wxss 为空文件似乎会导致IDE编译报错, 所以这里给他弄个占位 */
|
|
4
|
+
word-break: inherit;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.wd-form-input-group {
|
|
2
8
|
--wd-form-input-group-border-radius: var(--wd-border-radius);
|
|
3
9
|
--wd-form-input-group-text-default: var(--wd-color-text-form-default);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
._B00_Xa {
|
|
3
|
+
/* 如果生成的wxss 为空文件似乎会导致IDE编译报错, 所以这里给他弄个占位 */
|
|
4
|
+
word-break: inherit;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.wd-form-input-wrap {
|
|
2
8
|
--wd-form-input-wrap-border-radius: var(--wd-border-radius);
|
|
3
9
|
--wd-form-input-wrap-text-default: var(--wd-color-text-form-default);
|
package/package.json
CHANGED
package/style/utils.wxss
CHANGED
package/style/wd-design.wxss
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|