im-ui-mobile 0.0.98 → 0.0.99

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.
Files changed (40) hide show
  1. package/components/im-avatar/im-avatar.vue +121 -121
  2. package/components/im-button/im-button.vue +630 -626
  3. package/components/im-cell/im-cell.vue +10 -15
  4. package/components/im-cell-group/im-cell-group.vue +16 -16
  5. package/components/im-chat-item/im-chat-item.vue +213 -213
  6. package/components/im-context-menu/im-context-menu.vue +138 -138
  7. package/components/im-file-upload/im-file-upload.vue +309 -309
  8. package/components/im-friend-item/im-friend-item.vue +82 -75
  9. package/components/im-group-item/im-group-item.vue +62 -62
  10. package/components/im-group-member-selector/im-group-member-selector.vue +202 -202
  11. package/components/im-group-rtc-join/im-group-rtc-join.vue +112 -112
  12. package/components/im-image-upload/im-image-upload.vue +94 -94
  13. package/components/im-loading/im-loading.vue +64 -64
  14. package/components/im-mention-picker/im-mention-picker.vue +191 -191
  15. package/components/im-message-item/im-message-item.vue +555 -555
  16. package/components/im-nav-bar/im-nav-bar.vue +98 -98
  17. package/components/im-read-receipt/im-read-receipt.vue +174 -174
  18. package/components/im-virtual-list/im-virtual-list.vue +51 -50
  19. package/components/im-voice-input/im-voice-input.vue +305 -305
  20. package/libs/index.ts +2 -3
  21. package/package.json +58 -58
  22. package/styles/button.scss +1 -1
  23. package/theme.scss +61 -62
  24. package/types/components.d.ts +0 -1
  25. package/types/index.d.ts +94 -94
  26. package/types/libs/index.d.ts +206 -204
  27. package/types/utils/datetime.d.ts +9 -9
  28. package/types/utils/dom.d.ts +11 -11
  29. package/types/utils/emoji.d.ts +8 -8
  30. package/types/utils/enums.d.ts +73 -73
  31. package/types/utils/messageType.d.ts +35 -35
  32. package/types/utils/recorderApp.d.ts +9 -9
  33. package/types/utils/recorderH5.d.ts +9 -9
  34. package/types/utils/requester.d.ts +15 -15
  35. package/types/utils/url.d.ts +5 -5
  36. package/types/utils/useDynamicRefs.d.ts +9 -9
  37. package/types/utils/websocket.d.ts +34 -34
  38. package/utils/enums.js +1 -1
  39. package/components/im-virtual-scroller/im-virtual-scroller.vue +0 -54
  40. package/types/components/virtual-scroller.d.ts +0 -20
