@trtc/calls-uikit-vue2 4.1.0
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-zh_CN.md +83 -0
- package/README.md +89 -0
- package/debug/GenerateTestUserSig-es.js +26 -0
- package/debug/lib-generate-test-usersig-es.min.js +2 -0
- package/package.json +42 -0
- package/src/Components/TUICallKit.vue +334 -0
- package/src/Components/assets/MicrophoneVolume/desktop/mic-off.svg +5 -0
- package/src/Components/assets/MicrophoneVolume/desktop/mic-on.svg +5 -0
- package/src/Components/assets/base/close.svg +1 -0
- package/src/Components/assets/base/error.svg +1 -0
- package/src/Components/assets/base/info.svg +1 -0
- package/src/Components/assets/base/loading-circle.svg +1 -0
- package/src/Components/assets/base/success.svg +1 -0
- package/src/Components/assets/base/waring.svg +1 -0
- package/src/Components/assets/button/accept.svg +1 -0
- package/src/Components/assets/button/background-blur-close.svg +1 -0
- package/src/Components/assets/button/background-blur-open.svg +1 -0
- package/src/Components/assets/button/camera-close.svg +1 -0
- package/src/Components/assets/button/camera-open.svg +1 -0
- package/src/Components/assets/button/desktop/arrow.png +0 -0
- package/src/Components/assets/button/desktop/fullScreen.svg +4 -0
- package/src/Components/assets/button/desktop/inviteUser.svg +1 -0
- package/src/Components/assets/button/desktop/minimize.svg +6 -0
- package/src/Components/assets/button/hangup.svg +1 -0
- package/src/Components/assets/button/microphone-close.svg +1 -0
- package/src/Components/assets/button/microphone-open.svg +1 -0
- package/src/Components/assets/button/mobile/down.svg +1 -0
- package/src/Components/assets/button/mobile/inviteUser.svg +1 -0
- package/src/Components/assets/button/mobile/minimize.svg +1 -0
- package/src/Components/assets/button/mobile/switch-camera.svg +1 -0
- package/src/Components/assets/button/mobile/up.svg +1 -0
- package/src/Components/assets/button/speaker-close.svg +1 -0
- package/src/Components/assets/button/speaker-open.svg +1 -0
- package/src/Components/assets/button/switch-audio.svg +1 -0
- package/src/Components/assets/common/arrows.svg +1 -0
- package/src/Components/assets/common/call.svg +1 -0
- package/src/Components/assets/common/close.svg +1 -0
- package/src/Components/assets/common/defaultAvatar.svg +1 -0
- package/src/Components/assets/common/loading-audio.svg +1 -0
- package/src/Components/assets/common/loading-video.png +0 -0
- package/src/Components/assets/common/microphone-volumn-close.svg +1 -0
- package/src/Components/assets/desktop/acceptAudio.svg +4 -0
- package/src/Components/assets/desktop/acceptVideo.svg +8 -0
- package/src/Components/assets/desktop/arrow.png +0 -0
- package/src/Components/assets/desktop/camera-false.svg +5 -0
- package/src/Components/assets/desktop/camera.svg +6 -0
- package/src/Components/assets/desktop/floatCallEnd.svg +3 -0
- package/src/Components/assets/desktop/floatFullScreen.svg +3 -0
- package/src/Components/assets/desktop/floatMicrophone.svg +4 -0
- package/src/Components/assets/desktop/floatMicrophoneClosed.svg +3 -0
- package/src/Components/assets/desktop/fullScreen.svg +4 -0
- package/src/Components/assets/desktop/hangup.svg +4 -0
- package/src/Components/assets/desktop/invite_user.svg +5 -0
- package/src/Components/assets/desktop/microphone-false.svg +8 -0
- package/src/Components/assets/desktop/microphone.svg +9 -0
- package/src/Components/assets/desktop/minimize.svg +6 -0
- package/src/Components/assets/desktop/permission/index.ts +11 -0
- package/src/Components/assets/desktop/permission/mac/permit-en.jpg +0 -0
- package/src/Components/assets/desktop/permission/mac/permit-zh.jpg +0 -0
- package/src/Components/assets/desktop/permission/win/permit-en.png +0 -0
- package/src/Components/assets/desktop/permission/win/permit-zh.png +0 -0
- package/src/Components/assets/desktop/switchScreen.svg +5 -0
- package/src/Components/assets/desktop/trans.svg +6 -0
- package/src/Components/assets/floatingWindow/desktop/floatCallEnd.svg +3 -0
- package/src/Components/assets/floatingWindow/desktop/floatFullScreen.svg +3 -0
- package/src/Components/assets/floatingWindow/desktop/floatMicrophone.svg +4 -0
- package/src/Components/assets/floatingWindow/desktop/floatMicrophoneClosed.svg +3 -0
- package/src/Components/assets/floatingWindow/mobile/camera-close.svg +1 -0
- package/src/Components/assets/floatingWindow/mobile/camera-open.svg +1 -0
- package/src/Components/assets/floatingWindow/mobile/earphone.svg +1 -0
- package/src/Components/assets/floatingWindow/mobile/microphone-close.svg +1 -0
- package/src/Components/assets/floatingWindow/mobile/microphone-open.svg +1 -0
- package/src/Components/assets/mobile/accept.png +0 -0
- package/src/Components/assets/mobile/audio-false.png +0 -0
- package/src/Components/assets/mobile/audio-true.png +0 -0
- package/src/Components/assets/mobile/camera-false.png +0 -0
- package/src/Components/assets/mobile/camera-true.png +0 -0
- package/src/Components/assets/mobile/default_avatar.png +0 -0
- package/src/Components/assets/mobile/hangup.png +0 -0
- package/src/Components/assets/mobile/loading.png +0 -0
- package/src/Components/assets/mobile/phone_dialing.mp3 +0 -0
- package/src/Components/assets/mobile/phone_ringing.mp3 +0 -0
- package/src/Components/assets/mobile/speaker-false.png +0 -0
- package/src/Components/assets/mobile/speaker-true.png +0 -0
- package/src/Components/assets/mobile/switch_camera.png +0 -0
- package/src/Components/assets/mobile/swtich-camera.png +0 -0
- package/src/Components/assets/mobile/trans.png +0 -0
- package/src/Components/assets/permission/desktop/index.ts +11 -0
- package/src/Components/assets/permission/desktop/mac/permit-en.jpg +0 -0
- package/src/Components/assets/permission/desktop/mac/permit-zh.jpg +0 -0
- package/src/Components/assets/permission/desktop/win/permit-en.png +0 -0
- package/src/Components/assets/permission/desktop/win/permit-zh.png +0 -0
- package/src/Components/assets/streamInfo/mobile/mic-off-h5.svg +1 -0
- package/src/Components/assets/streamInfo/mobile/mic-on-h5.svg +1 -0
- package/src/Components/assets/streamInfo/mobile/microphone-close-group.svg +1 -0
- package/src/Components/assets/streamInfo/mobile/microphone-close-single.svg +1 -0
- package/src/Components/assets/streamInfo/mobile/volumn.svg +1 -0
- package/src/Components/assets/streamInfo/networkStatus.png +0 -0
- package/src/Components/components/GroupCall/BackGround/BackGround.vue +20 -0
- package/src/Components/components/GroupCall/BtnOperate/BtnOperate.vue +116 -0
- package/src/Components/components/GroupCall/BtnOperate/style/desktop.scss +60 -0
- package/src/Components/components/GroupCall/BtnOperate/style/index.scss +2 -0
- package/src/Components/components/GroupCall/BtnOperate/style/mobile.scss +39 -0
- package/src/Components/components/GroupCall/GroupCall.vue +129 -0
- package/src/Components/components/GroupCall/InviteInfo/InviteInfo.vue +116 -0
- package/src/Components/components/GroupCall/InviteInfo/mobile/InviteCallee.vue +120 -0
- package/src/Components/components/GroupCall/MediaContainer/MediaContainer.vue +267 -0
- package/src/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.vue +22 -0
- package/src/Components/components/GroupCall/PusherPlayer/PusherPlayer.vue +67 -0
- package/src/Components/components/GroupCall/PusherPlayer/deskTop/RemoteStreamList.vue +483 -0
- package/src/Components/components/GroupCall/PusherPlayer/mobile/RemoteStreamList.vue +151 -0
- package/src/Components/components/GroupCall/PusherPlayer/wechat/RemoteStreamList.vue +299 -0
- package/src/Components/components/SingleCall/BtnOperate/BtnOperate.vue +126 -0
- package/src/Components/components/SingleCall/BtnOperate/style/desktop.scss +60 -0
- package/src/Components/components/SingleCall/BtnOperate/style/index.scss +2 -0
- package/src/Components/components/SingleCall/BtnOperate/style/mobile.scss +39 -0
- package/src/Components/components/SingleCall/InviteInfo/InviteInfo.vue +161 -0
- package/src/Components/components/SingleCall/InviteInfo/mobile/SingleAudio.vue +69 -0
- package/src/Components/components/SingleCall/InviteInfo/mobile/SingleVideo.vue +67 -0
- package/src/Components/components/SingleCall/InviteInfo/style/desktop.sass +0 -0
- package/src/Components/components/SingleCall/InviteInfo/style/mobile.sass +0 -0
- package/src/Components/components/SingleCall/MediaContainer/MediaContainer.vue +165 -0
- package/src/Components/components/SingleCall/PusherPlayer/PusherPlayer.vue +215 -0
- package/src/Components/components/SingleCall/PusherPlayer/WeChatStream.vue +53 -0
- package/src/Components/components/SingleCall/PusherPlayer/wechat/Player.vue +110 -0
- package/src/Components/components/SingleCall/PusherPlayer/wechat/Pusher.vue +113 -0
- package/src/Components/components/SingleCall/SingleCall.vue +28 -0
- package/src/Components/components/SingleCall/hooks/useGetLargeViewName.ts +32 -0
- package/src/Components/components/base/Avatar/Avatar.ts +38 -0
- package/src/Components/components/base/Avatar/Avatar.vue +53 -0
- package/src/Components/components/base/Avatar/style/Avatar.scss +40 -0
- package/src/Components/components/base/Button/Button.ts +60 -0
- package/src/Components/components/base/Button/Button.vue +61 -0
- package/src/Components/components/base/Button/style/Button.scss +42 -0
- package/src/Components/components/base/Grid/Grid.ts +26 -0
- package/src/Components/components/base/Grid/Grid.vue +40 -0
- package/src/Components/components/base/Grid/GridItem/GridItem.vue +81 -0
- package/src/Components/components/base/Grid/GridItem/style/GridItem.scss +13 -0
- package/src/Components/components/base/Icon/Icon.ts +9 -0
- package/src/Components/components/base/Icon/Icon.vue +21 -0
- package/src/Components/components/base/Layout/Col/Col.ts +23 -0
- package/src/Components/components/base/Layout/Col/Col.vue +46 -0
- package/src/Components/components/base/Layout/Col/style/Col.scss +9 -0
- package/src/Components/components/base/Layout/Row/Row.ts +23 -0
- package/src/Components/components/base/Layout/Row/Row.vue +38 -0
- package/src/Components/components/base/Layout/Row/style/Row.scss +10 -0
- package/src/Components/components/base/Layout/constant.ts +1 -0
- package/src/Components/components/base/Loading/Circle/Circle.ts +13 -0
- package/src/Components/components/base/Loading/Circle/Circle.vue +36 -0
- package/src/Components/components/base/Loading/Circle/style/Circle.scss +26 -0
- package/src/Components/components/base/Loading/Dot/Dot.ts +13 -0
- package/src/Components/components/base/Loading/Dot/Dot.vue +44 -0
- package/src/Components/components/base/Loading/Dot/style/Dot.scss +61 -0
- package/src/Components/components/base/Loading/Loading.ts +29 -0
- package/src/Components/components/base/Loading/Loading.vue +36 -0
- package/src/Components/components/base/Loading/style/Loading.scss +18 -0
- package/src/Components/components/base/Message/Message.ts +117 -0
- package/src/Components/components/base/Message/Message.vue +60 -0
- package/src/Components/components/base/Message/style/Message.scss +49 -0
- package/src/Components/components/base/MessageGroup/MessageGroup.vue +37 -0
- package/src/Components/components/base/Overlay/Overlay.ts +46 -0
- package/src/Components/components/base/Overlay/Overlay.vue +75 -0
- package/src/Components/components/base/Overlay/style/Overlay.scss +40 -0
- package/src/Components/components/base/Popover/Popover.ts +36 -0
- package/src/Components/components/base/Popover/Popover.vue +44 -0
- package/src/Components/components/base/Popover/PopoverWeb/PopoverWeb.vue +110 -0
- package/src/Components/components/base/Popover/PopoverWx/PopoverWx.vue +15 -0
- package/src/Components/components/base/Popover/style/Popover.scss +30 -0
- package/src/Components/components/base/Popover/utils/calculatePosition.ts +50 -0
- package/src/Components/components/base/Portal/Portal.ts +14 -0
- package/src/Components/components/base/Portal/Portal.vue +26 -0
- package/src/Components/components/base/Portal/miniprogram/Portal.vue +20 -0
- package/src/Components/components/base/Portal/vue2/Portal.vue +53 -0
- package/src/Components/components/base/Portal/vue3/Portal.vue +19 -0
- package/src/Components/components/base/TKImage/TKImage.ts +34 -0
- package/src/Components/components/base/TKImage/TKImage.vue +77 -0
- package/src/Components/components/base/TKImage/style/TKImage.scss +20 -0
- package/src/Components/components/base/TKText/TKText.ts +24 -0
- package/src/Components/components/base/TKText/TKText.vue +43 -0
- package/src/Components/components/base/TKText/style/TKText.scss +19 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindow.ts +19 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindow.vue +46 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.ts +5 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.vue +62 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/style/ToggleWindowItem.scss +38 -0
- package/src/Components/components/base/ToggleWindow/constant.ts +1 -0
- package/src/Components/components/base/ToggleWindow/style/ToggleWindow.scss +7 -0
- package/src/Components/components/base/assets/message/close.svg +5 -0
- package/src/Components/components/base/assets/message/error.svg +1 -0
- package/src/Components/components/base/assets/message/info.svg +1 -0
- package/src/Components/components/base/assets/message/success.svg +1 -0
- package/src/Components/components/base/assets/message/warning.svg +1 -0
- package/src/Components/components/base/constants/index.ts +8 -0
- package/src/Components/components/base/hooks/useListenerEvent.ts +36 -0
- package/src/Components/components/base/hooks/useOnClickOutSide.ts +27 -0
- package/src/Components/components/base/styles/common.scss +43 -0
- package/src/Components/components/base/styles/var.scss +132 -0
- package/src/Components/components/base/util/checkEnv.ts +51 -0
- package/src/Components/components/base/util/checkVueVersion.ts +11 -0
- package/src/Components/components/base/util/classNames.ts +34 -0
- package/src/Components/components/base/util/filterObject.ts +11 -0
- package/src/Components/components/base/util/index.ts +10 -0
- package/src/Components/components/common/AudioStream/AudioStream.ts +29 -0
- package/src/Components/components/common/AudioStream/AudioStream.vue +65 -0
- package/src/Components/components/common/Button/Accept.vue +66 -0
- package/src/Components/components/common/Button/Camera.vue +115 -0
- package/src/Components/components/common/Button/FullScreen.vue +32 -0
- package/src/Components/components/common/Button/Hangup.vue +57 -0
- package/src/Components/components/common/Button/InviteUser.vue +52 -0
- package/src/Components/components/common/Button/Microphone.vue +109 -0
- package/src/Components/components/common/Button/Minimize.vue +41 -0
- package/src/Components/components/common/Button/Reject.vue +52 -0
- package/src/Components/components/common/Button/Speaker.vue +98 -0
- package/src/Components/components/common/Button/SwitchAudioCall.vue +86 -0
- package/src/Components/components/common/Button/SwitchCamera.vue +58 -0
- package/src/Components/components/common/Button/Timer.vue +19 -0
- package/src/Components/components/common/Button/ToggleButtonPanel.vue +44 -0
- package/src/Components/components/common/Button/ToggleSize.vue +50 -0
- package/src/Components/components/common/Button/VirtualBackground.vue +76 -0
- package/src/Components/components/common/Button/hooks/useConfig.ts +33 -0
- package/src/Components/components/common/Button/props/Button.ts +15 -0
- package/src/Components/components/common/Button/style/common.scss +5 -0
- package/src/Components/components/common/Button/style/desktop.scss +49 -0
- package/src/Components/components/common/Button/style/index.scss +2 -0
- package/src/Components/components/common/Button/style/mobile.scss +63 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanel.vue +238 -0
- package/src/Components/components/common/ButtonPanel/config/InitConfig.ts +252 -0
- package/src/Components/components/common/ButtonPanel/config/VirtualBackgroundMobileConfig.ts +29 -0
- package/src/Components/components/common/ButtonPanel/hooks/useButtonPanelLayout.ts +63 -0
- package/src/Components/components/common/DeviceSelect/DeviceSelect.ts +11 -0
- package/src/Components/components/common/DeviceSelect/DeviceSelect.vue +158 -0
- package/src/Components/components/common/FloatWindow/FloatWindow.vue +68 -0
- package/src/Components/components/common/FloatWindow/desktop/FloatWindow.vue +106 -0
- package/src/Components/components/common/FloatWindow/mobile/FloatWindow.vue +28 -0
- package/src/Components/components/common/FloatWindow/mobile/FloatWindowGroupCall.vue +141 -0
- package/src/Components/components/common/FloatWindow/mobile/FloatWindowSingleCall.vue +109 -0
- package/src/Components/components/common/JoinGroupCard/JoinGroupCard.vue +51 -0
- package/src/Components/components/common/JoinGroupCard/desktop/JoinGroupCard.scss +80 -0
- package/src/Components/components/common/JoinGroupCard/desktop/JoinGroupCard.vue +57 -0
- package/src/Components/components/common/JoinGroupCard/mobile/JoinGroupCard.scss +60 -0
- package/src/Components/components/common/JoinGroupCard/mobile/JoinGroupCard.vue +65 -0
- package/src/Components/components/common/MicVolume/MicVolume.vue +37 -0
- package/src/Components/components/common/MicVolume/MicVolumeClosed.vue +11 -0
- package/src/Components/components/common/MicrophoneVolume/MicrophoneVolume.ts +10 -0
- package/src/Components/components/common/MicrophoneVolume/MicrophoneVolume.vue +61 -0
- package/src/Components/components/common/OverlayStream/OverlayStream.ts +102 -0
- package/src/Components/components/common/OverlayStream/OverlayStream.vue +108 -0
- package/src/Components/components/common/OverlayStream/style/OverlayStream.scss +12 -0
- package/src/Components/components/common/OverlayStream/style/mobile.scss +32 -0
- package/src/Components/components/common/OverlayStream/style/pc.scss +21 -0
- package/src/Components/components/common/PermitTip/CloseIcon.vue +3 -0
- package/src/Components/components/common/PermitTip/PermitTip.ts +37 -0
- package/src/Components/components/common/PermitTip/PermitTip.vue +62 -0
- package/src/Components/components/common/PermitTip/SystemPermitTip.vue +160 -0
- package/src/Components/components/common/Player/Player.ts +18 -0
- package/src/Components/components/common/Player/Player.vue +59 -0
- package/src/Components/components/common/Player/WeChatPlayer/WeChatPlayer.vue +101 -0
- package/src/Components/components/common/Player/WeChatPlayer/style/index.scss +38 -0
- package/src/Components/components/common/Popover/Popover.vue +85 -0
- package/src/Components/components/common/Pusher/Pusher.ts +18 -0
- package/src/Components/components/common/Pusher/Pusher.vue +78 -0
- package/src/Components/components/common/Pusher/WeChatPusher/WeChatPusher.vue +70 -0
- package/src/Components/components/common/Pusher/WeChatPusher/style/index.scss +37 -0
- package/src/Components/components/common/SelectUser/SelectUser.vue +74 -0
- package/src/Components/components/common/SelectUser/components/Dialog/TDialog.vue +94 -0
- package/src/Components/components/common/SelectUser/components/Dialog/style/color.css +43 -0
- package/src/Components/components/common/SelectUser/components/Dialog/style/dialog.css +3 -0
- package/src/Components/components/common/SelectUser/components/Dialog/style/h5.css +49 -0
- package/src/Components/components/common/SelectUser/components/Dialog/style/web.css +55 -0
- package/src/Components/components/common/SelectUser/components/Icon/TIcon.vue +44 -0
- package/src/Components/components/common/SelectUser/components/Icon/style/icon.css +6 -0
- package/src/Components/components/common/SelectUser/components/Transfer/TTransfer.vue +304 -0
- package/src/Components/components/common/SelectUser/components/Transfer/icon/back.svg +16 -0
- package/src/Components/components/common/SelectUser/components/Transfer/icon/cancel.svg +23 -0
- package/src/Components/components/common/SelectUser/components/Transfer/icon/selected.svg +27 -0
- package/src/Components/components/common/SelectUser/components/Transfer/style/color.css +64 -0
- package/src/Components/components/common/SelectUser/components/Transfer/style/h5.css +86 -0
- package/src/Components/components/common/SelectUser/components/Transfer/style/transfer.css +17 -0
- package/src/Components/components/common/SelectUser/components/Transfer/style/web.css +146 -0
- package/src/Components/components/common/SelectUser/index.ts +12 -0
- package/src/Components/components/common/Swiper/Swiper.vue +145 -0
- package/src/Components/components/common/Swiper/SwiperSlider.vue +55 -0
- package/src/Components/components/common/Swiper/index.ts +10 -0
- package/src/Components/components/common/Swiper/useSlide.ts +56 -0
- package/src/Components/components/common/Swiper/useSwiperSliders.ts +34 -0
- package/src/Components/components/common/SwiperWx/Swiper.vue +123 -0
- package/src/Components/components/common/SwiperWx/SwiperSlider.vue +87 -0
- package/src/Components/components/common/SwiperWx/index.ts +5 -0
- package/src/Components/components/common/SwiperWx/useSlide.ts +60 -0
- package/src/Components/components/common/SwiperWx/useSwiperSliders.ts +23 -0
- package/src/Components/components/common/TKStreamInfo/StreamInfo.ts +34 -0
- package/src/Components/components/common/TKStreamInfo/StreamInfoMobile.vue +82 -0
- package/src/Components/components/common/TKStreamInfo/StreamInfoPC.vue +58 -0
- package/src/Components/components/common/TKStreamInfo/TKStreamInfo.vue +47 -0
- package/src/Components/components/common/Timer/Timer.ts +14 -0
- package/src/Components/components/common/Timer/Timer.vue +24 -0
- package/src/Components/components/common/Tip/Tip.ts +5 -0
- package/src/Components/components/common/Tip/Tip.vue +67 -0
- package/src/Components/components/common/Toast/Toast.ts +87 -0
- package/src/Components/components/common/Toast/Toast.vue +133 -0
- package/src/Components/components/common/Toast/index.ts +6 -0
- package/src/Components/components/common/Toast/type.ts +16 -0
- package/src/Components/components/common/TopBar/TopBar.ts +8 -0
- package/src/Components/components/common/TopBar/TopBar.vue +120 -0
- package/src/Components/components/common/Waiting/Waiting.vue +126 -0
- package/src/Components/components/config/button/ClosedPanelUI.ts +109 -0
- package/src/Components/components/config/button/DefaultUI.ts +550 -0
- package/src/Components/components/config/button/index.ts +2 -0
- package/src/Components/context/ButtonPanelContext.ts +6 -0
- package/src/Components/context/CallInfoContext.ts +15 -0
- package/src/Components/context/CallerUserInfoContext.ts +9 -0
- package/src/Components/context/CustomUIConfigContext.ts +1 -0
- package/src/Components/context/FloatWindowContext.ts +5 -0
- package/src/Components/context/FocusItemContext.ts +1 -0
- package/src/Components/context/IsClickableContext.ts +1 -0
- package/src/Components/context/PopoverContext.ts +1 -0
- package/src/Components/context/TranslateContext.ts +1 -0
- package/src/Components/context/UserInfoContextExcludeVolume.ts +8 -0
- package/src/Components/context/index.ts +10 -0
- package/src/Components/hooks/index.ts +22 -0
- package/src/Components/hooks/useButtonPanelStatus.ts +6 -0
- package/src/Components/hooks/useCallDuration.ts +32 -0
- package/src/Components/hooks/useCallInfoContext.ts +6 -0
- package/src/Components/hooks/useCallerUserInfoContext.ts +6 -0
- package/src/Components/hooks/useCustomUI.ts +7 -0
- package/src/Components/hooks/useCustomUIButtonConfig.ts +96 -0
- package/src/Components/hooks/useDeviceList.ts +51 -0
- package/src/Components/hooks/useFloatWindowContext.ts +6 -0
- package/src/Components/hooks/useFocusContext.ts +6 -0
- package/src/Components/hooks/useGetVolumeMap.ts +59 -0
- package/src/Components/hooks/useGroupCallLayout.ts +142 -0
- package/src/Components/hooks/useIsClickableContext.ts +6 -0
- package/src/Components/hooks/useJoinGroupCall.ts +69 -0
- package/src/Components/hooks/useNetWorkStatus.ts +30 -0
- package/src/Components/hooks/usePlayer.ts +32 -0
- package/src/Components/hooks/usePopover.ts +6 -0
- package/src/Components/hooks/useTip.ts +42 -0
- package/src/Components/hooks/useTranslate.ts +7 -0
- package/src/Components/hooks/useUserInfoContextExcludeVolume.ts +6 -0
- package/src/Components/hooks/useViewBackgroundConfig.ts +12 -0
- package/src/Components/util/deepClone.ts +15 -0
- package/src/Components/util/findValues.ts +21 -0
- package/src/Components/util/index.ts +6 -0
- package/src/Components/util/isEmpty.ts +15 -0
- package/src/Components/util/isEqual.ts +40 -0
- package/src/Components/util/isObject.ts +3 -0
- package/src/Components/util/stringToPath.ts +78 -0
- package/src/Components/util/toggleScreen.ts +10 -0
- package/src/Components/util/uiConfig.ts +74 -0
- package/src/TUICallService/CallService/UIDesign.ts +174 -0
- package/src/TUICallService/CallService/bellContext.ts +88 -0
- package/src/TUICallService/CallService/chatCombine.ts +313 -0
- package/src/TUICallService/CallService/engineEventHandler.ts +404 -0
- package/src/TUICallService/CallService/index.ts +797 -0
- package/src/TUICallService/CallService/miniProgram.ts +65 -0
- package/src/TUICallService/CallService/utils.ts +281 -0
- package/src/TUICallService/TUIGlobal/tuiGlobal.ts +43 -0
- package/src/TUICallService/TUIStore/callStore.ts +93 -0
- package/src/TUICallService/TUIStore/tuiStore.ts +167 -0
- package/src/TUICallService/assets/phone_dialing.mp3 +0 -0
- package/src/TUICallService/assets/phone_ringing.mp3 +0 -0
- package/src/TUICallService/const/call.ts +157 -0
- package/src/TUICallService/const/error.ts +20 -0
- package/src/TUICallService/const/index.ts +103 -0
- package/src/TUICallService/const/log.ts +9 -0
- package/src/TUICallService/index.ts +37 -0
- package/src/TUICallService/interface/ICallService.ts +70 -0
- package/src/TUICallService/interface/ICallStore.ts +55 -0
- package/src/TUICallService/interface/ITUIGlobal.ts +36 -0
- package/src/TUICallService/interface/ITUIStore.ts +87 -0
- package/src/TUICallService/interface/index.ts +4 -0
- package/src/TUICallService/locales/en.ts +135 -0
- package/src/TUICallService/locales/index.ts +61 -0
- package/src/TUICallService/locales/ja_JP.ts +134 -0
- package/src/TUICallService/locales/zh-cn.ts +130 -0
- package/src/TUICallService/serve/callManager.ts +109 -0
- package/src/TUICallService/utils/common-utils.ts +269 -0
- package/src/TUICallService/utils/decorators/promise-retry.ts +51 -0
- package/src/TUICallService/utils/env.ts +51 -0
- package/src/TUICallService/utils/index.ts +32 -0
- package/src/TUICallService/utils/is-empty.ts +31 -0
- package/src/TUICallService/utils/retry.ts +88 -0
- package/src/TUICallService/utils/timer.ts +162 -0
- package/src/TUICallService/utils/validate/avoidRepeatedCall.ts +39 -0
- package/src/TUICallService/utils/validate/index.ts +7 -0
- package/src/TUICallService/utils/validate/validateConfig.ts +203 -0
- package/src/TUICallService/utils/validate/validateParams.ts +88 -0
- package/src/TUICallService/utils/validate/validateStatus.ts +26 -0
- package/src/adapter-vue.ts +4 -0
- package/src/index.ts +65 -0
- package/tuicall-uikit-vue2.es.js +12469 -0
- package/tuicall-uikit-vue2.umd.js +102 -0
- package/types/Components/assets/desktop/permission/index.d.ts +5 -0
- package/types/Components/assets/permission/desktop/index.d.ts +5 -0
- package/types/Components/components/SingleCall/hooks/useGetLargeViewName.d.ts +2 -0
- package/types/Components/components/base/Avatar/Avatar.d.ts +34 -0
- package/types/Components/components/base/Button/Button.d.ts +56 -0
- package/types/Components/components/base/Grid/Grid.d.ts +23 -0
- package/types/Components/components/base/Icon/Icon.d.ts +9 -0
- package/types/Components/components/base/Layout/Col/Col.d.ts +20 -0
- package/types/Components/components/base/Layout/Row/Row.d.ts +20 -0
- package/types/Components/components/base/Layout/constant.d.ts +1 -0
- package/types/Components/components/base/Loading/Circle/Circle.d.ts +13 -0
- package/types/Components/components/base/Loading/Dot/Dot.d.ts +13 -0
- package/types/Components/components/base/Loading/Loading.d.ts +26 -0
- package/types/Components/components/base/Message/Message.d.ts +50 -0
- package/types/Components/components/base/Overlay/Overlay.d.ts +45 -0
- package/types/Components/components/base/Popover/Popover.d.ts +34 -0
- package/types/Components/components/base/Popover/utils/calculatePosition.d.ts +4 -0
- package/types/Components/components/base/Portal/Portal.d.ts +14 -0
- package/types/Components/components/base/TKImage/TKImage.d.ts +33 -0
- package/types/Components/components/base/TKText/TKText.d.ts +24 -0
- package/types/Components/components/base/ToggleWindow/ToggleWindow.d.ts +18 -0
- package/types/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.d.ts +5 -0
- package/types/Components/components/base/ToggleWindow/constant.d.ts +1 -0
- package/types/Components/components/base/constants/index.d.ts +7 -0
- package/types/Components/components/base/hooks/useListenerEvent.d.ts +13 -0
- package/types/Components/components/base/hooks/useOnClickOutSide.d.ts +1 -0
- package/types/Components/components/base/util/checkEnv.d.ts +10 -0
- package/types/Components/components/base/util/checkVueVersion.d.ts +4 -0
- package/types/Components/components/base/util/classNames.d.ts +1 -0
- package/types/Components/components/base/util/filterObject.d.ts +1 -0
- package/types/Components/components/base/util/index.d.ts +5 -0
- package/types/Components/components/common/AudioStream/AudioStream.d.ts +29 -0
- package/types/Components/components/common/Button/hooks/useConfig.d.ts +2 -0
- package/types/Components/components/common/Button/props/Button.d.ts +15 -0
- package/types/Components/components/common/ButtonPanel/config/InitConfig.d.ts +89 -0
- package/types/Components/components/common/ButtonPanel/config/VirtualBackgroundMobileConfig.d.ts +66 -0
- package/types/Components/components/common/ButtonPanel/hooks/useButtonPanelLayout.d.ts +4 -0
- package/types/Components/components/common/DeviceSelect/DeviceSelect.d.ts +11 -0
- package/types/Components/components/common/MicrophoneVolume/MicrophoneVolume.d.ts +10 -0
- package/types/Components/components/common/OverlayStream/OverlayStream.d.ts +92 -0
- package/types/Components/components/common/PermitTip/PermitTip.d.ts +3 -0
- package/types/Components/components/common/Player/Player.d.ts +18 -0
- package/types/Components/components/common/Pusher/Pusher.d.ts +18 -0
- package/types/Components/components/common/SelectUser/index.d.ts +6 -0
- package/types/Components/components/common/Swiper/index.d.ts +7 -0
- package/types/Components/components/common/Swiper/useSlide.d.ts +7 -0
- package/types/Components/components/common/Swiper/useSwiperSliders.d.ts +1 -0
- package/types/Components/components/common/SwiperWx/index.d.ts +4 -0
- package/types/Components/components/common/SwiperWx/useSlide.d.ts +9 -0
- package/types/Components/components/common/SwiperWx/useSwiperSliders.d.ts +1 -0
- package/types/Components/components/common/TKStreamInfo/StreamInfo.d.ts +34 -0
- package/types/Components/components/common/Timer/Timer.d.ts +14 -0
- package/types/Components/components/common/Tip/Tip.d.ts +5 -0
- package/types/Components/components/common/Toast/Toast.d.ts +4 -0
- package/types/Components/components/common/Toast/index.d.ts +2 -0
- package/types/Components/components/common/Toast/type.d.ts +16 -0
- package/types/Components/components/common/TopBar/TopBar.d.ts +8 -0
- package/types/Components/components/config/button/ClosedPanelUI.d.ts +3380 -0
- package/types/Components/components/config/button/DefaultUI.d.ts +14751 -0
- package/types/Components/components/config/button/index.d.ts +2 -0
- package/types/Components/context/ButtonPanelContext.d.ts +4 -0
- package/types/Components/context/CallInfoContext.d.ts +13 -0
- package/types/Components/context/CallerUserInfoContext.d.ts +8 -0
- package/types/Components/context/CustomUIConfigContext.d.ts +1 -0
- package/types/Components/context/FloatWindowContext.d.ts +4 -0
- package/types/Components/context/FocusItemContext.d.ts +1 -0
- package/types/Components/context/IsClickableContext.d.ts +1 -0
- package/types/Components/context/PopoverContext.d.ts +1 -0
- package/types/Components/context/TranslateContext.d.ts +1 -0
- package/types/Components/context/UserInfoContextExcludeVolume.d.ts +6 -0
- package/types/Components/context/index.d.ts +10 -0
- package/types/Components/hooks/index.d.ts +20 -0
- package/types/Components/hooks/useButtonPanelStatus.d.ts +2 -0
- package/types/Components/hooks/useCallDuration.d.ts +3 -0
- package/types/Components/hooks/useCallInfoContext.d.ts +2 -0
- package/types/Components/hooks/useCallerUserInfoContext.d.ts +2 -0
- package/types/Components/hooks/useCustomUI.d.ts +3 -0
- package/types/Components/hooks/useCustomUIButtonConfig.d.ts +1 -0
- package/types/Components/hooks/useDeviceList.d.ts +7 -0
- package/types/Components/hooks/useFloatWindowContext.d.ts +2 -0
- package/types/Components/hooks/useFocusContext.d.ts +1 -0
- package/types/Components/hooks/useGetVolumeMap.d.ts +1 -0
- package/types/Components/hooks/useGroupCallLayout.d.ts +1 -0
- package/types/Components/hooks/useIsClickableContext.d.ts +2 -0
- package/types/Components/hooks/useJoinGroupCall.d.ts +9 -0
- package/types/Components/hooks/useNetWorkStatus.d.ts +3 -0
- package/types/Components/hooks/usePlayer.d.ts +1 -0
- package/types/Components/hooks/usePopover.d.ts +2 -0
- package/types/Components/hooks/useTip.d.ts +5 -0
- package/types/Components/hooks/useTranslate.d.ts +2 -0
- package/types/Components/hooks/useUserInfoContextExcludeVolume.d.ts +2 -0
- package/types/Components/hooks/useViewBackgroundConfig.d.ts +1 -0
- package/types/Components/util/deepClone.d.ts +1 -0
- package/types/Components/util/findValues.d.ts +1 -0
- package/types/Components/util/index.d.ts +6 -0
- package/types/Components/util/isEmpty.d.ts +1 -0
- package/types/Components/util/isEqual.d.ts +1 -0
- package/types/Components/util/isObject.d.ts +1 -0
- package/types/Components/util/stringToPath.d.ts +12 -0
- package/types/Components/util/toggleScreen.d.ts +1 -0
- package/types/Components/util/uiConfig.d.ts +3 -0
- package/types/TUICallService/CallService/UIDesign.d.ts +28 -0
- package/types/TUICallService/CallService/bellContext.d.ts +19 -0
- package/types/TUICallService/CallService/chatCombine.d.ts +50 -0
- package/types/TUICallService/CallService/engineEventHandler.d.ts +35 -0
- package/types/TUICallService/CallService/index.d.ts +98 -0
- package/types/TUICallService/CallService/miniProgram.d.ts +7 -0
- package/types/TUICallService/CallService/utils.d.ts +42 -0
- package/types/TUICallService/TUIGlobal/tuiGlobal.d.ts +21 -0
- package/types/TUICallService/TUIStore/callStore.d.ts +10 -0
- package/types/TUICallService/TUIStore/tuiStore.d.ts +57 -0
- package/types/TUICallService/const/call.d.ts +141 -0
- package/types/TUICallService/const/error.d.ts +2 -0
- package/types/TUICallService/const/index.d.ts +27 -0
- package/types/TUICallService/const/log.d.ts +7 -0
- package/types/TUICallService/index.d.ts +5 -0
- package/types/TUICallService/interface/ICallService.d.ts +69 -0
- package/types/TUICallService/interface/ICallStore.d.ts +47 -0
- package/types/TUICallService/interface/ITUIGlobal.d.ts +36 -0
- package/types/TUICallService/interface/ITUIStore.d.ts +83 -0
- package/types/TUICallService/interface/index.d.ts +4 -0
- package/types/TUICallService/locales/en.d.ts +128 -0
- package/types/TUICallService/locales/index.d.ts +10 -0
- package/types/TUICallService/locales/ja_JP.d.ts +127 -0
- package/types/TUICallService/locales/zh-cn.d.ts +123 -0
- package/types/TUICallService/serve/callManager.d.ts +11 -0
- package/types/TUICallService/utils/common-utils.d.ts +62 -0
- package/types/TUICallService/utils/decorators/promise-retry.d.ts +32 -0
- package/types/TUICallService/utils/env.d.ts +10 -0
- package/types/TUICallService/utils/index.d.ts +2 -0
- package/types/TUICallService/utils/is-empty.d.ts +2 -0
- package/types/TUICallService/utils/retry.d.ts +36 -0
- package/types/TUICallService/utils/timer.d.ts +64 -0
- package/types/TUICallService/utils/validate/avoidRepeatedCall.d.ts +10 -0
- package/types/TUICallService/utils/validate/index.d.ts +2 -0
- package/types/TUICallService/utils/validate/validateConfig.d.ts +188 -0
- package/types/TUICallService/utils/validate/validateParams.d.ts +1 -0
- package/types/TUICallService/utils/validate/validateStatus.d.ts +5 -0
- package/types/adapter-vue.d.ts +2 -0
- package/types/index.d.ts +11 -0
- package/types/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div @click="toggleViewSize">
|
|
3
|
+
<live-pusher
|
|
4
|
+
:class="screen ? 'pusher-box' : 'player-container'"
|
|
5
|
+
:url="pusher.url"
|
|
6
|
+
:mode="pusher.mode"
|
|
7
|
+
:autopush="true"
|
|
8
|
+
:enable-camera="pusher.enableCamera"
|
|
9
|
+
:enable-mic="true"
|
|
10
|
+
:muted="!pusher.enableMic"
|
|
11
|
+
:enable-agc="true"
|
|
12
|
+
:enable-ans="true"
|
|
13
|
+
:enable-ear-monitor="pusher.enableEarMonitor"
|
|
14
|
+
auto-focus="false"
|
|
15
|
+
:zoom="pusher.enableZoom"
|
|
16
|
+
:min-bitrate="pusher.minBitrate"
|
|
17
|
+
:max-bitrate="pusher.maxBitrate"
|
|
18
|
+
:video-width="pusher.videoWidth"
|
|
19
|
+
:video-height="pusher.videoHeight"
|
|
20
|
+
:beauty="pusher.beautyLevel"
|
|
21
|
+
:whiteness="pusher.whitenessLevel"
|
|
22
|
+
:orientation="pusher.videoOrientation"
|
|
23
|
+
:aspect="pusher.videoAspect"
|
|
24
|
+
:device-position="pusher.frontCamera"
|
|
25
|
+
:remote-mirror="pusher.enableRemoteMirror"
|
|
26
|
+
:local-mirror="pusher.localMirror"
|
|
27
|
+
:background-mute="pusher.enableBackgroundMute"
|
|
28
|
+
:audio-quality="pusher.audioQuality"
|
|
29
|
+
:audio-volume-type="pusher.audioVolumeType"
|
|
30
|
+
:audio-reverb-type="pusher.audioReverbType"
|
|
31
|
+
:waiting-img="pusher.waitingImage"
|
|
32
|
+
:beauty-style="pusher.beautyStyle"
|
|
33
|
+
:filter="pusher.filter"
|
|
34
|
+
@statechange="pusherStateChangeHandler"
|
|
35
|
+
@netstatus="pusherNetStatus"
|
|
36
|
+
@error="pusherErrorHandler"
|
|
37
|
+
@audiovolumenotify="pusherAudioVolumeNotify"
|
|
38
|
+
></live-pusher>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script lang="ts" setup>
|
|
43
|
+
import { TUICallKitAPI, StoreName, NAME, TUIStore, CallStatus } from '../../../../../TUICallService/index';
|
|
44
|
+
import { onMounted, ref, onUnmounted } from '../../../../../adapter-vue';
|
|
45
|
+
const pusher = ref(TUIStore.getData(StoreName.CALL, NAME.PUSHER));
|
|
46
|
+
const callStatus = ref(TUIStore.getData(StoreName.CALL, NAME.CALL_STATUS));
|
|
47
|
+
const props = defineProps({
|
|
48
|
+
screen: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
required: true,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
const emit = defineEmits(['toggleViewSize']);
|
|
54
|
+
|
|
55
|
+
function toggleViewSize() {
|
|
56
|
+
if (callStatus.value !== CallStatus.CONNECTED || props.screen) return;
|
|
57
|
+
emit('toggleViewSize');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const handlePusherChange = (value) => {
|
|
61
|
+
pusher.value = Object.assign({}, pusher.value, value);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const handleCallStatusChange = (value) => {
|
|
65
|
+
callStatus.value = value;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const watchOptions = {
|
|
69
|
+
[NAME.PUSHER]: handlePusherChange,
|
|
70
|
+
[NAME.CALL_STATUS]: handleCallStatusChange,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
onMounted(() => {
|
|
74
|
+
TUIStore.watch(StoreName.CALL, watchOptions, { notifyRangeWhenWatch: NAME.MYSELF });
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
onUnmounted(() => {
|
|
78
|
+
TUIStore.unwatch(StoreName.CALL, watchOptions);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
function pusherStateChangeHandler(e: any) {
|
|
82
|
+
TUICallKitAPI._tuiCallEngine._pusherStateChangeHandler(e);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function pusherNetStatus(e: any) {
|
|
86
|
+
TUICallKitAPI._tuiCallEngine._pusherNetStatus(e);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function pusherErrorHandler(e: any) {
|
|
90
|
+
TUICallKitAPI._tuiCallEngine._pusherNetStatus(e);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function pusherAudioVolumeNotify(e: any) {
|
|
94
|
+
TUICallKitAPI._tuiCallEngine._pusherAudioVolumeNotify(e);
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style>
|
|
99
|
+
.pusher-box {
|
|
100
|
+
width: 100vw;
|
|
101
|
+
height: 100vh;
|
|
102
|
+
z-index: -1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.player-container {
|
|
106
|
+
position: fixed;
|
|
107
|
+
top: 60px;
|
|
108
|
+
right: 40px;
|
|
109
|
+
z-index: 999;
|
|
110
|
+
width: 140px;
|
|
111
|
+
height: 200px;
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="singlecall-container">
|
|
3
|
+
<TopBar />
|
|
4
|
+
<Waiting v-if="callStatus === CallStatus.CALLING" />
|
|
5
|
+
<MediaContainer />
|
|
6
|
+
<Tip />
|
|
7
|
+
<ButtonPanel />
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { toRefs } from '../../../adapter-vue';
|
|
13
|
+
import { CallStatus } from '../../../TUICallService';
|
|
14
|
+
import TopBar from '../common/TopBar/TopBar.vue';
|
|
15
|
+
import Waiting from '../common/Waiting/Waiting.vue';
|
|
16
|
+
import MediaContainer from './MediaContainer/MediaContainer.vue';
|
|
17
|
+
import Tip from '../common/Tip/Tip.vue';
|
|
18
|
+
import ButtonPanel from '../common/ButtonPanel/ButtonPanel.vue';
|
|
19
|
+
import { useCallInfoContext } from '../../hooks';
|
|
20
|
+
|
|
21
|
+
const { callStatus } = toRefs(useCallInfoContext());
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style lang="scss" scoped>
|
|
25
|
+
.singlecall-container {
|
|
26
|
+
height: 100%;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CallStatus, LayoutMode, ViewName } from '../../../../TUICallService/const';
|
|
2
|
+
import { ref, watch, toRefs } from '../../../../adapter-vue';
|
|
3
|
+
import { useCallInfoContext, useCustomUI, useUserInfoExcludeVolumeContext } from '../../../hooks';
|
|
4
|
+
|
|
5
|
+
export function useGetLargeViewName() {
|
|
6
|
+
const config = useCustomUI();
|
|
7
|
+
const { callStatus } = toRefs(useCallInfoContext());
|
|
8
|
+
const largeViewName = ref(ViewName.LOCAL);
|
|
9
|
+
const { remoteUserListExcludeVolume } = toRefs(useUserInfoExcludeVolumeContext());
|
|
10
|
+
|
|
11
|
+
watch([remoteUserListExcludeVolume, config, callStatus], () => {
|
|
12
|
+
if (callStatus.value === CallStatus.CALLING) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const c2cLayoutModes = [LayoutMode.RemoteInLargeView, LayoutMode.LocalInLargeView];
|
|
17
|
+
const customLayoutMode = config.value?.layoutMode;
|
|
18
|
+
if (c2cLayoutModes.includes(customLayoutMode)) {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
largeViewName.value = config.value?.layoutMode;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (remoteUserListExcludeVolume.value?.[0]?.isEnter) {
|
|
25
|
+
largeViewName.value = ViewName.REMOTE;
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
immediate: true,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return largeViewName;
|
|
32
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const Fit = ['fill', 'contain', 'cover'] as const;
|
|
2
|
+
const Shape = ['circle', 'square'] as const;
|
|
3
|
+
|
|
4
|
+
export const AvatarProps = {
|
|
5
|
+
icon: {
|
|
6
|
+
type: String,
|
|
7
|
+
},
|
|
8
|
+
size: {
|
|
9
|
+
type: [Number, String],
|
|
10
|
+
default: 100,
|
|
11
|
+
},
|
|
12
|
+
shape: {
|
|
13
|
+
type: String,
|
|
14
|
+
values: Shape,
|
|
15
|
+
default: 'square',
|
|
16
|
+
},
|
|
17
|
+
src: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
20
|
+
defaultSrc: {
|
|
21
|
+
type: String,
|
|
22
|
+
},
|
|
23
|
+
text: {
|
|
24
|
+
type: String,
|
|
25
|
+
},
|
|
26
|
+
fit: {
|
|
27
|
+
type: String,
|
|
28
|
+
values: Fit,
|
|
29
|
+
default: 'cover',
|
|
30
|
+
},
|
|
31
|
+
customClass: {
|
|
32
|
+
type: String,
|
|
33
|
+
},
|
|
34
|
+
} as const;
|
|
35
|
+
|
|
36
|
+
export const avatarEmits = {
|
|
37
|
+
error: (evt) => evt,
|
|
38
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classname" :style="[avatarStyle]">
|
|
3
|
+
<TKImage v-if="avatarSrc" :fit="fit" :width="width" :height="height" :src="avatarSrc" @error="handleError" />
|
|
4
|
+
<slot v-else />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default {
|
|
10
|
+
options: {
|
|
11
|
+
virtualHost: true,
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { computed, ref, watch } from '../../../../adapter-vue';
|
|
18
|
+
import TKImage from '../TKImage/TKImage.vue';
|
|
19
|
+
import { classNames } from '../util';
|
|
20
|
+
import { AvatarProps } from './Avatar';
|
|
21
|
+
import { PREFIX } from '../constants/index';
|
|
22
|
+
|
|
23
|
+
const props = defineProps(AvatarProps);
|
|
24
|
+
|
|
25
|
+
const avatarSrc = ref('');
|
|
26
|
+
|
|
27
|
+
watch(() => props.src, () => {
|
|
28
|
+
avatarSrc.value = props.src;
|
|
29
|
+
}, {
|
|
30
|
+
immediate: true,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const classname = computed(() => classNames([
|
|
34
|
+
`${PREFIX}-avatar`,
|
|
35
|
+
`${PREFIX}-avatar--${props.shape}`,
|
|
36
|
+
`${PREFIX}-avatar--${props.size}`,
|
|
37
|
+
props.customClass,
|
|
38
|
+
]));
|
|
39
|
+
const width = computed(() => typeof props.size === 'number' ? `${props.size}px` : props.size);
|
|
40
|
+
const height = computed(() => typeof props.size === 'number' ? `${props.size}px` : props.size);
|
|
41
|
+
const avatarStyle = computed(() => ({ width: width.value, height: height.value }));
|
|
42
|
+
|
|
43
|
+
function handleError(e) {
|
|
44
|
+
console.error(e);
|
|
45
|
+
if (props.defaultSrc) {
|
|
46
|
+
avatarSrc.value = props.defaultSrc;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style lang="scss">
|
|
52
|
+
@import './style/Avatar.scss';
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@import '../../styles/var.scss';
|
|
2
|
+
@import '../../styles/common.scss';
|
|
3
|
+
|
|
4
|
+
$--tk-avatar-text-color: $--tk-color-white;
|
|
5
|
+
$--tk-avatar-bg-color: $--tk-text-color-disabled;
|
|
6
|
+
$--tk-avatar-text-size: 14px;
|
|
7
|
+
$--tk-avatar-icon-size: 18px;
|
|
8
|
+
$--tk-avatar-border-radius: $--tk-border-radius-base;
|
|
9
|
+
$--tk-avatar-size-large: 56px;
|
|
10
|
+
$--tk-avatar-size-small: 24px;
|
|
11
|
+
$--tk-avatar-size: 40px;
|
|
12
|
+
|
|
13
|
+
.#{$PREFIX}-avatar {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
align-items: center;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
text-align: center;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
color: $--tk-avatar-text-color;
|
|
21
|
+
background: $--tk-avatar-bg-color;
|
|
22
|
+
width: $--tk-avatar-size;
|
|
23
|
+
height: $--tk-avatar-size;
|
|
24
|
+
font-size: $--tk-avatar-text-size;
|
|
25
|
+
|
|
26
|
+
&.#{$PREFIX}-avatar--square {
|
|
27
|
+
border-radius: $--tk-avatar-border-radius;
|
|
28
|
+
}
|
|
29
|
+
&.#{$PREFIX}-avatar--circle {
|
|
30
|
+
border-radius: $--tk-border-radius-circle;
|
|
31
|
+
}
|
|
32
|
+
.#{$PREFIX}-avatar_img {
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
}
|
|
36
|
+
.#{$PREFIX}-avatar_image {
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const Size = ['small','middle','large'] as const;
|
|
2
|
+
const Direction = ['row','column'] as const;
|
|
3
|
+
const Shape = ['circle','round'] as const;
|
|
4
|
+
|
|
5
|
+
export const ButtonProps = {
|
|
6
|
+
iconSrc: {
|
|
7
|
+
type: String,
|
|
8
|
+
},
|
|
9
|
+
iconSize: {
|
|
10
|
+
type: Number,
|
|
11
|
+
},
|
|
12
|
+
text: {
|
|
13
|
+
type: String,
|
|
14
|
+
},
|
|
15
|
+
loading: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false,
|
|
18
|
+
},
|
|
19
|
+
loadingColor: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: '#fff',
|
|
22
|
+
},
|
|
23
|
+
loadingWidth: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: '40px',
|
|
26
|
+
},
|
|
27
|
+
loadingHeight: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: '40px',
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
type: String,
|
|
33
|
+
values: Size,
|
|
34
|
+
default: 'middle',
|
|
35
|
+
},
|
|
36
|
+
width: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
height: {
|
|
40
|
+
type: String,
|
|
41
|
+
},
|
|
42
|
+
color: {
|
|
43
|
+
type: String,
|
|
44
|
+
},
|
|
45
|
+
direction: {
|
|
46
|
+
type: String,
|
|
47
|
+
values: Direction,
|
|
48
|
+
default: 'row',
|
|
49
|
+
},
|
|
50
|
+
shape: {
|
|
51
|
+
type: String,
|
|
52
|
+
values: Shape,
|
|
53
|
+
},
|
|
54
|
+
buttonStyle: {
|
|
55
|
+
type: Object,
|
|
56
|
+
},
|
|
57
|
+
buttonTextStyle: {
|
|
58
|
+
type: Object,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="[style]" :class="buttonClassName" @click="handleClick">
|
|
3
|
+
<Loading
|
|
4
|
+
v-if="loading"
|
|
5
|
+
:loadingWidth="loadingWidth"
|
|
6
|
+
:loadingHeight="loadingHeight"
|
|
7
|
+
:color="loadingColor"
|
|
8
|
+
/>
|
|
9
|
+
<Icon v-if="iconSrc && !loading" :size="iconSize" :src="iconSrc"></Icon>
|
|
10
|
+
<div
|
|
11
|
+
v-if="text"
|
|
12
|
+
:style="[buttonTextStyle]"
|
|
13
|
+
:class="buttonTextClassName"
|
|
14
|
+
>
|
|
15
|
+
{{ text }}
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
export default {
|
|
22
|
+
options: {
|
|
23
|
+
virtualHost: true,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import { computed } from '../../../../adapter-vue';
|
|
30
|
+
import Loading from '../Loading/Loading.vue';
|
|
31
|
+
import Icon from '../Icon/Icon.vue';
|
|
32
|
+
import { classNames, IS_PC } from '../util';
|
|
33
|
+
import { ButtonProps } from './Button';
|
|
34
|
+
import { PREFIX } from '../constants/index';
|
|
35
|
+
|
|
36
|
+
const props = defineProps(ButtonProps);
|
|
37
|
+
const buttonTextClassName = `${PREFIX}-button--content`;
|
|
38
|
+
const style = computed(() => ({
|
|
39
|
+
width: props.width,
|
|
40
|
+
height: props.height,
|
|
41
|
+
backgroundColor: props.color,
|
|
42
|
+
flexDirection: props.direction,
|
|
43
|
+
cursor: IS_PC ? 'pointer' : 'auto',
|
|
44
|
+
...props.buttonStyle,
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
const buttonClassName = classNames([
|
|
48
|
+
`${PREFIX}-button`,
|
|
49
|
+
{[`${PREFIX}-${props.shape}`]: props.shape},
|
|
50
|
+
`${PREFIX}-button--${props.size}`
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
const emit = defineEmits(['click']);
|
|
54
|
+
const handleClick = (event) => {
|
|
55
|
+
!props.loading && emit('click', event);
|
|
56
|
+
};
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<style lang="scss">
|
|
60
|
+
@import './style/Button.scss';
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@import '../../styles/var.scss';
|
|
2
|
+
@import '../../styles/common.scss';
|
|
3
|
+
|
|
4
|
+
$--tk-button-size-default: $--tk-button-size-middle;
|
|
5
|
+
|
|
6
|
+
.#{$PREFIX}-button {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
|
|
11
|
+
&.#{$PREFIX}-button--small {
|
|
12
|
+
height: $--tk-button-size-small;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.#{$PREFIX}-button--middle {
|
|
16
|
+
height: $--tk-button-size-middle;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.#{$PREFIX}-button--large {
|
|
20
|
+
height: $--tk-button-size-large;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.#{$PREFIX}-button--content {
|
|
24
|
+
color: $--tk-text-color-regular;
|
|
25
|
+
font-size: $--tk-font-size-base;
|
|
26
|
+
font-weight: $--tk-font-weight-primary;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.#{$PREFIX}-circle {
|
|
30
|
+
&.#{$PREFIX}-button--small {
|
|
31
|
+
width: $--tk-button-size-small;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.#{$PREFIX}-button--default {
|
|
35
|
+
width: $--tk-button-size-default;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.#{$PREFIX}-button--large {
|
|
39
|
+
width: $--tk-button-size-large;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const Unit = ['%', 'vw'];
|
|
2
|
+
|
|
3
|
+
export const GridProps = {
|
|
4
|
+
length: {
|
|
5
|
+
type: Number,
|
|
6
|
+
default: 0,
|
|
7
|
+
},
|
|
8
|
+
unit: {
|
|
9
|
+
type: String,
|
|
10
|
+
values: Unit,
|
|
11
|
+
default: '%',
|
|
12
|
+
},
|
|
13
|
+
enableFocus: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
layout: {
|
|
18
|
+
type: Array,
|
|
19
|
+
},
|
|
20
|
+
focus: {
|
|
21
|
+
type: [String, Number],
|
|
22
|
+
},
|
|
23
|
+
} as const;
|
|
24
|
+
|
|
25
|
+
export const ChangeFocusEmits = ['change', 'toggle'];
|
|
26
|
+
export const GridContextKey = 'GridContextKey';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="{ height: '100%'}">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
export default {
|
|
9
|
+
options: {
|
|
10
|
+
virtualHost: true
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { provide, watch, ref } from '../../../../adapter-vue';
|
|
17
|
+
import { ChangeFocusEmits, GridContextKey, GridProps } from './Grid';
|
|
18
|
+
|
|
19
|
+
const props = defineProps(GridProps);
|
|
20
|
+
const focus = ref(props.focus);
|
|
21
|
+
const layout = ref(props.layout);
|
|
22
|
+
const unit = ref(props.unit);
|
|
23
|
+
const emit = defineEmits(ChangeFocusEmits);
|
|
24
|
+
|
|
25
|
+
function handleFocusChange(value) {
|
|
26
|
+
emit('toggle', value);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
watch(() => props.focus, () => focus.value = props.focus);
|
|
30
|
+
watch(() => props.layout, () => layout.value = props.layout);
|
|
31
|
+
watch(() => props.unit, () => unit.value = props.unit);
|
|
32
|
+
|
|
33
|
+
provide(GridContextKey, {
|
|
34
|
+
layout,
|
|
35
|
+
enableFocus: props.enableFocus,
|
|
36
|
+
handleFocusChange,
|
|
37
|
+
focus,
|
|
38
|
+
unit,
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="show"
|
|
4
|
+
:class="gridItemClassName"
|
|
5
|
+
:style="[style]"
|
|
6
|
+
@click="handleClick"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
export default {
|
|
14
|
+
options: {
|
|
15
|
+
virtualHost: true
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { inject, computed, ref, watchEffect, watch, onUnmounted } from '../../../../../adapter-vue';
|
|
22
|
+
import { GridContextKey } from '../Grid';
|
|
23
|
+
import { PREFIX } from '../../constants/index';
|
|
24
|
+
import { IS_PC, IS_H5, classNames, findTarget } from '../../util';
|
|
25
|
+
|
|
26
|
+
const props = defineProps(['index', 'height', 'customStyle']);
|
|
27
|
+
const {
|
|
28
|
+
layout,
|
|
29
|
+
enableFocus,
|
|
30
|
+
handleFocusChange,
|
|
31
|
+
focus,
|
|
32
|
+
unit,
|
|
33
|
+
} = inject(GridContextKey);
|
|
34
|
+
|
|
35
|
+
const colWidth = 100 / 12;
|
|
36
|
+
const rowHeight = colWidth;
|
|
37
|
+
const style = ref({});
|
|
38
|
+
const gridItemClassName = classNames([
|
|
39
|
+
`${PREFIX}-grid-item`,
|
|
40
|
+
{
|
|
41
|
+
pc: IS_PC,
|
|
42
|
+
mobile: !IS_PC,
|
|
43
|
+
h5: IS_H5,
|
|
44
|
+
},
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
const handleClick = () => {
|
|
48
|
+
const value = String(props.index) === String(focus.value) ? null : props.index;
|
|
49
|
+
enableFocus && handleFocusChange(value);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const show = computed(() => !!findTarget(layout.value, { key: 'i', value: props.index}));
|
|
53
|
+
|
|
54
|
+
watchEffect(() => {
|
|
55
|
+
const target = findTarget(layout.value, { key: 'i', value: props.index});
|
|
56
|
+
|
|
57
|
+
if (!target) return;
|
|
58
|
+
|
|
59
|
+
const { x, y, w, h, customStyle, customProps } = target;
|
|
60
|
+
style.value = {
|
|
61
|
+
width: w * colWidth + unit.value,
|
|
62
|
+
height: props.height || h * rowHeight + unit.value,
|
|
63
|
+
left: x * colWidth + unit.value,
|
|
64
|
+
top: y * rowHeight + unit.value,
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
visibility: customProps?.show === false ? 'hidden' : '',
|
|
67
|
+
...props.customStyle,
|
|
68
|
+
...customStyle,
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
onUnmounted(() => {
|
|
73
|
+
if (String(props.index) === String(focus.value)) {
|
|
74
|
+
enableFocus && handleFocusChange(null);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="scss">
|
|
80
|
+
@import './style/GridItem.scss';
|
|
81
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@import '../../../styles/common.scss';
|
|
2
|
+
@import '../../../styles/var.scss';
|
|
3
|
+
|
|
4
|
+
.#{$PREFIX}-grid-item {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
|
|
8
|
+
&.h5 {
|
|
9
|
+
transition-property: width,height,left,top;
|
|
10
|
+
transition-duration: 0.3s;
|
|
11
|
+
transition-timing-function: ease-in;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TKImage :src="src" :width="width" :height="height"></TKImage>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
export default {
|
|
7
|
+
options: {
|
|
8
|
+
virtualHost: true,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
import { computed } from '../../../../adapter-vue';
|
|
15
|
+
import { IconProps } from './Icon';
|
|
16
|
+
import TKImage from '../TKImage/TKImage.vue';
|
|
17
|
+
|
|
18
|
+
const props = defineProps(IconProps);
|
|
19
|
+
const width = computed(() => `${props.size}px`);
|
|
20
|
+
const height = computed(() => `${props.size}px`);
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const ColJustify = ['start', 'center', 'end', 'space-around', 'space-between', 'space-evenly'] as const;
|
|
2
|
+
const ColAlign = ['top', 'middle', 'bottom'] as const;
|
|
3
|
+
|
|
4
|
+
export const colProps = {
|
|
5
|
+
span: {
|
|
6
|
+
type: Number,
|
|
7
|
+
default: 24,
|
|
8
|
+
},
|
|
9
|
+
justify: {
|
|
10
|
+
type: String,
|
|
11
|
+
values: ColJustify,
|
|
12
|
+
default: 'start',
|
|
13
|
+
},
|
|
14
|
+
align: {
|
|
15
|
+
type: String,
|
|
16
|
+
values: ColAlign,
|
|
17
|
+
default: 'middle',
|
|
18
|
+
},
|
|
19
|
+
offset: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
};
|