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,
119 lines (118 loc) • 4.3 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const uikitBaseComponentVue3 = require("@tencentcloud/uikit-base-component-vue3");
const SvgIcon = require("../SvgIcon.vue.js");
const CloseIcon = require("../../icons/CloseIcon.vue.js");
const useZIndex = require("../../../../hooks/useZIndex.js");
const environment = require("../../../../utils/environment.js");
const ApplyTipsIcon = require("../../icons/ApplyTipsIcon.vue.js");
const _hoisted_1 = { class: "tui-notification" };
const _hoisted_2 = { class: "tui-notification-mobile-content" };
const _hoisted_3 = { class: "tui-notification-header" };
const _hoisted_4 = { class: "tui-notification-title" };
const _hoisted_5 = { class: "close" };
const _hoisted_6 = { class: "tui-notification-footer" };
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
__name: "index",
props: {
message: { default: "" },
confirm: { type: [Function, null], default: null },
cancel: { type: [Function, null], default: null },
confirmButtonText: { default: "" },
cancelButtonText: { default: "" }
},
emits: ["close"],
setup(__props, { emit: __emit }) {
const visible = Vue.ref(false);
const overlayContainerStyle = Vue.ref({});
const { nextZIndex } = useZIndex.default();
const props = __props;
const emit = __emit;
Vue.watch(visible, (val) => {
if (val) {
overlayContainerStyle.value = { zIndex: nextZIndex() };
}
});
function handleClose() {
visible.value = false;
emit("close");
}
function handleAgree() {
if (props.confirm) {
props.confirm();
}
handleClose();
}
function handleReject() {
if (props.cancel) {
props.cancel();
}
handleClose();
}
function onOpen() {
visible.value = true;
}
Vue.onMounted(async () => {
onOpen();
});
return (_ctx, _cache) => {
return Vue.withDirectives((Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
Vue.unref(environment.isMobile) ? (Vue.openBlock(), Vue.createElementBlock("div", {
key: 0,
class: "tui-notification-container-mobile",
style: Vue.normalizeStyle(overlayContainerStyle.value)
}, [
Vue.createVNode(SvgIcon.default, {
icon: ApplyTipsIcon.default,
class: "tui-notification-mobile-icon"
}),
Vue.createElementVNode("span", _hoisted_2, Vue.toDisplayString(_ctx.message), 1),
Vue.createElementVNode("div", {
class: "tui-notification-mobile-check",
onClick: handleAgree
}, Vue.toDisplayString(_ctx.confirmButtonText), 1)
], 4)) : (Vue.openBlock(), Vue.createElementBlock("div", {
key: 1,
class: "tui-notification-container",
style: Vue.normalizeStyle(overlayContainerStyle.value)
}, [
Vue.createElementVNode("div", _hoisted_3, [
Vue.createElementVNode("div", _hoisted_4, Vue.toDisplayString(_ctx.message), 1),
Vue.createElementVNode("div", _hoisted_5, [
Vue.createVNode(SvgIcon.default, {
size: 16,
icon: CloseIcon.default,
onClick: handleClose
})
])
]),
Vue.createElementVNode("div", _hoisted_6, [
Vue.createVNode(Vue.unref(uikitBaseComponentVue3.TUIButton), {
onClick: handleAgree,
type: "primary",
style: { "min-width": "88px" }
}, {
default: Vue.withCtx(() => [
Vue.createTextVNode(Vue.toDisplayString(_ctx.confirmButtonText), 1)
]),
_: 1
}),
Vue.createVNode(Vue.unref(uikitBaseComponentVue3.TUIButton), {
onClick: handleReject,
style: { "min-width": "88px" }
}, {
default: Vue.withCtx(() => [
Vue.createTextVNode(Vue.toDisplayString(_ctx.cancelButtonText), 1)
]),
_: 1
})
])
], 4))
], 512)), [
[Vue.vShow, visible.value]
]);
};
}
});
exports.default = _sfc_main;