import{J as m,c as i,O as s,aE as v,aX as H,aY as q,K as I,r as B,aZ as O,a_ as V,ac as h,U as _,m as x,y as d,a$ as M}from"./index-CS0Lg7FU.js";import{Q as P}from"./QMenu-CRasz1Oe.js";const j=m({name:"QBtnGroup",props:{unelevated:Boolean,outline:Boolean,flat:Boolean,rounded:Boolean,square:Boolean,push:Boolean,stretch:Boolean,glossy:Boolean,spread:Boolean},setup(e,{slots:t}){const o=i(()=>{const a=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(l=>e[l]===!0).map(l=>`q-btn-group--${l}`).join(" ");return`q-btn-group row no-wrap${a.length!==0?" "+a:""}`+(e.spread===!0?" q-btn-group--spread":" inline")});return()=>s("div",{class:o.value},v(t.default))}}),$=Object.keys(q);function E(e){return $.reduce((t,o)=>{const a=e[o];return a!==void 0&&(t[o]=a),t},{})}const z=m({name:"QBtnDropdown",props:{...q,...H,modelValue:Boolean,split:Boolean,dropdownIcon:String,contentClass:[Array,String,Object],contentStyle:[Array,String,Object],cover:Boolean,persistent:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,autoClose:Boolean,noRefocus:Boolean,noFocus:Boolean,menuAnchor:{type:String,default:"bottom end"},menuSelf:{type:String,default:"top end"},menuOffset:Array,disableMainBtn:Boolean,disableDropdown:Boolean,noIconAnimation:Boolean,toggleAriaLabel:String},emits:["update:modelValue","click","beforeShow","show","beforeHide","hide"],setup(e,{slots:t,emit:o}){const{proxy:a}=I(),l=B(e.modelValue),u=B(null),c=O(),f=i(()=>{const n={"aria-expanded":l.value===!0?"true":"false","aria-haspopup":"true","aria-controls":c.value,"aria-label":e.toggleAriaLabel||a.$q.lang.label[l.value===!0?"collapse":"expand"](e.label)};return(e.disable===!0||e.split===!1&&e.disableMainBtn===!0||e.disableDropdown===!0)&&(n["aria-disabled"]="true"),n}),S=i(()=>"q-btn-dropdown__arrow"+(l.value===!0&&e.noIconAnimation===!1?" rotate-180":"")+(e.split===!1?" q-btn-dropdown__arrow-container":"")),b=i(()=>V(e)),w=i(()=>E(e));h(()=>e.modelValue,n=>{u.value?.[n?"show":"hide"]()}),h(()=>e.split,r);function D(n){l.value=!0,o("beforeShow",n)}function y(n){o("show",n),o("update:modelValue",!0)}function C(n){l.value=!1,o("beforeHide",n)}function A(n){o("hide",n),o("update:modelValue",!1)}function Q(n){o("click",n)}function R(n){M(n),r(),o("click",n)}function k(n){u.value?.toggle(n)}function g(n){u.value?.show(n)}function r(n){u.value?.hide(n)}return Object.assign(a,{show:g,hide:r,toggle:k}),_(()=>{e.modelValue===!0&&g()}),()=>{const n=[s(x,{class:S.value,name:e.dropdownIcon||a.$q.iconSet.arrow.dropdown})];return e.disableDropdown!==!0&&n.push(s(P,{ref:u,id:c.value,class:e.contentClass,style:e.contentStyle,cover:e.cover,fit:!0,persistent:e.persistent,noEscDismiss:e.noEscDismiss,noRouteDismiss:e.noRouteDismiss,autoClose:e.autoClose,noFocus:e.noFocus,noRefocus:e.noRefocus,anchor:e.menuAnchor,self:e.menuSelf,offset:e.menuOffset,separateClosePopup:!0,transitionShow:e.transitionShow,transitionHide:e.transitionHide,transitionDuration:e.transitionDuration,onBeforeShow:D,onShow:y,onBeforeHide:C,onHide:A},t.default)),e.split===!1?s(d,{class:"q-btn-dropdown q-btn-dropdown--simple",...w.value,...f.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:Q},{default:()=>v(t.label,[]).concat(n),loading:t.loading}):s(j,{class:"q-btn-dropdown q-btn-dropdown--split no-wrap q-btn-item",rounded:e.rounded,square:e.square,...b.value,glossy:e.glossy,stretch:e.stretch},()=>[s(d,{class:"q-btn-dropdown--current",...w.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:R},{default:t.label,loading:t.loading}),s(d,{class:"q-btn-dropdown__arrow-container q-anchor--skip",...f.value,...b.value,disable:e.disable===!0||e.disableDropdown===!0,rounded:e.rounded,color:e.color,textColor:e.textColor,dense:e.dense,size:e.size,padding:e.padding,ripple:e.ripple},()=>n)])}}});export{z as Q};
