-
-
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] Remove TSection
and strictly type TValue
#15434
Conversation
9b7e635
to
d133807
Compare
Deploy preview: https://deploy-preview-15434--material-ui-x.netlify.app/ Updated pages: |
d133807
to
d908e9c
Compare
d908e9c
to
8798bf4
Compare
627848d
to
627900d
Compare
627900d
to
097ccc0
Compare
/** | ||
* Determines if two values are equal. | ||
* @template TValue | ||
* @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. |
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 not a huge fan of this template.
I had the same everywhere for TIsRange
so when I moved to the new TValue
approached I just changes it everywhere, I can improve the sentence in a follow up.
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 agree that it can be improved. 👍
But I also see value in the information it portrays. 🤔
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 think we could improve the wording, but this one is better than nothing for sure
@@ -3,3 +3,5 @@ export * from './fields'; | |||
export * from './range'; | |||
export * from './validation'; | |||
export * from './multiInputRangeFieldClasses'; | |||
|
|||
export type { RangePosition } from '@mui/x-date-pickers/internals'; |
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 need the type on the community package, but as internal, and we make it public on the pro package
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
22d9f39
to
6c0471c
Compare
6c0471c
to
8b742d8
Compare
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.
Nice cleanup, great job! 👍 💯
Leaving a few nitpicks. 😉
docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/DateCalendar/tests/describes.DateCalendar.test.tsx
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/hooks/useClockReferenceDate.ts
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.types.ts
Show resolved
Hide resolved
/** | ||
* Determines if two values are equal. | ||
* @template TValue | ||
* @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value. |
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 agree that it can be improved. 👍
But I also see value in the information it portrays. 🤔
Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com> Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com>
Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com> Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com>
Alternative DX discussed with @LukasTy in #15290
Part of #14823 (step 2)
I will handle the migration guide in a follow up 👍
Example
UseFieldInternalProps< PickerRangeValue, - RangeFieldSection, TEnableAccessibleFieldDOMStructure, TimeRangeValidationError >