1 | 'use client';
|
2 |
|
3 | import * as React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import clsx from 'clsx';
|
6 | import composeClasses from '@mui/utils/composeClasses';
|
7 | import Tablelvl2Context from "../Table/Tablelvl2Context.js";
|
8 | import { styled } from "../zero-styled/index.js";
|
9 | import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
10 | import { getTableHeadUtilityClass } from "./tableHeadClasses.js";
|
11 | import { jsx as _jsx } from "react/jsx-runtime";
|
12 | const useUtilityClasses = ownerState => {
|
13 | const {
|
14 | classes
|
15 | } = ownerState;
|
16 | const slots = {
|
17 | root: ['root']
|
18 | };
|
19 | return composeClasses(slots, getTableHeadUtilityClass, classes);
|
20 | };
|
21 | const TableHeadRoot = styled('thead', {
|
22 | name: 'MuiTableHead',
|
23 | slot: 'Root',
|
24 | overridesResolver: (props, styles) => styles.root
|
25 | })({
|
26 | display: 'table-header-group'
|
27 | });
|
28 | const tablelvl2 = {
|
29 | variant: 'head'
|
30 | };
|
31 | const defaultComponent = 'thead';
|
32 | const TableHead = React.forwardRef(function TableHead(inProps, ref) {
|
33 | const props = useDefaultProps({
|
34 | props: inProps,
|
35 | name: 'MuiTableHead'
|
36 | });
|
37 | const {
|
38 | className,
|
39 | component = defaultComponent,
|
40 | ...other
|
41 | } = props;
|
42 | const ownerState = {
|
43 | ...props,
|
44 | component
|
45 | };
|
46 | const classes = useUtilityClasses(ownerState);
|
47 | return _jsx(Tablelvl2Context.Provider, {
|
48 | value: tablelvl2,
|
49 | children: _jsx(TableHeadRoot, {
|
50 | as: component,
|
51 | className: clsx(classes.root, className),
|
52 | ref: ref,
|
53 | role: component === defaultComponent ? null : 'rowgroup',
|
54 | ownerState: ownerState,
|
55 | ...other
|
56 | })
|
57 | });
|
58 | });
|
59 | process.env.NODE_ENV !== "production" ? TableHead.propTypes = {
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | |
65 |
|
66 |
|
67 | children: PropTypes.node,
|
68 | |
69 |
|
70 |
|
71 | classes: PropTypes.object,
|
72 | |
73 |
|
74 |
|
75 | className: PropTypes.string,
|
76 | |
77 |
|
78 |
|
79 |
|
80 | component: PropTypes.elementType,
|
81 | |
82 |
|
83 |
|
84 | sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
85 | } : void 0;
|
86 | export default TableHead; |
\ | No newline at end of file |