var b=Object.defineProperty;var g=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var y=(e,l,s)=>l in e?b(e,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[l]=s,m=(e,l)=>{for(var s in l||(l={}))$.call(l,s)&&y(e,s,l[s]);if(g)for(var s of g(l))w.call(l,s)&&y(e,s,l[s]);return e};import{_ as B,z as P,A as H,C as h,D as N,E as C,aX as q,c as a,o as i,w as t,k as n,j as D,i as d,B as c,K as f,a1 as u,J as I,l as V,q as E,p as F,t as M}from"./index-CZJgrp0v.js";var v,z;const T={props:m({type:{type:String,default:"primary"},disabled:{type:[Boolean,String],default:!1},size:{type:String,default:"medium"},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:""},cellChild:{type:Boolean,default:!1}},(z=(v=uni.$uv)==null?void 0:v.props)==null?void 0:z.tags)},j={name:"uv-tags",emits:["click","close"],mixins:[P,H,T],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}},closeSize(){return this.size==="large"?15:this.size==="medium"?13:12},iconSize(){return this.size==="large"?21:this.size==="medium"?19:16},elIconColor(){return this.iconColor?this.iconColor:this.plain?this.type:"#ffffff"}},methods:{closeHandler(){this.$emit("close",this.name)},clickHandler(){this.$emit("click",this.name)}}};function A(e,l,s,J,K,o){const _=V,p=h(C("uv-icon"),N),r=D,S=E,k=h(C("uv-transition"),q);return i(),a(k,{mode:"fade",show:e.show,"cell-child":e.cellChild},{default:t(()=>[n(r,{class:"uv-tags-wrapper"},{default:t(()=>[n(r,{class:u(["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:f(o.clickHandler,["stop"]),style:c([{marginRight:e.closable&&e.closePlace=="right-top"?"10px":0,marginTop:e.closable&&e.closePlace=="right-top"?"10px":0},o.style,e.$uv.addStyle(e.customStyle)])},{default:t(()=>[I(e.$slots,"icon",{},()=>[e.icon?(i(),a(r,{key:0,class:"uv-tags__icon"},{default:t(()=>[e.$uv.test.image(e.icon)?(i(),a(_,{key:0,src:e.icon,style:c([o.imgStyle])},null,8,["src","style"])):(i(),a(p,{key:1,color:o.elIconColor,name:e.icon,size:o.iconSize},null,8,["color","name","size"]))]),_:1})):d("",!0)],!0),n(S,{class:u(["uv-tags__text",[`uv-tags__text--${e.type}`,e.plain&&`uv-tags__text--${e.type}--plain`,`uv-tags__text--${e.size}`]]),style:c([o.textColor])},{default:t(()=>[F(M(e.text),1)]),_:1},8,["style","class"]),e.closable&&e.closePlace=="right"?(i(),a(r,{key:0,class:u(["uv-tags__close",[`uv-tags__close--${e.size}`,`uv-tags__close--${e.closePlace}`]]),onClick:f(o.closeHandler,["stop"]),style:c({backgroundColor:e.closeColor})},{default:t(()=>[n(p,{name:"close",size:o.closeSize,color:"#ffffff"},null,8,["size"])]),_:1},8,["class","onClick","style"])):d("",!0)]),_:3},8,["class","onClick","style"]),e.closable&&e.closePlace=="right-top"?(i(),a(r,{key:0,class:u(["uv-tags__close",[`uv-tags__close--${e.size}`,`uv-tags__close--${e.closePlace}`]]),onClick:f(o.closeHandler,["stop"]),style:c({backgroundColor:e.closeColor})},{default:t(()=>[n(p,{name:"close",size:o.closeSize,color:"#ffffff"},null,8,["size"])]),_:1},8,["class","onClick","style"])):d("",!0)]),_:3})]),_:3},8,["show","cell-child"])}const G=B(j,[["render",A],["__scopeId","data-v-fe23ee2d"]]);export{G as _};
