import{_ as d,C as g,D as y,E as f,c as o,o as l,w as s,J as n,k as m,i as h,j as C,l as v,B as i,q as S,a1 as r,p as _,t as z,K as b}from"./index-CZJgrp0v.js";const $={props:{type:{type:String,default:"primary"},disabled:{type:[Boolean,String],default:!1},size:{type:String,default:"mini"},shape:{type:String,default:"square"},text:{type:[String,Number],default:""},bgColor:{type:String,default:""},color:{type:String,default:""},borderColor:{type:String,default:""},name:{type:[String,Number],default:""},plainFill:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},closeColor:{type:String,default:"#C6C7CB"},closePlace:{type:String,default:"right-top"},show:{type:Boolean,default:!0},icon:{type:String,default:""},iconColor:{type:String,default:""}}},k={name:"uv-tags",emits:["click","close"],mixins:[$],computed:{style(){const e={};return this.bgColor&&(e.backgroundColor=this.bgColor),this.color&&(e.color=this.color),this.borderColor&&(e.borderColor=this.borderColor),e},textColor(){const e={};return this.color&&(e.color=this.color),e},imgStyle(){const e=this.size==="large"?"17px":this.size==="medium"?"15px":"13px";return{width:e,height:e}},iconSize(){return this.size==="large"?21:this.size==="medium"?19:16},elIconColor(){return this.iconColor?this.iconColor:this.plain?this.type:"#ffffff"}},methods:{clickHandler(){this.$emit("click",this.name)}}};function B(e,w,N,P,q,t){const c=v,p=g(f("uv-icon"),y),a=C,u=S;return l(),o(a,{class:r(["uv-tags",[`uv-tags--${e.shape}`,!e.plain&&`uv-tags--${e.type}`,e.plain&&`uv-tags--${e.type}--plain`,`uv-tags--${e.size}`,`uv-tags--${e.size}--${e.closePlace}`,e.plain&&e.plainFill&&`uv-tags--${e.type}--plain--fill`]]),onClick:b(t.clickHandler,["stop"]),style:i([{marginRight:e.closable&&e.closePlace=="right-top"?"10px":0,marginTop:e.closable&&e.closePlace=="right-top"?"10px":0},t.style])},{default:s(()=>[n(e.$slots,"icon",{},()=>[e.icon?(l(),o(a,{key:0,class:"uv-tags__icon"},{default:s(()=>[e.$uv.test.image(e.icon)?(l(),o(c,{key:0,src:e.icon,style:i([t.imgStyle])},null,8,["src","style"])):(l(),o(p,{key:1,color:t.elIconColor,name:e.icon,size:t.iconSize},null,8,["color","name","size"]))]),_:1})):h("",!0)],!0),m(u,{class:r(["uv-tags__text",[`uv-tags__text--${e.type}`,e.plain&&`uv-tags__text--${e.type}--plain`,`uv-tags__text--${e.size}`]]),style:i([t.textColor])},{default:s(()=>[_(z(e.text)+" ",1),n(e.$slots,"default",{},void 0,!0)]),_:3},8,["style","class"])]),_:3},8,["class","onClick","style"])}const I=d(k,[["render",B],["__scopeId","data-v-d9c3f2b1"]]);export{I as _};
