"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("@aplus-frontend/antdv");require("../../config-provider/index.js");require("../../hooks/index.js");const g=require("./style/index.js"),v=require("../../config-provider/hooks/use-namespace.js"),y=require("../../hooks/useControllableValue.js"),k=["onClick"],C=e.defineComponent({name:"ApRadioGroup",__name:"ap-radio-group",props:{value:{default:""},delay:{default:0},options:{default:()=>[]},optionStyle:{default:()=>({height:28,gap:8})}},emits:["update:value","change"],setup(a,{emit:c}){const{b:s,e:o}=v.useNamespace("ap-radio-group"),d=g.default("ap-radio-group"),r=a,u=c,{value:i,updateValue:p}=y.useControllableValue(r,u),n=e.ref(i.value),f=t=>e.isVNode(t)?e.h(t):typeof t=="function"?e.h("span",t()):e.h("span",t);e.watch(()=>i.value,t=>{t!==n.value&&(n.value=t)});const m=t=>{n.value=t,setTimeout(()=>{p(t),u("change",t)},r.delay)};return(t,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(s)(),e.unref(d)])},[e.createVNode(e.unref(h.Flex),{gap:a.optionStyle?.gap,wrap:"wrap"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.options.filter(l=>l.visible!==!1),l=>(e.openBlock(),e.createElementBlock("div",{key:l.value,class:e.normalizeClass([e.unref(o)("item"),n.value===l.value?e.unref(o)("item--active"):""]),style:e.normalizeStyle({height:`${a.optionStyle?.height}px`,lineHeight:`${a.optionStyle?.height}px`,color:a.optionStyle?.color}),onClick:B=>m(l.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(l.label))))],14,k))),128))]),_:1},8,["gap"])],2))}});exports.default=C;
