"use strict";

exports.__esModule = true;
exports.default = void 0;

require("./index-sfc.css");

// 调试开关
var DEBUG = process.env.NODE_ENV === 'development';

var __vue_render__ = function __vue_render__() {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c('div', {
    staticClass: "BarProgress"
  }, [_c('div', {
    staticClass: "_bar",
    style: _vm.wrapStyle
  }, [_c('div', {
    staticClass: "_p",
    style: _vm.progressStyle
  }, [_vm.withLabel ? _c('div', {
    staticClass: "_label",
    style: _vm.labelStyle
  }, [_c('span', {
    staticClass: "_t"
  }, [_vm._v(" " + _vm._s(_vm.percentage) + "% ")])]) : _vm.withText ? _c('div', {
    staticClass: "_text"
  }, [_c('span', {
    staticClass: "_t"
  }, [_vm._v(" " + _vm._s(_vm.percentage) + "% ")])]) : _vm._e()])])]);
};

var __vue_staticRenderFns__ = [];
var _default = {
  _scopeId: 'data-v-4697de36',
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__,
  name: 'BarProgress',
  props: {
    percentage: {
      type: [Number, String],
      required: false,
      default: 0
    },
    color: {
      type: String,
      default: '#4fc08d'
    },
    reverseColor: {
      type: String,
      default: 'rgba(0,0,0,0.1)'
    },
    strokeWidth: {
      type: Number,
      default: 14
    },
    borderRadius: {
      type: Number
    },
    withLabel: {
      type: Boolean,
      default: false
    },
    withText: {
      type: Boolean,
      default: false
    },
    duration: {
      // 动画时长
      type: Number,
      default: 1500
    }
  },
  data: function data() {
    return {};
  },
  computed: {
    wrapStyle: function wrapStyle() {
      return {
        height: this.strokeWidth + "px",
        lineHeight: this.strokeWidth + "px",
        borderRadius: (this.borderRadius === undefined ? this.strokeWidth / 2 : this.borderRadius) + "px",
        background: "" + this.reverseColor
      };
    },
    progressStyle: function progressStyle() {
      return {
        background: "" + this.color,
        borderRadius: (this.borderRadius === undefined ? this.strokeWidth / 2 : this.borderRadius) + "px",
        transition: "all ease " + this.duration + "ms",
        width: this.percentage + "%"
      };
    },
    labelStyle: function labelStyle() {
      return {
        background: "" + this.color,
        color: "" + this.color
      };
    }
  }
};
exports.default = _default;