-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] Fix CSS footer spacing #268
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
export * from './icons'; | ||
export * from './styled-wrappers'; | ||
|
||
export * from './api-context'; | ||
export * from './autosizer'; | ||
export * from './cell'; | ||
export * from './checkbox-renderer'; | ||
export * from './column-header-item'; | ||
export * from './column-header-separator'; | ||
export * from './column-header-sort-icon'; | ||
export * from './column-header-title'; | ||
export * from './column-header-separator'; | ||
export * from './column-headers'; | ||
export * from './default-footer'; | ||
export * from './icons'; | ||
export * from './loading-overlay'; | ||
export * from './no-row-message'; | ||
export * from './options-context'; | ||
export * from './pagination'; | ||
export * from './render-context'; | ||
export * from './rendering-zone'; | ||
export * from './row'; | ||
export * from './row-cells'; | ||
export * from './row-count'; | ||
export * from './row'; | ||
export * from './selected-row-count'; | ||
export * from './sticky-container'; | ||
export * from './styled-wrappers'; | ||
export * from './viewport'; | ||
export * from './watermark'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from 'react'; | ||
import { classnames } from '../../utils'; | ||
|
||
type GridDataContainerProps = React.HTMLAttributes<HTMLDivElement>; | ||
|
||
export const GridDataContainer = React.forwardRef<HTMLDivElement, GridDataContainerProps>( | ||
function GridDataContainer(props, ref) { | ||
const { className, ...other } = props; | ||
return ( | ||
<div ref={ref} className={classnames('MuiDataGrid-dataContainer', className)} {...other} /> | ||
); | ||
}, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import * as React from 'react'; | ||
import { DivProps } from './grid-root'; | ||
import { classnames } from '../../utils'; | ||
|
||
export const Footer = React.forwardRef<HTMLDivElement, DivProps>((props, ref) => { | ||
type GridFooterProps = React.HTMLAttributes<HTMLDivElement>; | ||
|
||
export const GridFooter = React.forwardRef<HTMLDivElement, GridFooterProps>(function GridFooter( | ||
props, | ||
ref, | ||
) { | ||
const { className, ...other } = props; | ||
return <div ref={ref} className={classnames('MuiDataGrid-footer', className)} {...other} />; | ||
}); | ||
Footer.displayName = 'Footer'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,7 +195,7 @@ export const useStyles = makeStyles( | |
alignItems: 'center', | ||
...theme.typography.body2, | ||
display: 'none', | ||
paddingLeft: theme.spacing(2), | ||
margin: theme.spacing(0, 2), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fix, the rest is refactorization. |
||
[theme.breakpoints.up('md')]: { | ||
minHeight: 52, // Match TablePagination min height | ||
display: 'flex', | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export * from './columns-container'; | ||
export * from './data-container'; | ||
export * from './footer'; | ||
export * from './grid-root'; | ||
export * from './window'; | ||
export * from './window-overlay'; | ||
export * from './GridColumnsContainer'; | ||
export * from './GridDataContainer'; | ||
export * from './GridFooter'; | ||
export * from './GridOverlay'; | ||
export * from './GridRoot'; | ||
export * from './GridWindow'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import * as React from 'react'; | ||
import { ColDef, XGrid, GridOverlay, Footer, useApiRef, ApiRef } from '@material-ui/x-grid'; | ||
import { ColDef, XGrid, GridOverlay, GridFooter, useApiRef, ApiRef } from '@material-ui/x-grid'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefix public components with |
||
import LinearProgress from '@material-ui/core/LinearProgress'; | ||
import CodeIcon from '@material-ui/icons/Code'; | ||
import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; | ||
|
@@ -139,7 +139,7 @@ export function CustomPagination() { | |
function FooterComponent(props) { | ||
const { paginationProps } = props; | ||
return ( | ||
<Footer className="my-custom-footer"> | ||
<GridFooter className="my-custom-footer"> | ||
<span style={{ display: 'flex', alignItems: 'center' }}> | ||
This is my custom footer and pagination here!{' '} | ||
</span> | ||
|
@@ -149,7 +149,7 @@ function FooterComponent(props) { | |
count={paginationProps.pageCount} | ||
onChange={(event, value) => paginationProps.setPage(value)} | ||
/> | ||
</Footer> | ||
</GridFooter> | ||
); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One this component, it seems that we can kill the
<div className="MuiDataGrid-overlayContent" />
element. It will make customization easier. I will look closer at the issue later.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, it's used in creating the no row message and error-message, and potentially more components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm saying that because I didn't see something in the CSS that would prevent. We will see, I could be wrong. It needs to be done in an isolated pull request anyway.