1 line
2.3 KiB
JSON
1 line
2.3 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 className: PropTypes.string,\n cssModule: PropTypes.object,\n size: PropTypes.string,\n bordered: PropTypes.bool,\n borderless: PropTypes.bool,\n striped: PropTypes.bool,\n dark: PropTypes.bool,\n hover: PropTypes.bool,\n responsive: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n tag: tagPropType,\n responsiveTag: tagPropType,\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object])\n};\nvar defaultProps = {\n tag: 'table',\n responsiveTag: 'div'\n};\n\nvar Table = function Table(props) {\n var className = props.className,\n cssModule = props.cssModule,\n size = props.size,\n bordered = props.bordered,\n borderless = props.borderless,\n striped = props.striped,\n dark = props.dark,\n hover = props.hover,\n responsive = props.responsive,\n Tag = props.tag,\n ResponsiveTag = props.responsiveTag,\n innerRef = props.innerRef,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"size\", \"bordered\", \"borderless\", \"striped\", \"dark\", \"hover\", \"responsive\", \"tag\", \"responsiveTag\", \"innerRef\"]);\n\n var classes = mapToCssModules(classNames(className, 'table', size ? 'table-' + size : false, bordered ? 'table-bordered' : false, borderless ? 'table-borderless' : false, striped ? 'table-striped' : false, dark ? 'table-dark' : false, hover ? 'table-hover' : false), cssModule);\n var table = React.createElement(Tag, _extends({}, attributes, {\n ref: innerRef,\n className: classes\n }));\n\n if (responsive) {\n var responsiveClassName = mapToCssModules(responsive === true ? 'table-responsive' : \"table-responsive-\" + responsive, cssModule);\n return React.createElement(ResponsiveTag, {\n className: responsiveClassName\n }, table);\n }\n\n return table;\n};\n\nTable.propTypes = propTypes;\nTable.defaultProps = defaultProps;\nexport default Table;","map":null,"metadata":{},"sourceType":"module"} |