"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

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

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

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

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

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

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

var _Form = _interopRequireDefault(require("../Form"));

/* tslint:disable */
// test Form.create on component without own props
var WithoutOwnProps = /*#__PURE__*/function (_Component) {
  (0, _inherits2["default"])(WithoutOwnProps, _Component);

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

  function WithoutOwnProps() {
    var _this;

    (0, _classCallCheck2["default"])(this, WithoutOwnProps);
    _this = _super.apply(this, arguments);
    _this.state = {
      foo: 'bar'
    };
    return _this;
  }

  (0, _createClass2["default"])(WithoutOwnProps, [{
    key: "render",
    value: function render() {
      return /*#__PURE__*/_react["default"].createElement("div", null, "foo");
    }
  }]);
  return WithoutOwnProps;
}(_react.Component);

var WithoutOwnPropsForm = _Form["default"].create()(WithoutOwnProps);

/*#__PURE__*/
_react["default"].createElement(WithoutOwnPropsForm, null);

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

  var _super2 = (0, _createSuper2["default"])(WithOwnProps);

  function WithOwnProps() {
    var _this2;

    (0, _classCallCheck2["default"])(this, WithOwnProps);
    _this2 = _super2.apply(this, arguments);
    _this2.state = {
      foo: 'bar'
    };
    return _this2;
  }

  (0, _createClass2["default"])(WithOwnProps, [{
    key: "render",
    value: function render() {
      return /*#__PURE__*/_react["default"].createElement("div", null, "foo");
    }
  }]);
  return WithOwnProps;
}(_react.Component);

var WithOwnPropsForm = _Form["default"].create()(WithOwnProps);

/*#__PURE__*/
_react["default"].createElement(WithOwnPropsForm, {
  name: "foo"
});

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

  var _super3 = (0, _createSuper2["default"])(WithCreateOptions);

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

  (0, _createClass2["default"])(WithCreateOptions, [{
    key: "render",
    value: function render() {
      return /*#__PURE__*/_react["default"].createElement("div", null, "foo");
    }
  }]);
  return WithCreateOptions;
}(_react.Component);

var mapPropsToFields = function mapPropsToFields(props) {
  var username = props.username;
  return {
    username: _Form["default"].createFormField({
      value: username
    })
  };
};

var formOptions = {
  mapPropsToFields: mapPropsToFields
};

var WithCreateOptionsForm = _Form["default"].create(formOptions)(WithCreateOptions);

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