neue Homepage auf react basis

This commit is contained in:
2026-08-07 21:39:30 +02:00
parent 164bdd19ad
commit ee89442c04
52191 changed files with 1230242 additions and 58 deletions
@@ -0,0 +1,9 @@
import * as React from 'react';
import type { SxProps, Theme } from '@mui/system';
export type GridFooterContainerProps = React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
};
declare const GridFooterContainer: React.ForwardRefExoticComponent<GridFooterContainerProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
} & React.RefAttributes<HTMLDivElement>>;
export { GridFooterContainer };
@@ -0,0 +1,9 @@
import * as React from 'react';
import type { SxProps, Theme } from '@mui/system';
export type GridFooterContainerProps = React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
};
declare const GridFooterContainer: React.ForwardRefExoticComponent<GridFooterContainerProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
} & React.RefAttributes<HTMLDivElement>>;
export { GridFooterContainer };
@@ -0,0 +1,62 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridFooterContainer = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
var _system = require("@mui/system");
var _forwardRef = require("@mui/x-internals/forwardRef");
var _gridClasses = require("../../constants/gridClasses");
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["className"];
const useUtilityClasses = ownerState => {
const {
classes
} = ownerState;
const slots = {
root: ['footerContainer', 'withBorderColor']
};
return (0, _composeClasses.default)(slots, _gridClasses.getDataGridUtilityClass, classes);
};
const GridFooterContainerRoot = (0, _system.styled)('div', {
name: 'MuiDataGrid',
slot: 'FooterContainer'
})({
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
minHeight: 52,
borderTop: '1px solid'
});
const GridFooterContainer = exports.GridFooterContainer = (0, _forwardRef.forwardRef)(function GridFooterContainer(props, ref) {
const {
className
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const rootProps = (0, _useGridRootProps.useGridRootProps)();
const classes = useUtilityClasses(rootProps);
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridFooterContainerRoot, (0, _extends2.default)({
className: (0, _clsx.default)(classes.root, className),
ownerState: rootProps
}, other, {
ref: ref
}));
});
if (process.env.NODE_ENV !== "production") GridFooterContainer.displayName = "GridFooterContainer";
process.env.NODE_ENV !== "production" ? GridFooterContainer.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
} : void 0;
@@ -0,0 +1,56 @@
'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 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.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: ['footerContainer', 'withBorderColor']
};
return composeClasses(slots, getDataGridUtilityClass, classes);
};
const GridFooterContainerRoot = styled('div', {
name: 'MuiDataGrid',
slot: 'FooterContainer'
})({
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
minHeight: 52,
borderTop: '1px solid'
});
const GridFooterContainer = forwardRef(function GridFooterContainer(props, ref) {
const {
className
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const rootProps = useGridRootProps();
const classes = useUtilityClasses(rootProps);
return /*#__PURE__*/_jsx(GridFooterContainerRoot, _extends({
className: clsx(classes.root, className),
ownerState: rootProps
}, other, {
ref: ref
}));
});
if (process.env.NODE_ENV !== "production") GridFooterContainer.displayName = "GridFooterContainer";
process.env.NODE_ENV !== "production" ? GridFooterContainer.propTypes /* remove-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 { GridFooterContainer };
@@ -0,0 +1,9 @@
import * as React from 'react';
import type { Theme, SxProps } from '@mui/system';
export type GridOverlayProps = React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
};
declare const GridOverlay: React.ForwardRefExoticComponent<GridOverlayProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
} & React.RefAttributes<HTMLDivElement>>;
export { GridOverlay };
@@ -0,0 +1,9 @@
import * as React from 'react';
import type { Theme, SxProps } from '@mui/system';
export type GridOverlayProps = React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
};
declare const GridOverlay: React.ForwardRefExoticComponent<GridOverlayProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
} & React.RefAttributes<HTMLDivElement>>;
export { GridOverlay };
@@ -0,0 +1,69 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridOverlay = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
var _system = require("@mui/system");
var _forwardRef = require("@mui/x-internals/forwardRef");
var _cssVariables = require("../../constants/cssVariables");
var _gridClasses = require("../../constants/gridClasses");
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["className"];
const useUtilityClasses = ownerState => {
const {
classes
} = ownerState;
const slots = {
root: ['overlay']
};
return (0, _composeClasses.default)(slots, _gridClasses.getDataGridUtilityClass, classes);
};
const GridOverlayRoot = (0, _system.styled)('div', {
name: 'MuiDataGrid',
slot: 'Overlay'
})({
width: '100%',
height: '100%',
display: 'flex',
gap: _cssVariables.vars.spacing(1),
flexDirection: 'column',
alignSelf: 'center',
alignItems: 'center',
justifyContent: 'center',
textAlign: 'center',
textWrap: 'balance',
backgroundColor: _cssVariables.vars.colors.background.backdrop
});
const GridOverlay = exports.GridOverlay = (0, _forwardRef.forwardRef)(function GridOverlay(props, ref) {
const {
className
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const rootProps = (0, _useGridRootProps.useGridRootProps)();
const classes = useUtilityClasses(rootProps);
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridOverlayRoot, (0, _extends2.default)({
className: (0, _clsx.default)(classes.root, className),
ownerState: rootProps
}, other, {
ref: ref
}));
});
if (process.env.NODE_ENV !== "production") GridOverlay.displayName = "GridOverlay";
process.env.NODE_ENV !== "production" ? GridOverlay.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
} : void 0;
@@ -0,0 +1,63 @@
'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 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 { vars } from "../../constants/cssVariables.mjs";
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: ['overlay']
};
return composeClasses(slots, getDataGridUtilityClass, classes);
};
const GridOverlayRoot = styled('div', {
name: 'MuiDataGrid',
slot: 'Overlay'
})({
width: '100%',
height: '100%',
display: 'flex',
gap: vars.spacing(1),
flexDirection: 'column',
alignSelf: 'center',
alignItems: 'center',
justifyContent: 'center',
textAlign: 'center',
textWrap: 'balance',
backgroundColor: vars.colors.background.backdrop
});
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
}));
});
if (process.env.NODE_ENV !== "production") GridOverlay.displayName = "GridOverlay";
process.env.NODE_ENV !== "production" ? GridOverlay.propTypes /* remove-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 };
@@ -0,0 +1,12 @@
import * as React from 'react';
import type { SxProps } from '@mui/system';
import type { Theme } from '@mui/material/styles';
export interface GridRootProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
sidePanel?: React.ReactNode;
}
declare const MemoizedGridRoot: React.ForwardRefExoticComponent<GridRootProps> | React.ForwardRefExoticComponent<GridRootProps & React.RefAttributes<HTMLDivElement>>;
export { MemoizedGridRoot as GridRoot };
@@ -0,0 +1,12 @@
import * as React from 'react';
import type { SxProps } from '@mui/system';
import type { Theme } from '@mui/material/styles';
export interface GridRootProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
sidePanel?: React.ReactNode;
}
declare const MemoizedGridRoot: React.ForwardRefExoticComponent<GridRootProps> | React.ForwardRefExoticComponent<GridRootProps & React.RefAttributes<HTMLDivElement>>;
export { MemoizedGridRoot as GridRoot };
@@ -0,0 +1,94 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridRoot = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
var _capitalize = _interopRequireDefault(require("@mui/utils/capitalize"));
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
var _fastMemo = require("@mui/x-internals/fastMemo");
var _forwardRef = require("@mui/x-internals/forwardRef");
var _GridRootStyles = require("./GridRootStyles");
var _context = require("../../utils/css/context");
var _useGridSelector = require("../../hooks/utils/useGridSelector");
var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
var _gridClasses = require("../../constants/gridClasses");
var _densitySelector = require("../../hooks/features/density/densitySelector");
var _useIsSSR = require("../../hooks/utils/useIsSSR");
var _GridHeader = require("../GridHeader");
var _base = require("../base");
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["className", "children", "sidePanel"];
const useUtilityClasses = (ownerState, density) => {
const {
autoHeight,
classes,
showCellVerticalBorder
} = ownerState;
const slots = {
root: ['root', autoHeight && 'autoHeight', `root--density${(0, _capitalize.default)(density)}`, ownerState.slots.toolbar === null && 'root--noToolbar', 'withBorderColor', showCellVerticalBorder && 'withVerticalBorder']
};
return (0, _composeClasses.default)(slots, _gridClasses.getDataGridUtilityClass, classes);
};
const GridRoot = (0, _forwardRef.forwardRef)(function GridRoot(props, ref) {
const rootProps = (0, _useGridRootProps.useGridRootProps)();
const {
className,
children,
sidePanel
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
const density = (0, _useGridSelector.useGridSelector)(apiRef, _densitySelector.gridDensitySelector);
const rootElementRef = apiRef.current.rootElementRef;
const rootMountCallback = React.useCallback(node => {
if (node === null) {
return;
}
apiRef.current.publishEvent('rootMount', node);
}, [apiRef]);
const handleRef = (0, _useForkRef.default)(rootElementRef, ref, rootMountCallback);
const ownerState = rootProps;
const classes = useUtilityClasses(ownerState, density);
const cssVariables = (0, _context.useCSSVariablesContext)();
const isSSR = (0, _useIsSSR.useIsSSR)();
if (isSSR) {
return null;
}
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridRootStyles.GridRootStyles, (0, _extends2.default)({
className: (0, _clsx.default)(classes.root, className, cssVariables.className, sidePanel && _gridClasses.gridClasses.withSidePanel),
ownerState: ownerState
}, other, {
ref: handleRef,
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
className: _gridClasses.gridClasses.mainContent,
role: "none",
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GridHeader.GridHeader, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.GridBody, {
children: children
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.GridFooterPlaceholder, {})]
}), sidePanel, cssVariables.tag]
}));
});
if (process.env.NODE_ENV !== "production") GridRoot.displayName = "GridRoot";
process.env.NODE_ENV !== "production" ? GridRoot.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
sidePanel: _propTypes.default.node,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
} : void 0;
const MemoizedGridRoot = exports.GridRoot = (0, _fastMemo.fastMemo)(GridRoot);
@@ -0,0 +1,88 @@
'use client';
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
const _excluded = ["className", "children", "sidePanel"];
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import useForkRef from '@mui/utils/useForkRef';
import capitalize from '@mui/utils/capitalize';
import composeClasses from '@mui/utils/composeClasses';
import { fastMemo } from '@mui/x-internals/fastMemo';
import { forwardRef } from '@mui/x-internals/forwardRef';
import { GridRootStyles } from "./GridRootStyles.mjs";
import { useCSSVariablesContext } from "../../utils/css/context.mjs";
import { useGridSelector } from "../../hooks/utils/useGridSelector.mjs";
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.mjs";
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.mjs";
import { getDataGridUtilityClass, gridClasses } from "../../constants/gridClasses.mjs";
import { gridDensitySelector } from "../../hooks/features/density/densitySelector.mjs";
import { useIsSSR } from "../../hooks/utils/useIsSSR.mjs";
import { GridHeader } from "../GridHeader.mjs";
import { GridBody, GridFooterPlaceholder } from "../base/index.mjs";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const useUtilityClasses = (ownerState, density) => {
const {
autoHeight,
classes,
showCellVerticalBorder
} = ownerState;
const slots = {
root: ['root', autoHeight && 'autoHeight', `root--density${capitalize(density)}`, ownerState.slots.toolbar === null && 'root--noToolbar', 'withBorderColor', showCellVerticalBorder && 'withVerticalBorder']
};
return composeClasses(slots, getDataGridUtilityClass, classes);
};
const GridRoot = forwardRef(function GridRoot(props, ref) {
const rootProps = useGridRootProps();
const {
className,
children,
sidePanel
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const apiRef = useGridPrivateApiContext();
const density = useGridSelector(apiRef, gridDensitySelector);
const rootElementRef = apiRef.current.rootElementRef;
const rootMountCallback = React.useCallback(node => {
if (node === null) {
return;
}
apiRef.current.publishEvent('rootMount', node);
}, [apiRef]);
const handleRef = useForkRef(rootElementRef, ref, rootMountCallback);
const ownerState = rootProps;
const classes = useUtilityClasses(ownerState, density);
const cssVariables = useCSSVariablesContext();
const isSSR = useIsSSR();
if (isSSR) {
return null;
}
return /*#__PURE__*/_jsxs(GridRootStyles, _extends({
className: clsx(classes.root, className, cssVariables.className, sidePanel && gridClasses.withSidePanel),
ownerState: ownerState
}, other, {
ref: handleRef,
children: [/*#__PURE__*/_jsxs("div", {
className: gridClasses.mainContent,
role: "none",
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {
children: children
}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
}), sidePanel, cssVariables.tag]
}));
});
if (process.env.NODE_ENV !== "production") GridRoot.displayName = "GridRoot";
process.env.NODE_ENV !== "production" ? GridRoot.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
sidePanel: PropTypes.node,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
} : void 0;
const MemoizedGridRoot = fastMemo(GridRoot);
export { MemoizedGridRoot as GridRoot };
@@ -0,0 +1,7 @@
import type { DataGridProcessedProps } from "../../models/props/DataGridProps.mjs";
export type OwnerState = DataGridProcessedProps;
export declare const GridRootStyles: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
ownerState: OwnerState;
}, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
export declare const supportsColorMix: boolean;
export declare const colorMixIfSupported: (colorMixValue: string, fallback: string) => string;
@@ -0,0 +1,7 @@
import type { DataGridProcessedProps } from "../../models/props/DataGridProps.js";
export type OwnerState = DataGridProcessedProps;
export declare const GridRootStyles: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
ownerState: OwnerState;
}, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
export declare const supportsColorMix: boolean;
export declare const colorMixIfSupported: (colorMixValue: string, fallback: string) => string;
@@ -0,0 +1,847 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.supportsColorMix = exports.colorMixIfSupported = exports.GridRootStyles = void 0;
var _styles = require("@mui/material/styles");
var _gridClasses = require("../../constants/gridClasses");
var _cssVariables = require("../../constants/cssVariables");
var _useGridSelector = require("../../hooks/utils/useGridSelector");
var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
const columnSeparatorTargetSize = 10;
const columnSeparatorOffset = -5;
const focusOutlineWidth = 1;
const separatorIconDragStyles = {
width: 3,
rx: 1.5,
x: 10.5
};
// Emotion thinks it knows better than us which selector we should use.
// https://github.com/emotion-js/emotion/issues/1105#issuecomment-1722524968
const ignoreSsrWarning = '/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */';
const shouldShowBorderTopRightRadiusSelector = apiRef => !apiRef.current.state.dimensions.isReady ? apiRef.current.state.dimensions.scrollbarSize === 0 : apiRef.current.state.dimensions.hasScrollX && (!apiRef.current.state.dimensions.hasScrollY || apiRef.current.state.dimensions.scrollbarSize === 0);
const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
name: 'MuiDataGrid',
slot: 'Root',
overridesResolver: (props, styles) => {
// Root overrides
const overrides = [styles.root];
_gridClasses.gridClassesOverrides.root.forEach(key => {
if (styles[key] !== undefined) {
overrides.push({
[`&.${_gridClasses.gridClasses[key]}`]: styles[key]
});
}
});
// Child element overrides
// - Only declare overrides here for class names that are not applied to `styled` components.
// - For `styled` components, declare overrides in the component itself.
_gridClasses.gridClassesOverrides.children.forEach(key => {
if (styles[key] !== undefined) {
overrides.push({
[`& .${_gridClasses.gridClasses[key]}`]: styles[key]
});
}
});
return overrides;
}
})(() => {
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
const shouldShowBorderTopRightRadius = (0, _useGridSelector.useGridSelector)(apiRef, shouldShowBorderTopRightRadiusSelector);
const baseBackground = _cssVariables.vars.colors.background.base;
const headerBackground = _cssVariables.vars.header.background.base;
const pinnedBackground = _cssVariables.vars.cell.background.pinned;
const hoverColor = removeOpacity(_cssVariables.vars.colors.interactive.hover);
const hoverOpacity = _cssVariables.vars.colors.interactive.hoverOpacity;
const selectedColor = _cssVariables.vars.colors.interactive.selected;
const selectedOpacity = _cssVariables.vars.colors.interactive.selectedOpacity;
const selectedHoverColor = selectedColor;
const selectedHoverOpacity = `calc(${selectedOpacity} + ${hoverOpacity})`;
const fallbackColors = {
hover: _cssVariables.vars.colors.interactive.hover,
selected: selectedColor,
selectedHover: selectedColor
};
const hoverBackground = mix(baseBackground, hoverColor, hoverOpacity, fallbackColors.hover);
const selectedBackground = mix(baseBackground, selectedColor, selectedOpacity, fallbackColors.selected);
const selectedHoverBackground = mix(baseBackground, selectedHoverColor, selectedHoverOpacity, fallbackColors.selectedHover);
const pinnedHoverBackground = mix(pinnedBackground, hoverColor, hoverOpacity, fallbackColors.hover);
const pinnedSelectedBackground = mix(pinnedBackground, selectedColor, selectedOpacity, fallbackColors.selected);
const pinnedSelectedHoverBackground = mix(pinnedBackground, selectedHoverColor, selectedHoverOpacity, fallbackColors.selectedHover);
const getPinnedBackgroundStyles = backgroundColor => ({
[`& .${_gridClasses.gridClasses['cell--pinnedLeft']}, & .${_gridClasses.gridClasses['cell--pinnedRight']}`]: {
backgroundColor,
'&.Mui-selected': {
backgroundColor: mix(backgroundColor, selectedBackground, selectedOpacity, fallbackColors.selected),
'&:hover': {
backgroundColor: mix(backgroundColor, selectedHoverBackground, selectedHoverOpacity, fallbackColors.selectedHover)
}
}
}
});
const pinnedHoverStyles = getPinnedBackgroundStyles(pinnedHoverBackground);
const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackground);
const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackground);
const selectedStyles = {
backgroundColor: selectedBackground,
'&:hover': {
backgroundColor: selectedHoverBackground,
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: selectedBackground
}
}
};
const gridStyle = {
'--unstable_DataGrid-radius': _cssVariables.vars.radius.base,
'--unstable_DataGrid-headWeight': _cssVariables.vars.typography.fontWeight.medium,
'--DataGrid-rowBorderColor': _cssVariables.vars.colors.border.base,
'--DataGrid-cellOffsetMultiplier': 2,
'--DataGrid-width': '0px',
'--DataGrid-hasScrollX': '0',
'--DataGrid-hasScrollY': '0',
'--DataGrid-scrollbarSize': '10px',
'--DataGrid-rowWidth': '0px',
'--DataGrid-columnsTotalWidth': '0px',
'--DataGrid-leftPinnedWidth': '0px',
'--DataGrid-rightPinnedWidth': '0px',
'--DataGrid-headerHeight': '0px',
'--DataGrid-headersTotalHeight': '0px',
'--DataGrid-topContainerHeight': '0px',
'--DataGrid-bottomContainerHeight': '0px',
'--DataGrid-horizontalFiller': '0px',
flex: 1,
boxSizing: 'border-box',
position: 'relative',
borderWidth: '1px',
borderStyle: 'solid',
borderColor: _cssVariables.vars.colors.border.base,
borderRadius: 'var(--unstable_DataGrid-radius)',
backgroundColor: _cssVariables.vars.colors.background.base,
color: _cssVariables.vars.colors.foreground.base,
font: _cssVariables.vars.typography.font.body,
outline: 'none',
height: '100%',
display: 'flex',
minWidth: 0,
// See https://github.com/mui/mui-x/issues/8547
minHeight: 0,
flexDirection: 'column',
overflow: 'hidden',
transform: 'translate(0, 0)',
// Create a stacking context to keep scrollbars from showing on top
[`& .${_gridClasses.gridClasses.virtualScroller}`]: {
overflowAnchor: 'none' // Keep the same scrolling position
},
// Use `css` tagged template so the ignore-comment remains a sibling of the
// `:first-child` rule in the stylis AST. Previously, the comment was embedded
// in the object-key selector, which got separated from the rule during
// pre-serialization when `styleOverrides` were applied, re-triggering Emotion's
// unsafe-selector SSR warning. https://github.com/emotion-js/emotion/issues/1105
[`.${_gridClasses.gridClasses.main}`]: (0, _styles.css)`
& > *:first-child ${ignoreSsrWarning} {
border-top-left-radius: var(--unstable_DataGrid-radius);
border-top-right-radius: var(--unstable_DataGrid-radius);
}
`,
[`&.${_gridClasses.gridClasses.autoHeight}`]: {
height: 'auto'
},
[`&.${_gridClasses.gridClasses.autosizing}`]: {
[`& .${_gridClasses.gridClasses.columnHeaderTitleContainerContent} > *`]: {
overflow: 'visible !important'
},
'@media (hover: hover)': {
[`& .${_gridClasses.gridClasses.menuIcon}`]: {
width: '0 !important',
visibility: 'hidden !important'
}
},
[`& .${_gridClasses.gridClasses.cell}`]: {
overflow: 'visible !important',
whiteSpace: 'nowrap',
minWidth: 'max-content !important',
maxWidth: 'max-content !important'
},
[`& .${_gridClasses.gridClasses.groupingCriteriaCell}`]: {
width: 'unset'
},
[`& .${_gridClasses.gridClasses.treeDataGroupingCell}`]: {
width: 'unset'
},
[`& .${_gridClasses.gridClasses['columnHeader--filter']}`]: {
flex: 'none !important',
width: 'unset !important'
},
[`& .${_gridClasses.gridClasses.multiSelectCell}`]: {
width: 'max-content',
overflow: 'visible'
},
[`& .${_gridClasses.gridClasses['multiSelectCellChip--hidden']}`]: {
display: 'inline-flex'
},
[`& .${_gridClasses.gridClasses.multiSelectCellOverflow}`]: {
display: 'none'
}
},
[`&.${_gridClasses.gridClasses.withSidePanel}`]: {
flexDirection: 'row'
},
[`& .${_gridClasses.gridClasses.mainContent}`]: {
display: 'flex',
flexDirection: 'column',
overflow: 'hidden',
flex: 1
},
[`& .${_gridClasses.gridClasses.columnHeader}, & .${_gridClasses.gridClasses.cell}`]: {
WebkitTapHighlightColor: 'transparent',
padding: '0 10px',
boxSizing: 'border-box'
},
[`& .${_gridClasses.gridClasses.columnHeader}:focus-within, & .${_gridClasses.gridClasses.cell}:focus-within`]: {
outline: `solid ${setOpacity(_cssVariables.vars.colors.interactive.focus, 0.5)} ${focusOutlineWidth}px`,
outlineOffset: focusOutlineWidth * -1
},
[`& .${_gridClasses.gridClasses.columnHeader}:focus, & .${_gridClasses.gridClasses.cell}:focus`]: {
outline: `solid ${_cssVariables.vars.colors.interactive.focus} ${focusOutlineWidth}px`,
outlineOffset: focusOutlineWidth * -1
},
// Hide the column separator when:
// - the column is focused and has an outline
// - the next column is focused and has an outline
// - the column has a left or right border
// - the next column is pinned right and has a left border
[`& .${_gridClasses.gridClasses.columnHeader}:focus,
& .${_gridClasses.gridClasses['columnHeader--withLeftBorder']},
& .${_gridClasses.gridClasses['columnHeader--withRightBorder']},
& .${_gridClasses.gridClasses['columnHeader--siblingFocused']}
`]: {
[`& .${_gridClasses.gridClasses.columnSeparator}`]: {
opacity: 0
},
// Show resizable separators at all times on touch devices
'@media (hover: none)': {
[`& .${_gridClasses.gridClasses['columnSeparator--resizable']}`]: {
opacity: 1
}
},
[`& .${_gridClasses.gridClasses['columnSeparator--resizable']}:hover`]: {
opacity: 1
}
},
[`&.${_gridClasses.gridClasses['root--noToolbar']} [aria-rowindex="1"] [aria-colindex="1"]`]: {
borderTopLeftRadius: 'calc(var(--unstable_DataGrid-radius) - 1px)'
},
[`&.${_gridClasses.gridClasses['root--noToolbar']} [aria-rowindex="1"] .${_gridClasses.gridClasses['columnHeader--last']}`]: {
borderTopRightRadius: shouldShowBorderTopRightRadius ? 'calc(var(--unstable_DataGrid-radius) - 1px)' : undefined
},
[`& .${_gridClasses.gridClasses.columnHeaderCheckbox}, & .${_gridClasses.gridClasses.cellCheckbox}`]: {
padding: 0,
justifyContent: 'center',
alignItems: 'center'
},
[`& .${_gridClasses.gridClasses.columnHeader}`]: {
position: 'relative',
display: 'flex',
alignItems: 'center',
backgroundColor: headerBackground,
flex: '0 0 auto'
},
[`& .${_gridClasses.gridClasses.columnHeader} .${_gridClasses.gridClasses.sortButton}`]: {
backgroundColor: _cssVariables.vars.header.background.base
},
[`& .${_gridClasses.gridClasses['columnHeader--filter']}`]: {
paddingTop: 8,
paddingBottom: 8,
paddingRight: 5,
minHeight: 'min-content',
overflow: 'hidden'
},
[`&.${_gridClasses.gridClasses['root--densityCompact']} .${_gridClasses.gridClasses['columnHeader--filter']}`]: {
paddingTop: 4,
paddingBottom: 4
},
[`& .${_gridClasses.gridClasses['virtualScroller--hasScrollX']} .${_gridClasses.gridClasses['columnHeader--last']}`]: {
overflow: 'hidden'
},
[`& .${_gridClasses.gridClasses['pivotPanelField--sorted']} .${_gridClasses.gridClasses.iconButtonContainer},
& .${_gridClasses.gridClasses['columnHeader--sorted']} .${_gridClasses.gridClasses.iconButtonContainer},
& .${_gridClasses.gridClasses['columnHeader--filtered']} .${_gridClasses.gridClasses.iconButtonContainer}`]: {
visibility: 'visible',
width: 'auto'
},
[`& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}) .${_gridClasses.gridClasses.sortButton},
& .${_gridClasses.gridClasses.columnHeader}:not(.${_gridClasses.gridClasses['columnHeader--sorted']}) .${_gridClasses.gridClasses.sortButton}`]: {
opacity: 0,
transition: _cssVariables.vars.transition(['opacity'], {
duration: _cssVariables.vars.transitions.duration.short
})
},
[`& .${_gridClasses.gridClasses.columnHeaderTitleContainer}`]: {
display: 'flex',
alignItems: 'center',
gap: _cssVariables.vars.spacing(0.25),
minWidth: 0,
flex: 1,
whiteSpace: 'nowrap',
overflow: 'hidden'
},
[`& .${_gridClasses.gridClasses.columnHeaderTitleContainerContent}`]: {
overflow: 'hidden',
display: 'flex',
alignItems: 'center'
},
[`& .${_gridClasses.gridClasses['columnHeader--filledGroup']} .${_gridClasses.gridClasses.columnHeaderTitleContainer}`]: {
borderBottomWidth: '1px',
borderBottomStyle: 'solid',
boxSizing: 'border-box'
},
[`& .${_gridClasses.gridClasses.sortIcon}, & .${_gridClasses.gridClasses.filterIcon}`]: {
fontSize: 'inherit'
},
[`& .${_gridClasses.gridClasses['columnHeader--sortable']}`]: {
cursor: 'pointer'
},
[`& .${_gridClasses.gridClasses['columnHeader--alignCenter']} .${_gridClasses.gridClasses.columnHeaderTitleContainer}`]: {
justifyContent: 'center'
},
[`& .${_gridClasses.gridClasses['columnHeader--alignRight']} .${_gridClasses.gridClasses.columnHeaderDraggableContainer}, & .${_gridClasses.gridClasses['columnHeader--alignRight']} .${_gridClasses.gridClasses.columnHeaderTitleContainer}`]: {
flexDirection: 'row-reverse'
},
[`& .${_gridClasses.gridClasses['columnHeader--alignCenter']} .${_gridClasses.gridClasses.menuIcon}`]: {
marginLeft: 'auto'
},
[`& .${_gridClasses.gridClasses['columnHeader--alignRight']} .${_gridClasses.gridClasses.menuIcon}`]: {
marginRight: 'auto',
marginLeft: -5
},
[`& .${_gridClasses.gridClasses['columnHeader--moving']}`]: {
backgroundColor: hoverBackground
},
[`& .${_gridClasses.gridClasses['columnHeader--pinnedLeft']}, & .${_gridClasses.gridClasses['columnHeader--pinnedRight']}`]: {
position: 'sticky',
zIndex: 40,
// Should be above the column separator
background: _cssVariables.vars.header.background.base
},
[`& .${_gridClasses.gridClasses.columnSeparator}`]: {
position: 'absolute',
overflow: 'hidden',
zIndex: 30,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
maxWidth: columnSeparatorTargetSize,
color: _cssVariables.vars.colors.border.base
},
[`& .${_gridClasses.gridClasses.columnHeaders}`]: {
width: 'var(--DataGrid-rowWidth)',
backgroundColor: headerBackground
},
'@media (hover: hover)': {
[`& .${_gridClasses.gridClasses.columnHeader}:hover`]: {
[`& .${_gridClasses.gridClasses.menuIcon}`]: {
width: 'auto',
visibility: 'visible'
},
[`& .${_gridClasses.gridClasses.iconButtonContainer}`]: {
visibility: 'visible',
width: 'auto'
}
},
[`& .${_gridClasses.gridClasses.columnHeader}:not(.${_gridClasses.gridClasses['columnHeader--sorted']}):hover .${_gridClasses.gridClasses.sortButton},
& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}):hover .${_gridClasses.gridClasses.sortButton},
& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}) .${_gridClasses.gridClasses.sortButton}:focus-visible`]: {
opacity: 1
},
// Add opacity only to the button content to avoid affecting the background color
[`& .${_gridClasses.gridClasses.columnHeader}:not(.${_gridClasses.gridClasses['columnHeader--sorted']}):hover .${_gridClasses.gridClasses.sortButton} > *,
& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}):hover .${_gridClasses.gridClasses.sortButton} > *,
& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}) .${_gridClasses.gridClasses.sortButton}:focus-visible > *`]: {
opacity: 0.78
},
[`& .${_gridClasses.gridClasses.pivotPanelFieldActionContainer} button:hover`]: {
backgroundColor: _cssVariables.vars.colors.background.base
}
},
'@media (hover: none)': {
[`& .${_gridClasses.gridClasses.columnHeader} .${_gridClasses.gridClasses.menuIcon}`]: {
width: 'auto',
visibility: 'visible'
},
[`& .${_gridClasses.gridClasses.columnHeader}:focus,
& .${_gridClasses.gridClasses['columnHeader--siblingFocused']}`]: {
[`.${_gridClasses.gridClasses['columnSeparator--resizable']}`]: {
color: _cssVariables.vars.colors.foreground.accent
}
},
[`& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}) .${_gridClasses.gridClasses.sortButton}`]: {
opacity: 0.78
}
},
// Hide the column separator when the column has border and it is not resizable
// In this case, this column separator may block interaction with the separator from the adjacent column that is resizable
[`& .${_gridClasses.gridClasses['columnHeader--withLeftBorder']} .${_gridClasses.gridClasses['columnSeparator--sideLeft']}:not(.${_gridClasses.gridClasses['columnSeparator--resizable']}), & .${_gridClasses.gridClasses['columnHeader--withRightBorder']} .${_gridClasses.gridClasses['columnSeparator--sideRight']}:not(.${_gridClasses.gridClasses['columnSeparator--resizable']})`]: {
display: 'none'
},
[`& .${_gridClasses.gridClasses['columnSeparator--sideLeft']}`]: {
left: columnSeparatorOffset
},
[`& .${_gridClasses.gridClasses['columnSeparator--sideRight']}`]: {
right: columnSeparatorOffset
},
[`& .${_gridClasses.gridClasses['columnHeader--withRightBorder']} .${_gridClasses.gridClasses['columnSeparator--sideLeft']}`]: {
left: columnSeparatorOffset - 0.5
},
[`& .${_gridClasses.gridClasses['columnHeader--withRightBorder']} .${_gridClasses.gridClasses['columnSeparator--sideRight']}`]: {
right: columnSeparatorOffset - 0.5
},
[`& .${_gridClasses.gridClasses['columnSeparator--resizable']}`]: {
cursor: 'col-resize',
touchAction: 'none',
[`&.${_gridClasses.gridClasses['columnSeparator--resizing']}`]: {
color: _cssVariables.vars.colors.foreground.accent
},
// Always appear as draggable on touch devices
'@media (hover: none)': {
[`& .${_gridClasses.gridClasses.iconSeparator} rect`]: separatorIconDragStyles
},
'@media (hover: hover)': {
'&:hover': {
color: _cssVariables.vars.colors.foreground.accent,
[`& .${_gridClasses.gridClasses.iconSeparator} rect`]: separatorIconDragStyles
}
},
'& svg': {
pointerEvents: 'none'
}
},
[`& .${_gridClasses.gridClasses.iconSeparator}`]: {
color: 'inherit',
transition: _cssVariables.vars.transition(['color', 'width'], {
duration: _cssVariables.vars.transitions.duration.short
})
},
[`& .${_gridClasses.gridClasses.menuIcon}`]: {
width: 0,
visibility: 'hidden',
fontSize: 20,
marginRight: -5,
display: 'flex',
alignItems: 'center'
},
[`.${_gridClasses.gridClasses.menuOpen}`]: {
visibility: 'visible',
width: 'auto'
},
[`& .${_gridClasses.gridClasses.headerFilterRow}`]: {
[`& .${_gridClasses.gridClasses.columnHeader}, & .${_gridClasses.gridClasses.scrollbarFiller}`]: {
boxSizing: 'border-box',
borderBottom: '1px solid var(--DataGrid-rowBorderColor)'
}
},
/* Bottom border of the top-container */
[`& .${_gridClasses.gridClasses['row--borderBottom']} .${_gridClasses.gridClasses.columnHeader},
& .${_gridClasses.gridClasses['row--borderBottom']} .${_gridClasses.gridClasses.filler},
& .${_gridClasses.gridClasses['row--borderBottom']} .${_gridClasses.gridClasses.scrollbarFiller}`]: {
borderBottom: `1px solid var(--DataGrid-rowBorderColor)`
},
[`& .${_gridClasses.gridClasses['row--borderBottom']} .${_gridClasses.gridClasses.cell}`]: {
borderBottom: `1px solid var(--rowBorderColor)`
},
/* Row styles */
[`.${_gridClasses.gridClasses.row}`]: {
display: 'flex',
position: 'relative',
width: 'var(--DataGrid-rowWidth)',
breakInside: 'avoid',
// Avoid the row to be broken in two different print pages.
'--rowBorderColor': 'var(--DataGrid-rowBorderColor)',
[`&.${_gridClasses.gridClasses['row--firstVisible']}`]: {
'--rowBorderColor': 'transparent'
},
'&:hover': {
backgroundColor: hoverBackground,
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent'
}
},
[`&.${_gridClasses.gridClasses.rowSkeleton}:hover`]: {
backgroundColor: 'transparent'
},
'&.Mui-selected': selectedStyles
},
/* Cell styles */
[`& .${_gridClasses.gridClasses.cell}`]: {
flex: '0 0 auto',
height: 'var(--height)',
width: 'var(--width)',
lineHeight: 'calc(var(--height) - 1px)',
// -1px for the border
boxSizing: 'border-box',
borderTop: `1px solid var(--rowBorderColor)`,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
'&.Mui-selected': selectedStyles
},
/* Default range border styles using box-shadow to avoid layout shift */
[`& .${_gridClasses.gridClasses.cell}.Mui-selected`]: {
'--range-top': '0 0 0 0 transparent',
'--range-bottom': '0 0 0 0 transparent',
'--range-left': '0 0 0 0 transparent',
'--range-right': '0 0 0 0 transparent',
boxShadow: 'var(--range-top), var(--range-bottom), var(--range-left), var(--range-right)'
},
[`& .${_gridClasses.gridClasses['cell--rangeTop']}`]: {
'--range-top': `inset 0 2px 0 0 ${_cssVariables.vars.colors.interactive.focus}`
},
[`& .${_gridClasses.gridClasses['cell--rangeBottom']}`]: {
'--range-bottom': `inset 0 -2px 0 0 ${_cssVariables.vars.colors.interactive.focus}`
},
[`& .${_gridClasses.gridClasses['cell--rangeLeft']}`]: {
'--range-left': `inset 2px 0 0 0 ${_cssVariables.vars.colors.interactive.focus}`
},
[`& .${_gridClasses.gridClasses['cell--rangeRight']}`]: {
'--range-right': `inset -2px 0 0 0 ${_cssVariables.vars.colors.interactive.focus}`
},
[`& .${_gridClasses.gridClasses['virtualScrollerContent--overflowed']} .${_gridClasses.gridClasses['row--lastVisible']} .${_gridClasses.gridClasses.cell}`]: {
borderTopColor: 'transparent'
},
[`& .${_gridClasses.gridClasses.pinnedRows} .${_gridClasses.gridClasses.row}, .${_gridClasses.gridClasses.aggregationRowOverlayWrapper} .${_gridClasses.gridClasses.row}`]: {
backgroundColor: pinnedBackground,
'&:hover': {
backgroundColor: pinnedHoverBackground
}
},
[`& .${_gridClasses.gridClasses['pinnedRows--top']} :first-of-type`]: {
[`& .${_gridClasses.gridClasses.cell}, .${_gridClasses.gridClasses.scrollbarFiller}`]: {
borderTop: 'none'
}
},
[`&.${_gridClasses.gridClasses['root--disableUserSelection']}`]: {
userSelect: 'none'
},
[`& .${_gridClasses.gridClasses['row--dynamicHeight']} > .${_gridClasses.gridClasses.cell}`]: {
whiteSpace: 'initial',
lineHeight: 'inherit'
},
[`& .${_gridClasses.gridClasses['row--dynamicHeight']}`]: {
[`& .${_gridClasses.gridClasses.multiSelectCell}, .${_gridClasses.gridClasses.editMultiSelectCell}`]: {
flexWrap: 'wrap'
}
},
[`& .${_gridClasses.gridClasses.cell}[aria-rowspan]:not([aria-rowspan="1"])`]: {
[`& .${_gridClasses.gridClasses.multiSelectCell}`]: {
alignItems: 'flex-start',
alignContent: 'flex-start',
flexWrap: 'wrap',
paddingTop: 8
},
[`& .${_gridClasses.gridClasses['multiSelectCellChip--hidden']}`]: {
display: 'inline-flex'
},
[`& .${_gridClasses.gridClasses.multiSelectCellOverflow}`]: {
display: 'none'
}
},
[`& .${_gridClasses.gridClasses.cellEmpty}`]: {
flex: 1,
padding: 0,
height: 'unset'
},
[`& .${_gridClasses.gridClasses.cell}.${_gridClasses.gridClasses['cell--selectionMode']}`]: {
cursor: 'default'
},
[`& .${_gridClasses.gridClasses.cell}.${_gridClasses.gridClasses['cell--editing']}`]: {
padding: 1,
display: 'flex',
boxShadow: _cssVariables.vars.shadows.base,
backgroundColor: _cssVariables.vars.colors.background.overlay,
'&:focus-within': {
outline: `${focusOutlineWidth}px solid ${_cssVariables.vars.colors.interactive.focus}`,
outlineOffset: focusOutlineWidth * -1
}
},
[`& .${_gridClasses.gridClasses['cell--editing']}`]: {
'& .MuiInputBase-root': {
height: '100%'
}
},
[`& .${_gridClasses.gridClasses['row--editing']}`]: {
boxShadow: _cssVariables.vars.shadows.base
},
[`& .${_gridClasses.gridClasses['row--editing']} .${_gridClasses.gridClasses.cell}`]: {
boxShadow: 'none',
backgroundColor: _cssVariables.vars.colors.background.overlay
},
[`& .${_gridClasses.gridClasses.editBooleanCell}`]: {
display: 'flex',
height: '100%',
width: '100%',
alignItems: 'center',
justifyContent: 'center'
},
[`& .${_gridClasses.gridClasses.booleanCell}[data-value="true"]`]: {
color: _cssVariables.vars.colors.foreground.muted
},
[`& .${_gridClasses.gridClasses.booleanCell}[data-value="false"]`]: {
color: _cssVariables.vars.colors.foreground.disabled
},
[`& .${_gridClasses.gridClasses.actionsCell}`]: {
display: 'inline-flex',
alignItems: 'center',
gridGap: _cssVariables.vars.spacing(1)
},
[`& .${_gridClasses.gridClasses.rowReorderCell}`]: {
display: 'inline-flex',
flex: 1,
alignItems: 'center',
justifyContent: 'center',
opacity: _cssVariables.vars.colors.interactive.disabledOpacity
},
[`& .${_gridClasses.gridClasses['rowReorderCell--draggable']}`]: {
cursor: 'grab',
opacity: 1
},
[`& .${_gridClasses.gridClasses.rowReorderCellContainer}`]: {
padding: 0,
display: 'flex',
alignItems: 'stretch'
},
[`.${_gridClasses.gridClasses.withBorderColor}`]: {
borderColor: _cssVariables.vars.colors.border.base
},
[`& .${_gridClasses.gridClasses['cell--withLeftBorder']}, & .${_gridClasses.gridClasses['columnHeader--withLeftBorder']}`]: {
borderLeftColor: 'var(--DataGrid-rowBorderColor)',
borderLeftWidth: '1px',
borderLeftStyle: 'solid'
},
[`& .${_gridClasses.gridClasses['cell--withRightBorder']}, & .${_gridClasses.gridClasses['columnHeader--withRightBorder']}`]: {
borderRightColor: 'var(--DataGrid-rowBorderColor)',
borderRightWidth: '1px',
borderRightStyle: 'solid'
},
[`& .${_gridClasses.gridClasses['cell--flex']}`]: {
display: 'flex',
alignItems: 'center',
lineHeight: 'inherit'
},
[`& .${_gridClasses.gridClasses['cell--textLeft']}`]: {
textAlign: 'left',
justifyContent: 'flex-start'
},
[`& .${_gridClasses.gridClasses['cell--textRight']}`]: {
textAlign: 'right',
justifyContent: 'flex-end'
},
[`& .${_gridClasses.gridClasses['cell--textCenter']}`]: {
textAlign: 'center',
justifyContent: 'center'
},
[`& .${_gridClasses.gridClasses['cell--pinnedLeft']}, & .${_gridClasses.gridClasses['cell--pinnedRight']}`]: {
position: 'sticky',
zIndex: 30,
background: _cssVariables.vars.cell.background.pinned,
'&.Mui-selected': {
backgroundColor: pinnedSelectedBackground
}
},
[`& .${_gridClasses.gridClasses.row}`]: {
'&:hover': pinnedHoverStyles,
'&.Mui-selected': pinnedSelectedStyles,
'&.Mui-selected:hover': pinnedSelectedHoverStyles
},
[`& .${_gridClasses.gridClasses.cellOffsetLeft}`]: {
flex: '0 0 auto',
display: 'inline-block'
},
[`& .${_gridClasses.gridClasses.cellSkeleton}`]: {
flex: '0 0 auto',
height: '100%',
display: 'inline-flex',
alignItems: 'center'
},
[`& .${_gridClasses.gridClasses.columnHeaderDraggableContainer}`]: {
display: 'flex',
width: '100%',
height: '100%'
},
[`& .${_gridClasses.gridClasses.rowReorderCellPlaceholder}`]: {
display: 'none'
},
[`& .${_gridClasses.gridClasses['columnHeader--dragging']}`]: {
background: _cssVariables.vars.colors.background.overlay,
padding: '0 12px',
borderRadius: 'var(--unstable_DataGrid-radius)',
opacity: _cssVariables.vars.colors.interactive.disabledOpacity
},
[`& .${_gridClasses.gridClasses['row--dragging']}`]: {
background: _cssVariables.vars.colors.background.overlay,
padding: '0 12px',
borderRadius: 'var(--unstable_DataGrid-radius)',
border: '1px solid var(--DataGrid-rowBorderColor)',
color: _cssVariables.vars.colors.foreground.base,
transform: 'translateZ(0)',
[`& .${_gridClasses.gridClasses.rowReorderCellPlaceholder}`]: {
padding: '0 6px',
display: 'flex'
}
},
[`& .${_gridClasses.gridClasses.treeDataGroupingCell}`]: {
display: 'flex',
alignItems: 'center',
width: '100%'
},
[`& .${_gridClasses.gridClasses.treeDataGroupingCellToggle}`]: {
flex: '0 0 28px',
alignSelf: 'stretch',
marginRight: _cssVariables.vars.spacing(2)
},
[`& .${_gridClasses.gridClasses.treeDataGroupingCellLoadingContainer}, .${_gridClasses.gridClasses.groupingCriteriaCellLoadingContainer}`]: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: '100%'
},
[`& .${_gridClasses.gridClasses.groupingCriteriaCell}`]: {
display: 'flex',
alignItems: 'center',
width: '100%'
},
[`& .${_gridClasses.gridClasses.groupingCriteriaCellToggle}`]: {
flex: '0 0 28px',
alignSelf: 'stretch',
marginRight: _cssVariables.vars.spacing(2)
},
/* ScrollbarFiller styles */
[`& .${_gridClasses.gridClasses.columnHeaders} .${_gridClasses.gridClasses.scrollbarFiller}`]: {
backgroundColor: headerBackground
},
[`.${_gridClasses.gridClasses.scrollbarFiller}`]: {
minWidth: 'calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))',
alignSelf: 'stretch',
backgroundColor: headerBackground,
[`&.${_gridClasses.gridClasses['scrollbarFiller--pinnedRight']}`]: {
position: 'sticky',
zIndex: 40,
// Should be above the column separator
right: 0
}
},
[`& .${_gridClasses.gridClasses.filler}`]: {
flex: '1 0 auto'
},
[`& .${_gridClasses.gridClasses['filler--borderBottom']}`]: {
borderBottom: '1px solid var(--DataGrid-rowBorderColor)'
},
[`& .${_gridClasses.gridClasses['filler--horizontal']}`]: {
width: 'var(--DataGrid-horizontalFiller)'
},
[`& .${_gridClasses.gridClasses.columnHeaders} .${_gridClasses.gridClasses.filler}`]: {
backgroundColor: headerBackground
},
/* Used when skeleton/no columns overlay is visible */
[`& .${_gridClasses.gridClasses['main--hiddenContent']}`]: {
[`& .${_gridClasses.gridClasses.virtualScrollerRenderZone}`]: {
// We use visibility hidden so that the virtual scroller content retains its height.
// Position fixed is used to remove the virtual scroller content from the flow.
// https://github.com/mui/mui-x/issues/14061
visibility: 'hidden'
},
// Hide grid content
[`& .${_gridClasses.gridClasses.pinnedRows}`]: {
display: 'none'
}
},
/* Fill handle styles */
[`& .${_gridClasses.gridClasses['cell--withFillHandle']}`]: {
position: 'relative',
'&::after': {
content: '""',
position: 'absolute',
bottom: 0,
insetInlineEnd: 0,
width: 7,
height: 7,
backgroundColor: _cssVariables.vars.colors.interactive.focus,
cursor: 'crosshair',
zIndex: 50
}
},
[`& .${_gridClasses.gridClasses['cell--fillPreview']}`]: {
backgroundColor: `color-mix(in srgb, ${_cssVariables.vars.colors.interactive.focus} 8%, transparent)`
},
[`& .${_gridClasses.gridClasses['cell--fillPreviewTop']}`]: {
borderTop: `1px dashed ${_cssVariables.vars.colors.interactive.focus}`
},
[`& .${_gridClasses.gridClasses['cell--fillPreviewBottom']}`]: {
borderBottom: `1px dashed ${_cssVariables.vars.colors.interactive.focus}`
},
[`& .${_gridClasses.gridClasses['cell--fillPreviewLeft']}`]: {
borderLeft: `1px dashed ${_cssVariables.vars.colors.interactive.focus}`
},
[`& .${_gridClasses.gridClasses['cell--fillPreviewRight']}`]: {
borderRight: `1px dashed ${_cssVariables.vars.colors.interactive.focus}`
},
[`& .${_gridClasses.gridClasses['row--beingDragged']}`]: {
color: _cssVariables.vars.colors.foreground.disabled,
'&:hover': {
backgroundColor: 'transparent'
}
},
/* Controlled layout overrides (absolute positioning for pinned elements) */
[`& .${_gridClasses.gridClasses['virtualizer--layoutControlled']} .${_gridClasses.gridClasses['columnHeader--pinnedLeft']},
& .${_gridClasses.gridClasses['virtualizer--layoutControlled']} .${_gridClasses.gridClasses['columnHeader--pinnedRight']}`]: {
position: 'absolute',
height: 'var(--height)'
},
[`& .${_gridClasses.gridClasses['virtualizer--layoutControlled']} .${_gridClasses.gridClasses['cell--pinnedLeft']},
& .${_gridClasses.gridClasses['virtualizer--layoutControlled']} .${_gridClasses.gridClasses['cell--pinnedRight']}`]: {
position: 'absolute'
},
[`& .${_gridClasses.gridClasses['virtualizer--layoutControlled']} .${_gridClasses.gridClasses.row}`]: {
position: 'static'
},
[`& .${_gridClasses.gridClasses['virtualizer--layoutControlled']} .${_gridClasses.gridClasses['scrollbarFiller--pinnedRight']}`]: {
position: 'absolute',
height: 'var(--height)'
},
[`& .${_gridClasses.gridClasses['virtualizer--layoutControlled']} .${_gridClasses.gridClasses.virtualScrollerRenderZone}`]: {
position: 'static',
width: 'fit-content'
},
[`& .${_gridClasses.gridClasses['virtualizer--layoutControlled']} .${_gridClasses.gridClasses['container--top']}`]: {
width: 'fit-content'
},
[`& .${_gridClasses.gridClasses['virtualizer--layoutControlled']} .${_gridClasses.gridClasses['container--bottom']}`]: {
width: 'fit-content'
}
};
return gridStyle;
});
function setOpacity(color, opacity) {
return `rgba(from ${color} r g b / ${opacity})`;
}
function removeOpacity(color) {
return setOpacity(color, 1);
}
const supportsColorMix = exports.supportsColorMix = typeof CSS !== 'undefined' && typeof CSS.supports === 'function' && CSS.supports('color', 'color-mix(in srgb, red 50%, blue 50%)');
const colorMixIfSupported = (colorMixValue, fallback) => {
if (!supportsColorMix) {
return fallback;
}
return colorMixValue;
};
exports.colorMixIfSupported = colorMixIfSupported;
function mix(background, overlay, opacity, fallback) {
return colorMixIfSupported(`color-mix(in srgb,${background}, ${overlay} calc(${opacity} * 100%))`, fallback);
}
@@ -0,0 +1,840 @@
import { styled, css } from '@mui/material/styles';
import { gridClasses as c, gridClassesOverrides } from "../../constants/gridClasses.mjs";
import { vars } from "../../constants/cssVariables.mjs";
import { useGridSelector } from "../../hooks/utils/useGridSelector.mjs";
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.mjs";
const columnSeparatorTargetSize = 10;
const columnSeparatorOffset = -5;
const focusOutlineWidth = 1;
const separatorIconDragStyles = {
width: 3,
rx: 1.5,
x: 10.5
};
// Emotion thinks it knows better than us which selector we should use.
// https://github.com/emotion-js/emotion/issues/1105#issuecomment-1722524968
const ignoreSsrWarning = '/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */';
const shouldShowBorderTopRightRadiusSelector = apiRef => !apiRef.current.state.dimensions.isReady ? apiRef.current.state.dimensions.scrollbarSize === 0 : apiRef.current.state.dimensions.hasScrollX && (!apiRef.current.state.dimensions.hasScrollY || apiRef.current.state.dimensions.scrollbarSize === 0);
export const GridRootStyles = styled('div', {
name: 'MuiDataGrid',
slot: 'Root',
overridesResolver: (props, styles) => {
// Root overrides
const overrides = [styles.root];
gridClassesOverrides.root.forEach(key => {
if (styles[key] !== undefined) {
overrides.push({
[`&.${c[key]}`]: styles[key]
});
}
});
// Child element overrides
// - Only declare overrides here for class names that are not applied to `styled` components.
// - For `styled` components, declare overrides in the component itself.
gridClassesOverrides.children.forEach(key => {
if (styles[key] !== undefined) {
overrides.push({
[`& .${c[key]}`]: styles[key]
});
}
});
return overrides;
}
})(() => {
const apiRef = useGridPrivateApiContext();
const shouldShowBorderTopRightRadius = useGridSelector(apiRef, shouldShowBorderTopRightRadiusSelector);
const baseBackground = vars.colors.background.base;
const headerBackground = vars.header.background.base;
const pinnedBackground = vars.cell.background.pinned;
const hoverColor = removeOpacity(vars.colors.interactive.hover);
const hoverOpacity = vars.colors.interactive.hoverOpacity;
const selectedColor = vars.colors.interactive.selected;
const selectedOpacity = vars.colors.interactive.selectedOpacity;
const selectedHoverColor = selectedColor;
const selectedHoverOpacity = `calc(${selectedOpacity} + ${hoverOpacity})`;
const fallbackColors = {
hover: vars.colors.interactive.hover,
selected: selectedColor,
selectedHover: selectedColor
};
const hoverBackground = mix(baseBackground, hoverColor, hoverOpacity, fallbackColors.hover);
const selectedBackground = mix(baseBackground, selectedColor, selectedOpacity, fallbackColors.selected);
const selectedHoverBackground = mix(baseBackground, selectedHoverColor, selectedHoverOpacity, fallbackColors.selectedHover);
const pinnedHoverBackground = mix(pinnedBackground, hoverColor, hoverOpacity, fallbackColors.hover);
const pinnedSelectedBackground = mix(pinnedBackground, selectedColor, selectedOpacity, fallbackColors.selected);
const pinnedSelectedHoverBackground = mix(pinnedBackground, selectedHoverColor, selectedHoverOpacity, fallbackColors.selectedHover);
const getPinnedBackgroundStyles = backgroundColor => ({
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
backgroundColor,
'&.Mui-selected': {
backgroundColor: mix(backgroundColor, selectedBackground, selectedOpacity, fallbackColors.selected),
'&:hover': {
backgroundColor: mix(backgroundColor, selectedHoverBackground, selectedHoverOpacity, fallbackColors.selectedHover)
}
}
}
});
const pinnedHoverStyles = getPinnedBackgroundStyles(pinnedHoverBackground);
const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackground);
const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackground);
const selectedStyles = {
backgroundColor: selectedBackground,
'&:hover': {
backgroundColor: selectedHoverBackground,
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: selectedBackground
}
}
};
const gridStyle = {
'--unstable_DataGrid-radius': vars.radius.base,
'--unstable_DataGrid-headWeight': vars.typography.fontWeight.medium,
'--DataGrid-rowBorderColor': vars.colors.border.base,
'--DataGrid-cellOffsetMultiplier': 2,
'--DataGrid-width': '0px',
'--DataGrid-hasScrollX': '0',
'--DataGrid-hasScrollY': '0',
'--DataGrid-scrollbarSize': '10px',
'--DataGrid-rowWidth': '0px',
'--DataGrid-columnsTotalWidth': '0px',
'--DataGrid-leftPinnedWidth': '0px',
'--DataGrid-rightPinnedWidth': '0px',
'--DataGrid-headerHeight': '0px',
'--DataGrid-headersTotalHeight': '0px',
'--DataGrid-topContainerHeight': '0px',
'--DataGrid-bottomContainerHeight': '0px',
'--DataGrid-horizontalFiller': '0px',
flex: 1,
boxSizing: 'border-box',
position: 'relative',
borderWidth: '1px',
borderStyle: 'solid',
borderColor: vars.colors.border.base,
borderRadius: 'var(--unstable_DataGrid-radius)',
backgroundColor: vars.colors.background.base,
color: vars.colors.foreground.base,
font: vars.typography.font.body,
outline: 'none',
height: '100%',
display: 'flex',
minWidth: 0,
// See https://github.com/mui/mui-x/issues/8547
minHeight: 0,
flexDirection: 'column',
overflow: 'hidden',
transform: 'translate(0, 0)',
// Create a stacking context to keep scrollbars from showing on top
[`& .${c.virtualScroller}`]: {
overflowAnchor: 'none' // Keep the same scrolling position
},
// Use `css` tagged template so the ignore-comment remains a sibling of the
// `:first-child` rule in the stylis AST. Previously, the comment was embedded
// in the object-key selector, which got separated from the rule during
// pre-serialization when `styleOverrides` were applied, re-triggering Emotion's
// unsafe-selector SSR warning. https://github.com/emotion-js/emotion/issues/1105
[`.${c.main}`]: css`
& > *:first-child ${ignoreSsrWarning} {
border-top-left-radius: var(--unstable_DataGrid-radius);
border-top-right-radius: var(--unstable_DataGrid-radius);
}
`,
[`&.${c.autoHeight}`]: {
height: 'auto'
},
[`&.${c.autosizing}`]: {
[`& .${c.columnHeaderTitleContainerContent} > *`]: {
overflow: 'visible !important'
},
'@media (hover: hover)': {
[`& .${c.menuIcon}`]: {
width: '0 !important',
visibility: 'hidden !important'
}
},
[`& .${c.cell}`]: {
overflow: 'visible !important',
whiteSpace: 'nowrap',
minWidth: 'max-content !important',
maxWidth: 'max-content !important'
},
[`& .${c.groupingCriteriaCell}`]: {
width: 'unset'
},
[`& .${c.treeDataGroupingCell}`]: {
width: 'unset'
},
[`& .${c['columnHeader--filter']}`]: {
flex: 'none !important',
width: 'unset !important'
},
[`& .${c.multiSelectCell}`]: {
width: 'max-content',
overflow: 'visible'
},
[`& .${c['multiSelectCellChip--hidden']}`]: {
display: 'inline-flex'
},
[`& .${c.multiSelectCellOverflow}`]: {
display: 'none'
}
},
[`&.${c.withSidePanel}`]: {
flexDirection: 'row'
},
[`& .${c.mainContent}`]: {
display: 'flex',
flexDirection: 'column',
overflow: 'hidden',
flex: 1
},
[`& .${c.columnHeader}, & .${c.cell}`]: {
WebkitTapHighlightColor: 'transparent',
padding: '0 10px',
boxSizing: 'border-box'
},
[`& .${c.columnHeader}:focus-within, & .${c.cell}:focus-within`]: {
outline: `solid ${setOpacity(vars.colors.interactive.focus, 0.5)} ${focusOutlineWidth}px`,
outlineOffset: focusOutlineWidth * -1
},
[`& .${c.columnHeader}:focus, & .${c.cell}:focus`]: {
outline: `solid ${vars.colors.interactive.focus} ${focusOutlineWidth}px`,
outlineOffset: focusOutlineWidth * -1
},
// Hide the column separator when:
// - the column is focused and has an outline
// - the next column is focused and has an outline
// - the column has a left or right border
// - the next column is pinned right and has a left border
[`& .${c.columnHeader}:focus,
& .${c['columnHeader--withLeftBorder']},
& .${c['columnHeader--withRightBorder']},
& .${c['columnHeader--siblingFocused']}
`]: {
[`& .${c.columnSeparator}`]: {
opacity: 0
},
// Show resizable separators at all times on touch devices
'@media (hover: none)': {
[`& .${c['columnSeparator--resizable']}`]: {
opacity: 1
}
},
[`& .${c['columnSeparator--resizable']}:hover`]: {
opacity: 1
}
},
[`&.${c['root--noToolbar']} [aria-rowindex="1"] [aria-colindex="1"]`]: {
borderTopLeftRadius: 'calc(var(--unstable_DataGrid-radius) - 1px)'
},
[`&.${c['root--noToolbar']} [aria-rowindex="1"] .${c['columnHeader--last']}`]: {
borderTopRightRadius: shouldShowBorderTopRightRadius ? 'calc(var(--unstable_DataGrid-radius) - 1px)' : undefined
},
[`& .${c.columnHeaderCheckbox}, & .${c.cellCheckbox}`]: {
padding: 0,
justifyContent: 'center',
alignItems: 'center'
},
[`& .${c.columnHeader}`]: {
position: 'relative',
display: 'flex',
alignItems: 'center',
backgroundColor: headerBackground,
flex: '0 0 auto'
},
[`& .${c.columnHeader} .${c.sortButton}`]: {
backgroundColor: vars.header.background.base
},
[`& .${c['columnHeader--filter']}`]: {
paddingTop: 8,
paddingBottom: 8,
paddingRight: 5,
minHeight: 'min-content',
overflow: 'hidden'
},
[`&.${c['root--densityCompact']} .${c['columnHeader--filter']}`]: {
paddingTop: 4,
paddingBottom: 4
},
[`& .${c['virtualScroller--hasScrollX']} .${c['columnHeader--last']}`]: {
overflow: 'hidden'
},
[`& .${c['pivotPanelField--sorted']} .${c.iconButtonContainer},
& .${c['columnHeader--sorted']} .${c.iconButtonContainer},
& .${c['columnHeader--filtered']} .${c.iconButtonContainer}`]: {
visibility: 'visible',
width: 'auto'
},
[`& .${c.pivotPanelField}:not(.${c['pivotPanelField--sorted']}) .${c.sortButton},
& .${c.columnHeader}:not(.${c['columnHeader--sorted']}) .${c.sortButton}`]: {
opacity: 0,
transition: vars.transition(['opacity'], {
duration: vars.transitions.duration.short
})
},
[`& .${c.columnHeaderTitleContainer}`]: {
display: 'flex',
alignItems: 'center',
gap: vars.spacing(0.25),
minWidth: 0,
flex: 1,
whiteSpace: 'nowrap',
overflow: 'hidden'
},
[`& .${c.columnHeaderTitleContainerContent}`]: {
overflow: 'hidden',
display: 'flex',
alignItems: 'center'
},
[`& .${c['columnHeader--filledGroup']} .${c.columnHeaderTitleContainer}`]: {
borderBottomWidth: '1px',
borderBottomStyle: 'solid',
boxSizing: 'border-box'
},
[`& .${c.sortIcon}, & .${c.filterIcon}`]: {
fontSize: 'inherit'
},
[`& .${c['columnHeader--sortable']}`]: {
cursor: 'pointer'
},
[`& .${c['columnHeader--alignCenter']} .${c.columnHeaderTitleContainer}`]: {
justifyContent: 'center'
},
[`& .${c['columnHeader--alignRight']} .${c.columnHeaderDraggableContainer}, & .${c['columnHeader--alignRight']} .${c.columnHeaderTitleContainer}`]: {
flexDirection: 'row-reverse'
},
[`& .${c['columnHeader--alignCenter']} .${c.menuIcon}`]: {
marginLeft: 'auto'
},
[`& .${c['columnHeader--alignRight']} .${c.menuIcon}`]: {
marginRight: 'auto',
marginLeft: -5
},
[`& .${c['columnHeader--moving']}`]: {
backgroundColor: hoverBackground
},
[`& .${c['columnHeader--pinnedLeft']}, & .${c['columnHeader--pinnedRight']}`]: {
position: 'sticky',
zIndex: 40,
// Should be above the column separator
background: vars.header.background.base
},
[`& .${c.columnSeparator}`]: {
position: 'absolute',
overflow: 'hidden',
zIndex: 30,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
maxWidth: columnSeparatorTargetSize,
color: vars.colors.border.base
},
[`& .${c.columnHeaders}`]: {
width: 'var(--DataGrid-rowWidth)',
backgroundColor: headerBackground
},
'@media (hover: hover)': {
[`& .${c.columnHeader}:hover`]: {
[`& .${c.menuIcon}`]: {
width: 'auto',
visibility: 'visible'
},
[`& .${c.iconButtonContainer}`]: {
visibility: 'visible',
width: 'auto'
}
},
[`& .${c.columnHeader}:not(.${c['columnHeader--sorted']}):hover .${c.sortButton},
& .${c.pivotPanelField}:not(.${c['pivotPanelField--sorted']}):hover .${c.sortButton},
& .${c.pivotPanelField}:not(.${c['pivotPanelField--sorted']}) .${c.sortButton}:focus-visible`]: {
opacity: 1
},
// Add opacity only to the button content to avoid affecting the background color
[`& .${c.columnHeader}:not(.${c['columnHeader--sorted']}):hover .${c.sortButton} > *,
& .${c.pivotPanelField}:not(.${c['pivotPanelField--sorted']}):hover .${c.sortButton} > *,
& .${c.pivotPanelField}:not(.${c['pivotPanelField--sorted']}) .${c.sortButton}:focus-visible > *`]: {
opacity: 0.78
},
[`& .${c.pivotPanelFieldActionContainer} button:hover`]: {
backgroundColor: vars.colors.background.base
}
},
'@media (hover: none)': {
[`& .${c.columnHeader} .${c.menuIcon}`]: {
width: 'auto',
visibility: 'visible'
},
[`& .${c.columnHeader}:focus,
& .${c['columnHeader--siblingFocused']}`]: {
[`.${c['columnSeparator--resizable']}`]: {
color: vars.colors.foreground.accent
}
},
[`& .${c.pivotPanelField}:not(.${c['pivotPanelField--sorted']}) .${c.sortButton}`]: {
opacity: 0.78
}
},
// Hide the column separator when the column has border and it is not resizable
// In this case, this column separator may block interaction with the separator from the adjacent column that is resizable
[`& .${c['columnHeader--withLeftBorder']} .${c['columnSeparator--sideLeft']}:not(.${c['columnSeparator--resizable']}), & .${c['columnHeader--withRightBorder']} .${c['columnSeparator--sideRight']}:not(.${c['columnSeparator--resizable']})`]: {
display: 'none'
},
[`& .${c['columnSeparator--sideLeft']}`]: {
left: columnSeparatorOffset
},
[`& .${c['columnSeparator--sideRight']}`]: {
right: columnSeparatorOffset
},
[`& .${c['columnHeader--withRightBorder']} .${c['columnSeparator--sideLeft']}`]: {
left: columnSeparatorOffset - 0.5
},
[`& .${c['columnHeader--withRightBorder']} .${c['columnSeparator--sideRight']}`]: {
right: columnSeparatorOffset - 0.5
},
[`& .${c['columnSeparator--resizable']}`]: {
cursor: 'col-resize',
touchAction: 'none',
[`&.${c['columnSeparator--resizing']}`]: {
color: vars.colors.foreground.accent
},
// Always appear as draggable on touch devices
'@media (hover: none)': {
[`& .${c.iconSeparator} rect`]: separatorIconDragStyles
},
'@media (hover: hover)': {
'&:hover': {
color: vars.colors.foreground.accent,
[`& .${c.iconSeparator} rect`]: separatorIconDragStyles
}
},
'& svg': {
pointerEvents: 'none'
}
},
[`& .${c.iconSeparator}`]: {
color: 'inherit',
transition: vars.transition(['color', 'width'], {
duration: vars.transitions.duration.short
})
},
[`& .${c.menuIcon}`]: {
width: 0,
visibility: 'hidden',
fontSize: 20,
marginRight: -5,
display: 'flex',
alignItems: 'center'
},
[`.${c.menuOpen}`]: {
visibility: 'visible',
width: 'auto'
},
[`& .${c.headerFilterRow}`]: {
[`& .${c.columnHeader}, & .${c.scrollbarFiller}`]: {
boxSizing: 'border-box',
borderBottom: '1px solid var(--DataGrid-rowBorderColor)'
}
},
/* Bottom border of the top-container */
[`& .${c['row--borderBottom']} .${c.columnHeader},
& .${c['row--borderBottom']} .${c.filler},
& .${c['row--borderBottom']} .${c.scrollbarFiller}`]: {
borderBottom: `1px solid var(--DataGrid-rowBorderColor)`
},
[`& .${c['row--borderBottom']} .${c.cell}`]: {
borderBottom: `1px solid var(--rowBorderColor)`
},
/* Row styles */
[`.${c.row}`]: {
display: 'flex',
position: 'relative',
width: 'var(--DataGrid-rowWidth)',
breakInside: 'avoid',
// Avoid the row to be broken in two different print pages.
'--rowBorderColor': 'var(--DataGrid-rowBorderColor)',
[`&.${c['row--firstVisible']}`]: {
'--rowBorderColor': 'transparent'
},
'&:hover': {
backgroundColor: hoverBackground,
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent'
}
},
[`&.${c.rowSkeleton}:hover`]: {
backgroundColor: 'transparent'
},
'&.Mui-selected': selectedStyles
},
/* Cell styles */
[`& .${c.cell}`]: {
flex: '0 0 auto',
height: 'var(--height)',
width: 'var(--width)',
lineHeight: 'calc(var(--height) - 1px)',
// -1px for the border
boxSizing: 'border-box',
borderTop: `1px solid var(--rowBorderColor)`,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
'&.Mui-selected': selectedStyles
},
/* Default range border styles using box-shadow to avoid layout shift */
[`& .${c.cell}.Mui-selected`]: {
'--range-top': '0 0 0 0 transparent',
'--range-bottom': '0 0 0 0 transparent',
'--range-left': '0 0 0 0 transparent',
'--range-right': '0 0 0 0 transparent',
boxShadow: 'var(--range-top), var(--range-bottom), var(--range-left), var(--range-right)'
},
[`& .${c['cell--rangeTop']}`]: {
'--range-top': `inset 0 2px 0 0 ${vars.colors.interactive.focus}`
},
[`& .${c['cell--rangeBottom']}`]: {
'--range-bottom': `inset 0 -2px 0 0 ${vars.colors.interactive.focus}`
},
[`& .${c['cell--rangeLeft']}`]: {
'--range-left': `inset 2px 0 0 0 ${vars.colors.interactive.focus}`
},
[`& .${c['cell--rangeRight']}`]: {
'--range-right': `inset -2px 0 0 0 ${vars.colors.interactive.focus}`
},
[`& .${c['virtualScrollerContent--overflowed']} .${c['row--lastVisible']} .${c.cell}`]: {
borderTopColor: 'transparent'
},
[`& .${c.pinnedRows} .${c.row}, .${c.aggregationRowOverlayWrapper} .${c.row}`]: {
backgroundColor: pinnedBackground,
'&:hover': {
backgroundColor: pinnedHoverBackground
}
},
[`& .${c['pinnedRows--top']} :first-of-type`]: {
[`& .${c.cell}, .${c.scrollbarFiller}`]: {
borderTop: 'none'
}
},
[`&.${c['root--disableUserSelection']}`]: {
userSelect: 'none'
},
[`& .${c['row--dynamicHeight']} > .${c.cell}`]: {
whiteSpace: 'initial',
lineHeight: 'inherit'
},
[`& .${c['row--dynamicHeight']}`]: {
[`& .${c.multiSelectCell}, .${c.editMultiSelectCell}`]: {
flexWrap: 'wrap'
}
},
[`& .${c.cell}[aria-rowspan]:not([aria-rowspan="1"])`]: {
[`& .${c.multiSelectCell}`]: {
alignItems: 'flex-start',
alignContent: 'flex-start',
flexWrap: 'wrap',
paddingTop: 8
},
[`& .${c['multiSelectCellChip--hidden']}`]: {
display: 'inline-flex'
},
[`& .${c.multiSelectCellOverflow}`]: {
display: 'none'
}
},
[`& .${c.cellEmpty}`]: {
flex: 1,
padding: 0,
height: 'unset'
},
[`& .${c.cell}.${c['cell--selectionMode']}`]: {
cursor: 'default'
},
[`& .${c.cell}.${c['cell--editing']}`]: {
padding: 1,
display: 'flex',
boxShadow: vars.shadows.base,
backgroundColor: vars.colors.background.overlay,
'&:focus-within': {
outline: `${focusOutlineWidth}px solid ${vars.colors.interactive.focus}`,
outlineOffset: focusOutlineWidth * -1
}
},
[`& .${c['cell--editing']}`]: {
'& .MuiInputBase-root': {
height: '100%'
}
},
[`& .${c['row--editing']}`]: {
boxShadow: vars.shadows.base
},
[`& .${c['row--editing']} .${c.cell}`]: {
boxShadow: 'none',
backgroundColor: vars.colors.background.overlay
},
[`& .${c.editBooleanCell}`]: {
display: 'flex',
height: '100%',
width: '100%',
alignItems: 'center',
justifyContent: 'center'
},
[`& .${c.booleanCell}[data-value="true"]`]: {
color: vars.colors.foreground.muted
},
[`& .${c.booleanCell}[data-value="false"]`]: {
color: vars.colors.foreground.disabled
},
[`& .${c.actionsCell}`]: {
display: 'inline-flex',
alignItems: 'center',
gridGap: vars.spacing(1)
},
[`& .${c.rowReorderCell}`]: {
display: 'inline-flex',
flex: 1,
alignItems: 'center',
justifyContent: 'center',
opacity: vars.colors.interactive.disabledOpacity
},
[`& .${c['rowReorderCell--draggable']}`]: {
cursor: 'grab',
opacity: 1
},
[`& .${c.rowReorderCellContainer}`]: {
padding: 0,
display: 'flex',
alignItems: 'stretch'
},
[`.${c.withBorderColor}`]: {
borderColor: vars.colors.border.base
},
[`& .${c['cell--withLeftBorder']}, & .${c['columnHeader--withLeftBorder']}`]: {
borderLeftColor: 'var(--DataGrid-rowBorderColor)',
borderLeftWidth: '1px',
borderLeftStyle: 'solid'
},
[`& .${c['cell--withRightBorder']}, & .${c['columnHeader--withRightBorder']}`]: {
borderRightColor: 'var(--DataGrid-rowBorderColor)',
borderRightWidth: '1px',
borderRightStyle: 'solid'
},
[`& .${c['cell--flex']}`]: {
display: 'flex',
alignItems: 'center',
lineHeight: 'inherit'
},
[`& .${c['cell--textLeft']}`]: {
textAlign: 'left',
justifyContent: 'flex-start'
},
[`& .${c['cell--textRight']}`]: {
textAlign: 'right',
justifyContent: 'flex-end'
},
[`& .${c['cell--textCenter']}`]: {
textAlign: 'center',
justifyContent: 'center'
},
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
position: 'sticky',
zIndex: 30,
background: vars.cell.background.pinned,
'&.Mui-selected': {
backgroundColor: pinnedSelectedBackground
}
},
[`& .${c.row}`]: {
'&:hover': pinnedHoverStyles,
'&.Mui-selected': pinnedSelectedStyles,
'&.Mui-selected:hover': pinnedSelectedHoverStyles
},
[`& .${c.cellOffsetLeft}`]: {
flex: '0 0 auto',
display: 'inline-block'
},
[`& .${c.cellSkeleton}`]: {
flex: '0 0 auto',
height: '100%',
display: 'inline-flex',
alignItems: 'center'
},
[`& .${c.columnHeaderDraggableContainer}`]: {
display: 'flex',
width: '100%',
height: '100%'
},
[`& .${c.rowReorderCellPlaceholder}`]: {
display: 'none'
},
[`& .${c['columnHeader--dragging']}`]: {
background: vars.colors.background.overlay,
padding: '0 12px',
borderRadius: 'var(--unstable_DataGrid-radius)',
opacity: vars.colors.interactive.disabledOpacity
},
[`& .${c['row--dragging']}`]: {
background: vars.colors.background.overlay,
padding: '0 12px',
borderRadius: 'var(--unstable_DataGrid-radius)',
border: '1px solid var(--DataGrid-rowBorderColor)',
color: vars.colors.foreground.base,
transform: 'translateZ(0)',
[`& .${c.rowReorderCellPlaceholder}`]: {
padding: '0 6px',
display: 'flex'
}
},
[`& .${c.treeDataGroupingCell}`]: {
display: 'flex',
alignItems: 'center',
width: '100%'
},
[`& .${c.treeDataGroupingCellToggle}`]: {
flex: '0 0 28px',
alignSelf: 'stretch',
marginRight: vars.spacing(2)
},
[`& .${c.treeDataGroupingCellLoadingContainer}, .${c.groupingCriteriaCellLoadingContainer}`]: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: '100%'
},
[`& .${c.groupingCriteriaCell}`]: {
display: 'flex',
alignItems: 'center',
width: '100%'
},
[`& .${c.groupingCriteriaCellToggle}`]: {
flex: '0 0 28px',
alignSelf: 'stretch',
marginRight: vars.spacing(2)
},
/* ScrollbarFiller styles */
[`& .${c.columnHeaders} .${c.scrollbarFiller}`]: {
backgroundColor: headerBackground
},
[`.${c.scrollbarFiller}`]: {
minWidth: 'calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))',
alignSelf: 'stretch',
backgroundColor: headerBackground,
[`&.${c['scrollbarFiller--pinnedRight']}`]: {
position: 'sticky',
zIndex: 40,
// Should be above the column separator
right: 0
}
},
[`& .${c.filler}`]: {
flex: '1 0 auto'
},
[`& .${c['filler--borderBottom']}`]: {
borderBottom: '1px solid var(--DataGrid-rowBorderColor)'
},
[`& .${c['filler--horizontal']}`]: {
width: 'var(--DataGrid-horizontalFiller)'
},
[`& .${c.columnHeaders} .${c.filler}`]: {
backgroundColor: headerBackground
},
/* Used when skeleton/no columns overlay is visible */
[`& .${c['main--hiddenContent']}`]: {
[`& .${c.virtualScrollerRenderZone}`]: {
// We use visibility hidden so that the virtual scroller content retains its height.
// Position fixed is used to remove the virtual scroller content from the flow.
// https://github.com/mui/mui-x/issues/14061
visibility: 'hidden'
},
// Hide grid content
[`& .${c.pinnedRows}`]: {
display: 'none'
}
},
/* Fill handle styles */
[`& .${c['cell--withFillHandle']}`]: {
position: 'relative',
'&::after': {
content: '""',
position: 'absolute',
bottom: 0,
insetInlineEnd: 0,
width: 7,
height: 7,
backgroundColor: vars.colors.interactive.focus,
cursor: 'crosshair',
zIndex: 50
}
},
[`& .${c['cell--fillPreview']}`]: {
backgroundColor: `color-mix(in srgb, ${vars.colors.interactive.focus} 8%, transparent)`
},
[`& .${c['cell--fillPreviewTop']}`]: {
borderTop: `1px dashed ${vars.colors.interactive.focus}`
},
[`& .${c['cell--fillPreviewBottom']}`]: {
borderBottom: `1px dashed ${vars.colors.interactive.focus}`
},
[`& .${c['cell--fillPreviewLeft']}`]: {
borderLeft: `1px dashed ${vars.colors.interactive.focus}`
},
[`& .${c['cell--fillPreviewRight']}`]: {
borderRight: `1px dashed ${vars.colors.interactive.focus}`
},
[`& .${c['row--beingDragged']}`]: {
color: vars.colors.foreground.disabled,
'&:hover': {
backgroundColor: 'transparent'
}
},
/* Controlled layout overrides (absolute positioning for pinned elements) */
[`& .${c['virtualizer--layoutControlled']} .${c['columnHeader--pinnedLeft']},
& .${c['virtualizer--layoutControlled']} .${c['columnHeader--pinnedRight']}`]: {
position: 'absolute',
height: 'var(--height)'
},
[`& .${c['virtualizer--layoutControlled']} .${c['cell--pinnedLeft']},
& .${c['virtualizer--layoutControlled']} .${c['cell--pinnedRight']}`]: {
position: 'absolute'
},
[`& .${c['virtualizer--layoutControlled']} .${c.row}`]: {
position: 'static'
},
[`& .${c['virtualizer--layoutControlled']} .${c['scrollbarFiller--pinnedRight']}`]: {
position: 'absolute',
height: 'var(--height)'
},
[`& .${c['virtualizer--layoutControlled']} .${c.virtualScrollerRenderZone}`]: {
position: 'static',
width: 'fit-content'
},
[`& .${c['virtualizer--layoutControlled']} .${c['container--top']}`]: {
width: 'fit-content'
},
[`& .${c['virtualizer--layoutControlled']} .${c['container--bottom']}`]: {
width: 'fit-content'
}
};
return gridStyle;
});
function setOpacity(color, opacity) {
return `rgba(from ${color} r g b / ${opacity})`;
}
function removeOpacity(color) {
return setOpacity(color, 1);
}
export const supportsColorMix = typeof CSS !== 'undefined' && typeof CSS.supports === 'function' && CSS.supports('color', 'color-mix(in srgb, red 50%, blue 50%)');
export const colorMixIfSupported = (colorMixValue, fallback) => {
if (!supportsColorMix) {
return fallback;
}
return colorMixValue;
};
function mix(background, overlay, opacity, fallback) {
return colorMixIfSupported(`color-mix(in srgb,${background}, ${overlay} calc(${opacity} * 100%))`, fallback);
}
@@ -0,0 +1,12 @@
import * as React from 'react';
import type { SxProps, Theme } from '@mui/system';
export type GridToolbarContainerProps = React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
};
/**
* @deprecated Use the {@link https://mui.com/x/react-data-grid/components/toolbar/ Toolbar} component instead. This component will be removed in a future major release.
*/
declare const GridToolbarContainer: React.ForwardRefExoticComponent<GridToolbarContainerProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
} & React.RefAttributes<HTMLDivElement>>;
export { GridToolbarContainer };
@@ -0,0 +1,12 @@
import * as React from 'react';
import type { SxProps, Theme } from '@mui/system';
export type GridToolbarContainerProps = React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
};
/**
* @deprecated Use the {@link https://mui.com/x/react-data-grid/components/toolbar/ Toolbar} component instead. This component will be removed in a future major release.
*/
declare const GridToolbarContainer: React.ForwardRefExoticComponent<GridToolbarContainerProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
sx?: SxProps<Theme>;
} & React.RefAttributes<HTMLDivElement>>;
export { GridToolbarContainer };
@@ -0,0 +1,75 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridToolbarContainer = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _system = require("@mui/system");
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
var _forwardRef = require("@mui/x-internals/forwardRef");
var _cssVariables = require("../../constants/cssVariables");
var _gridClasses = require("../../constants/gridClasses");
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
var _toolbarV = require("../toolbarV8");
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["className", "children"];
const useUtilityClasses = ownerState => {
const {
classes
} = ownerState;
const slots = {
root: ['toolbarContainer']
};
return (0, _composeClasses.default)(slots, _gridClasses.getDataGridUtilityClass, classes);
};
const GridToolbarContainerRoot = (0, _system.styled)(_toolbarV.Toolbar, {
name: 'MuiDataGrid',
slot: 'ToolbarContainer',
shouldForwardProp: prop => prop !== 'ownerState'
})({
display: 'flex',
alignItems: 'center',
flexWrap: 'wrap',
gap: _cssVariables.vars.spacing(1),
padding: _cssVariables.vars.spacing(0.5),
minHeight: 'auto'
});
/**
* @deprecated Use the {@link https://mui.com/x/react-data-grid/components/toolbar/ Toolbar} component instead. This component will be removed in a future major release.
*/
const GridToolbarContainer = exports.GridToolbarContainer = (0, _forwardRef.forwardRef)(function GridToolbarContainer(props, ref) {
const {
className,
children
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const rootProps = (0, _useGridRootProps.useGridRootProps)();
const classes = useUtilityClasses(rootProps);
if (!children) {
return null;
}
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridToolbarContainerRoot, (0, _extends2.default)({
className: (0, _clsx.default)(classes.root, className),
ownerState: rootProps
}, other, {
ref: ref,
children: children
}));
});
if (process.env.NODE_ENV !== "production") GridToolbarContainer.displayName = "GridToolbarContainer";
process.env.NODE_ENV !== "production" ? GridToolbarContainer.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
} : void 0;
@@ -0,0 +1,69 @@
'use client';
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 PropTypes from 'prop-types';
import clsx from 'clsx';
import { styled } from '@mui/system';
import composeClasses from '@mui/utils/composeClasses';
import { forwardRef } from '@mui/x-internals/forwardRef';
import { vars } from "../../constants/cssVariables.mjs";
import { getDataGridUtilityClass } from "../../constants/gridClasses.mjs";
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.mjs";
import { Toolbar } from "../toolbarV8/index.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
const useUtilityClasses = ownerState => {
const {
classes
} = ownerState;
const slots = {
root: ['toolbarContainer']
};
return composeClasses(slots, getDataGridUtilityClass, classes);
};
const GridToolbarContainerRoot = styled(Toolbar, {
name: 'MuiDataGrid',
slot: 'ToolbarContainer',
shouldForwardProp: prop => prop !== 'ownerState'
})({
display: 'flex',
alignItems: 'center',
flexWrap: 'wrap',
gap: vars.spacing(1),
padding: vars.spacing(0.5),
minHeight: 'auto'
});
/**
* @deprecated Use the {@link https://mui.com/x/react-data-grid/components/toolbar/ Toolbar} component instead. This component will be removed in a future major release.
*/
const GridToolbarContainer = forwardRef(function GridToolbarContainer(props, ref) {
const {
className,
children
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const rootProps = useGridRootProps();
const classes = useUtilityClasses(rootProps);
if (!children) {
return null;
}
return /*#__PURE__*/_jsx(GridToolbarContainerRoot, _extends({
className: clsx(classes.root, className),
ownerState: rootProps
}, other, {
ref: ref,
children: children
}));
});
if (process.env.NODE_ENV !== "production") GridToolbarContainer.displayName = "GridToolbarContainer";
process.env.NODE_ENV !== "production" ? GridToolbarContainer.propTypes /* remove-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 { GridToolbarContainer };
@@ -0,0 +1,4 @@
export * from "./GridRoot.mjs";
export * from "./GridFooterContainer.mjs";
export * from "./GridOverlay.mjs";
export * from "./GridToolbarContainer.mjs";
@@ -0,0 +1,4 @@
export * from "./GridRoot.js";
export * from "./GridFooterContainer.js";
export * from "./GridOverlay.js";
export * from "./GridToolbarContainer.js";
+49
View File
@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _GridRoot = require("./GridRoot");
Object.keys(_GridRoot).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _GridRoot[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _GridRoot[key];
}
});
});
var _GridFooterContainer = require("./GridFooterContainer");
Object.keys(_GridFooterContainer).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _GridFooterContainer[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _GridFooterContainer[key];
}
});
});
var _GridOverlay = require("./GridOverlay");
Object.keys(_GridOverlay).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _GridOverlay[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _GridOverlay[key];
}
});
});
var _GridToolbarContainer = require("./GridToolbarContainer");
Object.keys(_GridToolbarContainer).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _GridToolbarContainer[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _GridToolbarContainer[key];
}
});
});
@@ -0,0 +1,4 @@
export * from "./GridRoot.mjs";
export * from "./GridFooterContainer.mjs";
export * from "./GridOverlay.mjs";
export * from "./GridToolbarContainer.mjs";