@phonghq/go-chat 1.0.2 → 1.0.4

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 (284) hide show
  1. package/dist/go-chat.es.js +6578 -6530
  2. package/dist/go-chat.umd.js +14 -14
  3. package/dist/style.css +1 -1
  4. package/package.json +1 -1
  5. package/dist/assets/icons/IconArrowLeft.vue.d.ts +0 -2
  6. package/dist/assets/icons/IconArrowLeft.vue.js +0 -29
  7. package/dist/assets/icons/IconPhone.vue.d.ts +0 -2
  8. package/dist/assets/icons/IconPhone.vue.js +0 -19
  9. package/dist/assets/icons/IconPlan.vue.d.ts +0 -2
  10. package/dist/assets/icons/IconPlan.vue.js +0 -19
  11. package/dist/assets/icons/IconPlus.vue.d.ts +0 -2
  12. package/dist/assets/icons/IconPlus.vue.js +0 -22
  13. package/dist/assets/icons/IconSearch.vue.d.ts +0 -32
  14. package/dist/assets/icons/IconSearch.vue.js +0 -68
  15. package/dist/assets/icons/call/IconMic.vue.d.ts +0 -14
  16. package/dist/assets/icons/call/IconMic.vue.js +0 -123
  17. package/dist/assets/icons/call/IconPhone.vue.d.ts +0 -2
  18. package/dist/assets/icons/call/IconPhone.vue.js +0 -35
  19. package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +0 -2
  20. package/dist/assets/icons/call/IconPhoneCancel.vue.js +0 -35
  21. package/dist/assets/icons/call/IconSpeaker.vue.d.ts +0 -14
  22. package/dist/assets/icons/call/IconSpeaker.vue.js +0 -62
  23. package/dist/assets/icons/customer-appointment/IconFilter.vue.d.ts +0 -2
  24. package/dist/assets/icons/customer-appointment/IconFilter.vue.js +0 -53
  25. package/dist/assets/icons/customer-detail/IconArrow.vue.d.ts +0 -2
  26. package/dist/assets/icons/customer-detail/IconArrow.vue.js +0 -22
  27. package/dist/assets/icons/customer-detail/IconCheck.vue.d.ts +0 -2
  28. package/dist/assets/icons/customer-detail/IconCheck.vue.js +0 -27
  29. package/dist/assets/icons/customer-detail/IconDate.vue.d.ts +0 -2
  30. package/dist/assets/icons/customer-detail/IconDate.vue.js +0 -43
  31. package/dist/assets/icons/customer-detail/IconGroup.vue.d.ts +0 -2
  32. package/dist/assets/icons/customer-detail/IconGroup.vue.js +0 -48
  33. package/dist/assets/icons/customer-detail/IconMessage.vue.d.ts +0 -2
  34. package/dist/assets/icons/customer-detail/IconMessage.vue.js +0 -28
  35. package/dist/assets/icons/customer-detail/IconNote.vue.d.ts +0 -2
  36. package/dist/assets/icons/customer-detail/IconNote.vue.js +0 -29
  37. package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +0 -2
  38. package/dist/assets/icons/customer-detail/IconPhone.vue.js +0 -21
  39. package/dist/assets/icons/customer-detail/IconPin.vue.d.ts +0 -2
  40. package/dist/assets/icons/customer-detail/IconPin.vue.js +0 -29
  41. package/dist/assets/icons/customer-detail/IconSearch.vue.d.ts +0 -2
  42. package/dist/assets/icons/customer-detail/IconSearch.vue.js +0 -29
  43. package/dist/chat/App.vue.d.ts +0 -5
  44. package/dist/chat/App.vue.js +0 -502
  45. package/dist/chat/main.d.ts +0 -3
  46. package/dist/chat/main.js +0 -2
  47. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.d.ts +0 -2
  48. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.js +0 -207
  49. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.d.ts +0 -12
  50. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.js +0 -80
  51. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.d.ts +0 -2
  52. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.js +0 -136
  53. package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +0 -7
  54. package/dist/chat/page/customer-detail/CustomerDetail.vue.js +0 -235
  55. package/dist/chat/page/customer-detail/SubInformation.vue.d.ts +0 -16
  56. package/dist/chat/page/customer-detail/SubInformation.vue.js +0 -102
  57. package/dist/chat/page/error/Error.vue.d.ts +0 -2
  58. package/dist/chat/page/error/Error.vue.js +0 -64
  59. package/dist/chat/page/home/ChatList.vue.d.ts +0 -20
  60. package/dist/chat/page/home/ChatList.vue.js +0 -380
  61. package/dist/chat/page/home/ChatMessage.vue.d.ts +0 -16
  62. package/dist/chat/page/home/ChatMessage.vue.js +0 -271
  63. package/dist/chat/page/home/Home.vue.d.ts +0 -14
  64. package/dist/chat/page/home/Home.vue.js +0 -327
  65. package/dist/chat/page/home/HomeHeader.vue.d.ts +0 -10
  66. package/dist/chat/page/home/HomeHeader.vue.js +0 -122
  67. package/dist/chat/page/home/InputChat.vue.d.ts +0 -19
  68. package/dist/chat/page/home/InputChat.vue.js +0 -226
  69. package/dist/chat/page/home/NewCustomer.vue.d.ts +0 -6
  70. package/dist/chat/page/home/NewCustomer.vue.js +0 -82
  71. package/dist/components/ListenEvent.vue.d.ts +0 -2
  72. package/dist/components/ListenEvent.vue.js +0 -45
  73. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +0 -22
  74. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +0 -197
  75. package/dist/components/chat/call/Calling.vue.d.ts +0 -7
  76. package/dist/components/chat/call/Calling.vue.js +0 -291
  77. package/dist/components/chat/card/CardCustomerDetail.vue.d.ts +0 -13
  78. package/dist/components/chat/card/CardCustomerDetail.vue.js +0 -28
  79. package/dist/components/chat/common/collapse/CollapseBase.vue.d.ts +0 -20
  80. package/dist/components/chat/common/collapse/CollapseBase.vue.js +0 -59
  81. package/dist/components/chat/common/input/InputSearch.vue.d.ts +0 -16
  82. package/dist/components/chat/common/input/InputSearch.vue.js +0 -71
  83. package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +0 -35
  84. package/dist/components/chat/common/popover/PopoverBase.vue.js +0 -148
  85. package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +0 -2
  86. package/dist/components/chat/common/spin/BaseSpin.vue.js +0 -12
  87. package/dist/components/chat/customer/Avatar.vue.d.ts +0 -11
  88. package/dist/components/chat/customer/Avatar.vue.js +0 -79
  89. package/dist/components/chat/layout/mobile/Footer.vue.d.ts +0 -2
  90. package/dist/components/chat/layout/mobile/Footer.vue.js +0 -109
  91. package/dist/components/common/CustomLoading.vue.d.ts +0 -2
  92. package/dist/components/common/CustomLoading.vue.js +0 -19
  93. package/dist/components/common/Notification/NotificationDescription.vue.d.ts +0 -7
  94. package/dist/components/common/Notification/NotificationDescription.vue.js +0 -38
  95. package/dist/components/common/button/ButtonBase.vue.d.ts +0 -22
  96. package/dist/components/common/button/ButtonBase.vue.js +0 -78
  97. package/dist/components/common/button/ButtonToggle.vue.d.ts +0 -20
  98. package/dist/components/common/button/ButtonToggle.vue.js +0 -70
  99. package/dist/components/common/checkbox/CCheckboxNumber.vue.d.ts +0 -16
  100. package/dist/components/common/checkbox/CCheckboxNumber.vue.js +0 -48
  101. package/dist/components/common/collapse/BaseCollapse.vue.d.ts +0 -12
  102. package/dist/components/common/collapse/BaseCollapse.vue.js +0 -36
  103. package/dist/components/common/collapse/BaseCollapseItem.vue.d.ts +0 -4
  104. package/dist/components/common/collapse/BaseCollapseItem.vue.js +0 -22
  105. package/dist/components/common/drawer/DrawerBase.vue.d.ts +0 -39
  106. package/dist/components/common/drawer/DrawerBase.vue.js +0 -126
  107. package/dist/components/common/dropdown/DropdownBase.vue.d.ts +0 -21
  108. package/dist/components/common/dropdown/DropdownBase.vue.js +0 -91
  109. package/dist/components/common/input/CInputSearch.vue.d.ts +0 -14
  110. package/dist/components/common/input/CInputSearch.vue.js +0 -62
  111. package/dist/components/common/modal/ModalBase.vue.d.ts +0 -35
  112. package/dist/components/common/modal/ModalBase.vue.js +0 -164
  113. package/dist/components/common/popover/PopoverBase.vue.d.ts +0 -3
  114. package/dist/components/common/popover/PopoverBase.vue.js +0 -36
  115. package/dist/components/common/slider/BaseSlider.vue.d.ts +0 -11
  116. package/dist/components/common/slider/BaseSlider.vue.js +0 -70
  117. package/dist/components/common/spin/CSpin.vue.d.ts +0 -9
  118. package/dist/components/common/spin/CSpin.vue.js +0 -41
  119. package/dist/components/common/tooltip/TooltipBase.vue.d.ts +0 -2
  120. package/dist/components/common/tooltip/TooltipBase.vue.js +0 -8
  121. package/dist/components/layout/Blank.vue.d.ts +0 -9
  122. package/dist/components/layout/Blank.vue.js +0 -19
  123. package/dist/components/layout/Default.vue.d.ts +0 -9
  124. package/dist/components/layout/Default.vue.js +0 -21
  125. package/dist/components/modal/Confirm.vue.d.ts +0 -2
  126. package/dist/components/modal/Confirm.vue.js +0 -164
  127. package/dist/components/ui/button/CButton.vue.d.ts +0 -19
  128. package/dist/components/ui/button/CButton.vue.js +0 -49
  129. package/dist/components/ui/button/c-button.d.ts +0 -7
  130. package/dist/components/ui/button/c-button.js +0 -26
  131. package/dist/components/ui/checkbox/Checkbox.vue.d.ts +0 -18
  132. package/dist/components/ui/checkbox/Checkbox.vue.js +0 -79
  133. package/dist/components/ui/checkbox/index.d.ts +0 -1
  134. package/dist/components/ui/checkbox/index.js +0 -1
  135. package/dist/components/ui/collapsible/Collapsible.vue.d.ts +0 -16
  136. package/dist/components/ui/collapsible/Collapsible.vue.js +0 -47
  137. package/dist/components/ui/collapsible/CollapsibleContent.vue.d.ts +0 -10
  138. package/dist/components/ui/collapsible/CollapsibleContent.vue.js +0 -41
  139. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +0 -10
  140. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.js +0 -35
  141. package/dist/components/ui/collapsible/index.d.ts +0 -3
  142. package/dist/components/ui/collapsible/index.js +0 -3
  143. package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -14
  144. package/dist/components/ui/dialog/Dialog.vue.js +0 -42
  145. package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -10
  146. package/dist/components/ui/dialog/DialogClose.vue.js +0 -35
  147. package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -29
  148. package/dist/components/ui/dialog/DialogContent.vue.js +0 -84
  149. package/dist/components/ui/dialog/DialogDescription.vue.d.ts +0 -14
  150. package/dist/components/ui/dialog/DialogDescription.vue.js +0 -43
  151. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -13
  152. package/dist/components/ui/dialog/DialogFooter.vue.js +0 -26
  153. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -13
  154. package/dist/components/ui/dialog/DialogHeader.vue.js +0 -26
  155. package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +0 -30
  156. package/dist/components/ui/dialog/DialogScrollContent.vue.js +0 -99
  157. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -14
  158. package/dist/components/ui/dialog/DialogTitle.vue.js +0 -43
  159. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -10
  160. package/dist/components/ui/dialog/DialogTrigger.vue.js +0 -35
  161. package/dist/components/ui/dialog/index.d.ts +0 -9
  162. package/dist/components/ui/dialog/index.js +0 -9
  163. package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -26
  164. package/dist/components/ui/drawer/Drawer.vue.js +0 -48
  165. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -33
  166. package/dist/components/ui/drawer/DrawerContent.vue.js +0 -81
  167. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -14
  168. package/dist/components/ui/drawer/DrawerDescription.vue.js +0 -42
  169. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -13
  170. package/dist/components/ui/drawer/DrawerFooter.vue.js +0 -26
  171. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -13
  172. package/dist/components/ui/drawer/DrawerHeader.vue.js +0 -26
  173. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -7
  174. package/dist/components/ui/drawer/DrawerOverlay.vue.js +0 -37
  175. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -14
  176. package/dist/components/ui/drawer/DrawerTitle.vue.js +0 -42
  177. package/dist/components/ui/drawer/index.d.ts +0 -8
  178. package/dist/components/ui/drawer/index.js +0 -8
  179. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +0 -14
  180. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.js +0 -41
  181. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +0 -20
  182. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +0 -79
  183. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +0 -28
  184. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +0 -61
  185. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +0 -10
  186. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +0 -35
  187. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +0 -15
  188. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.js +0 -43
  189. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +0 -15
  190. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +0 -43
  191. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +0 -14
  192. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +0 -41
  193. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +0 -18
  194. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +0 -80
  195. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +0 -7
  196. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +0 -37
  197. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +0 -13
  198. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +0 -26
  199. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +0 -14
  200. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.js +0 -41
  201. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +0 -30
  202. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +0 -46
  203. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +0 -14
  204. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +0 -58
  205. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +0 -10
  206. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +0 -41
  207. package/dist/components/ui/dropdown-menu/index.d.ts +0 -15
  208. package/dist/components/ui/dropdown-menu/index.js +0 -15
  209. package/dist/components/ui/popover/Popover.vue.d.ts +0 -14
  210. package/dist/components/ui/popover/Popover.vue.js +0 -41
  211. package/dist/components/ui/popover/PopoverContent.vue.d.ts +0 -28
  212. package/dist/components/ui/popover/PopoverContent.vue.js +0 -60
  213. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +0 -10
  214. package/dist/components/ui/popover/PopoverTrigger.vue.js +0 -35
  215. package/dist/components/ui/popover/index.d.ts +0 -3
  216. package/dist/components/ui/popover/index.js +0 -3
  217. package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +0 -18
  218. package/dist/components/ui/radio-group/RadioGroup.vue.js +0 -46
  219. package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +0 -7
  220. package/dist/components/ui/radio-group/RadioGroupItem.vue.js +0 -71
  221. package/dist/components/ui/radio-group/index.d.ts +0 -2
  222. package/dist/components/ui/radio-group/index.js +0 -2
  223. package/dist/components/ui/slider/Slider.vue.d.ts +0 -13
  224. package/dist/components/ui/slider/Slider.vue.js +0 -155
  225. package/dist/components/ui/slider/index.d.ts +0 -1
  226. package/dist/components/ui/slider/index.js +0 -1
  227. package/dist/components/ui/switch/Switch.vue.d.ts +0 -18
  228. package/dist/components/ui/switch/Switch.vue.js +0 -61
  229. package/dist/components/ui/switch/index.d.ts +0 -1
  230. package/dist/components/ui/switch/index.js +0 -1
  231. package/dist/composable/useCallHelper.d.ts +0 -23
  232. package/dist/composable/useCallHelper.js +0 -170
  233. package/dist/composable/useInitData.d.ts +0 -11
  234. package/dist/composable/useInitData.js +0 -84
  235. package/dist/composable/useModalConfirm.d.ts +0 -5
  236. package/dist/composable/useModalConfirm.js +0 -39
  237. package/dist/constant/color.d.ts +0 -22
  238. package/dist/constant/color.js +0 -43
  239. package/dist/constant/datetime.d.ts +0 -5
  240. package/dist/constant/datetime.js +0 -5
  241. package/dist/constant/general.d.ts +0 -8
  242. package/dist/constant/general.js +0 -9
  243. package/dist/constant/message.d.ts +0 -8
  244. package/dist/constant/message.js +0 -8
  245. package/dist/constant/mqtt.d.ts +0 -4
  246. package/dist/constant/mqtt.js +0 -11
  247. package/dist/constant/user.d.ts +0 -8
  248. package/dist/constant/user.js +0 -9
  249. package/dist/lib/utils.d.ts +0 -2
  250. package/dist/lib/utils.js +0 -5
  251. package/dist/plugins/axios-gci.d.ts +0 -3
  252. package/dist/plugins/axios-gci.js +0 -25
  253. package/dist/plugins/axios.d.ts +0 -3
  254. package/dist/plugins/axios.js +0 -85
  255. package/dist/plugins/mqtt.d.ts +0 -10
  256. package/dist/plugins/mqtt.js +0 -128
  257. package/dist/plugins/sdk.d.ts +0 -19
  258. package/dist/plugins/sdk.js +0 -83
  259. package/dist/plugins/websocket.d.ts +0 -4
  260. package/dist/plugins/websocket.js +0 -65
  261. package/dist/types/chat/user.d.ts +0 -88
  262. package/dist/types/chat/user.js +0 -1
  263. package/dist/types/conversation.d.ts +0 -18
  264. package/dist/types/conversation.js +0 -1
  265. package/dist/utils/chat/auth.d.ts +0 -45
  266. package/dist/utils/chat/auth.js +0 -51
  267. package/dist/utils/chat/call.d.ts +0 -5
  268. package/dist/utils/chat/call.js +0 -61
  269. package/dist/utils/chat/chat-router.d.ts +0 -3
  270. package/dist/utils/chat/chat-router.js +0 -9
  271. package/dist/utils/chat/conversation.d.ts +0 -3
  272. package/dist/utils/chat/conversation.js +0 -7
  273. package/dist/utils/chat/message.d.ts +0 -17
  274. package/dist/utils/chat/message.js +0 -42
  275. package/dist/utils/chat/user.d.ts +0 -193
  276. package/dist/utils/chat/user.js +0 -33
  277. package/dist/utils/debounce.d.ts +0 -1
  278. package/dist/utils/debounce.js +0 -9
  279. package/dist/utils/json.d.ts +0 -2
  280. package/dist/utils/json.js +0 -18
  281. package/dist/utils/logger.d.ts +0 -3
  282. package/dist/utils/logger.js +0 -5
  283. package/dist/utils/string-helper.d.ts +0 -1
  284. package/dist/utils/string-helper.js +0 -27
