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