UNPKG

@mui/x-data-grid

Version:

The Community plan edition of the Data Grid components (MUI X).

56 lines 2.15 kB
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 PropTypes from 'prop-types'; 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.js"; import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js"; import { jsx as _jsx } from "react/jsx-runtime"; const useUtilityClasses = ownerState => { const { classes } = ownerState; const slots = { root: ['overlay'] }; return composeClasses(slots, getDataGridUtilityClass, classes); }; const GridOverlayRoot = styled('div', { name: 'MuiDataGrid', slot: 'Overlay', overridesResolver: (_, styles) => styles.overlay })({ width: '100%', height: '100%', display: 'flex', alignSelf: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: 'var(--unstable_DataGrid-overlayBackground)' }); const GridOverlay = forwardRef(function GridOverlay(props, ref) { const { className } = props, other = _objectWithoutPropertiesLoose(props, _excluded); const rootProps = useGridRootProps(); const classes = useUtilityClasses(rootProps); return /*#__PURE__*/_jsx(GridOverlayRoot, _extends({ className: clsx(classes.root, className), ownerState: rootProps }, other, { ref: ref })); }); process.env.NODE_ENV !== "production" ? GridOverlay.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the TypeScript types and run "pnpm proptypes" | // ---------------------------------------------------------------------- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]) } : void 0; export { GridOverlay };