MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
Published by flaviendelangle over 2 years ago
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights β¨:
π Support localization on the date and time picker components (#4517) @alexfauquette
Texts can be translated in the pickers components, similar to what can be done in the data grid component. Check the documentation for more information.
π Add support for column spanning when exporting to Excel (#4830) @cherniavskii
π Bugs fixes
@mui/[email protected]
/ @mui/[email protected]
/ @mui/[email protected]
loading
prop is changed (#4910) @m4theushwexceljs
to the dependencies (#4939) @alexfauquette@mui/[email protected]
/ @mui/[email protected]
The props related to the action bar buttons have been removed (clearable
, showTodayButton
, cancelText
, okText
)
To decide which button must be displayed and in which order, you can now use the actions
prop of the actionBar
component slot props.
<DatePicker
componentsProps={{
actionBar: {
// The actions will be the same between desktop and mobile
actions: ['clear'],
// The actions will be different between desktop and mobile
actions: (variant) => variant === 'desktop' ? [] : ['clear'],
}
}}
/>
The build-in ActionBar
component supports 4 different actions: 'clear'
, 'cancel'
, 'accept'
, and 'today'
.
By default, the pickers will render the cancel and accept button on mobile and no action on desktop.
If you need other actions, you can provide your own component to the ActionBar
component slot
<DatePicker
components={{ ActionBar: CustomActionBar }}
/>
null
(#4867) @flaviendelangleLICENSE
file to 80 char per line (#4873) @oliviertassinarirowHydration
(#4896) @flaviendelangleyarn prettier
@oliviertassinariCHANGELOG.md
(#4876) @oliviertassinariPublished by alexfauquette over 2 years ago
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights β¨:
π Premium plan release. We're happy to announce that the Premium plan is finally out! With it, MUI X officially steps up to the next level, supporting the most advanced use cases for UI components.
This plan is available through the new @mui/x-data-grid-premium
package, which contains the row grouping and the Excel export features.
If you were already using the row grouping feature, you can upgrade by installing @mui/x-data-grid-premium
and replace DataGridPro
with DataGridPremium
, as follows. Note that the experimental flag is not required anymore to use the row grouping.
-import { DataGridPro } from '@mui/x-data-grid-pro';
+import { DataGridPremium } from '@mui/x-data-grid-premium';
-<DataGridPro experimentalFeatures={{ rowGrouping: true }} />
+<DataGridPremium />
For more information about the revised pricing model please have a look at the blog post.
π Excel export. You can find this new Premium feature at: https://mui.com/x/react-data-grid/export/#excel-export.
π Quick filtering. You can now add a quick filtering search bar to your grid. To do so, either pass showQuickFilter
prop to the <GridToolbar />
or use the <GridToolbarQuickFilter />
component in your custom toolbar. More information about how to customize the filtering logic is in the documentation.
π Bugs fixes
@mui/[email protected]
/ @mui/[email protected]
/ @mui/[email protected]
Move row grouping to the premium package (#4223) @flaviendelangle
The use of rowGrouping
in the @mui/x-data-grid-pro
package is deprecated. The experimental flag will be removed in an upcoming release.
sx
prop in inner components (#4743) @lindapaistegetRowGroupChildren
API method (#4304) @flaviendelanglepreferencePanelClose
event only once when clicking on another panel button (#4810) @flaviendelangleonChange
callback to edit components (#4621) @m4theushwkeepNonExistentRowsSelected
prop (#4786) @willsoto@mui/x-data-grid-premium
(#4223) @flaviendelangle@mui/[email protected]
/ @mui/[email protected]
Rework the auto-closing behavior of the pickers (#4408) @flaviendelangle
The disableCloseOnSelect
prop has been replaced by a new closeOnSelect
prop which has the opposite behavior.
The default behavior remains the same (close after the last step on desktop but not on mobile).
// If you don't want to close after the last step
-<DatePicker disableCloseOnSelect={false} />
+<DatePicker closeOnSelect />
// If you want to close after the last step
-<DatePicker disableCloseOnSelect />
+<DatePicker closeOnSelect={false} />
orientation
prop (#4665) @m4theushwToolbar
should be visible by default on mobile (#4833) @flaviendelangleshouldDisableMonth
(#4708) @someone635minutesStep
(#4726) @flaviendelangleisTimeDisabled
method (#4688) @flaviendelanglepeerDependencies
for yarn pnp
users (#4763) @nate-summercookPickersArrowSwitcher
(#4672) @m4theushwDayPicker
(#4649) @flaviendelangleallowSameDateSelection
prop (#4808) @flaviendelangleampm=true
(#4731) @alexfauquettedisabled
and readOnly
behavior on calendar and clock (#4645) @alexfauquettedate
into parsedValue
when it can contain a range (#4736) @flaviendelangleTDate
, TInputDate
, TValue
and TInputValue
generics (#4617) @flaviendelangleusePickerState
(#4408) @flaviendelanglescopePathNames
property to column page (#4811) @flaviendelangleampm
prop (#4846) @alexfauquetteGridEventLookup
(#4725) @flaviendelangleuseKeepGroupingColumnsHidden
on @mui/x-data-grid-premium
(#4319) @flaviendelangledocs/pages/api-docs
folder (#4709) @m4theushwGridEvents
enum in documentation (#4699) @flaviendelangleprocess
is available (#4193) @m4theushwrowsCache
from state (#4480) @m4theushwDayPicker
api (#4783) @flaviendelanglex-license-pro
license to handle premium package (#4315) @DanailHGridEvents
enum (#4698, #4696, #4685) @flaviendelangleDataGrid
tests (#4752) @m4theushwsinon
sandbox after each karma
test (#4689) @m4theushwPublished by DanailH over 2 years ago
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights β¨:
π Introduce Row reorder (#4034) @DanailH
π Bug fixes
@mui/[email protected]
/ @mui/[email protected]
@mui/[email protected]
/ @mui/[email protected]
PaperProps
to DesktopWrapper
component (#4584) @alexfauquetteclearable
and clearText
props (#4511) @zigang93Published by cherniavskii over 2 years ago
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights β¨:
β‘ Update peer dependencies to support React 18 (#4332) @m4theushw
Now the data grid and pickers components support the concurrent mode.
π Add support for Column spanning (#4020) @cherniavskii
π New standalone documentation for MUI X (#4313) @siriwatknp
Each MUI product now has its own documentation.
More information on our blog post.
π Add Hungarian (hu-HU) locale (#4458) @x22tri
π Bug fixes
@mui/[email protected]
/ @mui/[email protected]
getRowClassName
and getRowSpacing
props (#3882) @flaviendelangleapi
prop leaking to DOM (#4384) @m4theushwloading
prop (#4334) @m4theushwGridCellParams.formattedValue
should be nullable (#4376) @flaviendelangleactions
column (#4325) @m4theushw@mui/[email protected]
/ @mui/[email protected]
shouldDisableTime
with the hours with meridiem (#4404) @flaviendelanglePickersMonth
button should not trigger the form submit (#4402) @flaviendelangleTimePicker
(#4398) @flaviendelangleTDate
generic to CalendarOrClockPicker
component (#4465) @flaviendelangleMuiPickersAdapterContext
(#4367) @flaviendelanglenoImplicitAny
in docs
folder (#4412) @cherniavskiiPublished by cherniavskii over 2 years ago
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights β¨:
π Expose new methods to save and restore the grid state (#4028) @flaviendelangle
The different methods to save and restore the data-grid state are now documented.
βοΈ Move date and time picker components from the lab (#3451) @flaviendelangle
Date and time picker components have been moved to the MUI X repository.
They are now accessible in their own packages: @mui/x-date-pickers
and @mui/x-date-pickers-pro
.
For more information, you can read the blog article and the migration guide.
π Add onProcessRowUpdateError
prop to simplify error management in edit mode (#4267) @m4theushw
β¨ Add generic typing to GridColDef
and derived interfaces (#4064) @flaviendelangle
You can now strongly type all the objects related to the row and the cell values.
Here is an example, you can find out more in the description of #4064.
const rows: Movie[] = [];
return (
<DataGrid
rows={rows}
columns={[{
// typeof params.row => Movie (R)
valueGetter: params => params.row.year,
}]}
/>
);
@mui/[email protected]
/ @mui/[email protected]
onProcessRowUpdateError
prop (#4267) @m4theushwGridColDef
and derived interfaces (#4064) @flaviendelanglegridClasses
and gridPanelClasses
(#4273) @flaviendelangleonPreferencePanelClose
/onPreferencePanelOpen
props (#4265) @kyeongsoosoo@mui/[email protected]
/ @mui/[email protected]
Published by m4theushw over 2 years ago
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights β¨:
β Add a new editing API with better support for server-side persistence and validation (#3963, #4060) @m4theushw
The new API is stable, but to avoid any breaking changes or conflicts with the old API, you must add the following flag to access it:
<DataGrid experimentalFeatures={{ newEditingApi: true }} />
β Users relying on the old API (legacy) don't need to worry as it will continue to work until v6.
The new API also features brand new documentation with more useful demos and guides explaining how to create custom edit components.
Visit the new documentation for more information.
π Documentation improvements
π Bug and typo fixes
@mui/[email protected]
/ @mui/[email protected]
ColumnsPanel
with componentsProps
prop (#4207) @alexfauquetteshowCellRightBorder
not working in the last row (#4140) @cherniavskiiautoHeight
is enabled (#4110) @cherniavskiidescription
prop in GridColumnHeaderTitle
(#4247) @baahrensborderRadius
(#4188) @socramm9editMode="row"
(#4198) @cherniavskiiX-Frame-Options
limitation (#4222) @DanailHprintOptions.pageStyle
(#4138) @alexfauquetteapiRef
from demos (#4221) @flaviendelangle@mui/x-license-pro
for date pickers (#4123) @flaviendelangle@mui/x-data-grid-generator
bundle (#4163) @m4theushwisDeepEqual
(#4159) @flaviendelangleGridPreferencePanel
children (#4216) @flaviendelangleshowCellRightBorder
(#4191) @cherniavskiigetComputedStyle
to speed up unit tests (#4142) @m4theushwPublished by flaviendelangle over 2 years ago
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights β¨:
[DataGrid] Allow to add margins or borders between rows (#3848) @m4theushw
<DataGrid getRowSpacing={() => ({ top: 10, bottom: 10 })} />
Check the documentation for more information.
@mui/[email protected]
/ @mui/[email protected]
localeTextConstants.ts
(#4080) @patilvishal755noImplicitAny
(#4084) @cherniavskiipage
and pageSize
state initializer into a single pagination
state initializer (#4087) @flaviendelangleyarn docs:api:build
scripts for multi packages support (#4111) @flaviendelangle@mui/monorepo
(#4149) @cherniavskiibuildWarning
and wrapWithWarningOnCall
for deprecated methods and wrong usages (#4056) @flaviendelanglePublished by alexfauquette over 2 years ago
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights β¨:
π¦ Use the same bundling scripts as those in the material-ui repository (#3965) @flaviendelangle
The code structure and the bundling strategy have been modified to provide better isolation between components.
The bundle size is slightly reduced, but with tree shaking, the doors are open for significant gains in the future. π
We predict that such modifications could potentially impact edge cases.
If you encounter problems with your build, please open an issue.
These issues will have high priority as part of our risk mitigation strategy.
π§Ό Clean and document the column selectors (#4010) @flaviendelangle
Column selectors have been renamed to improve clarity.
The old names have been deprecated and will be removed in v6.
Here are the new names and the modifications needed to get the same information with the new selectors.
Old name | New name |
---|---|
allGridColumnsFieldsSelector |
gridColumnFieldsSelector |
allGridColumnsSelector |
gridColumnDefinitionsSelector |
visibleGridColumnsSelector |
gridVisibleColumnDefinitionsSelector |
filterableGridColumnsSelector |
gridFilterableColumnDefinitionsSelector |
-const { all, lookup, columnVisibilityModel } = gridColumnsSelector(apiRef)
+const all = gridColumnFieldsSelector(apiRef)
+const lookup = gridColumnLookupSelector(apiRef)
+const columnVisibilityModel = gridColumnVisibilityModelSelector(apiRef)
-const filterableFields = filterableGridColumnsIdsSelector(apiRef);
+const lookup = gridFilterableColumnLookupSelector(apiRef);
+const filterableFields = gridColumnFieldsSelector(apiRef).filter(field => lookup[field]);
-const visibleColumnsNumber = visibleGridColumnsLengthSelector(apiRef);
+const visibleColumnsNumber = gridVisibleColumnDefinitionsSelector(apiRef).length;
-const { totalWidth, positions } = gridColumnsMetaSelector(apiRef);
+const totalWidth = gridColumnsTotalWidthSelector(apiRef);
+const positions = gridColumnPositionsSelector(apiRef);
π Documentation improvements
π Bug and typo fixes
@mui/[email protected]
/ @mui/[email protected]
linkOperator
(#3915) @alexfauquetteactions
column (#3375) @m4theushwGridCellParams
/GridValueGetterParams
and affiliated (#4089) @ flaviendelangleGridState
, GridApi
and GridApiRef
(#3648) @flaviendelanglesingleSelect
filter performance (#3956) @cherniavskiiflex
implementation match the W3C standard (#4006) @cherniavskiisortModel
and filterModel
warnings (#3671) @flaviendelanglePopper
modifiers passed to panel (#3975) @m4theushwPopper
is not fully positioned (#4067) @m4theushwGridCell
's borderBottom
when it is the last row (#3519) @DanailHrowNode
when building tree and the new rowNode
is equal to the previous one (#3961) @flaviendelanglerowCount
is not provided while using server pagination (#3902) @alexfauquetteonRowClick
when clicking in cells with interactive elements (#3929) @m4theushwheaderName
when available to search column (#3959) @pkratzunstable_setRowHeight
method to apiRef
(#3751) @cherniavskiipageSize
and page
when it has been initialized or is being controlled (#3908) @flaviendelanglevalueFormatter
on the grouping column (#4022) @flaviendelangleCommodity
and Employee
CSV export of the country
column (#3912) @DanailH_modules_
folder (#3953) @flaviendelangleuseGridScroll.ts
(#3973) @HexM7@mui/x-data-grid-pro
import shared code from @mui/x-data-grid
(#3688) @flaviendelangle@mui/x-license-pro
to the new bundling strategy (#3738) @flaviendelangleuseGridSelector
inside feature hooks (#3978) @flaviendelanglePublished by cherniavskii over 2 years ago
A big thanks to the 6 contributors who made this release possible. Here are some highlights β¨:
π Add props to customize the behavior of the filter panel (#3497) @alexfauquette
<DataGrid
componentsProps={{
filterPanel: { columnsSort: 'asc' },
}}
/>
Check the documentation to see all available props.
π Documentation improvements
π Bugfixes
@mui/[email protected]
/ @mui/[email protected]
debounceMs
option to setEditCellValue
method (#3825) @m4theushwcheckboxSelection
labels (#3846) @m4theushwvalue = 0
(#3843) @flaviendelangleblur
event rerenders the grid (#3718) @alexfauquette@mui/base
(#3903) @cherniavskiiuseGridPagination
to call onGridPage
and onGridPageSize
(#3880) @flaviendelanglecodecov
(#3873) @oliviertassinariPublished by flaviendelangle over 2 years ago
A big thanks to the 10 contributors who made this release possible. Here are some highlights β¨:
π Add support for master detail (#3387) @m4theushw
π Add Danish (daDK) locale (#3800) @kasperfilstrup
π Documentation improvements
π Bugfixes
@mui/[email protected]
/ @mui/[email protected]
Row
slot (#3807) @cherniavskiiid
requirement and document getRowId
prop (#3765) @cherniavskiifiltering.DataGrid.test.tsx
(#3768) @flaviendelangleuseGridSelector
(#3774) @m4theushw@mui/styles
(#3769) @m4theushwGridPreProcessingGroup
(#3798) @flaviendelangledocs:api
silent crash (#3808) @cherniavskiiPublished by alexfauquette over 2 years ago
A big thanks to the 9 contributors who made this release possible. Here are some highlights β¨:
π£ Introduce variable row height (#438) @DanailH
Allows for setting a row-specific height.
By default, all rows have the same height, but now you can set the height on a per-row basis.
<DataGrid
getRowHeight={
({ id }: GridRowHeightParams) => (id % 2 === 0 ? 100 : null)
}
/>
π Add new CSV export option: getRowsToExport
(#3687) @flaviendelangle
π Documentation improvements
π Bugfixes
@mui/[email protected]
/ @mui/[email protected]
is any of
(#3746) @alexfauquettegetRowsToExport
option (#3687) @flaviendelangleonCellEditCommit
(#3693) @valenfvisRowSelectable
when paginationMode='server'
(#3647) @flaviendelangleapiRef.current.updateRows
(#3735) @flaviendelanglepreProcessEditCellProps
resolves with an error (#3612) @m4theushwcheckboxSelection
(#3684) @m4theushwuseGridColumnPinning
before useGridColumns
(#3676) @flaviendelanglestyleOverrides
on pinned columns (#3733) @alexfauquetteuseGridApiRef
(#3666) @flaviendelanglecolumnVisibilityModel
(#3723) @alexfauquettev5.3.0
release notes (#3722) @cherniavskiil10n
script not updating csCZ
locale (#3748) @cherniavskiiasync
(#3675) @alexfauquette@ts-expect-error
(#3762) @m4theushwPublished by DanailH almost 3 years ago
A big thanks to the 9 contributors who made this release possible. Here are some highlights β¨:
π Allow to group rows based on column value (#3277) @flaviendelangle
β οΈ This feature is temporarily available on the Pro plan until the release of the Premium plan.
To avoid future regression for users of the Pro plan, the feature needs to be explicitly activated using the rowGrouping experimental feature flag.
// To fully control
<DataGridPro
rowGroupingModel={rowGroupingModel}
onRowGroupingModel={newModel => setRowGroupingModel(newModel)}
experimentalFeatures={{ rowGrouping: true }}
/>
// To initialize without controlling
<DataGridPro
initialState={{
rowGrouping: {
model: rowGroupingModel,
},
}}
experimentalFeatures={{ rowGrouping: true }}
/>
For more details see the introduction blog post and documentation.
β‘ Add is any of
filter operator (#2874) @alexfauquette
The new filter operator is any of
allows the user to provide multiple values. It opens access to complex filtering pattern mixing AND
and OR
logic connectors, such as status is any of filled or rejected, and currency is any of EUR or USD
.
β¨ Introduce a maxWidth
property in GridColDef
(#3550) @flaviendelangle
You can now limit the width of the flex columns and the resizable columns with the new maxWidth
property on GridColDef
.
const columns: GridColDef[] = [
{ field: 'director', flex: 1, maxWidth: 200 }, // will take the free space up to 200px and will not be resizable above 200px
{ field: 'year', maxWidth: 150 }, // will not be resizable above 150px
]
π Add component slots for a subset of used @mui/material
components (#3490) @DanailH
To make the grid more flexible we added component slots for base @mui/material
components that we use. Those component slots are prefixed with Base
to differentiate them from the other grid specific components
For more information check the documentation documentation.
π₯ Allow to pass csvOptions
and printOptions
to toolbar
component prop (#3623) @flaviendelangle
const CustomDataGrid = (props: DataGridProps) => {
return (
<DataGrid {...props} componentsProps={{ toolbar: { csvOptions: { delimiter: ';' } } }} />
)
}
π Add controlled behavior for the visible columns (#3554) @flaviendelangle
// To fully control
<DataGrid
columnVisibilityModel={columnVisibilityModel}
onColumnVisilibilityModelChange={newModel => setColumnVisibilityModel(newModel)}
/>
// To initialize without controlling
<DataGrid
initialState={{
columns: {
columnVisibilityModel
}
}}
/>
See the documentation for more details.
The hide
property from GridColDef
still works but has been deprecated.
π Documentation improvements
π Bugfixes
@mui/[email protected]
/ @mui/[email protected]
@mui/material
components (#3490) @DanailHis any of
filter operator (#2874) @alexfauquettecsvOptions
and printOptions
to GridToolbar
(#3623) @flaviendelangleHide
button if there's only one visible column (#3607) @cherniavskiimaxWidth
property in GridColDef
(#3550) @flaviendelanglepreProcessEditCellProps
(#3562) @flaviendelanglefalse
and true
on columns hiding section (#3561) @alexfauquette@mui/styles
in x-data-grid-generator
(#3560) @m4theushwl10n
issue with a single command line (#3588) @alexfauquettePublished by flaviendelangle almost 3 years ago
A big thanks to the 9 contributors who made this release possible. Here are some highlights β¨:
hideable
option to GridColDef
(#3433) @m4theushwsortingOrder
with the new sortingOrder
option in GridColDef
(#3449) @Quppapage
and pageSize
without controlling them with the initialState
prop (#3495) @flaviendelangleisGroupExpandedByDefault
prop (#3444) @flaviendelangle@mui/[email protected]
/ @mui/[email protected]
hideable
option to GridColDef (#3433) @alexfauquettesortingOrder
to GridColDef (#3449) @QuppagetValue
param from the cell and row params (#3369) @flaviendelangleline-height
from GridCell
(#3446) @DanailHisGroupExpandedByDefault
(#3444) @flaviendelanglepreProcessEditCellProps
(#3453) @m4theushwPublished by alexfauquette almost 3 years ago
A big thanks to the 8 contributors who made this release possible. Here are some highlights β¨:
pinnable
option to GridColDef
(#3425) @m4theushw@mui/[email protected]
/ @mui/[email protected]
pinnable
option (#3425) @m4theushwGridEditDateCell
to handle editRowsModel
correctly (#3267) @alexfauquetteuseGridApi
and useGridState
(#3325) @flaviendelanglex-data-grid
and x-data-grid-pro
packages (#3427) @flaviendelangleA big thanks to the 5 contributors who made this release possible. Here are some highlights β¨:
@mui/[email protected]
/ @mui/[email protected]
π Introduce the column pinning feature (#2946) @m4theushw
π₯ Add ability to disable export options (#3270) @alexfauquette
You can disable either export options by setting disableToolbarButton
to true
.
<GridToolbarExport csvOptions={{ disableToolbarButton: true }} />
<GridToolbarExport printOptions={{ disableToolbarButton: true }} />
π Add a new option to hide the amount of descendant on the grouping cells of the Tree Data (#3368) @flaviendelangle
<DataGridPro
treeData
rows={rows}
columns={columns}
groupingColDef={{ hideDescendantCount }}
/>
β οΈ Deprecate the getValue
param for the valueGetter
callback (#3314) @flaviendelangle
Instead, you can access directly the row in the params
-valueGetter: (params) => `${params.getValue(params.id, 'firstName') || ''} ${params.getValue(params.id, 'lastName') || ''}`
+valueGetter: (params) => `${params.row.firstName || ''} ${params.row.lastName || ''}`
π Documentation improvements
π Bugfixes
hideDescendantCount
option to Tree Data (#3368) @flaviendelanglefields
to the callback version of groupingColDef
(#3316) @flaviendelanglegetValue
param for the valueGetter
callback (#3314) @flaviendelangleDatePicker
bug by limiting years to 4 digits (#3222) @alexfauquetteyarn prettier
script (#3292) @oliviertassinari__modules__
folder in the x-data-grid-generator
package (#3379) @flaviendelangleapi
param in callback interfaces (#3315) @flaviendelangleuseFakeTimers
(#3323) @m4theushwapiRef
documentation (#3266) @flaviendelangleA big thanks to the 11 contributors who made this release possible. Here are some highlights β¨:
@mui/[email protected]
/ @mui/[email protected]
π Introduce the tree data feature (#2725) @flaviendelangle
π
Add support for sx
prop in the DataGrid and DataGridPro (#3281) @m4theushw
π¦ Improve focus management in the filter panel (#3004) @alexfauquette
π Add strict typing to the event publisher and listener (#3022) (@flaviendelangle)
The apiRef.current.subscribeEvent
, apiRef.current.publishEvent
and useGridApiEventHandler
are now fully typed and gives you the correct arguments based on the event you are listening to or emitting.
const handleRowClick: GridEventListener<'rowClick'> = (
params, // has type `GridRowParams`
event, // has type `MuiEvent<React.MouseEvent<HTMLElement>>
details, // has type `GridCallbackDetails
) => {
/* ... */
};
// with string event name
apiRef.current.subscribeEvent('rowClick', handleRowClick);
useGridApiEventHandler(apiRef, 'rowClick', handleRowClick);
// or with enum event name
apiRef.current.subscribeEvent(GridEvents.rowClick, handleRowClick);
useGridApiEventHandler(apiRef, GridEvents.rowClick, handleRowClick);
π Translation updates for many locales
If you are using DataGrid or DataGridPro in another language, check this issue to discover which translations are missing.
π Documentation improvements
π Bugfixes
groupigColDef
prop (#3317) @flaviendelanglesx
prop (#3281) @m4theushwsingleSelect
(#3220) @m4theushwGridOverlay
when no row is provided (#3261) @flaviendelangleInputComponent
for singleSelect
and date
columns #3227 @alexfauquetteEventManager
to not run listeners removed after registration #3206 @flaviendelangleautoHeight
(#3216) @alexfauquettePublished by flaviendelangle almost 3 years ago
Nov 23, 2021
A big thanks to the 3 contributors who made this release possible. Here are some highlights β¨:
π New API to validate the editing values (#3006) @m4theushw
You can now use the preProcessEditCellProps
key in GridColDef
to synchronously or asynchronously validate the values committed.
const columns: GridColDef[] = [
{
field: 'firstName',
preProcessEditCellProps: (params: GridEditCellPropsChangeParams) => {
const hasError = params.props.value.length < 3;
return { ...params.props, error: hasError };
},
},
{
field: 'email',
preProcessEditCellProps: async (params: GridEditCellPropsChangeParams) => {
const userWithEmail = await fetchUserByEmail(params.value);
const hasError = !!userWithEmail;
return { ...params.props, error: hasError };
}
}
];
β¨ New method getRootDimensions
to access the size of the grid (#3007) @flaviendelangle
It contains the size of the viewport (which is the scrollable container containing the rows and columns) considering scrollbars or not.
const dimensions = apiRef.current.getRootDimensions();
@mui/[email protected]
/ @mui/[email protected]
@mui/x-data-grid
type entrypoint (#3196) @flaviendelangleuseGridContainerProps
(#3007) @flaviendelanglegetRowIdFromRowIndex
and getRowIndex
to the sorting API (#3126) @flaviendelangleindex.ts
of the export hooks (#3165) @flaviendelanglePublished by flaviendelangle almost 3 years ago
Nov 23, 2021
π We are excited to introduce MUI X v5.0.0 π!
If you want to migrate the DataGrid or DataGridPro from v4 to v5, take a look at the migration guide.
This version is fully compatible with @mui/[email protected]
and can be used with @material-ui/[email protected]
with some additional steps.
A big thanks to the 7 contributors who made this release possible. Here are some highlights β¨:
@mui/[email protected]
/ @mui/[email protected]
[DataGrid] The following CSS classes were renamed to follow the internal convention:
MuiDataGrid-columnsContainer
was renamed to MuiDataGrid-columnHeaders
MuiDataGrid-columnHeaderWrapper
was renamed to MuiDataGrid-columnHeadersInner
scroll
class applied to MuiDataGrid-columnHeaderWrapper
was renamed to MuiDataGrid-columnHeadersInner--scrollable
[DataGrid] The props.components.Checkbox
and props.componentsProps.checkbox
props were renamed to props.components.BaseCheckbox
and props.componentsProps.baseCheckbox
respectively.
As a first step for #3066, these slots were renamed to clearly indicate that they are meant to replace a core component.
<DataGrid
components={{
- checkbox: MyCustomCheckbox,
+ BaseCheckbox: MyCustomCheckbox,
}}
componentsProps={{
- checkbox: {},
+ baseCheckbox: {},
}}
/>
Note: these changes apply to both the DataGrid
and DataGridPro
components.
apiRef.current.updateRows
on the Community plan (#3095) @flaviendelangleapiRef.current.updateRows
to not share rows from other instances (#3127) @m4theushwCheckbox
component and props slots to BaseCheckbox
(#3142) @DanailHLicenseStatus
(#3141) @Himself65useGridColumnsPreProcessing
generic (#3092) @m4theushwcreateClientRender
with new createRenderer
API (#3125) @flaviendelangleGridApi
instead of making the whole GridApi
extend it (#3069) @flaviendelangleunstable_
prefix instead of unsafe_
for private APIs (#3090) @flaviendelanglerowCount
CSS class description (#3072) @ZeeshanTamboliPublished by alexfauquette almost 3 years ago
Nov 4, 2021
@mui/[email protected]
/ @mui/[email protected]
[core] Prefix selectors from useGridContainerProps
with unstable
(#3002) @flaviendelangle
The dimension API is being temporarily made private to allow to clean it in future minor releases. The current approach causes useless re-renders.
If you relay on any of these selectors, open an issue explaining the use case so that will be taken into account when refactoring them.
The following selectors were prefixed by unstable_
. Use the provided alternatives.
gridContainerSizesSelector
was renamed to unstable_gridContainerSizesSelector
gridViewportSizesSelector
was renamed to unstable_gridViewportSizesSelector
gridScrollBarSizeSelector
was renamed to unstable_gridScrollBarSizeSelector
The following selectors were removed. You can hard-code their logic in your application if you really need them.
gridDataContainerSizesSelector
const dataContainerSizes = gridContainerSizesSelector(state)?.dataContainerSizes ?? null;
gridDataContainerHeightSelector
const dataContainerHeight = gridContainerSizesSelector(state)?.dataContainerSizes.height ?? null;
The selector gridViewportSizeStateSelector
was a duplicate and has been removed, you can use the selector unstable_gridViewportSizesSelector
instead.
GridEditDateCell
to handle timezone correctly (#2918) @flaviendelanglecellModeChange
when setCellMode
is called (#3025) @flaviendelangleuseDemoData
for Tree Data (#2978) @flaviendelangle*.tsbuildinfo
files (#3068) @m4theushwuseGridContainerProps
with unsafe
(#3002) @flaviendelanglesetGridState
and applyFilters
call when updating filterModel
(#3023) @flaviendelanglevalueGetter
to transform type (#3003) @alexfauquettePublished by DanailH almost 3 years ago
Nov 1, 2021
This version backports bug fixes and some of the features from the v5.x active release line.
As the development of v5 evolves, newer fixes might not be cherry-picked to the legacy version.
To have access to the latest features it is encouraged to upgrade to MUI X v5.
Upgrading MUI Core to v5 is also recommended, however, v4 can still be used by following these instructions.
Big thanks to the 3 contributors who made this release possible. Here are some highlights β¨:
@mui/[email protected]
/ @mui/[email protected]