@phonghq/go-chat 1.0.43 → 1.0.45

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 (106) hide show
  1. package/dist/assets/icons/IconPlan.vue.d.ts +13 -1
  2. package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +13 -1
  3. package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +13 -1
  4. package/dist/chat/App.vue.d.ts +13 -2
  5. package/dist/chat/page/home/ChatList.vue.d.ts +2 -0
  6. package/dist/chat/page/home/ChatMessageItem.vue.d.ts +1 -0
  7. package/dist/chat/page/home/ChatMessageItem2.vue.d.ts +19 -0
  8. package/dist/chat/page/home/Home.vue.d.ts +2 -0
  9. package/dist/chat/page/home/InputChat.vue.d.ts +2 -0
  10. package/dist/components/chat/call/Calling.vue.d.ts +4 -2
  11. package/dist/components/chat/common/tabs/TabBase.vue.d.ts +18 -0
  12. package/dist/components/common/drawer/DrawerBaseCustom.vue.d.ts +1 -1
  13. package/dist/components/ui/select/Select.vue.d.ts +20 -0
  14. package/dist/components/ui/select/SelectContent.vue.d.ts +24 -0
  15. package/dist/components/ui/select/SelectGroup.vue.d.ts +10 -0
  16. package/dist/components/ui/select/SelectItem.vue.d.ts +18 -0
  17. package/dist/components/ui/select/SelectItemText.vue.d.ts +10 -0
  18. package/dist/components/ui/select/SelectLabel.vue.d.ts +14 -0
  19. package/dist/components/ui/select/SelectScrollDownButton.vue.d.ts +14 -0
  20. package/dist/components/ui/select/SelectScrollUpButton.vue.d.ts +14 -0
  21. package/dist/components/ui/select/SelectSeparator.vue.d.ts +7 -0
  22. package/dist/components/ui/select/SelectTrigger.vue.d.ts +17 -0
  23. package/dist/components/ui/select/SelectValue.vue.d.ts +10 -0
  24. package/dist/components/ui/select/index.d.ts +11 -0
  25. package/dist/components/ui/tabs/Tabs.vue.d.ts +20 -0
  26. package/dist/components/ui/tabs/TabsContent.vue.d.ts +14 -0
  27. package/dist/components/ui/tabs/TabsList.vue.d.ts +14 -0
  28. package/dist/components/ui/tabs/TabsTrigger.vue.d.ts +14 -0
  29. package/dist/components/ui/tabs/index.d.ts +4 -0
  30. package/dist/composable/useInitData.d.ts +1 -1
  31. package/dist/composable/useListConversations.d.ts +1 -1
  32. package/dist/composable/useListentEvent.d.ts +5 -0
  33. package/dist/composable/usePlivo.d.ts +1 -0
  34. package/dist/constant/color.d.ts +2 -2
  35. package/dist/go-chat.es.js +14753 -14211
  36. package/dist/go-chat.umd.js +15 -15
  37. package/dist/style.css +1 -1
  38. package/dist/test/assets/icons/IconPlan.vue.js +23 -3
  39. package/dist/test/assets/icons/call/IconPhone.vue.js +6 -19
  40. package/dist/test/assets/icons/call/IconPhoneCancel.vue.js +32 -21
  41. package/dist/test/assets/icons/customer-detail/IconPhone.vue.js +23 -3
  42. package/dist/test/chat/App.vue.js +218 -301
  43. package/dist/test/chat/page/customer-check-in/CustomerCheckIn.vue.js +3 -1
  44. package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +2 -2
  45. package/dist/test/chat/page/home/ChatList.vue.js +64 -34
  46. package/dist/test/chat/page/home/ChatMessage.vue.js +10 -1
  47. package/dist/test/chat/page/home/ChatMessageItem.vue.js +63 -80
  48. package/dist/test/chat/page/home/ChatMessageItem2.vue.js +351 -0
  49. package/dist/test/chat/page/home/Home.vue.js +15 -7
  50. package/dist/test/chat/page/home/HomeHeader.vue.js +8 -4
  51. package/dist/test/chat/page/home/InputChat.vue.js +58 -37
  52. package/dist/test/components/chat/call/Calling.vue.js +111 -67
  53. package/dist/test/components/chat/common/tab/TabBase.vue.js +1 -0
  54. package/dist/test/components/chat/common/tabs/TabBase.vue.js +92 -0
  55. package/dist/test/components/chat/layout/mobile/Footer.vue.js +6 -1
  56. package/dist/test/components/common/drawer/DrawerBaseCustom.vue.js +1 -0
  57. package/dist/test/components/common/select/SelectBase.vue.js +139 -0
  58. package/dist/test/components/ui/select/Select.vue.js +49 -0
  59. package/dist/test/components/ui/select/SelectContent.vue.js +98 -0
  60. package/dist/test/components/ui/select/SelectGroup.vue.js +37 -0
  61. package/dist/test/components/ui/select/SelectItem.vue.js +86 -0
  62. package/dist/test/components/ui/select/SelectItemText.vue.js +37 -0
  63. package/dist/test/components/ui/select/SelectLabel.vue.js +40 -0
  64. package/dist/test/components/ui/select/SelectScrollDownButton.vue.js +58 -0
  65. package/dist/test/components/ui/select/SelectScrollUpButton.vue.js +58 -0
  66. package/dist/test/components/ui/select/SelectSeparator.vue.js +39 -0
  67. package/dist/test/components/ui/select/SelectTrigger.vue.js +76 -0
  68. package/dist/test/components/ui/select/SelectValue.vue.js +37 -0
  69. package/dist/test/components/ui/select/index.js +11 -0
  70. package/dist/test/components/ui/tabs/Tabs.vue.js +54 -0
  71. package/dist/test/components/ui/tabs/TabsContent.vue.js +44 -0
  72. package/dist/test/components/ui/tabs/TabsList.vue.js +44 -0
  73. package/dist/test/components/ui/tabs/TabsTrigger.vue.js +45 -0
  74. package/dist/test/components/ui/tabs/index.js +4 -0
  75. package/dist/test/composable/useInitData.js +5 -5
  76. package/dist/test/composable/useListConversations.js +32 -29
  77. package/dist/test/composable/useListentEvent.js +48 -0
  78. package/dist/test/composable/usePlivo.js +6 -1
  79. package/dist/test/constant/color.js +4 -2
  80. package/dist/test/plugins/axios-gci.js +1 -1
  81. package/dist/test/utils/chat/auth.js +1 -1
  82. package/dist/test/utils/chat/call.js +2 -3
  83. package/dist/test/utils/chat/conversation.js +2 -2
  84. package/dist/test/utils/chat/page-error.js +25 -0
  85. package/dist/test/utils/chat/user.js +7 -2
  86. package/dist/test/utils/string-helper.js +13 -0
  87. package/dist/types/chat/global.d.ts +6 -5
  88. package/dist/types/conversation.d.ts +1 -0
  89. package/dist/utils/chat/auth.d.ts +1 -1
  90. package/dist/utils/chat/conversation.d.ts +1 -0
  91. package/dist/utils/chat/page-error.d.ts +4 -0
  92. package/dist/utils/chat/user.d.ts +3 -0
  93. package/dist/utils/string-helper.d.ts +1 -0
  94. package/package.json +3 -2
  95. package/dist/components/layout/Blank.vue.d.ts +0 -9
  96. package/dist/components/layout/Default.vue.d.ts +0 -9
  97. package/dist/components/modal/Confirm.vue.d.ts +0 -2
  98. package/dist/composable/useError.d.ts +0 -4
  99. package/dist/composable/useModalConfirm.d.ts +0 -5
  100. package/dist/test/components/ListenEvent.vue.js +0 -45
  101. package/dist/test/components/layout/Blank.vue.js +0 -19
  102. package/dist/test/components/layout/Default.vue.js +0 -21
  103. package/dist/test/components/modal/Confirm.vue.js +0 -164
  104. package/dist/test/composable/useError.js +0 -10
  105. package/dist/test/composable/useModalConfirm.js +0 -39
  106. /package/dist/components/{ListenEvent.vue.d.ts → common/select/SelectBase.vue.d.ts} +0 -0
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;
@@ -1,4 +0,0 @@
1
- export declare const goChatError: import("vue").Ref<string, string>;
2
- export declare function useError(): {
3
- showError: (error: string) => void;
4
- };
@@ -1,5 +0,0 @@
1
- import type { ConfirmPayloadPromise, ConfirmPayload } from '../types/chat/promise';
2
- export declare function useModalConfirm(): {
3
- setHandleConfirm: (callback: (data: ConfirmPayloadPromise) => void) => void;
4
- modalConfirm: (data: ConfirmPayload) => Promise<any>;
5
- };
@@ -1,45 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import { onMounted, onBeforeUnmount } from 'vue';
3
- import { useDebounce } from '../utils/debounce';
4
- // import { useGeneralStore } from '@/stores/general'
5
- // const deviceType = computed({
6
- // set(value: any) {
7
- // return useGeneralStore().deviceResponsive = value
8
- // },
9
- // get() {
10
- // return useGeneralStore().deviceResponsive
11
- // }
12
- // })
13
- // const getDeviceType = () => {
14
- // const width = window.innerWidth
15
- // if (width < 767) {
16
- // return 'mobile'
17
- // } else if (width < 1023) {
18
- // return 'tablet'
19
- // } else {
20
- // return 'window'
21
- // }
22
- // }
23
- const updateDeviceType = useDebounce(() => {
24
- // const newType = getDeviceType()
25
- // if (deviceType.value !== newType) {
26
- // deviceType.value = newType
27
- // }
28
- }, 500);
29
- onMounted(() => {
30
- updateDeviceType();
31
- window.addEventListener('resize', updateDeviceType);
32
- });
33
- onBeforeUnmount(() => {
34
- window.removeEventListener('resize', updateDeviceType);
35
- });
36
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
37
- const __VLS_ctx = {
38
- ...{},
39
- ...{},
40
- };
41
- let __VLS_elements;
42
- let __VLS_components;
43
- let __VLS_directives;
44
- const __VLS_export = (await import('vue')).defineComponent({});
45
- export default {};
@@ -1,19 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
3
- const __VLS_ctx = {
4
- ...{},
5
- ...{},
6
- };
7
- let __VLS_elements;
8
- let __VLS_components;
9
- let __VLS_directives;
10
- __VLS_asFunctionalElement(__VLS_elements.main, __VLS_elements.main)({
11
- ...{ class: "main" },
12
- });
13
- var __VLS_0 = {};
14
- /** @type {__VLS_StyleScopedClasses['main']} */ ;
15
- // @ts-ignore
16
- var __VLS_1 = __VLS_0;
17
- const __VLS_base = (await import('vue')).defineComponent({});
18
- const __VLS_export = {};
19
- export default {};
@@ -1,21 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- // COMPONENT
3
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
4
- const __VLS_ctx = {};
5
- let __VLS_elements;
6
- let __VLS_components;
7
- let __VLS_directives;
8
- __VLS_asFunctionalElement(__VLS_elements.main, __VLS_elements.main)({
9
- ...{ class: "main" },
10
- });
11
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
12
- ...{ class: "container" },
13
- });
14
- var __VLS_0 = {};
15
- /** @type {__VLS_StyleScopedClasses['main']} */ ;
16
- /** @type {__VLS_StyleScopedClasses['container']} */ ;
17
- // @ts-ignore
18
- var __VLS_1 = __VLS_0;
19
- const __VLS_base = (await import('vue')).defineComponent({});
20
- const __VLS_export = {};
21
- export default {};
@@ -1,164 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import { ref, onBeforeUnmount, onMounted } from 'vue';
3
- import ModalBase from '../../components/common/modal/ModalBase.vue';
4
- import ButtonBase from '../../components/common/button/ButtonBase.vue';
5
- import { useModalConfirm } from '../../composable/useModalConfirm';
6
- const { setHandleConfirm } = useModalConfirm();
7
- const confirmPayload = ref(null);
8
- const isVisible = ref(false);
9
- const isResolved = ref(false);
10
- const isOpeningModal = ref(false);
11
- onMounted(() => {
12
- setHandleConfirm(open);
13
- });
14
- onBeforeUnmount(() => { });
15
- const open = (data) => {
16
- if (isOpeningModal.value)
17
- return;
18
- if (!data?.type) {
19
- data.type = 'confirm';
20
- }
21
- confirmPayload.value = data;
22
- isVisible.value = true;
23
- isOpeningModal.value = true;
24
- };
25
- const handleOk = () => {
26
- confirmPayload.value?.resolve('ok');
27
- isResolved.value = true;
28
- isVisible.value = false;
29
- };
30
- const handleCancel = () => {
31
- isVisible.value = false;
32
- };
33
- const handleAfterClose = () => {
34
- if (!isResolved.value)
35
- confirmPayload.value?.reject();
36
- isResolved.value = false;
37
- confirmPayload.value = null;
38
- isOpeningModal.value = false;
39
- };
40
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
41
- const __VLS_ctx = {
42
- ...{},
43
- ...{},
44
- };
45
- let __VLS_elements;
46
- let __VLS_components;
47
- let __VLS_directives;
48
- /** @type {[typeof ModalBase, typeof ModalBase, ]} */ ;
49
- // @ts-ignore
50
- const __VLS_0 = __VLS_asFunctionalComponent(ModalBase, new ModalBase({
51
- wrapClassName: "confirm-modal",
52
- open: (__VLS_ctx.isVisible),
53
- width: (652),
54
- title: (__VLS_ctx.confirmPayload?.headerTitle),
55
- showButtonClose: (false),
56
- maskClosable: (false),
57
- footer: (null),
58
- centered: true,
59
- afterClose: (__VLS_ctx.handleAfterClose),
60
- zIndex: (9000),
61
- }));
62
- const __VLS_1 = __VLS_0({
63
- wrapClassName: "confirm-modal",
64
- open: (__VLS_ctx.isVisible),
65
- width: (652),
66
- title: (__VLS_ctx.confirmPayload?.headerTitle),
67
- showButtonClose: (false),
68
- maskClosable: (false),
69
- footer: (null),
70
- centered: true,
71
- afterClose: (__VLS_ctx.handleAfterClose),
72
- zIndex: (9000),
73
- }, ...__VLS_functionalComponentArgsRest(__VLS_0));
74
- var __VLS_3 = {};
75
- const { default: __VLS_4 } = __VLS_2.slots;
76
- // @ts-ignore
77
- [isVisible, confirmPayload, handleAfterClose,];
78
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
79
- ...{ class: "text-center p-8" },
80
- });
81
- __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
82
- ...{ class: "text-lg font-semibold mb-1" },
83
- });
84
- (__VLS_ctx.confirmPayload?.bodyTitle || '');
85
- // @ts-ignore
86
- [confirmPayload,];
87
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
88
- ...{ class: "mb-0" },
89
- });
90
- __VLS_asFunctionalDirective(__VLS_directives.vHtml)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.confirmPayload?.bodyMessage) }, null, null);
91
- // @ts-ignore
92
- [confirmPayload,];
93
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
94
- ...{ class: "flex-center gap-4 pb-7 pt-4" },
95
- });
96
- if (__VLS_ctx.confirmPayload?.type === 'confirm') {
97
- // @ts-ignore
98
- [confirmPayload,];
99
- /** @type {[typeof ButtonBase, typeof ButtonBase, ]} */ ;
100
- // @ts-ignore
101
- const __VLS_5 = __VLS_asFunctionalComponent(ButtonBase, new ButtonBase({
102
- ...{ 'onClick': {} },
103
- ...{ class: "min-w-[100px]" },
104
- danger: true,
105
- ghost: true,
106
- type: "danger-outline",
107
- }));
108
- const __VLS_6 = __VLS_5({
109
- ...{ 'onClick': {} },
110
- ...{ class: "min-w-[100px]" },
111
- danger: true,
112
- ghost: true,
113
- type: "danger-outline",
114
- }, ...__VLS_functionalComponentArgsRest(__VLS_5));
115
- let __VLS_8;
116
- let __VLS_9;
117
- const __VLS_10 = ({ click: {} },
118
- { onClick: (__VLS_ctx.handleCancel) });
119
- const { default: __VLS_11 } = __VLS_7.slots;
120
- // @ts-ignore
121
- [handleCancel,];
122
- (__VLS_ctx.confirmPayload?.cancelButtonText || 'No');
123
- // @ts-ignore
124
- [confirmPayload,];
125
- var __VLS_7;
126
- }
127
- /** @type {[typeof ButtonBase, typeof ButtonBase, ]} */ ;
128
- // @ts-ignore
129
- const __VLS_12 = __VLS_asFunctionalComponent(ButtonBase, new ButtonBase({
130
- ...{ 'onClick': {} },
131
- ...{ class: "min-w-[100px]" },
132
- type: ('primary'),
133
- }));
134
- const __VLS_13 = __VLS_12({
135
- ...{ 'onClick': {} },
136
- ...{ class: "min-w-[100px]" },
137
- type: ('primary'),
138
- }, ...__VLS_functionalComponentArgsRest(__VLS_12));
139
- let __VLS_15;
140
- let __VLS_16;
141
- const __VLS_17 = ({ click: {} },
142
- { onClick: (__VLS_ctx.handleOk) });
143
- const { default: __VLS_18 } = __VLS_14.slots;
144
- // @ts-ignore
145
- [handleOk,];
146
- (__VLS_ctx.confirmPayload?.confirmButtonText || 'Yes');
147
- // @ts-ignore
148
- [confirmPayload,];
149
- var __VLS_14;
150
- var __VLS_2;
151
- /** @type {__VLS_StyleScopedClasses['text-center']} */ ;
152
- /** @type {__VLS_StyleScopedClasses['p-8']} */ ;
153
- /** @type {__VLS_StyleScopedClasses['text-lg']} */ ;
154
- /** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
155
- /** @type {__VLS_StyleScopedClasses['mb-1']} */ ;
156
- /** @type {__VLS_StyleScopedClasses['mb-0']} */ ;
157
- /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
158
- /** @type {__VLS_StyleScopedClasses['gap-4']} */ ;
159
- /** @type {__VLS_StyleScopedClasses['pb-7']} */ ;
160
- /** @type {__VLS_StyleScopedClasses['pt-4']} */ ;
161
- /** @type {__VLS_StyleScopedClasses['min-w-[100px]']} */ ;
162
- /** @type {__VLS_StyleScopedClasses['min-w-[100px]']} */ ;
163
- const __VLS_export = (await import('vue')).defineComponent({});
164
- export default {};
@@ -1,10 +0,0 @@
1
- import { ref } from 'vue';
2
- export const goChatError = ref('');
3
- export function useError() {
4
- const showError = (error) => {
5
- goChatError.value = error;
6
- };
7
- return {
8
- showError
9
- };
10
- }
@@ -1,39 +0,0 @@
1
- import { ref } from 'vue';
2
- // export type ConfirmPayload = {
3
- // headerTitle?: string
4
- // bodyTitle?: string
5
- // bodyImage?: string
6
- // bodyMessage?: string
7
- // confirmButtonText?: string
8
- // cancelButtonText?: string
9
- // timeOut?: number //seconds
10
- // type?: 'confirm' | 'information'
11
- // }
12
- //
13
- // export type ConfirmPayloadPromise = AddPromise<ConfirmPayload>
14
- const handleConfirm = ref(null);
15
- function setHandleConfirm(callback) {
16
- handleConfirm.value = callback;
17
- }
18
- export function useModalConfirm() {
19
- function setHandleConfirm(callback) {
20
- handleConfirm.value = callback;
21
- }
22
- function modalConfirm(data) {
23
- return new Promise((resolve, reject) => {
24
- if (handleConfirm.value == null) {
25
- reject('Modal is not already active');
26
- return;
27
- }
28
- handleConfirm.value({
29
- ...data,
30
- resolve,
31
- reject
32
- });
33
- });
34
- }
35
- return {
36
- setHandleConfirm,
37
- modalConfirm
38
- };
39
- }