-
-
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] Add a subset of used @mui/material
components to GridSlotsComponent
#3490
[DataGrid] Add a subset of used @mui/material
components to GridSlotsComponent
#3490
Conversation
…e/DataGrid-3066-add-base-components
@mui/material
components to GridSlotsComponent
@mui/material
components to GridSlotsComponent
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Could we add a |
Sure, but I didn't add all the form elements we use from the core. I skipped |
Yes, if you prefer we can first release this feature in a discrete way and then document it fully when ready. |
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.
Should Popper
also be added? Adding it seems to solve part of the problem raised in #3381.
It is possible to override Portal props for Column Header tooltips by customizing the theme's default props for Tooltip, but since there is no ability to customize default props for Popper/Portal to propogate the shadow dom container, all of the styled(Popper) components will appear outside and have no styling applied.
packages/grid/_modules_/grid/components/panel/filterPanel/GridFilterPanel.tsx
Show resolved
Hide resolved
…e/DataGrid-3066-add-base-components
I added |
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.
It's missing to spread rootProps.componentsProps?.basePopper
in the GridPanel
.
…e/DataGrid-3066-add-base-components
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@@ -76,7 +78,6 @@ const GridPanel = React.forwardRef<HTMLDivElement, GridPanelProps>((props, ref) | |||
ref={ref} | |||
placement="bottom-start" | |||
className={clsx(className, classes.panel)} |
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.
The as
prop is missing as well as rootProps.componentsProps.panel
.
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 can't add them in the GridPanel
directly because the useGridRootProps
can be used in components outside of DataGrid
. That's why I had to pass it down from the parent. The same applies to the other comment #3490 (comment)
Error: Uncaught Error: MUI: useGridRootProps should only be used inside the DataGrid/DataGridPro 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.
We had a discussion about that in #2522.
Currently the GridPanel
already depends on another context: GridApiContext
. We could also use useGridRootProps
but that would be a breaking change. So I'm OK to not do that for now.
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.
Ok so if we are postponing this and if this is the only thing left can we proceed with merging this PR?
as={rootProps.components.BasePopper} | ||
open={columns.length > 0 && preferencePanelState.open} | ||
{...rootProps.componentsProps?.panel} |
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.
If the as
prop is applied inside GridPanel
, then it doesn't need to be applied here again.
Part of #3066
I've made a subsite of all
@mui/material
components we use in the grid be available as a slot component. I've checked all the@mui/material
we use and these once seemed to make the most sense for a first iteration. I'm adding the rest below. We can discuss and see if any of the others also need to be added in this first iteration (or if I need to revert any of the ones I added).List of remaining
@mui/material
components currently used in the grid: