[POC][pickers] Explore the Base UI Picker components
Closes #15598 Doc preview
There is a lot of polishing to do before considering any of this to be ready. This POC is mostly here to test some of the assumption I made in my RFC.
New features compared to MUI
- [x] Grid layout for the months
- [x] Grid layout for the years
- [x] Multiple month rendered at once in the day view
- [x] Multiple years rendered at once in the month view
- [x] Month / year navigation in the range calendar (#4546)
- [x] Month / year range edition in the range calendar (#4995)
- [ ] Multi date selection (not a range, just a list of date) => standalone component? what about typing?
Steps before creating the Base UI X pickers package
- [ ] Decide how to name the package that will validate the license (it can use
@mui/x-licensetemporarily even if we don't want any@muideps for the launch - [ ] Decide how to name the Base UI X pickers packages
- [ ] Expose the utilities of Base UI that we need (
CompositeListand a lot of things in theutilspackage) - [ ] Move the adapters into a standalone package (can't be moved to the Base UI package, otherwise they won't be accessible in the scheduler when we start working on it)
- [ ] Decide how we structure the doc (for shared features between MUI X and Base UI X like the localization or the validation, when do we duplicate? when do we link to the Base UI X doc)
- [ ] Validate how we want to structure MIT / commercial features for the Base UI X offering
Work
Components
Calendar.*
- [x]
Calendar.Root - [x]
Calendar.SetVisibleMonth - [x]
Calendar.SetVisibleYear - [x]
Calendar.DayGrid - [x]
Calendar.DayGridHeader - [x]
Calendar.DayGridHeaderCell - [x]
Calendar.DayGridBody - [x]
Calendar.DayWeekRow - [x]
Calendar.DayCell - [x]
Calendar.MonthList - [x]
Calendar.MonthGrid - [x]
Calendar.MonthCell - [x]
Calendar.YearList - [x]
Calendar.YearGrid - [x]
Calendar.YearCell
RangeCalendar.*
- [x]
RangeCalendar.Root - [x]
RangeCalendar.SetVisibleMonth - [x]
RangeCalendar.SetVisibleYear - [x]
RangeCalendar.DaysGrid - [x]
RangeCalendar.DaysGridHeader - [x]
RangeCalendar.DaysGridHeaderCell - [x]
RangeCalendar.DaysGridBody - [x]
RangeCalendar.DaysWeekRow - [x]
RangeCalendar.DaysCell - [x]
RangeCalendar.MonthsList(no range selection for now, only usable for navigation) - [x]
RangeCalendar.MonthsGrid(no range selection for now, only usable for navigation) - [ ]
RangeCalendar.MonthsCell - [x]
RangeCalendar.YearList(no range selection for now, only usable for navigation) - [x]
RangeCalendar.YearGrid(no range selection for now, only usable for navigation) - [ ]
RangeCalendar.YearCell
Keyboard navigation
- [x]
Calendar.DaysGrid- [x] Navigation inside a given month
- [x] Navigation that triggers a change in the visible month
- [x] Navigation that moves the focus to another visible month (when rendering several at once)
- [x] Support
monthPageSize - [ ] Only add the default tabbable day (on the reference date or 1st day of the month) when the other rendered month also have no tabbable day
- [ ]
Calendar.MonthsList- [x] Navigation inside a given year
- [x] Navigation that triggers a change in the visible year
- [ ] Navigation that moves the focus to another visible month (when rendering several at once)
- [ ]
Calendar.MonthsGrid- [x] Navigation inside a given year
- [x] Navigation that triggers a change in the visible year
- [ ] Navigation that moves the focus to another visible month (when rendering several at once)
- [x]
Calendar.YearList- [x] Navigation inside the list
- [x]
Calendar.YearGrid- [x] Navigation inside the grid
- [ ]
RangeCalendar.DayGrid- [ ] Range expand / collapse using keyboard
Validation
- [x] Apply the same rules to disable day / month and year buttons as on the MUI version
- [x] Apply the same rules to disable the navigation button as on the MUI version
Focus
- [x]
Calendar.Root- [x] Support focusing tabbable cell on mount
- [x]
Calendar.DaysGrid- [x] Add
tabIndex={0}on the right cell - [x] Get focus on mount when it was inside the previous view
- [x] Add
- [x]
Calendar.MonthsGrid/Calendar.MonthsList- [x] Add
tabIndex={0}on the right cell - [x] Scroll to the tabbable cell if needed
- [x] Get focus on mount when it was inside the previous view
- [x] Add
- [x]
Calendar.YearGrid/Calendar.YearList- [x] Add
tabIndex={0}on the right cell - [x] Scroll to the tabbable cell if needed
- [x] Get focus on mount when it was inside the previous view
- [x] Add
Other
- [x] Support
value,defaultValue,referenceDate,onValueChange,onErrorandtimezonewith the same behavior as on the MUI version (justonChangeis renamedonValueChange) - [x] Support
fixedWeekNumber - [x] Support
monthPageSizeon<Calendar.SetVisibleMonth /> - [x] Support
yearPageSizeon<Calendar.SetVisibleYear /> - [x] Support
offseton<Calendar.DaysGrid /> - [ ] Support
offseton<Calendar.MonthsGrid />and<Calendar.MonthsList /> - [x] Support same value lifecycle when clicking on a day, a month a year as on the MUI version
- [ ] Check that
availableRangePositionsis always applied - [ ] Add
visibleDateandonVisibleDateChangeprops
Proposed breaking changes
-
Stop using
disablein validation terminology to clearly differentiate the "disabled" and "invalid" state:-
shouldDisableDate=>isDateInvalid -
shouldDisableMonth=>isMonthInvalid -
shouldDisableYear=>isYearInvalid
-
-
Change the
availableRangePositionsignature fromRangePosition[]to{ start?: boolean, end?: boolean }(unsure)
Planned recipes
- Full replication of our current Date Calendar
- Horizontal swipe to navigate month
- Vertical scroll to navigate month
Deploy preview: https://deploy-preview-16069--material-ui-x.netlify.app/
Updated pages:
- docs/data/date-pickers/base-calendar/base-calendar.md
- docs/data/date-pickers/base-clock/base-clock.md
- docs/data/date-pickers/base-range-calendar/base-range-calendar.md
- docs/data/date-pickers/base-recipes/base-recipes.md
Generated by :no_entry_sign: dangerJS against db849a08a63e465d16e65b389fc06f83e9322dbf
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.
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.
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.