Skip to content
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] Refactor: create base Select #16394

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

romgrk
Copy link
Contributor

@romgrk romgrk commented Jan 29, 2025

Part of the design-system agnostic work.

Create base Select.

@romgrk romgrk added the component: data grid This is the name of the generic UI component, not the React module! label Jan 29, 2025
@romgrk romgrk marked this pull request as ready for review January 29, 2025 22:41
@romgrk romgrk requested a review from a team January 29, 2025 22:41
@mui-bot
Copy link

mui-bot commented Jan 29, 2025

Deploy preview: https://deploy-preview-16394--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against b15bbe7

...rest
} = props;
return (
<MUIFormControl
Copy link
Member

@MBilalShafi MBilalShafi Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we need to pass different props to FormControl/InputLabel for two different BaseSelect usages?

To allow the customizability (e.g. tweaking props passed to FormControl) without changing the function BaseSelect implementation, would it be better to keep components like FormControl and InputLabel separate like before, but make the top level components design-specific provided to the Data Grid using configuration?

For example:

  1. GridColumnMenuAggregationItem gets moved to the /material/components
  2. It uses FormControl, InputLabel, and Select like today
  3. It is passed in configuration from material entry point. (technically it could also be a slot but I think they should be limited to the reusable parts rather than specific components.)
  4. Base UI Grid (or another design system) passes a totally different GridColumnMenuAggregationItem component.

In general, if we go this direction, /{design-system}/components could contain more such components which are not generic enough to be slots but their implementation is more binded to a specific design system, they could be passed as configuration.components or similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we need to pass different props to FormControl/InputLabel for two different BaseSelect usages?

We can always re-use the slotProps mechanism. I'm trying to limit the exposed API because the amount of work to add another design-system depends on the amount of API to re-implement. I'm open to moving bigger components to design-system folders if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants