UNPKG

@tencentcloud/roomkit-web-vue3

Version:

<h1 align="center"> TUIRoomKit</h1> Conference (TUIRoomKit) is a product suitable for multi-person audio and video conversation scenarios such as business meetings, webinars, and online education. By integrating this product, you can add room management,

78 lines (77 loc) 2.85 kB
import { defineComponent, ref, withDirectives, createCommentVNode, unref, createElementBlock, openBlock, createVNode, createBlock, withCtx } from "vue"; import { IconInvite } from "@tencentcloud/uikit-base-component-vue3"; import IconButton from "../common/base/IconButton.vue.mjs"; import { useBasicStore } from "../../stores/basic.mjs"; import { storeToRefs } from "pinia"; import { useI18n } from "../../locales/index.mjs"; import "../../services/main.mjs"; import { roomService } from "../../services/roomService.mjs"; import "@tencentcloud/tuiroom-engine-js"; import { isMobile } from "../../utils/environment.mjs"; import "mitt"; import "../../services/manager/roomActionManager.mjs"; import "@tencentcloud/tui-core"; import Index from "../RoomInvite/index.mjs"; import vClickOutside from "../../directives/vClickOutside.mjs"; const _hoisted_1 = { key: 0, class: "invite-control-container" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "InviteControl", emits: ["show-overlay"], setup(__props, { emit: __emit }) { const isShowInviteTab = ref(false); const inviteRef = ref(); const basicStore = useBasicStore(); const { sidebarName } = storeToRefs(basicStore); const { t } = useI18n(); const emit = __emit; const inviteControlConfig = roomService.getComponentConfig("InviteControl"); function toggleInviteSidebar() { isShowInviteTab.value = !isShowInviteTab.value; if (isMobile) { if (basicStore.sidebarName === "invite") { basicStore.setSidebarName(""); return; } basicStore.setSidebarName("invite"); emit("show-overlay", { name: "RoomInviteOverlay", visible: isShowInviteTab.value }); } roomService.trackingManager.sendMessage("experience-invite"); } function handleClickOutSide() { if (isShowInviteTab.value) { isShowInviteTab.value = false; } } return (_ctx, _cache) => { return unref(inviteControlConfig).visible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [ createVNode(IconButton, { class: "invite", "is-active": unref(sidebarName) === "invite", title: unref(t)("Invite"), onClickIcon: toggleInviteSidebar }, { default: withCtx(() => [ createVNode(unref(IconInvite), { size: "24" }) ]), _: 1 }, 8, ["is-active", "title"]), !unref(isMobile) && isShowInviteTab.value ? (openBlock(), createBlock(unref(Index), { key: 0, ref_key: "inviteRef", ref: inviteRef }, null, 512)) : createCommentVNode("", true) ])), [ [unref(vClickOutside), handleClickOutSide] ]) : createCommentVNode("", true); }; } }); export { _sfc_main as default };