UNPKG

@tarojs/components

Version:
1 lines 1.07 kB
import{r as s,h as r,H as e}from"./p-d0cabaaa.js";const o=class{constructor(r){s(this,r),this.percent=0,this.showInfo=!1,this.borderRadius=0,this.fontSize=16,this.strokeWidth=6,this.activeColor="#09BB07",this.backgroundColor="#EBEBEB",this.active=!1}render(){const{percent:s,showInfo:o,borderRadius:i,fontSize:t,strokeWidth:a,activeColor:n,backgroundColor:p,active:c}=this,l=s>100?100:s<0?0:s,h=c?"width 1s ease-in-out":"none";return r(e,{class:"weui-progress"},r("div",{class:"weui-progress__bar",style:{height:a+"px",backgroundColor:p}},r("div",{class:"weui-progress__inner-bar",style:{width:`${l}%`,transition:h,WebkitTransition:h,backgroundColor:n,borderRadius:i?`${i}px`:"0px"}})),o&&r("div",{class:"weui-progress__opr",style:{"font-size":`${t}px`}},r("span",null,l,"%")))}};o.style=".weui-progress{align-items:center;display:flex}.weui-progress__bar{background-color:#ebebeb;flex:1;height:3px}.weui-progress__inner-bar{background-color:#09bb07;width:0;height:100%}.weui-progress__opr{margin-left:15px;font-size:0;display:block}";export{o as taro_progress_core}