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