import{defineComponent as v,computed as s,createVNode as c}from"vue";import{someType as C}from"../_util/type.mjs";import{progressProps as g}from"./props.mjs";import{getSize as k}from"./utils.mjs";const y=()=>({...g(),steps:Number,strokeColor:C(),trailColor:String}),W=v({compatConfig:{MODE:3},name:"Steps",props:y(),setup(e,{slots:u}){const r=s(()=>Math.round(e.steps*((e.percent||0)/100))),m=s(()=>e.size??[e.size==="small"?2:14,e.strokeWidth||8]),i=s(()=>k(m.value,"step",{steps:e.steps,strokeWidth:e.strokeWidth||8})),p=s(()=>{const{steps:l,strokeColor:o,trailColor:d,prefixCls:n}=e,a=[];for(let t=0;t<l;t+=1){const f=Array.isArray(o)?o[t]:o,h={[`${n}-steps-item`]:!0,[`${n}-steps-item-active`]:t<=r.value-1};a.push(c("div",{key:t,class:h,style:{backgroundColor:t<=r.value-1?f:d,width:`${i.value.width/l}px`,height:`${i.value.height}px`}},null))}return a});return()=>c("div",{class:`${e.prefixCls}-steps-outer`},[p.value,u.default?.()])}});export{W as default,y as stepsProps};
