@tarojs/components
Version:
1 lines • 1.3 kB
JavaScript
import{r as registerInstance,h,H as Host}from"./index-5e431bb8.js";var indexCss=".weui-progress{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}.weui-progress__bar{background-color:#ebebeb;-ms-flex:1;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}";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,e=r.percent,s=r.showInfo,o=r.borderRadius,i=r.fontSize,t=r.strokeWidth,n=r.activeColor,a=r.backgroundColor,c=r.active;var l=e>100?100:e<0?0:e;var d={height:t+"px",backgroundColor:a};var p=c?"width 1s ease-in-out":"none";var g={width:"".concat(l,"%"),transition:p,WebkitTransition:p,backgroundColor:n,borderRadius:o?"".concat(o,"px"):"0px"};return h(Host,{class:"weui-progress"},h("div",{class:"weui-progress__bar",style:d},h("div",{class:"weui-progress__inner-bar",style:g})),s&&h("div",{class:"weui-progress__opr",style:{"font-size":"".concat(i,"px")}},h("span",null,l,"%")))};return r}();Progress.style=indexCss;export{Progress as taro_progress_core};