-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/next' into renovate/react
- Loading branch information
Showing
280 changed files
with
2,848 additions
and
1,998 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
docs/data/data-grid/column-dimensions/ColumnAutosizingGroupedRows.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
Oops, something went wrong.