@material-ui/core
Version:
React components that implement Google's Material Design.
56 lines (52 loc) • 1.65 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import withStyles from '../styles/withStyles';
import Tablelvl2Context from '../Table/Tablelvl2Context';
export var styles = {
/* Styles applied to the root element. */
root: {
display: 'table-header-group'
}
};
var tablelvl2 = {
variant: 'head'
};
var TableHead = React.forwardRef(function TableHead(props, ref) {
var classes = props.classes,
className = props.className,
_props$component = props.component,
Component = _props$component === void 0 ? 'thead' : _props$component,
other = _objectWithoutProperties(props, ["classes", "className", "component"]);
return React.createElement(Tablelvl2Context.Provider, {
value: tablelvl2
}, React.createElement(Component, _extends({
className: clsx(classes.root, className),
ref: ref
}, other)));
});
process.env.NODE_ENV !== "production" ? TableHead.propTypes = {
/**
* The content of the component, normally `TableRow`.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) 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.elementType
} : void 0;
export default withStyles(styles, {
name: 'MuiTableHead'
})(TableHead);