UNPKG

1.5 kBJavaScriptView Raw
1import _extends from "@babel/runtime/helpers/esm/extends";
2import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3import * as React from 'react';
4import PropTypes from 'prop-types';
5import clsx from 'clsx';
6import withStyles from '../styles/withStyles';
7export const styles = {
8 /* Styles applied to the root element. */
9 root: {
10 width: '100%',
11 overflowX: 'auto'
12 }
13};
14const TableContainer = /*#__PURE__*/React.forwardRef(function TableContainer(props, ref) {
15 const {
16 classes,
17 className,
18 component: Component = 'div'
19 } = props,
20 other = _objectWithoutPropertiesLoose(props, ["classes", "className", "component"]);
21
22 return /*#__PURE__*/React.createElement(Component, _extends({
23 ref: ref,
24 className: clsx(classes.root, className)
25 }, other));
26});
27process.env.NODE_ENV !== "production" ? TableContainer.propTypes = {
28 /**
29 * The table itself, normally `<Table />`
30 */
31 children: PropTypes.node,
32
33 /**
34 * Override or extend the styles applied to the component.
35 * See [CSS API](#css) below for more details.
36 */
37 classes: PropTypes.object.isRequired,
38
39 /**
40 * @ignore
41 */
42 className: PropTypes.string,
43
44 /**
45 * The component used for the root node.
46 * Either a string to use a HTML element or a component.
47 */
48 component: PropTypes
49 /* @typescript-to-proptypes-ignore */
50 .elementType
51} : void 0;
52export default withStyles(styles, {
53 name: 'MuiTableContainer'
54})(TableContainer);
\No newline at end of file