{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n children: PropTypes.node,\n inline: PropTypes.bool,\n tag: tagPropType,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'form'\n};\n\nvar Form = /*#__PURE__*/function (_Component) {\n _inheritsLoose(Form, _Component);\n\n function Form(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));\n _this.submit = _this.submit.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = Form.prototype;\n\n _proto.getRef = function getRef(ref) {\n if (this.props.innerRef) {\n this.props.innerRef(ref);\n }\n\n this.ref = ref;\n };\n\n _proto.submit = function submit() {\n if (this.ref) {\n this.ref.submit();\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n cssModule = _this$props.cssModule,\n inline = _this$props.inline,\n Tag = _this$props.tag,\n innerRef = _this$props.innerRef,\n attributes = _objectWithoutPropertiesLoose(_this$props, [\"className\", \"cssModule\", \"inline\", \"tag\", \"innerRef\"]);\n\n var classes = mapToCssModules(classNames(className, inline ? 'form-inline' : false), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n ref: innerRef,\n className: classes\n }));\n };\n\n return Form;\n}(Component);\n\nForm.propTypes = propTypes;\nForm.defaultProps = defaultProps;\nexport default Form;","map":null,"metadata":{},"sourceType":"module"}