v7.0.0-alpha.9
Pre-releaseWe'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
- 🎁 The Data Grid headers have been refactored to bring immense improvements to scrolling, state management, and overall performance of the grid.
- ⚙️ The Data Grid disabled column-specific features like filtering, sorting, grouping, etc. could now be accessed programmatically. See the related docs section.
- 🚀 Uplift the
SimpleTreeView
customization examples (#11424) @noraleonte - 🌍 Add Croatian (hr-HR), Portuguese (pt-PT), and Chinese (Hong Kong) (zh-HK) locales (#11668) on the Data Grid @BCaspari
- 🐞 Bugfixes
- 💔 Bump
@mui/material
peer dependency for all packages (#11692) @LukasTy
The minimum required version of@mui/material
is now5.15.0
.
Data Grid
Breaking changes
-
The
ariaV7
experimental flag has been removed and the Data Grid now uses the improved accessibility implementation by default.
If you were using theariaV7
flag, you can remove it from theexperimentalFeatures
prop:-<DataGrid experimentalFeatures={{ ariaV7: true }} /> +<DataGrid />
The most notable changes that might affect your application or tests are:
-
The
role="grid"
attribute along with related ARIA attributes are now applied to the innerdiv
element instead of the rootdiv
element:-<div class="MuiDataGrid-root" role="grid" aria-colcount="5" aria-rowcount="101" aria-multiselectable="false"> +<div class="MuiDataGrid-root"> <div class="MuiDataGrid-toolbarContainer"></div> - <div class="MuiDataGrid-main"></div> + <div class="MuiDataGrid-main" role="grid" aria-colcount="5" aria-rowcount="101" aria-multiselectable="false"></div> <div class="MuiDataGrid-footerContainer"></div> </div>
-
When the Tree data feature is used, the grid role is now
role="treegrid"
instead ofrole="grid"
. -
The Data Grid cells now have
role="gridcell"
instead ofrole="cell"
. -
The buttons in toolbar composable components
GridToolbarColumnsButton
,GridToolbarFilterButton
,GridToolbarDensity
, andGridToolbarExport
are now wrapped with a tooltip component and have a consistent interface. To override some props corresponding to the toolbar buttons or their corresponding tooltips, you can use theslotProps
prop. Following is an example diff. See Toolbar section for more details.function CustomToolbar() { return ( <GridToolbarContainer> <GridToolbarColumnsButton /> <GridToolbarFilterButton - title="Custom filter" // 🛑 This was previously forwarded to the tooltip component + slotProps={{ tooltip: { title: 'Custom filter' } }} // ✅ This is the correct way now /> <GridToolbarDensitySelector - variant="outlined" // 🛑 This was previously forwarded to the button component + slotProps={{ button: { variant: 'outlined' } }} // ✅ This is the correct way now /> </GridToolbarContainer> ); }
-
-
Column grouping is now enabled by default. The flag
columnGrouping
is no longer needed to be passed to theexperimentalFeatures
prop to enable it.-<DataGrid experimentalFeatures={{ columnGrouping: true }} /> +<DataGrid />
-
The column grouping API methods
getColumnGroupPath
andgetAllGroupDetails
are no longer prefixed withunstable_
. -
The column grouping selectors
gridFocusColumnGroupHeaderSelector
andgridTabIndexColumnGroupHeaderSelector
are no longer prefixed withunstable_
. -
The disabled column specific features like
hiding
,sorting
,filtering
,pinning
,row grouping
, etc could now be controlled programmatically usinginitialState
, respective controlled models, or the API object. See the related docs section.
@mui/[email protected]
- [DataGrid] Allow to filter non-filterable columns programmatically (#11538) @MBilalShafi
- [DataGrid] Allow to programmatically sort unsortable columns (#11512) @MBilalShafi
- [DataGrid] Fix incorrect default value for
filterModel.logicOperator
(#11673) @MBilalShafi - [DataGrid] Make
column grouping
feature stable (#11698) @MBilalShafi - [DataGrid] Remove the
ariaV7
experimental flag (#11428) @cherniavskii - [DataGrid] Start the FAQ page (#11686) @MBilalShafi
- [DataGrid] Sticky headers (#10059) @romgrk
- [DataGrid] Wrap toolbar buttons with tooltip (#11357) @MBilalShafi
- [l10n] Add Croatian (hr-HR), Portuguese (pt-PT), and Chinese (Hong Kong) (zh-HK) locales (#11668) @BCaspari
@mui/[email protected]
Same changes as in @mui/[email protected]
, plus:
- [DataGridPro] Allow non-pinnable columns to be pinned programmatically (#11680) @MBilalShafi
@mui/[email protected]
Same changes as in @mui/[email protected]
, plus:
- [DataGridPremium] Allow aggregation to be applied for non-aggregable columns (#11574) @MBilalShafi
- [DataGridPremium] Allow programmatically grouping non-groupable columns (#11539) @MBilalShafi
Date Pickers
Breaking changes
-
The
locales
export has been removed from the root of the packages.
If you were importing locales from the root, be sure to update it:-import { frFR } from '@mui/x-date-pickers'; +import { frFR } from '@mui/x-date-pickers/locales';
@mui/[email protected]
- [fields] Make
PickersTextField
and its dependencies public (#11581) @flaviendelangle - [fields] Support farsi digits (#11639) @flaviendelangle
- [pickers] Fix AdapterLuxon
getWeekNumber
behavior (#11697) @LukasTy - [pickers] Stop root exporting
locales
(#11612) @LukasTy
@mui/[email protected]
Same changes as in @mui/[email protected]
.
Charts / @mui/[email protected]
- [charts] Do not propagate
innerRadius
andouterRadius
to the DOM (#11689) @alexfauquette - [charts] Fix default
stackOffset
forLineChart
(#11647) @alexfauquette - [charts] Remove a TS ignore (#11688) @alexfauquette
Tree View
Breaking changes
-
The
expandIcon
/defaultExpandIcon
props, used to expand the children of a node (rendered when it is collapsed),
is now defined as a slot both on the Tree View and the Tree Item components.If you were using the
ChevronRight
icon from@mui/icons-material
,
you can stop passing it to your component because it is now the default value:-import ChevronRightIcon from '@mui/icons-material/ChevronRight'; <SimpleTreeView - defaultExpandIcon={<ChevronRightIcon />} > {items} </SimpleTreeView>
If you were passing another icon to your Tree View component,
you need to use the newexpandIcon
slot on this component:<SimpleTreeView - defaultExpandIcon={<MyCustomExpandIcon />} + slots={{ expandIcon: MyCustomExpandIcon }} > {items} </SimpleTreeView>
If you were passing another icon to your Tree Item component,
you need to use the newexpandIcon
slot on this component:<SimpleTreeView> <TreeItem nodeId="1" label="Node 1" - expandIcon={<MyCustomExpandIcon />} + slots={{ expandIcon: MyCustomExpandIcon }} /> </SimpleTreeView>
-
The
collapseIcon
/defaultCollapseIcon
props, used to collapse the children of a node (rendered when it is expanded),
is now defined as a slot both on the Tree View and the Tree Item components.If you were using the
ExpandMore
icon from@mui/icons-material
,
you can stop passing it to your component because it is now the default value:- import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; <SimpleTreeView - defaultCollapseIcon={<ExpandMoreIcon />} > {items} </SimpleTreeView>
If you were passing another icon to your Tree View component,
you need to use the newcollapseIcon
slot on this component:<SimpleTreeView - defaultCollapseIcon={<MyCustomCollapseIcon />} + slots={{ collapseIcon: MyCustomCollapseIcon }} > {items} </SimpleTreeView>
If you were passing another icon to your Tree Item component,
you need to use the newcollapseIcon
slot on this component:<SimpleTreeView> <TreeItem nodeId="1" label="Node 1" - collapseIcon={<MyCustomCollapseIcon />} + slots={{ collapseIcon: MyCustomCollapseIcon }} /> </SimpleTreeView>
-
The
useTreeItem
hook has been renameduseTreeItemState
.
This will help create a new headless version of theTreeItem
component based on a futureuseTreeItem
hook.-import { TreeItem, useTreeItem } from '@mui/x-tree-view/TreeItem'; +import { TreeItem, useTreeItemState } from '@mui/x-tree-view/TreeItem'; const CustomContent = React.forwardRef((props, ref) => { - const { disabled } = useTreeItem(props.nodeId); + const { disabled } = useTreeItemState(props.nodeId); // Render some UI }); function App() { return ( <SimpleTreeView> <TreeItem ContentComponent={CustomContent} /> </SimpleTreeView> ) }
-
The
parentIcon
prop has been removed from the Tree View components.If you were passing an icon to your Tree View component,
you can achieve the same behavior
by passing the same icon to both thecollapseIcon
and theexpandIcon
slots on this component:<SimpleTreeView - defaultParentIcon={<MyCustomParentIcon />} + slots={{ collapseIcon: MyCustomParentIcon, expandIcon: MyCustomParentIcon }} > {items} </SimpleTreeView>
-
The
endIcon
/defaultEndIcon
props, rendered next to an item without children,
is now defined as a slot both on the Tree View and the Tree Item components.If you were passing an icon to your Tree View component,
you need to use the newendIcon
slot on this component:<SimpleTreeView - defaultEndIcon={<MyCustomEndIcon />} + slots={{ endIcon: MyCustomEndIcon }} > {items} </SimpleTreeView>
If you were passing an icon to your Tree Item component,
you need to use the newendIcon
slot on this component:<SimpleTreeView> <TreeItem nodeId="1" label="Node 1" - endIcon={<MyCustomEndIcon />} + slots={{ endIcon: MyCustomEndIcon }} /> </SimpleTreeView>
-
The
icon
prop, rendered next to an item without children,
is now defined as a slot on the Tree Item component.If you were passing an icon to your Tree Item component,
you need to use the newicon
slot on this component:<SimpleTreeView> <TreeItem nodeId="1" label="Node 1" - icon={<MyCustomIcon />} + slots={{ icon: MyCustomIcon }} /> </SimpleTreeView>
@mui/[email protected]
- [TreeView] Adjust expansion and selection docs (#11723) @noraleonte
- [TreeView] Improve plugin signature definition (#11665) @flaviendelangle
- [TreeView] Make each plugin responsible for its context value (#11623) @flaviendelangle
- [TreeView] Migrate remaining icon props to slots (#11713) @flaviendelangle
- [TreeView] Pass through
Theme
generic to variants (#11480) @dhulme - [TreeView] Rename
useTreeItem
touseTreeItemState
(#11712) @flaviendelangle - [TreeView] Add
slots
andslotProps
on the Tree View components (#11664) @flaviendelangle - [TreeView] Explore a better plugin model API (#11567) @flaviendelangle
Docs
- [docs] Clean the pickers migration guide (#11694) @flaviendelangle
- [docs] Cleanup and fix Pickers Playground styling (#11700) @LukasTy
- [docs] First draft of the Tree View custom plugin doc (#11564) @flaviendelangle
- [docs] Fix Pickers migration syntax and diffs (#11695) @LukasTy
- [docs] Fix generated tree view API docs (#11737) @LukasTy
- [docs] Generate docs for Tree View slots (#11730) @flaviendelangle
- [docs] Improve codemod for v7 (#11650) @oliviertassinari
- [docs] Improve data grid
pageSizeOptions
prop documentation (#11682) @oliviertassinari - [docs] Parse markdown on API docs demo titles (#11728) @LukasTy
- [docs] Remove the description from the
className
prop (#11693) @oliviertassinari - [docs] Uplift
SimpleTreeView
customization examples (#11424) @noraleonte - [docs] Uplift the Date Pickers playground (#11555) @danilo-leal
Core
- [core] Bump
@mui/material
peer dependency for all packages (#11692) @LukasTy - [core] Make
karma
run in parallel (#11571) @romgrk - [core] make
karma-parallel
run under a new command (#11716) @romgrk - [code-infra] Migrate all prettier APIs to the async version (#11732) @Janpot
- [code-infra] Update the Babel macro path (#11479) @michaldudak
- [docs-infra] Enforce brand name rules (#11651) @oliviertassinari
- [test] Fix flaky Data Grid test (#11725) @cherniavskii