@phonghq/go-chat 1.0.42 → 1.0.44
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/dist/assets/icons/IconPlan.vue.d.ts +13 -1
- package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +13 -1
- package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +13 -1
- package/dist/chat/App.vue.d.ts +13 -2
- package/dist/chat/page/home/ChatList.vue.d.ts +10 -0
- package/dist/chat/page/home/ChatMessageItem.vue.d.ts +1 -0
- package/dist/chat/page/home/ChatMessageItem2.vue.d.ts +19 -0
- package/dist/chat/page/home/Home.vue.d.ts +2 -0
- package/dist/chat/page/home/InputChat.vue.d.ts +2 -0
- package/dist/components/chat/call/Calling.vue.d.ts +4 -2
- package/dist/components/chat/common/tabs/TabBase.vue.d.ts +18 -0
- package/dist/components/common/drawer/DrawerBaseCustom.vue.d.ts +1 -1
- package/dist/components/ui/select/Select.vue.d.ts +20 -0
- package/dist/components/ui/select/SelectContent.vue.d.ts +24 -0
- package/dist/components/ui/select/SelectGroup.vue.d.ts +10 -0
- package/dist/components/ui/select/SelectItem.vue.d.ts +18 -0
- package/dist/components/ui/select/SelectItemText.vue.d.ts +10 -0
- package/dist/components/ui/select/SelectLabel.vue.d.ts +14 -0
- package/dist/components/ui/select/SelectScrollDownButton.vue.d.ts +14 -0
- package/dist/components/ui/select/SelectScrollUpButton.vue.d.ts +14 -0
- package/dist/components/ui/select/SelectSeparator.vue.d.ts +7 -0
- package/dist/components/ui/select/SelectTrigger.vue.d.ts +17 -0
- package/dist/components/ui/select/SelectValue.vue.d.ts +10 -0
- package/dist/components/ui/select/index.d.ts +11 -0
- package/dist/components/ui/tabs/Tabs.vue.d.ts +20 -0
- package/dist/components/ui/tabs/TabsContent.vue.d.ts +14 -0
- package/dist/components/ui/tabs/TabsList.vue.d.ts +14 -0
- package/dist/components/ui/tabs/TabsTrigger.vue.d.ts +14 -0
- package/dist/components/ui/tabs/index.d.ts +4 -0
- package/dist/composable/useDigibot.d.ts +1 -1
- package/dist/composable/useInitData.d.ts +5 -2
- package/dist/composable/useListConversations.d.ts +4 -1
- package/dist/composable/useListentEvent.d.ts +5 -0
- package/dist/composable/usePlivo.d.ts +1 -0
- package/dist/constant/color.d.ts +2 -2
- package/dist/go-chat.es.js +14663 -14004
- package/dist/go-chat.umd.js +15 -15
- package/dist/style.css +1 -1
- package/dist/test/assets/icons/IconPlan.vue.js +23 -3
- package/dist/test/assets/icons/IconUser.vue.js +25 -0
- package/dist/test/assets/icons/call/IconPhone.vue.js +6 -19
- package/dist/test/assets/icons/call/IconPhoneCancel.vue.js +32 -21
- package/dist/test/assets/icons/customer-detail/IconPhone.vue.js +23 -3
- package/dist/test/chat/App.vue.js +303 -282
- package/dist/test/chat/page/customer-check-in/CustomerCheckIn.vue.js +3 -1
- package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +4 -4
- package/dist/test/chat/page/home/ChatList.vue.js +113 -43
- package/dist/test/chat/page/home/ChatMessage.vue.js +10 -1
- package/dist/test/chat/page/home/ChatMessageItem.vue.js +75 -83
- package/dist/test/chat/page/home/ChatMessageItem2.vue.js +351 -0
- package/dist/test/chat/page/home/Home.vue.js +29 -9
- package/dist/test/chat/page/home/HomeHeader.vue.js +8 -4
- package/dist/test/chat/page/home/InputChat.vue.js +58 -37
- package/dist/test/components/chat/call/Calling.vue.js +117 -71
- package/dist/test/components/chat/common/tab/TabBase.vue.js +1 -0
- package/dist/test/components/chat/common/tabs/TabBase.vue.js +92 -0
- package/dist/test/components/chat/customer/Avatar.vue.js +23 -4
- package/dist/test/components/chat/layout/mobile/Footer.vue.js +6 -1
- package/dist/test/components/common/drawer/DrawerBaseCustom.vue.js +1 -0
- package/dist/test/components/common/select/SelectBase.vue.js +139 -0
- package/dist/test/components/ui/select/Select.vue.js +49 -0
- package/dist/test/components/ui/select/SelectContent.vue.js +98 -0
- package/dist/test/components/ui/select/SelectGroup.vue.js +37 -0
- package/dist/test/components/ui/select/SelectItem.vue.js +86 -0
- package/dist/test/components/ui/select/SelectItemText.vue.js +37 -0
- package/dist/test/components/ui/select/SelectLabel.vue.js +40 -0
- package/dist/test/components/ui/select/SelectScrollDownButton.vue.js +58 -0
- package/dist/test/components/ui/select/SelectScrollUpButton.vue.js +58 -0
- package/dist/test/components/ui/select/SelectSeparator.vue.js +39 -0
- package/dist/test/components/ui/select/SelectTrigger.vue.js +76 -0
- package/dist/test/components/ui/select/SelectValue.vue.js +37 -0
- package/dist/test/components/ui/select/index.js +11 -0
- package/dist/test/components/ui/tabs/Tabs.vue.js +54 -0
- package/dist/test/components/ui/tabs/TabsContent.vue.js +44 -0
- package/dist/test/components/ui/tabs/TabsList.vue.js +44 -0
- package/dist/test/components/ui/tabs/TabsTrigger.vue.js +45 -0
- package/dist/test/components/ui/tabs/index.js +4 -0
- package/dist/test/composable/useDigibot.js +3 -3
- package/dist/test/composable/useInitData.js +23 -14
- package/dist/test/composable/useListConversations.js +51 -33
- package/dist/test/composable/useListentEvent.js +45 -0
- package/dist/test/composable/usePlivo.js +6 -1
- package/dist/test/constant/color.js +4 -2
- package/dist/test/plugins/axios-gci.js +1 -1
- package/dist/test/utils/chat/auth.js +1 -1
- package/dist/test/utils/chat/cache.js +63 -0
- package/dist/test/utils/chat/call.js +2 -3
- package/dist/test/utils/chat/conversation.js +9 -2
- package/dist/test/utils/chat/page-error.js +25 -0
- package/dist/test/utils/chat/user.js +7 -2
- package/dist/test/utils/string-helper.js +13 -0
- package/dist/test/views/NotTenantPhone.vue.js +99 -0
- package/dist/types/chat/global.d.ts +6 -5
- package/dist/types/conversation.d.ts +2 -0
- package/dist/utils/chat/auth.d.ts +1 -1
- package/dist/utils/chat/cache.d.ts +7 -0
- package/dist/utils/chat/conversation.d.ts +2 -0
- package/dist/utils/chat/page-error.d.ts +4 -0
- package/dist/utils/chat/user.d.ts +3 -0
- package/dist/utils/string-helper.d.ts +1 -0
- package/dist/views/NotTenantPhone.vue.d.ts +9 -0
- package/package.json +3 -2
- package/dist/components/layout/Blank.vue.d.ts +0 -9
- package/dist/components/layout/Default.vue.d.ts +0 -9
- package/dist/composable/useError.d.ts +0 -4
- package/dist/composable/useModalConfirm.d.ts +0 -5
- package/dist/test/components/ListenEvent.vue.js +0 -45
- package/dist/test/components/layout/Blank.vue.js +0 -19
- package/dist/test/components/layout/Default.vue.js +0 -21
- package/dist/test/components/modal/Confirm.vue.js +0 -164
- package/dist/test/composable/useError.js +0 -10
- package/dist/test/composable/useModalConfirm.js +0 -39
- /package/dist/{components/ListenEvent.vue.d.ts → assets/icons/IconUser.vue.d.ts} +0 -0
- /package/dist/components/{modal/Confirm.vue.d.ts → common/select/SelectBase.vue.d.ts} +0 -0
|
@@ -47,9 +47,11 @@ for (const [year, i] of __VLS_getVForSourceType((__VLS_ctx.checkin))) {
|
|
|
47
47
|
key: (i),
|
|
48
48
|
}, ...__VLS_functionalComponentArgsRest(__VLS_0));
|
|
49
49
|
const { default: __VLS_3 } = __VLS_2.slots;
|
|
50
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
51
|
+
...{ class: "flex flex-col gap-y-3" },
|
|
52
|
+
});
|
|
50
53
|
for (const [item] of __VLS_getVForSourceType((year.items))) {
|
|
51
54
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
52
|
-
...{ class: "flex flex-col gap-y-3" },
|
|
53
55
|
key: (item.id),
|
|
54
56
|
});
|
|
55
57
|
/** @type {[typeof CardCustomerDetail, typeof CardCustomerDetail, ]} */ ;
|
|
@@ -104,12 +104,12 @@ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
|
104
104
|
__VLS_asFunctionalElement(__VLS_elements.h2, __VLS_elements.h2)({
|
|
105
105
|
...{ class: "text-lg font-semibold text-gray-800" },
|
|
106
106
|
});
|
|
107
|
-
(__VLS_ctx.user?.username ?? '
|
|
107
|
+
(__VLS_ctx.user?.username ?? __VLS_ctx.phoneNumberFormat(__VLS_ctx.user?.phone ?? ''));
|
|
108
108
|
// @ts-ignore
|
|
109
|
-
[user,];
|
|
109
|
+
[user, user, phoneNumberFormat,];
|
|
110
110
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
111
111
|
...{ class: " mt-5 text-center mx-auto" },
|
|
112
|
-
...{ class: ({ 'flex justify-between w-max': __VLS_ctx.responsive
|
|
112
|
+
...{ class: ({ 'flex justify-between w-max': __VLS_ctx.responsive != 'mobile', 'grid grid-cols-3 w-full': __VLS_ctx.responsive == 'mobile' }) },
|
|
113
113
|
});
|
|
114
114
|
// @ts-ignore
|
|
115
115
|
[responsive, responsive,];
|
|
@@ -118,7 +118,7 @@ for (const [item, i] of __VLS_getVForSourceType((__VLS_ctx.customerTotalDetail))
|
|
|
118
118
|
[customerTotalDetail,];
|
|
119
119
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
120
120
|
...{ class: "border-l border-chat-haze-100 first:border-none" },
|
|
121
|
-
...{ class: ({ 'w-full': __VLS_ctx.responsive == 'mobile', 'w-[130px]': __VLS_ctx.responsive
|
|
121
|
+
...{ class: ({ 'w-full': __VLS_ctx.responsive == 'mobile', 'w-[130px]': __VLS_ctx.responsive != 'mobile' }) },
|
|
122
122
|
key: (i),
|
|
123
123
|
});
|
|
124
124
|
// @ts-ignore
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import InputSearch from '../../../components/chat/common/input/InputSearch.vue';
|
|
2
|
+
import IconPlus from '../../../assets/icons/IconPlus.vue';
|
|
2
3
|
import { computed, ref } from 'vue';
|
|
3
4
|
import Avatar from '../../../components/chat/customer/Avatar.vue';
|
|
5
|
+
import { getConversationView } from '../../../utils/chat/conversation';
|
|
4
6
|
import ScrollEvent from '../../../components/chat/ScrollEvent/ScrollEvent.vue';
|
|
5
7
|
import { useDebounce } from '../../../utils/debounce';
|
|
6
8
|
import { dataProfile } from '../../../utils/chat/auth';
|
|
@@ -12,7 +14,7 @@ import timezone from 'dayjs/plugin/timezone';
|
|
|
12
14
|
import { useDigibot } from '../../../composable/useDigibot';
|
|
13
15
|
import { TIME_ZONE_UTC } from '../../../constant/datetime';
|
|
14
16
|
import IconAiCheck from '../../../assets/icons/IconAiCheck.vue';
|
|
15
|
-
import
|
|
17
|
+
import TabBase2 from '../../../components/chat/common/tabs/TabBase.vue';
|
|
16
18
|
import { useListConversations } from '../../../composable/useListConversations';
|
|
17
19
|
import { phoneNumberFormat } from '../../../utils/string-helper';
|
|
18
20
|
dayjs.extend(updateLocale);
|
|
@@ -44,17 +46,24 @@ const TAB_VALUE = {
|
|
|
44
46
|
};
|
|
45
47
|
const tabs = computed(() => [
|
|
46
48
|
{ label: 'All', value: TAB_VALUE.ALL },
|
|
47
|
-
{
|
|
49
|
+
{
|
|
50
|
+
label: 'Message Requests',
|
|
51
|
+
value: TAB_VALUE.UNKNOWN,
|
|
52
|
+
badge: (listConversationsUnknownUnread.value || '').toString()
|
|
53
|
+
}
|
|
48
54
|
]);
|
|
49
55
|
const { digibotData, digibotId } = useDigibot();
|
|
50
|
-
const { listConversations: listConversationsAll, getData: getDataAll, params: paramsAll, pageCount: pageCountAll, handleReadMessage: handleReadMessageAll } = useListConversations(TAB_VALUE.ALL);
|
|
51
|
-
const { listConversations: listConversationsUnknown, getData: getDataUnknown, params: paramsUnknown, pageCount: pageCountUnknown, handleReadMessage: handleReadMessageUnknown } = useListConversations(TAB_VALUE.UNKNOWN);
|
|
56
|
+
const { listConversations: listConversationsAll, getData: getDataAll, params: paramsAll, pageCount: pageCountAll, handleReadMessage: handleReadMessageAll, getDataCache: getDataCacheAll } = useListConversations(TAB_VALUE.ALL, dataProfile.value?.user_type === 'tenant');
|
|
57
|
+
const { listConversations: listConversationsUnknown, getData: getDataUnknown, params: paramsUnknown, pageCount: pageCountUnknown, handleReadMessage: handleReadMessageUnknown, getDataCache: getDataCacheUnknown } = useListConversations(TAB_VALUE.UNKNOWN, dataProfile.value?.user_type === 'tenant');
|
|
52
58
|
const receiver_id = defineModel('receiverId');
|
|
53
59
|
const listConversations = computed(() => {
|
|
54
60
|
if (activeTabs.value == TAB_VALUE.ALL)
|
|
55
61
|
return listConversationsAll.value;
|
|
56
62
|
return listConversationsUnknown.value;
|
|
57
63
|
});
|
|
64
|
+
const listConversationsUnknownUnread = computed(() => {
|
|
65
|
+
return (listConversationsUnknown.value.reduce((total, cur) => total + (cur?.unread_count ?? 0), 0) ?? 0);
|
|
66
|
+
});
|
|
58
67
|
const keyword = ref('');
|
|
59
68
|
const activeTabs = ref(TAB_VALUE.ALL);
|
|
60
69
|
const scrollEventRef = ref(null);
|
|
@@ -64,13 +73,26 @@ const getData = async (data, option) => {
|
|
|
64
73
|
const tab_value = option?.tab ?? activeTabs.value;
|
|
65
74
|
if (!option?.hideLoading)
|
|
66
75
|
isLoadingSearch.value = true;
|
|
76
|
+
if (option?.reset) {
|
|
77
|
+
let cache = false;
|
|
78
|
+
if (tab_value == TAB_VALUE.ALL) {
|
|
79
|
+
cache = getDataCacheAll();
|
|
80
|
+
}
|
|
81
|
+
else if (tab_value == TAB_VALUE.UNKNOWN) {
|
|
82
|
+
cache = getDataCacheUnknown();
|
|
83
|
+
}
|
|
84
|
+
if (cache)
|
|
85
|
+
isLoadingSearch.value = false;
|
|
86
|
+
}
|
|
67
87
|
if (tab_value == TAB_VALUE.ALL) {
|
|
68
88
|
await getDataAll(data, option);
|
|
69
89
|
}
|
|
70
90
|
else if (tab_value == TAB_VALUE.UNKNOWN) {
|
|
71
91
|
await getDataUnknown(data, option);
|
|
72
92
|
}
|
|
73
|
-
|
|
93
|
+
if (!option?.hideCheckHasReceiveId) {
|
|
94
|
+
checkHasReceiveId();
|
|
95
|
+
}
|
|
74
96
|
if (option?.reset) {
|
|
75
97
|
getAllList();
|
|
76
98
|
}
|
|
@@ -98,7 +120,7 @@ const getAllList = async () => {
|
|
|
98
120
|
};
|
|
99
121
|
const checkHasReceiveId = () => {
|
|
100
122
|
const hasReceiveId = listConversations.value?.some((e) => e.receiver_id === receiver_id.value && receiver_id.value);
|
|
101
|
-
if (props.responsive
|
|
123
|
+
if (props.responsive != 'mobile') {
|
|
102
124
|
if (!hasReceiveId) {
|
|
103
125
|
if (listConversations.value?.length) {
|
|
104
126
|
emit('selectReceiver', listConversations.value[0]);
|
|
@@ -147,21 +169,43 @@ const getTimeFromNow = (data) => {
|
|
|
147
169
|
}
|
|
148
170
|
return data ?? '';
|
|
149
171
|
};
|
|
150
|
-
const handleTabChange = async (tab) => {
|
|
172
|
+
const handleTabChange = async (tab, option) => {
|
|
151
173
|
if (tab == TAB_VALUE.ALL && !listConversationsAll.value?.length) {
|
|
152
|
-
await getData({}, { reset: true, tab });
|
|
174
|
+
await getData({}, { reset: true, tab, ...(option ?? {}) });
|
|
153
175
|
}
|
|
154
176
|
else if (tab == TAB_VALUE.UNKNOWN && !listConversationsUnknown.value?.length) {
|
|
155
|
-
await getData({}, { reset: true, tab });
|
|
177
|
+
await getData({}, { reset: true, tab, ...(option ?? {}) });
|
|
156
178
|
}
|
|
157
|
-
checkHasReceiveId()
|
|
179
|
+
// checkHasReceiveId()
|
|
158
180
|
};
|
|
159
181
|
const getCurrentConversation = () => {
|
|
160
|
-
return listConversations.value?.find(user => user.receiver_id == receiver_id.value);
|
|
182
|
+
return listConversations.value?.find((user) => user.receiver_id == receiver_id.value);
|
|
183
|
+
};
|
|
184
|
+
const initData = async (option) => {
|
|
185
|
+
if (option?.is_unknown || option?.is_unknown == '0') {
|
|
186
|
+
activeTabs.value = Number(option?.is_unknown);
|
|
187
|
+
}
|
|
188
|
+
let hideCheckHasReceiveId = false;
|
|
189
|
+
if (option?.conversation_id) {
|
|
190
|
+
const conversation = await getConversationView(option?.conversation_id);
|
|
191
|
+
if (conversation.receiver_id) {
|
|
192
|
+
hideCheckHasReceiveId = true;
|
|
193
|
+
selectUser(conversation);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
handleTabChange(TAB_VALUE.ALL, { hideCheckHasReceiveId: activeTabs.value != TAB_VALUE.UNKNOWN });
|
|
197
|
+
handleTabChange(TAB_VALUE.UNKNOWN, {
|
|
198
|
+
hideCheckHasReceiveId,
|
|
199
|
+
hideLoading: activeTabs.value != TAB_VALUE.UNKNOWN
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
const __VLS_exposed = {
|
|
203
|
+
handleReadMessage,
|
|
204
|
+
listConversationsAll,
|
|
205
|
+
listConversationsUnknown,
|
|
206
|
+
getCurrentConversation,
|
|
207
|
+
initData
|
|
161
208
|
};
|
|
162
|
-
handleTabChange(TAB_VALUE.ALL);
|
|
163
|
-
handleTabChange(TAB_VALUE.UNKNOWN);
|
|
164
|
-
const __VLS_exposed = { handleReadMessage, listConversationsAll, listConversationsUnknown, getCurrentConversation };
|
|
165
209
|
defineExpose(__VLS_exposed);
|
|
166
210
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
167
211
|
const __VLS_modelEmit = defineEmits();
|
|
@@ -177,7 +221,7 @@ let __VLS_elements;
|
|
|
177
221
|
let __VLS_components;
|
|
178
222
|
let __VLS_directives;
|
|
179
223
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
180
|
-
...{ class: "h-full flex flex-col
|
|
224
|
+
...{ class: "h-full flex flex-col bg-white pt-6" },
|
|
181
225
|
});
|
|
182
226
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
183
227
|
...{ class: "shrink-0 w-full px-6 flex gap-2 mb-4" },
|
|
@@ -203,55 +247,71 @@ const __VLS_5 = ({ search: {} },
|
|
|
203
247
|
// @ts-ignore
|
|
204
248
|
[responsive, keyword, handleSearch,];
|
|
205
249
|
var __VLS_2;
|
|
250
|
+
__VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
251
|
+
...{ onClick: (...[$event]) => {
|
|
252
|
+
__VLS_ctx.emit('openPhoneNumpad');
|
|
253
|
+
// @ts-ignore
|
|
254
|
+
[emit,];
|
|
255
|
+
} },
|
|
256
|
+
...{ class: "shrink-0 h-11 w-11 rounded-full flex-center bg-[#C7DEFF] block xl:hidden" },
|
|
257
|
+
});
|
|
258
|
+
/** @type {[typeof IconPlus, ]} */ ;
|
|
259
|
+
// @ts-ignore
|
|
260
|
+
const __VLS_7 = __VLS_asFunctionalComponent(IconPlus, new IconPlus({
|
|
261
|
+
...{ class: "text-[#004AB3]" },
|
|
262
|
+
}));
|
|
263
|
+
const __VLS_8 = __VLS_7({
|
|
264
|
+
...{ class: "text-[#004AB3]" },
|
|
265
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
|
206
266
|
if (__VLS_ctx.dataProfile?.user_type == 'tenant') {
|
|
207
267
|
// @ts-ignore
|
|
208
268
|
[dataProfile,];
|
|
209
|
-
/** @type {[typeof
|
|
269
|
+
/** @type {[typeof TabBase2, ]} */ ;
|
|
210
270
|
// @ts-ignore
|
|
211
|
-
const
|
|
271
|
+
const __VLS_11 = __VLS_asFunctionalComponent(TabBase2, new TabBase2({
|
|
212
272
|
...{ 'onChange': {} },
|
|
213
|
-
...{ class: "shrink-0 px-6" },
|
|
273
|
+
...{ class: "shrink-0 px-6 mb-4" },
|
|
214
274
|
tabs: (__VLS_ctx.tabs),
|
|
215
275
|
active: (__VLS_ctx.activeTabs),
|
|
216
276
|
}));
|
|
217
|
-
const
|
|
277
|
+
const __VLS_12 = __VLS_11({
|
|
218
278
|
...{ 'onChange': {} },
|
|
219
|
-
...{ class: "shrink-0 px-6" },
|
|
279
|
+
...{ class: "shrink-0 px-6 mb-4" },
|
|
220
280
|
tabs: (__VLS_ctx.tabs),
|
|
221
281
|
active: (__VLS_ctx.activeTabs),
|
|
222
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
223
|
-
let
|
|
224
|
-
let
|
|
225
|
-
const
|
|
282
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_11));
|
|
283
|
+
let __VLS_14;
|
|
284
|
+
let __VLS_15;
|
|
285
|
+
const __VLS_16 = ({ change: {} },
|
|
226
286
|
{ onChange: (__VLS_ctx.handleTabChange) });
|
|
227
287
|
// @ts-ignore
|
|
228
288
|
[tabs, activeTabs, handleTabChange,];
|
|
229
|
-
var
|
|
289
|
+
var __VLS_13;
|
|
230
290
|
}
|
|
231
291
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
232
292
|
...{ class: "grow relative overflow-hidden" },
|
|
233
293
|
});
|
|
234
294
|
/** @type {[typeof ScrollEvent, typeof ScrollEvent, ]} */ ;
|
|
235
295
|
// @ts-ignore
|
|
236
|
-
const
|
|
296
|
+
const __VLS_18 = __VLS_asFunctionalComponent(ScrollEvent, new ScrollEvent({
|
|
237
297
|
...{ 'onGetDataBottom': {} },
|
|
238
298
|
ref: "scrollEventRef",
|
|
239
299
|
...{ class: "h-full overflow-auto" },
|
|
240
300
|
bottom: true,
|
|
241
301
|
}));
|
|
242
|
-
const
|
|
302
|
+
const __VLS_19 = __VLS_18({
|
|
243
303
|
...{ 'onGetDataBottom': {} },
|
|
244
304
|
ref: "scrollEventRef",
|
|
245
305
|
...{ class: "h-full overflow-auto" },
|
|
246
306
|
bottom: true,
|
|
247
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
248
|
-
let
|
|
249
|
-
let
|
|
250
|
-
const
|
|
307
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_18));
|
|
308
|
+
let __VLS_21;
|
|
309
|
+
let __VLS_22;
|
|
310
|
+
const __VLS_23 = ({ getDataBottom: {} },
|
|
251
311
|
{ onGetDataBottom: (__VLS_ctx.handleScroll) });
|
|
252
312
|
/** @type {typeof __VLS_ctx.scrollEventRef} */ ;
|
|
253
|
-
var
|
|
254
|
-
const { default:
|
|
313
|
+
var __VLS_24 = {};
|
|
314
|
+
const { default: __VLS_26 } = __VLS_20.slots;
|
|
255
315
|
// @ts-ignore
|
|
256
316
|
[handleScroll, scrollEventRef,];
|
|
257
317
|
for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
|
|
@@ -268,26 +328,26 @@ for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
|
|
|
268
328
|
});
|
|
269
329
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
270
330
|
...{ class: "w-full overflow-hidden flex items-center hover:bg-[#EDF5FF] cursor-pointer px-6 py-2" },
|
|
271
|
-
...{ class: ({ 'bg-[#EDF5FF]': __VLS_ctx.receiver_id == user.receiver_id && __VLS_ctx.responsive
|
|
331
|
+
...{ class: ({ 'bg-[#EDF5FF]': __VLS_ctx.receiver_id == user.receiver_id && __VLS_ctx.responsive != 'mobile' }) },
|
|
272
332
|
});
|
|
273
333
|
// @ts-ignore
|
|
274
334
|
[responsive, receiver_id,];
|
|
275
335
|
/** @type {[typeof Avatar, ]} */ ;
|
|
276
336
|
// @ts-ignore
|
|
277
|
-
const
|
|
337
|
+
const __VLS_27 = __VLS_asFunctionalComponent(Avatar, new Avatar({
|
|
278
338
|
id: (user.id),
|
|
279
339
|
...{ class: "shrink-0" },
|
|
280
340
|
src: (user.avatar ?? ''),
|
|
281
341
|
color: (user.color),
|
|
282
342
|
name: (user.username ?? ''),
|
|
283
343
|
}));
|
|
284
|
-
const
|
|
344
|
+
const __VLS_28 = __VLS_27({
|
|
285
345
|
id: (user.id),
|
|
286
346
|
...{ class: "shrink-0" },
|
|
287
347
|
src: (user.avatar ?? ''),
|
|
288
348
|
color: (user.color),
|
|
289
349
|
name: (user.username ?? ''),
|
|
290
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
350
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_27));
|
|
291
351
|
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
292
352
|
...{ class: "grow ml-3 overflow-hidden" },
|
|
293
353
|
});
|
|
@@ -311,12 +371,12 @@ for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
|
|
|
311
371
|
[digibotId,];
|
|
312
372
|
/** @type {[typeof IconAiCheck, ]} */ ;
|
|
313
373
|
// @ts-ignore
|
|
314
|
-
const
|
|
374
|
+
const __VLS_31 = __VLS_asFunctionalComponent(IconAiCheck, new IconAiCheck({
|
|
315
375
|
...{ class: "ml-2" },
|
|
316
376
|
}));
|
|
317
|
-
const
|
|
377
|
+
const __VLS_32 = __VLS_31({
|
|
318
378
|
...{ class: "ml-2" },
|
|
319
|
-
}, ...__VLS_functionalComponentArgsRest(
|
|
379
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_31));
|
|
320
380
|
}
|
|
321
381
|
if (user.unread_count) {
|
|
322
382
|
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
|
|
@@ -339,12 +399,12 @@ for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
|
|
|
339
399
|
// @ts-ignore
|
|
340
400
|
[getTimeFromNow,];
|
|
341
401
|
}
|
|
342
|
-
var
|
|
402
|
+
var __VLS_20;
|
|
343
403
|
/** @type {__VLS_StyleScopedClasses['']} */ ;
|
|
344
404
|
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
345
405
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
346
406
|
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
347
|
-
/** @type {__VLS_StyleScopedClasses['
|
|
407
|
+
/** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
|
|
348
408
|
/** @type {__VLS_StyleScopedClasses['pt-6']} */ ;
|
|
349
409
|
/** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
|
|
350
410
|
/** @type {__VLS_StyleScopedClasses['w-full']} */ ;
|
|
@@ -355,7 +415,17 @@ var __VLS_16;
|
|
|
355
415
|
/** @type {__VLS_StyleScopedClasses['h-11']} */ ;
|
|
356
416
|
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
357
417
|
/** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
|
|
418
|
+
/** @type {__VLS_StyleScopedClasses['h-11']} */ ;
|
|
419
|
+
/** @type {__VLS_StyleScopedClasses['w-11']} */ ;
|
|
420
|
+
/** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
|
|
421
|
+
/** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
|
|
422
|
+
/** @type {__VLS_StyleScopedClasses['bg-[#C7DEFF]']} */ ;
|
|
423
|
+
/** @type {__VLS_StyleScopedClasses['block']} */ ;
|
|
424
|
+
/** @type {__VLS_StyleScopedClasses['xl:hidden']} */ ;
|
|
425
|
+
/** @type {__VLS_StyleScopedClasses['text-[#004AB3]']} */ ;
|
|
426
|
+
/** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
|
|
358
427
|
/** @type {__VLS_StyleScopedClasses['px-6']} */ ;
|
|
428
|
+
/** @type {__VLS_StyleScopedClasses['mb-4']} */ ;
|
|
359
429
|
/** @type {__VLS_StyleScopedClasses['grow']} */ ;
|
|
360
430
|
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
361
431
|
/** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
|
|
@@ -406,7 +476,7 @@ var __VLS_16;
|
|
|
406
476
|
/** @type {__VLS_StyleScopedClasses['w-[80px]']} */ ;
|
|
407
477
|
/** @type {__VLS_StyleScopedClasses['md:w-[130px]']} */ ;
|
|
408
478
|
// @ts-ignore
|
|
409
|
-
var
|
|
479
|
+
var __VLS_25 = __VLS_24;
|
|
410
480
|
const __VLS_export = (await import('vue')).defineComponent({
|
|
411
481
|
setup: () => (__VLS_exposed),
|
|
412
482
|
__typeEmits: {},
|
|
@@ -33,6 +33,13 @@ const isChatFinished = (index) => {
|
|
|
33
33
|
const time2 = dayjs(props.message[index + 1].created_at);
|
|
34
34
|
return time2.diff(time1, 'minute') > 10;
|
|
35
35
|
};
|
|
36
|
+
const isChatStart = (index) => {
|
|
37
|
+
if (shouldShowAvatar(index))
|
|
38
|
+
return true;
|
|
39
|
+
const time1 = dayjs(props.message[index - 1].created_at);
|
|
40
|
+
const time2 = dayjs(props.message[index].created_at);
|
|
41
|
+
return time2.diff(time1, 'minute') > 10;
|
|
42
|
+
};
|
|
36
43
|
const handleScrollTop = () => {
|
|
37
44
|
emit('scrollTop');
|
|
38
45
|
};
|
|
@@ -122,6 +129,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
|
|
|
122
129
|
isLastMessage: (index == __VLS_ctx.message.length - 1),
|
|
123
130
|
isEndMessage: (__VLS_ctx.isEndMessage(index)),
|
|
124
131
|
isChatFinished: (__VLS_ctx.isChatFinished(index)),
|
|
132
|
+
isChatStart: (__VLS_ctx.isChatStart(index)),
|
|
125
133
|
}));
|
|
126
134
|
const __VLS_14 = __VLS_13({
|
|
127
135
|
...{ 'onCallAgain': {} },
|
|
@@ -134,6 +142,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
|
|
|
134
142
|
isLastMessage: (index == __VLS_ctx.message.length - 1),
|
|
135
143
|
isEndMessage: (__VLS_ctx.isEndMessage(index)),
|
|
136
144
|
isChatFinished: (__VLS_ctx.isChatFinished(index)),
|
|
145
|
+
isChatStart: (__VLS_ctx.isChatStart(index)),
|
|
137
146
|
}, ...__VLS_functionalComponentArgsRest(__VLS_13));
|
|
138
147
|
let __VLS_16;
|
|
139
148
|
let __VLS_17;
|
|
@@ -141,7 +150,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
|
|
|
141
150
|
{ onCallAgain: (...[$event]) => {
|
|
142
151
|
__VLS_ctx.emit('callBack');
|
|
143
152
|
// @ts-ignore
|
|
144
|
-
[data, message, responsive, dataProfile, shouldShowAvatar, isEndMessage, isChatFinished, emit,];
|
|
153
|
+
[data, message, responsive, dataProfile, shouldShowAvatar, isEndMessage, isChatFinished, isChatStart, emit,];
|
|
145
154
|
} });
|
|
146
155
|
var __VLS_15;
|
|
147
156
|
}
|