import{d as y,m as p,g as O,c as l,o as a,w as o,a9 as n,u as t,e as d,b as f,i as m,n as T,ad as k,t as v,F as b,z as N,ao as B}from"./Bxv1kRJt.js";import{_ as P}from"./DJ1-1-8O.js";import{P as V,a as w,b as E}from"./i2E1o2Cl.js";import{T as M,a as D,b as $}from"./Dxmk8VbU.js";const R=B(P),U={key:0,class:"i-mdi-chevron-down"},W=y({__name:"UiEditorDropdown",props:p({open:{type:Boolean},positioning:{},onClose:{},offset:{default:6},placement:{default:"bottom-start"},chevron:{type:Boolean},tooltip:{},tooltipOffset:{default:8},tooltipClasses:{default:""},disabled:{type:Boolean},items:{}},{modelValue:{required:!1},modelModifiers:{}}),emits:p(["onOpenChange"],["update:modelValue"]),setup(r,{emit:u}){const c=r,C=u,i=O(r,"modelValue");function g(e){C("onOpenChange",e),e||_()}function _(){c.onClose?.()}return(e,z)=>{const h=R;return a(),l(t(E),{open:e.open,"on-open-change":g},{default:o(()=>[n(t(V),null,{default:o(()=>[n(t(M),null,{default:o(()=>[n(t(D),{class:"flex items-center gap0.5"},{default:o(()=>[f(e.$slots,"default"),e.chevron?(a(),m("div",U)):d("",!0)]),_:3}),e.tooltip&&!e.disabled?(a(),l(t($),{key:0,offset:e.tooltipOffset,class:T(["TOOLTIP_CONTENT",e.tooltipClasses])},{default:o(()=>[k(v(e.tooltip),1)]),_:1},8,["offset","class"])):d("",!0)]),_:3})]),_:3}),n(t(w),{placement:e.placement,offset:e.offset,"element-context":"reference","alt-boundary":!0,strategy:"fixed",class:"DROPDOWN_MENU"},{default:o(()=>[e.items?(a(!0),m(b,{key:1},N(e.items,s=>(a(),l(h,{key:s,label:s,pressed:i.value===s,onClick:F=>i.value=s},null,8,["label","pressed","onClick"]))),128)):f(e.$slots,"menu",{key:0})]),_:3},8,["placement","offset"])]),_:3},8,["open"])}}});export{W as _};
