Releases: mui/mui-x
v5.0.0-beta.2
Sep 24, 2021
A big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
- 🇻🇳 Add Vietnamese (viVN) locale (#2668) @tuananh281098
- 🇵🇱 Improve Polish (plPL) locale (#2632) @michallukowski
- ⚡️ Apply the
valueFormatter
to thesingleSelect
column type (#2581) @DanailH
@mui/[email protected]
/ @mui/[email protected]
Breaking changes
-
[DataGrid] The params passed to the
valueFormatter
were changed. (#2581) @DanailHUse the
api
to get the missing params.
TheGridValueFormatterParams
interface has the following signature now:-export type GridValueFormatterParams = Omit<GridRenderCellParams, 'formattedValue' | 'isEditable'>; +export interface GridValueFormatterParams { + /** + * The column field of the cell that triggered the event + */ + field: string; + /** + * The cell value, but if the column has valueGetter, use getValue. + */ + value: GridCellValue; + /** + * GridApi that let you manipulate the grid. + */ + api: any; +}
Changes
- [DataGrid] Add Vietnamese (viVN) locale (#2668) @tuananh281098
- [DataGrid] Apply the
valueFormatter
tosingleSelect
select options (#2581) @DanailH - [DataGrid] Free up column header space when icons are not visible (#2606) @DanailH
- [DataGrid] Improve Polish (plPL) locale (#2632) @michallukowski
Docs
- [docs] Add section for controlled selection and server-side pagination (#2602) @DanailH
- [docs] Fix Algolia search (#2655) @oliviertassinari
- [docs] Improve the seach results relevance (#2656) @oliviertassinari
- [docs] Update installation instructions (#2663) @m4theushw
Core
- [core] Upgrade JSS plugins to 10.8.0 (#2667) @m4theushw
v5.0.0-beta.1
Sep 17, 2021
A big thanks to the 3 contributors who made this release possible.
@mui/[email protected]
/ @mui/[email protected]
Docs
- [docs] Explain how to use theme augmentation (#2582) @ZeeshanTamboli
- [docs] Fix formatting (#2626) @m4theushw
- [docs] Include packages from next tag (#2628) @m4theushw
Core
- [core] Copy bin folder when building the libraries (#2627) @flaviendelangle
- [core] Remove prop-types during build (#2586) @m4theushw
v5.0.0-beta.0
Sep 17, 2021
🎉 This is the first release with support for the new MUI v5 🎉!
In the next releases, we will be working to bring all the cool features from MUI v5 to the advanced components.
This beta version of MUI X drops support for MUI v4. We encourage everyone to upgrade to MUI v5 to be able to continue to get all the upcoming features and fixes of MUI X. New versions of MUI X v4, containing only fixes, will still be released, but at a slower pace.
A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
-
⚡ Migrate to the new
@mui/material
and@mui/styles
packages and drop support for@material-ui/core
(#2515, #2571, #2620) @m4theushw -
📚 Migrate to the new documentation infrastructure and design (#2441) (@DanailH, @m4theushw)
-
🎁 Add
actions
column type (#2385) @m4theushwSee the documentation for more details.
-
👁 Allow to disable virtualization with the
disableVirtualization
prop (#2326) @m4theushw -
🚀 Introduce the new
isRowSelected
api method (#2523) @flaviendelangle -
🕹️ Show page size controls on smaller resolutions (#2461) @michaldudak
-
🌎 Add Simplified Chinese (zhCN) localization (#2431) @wlf100220
-
🐞 Bugfixes
@mui/[email protected]
/ @mui/[email protected]
Breaking changes
-
[DataGridPro] Remove
apiRef.current.getState
method.-const state = apiRef.current.getState(); +const state = apiRef.current.state
-
[DataGridPro] The third argument in
apiRef.current.selectRow
is now inverted to keep consistency with other selection APIs. (#2523) @flaviendelangle-selectRow: (id: GridRowId, isSelected?: boolean, allowMultiple?: boolean = false) => void; +selectRow: (id: GridRowId, isSelected?: boolean, resetSelection?: boolean = false) => void;
-
[DataGrid] Remove the
options
prop from the return ofuseGridSlotComponentProps
.-const { options } = useGridSlotComponentProps(); +const rootProps = useGridRootProps();
-
[DataGrid] The module augmentation is not enabled by default. This change was done to prevent conflicts with projects using
DataGrid
andDataGridPro
together.In order to still be able to do overrides at the theme level, add the following imports to your project:
+import type {} from '@mui/x-data-grid/themeAugmentation'; +import type {} from '@mui/x-data-grid-pro/themeAugmentation';
Changes
- [DataGridPro] Only apply
checkboxSelectionVisibleOnly
when pagination is enabled (#2443) @flaviendelangle - [DataGridPro] Remove
apiRef.current.getState
method (#2579) @flaviendelangle - [DataGrid] Add
disableVirtualization
prop (#2326) @m4theushw - [DataGrid] Add missing exports from param models (#2448) @flaviendelangle
- [DataGrid] Add missing keys to the
classes
prop (#2458) @m4theushw - [DataGrid] Add
actions
column type (#2385) @m4theushw - [DataGrid] Add zhCN localization (#2431) @wlf100220
- [DataGrid] Add koKR localization (#2446) @zzossig
- [DataGrid] Clean the selection public API (#2523) @flaviendelangle
- [DataGrid] Do not call
useGridColumnResize
anduseGridInfiniteLoader
(#2580) @flaviendelangle - [DataGrid] Do not show right border of last column header when its cells don't have it (#2444) @flaviendelangle
- [DataGrid] Don't consider unselectable rows when
selectionModel
is used (#2464) @m4theushw - [DataGrid] Drop v4 support (#2515) @m4theushw
- [DataGrid] Export
useGridRootProps
(#2621) @flaviendelangle - [DataGrid] Fire
columnOrderChange
event after state update (#2451) @flaviendelangle - [DataGrid] Fix TypeScript type error for toolbar components (#2393) @ZeeshanTamboli
- [DataGrid] Fix navigation between column headers with rows filtered (#2440) @m4theushw
- [DataGrid] Force
scrollEndThreshold
to undefined (#2574) @flaviendelangle - [DataGrid] Improve jaJP localization (#2502) @daikiojm
- [DataGrid] Make
hideFooterRowCount
prop available only for DataGridPro (#2564) @ZeeshanTamboli - [DataGrid] Fix a bug where pressing Escape was not closing the
GridColumnHeaderMenu
(#2463) @DanailH - [DataGrid] Prevent scroll when selecting rows (#2558) @m4theushw
- [DataGrid] Reduce specificity of
GridToolbarContainer
styles (#2462) @michaldudak - [DataGrid] Remove import to
@material-ui/icons
(#2576) @m4theushw - [DataGrid] Show page size controls on smaller resolutions (#2461) @michaldudak
- [DataGrid] Vertically align column header icons (#2555) @oliviertassinari
- [DataGrid] Fix numeric filter operators not handling '0' correctly (#2528) @flaviendelangle
Docs
- [docs] Clarify confusion between licenses (#2525) @oliviertassinari
- [docs] Fix JSDoc comments (#2452) @m4theushw
- [docs] Fix event argument in onXXX props (#2391) @m4theushw
- [docs] Improve SEO ranking (#2467) @oliviertassinari
- [docs] Replace 'paging' with 'pagination' (#2459) @michaldudak
- [docs] Use same infrastructure from v5 (#2441) @DanailH
Core
- [core] Add typing to the details argument (#2512) @flaviendelangle
- [core] Allow to create one logger per Grid instance (#2529) @flaviendelangle
- [core] Clean
GridSimpleOptions
interface (#2578) @flaviendelangle - [core] Fix PR detection mechanism for upstream PRs @oliviertassinari
- [core] Generate propTypes (#2395) @m4theushw
- [core] Improve the feedback loop from developers (#2468) @oliviertassinari
- [core] List the requirement of each hook (#2319) @flaviendelangle
- [core] Only create one
GridEventEmitter
per Grid (#2504) @flaviendelangle - [core] Only run Prettier on files different from
next
instead ofmaster
(#2566) @flaviendelangle - [core] Polish issue template (#2503) @oliviertassinari
- [core] Prepare
x-grid-data-generator
for noImplicitAny (#2505) @flaviendelangle - [core] Provide theme augmentation as separate module (#2520) @m4theushw
- [core] Publish
GridEvents.rowsSet
when the rows state is modified afterprops.rows
is updated (#2530) @flaviendelangle - [core] Remove
state.isScrolling
(#2337) @m4theushw - [core] Remove useless apiRef optional chaining or non-null assertions (#2455) @flaviendelangle
- [core] Replace remaining
@material-ui
usages (#2577) @m4theushw - [core] Replace the options with direct prop reads (#2433) @flaviendelangle
- [core] Skip update on initial render (#2344) @oliviertassinari
- [core] Small changes (#2607, #2511) @flaviendelangle
- [core] Support for
@mui
packages (#2571) @m4theushw - [core] Synchronously subscribe to events in
useGridApiEventHandler
(#2557) @flaviendelangle - [core] Update
.browserslistrc
file (#2384) @DanailH - [core] Update monorepo version and copy assets (#2603) @m4theushw
- [core] Update outdated hook requirements (#2526) @flaviendelangle
- [test] Clean selection tests (#2457) @flaviendelangle
- [test] Disable browserstack for PRs (#2531) @flaviendelangle
v4.0.0
Aug 27, 2021
🎉 This is the first stable release of the data grid component 🎉!
We have been iterating on the component for 18 months. With the introduction of the row edit feature, many bug fixes, and polishing of the documentation, we believe the component is ready for a stable release.
The MUI X v4.0.0 release supports Material UI v4 and has partial support for v5-beta. With the soon-to-be-released v5 version of the core components, we are moving ongoing work to the v5 release line (Core and X).
The support for existing projects on MUI v4 won't be a priority going forward. We encourage you to migrate to MUI Core v5-beta and soon MUI X v5-beta. We don't patch, fix, or alter older versions. Using MUI Core v4 with MUI X v5 might lead to extra bundle size and configuration.
A big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
-
🚀 Introduce the row editing feature (#2098) @m4theushw
-
⚡️ Rename the
XGrid
component toDataGridPro
(#2382) @m4theushwThis should help clarify the products vs. plans separation. MUI X is a product line on its own. It contains MIT and Commercial software. Removing X from the name of the paid components should help remove a possible confusion: the MIT version of X is meant to be valuable enough for developers to use it, without feeling that it's crippled compared to other OSS alternatives.
The Pro suffix should help make it clear what's MIT and what's not. -
✨ Rename the
@material-ui
npm scope to@mui
(#2341) @oliviertassinariThis is part of the ongoing rebranding of the project and company. Material-UI is our current official name, however, we are going to change it. It's too long to write, read, and pronounce; and it is too closely associated with Material Design. In the near future, the whole project/company is moving to MUI and https://mui.com/.
-
💡 The
api
property was removed from the callback params. To access the API, use theDataGridPro
(#2312) @DanailH
@mui/[email protected]
/ @mui/[email protected]
Breaking changes
-
[DataGrid] Move packages to
@mui
scope and renameXGrid
toDataGridPro
(#2341, #2382) @m4theushw @oliviertassinari
You can find in the above highlight section why we are making these name changes. You can migrate following these steps:-import { DataGrid } from '@material-ui/data-grid'; +import { DataGrid } from '@mui/x-data-grid';
-import { XGrid } from '@material-ui/x-grid'; -<XGrid /> +import { DataGridPro } from '@mui/x-data-grid-pro'; +<DataGridPro />
-
[DataGrid] The
api
property was removed from the callback params (#2312) @DanailH
To access the API, use theDataGridPro
and get it from the newdetails
param.<DataGridPro - onColumnResize={(params, event) => console.log(params.api)} + onColumnResize={(params, event, details) => console.log(details.api)} />
-
[DataGrid] Remove unused row CSS classes (#2327) @ZeeshanTamboli
The CSS classes.Mui-odd
and.Mui-even
were removed from the row.
Changes
- [DataGrid] Add
gridClasses
API instead of hard coded classes (#2320) @m4theushw - [DataGrid] Add row editing feature (#2098) @m4theushw
- [DataGrid] Add TypeScript module augmentation for the theme (#2307) @ZeeshanTamboli
- [DataGrid] Fix
box-sizing: border-box
leak (#2330) @m4theushw - [DataGrid] Fix keyboard navigation header regression (#2342) @oliviertassinari
- [DataGrid] Fix keyboard navigation on filtered rows (#2336) @m4theushw
Docs
- [docs] Add
Row & Cell editing
in features list (#2396) @ZeeshanTamboli - [docs] Add redirect from
XGrid
toDataGridPro
(#2389) @m4theushw - [docs] Fix
onCellEditCommit
param type (#2390) @ArthurPedroti - [docs] Fix docs for
onEditRowsModelChange
prop (#2394) @ZeeshanTamboli - [docs] Fix docs links and pagination sentence (#2381) @ZeeshanTamboli
- [docs] Update the icons for the new branding (#2339) @oliviertassinari
Core
- [core] Keep prop-types in the same file (#2345) @oliviertassinari
- [core] Reduce
options
internal usage (#2318) @flaviendelangle - [core] Remove
DataGridPropTypes
(#2432) @flaviendelangle - [core] Remove private API from the export (#2299) @oliviertassinari
- [core] Remove usages of
options.scrollbarSize
(#2317) @flaviendelangle - [core] Simplify
useGridColumns
hook (#2343) @oliviertassinari - [core] Update
doesSupportTouchActionNone
implementation (#2378) @DanailH - [core] Upgrade dependency with the monorepo (#2377) @oliviertassinari
- [test] Use
.not.to.equal
in favour ofto.not.equal
(#2340) @oliviertassinari
v4.0.0-alpha.37
Jul 12, 2021
Big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
- 🔎 Add the "is empty" and "is not empty" filter operators to date and number columns (#2274) @flaviendelangle
- ⚡️ Only support @material-ui/core 4.12.0 or higher (#2281) @DanailH
- 🐞 Fix a regression to not require @material-ui/x-license when using the DataGrid (#2295) @oliviertassinari
- 👁️ Add
onViewportRowsChange
prop forXGrid
only (#2038) @DanailH - 📃 Translate booleans when exporting rows to CSV (#2296) @m4theushw
- 🌎 Add Sudanese Arabic (arSD) locale (#2269) @yassinhussein
This is the last alpha release. We are moving to beta in the next release, next week.
@material-ui/[email protected]
/ @material-ui/[email protected]
Breaking changes
-
[DataGrid] Drop support for @material-ui/core below v4.12.0 (#2281) @DanailH
-
[XGrid] Replace event constants with the
GridEvents
enum (#2279) @flaviendelangle-import { GRID_CELL_EDIT_START } from '@material-ui/x-grid'; -apiRef.current.subscribeEvent(GRID_CELL_EDIT_START, (params, event) => { ... }); +import { GridEvents } from '@material-ui/x-grid'; +apiRef.current.subscribeEvent(GridEvents.cellEditStart, (params, event) => { ... });
Changes
- [DataGrid] Add @material-ui/styles as peer dependency (#2288) @m4theushw
- [DataGrid] Add Sudanese Arabic (arSD) locale (#2269) @yassinhussein
- [DataGrid] Add "is empty" and "is not empty" filter operators to date and number columns (#2274) @flaviendelangle
- [DataGrid] Avoid crash if
valueOptions
is missing in theGridColDef
when usingsingleSelect
(#2276) @DanailH - [DataGrid] Remove the use of the
autoFocus
attribute (#2239) @m4theushw - [DataGrid] Drop support for @material-ui/core below 4.12.0 (#2281) @DanailH
- [DataGrid] Fix when
renderCell
returns false-ish values (#2242) @siriwatknp - [DataGrid] Group events into a single enum (#2279) @flaviendelangle
- [DataGrid] Improve error message if using multiple versions of data grid (#2311) @ZeeshanTamboli
- [DataGrid] Make resized column not flexible (#2308) @flaviendelangle
- [DataGrid] Merge
useGridVirtualColumns
intouseGridVirtualRows
(#2314) @m4theushw - [DataGrid] Remove dependency on x-license (#2295) @oliviertassinari
- [DataGrid] Translate booleans when exporting to CSV (#2296) @m4theushw
- [XGrid] Add
onViewportRowsChange
prop (#2038) @DanailH
Docs
- [docs] Fix page size warnings (#2301) @oliviertassinari
- [docs] Sort events alphabetically (#2278) @flaviendelangle
Core
- [core] Assert that
event.defaultMuiPrevented
is called (#2302) @oliviertassinari - [core] Reduce options usage in feature hooks (#2275, #2284) @flaviendelangle
- [core] Remove use of
getState
(#2300) @oliviertassinari - [core] Try
rangeStrategy: bump
@oliviertassinari - [core] Use type inference in selectors (#2244) @flaviendelangle
- [core] Improve type coverage of
colDef
(#2188) @flaviendelangle
v4.0.0-alpha.36
August 6, 2021
Big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
- 🚀 Polish the cell editing API (#2220) @m4theushw
- ⚡️ Add
details
param to each callback option inXGrid
(#2236) @DanailH - 💅 Work on internal optimizations and code separation (#2176, #2243, #2235, #2213) @flaviendelangle
- ✨ Allow non-integer column width for flex columns (#2282) @flaviendelangle
- 🐞 Fix one bug related to filtering
@material-ui/[email protected]
/ @material-ui/[email protected]
Breaking changes
-
[DataGrid] Polish cell editing (#2220) @m4theushw
- Replace
onCellModeChange
prop withonCellEditEnter
oronCellEditExit
. - Rename
onCellEditEnter
prop toonCellEditStart
. - Rename
onCellEditEnd
prop toonCellEditStop
.
<DataGrid - onCellEditEnter={...} - onCellEditExit={...} + onCellEditStart={...} + onCellEditStop={...} />
- [XGrid] The
setEditCellProps
API call is not available anymore.
Use the controlled editing orsetEditRowsModel
.
-apiRef.current.setEditCellProps({ id, field, props: { ...props, error: true } }); +apiRef.current.setEditRowsModel({ + ...oldModel, + [id]: { + ...oldModel[id], + [field]: { ...oldModel[id][field], error: true }, + }, +});
- Replace
-
[DataGrid] Allow non-integer column width for flex columns (#2282) @flaviendelangle
- The
width
property of the columns is no longer updated with the actual width of of the column. Use the newcomputedWidth
property in the callbacks instead.
const columns: GridColDef = [ { field: "name", width: 100, renderCell: ({ value, colDef }) => { - console.log(colDef.width!) + console.log(colDef.computedWidth) return value } ]
- The
Changes
- [DataGrid] Canonical controlled state behavior (#2208) @oliviertassinari
- [DataGrid] Fix filter with extended columns (#2246) @m4theushw
- [DataGrid] Remove default value of columnTypes prop (#2280) @m4theushw
- [DataGrid] Add German (deDE) translation for export and isEmpty operator (#2285) @ChristopherBussick
- [XGrid] Add
details
param to each callback option inXGrid
(#2236) @DanailH
Docs
- [docs] Improve slot API docs (#2219) @oliviertassinari
- [docs] Document virtualization APIs in virtualization section (#2247) @ZeeshanTamboli
Core
- [core] Isolate
DataGrid
andXGrid
(#2176) @dtassone - [core] Move
GridFilterModel
in the models directory (#2243) @flaviendelangle - [core] Add new column internal
computedWidth
field (#2235) @flaviendelangle - [core] Use
rootProps
instead ofoptions
in the grid components except forclasses
(#2213) @flaviendelangle - [core] Fix
rebaseWhen=auto
not working (#2271) @oliviertassinari - [core] Batch small changes (#2249) @oliviertassinari
v4.0.0-alpha.35
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/[email protected]
/ @material-ui/[email protected]
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
v4.0.0-alpha.34
July 21, 2021
Big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
- 🚀 Fix @material-ui/core v4.12.1 support (#2108) @DanailH
- 🐞 Add "is empty" and "is not empty" operators (#1997) @m4theushw
- 💅 Improve the editing API (#1955) @m4theushw
- 🐛 We have improved the scroll keyboard (#2162) @oliviertassinari
- ⚡️ Add control state for selection model, filter model, and sort model @dtassone
- 💡 Add quick filter demo in the docs @dtassone
@material-ui/[email protected] / @material-ui/[email protected]
Breaking changes
-
[DataGrid] Fix scrollToIndexes behavior (#2162) @oliviertassinari
Remove public
apiRef.current.isColumnVisibleInWindow()
as it servers private use cases.-apiRef.current.isColumnVisibleInWindow()
-
[DataGrid] Remove stateId argument from GridApi getState method (#2141) @flaviendelangle
-const filterState = apiRef.current.getState('filter'); +const filterState = apiRef.current.getState().filter;
-
[DataGrid] Improve controllable sorting (#2095) @dtassone
Normalize the controlled prop signature:
<DataGrid - onSortModelChange={(params: GridSortModelParams) => setSortModel(params.model)} + onSortModelChange={(model: GridSortModel) => setSortModel(model)} />
-
[DataGrid] Improve controllable filter (#1909) @dtassone
Normalize the controlled prop signature:
<DataGrid - onFilterModelChange={(params: GridFilterModelParams) => setFilterModel(params.model)} + onFilterModelChange={(model: GridFilterModel) => setFilterModel(model)} />
-
[DataGrid] Improve the editing API (#1955) @m4theushw
-
The
props
key in the first argument ofcommitCellChange
was removed to promote the use of the value already stored in the state.
To update the value in the state, callsetEditCellProps
before.-apiRef.current.commitCellChange({ id: 1, field: 'name', props: { value: 'Ana' } }); +apiRef.current.setEditCellProps({ id: 1, field: 'name', props: { value: 'Ana' } }); +apiRef.current.commitCellChange({ id: 1, field: 'name' });
-
Calling
commitCellChange
in a cell in view mode will throw an error. Make sure to first enter the edit mode.+apiRef.current.setCellMode(1, 'name', 'edit'); apiRef.current.commitCellChange({ id: 1, field: 'name' });
-
The
setCellValue
was removed from the API. UsecommitCellChange
orupdateRows
in place.-apiRef.current.setCellValue({ id: 1, field: 'name', value: 'Ana' }); +apiRef.current.updateRows([{ id: 1, name: 'Ana' }]);
or
-apiRef.current.setCellValue({ id: 1, field: 'name', value: 'Ana' }); +apiRef.current.setCellMode(1, 'name', 'edit'); +apiRef.current.setEditCellProps({ id: 1, field: 'name', props: { value: 'Ana' } }); +apiRef.current.commitCellChange({ id: 1, field: 'name' });
-
The
getEditCellProps
was removed becausegetEditCellPropsParams
offers the same functionality.-const props = apiRef.current.getEditCellProps(1, 'name'); +const { props } = apiRef.current.getEditCellPropsParams(1, 'name');
Note: This method will now throw an error if the cell is in view mode.
-
-
[DataGrid] Implement useControlState hook, and add control state on selectionModel (#1823) @dtassone
Normalize the controlled prop signature:
<DataGrid - onSelectionModelChange={(params: GridSelectionModelChangeParams) => setSelectionModel(params.model)} + onSelectionModelChange={(model: GridSelectionModel) => setSelectionModel(model)} />
Replace
onRowSelected
with the existing API:<DataGrid - onRowSelected={(params: GridRowSelectedParams) => } + onSelectionModelChange={(model: GridSelectionModel) => } />
Changes
- [DataGrid] Use find instead of filter (#2015) @DanailH
- [DataGrid] Add "is empty" and "is not empty" operators (#1997) @m4theushw
- [DataGrid] Add
minWidth
toGridColDef
(#2101) @DanailH - [DataGrid] Add missing localeText types (#2118) @oliviertassinari
- [DataGrid] Add missing translations to French (frFR) locale (#2082) @flaviendelangle
- [DataGrid] Add quick filter demo (#2149) @dtassone
- [DataGrid] Allow passing styles and Popper props to GridPanel (#1994) @sebastianfrey
- [DataGrid] Allow to customize the columns exported as CSV (#2008) @flaviendelangle
- [DataGrid] Emit
pageSizeChange
when autoPageSize is set and the grid size changes (#1986) @flaviendelangle - [DataGrid] Fix crash when id has a single-quote (#2033) @rbrishabh
- [DataGrid] Fix localeText type (#2117) @oliviertassinari
- [DataGrid] Fix manual entry in date fields (#2051) @m4theushw
- [DataGrid] Fix scrollToIndexes offscreen column (#1964) @m4theushw
- [DataGrid] Fix support for
@material-ui/[email protected]
(#2108) @DanailH - [DataGrid] Improve GridToolbarXXX props flexibility (#2157) @tifosiblack
- [DataGrid] Make GridToolbarXXX props overridable (#2084) @tifosiblack
- [DataGrid] Remove 'hide: true' from a column should correctly resize the others column (#2034) @flaviendelangle
- [DataGrid] Remove focus on cell when its row is removed from the data (#1995) @flaviendelangle
- [DataGrid] Remove unused
editMode
prop (#2173) @ZeeshanTamboli - [DataGrid] Support style prop (#2116) @oliviertassinari
- [DataGrid] Use Intl.Collator for string comparison (#2155) @m4theushw
- [DataGrid] Update apiRef.current.getRow to signal that it can return a null value (#2010) @flaviendelangle
- [XGrid] Add ability to disable reorder on some columns (#2085) @flaviendelangle
- [XGrid] Close column header menu when resizing column (#1989) @flaviendelangle
- [XGrid] Fix column resize on touch devices (#2089) @m4theushw
- [XGrid] Only show column sorting in the grid toolbar when experimental features enabled (#2091) @flaviendelangle
- [XGrid] Prevent headers from scrolling during reordering (#2154) @m4theushw
Docs
- [docs] Add new cursor-based pagination paragraph (#1991) @flaviendelangle
- [docs] Better explain what happens in the future (#2036) @oliviertassinari
- [docs] Fix broken env (#2160) @oliviertassinari
- [docs] Fix small typos in the documentation (#2169) @BrandonOldenhof
- [docs] Fix typo in README (#2150) @studyhog
Core
- [core] Add @material-ui/lab and @material-ui/icons as peer dependencies (#2012) @m4theushw
- [core] Add additional test case for
onSelectionModelChange
(#1966) @DanailH - [core] Add support bot (#2097) @oliviertassinari
- [core] Configure Renovate and remove Dependabot (#2075) @flaviendelangle
- [core] Copy getClasses from the core (removed in v5) (#2140) @flaviendelangle
- [core] Correctly test column visibility switch impact on column width (#2130) @flaviendelangle
- [core] Fix missing git source in packages (#2092) @msftenhanceprovenance
- [core] Fix typo errors (#2100) @flaviendelangle
- [core] No need to pin dependencies (#2094) @oliviertassinari
- [core] Remove dead code (#2088) @oliviertassinari
- [core] Remove implicit :scope (#2115) @oliviertassinari
- [core] Remove styled-components (#2060) @m4theushw
- [core] Remove unused event 'cellFocusChange' (#1996) @flaviendelangle
- [core] Renovate : Group storybook updates (#2086) @flaviendelangle
- [core] Replace fade with muiStyleAlpha (#2171) @m4theushw
- [core] Support
docs:api
script in Windows OS (#2166) @ZeeshanTamboli - [core] Upgrade dependencies (#2114) @oliviertassinari
- [core] Use getColumnHeaderCell in tests (#2093) @flaviendelangle
- [core] Use props instead of options for event handler (#2139) @flaviendelangle
- [test] Allow tests to run for up to 5 instead of 4 minutes (#2152) @oliviertassinari
- [test] Increase Browserstack worker timeout from 2.5 to 4 minutes (#2040) @flaviendelangle
- [test] Remove orphan async @oliviertassinari
- [test] Test the validation before saving a value (#2087) @m4theushw
v4.0.0-alpha.33
July 1, 2021
Big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
-
🐞 As a focus of Q2, we have kept fixing bugs
-
💅 End users are now allowed to copy the selected rows to the clipboard with CTRL + c (#1929) @m4theushw
-
🐛 We have fixed the
Select all
checkbox. When triggered, it should only select the filtered rows (#1879) @ZeeshanTamboli -
⚡️ We have added a new
singleSelect
column type (#1956) @DanailHUsing the column
type: 'singleSelect'
defaults toSelect
component when the cell is inedit
mode. You can find the documentation following this link.<DataGrid columns={[ { field: 'country', type: 'singleSelect', valueOptions: ['France', 'Netherlands', 'Brazil'], editable: true, } ]} rows={[ { id: 0, country: 'France' }, { id: 1, country: 'Netherlands' }, { id: 2, country: 'Brazil' }, ]} />
@material-ui/[email protected] / @material-ui/[email protected]
Breaking changes
-
[DataGrid] Rename
onColumnResizeCommitted
toonColumnWidthChange
(#1967) @m4theushw-<DataGrid onColumnResizeCommitted={...} /> +<DataGrid onColumnWidthChange={...} />
-
[DataGrid] Make GRID_ROWS_CLEAR private (#1925) @oliviertassinari
The
rowsCleared
event was always triggered alongsiderowsSet
. You can listen to the latter event only. -
[DataGrid] Fix events naming (#1862) @m4theushw
The following
XGrid
events were renamed:columnHeaderNavigationKeydown
tocolumnHeaderNavigationKeyDown
columnResizeCommitted
tocolumnWidthChange
rowsUpdated
torowsUpdate
columnsUpdated
tocolumnsChange
The following
XGrid
DOM events were removed:focusout
keydown
keyup
Changes
- [DataGrid] Add fallback for pagination translations (#2006) @m4theushw
- [DataGrid] Add single select column type (#1956) @DanailH
- [DataGrid] Allow to copy the selected rows to the clipboard (#1929) @m4theushw
- [DataGrid] Improve the logic of
scrollToIndexes
(#1969) @oliviertassinari - [DataGrid] Fix deferred rendering race condition (#1807) @dtassone
- [DataGrid] Fix double-click issue (#1919) @oliviertassinari
- [DataGrid] Fix number edit cell output (#1959) @oliviertassinari
- [DataGrid] Fix offscreen row when calling
scrollToIndexes
(#1949) @oliviertassinari - [DataGrid] Ignore drag events when disableColumnReorder is true (#1952) @m4theushw
- [DataGrid]
Select all
checkbox click should select only filtered rows (#1879) @ZeeshanTamboli - [XGrid] Add option to select only visible rows on the current page (#1998) @DanailH
Docs
- [docs] Align docs with EULA (source of truth) (#1963) @oliviertassinari
- [docs] Fix changing Dataset not working (#1965) @m4theushw
- [docs] Fix description of union types (#2003) @m4theushw
Core
- [core] Polish filtering internals (#1760) @ZeeshanTamboli
- [core] Upgrade actions-cool/issues-helper (#1962) @oliviertassinari
- [core] Name variables according to enUS instead of enGB (#1988) @flaviendelangle
- [test] Test vertical scrollbar (#1932) @oliviertassinari
v4.0.0-alpha.32
June 18, 2021
Big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
- ⚡️ Components that use portals, like
Select
andAutocomplete
, can now be used in the cell editing (#1772) @m4theushw - 📃 Apply the
valueFormatter
to the CSV exporting (#1922) @DanailH - 💅 Rename CSS classes to match the convention of the core components (#1872) @DanailH
- 🌎 Isolate translations from Material-UI Core and Material-UI X (#1913) @DanailH
- 🚀 Improve performance when finding column indexes and updating rows (#1903, #1923) @Janpot @N2D4
- 🐞 Bugfixes
@material-ui/[email protected] / @material-ui/[email protected]
Breaking changes
-
[DataGrid] The
onEditCellChangeCommitted
prop won't be called with an event when committing changes by clicking outside the cell (#1910) @m4theushw -
[DataGrid] Translation for Material-UI Core components are no longer included in the Material-UI X translation (#1913) @DanailH
import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles'; import { DataGrid, bgBG } from '@material-ui/data-grid'; +import { bgBG as coreBgBG } from '@material-ui/core/locale'; const theme = createMuiTheme( { // ... }, bgBG, + coreBgBG, );
-
[DataGrid] The
disableClickEventBubbling
prop was removed (#1910) @m4theushwThe same outcome can be obtained by using the React synthetic event, calling
event.stopPropagation()
:-<DataGrid disableClickEventBubbling /> +<DataGrid onCellClick={(event) => event.stopPropagation()} />
-
[DataGrid] Rename CSS classes according to new convention (#1872) @DanailH
The main grid components:
.data-container
was removed.MuiDataGrid-columnHeaderSortable
was renamed to.MuiDataGrid-columnHeader--sortable
.MuiDataGrid-columnHeaderCenter
was renamed to.MuiDataGrid-columnHeader--alignCenter
.MuiDataGrid-columnHeaderRight
was renamed to.MuiDataGrid-columnHeader--alignRight
.MuiDataGrid-columnHeader-draggable
was renamed to.MuiDataGrid-columnHeaderDraggableContainer
.MuiDataGrid-columnHeaderSortable
was renamed to.MuiDataGrid-columnHeader--sortable
.MuiDataGrid-columnHeaderMoving
was renamed to.MuiDataGrid-columnHeader--moving
.MuiDataGrid-columnHeaderSorted
was renamed to.MuiDataGrid-columnHeader--sorted
.MuiDataGrid-columnHeaderNumeric
was renamed to.MuiDataGrid-columnHeader--numeric
.MuiDataGrid-columnHeader-dropZone
was renamed to.MuiDataGrid-columnHeaderDropZone
.MuiDataGrid-columnSeparatorResizable
was renamed to.MuiDataGrid-columnSeparator--resizable
.MuiDataGrid-cellWithRenderer
was renamed to.MuiDataGrid-cell--withRenderer
.MuiDataGrid-cellLeft
was renamed to.MuiDataGrid-cell--textLeft
.MuiDataGrid-cellRight
was renamed to.MuiDataGrid-cell--textRight
.MuiDataGrid-cellCenter
was renamed to.MuiDataGrid-cell--textCenter
.MuiDataGrid-cellEditing
was renamed to.MuiDataGrid-cell--editing
.MuiDataGrid-cellEditable
was renamed to.MuiDataGrid-cell--editable
.MuiDataGrid-editCellBoolean
was renamed to.MuiDataGrid-editBooleanCell
.MuiDataGrid-editCellInputBase
was renamed to.MuiDataGrid-editInputCell
.MuiDataGrid-scrollArea-left
was renamed to.MuiDataGrid-scrollArea--left
.MuiDataGrid-scrollArea-right
was renamed to.MuiDataGrid-scrollArea--right
The standalone components:
.MuiDataGridMenu-*
was renamed to.MuiGridMenu-*
.MuiDataGridPanel-*
was renamed to.MuiGridPanel-*
.MuiDataGridPanelContent-*
was renamed to.MuiGridPanelContent-*
.MuiDataGridPanelFooter-*
was renamed to.MuiGridPanelFooter-*
.MuiDataGridPanelWrapper-*
was renamed to.MuiGridPanelWrapper-*
.MuiDataGridFilterForm-*
was renamed to.MuiGridFilterForm-*
.MuiDataGridToolbarFilterButton-*
was renamed to.MuiGridToolbarFilterButton-*
.MuiDataGrid-footer
was renamed to.MuiDataGrid-footerContainer
.MuiDataGrid-toolbar
was renamed to.MuiDataGrid-toolbarContainer
Changes
- [DataGrid] Add
aria-label
toGridToolbarExport
(#1869) @rbrishabh - [DataGrid] Add support for edit components that use portal (#1772) @m4theushw
- [DataGrid] Add
useGridApiContext
hook to access theGridApiContext
(#1877) @m4theushw - [DataGrid] Allow to set the delimiter in
GridExportCsvOptions
(#1859) @michallukowski - [DataGrid] Escape regular expression characters in filters (#1899) @ZeeshanTamboli
- [DataGrid] Fix support for
getRowId
on cell editing (#1917) @m4theushw - [DataGrid] Fix typo in French (frFR) locale (#1874) @julien-guillon
- [DataGrid] Improve Brazilian Portuguese (ptBR) locale (#1861) @aline-matos
- [DataGrid] Improve type of the blur event (#1918) @oliviertassinari
- [DataGrid] Improve updateRows performance (#1923) @N2D4
- [DataGrid] Include Material-UI core component localizations in
localeText
(#1913) @DanailH - [DataGrid] Make the CSV export respect the
valueFormatter
(#1922) @DanailH - [DataGrid] Remove
disableClickEventBubbling
(#1910) @m4theushw - [DataGrid] Rename CSS classes according to new convention (#1872) @DanailH
- [DataGrid] Use binary search to find column indexes in virtualization (#1903) @Janpot
Docs
- [docs] Fix 404 links (#1880) @oliviertassinari
- [docs] Fix prop-type warning (#1916) @oliviertassinari
- [docs] Make cells editable in demos (#1817) @m4theushw
- [docs] Polish
disableDensitySelector
description (#1884) @oliviertassinari
Core
- [core] Batch small changes (#1901) @oliviertassinari
- [core] Remove dead logic (#1900) @oliviertassinari
- [test] Fix tests (#1928) @m4theushw