import{a as e}from"./uv-loading-icon.ad70964c.js";import{Y as t,Z as o,_ as s,G as a,H as i,o as r,j as l,w as n,h as d,m as c,y as m,e as h,F as p,I as u,l as g,z as y,a0 as b,A as f,N as v,B as x}from"./index-90c12cc1.js";import{_}from"./uv-icon.c815b875.js";import{p as S}from"./uv-button.vue_vue_type_style_index_0_scoped_bc0e850d_lang.79bfdc50.js";import{_ as z}from"./_plugin-vue_export-helper.1b428a4d.js";const C=z({name:"uv-button",mixins:[t,o,S],emits:["click"],data:()=>({}),computed:{bemClass(){return this.color?this.bem("button",["shape","size"],["disabled","plain","hairline"]):this.bem("button",["type","shape","size"],["disabled","plain","hairline"])},loadingColor(){return this.plain?this.color?this.color:"#3c9cff":"info"===this.type?"#c9c9c9":"rgb(200, 200, 200)"},iconColorCom(){return this.iconColor?this.iconColor:this.plain?this.color?this.color:this.type:"info"===this.type?"#000000":"#ffffff"},baseColor(){let e={};return this.color&&(e.color=this.plain?this.color:"white",this.plain||(e["background-color"]=this.color),-1!==this.color.indexOf("gradient")?(e.borderTopWidth=0,e.borderRightWidth=0,e.borderBottomWidth=0,e.borderLeftWidth=0,this.plain||(e.backgroundImage=this.color)):(e.borderColor=this.color,e.borderWidth="1px",e.borderStyle="solid")),e},nvueTextStyle(){let e={};return"info"===this.type&&(e.color="#323233"),this.color&&(e.color=this.plain?this.color:"white"),e.fontSize=this.textSize+"px",e},textSize(){let e=14,{size:t}=this;return"large"===t&&(e=16),"normal"===t&&(e=14),"small"===t&&(e=12),"mini"===t&&(e=10),e}},methods:{clickHandler(){this.disabled||this.loading||s((()=>{this.$emit("click")}),this.throttleTime)}}},[["render",function(t,o,s,S,z,C){const k=a(i("uv-loading-icon"),e),T=f,w=a(i("uv-icon"),_),j=v,W=x;return r(),l(W,{class:"uv-button-wrapper"},{default:n((()=>[d(j,{"hover-start-time":Number(t.hoverStartTime),"hover-stay-time":Number(t.hoverStayTime),"form-type":t.formType,"open-type":t.openType,"app-parameter":t.appParameter,"hover-stop-propagation":t.hoverStopPropagation,"send-message-title":t.sendMessageTitle,"send-message-path":t.sendMessagePath,lang:t.lang,"data-name":t.dataName,"session-from":t.sessionFrom,"send-message-img":t.sendMessageImg,"show-message-card":t.showMessageCard,"hover-class":t.disabled||t.loading?"":"uv-button--active",class:c(["uv-button uv-reset-button",C.bemClass]),style:m([C.baseColor,t.$uv.addStyle(t.customStyle)]),onClick:C.clickHandler},{default:n((()=>[t.loading?(r(),h(p,{key:0},[d(k,{mode:t.loadingMode,size:1.15*t.loadingSize,color:C.loadingColor},null,8,["mode","size","color"]),d(T,{class:"uv-button__loading-text",style:m([{fontSize:C.textSize+"px"},t.$uv.addStyle(t.customTextStyle)])},{default:n((()=>[u(g(t.loadingText||t.text),1)])),_:1},8,["style"])],64)):(r(),h(p,{key:1},[t.icon?(r(),l(w,{key:0,name:t.icon,color:C.iconColorCom,size:1.35*C.textSize,customStyle:{marginRight:"2px"}},null,8,["name","color","size"])):y("",!0),b(t.$slots,"default",{},(()=>[d(T,{class:"uv-button__text",style:m([{fontSize:C.textSize+"px"},t.$uv.addStyle(t.customTextStyle)])},{default:n((()=>[u(g(t.text),1)])),_:1},8,["style"])]),!0)],64))])),_:3},8,["hover-start-time","hover-stay-time","form-type","open-type","app-parameter","hover-stop-propagation","send-message-title","send-message-path","lang","data-name","session-from","send-message-img","show-message-card","hover-class","style","onClick","class"])])),_:3})}],["__scopeId","data-v-bc0e850d"]]);export{C as _};
