@cloudbase/weda-ui-mp 3.7.4 → 3.7.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.
@@ -48,6 +48,10 @@ Component({
48
48
  type: Boolean,
49
49
  value: true,
50
50
  },
51
+ staticSearchable: {
52
+ type: Boolean,
53
+ value: true,
54
+ },
51
55
  },
52
56
  data: {
53
57
  height: '780rpx',
@@ -80,8 +84,14 @@ Component({
80
84
  bindinput: function (event) {
81
85
  const value = event.detail.value;
82
86
 
83
- const { option, loadStatus, isTurnPages, _needFetch, ignoreCase } =
84
- this.properties;
87
+ const {
88
+ option,
89
+ loadStatus,
90
+ isTurnPages,
91
+ _needFetch,
92
+ ignoreCase,
93
+ staticSearchable,
94
+ } = this.properties;
85
95
  if (value === '' || value === this.data.searchValue) {
86
96
  this.setData({
87
97
  searchValue: value,
@@ -109,8 +119,9 @@ Component({
109
119
  searchValue: value,
110
120
  pageNo: 1,
111
121
  });
112
- } else {
122
+ } else if (staticSearchable) {
113
123
  // 本地搜索
124
+
114
125
  const searchOption = option.filter((item) => {
115
126
  if (ignoreCase) {
116
127
  return String(item.label)
@@ -223,45 +234,54 @@ Component({
223
234
  },
224
235
  },
225
236
  observers: {
226
- 'option, loadStatus, searchOption, searchStatus, _needFetch': function (
227
- option,
228
- loadStatus,
229
- searchOption,
230
- searchStatus,
231
- _needFetch
232
- ) {
233
- if (this.data.searchValue === '') {
234
- // 初始化会走到这
235
- const { chooseIndexValue } = this.properties;
236
- let index = -1;
237
- if (chooseIndexValue !== '') {
238
- index = option.findIndex((item) => item.value === chooseIndexValue);
239
- } else {
240
- option.some((item, i) => {
241
- if (!item?.disabled) {
242
- index = i;
243
- return true;
244
- }
245
- });
246
- }
247
- this.setData({
248
- status: loadStatus,
249
- showOption: option,
250
- isFinish: true,
251
- index: index,
252
- clickIndex: index,
253
- });
254
- } else {
255
- if (_needFetch) {
256
- // 只有needFetch 才设置searchOption
237
+ 'option, loadStatus, searchOption, searchStatus, _needFetch, staticSearchable':
238
+ function (
239
+ option,
240
+ loadStatus,
241
+ searchOption,
242
+ searchStatus,
243
+ _needFetch,
244
+ staticSearchable
245
+ ) {
246
+ if (this.data.searchValue === '') {
247
+ // 初始化会走到这
248
+ const { chooseIndexValue } = this.properties;
249
+ let index = -1;
250
+ if (chooseIndexValue !== '') {
251
+ index = option.findIndex((item) => item.value === chooseIndexValue);
252
+ } else {
253
+ option.some((item, i) => {
254
+ if (!item?.disabled) {
255
+ index = i;
256
+ return true;
257
+ }
258
+ });
259
+ }
257
260
  this.setData({
258
- status: searchStatus,
259
- showOption: searchOption,
261
+ status: loadStatus,
262
+ showOption: option,
260
263
  isFinish: true,
261
- index: -1,
264
+ index: index,
265
+ clickIndex: index,
262
266
  });
267
+ } else {
268
+ if (_needFetch) {
269
+ // 只有needFetch 才设置searchOption
270
+ this.setData({
271
+ status: searchStatus,
272
+ showOption: searchOption,
273
+ isFinish: true,
274
+ index: -1,
275
+ });
276
+ } else if (!staticSearchable) {
277
+ this.setData({
278
+ status: searchStatus,
279
+ showOption: option,
280
+ isFinish: true,
281
+ index: -1,
282
+ });
283
+ }
263
284
  }
264
- }
265
- },
285
+ },
266
286
  },
267
287
  });
@@ -151,6 +151,10 @@ Component({
151
151
  type: Boolean,
152
152
  value: true,
153
153
  },
154
+ staticSearchable: {
155
+ type: Boolean,
156
+ value: true,
157
+ },
154
158
  },
155
159
  data: {
156
160
  cls: '',
@@ -34,6 +34,7 @@
34
34
  <block wx:if="{{allPickerShow}}">
35
35
  <dropdownSelect
36
36
  ignoreCase="{{ignoreCase}}"
37
+ staticSearchable="{{staticSearchable}}"
37
38
  class="weui-picker__group weui-input"
38
39
  bindchange="onChange"
39
40
  bind:_childFetchData="_childFetchData"
@@ -36,6 +36,10 @@ Component({
36
36
  type: Boolean,
37
37
  value: true,
38
38
  },
39
+ staticSearchable: {
40
+ type: Boolean,
41
+ value: true,
42
+ },
39
43
  },
40
44
  data: {
41
45
  height: '390px',
@@ -170,14 +174,18 @@ Component({
170
174
  },
171
175
  },
172
176
  observers: {
173
- 'option,searchValue': function (option, searchValue) {
177
+ 'option,searchValue,staticSearchable': function (
178
+ option,
179
+ searchValue,
180
+ staticSearchable
181
+ ) {
174
182
  const { ignoreCase } = this.properties;
175
183
  if (searchValue === '') {
176
184
  this.setData({
177
185
  showOption: option,
178
186
  status: option.length > 0 ? 0 : 3,
179
187
  });
180
- } else {
188
+ } else if (staticSearchable) {
181
189
  const searchRange = option.filter((item) => {
182
190
  if (ignoreCase) {
183
191
  return (
@@ -192,6 +200,10 @@ Component({
192
200
  showOption: searchRange,
193
201
  status: searchRange.length > 0 ? 0 : 3,
194
202
  });
203
+ } else {
204
+ this.setData({
205
+ showOption: option,
206
+ });
195
207
  }
196
208
  },
197
209
  option: function (option) {
@@ -91,6 +91,10 @@ Component({
91
91
  type: Boolean,
92
92
  value: true,
93
93
  },
94
+ staticSearchable: {
95
+ type: Boolean,
96
+ value: true,
97
+ },
94
98
  },
95
99
  data: {
96
100
  cls: '',
@@ -12,7 +12,21 @@
12
12
  </block>
13
13
  </view>
14
14
  <block wx:if="{{allPickerShow}}">
15
- <dropdownSelect class="weui-picker__group weui-input" bindchange="onChange" bind:_childFetchData="_childFetchData" bind:onSelectPicker="onSelectPicker" bind:onClosePicker="onClosePicker" option="{{option}}" loadStatus="{{loadStatus}}" searchStatus="{{searchStatus}}" displayLabel="{{displayLabel}}" selectedValue="{{value}}" ignoreCase="{{ignoreCase}}" bind:search="onSearch" />
15
+ <dropdownSelect
16
+ class="weui-picker__group weui-input"
17
+ bindchange="onChange"
18
+ bind:_childFetchData="_childFetchData"
19
+ bind:onSelectPicker="onSelectPicker"
20
+ bind:onClosePicker="onClosePicker"
21
+ option="{{option}}"
22
+ loadStatus="{{loadStatus}}"
23
+ searchStatus="{{searchStatus}}"
24
+ displayLabel="{{displayLabel}}"
25
+ selectedValue="{{value}}"
26
+ ignoreCase="{{ignoreCase}}"
27
+ staticSearchable="{{staticSearchable}}"
28
+ bind:search="onSearch"
29
+ />
16
30
  </block>
17
31
  </view>
18
32
  </view>
@@ -1,6 +1,5 @@
1
1
  import { validType } from './validator';
2
2
  import equal from '../../utils/deepEqual';
3
- // eslint-disable-next-line rulesdir/no-phantom-deps -- 小程序里面有
4
3
  import { autorun, untracked } from 'mobx';
5
4
  import {
6
5
  convertStatus,
@@ -379,6 +379,10 @@ export default Behavior({
379
379
  type: Boolean,
380
380
  value: true,
381
381
  },
382
+ staticSearchable: {
383
+ type: Boolean,
384
+ value: true,
385
+ },
382
386
  },
383
387
  data: {
384
388
  classPrefix: WD_PREFIX,
@@ -7,14 +7,9 @@
7
7
  .wd-form-obj-root {
8
8
  display: flex;
9
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
10
  .wd-form-obj-root .wd-form-obj {
17
11
  min-width: 200px;
12
+ width: fit-content;
18
13
  width: 100%;
19
14
  }
20
15
  .wd-form-obj-root.size-width-sm {
@@ -43,9 +38,56 @@
43
38
  .wd-form-obj-root .wd-form-item-wrap__label.wd-form-obj__label {
44
39
  height: unset;
45
40
  line-height: unset;
46
- padding: unset;
47
- margin-left: var(--wd-form-item-label-mr);
48
41
  }
49
42
  .wd-form-obj-root .wd-form-item-wrap .is-nowrap.wd-form-item-wrap__label.wd-form-obj__label > label {
50
43
  line-height: unset;
44
+ }
45
+ .wd-form-obj-root.wd-h5-form-obj-root {
46
+ margin-top: calc(var(--wd-space-base) * 4);
47
+ }
48
+ .wd-form-obj-root.wd-h5-form-obj-root .wd-form-item--weui.wd-form-item {
49
+ padding: 0;
50
+ margin: 0;
51
+ }
52
+ .wd-form-obj-root.wd-h5-form-obj-root .wd-form-obj .wd-h5-card-root {
53
+ margin-bottom: var(--wd-form-item-pd);
54
+ }
55
+ .wd-form-obj-root.wd-h5-form-obj-root .wd-h5-form-obj > div > .wd-form-item > .wd-form-item-wrap {
56
+ border: none;
57
+ }
58
+
59
+ .wd-form.wd-form--weui .wd-h5-form-obj-root > .wd-form-item-wrap {
60
+ border: none;
61
+ }
62
+
63
+ .wd-form .wd-card__header .wd-form-item-wrap__label.wd-form-obj__label {
64
+ padding: 0;
65
+ }
66
+ .wd-form.wd-pc-form .wd-form-obj-root .wd-form-obj > div > .wd-form-item {
67
+ padding-top: 0;
68
+ margin-top: calc(var(--wd-space-base) * 2.5);
69
+ }
70
+ .wd-form.wd-form--weui .wd-card__header .wd-form-item-wrap__label.wd-form-obj__label {
71
+ padding: 0;
72
+ }
73
+
74
+ .wd-form.wd-mp-form .wd-mp-form-obj-root > .wd-form-item-wrap {
75
+ border: none;
76
+ }
77
+
78
+ .wd-mp-form-obj-root {
79
+ margin-top: calc(var(--wd-space-base) * 4);
80
+ }
81
+ .wd-mp-form-obj-root .wd-form-item--weui.wd-form-item {
82
+ padding: 0;
83
+ margin: 0;
84
+ }
85
+ .wd-mp-form-obj-root .wd-form-obj .wd-h5-card-root {
86
+ margin-bottom: var(--wd-form-item-pd);
87
+ }
88
+ .wd-mp-form-obj-root .wd-mp-card-root {
89
+ margin-bottom: var(--wd-form-item-pd);
90
+ }
91
+ .wd-mp-form-obj-root .wd-mp-form-obj > view > .wd-form-item > .wd-form-item-wrap {
92
+ border: none;
51
93
  }
@@ -7,14 +7,9 @@
7
7
  .wd-form-obj-root {
8
8
  display: flex;
9
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
10
  .wd-form-obj-root .wd-form-obj {
17
11
  min-width: 200px;
12
+ width: fit-content;
18
13
  width: 100%;
19
14
  }
20
15
  .wd-form-obj-root.size-width-sm {
@@ -43,9 +38,56 @@
43
38
  .wd-form-obj-root .wd-form-item-wrap__label.wd-form-obj__label {
44
39
  height: unset;
45
40
  line-height: unset;
46
- padding: unset;
47
- margin-left: var(--wd-form-item-label-mr);
48
41
  }
49
42
  .wd-form-obj-root .wd-form-item-wrap .is-nowrap.wd-form-item-wrap__label.wd-form-obj__label > label {
50
43
  line-height: unset;
44
+ }
45
+ .wd-form-obj-root.wd-h5-form-obj-root {
46
+ margin-top: calc(var(--wd-space-base) * 4);
47
+ }
48
+ .wd-form-obj-root.wd-h5-form-obj-root .wd-form-item--weui.wd-form-item {
49
+ padding: 0;
50
+ margin: 0;
51
+ }
52
+ .wd-form-obj-root.wd-h5-form-obj-root .wd-form-obj .wd-h5-card-root {
53
+ margin-bottom: var(--wd-form-item-pd);
54
+ }
55
+ .wd-form-obj-root.wd-h5-form-obj-root .wd-h5-form-obj > div > .wd-form-item > .wd-form-item-wrap {
56
+ border: none;
57
+ }
58
+
59
+ .wd-form.wd-form--weui .wd-h5-form-obj-root > .wd-form-item-wrap {
60
+ border: none;
61
+ }
62
+
63
+ .wd-form .wd-card__header .wd-form-item-wrap__label.wd-form-obj__label {
64
+ padding: 0;
65
+ }
66
+ .wd-form.wd-pc-form .wd-form-obj-root .wd-form-obj > div > .wd-form-item {
67
+ padding-top: 0;
68
+ margin-top: calc(var(--wd-space-base) * 2.5);
69
+ }
70
+ .wd-form.wd-form--weui .wd-card__header .wd-form-item-wrap__label.wd-form-obj__label {
71
+ padding: 0;
72
+ }
73
+
74
+ .wd-form.wd-mp-form .wd-mp-form-obj-root > .wd-form-item-wrap {
75
+ border: none;
76
+ }
77
+
78
+ .wd-mp-form-obj-root {
79
+ margin-top: calc(var(--wd-space-base) * 4);
80
+ }
81
+ .wd-mp-form-obj-root .wd-form-item--weui.wd-form-item {
82
+ padding: 0;
83
+ margin: 0;
84
+ }
85
+ .wd-mp-form-obj-root .wd-form-obj .wd-h5-card-root {
86
+ margin-bottom: var(--wd-form-item-pd);
87
+ }
88
+ .wd-mp-form-obj-root .wd-mp-card-root {
89
+ margin-bottom: var(--wd-form-item-pd);
90
+ }
91
+ .wd-mp-form-obj-root .wd-mp-form-obj > view > .wd-form-item > .wd-form-item-wrap {
92
+ border: none;
51
93
  }
@@ -544,12 +544,19 @@ Component({
544
544
 
545
545
  const readValue = `${toShow}${getPercentUnit(format)}`;
546
546
 
547
- this.setData({
548
- readValue,
549
- realValue: toReal,
550
- showValue: toShow,
551
- isInit: false,
552
- });
547
+ if (this.data.isInit) {
548
+ this.setData({ isInit: false });
549
+ }
550
+
551
+ // 避免和focus逻辑冲突,延后一个任务执行赋值
552
+ // eslint-disable-next-line rulesdir/no-timer
553
+ setTimeout(() => {
554
+ this.setData({
555
+ readValue,
556
+ realValue: toReal,
557
+ showValue: toShow,
558
+ });
559
+ }, 0);
553
560
  },
554
561
  inputValue: function (inputValue) {
555
562
  if (equal(inputValue, this.data._oldInputValue)) return;
@@ -280,6 +280,11 @@
280
280
  .wd-menulayout-body__left-menu .wedatea2td-menu__item {
281
281
  padding: 7px 24px 7px 8px;
282
282
  }
283
+ .wd-menulayout-body__left-menu .wedatea2td-menu__item .wedatea2td-menu__text {
284
+ max-width: unset;
285
+ width: 100%;
286
+ padding: 0;
287
+ }
283
288
  .wd-menulayout-body__left-menu .wedatea2td-menu--light .wedatea2td-menu__fold:hover .wedatea2td-menu__fold-icon,
284
289
  .wd-menulayout-body__left-menu .wedatea2td-menu--light .wedatea2td-menu__list li.wedatea2td-menu__submenu.is-expanded:hover,
285
290
  .wd-menulayout-body__left-menu .wedatea2td-menu--light .wedatea2td-menu__list li.wedatea2td-menu__submenu.is-expanded > .wedatea2td-menu__item {
@@ -522,6 +527,11 @@
522
527
  .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu__item {
523
528
  padding: 16px 48px 16px 16px;
524
529
  }
530
+ .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu__item .wedatea2td-menu__text {
531
+ max-width: unset;
532
+ width: 100%;
533
+ padding: 0;
534
+ }
525
535
  .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu--light .wedatea2td-menu__fold:hover .wedatea2td-menu__fold-icon,
526
536
  .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu--light .wedatea2td-menu__list li.wedatea2td-menu__submenu.is-expanded:hover,
527
537
  .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu--light .wedatea2td-menu__list li.wedatea2td-menu__submenu.is-expanded > .wedatea2td-menu__item {
@@ -280,6 +280,11 @@
280
280
  .wd-menulayout-body__left-menu .wedatea2td-menu__item {
281
281
  padding: 7px 24px 7px 8px;
282
282
  }
283
+ .wd-menulayout-body__left-menu .wedatea2td-menu__item .wedatea2td-menu__text {
284
+ max-width: unset;
285
+ width: 100%;
286
+ padding: 0;
287
+ }
283
288
  .wd-menulayout-body__left-menu .wedatea2td-menu--light .wedatea2td-menu__fold:hover .wedatea2td-menu__fold-icon,
284
289
  .wd-menulayout-body__left-menu .wedatea2td-menu--light .wedatea2td-menu__list li.wedatea2td-menu__submenu.is-expanded:hover,
285
290
  .wd-menulayout-body__left-menu .wedatea2td-menu--light .wedatea2td-menu__list li.wedatea2td-menu__submenu.is-expanded > .wedatea2td-menu__item {
@@ -522,6 +527,11 @@
522
527
  .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu__item {
523
528
  padding: 16px 48px 16px 16px;
524
529
  }
530
+ .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu__item .wedatea2td-menu__text {
531
+ max-width: unset;
532
+ width: 100%;
533
+ padding: 0;
534
+ }
525
535
  .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu--light .wedatea2td-menu__fold:hover .wedatea2td-menu__fold-icon,
526
536
  .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu--light .wedatea2td-menu__list li.wedatea2td-menu__submenu.is-expanded:hover,
527
537
  .wd-menulayout-h5__drawer .wedatea2td-drawer__body .wedatea2td-menu--light .wedatea2td-menu__list li.wedatea2td-menu__submenu.is-expanded > .wedatea2td-menu__item {
@@ -41,6 +41,7 @@
41
41
  version="wd"
42
42
  mode="selector"
43
43
  ignoreCase="{{ignoreCase}}"
44
+ staticSearchable="{{staticSearchable}}"
44
45
  bind:change="handleChange"
45
46
  bind:changeOptions="changeOptions"
46
47
  bind:search="search"
@@ -40,6 +40,7 @@
40
40
  mode="selector"
41
41
  version="wd"
42
42
  ignoreCase="{{ignoreCase}}"
43
+ staticSearchable="{{staticSearchable}}"
43
44
  bind:change="handleChange"
44
45
  bind:changeOptions="changeOptions"
45
46
  bind:changeLabel="changeLabel"
@@ -46,6 +46,7 @@
46
46
  width: 100%;
47
47
  text-align: right;
48
48
  color: var(--wd-form-textarea-label-color);
49
+ margin-top: auto;
49
50
  }
50
51
  .wd-form-textarea-wrap__input {
51
52
  max-height: var(--wd-form-textarea-group-max-height);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "miniprogram": "./",
4
4
  "packageManager": "yarn@3.0.2",
5
5
  "dependencies": {},
6
- "version": "3.7.4",
6
+ "version": "3.7.6",
7
7
  "main": "./",
8
8
  "publishConfig": {
9
9
  "access": "public"