im-ui-mobile 0.1.41 → 0.1.43
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/im-button/im-button.vue +15 -91
- package/components/im-modal/im-modal.vue +7 -85
- package/components/im-popup/im-popup.vue +32 -73
- package/package.json +1 -1
- package/types/components/button.d.ts +32 -16
- package/types/components/modal.d.ts +10 -47
- package/types/components/popup.d.ts +25 -14
|
@@ -59,96 +59,20 @@
|
|
|
59
59
|
<script setup lang="ts">
|
|
60
60
|
import { computed } from 'vue'
|
|
61
61
|
import { validator } from '../../index'
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
| 'chooseAvatar'
|
|
77
|
-
type IconPosition = 'left' | 'right'
|
|
78
|
-
type TextSize = 'small' | 'medium' | 'large'
|
|
79
|
-
|
|
80
|
-
interface Props {
|
|
81
|
-
// 基础属性
|
|
82
|
-
text?: string
|
|
83
|
-
type?: ButtonType
|
|
84
|
-
size?: ButtonSize
|
|
85
|
-
shape?: ButtonShape
|
|
86
|
-
disabled?: boolean
|
|
87
|
-
loading?: boolean
|
|
88
|
-
loadingText?: string
|
|
89
|
-
loadingColor?: string
|
|
90
|
-
showLoading?: boolean
|
|
91
|
-
hideTextWhenLoading?: boolean
|
|
92
|
-
block?: boolean
|
|
93
|
-
plain?: boolean
|
|
94
|
-
hairline?: boolean
|
|
95
|
-
native?: boolean
|
|
96
|
-
|
|
97
|
-
// 图标
|
|
98
|
-
icon?: string
|
|
99
|
-
iconPosition?: IconPosition
|
|
100
|
-
iconSize?: string | number
|
|
101
|
-
|
|
102
|
-
// 样式
|
|
103
|
-
color?: string
|
|
104
|
-
bgColor?: string
|
|
105
|
-
borderColor?: string
|
|
106
|
-
border?: boolean
|
|
107
|
-
textColor?: string
|
|
108
|
-
textSize?: TextSize
|
|
109
|
-
width?: string
|
|
110
|
-
height?: string
|
|
111
|
-
padding?: string
|
|
112
|
-
margin?: string
|
|
113
|
-
radius?: string
|
|
114
|
-
shadow?: string
|
|
115
|
-
|
|
116
|
-
// 角标
|
|
117
|
-
badge?: boolean | number | string
|
|
118
|
-
|
|
119
|
-
// 表单相关
|
|
120
|
-
formType?: ButtonFormType
|
|
121
|
-
|
|
122
|
-
// 开放能力
|
|
123
|
-
openType?: ButtonOpenType
|
|
124
|
-
appParameter?: string
|
|
125
|
-
lang?: 'en' | 'zh_CN' | 'zh_TW'
|
|
126
|
-
sessionFrom?: string
|
|
127
|
-
sendMessageTitle?: string
|
|
128
|
-
sendMessagePath?: string
|
|
129
|
-
sendMessageImg?: string
|
|
130
|
-
showMessageCard?: boolean
|
|
131
|
-
|
|
132
|
-
// 交互效果
|
|
133
|
-
hoverClass?: string
|
|
134
|
-
hoverStartTime?: number
|
|
135
|
-
hoverStayTime?: number
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// 定义 Emits
|
|
139
|
-
interface Emits {
|
|
140
|
-
(e: 'click', event: PointerEvent): void
|
|
141
|
-
(e: 'getuserinfo', detail: any): void
|
|
142
|
-
(e: 'contact', detail: any): void
|
|
143
|
-
(e: 'getphonenumber', detail: any): void
|
|
144
|
-
(e: 'error', detail: any): void
|
|
145
|
-
(e: 'launchapp', detail: any): void
|
|
146
|
-
(e: 'opensetting', detail: any): void
|
|
147
|
-
(e: 'chooseavatar', detail: any): void
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Props 和 Emits
|
|
151
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
62
|
+
import type {
|
|
63
|
+
ButtonType,
|
|
64
|
+
ButtonSize,
|
|
65
|
+
ButtonShape,
|
|
66
|
+
ButtonFormType,
|
|
67
|
+
ButtonOpenType,
|
|
68
|
+
ButtonIconPosition,
|
|
69
|
+
ButtonTextSize,
|
|
70
|
+
ButtonProps,
|
|
71
|
+
ButtonEmits
|
|
72
|
+
} from '../../types/components/button'
|
|
73
|
+
|
|
74
|
+
// ButtonProps 和 ButtonEmits
|
|
75
|
+
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
152
76
|
type: 'default',
|
|
153
77
|
size: 'medium',
|
|
154
78
|
shape: 'round',
|
|
@@ -181,7 +105,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
181
105
|
lang: 'zh_CN'
|
|
182
106
|
})
|
|
183
107
|
|
|
184
|
-
const emit = defineEmits<
|
|
108
|
+
const emit = defineEmits<ButtonEmits>()
|
|
185
109
|
|
|
186
110
|
// 计算属性
|
|
187
111
|
const buttonStyles = computed(() => {
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
:show-overlay="showOverlay" :overlay-color="overlayColor" :overlay-opacity="overlayOpacity"
|
|
4
4
|
:close-on-click-overlay="closeOnClickOverlay" :lock-scroll="lockScroll" :width="computedWidth"
|
|
5
5
|
:border-radius="borderRadius" :background-color="backgroundColor" :z-index="zIndex"
|
|
6
|
-
:show-close="showClose && showHeader" :close-position="closePosition" :
|
|
7
|
-
|
|
8
|
-
@click-overlay="handleClickOverlay">
|
|
6
|
+
:show-close="showClose && showHeader" :close-position="closePosition" :custom-class="customClass" @open="handleOpen"
|
|
7
|
+
@opened="handleOpened" @close="handleClose" @closed="handleClosed" @click-overlay="handleClickOverlay">
|
|
9
8
|
<!-- 头部 -->
|
|
10
9
|
<view v-if="showHeader" class="im-modal__header">
|
|
11
10
|
<slot name="header">
|
|
@@ -51,86 +50,10 @@ import { ref, computed } from 'vue'
|
|
|
51
50
|
import type { Popup as PopupType } from 'im-ui-mobile'
|
|
52
51
|
import ImPopup from '../im-popup/im-popup.vue'
|
|
53
52
|
import ImButton from '../im-button/im-button.vue'
|
|
54
|
-
|
|
55
|
-
// 定义 Props
|
|
56
|
-
interface Props {
|
|
57
|
-
// 显示控制
|
|
58
|
-
show?: boolean
|
|
59
|
-
modelValue?: boolean
|
|
60
|
-
|
|
61
|
-
// 标题和内容
|
|
62
|
-
title?: string
|
|
63
|
-
subtitle?: string
|
|
64
|
-
content?: string
|
|
65
|
-
|
|
66
|
-
// 头部配置
|
|
67
|
-
showHeader?: boolean
|
|
68
|
-
showSubtitle?: boolean
|
|
69
|
-
|
|
70
|
-
// 内容配置
|
|
71
|
-
bodyStyle?: Record<string, string>
|
|
72
|
-
|
|
73
|
-
// 底部按钮配置
|
|
74
|
-
showFooter?: boolean
|
|
75
|
-
showCancel?: boolean
|
|
76
|
-
showConfirm?: boolean
|
|
77
|
-
cancelText?: string
|
|
78
|
-
confirmText?: string
|
|
79
|
-
cancelType?: 'default' | 'primary' | 'warning' | 'error'
|
|
80
|
-
confirmType?: 'default' | 'primary' | 'warning' | 'error'
|
|
81
|
-
cancelPlain?: boolean
|
|
82
|
-
confirmPlain?: boolean
|
|
83
|
-
cancelDisabled?: boolean
|
|
84
|
-
confirmDisabled?: boolean
|
|
85
|
-
cancelLoading?: boolean
|
|
86
|
-
confirmLoading?: boolean
|
|
87
|
-
buttonSize?: 'small' | 'medium' | 'large'
|
|
88
|
-
|
|
89
|
-
// 弹窗配置(传递给 im-popup)
|
|
90
|
-
position?: 'center' | 'top' | 'bottom' | 'left' | 'right'
|
|
91
|
-
animation?: 'fade' | 'slide' | 'zoom' | 'none'
|
|
92
|
-
duration?: number
|
|
93
|
-
showOverlay?: boolean
|
|
94
|
-
overlayColor?: string
|
|
95
|
-
overlayOpacity?: number
|
|
96
|
-
closeOnClickOverlay?: boolean
|
|
97
|
-
lockScroll?: boolean
|
|
98
|
-
width?: string
|
|
99
|
-
maxWidth?: string
|
|
100
|
-
minWidth?: string
|
|
101
|
-
borderRadius?: string
|
|
102
|
-
backgroundColor?: string
|
|
103
|
-
zIndex?: number
|
|
104
|
-
showClose?: boolean
|
|
105
|
-
closePosition?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
|
|
106
|
-
safeAreaInsetBottom?: boolean
|
|
107
|
-
customClass?: string
|
|
108
|
-
|
|
109
|
-
// 行为控制
|
|
110
|
-
closeOnClickAction?: boolean
|
|
111
|
-
showCloseAfterConfirm?: boolean
|
|
112
|
-
showCloseAfterCancel?: boolean
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// 定义 Emits
|
|
116
|
-
interface Emits {
|
|
117
|
-
(e: 'update:show', value: boolean): void
|
|
118
|
-
(e: 'update:modelValue', value: boolean): void
|
|
119
|
-
(e: 'open'): void
|
|
120
|
-
(e: 'opened'): void
|
|
121
|
-
(e: 'close'): void
|
|
122
|
-
(e: 'closed'): void
|
|
123
|
-
(e: 'click-overlay'): void
|
|
124
|
-
(e: 'confirm'): void
|
|
125
|
-
(e: 'cancel'): void
|
|
126
|
-
(e: 'before-enter'): void
|
|
127
|
-
(e: 'after-enter'): void
|
|
128
|
-
(e: 'before-leave'): void
|
|
129
|
-
(e: 'after-leave'): void
|
|
130
|
-
}
|
|
53
|
+
import { ModalProps, ModalEmits } from '../../types/components/modal'
|
|
131
54
|
|
|
132
55
|
// 定义 Props 默认值
|
|
133
|
-
const props = withDefaults(defineProps<
|
|
56
|
+
const props = withDefaults(defineProps<ModalProps>(), {
|
|
134
57
|
show: false,
|
|
135
58
|
modelValue: false,
|
|
136
59
|
|
|
@@ -174,7 +97,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
174
97
|
zIndex: 1000,
|
|
175
98
|
showClose: true,
|
|
176
99
|
closePosition: 'top-right',
|
|
177
|
-
safeAreaInsetBottom: true,
|
|
178
100
|
customClass: '',
|
|
179
101
|
|
|
180
102
|
closeOnClickAction: true,
|
|
@@ -182,7 +104,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
182
104
|
showCloseAfterCancel: true
|
|
183
105
|
})
|
|
184
106
|
|
|
185
|
-
const emit = defineEmits<
|
|
107
|
+
const emit = defineEmits<ModalEmits>()
|
|
186
108
|
|
|
187
109
|
// 组件引用
|
|
188
110
|
const popupRef = ref<InstanceType<typeof PopupType>>()
|
|
@@ -325,7 +247,7 @@ defineExpose({
|
|
|
325
247
|
}
|
|
326
248
|
|
|
327
249
|
&__footer {
|
|
328
|
-
padding:
|
|
250
|
+
padding: 40rpx;
|
|
329
251
|
|
|
330
252
|
&-buttons {
|
|
331
253
|
display: flex;
|
|
@@ -335,7 +257,7 @@ defineExpose({
|
|
|
335
257
|
}
|
|
336
258
|
|
|
337
259
|
&__button {
|
|
338
|
-
flex: 1;
|
|
260
|
+
// flex: 1;
|
|
339
261
|
}
|
|
340
262
|
}
|
|
341
263
|
</style>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
customClass,
|
|
11
11
|
{ 'im-popup--hide': !visible },
|
|
12
12
|
{ 'im-popup--show': !!visible },
|
|
13
|
-
{ 'im-popup--safe-area':
|
|
13
|
+
{ 'im-popup--safe-area': position == 'bottom' }
|
|
14
14
|
]" :style="popupStyle" @tap.stop>
|
|
15
15
|
<!-- 关闭按钮 -->
|
|
16
16
|
<view v-if="showClose" class="im-popup__close" :class="`im-popup__close--${closePosition}`" @tap="handleClose">
|
|
@@ -29,59 +29,10 @@
|
|
|
29
29
|
<script setup lang="ts">
|
|
30
30
|
import { ref, computed, watch, onMounted, onUnmounted } from 'vue'
|
|
31
31
|
import { validator } from '../../index'
|
|
32
|
-
|
|
33
|
-
// 定义 Props
|
|
34
|
-
interface Props {
|
|
35
|
-
// 显示控制
|
|
36
|
-
show?: boolean
|
|
37
|
-
modelValue?: boolean
|
|
38
|
-
|
|
39
|
-
// 位置和动画
|
|
40
|
-
position?: 'center' | 'top' | 'bottom' | 'left' | 'right'
|
|
41
|
-
animation?: 'fade' | 'slide' | 'zoom' | 'none'
|
|
42
|
-
duration?: number
|
|
43
|
-
|
|
44
|
-
// 遮罩层
|
|
45
|
-
showOverlay?: boolean
|
|
46
|
-
overlayColor?: string
|
|
47
|
-
overlayOpacity?: number
|
|
48
|
-
closeOnClickOverlay?: boolean
|
|
49
|
-
overlayClass?: string
|
|
50
|
-
|
|
51
|
-
// 样式
|
|
52
|
-
width?: string
|
|
53
|
-
height?: string
|
|
54
|
-
backgroundColor?: string
|
|
55
|
-
borderRadius?: number | string
|
|
56
|
-
zIndex?: number
|
|
57
|
-
|
|
58
|
-
// 行为
|
|
59
|
-
lockScroll?: boolean
|
|
60
|
-
showClose?: boolean
|
|
61
|
-
closePosition?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
|
|
62
|
-
safeAreaInsetBottom?: boolean
|
|
63
|
-
|
|
64
|
-
// 自定义类名
|
|
65
|
-
customClass?: string
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// 定义 Emits
|
|
69
|
-
interface Emits {
|
|
70
|
-
(e: 'update:show', value: boolean): void
|
|
71
|
-
(e: 'update:modelValue', value: boolean): void
|
|
72
|
-
(e: 'open'): void
|
|
73
|
-
(e: 'opened'): void
|
|
74
|
-
(e: 'close'): void
|
|
75
|
-
(e: 'closed'): void
|
|
76
|
-
(e: 'click-overlay'): void
|
|
77
|
-
(e: 'before-enter'): void
|
|
78
|
-
(e: 'after-enter'): void
|
|
79
|
-
(e: 'before-leave'): void
|
|
80
|
-
(e: 'after-leave'): void
|
|
81
|
-
}
|
|
32
|
+
import { PopupProps, PopupEmits } from '../../types/components/popup'
|
|
82
33
|
|
|
83
34
|
// 定义 Props 默认值
|
|
84
|
-
const props = withDefaults(defineProps<
|
|
35
|
+
const props = withDefaults(defineProps<PopupProps>(), {
|
|
85
36
|
show: false,
|
|
86
37
|
modelValue: false,
|
|
87
38
|
|
|
@@ -104,12 +55,11 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
104
55
|
lockScroll: true,
|
|
105
56
|
showClose: false,
|
|
106
57
|
closePosition: 'top-right',
|
|
107
|
-
safeAreaInsetBottom: true,
|
|
108
58
|
|
|
109
59
|
customClass: ''
|
|
110
60
|
})
|
|
111
61
|
|
|
112
|
-
const emit = defineEmits<
|
|
62
|
+
const emit = defineEmits<PopupEmits>()
|
|
113
63
|
|
|
114
64
|
// 内部状态
|
|
115
65
|
const internalShow = ref(false)
|
|
@@ -160,7 +110,6 @@ const popupStyle = computed(() => {
|
|
|
160
110
|
style.height = '100%'
|
|
161
111
|
}
|
|
162
112
|
|
|
163
|
-
|
|
164
113
|
// 圆角
|
|
165
114
|
switch (props.position) {
|
|
166
115
|
case 'top':
|
|
@@ -188,12 +137,12 @@ const popupStyle = computed(() => {
|
|
|
188
137
|
const handleOverlayTap = () => {
|
|
189
138
|
emit('click-overlay')
|
|
190
139
|
if (props.closeOnClickOverlay) {
|
|
191
|
-
|
|
140
|
+
close()
|
|
192
141
|
}
|
|
193
142
|
}
|
|
194
143
|
|
|
195
144
|
const handleClose = () => {
|
|
196
|
-
|
|
145
|
+
close()
|
|
197
146
|
}
|
|
198
147
|
|
|
199
148
|
const handleTouchMove = (e: Event) => {
|
|
@@ -218,7 +167,7 @@ const openPopup = () => {
|
|
|
218
167
|
}
|
|
219
168
|
|
|
220
169
|
// 关闭弹窗
|
|
221
|
-
const
|
|
170
|
+
const close = () => {
|
|
222
171
|
if (animating.value) return
|
|
223
172
|
|
|
224
173
|
emit('close')
|
|
@@ -241,6 +190,24 @@ const closePopup = () => {
|
|
|
241
190
|
}, props.duration)
|
|
242
191
|
}
|
|
243
192
|
|
|
193
|
+
// 打开模态框
|
|
194
|
+
const open = () => {
|
|
195
|
+
internalShow.value = true
|
|
196
|
+
emit('update:show', true)
|
|
197
|
+
emit('update:modelValue', true)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// 切换显示状态
|
|
201
|
+
const toggle = () => {
|
|
202
|
+
if (visible.value) {
|
|
203
|
+
close()
|
|
204
|
+
} else {
|
|
205
|
+
internalShow.value = true
|
|
206
|
+
emit('update:show', true)
|
|
207
|
+
emit('update:modelValue', true)
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
244
211
|
// 滚动锁定
|
|
245
212
|
const lockScroll = () => {
|
|
246
213
|
if (typeof document !== 'undefined') {
|
|
@@ -293,21 +260,9 @@ onUnmounted(() => {
|
|
|
293
260
|
|
|
294
261
|
// 暴露方法
|
|
295
262
|
defineExpose({
|
|
296
|
-
open
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
emit('update:modelValue', true)
|
|
300
|
-
},
|
|
301
|
-
close: closePopup,
|
|
302
|
-
toggle: () => {
|
|
303
|
-
if (visible.value) {
|
|
304
|
-
closePopup()
|
|
305
|
-
} else {
|
|
306
|
-
internalShow.value = true
|
|
307
|
-
emit('update:show', true)
|
|
308
|
-
emit('update:modelValue', true)
|
|
309
|
-
}
|
|
310
|
-
},
|
|
263
|
+
open,
|
|
264
|
+
close,
|
|
265
|
+
toggle,
|
|
311
266
|
state: internalShow.value
|
|
312
267
|
})
|
|
313
268
|
</script>
|
|
@@ -442,6 +397,10 @@ defineExpose({
|
|
|
442
397
|
|
|
443
398
|
&-icon {
|
|
444
399
|
font-size: 40rpx;
|
|
400
|
+
/* #ifdef MP-WEIXIN */
|
|
401
|
+
font-size: 60rpx;
|
|
402
|
+
/* #endif */
|
|
403
|
+
|
|
445
404
|
color: #999;
|
|
446
405
|
line-height: 1;
|
|
447
406
|
font-weight: 300;
|
package/package.json
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import { AllowedComponentProps, VNodeProps } from 'vue'
|
|
2
2
|
|
|
3
|
+
// 定义类型
|
|
4
|
+
declare type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info'
|
|
5
|
+
declare type ButtonSize = 'mini' | 'small' | 'medium' | 'large'
|
|
6
|
+
declare type ButtonShape = 'square' | 'round' | 'circle'
|
|
7
|
+
declare type ButtonFormType = 'submit' | 'reset'
|
|
8
|
+
declare type ButtonOpenType =
|
|
9
|
+
| 'contact'
|
|
10
|
+
| 'share'
|
|
11
|
+
| 'getPhoneNumber'
|
|
12
|
+
| 'getUserInfo'
|
|
13
|
+
| 'launchApp'
|
|
14
|
+
| 'openSetting'
|
|
15
|
+
| 'feedback'
|
|
16
|
+
| 'chooseAvatar'
|
|
17
|
+
declare type ButtonIconPosition = 'left' | 'right'
|
|
18
|
+
declare type ButtonTextSize = 'small' | 'medium' | 'large'
|
|
19
|
+
|
|
3
20
|
declare interface ButtonProps {
|
|
4
21
|
// 基础属性
|
|
5
22
|
text?: string
|
|
6
|
-
type?:
|
|
7
|
-
size?:
|
|
8
|
-
shape?:
|
|
23
|
+
type?: ButtonType
|
|
24
|
+
size?: ButtonSize
|
|
25
|
+
shape?: ButtonShape
|
|
9
26
|
disabled?: boolean
|
|
10
27
|
loading?: boolean
|
|
11
28
|
loadingText?: string
|
|
@@ -19,7 +36,7 @@ declare interface ButtonProps {
|
|
|
19
36
|
|
|
20
37
|
// 图标
|
|
21
38
|
icon?: string
|
|
22
|
-
iconPosition?:
|
|
39
|
+
iconPosition?: ButtonIconPosition
|
|
23
40
|
iconSize?: string | number
|
|
24
41
|
|
|
25
42
|
// 样式
|
|
@@ -28,7 +45,7 @@ declare interface ButtonProps {
|
|
|
28
45
|
borderColor?: string
|
|
29
46
|
border?: boolean
|
|
30
47
|
textColor?: string
|
|
31
|
-
textSize?:
|
|
48
|
+
textSize?: ButtonTextSize
|
|
32
49
|
width?: string
|
|
33
50
|
height?: string
|
|
34
51
|
padding?: string
|
|
@@ -40,18 +57,10 @@ declare interface ButtonProps {
|
|
|
40
57
|
badge?: boolean | number | string
|
|
41
58
|
|
|
42
59
|
// 表单相关
|
|
43
|
-
formType?:
|
|
60
|
+
formType?: ButtonFormType
|
|
44
61
|
|
|
45
62
|
// 开放能力
|
|
46
|
-
openType?:
|
|
47
|
-
| 'contact'
|
|
48
|
-
| 'share'
|
|
49
|
-
| 'getPhoneNumber'
|
|
50
|
-
| 'getUserInfo'
|
|
51
|
-
| 'launchApp'
|
|
52
|
-
| 'openSetting'
|
|
53
|
-
| 'feedback'
|
|
54
|
-
| 'chooseAvatar'
|
|
63
|
+
openType?: ButtonOpenType
|
|
55
64
|
appParameter?: string
|
|
56
65
|
lang?: 'en' | 'zh_CN' | 'zh_TW'
|
|
57
66
|
sessionFrom?: string
|
|
@@ -67,7 +76,7 @@ declare interface ButtonProps {
|
|
|
67
76
|
}
|
|
68
77
|
|
|
69
78
|
declare interface ButtonEmits {
|
|
70
|
-
(e: 'click', event:
|
|
79
|
+
(e: 'click', event: PointerEvent): void
|
|
71
80
|
(e: 'getuserinfo', detail: any): void
|
|
72
81
|
(e: 'contact', detail: any): void
|
|
73
82
|
(e: 'getphonenumber', detail: any): void
|
|
@@ -89,6 +98,13 @@ export declare const Button: _Button
|
|
|
89
98
|
export default Button
|
|
90
99
|
|
|
91
100
|
export type {
|
|
101
|
+
ButtonType,
|
|
102
|
+
ButtonSize,
|
|
103
|
+
ButtonShape,
|
|
104
|
+
ButtonFormType,
|
|
105
|
+
ButtonOpenType,
|
|
106
|
+
ButtonIconPosition,
|
|
107
|
+
ButtonTextSize,
|
|
92
108
|
ButtonProps,
|
|
93
109
|
ButtonEmits
|
|
94
110
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { AllowedComponentProps, VNodeProps } from '../common'
|
|
2
|
+
import { PopupProps, PopupEmits, PopupMethods } from './popup'
|
|
3
|
+
import type { ButtonType, ButtonSize } from './button'
|
|
2
4
|
|
|
3
5
|
// 模态框组件 Props
|
|
4
|
-
declare interface ModalProps {
|
|
5
|
-
// 显示控制
|
|
6
|
-
show?: boolean
|
|
7
|
-
modelValue?: boolean
|
|
8
|
-
|
|
6
|
+
declare interface ModalProps extends PopupProps {
|
|
9
7
|
// 标题和内容
|
|
10
8
|
title?: string
|
|
11
9
|
subtitle?: string
|
|
@@ -24,35 +22,19 @@ declare interface ModalProps {
|
|
|
24
22
|
showConfirm?: boolean
|
|
25
23
|
cancelText?: string
|
|
26
24
|
confirmText?: string
|
|
27
|
-
cancelType?: 'default' | 'primary' | 'warning' | 'error'
|
|
28
|
-
confirmType?: 'default' | 'primary' | 'warning' | 'error'
|
|
25
|
+
cancelType?: ButtonType // 'default' | 'primary' | 'warning' | 'error'
|
|
26
|
+
confirmType?:ButtonType// 'default' | 'primary' | 'warning' | 'error'
|
|
29
27
|
cancelPlain?: boolean
|
|
30
28
|
confirmPlain?: boolean
|
|
31
29
|
cancelDisabled?: boolean
|
|
32
30
|
confirmDisabled?: boolean
|
|
33
31
|
cancelLoading?: boolean
|
|
34
32
|
confirmLoading?: boolean
|
|
35
|
-
buttonSize?: 'small' | 'medium' | 'large'
|
|
33
|
+
buttonSize?: ButtonSize//'small' | 'medium' | 'large'
|
|
36
34
|
|
|
37
35
|
// 弹窗配置
|
|
38
|
-
position?: 'center' | 'top' | 'bottom' | 'left' | 'right'
|
|
39
|
-
animation?: 'fade' | 'slide' | 'zoom' | 'none'
|
|
40
|
-
duration?: number
|
|
41
|
-
showOverlay?: boolean
|
|
42
|
-
overlayColor?: string
|
|
43
|
-
overlayOpacity?: number
|
|
44
|
-
closeOnClickOverlay?: boolean
|
|
45
|
-
lockScroll?: boolean
|
|
46
|
-
width?: string
|
|
47
36
|
maxWidth?: string
|
|
48
37
|
minWidth?: string
|
|
49
|
-
borderRadius?: string
|
|
50
|
-
backgroundColor?: string
|
|
51
|
-
zIndex?: number
|
|
52
|
-
showClose?: boolean
|
|
53
|
-
closePosition?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
|
|
54
|
-
safeAreaInsetBottom?: boolean
|
|
55
|
-
customClass?: string
|
|
56
38
|
|
|
57
39
|
// 行为控制
|
|
58
40
|
closeOnClickAction?: boolean
|
|
@@ -61,31 +43,12 @@ declare interface ModalProps {
|
|
|
61
43
|
}
|
|
62
44
|
|
|
63
45
|
// 模态框组件方法
|
|
64
|
-
declare interface ModalMethods {
|
|
65
|
-
// 打开模态框
|
|
66
|
-
open: () => void
|
|
67
|
-
|
|
68
|
-
// 关闭模态框
|
|
69
|
-
close: () => void
|
|
70
|
-
|
|
71
|
-
// 切换显示状态
|
|
72
|
-
toggle: () => void
|
|
46
|
+
declare interface ModalMethods extends PopupMethods {
|
|
73
47
|
}
|
|
74
48
|
|
|
75
|
-
declare interface ModalEmits {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
'open': () => void
|
|
79
|
-
'opened': () => void
|
|
80
|
-
'close': () => void
|
|
81
|
-
'closed': () => void
|
|
82
|
-
'click-overlay': () => void
|
|
83
|
-
'confirm': () => void
|
|
84
|
-
'cancel': () => void
|
|
85
|
-
'before-enter': () => void
|
|
86
|
-
'after-enter': () => void
|
|
87
|
-
'before-leave': () => void
|
|
88
|
-
'after-leave': () => void
|
|
49
|
+
declare interface ModalEmits extends PopupEmits {
|
|
50
|
+
(e: 'confirm')
|
|
51
|
+
(e: 'cancel')
|
|
89
52
|
}
|
|
90
53
|
|
|
91
54
|
declare interface _Modal {
|
|
@@ -21,31 +21,41 @@ declare interface PopupProps {
|
|
|
21
21
|
width?: string
|
|
22
22
|
height?: string
|
|
23
23
|
backgroundColor?: string
|
|
24
|
-
borderRadius?: string
|
|
24
|
+
borderRadius?: number | string
|
|
25
25
|
zIndex?: number
|
|
26
26
|
|
|
27
27
|
// 行为
|
|
28
28
|
lockScroll?: boolean
|
|
29
29
|
showClose?: boolean
|
|
30
30
|
closePosition?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
|
|
31
|
-
safeAreaInsetBottom?: boolean
|
|
32
31
|
|
|
33
32
|
// 自定义
|
|
34
33
|
customClass?: string
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
declare interface PopupEmits {
|
|
38
|
-
'update:show'
|
|
39
|
-
'update:modelValue'
|
|
40
|
-
'open'
|
|
41
|
-
'opened'
|
|
42
|
-
'close'
|
|
43
|
-
'closed'
|
|
44
|
-
'click-overlay'
|
|
45
|
-
'before-enter'
|
|
46
|
-
'after-enter'
|
|
47
|
-
'before-leave'
|
|
48
|
-
'after-leave'
|
|
37
|
+
(e: 'update:show', value: boolean)
|
|
38
|
+
(e: 'update:modelValue', value: boolean)
|
|
39
|
+
(e: 'open')
|
|
40
|
+
(e: 'opened')
|
|
41
|
+
(e: 'close')
|
|
42
|
+
(e: 'closed')
|
|
43
|
+
(e: 'click-overlay')
|
|
44
|
+
(e: 'before-enter')
|
|
45
|
+
(e: 'after-enter')
|
|
46
|
+
(e: 'before-leave')
|
|
47
|
+
(e: 'after-leave')
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare interface PopupMethods {
|
|
51
|
+
// 打开模态框
|
|
52
|
+
open: () => void
|
|
53
|
+
|
|
54
|
+
// 关闭模态框
|
|
55
|
+
close: () => void
|
|
56
|
+
|
|
57
|
+
// 切换显示状态
|
|
58
|
+
toggle: () => void
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
declare interface _Popup {
|
|
@@ -61,5 +71,6 @@ export default Popup
|
|
|
61
71
|
|
|
62
72
|
export type {
|
|
63
73
|
PopupProps,
|
|
64
|
-
PopupEmits
|
|
74
|
+
PopupEmits,
|
|
75
|
+
PopupMethods
|
|
65
76
|
}
|