var v=Object.defineProperty;var a=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var l=(e,t,s)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,u=(e,t)=>{for(var s in t||(t={}))y.call(t,s)&&l(e,s,t[s]);if(a)for(var s of a(t))m.call(t,s)&&l(e,s,t[s]);return e};import{_ as f,z as $,A as P,c as d,o as g,w as i,k as h,j as S,B as n,J as b,i as k,q as w,p as x,t as C}from"./index-CZJgrp0v.js";var c,p;const W={props:u({activeColor:{type:String,default:"#19be6b"},inactiveColor:{type:String,default:"#ececec"},percentage:{type:[String,Number],default:0},showText:{type:Boolean,default:!0},height:{type:[String,Number],default:12}},(p=(c=uni.$uv)==null?void 0:c.props)==null?void 0:p.lineProgress)},z={name:"uv-line-progress",mixins:[$,P,W],data(){return{lineWidth:0}},watch:{percentage(e){this.resizeProgressWidth()}},computed:{progressStyle(){let e={};return e.width=this.lineWidth,e.backgroundColor=this.activeColor,e.height=this.$uv.addUnit(this.$uv.getPx(this.height)),e},innserPercentage(){return this.$uv.range(0,100,this.percentage)}},mounted(){this.init()},methods:{init(){this.$uv.sleep(20).then(()=>{this.resizeProgressWidth()})},getProgressWidth(){return this.$uvGetRect(".uv-line-progress__background")},resizeProgressWidth(){this.getProgressWidth().then(e=>{const{width:t}=e;this.lineWidth=t*this.innserPercentage/100+"px"})}}};function N(e,t,s,B,T,o){const r=S,_=w;return g(),d(r,{class:"uv-line-progress",style:n([e.$uv.addStyle(e.customStyle)])},{default:i(()=>[h(r,{class:"uv-line-progress__background",ref:"uv-line-progress__background",style:n([{backgroundColor:e.inactiveColor,height:e.$uv.addUnit(e.$uv.getPx(e.height))}])},null,8,["style"]),h(r,{class:"uv-line-progress__line",style:n([o.progressStyle])},{default:i(()=>[b(e.$slots,"default",{},()=>[e.showText&&e.percentage>=10?(g(),d(_,{key:0,class:"uv-line-progress__text"},{default:i(()=>[x(C(o.innserPercentage+"%"),1)]),_:1})):k("",!0)],!0)]),_:3},8,["style"])]),_:3},8,["style"])}const j=f(z,[["render",N],["__scopeId","data-v-d5055174"]]);export{j as _};
