import{defineComponent as k,createVNode as N}from"vue";import B from"../_util/classNames.mjs";import{filterEmpty as O}from"../_util/props-util/index.mjs";import{functionType as S,stringType as V}from"../_util/type.mjs";import{cloneElement as _}from"../_util/vnode.mjs";import e from"../_util/vue-types/index.mjs";import j from"./Step.mjs";const G=k({compatConfig:{MODE:3},name:"Steps",props:{type:e.string.def("default"),prefixCls:e.string.def("vc-steps"),iconPrefix:e.string.def("vc"),direction:e.string.def("horizontal"),labelPlacement:e.string.def("horizontal"),status:V("process"),size:e.string.def(""),progressDot:e.oneOfType([e.looseBool,e.func]).def(void 0),initial:e.number.def(0),current:e.number.def(0),items:e.array.def(()=>[]),icons:e.shape({finish:e.any,error:e.any}).loose,stepIcon:S(),isInline:e.looseBool,itemRender:S()},emits:["change"],setup(m,{slots:f,emit:x}){const z=t=>{const{current:s}=m;s!==t&&x("change",t)},h=(t,s,o)=>{const{prefixCls:a,iconPrefix:D,status:d,current:i,initial:$,icons:u,stepIcon:b=f.stepIcon,isInline:g,itemRender:l,progressDot:c=f.progressDot}=m,v=g||c,r={...t,class:""},n=$+s,p={active:n===i,stepNumber:n+1,stepIndex:n,key:n,prefixCls:a,iconPrefix:D,progressDot:v,stepIcon:b,icons:u,onStepClick:z};return d==="error"&&s===i-1&&(r.class=`${a}-next-error`),r.status||(n===i?r.status=d:n<i?r.status="finish":r.status="wait"),g&&(r.icon=void 0,r.subTitle=void 0),o?o({...r,...p}):(l&&(r.itemRender=y=>l(r,y)),N(j,{...r,...p,__legacy:!1},null))},C=(t,s)=>h({...t.props},s,o=>_(t,o));return()=>{const{prefixCls:t,direction:s,type:o,labelPlacement:a,iconPrefix:D,status:d,size:i,current:$,progressDot:u=f.progressDot,initial:b,icons:g,items:l,isInline:c,itemRender:v,...r}=m,n=o==="navigation",p=c||u,y=c?"horizontal":s,I=c?void 0:i,T=p?"vertical":a,E=B(t,`${t}-${s}`,{[`${t}-${I}`]:I,[`${t}-label-${T}`]:y==="horizontal",[`${t}-dot`]:!!p,[`${t}-navigation`]:n,[`${t}-inline`]:c});return N("div",{class:E,...r},[l.filter(P=>P).map((P,R)=>h(P,R)),O(f.default?.()).map(C)])}}});export{G as default};
