-
-
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] Use the new ownerState
in DateCalendar
, DateRangeCalendar
, MonthCalendar
and YearCalendar
#15171
Merged
flaviendelangle
merged 9 commits into
mui:master
from
flaviendelangle:ownerState-date-views
Nov 6, 2024
Merged
[pickers] Use the new ownerState
in DateCalendar
, DateRangeCalendar
, MonthCalendar
and YearCalendar
#15171
flaviendelangle
merged 9 commits into
mui:master
from
flaviendelangle:ownerState-date-views
Nov 6, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 tasks
flaviendelangle
added
breaking change
component: pickers
This is the name of the generic UI component, not the React module!
labels
Oct 29, 2024
Deploy preview: https://deploy-preview-15171--material-ui-x.netlify.app/ |
flaviendelangle
force-pushed
the
ownerState-date-views
branch
3 times, most recently
from
October 29, 2024 17:07
0e6270e
to
6f9cf51
Compare
flaviendelangle
commented
Oct 29, 2024
…MonthCalendar and YearCalendar
flaviendelangle
force-pushed
the
ownerState-date-views
branch
from
October 29, 2024 17:16
6f9cf51
to
a235cea
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
github-actions
bot
added
the
PR: out-of-date
The pull request has merge conflicts and can't be merged
label
Oct 31, 2024
github-actions
bot
removed
the
PR: out-of-date
The pull request has merge conflicts and can't be merged
label
Oct 31, 2024
LukasTy
reviewed
Nov 1, 2024
packages/x-date-pickers/src/MonthCalendar/MonthCalendar.types.ts
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/MonthCalendar/MonthCalendar.types.ts
Outdated
Show resolved
Hide resolved
github-actions
bot
added
the
PR: out-of-date
The pull request has merge conflicts and can't be merged
label
Nov 5, 2024
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
github-actions
bot
removed
the
PR: out-of-date
The pull request has merge conflicts and can't be merged
label
Nov 5, 2024
LukasTy
approved these changes
Nov 6, 2024
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 work. 👍 🎉
flaviendelangle
force-pushed
the
ownerState-date-views
branch
from
November 6, 2024 11:17
793049e
to
d2a79af
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
component: pickers
This is the name of the generic UI component, not the React module!
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #14475
Another day, another PR for the
ownerState
😆 , now that we have the context it's easy to migrate the slots piece by piece.I did not change the
ownerState
passed to thestyleOverrides
ofPickersDay
and its range counterpart because I want @noraleonte DX proposal before. But IMHO thisownerState
should eventually be 100% identical to the one passed toslots.day
.Changes
Changes on
usePickersPrivateContext
ownerState
object with everything marked asfalse
. Alternatively I could update theownerState
in the views to bePickerOwnerState | {}
orPartial<PickerOwnerState>
but I think the default value is easier to work with.Updated slots
I only added the selected and disabled properties to the day, month and year
ownerState
because they are often needed to build our classes and I think it's nice being consistent between the three.I can add
month
andyear
objets to matchday
if you think it's useful.day
is used inDateRangeCalendar
so I need to have it.day
:PickerOwnerState & { day: TDate, isDaySelected: boolean, isDayDisabled: boolean }
monthButton: PickerOwnerState & { isMonthSelected: boolean, isMonthDisabled: boolean }
yearButton: PickerOwnerState & { isYearSelected: boolean, isYearDisabled: boolean }
calendarHeader: PickerOwnerState