@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.
@@ -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="onSelectPicker" data-show="true">
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
- ignoreCase="{{ignoreCase}}"
9
- staticSearchable="{{staticSearchable}}"
10
- class="weui-picker__group weui-input"
11
- bindchange="onChange"
12
- bind:_childFetchData="_childFetchData"
13
- bind:onSelectPicker="onSelectPicker"
14
- option="{{option}}"
15
- loadStatus="{{loadStatus}}"
16
- searchOption="{{searchOption}}"
17
- searchStatus="{{searchStatus}}"
18
- chooseIndexValue="{{chooseIndexValue}}"
19
- isTurnPages="{{isTurnPages}}"
20
- pageNo="{{pageNo}}"
21
- _needFetch="{{formatNeedFetch}}"
22
- bind:search="onSearch"
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
- options: function (options) {
69
- const itemMap = arrayToMap(options, 'value');
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: {
@@ -5,6 +5,6 @@
5
5
  "wd-form-item": "../wd-form-item/index",
6
6
  "wd-input-group": "../wd-input-group/index",
7
7
  "wd-input-wrap": "../wd-input-wrap/index",
8
- "old-select": "../form/selectMultiple"
8
+ "old-select": "../wd-select/select/index"
9
9
  }
10
10
  }
@@ -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:changeOptions="changeOptions"
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>
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "miniprogram": "./",
4
4
  "packageManager": "yarn@3.0.2",
5
5
  "dependencies": {},
6
- "version": "3.15.8",
6
+ "version": "3.16.0",
7
7
  "main": "./",
8
8
  "publishConfig": {
9
9
  "access": "public"