@cloudbase/weda-ui-mp 3.18.5 → 3.18.8

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.
@@ -35,7 +35,7 @@ Component({
35
35
  placeholderCls: `${WD_PREFIX}-form-input-wrap__placeholder weui-input__placeholder`,
36
36
  cls: '',
37
37
  currentInputValue: '',
38
- hasClearIcon: false,
38
+ _hasClearIcon: false,
39
39
  isFocus: false,
40
40
  counter: 0,
41
41
 
@@ -102,9 +102,9 @@ Component({
102
102
  },
103
103
  observers: {
104
104
  'disabled,clearable,isFocus,currentInputValue': function (disabled, clearable, isFocus, currentInputValue) {
105
- const hasClearIcon = clearable && isFocus && !disabled && currentInputValue?.length > 0;
105
+ const _hasClearIcon = clearable && isFocus && !disabled && currentInputValue?.length > 0;
106
106
  const counter = typeof currentInputValue === 'string' ? currentInputValue.length : 0;
107
- this.setData({ hasClearIcon, counter });
107
+ this.setData({ _hasClearIcon, counter });
108
108
  },
109
109
  'disabled,size,classRoot,wrapClassName,before,after': function (
110
110
  disabled,
@@ -56,14 +56,14 @@
56
56
  </view>
57
57
 
58
58
  <!-- 清除按钮 -->
59
- <block wx:if="{{hasClearIcon}}">
60
- <view class="{{inputWrap}}__after">
59
+ <block wx:if="{{_hasClearIcon}}">
60
+ <view class="{{inputWrap}}__after" >
61
61
  <wd-icon className="{{classPrefix}}-icon__trigger" name="td:close-circle-filled" size="{{iconSize}}" bind:touchstart="handleClear"></wd-icon>
62
62
  </view>
63
63
  </block>
64
64
 
65
65
  <!-- 后缀图标 -->
66
- <block wx:if="{{!hasClearIcon && suffixType}}">
66
+ <block wx:if="{{!_hasClearIcon && suffixType}}">
67
67
  <view class="{{inputWrap}}__after" data-type="suffix" bind:tap="inputAdornmentClick">
68
68
  <wd-icon name="{{suffixIcon}}" type="{{suffixType}}" src="{{suffixSrc}}" size="{{iconSize}}" className="{{root}}__icon-after"></wd-icon>
69
69
  </view>
@@ -76,7 +76,7 @@ Component({
76
76
  * 控制弹窗打开/关闭
77
77
  * @param {Boolean} isOpen
78
78
  */
79
- dealShow(isOpen, params) {
79
+ dealShow(isOpen, params, isTrigger = true) {
80
80
  let setImmediately = {
81
81
  maskPreToShow: true,
82
82
  isMaskShow: !isOpen,
@@ -92,8 +92,9 @@ Component({
92
92
  }
93
93
 
94
94
  this.setData(setImmediately);
95
-
96
- this.triggerEvent(isOpen ? 'open' : 'close', params);
95
+ if (isTrigger) {
96
+ this.triggerEvent(isOpen ? 'open' : 'close', params);
97
+ }
97
98
  },
98
99
  /**
99
100
  * 关闭弹窗
@@ -162,6 +163,9 @@ Component({
162
163
  modalBdClasses,
163
164
  });
164
165
  },
166
+ defaultShow: function (defaultShow) {
167
+ this.dealShow(defaultShow, {}, false);
168
+ },
165
169
  'isBdShow,openInfo,closeInfo': function () {
166
170
  this.updateWidgetAPI();
167
171
  },
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "miniprogram": "./",
4
4
  "packageManager": "yarn@3.0.2",
5
5
  "dependencies": {},
6
- "version": "3.18.5",
6
+ "version": "3.18.8",
7
7
  "main": "./",
8
8
  "publishConfig": {
9
9
  "access": "public"