import{f as n,b as o}from"./index-9c365a03.js";import{c as i,h as a,r as e,a as l,n as t,j as s,X as r,I as d,p as c,L as g,w as u}from"./index.daaf9893.js";const[p,b]=i("button");const f=u(n({name:p,props:a({},e,{tag:l("button"),text:String,icon:String,type:l("default"),size:l("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:l("button"),loadingSize:t,loadingText:String,loadingType:String,iconPosition:l("left")}),emits:["click"],setup(n,{emit:i,slots:a}){const e=s(),l=()=>n.loading?a.loading?a.loading():o(g,{size:n.loadingSize,type:n.loadingType,class:b("loading")},null):a.icon?o("div",{class:b("icon")},[a.icon()]):n.icon?o(d,{name:n.icon,class:b("icon"),classPrefix:n.iconPrefix},null):void 0,t=()=>{let i;if(i=n.loading?n.loadingText:a.default?a.default():n.text,i)return o("span",{class:b("text")},[i])},u=()=>{const{color:o,plain:i}=n;if(o){const n={color:i?o:"white"};return i||(n.background=o),o.includes("gradient")?n.border=0:n.borderColor=o,n}},p=o=>{n.loading?c(o):n.disabled||(i("click",o),e())};return()=>{const{tag:i,type:a,size:e,block:s,round:d,plain:c,square:g,loading:f,disabled:x,hairline:m,nativeType:y,iconPosition:B}=n,S=[b([a,e,{plain:c,block:s,round:d,square:g,loading:f,disabled:x,hairline:m}]),{[r]:m}];return o(i,{type:y,class:S,style:u(),disabled:x,onClick:p},{default:()=>[o("div",{class:b("content")},["left"===B&&l(),t(),"right"===B&&l()])]})}}}));export{f as B};
