July 31, 2021
Big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
- ⚛️ Complete the idiomatic support of controllable props (#2143, #2099) @m4theushw, @flaviendelangle
- ✨ Improve support of @material-ui/core@v5 (#2224, #2240) @oliviertassinari, @siriwatknp
- 🐛 Fix 7 bugs and regressions
@material-ui/data-grid@v4.0.0-alpha.35
/ @material-ui/x-grid@v4.0.0-alpha.35
Breaking changes
-
[DataGrid] Improve controllable cell edit (#2143) @m4theushw
- The
onEditCellChange
prop was renamed toonEditCellPropsChange
. - The
onEditCellChangeCommitted
prop was renamed toonCellEditCommit
. - The
onEditRowModelChange
prop was removed. Use the newonEditRowsModelChange
prop.-onEditRowModelChange?: (params: GridEditRowModelParams) +onEditRowsModelChange?: (editRowsModel: GridEditRowsModel)
- The
-
[XGrid] Improve controllable cell edit (#2143) @m4theushw
- The
cellEditPropsChange
event was renamed toeditCellPropsChange
. - The
cellEditPropsChangeCommitted
event was renamed tocellEditCommit
. - The
cellValueChange
event was removed. Listen tocellEditCommit
to detect when the value is committed. - The
editRowModelChange
event was renamed toeditRowsModelChange
.
- The
-
[DataGrid] Improve controllable pagination (#2099) @flaviendelangle
-
The
pageSize
is now a controlled prop. If you set a value, you also need to handle updates with onPageSizeChange. See the documentation. -
Change the controllable API signature:
// Signature -onPageChange?: (params: GridPageChangeParams) => void; +onPageChange?: (page: number) => void; // Usage -<DataGrid onPageChange={(params: GridPageChangeParams) => setPage(params.page)} /> +<DataGrid onPageChange={(page: number) => setPage(page)} />
// Signature -onPageSizeChange?: (params: GridPageChangeParams) => void; +onPageSizeChange?: (pageSize: number) => void; // Usage -<DataGrid onPageSizeChange={(params: GridPageChangeParams) => setPageSize(params.pageSize)} /> +<DataGrid onPageSizeChange={(pageSize: number) => setPageSize(pageSize)} />
-
Changes
- [DataGrid] Fix
Controlled selection
console error (#2197) @ZeeshanTamboli - [DataGrid] Fix
disableMultipleColumnsFiltering
console warning @ZeeshanTamboli - [DataGrid] Fix CSV export when selected row id is number (#2232) @flaviendelangle
- [DataGrid] Fix horizontal scroll when no rows (#2159) @m4theushw
- [DataGrid] Fix id passed to setEditCellValue (#2215) @m4theushw
- [DataGrid] Fix missing value in onCellEditCommit (#2214) @m4theushw
- [DataGrid] Fix prop-type warning with v5 (#2224) @oliviertassinari
- [DataGrid] Fix support for singleSelect with numeric values (#2112) @m4theushw
- [DataGrid] Improve translations to the Turkish locale (#2203) @cihanyakar
- [DataGrid] Use event.defaultMuiPrevented to prevent the default behavior (#2179) @m4theushw
- [DataGrid] Warn when pageSize is not present in rowsPerPageOptions (#2014) @flaviendelangle
- [XGrid] Fix v5 filter select display (#2240) @siriwatknp
Docs
- [docs] Add missing API docs (#2167) @ZeeshanTamboli
- [docs] Describe how to export custom rendered cells (#2194) @m4theushw
- [docs] Generate api doc for the GridExportCSVOptions interface (#2102) @flaviendelangle
- [docs] Handle generics in api doc generation (#2210) @flaviendelangle
Core
- [core] Don't export the internal utils (#2233) @flaviendelangle
- [core] Receive patch and minor dependency updates (#2221) @flaviendelangle
- [test] Add tests for column resizing (#2211) @flaviendelangle
- [test] Fix singleSelect tests (#2200) @m4theushw
- [test] Sync Karma config (#2191) @m4theushw
- [test] Test support for theme translations (#2229) @m4theushw