"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

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

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

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

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

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

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

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

var _tslib = require("tslib");

var _react = _interopRequireDefault(require("react"));

var _mobxReact = require("mobx-react");

var _omit = _interopRequireDefault(require("lodash/omit"));

var _isNumber = _interopRequireDefault(require("lodash/isNumber"));

var _progress = _interopRequireDefault(require("../../../lib/progress"));

var _FormField2 = require("../field/FormField");

var Progress = /*#__PURE__*/function (_FormField) {
  (0, _inherits2["default"])(Progress, _FormField);

  var _super = (0, _createSuper2["default"])(Progress);

  function Progress() {
    (0, _classCallCheck2["default"])(this, Progress);
    return _super.apply(this, arguments);
  }

  (0, _createClass2["default"])(Progress, [{
    key: "getValue",
    value: function getValue() {
      var value = (0, _get2["default"])((0, _getPrototypeOf2["default"])(Progress.prototype), "getValue", this).call(this);

      if ((0, _isNumber["default"])(value)) {
        return value;
      }

      return this.props.percent;
    }
  }, {
    key: "render",
    value: function render() {
      return /*#__PURE__*/_react["default"].createElement(_progress["default"], (0, _extends2["default"])({}, (0, _omit["default"])(this.props, ['dataSet', 'showHelp', 'renderer']), {
        percent: this.getValue()
      }));
    }
  }]);
  return Progress;
}(_FormField2.FormField);

Progress.displayName = 'Progress';
Progress = (0, _tslib.__decorate)([_mobxReact.observer], Progress);
var _default = Progress;
exports["default"] = _default;
//# sourceMappingURL=Progress.js.map
