mali-applet-ui 0.1.40 → 0.1.41

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.
@@ -13,8 +13,8 @@
13
13
  </view>
14
14
  <view v-if="showConfirmButton || showCancelButton || showFooter" class="ml-drawer-footer">
15
15
  <slot name="footer">
16
- <ml-button v-if="showCancelButton" width="40%" round @click="cancelEvent">{{ cancelButtonText }}</ml-button>
17
- <ml-button v-if="showConfirmButton" status="primary" width="40%" round @click="confirmEvent">{{ confirmButtonText }}</ml-button>
16
+ <ml-button v-if="showCancelButton" width="40%" @click="cancelEvent">{{ cancelButtonText }}</ml-button>
17
+ <ml-button v-if="showConfirmButton" status="primary" width="40%" @click="confirmEvent">{{ confirmButtonText }}</ml-button>
18
18
  </slot>
19
19
  </view>
20
20
  </view>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <view class="ml-tooltip">
3
+ <slot></slot>
4
+ <view class="ml-tooltip-title">
5
+ <view>{{ title }}</view>
6
+ </view>
7
+ </view>
8
+ </template>
9
+
10
+ <script>
11
+ export default {
12
+ name: 'MlTooltip',
13
+ props: {
14
+ value: Boolean,
15
+ title: String,
16
+ placement: String
17
+ },
18
+ data () {
19
+ return {
20
+ }
21
+ }
22
+ }
23
+ </script>
24
+
25
+ <style lang="scss">
26
+
27
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "components",
@@ -1,200 +0,0 @@
1
- <template>
2
- <view class="ml-popup" :class="[className || '', `placement-${placement || 'bottom'}`, {'is-visible': visible, 'is-animate': isAnimate}]" @tap="tapMaskEvent">
3
- <view v-if="visible" class="ml-popup-warpper" @tap.stop>
4
- <view v-if="showHeader" class="ml-popup-header">
5
- <slot name="header">
6
- <view v-if="title" class="ml-popup-header-title">{{ title }}</view>
7
- </slot>
8
- </view>
9
- <view class="ml-popup-body" :style="bodyStyles">
10
- <scroll-view scroll-y>
11
- <slot></slot>
12
- </scroll-view>
13
- </view>
14
- <view v-if="showConfirmButton || showCancelButton || showFooter" class="ml-popup-footer">
15
- <slot name="footer">
16
- <ml-button v-if="showCancelButton" width="40%" round @click="cancelEvent">{{ cancelButtonText }}</ml-button>
17
- <ml-button v-if="showConfirmButton" status="primary" width="40%" round @click="confirmEvent">{{ confirmButtonText }}</ml-button>
18
- </slot>
19
- </view>
20
- </view>
21
- </view>
22
- </template>
23
-
24
- <script>
25
- export default {
26
- name: 'MlPopup',
27
- props: {
28
- value: Boolean,
29
- title: String,
30
- height: String,
31
- width: String,
32
- showHeader: {
33
- type: Boolean,
34
- default: true
35
- },
36
- showFooter: Boolean,
37
- placement: String,
38
- maskClosable: Boolean,
39
- showConfirmButton: Boolean,
40
- confirmButtonText: {
41
- type: String,
42
- default: '确认'
43
- },
44
- confirmClosable: Boolean,
45
- showCancelButton: Boolean,
46
- cancelButtonText: {
47
- type: String,
48
- default: '取消'
49
- },
50
- cancelClosable: {
51
- type: Boolean,
52
- default: true
53
- },
54
- className: String
55
- },
56
- data () {
57
- return {
58
- visible: false,
59
- isAnimate: false,
60
- animateTime: null
61
- }
62
- },
63
- computed: {
64
- bodyStyles () {
65
- const wSty = this.width ? `width:${this.width};` : ''
66
- const hSty = this.height ? `height:${this.height};` : ''
67
- return `${wSty}${hSty}`
68
- }
69
- },
70
- watch: {
71
- value (val) {
72
- if (val) {
73
- this.open()
74
- } else {
75
- this.close()
76
- }
77
- }
78
- },
79
- created () {
80
- this.$nextTick(() => {
81
- if (this.value) {
82
- this.open()
83
- } else {
84
- this.close()
85
- }
86
- })
87
- },
88
- methods: {
89
- close () {
90
- clearTimeout(this.animateTime)
91
- this.isAnimate = true
92
- this.isAnimate = false
93
- this.animateTime = setTimeout(() => {
94
- this.visible = false
95
- this.$emit('input', false)
96
- this.$emit('hide', {})
97
- }, 300)
98
- },
99
- open () {
100
- clearTimeout(this.animateTime)
101
- this.isAnimate = false
102
- this.visible = true
103
- this.animateTime = setTimeout(() => {
104
- this.isAnimate = true
105
- this.$emit('show', {})
106
- }, 20)
107
- this.$emit('input', true)
108
- },
109
- tapMaskEvent () {
110
- if (this.maskClosable) {
111
- this.close()
112
- }
113
- },
114
- cancelEvent () {
115
- if (this.cancelClosable) {
116
- this.close()
117
- }
118
- this.$emit('cancel', {})
119
- },
120
- confirmEvent () {
121
- if (this.confirmClosable) {
122
- this.close()
123
- }
124
- this.$emit('confirm', {})
125
- }
126
- }
127
- }
128
- </script>
129
-
130
- <style lang="scss">
131
- .ml-popup {
132
- display: none;
133
- position: fixed;
134
- top: 0;
135
- left: 0;
136
- width: $ml-page-full-width;
137
- height: 100vh;
138
- z-index: 999;
139
- background-color: rgba(0, 0, 0, 0.4);
140
- // #ifdef H5
141
- left: 50%;
142
- transform: translateX(-50%);
143
- // #endif
144
- &.is-visible {
145
- display: block;
146
- }
147
- &.placement-left {
148
- &.is-animate {
149
- .ml-popup-warpper {
150
- transform: translateX(0);
151
- }
152
- }
153
- .ml-popup-warpper {
154
- height: 100%;
155
- transform: translateX(-100%);
156
- }
157
- }
158
- &.placement-bottom {
159
- &.is-animate {
160
- .ml-popup-warpper {
161
- transform: translateY(0);
162
- }
163
- }
164
- .ml-popup-warpper {
165
- width: 100%;
166
- transform: translateY(100%);
167
- }
168
- }
169
- }
170
- .ml-popup-warpper {
171
- position: absolute;
172
- bottom: 0;
173
- left: 0;
174
- padding-bottom: 20rpx;
175
- background: #fff;
176
- transition: transform 0.25s ease, transform 0.3s ease;
177
- }
178
- .ml-popup-header {
179
- padding: 10rpx 20rpx;
180
- }
181
- .ml-popup-header-title {
182
- text-align: center;
183
- height: 70rpx;
184
- line-height: 70rpx;
185
- font-size: $uni-font-size-base;
186
- overflow: hidden;
187
- text-overflow: ellipsis;
188
- white-space: nowrap;
189
- }
190
- .ml-popup-body {
191
- padding: 20rpx;
192
- overflow: auto;
193
- height: 500rpx;
194
- }
195
- .ml-popup-footer {
196
- display: flex;
197
- flex-direction: row;
198
- padding: 20rpx;
199
- }
200
- </style>