"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _createBasic = _interopRequireDefault(require("../utils/create-basic"));

var _unit = require("../utils/format/unit");

var _default = (0, _createBasic.default)({
  render: function render() {
    var _vm = this;

    var _h = _vm.$createElement;

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

    return _c('div', {
      class: _vm.b([_vm.type, {
        vertical: _vm.vertical
      }]),
      style: _vm.style
    }, [_c('span', {
      class: _vm.b('container', _vm.type),
      style: _vm.cStyle
    }, [_vm._l(_vm.type === 'spinner' ? 12 : 0, function (item, index) {
      return _c('i', {
        key: index
      });
    }), _vm.type === 'circular' ? _c('svg', {
      class: _vm.b('circle'),
      attrs: {
        "viewBox": "25 25 50 50"
      }
    }, [_c('circle', {
      attrs: {
        "cx": "50",
        "cy": "50",
        "r": "20",
        "fill": "none"
      }
    })]) : _vm._e()], 2), _vm.$slots['default'] ? _c('span', {
      class: _vm.b('text'),
      style: {
        fontSize: _vm.addUnit(_vm.textSize)
      }
    }, [_vm._t("default")], 2) : _vm._e()]);
  },
  name: "loading",
  props: {
    size: [String, Number],
    type: {
      type: String,
      default: "circular"
    },
    color: {
      type: String,
      default: "#c9c9c9"
    },
    textSize: [Number, String],
    vertical: Boolean,
    background: String,
    backgroundSize: {
      type: String,
      default: "10px"
    }
  },
  methods: {
    addUnit: _unit.addUnit
  },
  computed: {
    style: function style() {
      return {
        color: this.color,
        background: this.background,
        padding: this.background ? this.backgroundSize : "",
        borderRadius: this.background ? "4px" : ""
      };
    },
    cStyle: function cStyle() {
      return {
        width: (0, _unit.addUnit)(this.size),
        height: (0, _unit.addUnit)(this.size)
      };
    }
  }
});

exports.default = _default;