import{getTransitionGroupProps as e,getTransitionProps as t}from"../_util/transition.mjs";import n from"../_util/collapseMotion.mjs";import{useInjectFormItemPrefix as r}from"./context.mjs";import i from"./style/index.mjs";import{Transition as a,TransitionGroup as o,computed as s,createVNode as c,defineComponent as l,ref as u,vShow as d,watch as f,withDirectives as p}from"vue";var m=l({compatConfig:{MODE:3},name:`ErrorList`,inheritAttrs:!1,props:[`errors`,`help`,`onErrorVisibleChanged`,`helpStatus`,`warnings`],setup(l,{attrs:m}){let{prefixCls:h,status:g}=r(),_=s(()=>`${h.value}-item-explain`),v=s(()=>!!(l.errors&&l.errors.length)),y=u(g.value),[,b]=i(h);return f([v,g],()=>{v.value&&(y.value=g.value)}),()=>{let r=n(`${h.value}-show-help-item`),i=e(`${h.value}-show-help-item`,r);return i.role=`alert`,i.class=[b.value,_.value,m.class,`${h.value}-show-help`],c(a,{...t(`${h.value}-show-help`),onAfterEnter:()=>l.onErrorVisibleChanged(!0),onAfterLeave:()=>l.onErrorVisibleChanged(!1)},{default:()=>[p(c(o,{...i,tag:`div`},{default:()=>[l.errors?.map((e,t)=>c(`div`,{key:t,class:y.value?`${_.value}-${y.value}`:``},[e]))]}),[[d,!!l.errors?.length]])]})}}});export{m as default};