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

[pickers] Add calendarHeader slot #7784

Merged
merged 12 commits into from
Aug 3, 2023

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Feb 1, 2023

Closes #6653
Closes #9783
Live example

@mui-bot
Copy link

mui-bot commented Feb 1, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-7784--material-ui-x.netlify.app/

Updated pages

No updates.

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 318 455.6 352.1 373.18 55.83
Sort 100k rows ms 481.7 874 725.9 703.1 144.202
Select 100k rows ms 154.3 212.7 205.6 188.4 25.755
Deselect 100k rows ms 126 267.3 179.8 183.4 51.038

Generated by 🚫 dangerJS against 589f369

@flaviendelangle flaviendelangle added the component: pickers This is the name of the generic UI component, not the React module! label Feb 1, 2023
packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx Outdated Show resolved Hide resolved
@@ -64,7 +65,7 @@ export interface PickersCalendarHeaderSlotsComponentsProps<TDate>

export interface PickersCalendarHeaderProps<TDate>
extends ExportedPickersArrowSwitcherProps,
DateComponentValidationProps<TDate> {
Copy link
Member Author

Choose a reason for hiding this comment

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

The component had shouldDisableXXX props but never received them and never used them.
The new typing is closer from what is actually used.

@flaviendelangle flaviendelangle marked this pull request as ready for review February 1, 2023 16:12
Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

It overall looks good. I'm wondering if we should provide helpers to recreate the default header, by providing a <HeaderLabel/> and a <HeaderMonthSwich/> Such that if devs want to add something in the middle they can do it without having to care about stuff like: the labelId should be passed to the date text, I need to add some transition on buttons, ...

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 3, 2023
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 27, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 9, 2023
@github-actions
Copy link

github-actions bot commented May 9, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 22, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 31, 2023
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@matheus1lva
Copy link

Would be good to also give the users a dropdown for the months and for the years, so we can have users that create a layout with one dropdown for each type.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 1, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 1, 2023
@github-actions
Copy link

github-actions bot commented Aug 1, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 2, 2023
Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

Should be a great improvement! 👏
Do you think it would be worth adding a section in the https://mui.com/x/react-date-pickers/custom-components/ page? 🤔

@LukasTy LukasTy changed the title [pickers] New slot: CalendarHeader [pickers] Add CalendarHeader slot Aug 2, 2023
@dChin84
Copy link

dChin84 commented Aug 2, 2023

♥️ That this feature is in the pipeline. Could I ask how long it would be until the release 👍

@flaviendelangle
Copy link
Member Author

@dChin84 we can't guarantee a release date yet, hopefully next week

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

IMHO, it wouldn't hurt having example(s) on custom-componets page, but thats purely optional.
Great work! 👍 💯

@flaviendelangle
Copy link
Member Author

I'll do a follow up with a doc example 👍

@flaviendelangle flaviendelangle merged commit 9a86f43 into mui:master Aug 3, 2023
4 checks passed
@flaviendelangle flaviendelangle deleted the calendar-header branch August 3, 2023 07:19
@flaviendelangle flaviendelangle changed the title [pickers] Add CalendarHeader slot [pickers] Add calendarHeader slot Aug 3, 2023
@gabrielbuii
Copy link

Hi! Is there a way to add a custom header for the digital clock section as well? A few users have mentioned they're having trouble distinguishing between the hour and minute columns... Essentially, we want to add a label above the hours, minutes, and seconds columns.

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