-
-
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 branch 'master' into speed-test-unit
- Loading branch information
Showing
43 changed files
with
624 additions
and
64 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,34 @@ | ||
import * as React from 'react'; | ||
import { DataGrid, gridClasses } from '@mui/x-data-grid'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
import { grey } from '@mui/material/colors'; | ||
|
||
export default function RowMarginGrid() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Commodity', | ||
rowLength: 200, | ||
maxColumns: 6, | ||
}); | ||
|
||
const getRowSpacing = React.useCallback((params) => { | ||
return { | ||
top: params.isFirstVisible ? 0 : 5, | ||
bottom: params.isLastVisible ? 0 : 5, | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div style={{ height: 400, width: '100%' }}> | ||
<DataGrid | ||
{...data} | ||
getRowSpacing={getRowSpacing} | ||
sx={{ | ||
[`& .${gridClasses.row}`]: { | ||
bgcolor: (theme) => | ||
theme.palette.mode === 'light' ? grey[200] : grey[800], | ||
}, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
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,34 @@ | ||
import * as React from 'react'; | ||
import { DataGrid, GridRowSpacingParams, gridClasses } from '@mui/x-data-grid'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
import { grey } from '@mui/material/colors'; | ||
|
||
export default function RowMarginGrid() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Commodity', | ||
rowLength: 200, | ||
maxColumns: 6, | ||
}); | ||
|
||
const getRowSpacing = React.useCallback((params: GridRowSpacingParams) => { | ||
return { | ||
top: params.isFirstVisible ? 0 : 5, | ||
bottom: params.isLastVisible ? 0 : 5, | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div style={{ height: 400, width: '100%' }}> | ||
<DataGrid | ||
{...data} | ||
getRowSpacing={getRowSpacing} | ||
sx={{ | ||
[`& .${gridClasses.row}`]: { | ||
bgcolor: (theme) => | ||
theme.palette.mode === 'light' ? grey[200] : grey[800], | ||
}, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
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,10 @@ | ||
<DataGrid | ||
{...data} | ||
getRowSpacing={getRowSpacing} | ||
sx={{ | ||
[`& .${gridClasses.row}`]: { | ||
bgcolor: (theme) => | ||
theme.palette.mode === 'light' ? grey[200] : grey[800], | ||
}, | ||
}} | ||
/> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; | ||
import { demos, docs, demoComponents } from './grid-row-class-name-params.md?@mui/markdown'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs demos={demos} docs={docs} demoComponents={demoComponents} />; | ||
} |
22 changes: 22 additions & 0 deletions
22
docs/pages/api-docs/data-grid/grid-row-class-name-params.md
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,22 @@ | ||
# GridRowClassNameParams Interface | ||
|
||
<p class="description">Object passed as parameter in the row `getRowClassName` callback prop.</p> | ||
|
||
## Import | ||
|
||
```js | ||
import { GridRowClassNameParams } from '@mui/x-data-grid-pro'; | ||
// or | ||
import { GridRowClassNameParams } from '@mui/x-data-grid'; | ||
``` | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | | ||
| :-------------------------------------------- | :-------------------------------------------------------------------------------- | :--------------------------------------------------------- | | ||
| <span class="prop-name">columns</span> | <span class="prop-type">GridColumns</span> | All grid columns. | | ||
| <span class="prop-name">getValue</span> | <span class="prop-type">(id: GridRowId, field: string) => GridCellValue</span> | Get the cell value of a row and field. | | ||
| <span class="prop-name">id</span> | <span class="prop-type">GridRowId</span> | The grid row id. | | ||
| <span class="prop-name">isFirstVisible</span> | <span class="prop-type">boolean</span> | Whether this row is the first visible or not. | | ||
| <span class="prop-name">isLastVisible</span> | <span class="prop-type">boolean</span> | Whether this row is the last visible or not. | | ||
| <span class="prop-name">row</span> | <span class="prop-type">R</span> | The row model of the row that the current cell belongs to. | |
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,7 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; | ||
import { demos, docs, demoComponents } from './grid-row-spacing-params.md?@mui/markdown'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs demos={demos} docs={docs} demoComponents={demoComponents} />; | ||
} |
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,20 @@ | ||
# GridRowSpacingParams Interface | ||
|
||
<p class="description">Object passed as parameter in the row `getRowSpacing` callback prop.</p> | ||
|
||
## Import | ||
|
||
```js | ||
import { GridRowSpacingParams } from '@mui/x-data-grid-pro'; | ||
// or | ||
import { GridRowSpacingParams } from '@mui/x-data-grid'; | ||
``` | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | | ||
| :-------------------------------------------- | :------------------------------------------ | :-------------------------------------------- | | ||
| <span class="prop-name">id</span> | <span class="prop-type">GridRowId</span> | The row id. | | ||
| <span class="prop-name">isFirstVisible</span> | <span class="prop-type">boolean</span> | Whether this row is the first visible or not. | | ||
| <span class="prop-name">isLastVisible</span> | <span class="prop-type">boolean</span> | Whether this row is the last visible or not. | | ||
| <span class="prop-name">model</span> | <span class="prop-type">GridRowModel</span> | The row model. | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs'; | ||
import { demos, docs, demoComponents } from './grid-row-class-name-params.md?@mui/markdown'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs demos={demos} docs={docs} demoComponents={demoComponents} />; | ||
} |
Oops, something went wrong.