import{booleanType as e,functionType as t}from"../_util/type.mjs";import n from"../_util/classNames.mjs";import r from"../_util/omit.mjs";import{useInjectDisabled as i}from"../config-provider/DisabledContext.mjs";import a from"../config-provider/hooks/useConfigInject.mjs";import o from"../_util/vue-types/index.mjs";import{FormItemInputContext as s,useInjectFormItemContext as c}from"../form/FormItemContext.mjs";import l from"../vc-checkbox/Checkbox.mjs";import{useInjectRadioGroupContext as u,useInjectRadioOptionTypeContext as d}from"./context.mjs";import f from"./style/index.mjs";import{computed as p,createVNode as m,defineComponent as h,ref as g}from"vue";var _=()=>({prefixCls:String,checked:e(),disabled:e(),isGroup:e(),value:o.any,name:String,id:String,autofocus:e(),onChange:t(),onFocus:t(),onBlur:t(),onClick:t(),"onUpdate:checked":t(),"onUpdate:value":t()}),v=h({compatConfig:{MODE:3},name:`ARadio`,inheritAttrs:!1,props:_(),setup(e,{emit:t,expose:o,slots:h,attrs:_}){let v=c(),y=s.useInject(),b=d(),x=u(),S=i(),C=p(()=>D.value??S.value),w=g(),{prefixCls:T,direction:E,disabled:D}=a(`radio`,e),O=p(()=>x?.optionType.value===`button`||b===`button`?`${T.value}-button`:T.value),k=i(),[A,j]=f(T);o({focus:()=>{w.value.focus()},blur:()=>{w.value.blur()}});let M=e=>{let n=e.target.checked;t(`update:checked`,n),t(`update:value`,n),t(`change`,e),v.onFieldChange()},N=e=>{t(`change`,e),x&&x.onChange&&x.onChange(e)};return()=>{let t=x,{prefixCls:i,id:a=v.id.value,...o}=e,s={prefixCls:O.value,id:a,...r(o,[`onUpdate:checked`,`onUpdate:value`]),disabled:D.value??k.value};t?(s.name=t.name.value,s.onChange=N,s.checked=e.value===t.value.value,s.disabled=C.value||t.disabled.value):s.onChange=M;let c=n({[`${O.value}-wrapper`]:!0,[`${O.value}-wrapper-checked`]:s.checked,[`${O.value}-wrapper-disabled`]:s.disabled,[`${O.value}-wrapper-rtl`]:E.value===`rtl`,[`${O.value}-wrapper-in-form-item`]:y.isFormItemInput},_.class,j.value);return A(m(`label`,{..._,class:c},[m(l,{...s,type:`radio`,ref:w},null),h.default&&m(`span`,null,[h.default()])]))}}});export{v as default,_ as radioProps};