@@ -1,9 +1,9 @@
1
- import type { UploadRecorderFileResult } from '../libs';
2
- declare class RecorderApp {
3
- constructor();
4
- checkIsEnable: () => boolean;
5
- start: () => Promise<void>;
6
- close: () => void;
7
- upload: () => Promise<UploadRecorderFileResult>;
8
- };
9
- export default RecorderApp;
1
+ import type { UploadRecorderFileResult } from '../libs';
2
+ declare class RecorderApp {
3
+ constructor();
4
+ checkIsEnable: () => boolean;
5
+ start: () => Promise<void>;
6
+ close: () => void;
7
+ upload: () => Promise<UploadRecorderFileResult>;
8
+ };
9
+ export default RecorderApp;
@@ -1,9 +1,9 @@
1
- import type { UploadRecorderFileResult } from '../libs';
2
- declare class RecorderH5 {
3
- constructor();
4
- checkIsEnable: () => boolean;
5
- start: () => Promise<void>;
6
- close: () => void;
7
- upload: () => Promise<UploadRecorderFileResult>;
8
- };
9
- export default RecorderH5;
1
+ import type { UploadRecorderFileResult } from '../libs';
2
+ declare class RecorderH5 {
3
+ constructor();
4
+ checkIsEnable: () => boolean;
5
+ start: () => Promise<void>;
6
+ close: () => void;
7
+ upload: () => Promise<UploadRecorderFileResult>;
8
+ };
9
+ export default RecorderH5;
@@ -1,16 +1,16 @@
1
- /// <reference types="@dcloudio/types" />
2
- import type { Response } from '../libs/index';
3
- declare class Requester {
4
- private baseURL;
5
- private options;
6
- private timeout;
7
- private header;
8
- constructor(baseURL: string, options?: Partial<UniApp.RequestOptions>);
9
- setToken(token: string): void;
10
- request<T = any>(options: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
11
- get<T = any>(url: string, data?: any, options?: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
12
- post<T = any>(url: string, data?: any, options?: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
13
- put<T = any>(url: string, data?: any, options?: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
14
- delete<T = any>(url: string, data?: any, options?: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
15
- }
1
+ /// <reference types="@dcloudio/types" />
2
+ import type { Response } from '../libs/index';
3
+ declare class Requester {
4
+ private baseURL;
5
+ private options;
6
+ private timeout;
7
+ private header;
8
+ constructor(baseURL: string, options?: Partial<UniApp.RequestOptions>);
9
+ setToken(token: string): void;
10
+ request<T = any>(options: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
11
+ get<T = any>(url: string, data?: any, options?: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
12
+ post<T = any>(url: string, data?: any, options?: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
13
+ put<T = any>(url: string, data?: any, options?: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
14
+ delete<T = any>(url: string, data?: any, options?: Partial<UniApp.RequestOptions>): Promise<Response<T>>;
15
+ }
16
16
  export default Requester;
@@ -1,5 +1,5 @@
1
- declare const _default: {
2
- containUrl: (content: string) => boolean;
3
- replaceURLWithHTMLLinks: (content: string, color?: string) => string;
4
- };
5
- export default _default;
1
+ declare const _default: {
2
+ containUrl: (content: string) => boolean;
3
+ replaceURLWithHTMLLinks: (content: string, color?: string) => string;
4
+ };
5
+ export default _default;
@@ -1,9 +1,9 @@
1
- /**
2
- * 使用动态Refs(组合式函数)
3
- */
4
- export declare function useDynamicRefs<T = any>(): {
5
- refs: import("vue").Ref<Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>, Map<string, T> | (Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>) >;
6
- setRef: (key: string) => (el: T) => void;
7
- getRef: (key: string) => T | undefined;
8
- getAllRefs: () => Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>;
9
- };
1
+ /**
2
+ * 使用动态Refs(组合式函数)
3
+ */
4
+ export declare function useDynamicRefs<T = any>(): {
5
+ refs: import("vue").Ref<Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>, Map<string, T> | (Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>) >;
6
+ setRef: (key: string) => (el: T) => void;
7
+ getRef: (key: string) => T | undefined;
8
+ getAllRefs: () => Map<string, import("@vue/reactivity").UnwrapRefSimple<T>> & Omit<Map<string, T>, keyof Map<any, any>>;
9
+ };
@@ -1,34 +1,34 @@
1
- type MessageCallback = (cmd: number, data: any) => void;
2
- type CloseCallback = (res: any) => void;
3
- type ConnectCallback = () => void;
4
- declare class WebSocket {
5
- private messageCallBack;
6
- private closeCallBack;
7
- private connectCallBack;
8
- private isConnect;
9
- private reconnectTimer;
10
- private lastConnectTime;
11
- private socketTask;
12
- private heartCheckTimeout;
13
- private heartCheckTimer;
14
- private startHeartCheck;
15
- private resetHeartCheck;
16
- private clearHeartCheck;
17
- private setupSocketEvents;
18
- private handleMessage;
19
- private handleClose;
20
- private scheduleReconnect;
21
- constructor();
22
- connect(wsurl: string, token: string): void;
23
- reconnect(wsurl: string, token: string): void;
24
- close(code?: number): void;
25
- sendMessage(message: string): void;
26
- onConnect(callback: ConnectCallback): void;
27
- onMessage(callback: MessageCallback): void;
28
- onClose(callback: CloseCallback): void;
29
- getIsConnect(): boolean;
30
- getLastConnectTime(): Date;
31
- setHeartCheckTimeout(timeout: number): void;
32
- destroy(): void;
33
- }
34
- export default WebSocket;
1
+ type MessageCallback = (cmd: number, data: any) => void;
2
+ type CloseCallback = (res: any) => void;
3
+ type ConnectCallback = () => void;
4
+ declare class WebSocket {
5
+ private messageCallBack;
6
+ private closeCallBack;
7
+ private connectCallBack;
8
+ private isConnect;
9
+ private reconnectTimer;
10
+ private lastConnectTime;
11
+ private socketTask;
12
+ private heartCheckTimeout;
13
+ private heartCheckTimer;
14
+ private startHeartCheck;
15
+ private resetHeartCheck;
16
+ private clearHeartCheck;
17
+ private setupSocketEvents;
18
+ private handleMessage;
19
+ private handleClose;
20
+ private scheduleReconnect;
21
+ constructor();
22
+ connect(wsurl: string, token: string): void;
23
+ reconnect(wsurl: string, token: string): void;
24
+ close(code?: number): void;
25
+ sendMessage(message: string): void;
26
+ onConnect(callback: ConnectCallback): void;
27
+ onMessage(callback: MessageCallback): void;
28
+ onClose(callback: CloseCallback): void;
29
+ getIsConnect(): boolean;
30
+ getLastConnectTime(): Date;
31
+ setHeartCheckTimeout(timeout: number): void;
32
+ destroy(): void;
33
+ }
34
+ export default WebSocket;
package/utils/enums.js CHANGED
@@ -73,4 +73,4 @@ export const MESSAGE_STATUS = {
73
73
  DELIVERED: 1, // 已送达(对方已收到,但是未读消息)
74
74
  RECALL: 2, // 已撤回
75
75
  READED: 3, // 消息已读
76
- };
76
+ };
@@ -1,54 +0,0 @@
1
- <template>
2
- <scroll-view scroll-y="true" :style="{ height: height }" upper-threshold="200" @scrolltolower="onScrollToBottom"
3
- scroll-with-animation="true">
4
- <view class="virtual-scroller" v-for="(item, idx) in showItems" :key="idx">
5
- <slot :item="item">
6
- </slot>
7
- </view>
8
- </scroll-view>
9
- </template>
10
-
11
- <script setup lang="ts">
12
- import { ref, computed } from 'vue'
13
-
14
- interface Props {
15
- height?: string;
16
- items?: any[];
17
- size?: number;
18
- }
19
-
20
- const props = withDefaults(defineProps<Props>(), {
21
- height: '60vh',
22
- items: () => [],
23
- size: 30
24
- });
25
-
26
- const page = ref(1);
27
- const isInitEvent = ref(false);
28
- const lockTip = ref(false);
29
-
30
- const onScrollToBottom = (e: any) => {
31
- if (showMaxIdx.value >= props.items.length) {
32
- showTip();
33
- } else {
34
- page.value++;
35
- }
36
- };
37
-
38
- const showTip = () => {
39
- uni.showToast({
40
- title: "已滚动至底部",
41
- icon: 'none'
42
- });
43
- };
44
-
45
- const showMaxIdx = computed(() => {
46
- return Math.min(page.value * props.size, props.items.length);
47
- });
48
-
49
- const showItems = computed(() => {
50
- return props.items.slice(0, showMaxIdx.value);
51
- });
52
- </script>
53
-
54
- <style scoped></style>
@@ -1,20 +0,0 @@
1
- import { AllowedComponentProps, VNodeProps } from '../common'
2
-
3
- declare interface VirtualScrollerProps {
4
- height?: string
5
- items?: any[]
6
- size?: number
7
- }
8
-
9
- declare interface VirtualScrollerSlots {
10
- default?: (params: { item: any }) => any
11
- }
12
-
13
- declare interface _VirtualScroller {
14
- new(): {
15
- $props: AllowedComponentProps & VNodeProps & VirtualScrollerProps
16
- $slots: VirtualScrollerSlots
17
- }
18
- }
19
-
20
- export declare const VirtualScroller: _VirtualScroller