"use strict";const r=require("./props.js"),n=require("../../libs/mixin/mpMixin.js"),l=require("../../libs/mixin/mixin.js"),o=require("../../libs/function/index.js"),s=require("../../../../common/vendor.js"),a={name:"u-badge",mixins:[n.mpMixin,r.props,l.mixin],computed:{boxStyle(){return{}},badgeStyle(){const e={};if(this.color&&(e.color=this.color),this.bgColor&&!this.inverted&&(e.backgroundColor=this.bgColor),this.absolute&&(e.position="absolute",this.offset.length)){const t=this.offset[0],u=this.offset[1]||t;e.top=o.addUnit(t),e.right=o.addUnit(u)}return e},showValue(){switch(this.numberType){case"overflow":return Number(this.value)>Number(this.max)?this.max+"+":this.value;case"ellipsis":return Number(this.value)>Number(this.max)?"...":this.value;case"limit":return Number(this.value)>999?Number(this.value)>=9999?Math.floor(this.value/1e4*100)/100+"w":Math.floor(this.value/1e3*100)/100+"k":this.value;default:return Number(this.value)}}},methods:{addStyle:o.addStyle}};function d(e,t,u,m,b,i){return s.e({a:e.show&&((Number(e.value)===0?e.showZero:!0)||e.isDot)},e.show&&(Number(e.value)!==0||e.showZero||e.isDot)?{b:s.t(e.isDot?"":i.showValue),c:s.n(e.isDot?"u-badge--dot":"u-badge--not-dot"),d:s.n(e.inverted&&"u-badge--inverted"),e:s.n(e.shape==="horn"&&"u-badge--horn"),f:s.n(`u-badge--${e.type}${e.inverted?"--inverted":""}`),g:s.s(i.addStyle(e.customStyle)),h:s.s(i.badgeStyle)}:{})}const h=s._export_sfc(a,[["render",d],["__scopeId","data-v-06cca9b7"]]);wx.createComponent(h);
