@phonghq/go-chat 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/assets/icons/IconArrowLeft.vue.d.ts +2 -0
- package/dist/assets/icons/IconArrowLeft.vue.js +29 -0
- package/dist/assets/icons/IconPhone.vue.d.ts +2 -0
- package/dist/assets/icons/IconPhone.vue.js +19 -0
- package/dist/assets/icons/IconPlan.vue.d.ts +2 -0
- package/dist/assets/icons/IconPlan.vue.js +19 -0
- package/dist/assets/icons/IconPlus.vue.d.ts +2 -0
- package/dist/assets/icons/IconPlus.vue.js +22 -0
- package/dist/assets/icons/IconSearch.vue.d.ts +32 -0
- package/dist/assets/icons/IconSearch.vue.js +68 -0
- package/dist/assets/icons/call/IconMic.vue.d.ts +14 -0
- package/dist/assets/icons/call/IconMic.vue.js +123 -0
- package/dist/assets/icons/call/IconPhone.vue.d.ts +2 -0
- package/dist/assets/icons/call/IconPhone.vue.js +35 -0
- package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +2 -0
- package/dist/assets/icons/call/IconPhoneCancel.vue.js +35 -0
- package/dist/assets/icons/call/IconSpeaker.vue.d.ts +14 -0
- package/dist/assets/icons/call/IconSpeaker.vue.js +62 -0
- package/dist/assets/icons/customer-appointment/IconFilter.vue.d.ts +2 -0
- package/dist/assets/icons/customer-appointment/IconFilter.vue.js +53 -0
- package/dist/assets/icons/customer-detail/IconArrow.vue.d.ts +2 -0
- package/dist/assets/icons/customer-detail/IconArrow.vue.js +22 -0
- package/dist/assets/icons/customer-detail/IconCheck.vue.d.ts +2 -0
- package/dist/assets/icons/customer-detail/IconCheck.vue.js +27 -0
- package/dist/assets/icons/customer-detail/IconDate.vue.d.ts +2 -0
- package/dist/assets/icons/customer-detail/IconDate.vue.js +43 -0
- package/dist/assets/icons/customer-detail/IconGroup.vue.d.ts +2 -0
- package/dist/assets/icons/customer-detail/IconGroup.vue.js +48 -0
- package/dist/assets/icons/customer-detail/IconMessage.vue.d.ts +2 -0
- package/dist/assets/icons/customer-detail/IconMessage.vue.js +28 -0
- package/dist/assets/icons/customer-detail/IconNote.vue.d.ts +2 -0
- package/dist/assets/icons/customer-detail/IconNote.vue.js +29 -0
- package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +2 -0
- package/dist/assets/icons/customer-detail/IconPhone.vue.js +21 -0
- package/dist/assets/icons/customer-detail/IconPin.vue.d.ts +2 -0
- package/dist/assets/icons/customer-detail/IconPin.vue.js +29 -0
- package/dist/assets/icons/customer-detail/IconSearch.vue.d.ts +2 -0
- package/dist/assets/icons/customer-detail/IconSearch.vue.js +29 -0
- package/dist/chat/App.vue.d.ts +5 -0
- package/dist/chat/App.vue.js +502 -0
- package/dist/chat/main.d.ts +3 -0
- package/dist/chat/main.js +2 -0
- package/dist/chat/page/customer-appointment/CustomerAppointment.vue.d.ts +2 -0
- package/dist/chat/page/customer-appointment/CustomerAppointment.vue.js +207 -0
- package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.d.ts +12 -0
- package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.js +80 -0
- package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.d.ts +2 -0
- package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.js +136 -0
- package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +7 -0
- package/dist/chat/page/customer-detail/CustomerDetail.vue.js +235 -0
- package/dist/chat/page/customer-detail/SubInformation.vue.d.ts +16 -0
- package/dist/chat/page/customer-detail/SubInformation.vue.js +102 -0
- package/dist/chat/page/error/Error.vue.d.ts +2 -0
- package/dist/chat/page/error/Error.vue.js +64 -0
- package/dist/chat/page/home/ChatList.vue.d.ts +20 -0
- package/dist/chat/page/home/ChatList.vue.js +380 -0
- package/dist/chat/page/home/ChatMessage.vue.d.ts +16 -0
- package/dist/chat/page/home/ChatMessage.vue.js +271 -0
- package/dist/chat/page/home/Home.vue.d.ts +14 -0
- package/dist/chat/page/home/Home.vue.js +327 -0
- package/dist/chat/page/home/HomeHeader.vue.d.ts +10 -0
- package/dist/chat/page/home/HomeHeader.vue.js +122 -0
- package/dist/chat/page/home/InputChat.vue.d.ts +19 -0
- package/dist/chat/page/home/InputChat.vue.js +226 -0
- package/dist/chat/page/home/NewCustomer.vue.d.ts +6 -0
- package/dist/chat/page/home/NewCustomer.vue.js +82 -0
- package/dist/components/ListenEvent.vue.d.ts +2 -0
- package/dist/components/ListenEvent.vue.js +45 -0
- package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +22 -0
- package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +197 -0
- package/dist/components/chat/call/Calling.vue.d.ts +7 -0
- package/dist/components/chat/call/Calling.vue.js +291 -0
- package/dist/components/chat/card/CardCustomerDetail.vue.d.ts +13 -0
- package/dist/components/chat/card/CardCustomerDetail.vue.js +28 -0
- package/dist/components/chat/common/collapse/CollapseBase.vue.d.ts +20 -0
- package/dist/components/chat/common/collapse/CollapseBase.vue.js +59 -0
- package/dist/components/chat/common/input/InputSearch.vue.d.ts +16 -0
- package/dist/components/chat/common/input/InputSearch.vue.js +71 -0
- package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +35 -0
- package/dist/components/chat/common/popover/PopoverBase.vue.js +148 -0
- package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +2 -0
- package/dist/components/chat/common/spin/BaseSpin.vue.js +12 -0
- package/dist/components/chat/customer/Avatar.vue.d.ts +11 -0
- package/dist/components/chat/customer/Avatar.vue.js +79 -0
- package/dist/components/chat/layout/mobile/Footer.vue.d.ts +2 -0
- package/dist/components/chat/layout/mobile/Footer.vue.js +109 -0
- package/dist/components/common/CustomLoading.vue.d.ts +2 -0
- package/dist/components/common/CustomLoading.vue.js +19 -0
- package/dist/components/common/Notification/NotificationDescription.vue.d.ts +7 -0
- package/dist/components/common/Notification/NotificationDescription.vue.js +38 -0
- package/dist/components/common/button/ButtonBase.vue.d.ts +22 -0
- package/dist/components/common/button/ButtonBase.vue.js +78 -0
- package/dist/components/common/button/ButtonToggle.vue.d.ts +20 -0
- package/dist/components/common/button/ButtonToggle.vue.js +70 -0
- package/dist/components/common/checkbox/CCheckboxNumber.vue.d.ts +16 -0
- package/dist/components/common/checkbox/CCheckboxNumber.vue.js +48 -0
- package/dist/components/common/collapse/BaseCollapse.vue.d.ts +12 -0
- package/dist/components/common/collapse/BaseCollapse.vue.js +36 -0
- package/dist/components/common/collapse/BaseCollapseItem.vue.d.ts +4 -0
- package/dist/components/common/collapse/BaseCollapseItem.vue.js +22 -0
- package/dist/components/common/drawer/DrawerBase.vue.d.ts +39 -0
- package/dist/components/common/drawer/DrawerBase.vue.js +126 -0
- package/dist/components/common/dropdown/DropdownBase.vue.d.ts +21 -0
- package/dist/components/common/dropdown/DropdownBase.vue.js +91 -0
- package/dist/components/common/input/CInputSearch.vue.d.ts +14 -0
- package/dist/components/common/input/CInputSearch.vue.js +62 -0
- package/dist/components/common/modal/ModalBase.vue.d.ts +35 -0
- package/dist/components/common/modal/ModalBase.vue.js +164 -0
- package/dist/components/common/popover/PopoverBase.vue.d.ts +3 -0
- package/dist/components/common/popover/PopoverBase.vue.js +36 -0
- package/dist/components/common/slider/BaseSlider.vue.d.ts +11 -0
- package/dist/components/common/slider/BaseSlider.vue.js +70 -0
- package/dist/components/common/spin/CSpin.vue.d.ts +9 -0
- package/dist/components/common/spin/CSpin.vue.js +41 -0
- package/dist/components/common/tooltip/TooltipBase.vue.d.ts +2 -0
- package/dist/components/common/tooltip/TooltipBase.vue.js +8 -0
- package/dist/components/layout/Blank.vue.d.ts +9 -0
- package/dist/components/layout/Blank.vue.js +19 -0
- package/dist/components/layout/Default.vue.d.ts +9 -0
- package/dist/components/layout/Default.vue.js +21 -0
- package/dist/components/modal/Confirm.vue.d.ts +2 -0
- package/dist/components/modal/Confirm.vue.js +164 -0
- package/dist/components/ui/button/CButton.vue.d.ts +19 -0
- package/dist/components/ui/button/CButton.vue.js +49 -0
- package/dist/components/ui/button/c-button.d.ts +7 -0
- package/dist/components/ui/button/c-button.js +26 -0
- package/dist/components/ui/checkbox/Checkbox.vue.d.ts +18 -0
- package/dist/components/ui/checkbox/Checkbox.vue.js +79 -0
- package/dist/components/ui/checkbox/index.d.ts +1 -0
- package/dist/components/ui/checkbox/index.js +1 -0
- package/dist/components/ui/collapsible/Collapsible.vue.d.ts +16 -0
- package/dist/components/ui/collapsible/Collapsible.vue.js +47 -0
- package/dist/components/ui/collapsible/CollapsibleContent.vue.d.ts +10 -0
- package/dist/components/ui/collapsible/CollapsibleContent.vue.js +41 -0
- package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +10 -0
- package/dist/components/ui/collapsible/CollapsibleTrigger.vue.js +35 -0
- package/dist/components/ui/collapsible/index.d.ts +3 -0
- package/dist/components/ui/collapsible/index.js +3 -0
- package/dist/components/ui/dialog/Dialog.vue.d.ts +14 -0
- package/dist/components/ui/dialog/Dialog.vue.js +42 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +10 -0
- package/dist/components/ui/dialog/DialogClose.vue.js +35 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +29 -0
- package/dist/components/ui/dialog/DialogContent.vue.js +84 -0
- package/dist/components/ui/dialog/DialogDescription.vue.d.ts +14 -0
- package/dist/components/ui/dialog/DialogDescription.vue.js +43 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +13 -0
- package/dist/components/ui/dialog/DialogFooter.vue.js +26 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +13 -0
- package/dist/components/ui/dialog/DialogHeader.vue.js +26 -0
- package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +30 -0
- package/dist/components/ui/dialog/DialogScrollContent.vue.js +99 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +14 -0
- package/dist/components/ui/dialog/DialogTitle.vue.js +43 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +10 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.js +35 -0
- package/dist/components/ui/dialog/index.d.ts +9 -0
- package/dist/components/ui/dialog/index.js +9 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +26 -0
- package/dist/components/ui/drawer/Drawer.vue.js +48 -0
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +33 -0
- package/dist/components/ui/drawer/DrawerContent.vue.js +81 -0
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +14 -0
- package/dist/components/ui/drawer/DrawerDescription.vue.js +42 -0
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +13 -0
- package/dist/components/ui/drawer/DrawerFooter.vue.js +26 -0
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +13 -0
- package/dist/components/ui/drawer/DrawerHeader.vue.js +26 -0
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +7 -0
- package/dist/components/ui/drawer/DrawerOverlay.vue.js +37 -0
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +14 -0
- package/dist/components/ui/drawer/DrawerTitle.vue.js +42 -0
- package/dist/components/ui/drawer/index.d.ts +8 -0
- package/dist/components/ui/drawer/index.js +8 -0
- package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +14 -0
- package/dist/components/ui/dropdown-menu/DropdownMenu.vue.js +41 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +20 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +79 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +28 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +61 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +10 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +35 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +15 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.js +43 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +15 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +43 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +14 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +41 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +18 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +80 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +37 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +13 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +26 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +14 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.js +41 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +30 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +46 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +14 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +58 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +10 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +41 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +15 -0
- package/dist/components/ui/dropdown-menu/index.js +15 -0
- package/dist/components/ui/popover/Popover.vue.d.ts +14 -0
- package/dist/components/ui/popover/Popover.vue.js +41 -0
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +28 -0
- package/dist/components/ui/popover/PopoverContent.vue.js +60 -0
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +10 -0
- package/dist/components/ui/popover/PopoverTrigger.vue.js +35 -0
- package/dist/components/ui/popover/index.d.ts +3 -0
- package/dist/components/ui/popover/index.js +3 -0
- package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +18 -0
- package/dist/components/ui/radio-group/RadioGroup.vue.js +46 -0
- package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +7 -0
- package/dist/components/ui/radio-group/RadioGroupItem.vue.js +71 -0
- package/dist/components/ui/radio-group/index.d.ts +2 -0
- package/dist/components/ui/radio-group/index.js +2 -0
- package/dist/components/ui/slider/Slider.vue.d.ts +13 -0
- package/dist/components/ui/slider/Slider.vue.js +155 -0
- package/dist/components/ui/slider/index.d.ts +1 -0
- package/dist/components/ui/slider/index.js +1 -0
- package/dist/components/ui/switch/Switch.vue.d.ts +18 -0
- package/dist/components/ui/switch/Switch.vue.js +61 -0
- package/dist/components/ui/switch/index.d.ts +1 -0
- package/dist/components/ui/switch/index.js +1 -0
- package/dist/composable/useCallHelper.d.ts +23 -0
- package/dist/composable/useCallHelper.js +170 -0
- package/dist/composable/useInitData.d.ts +11 -0
- package/dist/composable/useInitData.js +84 -0
- package/dist/composable/useModalConfirm.d.ts +5 -0
- package/dist/composable/useModalConfirm.js +39 -0
- package/dist/constant/color.d.ts +22 -0
- package/dist/constant/color.js +43 -0
- package/dist/constant/datetime.d.ts +5 -0
- package/dist/constant/datetime.js +5 -0
- package/dist/constant/general.d.ts +8 -0
- package/dist/constant/general.js +9 -0
- package/dist/constant/message.d.ts +8 -0
- package/dist/constant/message.js +8 -0
- package/dist/constant/mqtt.d.ts +4 -0
- package/dist/constant/mqtt.js +11 -0
- package/dist/constant/user.d.ts +8 -0
- package/dist/constant/user.js +9 -0
- package/dist/go-chat.es.js +64024 -2699
- package/dist/go-chat.umd.js +15 -3
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/dist/plugins/axios-gci.d.ts +3 -0
- package/dist/plugins/axios-gci.js +25 -0
- package/dist/plugins/axios.d.ts +3 -0
- package/dist/plugins/axios.js +85 -0
- package/dist/plugins/mqtt.d.ts +10 -0
- package/dist/plugins/mqtt.js +128 -0
- package/dist/plugins/sdk.d.ts +19 -0
- package/dist/plugins/sdk.js +83 -0
- package/dist/plugins/websocket.d.ts +4 -0
- package/dist/plugins/websocket.js +65 -0
- package/dist/style.css +1 -1
- package/dist/types/chat/user.d.ts +88 -0
- package/dist/types/chat/user.js +1 -0
- package/dist/types/conversation.d.ts +18 -0
- package/dist/types/conversation.js +1 -0
- package/dist/utils/chat/auth.d.ts +45 -0
- package/dist/utils/chat/auth.js +51 -0
- package/dist/utils/chat/call.d.ts +5 -0
- package/dist/utils/chat/call.js +61 -0
- package/dist/utils/chat/chat-router.d.ts +3 -0
- package/dist/utils/chat/chat-router.js +9 -0
- package/dist/utils/chat/conversation.d.ts +3 -0
- package/dist/utils/chat/conversation.js +7 -0
- package/dist/utils/chat/message.d.ts +17 -0
- package/dist/utils/chat/message.js +42 -0
- package/dist/utils/chat/user.d.ts +193 -0
- package/dist/utils/chat/user.js +33 -0
- package/dist/utils/debounce.d.ts +1 -0
- package/dist/utils/debounce.js +9 -0
- package/dist/utils/json.d.ts +2 -0
- package/dist/utils/json.js +18 -0
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.js +5 -0
- package/dist/utils/string-helper.d.ts +1 -0
- package/dist/utils/string-helper.js +27 -0
- package/package.json +8 -7
|
@@ -0,0 +1,226 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IResUser } from '../../../types/message';
|
|
2
|
+
type Props = {
|
|
3
|
+
data: IResUser | null;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
top?: boolean;
|
|
3
|
+
bottom?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {
|
|
6
|
+
hideLoading: () => void;
|
|
7
|
+
fixedScroll: () => void;
|
|
8
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
+
getDataBottom: () => any;
|
|
10
|
+
getDataTop: () => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
12
|
+
onGetDataBottom?: (() => any) | undefined;
|
|
13
|
+
onGetDataTop?: (() => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
15
|
+
default?: ((props: {}) => any) | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IResUser } from '../../../types/message';
|
|
2
|
+
declare function endCall(): void;
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
4
|
+
startCall: (data: IResUser) => Promise<void>;
|
|
5
|
+
endCall: typeof endCall;
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
export default _default;
|