47 lines
1.6 KiB
JavaScript
47 lines
1.6 KiB
JavaScript
'use client';
|
|
|
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
const _excluded = ["className"];
|
|
import * as React from 'react';
|
|
import clsx from 'clsx';
|
|
import composeClasses from '@mui/utils/composeClasses';
|
|
import { styled } from '@mui/system';
|
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.mjs";
|
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.mjs";
|
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
const useUtilityClasses = ownerState => {
|
|
const {
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ['columnHeaders']
|
|
};
|
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
};
|
|
const GridColumnHeadersRoot = styled('div', {
|
|
name: 'MuiDataGrid',
|
|
slot: 'ColumnHeaders'
|
|
})({
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',
|
|
borderTopRightRadius: 'var(--unstable_DataGrid-radius)'
|
|
});
|
|
export const GridBaseColumnHeaders = forwardRef(function GridColumnHeaders(props, ref) {
|
|
const {
|
|
className
|
|
} = props,
|
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
const rootProps = useGridRootProps();
|
|
const classes = useUtilityClasses(rootProps);
|
|
return /*#__PURE__*/_jsx(GridColumnHeadersRoot, _extends({
|
|
className: clsx(classes.root, className),
|
|
ownerState: rootProps
|
|
}, other, {
|
|
role: "none",
|
|
ref: ref
|
|
}));
|
|
});
|
|
if (process.env.NODE_ENV !== "production") GridBaseColumnHeaders.displayName = "GridBaseColumnHeaders"; |