import{Transition as e,createVNode as t,defineComponent as n,nextTick as r}from"vue";import{LoadingOutlined as i}from"@antsoo-lib/icons";var a=e=>{e&&(e.style.width=`0px`,e.style.opacity=`0`,e.style.transform=`scale(0)`)},o=e=>{r(()=>{e&&(e.style.width=`${e.scrollWidth}px`,e.style.opacity=`1`,e.style.transform=`scale(1)`)})},s=e=>{e&&e.style&&(e.style.width=null,e.style.opacity=null,e.style.transform=null)},c=n({compatConfig:{MODE:3},name:`LoadingIcon`,props:{prefixCls:String,loading:[Boolean,Object],existIcon:Boolean},setup(n){return()=>{let{existIcon:r,prefixCls:c,loading:l}=n;if(r)return t(`span`,{class:`${c}-loading-icon`},[t(i,null,null)]);let u=!!l;return t(e,{name:`${c}-loading-icon-motion`,onBeforeEnter:a,onEnter:o,onAfterEnter:s,onBeforeLeave:o,onLeave:e=>{setTimeout(()=>{a(e)})},onAfterLeave:s},{default:()=>[u?t(`span`,{class:`${c}-loading-icon`},[t(i,null,null)]):null]})}}});export{c as default};