import _extends from "@babel/runtime/helpers/extends";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _get from "@babel/runtime/helpers/get";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
import { __decorate } from "tslib";
import React from 'react';
import { observer } from 'mobx-react';
import omit from 'lodash/omit';
import isNumber from 'lodash/isNumber';
import C7NProgress from '../../../es/progress';
import { FormField } from '../field/FormField';

var Progress = /*#__PURE__*/function (_FormField) {
  _inherits(Progress, _FormField);

  var _super = _createSuper(Progress);

  function Progress() {
    _classCallCheck(this, Progress);

    return _super.apply(this, arguments);
  }

  _createClass(Progress, [{
    key: "getValue",
    value: function getValue() {
      var value = _get(_getPrototypeOf(Progress.prototype), "getValue", this).call(this);

      if (isNumber(value)) {
        return value;
      }

      return this.props.percent;
    }
  }, {
    key: "render",
    value: function render() {
      return /*#__PURE__*/React.createElement(C7NProgress, _extends({}, omit(this.props, ['dataSet', 'showHelp', 'renderer']), {
        percent: this.getValue()
      }));
    }
  }]);

  return Progress;
}(FormField);

Progress.displayName = 'Progress';
Progress = __decorate([observer], Progress);
export default Progress;
//# sourceMappingURL=Progress.js.map
