@phonghq/go-chat 1.0.3 → 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 (296) 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/IconPhone.vue.d.ts +0 -2
  7. package/dist/assets/icons/IconPlan.vue.d.ts +0 -2
  8. package/dist/assets/icons/IconPlus.vue.d.ts +0 -2
  9. package/dist/assets/icons/IconSearch.vue.d.ts +0 -32
  10. package/dist/assets/icons/call/IconMic.vue.d.ts +0 -14
  11. package/dist/assets/icons/call/IconPhone.vue.d.ts +0 -2
  12. package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +0 -2
  13. package/dist/assets/icons/call/IconSpeaker.vue.d.ts +0 -14
  14. package/dist/assets/icons/customer-appointment/IconFilter.vue.d.ts +0 -2
  15. package/dist/assets/icons/customer-detail/IconArrow.vue.d.ts +0 -2
  16. package/dist/assets/icons/customer-detail/IconCheck.vue.d.ts +0 -2
  17. package/dist/assets/icons/customer-detail/IconDate.vue.d.ts +0 -2
  18. package/dist/assets/icons/customer-detail/IconGroup.vue.d.ts +0 -2
  19. package/dist/assets/icons/customer-detail/IconMessage.vue.d.ts +0 -2
  20. package/dist/assets/icons/customer-detail/IconNote.vue.d.ts +0 -2
  21. package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +0 -2
  22. package/dist/assets/icons/customer-detail/IconPin.vue.d.ts +0 -2
  23. package/dist/assets/icons/customer-detail/IconSearch.vue.d.ts +0 -2
  24. package/dist/chat/App.vue.d.ts +0 -5
  25. package/dist/chat/main.d.ts +0 -6
  26. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.d.ts +0 -2
  27. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.d.ts +0 -12
  28. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.d.ts +0 -2
  29. package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +0 -7
  30. package/dist/chat/page/customer-detail/SubInformation.vue.d.ts +0 -16
  31. package/dist/chat/page/error/Error.vue.d.ts +0 -2
  32. package/dist/chat/page/home/ChatList.vue.d.ts +0 -20
  33. package/dist/chat/page/home/ChatMessage.vue.d.ts +0 -16
  34. package/dist/chat/page/home/Home.vue.d.ts +0 -14
  35. package/dist/chat/page/home/HomeHeader.vue.d.ts +0 -10
  36. package/dist/chat/page/home/InputChat.vue.d.ts +0 -19
  37. package/dist/chat/page/home/NewCustomer.vue.d.ts +0 -6
  38. package/dist/components/ListenEvent.vue.d.ts +0 -2
  39. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +0 -22
  40. package/dist/components/chat/call/Calling.vue.d.ts +0 -7
  41. package/dist/components/chat/card/CardCustomerDetail.vue.d.ts +0 -13
  42. package/dist/components/chat/common/collapse/CollapseBase.vue.d.ts +0 -20
  43. package/dist/components/chat/common/input/InputSearch.vue.d.ts +0 -16
  44. package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +0 -35
  45. package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +0 -2
  46. package/dist/components/chat/customer/Avatar.vue.d.ts +0 -11
  47. package/dist/components/chat/layout/mobile/Footer.vue.d.ts +0 -2
  48. package/dist/components/common/CustomLoading.vue.d.ts +0 -2
  49. package/dist/components/common/Notification/NotificationDescription.vue.d.ts +0 -7
  50. package/dist/components/common/button/ButtonBase.vue.d.ts +0 -22
  51. package/dist/components/common/button/ButtonToggle.vue.d.ts +0 -20
  52. package/dist/components/common/checkbox/CCheckboxNumber.vue.d.ts +0 -16
  53. package/dist/components/common/collapse/BaseCollapse.vue.d.ts +0 -12
  54. package/dist/components/common/collapse/BaseCollapseItem.vue.d.ts +0 -4
  55. package/dist/components/common/drawer/DrawerBase.vue.d.ts +0 -39
  56. package/dist/components/common/dropdown/DropdownBase.vue.d.ts +0 -21
  57. package/dist/components/common/input/CInputSearch.vue.d.ts +0 -14
  58. package/dist/components/common/modal/ModalBase.vue.d.ts +0 -35
  59. package/dist/components/common/popover/PopoverBase.vue.d.ts +0 -3
  60. package/dist/components/common/slider/BaseSlider.vue.d.ts +0 -11
  61. package/dist/components/common/spin/CSpin.vue.d.ts +0 -9
  62. package/dist/components/common/tooltip/TooltipBase.vue.d.ts +0 -2
  63. package/dist/components/layout/Blank.vue.d.ts +0 -9
  64. package/dist/components/layout/Default.vue.d.ts +0 -9
  65. package/dist/components/modal/Confirm.vue.d.ts +0 -2
  66. package/dist/components/ui/button/CButton.vue.d.ts +0 -19
  67. package/dist/components/ui/button/c-button.d.ts +0 -7
  68. package/dist/components/ui/checkbox/Checkbox.vue.d.ts +0 -18
  69. package/dist/components/ui/checkbox/index.d.ts +0 -1
  70. package/dist/components/ui/collapsible/Collapsible.vue.d.ts +0 -16
  71. package/dist/components/ui/collapsible/CollapsibleContent.vue.d.ts +0 -10
  72. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +0 -10
  73. package/dist/components/ui/collapsible/index.d.ts +0 -3
  74. package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -14
  75. package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -10
  76. package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -29
  77. package/dist/components/ui/dialog/DialogDescription.vue.d.ts +0 -14
  78. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -13
  79. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -13
  80. package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +0 -30
  81. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -14
  82. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -10
  83. package/dist/components/ui/dialog/index.d.ts +0 -9
  84. package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -26
  85. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -33
  86. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -14
  87. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -13
  88. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -13
  89. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -7
  90. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -14
  91. package/dist/components/ui/drawer/index.d.ts +0 -8
  92. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +0 -14
  93. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +0 -20
  94. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +0 -28
  95. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +0 -10
  96. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +0 -15
  97. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +0 -15
  98. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +0 -14
  99. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +0 -18
  100. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +0 -7
  101. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +0 -13
  102. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +0 -14
  103. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +0 -30
  104. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +0 -14
  105. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +0 -10
  106. package/dist/components/ui/dropdown-menu/index.d.ts +0 -15
  107. package/dist/components/ui/popover/Popover.vue.d.ts +0 -14
  108. package/dist/components/ui/popover/PopoverContent.vue.d.ts +0 -28
  109. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +0 -10
  110. package/dist/components/ui/popover/index.d.ts +0 -3
  111. package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +0 -18
  112. package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +0 -7
  113. package/dist/components/ui/radio-group/index.d.ts +0 -2
  114. package/dist/components/ui/slider/Slider.vue.d.ts +0 -13
  115. package/dist/components/ui/slider/index.d.ts +0 -1
  116. package/dist/components/ui/switch/Switch.vue.d.ts +0 -18
  117. package/dist/components/ui/switch/index.d.ts +0 -1
  118. package/dist/composable/useCallHelper.d.ts +0 -23
  119. package/dist/composable/useInitData.d.ts +0 -11
  120. package/dist/composable/useModalConfirm.d.ts +0 -5
  121. package/dist/constant/color.d.ts +0 -22
  122. package/dist/constant/datetime.d.ts +0 -5
  123. package/dist/constant/general.d.ts +0 -8
  124. package/dist/constant/message.d.ts +0 -8
  125. package/dist/constant/mqtt.d.ts +0 -4
  126. package/dist/constant/user.d.ts +0 -8
  127. package/dist/lib/utils.d.ts +0 -2
  128. package/dist/plugins/axios-gci.d.ts +0 -3
  129. package/dist/plugins/axios.d.ts +0 -3
  130. package/dist/plugins/mqtt.d.ts +0 -10
  131. package/dist/plugins/sdk.d.ts +0 -19
  132. package/dist/plugins/websocket.d.ts +0 -4
  133. package/dist/test/assets/icons/IconArrowLeft.vue.js +0 -29
  134. package/dist/test/assets/icons/IconPhone.vue.js +0 -19
  135. package/dist/test/assets/icons/IconPlan.vue.js +0 -19
  136. package/dist/test/assets/icons/IconPlus.vue.js +0 -22
  137. package/dist/test/assets/icons/IconSearch.vue.js +0 -68
  138. package/dist/test/assets/icons/call/IconMic.vue.js +0 -123
  139. package/dist/test/assets/icons/call/IconPhone.vue.js +0 -35
  140. package/dist/test/assets/icons/call/IconPhoneCancel.vue.js +0 -35
  141. package/dist/test/assets/icons/call/IconSpeaker.vue.js +0 -62
  142. package/dist/test/assets/icons/customer-appointment/IconFilter.vue.js +0 -53
  143. package/dist/test/assets/icons/customer-detail/IconArrow.vue.js +0 -22
  144. package/dist/test/assets/icons/customer-detail/IconCheck.vue.js +0 -27
  145. package/dist/test/assets/icons/customer-detail/IconDate.vue.js +0 -43
  146. package/dist/test/assets/icons/customer-detail/IconGroup.vue.js +0 -48
  147. package/dist/test/assets/icons/customer-detail/IconMessage.vue.js +0 -28
  148. package/dist/test/assets/icons/customer-detail/IconNote.vue.js +0 -29
  149. package/dist/test/assets/icons/customer-detail/IconPhone.vue.js +0 -21
  150. package/dist/test/assets/icons/customer-detail/IconPin.vue.js +0 -29
  151. package/dist/test/assets/icons/customer-detail/IconSearch.vue.js +0 -29
  152. package/dist/test/chat/App.vue.js +0 -502
  153. package/dist/test/chat/main.js +0 -6
  154. package/dist/test/chat/page/customer-appointment/CustomerAppointment.vue.js +0 -207
  155. package/dist/test/chat/page/customer-check-in/CollapseCheckIn.vue.js +0 -80
  156. package/dist/test/chat/page/customer-check-in/CustomerCheckIn.vue.js +0 -136
  157. package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +0 -235
  158. package/dist/test/chat/page/customer-detail/SubInformation.vue.js +0 -102
  159. package/dist/test/chat/page/error/Error.vue.js +0 -64
  160. package/dist/test/chat/page/home/ChatList.vue.js +0 -380
  161. package/dist/test/chat/page/home/ChatMessage.vue.js +0 -271
  162. package/dist/test/chat/page/home/Home.vue.js +0 -327
  163. package/dist/test/chat/page/home/HomeHeader.vue.js +0 -122
  164. package/dist/test/chat/page/home/InputChat.vue.js +0 -226
  165. package/dist/test/chat/page/home/NewCustomer.vue.js +0 -82
  166. package/dist/test/components/ListenEvent.vue.js +0 -45
  167. package/dist/test/components/chat/ScrollEvent/ScrollEvent.vue.js +0 -197
  168. package/dist/test/components/chat/call/Calling.vue.js +0 -291
  169. package/dist/test/components/chat/card/CardCustomerDetail.vue.js +0 -28
  170. package/dist/test/components/chat/common/collapse/CollapseBase.vue.js +0 -59
  171. package/dist/test/components/chat/common/input/InputSearch.vue.js +0 -71
  172. package/dist/test/components/chat/common/popover/PopoverBase.vue.js +0 -148
  173. package/dist/test/components/chat/common/spin/BaseSpin.vue.js +0 -12
  174. package/dist/test/components/chat/customer/Avatar.vue.js +0 -79
  175. package/dist/test/components/chat/layout/mobile/Footer.vue.js +0 -109
  176. package/dist/test/components/common/CustomLoading.vue.js +0 -19
  177. package/dist/test/components/common/Notification/NotificationDescription.vue.js +0 -38
  178. package/dist/test/components/common/button/ButtonBase.vue.js +0 -78
  179. package/dist/test/components/common/button/ButtonToggle.vue.js +0 -70
  180. package/dist/test/components/common/checkbox/CCheckboxNumber.vue.js +0 -48
  181. package/dist/test/components/common/collapse/BaseCollapse.vue.js +0 -36
  182. package/dist/test/components/common/collapse/BaseCollapseItem.vue.js +0 -22
  183. package/dist/test/components/common/drawer/DrawerBase.vue.js +0 -126
  184. package/dist/test/components/common/dropdown/DropdownBase.vue.js +0 -91
  185. package/dist/test/components/common/input/CInputSearch.vue.js +0 -62
  186. package/dist/test/components/common/modal/ModalBase.vue.js +0 -164
  187. package/dist/test/components/common/popover/PopoverBase.vue.js +0 -36
  188. package/dist/test/components/common/slider/BaseSlider.vue.js +0 -70
  189. package/dist/test/components/common/spin/CSpin.vue.js +0 -41
  190. package/dist/test/components/common/tooltip/TooltipBase.vue.js +0 -8
  191. package/dist/test/components/layout/Blank.vue.js +0 -19
  192. package/dist/test/components/layout/Default.vue.js +0 -21
  193. package/dist/test/components/modal/Confirm.vue.js +0 -164
  194. package/dist/test/components/ui/button/CButton.vue.js +0 -49
  195. package/dist/test/components/ui/button/c-button.js +0 -26
  196. package/dist/test/components/ui/checkbox/Checkbox.vue.js +0 -79
  197. package/dist/test/components/ui/checkbox/index.js +0 -1
  198. package/dist/test/components/ui/collapsible/Collapsible.vue.js +0 -47
  199. package/dist/test/components/ui/collapsible/CollapsibleContent.vue.js +0 -41
  200. package/dist/test/components/ui/collapsible/CollapsibleTrigger.vue.js +0 -35
  201. package/dist/test/components/ui/collapsible/index.js +0 -3
  202. package/dist/test/components/ui/dialog/Dialog.vue.js +0 -42
  203. package/dist/test/components/ui/dialog/DialogClose.vue.js +0 -35
  204. package/dist/test/components/ui/dialog/DialogContent.vue.js +0 -84
  205. package/dist/test/components/ui/dialog/DialogDescription.vue.js +0 -43
  206. package/dist/test/components/ui/dialog/DialogFooter.vue.js +0 -26
  207. package/dist/test/components/ui/dialog/DialogHeader.vue.js +0 -26
  208. package/dist/test/components/ui/dialog/DialogScrollContent.vue.js +0 -99
  209. package/dist/test/components/ui/dialog/DialogTitle.vue.js +0 -43
  210. package/dist/test/components/ui/dialog/DialogTrigger.vue.js +0 -35
  211. package/dist/test/components/ui/dialog/index.js +0 -9
  212. package/dist/test/components/ui/drawer/Drawer.vue.js +0 -48
  213. package/dist/test/components/ui/drawer/DrawerContent.vue.js +0 -81
  214. package/dist/test/components/ui/drawer/DrawerDescription.vue.js +0 -42
  215. package/dist/test/components/ui/drawer/DrawerFooter.vue.js +0 -26
  216. package/dist/test/components/ui/drawer/DrawerHeader.vue.js +0 -26
  217. package/dist/test/components/ui/drawer/DrawerOverlay.vue.js +0 -37
  218. package/dist/test/components/ui/drawer/DrawerTitle.vue.js +0 -42
  219. package/dist/test/components/ui/drawer/index.js +0 -8
  220. package/dist/test/components/ui/dropdown-menu/DropdownMenu.vue.js +0 -41
  221. package/dist/test/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +0 -79
  222. package/dist/test/components/ui/dropdown-menu/DropdownMenuContent.vue.js +0 -61
  223. package/dist/test/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +0 -35
  224. package/dist/test/components/ui/dropdown-menu/DropdownMenuItem.vue.js +0 -43
  225. package/dist/test/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +0 -43
  226. package/dist/test/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +0 -41
  227. package/dist/test/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +0 -80
  228. package/dist/test/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +0 -37
  229. package/dist/test/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +0 -26
  230. package/dist/test/components/ui/dropdown-menu/DropdownMenuSub.vue.js +0 -41
  231. package/dist/test/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +0 -46
  232. package/dist/test/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +0 -58
  233. package/dist/test/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +0 -41
  234. package/dist/test/components/ui/dropdown-menu/index.js +0 -15
  235. package/dist/test/components/ui/popover/Popover.vue.js +0 -41
  236. package/dist/test/components/ui/popover/PopoverContent.vue.js +0 -60
  237. package/dist/test/components/ui/popover/PopoverTrigger.vue.js +0 -35
  238. package/dist/test/components/ui/popover/index.js +0 -3
  239. package/dist/test/components/ui/radio-group/RadioGroup.vue.js +0 -46
  240. package/dist/test/components/ui/radio-group/RadioGroupItem.vue.js +0 -71
  241. package/dist/test/components/ui/radio-group/index.js +0 -2
  242. package/dist/test/components/ui/slider/Slider.vue.js +0 -155
  243. package/dist/test/components/ui/slider/index.js +0 -1
  244. package/dist/test/components/ui/switch/Switch.vue.js +0 -61
  245. package/dist/test/components/ui/switch/index.js +0 -1
  246. package/dist/test/composable/useCallHelper.js +0 -170
  247. package/dist/test/composable/useInitData.js +0 -84
  248. package/dist/test/composable/useModalConfirm.js +0 -39
  249. package/dist/test/constant/color.js +0 -43
  250. package/dist/test/constant/datetime.js +0 -5
  251. package/dist/test/constant/general.js +0 -9
  252. package/dist/test/constant/message.js +0 -8
  253. package/dist/test/constant/mqtt.js +0 -11
  254. package/dist/test/constant/user.js +0 -9
  255. package/dist/test/lib/utils.js +0 -5
  256. package/dist/test/plugins/axios-gci.js +0 -25
  257. package/dist/test/plugins/axios.js +0 -85
  258. package/dist/test/plugins/mqtt.js +0 -128
  259. package/dist/test/plugins/sdk.js +0 -83
  260. package/dist/test/plugins/websocket.js +0 -65
  261. package/dist/test/types/call.js +0 -1
  262. package/dist/test/types/chat/auth.js +0 -1
  263. package/dist/test/types/chat/global.js +0 -1
  264. package/dist/test/types/chat/promise.js +0 -1
  265. package/dist/test/types/chat/user.js +0 -1
  266. package/dist/test/types/conversation.js +0 -1
  267. package/dist/test/types/global.js +0 -15
  268. package/dist/test/types/message.js +0 -1
  269. package/dist/test/utils/chat/auth.js +0 -51
  270. package/dist/test/utils/chat/call.js +0 -61
  271. package/dist/test/utils/chat/chat-router.js +0 -9
  272. package/dist/test/utils/chat/conversation.js +0 -7
  273. package/dist/test/utils/chat/message.js +0 -42
  274. package/dist/test/utils/chat/user.js +0 -33
  275. package/dist/test/utils/debounce.js +0 -9
  276. package/dist/test/utils/json.js +0 -18
  277. package/dist/test/utils/logger.js +0 -5
  278. package/dist/test/utils/string-helper.js +0 -27
  279. package/dist/types/call.d.ts +0 -4
  280. package/dist/types/chat/auth.d.ts +0 -37
  281. package/dist/types/chat/global.d.ts +0 -7
  282. package/dist/types/chat/promise.d.ts +0 -17
  283. package/dist/types/chat/user.d.ts +0 -88
  284. package/dist/types/conversation.d.ts +0 -18
  285. package/dist/types/global.d.ts +0 -11
  286. package/dist/types/message.d.ts +0 -43
  287. package/dist/utils/chat/auth.d.ts +0 -45
  288. package/dist/utils/chat/call.d.ts +0 -5
  289. package/dist/utils/chat/chat-router.d.ts +0 -3
  290. package/dist/utils/chat/conversation.d.ts +0 -3
  291. package/dist/utils/chat/message.d.ts +0 -17
  292. package/dist/utils/chat/user.d.ts +0 -193
  293. package/dist/utils/debounce.d.ts +0 -1
  294. package/dist/utils/json.d.ts +0 -2
  295. package/dist/utils/logger.d.ts +0 -3
  296. package/dist/utils/string-helper.d.ts +0 -1
@@ -1,122 +0,0 @@
1
- import IconPhone from '../../../assets/icons/IconPhone.vue';
2
- import { PAGE } from '../../../constant/general';
3
- import Avatar from '../../../components/chat/customer/Avatar.vue';
4
- import { routerPush } from '../../../utils/chat/chat-router';
5
- import { user } from '../../../utils/chat/user';
6
- import { dataProfile } from '../../../utils/chat/auth';
7
- const props = withDefaults(defineProps(), {});
8
- const emit = defineEmits();
9
- const goToViewUser = () => {
10
- if (dataProfile.value?.user_type == 'tenant') {
11
- user.value = props.data;
12
- routerPush(PAGE.CUSTOMER_DETAIL);
13
- }
14
- };
15
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
16
- const __VLS_defaults = {};
17
- const __VLS_ctx = {
18
- ...{},
19
- ...{},
20
- ...{},
21
- ...{},
22
- ...{},
23
- };
24
- let __VLS_elements;
25
- let __VLS_components;
26
- let __VLS_directives;
27
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
28
- ...{ class: "px-8 pb-4 border-b border-chat-gray-5" },
29
- });
30
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
31
- ...{ class: "flex items-center" },
32
- });
33
- /** @type {[typeof Avatar, ]} */ ;
34
- // @ts-ignore
35
- const __VLS_0 = __VLS_asFunctionalComponent(Avatar, new Avatar({
36
- ...{ 'onClick': {} },
37
- ...{ class: ({ 'cursor-pointer': __VLS_ctx.dataProfile?.user_type == 'tenant' }) },
38
- src: (__VLS_ctx.data?.avatar ?? ''),
39
- color: (__VLS_ctx.data?.color),
40
- name: (__VLS_ctx.data?.username),
41
- }));
42
- const __VLS_1 = __VLS_0({
43
- ...{ 'onClick': {} },
44
- ...{ class: ({ 'cursor-pointer': __VLS_ctx.dataProfile?.user_type == 'tenant' }) },
45
- src: (__VLS_ctx.data?.avatar ?? ''),
46
- color: (__VLS_ctx.data?.color),
47
- name: (__VLS_ctx.data?.username),
48
- }, ...__VLS_functionalComponentArgsRest(__VLS_0));
49
- let __VLS_3;
50
- let __VLS_4;
51
- const __VLS_5 = ({ click: {} },
52
- { onClick: (__VLS_ctx.goToViewUser) });
53
- // @ts-ignore
54
- [dataProfile, data, data, data, goToViewUser,];
55
- var __VLS_2;
56
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
57
- ...{ class: "flex-1 ml-3" },
58
- });
59
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
60
- ...{ class: "flex justify-between items-center" },
61
- });
62
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
63
- ...{ onClick: (__VLS_ctx.goToViewUser) },
64
- ...{ class: ({ 'cursor-pointer': __VLS_ctx.dataProfile?.user_type == 'tenant' }) },
65
- });
66
- // @ts-ignore
67
- [dataProfile, goToViewUser,];
68
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
69
- ...{ class: "flex items-center" },
70
- });
71
- __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
72
- ...{ class: "font-semibold" },
73
- });
74
- (__VLS_ctx.data?.username ?? 'n/a');
75
- // @ts-ignore
76
- [data,];
77
- __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
78
- ...{ class: "text-sm text-chat-gray-3 truncate" },
79
- });
80
- __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
81
- ...{ onClick: (...[$event]) => {
82
- __VLS_ctx.emit('call');
83
- // @ts-ignore
84
- [emit,];
85
- } },
86
- ...{ class: "flex-center text-[#0051E6] bg-chat-haze-200 w-9 h-9 rounded-lg" },
87
- });
88
- /** @type {[typeof IconPhone, ]} */ ;
89
- // @ts-ignore
90
- const __VLS_7 = __VLS_asFunctionalComponent(IconPhone, new IconPhone({}));
91
- const __VLS_8 = __VLS_7({}, ...__VLS_functionalComponentArgsRest(__VLS_7));
92
- /** @type {__VLS_StyleScopedClasses['px-8']} */ ;
93
- /** @type {__VLS_StyleScopedClasses['pb-4']} */ ;
94
- /** @type {__VLS_StyleScopedClasses['border-b']} */ ;
95
- /** @type {__VLS_StyleScopedClasses['border-chat-gray-5']} */ ;
96
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
97
- /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
98
- /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
99
- /** @type {__VLS_StyleScopedClasses['flex-1']} */ ;
100
- /** @type {__VLS_StyleScopedClasses['ml-3']} */ ;
101
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
102
- /** @type {__VLS_StyleScopedClasses['justify-between']} */ ;
103
- /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
104
- /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
105
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
106
- /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
107
- /** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
108
- /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
109
- /** @type {__VLS_StyleScopedClasses['text-chat-gray-3']} */ ;
110
- /** @type {__VLS_StyleScopedClasses['truncate']} */ ;
111
- /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
112
- /** @type {__VLS_StyleScopedClasses['text-[#0051E6]']} */ ;
113
- /** @type {__VLS_StyleScopedClasses['bg-chat-haze-200']} */ ;
114
- /** @type {__VLS_StyleScopedClasses['w-9']} */ ;
115
- /** @type {__VLS_StyleScopedClasses['h-9']} */ ;
116
- /** @type {__VLS_StyleScopedClasses['rounded-lg']} */ ;
117
- const __VLS_export = (await import('vue')).defineComponent({
118
- __typeEmits: {},
119
- __typeProps: {},
120
- props: {},
121
- });
122
- export default {};
@@ -1,226 +0,0 @@
1
- import IconPlus from '../../../assets/icons/IconPlus.vue';
2
- import IconPlan from '../../../assets/icons/IconPlan.vue';
3
- import EmojiPicker from 'vue3-emoji-picker';
4
- import 'vue3-emoji-picker/css';
5
- import dayjs from 'dayjs';
6
- import { DATE_FORMATS } from '../../../constant/datetime';
7
- import { dataProfile } from '../../../utils/chat/auth';
8
- import { ref } from 'vue';
9
- import PopoverBase from '../../../components/chat/common/popover/PopoverBase.vue';
10
- const props = withDefaults(defineProps(), {});
11
- const emit = defineEmits();
12
- const keyword = defineModel();
13
- let chatId = 1;
14
- const refInputImage = ref(null);
15
- const isLoadingImage = ref([]);
16
- const chatInputRef = ref(null);
17
- const emojiOpen = ref(false);
18
- const handleSendMessage = async (type) => {
19
- const tempId = Date.now();
20
- let messageContent = '';
21
- let attachments = [];
22
- if (type == 'message') {
23
- if (!keyword.value)
24
- return;
25
- messageContent = keyword.value;
26
- keyword.value = '';
27
- }
28
- else if (type == 'file') {
29
- const file = uploadImage();
30
- if (!file)
31
- return;
32
- const file_path = URL.createObjectURL(file);
33
- attachments = [{ file_name: String(tempId), file_path, file_local: file }];
34
- }
35
- keyword.value = '';
36
- chatId++;
37
- const id = props.data?.id.toString() + '-' + chatId;
38
- const data = {
39
- conversation_id: 135,
40
- created_at: dayjs().format(DATE_FORMATS['DATE_FORMAT_FULL']),
41
- id,
42
- message: messageContent,
43
- receiver_id: props.data?.id || 0,
44
- sender_id: dataProfile.value?.id,
45
- status: 'read',
46
- attachments: attachments
47
- };
48
- emit('sendMessage', data);
49
- };
50
- const uploadImage = () => {
51
- if (!refInputImage.value ||
52
- !refInputImage.value.files ||
53
- refInputImage.value.files.length === 0) {
54
- return null;
55
- }
56
- return refInputImage.value.files[0];
57
- };
58
- const handleFileUpload = () => {
59
- handleSendMessage('file');
60
- };
61
- const onSelectEmoji = (value) => {
62
- keyword.value = (keyword.value ?? '') + (value?.i?.replace('undefined', '') ?? '');
63
- emojiOpen.value = false;
64
- chatInputRef.value?.focus?.();
65
- };
66
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
67
- const __VLS_modelEmit = defineEmits();
68
- const __VLS_defaults = {};
69
- const __VLS_ctx = {
70
- ...{},
71
- ...{},
72
- ...{},
73
- ...{},
74
- ...{},
75
- };
76
- let __VLS_elements;
77
- let __VLS_components;
78
- let __VLS_directives;
79
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
80
- ...{ class: "flex gap-2" },
81
- });
82
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
83
- ...{ class: "w-full relative grow" },
84
- });
85
- __VLS_asFunctionalElement(__VLS_elements.input)({
86
- ...{ onKeydown: (...[$event]) => {
87
- __VLS_ctx.handleSendMessage('message');
88
- // @ts-ignore
89
- [handleSendMessage,];
90
- } },
91
- ...{ class: "w-full chat-input h-11 px-4 border border-chat-haze-200" },
92
- ref: "chatInputRef",
93
- placeholder: "Send Message",
94
- });
95
- (__VLS_ctx.keyword);
96
- /** @type {typeof __VLS_ctx.chatInputRef} */ ;
97
- // @ts-ignore
98
- [keyword, chatInputRef,];
99
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
100
- ...{ class: "flex gap-2 absolute right-0 bottom-0" },
101
- });
102
- /** @type {[typeof PopoverBase, typeof PopoverBase, ]} */ ;
103
- // @ts-ignore
104
- const __VLS_0 = __VLS_asFunctionalComponent(PopoverBase, new PopoverBase({
105
- open: (__VLS_ctx.emojiOpen),
106
- align: "end",
107
- side: "top",
108
- }));
109
- const __VLS_1 = __VLS_0({
110
- open: (__VLS_ctx.emojiOpen),
111
- align: "end",
112
- side: "top",
113
- }, ...__VLS_functionalComponentArgsRest(__VLS_0));
114
- const { default: __VLS_3 } = __VLS_2.slots;
115
- // @ts-ignore
116
- [emojiOpen,];
117
- __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
118
- ...{ onClick: (...[$event]) => {
119
- __VLS_ctx.emojiOpen = !__VLS_ctx.emojiOpen;
120
- // @ts-ignore
121
- [emojiOpen, emojiOpen,];
122
- } },
123
- ...{ class: "" },
124
- });
125
- {
126
- const { content: __VLS_4 } = __VLS_2.slots;
127
- const __VLS_5 = {}.EmojiPicker;
128
- /** @type {[typeof __VLS_components.EmojiPicker, typeof __VLS_components.emojiPicker, ]} */ ;
129
- // @ts-ignore
130
- EmojiPicker;
131
- // @ts-ignore
132
- const __VLS_6 = __VLS_asFunctionalComponent(__VLS_5, new __VLS_5({
133
- ...{ 'onSelect': {} },
134
- ...{ class: "!w-[300px]" },
135
- native: (true),
136
- offset: (2),
137
- hideSearch: true,
138
- }));
139
- const __VLS_7 = __VLS_6({
140
- ...{ 'onSelect': {} },
141
- ...{ class: "!w-[300px]" },
142
- native: (true),
143
- offset: (2),
144
- hideSearch: true,
145
- }, ...__VLS_functionalComponentArgsRest(__VLS_6));
146
- let __VLS_9;
147
- let __VLS_10;
148
- const __VLS_11 = ({ select: {} },
149
- { onSelect: (__VLS_ctx.onSelectEmoji) });
150
- // @ts-ignore
151
- [onSelectEmoji,];
152
- var __VLS_8;
153
- }
154
- var __VLS_2;
155
- __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
156
- ...{ onClick: (...[$event]) => {
157
- __VLS_ctx.handleSendMessage('message');
158
- // @ts-ignore
159
- [handleSendMessage,];
160
- } },
161
- ...{ class: "h-11 w-10" },
162
- });
163
- /** @type {[typeof IconPlan, ]} */ ;
164
- // @ts-ignore
165
- const __VLS_13 = __VLS_asFunctionalComponent(IconPlan, new IconPlan({}));
166
- const __VLS_14 = __VLS_13({}, ...__VLS_functionalComponentArgsRest(__VLS_13));
167
- __VLS_asFunctionalElement(__VLS_elements.label, __VLS_elements.label)({
168
- ...{ class: "shrink-0 cursor-pointer relative" },
169
- });
170
- __VLS_asFunctionalElement(__VLS_elements.input)({
171
- ...{ onChange: (__VLS_ctx.handleFileUpload) },
172
- type: "file",
173
- ...{ class: "hidden" },
174
- ref: "refInputImage",
175
- accept: ".png, .jpeg, .jpg",
176
- });
177
- /** @type {typeof __VLS_ctx.refInputImage} */ ;
178
- // @ts-ignore
179
- [handleFileUpload, refInputImage,];
180
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
181
- ...{ class: "h-11 w-11 rounded-full flex-center bg-[#002E6B]" },
182
- });
183
- /** @type {[typeof IconPlus, ]} */ ;
184
- // @ts-ignore
185
- const __VLS_17 = __VLS_asFunctionalComponent(IconPlus, new IconPlus({
186
- ...{ class: "text-white" },
187
- }));
188
- const __VLS_18 = __VLS_17({
189
- ...{ class: "text-white" },
190
- }, ...__VLS_functionalComponentArgsRest(__VLS_17));
191
- /** @type {__VLS_StyleScopedClasses['']} */ ;
192
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
193
- /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
194
- /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
195
- /** @type {__VLS_StyleScopedClasses['relative']} */ ;
196
- /** @type {__VLS_StyleScopedClasses['grow']} */ ;
197
- /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
198
- /** @type {__VLS_StyleScopedClasses['chat-input']} */ ;
199
- /** @type {__VLS_StyleScopedClasses['h-11']} */ ;
200
- /** @type {__VLS_StyleScopedClasses['px-4']} */ ;
201
- /** @type {__VLS_StyleScopedClasses['border']} */ ;
202
- /** @type {__VLS_StyleScopedClasses['border-chat-haze-200']} */ ;
203
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
204
- /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
205
- /** @type {__VLS_StyleScopedClasses['absolute']} */ ;
206
- /** @type {__VLS_StyleScopedClasses['right-0']} */ ;
207
- /** @type {__VLS_StyleScopedClasses['bottom-0']} */ ;
208
- /** @type {__VLS_StyleScopedClasses['!w-[300px]']} */ ;
209
- /** @type {__VLS_StyleScopedClasses['h-11']} */ ;
210
- /** @type {__VLS_StyleScopedClasses['w-10']} */ ;
211
- /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
212
- /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
213
- /** @type {__VLS_StyleScopedClasses['relative']} */ ;
214
- /** @type {__VLS_StyleScopedClasses['hidden']} */ ;
215
- /** @type {__VLS_StyleScopedClasses['h-11']} */ ;
216
- /** @type {__VLS_StyleScopedClasses['w-11']} */ ;
217
- /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
218
- /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
219
- /** @type {__VLS_StyleScopedClasses['bg-[#002E6B]']} */ ;
220
- /** @type {__VLS_StyleScopedClasses['text-white']} */ ;
221
- const __VLS_export = (await import('vue')).defineComponent({
222
- __typeEmits: {},
223
- __typeProps: {},
224
- props: {},
225
- });
226
- export default {};
@@ -1,82 +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
- const props = withDefaults(defineProps(), {});
4
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
5
- const __VLS_defaults = {};
6
- const __VLS_ctx = {
7
- ...{},
8
- ...{},
9
- ...{},
10
- ...{},
11
- };
12
- let __VLS_elements;
13
- let __VLS_components;
14
- let __VLS_directives;
15
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
16
- ...{ class: "flex flex-col items-center justify-center text-center" },
17
- });
18
- /** @type {[typeof Avatar, ]} */ ;
19
- // @ts-ignore
20
- const __VLS_0 = __VLS_asFunctionalComponent(Avatar, new Avatar({
21
- ...{ class: "mb-4" },
22
- src: (__VLS_ctx.data?.avatar ?? ''),
23
- color: (__VLS_ctx.data?.color),
24
- name: (__VLS_ctx.data?.username),
25
- size: "xxl",
26
- }));
27
- const __VLS_1 = __VLS_0({
28
- ...{ class: "mb-4" },
29
- src: (__VLS_ctx.data?.avatar ?? ''),
30
- color: (__VLS_ctx.data?.color),
31
- name: (__VLS_ctx.data?.username),
32
- size: "xxl",
33
- }, ...__VLS_functionalComponentArgsRest(__VLS_0));
34
- // @ts-ignore
35
- [data, data, data,];
36
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
37
- ...{ class: "flex items-center gap-1" },
38
- });
39
- __VLS_asFunctionalElement(__VLS_elements.h2, __VLS_elements.h2)({
40
- ...{ class: "text-2xl font-semibold" },
41
- });
42
- (__VLS_ctx.data?.username ?? 'n/a');
43
- // @ts-ignore
44
- [data,];
45
- __VLS_asFunctionalElement(__VLS_elements.img)({
46
- src: "../../../assets/images/icons/new-customer.png",
47
- });
48
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
49
- ...{ class: "text-chat-haze-400 text-sm mt-1 flex items-center gap-1" },
50
- });
51
- __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({});
52
- __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({});
53
- __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({});
54
- __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
55
- ...{ class: "text-chat-haze-400 text-sm mt-3 max-w-md" },
56
- });
57
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
58
- /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
59
- /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
60
- /** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
61
- /** @type {__VLS_StyleScopedClasses['text-center']} */ ;
62
- /** @type {__VLS_StyleScopedClasses['mb-4']} */ ;
63
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
64
- /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
65
- /** @type {__VLS_StyleScopedClasses['gap-1']} */ ;
66
- /** @type {__VLS_StyleScopedClasses['text-2xl']} */ ;
67
- /** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
68
- /** @type {__VLS_StyleScopedClasses['text-chat-haze-400']} */ ;
69
- /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
70
- /** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
71
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
72
- /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
73
- /** @type {__VLS_StyleScopedClasses['gap-1']} */ ;
74
- /** @type {__VLS_StyleScopedClasses['text-chat-haze-400']} */ ;
75
- /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
76
- /** @type {__VLS_StyleScopedClasses['mt-3']} */ ;
77
- /** @type {__VLS_StyleScopedClasses['max-w-md']} */ ;
78
- const __VLS_export = (await import('vue')).defineComponent({
79
- __typeProps: {},
80
- props: {},
81
- });
82
- export default {};
@@ -1,45 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat/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,197 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import { ref } from 'vue';
3
- import { useDebounce } from '../../../utils/debounce';
4
- const props = withDefaults(defineProps(), {});
5
- const emit = defineEmits();
6
- const scrollEvent = ref(null);
7
- const loading = ref(false);
8
- const loadingTop = ref(false);
9
- let isOnBottom = false;
10
- let isOnTop = false;
11
- let TouchPositionPast = 0;
12
- let scrollTopPast = 0;
13
- let scrollTopCurrent = 0;
14
- let oldScrollHeight = 0;
15
- const handleTouchEnd = () => {
16
- if (loading.value && props.bottom)
17
- emit('getDataBottom');
18
- if (loadingTop.value && props.top) {
19
- oldScrollHeight = scrollEvent.value?.scrollHeight ?? 0;
20
- console.log(oldScrollHeight);
21
- emit('getDataTop');
22
- }
23
- };
24
- const scrollCheckHeight = 20;
25
- const handleTouchMoveDebounce = useDebounce((event, el) => {
26
- handleTouchMove(event, el);
27
- }, 10);
28
- const handleTouchMove = async (event, el) => {
29
- scrollTopCurrent = el.scrollTop;
30
- if (el && el.scrollHeight <= el.clientHeight) {
31
- let position = event.touches[0].clientY;
32
- if (position > TouchPositionPast) {
33
- loadingTop.value = true;
34
- }
35
- else {
36
- loadingTop.value = false;
37
- }
38
- return;
39
- }
40
- if (el && el.scrollHeight <= el.clientHeight) {
41
- let position = event.touches[0].clientY;
42
- if (position < TouchPositionPast) {
43
- loading.value = true;
44
- }
45
- else {
46
- loading.value = false;
47
- }
48
- return;
49
- }
50
- if (isOnTop) {
51
- let position = event.touches[0].clientY;
52
- if (position > TouchPositionPast) {
53
- loadingTop.value = true;
54
- }
55
- else {
56
- loadingTop.value = false;
57
- }
58
- return;
59
- }
60
- if (isOnBottom) {
61
- let position = event.touches[0].clientY;
62
- if (position < TouchPositionPast) {
63
- loading.value = true;
64
- }
65
- else {
66
- loading.value = false;
67
- }
68
- return;
69
- }
70
- const distancePast = el.scrollHeight - scrollTopPast - el.clientHeight;
71
- const distanceCurrent = el.scrollHeight - scrollTopCurrent - el.clientHeight;
72
- if (distancePast > scrollCheckHeight && distanceCurrent <= scrollCheckHeight) {
73
- loading.value = true;
74
- }
75
- else if (distanceCurrent > scrollCheckHeight) {
76
- loading.value = false;
77
- }
78
- if (scrollTopPast > scrollCheckHeight && scrollTopCurrent <= scrollCheckHeight) {
79
- loadingTop.value = true;
80
- }
81
- else if (scrollTopCurrent > scrollCheckHeight) {
82
- loadingTop.value = false;
83
- }
84
- scrollTopPast = scrollTopCurrent;
85
- };
86
- const handleTouchStart = async (event, el) => {
87
- TouchPositionPast = event.touches[0].clientY;
88
- if (!el) {
89
- isOnBottom = false;
90
- isOnTop = false;
91
- return;
92
- }
93
- if (el && el.scrollTop < scrollCheckHeight)
94
- isOnTop = true;
95
- else
96
- isOnTop = false;
97
- const distanceFromBottom = el.scrollHeight - el.scrollTop - el.clientHeight;
98
- if (distanceFromBottom < scrollCheckHeight) {
99
- isOnBottom = true;
100
- }
101
- else {
102
- isOnBottom = false;
103
- }
104
- };
105
- const hideLoading = () => {
106
- loading.value = false;
107
- loadingTop.value = false;
108
- };
109
- const handleScroll = (event, el) => {
110
- const scrollTop = el.scrollTop;
111
- const scrollHeight = el.scrollHeight;
112
- const clientHeight = el.clientHeight;
113
- if (scrollTop <= scrollCheckHeight && !loadingTop.value) {
114
- loadingTop.value = true;
115
- if (props.top) {
116
- emit('getDataTop');
117
- oldScrollHeight = scrollHeight;
118
- }
119
- }
120
- else if (loadingTop.value) {
121
- loadingTop.value = false;
122
- }
123
- if (scrollTop + clientHeight >= scrollHeight - scrollCheckHeight) {
124
- if (props.bottom)
125
- emit('getDataBottom');
126
- loading.value = true;
127
- }
128
- else {
129
- loading.value = false;
130
- }
131
- };
132
- const fixedScroll = () => {
133
- const newHeight = scrollEvent.value?.scrollHeight ?? 0;
134
- scrollEvent.value.scrollTop += newHeight - oldScrollHeight;
135
- };
136
- const __VLS_exposed = { hideLoading, fixedScroll };
137
- defineExpose(__VLS_exposed);
138
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
139
- const __VLS_defaults = {};
140
- const __VLS_ctx = {
141
- ...{},
142
- ...{},
143
- ...{},
144
- ...{},
145
- ...{},
146
- };
147
- let __VLS_elements;
148
- let __VLS_components;
149
- let __VLS_directives;
150
- /** @type {__VLS_StyleScopedClasses['loader-line']} */ ;
151
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
152
- ...{ onTouchend: (__VLS_ctx.handleTouchEnd) },
153
- ...{ onTouchmove: (...[$event]) => {
154
- __VLS_ctx.handleTouchMoveDebounce($event, __VLS_ctx.scrollEvent);
155
- // @ts-ignore
156
- [handleTouchEnd, handleTouchMoveDebounce, scrollEvent,];
157
- } },
158
- ...{ onTouchstart: (...[$event]) => {
159
- __VLS_ctx.handleTouchStart($event, __VLS_ctx.scrollEvent);
160
- // @ts-ignore
161
- [scrollEvent, handleTouchStart,];
162
- } },
163
- ...{ onScroll: (...[$event]) => {
164
- __VLS_ctx.handleScroll($event, __VLS_ctx.scrollEvent);
165
- // @ts-ignore
166
- [scrollEvent, handleScroll,];
167
- } },
168
- ref: "scrollEvent",
169
- });
170
- /** @type {typeof __VLS_ctx.scrollEvent} */ ;
171
- // @ts-ignore
172
- [scrollEvent,];
173
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
174
- ...{ class: "loader-line" },
175
- });
176
- __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.loadingTop && __VLS_ctx.top) }, null, null);
177
- // @ts-ignore
178
- [loadingTop, top,];
179
- var __VLS_0 = {};
180
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
181
- ...{ class: "loader-line" },
182
- });
183
- __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.loading && __VLS_ctx.bottom) }, null, null);
184
- // @ts-ignore
185
- [loading, bottom,];
186
- /** @type {__VLS_StyleScopedClasses['loader-line']} */ ;
187
- /** @type {__VLS_StyleScopedClasses['loader-line']} */ ;
188
- // @ts-ignore
189
- var __VLS_1 = __VLS_0;
190
- const __VLS_base = (await import('vue')).defineComponent({
191
- setup: () => (__VLS_exposed),
192
- __typeEmits: {},
193
- __typeProps: {},
194
- props: {},
195
- });
196
- const __VLS_export = {};
197
- export default {};