import{D as e,E as t,G as s,H as r,J as i,aL as o,L as a,U as n,o as l,c as g,w as d,d as h,M as u,O as c,e as p,t as _,m as y,i as f,j as m}from"./index-DkGewvWo.js";import{_ as P}from"./_plugin-vue_export-helper.BCo6x5W8.js";const x=P({name:"u-line-progress",mixins:[s,r,e({props:{activeColor:{type:String,default:()=>t.lineProgress.activeColor},inactiveColor:{type:String,default:()=>t.lineProgress.color},percentage:{type:[String,Number],default:()=>t.lineProgress.inactiveColor},showText:{type:Boolean,default:()=>t.lineProgress.showText},height:{type:[String,Number],default:()=>t.lineProgress.height}}})],data:()=>({lineWidth:0}),watch:{percentage(e){this.resizeProgressWidth()}},computed:{progressStyle(){let e={};return e.width=this.lineWidth,e.backgroundColor=this.activeColor,e.height=i(this.height),e},innserPercentage(){return o(0,100,this.percentage)}},mounted(){this.init()},methods:{addStyle:a,addUnit:i,init(){n(20).then((()=>{this.resizeProgressWidth()}))},getProgressWidth(){return this.$uGetRect(".u-line-progress__background")},resizeProgressWidth(){this.getProgressWidth().then((e=>{const{width:t}=e;this.lineWidth=t*this.innserPercentage/100+"px"}))}}},[["render",function(e,t,s,r,i,o){const a=f,n=m;return l(),g(a,{class:"u-line-progress",style:u([o.addStyle(e.customStyle)])},{default:d((()=>[h(a,{class:"u-line-progress__background",ref:"u-line-progress__background",style:u([{backgroundColor:e.inactiveColor,height:o.addUnit(e.height)}])},null,8,["style"]),h(a,{class:"u-line-progress__line",style:u([o.progressStyle])},{default:d((()=>[c(e.$slots,"default",{},(()=>[e.showText&&e.percentage>=10?(l(),g(n,{key:0,class:"u-line-progress__text"},{default:d((()=>[p(_(o.innserPercentage+"%"),1)])),_:1})):y("",!0)]),!0)])),_:3},8,["style"])])),_:3},8,["style"])}],["__scopeId","data-v-443e8311"]]);export{x as _};