"use strict";const i=require("../../../uv-ui-tools/libs/mixin/mpMixin.js"),t=require("../../../uv-ui-tools/libs/mixin/mixin.js"),s=require("./icons.js"),e=require("./props.js"),o=require("../../../../common/vendor.js"),n={name:"uv-icon",emits:["click"],mixins:[i.mpMixin,t.mixin,e.props],data:()=>({colorType:["primary","success","info","error","warning"]}),computed:{uClasses(){let i=[];return i.push(this.customPrefix),i.push(this.customPrefix+"-"+this.name),this.color&&this.colorType.includes(this.color)&&i.push("uv-icon__icon--"+this.color),i},iconStyle(){let i={};return i={fontSize:this.$uv.addUnit(this.size),lineHeight:this.$uv.addUnit(this.size),fontWeight:this.bold?"bold":"normal",top:this.$uv.addUnit(this.top)},this.color&&!this.colorType.includes(this.color)&&(i.color=this.color),i},isImg(){const i=this.name.indexOf("data:")>-1&&this.name.indexOf("base64")>-1;return-1!==this.name.indexOf("/")||i},imgStyle(){let i={};return i.width=this.width?this.$uv.addUnit(this.width):this.$uv.addUnit(this.size),i.height=this.height?this.$uv.addUnit(this.height):this.$uv.addUnit(this.size),i},icon(){const i=s.icons["uvicon-"+this.name];return i?unescape(`%u${i}`):["uvicon"].indexOf(this.customPrefix)>-1?this.name:""}},methods:{clickHandler(i){this.$emit("click",this.index),this.stop&&this.preventEvent(i)}}};const l=o._export_sfc(n,[["render",function(i,t,s,e,n,l){return o.e({a:l.isImg},l.isImg?{b:i.name,c:i.imgMode,d:o.s(l.imgStyle),e:o.s(i.$uv.addStyle(i.customStyle))}:{f:o.t(l.icon),g:o.n(l.uClasses),h:o.s(l.iconStyle),i:o.s(i.$uv.addStyle(i.customStyle)),j:i.hoverClass},{k:""!==i.label},""!==i.label?{l:o.t(i.label),m:i.labelColor,n:i.$uv.addUnit(i.labelSize),o:"right"==i.labelPos?i.$uv.addUnit(i.space):0,p:"bottom"==i.labelPos?i.$uv.addUnit(i.space):0,q:"left"==i.labelPos?i.$uv.addUnit(i.space):0,r:"top"==i.labelPos?i.$uv.addUnit(i.space):0}:{},{s:o.o(((...i)=>l.clickHandler&&l.clickHandler(...i))),t:o.n("uv-icon--"+i.labelPos)})}],["__scopeId","data-v-eab170a5"]]);wx.createComponent(l);
