@material-ui/core
Version:
React components that implement Google's Material Design.
71 lines (63 loc) • 1.76 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = {
/* Styles applied to the root element. */
root: {
display: 'table-row-group'
}
};
class TableBody extends React.Component {
getChildContext() {
// eslint-disable-line class-methods-use-this
return {
tablelvl2: {
variant: 'body'
}
};
}
render() {
const _this$props = this.props,
{
classes,
className,
component: Component
} = _this$props,
other = _objectWithoutProperties(_this$props, ["classes", "className", "component"]);
return React.createElement(Component, _extends({
className: classNames(classes.root, className)
}, other));
}
}
TableBody.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* The content of the component, normally `TableRow`.
*/
children: PropTypes.node.isRequired,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css-api) below for more details.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The component used for the root node.
* Either a string to use a DOM element or a component.
*/
component: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object])
} : {};
TableBody.defaultProps = {
component: 'tbody'
};
TableBody.childContextTypes = {
tablelvl2: PropTypes.object
};
export default withStyles(styles, {
name: 'MuiTableBody'
})(TableBody);