forked from mui/mui-x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DataGrid] Add Skeleton loading overlay support (mui#13293)
Signed-off-by: Kenan Yusuf <[email protected]> Co-authored-by: Olivier Tassinari <[email protected]> Co-authored-by: Andrew Cherniavskii <[email protected]>
- Loading branch information
1 parent
8549d1b
commit 1ab8174
Showing
32 changed files
with
913 additions
and
96 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
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
27 changes: 27 additions & 0 deletions
27
docs/data/data-grid/overlays/LoadingOverlayLinearProgress.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,27 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
import { DataGrid } from '@mui/x-data-grid'; | ||
|
||
export default function LoadingOverlayLinearProgress() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Commodity', | ||
rowLength: 100, | ||
maxColumns: 6, | ||
}); | ||
|
||
return ( | ||
<Box sx={{ width: '100%', height: 400 }}> | ||
<DataGrid | ||
{...data} | ||
loading | ||
slotProps={{ | ||
loadingOverlay: { | ||
variant: 'linear-progress', | ||
noRowsVariant: 'linear-progress', | ||
}, | ||
}} | ||
/> | ||
</Box> | ||
); | ||
} |
27 changes: 27 additions & 0 deletions
27
docs/data/data-grid/overlays/LoadingOverlayLinearProgress.tsx
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,27 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
import { DataGrid } from '@mui/x-data-grid'; | ||
|
||
export default function LoadingOverlayLinearProgress() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Commodity', | ||
rowLength: 100, | ||
maxColumns: 6, | ||
}); | ||
|
||
return ( | ||
<Box sx={{ width: '100%', height: 400 }}> | ||
<DataGrid | ||
{...data} | ||
loading | ||
slotProps={{ | ||
loadingOverlay: { | ||
variant: 'linear-progress', | ||
noRowsVariant: 'linear-progress', | ||
}, | ||
}} | ||
/> | ||
</Box> | ||
); | ||
} |
10 changes: 10 additions & 0 deletions
10
docs/data/data-grid/overlays/LoadingOverlayLinearProgress.tsx.preview
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} | ||
loading | ||
slotProps={{ | ||
loadingOverlay: { | ||
variant: 'linear-progress', | ||
noRowsVariant: 'linear-progress', | ||
}, | ||
}} | ||
/> |
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,32 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
import { DataGridPro } from '@mui/x-data-grid-pro'; | ||
|
||
export default function LoadingOverlaySkeleton() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Commodity', | ||
rowLength: 100, | ||
maxColumns: 9, | ||
}); | ||
|
||
return ( | ||
<Box sx={{ width: '100%', height: 400 }}> | ||
<DataGridPro | ||
{...data} | ||
loading | ||
slotProps={{ | ||
loadingOverlay: { | ||
variant: 'skeleton', | ||
noRowsVariant: 'skeleton', | ||
}, | ||
}} | ||
initialState={{ | ||
pinnedColumns: { | ||
left: ['desk'], | ||
}, | ||
}} | ||
/> | ||
</Box> | ||
); | ||
} |
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,32 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import { useDemoData } from '@mui/x-data-grid-generator'; | ||
import { DataGridPro } from '@mui/x-data-grid-pro'; | ||
|
||
export default function LoadingOverlaySkeleton() { | ||
const { data } = useDemoData({ | ||
dataSet: 'Commodity', | ||
rowLength: 100, | ||
maxColumns: 9, | ||
}); | ||
|
||
return ( | ||
<Box sx={{ width: '100%', height: 400 }}> | ||
<DataGridPro | ||
{...data} | ||
loading | ||
slotProps={{ | ||
loadingOverlay: { | ||
variant: 'skeleton', | ||
noRowsVariant: 'skeleton', | ||
}, | ||
}} | ||
initialState={{ | ||
pinnedColumns: { | ||
left: ['desk'], | ||
}, | ||
}} | ||
/> | ||
</Box> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
docs/data/data-grid/overlays/LoadingOverlaySkeleton.tsx.preview
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,15 @@ | ||
<DataGridPro | ||
{...data} | ||
loading | ||
slotProps={{ | ||
loadingOverlay: { | ||
variant: 'skeleton', | ||
noRowsVariant: 'skeleton', | ||
}, | ||
}} | ||
initialState={{ | ||
pinnedColumns: { | ||
left: ['desk'], | ||
}, | ||
}} | ||
/> |
Oops, something went wrong.