1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import * as React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import clsx from 'clsx';
|
6 | import withStyles from '../styles/withStyles';
|
7 | import Tablelvl2Context from '../Table/Tablelvl2Context';
|
8 | export const styles = {
|
9 |
|
10 | root: {
|
11 | display: 'table-header-group'
|
12 | }
|
13 | };
|
14 | const tablelvl2 = {
|
15 | variant: 'head'
|
16 | };
|
17 | const defaultComponent = 'thead';
|
18 | const TableHead = React.forwardRef(function TableHead(props, ref) {
|
19 | const {
|
20 | classes,
|
21 | className,
|
22 | component: Component = defaultComponent
|
23 | } = props,
|
24 | other = _objectWithoutPropertiesLoose(props, ["classes", "className", "component"]);
|
25 |
|
26 | return React.createElement(Tablelvl2Context.Provider, {
|
27 | value: tablelvl2
|
28 | }, React.createElement(Component, _extends({
|
29 | className: clsx(classes.root, className),
|
30 | ref: ref,
|
31 | role: Component === defaultComponent ? null : 'rowgroup'
|
32 | }, other)));
|
33 | });
|
34 | process.env.NODE_ENV !== "production" ? TableHead.propTypes = {
|
35 | |
36 |
|
37 |
|
38 | children: PropTypes.node,
|
39 |
|
40 | |
41 |
|
42 |
|
43 |
|
44 | classes: PropTypes.object.isRequired,
|
45 |
|
46 | |
47 |
|
48 |
|
49 | className: PropTypes.string,
|
50 |
|
51 | |
52 |
|
53 |
|
54 |
|
55 | component: PropTypes
|
56 |
|
57 | .elementType
|
58 | } : void 0;
|
59 | export default withStyles(styles, {
|
60 | name: 'MuiTableHead'
|
61 | })(TableHead); |
\ | No newline at end of file |