@mui/x-data-grid 7.0.0-alpha.8 → 7.0.0-beta.0
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 +508 -30
- package/DataGrid/DataGrid.js +6 -6
- package/DataGrid/useDataGridComponent.js +2 -1
- package/DataGrid/useDataGridProps.js +1 -0
- package/README.md +3 -3
- package/components/GridColumnHeaders.d.ts +3 -2
- package/components/GridColumnHeaders.js +3 -11
- package/components/GridDetailPanels.d.ts +5 -0
- package/components/GridDetailPanels.js +4 -0
- package/components/GridHeaders.d.ts +4 -0
- package/components/GridHeaders.js +53 -0
- package/components/GridPinnedRows.d.ts +7 -0
- package/components/GridPinnedRows.js +4 -0
- package/components/GridRow.d.ts +7 -4
- package/components/GridRow.js +161 -97
- package/components/GridScrollbarFillerCell.d.ts +7 -0
- package/components/GridScrollbarFillerCell.js +39 -0
- package/components/base/GridBody.d.ts +2 -13
- package/components/base/GridBody.js +2 -116
- package/components/base/GridOverlays.js +10 -21
- package/components/cell/GridActionsCellItem.d.ts +2 -2
- package/components/cell/GridCell.d.ts +15 -21
- package/components/cell/GridCell.js +67 -372
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +2 -1
- package/components/columnHeaders/GridColumnHeaderItem.js +7 -3
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -0
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/components/columnHeaders/GridColumnHeadersInner.js +1 -2
- package/components/columnsManagement/GridColumnsManagement.d.ts +36 -0
- package/components/columnsManagement/GridColumnsManagement.js +260 -0
- package/components/columnsManagement/index.d.ts +1 -0
- package/components/columnsManagement/index.js +1 -0
- package/components/columnsManagement/utils.d.ts +4 -0
- package/components/columnsManagement/utils.js +16 -0
- package/components/containers/GridRoot.js +18 -15
- package/components/containers/GridRootStyles.js +307 -204
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/components/panel/GridColumnsPanel.d.ts +0 -28
- package/components/panel/GridColumnsPanel.js +5 -213
- package/components/panel/GridPanel.js +3 -4
- package/components/panel/filterPanel/GridFilterForm.d.ts +6 -4
- package/components/panel/filterPanel/GridFilterForm.js +31 -14
- package/components/panel/filterPanel/GridFilterPanel.js +46 -20
- package/components/toolbar/GridToolbarColumnsButton.d.ts +13 -1
- package/components/toolbar/GridToolbarColumnsButton.js +40 -22
- package/components/toolbar/GridToolbarDensitySelector.d.ts +13 -1
- package/components/toolbar/GridToolbarDensitySelector.js +40 -22
- package/components/toolbar/GridToolbarExport.d.ts +10 -1
- package/components/toolbar/GridToolbarExport.js +6 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +15 -1
- package/components/toolbar/GridToolbarExportContainer.js +41 -23
- package/components/toolbar/GridToolbarFilterButton.d.ts +5 -4
- package/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/components/virtualization/GridBottomContainer.d.ts +2 -0
- package/components/virtualization/GridBottomContainer.js +25 -0
- package/components/{containers → virtualization}/GridMainContainer.d.ts +2 -0
- package/components/virtualization/GridMainContainer.js +20 -0
- package/components/virtualization/GridTopContainer.d.ts +2 -0
- package/components/virtualization/GridTopContainer.js +35 -0
- package/components/virtualization/GridVirtualScrollbar.d.ts +7 -0
- package/components/virtualization/GridVirtualScrollbar.js +131 -0
- package/components/virtualization/GridVirtualScroller.d.ts +4 -4
- package/components/virtualization/GridVirtualScroller.js +69 -16
- package/components/virtualization/GridVirtualScrollerFiller.d.ts +4 -0
- package/components/virtualization/GridVirtualScrollerFiller.js +71 -0
- package/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/constants/defaultGridSlotsComponents.js +8 -3
- package/constants/gridClasses.d.ts +72 -12
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +4 -6
- package/hooks/core/gridCoreSelector.d.ts +6 -0
- package/hooks/core/gridCoreSelector.js +5 -0
- package/hooks/core/useGridApiInitialization.js +4 -0
- package/hooks/core/useGridInitialization.js +4 -0
- package/hooks/core/useGridRefs.d.ts +3 -0
- package/hooks/core/useGridRefs.js +13 -0
- package/hooks/core/useGridTheme.d.ts +3 -0
- package/hooks/core/useGridTheme.js +19 -0
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +7 -14
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +13 -18
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +68 -162
- package/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +17 -0
- package/hooks/features/columns/gridColumnsInterfaces.js +9 -1
- package/hooks/features/columns/gridColumnsSelector.d.ts +14 -1
- package/hooks/features/columns/gridColumnsSelector.js +52 -0
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -5
- package/hooks/features/columns/gridColumnsUtils.js +10 -12
- package/hooks/features/columns/index.d.ts +2 -2
- package/hooks/features/columns/index.js +2 -1
- package/hooks/features/columns/useGridColumnSpanning.js +62 -61
- package/hooks/features/columns/useGridColumns.js +20 -23
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +60 -11
- package/hooks/features/dimensions/gridDimensionsSelectors.d.ts +2 -0
- package/hooks/features/dimensions/gridDimensionsSelectors.js +1 -0
- package/hooks/features/dimensions/index.d.ts +2 -0
- package/hooks/features/dimensions/index.js +1 -0
- package/hooks/features/dimensions/useGridDimensions.d.ts +7 -1
- package/hooks/features/dimensions/useGridDimensions.js +216 -148
- package/hooks/features/export/serializers/csvSerializer.js +2 -2
- package/hooks/features/filter/useGridFilter.js +3 -3
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -2
- package/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/hooks/features/focus/useGridFocus.js +3 -3
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -16
- package/hooks/features/pagination/useGridPagination.js +3 -5
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -0
- package/hooks/features/rows/gridRowsSelector.d.ts +2 -2
- package/hooks/features/rows/gridRowsSelector.js +5 -5
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.js +8 -5
- package/hooks/features/rows/useGridRowsMeta.js +7 -4
- package/hooks/features/scroll/useGridScroll.js +8 -10
- package/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.js +15 -10
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +14 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +22 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +27 -42
- package/hooks/features/virtualization/useGridVirtualScroller.js +441 -438
- package/hooks/features/virtualization/useGridVirtualization.d.ts +8 -0
- package/hooks/features/virtualization/useGridVirtualization.js +8 -1
- package/hooks/utils/index.d.ts +3 -0
- package/hooks/utils/index.js +4 -1
- package/hooks/utils/useGridAriaAttributes.js +1 -2
- package/hooks/utils/useGridNativeEventListener.js +4 -9
- package/hooks/utils/useResizeObserver.d.ts +2 -0
- package/hooks/utils/useResizeObserver.js +36 -0
- package/hooks/utils/useRunOnce.d.ts +5 -0
- package/hooks/utils/useRunOnce.js +18 -0
- package/index.js +1 -1
- package/internals/index.d.ts +12 -9
- package/internals/index.js +9 -7
- package/legacy/DataGrid/DataGrid.js +6 -6
- package/legacy/DataGrid/useDataGridComponent.js +2 -1
- package/legacy/DataGrid/useDataGridProps.js +1 -0
- package/legacy/components/GridColumnHeaders.js +3 -11
- package/legacy/components/GridDetailPanels.js +4 -0
- package/legacy/components/GridHeaders.js +53 -0
- package/legacy/components/GridPinnedRows.js +4 -0
- package/legacy/components/GridRow.js +159 -98
- package/legacy/components/GridScrollbarFillerCell.js +36 -0
- package/legacy/components/base/GridBody.js +2 -114
- package/legacy/components/base/GridOverlays.js +10 -25
- package/legacy/components/cell/GridCell.js +69 -377
- package/legacy/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +7 -3
- package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +1 -2
- package/legacy/components/columnsManagement/GridColumnsManagement.js +300 -0
- package/legacy/components/columnsManagement/index.js +1 -0
- package/legacy/components/columnsManagement/utils.js +22 -0
- package/legacy/components/containers/GridRoot.js +18 -15
- package/legacy/components/containers/GridRootStyles.js +215 -137
- package/legacy/components/index.js +1 -0
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/legacy/components/panel/GridColumnsPanel.js +5 -233
- package/legacy/components/panel/GridPanel.js +3 -4
- package/legacy/components/panel/filterPanel/GridFilterForm.js +30 -13
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +49 -20
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +40 -21
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +40 -21
- package/legacy/components/toolbar/GridToolbarExport.js +6 -1
- package/legacy/components/toolbar/GridToolbarExportContainer.js +40 -21
- package/legacy/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/legacy/components/virtualization/GridBottomContainer.js +25 -0
- package/legacy/components/virtualization/GridMainContainer.js +20 -0
- package/legacy/components/virtualization/GridTopContainer.js +35 -0
- package/legacy/components/virtualization/GridVirtualScrollbar.js +129 -0
- package/legacy/components/virtualization/GridVirtualScroller.js +67 -16
- package/legacy/components/virtualization/GridVirtualScrollerFiller.js +70 -0
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/legacy/constants/defaultGridSlotsComponents.js +8 -3
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +4 -6
- package/legacy/hooks/core/gridCoreSelector.js +7 -0
- package/legacy/hooks/core/useGridApiInitialization.js +4 -0
- package/legacy/hooks/core/useGridInitialization.js +4 -0
- package/legacy/hooks/core/useGridRefs.js +13 -0
- package/legacy/hooks/core/useGridTheme.js +21 -0
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +7 -14
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +69 -181
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/legacy/hooks/features/columns/gridColumnsInterfaces.js +9 -1
- package/legacy/hooks/features/columns/gridColumnsSelector.js +62 -0
- package/legacy/hooks/features/columns/gridColumnsUtils.js +10 -16
- package/legacy/hooks/features/columns/index.js +2 -1
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +60 -59
- package/legacy/hooks/features/columns/useGridColumns.js +22 -23
- package/legacy/hooks/features/dimensions/gridDimensionsSelectors.js +3 -0
- package/legacy/hooks/features/dimensions/index.js +1 -0
- package/legacy/hooks/features/dimensions/useGridDimensions.js +226 -151
- package/legacy/hooks/features/export/serializers/csvSerializer.js +2 -2
- package/legacy/hooks/features/filter/useGridFilter.js +3 -3
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/legacy/hooks/features/focus/useGridFocus.js +3 -3
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -16
- package/legacy/hooks/features/pagination/useGridPagination.js +3 -5
- package/legacy/hooks/features/rows/gridRowsSelector.js +5 -5
- package/legacy/hooks/features/rows/gridRowsUtils.js +8 -5
- package/legacy/hooks/features/rows/useGridRowsMeta.js +7 -4
- package/legacy/hooks/features/scroll/useGridScroll.js +8 -10
- package/legacy/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/legacy/hooks/features/sorting/useGridSorting.js +15 -10
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +29 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +490 -483
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +8 -1
- package/legacy/hooks/utils/index.js +4 -1
- package/legacy/hooks/utils/useGridAriaAttributes.js +1 -2
- package/legacy/hooks/utils/useGridNativeEventListener.js +4 -9
- package/legacy/hooks/utils/useResizeObserver.js +36 -0
- package/legacy/hooks/utils/useRunOnce.js +18 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +9 -7
- package/legacy/locales/arSD.js +5 -6
- package/legacy/locales/beBY.js +5 -6
- package/legacy/locales/bgBG.js +5 -6
- package/legacy/locales/csCZ.js +5 -6
- package/legacy/locales/daDK.js +5 -6
- package/legacy/locales/deDE.js +5 -6
- package/legacy/locales/elGR.js +5 -6
- package/legacy/locales/esES.js +5 -6
- package/legacy/locales/faIR.js +5 -6
- package/legacy/locales/fiFI.js +5 -6
- package/legacy/locales/frFR.js +5 -6
- package/legacy/locales/heIL.js +5 -6
- package/legacy/locales/hrHR.js +160 -0
- package/legacy/locales/huHU.js +5 -6
- package/legacy/locales/index.js +4 -1
- package/legacy/locales/itIT.js +5 -6
- package/legacy/locales/jaJP.js +5 -6
- package/legacy/locales/koKR.js +5 -6
- package/legacy/locales/nbNO.js +5 -6
- package/legacy/locales/nlNL.js +5 -6
- package/legacy/locales/plPL.js +5 -6
- package/legacy/locales/ptBR.js +5 -6
- package/legacy/locales/ptPT.js +160 -0
- package/legacy/locales/roRO.js +5 -6
- package/legacy/locales/ruRU.js +5 -6
- package/legacy/locales/skSK.js +5 -6
- package/legacy/locales/svSE.js +5 -6
- package/legacy/locales/trTR.js +5 -6
- package/legacy/locales/ukUA.js +5 -6
- package/legacy/locales/urPK.js +5 -6
- package/legacy/locales/viVN.js +5 -6
- package/legacy/locales/zhCN.js +5 -6
- package/legacy/locales/zhHK.js +160 -0
- package/legacy/locales/zhTW.js +5 -6
- package/legacy/models/index.js +0 -1
- package/legacy/models/params/index.js +1 -2
- package/legacy/utils/utils.js +10 -1
- package/locales/arSD.js +5 -6
- package/locales/beBY.js +5 -6
- package/locales/bgBG.js +5 -6
- package/locales/csCZ.js +5 -6
- package/locales/daDK.js +5 -6
- package/locales/deDE.js +5 -6
- package/locales/elGR.js +5 -6
- package/locales/esES.js +5 -6
- package/locales/faIR.js +5 -6
- package/locales/fiFI.js +5 -6
- package/locales/frFR.js +5 -6
- package/locales/heIL.js +5 -6
- package/locales/hrHR.d.ts +1 -0
- package/locales/hrHR.js +148 -0
- package/locales/huHU.js +5 -6
- package/locales/index.d.ts +3 -0
- package/locales/index.js +4 -1
- package/locales/itIT.js +5 -6
- package/locales/jaJP.js +5 -6
- package/locales/koKR.js +5 -6
- package/locales/nbNO.js +5 -6
- package/locales/nlNL.js +5 -6
- package/locales/plPL.js +5 -6
- package/locales/ptBR.js +5 -6
- package/locales/ptPT.d.ts +1 -0
- package/locales/ptPT.js +148 -0
- package/locales/roRO.js +5 -6
- package/locales/ruRU.js +5 -6
- package/locales/skSK.js +5 -6
- package/locales/svSE.js +5 -6
- package/locales/trTR.js +5 -6
- package/locales/ukUA.js +5 -6
- package/locales/urPK.js +5 -6
- package/locales/viVN.js +5 -6
- package/locales/zhCN.js +5 -6
- package/locales/zhHK.d.ts +1 -0
- package/locales/zhHK.js +148 -0
- package/locales/zhTW.js +5 -6
- package/models/api/gridColumnGroupingApi.d.ts +2 -2
- package/models/api/gridCoreApi.d.ts +16 -16
- package/models/api/gridLocaleTextApi.d.ts +3 -5
- package/models/api/gridRowsMetaApi.d.ts +1 -1
- package/models/api/gridVirtualizationApi.d.ts +2 -3
- package/models/colDef/gridColType.d.ts +11 -2
- package/models/events/gridEventLookup.d.ts +3 -3
- package/models/gridFilterModel.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +21 -2
- package/models/gridSlotsComponentsProps.d.ts +4 -0
- package/models/gridStateCommunity.d.ts +5 -1
- package/models/index.d.ts +0 -1
- package/models/index.js +0 -1
- package/models/params/index.d.ts +0 -1
- package/models/params/index.js +1 -2
- package/models/props/DataGridProps.d.ts +6 -11
- package/modern/DataGrid/DataGrid.js +6 -6
- package/modern/DataGrid/useDataGridComponent.js +2 -1
- package/modern/DataGrid/useDataGridProps.js +1 -0
- package/modern/components/GridColumnHeaders.js +3 -11
- package/modern/components/GridDetailPanels.js +4 -0
- package/modern/components/GridHeaders.js +53 -0
- package/modern/components/GridPinnedRows.js +4 -0
- package/modern/components/GridRow.js +159 -96
- package/modern/components/GridScrollbarFillerCell.js +39 -0
- package/modern/components/base/GridBody.js +2 -116
- package/modern/components/base/GridOverlays.js +10 -16
- package/modern/components/cell/GridCell.js +65 -369
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +7 -3
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/modern/components/columnsManagement/GridColumnsManagement.js +256 -0
- package/modern/components/columnsManagement/index.js +1 -0
- package/modern/components/columnsManagement/utils.js +16 -0
- package/modern/components/containers/GridRoot.js +18 -14
- package/modern/components/containers/GridRootStyles.js +307 -204
- package/modern/components/index.js +1 -0
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/modern/components/panel/GridColumnsPanel.js +4 -209
- package/modern/components/panel/GridPanel.js +3 -4
- package/modern/components/panel/filterPanel/GridFilterForm.js +30 -13
- package/modern/components/panel/filterPanel/GridFilterPanel.js +46 -20
- package/modern/components/toolbar/GridToolbarColumnsButton.js +38 -21
- package/modern/components/toolbar/GridToolbarDensitySelector.js +38 -21
- package/modern/components/toolbar/GridToolbarExport.js +6 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +39 -22
- package/modern/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/modern/components/virtualization/GridBottomContainer.js +25 -0
- package/modern/components/virtualization/GridMainContainer.js +20 -0
- package/modern/components/virtualization/GridTopContainer.js +35 -0
- package/modern/components/virtualization/GridVirtualScrollbar.js +131 -0
- package/modern/components/virtualization/GridVirtualScroller.js +69 -16
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +71 -0
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/modern/constants/defaultGridSlotsComponents.js +8 -3
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +4 -6
- package/modern/hooks/core/gridCoreSelector.js +5 -0
- package/modern/hooks/core/useGridApiInitialization.js +3 -0
- package/modern/hooks/core/useGridInitialization.js +4 -0
- package/modern/hooks/core/useGridRefs.js +13 -0
- package/modern/hooks/core/useGridTheme.js +19 -0
- package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +5 -12
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +67 -160
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/modern/hooks/features/columns/gridColumnsInterfaces.js +9 -1
- package/modern/hooks/features/columns/gridColumnsSelector.js +51 -0
- package/modern/hooks/features/columns/gridColumnsUtils.js +10 -12
- package/modern/hooks/features/columns/index.js +2 -1
- package/modern/hooks/features/columns/useGridColumnSpanning.js +62 -61
- package/modern/hooks/features/columns/useGridColumns.js +19 -21
- package/modern/hooks/features/dimensions/gridDimensionsSelectors.js +1 -0
- package/modern/hooks/features/dimensions/index.js +1 -0
- package/modern/hooks/features/dimensions/useGridDimensions.js +214 -146
- package/modern/hooks/features/export/serializers/csvSerializer.js +2 -2
- package/modern/hooks/features/filter/useGridFilter.js +3 -3
- package/modern/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/modern/hooks/features/focus/useGridFocus.js +3 -3
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -16
- package/modern/hooks/features/pagination/useGridPagination.js +3 -5
- package/modern/hooks/features/rows/gridRowsSelector.js +2 -2
- package/modern/hooks/features/rows/gridRowsUtils.js +8 -5
- package/modern/hooks/features/rows/useGridRowsMeta.js +7 -4
- package/modern/hooks/features/scroll/useGridScroll.js +8 -9
- package/modern/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/modern/hooks/features/sorting/useGridSorting.js +15 -10
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +22 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +435 -432
- package/modern/hooks/features/virtualization/useGridVirtualization.js +8 -1
- package/modern/hooks/utils/index.js +4 -1
- package/modern/hooks/utils/useGridAriaAttributes.js +1 -1
- package/modern/hooks/utils/useGridNativeEventListener.js +3 -9
- package/modern/hooks/utils/useResizeObserver.js +36 -0
- package/modern/hooks/utils/useRunOnce.js +18 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +9 -7
- package/modern/locales/arSD.js +5 -6
- package/modern/locales/beBY.js +5 -6
- package/modern/locales/bgBG.js +5 -6
- package/modern/locales/csCZ.js +5 -6
- package/modern/locales/daDK.js +5 -6
- package/modern/locales/deDE.js +5 -6
- package/modern/locales/elGR.js +5 -6
- package/modern/locales/esES.js +5 -6
- package/modern/locales/faIR.js +5 -6
- package/modern/locales/fiFI.js +5 -6
- package/modern/locales/frFR.js +5 -6
- package/modern/locales/heIL.js +5 -6
- package/modern/locales/hrHR.js +148 -0
- package/modern/locales/huHU.js +5 -6
- package/modern/locales/index.js +4 -1
- package/modern/locales/itIT.js +5 -6
- package/modern/locales/jaJP.js +5 -6
- package/modern/locales/koKR.js +5 -6
- package/modern/locales/nbNO.js +5 -6
- package/modern/locales/nlNL.js +5 -6
- package/modern/locales/plPL.js +5 -6
- package/modern/locales/ptBR.js +5 -6
- package/modern/locales/ptPT.js +148 -0
- package/modern/locales/roRO.js +5 -6
- package/modern/locales/ruRU.js +5 -6
- package/modern/locales/skSK.js +5 -6
- package/modern/locales/svSE.js +5 -6
- package/modern/locales/trTR.js +5 -6
- package/modern/locales/ukUA.js +5 -6
- package/modern/locales/urPK.js +5 -6
- package/modern/locales/viVN.js +5 -6
- package/modern/locales/zhCN.js +5 -6
- package/modern/locales/zhHK.js +148 -0
- package/modern/locales/zhTW.js +5 -6
- package/modern/models/index.js +0 -1
- package/modern/models/params/index.js +1 -2
- package/modern/utils/utils.js +10 -1
- package/node/DataGrid/DataGrid.js +6 -6
- package/node/DataGrid/useDataGridComponent.js +1 -0
- package/node/DataGrid/useDataGridProps.js +1 -0
- package/node/components/GridColumnHeaders.js +3 -11
- package/node/components/GridDetailPanels.js +10 -0
- package/node/components/GridHeaders.js +60 -0
- package/node/components/GridPinnedRows.js +10 -0
- package/node/components/GridRow.js +157 -94
- package/node/components/GridScrollbarFillerCell.js +47 -0
- package/node/components/base/GridBody.js +7 -118
- package/node/components/base/GridOverlays.js +9 -15
- package/node/components/cell/GridCell.js +66 -369
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/node/components/columnHeaders/GridColumnHeaderItem.js +8 -4
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/node/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/node/components/columnsManagement/GridColumnsManagement.js +264 -0
- package/node/components/columnsManagement/index.js +16 -0
- package/node/components/columnsManagement/utils.js +24 -0
- package/node/components/containers/GridRoot.js +17 -14
- package/node/components/containers/GridRootStyles.js +175 -72
- package/node/components/index.js +11 -0
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/node/components/panel/GridColumnsPanel.js +4 -208
- package/node/components/panel/GridPanel.js +3 -4
- package/node/components/panel/filterPanel/GridFilterForm.js +29 -12
- package/node/components/panel/filterPanel/GridFilterPanel.js +45 -19
- package/node/components/toolbar/GridToolbarColumnsButton.js +36 -20
- package/node/components/toolbar/GridToolbarDensitySelector.js +36 -20
- package/node/components/toolbar/GridToolbarExport.js +6 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +37 -21
- package/node/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/node/components/virtualization/GridBottomContainer.js +34 -0
- package/node/components/{containers → virtualization}/GridMainContainer.js +7 -29
- package/node/components/virtualization/GridTopContainer.js +44 -0
- package/node/components/virtualization/GridVirtualScrollbar.js +138 -0
- package/node/components/virtualization/GridVirtualScroller.js +69 -17
- package/node/components/virtualization/GridVirtualScrollerFiller.js +77 -0
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/node/constants/defaultGridSlotsComponents.js +6 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +4 -6
- package/node/hooks/core/gridCoreSelector.js +12 -0
- package/node/hooks/core/useGridApiInitialization.js +3 -0
- package/node/hooks/core/useGridInitialization.js +4 -0
- package/node/hooks/core/useGridRefs.js +22 -0
- package/node/hooks/core/useGridTheme.js +29 -0
- package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +5 -12
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +65 -159
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/node/hooks/features/columns/gridColumnsInterfaces.js +11 -1
- package/node/hooks/features/columns/gridColumnsSelector.js +52 -1
- package/node/hooks/features/columns/gridColumnsUtils.js +10 -13
- package/node/hooks/features/columns/index.js +22 -61
- package/node/hooks/features/columns/useGridColumnSpanning.js +62 -61
- package/node/hooks/features/columns/useGridColumns.js +20 -22
- package/node/hooks/features/dimensions/gridDimensionsSelectors.js +8 -0
- package/node/hooks/features/dimensions/index.js +11 -0
- package/node/hooks/features/dimensions/useGridDimensions.js +215 -144
- package/node/hooks/features/export/serializers/csvSerializer.js +2 -2
- package/node/hooks/features/filter/useGridFilter.js +2 -2
- package/node/hooks/features/focus/gridFocusStateSelector.js +3 -7
- package/node/hooks/features/focus/useGridFocus.js +2 -2
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -15
- package/node/hooks/features/pagination/useGridPagination.js +3 -5
- package/node/hooks/features/rows/gridRowsSelector.js +2 -2
- package/node/hooks/features/rows/gridRowsUtils.js +8 -5
- package/node/hooks/features/rows/useGridRowsMeta.js +5 -3
- package/node/hooks/features/scroll/useGridScroll.js +8 -9
- package/node/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/node/hooks/features/sorting/useGridSorting.js +15 -10
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +22 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +434 -431
- package/node/hooks/features/virtualization/useGridVirtualization.js +9 -1
- package/node/hooks/utils/index.js +36 -0
- package/node/hooks/utils/useGridAriaAttributes.js +1 -1
- package/node/hooks/utils/useGridNativeEventListener.js +3 -9
- package/node/hooks/utils/useResizeObserver.js +44 -0
- package/node/hooks/utils/useRunOnce.js +27 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +86 -71
- package/node/locales/arSD.js +5 -6
- package/node/locales/beBY.js +5 -6
- package/node/locales/bgBG.js +5 -6
- package/node/locales/csCZ.js +5 -6
- package/node/locales/daDK.js +5 -6
- package/node/locales/deDE.js +5 -6
- package/node/locales/elGR.js +5 -6
- package/node/locales/esES.js +5 -6
- package/node/locales/faIR.js +5 -6
- package/node/locales/fiFI.js +5 -6
- package/node/locales/frFR.js +5 -6
- package/node/locales/heIL.js +5 -6
- package/node/locales/hrHR.js +154 -0
- package/node/locales/huHU.js +5 -6
- package/node/locales/index.js +33 -0
- package/node/locales/itIT.js +5 -6
- package/node/locales/jaJP.js +5 -6
- package/node/locales/koKR.js +5 -6
- package/node/locales/nbNO.js +5 -6
- package/node/locales/nlNL.js +5 -6
- package/node/locales/plPL.js +5 -6
- package/node/locales/ptBR.js +5 -6
- package/node/locales/ptPT.js +154 -0
- package/node/locales/roRO.js +5 -6
- package/node/locales/ruRU.js +5 -6
- package/node/locales/skSK.js +5 -6
- package/node/locales/svSE.js +5 -6
- package/node/locales/trTR.js +5 -6
- package/node/locales/ukUA.js +5 -6
- package/node/locales/urPK.js +5 -6
- package/node/locales/viVN.js +5 -6
- package/node/locales/zhCN.js +5 -6
- package/node/locales/zhHK.js +154 -0
- package/node/locales/zhTW.js +5 -6
- package/node/models/index.js +0 -11
- package/node/models/params/index.js +0 -11
- package/node/utils/utils.js +11 -1
- package/package.json +6 -6
- package/utils/utils.d.ts +6 -0
- package/utils/utils.js +10 -1
- package/components/DataGridVirtualScroller.d.ts +0 -3
- package/components/DataGridVirtualScroller.js +0 -35
- package/components/containers/GridMainContainer.js +0 -43
- package/legacy/components/DataGridVirtualScroller.js +0 -32
- package/legacy/components/containers/GridMainContainer.js +0 -45
- package/legacy/models/gridRootContainerRef.js +0 -1
- package/legacy/models/params/gridRenderedRowsIntervalChangeParams.js +0 -1
- package/models/gridRootContainerRef.d.ts +0 -5
- package/models/gridRootContainerRef.js +0 -1
- package/models/params/gridRenderedRowsIntervalChangeParams.d.ts +0 -10
- package/models/params/gridRenderedRowsIntervalChangeParams.js +0 -1
- package/modern/components/DataGridVirtualScroller.js +0 -35
- package/modern/components/containers/GridMainContainer.js +0 -42
- package/modern/models/gridRootContainerRef.js +0 -1
- package/modern/models/params/gridRenderedRowsIntervalChangeParams.js +0 -1
- package/node/components/DataGridVirtualScroller.js +0 -42
- package/node/models/gridRootContainerRef.js +0 -5
- package/node/models/params/gridRenderedRowsIntervalChangeParams.js +0 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { alpha, styled, darken, lighten } from '@mui/material/styles';
|
|
3
|
-
import { gridClasses } from '../../constants/gridClasses';
|
|
2
|
+
import { alpha, styled, darken, lighten, decomposeColor, recomposeColor } from '@mui/material/styles';
|
|
3
|
+
import { gridClasses as c } from '../../constants/gridClasses';
|
|
4
4
|
function getBorderColor(theme) {
|
|
5
5
|
if (theme.vars) {
|
|
6
6
|
return theme.vars.palette.TableCell.border;
|
|
@@ -11,17 +11,17 @@ function getBorderColor(theme) {
|
|
|
11
11
|
return darken(alpha(theme.palette.divider, 1), 0.68);
|
|
12
12
|
}
|
|
13
13
|
const columnHeadersStyles = {
|
|
14
|
-
[`.${
|
|
14
|
+
[`.${c.columnSeparator}, .${c['columnSeparator--resizing']}`]: {
|
|
15
15
|
visibility: 'visible',
|
|
16
16
|
width: 'auto'
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
const columnHeaderStyles = {
|
|
20
|
-
[`& .${
|
|
20
|
+
[`& .${c.iconButtonContainer}`]: {
|
|
21
21
|
visibility: 'visible',
|
|
22
22
|
width: 'auto'
|
|
23
23
|
},
|
|
24
|
-
[`& .${
|
|
24
|
+
[`& .${c.menuIcon}`]: {
|
|
25
25
|
width: 'auto',
|
|
26
26
|
visibility: 'visible'
|
|
27
27
|
}
|
|
@@ -30,138 +30,179 @@ export const GridRootStyles = styled('div', {
|
|
|
30
30
|
name: 'MuiDataGrid',
|
|
31
31
|
slot: 'Root',
|
|
32
32
|
overridesResolver: (props, styles) => [{
|
|
33
|
-
[`&.${
|
|
33
|
+
[`&.${c.autoHeight}`]: styles.autoHeight
|
|
34
34
|
}, {
|
|
35
|
-
[`&.${
|
|
35
|
+
[`&.${c.aggregationColumnHeader}`]: styles.aggregationColumnHeader
|
|
36
36
|
}, {
|
|
37
|
-
[`&.${
|
|
37
|
+
[`&.${c['aggregationColumnHeader--alignLeft']}`]: styles['aggregationColumnHeader--alignLeft']
|
|
38
38
|
}, {
|
|
39
|
-
[`&.${
|
|
39
|
+
[`&.${c['aggregationColumnHeader--alignCenter']}`]: styles['aggregationColumnHeader--alignCenter']
|
|
40
40
|
}, {
|
|
41
|
-
[`&.${
|
|
41
|
+
[`&.${c['aggregationColumnHeader--alignRight']}`]: styles['aggregationColumnHeader--alignRight']
|
|
42
42
|
}, {
|
|
43
|
-
[`&.${
|
|
43
|
+
[`&.${c.aggregationColumnHeaderLabel}`]: styles.aggregationColumnHeaderLabel
|
|
44
44
|
}, {
|
|
45
|
-
[`&.${
|
|
45
|
+
[`&.${c['root--disableUserSelection']} .${c.cell}`]: styles['root--disableUserSelection']
|
|
46
46
|
}, {
|
|
47
|
-
[`&.${
|
|
47
|
+
[`&.${c.autosizing}`]: styles.autosizing
|
|
48
48
|
}, {
|
|
49
|
-
[`& .${
|
|
49
|
+
[`& .${c.editBooleanCell}`]: styles.editBooleanCell
|
|
50
50
|
}, {
|
|
51
|
-
[`& .${
|
|
51
|
+
[`& .${c['cell--editing']}`]: styles['cell--editing']
|
|
52
52
|
}, {
|
|
53
|
-
[`& .${
|
|
53
|
+
[`& .${c['cell--textCenter']}`]: styles['cell--textCenter']
|
|
54
54
|
}, {
|
|
55
|
-
[`& .${
|
|
55
|
+
[`& .${c['cell--textLeft']}`]: styles['cell--textLeft']
|
|
56
56
|
}, {
|
|
57
|
-
[`& .${
|
|
57
|
+
[`& .${c['cell--textRight']}`]: styles['cell--textRight']
|
|
58
58
|
},
|
|
59
59
|
// TODO v6: Remove
|
|
60
60
|
{
|
|
61
|
-
[`& .${
|
|
61
|
+
[`& .${c['cell--withRenderer']}`]: styles['cell--withRenderer']
|
|
62
62
|
}, {
|
|
63
|
-
[`& .${
|
|
63
|
+
[`& .${c.cell}`]: styles.cell
|
|
64
64
|
}, {
|
|
65
|
-
[`& .${
|
|
65
|
+
[`& .${c['cell--rangeTop']}`]: styles['cell--rangeTop']
|
|
66
66
|
}, {
|
|
67
|
-
[`& .${
|
|
67
|
+
[`& .${c['cell--rangeBottom']}`]: styles['cell--rangeBottom']
|
|
68
68
|
}, {
|
|
69
|
-
[`& .${
|
|
69
|
+
[`& .${c['cell--rangeLeft']}`]: styles['cell--rangeLeft']
|
|
70
70
|
}, {
|
|
71
|
-
[`& .${
|
|
71
|
+
[`& .${c['cell--rangeRight']}`]: styles['cell--rangeRight']
|
|
72
72
|
}, {
|
|
73
|
-
[`& .${
|
|
73
|
+
[`& .${c['cell--withRightBorder']}`]: styles['cell--withRightBorder']
|
|
74
74
|
}, {
|
|
75
|
-
[`& .${
|
|
75
|
+
[`& .${c.cellContent}`]: styles.cellContent
|
|
76
76
|
}, {
|
|
77
|
-
[`& .${
|
|
77
|
+
[`& .${c.cellCheckbox}`]: styles.cellCheckbox
|
|
78
78
|
}, {
|
|
79
|
-
[`& .${
|
|
79
|
+
[`& .${c.cellSkeleton}`]: styles.cellSkeleton
|
|
80
80
|
}, {
|
|
81
|
-
[`& .${
|
|
81
|
+
[`& .${c.checkboxInput}`]: styles.checkboxInput
|
|
82
82
|
}, {
|
|
83
|
-
[`& .${
|
|
83
|
+
[`& .${c['columnHeader--alignCenter']}`]: styles['columnHeader--alignCenter']
|
|
84
84
|
}, {
|
|
85
|
-
[`& .${
|
|
85
|
+
[`& .${c['columnHeader--alignLeft']}`]: styles['columnHeader--alignLeft']
|
|
86
86
|
}, {
|
|
87
|
-
[`& .${
|
|
87
|
+
[`& .${c['columnHeader--alignRight']}`]: styles['columnHeader--alignRight']
|
|
88
88
|
}, {
|
|
89
|
-
[`& .${
|
|
89
|
+
[`& .${c['columnHeader--dragging']}`]: styles['columnHeader--dragging']
|
|
90
90
|
}, {
|
|
91
|
-
[`& .${
|
|
91
|
+
[`& .${c['columnHeader--moving']}`]: styles['columnHeader--moving']
|
|
92
92
|
}, {
|
|
93
|
-
[`& .${
|
|
93
|
+
[`& .${c['columnHeader--numeric']}`]: styles['columnHeader--numeric']
|
|
94
94
|
}, {
|
|
95
|
-
[`& .${
|
|
95
|
+
[`& .${c['columnHeader--sortable']}`]: styles['columnHeader--sortable']
|
|
96
96
|
}, {
|
|
97
|
-
[`& .${
|
|
97
|
+
[`& .${c['columnHeader--sorted']}`]: styles['columnHeader--sorted']
|
|
98
98
|
}, {
|
|
99
|
-
[`& .${
|
|
99
|
+
[`& .${c['columnHeader--withRightBorder']}`]: styles['columnHeader--withRightBorder']
|
|
100
100
|
}, {
|
|
101
|
-
[`& .${
|
|
101
|
+
[`& .${c.columnHeader}`]: styles.columnHeader
|
|
102
102
|
}, {
|
|
103
|
-
[`& .${
|
|
103
|
+
[`& .${c.headerFilterRow}`]: styles.headerFilterRow
|
|
104
104
|
}, {
|
|
105
|
-
[`& .${
|
|
105
|
+
[`& .${c.columnHeaderCheckbox}`]: styles.columnHeaderCheckbox
|
|
106
106
|
}, {
|
|
107
|
-
[`& .${
|
|
107
|
+
[`& .${c.columnHeaderDraggableContainer}`]: styles.columnHeaderDraggableContainer
|
|
108
108
|
}, {
|
|
109
|
-
[`& .${
|
|
109
|
+
[`& .${c.columnHeaderTitleContainer}`]: styles.columnHeaderTitleContainer
|
|
110
110
|
}, {
|
|
111
|
-
[`& .${
|
|
111
|
+
[`& .${c['columnSeparator--resizable']}`]: styles['columnSeparator--resizable']
|
|
112
112
|
}, {
|
|
113
|
-
[`& .${
|
|
113
|
+
[`& .${c['columnSeparator--resizing']}`]: styles['columnSeparator--resizing']
|
|
114
114
|
}, {
|
|
115
|
-
[`& .${
|
|
115
|
+
[`& .${c.columnSeparator}`]: styles.columnSeparator
|
|
116
116
|
}, {
|
|
117
|
-
[`& .${
|
|
117
|
+
[`& .${c.filterIcon}`]: styles.filterIcon
|
|
118
118
|
}, {
|
|
119
|
-
[`& .${
|
|
119
|
+
[`& .${c.iconSeparator}`]: styles.iconSeparator
|
|
120
120
|
}, {
|
|
121
|
-
[`& .${
|
|
121
|
+
[`& .${c.menuIcon}`]: styles.menuIcon
|
|
122
122
|
}, {
|
|
123
|
-
[`& .${
|
|
123
|
+
[`& .${c.menuIconButton}`]: styles.menuIconButton
|
|
124
124
|
}, {
|
|
125
|
-
[`& .${
|
|
125
|
+
[`& .${c.menuOpen}`]: styles.menuOpen
|
|
126
126
|
}, {
|
|
127
|
-
[`& .${
|
|
127
|
+
[`& .${c.menuList}`]: styles.menuList
|
|
128
128
|
}, {
|
|
129
|
-
[`& .${
|
|
129
|
+
[`& .${c['row--editable']}`]: styles['row--editable']
|
|
130
130
|
}, {
|
|
131
|
-
[`& .${
|
|
131
|
+
[`& .${c['row--editing']}`]: styles['row--editing']
|
|
132
132
|
}, {
|
|
133
|
-
[`& .${
|
|
133
|
+
[`& .${c['row--dragging']}`]: styles['row--dragging']
|
|
134
134
|
}, {
|
|
135
|
-
[`& .${
|
|
135
|
+
[`& .${c.row}`]: styles.row
|
|
136
136
|
}, {
|
|
137
|
-
[`& .${
|
|
137
|
+
[`& .${c.rowReorderCellPlaceholder}`]: styles.rowReorderCellPlaceholder
|
|
138
138
|
}, {
|
|
139
|
-
[`& .${
|
|
139
|
+
[`& .${c.rowReorderCell}`]: styles.rowReorderCell
|
|
140
140
|
}, {
|
|
141
|
-
[`& .${
|
|
141
|
+
[`& .${c['rowReorderCell--draggable']}`]: styles['rowReorderCell--draggable']
|
|
142
142
|
}, {
|
|
143
|
-
[`& .${
|
|
143
|
+
[`& .${c.sortIcon}`]: styles.sortIcon
|
|
144
144
|
}, {
|
|
145
|
-
[`& .${
|
|
145
|
+
[`& .${c.withBorderColor}`]: styles.withBorderColor
|
|
146
146
|
}, {
|
|
147
|
-
[`& .${
|
|
147
|
+
[`& .${c.treeDataGroupingCell}`]: styles.treeDataGroupingCell
|
|
148
148
|
}, {
|
|
149
|
-
[`& .${
|
|
149
|
+
[`& .${c.treeDataGroupingCellToggle}`]: styles.treeDataGroupingCellToggle
|
|
150
150
|
}, {
|
|
151
|
-
[`& .${
|
|
151
|
+
[`& .${c.detailPanelToggleCell}`]: styles.detailPanelToggleCell
|
|
152
152
|
}, {
|
|
153
|
-
[`& .${
|
|
153
|
+
[`& .${c['detailPanelToggleCell--expanded']}`]: styles['detailPanelToggleCell--expanded']
|
|
154
154
|
}, styles.root]
|
|
155
155
|
})(({
|
|
156
|
-
theme
|
|
156
|
+
theme: t
|
|
157
157
|
}) => {
|
|
158
|
-
const borderColor = getBorderColor(
|
|
159
|
-
const radius =
|
|
158
|
+
const borderColor = getBorderColor(t);
|
|
159
|
+
const radius = t.shape.borderRadius;
|
|
160
|
+
const containerBackground = t.vars ? t.vars.palette.background.default : t.palette.background.default;
|
|
161
|
+
const pinnedBackground = containerBackground;
|
|
162
|
+
const overlayBackground = t.vars ? `rgba(${t.vars.palette.background.defaultChannel} / ${t.vars.palette.action.disabledOpacity})` : alpha(t.palette.background.default, t.palette.action.disabledOpacity);
|
|
163
|
+
const hoverOpacity = (t.vars || t).palette.action.hoverOpacity;
|
|
164
|
+
const hoverColor = (t.vars || t).palette.action.hover;
|
|
165
|
+
const selectedOpacity = (t.vars || t).palette.action.selectedOpacity;
|
|
166
|
+
const selectedBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedOpacity})` : alpha(t.palette.primary.main, selectedOpacity);
|
|
167
|
+
const selectedHoverBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / calc(
|
|
168
|
+
${t.vars.palette.action.selectedOpacity} +
|
|
169
|
+
${t.vars.palette.action.hoverOpacity}
|
|
170
|
+
))` : alpha(t.palette.primary.main, t.palette.action.selectedOpacity + t.palette.action.hoverOpacity);
|
|
171
|
+
const pinnedHoverBackground = t.vars ? hoverColor : blend(pinnedBackground, hoverColor, hoverOpacity);
|
|
172
|
+
const pinnedSelectedBackground = t.vars ? selectedBackground : blend(pinnedBackground, selectedBackground, selectedOpacity);
|
|
173
|
+
const pinnedSelectedHoverBackground = t.vars ? hoverColor : blend(pinnedSelectedBackground, hoverColor, hoverOpacity);
|
|
174
|
+
const selectedStyles = {
|
|
175
|
+
backgroundColor: selectedBackground,
|
|
176
|
+
'&:hover': {
|
|
177
|
+
backgroundColor: selectedHoverBackground,
|
|
178
|
+
// Reset on touch devices, it doesn't add specificity
|
|
179
|
+
'@media (hover: none)': {
|
|
180
|
+
backgroundColor: selectedBackground
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
160
184
|
const gridStyle = _extends({
|
|
161
185
|
'--unstable_DataGrid-radius': typeof radius === 'number' ? `${radius}px` : radius,
|
|
162
|
-
'--unstable_DataGrid-headWeight':
|
|
163
|
-
'--unstable_DataGrid-overlayBackground':
|
|
186
|
+
'--unstable_DataGrid-headWeight': t.typography.fontWeightMedium,
|
|
187
|
+
'--unstable_DataGrid-overlayBackground': overlayBackground,
|
|
188
|
+
'--DataGrid-containerBackground': containerBackground,
|
|
189
|
+
'--DataGrid-pinnedBackground': pinnedBackground,
|
|
190
|
+
'--DataGrid-rowBorderColor': borderColor,
|
|
164
191
|
'--DataGrid-cellOffsetMultiplier': 2,
|
|
192
|
+
'--DataGrid-width': '0px',
|
|
193
|
+
'--DataGrid-hasScrollX': '0',
|
|
194
|
+
'--DataGrid-hasScrollY': '0',
|
|
195
|
+
'--DataGrid-offsetTop': '0px',
|
|
196
|
+
'--DataGrid-offsetLeft': '0px',
|
|
197
|
+
'--DataGrid-scrollbarSize': '10px',
|
|
198
|
+
'--DataGrid-rowWidth': '0px',
|
|
199
|
+
'--DataGrid-columnsTotalWidth': '0px',
|
|
200
|
+
'--DataGrid-leftPinnedWidth': '0px',
|
|
201
|
+
'--DataGrid-rightPinnedWidth': '0px',
|
|
202
|
+
'--DataGrid-headerHeight': '0px',
|
|
203
|
+
'--DataGrid-headersTotalHeight': '0px',
|
|
204
|
+
'--DataGrid-topContainerHeight': '0px',
|
|
205
|
+
'--DataGrid-bottomContainerHeight': '0px',
|
|
165
206
|
flex: 1,
|
|
166
207
|
boxSizing: 'border-box',
|
|
167
208
|
position: 'relative',
|
|
@@ -169,8 +210,8 @@ export const GridRootStyles = styled('div', {
|
|
|
169
210
|
borderStyle: 'solid',
|
|
170
211
|
borderColor,
|
|
171
212
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
172
|
-
color: (
|
|
173
|
-
},
|
|
213
|
+
color: (t.vars || t).palette.text.primary
|
|
214
|
+
}, t.typography.body2, {
|
|
174
215
|
outline: 'none',
|
|
175
216
|
height: '100%',
|
|
176
217
|
display: 'flex',
|
|
@@ -180,59 +221,63 @@ export const GridRootStyles = styled('div', {
|
|
|
180
221
|
flexDirection: 'column',
|
|
181
222
|
overflowAnchor: 'none',
|
|
182
223
|
// Keep the same scrolling position
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
224
|
+
// The selector we really want here is `:first-child`, but emotion thinks it knows better than use what we
|
|
225
|
+
// want and prints a warning to the console if we use it, about :first-child being "unsafe" in an SSR context.
|
|
226
|
+
// https://github.com/emotion-js/emotion/issues/1105
|
|
227
|
+
// Using `:first-of-type instead` is ironically less "safe" because if all our elements aren't `div`, this style
|
|
228
|
+
// will fail to apply.
|
|
229
|
+
[`.${c.main} > *:first-of-type`]: {
|
|
230
|
+
borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',
|
|
231
|
+
borderTopRightRadius: 'var(--unstable_DataGrid-radius)'
|
|
232
|
+
},
|
|
233
|
+
[`&.${c.autoHeight}`]: {
|
|
234
|
+
height: 'auto'
|
|
235
|
+
},
|
|
236
|
+
[`&.${c.autosizing}`]: {
|
|
237
|
+
[`& .${c.columnHeaderTitleContainerContent} > *`]: {
|
|
191
238
|
overflow: 'visible !important'
|
|
192
239
|
},
|
|
193
|
-
[`& .${
|
|
240
|
+
[`& .${c.cell} > *`]: {
|
|
194
241
|
overflow: 'visible !important',
|
|
195
242
|
whiteSpace: 'nowrap'
|
|
196
243
|
}
|
|
197
244
|
},
|
|
198
|
-
[`& .${
|
|
199
|
-
borderBottomColor: 'transparent'
|
|
200
|
-
},
|
|
201
|
-
[`& .${gridClasses.columnHeader}, & .${gridClasses.cell}`]: {
|
|
245
|
+
[`& .${c.columnHeader}, & .${c.cell}`]: {
|
|
202
246
|
WebkitTapHighlightColor: 'transparent',
|
|
203
247
|
lineHeight: null,
|
|
204
248
|
padding: '0 10px',
|
|
205
249
|
boxSizing: 'border-box'
|
|
206
250
|
},
|
|
207
|
-
[`& .${
|
|
208
|
-
outline: `solid ${
|
|
251
|
+
[`& .${c.columnHeader}:focus-within, & .${c.cell}:focus-within`]: {
|
|
252
|
+
outline: `solid ${t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / 0.5)` : alpha(t.palette.primary.main, 0.5)} 1px`,
|
|
209
253
|
outlineWidth: 1,
|
|
210
254
|
outlineOffset: -1
|
|
211
255
|
},
|
|
212
|
-
[`& .${
|
|
213
|
-
outline: `solid ${
|
|
256
|
+
[`& .${c.columnHeader}:focus, & .${c.cell}:focus`]: {
|
|
257
|
+
outline: `solid ${t.palette.primary.main} 1px`
|
|
214
258
|
},
|
|
215
|
-
[`& .${
|
|
259
|
+
[`& .${c.columnHeaderCheckbox}, & .${c.cellCheckbox}`]: {
|
|
216
260
|
padding: 0,
|
|
217
261
|
justifyContent: 'center',
|
|
218
262
|
alignItems: 'center'
|
|
219
263
|
},
|
|
220
|
-
[`& .${
|
|
264
|
+
[`& .${c.columnHeader}`]: {
|
|
221
265
|
position: 'relative',
|
|
222
266
|
display: 'flex',
|
|
223
|
-
alignItems: 'center'
|
|
267
|
+
alignItems: 'center',
|
|
268
|
+
overflow: 'hidden'
|
|
224
269
|
},
|
|
225
|
-
[`& .${
|
|
270
|
+
[`& .${c['columnHeader--sorted']} .${c.iconButtonContainer}, & .${c['columnHeader--filtered']} .${c.iconButtonContainer}`]: {
|
|
226
271
|
visibility: 'visible',
|
|
227
272
|
width: 'auto'
|
|
228
273
|
},
|
|
229
|
-
[`& .${
|
|
274
|
+
[`& .${c.columnHeader}:not(.${c['columnHeader--sorted']}) .${c.sortIcon}`]: {
|
|
230
275
|
opacity: 0,
|
|
231
|
-
transition:
|
|
232
|
-
duration:
|
|
276
|
+
transition: t.transitions.create(['opacity'], {
|
|
277
|
+
duration: t.transitions.duration.shorter
|
|
233
278
|
})
|
|
234
279
|
},
|
|
235
|
-
[`& .${
|
|
280
|
+
[`& .${c.columnHeaderTitleContainer}`]: {
|
|
236
281
|
display: 'flex',
|
|
237
282
|
alignItems: 'center',
|
|
238
283
|
minWidth: 0,
|
|
@@ -242,51 +287,48 @@ export const GridRootStyles = styled('div', {
|
|
|
242
287
|
// to anchor the aggregation label
|
|
243
288
|
position: 'relative'
|
|
244
289
|
},
|
|
245
|
-
[`& .${
|
|
290
|
+
[`& .${c.columnHeaderTitleContainerContent}`]: {
|
|
246
291
|
overflow: 'hidden',
|
|
247
292
|
display: 'flex',
|
|
248
293
|
alignItems: 'center'
|
|
249
294
|
},
|
|
250
|
-
[`& .${
|
|
295
|
+
[`& .${c['columnHeader--filledGroup']} .${c.columnHeaderTitleContainer}`]: {
|
|
251
296
|
borderBottomWidth: '1px',
|
|
252
297
|
borderBottomStyle: 'solid',
|
|
253
298
|
boxSizing: 'border-box'
|
|
254
299
|
},
|
|
255
|
-
[`& .${
|
|
300
|
+
[`& .${c['columnHeader--filledGroup']}.${c['columnHeader--showColumnBorder']} .${c.columnHeaderTitleContainer}`]: {
|
|
256
301
|
borderBottom: `none`
|
|
257
302
|
},
|
|
258
|
-
[`& .${
|
|
303
|
+
[`& .${c['columnHeader--filledGroup']}.${c['columnHeader--showColumnBorder']}`]: {
|
|
259
304
|
borderBottomWidth: '1px',
|
|
260
305
|
borderBottomStyle: 'solid',
|
|
261
306
|
boxSizing: 'border-box'
|
|
262
307
|
},
|
|
263
|
-
[`& .${
|
|
264
|
-
borderTop: `1px solid ${borderColor}`
|
|
265
|
-
},
|
|
266
|
-
[`& .${gridClasses.sortIcon}, & .${gridClasses.filterIcon}`]: {
|
|
308
|
+
[`& .${c.sortIcon}, & .${c.filterIcon}`]: {
|
|
267
309
|
fontSize: 'inherit'
|
|
268
310
|
},
|
|
269
|
-
[`& .${
|
|
311
|
+
[`& .${c['columnHeader--sortable']}`]: {
|
|
270
312
|
cursor: 'pointer'
|
|
271
313
|
},
|
|
272
|
-
[`& .${
|
|
314
|
+
[`& .${c['columnHeader--alignCenter']} .${c.columnHeaderTitleContainer}`]: {
|
|
273
315
|
justifyContent: 'center'
|
|
274
316
|
},
|
|
275
|
-
[`& .${
|
|
317
|
+
[`& .${c['columnHeader--alignRight']} .${c.columnHeaderDraggableContainer}, & .${c['columnHeader--alignRight']} .${c.columnHeaderTitleContainer}`]: {
|
|
276
318
|
flexDirection: 'row-reverse'
|
|
277
319
|
},
|
|
278
|
-
[`& .${
|
|
320
|
+
[`& .${c['columnHeader--alignCenter']} .${c.menuIcon}, & .${c['columnHeader--alignRight']} .${c.menuIcon}`]: {
|
|
279
321
|
marginRight: 'auto',
|
|
280
322
|
marginLeft: -6
|
|
281
323
|
},
|
|
282
|
-
[`& .${
|
|
324
|
+
[`& .${c['columnHeader--alignRight']} .${c.menuIcon}, & .${c['columnHeader--alignRight']} .${c.menuIcon}`]: {
|
|
283
325
|
marginRight: 'auto',
|
|
284
326
|
marginLeft: -10
|
|
285
327
|
},
|
|
286
|
-
[`& .${
|
|
287
|
-
backgroundColor: (
|
|
328
|
+
[`& .${c['columnHeader--moving']}`]: {
|
|
329
|
+
backgroundColor: (t.vars || t).palette.action.hover
|
|
288
330
|
},
|
|
289
|
-
[`& .${
|
|
331
|
+
[`& .${c.columnSeparator}`]: {
|
|
290
332
|
visibility: 'hidden',
|
|
291
333
|
position: 'absolute',
|
|
292
334
|
zIndex: 100,
|
|
@@ -295,44 +337,47 @@ export const GridRootStyles = styled('div', {
|
|
|
295
337
|
justifyContent: 'center',
|
|
296
338
|
color: borderColor
|
|
297
339
|
},
|
|
340
|
+
[`& .${c.columnHeaders}`]: {
|
|
341
|
+
width: 'var(--DataGrid-rowWidth)'
|
|
342
|
+
},
|
|
298
343
|
'@media (hover: hover)': {
|
|
299
|
-
[`& .${
|
|
300
|
-
[`& .${
|
|
301
|
-
[`& .${
|
|
344
|
+
[`& .${c.columnHeaders}:hover`]: columnHeadersStyles,
|
|
345
|
+
[`& .${c.columnHeader}:hover`]: columnHeaderStyles,
|
|
346
|
+
[`& .${c.columnHeader}:not(.${c['columnHeader--sorted']}):hover .${c.sortIcon}`]: {
|
|
302
347
|
opacity: 0.5
|
|
303
348
|
}
|
|
304
349
|
},
|
|
305
350
|
'@media (hover: none)': {
|
|
306
|
-
[`& .${
|
|
307
|
-
[`& .${
|
|
351
|
+
[`& .${c.columnHeaders}`]: columnHeadersStyles,
|
|
352
|
+
[`& .${c.columnHeader}`]: columnHeaderStyles
|
|
308
353
|
},
|
|
309
|
-
[`& .${
|
|
354
|
+
[`& .${c['columnSeparator--sideLeft']}`]: {
|
|
310
355
|
left: -12
|
|
311
356
|
},
|
|
312
|
-
[`& .${
|
|
357
|
+
[`& .${c['columnSeparator--sideRight']}`]: {
|
|
313
358
|
right: -12
|
|
314
359
|
},
|
|
315
|
-
[`& .${
|
|
360
|
+
[`& .${c['columnSeparator--resizable']}`]: {
|
|
316
361
|
cursor: 'col-resize',
|
|
317
362
|
touchAction: 'none',
|
|
318
363
|
'&:hover': {
|
|
319
|
-
color: (
|
|
364
|
+
color: (t.vars || t).palette.text.primary,
|
|
320
365
|
// Reset on touch devices, it doesn't add specificity
|
|
321
366
|
'@media (hover: none)': {
|
|
322
367
|
color: borderColor
|
|
323
368
|
}
|
|
324
369
|
},
|
|
325
|
-
[`&.${
|
|
326
|
-
color: (
|
|
370
|
+
[`&.${c['columnSeparator--resizing']}`]: {
|
|
371
|
+
color: (t.vars || t).palette.text.primary
|
|
327
372
|
},
|
|
328
373
|
'& svg': {
|
|
329
374
|
pointerEvents: 'none'
|
|
330
375
|
}
|
|
331
376
|
},
|
|
332
|
-
[`& .${
|
|
377
|
+
[`& .${c.iconSeparator}`]: {
|
|
333
378
|
color: 'inherit'
|
|
334
379
|
},
|
|
335
|
-
[`& .${
|
|
380
|
+
[`& .${c.menuIcon}`]: {
|
|
336
381
|
width: 0,
|
|
337
382
|
visibility: 'hidden',
|
|
338
383
|
fontSize: 20,
|
|
@@ -340,178 +385,236 @@ export const GridRootStyles = styled('div', {
|
|
|
340
385
|
display: 'flex',
|
|
341
386
|
alignItems: 'center'
|
|
342
387
|
},
|
|
343
|
-
[`.${
|
|
388
|
+
[`.${c.menuOpen}`]: {
|
|
344
389
|
visibility: 'visible',
|
|
345
390
|
width: 'auto'
|
|
346
391
|
},
|
|
347
|
-
[`& .${
|
|
392
|
+
[`& .${c.headerFilterRow}`]: {
|
|
393
|
+
[`& .${c.columnHeader}`]: {
|
|
394
|
+
boxSizing: 'border-box',
|
|
395
|
+
borderTop: '1px solid var(--DataGrid-rowBorderColor)'
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
/* Row styles */
|
|
399
|
+
[`.${c.row}`]: {
|
|
348
400
|
display: 'flex',
|
|
349
|
-
width: '
|
|
401
|
+
width: 'var(--DataGrid-rowWidth)',
|
|
350
402
|
breakInside: 'avoid',
|
|
351
403
|
// Avoid the row to be broken in two different print pages.
|
|
352
|
-
|
|
353
|
-
|
|
404
|
+
|
|
405
|
+
'--rowBorderColor': 'var(--DataGrid-rowBorderColor)',
|
|
406
|
+
[`&.${c['row--firstVisible']}`]: {
|
|
407
|
+
'--rowBorderColor': 'transparent'
|
|
408
|
+
},
|
|
409
|
+
'&:hover': {
|
|
410
|
+
backgroundColor: (t.vars || t).palette.action.hover,
|
|
354
411
|
// Reset on touch devices, it doesn't add specificity
|
|
355
412
|
'@media (hover: none)': {
|
|
356
413
|
backgroundColor: 'transparent'
|
|
357
414
|
}
|
|
358
415
|
},
|
|
359
|
-
'&.Mui-selected':
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
'@media (hover: none)': {
|
|
368
|
-
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity)
|
|
369
|
-
}
|
|
370
|
-
}
|
|
416
|
+
'&.Mui-selected': selectedStyles
|
|
417
|
+
},
|
|
418
|
+
[`& .${c['container--top']}, & .${c['container--bottom']}`]: {
|
|
419
|
+
'[role=row]': {
|
|
420
|
+
background: 'var(--DataGrid-containerBackground)'
|
|
421
|
+
},
|
|
422
|
+
[`.${c.pinnedColumnHeaders} [role=row]`]: {
|
|
423
|
+
background: 'var(--DataGrid-pinnedBackground)'
|
|
371
424
|
}
|
|
372
425
|
},
|
|
373
|
-
|
|
426
|
+
/* Cell styles */
|
|
427
|
+
[`& .${c.cell}`]: {
|
|
374
428
|
display: 'flex',
|
|
375
429
|
alignItems: 'center',
|
|
376
|
-
|
|
377
|
-
'
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
},
|
|
388
|
-
[`&.${
|
|
430
|
+
height: 'var(--height)',
|
|
431
|
+
minWidth: 'var(--width)',
|
|
432
|
+
maxWidth: 'var(--width)',
|
|
433
|
+
'--width': '0px',
|
|
434
|
+
'--height': '0px',
|
|
435
|
+
boxSizing: 'border-box',
|
|
436
|
+
borderTop: `1px solid var(--rowBorderColor)`,
|
|
437
|
+
'&.Mui-selected': selectedStyles
|
|
438
|
+
},
|
|
439
|
+
[`& .${c['virtualScrollerContent--overflowed']} .${c['row--lastVisible']} .${c.cell}`]: {
|
|
440
|
+
borderTopColor: 'transparent'
|
|
441
|
+
},
|
|
442
|
+
[`&.${c['root--disableUserSelection']} .${c.cell}`]: {
|
|
389
443
|
userSelect: 'none'
|
|
390
444
|
},
|
|
391
|
-
[`& .${
|
|
445
|
+
[`& .${c.row}:not(.${c['row--dynamicHeight']}) > .${c.cell}`]: {
|
|
392
446
|
overflow: 'hidden',
|
|
393
447
|
whiteSpace: 'nowrap'
|
|
394
448
|
},
|
|
395
|
-
[`& .${
|
|
396
|
-
|
|
397
|
-
textOverflow: 'ellipsis'
|
|
449
|
+
[`& .${c.cellEmpty}`]: {
|
|
450
|
+
padding: 0
|
|
398
451
|
},
|
|
399
|
-
[`& .${
|
|
452
|
+
[`& .${c.cell}.${c['cell--selectionMode']}`]: {
|
|
400
453
|
cursor: 'default'
|
|
401
454
|
},
|
|
402
|
-
[`& .${
|
|
455
|
+
[`& .${c.cell}.${c['cell--editing']}`]: {
|
|
403
456
|
padding: 1,
|
|
404
457
|
display: 'flex',
|
|
405
|
-
boxShadow:
|
|
406
|
-
backgroundColor: (
|
|
458
|
+
boxShadow: t.shadows[2],
|
|
459
|
+
backgroundColor: (t.vars || t).palette.background.paper,
|
|
407
460
|
'&:focus-within': {
|
|
408
|
-
outline: `solid ${(
|
|
461
|
+
outline: `solid ${(t.vars || t).palette.primary.main} 1px`,
|
|
409
462
|
outlineOffset: '-1px'
|
|
410
463
|
}
|
|
411
464
|
},
|
|
412
|
-
[`& .${
|
|
413
|
-
|
|
465
|
+
[`& .${c.cellContent}`]: {
|
|
466
|
+
overflow: 'hidden',
|
|
467
|
+
textOverflow: 'ellipsis'
|
|
468
|
+
},
|
|
469
|
+
[`& .${c['row--editing']}`]: {
|
|
470
|
+
boxShadow: t.shadows[2]
|
|
414
471
|
},
|
|
415
|
-
[`& .${
|
|
416
|
-
boxShadow:
|
|
417
|
-
backgroundColor: (
|
|
472
|
+
[`& .${c['row--editing']} .${c.cell}`]: {
|
|
473
|
+
boxShadow: t.shadows[0],
|
|
474
|
+
backgroundColor: (t.vars || t).palette.background.paper
|
|
418
475
|
},
|
|
419
|
-
[`& .${
|
|
476
|
+
[`& .${c.editBooleanCell}`]: {
|
|
420
477
|
display: 'flex',
|
|
421
478
|
height: '100%',
|
|
422
479
|
width: '100%',
|
|
423
480
|
alignItems: 'center',
|
|
424
481
|
justifyContent: 'center'
|
|
425
482
|
},
|
|
426
|
-
[`& .${
|
|
427
|
-
color: (
|
|
483
|
+
[`& .${c.booleanCell}[data-value="true"]`]: {
|
|
484
|
+
color: (t.vars || t).palette.text.secondary
|
|
428
485
|
},
|
|
429
|
-
[`& .${
|
|
430
|
-
color: (
|
|
486
|
+
[`& .${c.booleanCell}[data-value="false"]`]: {
|
|
487
|
+
color: (t.vars || t).palette.text.disabled
|
|
431
488
|
},
|
|
432
|
-
[`& .${
|
|
489
|
+
[`& .${c.actionsCell}`]: {
|
|
433
490
|
display: 'inline-flex',
|
|
434
491
|
alignItems: 'center',
|
|
435
|
-
gridGap:
|
|
492
|
+
gridGap: t.spacing(1)
|
|
436
493
|
},
|
|
437
|
-
[`& .${
|
|
494
|
+
[`& .${c.rowReorderCell}`]: {
|
|
438
495
|
display: 'inline-flex',
|
|
439
496
|
flex: 1,
|
|
440
497
|
alignItems: 'center',
|
|
441
498
|
justifyContent: 'center',
|
|
442
|
-
opacity: (
|
|
499
|
+
opacity: (t.vars || t).palette.action.disabledOpacity
|
|
443
500
|
},
|
|
444
|
-
[`& .${
|
|
501
|
+
[`& .${c['rowReorderCell--draggable']}`]: {
|
|
445
502
|
cursor: 'move',
|
|
446
503
|
opacity: 1
|
|
447
504
|
},
|
|
448
|
-
[`& .${
|
|
505
|
+
[`& .${c.rowReorderCellContainer}`]: {
|
|
449
506
|
padding: 0,
|
|
450
507
|
alignItems: 'stretch'
|
|
451
508
|
},
|
|
452
|
-
[`.${
|
|
509
|
+
[`.${c.withBorderColor}`]: {
|
|
453
510
|
borderColor
|
|
454
511
|
},
|
|
455
|
-
[`& .${
|
|
512
|
+
[`& .${c['cell--withLeftBorder']}`]: {
|
|
513
|
+
borderLeftColor: 'var(--DataGrid-rowBorderColor)',
|
|
514
|
+
borderLeftWidth: '1px',
|
|
515
|
+
borderLeftStyle: 'solid'
|
|
516
|
+
},
|
|
517
|
+
[`& .${c['cell--withRightBorder']}`]: {
|
|
518
|
+
borderRightColor: 'var(--DataGrid-rowBorderColor)',
|
|
456
519
|
borderRightWidth: '1px',
|
|
457
520
|
borderRightStyle: 'solid'
|
|
458
521
|
},
|
|
459
|
-
[`& .${
|
|
522
|
+
[`& .${c['columnHeader--withRightBorder']}`]: {
|
|
460
523
|
borderRightWidth: '1px',
|
|
461
524
|
borderRightStyle: 'solid'
|
|
462
525
|
},
|
|
463
|
-
[`& .${
|
|
526
|
+
[`& .${c['cell--textLeft']}`]: {
|
|
464
527
|
justifyContent: 'flex-start'
|
|
465
528
|
},
|
|
466
|
-
[`& .${
|
|
529
|
+
[`& .${c['cell--textRight']}`]: {
|
|
467
530
|
justifyContent: 'flex-end'
|
|
468
531
|
},
|
|
469
|
-
[`& .${
|
|
532
|
+
[`& .${c['cell--textCenter']}`]: {
|
|
470
533
|
justifyContent: 'center'
|
|
471
534
|
},
|
|
472
|
-
[`& .${
|
|
535
|
+
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
536
|
+
position: 'sticky',
|
|
537
|
+
zIndex: 3,
|
|
538
|
+
background: 'var(--DataGrid-pinnedBackground)'
|
|
539
|
+
},
|
|
540
|
+
[`& .${c.virtualScrollerContent} .${c.row}`]: {
|
|
541
|
+
'&:hover': {
|
|
542
|
+
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
543
|
+
backgroundColor: pinnedHoverBackground
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
[`&.Mui-selected`]: {
|
|
547
|
+
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
548
|
+
backgroundColor: pinnedSelectedBackground
|
|
549
|
+
},
|
|
550
|
+
'&:hover': {
|
|
551
|
+
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
552
|
+
backgroundColor: pinnedSelectedHoverBackground
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
[`& .${c.cell}:not(.${c['cell--pinnedLeft']}):not(.${c['cell--pinnedRight']})`]: {
|
|
558
|
+
transform: 'translate3d(var(--DataGrid-offsetLeft), 0, 0)'
|
|
559
|
+
},
|
|
560
|
+
[`& .${c.columnHeaderDraggableContainer}`]: {
|
|
473
561
|
display: 'flex',
|
|
474
562
|
width: '100%',
|
|
475
563
|
height: '100%'
|
|
476
564
|
},
|
|
477
|
-
[`& .${
|
|
565
|
+
[`& .${c.rowReorderCellPlaceholder}`]: {
|
|
478
566
|
display: 'none'
|
|
479
567
|
},
|
|
480
|
-
[`& .${
|
|
481
|
-
background: (
|
|
568
|
+
[`& .${c['columnHeader--dragging']}, & .${c['row--dragging']}`]: {
|
|
569
|
+
background: (t.vars || t).palette.background.paper,
|
|
482
570
|
padding: '0 12px',
|
|
483
571
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
484
|
-
opacity: (
|
|
572
|
+
opacity: (t.vars || t).palette.action.disabledOpacity
|
|
485
573
|
},
|
|
486
|
-
[`& .${
|
|
487
|
-
background: (
|
|
574
|
+
[`& .${c['row--dragging']}`]: {
|
|
575
|
+
background: (t.vars || t).palette.background.paper,
|
|
488
576
|
padding: '0 12px',
|
|
489
577
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
490
|
-
opacity: (
|
|
491
|
-
[`& .${
|
|
578
|
+
opacity: (t.vars || t).palette.action.disabledOpacity,
|
|
579
|
+
[`& .${c.rowReorderCellPlaceholder}`]: {
|
|
492
580
|
display: 'flex'
|
|
493
581
|
}
|
|
494
582
|
},
|
|
495
|
-
[`& .${
|
|
583
|
+
[`& .${c.treeDataGroupingCell}`]: {
|
|
496
584
|
display: 'flex',
|
|
497
585
|
alignItems: 'center',
|
|
498
586
|
width: '100%'
|
|
499
587
|
},
|
|
500
|
-
[`& .${
|
|
588
|
+
[`& .${c.treeDataGroupingCellToggle}`]: {
|
|
501
589
|
flex: '0 0 28px',
|
|
502
590
|
alignSelf: 'stretch',
|
|
503
|
-
marginRight:
|
|
591
|
+
marginRight: t.spacing(2)
|
|
504
592
|
},
|
|
505
|
-
[`& .${
|
|
593
|
+
[`& .${c.groupingCriteriaCell}`]: {
|
|
506
594
|
display: 'flex',
|
|
507
595
|
alignItems: 'center',
|
|
508
596
|
width: '100%'
|
|
509
597
|
},
|
|
510
|
-
[`& .${
|
|
598
|
+
[`& .${c.groupingCriteriaCellToggle}`]: {
|
|
511
599
|
flex: '0 0 28px',
|
|
512
600
|
alignSelf: 'stretch',
|
|
513
|
-
marginRight:
|
|
601
|
+
marginRight: t.spacing(2)
|
|
514
602
|
}
|
|
515
603
|
});
|
|
516
604
|
return gridStyle;
|
|
517
|
-
});
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Blend a transparent overlay color with a background color, resulting in a single
|
|
609
|
+
* RGB color.
|
|
610
|
+
*/
|
|
611
|
+
function blend(background, overlay, opacity, gamma = 1) {
|
|
612
|
+
const f = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);
|
|
613
|
+
const backgroundColor = decomposeColor(background);
|
|
614
|
+
const overlayColor = decomposeColor(overlay);
|
|
615
|
+
const rgb = [f(backgroundColor.values[0], overlayColor.values[0]), f(backgroundColor.values[1], overlayColor.values[1]), f(backgroundColor.values[2], overlayColor.values[2])];
|
|
616
|
+
return recomposeColor({
|
|
617
|
+
type: 'rgb',
|
|
618
|
+
values: rgb
|
|
619
|
+
});
|
|
620
|
+
}
|