UNPKG

@tencentcloud/roomkit-electron-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,

139 lines (138 loc) 5.76 kB
import { defineComponent, ref, watch, onMounted, withDirectives, createElementBlock, openBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, toDisplayString, unref, withCtx, vShow, pushScopeId, popScopeId } from "vue"; import TuiButton from "../../../base/Button.vue.mjs"; import SvgIcon from "../../../base/SvgIcon.vue.mjs"; import useZIndex from "../../../../../hooks/useZIndex.mjs"; import EnterRoomIcon from "../../../icons/EnterRoomIcon.vue.mjs"; import { useI18n } from "../../../../../locales/index.mjs"; import TuiAvatar from "../../../Avatar.vue.mjs"; const _withScopeId = (n) => (pushScopeId("data-v-9f1f1110"), n = n(), popScopeId(), n); 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 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("i", { class: "invitation-notification-room-text-split" }, null, -1)); const _hoisted_11 = { class: "invitation-notification-room-text" }; const _hoisted_12 = { class: "invitation-notification-room-text" }; const _hoisted_13 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("i", { class: "invitation-notification-bottom-split" }, null, -1)); const _hoisted_14 = { class: "invitation-notification-bottom-container" }; const _hoisted_15 = { 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) ]), _hoisted_10, createElementVNode("div", null, [ createElementVNode("span", _hoisted_11, toDisplayString(unref(t)("Attendees")) + ": ", 1), createElementVNode("span", _hoisted_12, toDisplayString(`${_ctx.message.roomMemberCount} ${unref(t)("people")}`), 1) ]) ]) ]) ]), _hoisted_13, createElementVNode("div", _hoisted_14, [ createElementVNode("span", { class: "invitation-notification-bottom", onClick: handleCancel }, toDisplayString(_ctx.cancelButtonText), 1), createVNode(TuiButton, { class: "button-item", style: { "width": "110px" }, onClick: handleConfirm }, { default: withCtx(() => [ createVNode(SvgIcon, { class: "icon", icon: EnterRoomIcon }), createElementVNode("span", _hoisted_15, toDisplayString(_ctx.confirmButtonText), 1) ]), _: 1 }) ]) ], 4) ], 2)), [ [vShow, visible.value] ]); }; } }); export { _sfc_main as default };