@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,
130 lines (129 loc) • 5.34 kB
JavaScript
import { defineComponent, ref, watch, onMounted, withDirectives, createElementBlock, openBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, toDisplayString, unref, withCtx, vShow } from "vue";
import { TUIButton, IconEnterRoom } from "@tencentcloud/uikit-base-component-vue3";
import useZIndex from "../../../../../hooks/useZIndex.mjs";
import { useI18n } from "../../../../../locales/index.mjs";
import TuiAvatar from "../../../Avatar.vue2.mjs";
const _hoisted_1 = { class: "tui-notification-message" };
const _hoisted_2 = { class: "invitation-notification-inviter-container" };
const _hoisted_3 = { class: "invitation-notification-inviter" };
const _hoisted_4 = { class: "invitation-notification-title" };
const _hoisted_5 = { class: "invitation-notification-room-name" };
const _hoisted_6 = { class: "invitation-notification-room-info-container" };
const _hoisted_7 = { class: "invitation-notification-room-text-container" };
const _hoisted_8 = { class: "invitation-notification-room-text" };
const _hoisted_9 = { class: "invitation-notification-room-text" };
const _hoisted_10 = { class: "invitation-notification-room-text" };
const _hoisted_11 = { class: "invitation-notification-room-text" };
const _hoisted_12 = { class: "invitation-notification-bottom-container" };
const _hoisted_13 = { class: "button-text" };
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "index",
props: {
appendTo: { default: "" },
customClass: { default: "" },
message: { default: {
userId: "",
userName: "",
avatarUrl: "",
roomName: "",
roomMemberCount: 0,
roomOwner: "",
roomId: ""
} },
onConfirm: { type: [Function, null], default: null },
onCancel: { type: [Function, null], default: null },
close: { type: [Function, null], default: null },
confirmButtonText: { default: "" },
cancelButtonText: { default: "" }
},
setup(__props) {
const { t } = useI18n();
const visible = ref(false);
const overlayContainerStyle = ref({});
const { nextZIndex } = useZIndex();
const props = __props;
watch(visible, (val) => {
if (val) {
overlayContainerStyle.value = { zIndex: nextZIndex() };
}
});
function onOpen() {
visible.value = true;
}
const handleConfirm = () => {
handleAction(props.onConfirm);
};
const handleCancel = () => {
handleAction(props.onCancel);
};
const handleAction = (fn) => {
if (fn) {
fn();
}
if (props.close) {
props.close();
}
};
onMounted(() => {
onOpen();
});
return (_ctx, _cache) => {
return withDirectives((openBlock(), createElementBlock("div", {
class: normalizeClass(["tui-notification", _ctx.customClass])
}, [
createElementVNode("div", {
class: "tui-notification-container",
style: normalizeStyle(overlayContainerStyle.value)
}, [
createElementVNode("div", _hoisted_1, [
createElementVNode("div", _hoisted_2, [
createElementVNode("div", _hoisted_3, [
createVNode(TuiAvatar, {
class: "avatar",
"img-src": _ctx.message.avatarUrl
}, null, 8, ["img-src"]),
createElementVNode("span", _hoisted_4, toDisplayString(unref(t)("sb invites you to join the conference", {
name: _ctx.message.userName || _ctx.message.userId
})), 1)
]),
createElementVNode("span", _hoisted_5, toDisplayString(_ctx.message.roomName), 1),
createElementVNode("div", _hoisted_6, [
createElementVNode("div", _hoisted_7, [
createElementVNode("span", _hoisted_8, toDisplayString(unref(t)("Host")) + ": ", 1),
createElementVNode("span", _hoisted_9, toDisplayString(_ctx.message.roomOwner), 1)
]),
_cache[0] || (_cache[0] = createElementVNode("i", { class: "invitation-notification-room-text-split" }, null, -1)),
createElementVNode("div", null, [
createElementVNode("span", _hoisted_10, toDisplayString(unref(t)("Attendees")) + ": ", 1),
createElementVNode("span", _hoisted_11, toDisplayString(`${_ctx.message.roomMemberCount} ${unref(t)("people")}`), 1)
])
])
])
]),
_cache[1] || (_cache[1] = createElementVNode("i", { class: "invitation-notification-bottom-split" }, null, -1)),
createElementVNode("div", _hoisted_12, [
createElementVNode("span", {
class: "invitation-notification-bottom",
onClick: handleCancel
}, toDisplayString(_ctx.cancelButtonText), 1),
createVNode(unref(TUIButton), {
type: "primary",
onClick: handleConfirm
}, {
default: withCtx(() => [
createVNode(unref(IconEnterRoom), { class: "icon" }),
createElementVNode("span", _hoisted_13, toDisplayString(_ctx.confirmButtonText), 1)
]),
_: 1
})
])
], 4)
], 2)), [
[vShow, visible.value]
]);
};
}
});
export {
_sfc_main as default
};