UNPKG

@tarojs/components

Version:
1 lines 967 B
import{r as registerInstance,h,H as Host}from"./index-980f930f.js";var Progress=function(){function r(r){registerInstance(this,r);this.percent=0;this.showInfo=false;this.borderRadius=0;this.fontSize=16;this.strokeWidth=6;this.activeColor="#09BB07";this.backgroundColor="#EBEBEB";this.active=false}r.prototype.render=function(){var r=this,s=r.percent,o=r.showInfo,t=r.borderRadius,e=r.fontSize,i=r.strokeWidth,n=r.activeColor,a=r.backgroundColor,c=r.active;var d=s>100?100:s<0?0:s;var u={height:i+"px",backgroundColor:a};var l=c?"width 1s ease-in-out":"none";var p={width:"".concat(d,"%"),transition:l,WebkitTransition:l,backgroundColor:n,borderRadius:t?"".concat(t,"px"):"0px"};return h(Host,{class:"weui-progress"},h("div",{class:"weui-progress__bar",style:u},h("div",{class:"weui-progress__inner-bar",style:p})),o&&h("div",{class:"weui-progress__opr",style:{"font-size":"".concat(e,"px")}},h("span",null,d,"%")))};return r}();export{Progress as taro_progress_core};