1 line
1.8 KiB
JSON
1 line
1.8 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 rowColWidths = ['xs', 'sm', 'md', 'lg', 'xl'];\nvar rowColsPropType = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);\nvar propTypes = {\n tag: tagPropType,\n noGutters: PropTypes.bool,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n form: PropTypes.bool,\n xs: rowColsPropType,\n sm: rowColsPropType,\n md: rowColsPropType,\n lg: rowColsPropType,\n xl: rowColsPropType\n};\nvar defaultProps = {\n tag: 'div',\n widths: rowColWidths\n};\n\nvar Row = function Row(props) {\n var className = props.className,\n cssModule = props.cssModule,\n noGutters = props.noGutters,\n Tag = props.tag,\n form = props.form,\n widths = props.widths,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"noGutters\", \"tag\", \"form\", \"widths\"]);\n\n var colClasses = [];\n widths.forEach(function (colWidth, i) {\n var colSize = props[colWidth];\n delete attributes[colWidth];\n\n if (!colSize) {\n return;\n }\n\n var isXs = !i;\n colClasses.push(isXs ? \"row-cols-\" + colSize : \"row-cols-\" + colWidth + \"-\" + colSize);\n });\n var classes = mapToCssModules(classNames(className, noGutters ? 'no-gutters' : null, form ? 'form-row' : 'row', colClasses), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nRow.propTypes = propTypes;\nRow.defaultProps = defaultProps;\nexport default Row;","map":null,"metadata":{},"sourceType":"module"} |