-
-
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
[pickers] Create the new picker's ownerState
object
#14889
[pickers] Create the new picker's ownerState
object
#14889
Conversation
baa73e9
to
71b017c
Compare
Deploy preview: https://deploy-preview-14889--material-ui-x.netlify.app/ |
@@ -14,3 +14,22 @@ export interface PickerValidDateLookup {} | |||
export type PickerValidDate = keyof PickerValidDateLookup extends number | |||
? any | |||
: PickerValidDateLookup[keyof PickerValidDateLookup]; | |||
|
|||
export interface PickerOwnerState<TValue> { |
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 would be in favor of keeping the object as minimal as possible for now and add more properties as user request them.
But if you have another property that you think is important, I can of course add it 👍
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.
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 a very good candidate for the ownerState
indeed 👌
I propose to treat it in a follow up, because I'm not sure we want to have it in its current shape.
We discussed following MD3 nomenclature (docked and modal) instead of mobile and desktop and this would impact the name of this property.
ownerState
objectownerState
object
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 good and very promising to me 🎉
Thanks for this initiative !
Part of #14475
No breaking change, we can merge it before the alpha.
PickerOwnerState
interface and create theownerState
inusePicker
ownerState
fromusePicker
for theopenPickerIcon
slot which already uses a small object