@cloudbase/weda-ui-mp 3.15.8 → 3.16.0
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/select/dropdown-select/index.js +8 -0
- package/components/form/select/dropdown-select/index.wxml +1 -1
- package/components/form/selectMultiple/dropdown-select/index.js +15 -17
- package/components/form/selectMultiple/dropdown-select/index.wxml +1 -1
- package/components/form/selectMultiple/index.js +29 -7
- package/components/form/selectMultiple/index.wxml +2 -1
- package/components/richText/copy/index.wxss +45 -48
- package/components/wd-select/index.js +18 -14
- package/components/wd-select/index.wxml +7 -3
- package/components/wd-select/select/dropdown-select/index.js +192 -0
- package/components/wd-select/select/dropdown-select/index.json +4 -0
- package/components/wd-select/select/dropdown-select/index.wxml +37 -0
- package/components/wd-select/select/dropdown-select/index.wxss +329 -0
- package/components/wd-select/select/formats-util.js +12 -1
- package/components/wd-select/select/index.js +208 -344
- package/components/wd-select/select/index.json +1 -1
- package/components/wd-select/select/index.wxml +16 -16
- package/components/wd-select-multiple/index.js +16 -8
- package/components/wd-select-multiple/index.json +1 -1
- package/components/wd-select-multiple/index.wxml +6 -2
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
<wd-form-item-read-only version="{{version}}" readOnly="{{readOnly}}" readValue="{{displayValue}}">
|
|
2
2
|
<view class="wd-select">
|
|
3
|
-
<view class="wd-select-input-group" bindchange="onChange" bindtap="
|
|
3
|
+
<view class="wd-select-input-group" bindchange="onChange" bindtap="onOpenPicker" data-show="true">
|
|
4
4
|
<label class="wd-select-input {{displayValue ? '' : 'weui-input__placeholder'}}">{{displayValue || placeholder}}</label>
|
|
5
5
|
</view>
|
|
6
6
|
<block wx:if="{{allPickerShow}}">
|
|
7
7
|
<dropdownSelect
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
multiple="{{multiple}}"
|
|
9
|
+
searchable="{{searchable}}"
|
|
10
|
+
filterable="{{_filterable}}"
|
|
11
|
+
currentPageNo="{{currentPageNo}}"
|
|
12
|
+
class="weui-picker__group weui-input"
|
|
13
|
+
bindchange="onChange"
|
|
14
|
+
bind:_childFetchData="_childFetchData"
|
|
15
|
+
bind:onSelectPicker="onSelectPicker"
|
|
16
|
+
bind:onClosePicker="onClosePicker"
|
|
17
|
+
option="{{option}}"
|
|
18
|
+
loadStatus="{{loadStatus}}"
|
|
19
|
+
searchStatus="{{searchStatus}}"
|
|
20
|
+
selectedValue="{{value}}"
|
|
21
|
+
ignoreCase="{{ignoreCase}}"
|
|
22
|
+
bind:search="onSearch"
|
|
23
23
|
/>
|
|
24
24
|
</block>
|
|
25
25
|
</view>
|
|
@@ -25,9 +25,16 @@ Component({
|
|
|
25
25
|
type: Array,
|
|
26
26
|
value: [],
|
|
27
27
|
},
|
|
28
|
+
searchable: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
value: true,
|
|
31
|
+
},
|
|
32
|
+
filterable: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
value: false,
|
|
35
|
+
},
|
|
28
36
|
},
|
|
29
37
|
data: {
|
|
30
|
-
options: [],
|
|
31
38
|
itemMap: {},
|
|
32
39
|
selectedLabel: null,
|
|
33
40
|
selectedItem: null,
|
|
@@ -55,6 +62,12 @@ Component({
|
|
|
55
62
|
debouncedTriggerSearchEvent: debounce(function (value) {
|
|
56
63
|
this.triggerEvent('search', { value });
|
|
57
64
|
}),
|
|
65
|
+
updateSelect: function (e) {
|
|
66
|
+
const { value, option } = e.detail;
|
|
67
|
+
const itemMap = arrayToMap(option, 'value');
|
|
68
|
+
const { selectedLabel, selectedItem } = getSelected(itemMap, value, true);
|
|
69
|
+
this.setData({ selectedLabel, selectedItem });
|
|
70
|
+
},
|
|
58
71
|
},
|
|
59
72
|
observers: {
|
|
60
73
|
'name, value, label, required, visible, disabled, readOnly, before, after, primaryField, selectedLabel, selectedItem':
|
|
@@ -65,13 +78,8 @@ Component({
|
|
|
65
78
|
const [_suffixType, _suffixIcon] = convertFixedIcon(suffixType, suffixIcon, SELECT_ICON_H5);
|
|
66
79
|
this.setData({ _suffixType, _suffixIcon });
|
|
67
80
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.setData({ itemMap });
|
|
71
|
-
},
|
|
72
|
-
'itemMap, value': function (itemMap, value) {
|
|
73
|
-
const { selectedLabel, selectedItem } = getSelected(itemMap, value, true);
|
|
74
|
-
this.setData({ selectedLabel, selectedItem });
|
|
81
|
+
range: function (range) {
|
|
82
|
+
this.updateSelect({ detail: { value: this.data.value, option: range } });
|
|
75
83
|
},
|
|
76
84
|
},
|
|
77
85
|
lifetimes: {
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
<wd-input-group before="{{before}}" after="{{after}}" block="{{true}}" size="{{_size}}" classRoot="{{classRoot}}" readOnly="{{readOnly}}">
|
|
23
23
|
<wd-input-wrap block="{{block}}" classRoot="{{classRoot}}" before="{{before}}" after="{{after}}" disabled="{{disabled}}" prefixType="{{prefixType}}" prefixIcon="{{prefixIcon}}" prefixSrc="{{prefixSrc}}" suffixType="{{_suffixType}}" suffixIcon="{{_suffixIcon}}" suffixSrc="{{suffixSrc}}" hasClearIcon="{{hasClearIcon}}" bind:onClear="handleClear" readOnly="{{readOnly}}">
|
|
24
24
|
<old-select
|
|
25
|
+
multiple="{{true}}"
|
|
26
|
+
searchable="{{searchable}}"
|
|
27
|
+
filterable="{{filterable}}"
|
|
25
28
|
supportManyRelated="{{supportManyRelated}}"
|
|
26
29
|
queryCondition="{{queryCondition}}"
|
|
27
30
|
sorter="{{sorter}}"
|
|
@@ -43,11 +46,12 @@
|
|
|
43
46
|
mode="selector"
|
|
44
47
|
version="wd"
|
|
45
48
|
ignoreCase="{{ignoreCase}}"
|
|
46
|
-
staticSearchable="{{staticSearchable}}"
|
|
47
49
|
bind:change="handleChange"
|
|
48
|
-
bind:
|
|
50
|
+
bind:updateSelect="updateSelect"
|
|
49
51
|
bind:changeLabel="changeLabel"
|
|
50
52
|
bind:search="search"
|
|
53
|
+
bind:focus="handleEvent"
|
|
54
|
+
bind:blur="handleEvent"
|
|
51
55
|
/>
|
|
52
56
|
</wd-input-wrap>
|
|
53
57
|
</wd-input-group>
|