mali-applet-ui 1.0.9 → 1.0.11

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.
@@ -236,6 +236,10 @@ export default {
236
236
  }
237
237
  }
238
238
  &.is-border {
239
+ .ml-amount-input-clear-icon {
240
+ border: 1px solid #e5e5e5;
241
+ border-left: 0;
242
+ }
239
243
  .ml-amount-input-inp,
240
244
  .ml-amount-input-simulate {
241
245
  border: 1px solid #e5e5e5;
@@ -275,8 +279,14 @@ export default {
275
279
  align-items: center;
276
280
  justify-content: center;
277
281
  background: #fff;
278
- color: #c0c4cc;
282
+ color: $ml-input-clear-icon-color;
279
283
  border-radius: 0 $ml-border-radius $ml-border-radius 0;
280
284
  }
285
+ &.is-clear {
286
+ .ml-amount-input-inp {
287
+ padding-right: 0;
288
+ border-right: 0;
289
+ }
290
+ }
281
291
  }
282
292
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <button class="ml-button" :class="[className || '', `type-${type}`, size ? `size-${size}` : '', status ? `ss-${status}` : '', {'is-round': round, 'is-underline': underline}]" :open-type="openType" :style="styles" @tap="tapEvent" @click="clickEvent">
2
+ <button class="ml-button" :class="[className || '', `type-${type}`, size ? `size-${size}` : '', status ? `ss-${status}` : '', {'is-round': round, 'is-underline': underline, 'is-disabled': disabled}]" :disabled="disabled" :open-type="openType" :style="styles" @tap="tapEvent" @click="clickEvent">
3
3
  <slot>{{ content }}</slot>
4
4
  </button>
5
5
  </template>
@@ -19,6 +19,7 @@ export default {
19
19
  default: 'button'
20
20
  },
21
21
  size: String,
22
+ disabled: Boolean,
22
23
  underline: Boolean,
23
24
  openType: String,
24
25
  width: String,
@@ -36,6 +37,9 @@ export default {
36
37
  },
37
38
  methods: {
38
39
  tapEvent () {
40
+ if (this.disabled) {
41
+ return
42
+ }
39
43
  if (this.url) {
40
44
  if (this.redirect) {
41
45
  uni.redirectTo({
@@ -206,5 +210,11 @@ export default {
206
210
  }
207
211
  }
208
212
  }
213
+ &.is-disabled {
214
+ opacity: 0.5;
215
+ // #ifdef H5
216
+ cursor: no-drop;
217
+ // #endif
218
+ }
209
219
  }
210
220
  </style>
@@ -225,7 +225,7 @@ export default {
225
225
  align-items: center;
226
226
  justify-content: center;
227
227
  background: #fff;
228
- color: #c0c4cc;
228
+ color: $ml-input-clear-icon-color;
229
229
  border-radius: 0 10rpx 10rpx 0;
230
230
  }
231
231
  .ml-cascader-picker-icon {
@@ -56,9 +56,8 @@ export default {
56
56
  }
57
57
  }
58
58
  .ml-form-group-content {
59
- padding-bottom: 20rpx;
60
59
  background: #ffffff;
61
60
  border-radius: $ml-border-radius;
62
61
  }
63
62
  }
64
- </style>
63
+ </style>
@@ -189,9 +189,6 @@ export default {
189
189
  padding: 10rpx 20rpx;
190
190
  &.is-border {
191
191
  border-bottom: 1px solid #e5e5e5;
192
- &:last-child {
193
- border: 0;
194
- }
195
192
  }
196
193
  &.is-error {
197
194
  .ml-form-item-content-error {
@@ -200,12 +197,13 @@ export default {
200
197
  }
201
198
  }
202
199
  .ml-form-item-header {
203
- min-height: 70rpx;
200
+ min-height: 78rpx;
204
201
  }
205
202
  .ml-form-item-header-asterisk {
206
203
  display: inline;
207
204
  color: red;
208
205
  padding-right: 4rpx;
206
+ font-weight: 700;
209
207
  }
210
208
  .ml-form-item-header-title {
211
209
  display: inline;
@@ -283,4 +281,4 @@ export default {
283
281
  transform: scaleY(0);
284
282
  transition: all 0.3s;
285
283
  }
286
- </style>
284
+ </style>
@@ -160,7 +160,7 @@ export default {
160
160
  align-items: center;
161
161
  justify-content: center;
162
162
  background: #fff;
163
- color: #c0c4cc;
163
+ color: $ml-input-clear-icon-color;
164
164
  border-radius: 0 $ml-border-radius $ml-border-radius 0;
165
165
  }
166
166
  .ml-input-prefix-icon,
@@ -217,6 +217,10 @@ export default {
217
217
  }
218
218
  &.is-border,
219
219
  &.is-controls {
220
+ .ml-number-input-clear-icon {
221
+ border: 1px solid #e5e5e5;
222
+ border-left: 0;
223
+ }
220
224
  .ml-number-input-inp,
221
225
  .ml-number-input-simulate {
222
226
  border: 1px solid #e5e5e5;
@@ -267,5 +271,11 @@ export default {
267
271
  .ml-number-input-plus-btn {
268
272
  border-left: 0;
269
273
  }
274
+ &.is-clear {
275
+ .ml-number-input-inp {
276
+ padding-right: 0;
277
+ border-right: 0;
278
+ }
279
+ }
270
280
  }
271
281
  </style>
@@ -167,7 +167,7 @@ export default {
167
167
  display: flex;
168
168
  flex-direction: row;
169
169
  align-items: center;
170
- padding: 0 20rpx;
170
+ padding: 0 10rpx;
171
171
  height: 70rpx;
172
172
  border-radius: $ml-border-radius;
173
173
  .ml-province-city-picker-text {
@@ -182,13 +182,13 @@ export default {
182
182
  }
183
183
  }
184
184
  .ml-province-city-picker-clear-icon {
185
- width: 60rpx;
185
+ width: 34rpx;
186
186
  display: flex;
187
187
  flex-shrink: 0;
188
188
  align-items: center;
189
189
  justify-content: center;
190
190
  background: #fff;
191
- color: #c0c4cc;
191
+ color: $ml-input-clear-icon-color;
192
192
  border-radius: 0 $ml-border-radius $ml-border-radius 0;
193
193
  }
194
194
  .ml-province-city-picker-icon {
@@ -0,0 +1,170 @@
1
+ <template>
2
+ <view v-if="!editable && (platformEnv.isWXMP || platformEnv.isQWMP)" class="ml-search-bar not-edit" :class="[className || '', {'is-right': align === 'right'}]">
3
+ <view class="ml-search-bar-simulate">
4
+ <text v-if="inpVal">{{ inpVal }}</text>
5
+ <text v-else class="ml-search-bar-placeholder">{{ placeholder }}</text>
6
+ </view>
7
+ </view>
8
+ <view v-else class="ml-search-bar is-prefix" :class="[className || '', {'is-right': align === 'right','is-disabled': disabled, 'is-clear': clearable && inpVal}]">
9
+ <view class="ml-search-bar-prefix-icon">
10
+ <ml-icon name="search"></ml-icon>
11
+ </view>
12
+ <input
13
+ v-model="inpVal"
14
+ class="ml-search-bar-inp"
15
+ autocomplete="off"
16
+ type="search"
17
+ confirm-type="search"
18
+ :placeholder="placeholder"
19
+ :maxlength="maxlength"
20
+ :disabled="disabled"
21
+ @input="inputEvent"
22
+ @focus="focusEvent"
23
+ @blur="blurEvent"
24
+ @confirm="confirmEvent"/>
25
+ <view v-if="clearable && !disabled && inpVal" class="ml-search-bar-clear-icon" @click.stop="clearEvent">
26
+ <ml-icon name="delete-filling"></ml-icon>
27
+ </view>
28
+ </view>
29
+ </template>
30
+
31
+ <script>
32
+ import { getPlatformEnv } from '../../../utils'
33
+
34
+ export default {
35
+ name: 'MlSearchBar',
36
+ options: {
37
+ virtualHost: true
38
+ },
39
+ props: {
40
+ value: [Number, String],
41
+ align: String,
42
+ disabled: Boolean,
43
+ clearable: Boolean,
44
+ readonly: Boolean,
45
+ editable: {
46
+ type: Boolean,
47
+ default: true
48
+ },
49
+ placeholder: {
50
+ type: String,
51
+ default: '搜索内容'
52
+ },
53
+ maxlength: {
54
+ type: [String, Number],
55
+ default: 30
56
+ },
57
+ className: String
58
+ },
59
+ data () {
60
+ return {
61
+ platformEnv: getPlatformEnv(),
62
+ inpVal: ''
63
+ }
64
+ },
65
+ watch: {
66
+ value (val) {
67
+ this.inpVal = val
68
+ }
69
+ },
70
+ created () {
71
+ this.inpVal = this.value
72
+ },
73
+ methods: {
74
+ inputEvent () {
75
+ const value = this.inpVal
76
+ this.$emit('input', value)
77
+ this.$emit('change', { value })
78
+ },
79
+ focusEvent () {
80
+ this.$emit('focus', { value: this.inpVal })
81
+ },
82
+ blurEvent () {
83
+ this.$emit('blur', { value: this.inpVal })
84
+ },
85
+ confirmEvent () {
86
+ const value = this.inpVal
87
+ this.$emit('confirm', { value })
88
+ },
89
+ clearEvent () {
90
+ this.inpVal = ''
91
+ this.inputEvent()
92
+ this.$emit('clear', { value: this.inpVal })
93
+ }
94
+ }
95
+ }
96
+ </script>
97
+
98
+ <style lang="scss">
99
+ .ml-search-bar {
100
+ flex-grow: 1;
101
+ display: flex;
102
+ flex-direction: row;
103
+ background: #eaeced;
104
+ border-radius: $ml-border-radius;
105
+ .ml-search-bar-placeholder {
106
+ color: $uni-text-color-placeholder;
107
+ }
108
+ .ml-search-bar-simulate {
109
+ padding: 0 10rpx;
110
+ height: 70rpx;
111
+ line-height: 70rpx;
112
+ overflow: hidden;
113
+ text-overflow: ellipsis;
114
+ white-space: nowrap;
115
+ background: #eaeced;
116
+ }
117
+ .ml-search-bar-readonly-content {
118
+ padding: 20rpx 4rpx;
119
+ }
120
+ .ml-search-bar-inp {
121
+ outline: 0;
122
+ color: rgb(23, 26, 29);
123
+ background: #eaeced;
124
+ }
125
+ .ml-search-bar-inp,
126
+ .ml-search-bar-simulate {
127
+ padding: 0 10rpx;
128
+ height: 70rpx;
129
+ width: 100%;
130
+ font-size: 30rpx;
131
+ }
132
+ .ml-search-bar-clear-icon {
133
+ width: 60rpx;
134
+ display: flex;
135
+ flex-shrink: 0;
136
+ align-items: center;
137
+ justify-content: center;
138
+ background: #eaeced;
139
+ color: $ml-input-clear-icon-color;
140
+ border-radius: 0 $ml-border-radius $ml-border-radius 0;
141
+ }
142
+ .ml-search-bar-prefix-icon {
143
+ min-width: 70rpx;
144
+ display: flex;
145
+ flex-shrink: 0;
146
+ align-items: center;
147
+ justify-content: center;
148
+ font-size: 34rpx;
149
+ padding: 0 10rpx;
150
+ color: rgba(0, 0, 0, 0.4);
151
+ }
152
+ &.is-right {
153
+ .ml-search-bar-inp,
154
+ .ml-search-bar-simulate {
155
+ text-align: right;
156
+ }
157
+ }
158
+ &.is-prefix{
159
+ .ml-search-bar-inp,
160
+ .ml-search-bar-simulate {
161
+ border-radius: $ml-border-radius;
162
+ }
163
+ }
164
+ &.is-prefix {
165
+ .ml-search-bar-prefix-icon {
166
+ border-radius: $ml-border-radius 0 0 $ml-border-radius;
167
+ }
168
+ }
169
+ }
170
+ </style>
@@ -169,7 +169,7 @@ export default {
169
169
  align-items: center;
170
170
  justify-content: center;
171
171
  background: #fff;
172
- color: #c0c4cc;
172
+ color: $ml-input-clear-icon-color;
173
173
  border-radius: 0 $ml-border-radius $ml-border-radius 0;
174
174
  }
175
175
  .ml-select-picker-icon {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",
package/theme.scss CHANGED
@@ -18,3 +18,5 @@ $ml-white-color: #ffffff;
18
18
  $ml-border-radius: 8rpx;
19
19
  // 按钮间隔宽度
20
20
  $ml-button-interval-margin: 16rpx;
21
+ // 输入框清除按钮颜色
22
+ $ml-input-clear-icon-color: rgba(23, 26, 29, 0.4);