@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,291 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { ref, onMounted, onUnmounted, watch } from 'vue';
|
|
3
|
+
import DrawerBase from '../../../components/common/drawer/DrawerBase.vue';
|
|
4
|
+
import IconPhone from '../../../assets/icons/call/IconPhone.vue';
|
|
5
|
+
import { dataProfile } from '../../../utils/chat/auth.js';
|
|
6
|
+
import { addHandleMqttMessage, connectMqtt, removeHandleMqttMessage, subscribeToTopic, unsubscribeFromTopic } from '../../../plugins/mqtt.js';
|
|
7
|
+
import { TOPIC_DETAIL_CALL } from '../../../constant/mqtt.js';
|
|
8
|
+
import { useCallHelper } from '../../../composable/useCallHelper';
|
|
9
|
+
import IconPhoneCancel from '../../../assets/icons/call/IconPhoneCancel.vue';
|
|
10
|
+
import { addHandleWebSK, removeHandleWebSK } from '../../../plugins/websocket';
|
|
11
|
+
import { callClient, callOutBound } from '../../../utils/chat/call';
|
|
12
|
+
const { handleOffer, handleOfferResponse, call, end, endPc, addIceCandidate, sendOfferOk } = useCallHelper();
|
|
13
|
+
const STATUS = {
|
|
14
|
+
CONNECTING: 'Connecting...',
|
|
15
|
+
CALLING: 'calling',
|
|
16
|
+
RINGING: 'ringing',
|
|
17
|
+
CONNECT_FAILED: 'Connect Error',
|
|
18
|
+
CALL_START: 'in-progress',
|
|
19
|
+
CALL_END: 'completed'
|
|
20
|
+
};
|
|
21
|
+
const STATUS_LABEL = {
|
|
22
|
+
[STATUS.CONNECTING]: 'Connecting...',
|
|
23
|
+
[STATUS.CALLING]: 'Calling...',
|
|
24
|
+
[STATUS.RINGING]: 'Ringing...',
|
|
25
|
+
[STATUS.CONNECT_FAILED]: 'Connect Error',
|
|
26
|
+
[STATUS.CALL_START]: '',
|
|
27
|
+
[STATUS.CALL_END]: 'Call Ended'
|
|
28
|
+
};
|
|
29
|
+
const callStatus = ref(STATUS.CONNECTING);
|
|
30
|
+
const duration = ref('00:00');
|
|
31
|
+
const drawerVisible = ref(false);
|
|
32
|
+
const disable = ref(false);
|
|
33
|
+
let timer = null;
|
|
34
|
+
let timeOut = null;
|
|
35
|
+
onMounted(() => {
|
|
36
|
+
// timeOut = setTimeout(() => {
|
|
37
|
+
// callStatus.value = 'Connected'
|
|
38
|
+
// startTimer()
|
|
39
|
+
// }, 2000)
|
|
40
|
+
});
|
|
41
|
+
onUnmounted(() => {
|
|
42
|
+
if (timer)
|
|
43
|
+
clearInterval(timer);
|
|
44
|
+
if (timeOut)
|
|
45
|
+
clearTimeout(timeOut);
|
|
46
|
+
});
|
|
47
|
+
let dataWebSK = null;
|
|
48
|
+
function startTimer() {
|
|
49
|
+
let sec = 0;
|
|
50
|
+
timer = setInterval(() => {
|
|
51
|
+
sec++;
|
|
52
|
+
const m = String(Math.floor(sec / 60)).padStart(2, '0');
|
|
53
|
+
const s = String(sec % 60).padStart(2, '0');
|
|
54
|
+
duration.value = `${m}:${s}`;
|
|
55
|
+
}, 1000);
|
|
56
|
+
}
|
|
57
|
+
function toggleMute() {
|
|
58
|
+
alert('Mic toggled');
|
|
59
|
+
}
|
|
60
|
+
function toggleSpeaker() {
|
|
61
|
+
alert('Speaker toggled');
|
|
62
|
+
}
|
|
63
|
+
function endCall() {
|
|
64
|
+
callStatus.value = STATUS.CALL_END;
|
|
65
|
+
end('');
|
|
66
|
+
clearInterval(timer);
|
|
67
|
+
disable.value = false;
|
|
68
|
+
drawerVisible.value = false;
|
|
69
|
+
}
|
|
70
|
+
const open = () => {
|
|
71
|
+
drawerVisible.value = true;
|
|
72
|
+
disable.value = true;
|
|
73
|
+
};
|
|
74
|
+
const startCall = async (data) => {
|
|
75
|
+
try {
|
|
76
|
+
callStatus.value = STATUS.CONNECTING;
|
|
77
|
+
open();
|
|
78
|
+
await callOutBound(data);
|
|
79
|
+
// await call(data)
|
|
80
|
+
callStatus.value = STATUS.CALLING;
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
console.log(e);
|
|
84
|
+
callStatus.value = STATUS.CONNECT_FAILED;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const answer = async () => {
|
|
88
|
+
await callClient(dataWebSK);
|
|
89
|
+
callStatus.value = STATUS.CALL_START;
|
|
90
|
+
// sendOfferOk()
|
|
91
|
+
};
|
|
92
|
+
const handleMqttMessage = async (message) => {
|
|
93
|
+
if (message?.data?.status == STATUS.RINGING) {
|
|
94
|
+
if (message?.data?.to_number == dataProfile.value?.phone) {
|
|
95
|
+
callStatus.value = STATUS.RINGING;
|
|
96
|
+
dataWebSK = {
|
|
97
|
+
from: message.data.from_number,
|
|
98
|
+
to: message.data.to_number
|
|
99
|
+
};
|
|
100
|
+
open();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (message?.data?.status == STATUS.CALL_START) {
|
|
104
|
+
callStatus.value = STATUS.CALL_START;
|
|
105
|
+
}
|
|
106
|
+
else if (message?.data?.status == STATUS.CALL_END) {
|
|
107
|
+
endCall();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
// const handleMqttMessage = async (topic: string, message: any) => {
|
|
111
|
+
// if (topic == TOPIC_DETAIL_CALL + dataProfile.value?.id) {
|
|
112
|
+
// console.log(message)
|
|
113
|
+
// if (message?.type === 'offer') {
|
|
114
|
+
// const status = await handleOffer(message)
|
|
115
|
+
// if (status) {
|
|
116
|
+
// callStatus.value = STATUS.CALLING
|
|
117
|
+
// open()
|
|
118
|
+
// }
|
|
119
|
+
// } else if (message?.type === 'offer-response') {
|
|
120
|
+
// await handleOfferResponse(message)
|
|
121
|
+
// callStatus.value = STATUS.CALL_START
|
|
122
|
+
// } else if (message?.type === 'candidate') {
|
|
123
|
+
// addIceCandidate(message)
|
|
124
|
+
// } else if (message?.type === 'end-call') {
|
|
125
|
+
// endPc(message?.link)
|
|
126
|
+
// callStatus.value = STATUS.CALL_END
|
|
127
|
+
// }
|
|
128
|
+
// }
|
|
129
|
+
// }
|
|
130
|
+
const __VLS_exposed = { startCall, endCall };
|
|
131
|
+
defineExpose(__VLS_exposed);
|
|
132
|
+
watch(dataProfile, async (newValue, oldValue) => {
|
|
133
|
+
if (oldValue?.id && oldValue?.id != newValue?.id) {
|
|
134
|
+
unsubscribeFromTopic(TOPIC_DETAIL_CALL + oldValue?.id);
|
|
135
|
+
removeHandleMqttMessage('call-message');
|
|
136
|
+
removeHandleWebSK('call-message');
|
|
137
|
+
}
|
|
138
|
+
if (newValue?.id && oldValue?.id != newValue?.id) {
|
|
139
|
+
await connectMqtt();
|
|
140
|
+
subscribeToTopic(TOPIC_DETAIL_CALL + newValue?.id);
|
|
141
|
+
addHandleMqttMessage('call-message', TOPIC_DETAIL_CALL + newValue?.id, handleMqttMessage);
|
|
142
|
+
addHandleWebSK('call-message', handleMqttMessage);
|
|
143
|
+
}
|
|
144
|
+
}, { immediate: true });
|
|
145
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
146
|
+
const __VLS_ctx = {
|
|
147
|
+
...{},
|
|
148
|
+
...{},
|
|
149
|
+
};
|
|
150
|
+
let __VLS_elements;
|
|
151
|
+
let __VLS_components;
|
|
152
|
+
let __VLS_directives;
|
|
153
|
+
/** @type {[typeof DrawerBase, typeof DrawerBase, ]} */ ;
|
|
154
|
+
// @ts-ignore
|
|
155
|
+
const __VLS_0 = __VLS_asFunctionalComponent(DrawerBase, new DrawerBase({
|
|
156
|
+
open: (__VLS_ctx.drawerVisible),
|
|
157
|
+
width: (500),
|
|
158
|
+
disableClose: (__VLS_ctx.disable),
|
|
159
|
+
}));
|
|
160
|
+
const __VLS_1 = __VLS_0({
|
|
161
|
+
open: (__VLS_ctx.drawerVisible),
|
|
162
|
+
width: (500),
|
|
163
|
+
disableClose: (__VLS_ctx.disable),
|
|
164
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_0));
|
|
165
|
+
const { default: __VLS_3 } = __VLS_2.slots;
|
|
166
|
+
// @ts-ignore
|
|
167
|
+
[drawerVisible, disable,];
|
|
168
|
+
{
|
|
169
|
+
const { content: __VLS_4 } = __VLS_2.slots;
|
|
170
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
171
|
+
...{ class: "flex flex-col items-center justify-center h-screen bg-chat-haze-300 text-white relative" },
|
|
172
|
+
});
|
|
173
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
174
|
+
...{ class: "w-32 h-32 rounded-full overflow-hidden mb-4 border-4 border-gray-700" },
|
|
175
|
+
});
|
|
176
|
+
__VLS_asFunctionalElement(__VLS_elements.img)({
|
|
177
|
+
src: "https://i.pravatar.cc/300",
|
|
178
|
+
alt: "avatar",
|
|
179
|
+
...{ class: "w-full h-full object-cover" },
|
|
180
|
+
});
|
|
181
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
182
|
+
...{ class: "text-center" },
|
|
183
|
+
});
|
|
184
|
+
__VLS_asFunctionalElement(__VLS_elements.h2, __VLS_elements.h2)({
|
|
185
|
+
...{ class: "text-2xl font-semibold" },
|
|
186
|
+
});
|
|
187
|
+
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
|
|
188
|
+
...{ class: "text-gray-400 mt-1" },
|
|
189
|
+
});
|
|
190
|
+
(__VLS_ctx.STATUS_LABEL[__VLS_ctx.callStatus]);
|
|
191
|
+
// @ts-ignore
|
|
192
|
+
[STATUS_LABEL, callStatus,];
|
|
193
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
194
|
+
...{ class: "flex items-center justify-center gap-8 mt-10" },
|
|
195
|
+
});
|
|
196
|
+
if (__VLS_ctx.callStatus == __VLS_ctx.STATUS.RINGING) {
|
|
197
|
+
// @ts-ignore
|
|
198
|
+
[callStatus, STATUS,];
|
|
199
|
+
__VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
200
|
+
...{ onClick: (__VLS_ctx.answer) },
|
|
201
|
+
...{ class: "w-16 h-16 bg-[#22C55E] hover:bg-green-600 text-white rounded-full flex items-center justify-center shadow-lg transition" },
|
|
202
|
+
});
|
|
203
|
+
// @ts-ignore
|
|
204
|
+
[answer,];
|
|
205
|
+
/** @type {[typeof IconPhone, ]} */ ;
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
const __VLS_5 = __VLS_asFunctionalComponent(IconPhone, new IconPhone({}));
|
|
208
|
+
const __VLS_6 = __VLS_5({}, ...__VLS_functionalComponentArgsRest(__VLS_5));
|
|
209
|
+
}
|
|
210
|
+
__VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
|
|
211
|
+
...{ onClick: (__VLS_ctx.endCall) },
|
|
212
|
+
...{ class: "w-16 h-16 rounded-full bg-[#EF4444] hover:bg-red-700 flex items-center justify-center" },
|
|
213
|
+
});
|
|
214
|
+
// @ts-ignore
|
|
215
|
+
[endCall,];
|
|
216
|
+
/** @type {[typeof IconPhoneCancel, ]} */ ;
|
|
217
|
+
// @ts-ignore
|
|
218
|
+
const __VLS_9 = __VLS_asFunctionalComponent(IconPhoneCancel, new IconPhoneCancel({}));
|
|
219
|
+
const __VLS_10 = __VLS_9({}, ...__VLS_functionalComponentArgsRest(__VLS_9));
|
|
220
|
+
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
|
|
221
|
+
...{ class: "absolute bottom-6 text-gray-500 text-sm" },
|
|
222
|
+
});
|
|
223
|
+
(__VLS_ctx.duration);
|
|
224
|
+
// @ts-ignore
|
|
225
|
+
[duration,];
|
|
226
|
+
}
|
|
227
|
+
var __VLS_2;
|
|
228
|
+
__VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
|
|
229
|
+
id: "go-chat-local-audio",
|
|
230
|
+
autoplay: true,
|
|
231
|
+
muted: true,
|
|
232
|
+
});
|
|
233
|
+
__VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
|
|
234
|
+
id: "go-chat-remote-audio",
|
|
235
|
+
autoplay: true,
|
|
236
|
+
});
|
|
237
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
238
|
+
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
239
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
240
|
+
/** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
|
|
241
|
+
/** @type {__VLS_StyleScopedClasses['h-screen']} */ ;
|
|
242
|
+
/** @type {__VLS_StyleScopedClasses['bg-chat-haze-300']} */ ;
|
|
243
|
+
/** @type {__VLS_StyleScopedClasses['text-white']} */ ;
|
|
244
|
+
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
245
|
+
/** @type {__VLS_StyleScopedClasses['w-32']} */ ;
|
|
246
|
+
/** @type {__VLS_StyleScopedClasses['h-32']} */ ;
|
|
247
|
+
/** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
|
|
248
|
+
/** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
|
|
249
|
+
/** @type {__VLS_StyleScopedClasses['mb-4']} */ ;
|
|
250
|
+
/** @type {__VLS_StyleScopedClasses['border-4']} */ ;
|
|
251
|
+
/** @type {__VLS_StyleScopedClasses['border-gray-700']} */ ;
|
|
252
|
+
/** @type {__VLS_StyleScopedClasses['w-full']} */ ;
|
|
253
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
254
|
+
/** @type {__VLS_StyleScopedClasses['object-cover']} */ ;
|
|
255
|
+
/** @type {__VLS_StyleScopedClasses['text-center']} */ ;
|
|
256
|
+
/** @type {__VLS_StyleScopedClasses['text-2xl']} */ ;
|
|
257
|
+
/** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
|
|
258
|
+
/** @type {__VLS_StyleScopedClasses['text-gray-400']} */ ;
|
|
259
|
+
/** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
|
|
260
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
261
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
262
|
+
/** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
|
|
263
|
+
/** @type {__VLS_StyleScopedClasses['gap-8']} */ ;
|
|
264
|
+
/** @type {__VLS_StyleScopedClasses['mt-10']} */ ;
|
|
265
|
+
/** @type {__VLS_StyleScopedClasses['w-16']} */ ;
|
|
266
|
+
/** @type {__VLS_StyleScopedClasses['h-16']} */ ;
|
|
267
|
+
/** @type {__VLS_StyleScopedClasses['bg-[#22C55E]']} */ ;
|
|
268
|
+
/** @type {__VLS_StyleScopedClasses['hover:bg-green-600']} */ ;
|
|
269
|
+
/** @type {__VLS_StyleScopedClasses['text-white']} */ ;
|
|
270
|
+
/** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
|
|
271
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
272
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
273
|
+
/** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
|
|
274
|
+
/** @type {__VLS_StyleScopedClasses['shadow-lg']} */ ;
|
|
275
|
+
/** @type {__VLS_StyleScopedClasses['transition']} */ ;
|
|
276
|
+
/** @type {__VLS_StyleScopedClasses['w-16']} */ ;
|
|
277
|
+
/** @type {__VLS_StyleScopedClasses['h-16']} */ ;
|
|
278
|
+
/** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
|
|
279
|
+
/** @type {__VLS_StyleScopedClasses['bg-[#EF4444]']} */ ;
|
|
280
|
+
/** @type {__VLS_StyleScopedClasses['hover:bg-red-700']} */ ;
|
|
281
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
282
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
283
|
+
/** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
|
|
284
|
+
/** @type {__VLS_StyleScopedClasses['absolute']} */ ;
|
|
285
|
+
/** @type {__VLS_StyleScopedClasses['bottom-6']} */ ;
|
|
286
|
+
/** @type {__VLS_StyleScopedClasses['text-gray-500']} */ ;
|
|
287
|
+
/** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
|
|
288
|
+
const __VLS_export = (await import('vue')).defineComponent({
|
|
289
|
+
setup: () => (__VLS_exposed),
|
|
290
|
+
});
|
|
291
|
+
export default {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
header?: (props: typeof __VLS_1) => any;
|
|
4
|
+
} & {
|
|
5
|
+
content?: (props: typeof __VLS_3) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, __VLS_Slots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
3
|
+
const __VLS_ctx = {};
|
|
4
|
+
let __VLS_elements;
|
|
5
|
+
let __VLS_components;
|
|
6
|
+
let __VLS_directives;
|
|
7
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
8
|
+
...{ class: "bg-white border border-chat-haze-200 rounded-lg p-4" },
|
|
9
|
+
});
|
|
10
|
+
var __VLS_0 = {};
|
|
11
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
12
|
+
...{ class: "border-t border-dashed border-chat-haze-200 my-2" },
|
|
13
|
+
});
|
|
14
|
+
var __VLS_2 = {};
|
|
15
|
+
/** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
|
|
16
|
+
/** @type {__VLS_StyleScopedClasses['border']} */ ;
|
|
17
|
+
/** @type {__VLS_StyleScopedClasses['border-chat-haze-200']} */ ;
|
|
18
|
+
/** @type {__VLS_StyleScopedClasses['rounded-lg']} */ ;
|
|
19
|
+
/** @type {__VLS_StyleScopedClasses['p-4']} */ ;
|
|
20
|
+
/** @type {__VLS_StyleScopedClasses['border-t']} */ ;
|
|
21
|
+
/** @type {__VLS_StyleScopedClasses['border-dashed']} */ ;
|
|
22
|
+
/** @type {__VLS_StyleScopedClasses['border-chat-haze-200']} */ ;
|
|
23
|
+
/** @type {__VLS_StyleScopedClasses['my-2']} */ ;
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
var __VLS_1 = __VLS_0, __VLS_3 = __VLS_2;
|
|
26
|
+
const __VLS_base = (await import('vue')).defineComponent({});
|
|
27
|
+
const __VLS_export = {};
|
|
28
|
+
export default {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_ModelProps = {
|
|
2
|
+
'open'?: boolean | undefined;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_12: {}, __VLS_19: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
trigger?: (props: typeof __VLS_12) => any;
|
|
7
|
+
} & {
|
|
8
|
+
default?: (props: typeof __VLS_19) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:open": (value: boolean | undefined) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
13
|
+
"onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../../../components/ui/collapsible';
|
|
3
|
+
const isOpen = defineModel('open');
|
|
4
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
5
|
+
const __VLS_modelEmit = defineEmits();
|
|
6
|
+
const __VLS_ctx = {
|
|
7
|
+
...{},
|
|
8
|
+
...{},
|
|
9
|
+
...{},
|
|
10
|
+
...{},
|
|
11
|
+
...{},
|
|
12
|
+
};
|
|
13
|
+
let __VLS_elements;
|
|
14
|
+
let __VLS_components;
|
|
15
|
+
let __VLS_directives;
|
|
16
|
+
const __VLS_0 = {}.Collapsible;
|
|
17
|
+
/** @type {[typeof __VLS_components.Collapsible, typeof __VLS_components.Collapsible, ]} */ ;
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
Collapsible;
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
|
|
22
|
+
open: (__VLS_ctx.isOpen),
|
|
23
|
+
}));
|
|
24
|
+
const __VLS_2 = __VLS_1({
|
|
25
|
+
open: (__VLS_ctx.isOpen),
|
|
26
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
27
|
+
var __VLS_4 = {};
|
|
28
|
+
const { default: __VLS_5 } = __VLS_3.slots;
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
[isOpen,];
|
|
31
|
+
const __VLS_6 = {}.CollapsibleTrigger;
|
|
32
|
+
/** @type {[typeof __VLS_components.CollapsibleTrigger, typeof __VLS_components.CollapsibleTrigger, ]} */ ;
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
CollapsibleTrigger;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
const __VLS_7 = __VLS_asFunctionalComponent(__VLS_6, new __VLS_6({}));
|
|
37
|
+
const __VLS_8 = __VLS_7({}, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
|
38
|
+
const { default: __VLS_10 } = __VLS_9.slots;
|
|
39
|
+
var __VLS_11 = {};
|
|
40
|
+
var __VLS_9;
|
|
41
|
+
const __VLS_13 = {}.CollapsibleContent;
|
|
42
|
+
/** @type {[typeof __VLS_components.CollapsibleContent, typeof __VLS_components.CollapsibleContent, ]} */ ;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
CollapsibleContent;
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({}));
|
|
47
|
+
const __VLS_15 = __VLS_14({}, ...__VLS_functionalComponentArgsRest(__VLS_14));
|
|
48
|
+
const { default: __VLS_17 } = __VLS_16.slots;
|
|
49
|
+
var __VLS_18 = {};
|
|
50
|
+
var __VLS_16;
|
|
51
|
+
var __VLS_3;
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
var __VLS_12 = __VLS_11, __VLS_19 = __VLS_18;
|
|
54
|
+
const __VLS_base = (await import('vue')).defineComponent({
|
|
55
|
+
__typeEmits: {},
|
|
56
|
+
__typeProps: {},
|
|
57
|
+
});
|
|
58
|
+
const __VLS_export = {};
|
|
59
|
+
export default {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PAGE_RESPONSE } from '../../../../types/chat/global';
|
|
2
|
+
type Props = {
|
|
3
|
+
modelValue: string;
|
|
4
|
+
response: PAGE_RESPONSE;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
8
|
+
search: (val: string) => any;
|
|
9
|
+
"update:modelValue": (val: string) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
11
|
+
onSearch?: ((val: string) => any) | undefined;
|
|
12
|
+
"onUpdate:modelValue"?: ((val: string) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
placeholder: string;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import IconSearch from '../../../../assets/icons/IconSearch.vue';
|
|
4
|
+
import { useDebounce } from '../../../../utils/debounce';
|
|
5
|
+
const props = withDefaults(defineProps(), {
|
|
6
|
+
placeholder: 'Search...'
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits();
|
|
9
|
+
const keyword = computed({
|
|
10
|
+
get: () => props.modelValue,
|
|
11
|
+
set: (val) => emit('update:modelValue', val)
|
|
12
|
+
});
|
|
13
|
+
const search = useDebounce(() => {
|
|
14
|
+
emit('search', keyword.value);
|
|
15
|
+
});
|
|
16
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
17
|
+
const __VLS_defaults = {
|
|
18
|
+
placeholder: 'Search...'
|
|
19
|
+
};
|
|
20
|
+
const __VLS_ctx = {
|
|
21
|
+
...{},
|
|
22
|
+
...{},
|
|
23
|
+
...{},
|
|
24
|
+
...{},
|
|
25
|
+
...{},
|
|
26
|
+
};
|
|
27
|
+
let __VLS_elements;
|
|
28
|
+
let __VLS_components;
|
|
29
|
+
let __VLS_directives;
|
|
30
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
31
|
+
...{ class: "relative" },
|
|
32
|
+
});
|
|
33
|
+
__VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
|
|
34
|
+
...{ class: "absolute inset-y-0 left-4 translate-y-1/2 bottom-1/2 flex items-center pointer-events-none text-gray-500" },
|
|
35
|
+
});
|
|
36
|
+
/** @type {[typeof IconSearch, ]} */ ;
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
const __VLS_0 = __VLS_asFunctionalComponent(IconSearch, new IconSearch({}));
|
|
39
|
+
const __VLS_1 = __VLS_0({}, ...__VLS_functionalComponentArgsRest(__VLS_0));
|
|
40
|
+
__VLS_asFunctionalElement(__VLS_elements.input)({
|
|
41
|
+
...{ onInput: (__VLS_ctx.search) },
|
|
42
|
+
...{ class: "sc-full chat-input bg-[#F7F8F9] pr-4 py-3 pl-10" },
|
|
43
|
+
...{ class: ({ '!bg-white': __VLS_ctx.response == 'mobile' }) },
|
|
44
|
+
placeholder: (props.placeholder),
|
|
45
|
+
});
|
|
46
|
+
(__VLS_ctx.keyword);
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
[search, response, keyword,];
|
|
49
|
+
/** @type {__VLS_StyleScopedClasses['relative']} */ ;
|
|
50
|
+
/** @type {__VLS_StyleScopedClasses['absolute']} */ ;
|
|
51
|
+
/** @type {__VLS_StyleScopedClasses['inset-y-0']} */ ;
|
|
52
|
+
/** @type {__VLS_StyleScopedClasses['left-4']} */ ;
|
|
53
|
+
/** @type {__VLS_StyleScopedClasses['translate-y-1/2']} */ ;
|
|
54
|
+
/** @type {__VLS_StyleScopedClasses['bottom-1/2']} */ ;
|
|
55
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
56
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
57
|
+
/** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
|
|
58
|
+
/** @type {__VLS_StyleScopedClasses['text-gray-500']} */ ;
|
|
59
|
+
/** @type {__VLS_StyleScopedClasses['sc-full']} */ ;
|
|
60
|
+
/** @type {__VLS_StyleScopedClasses['chat-input']} */ ;
|
|
61
|
+
/** @type {__VLS_StyleScopedClasses['bg-[#F7F8F9]']} */ ;
|
|
62
|
+
/** @type {__VLS_StyleScopedClasses['pr-4']} */ ;
|
|
63
|
+
/** @type {__VLS_StyleScopedClasses['py-3']} */ ;
|
|
64
|
+
/** @type {__VLS_StyleScopedClasses['pl-10']} */ ;
|
|
65
|
+
/** @type {__VLS_StyleScopedClasses['!bg-white']} */ ;
|
|
66
|
+
const __VLS_export = (await import('vue')).defineComponent({
|
|
67
|
+
__typeEmits: {},
|
|
68
|
+
__typeProps: {},
|
|
69
|
+
props: {},
|
|
70
|
+
});
|
|
71
|
+
export default {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PopoverContentProps } from "reka-ui";
|
|
2
|
+
type ShortPopoverContentProps = Pick<PopoverContentProps, 'side' | 'align' | 'sideOffset'> & {
|
|
3
|
+
delay?: number;
|
|
4
|
+
trigger?: 'hover' | 'click';
|
|
5
|
+
triggerClass?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_Props = ShortPopoverContentProps;
|
|
9
|
+
type __VLS_ModelProps = {
|
|
10
|
+
'open'?: boolean;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
13
|
+
declare var __VLS_19: {}, __VLS_30: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
default?: (props: typeof __VLS_19) => any;
|
|
16
|
+
} & {
|
|
17
|
+
content?: (props: typeof __VLS_30) => any;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
"update:open": (value: boolean | undefined) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
"onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
sideOffset: number;
|
|
25
|
+
align: "end" | "start" | "center";
|
|
26
|
+
delay: number;
|
|
27
|
+
trigger: "click" | "hover";
|
|
28
|
+
triggerClass: string;
|
|
29
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|