@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,
106 lines (105 loc) • 4.28 kB
JavaScript
import { defineComponent, ref, onMounted, onUnmounted, createElementBlock, openBlock, createCommentVNode, unref, withDirectives, createBlock, withCtx, createVNode, createElementVNode, createTextVNode, toDisplayString } from "vue";
import { IconExtension } from "@tencentcloud/uikit-base-component-vue3";
import IconButton from "../../common/base/IconButton.vue.mjs";
import useControl from "./useMoreControlHooks.mjs";
import _sfc_main$1 from "../ChatControl.vue.mjs";
import InviteControl from "../InviteControl.vue.mjs";
import ContactControl from "../ContactControl.vue.mjs";
import { useRoomStore } from "../../../stores/room.mjs";
import bus from "../../../hooks/useMitt.mjs";
import vTap from "../../../directives/vTap.mjs";
import "../../../services/main.mjs";
import { roomService } from "../../../services/roomService.mjs";
import "../../../locales/index.mjs";
import "@tencentcloud/tuiroom-engine-js";
import "../../../utils/environment.mjs";
import "mitt";
import "../../../services/manager/roomActionManager.mjs";
import "@tencentcloud/tui-core";
const _hoisted_1 = {
key: 0,
class: "more-control-container"
};
const _hoisted_2 = { class: "control-compent" };
const _hoisted_3 = { class: "close" };
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "MoreControlH5",
emits: ["show-overlay"],
setup(__props, { emit: __emit }) {
const moreControlConfig = roomService.getComponentConfig("MoreControl");
const showMoreContent = ref(false);
const moreContentRef = ref();
const { t, sidebarName } = useControl();
const roomStore = useRoomStore();
const emit = __emit;
function showMore() {
showMoreContent.value = true;
}
function handleCancelControl() {
showMoreContent.value = false;
}
function handleControlClick(name) {
bus.emit("experience-communication", name);
}
function handleShowOverlay(data) {
showMoreContent.value = false;
emit("show-overlay", data);
}
function handleDocumentClick(event) {
if (showMoreContent.value && !moreContentRef.value.contains(event.target)) {
showMoreContent.value = false;
}
}
onMounted(() => {
document == null ? void 0 : document.addEventListener("click", handleDocumentClick, true);
});
onUnmounted(() => {
document == null ? void 0 : document.removeEventListener("click", handleDocumentClick, true);
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", null, [
unref(moreControlConfig).visible ? (openBlock(), createElementBlock("div", _hoisted_1, [
withDirectives((openBlock(), createBlock(IconButton, {
"is-active": unref(sidebarName) === "more",
title: unref(t)("More")
}, {
default: withCtx(() => [
createVNode(unref(IconExtension), { size: "24" })
]),
_: 1
}, 8, ["is-active", "title"])), [
[unref(vTap), showMore]
])
])) : createCommentVNode("", true),
showMoreContent.value ? (openBlock(), createElementBlock("div", {
key: 1,
ref_key: "moreContentRef",
ref: moreContentRef,
class: "show-more-content"
}, [
createElementVNode("div", _hoisted_2, [
unref(roomStore).isSpeakAfterTakingSeatMode ? (openBlock(), createBlock(_sfc_main$1, {
key: 0,
onClick: _cache[0] || (_cache[0] = ($event) => handleControlClick("chatControl"))
})) : createCommentVNode("", true),
createVNode(ContactControl, {
onClick: _cache[1] || (_cache[1] = ($event) => handleControlClick("contactControl"))
}),
createVNode(InviteControl, {
onShowOverlay: handleShowOverlay,
onClick: _cache[2] || (_cache[2] = ($event) => handleControlClick("inviteControl"))
})
]),
withDirectives((openBlock(), createElementBlock("div", _hoisted_3, [
createTextVNode(toDisplayString(unref(t)("Cancel")), 1)
])), [
[unref(vTap), handleCancelControl]
])
], 512)) : createCommentVNode("", true)
]);
};
}
});
export {
_sfc_main as default
};