UNPKG

@mui/x-data-grid-premium

Version:

The Premium plan edition of the MUI X Data Grid Components.

47 lines 1.51 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; const _excluded = ["className", "children"]; import * as React from 'react'; import clsx from 'clsx'; import { styled } from '@mui/system'; import { getDataGridUtilityClass } from '@mui/x-data-grid-pro'; import composeClasses from '@mui/utils/composeClasses'; import { ResizablePanel, ResizablePanelHandle } from "../resizablePanel/index.js"; import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const useUtilityClasses = ownerState => { const { classes } = ownerState; const slots = { root: ['sidebar'] }; return composeClasses(slots, getDataGridUtilityClass, classes); }; const SidebarRoot = styled(ResizablePanel, { name: 'MuiDataGrid', slot: 'Sidebar' })({ display: 'flex', flexDirection: 'column', width: 300, minWidth: 260, maxWidth: 400, overflow: 'hidden' }); function Sidebar(props) { const { className, children } = props, other = _objectWithoutPropertiesLoose(props, _excluded); const rootProps = useGridRootProps(); const classes = useUtilityClasses(rootProps); return /*#__PURE__*/_jsxs(SidebarRoot, _extends({ className: clsx(className, classes.root), ownerState: rootProps }, other, { children: [/*#__PURE__*/_jsx(ResizablePanelHandle, {}), children] })); } export { Sidebar };