Skip to content

Commit

Permalink
v8.0.0-alpha.13 (#16684)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Fauquette <[email protected]>
Co-authored-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Andrew Cherniavskyi <[email protected]>
Co-authored-by: Kenan Yusuf <[email protected]>
Co-authored-by: Armin Mehinovic <[email protected]>
Co-authored-by: Michel Engelen <[email protected]>
  • Loading branch information
6 people authored Feb 28, 2025
1 parent 3855f1e commit 7746150
Show file tree
Hide file tree
Showing 16 changed files with 314 additions and 15 deletions.
299 changes: 299 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,305 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 8.0.0-alpha.13

_Feb 28, 2025_

We'd like to offer a big thanks to the 19 contributors who made this release possible. Here are some highlights ✨:

- 📊 Decouple `margin` and `axis-size`. A new API to support multiple axes (#16418) @JCQuintas
- 🗺️ Added Bangla (bn-BD) locale
- 🗺️ Improve Russian (ru-RU) and Hungarian (hu-HU) locale on the Data Grid

Special thanks go out to the community members for their contributions:
@denpiligrim, @lhilgert9, @noherczeg, @officialkidmax, @pcorpet.
Following are all team members who have contributed to this release:
@alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @hasdfa, @Janpot, @JCQuintas, @KenanYusuf, @LukasTy, @michelengelen, @MBilalShafi, @oliviertassinari, @romgrk.

<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->

### Data Grid

#### Breaking changes

- The `slots.baseFormControl` component was removed.

- The "Reset" button in the column visibility panel now resets to the initial column visibility model. Previously it was reset to the model that was active at the time the panel was opened. The reset behavior follows these rules:

1. If an initial `columnVisibilityModel` is provided, it resets to that model.
2. If a controlled `columnVisibilityModel` is provided, it resets to the first model value.
3. When the columns are updated (via the `columns` prop or `updateColumns()` API method), the reset reference point updates to the current `columnVisibilityModel`.

To revert to the previous behavior, provide a custom component to the `slots.columnsManagement`.

- The deprecated `LicenseInfo` export has been removed from the `@mui/x-data-grid-pro` and `@mui/x-data-grid-premium` packages.
You have to import it from `@mui/x-license` instead:

```diff
- import { LicenseInfo } from '@mui/x-data-grid-pro';
- import { LicenseInfo } from '@mui/x-data-grid-premium';
+ import { LicenseInfo } from '@mui/x-license';

LicenseInfo.setLicenseKey('YOUR_LICENSE_KEY');
```

- The row selection model has been changed from `GridRowId[]` to `{ type: 'include' | 'exclude'; ids: Set<GridRowId> }`.
Using `Set` allows for a more efficient row selection management.
The `exclude` selection type allows to select all rows except the ones in the `ids` set.

This change impacts the following props:

- `rowSelectionModel`
- `onRowSelectionModelChange`
- `initialState.rowSelectionModel`

```diff
- const [rowSelectionModel, setRowSelectionModel] = React.useState<GridRowSelectionModel>([]);
+ const [rowSelectionModel, setRowSelectionModel] = React.useState<GridRowSelectionModel>({ type: 'include', ids: new Set() });
```

This change also impacts the `gridRowSelectionStateSelector` selector.
For convenience, use the `gridRowSelectionManagerSelector` selector to handle both selection types:

```diff
- const rowSelection = gridRowSelectionStateSelector(apiRef);
- const isRowSelected = rowSelection.includes(rowId);
+ const rowSelectionManager = gridRowSelectionManagerSelector(apiRef);
+ const isRowSelected = rowSelectionManager.has(rowId);
```

There is also a `createRowSelectionManager` utility function that can be used to manage the row selection:

```ts
const rowSelectionManager = createRowSelectionManager({
type: 'include',
ids: new Set(),
});
rowSelectionManager.select(rowId);
rowSelectionManager.unselect(rowId);
rowSelectionManager.has(rowId);
```

- The `selectedIdsLookupSelector` selector has been removed. Use the `gridRowSelectionManagerSelector` or `gridRowSelectionStateSelector` selectors instead.
- The `selectedGridRowsSelector` has been renamed to `gridRowSelectionIdsSelector`.
- The `selectedGridRowsCountSelector` has been renamed to `gridRowSelectionCountSelector`.

- The data source feature and its related props are now stable.

```diff
<DataGridPro
- unstable_dataSource={dataSource}
- unstable_dataSourceCache={cache}
- unstable_lazyLoading
- unstable_lazyLoadingRequestThrottleMs={100}
+ dataSource={dataSource}
+ dataSourceCache={cache}
+ lazyLoading
+ lazyLoadingRequestThrottleMs={100}
/>
```

- The data source API is now stable.

```diff
- apiRef.current.unstable_dataSource.getRows()
+ apiRef.current.dataSource.getRows()
```

- The signature of `unstable_onDataSourceError()` has been updated to support future use-cases.

```diff
<DataGrid
- unstable_onDataSourceError={(error: Error, params: GridGetRowsParams) => {
- if (params.filterModel) {
- // do something
- }
- }}
+ unstable_onDataSourceError={(error: GridGetRowsError | GridUpdateRowError) => {
+ if (error instanceof GridGetRowsError && error.params.filterModel) {
+ // do something
+ }
+ }}
/>
```

- Fix the type of the `GridSortModel` to allow readonly arrays.

- `GridSortItem` interface is not exported anymore.

- The `showToolbar` prop is now required to display the toolbar.

It is no longer necessary to pass `GridToolbar` as a slot to display the default toolbar.

```diff
<DataGrid
+ showToolbar
- slots={{
- toolbar: GridToolbar,
- }}
/>
```

#### `@mui/[email protected]`

- [DataGrid] Add `showToolbar` prop to enable default toolbar (#16687) @KenanYusuf
- [DataGrid] Column Visibility: Update "Reset" button behavior (#16626) @MBilalShafi
- [DataGrid] Column management design updates (#16630) @KenanYusuf
- [DataGrid] Fix `showColumnVerticalBorder` prop (#16715) @KenanYusuf
- [DataGrid] Fix scrollbar overlapping cells on mount (#16639) @KenanYusuf
- [DataGrid] Fix: base `Select` menuprops `onClose()` (#16643) @romgrk
- [DataGrid] Make `GridSortItem` internal (#16732) @arminmeh
- [DataGrid] Make data source stable (#16710) @MBilalShafi
- [DataGrid] Reshape row selection model (#15651) @cherniavskii
- [DataGrid] Replace `sx` prop usage with `styled()` components (#16665) @KenanYusuf
- [DataGrid] Refactor: create base `Autocomplete` (#16390) @romgrk
- [DataGrid] Refactor: remove base form control (#16634) @romgrk
- [DataGrid] Refactor: remove base input label & adornment (#16646) @romgrk
- [DataGrid] Refactor: remove material containers (#16633) @romgrk
- [DataGrid] Refactor: theme to CSS variables (#16588) @romgrk
- [DataGrid] Update the signature of the `onDataSourceError()` callback (#16718) @MBilalShafi
- [DataGrid] Use readonly array for the `GridSortModel` (#16627) @pcorpet
- [DataGrid] Fix the popper focus trap (#16736) @romgrk
- [l10n] Added Bangla (bn-BD) locale (#16648) @officialkidmax
- [l10n] Improve Hungarian (hu-HU) locale (#16578) @noherczeg
- [l10n] Improve Russian (ru-RU) locale (#16591) @denpiligrim

#### `@mui/[email protected]` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')

Same changes as in `@mui/[email protected]`, plus:

- [DataGridPro] Remove `LicenseInfo` reexports (#16671) @cherniavskii

#### `@mui/[email protected]` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')

Same changes as in `@mui/[email protected]`, plus:

- [DataGridPremium] Use `valueGetter` to get row group keys (#16016) @cherniavskii

### Date and Time Pickers

#### Breaking changes

- The `<DateRangePicker />` now uses a `dialog` instead of a `tooltip` to render their view when used with a single input range field.

#### `@mui/[email protected]`

- [l10n] Added Bangla (bn-BD) locale (#16648) @officialkidmax
- [pickers] Clean the typing of the slots on the range pickers (#16670) @flaviendelangle
- [pickers] Fix Time Clock meridiem button selected styles (#16681) @LukasTy
- [pickers] Make the single input field the default field on range pickers (#16656) @flaviendelangle
- [pickers] Move the opening logic to the range fields (#16175) @flaviendelangle

#### `@mui/[email protected]` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')

Same changes as in `@mui/[email protected]`.

### Charts

#### Breaking changes

- Charts array inputs are now `readonly`. Allowing externally defined `as const` to be used as a prop value of the React component.

```tsx
const xAxis = [{ position: 'bottom' }] as const
<BarChart xAxis={xAxis} />
```

- Replace `topAxis`, `rightAxis`, `bottomAxis` and `leftAxis` props by the `position` property in the axis config.
If you were using them to place axis, set the `position` property to the corresponding value `'top' | 'right' | 'bottom' | 'left'`.
If you were disabling an axis by setting it to `null`, set its `position` to `'none'`.

```diff
<LineChart
yAxis={[
{
scaleType: 'linear',
+ position: 'right',
},
]}
series={[{ data: [1, 10, 30, 50, 70, 90, 100], label: 'linear' }]}
height={400}
- rightAxis={{}}
/>
```

- Remove `position` prop from `ChartsXAxis` and `ChartsYAxis`.
The `position` prop has been removed from the `ChartsXAxis` and `ChartsYAxis` components. Configure it directly in the axis config.

```diff
<ChartContainer
yAxis={[
{
id: 'my-axis',
+ position: 'right',
},
]}
>
- <ChartsYAxis axisId="my-axis" position="right" />
+ <ChartsYAxis axisId="my-axis" />
</ChartContainer>
```

- Add `minTickLabelGap` to x-axis, which allows users to define the minimum gap, in pixels, between two tick labels. The default value is 4px. Make sure to check your charts as the spacing between tick labels might have changed.

#### `@mui/[email protected]`

- [charts] Accept component in `labelMarkType` (#16739) @bernardobelchior
- [charts] Add `minTickLabelGap` to x-axis (#16548) @bernardobelchior
- [charts] Add unit test for pie chart with empty series (#16663) @bernardobelchior
- [charts] Decouple `margin` and `axis-size` (#16418) @JCQuintas
- [charts] Display slider tooltip on demos (#16723) @JCQuintas
- [charts] Fix composition docs link (#16761) @bernardobelchior
- [charts] Fix default label measurement being off (#16635) @bernardobelchior
- [charts] Fix is highlighted memoization (#16592) @alexfauquette
- [charts] Fix missing `theme.shape` error in the tooltip (#16748) @alexfauquette
- [charts] Fix typo in error message (#16641) @JCQuintas
- [charts] Improve axis size docs (#16673) @JCQuintas
- [charts] Improve performance of rendering ticks in x-axis (#16536) @bernardobelchior
- [charts] Make `defaultizeAxis` function type-safe (#16642) @JCQuintas
- [charts] Make `series.data` readonly (#16645) @JCQuintas
- [charts] Migrate `ChartsUsageDemo` to TSX and removed NoSnap (#16686) @JCQuintas
- [charts] Prevent `position='none'` axes from rendering (#16727) @JCQuintas
- [charts] Make array inputs readonly (#16632) @JCQuintas
- [charts] Remove state initialization hack (#16520) @alexfauquette
- [charts] Remove redundant default axis (#16734) @bernardobelchior

#### `@mui/[email protected]` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')

Same changes as in `@mui/[email protected]`, plus:

- [charts-pro] Add back zoom control (#16550) @alexfauquette

### Tree View

#### `@mui/[email protected]`

Internal changes.

#### `@mui/[email protected]` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')

Same changes as in `@mui/[email protected]`.

### `@mui/[email protected]`

- [codemod] Add a few Data Grid codemods (#16711) @MBilalShafi
- [codemod] Improve Pickers renaming codemod (#16685) @LukasTy

### Docs

- [docs] Fix charts with on bar and line pages (#16712) @alexfauquette
- [docs] Fix migration guide introduction for charts (#16679) @alexfauquette
- [docs] Fix remaining charts demos on mobile (#16728) @alexfauquette
- [docs] Fix scroll overflow on mobile (#16675) @oliviertassinari
- [docs] Improve Pickers migration page (#16682) @LukasTy
- [docs] Update small Pickers doc inconsistencies (#16724) @LukasTy
- [code-infra] Charts changes for `vitest` (#16755) @JCQuintas
- [code-infra] General packages changes for `vitest` (#16757) @JCQuintas
- [code-infra] Native Node.js ESM (#16603) @Janpot
- [infra] Update contributor acknowledgment wording (#16751) @michelengelen
- [test] Revert timeout increase for possibly slow tests (#16651) @LukasTy
- [x-license] Introduce usage telemetry (#13530) @hasdfa

## 8.0.0-alpha.12

_Feb 17, 2025_
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts-pro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-charts-pro",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"description": "The Pro plan edition of the Charts components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts-vendor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-charts-vendor",
"version": "8.0.0-alpha.10",
"version": "8.0.0-alpha.13",
"description": "Vendored dependencies for MUI X Charts",
"author": "MUI Team",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-charts",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"description": "The community edition of the Charts components (MUI X).",
"author": "MUI Team",
"main": "src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-codemod",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"bin": "./codemod.js",
"private": false,
"author": "MUI Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-data-grid-generator",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"description": "Generate fake data for demo purposes only.",
"author": "MUI Team",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-premium/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-data-grid-premium",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"description": "The Premium plan edition of the Data Grid Components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-pro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-data-grid-pro",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"description": "The Pro plan edition of the Data Grid components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-data-grid",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"description": "The Community plan edition of the Data Grid components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers-pro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-date-pickers-pro",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"description": "The Pro plan edition of the Date and Time Picker components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/x-date-pickers",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"description": "The community edition of the Date and Time Picker components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
Expand Down
Loading

0 comments on commit 7746150

Please sign in to comment.