import{booleanType as e,functionType as t,stringType as n}from"../_util/type.mjs";import r from"../_util/classNames.mjs";import i from"../_util/omit.mjs";import a,{withUndefined as o}from"../_util/vue-types/index.mjs";import{createVNode as s,defineComponent as c}from"vue";function l(e){return typeof e==`string`}function u(){}var d=()=>({prefixCls:String,itemWidth:String,active:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},status:n(),iconPrefix:String,icon:a.any,adjustMarginRight:String,stepNumber:Number,stepIndex:Number,description:a.any,title:a.any,subTitle:a.any,progressDot:o(a.oneOfType([a.looseBool,a.func])),tailContent:a.any,icons:a.shape({finish:a.any,error:a.any}).loose,onClick:t(),onStepClick:t(),stepIcon:t(),itemRender:t(),__legacy:e()}),f=c({compatConfig:{MODE:3},name:`Step`,inheritAttrs:!1,props:d(),setup(e,{slots:t,emit:n,attrs:a}){let o=t=>{n(`click`,t),n(`stepClick`,e.stepIndex)},c=({icon:n,title:i,description:a})=>{let{prefixCls:o,stepNumber:c,status:u,iconPrefix:d,icons:f,progressDot:p=t.progressDot,stepIcon:m=t.stepIcon}=e,h,g=r(`${o}-icon`,`${d}icon`,{[`${d}icon-${n}`]:n&&l(n),[`${d}icon-check`]:!n&&u===`finish`&&(f&&!f.finish||!f),[`${d}icon-cross`]:!n&&u===`error`&&(f&&!f.error||!f)}),_=s(`span`,{class:`${o}-icon-dot`},null);return h=p?typeof p==`function`?s(`span`,{class:`${o}-icon`},[p({iconDot:_,index:c-1,status:u,title:i,description:a,prefixCls:o})]):s(`span`,{class:`${o}-icon`},[_]):n&&!l(n)?s(`span`,{class:`${o}-icon`},[n]):f&&f.finish&&u===`finish`?s(`span`,{class:`${o}-icon`},[f.finish]):f&&f.error&&u===`error`?s(`span`,{class:`${o}-icon`},[f.error]):n||u===`finish`||u===`error`?s(`span`,{class:g},null):s(`span`,{class:`${o}-icon`},[c]),m&&(h=m({index:c-1,status:u,title:i,description:a,node:h})),h};return()=>{let{prefixCls:n,itemWidth:l,active:d,status:f=`wait`,tailContent:p,adjustMarginRight:m,disabled:h,title:g=t.title?.(),description:_=t.description?.(),subTitle:v=t.subTitle?.(),icon:y=t.icon?.(),onClick:b,onStepClick:x}=e,S=f||`wait`,C=r(`${n}-item`,`${n}-item-${S}`,{[`${n}-item-custom`]:y,[`${n}-item-active`]:d,[`${n}-item-disabled`]:h===!0}),w={};l&&(w.width=l),m&&(w.marginRight=m);let T={onClick:b||u};x&&!h&&(T.role=`button`,T.tabindex=0,T.onClick=o);let E=s(`div`,{...i(a,[`__legacy`]),class:[C,a.class],style:[a.style,w]},[s(`div`,{...T,class:`${n}-item-container`},[s(`div`,{class:`${n}-item-tail`},[p]),s(`div`,{class:`${n}-item-icon`},[c({icon:y,title:g,description:_})]),s(`div`,{class:`${n}-item-content`},[s(`div`,{class:`${n}-item-title`},[g,v&&s(`div`,{title:typeof v==`string`?v:void 0,class:`${n}-item-subtitle`},[v])]),_&&s(`div`,{class:`${n}-item-description`},[_])])])]);return e.itemRender?e.itemRender(E):E}}});export{d as VcStepProps,f as default};