1 line
1.5 KiB
JSON
1 line
1.5 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n children: PropTypes.node,\n row: PropTypes.bool,\n check: PropTypes.bool,\n inline: PropTypes.bool,\n disabled: PropTypes.bool,\n tag: tagPropType,\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'div'\n};\n\nvar FormGroup = function FormGroup(props) {\n var className = props.className,\n cssModule = props.cssModule,\n row = props.row,\n disabled = props.disabled,\n check = props.check,\n inline = props.inline,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"row\", \"disabled\", \"check\", \"inline\", \"tag\"]);\n\n var classes = mapToCssModules(classNames(className, row ? 'row' : false, check ? 'form-check' : 'form-group', check && inline ? 'form-check-inline' : false, check && disabled ? 'disabled' : false), cssModule);\n\n if (Tag === 'fieldset') {\n attributes.disabled = disabled;\n }\n\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nFormGroup.propTypes = propTypes;\nFormGroup.defaultProps = defaultProps;\nexport default FormGroup;","map":null,"metadata":{},"sourceType":"module"} |