mali-applet-ui 0.0.99 → 0.0.100
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/components/ml-checkbox/ml-checkbox.vue +6 -7
- package/components/ml-checkbox-group/ml-checkbox-group.vue +4 -4
- package/components/ml-list-group/ml-list-group.vue +1 -1
- package/components/ml-list-item/ml-list-item.vue +1 -4
- package/components/ml-list-menu-item/ml-list-menu-item.vue +3 -2
- package/components/ml-popup/ml-popup.vue +36 -11
- package/components/ml-radio/ml-radio.vue +6 -7
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</view>
|
|
6
6
|
<view class="ml-checkbox-content">
|
|
7
7
|
<slot>
|
|
8
|
-
<
|
|
8
|
+
<view>{{ content }}</view>
|
|
9
9
|
</slot>
|
|
10
10
|
</view>
|
|
11
11
|
</view>
|
|
@@ -53,13 +53,13 @@ export default {
|
|
|
53
53
|
|
|
54
54
|
<style lang="scss">
|
|
55
55
|
.ml-checkbox {
|
|
56
|
-
display: inline-
|
|
56
|
+
display: inline-flex;
|
|
57
57
|
margin-right: 20rpx;
|
|
58
|
+
align-items: center;
|
|
58
59
|
&.is-checked {
|
|
59
60
|
color: $uni-color-primary;
|
|
60
61
|
}
|
|
61
62
|
.ml-checkbox-icon {
|
|
62
|
-
display: inline-block;
|
|
63
63
|
width: 40rpx;
|
|
64
64
|
margin-right: 10rpx;
|
|
65
65
|
text-align: center;
|
|
@@ -67,10 +67,9 @@ export default {
|
|
|
67
67
|
}
|
|
68
68
|
.ml-checkbox-icon,
|
|
69
69
|
.ml-checkbox-content {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
display: inline-block;
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
flex-direction: row;
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-
|
|
3
|
-
<view class="ml-
|
|
2
|
+
<view class="ml-checkbox-group" :class="[className || '', {'is-disabled': disabled, 'is-vertical': vertical}]">
|
|
3
|
+
<view class="ml-checkbox-group-item" v-for="(item, index) in options" :key="index">
|
|
4
4
|
<ml-checkbox :value="value.includes(item.value) ? item.value : null" :label="item.value" :content="item.label" :disabled="disabled || item.disabled" @change="changeEvent"></ml-checkbox>
|
|
5
5
|
</view>
|
|
6
6
|
</view>
|
|
@@ -33,12 +33,12 @@ export default {
|
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<style lang="scss">
|
|
36
|
-
.ml-
|
|
36
|
+
.ml-checkbox-group {
|
|
37
37
|
display: inline-flex;
|
|
38
38
|
&.is-vertical {
|
|
39
39
|
width: 100%;
|
|
40
40
|
flex-direction: column;
|
|
41
|
-
& > .ml-
|
|
41
|
+
& > .ml-checkbox-group-item {
|
|
42
42
|
margin: 4rpx 0;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -74,12 +74,9 @@ export default {
|
|
|
74
74
|
display: flex;
|
|
75
75
|
flex-direction: row;
|
|
76
76
|
padding: 20rpx;
|
|
77
|
-
margin: 20rpx
|
|
77
|
+
margin-bottom: 20rpx;
|
|
78
78
|
border-radius: 10rpx;
|
|
79
79
|
background: #ffffff;
|
|
80
|
-
&:first-child {
|
|
81
|
-
margin-top: 0;
|
|
82
|
-
}
|
|
83
80
|
&:last-child {
|
|
84
81
|
margin-bottom: 0;
|
|
85
82
|
}
|
|
@@ -81,10 +81,11 @@ export default {
|
|
|
81
81
|
.ml-list-menu-item {
|
|
82
82
|
display: flex;
|
|
83
83
|
flex-direction: row;
|
|
84
|
+
align-items: center;
|
|
84
85
|
border-bottom: 1px solid #e5e5e5;
|
|
85
|
-
|
|
86
|
+
min-height: 90rpx;
|
|
86
87
|
font-size: 30rpx;
|
|
87
|
-
padding:
|
|
88
|
+
padding: 10rpx 20rpx;
|
|
88
89
|
background: #ffffff;
|
|
89
90
|
&:first-child {
|
|
90
91
|
border-top: 1px solid #e5e5e5;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-popup" :class="[className || '', {'is-visible': visible, 'is-animate': isAnimate}]">
|
|
3
|
-
<view v-if="visible" class="ml-popup-warpper">
|
|
2
|
+
<view class="ml-popup" :class="[className || '', {'is-visible': visible, 'is-animate': isAnimate}]" @tap="tapMaskEvent">
|
|
3
|
+
<view v-if="visible" class="ml-popup-warpper" @tap.stop>
|
|
4
4
|
<view v-if="showHeader" class="ml-popup-header">
|
|
5
5
|
<slot name="header">
|
|
6
6
|
<view v-if="title" class="ml-popup-header-title">{{ title }}</view>
|
|
7
7
|
</slot>
|
|
8
8
|
</view>
|
|
9
9
|
<view class="ml-popup-body" :style="bodyStyles">
|
|
10
|
-
<
|
|
10
|
+
<scroll-view scroll-y>
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</scroll-view>
|
|
11
13
|
</view>
|
|
12
14
|
<view v-if="showConfirmButton || showCancelButton" class="ml-popup-footer">
|
|
13
|
-
<ml-button width="40%" round @click="cancelEvent">{{ cancelButtonText }}</ml-button>
|
|
14
|
-
<ml-button status="primary" width="40%" round @click="confirmEvent">{{ confirmButtonText }}</ml-button>
|
|
15
|
+
<ml-button v-if="showCancelButton" width="40%" round @click="cancelEvent">{{ cancelButtonText }}</ml-button>
|
|
16
|
+
<ml-button v-if="showConfirmButton" status="primary" width="40%" round @click="confirmEvent">{{ confirmButtonText }}</ml-button>
|
|
15
17
|
</view>
|
|
16
18
|
</view>
|
|
17
19
|
</view>
|
|
@@ -28,6 +30,7 @@ export default {
|
|
|
28
30
|
type: Boolean,
|
|
29
31
|
default: true
|
|
30
32
|
},
|
|
33
|
+
maskClosable: Boolean,
|
|
31
34
|
showConfirmButton: Boolean,
|
|
32
35
|
confirmButtonText: {
|
|
33
36
|
type: String,
|
|
@@ -48,7 +51,8 @@ export default {
|
|
|
48
51
|
data () {
|
|
49
52
|
return {
|
|
50
53
|
visible: false,
|
|
51
|
-
isAnimate: false
|
|
54
|
+
isAnimate: false,
|
|
55
|
+
animateTime: null
|
|
52
56
|
}
|
|
53
57
|
},
|
|
54
58
|
computed: {
|
|
@@ -76,26 +80,41 @@ export default {
|
|
|
76
80
|
},
|
|
77
81
|
methods: {
|
|
78
82
|
close () {
|
|
83
|
+
clearTimeout(this.animateTime)
|
|
84
|
+
this.isAnimate = true
|
|
79
85
|
this.isAnimate = false
|
|
80
|
-
setTimeout(() => {
|
|
86
|
+
this.animateTime = setTimeout(() => {
|
|
81
87
|
this.visible = false
|
|
88
|
+
this.$emit('input', false)
|
|
89
|
+
this.$emit('show', {})
|
|
82
90
|
}, 300)
|
|
83
91
|
},
|
|
84
92
|
open () {
|
|
93
|
+
clearTimeout(this.animateTime)
|
|
94
|
+
this.isAnimate = false
|
|
85
95
|
this.visible = true
|
|
86
|
-
this
|
|
96
|
+
this.animateTime = setTimeout(() => {
|
|
87
97
|
this.isAnimate = true
|
|
88
|
-
|
|
98
|
+
this.$emit('hide', {})
|
|
99
|
+
}, 20)
|
|
100
|
+
this.$emit('input', true)
|
|
101
|
+
},
|
|
102
|
+
tapMaskEvent () {
|
|
103
|
+
if (this.maskClosable) {
|
|
104
|
+
this.close()
|
|
105
|
+
}
|
|
89
106
|
},
|
|
90
107
|
cancelEvent () {
|
|
91
108
|
if (this.cancelClosable) {
|
|
92
109
|
this.close()
|
|
93
110
|
}
|
|
111
|
+
this.$emit('cancel', {})
|
|
94
112
|
},
|
|
95
113
|
confirmEvent () {
|
|
96
114
|
if (this.confirmClosable) {
|
|
97
115
|
this.close()
|
|
98
116
|
}
|
|
117
|
+
this.$emit('confirm', {})
|
|
99
118
|
}
|
|
100
119
|
}
|
|
101
120
|
}
|
|
@@ -125,22 +144,28 @@ export default {
|
|
|
125
144
|
bottom: 0;
|
|
126
145
|
left: 0;
|
|
127
146
|
width: 100%;
|
|
147
|
+
padding-bottom: 20rpx;
|
|
128
148
|
transform: translateY(100%);
|
|
129
|
-
transition: transform
|
|
149
|
+
transition: transform 0.3s ease, transform 0.3s ease;
|
|
130
150
|
background: #fff;
|
|
131
151
|
}
|
|
132
152
|
.ml-popup-header-title {
|
|
133
153
|
text-align: center;
|
|
134
154
|
height: 70rpx;
|
|
135
155
|
line-height: 70rpx;
|
|
156
|
+
font-size: $uni-font-size-base;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
text-overflow: ellipsis;
|
|
159
|
+
white-space: nowrap;
|
|
136
160
|
}
|
|
137
161
|
.ml-popup-body {
|
|
138
162
|
padding: 20rpx;
|
|
139
163
|
overflow: auto;
|
|
140
|
-
height:
|
|
164
|
+
height: 500rpx;
|
|
141
165
|
}
|
|
142
166
|
.ml-popup-footer {
|
|
143
167
|
display: flex;
|
|
144
168
|
flex-direction: row;
|
|
169
|
+
padding: 20rpx;
|
|
145
170
|
}
|
|
146
171
|
</style>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</view>
|
|
6
6
|
<view class="ml-radio-content">
|
|
7
7
|
<slot>
|
|
8
|
-
<
|
|
8
|
+
<view>{{ content }}</view>
|
|
9
9
|
</slot>
|
|
10
10
|
</view>
|
|
11
11
|
</view>
|
|
@@ -44,22 +44,21 @@ export default {
|
|
|
44
44
|
|
|
45
45
|
<style lang="scss">
|
|
46
46
|
.ml-radio {
|
|
47
|
-
display: inline-
|
|
47
|
+
display: inline-flex;
|
|
48
48
|
margin-right: 20rpx;
|
|
49
|
+
align-items: center;
|
|
49
50
|
&.is-checked {
|
|
50
51
|
color: $uni-color-primary;
|
|
51
52
|
}
|
|
52
53
|
.ml-radio-icon {
|
|
53
|
-
display: inline-block;
|
|
54
54
|
margin-right: 10rpx;
|
|
55
55
|
font-size: 1.4em;
|
|
56
56
|
}
|
|
57
57
|
.ml-radio-icon,
|
|
58
58
|
.ml-radio-content {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
display: inline-block;
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
flex-direction: row;
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
</style>
|