@@ -1,380 +0,0 @@
1
- import InputSearch from '../../../components/chat/common/input/InputSearch.vue';
2
- import IconPlus from '../../../assets/icons/IconPlus.vue';
3
- import { nextTick, onMounted, onUnmounted, ref } from 'vue';
4
- import Avatar from '../../../components/chat/customer/Avatar.vue';
5
- import { getConversation } from '../../../utils/chat/conversation';
6
- import BaseSpin from '../../../components/chat/common/spin/BaseSpin.vue';
7
- import ScrollEvent from '../../../components/chat/ScrollEvent/ScrollEvent.vue';
8
- import { useDebounce } from '../../../utils/debounce';
9
- import { addHandleMqttMessage, connectMqtt, removeHandleMqttMessage, subscribeToTopic, unsubscribeFromTopic } from '../../../plugins/mqtt';
10
- import { TOPIC_HOME, TOPIC_STATUS_USER } from '../../../constant/mqtt';
11
- import { dataProfile } from '../../../utils/chat/auth';
12
- import { readMessages } from '../../../utils/chat/message';
13
- import dayjs from 'dayjs';
14
- import relativeTime from 'dayjs/plugin/relativeTime';
15
- dayjs.extend(relativeTime);
16
- const props = withDefaults(defineProps(), {});
17
- const emit = defineEmits();
18
- const receiver_id = defineModel('receiverId');
19
- const isOpen = ref(false);
20
- const keyword = ref('');
21
- const scrollEventRef = ref(null);
22
- const listConversations = ref([]);
23
- const params = ref({
24
- page: 1,
25
- search: ''
26
- });
27
- let pageCount = 0;
28
- const isLoadingSearch = ref(false);
29
- onMounted(() => {
30
- handleConnectMqtt();
31
- });
32
- onUnmounted(() => {
33
- handleDisconnectMqtt;
34
- });
35
- const handleDisconnectMqtt = () => {
36
- TOPIC_HOME.forEach((item) => {
37
- unsubscribeFromTopic(item + dataProfile.value?.id);
38
- removeHandleMqttMessage('chat-list-' + item);
39
- });
40
- if (dataProfile.value?.user_type == 'tenant') {
41
- subscribeToTopic(TOPIC_STATUS_USER + dataProfile.value?.id);
42
- removeHandleMqttMessage('chat-list-' + TOPIC_STATUS_USER);
43
- }
44
- };
45
- const handleConnectMqtt = async () => {
46
- try {
47
- if (dataProfile.value) {
48
- await connectMqtt();
49
- TOPIC_HOME.forEach((item) => {
50
- subscribeToTopic(item + dataProfile.value?.id);
51
- addHandleMqttMessage('chat-list-' + item, item + dataProfile.value?.id, mqttMessageHandler);
52
- });
53
- subscribeToTopic(TOPIC_STATUS_USER + dataProfile.value?.id);
54
- addHandleMqttMessage('chat-list-' + TOPIC_STATUS_USER, TOPIC_STATUS_USER + dataProfile.value?.id, mqttMessageHandler);
55
- }
56
- }
57
- catch (error) {
58
- console.error(error);
59
- }
60
- };
61
- const mqttMessageHandler = (topic, data) => {
62
- getDataMqtt();
63
- if (topic === TOPIC_HOME[0] + dataProfile.value?.id) {
64
- const index = listConversations.value.findIndex((item) => item.id === data.id);
65
- if (index != -1) {
66
- listConversations.value.splice(index, 1);
67
- }
68
- listConversations.value.unshift(data);
69
- }
70
- if (topic === TOPIC_HOME[1] + dataProfile.value?.id) {
71
- const index = listConversations.value.findIndex((item) => item.id === data.id);
72
- if (index != -1) {
73
- listConversations.value[index].unread_count = 0;
74
- }
75
- }
76
- if (topic === TOPIC_HOME[2] + dataProfile.value?.id) {
77
- listConversations.value.unshift(data?.conversations);
78
- }
79
- if (topic === TOPIC_STATUS_USER + dataProfile.value?.id) {
80
- const index = listConversations.value.findIndex((e) => e.receiver_id == Number(data?.customer_id));
81
- if (index != -1) {
82
- listConversations.value[index].status = data.is_online ? 1 : 0;
83
- }
84
- }
85
- };
86
- const getDataMqtt = useDebounce(() => {
87
- getData(undefined, { hideLoading: true, reset: true });
88
- }, 5000);
89
- const getData = async (data, option) => {
90
- try {
91
- if (!option?.hideLoading)
92
- isLoadingSearch.value = true;
93
- params.value = { ...params.value, ...(data ?? {}) };
94
- const res = await getConversation(params.value);
95
- if (option?.reset) {
96
- listConversations.value = [];
97
- await nextTick();
98
- }
99
- listConversations.value.push(...(res?.items ?? []));
100
- checkHasReceiveId();
101
- params.value.page = res?._meta?.currentPage || 1;
102
- pageCount = res?._meta?.pageCount || 1;
103
- }
104
- catch (error) {
105
- console.error(error);
106
- }
107
- finally {
108
- isLoadingSearch.value = false;
109
- }
110
- };
111
- const checkHasReceiveId = () => {
112
- const hasReceiveId = listConversations.value?.some((e) => e.receiver_id === receiver_id.value);
113
- if (props.response == 'tablet') {
114
- if (!hasReceiveId && listConversations.value?.length)
115
- emit('selectReceiver', listConversations.value[0]);
116
- }
117
- };
118
- const handleSearch = (value) => {
119
- // listConversations.value = []
120
- getData({ search: value }, { reset: true });
121
- };
122
- const handleScroll = useDebounce(async () => {
123
- if (params.value.page >= pageCount) {
124
- scrollEventRef.value?.hideLoading();
125
- return;
126
- }
127
- let page = params.value.page + 1;
128
- await getData({ page });
129
- scrollEventRef.value?.hideLoading();
130
- }, 200);
131
- const selectUser = (user) => {
132
- emit('selectReceiver', user);
133
- };
134
- const handleReadMessage = () => {
135
- const index = listConversations.value.findIndex((e) => e.receiver_id == receiver_id.value);
136
- if (index > -1) {
137
- if (listConversations.value[index].unread_count) {
138
- readMessages(listConversations.value[index].id);
139
- listConversations.value[index].unread_count = 0;
140
- }
141
- }
142
- };
143
- getData();
144
- const __VLS_exposed = { handleReadMessage };
145
- defineExpose(__VLS_exposed);
146
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
147
- const __VLS_modelEmit = defineEmits();
148
- const __VLS_defaults = {};
149
- const __VLS_ctx = {
150
- ...{},
151
- ...{},
152
- ...{},
153
- ...{},
154
- ...{},
155
- };
156
- let __VLS_elements;
157
- let __VLS_components;
158
- let __VLS_directives;
159
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
160
- ...{ class: "h-full flex flex-col chat-box-white pt-6" },
161
- });
162
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
163
- ...{ class: "shrink-0 w-full px-6 flex gap-2 mb-6" },
164
- });
165
- /** @type {[typeof InputSearch, ]} */ ;
166
- // @ts-ignore
167
- const __VLS_0 = __VLS_asFunctionalComponent(InputSearch, new InputSearch({
168
- ...{ 'onSearch': {} },
169
- ...{ class: "h-[45px] grow" },
170
- response: (__VLS_ctx.response),
171
- modelValue: (__VLS_ctx.keyword),
172
- }));
173
- const __VLS_1 = __VLS_0({
174
- ...{ 'onSearch': {} },
175
- ...{ class: "h-[45px] grow" },
176
- response: (__VLS_ctx.response),
177
- modelValue: (__VLS_ctx.keyword),
178
- }, ...__VLS_functionalComponentArgsRest(__VLS_0));
179
- let __VLS_3;
180
- let __VLS_4;
181
- const __VLS_5 = ({ search: {} },
182
- { onSearch: (__VLS_ctx.handleSearch) });
183
- // @ts-ignore
184
- [response, keyword, handleSearch,];
185
- var __VLS_2;
186
- __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
187
- ...{ class: "h-[45px] w-[45px] rounded-full flex-center bg-[#C7DEFF]" },
188
- });
189
- /** @type {[typeof IconPlus, ]} */ ;
190
- // @ts-ignore
191
- const __VLS_7 = __VLS_asFunctionalComponent(IconPlus, new IconPlus({
192
- ...{ class: "text-[#004AB3]" },
193
- }));
194
- const __VLS_8 = __VLS_7({
195
- ...{ class: "text-[#004AB3]" },
196
- }, ...__VLS_functionalComponentArgsRest(__VLS_7));
197
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
198
- ...{ class: "grow relative overflow-hidden" },
199
- });
200
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
201
- ...{ class: "absolute sc-full flex-center bg-black/10" },
202
- });
203
- __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.isLoadingSearch) }, null, null);
204
- // @ts-ignore
205
- [isLoadingSearch,];
206
- /** @type {[typeof BaseSpin, ]} */ ;
207
- // @ts-ignore
208
- const __VLS_11 = __VLS_asFunctionalComponent(BaseSpin, new BaseSpin({}));
209
- const __VLS_12 = __VLS_11({}, ...__VLS_functionalComponentArgsRest(__VLS_11));
210
- /** @type {[typeof ScrollEvent, typeof ScrollEvent, ]} */ ;
211
- // @ts-ignore
212
- const __VLS_15 = __VLS_asFunctionalComponent(ScrollEvent, new ScrollEvent({
213
- ...{ 'onGetDataBottom': {} },
214
- ref: "scrollEventRef",
215
- ...{ class: "h-full overflow-auto" },
216
- bottom: true,
217
- }));
218
- const __VLS_16 = __VLS_15({
219
- ...{ 'onGetDataBottom': {} },
220
- ref: "scrollEventRef",
221
- ...{ class: "h-full overflow-auto" },
222
- bottom: true,
223
- }, ...__VLS_functionalComponentArgsRest(__VLS_15));
224
- let __VLS_18;
225
- let __VLS_19;
226
- const __VLS_20 = ({ getDataBottom: {} },
227
- { onGetDataBottom: (__VLS_ctx.handleScroll) });
228
- /** @type {typeof __VLS_ctx.scrollEventRef} */ ;
229
- var __VLS_21 = {};
230
- const { default: __VLS_23 } = __VLS_17.slots;
231
- // @ts-ignore
232
- [handleScroll, scrollEventRef,];
233
- for (const [user] of __VLS_getVForSourceType((__VLS_ctx.listConversations))) {
234
- // @ts-ignore
235
- [listConversations,];
236
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
237
- ...{ onClick: (...[$event]) => {
238
- __VLS_ctx.selectUser(user);
239
- // @ts-ignore
240
- [selectUser,];
241
- } },
242
- ...{ class: "" },
243
- key: (user.id),
244
- });
245
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
246
- ...{ class: "w-full overflow-hidden flex items-center hover:bg-[#EDF5FF] cursor-pointer px-6 py-2" },
247
- ...{ class: ({ 'bg-[#EDF5FF]': __VLS_ctx.receiver_id == user.receiver_id && __VLS_ctx.response == 'tablet' }) },
248
- });
249
- // @ts-ignore
250
- [response, receiver_id,];
251
- /** @type {[typeof Avatar, ]} */ ;
252
- // @ts-ignore
253
- const __VLS_24 = __VLS_asFunctionalComponent(Avatar, new Avatar({
254
- ...{ class: "shrink-0" },
255
- src: (user.avatar ?? ''),
256
- color: (user.color),
257
- name: (user.username ?? ''),
258
- }));
259
- const __VLS_25 = __VLS_24({
260
- ...{ class: "shrink-0" },
261
- src: (user.avatar ?? ''),
262
- color: (user.color),
263
- name: (user.username ?? ''),
264
- }, ...__VLS_functionalComponentArgsRest(__VLS_24));
265
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
266
- ...{ class: "grow ml-3 overflow-hidden" },
267
- });
268
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
269
- ...{ class: "flex justify-between items-center gap-4" },
270
- });
271
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
272
- ...{ class: "truncate" },
273
- });
274
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
275
- ...{ class: "flex items-center" },
276
- });
277
- __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
278
- ...{ class: "font-semibold" },
279
- });
280
- (user.username);
281
- if (user.unread_count) {
282
- __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
283
- ...{ class: "ml-2 bg-[#E60000] text-white text-xs font-bold px-2 py-[1px] flex-center rounded-full" },
284
- });
285
- (user.unread_count);
286
- }
287
- __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
288
- ...{ class: "text-sm truncate" },
289
- ...{ class: ({
290
- 'font-semibold': user.unread_count,
291
- 'text-chat-gray-3': !user.unread_count
292
- }) },
293
- });
294
- (user.last_message ?? 'No messages');
295
- __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
296
- ...{ class: "text-sm text-right text-chat-gray-4 w-[130px]" },
297
- });
298
- (__VLS_ctx.dayjs(user.last_message_time).isValid()
299
- ? __VLS_ctx.dayjs(user.last_message_time).fromNow()
300
- : (user.last_message_time ?? ''));
301
- // @ts-ignore
302
- [dayjs, dayjs,];
303
- }
304
- var __VLS_17;
305
- /** @type {__VLS_StyleScopedClasses['']} */ ;
306
- /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
307
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
308
- /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
309
- /** @type {__VLS_StyleScopedClasses['chat-box-white']} */ ;
310
- /** @type {__VLS_StyleScopedClasses['pt-6']} */ ;
311
- /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
312
- /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
313
- /** @type {__VLS_StyleScopedClasses['px-6']} */ ;
314
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
315
- /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
316
- /** @type {__VLS_StyleScopedClasses['mb-6']} */ ;
317
- /** @type {__VLS_StyleScopedClasses['h-[45px]']} */ ;
318
- /** @type {__VLS_StyleScopedClasses['grow']} */ ;
319
- /** @type {__VLS_StyleScopedClasses['h-[45px]']} */ ;
320
- /** @type {__VLS_StyleScopedClasses['w-[45px]']} */ ;
321
- /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
322
- /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
323
- /** @type {__VLS_StyleScopedClasses['bg-[#C7DEFF]']} */ ;
324
- /** @type {__VLS_StyleScopedClasses['text-[#004AB3]']} */ ;
325
- /** @type {__VLS_StyleScopedClasses['grow']} */ ;
326
- /** @type {__VLS_StyleScopedClasses['relative']} */ ;
327
- /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
328
- /** @type {__VLS_StyleScopedClasses['absolute']} */ ;
329
- /** @type {__VLS_StyleScopedClasses['sc-full']} */ ;
330
- /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
331
- /** @type {__VLS_StyleScopedClasses['bg-black/10']} */ ;
332
- /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
333
- /** @type {__VLS_StyleScopedClasses['overflow-auto']} */ ;
334
- /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
335
- /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
336
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
337
- /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
338
- /** @type {__VLS_StyleScopedClasses['hover:bg-[#EDF5FF]']} */ ;
339
- /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
340
- /** @type {__VLS_StyleScopedClasses['px-6']} */ ;
341
- /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
342
- /** @type {__VLS_StyleScopedClasses['bg-[#EDF5FF]']} */ ;
343
- /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
344
- /** @type {__VLS_StyleScopedClasses['grow']} */ ;
345
- /** @type {__VLS_StyleScopedClasses['ml-3']} */ ;
346
- /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
347
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
348
- /** @type {__VLS_StyleScopedClasses['justify-between']} */ ;
349
- /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
350
- /** @type {__VLS_StyleScopedClasses['gap-4']} */ ;
351
- /** @type {__VLS_StyleScopedClasses['truncate']} */ ;
352
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
353
- /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
354
- /** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
355
- /** @type {__VLS_StyleScopedClasses['ml-2']} */ ;
356
- /** @type {__VLS_StyleScopedClasses['bg-[#E60000]']} */ ;
357
- /** @type {__VLS_StyleScopedClasses['text-white']} */ ;
358
- /** @type {__VLS_StyleScopedClasses['text-xs']} */ ;
359
- /** @type {__VLS_StyleScopedClasses['font-bold']} */ ;
360
- /** @type {__VLS_StyleScopedClasses['px-2']} */ ;
361
- /** @type {__VLS_StyleScopedClasses['py-[1px]']} */ ;
362
- /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
363
- /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
364
- /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
365
- /** @type {__VLS_StyleScopedClasses['truncate']} */ ;
366
- /** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
367
- /** @type {__VLS_StyleScopedClasses['text-chat-gray-3']} */ ;
368
- /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
369
- /** @type {__VLS_StyleScopedClasses['text-right']} */ ;
370
- /** @type {__VLS_StyleScopedClasses['text-chat-gray-4']} */ ;
371
- /** @type {__VLS_StyleScopedClasses['w-[130px]']} */ ;
372
- // @ts-ignore
373
- var __VLS_22 = __VLS_21;
374
- const __VLS_export = (await import('vue')).defineComponent({
375
- setup: () => (__VLS_exposed),
376
- __typeEmits: {},
377
- __typeProps: {},
378
- props: {},
379
- });
380
- export default {};
@@ -1,16 +0,0 @@
1
- import type { IResMessage, IResUser } from '../../../types/message';
2
- import type { PAGE_RESPONSE } from '../../../types/chat/global';
3
- type Props = {
4
- data: IResUser | null;
5
- message: IResMessage[];
6
- response: PAGE_RESPONSE;
7
- };
8
- declare const _default: import("vue").DefineComponent<Props, {
9
- scrollBottom: () => void;
10
- hideScrollEvent: () => void;
11
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
- scrollTop: () => any;
13
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
14
- onScrollTop?: (() => any) | undefined;
15
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
- export default _default;
@@ -1,271 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import Avatar from '../../../components/chat/customer/Avatar.vue';
3
- import { dataProfile } from '../../../utils/chat/auth';
4
- import { nextTick, ref } from 'vue';
5
- import ScrollEvent from '../../../components/chat/ScrollEvent/ScrollEvent.vue';
6
- import { MessageState } from '../../../constant/message';
7
- const props = withDefaults(defineProps(), {});
8
- const emit = defineEmits();
9
- const scrollEventRef = ref(null);
10
- const scrollBottom = () => {
11
- nextTick(() => {
12
- const eleIdContentChat = document.getElementById('content-chat');
13
- if (eleIdContentChat) {
14
- eleIdContentChat.scrollTop = eleIdContentChat.scrollHeight;
15
- }
16
- });
17
- };
18
- const shouldShowAvatar = (index) => {
19
- if (index === 0)
20
- return true;
21
- return props.message[index - 1].sender_id !== props.message[index].sender_id;
22
- };
23
- const isEndMessage = (index) => {
24
- if (props.message?.length == index + 1)
25
- return true;
26
- return props.message[index + 1].sender_id !== props.message[index].sender_id;
27
- };
28
- const handleScrollTop = () => {
29
- emit('scrollTop');
30
- };
31
- const hideScrollEvent = () => {
32
- scrollEventRef.value?.hideLoading();
33
- scrollEventRef.value?.fixedScroll();
34
- };
35
- const getMessageStateText = (item) => {
36
- const state = item.state;
37
- switch (state) {
38
- case MessageState.Sending:
39
- return 'Sending...';
40
- case MessageState.Uploading:
41
- return 'Uploading...';
42
- case MessageState.Sent:
43
- return '';
44
- case MessageState.Read:
45
- return 'Seen';
46
- case MessageState.Failed:
47
- return item.error || 'Message failed';
48
- default:
49
- return '';
50
- }
51
- };
52
- const __VLS_exposed = { scrollBottom, hideScrollEvent };
53
- defineExpose(__VLS_exposed);
54
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
55
- const __VLS_defaults = {};
56
- const __VLS_ctx = {
57
- ...{},
58
- ...{},
59
- ...{},
60
- ...{},
61
- ...{},
62
- };
63
- let __VLS_elements;
64
- let __VLS_components;
65
- let __VLS_directives;
66
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
67
- ...{ class: "relative overflow-hidden" },
68
- });
69
- /** @type {[typeof ScrollEvent, typeof ScrollEvent, ]} */ ;
70
- // @ts-ignore
71
- const __VLS_0 = __VLS_asFunctionalComponent(ScrollEvent, new ScrollEvent({
72
- ...{ 'onGetDataTop': {} },
73
- ...{ class: "bg-white h-full flex flex-col overflow-auto" },
74
- id: "content-chat",
75
- top: true,
76
- ref: "scrollEventRef",
77
- }));
78
- const __VLS_1 = __VLS_0({
79
- ...{ 'onGetDataTop': {} },
80
- ...{ class: "bg-white h-full flex flex-col overflow-auto" },
81
- id: "content-chat",
82
- top: true,
83
- ref: "scrollEventRef",
84
- }, ...__VLS_functionalComponentArgsRest(__VLS_0));
85
- let __VLS_3;
86
- let __VLS_4;
87
- const __VLS_5 = ({ getDataTop: {} },
88
- { onGetDataTop: (__VLS_ctx.handleScrollTop) });
89
- /** @type {typeof __VLS_ctx.scrollEventRef} */ ;
90
- var __VLS_6 = {};
91
- const { default: __VLS_8 } = __VLS_2.slots;
92
- // @ts-ignore
93
- [handleScrollTop, scrollEventRef,];
94
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
95
- ...{ class: "chat-padding-page" },
96
- });
97
- for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
98
- (item.id);
99
- // @ts-ignore
100
- [message,];
101
- if (item.sender_id !== __VLS_ctx.dataProfile?.id) {
102
- // @ts-ignore
103
- [dataProfile,];
104
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
105
- ...{ class: "flex items-end gap-2 mt-2" },
106
- ...{ class: ({ 'mt-4': __VLS_ctx.shouldShowAvatar(index) }) },
107
- });
108
- // @ts-ignore
109
- [shouldShowAvatar,];
110
- if (item.state != __VLS_ctx.MessageState.Sending) {
111
- // @ts-ignore
112
- [MessageState,];
113
- if (__VLS_ctx.shouldShowAvatar(index)) {
114
- // @ts-ignore
115
- [shouldShowAvatar,];
116
- /** @type {[typeof Avatar, ]} */ ;
117
- // @ts-ignore
118
- const __VLS_9 = __VLS_asFunctionalComponent(Avatar, new Avatar({
119
- src: (__VLS_ctx.data?.avatar ?? ''),
120
- color: (__VLS_ctx.data?.color),
121
- name: (__VLS_ctx.data?.username),
122
- size: (__VLS_ctx.response == 'mobile' ? 'sm' : 'md'),
123
- ...{ class: (__VLS_ctx.response == 'mobile' ? 'translate-y-[-2px]' : '') },
124
- }));
125
- const __VLS_10 = __VLS_9({
126
- src: (__VLS_ctx.data?.avatar ?? ''),
127
- color: (__VLS_ctx.data?.color),
128
- name: (__VLS_ctx.data?.username),
129
- size: (__VLS_ctx.response == 'mobile' ? 'sm' : 'md'),
130
- ...{ class: (__VLS_ctx.response == 'mobile' ? 'translate-y-[-2px]' : '') },
131
- }, ...__VLS_functionalComponentArgsRest(__VLS_9));
132
- // @ts-ignore
133
- [data, data, data, response, response,];
134
- }
135
- else {
136
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
137
- ...{ class: (__VLS_ctx.response == 'mobile' ? 'w-8' : 'w-12') },
138
- });
139
- // @ts-ignore
140
- [response,];
141
- }
142
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
143
- ...{ class: "bg-[#E4E4E4D4] text-chat-haze-600 px-3 py-2 rounded-2xl max-w-xs" },
144
- ...{ class: ({
145
- 'rounded-tl-none': !__VLS_ctx.shouldShowAvatar(index),
146
- 'rounded-bl-none': !__VLS_ctx.isEndMessage(index)
147
- }) },
148
- });
149
- // @ts-ignore
150
- [shouldShowAvatar, isEndMessage,];
151
- if (item.message) {
152
- __VLS_asFunctionalElement(__VLS_elements.div)({
153
- ...{ style: ({ wordBreak: 'break-word' }) },
154
- });
155
- __VLS_asFunctionalDirective(__VLS_directives.vHtml)(null, { ...__VLS_directiveBindingRestFields, value: (item.message) }, null, null);
156
- }
157
- else if (item.attachments.length) {
158
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
159
- __VLS_asFunctionalElement(__VLS_elements.img)({
160
- ...{ onLoad: (() => {
161
- if (index == __VLS_ctx.message.length - 1) {
162
- __VLS_ctx.scrollBottom();
163
- }
164
- }) },
165
- src: (item.attachments[0]?.file_path),
166
- alt: "avatar",
167
- });
168
- // @ts-ignore
169
- [message, scrollBottom,];
170
- }
171
- }
172
- }
173
- else {
174
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
175
- ...{ class: "flex flex-col items-end mt-2" },
176
- ...{ class: ({ 'mt-4': __VLS_ctx.shouldShowAvatar(index) }) },
177
- });
178
- // @ts-ignore
179
- [shouldShowAvatar,];
180
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
181
- ...{ class: "bg-[#D0DFEC] text-[#266699] px-3 py-2 rounded-2xl max-w-xs" },
182
- ...{ class: ({
183
- 'rounded-tr-none': !__VLS_ctx.shouldShowAvatar(index),
184
- 'rounded-br-none': !__VLS_ctx.isEndMessage(index)
185
- }) },
186
- });
187
- // @ts-ignore
188
- [shouldShowAvatar, isEndMessage,];
189
- if (item.message) {
190
- __VLS_asFunctionalElement(__VLS_elements.div)({
191
- ...{ style: ({ wordBreak: 'break-word' }) },
192
- });
193
- __VLS_asFunctionalDirective(__VLS_directives.vHtml)(null, { ...__VLS_directiveBindingRestFields, value: (item.message) }, null, null);
194
- }
195
- else if (item?.attachments?.length) {
196
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
197
- __VLS_asFunctionalElement(__VLS_elements.img)({
198
- ...{ onLoad: (() => {
199
- if (index == __VLS_ctx.message.length - 1) {
200
- __VLS_ctx.scrollBottom();
201
- }
202
- }) },
203
- src: (item.attachments[0]?.file_path),
204
- alt: "avatar",
205
- });
206
- // @ts-ignore
207
- [message, scrollBottom,];
208
- }
209
- if ((index == __VLS_ctx.message.length - 1 && __VLS_ctx.getMessageStateText(item)) || item.state == __VLS_ctx.MessageState.Failed) {
210
- // @ts-ignore
211
- [message, MessageState, getMessageStateText,];
212
- __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
213
- ...{ class: "text-chat-haze-200 text-xs mt-1" },
214
- ...{ class: ({ 'text-danger': item.state == __VLS_ctx.MessageState.Failed }) },
215
- });
216
- // @ts-ignore
217
- [MessageState,];
218
- (__VLS_ctx.getMessageStateText(item));
219
- // @ts-ignore
220
- [getMessageStateText,];
221
- }
222
- }
223
- }
224
- var __VLS_2;
225
- /** @type {__VLS_StyleScopedClasses['relative']} */ ;
226
- /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
227
- /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
228
- /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
229
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
230
- /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
231
- /** @type {__VLS_StyleScopedClasses['overflow-auto']} */ ;
232
- /** @type {__VLS_StyleScopedClasses['chat-padding-page']} */ ;
233
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
234
- /** @type {__VLS_StyleScopedClasses['items-end']} */ ;
235
- /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
236
- /** @type {__VLS_StyleScopedClasses['mt-2']} */ ;
237
- /** @type {__VLS_StyleScopedClasses['mt-4']} */ ;
238
- /** @type {__VLS_StyleScopedClasses['bg-[#E4E4E4D4]']} */ ;
239
- /** @type {__VLS_StyleScopedClasses['text-chat-haze-600']} */ ;
240
- /** @type {__VLS_StyleScopedClasses['px-3']} */ ;
241
- /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
242
- /** @type {__VLS_StyleScopedClasses['rounded-2xl']} */ ;
243
- /** @type {__VLS_StyleScopedClasses['max-w-xs']} */ ;
244
- /** @type {__VLS_StyleScopedClasses['rounded-tl-none']} */ ;
245
- /** @type {__VLS_StyleScopedClasses['rounded-bl-none']} */ ;
246
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
247
- /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
248
- /** @type {__VLS_StyleScopedClasses['items-end']} */ ;
249
- /** @type {__VLS_StyleScopedClasses['mt-2']} */ ;
250
- /** @type {__VLS_StyleScopedClasses['mt-4']} */ ;
251
- /** @type {__VLS_StyleScopedClasses['bg-[#D0DFEC]']} */ ;
252
- /** @type {__VLS_StyleScopedClasses['text-[#266699]']} */ ;
253
- /** @type {__VLS_StyleScopedClasses['px-3']} */ ;
254
- /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
255
- /** @type {__VLS_StyleScopedClasses['rounded-2xl']} */ ;
256
- /** @type {__VLS_StyleScopedClasses['max-w-xs']} */ ;
257
- /** @type {__VLS_StyleScopedClasses['rounded-tr-none']} */ ;
258
- /** @type {__VLS_StyleScopedClasses['rounded-br-none']} */ ;
259
- /** @type {__VLS_StyleScopedClasses['text-chat-haze-200']} */ ;
260
- /** @type {__VLS_StyleScopedClasses['text-xs']} */ ;
261
- /** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
262
- /** @type {__VLS_StyleScopedClasses['text-danger']} */ ;
263
- // @ts-ignore
264
- var __VLS_7 = __VLS_6;
265
- const __VLS_export = (await import('vue')).defineComponent({
266
- setup: () => (__VLS_exposed),
267
- __typeEmits: {},
268
- __typeProps: {},
269
- props: {},
270
- });
271
- export default {};
@@ -1,14 +0,0 @@
1
- import type { IResUser } from '../../../types/message';
2
- import type { PAGE_RESPONSE } from '../../../types/chat/global';
3
- type Props = {
4
- receiverId: any;
5
- response: PAGE_RESPONSE;
6
- };
7
- declare const _default: import("vue").DefineComponent<Props, {
8
- getData: (data?: any) => Promise<void>;
9
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
- call: (value: IResUser) => any;
11
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
12
- onCall?: ((value: IResUser) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
- export default _default;