import { defineComponent, computed, ref, unref, openBlock, createBlock, mergeProps, withCtx, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, renderSlot, createTextVNode } from 'vue'; import { ElTooltip } from '../../tooltip/index.mjs'; import '../../../utils/index.mjs'; import '../../../hooks/index.mjs'; import { popoverProps, popoverEmits } from './popover2.mjs'; import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs'; import { useNamespace } from '../../../hooks/use-namespace/index.mjs'; import { addUnit } from '../../../utils/dom/style.mjs'; const updateEventKeyRaw = `onUpdate:visible`; const __default__ = defineComponent({ name: "ElPopover" }); const _sfc_main = /* @__PURE__ */ defineComponent({ ...__default__, props: popoverProps, emits: popoverEmits, setup(__props, { expose, emit }) { const props = __props; const onUpdateVisible = computed(() => { return props[updateEventKeyRaw]; }); const ns = useNamespace("popover"); const tooltipRef = ref(); const popperRef = computed(() => { var _a; return (_a = unref(tooltipRef)) == null ? void 0 : _a.popperRef; }); const style = computed(() => { return [ { width: addUnit(props.width) }, props.popperStyle ]; }); const kls = computed(() => { return [ns.b(), props.popperClass, { [ns.m("plain")]: !!props.content }]; }); const gpuAcceleration = computed(() => { return props.transition === `${ns.namespace.value}-fade-in-linear`; }); const hide = () => { var _a; (_a = tooltipRef.value) == null ? void 0 : _a.hide(); }; const beforeEnter = () => { emit("before-enter"); }; const beforeLeave = () => { emit("before-leave"); }; const afterEnter = () => { emit("after-enter"); }; const afterLeave = () => { emit("update:visible", false); emit("after-leave"); }; expose({ popperRef, hide }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ElTooltip), mergeProps({ ref_key: "tooltipRef", ref: tooltipRef }, _ctx.$attrs, { trigger: _ctx.trigger, placement: _ctx.placement, disabled: _ctx.disabled, visible: _ctx.visible, transition: _ctx.transition, "popper-options": _ctx.popperOptions, tabindex: _ctx.tabindex, content: _ctx.content, offset: _ctx.offset, "show-after": _ctx.showAfter, "hide-after": _ctx.hideAfter, "auto-close": _ctx.autoClose, "show-arrow": _ctx.showArrow, "aria-label": _ctx.title, effect: _ctx.effect, enterable: _ctx.enterable, "popper-class": unref(kls), "popper-style": unref(style), teleported: _ctx.teleported, persistent: _ctx.persistent, "gpu-acceleration": unref(gpuAcceleration), "onUpdate:visible": unref(onUpdateVisible), onBeforeShow: beforeEnter, onBeforeHide: beforeLeave, onShow: afterEnter, onHide: afterLeave }), { content: withCtx(() => [ _ctx.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(ns).e("title")), role: "title" }, toDisplayString(_ctx.title), 3)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default", {}, () => [ createTextVNode(toDisplayString(_ctx.content), 1) ]) ]), default: withCtx(() => [ _ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"]); }; } }); var Popover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "popover.vue"]]); export { Popover as default }; //# sourceMappingURL=popover.mjs.map