import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";

/* tslint:disable */
import React, { Component } from 'react';
import Form from '../Form'; // test Form.create on component without own props

var WithoutOwnProps = /*#__PURE__*/function (_Component) {
  _inherits(WithoutOwnProps, _Component);

  var _super = _createSuper(WithoutOwnProps);

  function WithoutOwnProps() {
    var _this;

    _classCallCheck(this, WithoutOwnProps);

    _this = _super.apply(this, arguments);
    _this.state = {
      foo: 'bar'
    };
    return _this;
  }

  _createClass(WithoutOwnProps, [{
    key: "render",
    value: function render() {
      return /*#__PURE__*/React.createElement("div", null, "foo");
    }
  }]);

  return WithoutOwnProps;
}(Component);

var WithoutOwnPropsForm = Form.create()(WithoutOwnProps);

/*#__PURE__*/
React.createElement(WithoutOwnPropsForm, null);

var WithOwnProps = /*#__PURE__*/function (_Component2) {
  _inherits(WithOwnProps, _Component2);

  var _super2 = _createSuper(WithOwnProps);

  function WithOwnProps() {
    var _this2;

    _classCallCheck(this, WithOwnProps);

    _this2 = _super2.apply(this, arguments);
    _this2.state = {
      foo: 'bar'
    };
    return _this2;
  }

  _createClass(WithOwnProps, [{
    key: "render",
    value: function render() {
      return /*#__PURE__*/React.createElement("div", null, "foo");
    }
  }]);

  return WithOwnProps;
}(Component);

var WithOwnPropsForm = Form.create()(WithOwnProps);

/*#__PURE__*/
React.createElement(WithOwnPropsForm, {
  name: "foo"
});

var WithCreateOptions = /*#__PURE__*/function (_Component3) {
  _inherits(WithCreateOptions, _Component3);

  var _super3 = _createSuper(WithCreateOptions);

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

    return _super3.apply(this, arguments);
  }

  _createClass(WithCreateOptions, [{
    key: "render",
    value: function render() {
      return /*#__PURE__*/React.createElement("div", null, "foo");
    }
  }]);

  return WithCreateOptions;
}(Component);

var mapPropsToFields = function mapPropsToFields(props) {
  var username = props.username;
  return {
    username: Form.createFormField({
      value: username
    })
  };
};

var formOptions = {
  mapPropsToFields: mapPropsToFields
};
var WithCreateOptionsForm = Form.create(formOptions)(WithCreateOptions);

/*#__PURE__*/
React.createElement(WithCreateOptionsForm, {
  username: "foo"
});
//# sourceMappingURL=type.js.map
