import{_ as o}from"./u-icon.CLOPtL2B.js";import{q as e,o as t,c as l,w as s,v as i,x as r,t as a,a0 as c,R as n,A as d,G as u,i as p}from"./index-DL8B2Mxu.js";import{r as f}from"./uni-app.es.BSVEa1f2.js";import{_ as h}from"./_plugin-vue_export-helper.BCo6x5W8.js";const m=h({name:"u-tag",emits:["click","close"],props:{type:{type:String,default:"primary"},disabled:{type:[Boolean,String],default:!1},size:{type:String,default:"default"},shape:{type:String,default:"square"},text:{type:[String,Number],default:""},bgColor:{type:String,default:""},color:{type:String,default:""},borderColor:{type:String,default:""},closeColor:{type:String,default:""},index:{type:[Number,String],default:""},mode:{type:String,default:"light"},closeable:{type:Boolean,default:!1},show:{type:Boolean,default:!0}},data:()=>({}),computed:{customStyle(){let o={};return this.color&&(o.color=this.color),this.bgColor&&(o.backgroundColor=this.bgColor),"plain"==this.mode&&this.color&&!this.borderColor?o.borderColor=this.color:o.borderColor=this.borderColor,o},iconStyle(){if(!this.closeable)return;let o={};return"mini"==this.size?o.fontSize="20rpx":o.fontSize="22rpx","plain"==this.mode||"light"==this.mode?o.color=this.type:"dark"==this.mode&&(o.color="#ffffff"),this.closeColor&&(o.color=this.closeColor),o},closeIconColor(){return this.closeColor?this.closeColor:this.color?this.color:"dark"==this.mode?"#ffffff":this.type}},methods:{clickTag(){this.disabled||this.$emit("click",this.index)},close(){this.$emit("close",this.index)}}},[["render",function(h,m,y,g,C,b){const S=f(e("u-icon"),o),k=p;return y.show?(t(),l(k,{key:0,class:u([[y.disabled?"u-disabled":"","u-size-"+y.size,"u-shape-"+y.shape,"u-mode-"+y.mode+"-"+y.type],"u-tag"]),style:n([b.customStyle]),onClick:b.clickTag},{default:s((()=>[i(r(y.text)+" ",1),a(k,{class:"u-icon-wrap",onClick:m[0]||(m[0]=c((()=>{}),["stop"]))},{default:s((()=>[y.closeable?(t(),l(S,{key:0,onClick:b.close,size:"22",color:b.closeIconColor,name:"close",class:"u-close-icon",style:n([b.iconStyle])},null,8,["onClick","color","style"])):d("",!0)])),_:1})])),_:1},8,["class","style","onClick"])):d("",!0)}],["__scopeId","data-v-5e1a183f"]]);export{m as _};
