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