im-ui-mobile 0.1.0 → 0.1.2
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-avatar/im-avatar.vue +7 -7
- package/components/im-badge/im-badge.vue +326 -0
- package/components/im-button/im-button.vue +71 -34
- package/components/im-card/im-card.vue +563 -0
- package/components/im-chat-item/im-chat-item.vue +5 -4
- package/components/im-col/im-col.vue +191 -0
- package/components/im-dialog/im-dialog.vue +543 -0
- package/components/im-double-tap-view/im-double-tap-view.vue +93 -0
- package/components/im-emoji-picker/im-emoji-picker.vue +1143 -0
- package/components/im-friend-item/im-friend-item.vue +1 -1
- package/components/im-group-item/im-group-item.vue +1 -1
- package/components/im-group-member-selector/im-group-member-selector.vue +5 -5
- package/components/im-group-rtc-join/im-group-rtc-join.vue +8 -8
- package/components/im-icon/im-icon.vue +593 -0
- package/components/im-image-upload/im-image-upload.vue +0 -2
- package/components/im-link/im-link.vue +628 -0
- package/components/im-loading/im-loading.vue +13 -4
- package/components/im-mention-picker/im-mention-picker.vue +8 -7
- package/components/im-message-action/im-message-action.vue +678 -0
- package/components/im-message-item/im-message-item.vue +28 -26
- package/components/im-message-list/im-message-list.vue +1108 -0
- package/components/im-modal/im-modal.vue +373 -0
- package/components/im-nav-bar/im-nav-bar.vue +689 -75
- package/components/im-parse/im-parse.vue +1054 -0
- package/components/im-popup/im-popup.vue +467 -0
- package/components/im-read-receipt/im-read-receipt.vue +10 -10
- package/components/im-row/im-row.vue +189 -0
- package/components/im-search/im-search.vue +762 -0
- package/components/im-sku/im-sku.vue +720 -0
- package/components/im-sku/utils/helper.ts +182 -0
- package/components/im-stepper/im-stepper.vue +585 -0
- package/components/im-stepper/utils/helper.ts +167 -0
- package/components/im-tabs/im-tabs.vue +1022 -0
- package/components/im-tabs/tabs-navigation.vue +489 -0
- package/components/im-tabs/utils/helper.ts +181 -0
- package/components/im-tabs-tab-pane/im-tabs-tab-pane.vue +145 -0
- package/components/im-upload/im-upload.vue +1236 -0
- package/components/im-voice-input/im-voice-input.vue +1 -1
- package/index.js +3 -5
- package/index.scss +19 -0
- package/libs/emoji-data.ts +229 -0
- package/libs/index.ts +16 -16
- package/package.json +1 -2
- package/styles/button.scss +33 -33
- package/theme.scss +2 -2
- package/types/components/badge.d.ts +42 -0
- package/types/components/button.d.ts +2 -1
- package/types/components/card.d.ts +122 -0
- package/types/components/col.d.ts +37 -0
- package/types/components/dialog.d.ts +125 -0
- package/types/components/double-tap-view.d.ts +31 -0
- package/types/components/emoji-picker.d.ts +121 -0
- package/types/components/group-rtc-join.d.ts +1 -1
- package/types/components/icon.d.ts +77 -0
- package/types/components/link.d.ts +55 -0
- package/types/components/loading.d.ts +1 -0
- package/types/components/message-action.d.ts +96 -0
- package/types/components/message-item.d.ts +2 -2
- package/types/components/message-list.d.ts +136 -0
- package/types/components/modal.d.ts +106 -0
- package/types/components/nav-bar.d.ts +125 -0
- package/types/components/parse.d.ts +90 -0
- package/types/components/popup.d.ts +58 -0
- package/types/components/row.d.ts +31 -0
- package/types/components/search.d.ts +54 -0
- package/types/components/sku.d.ts +195 -0
- package/types/components/stepper.d.ts +99 -0
- package/types/components/tabs-tab-pane.d.ts +27 -0
- package/types/components/tabs.d.ts +117 -0
- package/types/components/upload.d.ts +137 -0
- package/types/components.d.ts +19 -1
- package/types/index.d.ts +38 -1
- package/types/libs/index.d.ts +10 -10
- package/types/utils/base64.d.ts +5 -0
- package/types/utils/dom.d.ts +3 -0
- package/types/utils/enums.d.ts +4 -5
- package/types/utils/validator.d.ts +74 -0
- package/utils/base64.js +18 -0
- package/utils/dom.js +353 -1
- package/utils/enums.js +4 -5
- package/utils/validator.js +230 -0
- package/components/im-file-upload/im-file-upload.vue +0 -309
- package/plugins/uview-plus.js +0 -29
- package/types/components/arrow-bar.d.ts +0 -14
- package/types/components/file-upload.d.ts +0 -58
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="class" :style="style" @tap="handleTap">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { ref, onUnmounted } from 'vue'
|
|
9
|
+
|
|
10
|
+
export interface DoubleTapViewProps {
|
|
11
|
+
/** 双击间隔时间(毫秒)默认 300ms */
|
|
12
|
+
delay?: number
|
|
13
|
+
/** 是否阻止事件冒泡 */
|
|
14
|
+
stopPropagation?: boolean,
|
|
15
|
+
/** CSS样式类 **/
|
|
16
|
+
class?: string,
|
|
17
|
+
/** CSS样式 **/
|
|
18
|
+
style?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface DoubleTapViewEmits {
|
|
22
|
+
/** 单击事件 */
|
|
23
|
+
(e: 'single-tap', event: any): void
|
|
24
|
+
/** 双击事件 */
|
|
25
|
+
(e: 'double-tap', event: any): void
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const props = withDefaults(defineProps<DoubleTapViewProps>(), {
|
|
29
|
+
delay: 300,
|
|
30
|
+
stopPropagation: false
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const emit = defineEmits<DoubleTapViewEmits>()
|
|
34
|
+
|
|
35
|
+
// 状态管理
|
|
36
|
+
const lastTapTime = ref(0)
|
|
37
|
+
let tapTimeout: ReturnType<typeof setTimeout> | null = null
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 清除定时器
|
|
41
|
+
*/
|
|
42
|
+
const clearTapTimeout = () => {
|
|
43
|
+
if (tapTimeout) {
|
|
44
|
+
clearTimeout(tapTimeout)
|
|
45
|
+
tapTimeout = null
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 处理点击事件
|
|
51
|
+
*/
|
|
52
|
+
const handleTap = (event: any) => {
|
|
53
|
+
if (props.stopPropagation) {
|
|
54
|
+
event?.stopPropagation?.()
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const currentTime = Date.now()
|
|
58
|
+
const timeDiff = currentTime - lastTapTime.value
|
|
59
|
+
|
|
60
|
+
// 双击检测
|
|
61
|
+
if (timeDiff > 0 && timeDiff < props.delay) {
|
|
62
|
+
clearTapTimeout()
|
|
63
|
+
emit('double-tap', event)
|
|
64
|
+
lastTapTime.value = 0
|
|
65
|
+
} else {
|
|
66
|
+
// 可能是单击
|
|
67
|
+
lastTapTime.value = currentTime
|
|
68
|
+
tapTimeout = setTimeout(() => {
|
|
69
|
+
emit('single-tap', event)
|
|
70
|
+
lastTapTime.value = 0
|
|
71
|
+
tapTimeout = null
|
|
72
|
+
}, props.delay)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 重置组件状态
|
|
78
|
+
*/
|
|
79
|
+
const reset = () => {
|
|
80
|
+
clearTapTimeout()
|
|
81
|
+
lastTapTime.value = 0
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 暴露方法给父组件
|
|
85
|
+
defineExpose({
|
|
86
|
+
reset
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
// 组件卸载时清理
|
|
90
|
+
onUnmounted(() => {
|
|
91
|
+
clearTapTimeout()
|
|
92
|
+
})
|
|
93
|
+
</script>
|