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