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