import{d as y,m as p,j as O,o as a,c as l,w as o,z as n,b as t,p as d,e as f,f as m,n as T,D as k,t as v,F as b,g as N,aa as B}from"./BvNnk7SS.js";import{_ as P}from"./a7ZBoMfv.js";import{P as V,a as w,b as D}from"./BxD-9MY-.js";import{T as E,a as M,b as $}from"./CYKwSea8.js";const R=B(P),U={key:0,class:"i-mdi-chevron-down"},q=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(D),{open:e.open,"on-open-change":g},{default:o(()=>[n(t(V),null,{default:o(()=>[n(t(E),null,{default:o(()=>[n(t(M),{class:"flex items-center gap0.5"},{default:o(()=>[d(e.$slots,"default"),e.chevron?(a(),f("div",U)):m("",!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"])):m("",!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),f(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)):d(e.$slots,"menu",{key:0})]),_:3},8,["placement","offset"])]),_:3},8,["open"])}}});export{q as _};
