Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/next' into renovate/react
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed Dec 15, 2023
2 parents f0c6585 + a6f1170 commit 8ba4628
Show file tree
Hide file tree
Showing 280 changed files with 2,848 additions and 1,998 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/cherry-pick-next-to-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
pull_request:
branches:
- next
types: ['closed']

jobs:
cherry_pick_to_master:
runs-on: ubuntu-latest
name: Cherry pick into master
permissions:
pull-requests: write
contents: write
if: ${{ contains(github.event.pull_request.labels.*.name, 'needs cherry-pick') && github.event.pull_request.merged == true }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cherry pick and create the new PR
uses: carloscastrojumo/github-cherry-pick-action@v1.0.9
with:
branch: master
token: ${{ secrets.GITHUB_TOKEN }}
body: 'Cherry-pick of #{old_pull_request_id}'
labels: |
cherry-pick
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8
uses: github/codeql-action/init@c0d1daa7f7e14667747d73a7dbbe8c074bc8bfe2 # v2.22.9
with:
languages: typescript
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -29,4 +29,4 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8
uses: github/codeql-action/analyze@c0d1daa7f7e14667747d73a7dbbe8c074bc8bfe2 # v2.22.9
6 changes: 4 additions & 2 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: No Response

# Both `issue_comment` and `scheduled` event types are required for this Action
# `issues`.`closed`, `issue_comment`.`created`, and `scheduled` event types are required for this Action
# to work properly.
on:
issues:
types: [closed]
issue_comment:
types: [created]
schedule:
Expand All @@ -18,7 +20,7 @@ jobs:
contents: read
issues: write
steps:
- uses: MBilalShafi/no-response-add-label@6291e5d1a4eaffe530b2ec434991f258641a8599
- uses: MBilalShafi/no-response-add-label@629add01d7b6f8e120811f978c42703736098947
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Number of days of inactivity before an Issue is closed for lack of response
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8
uses: github/codeql-action/upload-sarif@c0d1daa7f7e14667747d73a7dbbe8c074bc8bfe2 # v2.22.9
with:
sarif_file: results.sarif
203 changes: 203 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,167 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 7.0.0-alpha.5

_Dec 14, 2023_

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

- 💫 New recipe added for the Data Grid
- 🌍 Improve Swedish (sv-SE) and Urdu (ur-PK) locales on the Data Grid
- 🐞 Bugfixes

### Data Grid

#### Breaking changes

- The `instanceId` prop is now required for state selectors.
This prop is used to distinguish between multiple Data Grid instances on the same page.
See [migration docs](https://next.mui.com/x/migration/migration-data-grid-v6/#instanceid-prop-is-required-for-state-selectors) for more details.

#### `@mui/x-data-grid@7.0.0-alpha.5`

- [DataGrid] Make `instanceId` required for state selectors (#11395) @cherniavskii
- [DataGrid] Recipe for grouped rows autosizing (#11401) @michelengelen
- [l10n] Improve Swedish (sv-SE) locale (#11373) @fredrikcarlbom
- [l10n] Improve Urdu (ur-PK) locale (#11400) @MBilalShafi

#### `@mui/x-data-grid-pro@7.0.0-alpha.5` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')

Same changes as in `@mui/x-data-grid@7.0.0-alpha.5`.

#### `@mui/x-data-grid-premium@7.0.0-alpha.5` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')

Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.5`.

### Date Pickers

#### Breaking changes

- The slot interfaces got renamed to match with `@mui/base` naming.
The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsProps` with `SlotProps`.

```diff
- DateCalendarSlotsComponent
+ DateCalendarSlots
- DateCalendarSlotsComponentsProps
+ DateCalendarSlotProps
```

- Move `inputRef` inside the props passed to the field hooks

The field hooks now only receive the props instead of an object containing both the props and the `inputRef`.

```diff
- const { inputRef, ...otherProps } = props
- const fieldResponse = useDateField({ props: otherProps, inputRef });
+ const fieldResponse = useDateField(props);
```

If you are using a multi input range field hook, the same applies to `startInputRef` and `endInputRef` params

```diff
- const { inputRef: startInputRef, ...otherStartTextFieldProps } = startTextFieldProps
- const { inputRef: endInputRef, ...otherEndTextFieldProps } = endTextFieldProps

const fieldResponse = useMultiInputDateRangeField({
sharedProps,
- startTextFieldProps: otherStartTextFieldProps,
- endTextFieldProps: otherEndTextFieldProps,
- startInputRef
- endInputRef,
+ startTextFieldProps,
+ endTextFieldProps
});
```

- Rename the ref returned by the field hooks to `inputRef`

When used with the v6 TextField approach (where the input is an `<input />` HTML element), the field hooks return a ref that needs to be passed to the `<input />` element.
This ref was previously named `ref` and has been renamed `inputRef` for extra clarity.

```diff
const fieldResponse = useDateField(props);

- return <input ref={fieldResponse.ref} />
+ return <input ref={fieldResponse.inputRef} />
```

If you are using a multi input range field hook, the same applies to the ref in the `startDate` and `endDate` objects

```diff
const fieldResponse = useDateField(props);

return (
<div>
- <input ref={fieldResponse.startDate.ref} />
+ <input ref={fieldResponse.startDate.inputRef} />
<span>–</span>
- <input ref={fieldResponse.endDate.ref} />
+ <input ref={fieldResponse.endDate.inputRef} />
</div>
)
```

- Restructure the API of `useClearableField`

The `useClearableField` hook API has been simplified to now take a `props` parameter instead of a `fieldProps`, `InputProps`, `clearable`, `onClear`, `slots` and `slotProps` parameters.

You should now be able to directly pass the returned value from your field hook (e.g: `useDateField`) to `useClearableField`

```diff
const fieldResponse = useDateField(props);

- const { InputProps, onClear, clearable, slots, slotProps, ...otherFieldProps } = fieldResponse
- const { InputProps: ProcessedInputProps, fieldProps: processedFieldProps } = useClearableField({
- fieldProps: otherFieldProps,
- InputProps,
- clearable,
- onClear,
- slots,
- slotProps,
- });
-
- return <MyCustomTextField {...processedFieldProps} InputProps={ProcessedInputProps} />

+ const processedFieldProps = useClearableField(fieldResponse);
+
+ return <MyCustomTextField {...processedFieldProps} />
```

#### `@mui/x-date-pickers@7.0.0-alpha.5`

- [fields] Support empty sections (#10307) @flaviendelangle
- [pickers] Fix field types to avoid error on latest `@types/react` version (#11397) @LukasTy
- [pickers] Remove all relative imports to the internals index file (#11375) @flaviendelangle
- [pickers] Rename slots interfaces (#11339) @alexfauquette
- [pickers] Simplify the API of the field hooks (#11371) @flaviendelangle
- [pickers] Support name prop (#11025) @gitstart

#### `@mui/x-date-pickers-pro@7.0.0-alpha.5` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')

Same changes as in `@mui/x-date-pickers@7.0.0-alpha.5`, plus:

- [DateRangePicker] Fix `autoFocus` behavior (#11273) @kealjones-wk

### Charts / `@mui/x-charts@7.0.0-alpha.5`

- [charts] Fix size overflow (#11385) @alexfauquette

### `@mui/x-codemod@7.0.0-alpha.5`

- [codemod] Add `cellSelection` codemod and update migration guide (#11353) @MBilalShafi

### Docs

- [docs] Respect GoT books (@janoma) (#11387) @alexfauquette

### Core

- [core] Automate cherry-pick of PRs from `next` -> `master` (#11382) @MBilalShafi
- [github] Update `no-response` workflow (#11369) @MBilalShafi
- [test] Fix flaky screenshots (#11388) @cherniavskii

## 7.0.0-alpha.4

_Dec 8, 2023_
Expand Down Expand Up @@ -949,6 +1110,48 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
- [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
- [license] Correctly throw errors (#10924) @oliviertassinari

## 6.18.5

_Dec 14, 2023_

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

- 🌍 Improve Swedish (sv-SE) and Urdu (ur-PK) locales on the Data Grid
- 🐞 Bugfixes

### Data Grid

#### `@mui/x-data-grid@6.18.5`

- [l10n] Improve Swedish (sv-SE) locale (#11379) @fredrikcarlbom
- [l10n] Improve Urdu (ur-PK) locale for data grid (#11409) @MBilalShafi

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

Same changes as in `@mui/x-data-grid@6.18.5`.

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

Same changes as in `@mui/x-data-grid-pro@6.18.5`.

### Date Pickers

#### `@mui/x-date-pickers@6.18.5`

- [pickers] Fix field types to avoid error on latest `@types/react` version (#11398) @LukasTy
- [pickers] Support name prop (#11380) @gitstart

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

Same changes as in `@mui/x-date-pickers@6.18.5`, plus:

- [DateRangePicker] Fix `autoFocus` behavior (#11376) @kealjones-wk

### Docs

- [docs] Respect GoT books (#11294) @janoma
- [test] Fix flaky screenshots (#11391) @cherniavskii

## 6.18.4

_Dec 8, 2023_
Expand Down
41 changes: 21 additions & 20 deletions docs/data/charts/styling/MarginNoSnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,27 @@ export default function MarginNoSnap() {
componentName="Margin demos"
data={data}
renderDemo={(props) => (
<BarChart
series={[{ data: [6, 18, 12] }]}
width={500}
height={300}
margin={{
left: props.left,
right: props.right,
top: props.top,
bottom: props.bottom,
}}
xAxis={[
{
id: DEFAULT_X_AXIS_KEY,
scaleType: 'band',
data: ['Page 1', 'Page 2', 'Page 3'],
},
]}
topAxis={DEFAULT_X_AXIS_KEY}
rightAxis={DEFAULT_Y_AXIS_KEY}
/>
<div style={{ width: '100%', margin: 4 }}>
<BarChart
series={[{ data: [6, 18, 12] }]}
height={300}
margin={{
left: props.left,
right: props.right,
top: props.top,
bottom: props.bottom,
}}
xAxis={[
{
id: DEFAULT_X_AXIS_KEY,
scaleType: 'band',
data: ['Page 1', 'Page 2', 'Page 3'],
},
]}
topAxis={DEFAULT_X_AXIS_KEY}
rightAxis={DEFAULT_Y_AXIS_KEY}
/>
</div>
)}
getCode={({ props }) => {
return [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import * as React from 'react';
import {
DataGridPremium,
useGridApiRef,
useKeepGroupedColumnsHidden,
} from '@mui/x-data-grid-premium';
import { useMovieData } from '@mui/x-data-grid-generator';

export default function ColumnAutosizingGroupedRows() {
const data = useMovieData();
const apiRef = useGridApiRef();

const columns = React.useMemo(() => {
return data.columns.map((col) => ({ ...col, width: 50 }));
}, [data.columns]);

const initialState = useKeepGroupedColumnsHidden({
apiRef,
initialState: { rowGrouping: { model: ['company'] } },
});

React.useEffect(() => {
return apiRef.current.subscribeEvent('rowExpansionChange', (params) => {
if (params.childrenExpanded) {
apiRef.current.autosizeColumns({ includeOutliers: true });
}
});
}, [apiRef]);

return (
<div style={{ height: 400, width: '100%' }}>
<DataGridPremium
{...data}
columns={columns}
apiRef={apiRef}
initialState={initialState}
groupingColDef={{ width: 250 }}
/>
</div>
);
}
Loading

0 comments on commit 8ba4628

Please sign in to comment.