"use strict";

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

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

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

  var _h = _vm.$createElement;

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

  return _c('div', {
    staticClass: "BarProgress"
  }, [_vm._t("default"), _vm._v(" "), _c('div', {
    staticClass: "_bar",
    style: _vm.wrapStyle
  }, [_c('div', {
    staticClass: "_p",
    style: _vm.progressStyle
  }, [_vm.labelType == 3 ? _c('div', {
    class: ['_label', '_label_' + _vm.labelType],
    style: _vm.labelStyle
  }, [_c('span', {
    staticClass: "_text"
  }, [_vm._v(" " + _vm._s(_vm.percentage) + "% ")])]) : _vm._e()])]), _vm._v(" "), _vm.labelType != 3 ? _vm._t("value", function () {
    return [_c('div', {
      class: ['_label', '_label_' + _vm.labelType],
      style: _vm.labelStyle
    }, [_c('span', {
      staticClass: "_text"
    }, [_vm._v(" " + _vm._s(_vm.percentage) + "% ")])])];
  }) : _vm._e()], 2);
};

var __vue_staticRenderFns__ = [];
var _default = {
  _scopeId: 'data-v-c5fc1eaa',
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__,
  name: 'bar-progress',
  props: {
    percentage: {
      type: [Number, String],
      required: false,
      default: 0
    },
    color: {
      type: String,
      default: '#3ed7f5'
    },
    reverseColor: {
      type: String,
      default: 'rgba(255,255,255,0.2)'
    },
    strokeWidth: {
      type: Number,
      default: 14
    },
    borderRadius: {
      type: Number
    },
    labelType: {
      // label类型 1: 右上,2：右,3：跟随
      type: [Number, String],
      default: '1'
    },
    labelColor: {
      type: String,
      required: false,
      default: '#3ed7f5'
    },
    duration: {
      // 动画时长
      type: Number,
      default: 1500
    }
  },
  data: function data() {
    return {};
  },
  computed: {
    wrapStyle: function wrapStyle() {
      return {
        height: 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: "" + (Number(this.labelType) === 3 ? this.labelColor : ''),
        color: "" + this.labelColor
      };
    }
  }
};
exports.default = _default;