import{v as a,x as l,E as h,B as t,D as o,l as i,F as y,y as b,U as g,s}from"./x-CuOWXDIc.js";const _={class:"form-group"},k={key:0,class:"form-group__label"},v={key:0,class:"form-group__required"},V=["onClick"],B={class:"radio__label"},S={key:1,class:"form-group__error"},p={key:2,class:"form-group__hint"},q={__name:"RadioField",props:{modelValue:{type:[String,Number,Boolean],default:null},label:{type:String,default:""},hint:{type:String,default:""},error:{type:String,default:""},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},direction:{type:String,default:"vertical"}},emits:["update:modelValue"],setup(e,{emit:n}){const c=e,u=n;function m(d){c.disabled||u("update:modelValue",d)}return(d,x)=>(a(),l("div",_,[e.label?(a(),l("label",k,[h(t(e.label)+" ",1),e.required?(a(),l("span",v,"*")):o("",!0)])):o("",!0),i("div",{class:s(e.direction==="horizontal"?"radio-group radio-group--horizontal":"radio-group")},[(a(!0),l(y,null,b(e.options,(r,f)=>(a(),l("label",{key:f,class:s(["radio",r.disabled||e.disabled?"radio--disabled":""]),onClick:g(C=>!r.disabled&&m(r.value),["prevent"])},[i("span",{class:s(["radio__circle",e.modelValue===r.value?"radio__circle--checked":"",e.error&&e.modelValue!==r.value?"radio__circle--error":""])},null,2),i("span",B,t(r.label),1)],10,V))),128))],2),e.error?(a(),l("p",S,t(e.error),1)):e.hint?(a(),l("p",p,t(e.hint),1)):o("",!0)]))}};export{q as _};
