Files
open-kimi-ppt-skill/editor/neo-ppt/assets/PopoverMenu-D6aS9gI3.js
T

1 line
1.7 KiB
JavaScript

import{At as e,G as t,H as n,K as r,Tt as i,U as a,W as o,Y as s,Z as c,bt as l,ct as u,dt as d,kt as f,n as p,vt as m,xt as h,z as g}from"./vue-B11_pI9F.js";import{t as _}from"./_plugin-vue_export-helper-B67ILkmu.js";import{v}from"./index-jtNAhQeK.js";import{r as y}from"./dom-CWEl93tC.js";import{n as b,t as x}from"./menuExclusive-DWJqMbvd.js";var S=_(c({__name:`PopoverMenu`,props:{tooltip:{},tooltipPlacement:{},hideCaret:{type:Boolean},floatOptions:{},disabled:{type:Boolean},contentClass:{},contentClickCloses:{type:Boolean,default:!0}},emits:[`update:open`],setup(c,{expose:_,emit:S}){let C=c,w=S,T=i(!1),E=i(),D=n(()=>C.floatOptions?.teleport??!1),{notifyOpen:O}=x(()=>{T.value=!1}),k=()=>{D.value||(T.value=!1)},A=()=>{C.disabled||(T.value=!T.value)},j=()=>{C.contentClickCloses&&A()};return m(()=>C.disabled,e=>{e&&(T.value=!1)}),m(T,e=>{e&&O(),w(`update:open`,e)}),_({close:()=>{T.value=!1}}),(n,i)=>h((u(),r(`div`,{class:e([`popover-menu`,{disabled:c.disabled}]),onClick:g(A,[`stop`])},[s(f(y),{content:c.tooltip,disabled:!c.tooltip,placement:c.tooltipPlacement},{trigger:l(()=>[a(`div`,{ref_key:`triggerRef`,ref:E,class:`popover-menu-trigger`},[d(n.$slots,`trigger`,{popoverVisible:T.value},void 0,!0),c.hideCaret?t(``,!0):(u(),o(f(v),{key:0,class:`popover-menu-caret`,name:`Down_b`,width:`12`,height:`12`}))],512)]),_:3},8,[`content`,`disabled`,`placement`]),s(b,{open:T.value,"onUpdate:open":i[0]||(i[0]=e=>T.value=e),"trigger-el":E.value,options:c.floatOptions},{default:l(()=>[a(`div`,{class:e([`popover-menu-content auto-rtl`,[{"is-floating":D.value},c.contentClass]]),onClick:g(j,[`stop`])},[d(n.$slots,`popover`,{},void 0,!0)],2)]),_:3},8,[`open`,`trigger-el`,`options`])],2)),[[f(p),k]])}}),[[`__scopeId`,`data-v-2856486f`]]);export{S as t};