'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-e1b469cd.js');

const Progress = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.percent = 0;
    this.showInfo = false;
    this.borderRadius = 0;
    this.fontSize = 16;
    this.strokeWidth = 6;
    this.activeColor = '#09BB07';
    this.backgroundColor = '#EBEBEB';
    this.active = false;
  }
  render() {
    const { percent, showInfo, borderRadius, fontSize, strokeWidth, activeColor, backgroundColor, active } = this;
    const pgPercent = percent > 100 ? 100 : percent < 0 ? 0 : percent;
    const pgHeight = {
      height: strokeWidth + 'px',
      backgroundColor
    };
    const transition = active ? 'width 1s ease-in-out' : 'none';
    const pgWidth = {
      width: `${pgPercent}%`,
      transition,
      WebkitTransition: transition,
      backgroundColor: activeColor,
      borderRadius: borderRadius ? `${borderRadius}px` : '0px'
    };
    return (index.h(index.Host, { class: 'weui-progress' }, index.h("div", { class: 'weui-progress__bar', style: pgHeight }, index.h("div", { class: 'weui-progress__inner-bar', style: pgWidth })), showInfo && (index.h("div", { class: 'weui-progress__opr', style: { 'font-size': `${fontSize}px` } }, index.h("span", null, pgPercent, "%")))));
  }
};

exports.taro_progress_core = Progress;

//# sourceMappingURL=taro-progress-core.cjs.entry.js.map