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.
- package/lib/components/ml-amount-input/ml-amount-input.vue +11 -1
- package/lib/components/ml-button/ml-button.vue +11 -1
- package/lib/components/ml-cascader-picker/ml-cascader-picker.vue +1 -1
- package/lib/components/ml-form-group/ml-form-group.vue +1 -2
- package/lib/components/ml-form-item/ml-form-item.vue +3 -5
- package/lib/components/ml-input/ml-input.vue +1 -1
- package/lib/components/ml-number-input/ml-number-input.vue +10 -0
- package/lib/components/ml-province-city-picker/ml-province-city-picker.vue +3 -3
- package/lib/components/ml-search-bar/ml-search-bar.vue +170 -0
- package/lib/components/ml-select-picker/ml-select-picker.vue +1 -1
- package/package.json +1 -1
- package/theme.scss +2 -0
|
@@ -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:
|
|
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>
|
|
@@ -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:
|
|
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>
|
|
@@ -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
|
|
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:
|
|
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:
|
|
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>
|
package/package.json
CHANGED