@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,
69 lines (68 loc) • 1.82 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const Vue = require("vue");
const index = require("./index.vue.js");
function NotificationFactory() {
let notificationInstance = null;
let container = null;
let timer = null;
let fullscreenElement = null;
function openInviteNotification(options) {
if (document.getElementById(options.appendTo)) {
fullscreenElement = document.getElementById(
options.appendTo
);
} else {
fullscreenElement = document.fullscreenElement || document.body;
}
if (!notificationInstance) {
container = document.createElement("div");
container.className = "tui-room-notification";
fullscreenElement == null ? void 0 : fullscreenElement.appendChild(container);
}
const {
appendTo,
customClass,
message,
onConfirm,
onCancel,
confirmButtonText,
cancelButtonText
} = options;
const vnode = Vue.createVNode(index.default, {
appendTo,
customClass,
message,
onConfirm,
onCancel,
confirmButtonText,
cancelButtonText,
close
});
if (container) {
Vue.render(vnode, container);
notificationInstance = vnode;
}
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(close, options.duration || 3e4);
}
function close() {
if (container) {
Vue.render(null, container);
fullscreenElement == null ? void 0 : fullscreenElement.removeChild(container);
notificationInstance = null;
container = null;
}
if (timer) {
clearTimeout(timer);
timer = null;
}
}
return {
openInviteNotification
};
}
const inviteNotification = NotificationFactory();
exports.inviteNotification = inviteNotification;
;