UNPKG

@mui/x-data-grid

Version:

The community edition of the data grid component (MUI X).

52 lines 2.14 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; var _excluded = ["className"]; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { unstable_composeClasses as composeClasses } from '@mui/utils'; import { styled } from '@mui/system'; import { getDataGridUtilityClass } from '../../constants/gridClasses'; import { useGridRootProps } from '../../hooks/utils/useGridRootProps'; import { jsx as _jsx } from "react/jsx-runtime"; var useUtilityClasses = function useUtilityClasses(ownerState) { var classes = ownerState.classes; var slots = { root: ['overlay'] }; return composeClasses(slots, getDataGridUtilityClass, classes); }; var GridOverlayRoot = styled('div', { name: 'MuiDataGrid', slot: 'Overlay', overridesResolver: function overridesResolver(_, styles) { return styles.overlay; } })({ width: '100%', height: '100%', display: 'flex', alignSelf: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: 'var(--unstable_DataGrid-overlayBackground)' }); var GridOverlay = /*#__PURE__*/React.forwardRef(function GridOverlay(props, ref) { var className = props.className, other = _objectWithoutProperties(props, _excluded); var rootProps = useGridRootProps(); var classes = useUtilityClasses(rootProps); return /*#__PURE__*/_jsx(GridOverlayRoot, _extends({ ref: ref, className: clsx(classes.root, className), ownerState: rootProps }, other)); }); 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 "yarn proptypes" | // ---------------------------------------------------------------------- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]) } : void 0; export { GridOverlay };