-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] Default toolbar setup #574
Conversation
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.
Looks like a good skeleton. Note that we need to fix #502 before we can display anything in the header/toolbar. I believe the solution is to reorganize the grid to have the AutoSizer nested
Nice, ok let's see what @dtassone will say about the skeleton because I need this merged in order to start with either the column picker or the density selector. In the meantime, I can take a look at the |
If this will be the way to go should I proceed with adding the documentation, hiding the toolbar if it is empty, and convert it to a normal PR? |
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.
Why would somebody use the toolbar
over the header
?
packages/grid/_modules_/grid/components/styled-wrappers/GridRootStyles.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
…erial-ui-x into feature/DataGrid-516-toolbar
packages/grid/_modules_/grid/models/gridComponentOverridesProp.tsx
Outdated
Show resolved
Hide resolved
packages/storybook/src/stories/playground/customize-components.stories.tsx
Outdated
Show resolved
Hide resolved
docs/src/pages/components/data-grid/rendering/CustomToolbarGrid.js
Outdated
Show resolved
Hide resolved
I have updated the pull-request to go into the header direction: <DataGrid
components={{
header: () => (
<GridToolbar>
<GridToolbarFilter />
<GridToolbarDensity />
</GridToolbar>
)
}}
/> |
Ok so probably I misunderstood your previous comment. You want basically for the toolbar to be the header in terms of the API we expose. |
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
….tsx Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
….stories.tsx Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
…d.js Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Ok, I've cleaned it up further, so now to overwrite the |
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.
Great, I had a sync with @dtassone, and we are all aligned for pushing further with this API :)
Nice, that is still easily abstractable tho, so if we decide to go with the |
- `hideToolbar`: If `true`, the toolbar component is hidden. | ||
|
||
You can replace the default toolbar by providing your own implementation. | ||
You can replace the default toolbar by providing a `header` component. |
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 lost with this. I thought we would add a toolbar slot
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.
This PR is 3 months old
@@ -39,14 +39,6 @@ export const useComponents = ( | |||
[componentOverrides, componentProps], | |||
); | |||
|
|||
const toolbarComponent = React.useMemo( |
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.
Why?
This pull request aims to add an empty toolbar that will sit at the top of the data grid (above the columns and the header component it such is provided). It is structured in a way that will allow us to be easily extracted in the future if we decided to do so. To add buttons (features) in the
Toolbar
on needs to create a separate component for that feature (eg.ColumnPicker
) and implement the functionality there. After it is done the following structure should be followed when adding the feature to the toolbar:Questions that need to be answered in this Draft PR:
min-height
, centered the items vertically, added a border, and a background. Themin-height
matches the one we have for an MUIbutton
with sizesmall
(a similar approach was taken for the footer where themin-height
matches the height of theTablePagination
component).Closes #516