@mui/x-data-grid 8.0.0-alpha.12 → 8.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +299 -0
- package/DataGrid/DataGrid.js +31 -22
- package/DataGrid/useDataGridProps.js +1 -1
- package/colDef/gridCheckboxSelectionColDef.js +1 -3
- package/components/GridFooter.js +1 -1
- package/components/GridHeader.js +1 -1
- package/components/GridPagination.js +5 -6
- package/components/GridRowCount.js +4 -5
- package/components/GridScrollArea.js +4 -3
- package/components/GridSelectedRowCount.js +5 -6
- package/components/GridShadowScrollArea.d.ts +8 -0
- package/components/GridShadowScrollArea.js +82 -0
- package/components/cell/GridEditInputCell.js +2 -3
- package/components/columnSelection/GridHeaderCheckbox.js +51 -17
- package/components/columnsManagement/GridColumnsManagement.js +59 -61
- package/components/containers/GridOverlay.js +6 -8
- package/components/containers/GridRoot.js +4 -2
- package/components/containers/GridRootStyles.d.ts +1 -2
- package/components/containers/GridRootStyles.js +77 -100
- package/components/containers/GridToolbarContainer.js +5 -6
- package/components/menu/GridMenu.js +7 -6
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -3
- package/components/panel/GridPanel.js +18 -20
- package/components/panel/GridPanelContent.js +6 -8
- package/components/panel/GridPanelFooter.js +5 -6
- package/components/panel/GridPanelHeader.js +4 -5
- package/components/panel/filterPanel/GridFilterForm.js +13 -20
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +20 -45
- package/components/panel/filterPanel/GridFilterInputValue.js +3 -6
- package/components/toolbar/GridToolbarFilterButton.js +5 -6
- package/components/toolbar/GridToolbarQuickFilter.js +23 -30
- package/components/virtualization/GridVirtualScrollbar.js +8 -5
- package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/constants/cssVariables.d.ts +294 -0
- package/constants/cssVariables.js +168 -0
- package/constants/dataGridPropsDefaultValues.js +1 -0
- package/constants/defaultGridSlotsComponents.js +1 -1
- package/constants/gridClasses.d.ts +13 -0
- package/constants/gridClasses.js +1 -1
- package/context/GridContextProvider.js +4 -1
- package/esm/DataGrid/DataGrid.js +31 -22
- package/esm/DataGrid/useDataGridProps.js +1 -1
- package/esm/colDef/gridCheckboxSelectionColDef.js +1 -3
- package/esm/components/GridFooter.js +2 -2
- package/esm/components/GridHeader.js +1 -1
- package/esm/components/GridPagination.js +5 -6
- package/esm/components/GridRowCount.js +4 -5
- package/esm/components/GridScrollArea.js +2 -1
- package/esm/components/GridSelectedRowCount.js +5 -6
- package/esm/components/GridShadowScrollArea.d.ts +8 -0
- package/esm/components/GridShadowScrollArea.js +74 -0
- package/esm/components/cell/GridEditInputCell.js +2 -3
- package/esm/components/columnSelection/GridHeaderCheckbox.js +51 -17
- package/esm/components/columnsManagement/GridColumnsManagement.js +60 -62
- package/esm/components/containers/GridOverlay.js +6 -8
- package/esm/components/containers/GridRoot.js +4 -2
- package/esm/components/containers/GridRootStyles.d.ts +1 -2
- package/esm/components/containers/GridRootStyles.js +78 -101
- package/esm/components/containers/GridToolbarContainer.js +5 -6
- package/esm/components/menu/GridMenu.js +7 -6
- package/esm/components/menu/columnMenu/GridColumnHeaderMenu.js +2 -1
- package/esm/components/panel/GridPanel.js +18 -20
- package/esm/components/panel/GridPanelContent.js +6 -8
- package/esm/components/panel/GridPanelFooter.js +5 -6
- package/esm/components/panel/GridPanelHeader.js +4 -5
- package/esm/components/panel/filterPanel/GridFilterForm.js +13 -20
- package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
- package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.js +19 -44
- package/esm/components/panel/filterPanel/GridFilterInputValue.js +3 -6
- package/esm/components/toolbar/GridToolbarFilterButton.js +5 -6
- package/esm/components/toolbar/GridToolbarQuickFilter.js +23 -30
- package/esm/components/virtualization/GridVirtualScrollbar.js +3 -1
- package/esm/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/esm/constants/cssVariables.d.ts +294 -0
- package/esm/constants/cssVariables.js +161 -0
- package/esm/constants/dataGridPropsDefaultValues.js +1 -0
- package/esm/constants/defaultGridSlotsComponents.js +2 -2
- package/esm/constants/gridClasses.d.ts +13 -0
- package/esm/constants/gridClasses.js +1 -1
- package/esm/context/GridContextProvider.js +4 -1
- package/esm/hooks/features/clipboard/useGridClipboard.js +3 -2
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/esm/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/esm/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
- package/esm/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
- package/esm/hooks/features/columns/gridColumnsSelector.js +8 -0
- package/esm/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
- package/esm/hooks/features/columns/gridColumnsUtils.js +6 -3
- package/esm/hooks/features/columns/index.d.ts +1 -1
- package/esm/hooks/features/columns/index.js +1 -1
- package/esm/hooks/features/columns/useGridColumns.js +4 -2
- package/esm/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
- package/esm/hooks/features/dataSource/gridDataSourceError.js +32 -0
- package/esm/hooks/features/dataSource/index.d.ts +2 -0
- package/esm/hooks/features/dataSource/index.js +2 -0
- package/esm/hooks/features/dataSource/models.d.ts +1 -1
- package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/esm/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
- package/esm/hooks/features/dimensions/useGridDimensions.js +11 -10
- package/esm/hooks/features/editing/useGridCellEditing.js +2 -1
- package/esm/hooks/features/editing/useGridRowEditing.js +2 -1
- package/esm/hooks/features/export/utils.js +4 -2
- package/esm/hooks/features/focus/useGridFocus.js +3 -2
- package/esm/hooks/features/index.d.ts +1 -1
- package/esm/hooks/features/index.js +1 -1
- package/esm/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/esm/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +148 -81
- package/esm/hooks/features/rowSelection/utils.d.ts +2 -2
- package/esm/hooks/features/rowSelection/utils.js +11 -11
- package/esm/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
- package/esm/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/esm/hooks/features/rows/gridRowsUtils.js +8 -0
- package/esm/hooks/features/rows/useGridParamsApi.js +2 -8
- package/esm/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
- package/esm/hooks/features/rows/useGridRows.d.ts +2 -2
- package/esm/hooks/features/rows/useGridRows.js +7 -7
- package/esm/hooks/features/virtualization/useGridVirtualScroller.js +5 -9
- package/esm/hooks/utils/useGridSelector.js +4 -1
- package/esm/hooks/utils/useIsSSR.js +4 -1
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +2 -1
- package/esm/internals/index.js +2 -1
- package/esm/internals/utils/propValidation.js +1 -1
- package/esm/locales/bnBD.d.ts +2 -0
- package/esm/locales/bnBD.js +167 -0
- package/esm/locales/deDE.js +3 -5
- package/esm/locales/huHU.js +10 -13
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +1 -0
- package/esm/locales/ruRU.js +17 -21
- package/esm/material/index.d.ts +1 -0
- package/esm/material/index.js +164 -49
- package/esm/material/variables.d.ts +5 -0
- package/esm/material/variables.js +89 -0
- package/esm/models/api/gridRowSelectionApi.d.ts +4 -2
- package/esm/models/api/gridSortApi.d.ts +1 -1
- package/esm/models/configuration/gridConfiguration.d.ts +7 -1
- package/esm/models/gridBaseSlots.d.ts +56 -6
- package/esm/models/gridDataSource.d.ts +9 -4
- package/esm/models/gridRowSelectionManager.d.ts +9 -0
- package/esm/models/gridRowSelectionManager.js +36 -0
- package/esm/models/gridRowSelectionModel.d.ts +4 -2
- package/esm/models/gridSlotsComponent.d.ts +7 -27
- package/esm/models/gridSlotsComponentsProps.d.ts +3 -11
- package/esm/models/gridSortModel.d.ts +1 -1
- package/esm/models/index.d.ts +2 -1
- package/esm/models/index.js +2 -3
- package/esm/models/props/DataGridProps.d.ts +22 -17
- package/esm/utils/css/context.d.ts +14 -0
- package/esm/utils/css/context.js +54 -0
- package/esm/utils/index.d.ts +2 -1
- package/esm/utils/index.js +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +3 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/hooks/features/columnResize/useGridColumnResize.js +28 -27
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
- package/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
- package/hooks/features/columns/gridColumnsSelector.js +9 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
- package/hooks/features/columns/gridColumnsUtils.js +6 -3
- package/hooks/features/columns/index.d.ts +1 -1
- package/hooks/features/columns/index.js +94 -10
- package/hooks/features/columns/useGridColumns.js +4 -2
- package/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
- package/hooks/features/dataSource/gridDataSourceError.js +40 -0
- package/hooks/features/dataSource/index.d.ts +2 -0
- package/hooks/features/dataSource/index.js +25 -0
- package/hooks/features/dataSource/models.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
- package/hooks/features/dimensions/useGridDimensions.js +19 -18
- package/hooks/features/editing/useGridCellEditing.js +10 -9
- package/hooks/features/editing/useGridRowEditing.js +11 -10
- package/hooks/features/export/utils.js +4 -2
- package/hooks/features/focus/useGridFocus.js +8 -7
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +11 -28
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
- package/hooks/features/rowSelection/useGridRowSelection.js +146 -79
- package/hooks/features/rowSelection/utils.d.ts +2 -2
- package/hooks/features/rowSelection/utils.js +10 -10
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/hooks/features/rows/gridRowsUtils.js +10 -1
- package/hooks/features/rows/useGridParamsApi.js +2 -8
- package/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRows.js +7 -7
- package/hooks/features/virtualization/useGridVirtualScroller.js +21 -25
- package/hooks/utils/useGridSelector.js +6 -2
- package/hooks/utils/useIsSSR.js +6 -2
- package/index.js +1 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +15 -0
- package/internals/utils/propValidation.js +1 -1
- package/locales/bnBD.d.ts +2 -0
- package/locales/bnBD.js +173 -0
- package/locales/deDE.js +3 -5
- package/locales/huHU.js +10 -13
- package/locales/index.d.ts +1 -0
- package/locales/index.js +11 -0
- package/locales/ruRU.js +17 -21
- package/material/index.d.ts +1 -0
- package/material/index.js +170 -49
- package/material/variables.d.ts +5 -0
- package/material/variables.js +95 -0
- package/models/api/gridRowSelectionApi.d.ts +4 -2
- package/models/api/gridSortApi.d.ts +1 -1
- package/models/configuration/gridConfiguration.d.ts +7 -1
- package/models/gridBaseSlots.d.ts +56 -6
- package/models/gridDataSource.d.ts +9 -4
- package/models/gridRowSelectionManager.d.ts +9 -0
- package/models/gridRowSelectionManager.js +43 -0
- package/models/gridRowSelectionModel.d.ts +4 -2
- package/models/gridSlotsComponent.d.ts +7 -27
- package/models/gridSlotsComponentsProps.d.ts +3 -11
- package/models/gridSortModel.d.ts +1 -1
- package/models/index.d.ts +2 -1
- package/models/index.js +34 -11
- package/models/props/DataGridProps.d.ts +22 -17
- package/modern/DataGrid/DataGrid.js +31 -22
- package/modern/DataGrid/useDataGridProps.js +1 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -3
- package/modern/components/GridFooter.js +2 -2
- package/modern/components/GridHeader.js +1 -1
- package/modern/components/GridPagination.js +5 -6
- package/modern/components/GridRowCount.js +4 -5
- package/modern/components/GridScrollArea.js +2 -1
- package/modern/components/GridSelectedRowCount.js +5 -6
- package/modern/components/GridShadowScrollArea.d.ts +8 -0
- package/modern/components/GridShadowScrollArea.js +74 -0
- package/modern/components/cell/GridEditInputCell.js +2 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +51 -17
- package/modern/components/columnsManagement/GridColumnsManagement.js +60 -62
- package/modern/components/containers/GridOverlay.js +6 -8
- package/modern/components/containers/GridRoot.js +4 -2
- package/modern/components/containers/GridRootStyles.d.ts +1 -2
- package/modern/components/containers/GridRootStyles.js +78 -101
- package/modern/components/containers/GridToolbarContainer.js +5 -6
- package/modern/components/menu/GridMenu.js +7 -6
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +2 -1
- package/modern/components/panel/GridPanel.js +18 -20
- package/modern/components/panel/GridPanelContent.js +6 -8
- package/modern/components/panel/GridPanelFooter.js +5 -6
- package/modern/components/panel/GridPanelHeader.js +4 -5
- package/modern/components/panel/filterPanel/GridFilterForm.js +13 -20
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +19 -44
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +3 -6
- package/modern/components/toolbar/GridToolbarFilterButton.js +5 -6
- package/modern/components/toolbar/GridToolbarQuickFilter.js +23 -30
- package/modern/components/virtualization/GridVirtualScrollbar.js +3 -1
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/modern/constants/cssVariables.d.ts +294 -0
- package/modern/constants/cssVariables.js +161 -0
- package/modern/constants/dataGridPropsDefaultValues.js +1 -0
- package/modern/constants/defaultGridSlotsComponents.js +2 -2
- package/modern/constants/gridClasses.d.ts +13 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/context/GridContextProvider.js +4 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +3 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/modern/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
- package/modern/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
- package/modern/hooks/features/columns/gridColumnsSelector.js +8 -0
- package/modern/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
- package/modern/hooks/features/columns/gridColumnsUtils.js +6 -3
- package/modern/hooks/features/columns/index.d.ts +1 -1
- package/modern/hooks/features/columns/index.js +1 -1
- package/modern/hooks/features/columns/useGridColumns.js +4 -2
- package/modern/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
- package/modern/hooks/features/dataSource/gridDataSourceError.js +32 -0
- package/modern/hooks/features/dataSource/index.d.ts +2 -0
- package/modern/hooks/features/dataSource/index.js +2 -0
- package/modern/hooks/features/dataSource/models.d.ts +1 -1
- package/modern/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/modern/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
- package/modern/hooks/features/dimensions/useGridDimensions.js +11 -10
- package/modern/hooks/features/editing/useGridCellEditing.js +2 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +2 -1
- package/modern/hooks/features/export/utils.js +4 -2
- package/modern/hooks/features/focus/useGridFocus.js +3 -2
- package/modern/hooks/features/index.d.ts +1 -1
- package/modern/hooks/features/index.js +1 -1
- package/modern/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/modern/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +148 -81
- package/modern/hooks/features/rowSelection/utils.d.ts +2 -2
- package/modern/hooks/features/rowSelection/utils.js +11 -11
- package/modern/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +8 -0
- package/modern/hooks/features/rows/useGridParamsApi.js +2 -8
- package/modern/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
- package/modern/hooks/features/rows/useGridRows.d.ts +2 -2
- package/modern/hooks/features/rows/useGridRows.js +7 -7
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +5 -9
- package/modern/hooks/utils/useGridSelector.js +4 -1
- package/modern/hooks/utils/useIsSSR.js +4 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.d.ts +2 -1
- package/modern/internals/index.js +2 -1
- package/modern/internals/utils/propValidation.js +1 -1
- package/modern/locales/bnBD.d.ts +2 -0
- package/modern/locales/bnBD.js +167 -0
- package/modern/locales/deDE.js +3 -5
- package/modern/locales/huHU.js +10 -13
- package/modern/locales/index.d.ts +1 -0
- package/modern/locales/index.js +1 -0
- package/modern/locales/ruRU.js +17 -21
- package/modern/material/index.d.ts +1 -0
- package/modern/material/index.js +164 -49
- package/modern/material/variables.d.ts +5 -0
- package/modern/material/variables.js +89 -0
- package/modern/models/api/gridRowSelectionApi.d.ts +4 -2
- package/modern/models/api/gridSortApi.d.ts +1 -1
- package/modern/models/configuration/gridConfiguration.d.ts +7 -1
- package/modern/models/gridBaseSlots.d.ts +56 -6
- package/modern/models/gridDataSource.d.ts +9 -4
- package/modern/models/gridRowSelectionManager.d.ts +9 -0
- package/modern/models/gridRowSelectionManager.js +36 -0
- package/modern/models/gridRowSelectionModel.d.ts +4 -2
- package/modern/models/gridSlotsComponent.d.ts +7 -27
- package/modern/models/gridSlotsComponentsProps.d.ts +3 -11
- package/modern/models/gridSortModel.d.ts +1 -1
- package/modern/models/index.d.ts +2 -1
- package/modern/models/index.js +2 -3
- package/modern/models/props/DataGridProps.d.ts +22 -17
- package/modern/utils/css/context.d.ts +14 -0
- package/modern/utils/css/context.js +54 -0
- package/modern/utils/index.d.ts +2 -1
- package/modern/utils/index.js +1 -1
- package/package.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/css/context.d.ts +14 -0
- package/utils/css/context.js +64 -0
- package/utils/index.d.ts +2 -1
- package/utils/index.js +8 -1
|
@@ -8,17 +8,9 @@ exports.GridRootStyles = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _styles = require("@mui/material/styles");
|
|
10
10
|
var _gridClasses = require("../../constants/gridClasses");
|
|
11
|
+
var _cssVariables = require("../../constants/cssVariables");
|
|
11
12
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
12
13
|
var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
|
|
13
|
-
function getBorderColor(theme) {
|
|
14
|
-
if (theme.vars) {
|
|
15
|
-
return theme.vars.palette.TableCell.border;
|
|
16
|
-
}
|
|
17
|
-
if (theme.palette.mode === 'light') {
|
|
18
|
-
return (0, _styles.lighten)((0, _styles.alpha)(theme.palette.divider, 1), 0.88);
|
|
19
|
-
}
|
|
20
|
-
return (0, _styles.darken)((0, _styles.alpha)(theme.palette.divider, 1), 0.68);
|
|
21
|
-
}
|
|
22
14
|
const columnHeaderStyles = {
|
|
23
15
|
[`& .${_gridClasses.gridClasses.iconButtonContainer}`]: {
|
|
24
16
|
visibility: 'visible',
|
|
@@ -268,42 +260,38 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
268
260
|
}, {
|
|
269
261
|
[`& .${_gridClasses.gridClasses.withBorderColor}`]: styles.withBorderColor
|
|
270
262
|
}]
|
|
271
|
-
})(({
|
|
272
|
-
theme: t
|
|
273
|
-
}) => {
|
|
263
|
+
})(() => {
|
|
274
264
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
275
265
|
const shouldShowBorderTopRightRadius = (0, _useGridSelector.useGridSelector)(apiRef, shouldShowBorderTopRightRadiusSelector);
|
|
276
|
-
const
|
|
277
|
-
const
|
|
278
|
-
const
|
|
279
|
-
const
|
|
280
|
-
const
|
|
281
|
-
const
|
|
282
|
-
const
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
const
|
|
289
|
-
const
|
|
266
|
+
const baseBackground = _cssVariables.vars.colors.background.base;
|
|
267
|
+
const headerBackground = _cssVariables.vars.header.background.base;
|
|
268
|
+
const pinnedBackground = _cssVariables.vars.cell.background.pinned;
|
|
269
|
+
const hoverColor = _cssVariables.vars.colors.interactive.hover;
|
|
270
|
+
const hoverOpacity = _cssVariables.vars.colors.interactive.hoverOpacity;
|
|
271
|
+
const selectedColor = _cssVariables.vars.colors.interactive.selected;
|
|
272
|
+
const selectedOpacity = _cssVariables.vars.colors.interactive.selectedOpacity;
|
|
273
|
+
const selectedHoverColor = selectedColor;
|
|
274
|
+
const selectedHoverOpacity = `calc(${selectedOpacity} + ${hoverOpacity})`;
|
|
275
|
+
const hoverBackground = mix(baseBackground, hoverColor, hoverOpacity);
|
|
276
|
+
const selectedBackground = mix(baseBackground, selectedColor, selectedOpacity);
|
|
277
|
+
const selectedHoverBackground = mix(baseBackground, selectedHoverColor, selectedHoverOpacity);
|
|
278
|
+
const pinnedHoverBackground = mix(pinnedBackground, hoverColor, hoverOpacity);
|
|
279
|
+
const pinnedSelectedBackground = mix(pinnedBackground, selectedColor, selectedOpacity);
|
|
280
|
+
const pinnedSelectedHoverBackground = mix(pinnedBackground, selectedHoverColor, selectedHoverOpacity);
|
|
290
281
|
const getPinnedBackgroundStyles = backgroundColor => ({
|
|
291
282
|
[`& .${_gridClasses.gridClasses['cell--pinnedLeft']}, & .${_gridClasses.gridClasses['cell--pinnedRight']}`]: {
|
|
292
283
|
backgroundColor,
|
|
293
284
|
'&.Mui-selected': {
|
|
294
|
-
backgroundColor:
|
|
285
|
+
backgroundColor: mix(backgroundColor, selectedBackground, selectedOpacity),
|
|
295
286
|
'&:hover': {
|
|
296
|
-
backgroundColor:
|
|
287
|
+
backgroundColor: mix(backgroundColor, selectedHoverBackground, selectedHoverOpacity)
|
|
297
288
|
}
|
|
298
289
|
}
|
|
299
290
|
}
|
|
300
291
|
});
|
|
301
|
-
const
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackgroundColor);
|
|
305
|
-
const pinnedSelectedHoverBackgroundColor = blendFn(pinnedBackground, selectedHoverBackground, selectedHoverOpacity);
|
|
306
|
-
const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackgroundColor);
|
|
292
|
+
const pinnedHoverStyles = getPinnedBackgroundStyles(pinnedHoverBackground);
|
|
293
|
+
const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackground);
|
|
294
|
+
const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackground);
|
|
307
295
|
const selectedStyles = {
|
|
308
296
|
backgroundColor: selectedBackground,
|
|
309
297
|
'&:hover': {
|
|
@@ -315,13 +303,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
315
303
|
}
|
|
316
304
|
};
|
|
317
305
|
const gridStyle = (0, _extends2.default)({
|
|
318
|
-
'--unstable_DataGrid-radius':
|
|
319
|
-
'--unstable_DataGrid-headWeight':
|
|
320
|
-
'--
|
|
321
|
-
'--DataGrid-background': background,
|
|
322
|
-
'--DataGrid-headerBackground': headerBackground,
|
|
323
|
-
'--DataGrid-pinnedBackground': pinnedBackground,
|
|
324
|
-
'--DataGrid-rowBorderColor': borderColor,
|
|
306
|
+
'--unstable_DataGrid-radius': _cssVariables.vars.radius.base,
|
|
307
|
+
'--unstable_DataGrid-headWeight': _cssVariables.vars.typography.fontWeight.medium,
|
|
308
|
+
'--DataGrid-rowBorderColor': _cssVariables.vars.colors.border.base,
|
|
325
309
|
'--DataGrid-cellOffsetMultiplier': 2,
|
|
326
310
|
'--DataGrid-width': '0px',
|
|
327
311
|
'--DataGrid-hasScrollX': '0',
|
|
@@ -340,11 +324,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
340
324
|
position: 'relative',
|
|
341
325
|
borderWidth: '1px',
|
|
342
326
|
borderStyle: 'solid',
|
|
343
|
-
borderColor,
|
|
327
|
+
borderColor: _cssVariables.vars.colors.border.base,
|
|
344
328
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
345
|
-
backgroundColor:
|
|
346
|
-
color:
|
|
347
|
-
},
|
|
329
|
+
backgroundColor: _cssVariables.vars.colors.background.base,
|
|
330
|
+
color: _cssVariables.vars.colors.foreground.base
|
|
331
|
+
}, _cssVariables.vars.typography.body, {
|
|
348
332
|
outline: 'none',
|
|
349
333
|
height: '100%',
|
|
350
334
|
display: 'flex',
|
|
@@ -391,11 +375,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
391
375
|
boxSizing: 'border-box'
|
|
392
376
|
},
|
|
393
377
|
[`& .${_gridClasses.gridClasses.columnHeader}:focus-within, & .${_gridClasses.gridClasses.cell}:focus-within`]: {
|
|
394
|
-
outline: `solid ${
|
|
378
|
+
outline: `solid ${setOpacity(_cssVariables.vars.colors.interactive.focus, 0.5)} ${focusOutlineWidth}px`,
|
|
395
379
|
outlineOffset: focusOutlineWidth * -1
|
|
396
380
|
},
|
|
397
381
|
[`& .${_gridClasses.gridClasses.columnHeader}:focus, & .${_gridClasses.gridClasses.cell}:focus`]: {
|
|
398
|
-
outline: `solid ${
|
|
382
|
+
outline: `solid ${_cssVariables.vars.colors.interactive.focus} ${focusOutlineWidth}px`,
|
|
399
383
|
outlineOffset: focusOutlineWidth * -1
|
|
400
384
|
},
|
|
401
385
|
// Hide the column separator when:
|
|
@@ -437,7 +421,8 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
437
421
|
[`& .${_gridClasses.gridClasses.columnHeader}`]: {
|
|
438
422
|
position: 'relative',
|
|
439
423
|
display: 'flex',
|
|
440
|
-
alignItems: 'center'
|
|
424
|
+
alignItems: 'center',
|
|
425
|
+
backgroundColor: headerBackground
|
|
441
426
|
},
|
|
442
427
|
[`& .${_gridClasses.gridClasses['columnHeader--filter']}`]: {
|
|
443
428
|
paddingTop: 8,
|
|
@@ -455,14 +440,14 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
455
440
|
},
|
|
456
441
|
[`& .${_gridClasses.gridClasses.columnHeader}:not(.${_gridClasses.gridClasses['columnHeader--sorted']}) .${_gridClasses.gridClasses.sortIcon}`]: {
|
|
457
442
|
opacity: 0,
|
|
458
|
-
transition:
|
|
459
|
-
duration:
|
|
443
|
+
transition: _cssVariables.vars.transition(['opacity'], {
|
|
444
|
+
duration: _cssVariables.vars.transitions.duration.short
|
|
460
445
|
})
|
|
461
446
|
},
|
|
462
447
|
[`& .${_gridClasses.gridClasses.columnHeaderTitleContainer}`]: {
|
|
463
448
|
display: 'flex',
|
|
464
449
|
alignItems: 'center',
|
|
465
|
-
gap:
|
|
450
|
+
gap: _cssVariables.vars.spacing(0.25),
|
|
466
451
|
minWidth: 0,
|
|
467
452
|
flex: 1,
|
|
468
453
|
whiteSpace: 'nowrap',
|
|
@@ -498,13 +483,13 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
498
483
|
marginLeft: -5
|
|
499
484
|
},
|
|
500
485
|
[`& .${_gridClasses.gridClasses['columnHeader--moving']}`]: {
|
|
501
|
-
backgroundColor:
|
|
486
|
+
backgroundColor: hoverBackground
|
|
502
487
|
},
|
|
503
488
|
[`& .${_gridClasses.gridClasses['columnHeader--pinnedLeft']}, & .${_gridClasses.gridClasses['columnHeader--pinnedRight']}`]: {
|
|
504
489
|
position: 'sticky',
|
|
505
490
|
zIndex: 4,
|
|
506
491
|
// Should be above the column separator
|
|
507
|
-
background:
|
|
492
|
+
background: _cssVariables.vars.header.background.base
|
|
508
493
|
},
|
|
509
494
|
[`& .${_gridClasses.gridClasses.columnSeparator}`]: {
|
|
510
495
|
position: 'absolute',
|
|
@@ -515,11 +500,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
515
500
|
justifyContent: 'center',
|
|
516
501
|
alignItems: 'center',
|
|
517
502
|
maxWidth: columnSeparatorTargetSize,
|
|
518
|
-
color:
|
|
503
|
+
color: _cssVariables.vars.colors.border.base
|
|
519
504
|
},
|
|
520
505
|
[`& .${_gridClasses.gridClasses.columnHeaders}`]: {
|
|
521
506
|
width: 'var(--DataGrid-rowWidth)',
|
|
522
|
-
backgroundColor:
|
|
507
|
+
backgroundColor: headerBackground
|
|
523
508
|
},
|
|
524
509
|
'@media (hover: hover)': {
|
|
525
510
|
[`& .${_gridClasses.gridClasses.columnHeader}:hover`]: columnHeaderStyles,
|
|
@@ -532,7 +517,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
532
517
|
[`& .${_gridClasses.gridClasses.columnHeader}:focus,
|
|
533
518
|
& .${_gridClasses.gridClasses['columnHeader--siblingFocused']}`]: {
|
|
534
519
|
[`.${_gridClasses.gridClasses['columnSeparator--resizable']}`]: {
|
|
535
|
-
color:
|
|
520
|
+
color: _cssVariables.vars.colors.foreground.accent
|
|
536
521
|
}
|
|
537
522
|
}
|
|
538
523
|
},
|
|
@@ -552,7 +537,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
552
537
|
cursor: 'col-resize',
|
|
553
538
|
touchAction: 'none',
|
|
554
539
|
[`&.${_gridClasses.gridClasses['columnSeparator--resizing']}`]: {
|
|
555
|
-
color:
|
|
540
|
+
color: _cssVariables.vars.colors.foreground.accent
|
|
556
541
|
},
|
|
557
542
|
// Always appear as draggable on touch devices
|
|
558
543
|
'@media (hover: none)': {
|
|
@@ -560,7 +545,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
560
545
|
},
|
|
561
546
|
'@media (hover: hover)': {
|
|
562
547
|
'&:hover': {
|
|
563
|
-
color:
|
|
548
|
+
color: _cssVariables.vars.colors.foreground.accent,
|
|
564
549
|
[`& .${_gridClasses.gridClasses.iconSeparator} rect`]: separatorIconDragStyles
|
|
565
550
|
}
|
|
566
551
|
},
|
|
@@ -570,8 +555,8 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
570
555
|
},
|
|
571
556
|
[`& .${_gridClasses.gridClasses.iconSeparator}`]: {
|
|
572
557
|
color: 'inherit',
|
|
573
|
-
transition:
|
|
574
|
-
duration:
|
|
558
|
+
transition: _cssVariables.vars.transition(['color', 'width'], {
|
|
559
|
+
duration: _cssVariables.vars.transitions.duration.short
|
|
575
560
|
})
|
|
576
561
|
},
|
|
577
562
|
[`& .${_gridClasses.gridClasses.menuIcon}`]: {
|
|
@@ -613,7 +598,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
613
598
|
'--rowBorderColor': 'transparent'
|
|
614
599
|
},
|
|
615
600
|
'&:hover': {
|
|
616
|
-
backgroundColor:
|
|
601
|
+
backgroundColor: hoverBackground,
|
|
617
602
|
// Reset on touch devices, it doesn't add specificity
|
|
618
603
|
'@media (hover: none)': {
|
|
619
604
|
backgroundColor: 'transparent'
|
|
@@ -624,6 +609,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
624
609
|
},
|
|
625
610
|
'&.Mui-selected': selectedStyles
|
|
626
611
|
},
|
|
612
|
+
[`& .${_gridClasses.gridClasses['container--top']}, & .${_gridClasses.gridClasses['container--bottom']}`]: {
|
|
613
|
+
'[role=row]': {
|
|
614
|
+
background: _cssVariables.vars.colors.background.base
|
|
615
|
+
}
|
|
616
|
+
},
|
|
627
617
|
/* Cell styles */
|
|
628
618
|
[`& .${_gridClasses.gridClasses.cell}`]: {
|
|
629
619
|
flex: '0 0 auto',
|
|
@@ -643,9 +633,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
643
633
|
borderTopColor: 'transparent'
|
|
644
634
|
},
|
|
645
635
|
[`& .${_gridClasses.gridClasses.pinnedRows} .${_gridClasses.gridClasses.row}, .${_gridClasses.gridClasses.aggregationRowOverlayWrapper} .${_gridClasses.gridClasses.row}`]: {
|
|
646
|
-
backgroundColor:
|
|
636
|
+
backgroundColor: pinnedBackground,
|
|
647
637
|
'&:hover': {
|
|
648
|
-
backgroundColor:
|
|
638
|
+
backgroundColor: pinnedHoverBackground
|
|
649
639
|
}
|
|
650
640
|
},
|
|
651
641
|
[`& .${_gridClasses.gridClasses['pinnedRows--top']} :first-of-type`]: {
|
|
@@ -671,19 +661,19 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
671
661
|
[`& .${_gridClasses.gridClasses.cell}.${_gridClasses.gridClasses['cell--editing']}`]: {
|
|
672
662
|
padding: 1,
|
|
673
663
|
display: 'flex',
|
|
674
|
-
boxShadow:
|
|
675
|
-
backgroundColor:
|
|
664
|
+
boxShadow: _cssVariables.vars.shadows.base,
|
|
665
|
+
backgroundColor: _cssVariables.vars.colors.background.overlay,
|
|
676
666
|
'&:focus-within': {
|
|
677
|
-
outline: `${focusOutlineWidth}px solid ${
|
|
667
|
+
outline: `${focusOutlineWidth}px solid ${_cssVariables.vars.colors.interactive.focus}`,
|
|
678
668
|
outlineOffset: focusOutlineWidth * -1
|
|
679
669
|
}
|
|
680
670
|
},
|
|
681
671
|
[`& .${_gridClasses.gridClasses['row--editing']}`]: {
|
|
682
|
-
boxShadow:
|
|
672
|
+
boxShadow: _cssVariables.vars.shadows.base
|
|
683
673
|
},
|
|
684
674
|
[`& .${_gridClasses.gridClasses['row--editing']} .${_gridClasses.gridClasses.cell}`]: {
|
|
685
|
-
boxShadow:
|
|
686
|
-
backgroundColor:
|
|
675
|
+
boxShadow: 'none',
|
|
676
|
+
backgroundColor: _cssVariables.vars.colors.background.overlay
|
|
687
677
|
},
|
|
688
678
|
[`& .${_gridClasses.gridClasses.editBooleanCell}`]: {
|
|
689
679
|
display: 'flex',
|
|
@@ -693,22 +683,22 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
693
683
|
justifyContent: 'center'
|
|
694
684
|
},
|
|
695
685
|
[`& .${_gridClasses.gridClasses.booleanCell}[data-value="true"]`]: {
|
|
696
|
-
color:
|
|
686
|
+
color: _cssVariables.vars.colors.foreground.muted
|
|
697
687
|
},
|
|
698
688
|
[`& .${_gridClasses.gridClasses.booleanCell}[data-value="false"]`]: {
|
|
699
|
-
color:
|
|
689
|
+
color: _cssVariables.vars.colors.foreground.disabled
|
|
700
690
|
},
|
|
701
691
|
[`& .${_gridClasses.gridClasses.actionsCell}`]: {
|
|
702
692
|
display: 'inline-flex',
|
|
703
693
|
alignItems: 'center',
|
|
704
|
-
gridGap:
|
|
694
|
+
gridGap: _cssVariables.vars.spacing(1)
|
|
705
695
|
},
|
|
706
696
|
[`& .${_gridClasses.gridClasses.rowReorderCell}`]: {
|
|
707
697
|
display: 'inline-flex',
|
|
708
698
|
flex: 1,
|
|
709
699
|
alignItems: 'center',
|
|
710
700
|
justifyContent: 'center',
|
|
711
|
-
opacity:
|
|
701
|
+
opacity: _cssVariables.vars.colors.interactive.disabledOpacity
|
|
712
702
|
},
|
|
713
703
|
[`& .${_gridClasses.gridClasses['rowReorderCell--draggable']}`]: {
|
|
714
704
|
cursor: 'move',
|
|
@@ -720,7 +710,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
720
710
|
alignItems: 'stretch'
|
|
721
711
|
},
|
|
722
712
|
[`.${_gridClasses.gridClasses.withBorderColor}`]: {
|
|
723
|
-
borderColor
|
|
713
|
+
borderColor: _cssVariables.vars.colors.border.base
|
|
724
714
|
},
|
|
725
715
|
[`& .${_gridClasses.gridClasses['cell--withLeftBorder']}, & .${_gridClasses.gridClasses['columnHeader--withLeftBorder']}`]: {
|
|
726
716
|
borderLeftColor: 'var(--DataGrid-rowBorderColor)',
|
|
@@ -752,9 +742,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
752
742
|
[`& .${_gridClasses.gridClasses['cell--pinnedLeft']}, & .${_gridClasses.gridClasses['cell--pinnedRight']}`]: {
|
|
753
743
|
position: 'sticky',
|
|
754
744
|
zIndex: 3,
|
|
755
|
-
background:
|
|
745
|
+
background: _cssVariables.vars.cell.background.pinned,
|
|
756
746
|
'&.Mui-selected': {
|
|
757
|
-
backgroundColor:
|
|
747
|
+
backgroundColor: pinnedSelectedBackground
|
|
758
748
|
}
|
|
759
749
|
},
|
|
760
750
|
[`& .${_gridClasses.gridClasses.row}`]: {
|
|
@@ -781,16 +771,16 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
781
771
|
display: 'none'
|
|
782
772
|
},
|
|
783
773
|
[`& .${_gridClasses.gridClasses['columnHeader--dragging']}, & .${_gridClasses.gridClasses['row--dragging']}`]: {
|
|
784
|
-
background:
|
|
774
|
+
background: _cssVariables.vars.colors.background.overlay,
|
|
785
775
|
padding: '0 12px',
|
|
786
776
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
787
|
-
opacity:
|
|
777
|
+
opacity: _cssVariables.vars.colors.interactive.disabledOpacity
|
|
788
778
|
},
|
|
789
779
|
[`& .${_gridClasses.gridClasses['row--dragging']}`]: {
|
|
790
|
-
background:
|
|
780
|
+
background: _cssVariables.vars.colors.background.overlay,
|
|
791
781
|
padding: '0 12px',
|
|
792
782
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
793
|
-
opacity:
|
|
783
|
+
opacity: _cssVariables.vars.colors.interactive.disabledOpacity,
|
|
794
784
|
[`& .${_gridClasses.gridClasses.rowReorderCellPlaceholder}`]: {
|
|
795
785
|
display: 'flex'
|
|
796
786
|
}
|
|
@@ -803,7 +793,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
803
793
|
[`& .${_gridClasses.gridClasses.treeDataGroupingCellToggle}`]: {
|
|
804
794
|
flex: '0 0 28px',
|
|
805
795
|
alignSelf: 'stretch',
|
|
806
|
-
marginRight:
|
|
796
|
+
marginRight: _cssVariables.vars.spacing(2)
|
|
807
797
|
},
|
|
808
798
|
[`& .${_gridClasses.gridClasses.treeDataGroupingCellLoadingContainer}, .${_gridClasses.gridClasses.groupingCriteriaCellLoadingContainer}`]: {
|
|
809
799
|
display: 'flex',
|
|
@@ -819,7 +809,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
819
809
|
[`& .${_gridClasses.gridClasses.groupingCriteriaCellToggle}`]: {
|
|
820
810
|
flex: '0 0 28px',
|
|
821
811
|
alignSelf: 'stretch',
|
|
822
|
-
marginRight:
|
|
812
|
+
marginRight: _cssVariables.vars.spacing(2)
|
|
823
813
|
},
|
|
824
814
|
/* ScrollbarFiller styles */
|
|
825
815
|
[`.${_gridClasses.gridClasses.scrollbarFiller}`]: {
|
|
@@ -832,7 +822,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
832
822
|
borderBottom: '1px solid var(--DataGrid-rowBorderColor)'
|
|
833
823
|
},
|
|
834
824
|
[`&.${_gridClasses.gridClasses['scrollbarFiller--pinnedRight']}`]: {
|
|
835
|
-
backgroundColor:
|
|
825
|
+
backgroundColor: _cssVariables.vars.cell.background.pinned,
|
|
836
826
|
position: 'sticky',
|
|
837
827
|
right: 0
|
|
838
828
|
}
|
|
@@ -859,22 +849,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
859
849
|
});
|
|
860
850
|
return gridStyle;
|
|
861
851
|
});
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
* Blend a transparent overlay color with a background color, resulting in a single
|
|
865
|
-
* RGB color.
|
|
866
|
-
*/
|
|
867
|
-
function blend(background, overlay, opacity, gamma = 1) {
|
|
868
|
-
const f = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);
|
|
869
|
-
const backgroundColor = (0, _styles.decomposeColor)(background);
|
|
870
|
-
const overlayColor = (0, _styles.decomposeColor)(overlay);
|
|
871
|
-
const rgb = [f(backgroundColor.values[0], overlayColor.values[0]), f(backgroundColor.values[1], overlayColor.values[1]), f(backgroundColor.values[2], overlayColor.values[2])];
|
|
872
|
-
return (0, _styles.recomposeColor)({
|
|
873
|
-
type: 'rgb',
|
|
874
|
-
values: rgb
|
|
875
|
-
});
|
|
852
|
+
function setOpacity(color, opacity) {
|
|
853
|
+
return `rgba(from ${color} r g b / ${opacity})`;
|
|
876
854
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
return `color-mix(in srgb,${background}, ${removeOpacity(overlay)} calc(${opacity} * 100%))`;
|
|
855
|
+
function mix(background, overlay, opacity) {
|
|
856
|
+
return `color-mix(in srgb,${background}, ${overlay} calc(${opacity} * 100%))`;
|
|
880
857
|
}
|
|
@@ -14,6 +14,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
14
14
|
var _system = require("@mui/system");
|
|
15
15
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
16
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
17
|
+
var _cssVariables = require("../../constants/cssVariables");
|
|
17
18
|
var _gridClasses = require("../../constants/gridClasses");
|
|
18
19
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -31,15 +32,13 @@ const GridToolbarContainerRoot = (0, _system.styled)('div', {
|
|
|
31
32
|
name: 'MuiDataGrid',
|
|
32
33
|
slot: 'ToolbarContainer',
|
|
33
34
|
overridesResolver: (_, styles) => styles.toolbarContainer
|
|
34
|
-
})(
|
|
35
|
-
theme
|
|
36
|
-
}) => ({
|
|
35
|
+
})({
|
|
37
36
|
display: 'flex',
|
|
38
37
|
alignItems: 'center',
|
|
39
38
|
flexWrap: 'wrap',
|
|
40
|
-
gap:
|
|
41
|
-
padding:
|
|
42
|
-
})
|
|
39
|
+
gap: _cssVariables.vars.spacing(1),
|
|
40
|
+
padding: _cssVariables.vars.spacing(0.5, 0.5, 0)
|
|
41
|
+
});
|
|
43
42
|
const GridToolbarContainer = exports.GridToolbarContainer = (0, _forwardRef.forwardRef)(function GridToolbarContainer(props, ref) {
|
|
44
43
|
const {
|
|
45
44
|
className,
|
|
@@ -13,6 +13,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
15
|
var _styles = require("@mui/material/styles");
|
|
16
|
+
var _cssVariables = require("../../constants/cssVariables");
|
|
17
|
+
var _context = require("../../utils/css/context");
|
|
16
18
|
var _gridClasses = require("../../constants/gridClasses");
|
|
17
19
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
18
20
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
@@ -31,14 +33,12 @@ const useUtilityClasses = ownerState => {
|
|
|
31
33
|
const GridMenuRoot = (0, _styles.styled)(_assert.NotRendered, {
|
|
32
34
|
name: 'MuiDataGrid',
|
|
33
35
|
slot: 'Menu'
|
|
34
|
-
})(
|
|
35
|
-
|
|
36
|
-
}) => ({
|
|
37
|
-
zIndex: theme.zIndex.modal,
|
|
36
|
+
})({
|
|
37
|
+
zIndex: _cssVariables.vars.zIndex.menu,
|
|
38
38
|
[`& .${_gridClasses.gridClasses.menuList}`]: {
|
|
39
39
|
outline: 0
|
|
40
40
|
}
|
|
41
|
-
})
|
|
41
|
+
});
|
|
42
42
|
function GridMenu(props) {
|
|
43
43
|
const {
|
|
44
44
|
open,
|
|
@@ -53,6 +53,7 @@ function GridMenu(props) {
|
|
|
53
53
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
54
54
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
55
55
|
const classes = useUtilityClasses(rootProps);
|
|
56
|
+
const variablesClass = (0, _context.useCSSVariablesClass)();
|
|
56
57
|
const savedFocusRef = React.useRef(null);
|
|
57
58
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
58
59
|
if (open) {
|
|
@@ -77,7 +78,7 @@ function GridMenu(props) {
|
|
|
77
78
|
};
|
|
78
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridMenuRoot, (0, _extends2.default)({
|
|
79
80
|
as: rootProps.slots.basePopper,
|
|
80
|
-
className: (0, _clsx.default)(classes.root, className),
|
|
81
|
+
className: (0, _clsx.default)(classes.root, className, variablesClass),
|
|
81
82
|
ownerState: rootProps,
|
|
82
83
|
open: open,
|
|
83
84
|
target: target,
|
|
@@ -9,7 +9,8 @@ exports.GridColumnHeaderMenu = GridColumnHeaderMenu;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var
|
|
12
|
+
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
13
|
+
var _HTMLElementType = _interopRequireDefault(require("@mui/utils/HTMLElementType"));
|
|
13
14
|
var _useGridApiContext = require("../../../hooks/utils/useGridApiContext");
|
|
14
15
|
var _GridMenu = require("../GridMenu");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -25,7 +26,7 @@ function GridColumnHeaderMenu({
|
|
|
25
26
|
}) {
|
|
26
27
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
27
28
|
const colDef = apiRef.current.getColumn(field);
|
|
28
|
-
const hideMenu = (0,
|
|
29
|
+
const hideMenu = (0, _useEventCallback.default)(event => {
|
|
29
30
|
if (event) {
|
|
30
31
|
// Prevent triggering the sorting
|
|
31
32
|
event.stopPropagation();
|
|
@@ -65,5 +66,5 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderMenu.propTypes = {
|
|
|
65
66
|
field: _propTypes.default.string.isRequired,
|
|
66
67
|
onExited: _propTypes.default.func,
|
|
67
68
|
open: _propTypes.default.bool.isRequired,
|
|
68
|
-
target:
|
|
69
|
+
target: _HTMLElementType.default
|
|
69
70
|
} : void 0;
|
|
@@ -14,8 +14,9 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _utils = require("@mui/utils");
|
|
16
16
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
17
|
-
var _Paper = _interopRequireDefault(require("@mui/material/Paper"));
|
|
18
17
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
18
|
+
var _cssVariables = require("../../constants/cssVariables");
|
|
19
|
+
var _context = require("../../utils/css/context");
|
|
19
20
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
20
21
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
21
22
|
var _assert = require("../../utils/assert");
|
|
@@ -24,25 +25,23 @@ const _excluded = ["children", "className", "classes"];
|
|
|
24
25
|
const gridPanelClasses = exports.gridPanelClasses = (0, _utils.unstable_generateUtilityClasses)('MuiDataGrid', ['panel', 'paper']);
|
|
25
26
|
const GridPanelRoot = (0, _styles.styled)(_assert.NotRendered, {
|
|
26
27
|
name: 'MuiDataGrid',
|
|
27
|
-
slot: '
|
|
28
|
-
})(
|
|
29
|
-
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
}));
|
|
33
|
-
const GridPaperRoot = (0, _styles.styled)(_Paper.default, {
|
|
28
|
+
slot: 'panel'
|
|
29
|
+
})({
|
|
30
|
+
zIndex: _cssVariables.vars.zIndex.panel
|
|
31
|
+
});
|
|
32
|
+
const GridPanelContent = (0, _styles.styled)('div', {
|
|
34
33
|
name: 'MuiDataGrid',
|
|
35
|
-
slot: '
|
|
36
|
-
})(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
slot: 'panelContent'
|
|
35
|
+
})({
|
|
36
|
+
backgroundColor: _cssVariables.vars.colors.background.overlay,
|
|
37
|
+
borderRadius: _cssVariables.vars.radius.base,
|
|
38
|
+
boxShadow: _cssVariables.vars.shadows.overlay,
|
|
40
39
|
minWidth: 300,
|
|
41
40
|
maxHeight: 450,
|
|
42
41
|
display: 'flex',
|
|
43
|
-
maxWidth: `calc(100vw - ${
|
|
42
|
+
maxWidth: `calc(100vw - ${_cssVariables.vars.spacing(0.5)})`,
|
|
44
43
|
overflow: 'auto'
|
|
45
|
-
})
|
|
44
|
+
});
|
|
46
45
|
const GridPanel = exports.GridPanel = (0, _forwardRef.forwardRef)((props, ref) => {
|
|
47
46
|
const {
|
|
48
47
|
children,
|
|
@@ -53,6 +52,7 @@ const GridPanel = exports.GridPanel = (0, _forwardRef.forwardRef)((props, ref) =
|
|
|
53
52
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
54
53
|
const classes = gridPanelClasses;
|
|
55
54
|
const [isPlaced, setIsPlaced] = React.useState(false);
|
|
55
|
+
const variablesClass = (0, _context.useCSSVariablesClass)();
|
|
56
56
|
const onDidShow = (0, _useEventCallback.default)(() => setIsPlaced(true));
|
|
57
57
|
const onDidHide = (0, _useEventCallback.default)(() => setIsPlaced(false));
|
|
58
58
|
const handleClickAway = (0, _useEventCallback.default)(() => {
|
|
@@ -77,7 +77,7 @@ const GridPanel = exports.GridPanel = (0, _forwardRef.forwardRef)((props, ref) =
|
|
|
77
77
|
as: rootProps.slots.basePopper,
|
|
78
78
|
ownerState: rootProps,
|
|
79
79
|
placement: "bottom-start",
|
|
80
|
-
className: (0, _clsx.default)(classes.panel, className),
|
|
80
|
+
className: (0, _clsx.default)(classes.panel, className, variablesClass),
|
|
81
81
|
target: target,
|
|
82
82
|
flip: true,
|
|
83
83
|
onDidShow: onDidShow,
|
|
@@ -85,14 +85,12 @@ const GridPanel = exports.GridPanel = (0, _forwardRef.forwardRef)((props, ref) =
|
|
|
85
85
|
onClickAway: handleClickAway,
|
|
86
86
|
clickAwayMouseEvent: "onPointerUp",
|
|
87
87
|
clickAwayTouchEvent: false,
|
|
88
|
-
focusTrap: true
|
|
89
|
-
focusTrapEnabled: true
|
|
88
|
+
focusTrap: true
|
|
90
89
|
}, other, rootProps.slotProps?.basePopper, {
|
|
91
90
|
ref: ref,
|
|
92
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
91
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(GridPanelContent, {
|
|
93
92
|
className: classes.paper,
|
|
94
93
|
ownerState: rootProps,
|
|
95
|
-
elevation: 8,
|
|
96
94
|
onKeyDown: handleKeyDown,
|
|
97
95
|
children: isPlaced && children
|
|
98
96
|
})
|
|
@@ -13,6 +13,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _system = require("@mui/system");
|
|
15
15
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
|
+
var _cssVariables = require("../../constants/cssVariables");
|
|
16
17
|
var _gridClasses = require("../../constants/gridClasses");
|
|
17
18
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -28,19 +29,16 @@ const useUtilityClasses = ownerState => {
|
|
|
28
29
|
};
|
|
29
30
|
const GridPanelContentRoot = (0, _system.styled)('div', {
|
|
30
31
|
name: 'MuiDataGrid',
|
|
31
|
-
slot: 'PanelContent'
|
|
32
|
-
|
|
33
|
-
})(({
|
|
34
|
-
theme
|
|
35
|
-
}) => ({
|
|
32
|
+
slot: 'PanelContent'
|
|
33
|
+
})({
|
|
36
34
|
display: 'flex',
|
|
37
35
|
flexDirection: 'column',
|
|
38
36
|
overflow: 'auto',
|
|
39
37
|
flex: '1 1',
|
|
40
38
|
maxHeight: 400,
|
|
41
|
-
padding:
|
|
42
|
-
gap:
|
|
43
|
-
})
|
|
39
|
+
padding: _cssVariables.vars.spacing(2.5, 1.5, 2, 1),
|
|
40
|
+
gap: _cssVariables.vars.spacing(2.5)
|
|
41
|
+
});
|
|
44
42
|
function GridPanelContent(props) {
|
|
45
43
|
const {
|
|
46
44
|
className
|
|
@@ -13,6 +13,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
|
+
var _cssVariables = require("../../constants/cssVariables");
|
|
16
17
|
var _gridClasses = require("../../constants/gridClasses");
|
|
17
18
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -30,14 +31,12 @@ const GridPanelFooterRoot = (0, _styles.styled)('div', {
|
|
|
30
31
|
name: 'MuiDataGrid',
|
|
31
32
|
slot: 'PanelFooter',
|
|
32
33
|
overridesResolver: (props, styles) => styles.panelFooter
|
|
33
|
-
})(
|
|
34
|
-
|
|
35
|
-
}) => ({
|
|
36
|
-
padding: theme.spacing(1),
|
|
34
|
+
})({
|
|
35
|
+
padding: _cssVariables.vars.spacing(1),
|
|
37
36
|
display: 'flex',
|
|
38
37
|
justifyContent: 'space-between',
|
|
39
|
-
borderTop: `1px solid ${
|
|
40
|
-
})
|
|
38
|
+
borderTop: `1px solid ${_cssVariables.vars.colors.border.base}`
|
|
39
|
+
});
|
|
41
40
|
function GridPanelFooter(props) {
|
|
42
41
|
const {
|
|
43
42
|
className
|