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