import{C as N,aP as P,k as B,a6 as R,a5 as V,a0 as F,l as O,n as v,b5 as w,W as Q,aS as X,b6 as Y,_ as k,d as _,u as I,c as C,o as G,x as y,v as A,bB as D,y as h,P as $,aj as L,M as x,D as Z,ay as ee,a9 as ae,aA as oe,L as le,J as se,I as ne,ag as te,aL as K,S as re}from"./index-BXlk60bP.js";import{d as z,a7 as E,$ as e,n as f,k as U,a1 as M,g as ie,S as de,ad as ue}from"./common-vYHpopNV.js";const T=B({modelValue:{type:[String,Number,Boolean],default:void 0},size:F,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),ce=B({...T,border:Boolean}),j={[V]:o=>z(o)||N(o)||P(o),[R]:o=>z(o)||N(o)||P(o)},W=Symbol("radioGroupKey"),q=(o,u)=>{const s=E(),a=O(W,void 0),i=v(()=>!!a),c=v(()=>w(o.value)?o.label:o.value),r=v({get(){return i.value?a.modelValue:o.modelValue},set(n){i.value?a.changeEvent(n):u&&u(V,n),s.value.checked=o.modelValue===c.value}}),d=Q(v(()=>a==null?void 0:a.size)),l=X(v(()=>a==null?void 0:a.disabled)),t=E(!1),p=v(()=>l.value||i.value&&r.value!==c.value?-1:0);return Y({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},v(()=>i.value&&w(o.value))),{radioRef:s,isGroup:i,radioGroup:a,focus:t,size:d,disabled:l,tabIndex:p,modelValue:r,actualValue:c}},pe=_({name:"ElRadio"}),me=_({...pe,props:ce,emits:j,setup(o,{emit:u}){const s=o,a=I("radio"),{radioRef:i,radioGroup:c,focus:r,size:d,disabled:l,modelValue:t,actualValue:p}=q(s,u);function n(){x(()=>u(R,t.value))}return(m,g)=>{var b;return G(),C("label",{class:f([e(a).b(),e(a).is("disabled",e(l)),e(a).is("focus",e(r)),e(a).is("bordered",m.border),e(a).is("checked",e(t)===e(p)),e(a).m(e(d))])},[y("span",{class:f([e(a).e("input"),e(a).is("disabled",e(l)),e(a).is("checked",e(t)===e(p))])},[A(y("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":S=>U(t)?t.value=S:null,class:f(e(a).e("original")),value:e(p),name:m.name||((b=e(c))==null?void 0:b.name),disabled:e(l),checked:e(t)===e(p),type:"radio",onFocus:S=>r.value=!0,onBlur:S=>r.value=!1,onChange:n,onClick:h(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[D,e(t)]]),y("span",{class:f(e(a).e("inner"))},null,2)],2),y("span",{class:f(e(a).e("label")),onKeydown:h(()=>{},["stop"])},[$(m.$slots,"default",{},()=>[L(M(m.label),1)])],42,["onKeydown"])],2)}}});var ve=k(me,[["__file","radio.vue"]]);const fe=B({...T}),be=_({name:"ElRadioButton"}),ye=_({...be,props:fe,setup(o){const u=o,s=I("radio"),{radioRef:a,focus:i,size:c,disabled:r,modelValue:d,radioGroup:l,actualValue:t}=q(u),p=v(()=>({backgroundColor:(l==null?void 0:l.fill)||"",borderColor:(l==null?void 0:l.fill)||"",boxShadow:l!=null&&l.fill?`-1px 0 0 0 ${l.fill}`:"",color:(l==null?void 0:l.textColor)||""}));return(n,m)=>{var g;return G(),C("label",{class:f([e(s).b("button"),e(s).is("active",e(d)===e(t)),e(s).is("disabled",e(r)),e(s).is("focus",e(i)),e(s).bm("button",e(c))])},[A(y("input",{ref_key:"radioRef",ref:a,"onUpdate:modelValue":b=>U(d)?d.value=b:null,class:f(e(s).be("button","original-radio")),value:e(t),type:"radio",name:n.name||((g=e(l))==null?void 0:g.name),disabled:e(r),onFocus:b=>i.value=!0,onBlur:b=>i.value=!1,onClick:h(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[D,e(d)]]),y("span",{class:f(e(s).be("button","inner")),style:ie(e(d)===e(t)?e(p):{}),onKeydown:h(()=>{},["stop"])},[$(n.$slots,"default",{},()=>[L(M(n.label),1)])],46,["onKeydown"])],2)}}});var H=k(ye,[["__file","radio-button.vue"]]);const _e=B({id:{type:String,default:void 0},size:F,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...Z(["ariaLabel"])}),ge=j,he=_({name:"ElRadioGroup"}),Be=_({...he,props:_e,emits:ge,setup(o,{emit:u}){const s=o,a=I("radio"),i=ee(),c=E(),{formItem:r}=ae(),{inputId:d,isLabeledByFormItem:l}=oe(s,{formItemContext:r}),t=n=>{u(V,n),x(()=>u(R,n))};le(()=>{const n=c.value.querySelectorAll("[type=radio]"),m=n[0];!Array.from(n).some(g=>g.checked)&&m&&(m.tabIndex=0)});const p=v(()=>s.name||i.value);return se(W,de({...ue(s),changeEvent:t,name:p})),ne(()=>s.modelValue,()=>{s.validateEvent&&(r==null||r.validate("change").catch(n=>te()))}),(n,m)=>(G(),C("div",{id:e(d),ref_key:"radioGroupRef",ref:c,class:f(e(a).b("group")),role:"radiogroup","aria-label":e(l)?void 0:n.ariaLabel||"radio-group","aria-labelledby":e(l)?e(r).labelId:void 0},[$(n.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var J=k(Be,[["__file","radio-group.vue"]]);const Re=re(ve,{RadioButton:H,RadioGroup:J}),Ve=K(J),ke=K(H);export{Ve as E,ke as a,Re as b};
