"use strict";const e=require("../common/validator.js"),s=require("../common/src/instantiationDecorator.js"),a=require("../common/config.js"),i=require("./props.js"),l=require("../common/utils.js"),o=require("../common/utils.wxs.js"),t=require("../../../../common/vendor.js"),c=`${a.prefix}-tag`,n=s.uniComponent({name:c,options:{styleIsolation:"shared"},externalClasses:[`${a.prefix}-class`],components:{TIcon:()=>"../icon/icon.js"},props:{...i.props},data:()=>({prefix:a.prefix,classPrefix:c,className:"",tagStyle:"",tools:o.tools,_icon:null,_closable:null}),watch:{size:"setClass",shape:"setClass",theme:"setClass",variant:"setClass",disabled:"setClass",maxWidth:"setTagStyle",icon:{handler(e){this._icon=l.calcIcon(e)},immediate:!0},closable:{handler(e){this.setClass(),this._closable=l.calcIcon(e,"close")},immediate:!0}},mounted(){this.setClass(),this.setTagStyle()},methods:{setClass(){const{prefix:e,classPrefix:s}=this,{size:a,shape:i,theme:o,variant:t,closable:c,disabled:n}=this,r=[s,`${s}--${o||"default"}`,`${s}--${t}`,c?`${s}--closable ${e}-is-closable`:"",n?`${s}--disabled ${e}-is-disabled`:"",`${s}--${a}`,`${s}--${i}`],d=l.classNames(r);this.className=d},setTagStyle(){const{maxWidth:s}=this;if(!s)return"";const a=e.isNumeric(s)?`${s}px`:s;this.tagStyle=`max-width:${a};`},handleClick(e){this.disabled||this.$emit("click",{e:e})},handleClose(e){this.disabled||this.$emit("close",{e:e})}}});if(!Array){t.resolveComponent("t-icon")()}Math;const r=t._export_sfc(n,[["render",function(e,s,a,i,l,o){return t.e({a:e._icon},e._icon?{b:t.p({"custom-style":e._icon.style||"","t-class":e.prefix+"-icon",prefix:e._icon.prefix,name:e._icon.name,size:e._icon.size,color:e._icon.color,"aria-hidden":!!e._icon.ariaHidden,"aria-label":e._icon.ariaLabel,"aria-role":e._icon.ariaRole})}:{},{c:t.n(e.classPrefix+"__icon"),d:t.n(e.classPrefix+"__text"),e:e._closable},e._closable?{f:t.o(e.handleClose),g:t.p({"custom-style":e._closable.style||"","t-class":e.classPrefix+"__icon-close "+e.prefix+"-icon",prefix:e._closable.prefix,name:e._closable.name,size:e._closable.size,color:e._closable.color,"aria-hidden":!!e._closable.ariaHidden,"aria-label":e._closable.ariaLabel||"关闭","aria-role":e._closable.ariaRole})}:{},{h:t.n(e.className+" "),i:t.n(e.tClass),j:t.s(e.tools._style([e.tagStyle,e.customStyle])),k:t.o(((...s)=>e.handleClick&&e.handleClick(...s)))})}],["__scopeId","data-v-f863a1aa"]]);wx.createComponent(r);
