@mui/x-data-grid 6.0.0-beta.4 → 6.0.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 +204 -29
- package/DataGrid/DataGrid.js +10 -2
- package/DataGrid/useDataGridProps.js +25 -18
- package/colDef/gridSingleSelectColDef.js +13 -4
- package/components/GridColumnHeaders.d.ts +7 -0
- package/components/GridColumnHeaders.js +108 -0
- package/components/GridFooter.d.ts +1 -1
- package/components/GridFooter.js +2 -2
- package/components/GridHeader.js +2 -2
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridNoResultsOverlay.d.ts +1 -1
- package/components/GridNoRowsOverlay.d.ts +1 -1
- package/components/GridRow.d.ts +13 -7
- package/components/GridRow.js +49 -31
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +4 -6
- package/components/GridScrollArea.js +4 -3
- package/components/GridSelectedRowCount.d.ts +1 -1
- package/components/GridSelectedRowCount.js +4 -6
- package/components/base/GridBody.d.ts +1 -4
- package/components/base/GridBody.js +43 -5
- package/components/base/GridFooterPlaceholder.js +2 -2
- package/components/base/GridOverlays.js +7 -7
- package/components/cell/GridActionsCell.js +4 -4
- package/components/cell/GridActionsCellItem.js +3 -3
- package/components/cell/GridBooleanCell.js +1 -1
- package/components/cell/GridCell.d.ts +2 -5
- package/components/cell/GridCell.js +14 -12
- package/components/cell/GridEditBooleanCell.js +3 -3
- package/components/cell/GridEditInputCell.js +3 -6
- package/components/cell/GridEditSingleSelectCell.d.ts +2 -8
- package/components/cell/GridEditSingleSelectCell.js +32 -16
- package/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +7 -0
- package/{modern/components/columnHeaders/GridColumnHeaders.js → components/columnHeaders/GridBaseColumnHeaders.js} +14 -20
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +6 -6
- package/components/columnHeaders/GridColumnHeaderItem.js +5 -5
- package/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +7 -7
- package/components/columnHeaders/GridColumnHeaderTitle.js +10 -14
- package/components/columnHeaders/GridColumnHeadersInner.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeadersInner.js +6 -6
- package/components/columnHeaders/GridIconButtonContainer.js +4 -6
- package/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
- package/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +10 -15
- package/components/containers/GridMainContainer.js +3 -5
- package/components/containers/GridOverlay.d.ts +1 -2
- package/components/containers/GridOverlay.js +7 -11
- package/components/containers/GridRoot.js +4 -5
- package/components/containers/GridRootStyles.d.ts +5 -1
- package/components/containers/GridRootStyles.js +7 -3
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +4 -6
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/components/menu/GridMenu.js +5 -7
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
- package/components/panel/GridColumnsPanel.js +16 -18
- package/components/panel/GridPanel.d.ts +6 -2
- package/components/panel/GridPanel.js +4 -0
- package/components/panel/GridPanelContent.d.ts +1 -1
- package/components/panel/GridPanelContent.js +4 -6
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelFooter.js +4 -6
- package/components/panel/GridPanelHeader.d.ts +1 -1
- package/components/panel/GridPanelHeader.js +4 -6
- package/components/panel/GridPanelWrapper.js +3 -5
- package/components/panel/GridPreferencesPanel.js +4 -4
- package/components/panel/filterPanel/GridFilterForm.js +50 -45
- package/components/panel/filterPanel/GridFilterInputBoolean.js +14 -11
- package/components/panel/filterPanel/GridFilterInputDate.js +4 -5
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -8
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +28 -20
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +3 -3
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +2 -8
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +53 -25
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -5
- package/components/panel/filterPanel/GridFilterPanel.d.ts +5 -3
- package/components/panel/filterPanel/GridFilterPanel.js +35 -11
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -2
- package/components/panel/filterPanel/filterPanelUtils.js +3 -9
- package/components/toolbar/GridToolbarColumnsButton.js +4 -4
- package/components/toolbar/GridToolbarDensitySelector.js +9 -9
- package/components/toolbar/GridToolbarExportContainer.js +4 -4
- package/components/toolbar/GridToolbarFilterButton.js +9 -11
- package/components/toolbar/GridToolbarQuickFilter.js +8 -7
- package/components/virtualization/GridVirtualScroller.d.ts +1 -1
- package/components/virtualization/GridVirtualScroller.js +4 -6
- package/components/virtualization/GridVirtualScrollerContent.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerContent.js +4 -4
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.js +4 -6
- package/constants/defaultGridSlotsComponents.js +5 -54
- package/constants/localeTextConstants.js +1 -0
- package/hooks/core/useGridLocaleText.js +2 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +22 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -26
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.js +5 -5
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +5 -5
- package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +2 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +36 -19
- package/index.d.ts +3 -0
- package/index.js +5 -1
- package/internals/index.d.ts +4 -1
- package/internals/index.js +3 -2
- package/internals/utils/computeSlots.d.ts +6 -0
- package/internals/utils/computeSlots.js +17 -0
- package/internals/utils/index.d.ts +2 -0
- package/internals/utils/index.js +2 -0
- package/internals/utils/slotsMigration.d.ts +4 -0
- package/internals/utils/slotsMigration.js +13 -0
- package/legacy/DataGrid/DataGrid.js +10 -2
- package/legacy/DataGrid/useDataGridProps.js +21 -20
- package/legacy/colDef/gridSingleSelectColDef.js +13 -4
- package/legacy/components/GridColumnHeaders.js +106 -0
- package/legacy/components/GridFooter.js +2 -2
- package/legacy/components/GridHeader.js +2 -2
- package/legacy/components/GridRow.js +47 -31
- package/legacy/components/GridRowCount.js +4 -6
- package/legacy/components/GridScrollArea.js +4 -3
- package/legacy/components/GridSelectedRowCount.js +4 -6
- package/legacy/components/base/GridBody.js +43 -5
- package/legacy/components/base/GridFooterPlaceholder.js +2 -2
- package/legacy/components/base/GridOverlays.js +7 -7
- package/legacy/components/cell/GridActionsCell.js +4 -4
- package/legacy/components/cell/GridActionsCellItem.js +3 -3
- package/legacy/components/cell/GridBooleanCell.js +2 -2
- package/legacy/components/cell/GridCell.js +14 -12
- package/legacy/components/cell/GridEditBooleanCell.js +3 -3
- package/legacy/components/cell/GridEditInputCell.js +3 -6
- package/legacy/components/cell/GridEditSingleSelectCell.js +40 -23
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +4 -4
- package/legacy/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +14 -19
- package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +6 -6
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -5
- package/legacy/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +7 -7
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +12 -17
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +6 -6
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +4 -6
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +3 -3
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/legacy/components/containers/GridFooterContainer.js +10 -15
- package/legacy/components/containers/GridMainContainer.js +3 -5
- package/legacy/components/containers/GridOverlay.js +12 -17
- package/legacy/components/containers/GridRoot.js +5 -6
- package/legacy/components/containers/GridRootStyles.js +7 -3
- package/legacy/components/containers/GridToolbarContainer.js +4 -6
- package/legacy/components/index.js +1 -1
- package/legacy/components/menu/GridMenu.js +5 -7
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
- package/legacy/components/panel/GridColumnsPanel.js +16 -20
- package/legacy/components/panel/GridPanel.js +4 -0
- package/legacy/components/panel/GridPanelContent.js +4 -6
- package/legacy/components/panel/GridPanelFooter.js +4 -6
- package/legacy/components/panel/GridPanelHeader.js +4 -6
- package/legacy/components/panel/GridPanelWrapper.js +3 -5
- package/legacy/components/panel/GridPreferencesPanel.js +4 -4
- package/legacy/components/panel/filterPanel/GridFilterForm.js +50 -45
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +14 -11
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -5
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +32 -26
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +3 -3
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +52 -27
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -5
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +36 -10
- package/legacy/components/panel/filterPanel/filterPanelUtils.js +3 -9
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +4 -4
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +9 -9
- package/legacy/components/toolbar/GridToolbarExportContainer.js +4 -4
- package/legacy/components/toolbar/GridToolbarFilterButton.js +9 -11
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +8 -7
- package/legacy/components/virtualization/GridVirtualScroller.js +4 -6
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +4 -4
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +4 -6
- package/legacy/constants/defaultGridSlotsComponents.js +5 -54
- package/legacy/constants/localeTextConstants.js +1 -0
- package/legacy/hooks/core/useGridLocaleText.js +2 -4
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -26
- package/legacy/hooks/features/columns/useGridColumns.js +5 -5
- package/legacy/hooks/features/filter/useGridFilter.js +5 -5
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +34 -17
- package/legacy/index.js +5 -1
- package/legacy/internals/index.js +3 -2
- package/legacy/internals/utils/computeSlots.js +16 -0
- package/legacy/internals/utils/index.js +2 -0
- package/legacy/internals/utils/slotsMigration.js +14 -0
- package/legacy/locales/arSD.js +15 -19
- package/legacy/locales/beBY.js +1 -0
- package/legacy/locales/bgBG.js +1 -0
- package/legacy/locales/csCZ.js +25 -32
- package/legacy/locales/daDK.js +1 -0
- package/legacy/locales/deDE.js +1 -0
- package/legacy/locales/elGR.js +1 -0
- package/legacy/locales/esES.js +2 -1
- package/legacy/locales/faIR.js +1 -0
- package/legacy/locales/fiFI.js +1 -0
- package/legacy/locales/frFR.js +1 -0
- package/legacy/locales/heIL.js +1 -0
- package/legacy/locales/huHU.js +1 -0
- package/legacy/locales/itIT.js +1 -0
- package/legacy/locales/jaJP.js +1 -0
- package/legacy/locales/koKR.js +1 -0
- package/legacy/locales/nbNO.js +1 -0
- package/legacy/locales/nlNL.js +1 -0
- package/legacy/locales/plPL.js +1 -0
- package/legacy/locales/ptBR.js +1 -0
- package/legacy/locales/roRO.js +1 -0
- package/legacy/locales/ruRU.js +1 -0
- package/legacy/locales/skSK.js +1 -0
- package/legacy/locales/svSE.js +1 -0
- package/legacy/locales/trTR.js +1 -0
- package/legacy/locales/ukUA.js +1 -0
- package/legacy/locales/urPK.js +1 -0
- package/legacy/locales/viVN.js +1 -0
- package/legacy/locales/zhCN.js +1 -0
- package/legacy/locales/zhTW.js +1 -0
- package/legacy/material/components/MUISelectOption.js +14 -0
- package/legacy/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
- package/legacy/{components → material}/icons/index.js +7 -1
- package/legacy/material/index.js +65 -0
- package/legacy/models/gridFilterItem.js +2 -0
- package/legacy/models/params/gridRowParams.js +4 -0
- package/locales/arSD.js +15 -19
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +1 -0
- package/locales/csCZ.js +24 -31
- package/locales/daDK.js +1 -0
- package/locales/deDE.js +1 -0
- package/locales/elGR.js +1 -0
- package/locales/esES.js +2 -1
- package/locales/faIR.js +1 -0
- package/locales/fiFI.js +1 -0
- package/locales/frFR.js +1 -0
- package/locales/heIL.js +1 -0
- package/locales/huHU.js +1 -0
- package/locales/itIT.js +1 -0
- package/locales/jaJP.js +1 -0
- package/locales/koKR.js +1 -0
- package/locales/nbNO.js +1 -0
- package/locales/nlNL.js +1 -0
- package/locales/plPL.js +1 -0
- package/locales/ptBR.js +1 -0
- package/locales/roRO.js +1 -0
- package/locales/ruRU.js +1 -0
- package/locales/skSK.js +1 -0
- package/locales/svSE.js +1 -0
- package/locales/trTR.js +1 -0
- package/locales/ukUA.js +1 -0
- package/locales/urPK.js +1 -0
- package/locales/viVN.js +1 -0
- package/locales/zhCN.js +1 -0
- package/locales/zhTW.js +1 -0
- package/material/components/MUISelectOption.d.ts +3 -0
- package/material/components/MUISelectOption.js +16 -0
- package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
- package/{components → material}/icons/index.d.ts +6 -0
- package/{components → material}/icons/index.js +7 -1
- package/material/index.d.ts +57 -0
- package/material/index.js +65 -0
- package/material/package.json +6 -0
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/colDef/gridColDef.d.ts +19 -1
- package/models/gridExport.d.ts +4 -0
- package/models/gridFilterItem.d.ts +2 -0
- package/models/gridFilterItem.js +2 -0
- package/models/gridFilterModel.d.ts +2 -0
- package/models/gridFilterOperator.d.ts +2 -0
- package/models/gridIconSlotsComponent.d.ts +22 -2
- package/models/gridSlotsComponent.d.ts +18 -1
- package/models/gridSlotsComponentsProps.d.ts +103 -23
- package/models/params/gridRowParams.d.ts +6 -0
- package/models/params/gridRowParams.js +4 -0
- package/models/props/DataGridProps.d.ts +13 -2
- package/modern/DataGrid/DataGrid.js +10 -2
- package/modern/DataGrid/useDataGridProps.js +21 -17
- package/modern/colDef/gridSingleSelectColDef.js +13 -4
- package/modern/components/GridColumnHeaders.js +108 -0
- package/modern/components/GridFooter.js +1 -1
- package/modern/components/GridHeader.js +1 -1
- package/modern/components/GridRow.js +49 -28
- package/modern/components/GridRowCount.js +4 -6
- package/modern/components/GridScrollArea.js +4 -3
- package/modern/components/GridSelectedRowCount.js +4 -6
- package/modern/components/base/GridBody.js +43 -5
- package/modern/components/base/GridFooterPlaceholder.js +1 -1
- package/modern/components/base/GridOverlays.js +4 -4
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridActionsCellItem.js +2 -2
- package/modern/components/cell/GridBooleanCell.js +1 -1
- package/modern/components/cell/GridCell.js +14 -12
- package/modern/components/cell/GridEditBooleanCell.js +2 -2
- package/modern/components/cell/GridEditInputCell.js +3 -6
- package/modern/components/cell/GridEditSingleSelectCell.js +30 -15
- package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/{components/columnHeaders/GridColumnHeaders.js → modern/components/columnHeaders/GridBaseColumnHeaders.js} +14 -20
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +5 -5
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +4 -4
- package/modern/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +6 -6
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +9 -13
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +6 -6
- package/modern/components/columnHeaders/GridIconButtonContainer.js +4 -6
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/modern/components/columnSelection/GridHeaderCheckbox.js +2 -2
- package/modern/components/containers/GridFooterContainer.js +10 -15
- package/modern/components/containers/GridMainContainer.js +3 -5
- package/modern/components/containers/GridOverlay.js +7 -11
- package/modern/components/containers/GridRoot.js +4 -5
- package/modern/components/containers/GridRootStyles.js +7 -3
- package/modern/components/containers/GridToolbarContainer.js +4 -6
- package/modern/components/index.js +1 -1
- package/modern/components/menu/GridMenu.js +4 -6
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
- package/modern/components/panel/GridColumnsPanel.js +14 -16
- package/modern/components/panel/GridPanel.js +4 -0
- package/modern/components/panel/GridPanelContent.js +4 -6
- package/modern/components/panel/GridPanelFooter.js +4 -6
- package/modern/components/panel/GridPanelHeader.js +4 -6
- package/modern/components/panel/GridPanelWrapper.js +3 -5
- package/modern/components/panel/GridPreferencesPanel.js +3 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +49 -44
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +13 -10
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +3 -4
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +24 -17
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +52 -24
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +3 -4
- package/modern/components/panel/filterPanel/GridFilterPanel.js +34 -10
- package/modern/components/panel/filterPanel/filterPanelUtils.js +3 -9
- package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -3
- package/modern/components/toolbar/GridToolbarDensitySelector.js +8 -8
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -3
- package/modern/components/toolbar/GridToolbarFilterButton.js +8 -10
- package/modern/components/toolbar/GridToolbarQuickFilter.js +7 -6
- package/modern/components/virtualization/GridVirtualScroller.js +4 -6
- package/modern/components/virtualization/GridVirtualScrollerContent.js +4 -4
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +4 -6
- package/modern/constants/defaultGridSlotsComponents.js +5 -54
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/core/useGridLocaleText.js +2 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -26
- package/modern/hooks/features/columns/useGridColumns.js +3 -3
- package/modern/hooks/features/filter/useGridFilter.js +3 -3
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +34 -18
- package/modern/index.js +5 -1
- package/modern/internals/index.js +3 -2
- package/modern/internals/utils/computeSlots.js +17 -0
- package/modern/internals/utils/index.js +2 -0
- package/modern/internals/utils/slotsMigration.js +13 -0
- package/modern/locales/arSD.js +15 -19
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +1 -0
- package/modern/locales/csCZ.js +24 -31
- package/modern/locales/daDK.js +1 -0
- package/modern/locales/deDE.js +1 -0
- package/modern/locales/elGR.js +1 -0
- package/modern/locales/esES.js +2 -1
- package/modern/locales/faIR.js +1 -0
- package/modern/locales/fiFI.js +1 -0
- package/modern/locales/frFR.js +1 -0
- package/modern/locales/heIL.js +1 -0
- package/modern/locales/huHU.js +1 -0
- package/modern/locales/itIT.js +1 -0
- package/modern/locales/jaJP.js +1 -0
- package/modern/locales/koKR.js +1 -0
- package/modern/locales/nbNO.js +1 -0
- package/modern/locales/nlNL.js +1 -0
- package/modern/locales/plPL.js +1 -0
- package/modern/locales/ptBR.js +1 -0
- package/modern/locales/roRO.js +1 -0
- package/modern/locales/ruRU.js +1 -0
- package/modern/locales/skSK.js +1 -0
- package/modern/locales/svSE.js +1 -0
- package/modern/locales/trTR.js +1 -0
- package/modern/locales/ukUA.js +1 -0
- package/modern/locales/urPK.js +1 -0
- package/modern/locales/viVN.js +1 -0
- package/modern/locales/zhCN.js +1 -0
- package/modern/locales/zhTW.js +1 -0
- package/modern/material/components/MUISelectOption.js +16 -0
- package/modern/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
- package/modern/{components → material}/icons/index.js +7 -1
- package/modern/material/index.js +65 -0
- package/modern/models/gridFilterItem.js +2 -0
- package/modern/models/params/gridRowParams.js +4 -0
- package/node/DataGrid/DataGrid.js +10 -2
- package/node/DataGrid/useDataGridProps.js +21 -17
- package/node/colDef/gridSingleSelectColDef.js +12 -3
- package/node/components/GridColumnHeaders.js +116 -0
- package/node/components/GridFooter.js +1 -1
- package/node/components/GridHeader.js +1 -1
- package/node/components/GridRow.js +49 -28
- package/node/components/GridRowCount.js +5 -7
- package/node/components/GridScrollArea.js +5 -4
- package/node/components/GridSelectedRowCount.js +5 -7
- package/node/components/base/GridBody.js +43 -5
- package/node/components/base/GridFooterPlaceholder.js +1 -1
- package/node/components/base/GridOverlays.js +6 -6
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridActionsCellItem.js +2 -2
- package/node/components/cell/GridBooleanCell.js +1 -1
- package/node/components/cell/GridCell.js +14 -11
- package/node/components/cell/GridEditBooleanCell.js +2 -2
- package/node/components/cell/GridEditInputCell.js +3 -6
- package/node/components/cell/GridEditSingleSelectCell.js +28 -14
- package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/node/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +17 -23
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +5 -5
- package/node/components/columnHeaders/GridColumnHeaderItem.js +4 -4
- package/node/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +6 -6
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +10 -14
- package/node/components/columnHeaders/GridColumnHeadersInner.js +7 -7
- package/node/components/columnHeaders/GridIconButtonContainer.js +5 -7
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/node/components/columnSelection/GridHeaderCheckbox.js +2 -2
- package/node/components/containers/GridFooterContainer.js +11 -16
- package/node/components/containers/GridMainContainer.js +4 -6
- package/node/components/containers/GridOverlay.js +8 -12
- package/node/components/containers/GridRoot.js +4 -5
- package/node/components/containers/GridRootStyles.js +7 -3
- package/node/components/containers/GridToolbarContainer.js +5 -7
- package/node/components/index.js +1 -1
- package/node/components/menu/GridMenu.js +4 -6
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -2
- package/node/components/panel/GridColumnsPanel.js +14 -16
- package/node/components/panel/GridPanel.js +4 -0
- package/node/components/panel/GridPanelContent.js +5 -7
- package/node/components/panel/GridPanelFooter.js +5 -7
- package/node/components/panel/GridPanelHeader.js +5 -7
- package/node/components/panel/GridPanelWrapper.js +3 -5
- package/node/components/panel/GridPreferencesPanel.js +3 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +48 -44
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +13 -10
- package/node/components/panel/filterPanel/GridFilterInputDate.js +3 -4
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +23 -16
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +50 -23
- package/node/components/panel/filterPanel/GridFilterInputValue.js +3 -4
- package/node/components/panel/filterPanel/GridFilterPanel.js +34 -10
- package/node/components/panel/filterPanel/filterPanelUtils.js +3 -10
- package/node/components/toolbar/GridToolbarColumnsButton.js +3 -3
- package/node/components/toolbar/GridToolbarDensitySelector.js +8 -8
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -3
- package/node/components/toolbar/GridToolbarFilterButton.js +8 -10
- package/node/components/toolbar/GridToolbarQuickFilter.js +7 -6
- package/node/components/virtualization/GridVirtualScroller.js +5 -7
- package/node/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -7
- package/node/constants/defaultGridSlotsComponents.js +4 -53
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/core/useGridLocaleText.js +2 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +21 -28
- package/node/hooks/features/columns/useGridColumns.js +3 -3
- package/node/hooks/features/filter/useGridFilter.js +3 -3
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +33 -16
- package/node/index.js +9 -1
- package/node/internals/index.js +94 -4
- package/node/internals/utils/computeSlots.js +23 -0
- package/node/internals/utils/index.js +27 -0
- package/node/internals/utils/slotsMigration.js +21 -0
- package/node/locales/arSD.js +15 -19
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +1 -0
- package/node/locales/csCZ.js +24 -31
- package/node/locales/daDK.js +1 -0
- package/node/locales/deDE.js +1 -0
- package/node/locales/elGR.js +1 -0
- package/node/locales/esES.js +2 -1
- package/node/locales/faIR.js +1 -0
- package/node/locales/fiFI.js +1 -0
- package/node/locales/frFR.js +1 -0
- package/node/locales/heIL.js +1 -0
- package/node/locales/huHU.js +1 -0
- package/node/locales/itIT.js +1 -0
- package/node/locales/jaJP.js +1 -0
- package/node/locales/koKR.js +1 -0
- package/node/locales/nbNO.js +1 -0
- package/node/locales/nlNL.js +1 -0
- package/node/locales/plPL.js +1 -0
- package/node/locales/ptBR.js +1 -0
- package/node/locales/roRO.js +1 -0
- package/node/locales/ruRU.js +1 -0
- package/node/locales/skSK.js +1 -0
- package/node/locales/svSE.js +1 -0
- package/node/locales/trTR.js +1 -0
- package/node/locales/ukUA.js +1 -0
- package/node/locales/urPK.js +1 -0
- package/node/locales/viVN.js +1 -0
- package/node/locales/zhCN.js +1 -0
- package/node/locales/zhTW.js +1 -0
- package/node/{components/DataGridColumnHeaders.js → material/components/MUISelectOption.js} +13 -35
- package/node/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +1 -1
- package/node/{components → material}/icons/index.js +10 -2
- package/node/material/index.js +73 -0
- package/node/models/gridFilterItem.js +2 -0
- package/node/models/params/gridRowParams.js +4 -0
- package/package.json +1 -1
- package/components/DataGridColumnHeaders.d.ts +0 -6
- package/components/DataGridColumnHeaders.js +0 -38
- package/components/columnHeaders/GridColumnHeaders.d.ts +0 -7
- package/legacy/components/DataGridColumnHeaders.js +0 -36
- package/modern/components/DataGridColumnHeaders.js +0 -38
- /package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.d.ts +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen", "getOptionLabel"];
|
|
3
|
+
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen", "getOptionLabel", "getOptionValue"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
7
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
8
7
|
import { isEscapeKey } from '../../utils/keyboardUtils';
|
|
9
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
9
|
import { GridEditModes } from '../../models/gridEditRowModel';
|
|
11
|
-
import {
|
|
10
|
+
import { getValueFromValueOptions, isSingleSelectColDef } from '../panel/filterPanel/filterPanelUtils';
|
|
12
11
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
12
|
+
import { createElement as _createElement } from "react";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
function isKeyboardEvent(event) {
|
|
15
15
|
return !!event.key;
|
|
@@ -26,14 +26,15 @@ function GridEditSingleSelectCell(props) {
|
|
|
26
26
|
error,
|
|
27
27
|
onValueChange,
|
|
28
28
|
initialOpen = rootProps.editMode === GridEditModes.Cell,
|
|
29
|
-
getOptionLabel
|
|
29
|
+
getOptionLabel: getOptionLabelProp,
|
|
30
|
+
getOptionValue: getOptionValueProp
|
|
30
31
|
} = props,
|
|
31
32
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
32
33
|
const apiRef = useGridApiContext();
|
|
33
34
|
const ref = React.useRef();
|
|
34
35
|
const inputRef = React.useRef();
|
|
35
36
|
const [open, setOpen] = React.useState(initialOpen);
|
|
36
|
-
const baseSelectProps = rootProps.
|
|
37
|
+
const baseSelectProps = rootProps.slotProps?.baseSelect || {};
|
|
37
38
|
const isSelectNative = baseSelectProps.native ?? false;
|
|
38
39
|
useEnhancedEffect(() => {
|
|
39
40
|
if (hasFocus) {
|
|
@@ -56,11 +57,16 @@ function GridEditSingleSelectCell(props) {
|
|
|
56
57
|
if (!valueOptions) {
|
|
57
58
|
return null;
|
|
58
59
|
}
|
|
60
|
+
const getOptionValue = getOptionValueProp || colDef.getOptionValue;
|
|
61
|
+
const getOptionLabel = getOptionLabelProp || colDef.getOptionLabel;
|
|
59
62
|
const handleChange = async event => {
|
|
63
|
+
if (!isSingleSelectColDef(colDef) || !valueOptions) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
60
66
|
setOpen(false);
|
|
61
67
|
const target = event.target;
|
|
62
68
|
// NativeSelect casts the value to a string.
|
|
63
|
-
const formattedTargetValue = getValueFromValueOptions(target.value, valueOptions);
|
|
69
|
+
const formattedTargetValue = getValueFromValueOptions(target.value, valueOptions, getOptionValue);
|
|
64
70
|
if (onValueChange) {
|
|
65
71
|
await onValueChange(event, formattedTargetValue);
|
|
66
72
|
}
|
|
@@ -89,8 +95,10 @@ function GridEditSingleSelectCell(props) {
|
|
|
89
95
|
}
|
|
90
96
|
setOpen(true);
|
|
91
97
|
};
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
if (!valueOptions || !colDef) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
94
102
|
ref: ref,
|
|
95
103
|
inputRef: inputRef,
|
|
96
104
|
value: valueProp,
|
|
@@ -103,13 +111,14 @@ function GridEditSingleSelectCell(props) {
|
|
|
103
111
|
error: error,
|
|
104
112
|
native: isSelectNative,
|
|
105
113
|
fullWidth: true
|
|
106
|
-
}, other, rootProps.
|
|
114
|
+
}, other, rootProps.slotProps?.baseSelect, {
|
|
107
115
|
children: valueOptions.map(valueOption => {
|
|
108
|
-
const value =
|
|
109
|
-
return /*#__PURE__*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
const value = getOptionValue(valueOption);
|
|
117
|
+
return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, rootProps.slotProps?.baseSelectOption || {}, {
|
|
118
|
+
native: isSelectNative,
|
|
119
|
+
key: value,
|
|
120
|
+
value: value
|
|
121
|
+
}), getOptionLabel(valueOption));
|
|
113
122
|
})
|
|
114
123
|
}));
|
|
115
124
|
}
|
|
@@ -140,11 +149,17 @@ process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
|
140
149
|
*/
|
|
141
150
|
formattedValue: PropTypes.any,
|
|
142
151
|
/**
|
|
143
|
-
* Used to determine the
|
|
152
|
+
* Used to determine the label displayed for a given value option.
|
|
144
153
|
* @param {ValueOptions} value The current value option.
|
|
145
154
|
* @returns {string} The text to be displayed.
|
|
146
155
|
*/
|
|
147
156
|
getOptionLabel: PropTypes.func,
|
|
157
|
+
/**
|
|
158
|
+
* Used to determine the value used for a value option.
|
|
159
|
+
* @param {ValueOptions} value The current value option.
|
|
160
|
+
* @returns {string} The value to be used.
|
|
161
|
+
*/
|
|
162
|
+
getOptionValue: PropTypes.func,
|
|
148
163
|
/**
|
|
149
164
|
* If true, the cell is the active element.
|
|
150
165
|
*/
|
|
@@ -37,7 +37,7 @@ export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
|
|
|
37
37
|
}, [apiRef, colDef.field]);
|
|
38
38
|
return /*#__PURE__*/_jsx("div", {
|
|
39
39
|
className: classes.root,
|
|
40
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
40
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
41
41
|
ref: iconButtonRef,
|
|
42
42
|
tabIndex: -1,
|
|
43
43
|
className: classes.button,
|
|
@@ -49,8 +49,8 @@ export const ColumnHeaderMenuIcon = /*#__PURE__*/React.memo(props => {
|
|
|
49
49
|
"aria-haspopup": "true",
|
|
50
50
|
"aria-controls": columnMenuId,
|
|
51
51
|
id: columnMenuButtonId
|
|
52
|
-
}, rootProps.
|
|
53
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
52
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
53
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuIcon, {
|
|
54
54
|
fontSize: "small"
|
|
55
55
|
})
|
|
56
56
|
}))
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -21,32 +21,26 @@ const GridColumnHeadersRoot = styled('div', {
|
|
|
21
21
|
name: 'MuiDataGrid',
|
|
22
22
|
slot: 'ColumnHeaders',
|
|
23
23
|
overridesResolver: (props, styles) => styles.columnHeaders
|
|
24
|
-
})(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
borderBottom: '1px solid',
|
|
34
|
-
borderTopLeftRadius: theme.shape.borderRadius,
|
|
35
|
-
borderTopRightRadius: theme.shape.borderRadius
|
|
36
|
-
};
|
|
24
|
+
})({
|
|
25
|
+
position: 'relative',
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
boxSizing: 'border-box',
|
|
30
|
+
borderBottom: '1px solid',
|
|
31
|
+
borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',
|
|
32
|
+
borderTopRightRadius: 'var(--unstable_DataGrid-radius)'
|
|
37
33
|
});
|
|
38
|
-
export const
|
|
34
|
+
export const GridBaseColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeaders(props, ref) {
|
|
39
35
|
const {
|
|
40
36
|
className
|
|
41
37
|
} = props,
|
|
42
38
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
43
39
|
const rootProps = useGridRootProps();
|
|
44
|
-
const
|
|
45
|
-
classes: rootProps.classes
|
|
46
|
-
};
|
|
47
|
-
const classes = useUtilityClasses(ownerState);
|
|
40
|
+
const classes = useUtilityClasses(rootProps);
|
|
48
41
|
return /*#__PURE__*/_jsx(GridColumnHeadersRoot, _extends({
|
|
49
42
|
ref: ref,
|
|
50
|
-
className: clsx(className, classes.root)
|
|
43
|
+
className: clsx(className, classes.root),
|
|
44
|
+
ownerState: rootProps
|
|
51
45
|
}, other));
|
|
52
46
|
});
|
|
@@ -51,22 +51,22 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
51
51
|
if (!counter) {
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
const iconButton = /*#__PURE__*/_jsx(rootProps.
|
|
54
|
+
const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
55
55
|
onClick: toggleFilter,
|
|
56
56
|
color: "default",
|
|
57
57
|
"aria-label": apiRef.current.getLocaleText('columnHeaderFiltersLabel'),
|
|
58
58
|
size: "small",
|
|
59
59
|
tabIndex: -1
|
|
60
|
-
}, rootProps.
|
|
61
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
60
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
61
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnFilteredIcon, {
|
|
62
62
|
className: classes.icon,
|
|
63
63
|
fontSize: "small"
|
|
64
64
|
})
|
|
65
65
|
}));
|
|
66
|
-
return /*#__PURE__*/_jsx(rootProps.
|
|
66
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
67
67
|
title: apiRef.current.getLocaleText('columnHeaderFiltersTooltipActive')(counter),
|
|
68
68
|
enterDelay: 1000
|
|
69
|
-
}, rootProps.
|
|
69
|
+
}, rootProps.slotProps?.baseTooltip, {
|
|
70
70
|
children: /*#__PURE__*/_jsxs(GridIconButtonContainer, {
|
|
71
71
|
children: [counter > 1 && /*#__PURE__*/_jsx(Badge, {
|
|
72
72
|
badgeContent: counter,
|
|
@@ -117,16 +117,16 @@ function GridColumnHeaderItem(props) {
|
|
|
117
117
|
field: colDef.field,
|
|
118
118
|
open: columnMenuOpen,
|
|
119
119
|
target: iconButtonRef.current,
|
|
120
|
-
ContentComponent: rootProps.
|
|
121
|
-
contentComponentProps: rootProps.
|
|
120
|
+
ContentComponent: rootProps.slots.columnMenu,
|
|
121
|
+
contentComponentProps: rootProps.slotProps?.columnMenu,
|
|
122
122
|
onExited: handleExited
|
|
123
123
|
});
|
|
124
124
|
const sortingOrder = colDef.sortingOrder ?? rootProps.sortingOrder;
|
|
125
125
|
const columnTitleIconButtons = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
126
|
-
children: [!rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.
|
|
126
|
+
children: [!rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.slots.columnHeaderFilterIconButton, _extends({
|
|
127
127
|
field: colDef.field,
|
|
128
128
|
counter: filterItemsCounter
|
|
129
|
-
}, rootProps.
|
|
129
|
+
}, rootProps.slotProps?.columnHeaderFilterIconButton)), colDef.sortable && !colDef.hideSortIcons && /*#__PURE__*/_jsx(GridColumnHeaderSortIcon, {
|
|
130
130
|
direction: sortDirection,
|
|
131
131
|
index: sortIndex,
|
|
132
132
|
sortingOrder: sortingOrder
|
|
@@ -52,7 +52,7 @@ function GridColumnHeaderSeparatorRaw(props) {
|
|
|
52
52
|
}
|
|
53
53
|
}, other, {
|
|
54
54
|
onClick: stopClick,
|
|
55
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
55
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnResizeIcon, {
|
|
56
56
|
className: classes.icon
|
|
57
57
|
})
|
|
58
58
|
}))
|
|
@@ -22,11 +22,11 @@ function getIcon(icons, direction, className, sortingOrder) {
|
|
|
22
22
|
let Icon;
|
|
23
23
|
const iconProps = {};
|
|
24
24
|
if (direction === 'asc') {
|
|
25
|
-
Icon = icons.
|
|
25
|
+
Icon = icons.columnSortedAscendingIcon;
|
|
26
26
|
} else if (direction === 'desc') {
|
|
27
|
-
Icon = icons.
|
|
27
|
+
Icon = icons.columnSortedDescendingIcon;
|
|
28
28
|
} else {
|
|
29
|
-
Icon = icons.
|
|
29
|
+
Icon = icons.columnUnsortedIcon;
|
|
30
30
|
iconProps.sortingOrder = sortingOrder;
|
|
31
31
|
}
|
|
32
32
|
return Icon ? /*#__PURE__*/_jsx(Icon, _extends({
|
|
@@ -46,16 +46,16 @@ function GridColumnHeaderSortIconRaw(props) {
|
|
|
46
46
|
classes: rootProps.classes
|
|
47
47
|
});
|
|
48
48
|
const classes = useUtilityClasses(ownerState);
|
|
49
|
-
const iconElement = getIcon(rootProps.
|
|
49
|
+
const iconElement = getIcon(rootProps.slots, direction, classes.icon, sortingOrder);
|
|
50
50
|
if (!iconElement) {
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
|
-
const iconButton = /*#__PURE__*/_jsx(rootProps.
|
|
53
|
+
const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
54
54
|
tabIndex: -1,
|
|
55
55
|
"aria-label": apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
|
|
56
56
|
title: apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
|
|
57
57
|
size: "small"
|
|
58
|
-
}, rootProps.
|
|
58
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
59
59
|
children: iconElement
|
|
60
60
|
}));
|
|
61
61
|
return /*#__PURE__*/_jsxs(GridIconButtonContainer, {
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { isOverflown } from '../../utils/domUtils';
|
|
10
10
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
11
11
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -23,27 +23,23 @@ const GridColumnHeaderTitleRoot = styled('div', {
|
|
|
23
23
|
name: 'MuiDataGrid',
|
|
24
24
|
slot: 'ColumnHeaderTitle',
|
|
25
25
|
overridesResolver: (props, styles) => styles.columnHeaderTitle
|
|
26
|
-
})(
|
|
27
|
-
theme
|
|
28
|
-
}) => ({
|
|
26
|
+
})({
|
|
29
27
|
textOverflow: 'ellipsis',
|
|
30
28
|
overflow: 'hidden',
|
|
31
29
|
whiteSpace: 'nowrap',
|
|
32
|
-
fontWeight:
|
|
33
|
-
})
|
|
30
|
+
fontWeight: 'var(--unstable_DataGrid-headWeight)'
|
|
31
|
+
});
|
|
34
32
|
const ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHeaderInnerTitle(props, ref) {
|
|
35
33
|
const {
|
|
36
34
|
className
|
|
37
35
|
} = props,
|
|
38
36
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
39
37
|
const rootProps = useGridRootProps();
|
|
40
|
-
const
|
|
41
|
-
classes: rootProps.classes
|
|
42
|
-
};
|
|
43
|
-
const classes = useUtilityClasses(ownerState);
|
|
38
|
+
const classes = useUtilityClasses(rootProps);
|
|
44
39
|
return /*#__PURE__*/_jsx(GridColumnHeaderTitleRoot, _extends({
|
|
45
40
|
ref: ref,
|
|
46
|
-
className: clsx(classes.root, className)
|
|
41
|
+
className: clsx(classes.root, className),
|
|
42
|
+
ownerState: rootProps
|
|
47
43
|
}, other));
|
|
48
44
|
});
|
|
49
45
|
// No React.memo here as if we display the sort icon, we need to recalculate the isOver
|
|
@@ -66,9 +62,9 @@ function GridColumnHeaderTitle(props) {
|
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
64
|
}, [titleRef, columnWidth, description, label]);
|
|
69
|
-
return /*#__PURE__*/_jsx(rootProps.
|
|
65
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
70
66
|
title: description || tooltip
|
|
71
|
-
}, rootProps.
|
|
67
|
+
}, rootProps.slotProps?.baseTooltip, {
|
|
72
68
|
children: /*#__PURE__*/_jsx(ColumnHeaderInnerTitle, {
|
|
73
69
|
ref: titleRef,
|
|
74
70
|
children: label
|
|
@@ -4,7 +4,7 @@ const _excluded = ["isDragging", "className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { gridClasses, getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
@@ -45,14 +45,14 @@ export const GridColumnHeadersInner = /*#__PURE__*/React.forwardRef(function Gri
|
|
|
45
45
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
46
46
|
const apiRef = useGridApiContext();
|
|
47
47
|
const rootProps = useGridRootProps();
|
|
48
|
-
const ownerState = {
|
|
48
|
+
const ownerState = _extends({}, rootProps, {
|
|
49
49
|
isDragging,
|
|
50
|
-
hasScrollX: apiRef.current.getRootDimensions()?.hasScrollX ?? false
|
|
51
|
-
|
|
52
|
-
};
|
|
50
|
+
hasScrollX: apiRef.current.getRootDimensions()?.hasScrollX ?? false
|
|
51
|
+
});
|
|
53
52
|
const classes = useUtilityClasses(ownerState);
|
|
54
53
|
return /*#__PURE__*/_jsx(GridColumnHeadersInnerRoot, _extends({
|
|
55
54
|
ref: ref,
|
|
56
|
-
className: clsx(className, classes.root)
|
|
55
|
+
className: clsx(className, classes.root),
|
|
56
|
+
ownerState: ownerState
|
|
57
57
|
}, other));
|
|
58
58
|
});
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -32,12 +32,10 @@ export const GridIconButtonContainer = /*#__PURE__*/React.forwardRef(function Gr
|
|
|
32
32
|
} = props,
|
|
33
33
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
34
34
|
const rootProps = useGridRootProps();
|
|
35
|
-
const
|
|
36
|
-
classes: rootProps.classes
|
|
37
|
-
};
|
|
38
|
-
const classes = useUtilityClasses(ownerState);
|
|
35
|
+
const classes = useUtilityClasses(rootProps);
|
|
39
36
|
return /*#__PURE__*/_jsx(GridIconButtonContainerRoot, _extends({
|
|
40
37
|
ref: ref,
|
|
41
|
-
className: clsx(classes.root, className)
|
|
38
|
+
className: clsx(classes.root, className),
|
|
39
|
+
ownerState: rootProps
|
|
42
40
|
}, other));
|
|
43
41
|
});
|
|
@@ -73,7 +73,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
73
73
|
}
|
|
74
74
|
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
75
75
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
76
|
-
return /*#__PURE__*/_jsx(rootProps.
|
|
76
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
|
|
77
77
|
ref: handleRef,
|
|
78
78
|
tabIndex: tabIndex,
|
|
79
79
|
checked: isChecked,
|
|
@@ -85,7 +85,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
85
85
|
onKeyDown: handleKeyDown,
|
|
86
86
|
disabled: !isSelectable,
|
|
87
87
|
touchRippleRef: rippleRef
|
|
88
|
-
}, rootProps.
|
|
88
|
+
}, rootProps.slotProps?.baseCheckbox, other));
|
|
89
89
|
});
|
|
90
90
|
process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
91
91
|
// ----------------------------- Warning --------------------------------
|
|
@@ -92,7 +92,7 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
92
92
|
return apiRef.current.subscribeEvent('rowSelectionChange', handleSelectionChange);
|
|
93
93
|
}, [apiRef, handleSelectionChange]);
|
|
94
94
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectAllRows' : 'checkboxSelectionSelectAllRows');
|
|
95
|
-
return /*#__PURE__*/_jsx(rootProps.
|
|
95
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
|
|
96
96
|
ref: ref,
|
|
97
97
|
indeterminate: isIndeterminate,
|
|
98
98
|
checked: isChecked,
|
|
@@ -103,7 +103,7 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
103
103
|
},
|
|
104
104
|
tabIndex: tabIndex,
|
|
105
105
|
onKeyDown: handleKeyDown
|
|
106
|
-
}, rootProps.
|
|
106
|
+
}, rootProps.slotProps?.baseCheckbox, other));
|
|
107
107
|
});
|
|
108
108
|
process.env.NODE_ENV !== "production" ? GridHeaderCheckbox.propTypes = {
|
|
109
109
|
// ----------------------------- Warning --------------------------------
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -22,15 +22,12 @@ const GridFooterContainerRoot = styled('div', {
|
|
|
22
22
|
name: 'MuiDataGrid',
|
|
23
23
|
slot: 'FooterContainer',
|
|
24
24
|
overridesResolver: (props, styles) => styles.footerContainer
|
|
25
|
-
})(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// Match TablePagination min height
|
|
32
|
-
borderTop: '1px solid'
|
|
33
|
-
};
|
|
25
|
+
})({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
justifyContent: 'space-between',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
minHeight: 52,
|
|
30
|
+
borderTop: '1px solid'
|
|
34
31
|
});
|
|
35
32
|
const GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFooterContainer(props, ref) {
|
|
36
33
|
const {
|
|
@@ -38,13 +35,11 @@ const GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFooterCon
|
|
|
38
35
|
} = props,
|
|
39
36
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
37
|
const rootProps = useGridRootProps();
|
|
41
|
-
const
|
|
42
|
-
classes: rootProps.classes
|
|
43
|
-
};
|
|
44
|
-
const classes = useUtilityClasses(ownerState);
|
|
38
|
+
const classes = useUtilityClasses(rootProps);
|
|
45
39
|
return /*#__PURE__*/_jsx(GridFooterContainerRoot, _extends({
|
|
46
40
|
ref: ref,
|
|
47
|
-
className: clsx(classes.root, className)
|
|
41
|
+
className: clsx(classes.root, className),
|
|
42
|
+
ownerState: rootProps
|
|
48
43
|
}, other));
|
|
49
44
|
});
|
|
50
45
|
process.env.NODE_ENV !== "production" ? GridFooterContainer.propTypes = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
3
|
-
import { styled } from '@mui/
|
|
3
|
+
import { styled } from '@mui/system';
|
|
4
4
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
5
5
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -26,12 +26,10 @@ const GridMainContainerRoot = styled('div', {
|
|
|
26
26
|
}));
|
|
27
27
|
export function GridMainContainer(props) {
|
|
28
28
|
const rootProps = useGridRootProps();
|
|
29
|
-
const
|
|
30
|
-
classes: rootProps.classes
|
|
31
|
-
};
|
|
32
|
-
const classes = useUtilityClasses(ownerState);
|
|
29
|
+
const classes = useUtilityClasses(rootProps);
|
|
33
30
|
return /*#__PURE__*/_jsx(GridMainContainerRoot, {
|
|
34
31
|
className: classes.root,
|
|
32
|
+
ownerState: rootProps,
|
|
35
33
|
children: props.children
|
|
36
34
|
});
|
|
37
35
|
}
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import {
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -22,30 +22,26 @@ const GridOverlayRoot = styled('div', {
|
|
|
22
22
|
name: 'MuiDataGrid',
|
|
23
23
|
slot: 'Overlay',
|
|
24
24
|
overridesResolver: (_, styles) => styles.overlay
|
|
25
|
-
})(
|
|
26
|
-
theme
|
|
27
|
-
}) => ({
|
|
25
|
+
})({
|
|
28
26
|
width: '100%',
|
|
29
27
|
height: '100%',
|
|
30
28
|
display: 'flex',
|
|
31
29
|
alignSelf: 'center',
|
|
32
30
|
alignItems: 'center',
|
|
33
31
|
justifyContent: 'center',
|
|
34
|
-
backgroundColor:
|
|
35
|
-
})
|
|
32
|
+
backgroundColor: 'var(--unstable_DataGrid-overlayBackground)'
|
|
33
|
+
});
|
|
36
34
|
const GridOverlay = /*#__PURE__*/React.forwardRef(function GridOverlay(props, ref) {
|
|
37
35
|
const {
|
|
38
36
|
className
|
|
39
37
|
} = props,
|
|
40
38
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
41
39
|
const rootProps = useGridRootProps();
|
|
42
|
-
const
|
|
43
|
-
classes: rootProps.classes
|
|
44
|
-
};
|
|
45
|
-
const classes = useUtilityClasses(ownerState);
|
|
40
|
+
const classes = useUtilityClasses(rootProps);
|
|
46
41
|
return /*#__PURE__*/_jsx(GridOverlayRoot, _extends({
|
|
47
42
|
ref: ref,
|
|
48
|
-
className: clsx(classes.root, className)
|
|
43
|
+
className: clsx(classes.root, className),
|
|
44
|
+
ownerState: rootProps
|
|
49
45
|
}, other));
|
|
50
46
|
});
|
|
51
47
|
process.env.NODE_ENV !== "production" ? GridOverlay.propTypes = {
|
|
@@ -41,11 +41,9 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
41
41
|
const rootContainerRef = React.useRef(null);
|
|
42
42
|
const handleRef = useForkRef(rootContainerRef, ref);
|
|
43
43
|
const pinnedRowsCount = useGridSelector(apiRef, gridPinnedRowsCountSelector);
|
|
44
|
-
const ownerState = {
|
|
45
|
-
density: densityValue
|
|
46
|
-
|
|
47
|
-
autoHeight: rootProps.autoHeight
|
|
48
|
-
};
|
|
44
|
+
const ownerState = _extends({}, rootProps, {
|
|
45
|
+
density: densityValue
|
|
46
|
+
});
|
|
49
47
|
const classes = useUtilityClasses(ownerState);
|
|
50
48
|
apiRef.current.register('public', {
|
|
51
49
|
rootElementRef: rootContainerRef
|
|
@@ -67,6 +65,7 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
67
65
|
return /*#__PURE__*/_jsx(GridRootStyles, _extends({
|
|
68
66
|
ref: handleRef,
|
|
69
67
|
className: clsx(className, classes.root),
|
|
68
|
+
ownerState: ownerState,
|
|
70
69
|
role: "grid",
|
|
71
70
|
"aria-colcount": visibleColumns.length,
|
|
72
71
|
"aria-rowcount": headerGroupingMaxDepth + 1 + pinnedRowsCount + totalRowCount,
|
|
@@ -132,14 +132,18 @@ export const GridRootStyles = styled('div', {
|
|
|
132
132
|
theme
|
|
133
133
|
}) => {
|
|
134
134
|
const borderColor = getBorderColor(theme);
|
|
135
|
+
const radius = theme.shape.borderRadius;
|
|
135
136
|
const gridStyle = _extends({
|
|
137
|
+
'--unstable_DataGrid-radius': typeof radius === 'number' ? `${radius}px` : radius,
|
|
138
|
+
'--unstable_DataGrid-headWeight': theme.typography.fontWeightMedium,
|
|
139
|
+
'--unstable_DataGrid-overlayBackground': theme.vars ? `rgba(${theme.vars.palette.background.defaultChannel} / ${theme.vars.palette.action.disabledOpacity})` : alpha(theme.palette.background.default, theme.palette.action.disabledOpacity),
|
|
136
140
|
flex: 1,
|
|
137
141
|
boxSizing: 'border-box',
|
|
138
142
|
position: 'relative',
|
|
139
143
|
borderWidth: '1px',
|
|
140
144
|
borderStyle: 'solid',
|
|
141
145
|
borderColor,
|
|
142
|
-
borderRadius:
|
|
146
|
+
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
143
147
|
color: (theme.vars || theme).palette.text.primary
|
|
144
148
|
}, theme.typography.body2, {
|
|
145
149
|
outline: 'none',
|
|
@@ -434,13 +438,13 @@ export const GridRootStyles = styled('div', {
|
|
|
434
438
|
[`& .${gridClasses['columnHeader--dragging']}, & .${gridClasses['row--dragging']}`]: {
|
|
435
439
|
background: (theme.vars || theme).palette.background.paper,
|
|
436
440
|
padding: '0 12px',
|
|
437
|
-
borderRadius:
|
|
441
|
+
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
438
442
|
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
439
443
|
},
|
|
440
444
|
[`& .${gridClasses['row--dragging']}`]: {
|
|
441
445
|
background: (theme.vars || theme).palette.background.paper,
|
|
442
446
|
padding: '0 12px',
|
|
443
|
-
borderRadius:
|
|
447
|
+
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
444
448
|
opacity: (theme.vars || theme).palette.action.disabledOpacity,
|
|
445
449
|
[`& .${gridClasses.rowReorderCellPlaceholder}`]: {
|
|
446
450
|
display: 'flex'
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className", "children"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -38,16 +38,14 @@ const GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridToolbarC
|
|
|
38
38
|
} = props,
|
|
39
39
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
40
|
const rootProps = useGridRootProps();
|
|
41
|
-
const
|
|
42
|
-
classes: rootProps.classes
|
|
43
|
-
};
|
|
44
|
-
const classes = useUtilityClasses(ownerState);
|
|
41
|
+
const classes = useUtilityClasses(rootProps);
|
|
45
42
|
if (!children) {
|
|
46
43
|
return null;
|
|
47
44
|
}
|
|
48
45
|
return /*#__PURE__*/_jsx(GridToolbarContainerRoot, _extends({
|
|
49
46
|
ref: ref,
|
|
50
|
-
className: clsx(className, classes.root)
|
|
47
|
+
className: clsx(className, classes.root),
|
|
48
|
+
ownerState: rootProps
|
|
51
49
|
}, other, {
|
|
52
50
|
children: children
|
|
53
51
|
}));
|
|
@@ -3,7 +3,7 @@ export * from './cell';
|
|
|
3
3
|
export * from './containers';
|
|
4
4
|
export * from './columnHeaders';
|
|
5
5
|
export * from './columnSelection';
|
|
6
|
-
export * from '
|
|
6
|
+
export * from '../material/icons';
|
|
7
7
|
export * from './menu';
|
|
8
8
|
export * from './panel';
|
|
9
9
|
export * from './toolbar';
|