import{a0 as B,aw as P,ad as $,ae as w,ax as z,r as S,a3 as J,G as f,ay as F,a2 as _,a4 as V,o as k,c as R,a as y,i as A,az as U,f as e,m as x,n as v,A as h,ab as G,j as D,t as K,a5 as L,a7 as Q,e as X,aa as Y,M as Z,aA as ee,y as ae,ai as oe,aj as M}from"./index-25eb6331.js";import{U as I,C,k as le,u as se,l as ne,_ as N,m as te,n as re,o as ie,j as de}from"./index-3bef6acb.js";import{k as ue}from"./request-14d7fed5.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={[I]:o=>$(o)||w(o)||z(o),[C]:o=>$(o)||w(o)||z(o)},q=Symbol("radioGroupKey"),H=(o,u)=>{const s=S(),a=J(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(n){i.value?a.changeEvent(n):u&&u(I,n),s.value.checked=o.modelValue===c.value}}),d=le(f(()=>a==null?void 0:a.size)),l=se(f(()=>a==null?void 0:a.disabled)),t=S(!1),p=f(()=>l.value||i.value&&r.value!==c.value?-1:0);return ne({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: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=V("radio"),{radioRef:i,radioGroup:c,focus:r,size:d,disabled:l,modelValue:t,actualValue:p}=H(s,u);function n(){L(()=>u(C,t.value))}return(m,g)=>{var b;return k(),R("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(t)===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(t)===e(p))])},[A(y("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":E=>x(t)?t.value=E: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(t)===e(p),type:"radio",onFocus:E=>r.value=!0,onBlur:E=>r.value=!1,onChange:n,onClick:h(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[U,e(t)]]),y("span",{class:v(e(a).e("inner"))},null,2)],2),y("span",{class:v(e(a).e("label")),onKeydown:h(()=>{},["stop"])},[G(m.$slots,"default",{},()=>[D(K(m.label),1)])],42,["onKeydown"])],2)}}});var fe=N(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:t}=H(u),p=f(()=>({backgroundColor:(l==null?void 0:l.fill)||"",borderColor:(l==null?void 0:l.fill)||"",boxShadow:l!=null&&l.fill?"-1px 0 0 0 ".concat(l.fill):"",color:(l==null?void 0:l.textColor)||""}));return(n,m)=>{var g;return k(),R("label",{class:v([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=>x(d)?d.value=b:null,class:v(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"]),[[U,e(d)]]),y("span",{class:v(e(s).be("button","inner")),style:Q(e(d)===e(t)?e(p):{}),onKeydown:h(()=>{},["stop"])},[G(n.$slots,"default",{},()=>[D(K(n.label),1)])],46,["onKeydown"])],2)}}});var O=N(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},...ue(["ariaLabel"])}),ge=j,he=_({name:"ElRadioGroup"}),Be=_({...he,props:_e,emits:ge,setup(o,{emit:u}){const s=o,a=V("radio"),i=te(),c=S(),{formItem:r}=re(),{inputId:d,isLabeledByFormItem:l}=ie(s,{formItemContext:r}),t=n=>{u(I,n),L(()=>u(C,n))};X(()=>{const n=c.value.querySelectorAll("[type=radio]"),m=n[0];!Array.from(n).some(g=>g.checked)&&m&&(m.tabIndex=0)});const p=f(()=>s.name||i.value);return Y(q,Z({...ee(s),changeEvent:t,name:p})),ae(()=>s.modelValue,()=>{s.validateEvent&&(r==null||r.validate("change").catch(n=>de()))}),(n,m)=>(k(),R("div",{id:e(d),ref_key:"radioGroupRef",ref:c,class:v(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},[G(n.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var W=N(Be,[["__file","radio-group.vue"]]);const ke=oe(fe,{RadioButton:O,RadioGroup:W}),Re=M(W);M(O);export{ke as E,Re as a};
