@mui/x-date-pickers-pro 7.0.0-alpha.0 → 7.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +591 -5
  2. package/DateRangeCalendar/DateRangeCalendar.js +72 -68
  3. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +8 -5
  4. package/DateRangeCalendar/useDragRange.js +1 -1
  5. package/DateRangePicker/DateRangePicker.js +1 -6
  6. package/DateRangePicker/shared.d.ts +1 -1
  7. package/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -6
  8. package/MobileDateRangePicker/MobileDateRangePicker.js +1 -6
  9. package/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  10. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +1 -9
  11. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +1 -9
  12. package/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  13. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +1 -9
  14. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +1 -9
  15. package/StaticDateRangePicker/StaticDateRangePicker.js +1 -6
  16. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +1 -1
  17. package/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -2
  18. package/index.js +1 -1
  19. package/internals/utils/date-fields-utils.d.ts +0 -1
  20. package/internals/utils/releaseInfo.js +1 -1
  21. package/legacy/DateRangeCalendar/DateRangeCalendar.js +42 -41
  22. package/legacy/DateRangeCalendar/useDragRange.js +1 -1
  23. package/legacy/DateRangePicker/DateRangePicker.js +1 -6
  24. package/legacy/DateRangePickerDay/DateRangePickerDay.js +3 -4
  25. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -6
  26. package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +1 -6
  27. package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  28. package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +1 -9
  29. package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +1 -9
  30. package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  31. package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +1 -9
  32. package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +1 -9
  33. package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +1 -6
  34. package/legacy/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -2
  35. package/legacy/index.js +1 -1
  36. package/legacy/internals/utils/releaseInfo.js +1 -1
  37. package/modern/DateRangeCalendar/DateRangeCalendar.js +33 -33
  38. package/modern/DateRangeCalendar/useDragRange.js +1 -1
  39. package/modern/DateRangePicker/DateRangePicker.js +1 -6
  40. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -6
  41. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -6
  42. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  43. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +1 -9
  44. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +1 -9
  45. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  46. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +1 -9
  47. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +1 -9
  48. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -6
  49. package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -2
  50. package/modern/index.js +1 -1
  51. package/modern/internals/utils/releaseInfo.js +1 -1
  52. package/node/DateRangeCalendar/DateRangeCalendar.js +32 -32
  53. package/node/DateRangeCalendar/useDragRange.js +1 -1
  54. package/node/DateRangePicker/DateRangePicker.js +1 -6
  55. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -6
  56. package/node/MobileDateRangePicker/MobileDateRangePicker.js +1 -6
  57. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  58. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +1 -9
  59. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +1 -9
  60. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  61. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +1 -9
  62. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +1 -9
  63. package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -6
  64. package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -2
  65. package/node/index.js +1 -1
  66. package/node/internals/utils/releaseInfo.js +1 -1
  67. package/package.json +7 -6
@@ -1,13 +1,13 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "defaultCalendarMonth", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone"],
3
+ const _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone"],
4
4
  _excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
8
8
  import useEventCallback from '@mui/utils/useEventCallback';
9
9
  import useMediaQuery from '@mui/material/useMediaQuery';
10
- import { resolveComponentProps } from '@mui/base/utils';
10
+ import { resolveComponentProps, useSlotProps } from '@mui/base/utils';
11
11
  import { styled, useThemeProps } from '@mui/material/styles';
12
12
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
13
13
  import { Watermark } from '@mui/x-license-pro';
@@ -120,6 +120,7 @@ const useUtilityClasses = ownerState => {
120
120
  * - [DateRangeCalendar API](https://mui.com/x/api/date-pickers/date-range-calendar/)
121
121
  */
122
122
  const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalendar(inProps, ref) {
123
+ var _slots$calendarHeader;
123
124
  const props = useDateRangeCalendarDefaultizedProps(inProps, 'MuiDateRangeCalendar');
124
125
  const shouldHavePreview = useMediaQuery(DEFAULT_DESKTOP_MODE_MEDIA_QUERY, {
125
126
  defaultMatches: false
@@ -137,7 +138,6 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
137
138
  shouldDisableDate,
138
139
  reduceAnimations,
139
140
  onMonthChange,
140
- defaultCalendarMonth,
141
141
  rangePosition: rangePositionProp,
142
142
  defaultRangePosition: inDefaultRangePosition,
143
143
  onRangePositionChange: inOnRangePositionChange,
@@ -257,7 +257,6 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
257
257
  } = useCalendarState({
258
258
  value: value[0] || value[1],
259
259
  referenceDate,
260
- defaultCalendarMonth,
261
260
  disableFuture,
262
261
  disablePast,
263
262
  disableSwitchToMonthOnDayFocus: true,
@@ -268,6 +267,34 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
268
267
  shouldDisableDate: wrappedShouldDisableDate,
269
268
  timezone
270
269
  });
270
+
271
+ // When disabled, limit the view to the selected date
272
+ const minDateWithDisabled = disabled && value[0] || minDate;
273
+ const maxDateWithDisabled = disabled && value[1] || maxDate;
274
+ const CalendarHeader = (_slots$calendarHeader = slots == null ? void 0 : slots.calendarHeader) != null ? _slots$calendarHeader : PickersCalendarHeader;
275
+ const calendarHeaderProps = useSlotProps({
276
+ elementType: CalendarHeader,
277
+ externalSlotProps: slotProps == null ? void 0 : slotProps.calendarHeader,
278
+ additionalProps: {
279
+ views: ['day'],
280
+ view: 'day',
281
+ currentMonth: calendarState.currentMonth,
282
+ onMonthChange: (newMonth, direction) => handleChangeMonth({
283
+ newMonth,
284
+ direction
285
+ }),
286
+ minDate: minDateWithDisabled,
287
+ maxDate: maxDateWithDisabled,
288
+ disabled,
289
+ disablePast,
290
+ disableFuture,
291
+ reduceAnimations,
292
+ slots,
293
+ slotProps,
294
+ timezone
295
+ },
296
+ ownerState: props
297
+ });
271
298
  const prevValue = React.useRef(null);
272
299
  React.useEffect(() => {
273
300
  var _prevValue$current, _prevValue$current2;
@@ -321,10 +348,6 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
321
348
  readOnly,
322
349
  disabled
323
350
  };
324
-
325
- // When disabled, limit the view to the selected date
326
- const minDateWithDisabled = disabled && value[0] || minDate;
327
- const maxDateWithDisabled = disabled && value[1] || maxDate;
328
351
  const [rangePreviewDay, setRangePreviewDay] = React.useState(null);
329
352
  const CalendarTransitionProps = React.useMemo(() => ({
330
353
  onMouseLeave: () => setRangePreviewDay(null)
@@ -421,60 +444,46 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
421
444
  children: [/*#__PURE__*/_jsx(Watermark, {
422
445
  packageName: "x-date-pickers-pro",
423
446
  releaseInfo: releaseInfo
424
- }), calendarMonths.map((month, index) => /*#__PURE__*/_jsxs(DateRangeCalendarMonthContainer, {
425
- className: classes.monthContainer,
426
- children: [calendars === 1 ? /*#__PURE__*/_jsx(PickersCalendarHeader, {
427
- views: ['day'],
428
- view: 'day',
429
- currentMonth: calendarState.currentMonth,
430
- onMonthChange: (newMonth, direction) => handleChangeMonth({
431
- newMonth,
432
- direction
433
- }),
434
- minDate: minDateWithDisabled,
435
- maxDate: maxDateWithDisabled,
436
- disabled: disabled,
437
- disablePast: disablePast,
438
- disableFuture: disableFuture,
439
- reduceAnimations: reduceAnimations,
440
- slots: slots,
441
- slotProps: slotProps,
442
- timezone: timezone
443
- }) : /*#__PURE__*/_jsx(DateRangeCalendarArrowSwitcher, {
444
- onGoToPrevious: selectPreviousMonth,
445
- onGoToNext: selectNextMonth,
446
- isPreviousHidden: index !== 0,
447
- isPreviousDisabled: isPreviousMonthDisabled,
448
- previousLabel: localeText.previousMonth,
449
- isNextHidden: index !== calendars - 1,
450
- isNextDisabled: isNextMonthDisabled,
451
- nextLabel: localeText.nextMonth,
452
- slots: slots,
453
- slotProps: slotProps,
454
- children: utils.format(visibleMonths[month], 'monthAndYear')
455
- }), /*#__PURE__*/_jsx(DayCalendarForRange, _extends({
456
- className: classes.dayCalendar
457
- }, calendarState, baseDateValidationProps, commonViewProps, {
458
- onMonthSwitchingAnimationEnd: onMonthSwitchingAnimationEnd,
459
- onFocusedDayChange: changeFocusedDay,
460
- reduceAnimations: reduceAnimations,
461
- selectedDays: value,
462
- onSelectedDaysChange: handleSelectedDayChange,
463
- currentMonth: visibleMonths[month],
464
- TransitionProps: CalendarTransitionProps,
465
- shouldDisableDate: wrappedShouldDisableDate,
466
- showDaysOutsideCurrentMonth: calendars === 1 && showDaysOutsideCurrentMonth,
467
- dayOfWeekFormatter: dayOfWeekFormatter,
468
- loading: loading,
469
- renderLoading: renderLoading,
470
- slots: slotsForDayCalendar,
471
- slotProps: slotPropsForDayCalendar,
472
- autoFocus: month === focusedMonth,
473
- fixedWeekNumber: fixedWeekNumber,
474
- displayWeekNumber: displayWeekNumber,
475
- timezone: timezone
476
- }), index)]
477
- }, month))]
447
+ }), calendarMonths.map((month, index) => {
448
+ var _calendarHeaderProps$;
449
+ return /*#__PURE__*/_jsxs(DateRangeCalendarMonthContainer, {
450
+ className: classes.monthContainer,
451
+ children: [calendars === 1 ? /*#__PURE__*/_jsx(CalendarHeader, _extends({}, calendarHeaderProps)) : /*#__PURE__*/_jsx(DateRangeCalendarArrowSwitcher, {
452
+ onGoToPrevious: selectPreviousMonth,
453
+ onGoToNext: selectNextMonth,
454
+ isPreviousHidden: index !== 0,
455
+ isPreviousDisabled: isPreviousMonthDisabled,
456
+ previousLabel: localeText.previousMonth,
457
+ isNextHidden: index !== calendars - 1,
458
+ isNextDisabled: isNextMonthDisabled,
459
+ nextLabel: localeText.nextMonth,
460
+ slots: slots,
461
+ slotProps: slotProps,
462
+ children: utils.formatByString(visibleMonths[month], (_calendarHeaderProps$ = calendarHeaderProps.format) != null ? _calendarHeaderProps$ : `${utils.formats.month} ${utils.formats.year}`)
463
+ }), /*#__PURE__*/_jsx(DayCalendarForRange, _extends({
464
+ className: classes.dayCalendar
465
+ }, calendarState, baseDateValidationProps, commonViewProps, {
466
+ onMonthSwitchingAnimationEnd: onMonthSwitchingAnimationEnd,
467
+ onFocusedDayChange: changeFocusedDay,
468
+ reduceAnimations: reduceAnimations,
469
+ selectedDays: value,
470
+ onSelectedDaysChange: handleSelectedDayChange,
471
+ currentMonth: visibleMonths[month],
472
+ TransitionProps: CalendarTransitionProps,
473
+ shouldDisableDate: wrappedShouldDisableDate,
474
+ showDaysOutsideCurrentMonth: calendars === 1 && showDaysOutsideCurrentMonth,
475
+ dayOfWeekFormatter: dayOfWeekFormatter,
476
+ loading: loading,
477
+ renderLoading: renderLoading,
478
+ slots: slotsForDayCalendar,
479
+ slotProps: slotPropsForDayCalendar,
480
+ autoFocus: month === focusedMonth,
481
+ fixedWeekNumber: fixedWeekNumber,
482
+ displayWeekNumber: displayWeekNumber,
483
+ timezone: timezone
484
+ }), index)]
485
+ }, month);
486
+ })]
478
487
  }));
479
488
  });
480
489
  process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
@@ -503,16 +512,11 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
503
512
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
504
513
  /**
505
514
  * Formats the day of week displayed in the calendar header.
506
- * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
507
515
  * @param {TDate} date The date of the day of week provided by the adapter.
508
516
  * @returns {string} The name to display.
509
517
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
510
518
  */
511
519
  dayOfWeekFormatter: PropTypes.func,
512
- /**
513
- * Default calendar month displayed when `value={[null, null]}`.
514
- */
515
- defaultCalendarMonth: PropTypes.any,
516
520
  /**
517
521
  * The initial position in the edited date range.
518
522
  * Used when the component is not controlled.
@@ -662,7 +666,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
662
666
  * Choose which timezone to use for the value.
663
667
  * Example: "default", "system", "UTC", "America/New_York".
664
668
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
665
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
669
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
666
670
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
667
671
  */
668
672
  timezone: PropTypes.string,
@@ -3,7 +3,7 @@ import { SxProps } from '@mui/system';
3
3
  import { SlotComponentProps } from '@mui/base/utils';
4
4
  import { Theme } from '@mui/material/styles';
5
5
  import { TimezoneProps } from '@mui/x-date-pickers/models';
6
- import { PickersCalendarHeaderSlotsComponent, PickersCalendarHeaderSlotsComponentsProps } from '@mui/x-date-pickers/PickersCalendarHeader';
6
+ import { PickersCalendarHeader, PickersCalendarHeaderProps, PickersCalendarHeaderSlotsComponent, PickersCalendarHeaderSlotsComponentsProps } from '@mui/x-date-pickers/PickersCalendarHeader';
7
7
  import { BaseDateValidationProps, DefaultizedProps, ExportedDayCalendarProps, DayCalendarSlotsComponent, DayCalendarSlotsComponentsProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps, PickerSelectionState, DayCalendarProps, ExportedUseViewsOptions } from '@mui/x-date-pickers/internals';
8
8
  import { DateRange, DayRangeValidationProps } from '../internals/models';
9
9
  import { DateRangeCalendarClasses } from './dateRangeCalendarClasses';
@@ -11,6 +11,12 @@ import { DateRangePickerDay, DateRangePickerDayProps } from '../DateRangePickerD
11
11
  import { UseRangePositionProps } from '../internals/hooks/useRangePosition';
12
12
  export type DateRangePosition = 'start' | 'end';
13
13
  export interface DateRangeCalendarSlotsComponent<TDate> extends PickersArrowSwitcherSlotsComponent, Omit<DayCalendarSlotsComponent<TDate>, 'day'>, PickersCalendarHeaderSlotsComponent {
14
+ /**
15
+ * Custom component for calendar header.
16
+ * Check the [PickersCalendarHeader](https://mui.com/x/api/date-pickers/pickers-calendar-header/) component.
17
+ * @default PickersCalendarHeader
18
+ */
19
+ calendarHeader?: React.ElementType<PickersCalendarHeaderProps<TDate>>;
14
20
  /**
15
21
  * Custom component for day in range pickers.
16
22
  * Check the [DateRangePickersDay](https://mui.com/x/api/date-pickers/date-range-picker-day/) component.
@@ -19,6 +25,7 @@ export interface DateRangeCalendarSlotsComponent<TDate> extends PickersArrowSwit
19
25
  day?: React.ElementType<DateRangePickerDayProps<TDate>>;
20
26
  }
21
27
  export interface DateRangeCalendarSlotsComponentsProps<TDate> extends PickersArrowSwitcherSlotsComponentsProps, Omit<DayCalendarSlotsComponentsProps<TDate>, 'day'>, PickersCalendarHeaderSlotsComponentsProps<TDate> {
28
+ calendarHeader?: SlotComponentProps<typeof PickersCalendarHeader, {}, DateRangeCalendarProps<TDate>>;
22
29
  day?: SlotComponentProps<typeof DateRangePickerDay, {}, DayCalendarProps<TDate> & {
23
30
  day: TDate;
24
31
  selected: boolean;
@@ -30,10 +37,6 @@ export interface ExportedDateRangeCalendarProps<TDate> extends ExportedDayCalend
30
37
  * @default false
31
38
  */
32
39
  disableAutoMonthSwitching?: boolean;
33
- /**
34
- * Default calendar month displayed when `value={[null, null]}`.
35
- */
36
- defaultCalendarMonth?: TDate;
37
40
  /**
38
41
  * If `true`, the picker and text field are disabled.
39
42
  * @default false
@@ -8,7 +8,7 @@ const resolveDateFromTarget = (target, utils, timezone) => {
8
8
  return null;
9
9
  }
10
10
  const timestamp = +timestampString;
11
- return utils.dateWithTimezone(new Date(timestamp).toISOString(), timezone);
11
+ return utils.date(new Date(timestamp).toISOString(), timezone);
12
12
  };
13
13
  const isSameAsDraggingDate = event => {
14
14
  const timestampString = event.target.dataset.timestamp;
@@ -75,16 +75,11 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
75
75
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
76
76
  /**
77
77
  * Formats the day of week displayed in the calendar header.
78
- * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
79
78
  * @param {TDate} date The date of the day of week provided by the adapter.
80
79
  * @returns {string} The name to display.
81
80
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
82
81
  */
83
82
  dayOfWeekFormatter: PropTypes.func,
84
- /**
85
- * Default calendar month displayed when `value={[null, null]}`.
86
- */
87
- defaultCalendarMonth: PropTypes.any,
88
83
  /**
89
84
  * The initial position in the edited date range.
90
85
  * Used when the component is not controlled.
@@ -317,7 +312,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
317
312
  * Choose which timezone to use for the value.
318
313
  * Example: "default", "system", "UTC", "America/New_York".
319
314
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
320
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
315
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
321
316
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
322
317
  */
323
318
  timezone: PropTypes.string,
@@ -35,5 +35,5 @@ export interface BaseDateRangePickerProps<TDate> extends Omit<BasePickerInputPro
35
35
  viewRenderers?: Partial<PickerViewRendererLookup<DateRange<TDate>, 'day', DateRangeViewRendererProps<TDate, 'day'>, {}>>;
36
36
  }
37
37
  type UseDateRangePickerDefaultizedProps<TDate, Props extends BaseDateRangePickerProps<TDate>> = LocalizedComponent<TDate, DefaultizedProps<Props, keyof BaseDateValidationProps<TDate>>>;
38
- export declare function useDateRangePickerDefaultizedProps<TDate, Props extends BaseDateRangePickerProps<TDate>>(props: Props, name: string): UseDateRangePickerDefaultizedProps<TDate, Omit<Props, 'components' | 'componentsProps'>>;
38
+ export declare function useDateRangePickerDefaultizedProps<TDate, Props extends BaseDateRangePickerProps<TDate>>(props: Props, name: string): UseDateRangePickerDefaultizedProps<TDate, Props>;
39
39
  export {};
@@ -90,16 +90,11 @@ DesktopDateRangePicker.propTypes = {
90
90
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
91
91
  /**
92
92
  * Formats the day of week displayed in the calendar header.
93
- * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
94
93
  * @param {TDate} date The date of the day of week provided by the adapter.
95
94
  * @returns {string} The name to display.
96
95
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
97
96
  */
98
97
  dayOfWeekFormatter: PropTypes.func,
99
- /**
100
- * Default calendar month displayed when `value={[null, null]}`.
101
- */
102
- defaultCalendarMonth: PropTypes.any,
103
98
  /**
104
99
  * The initial position in the edited date range.
105
100
  * Used when the component is not controlled.
@@ -326,7 +321,7 @@ DesktopDateRangePicker.propTypes = {
326
321
  * Choose which timezone to use for the value.
327
322
  * Example: "default", "system", "UTC", "America/New_York".
328
323
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
329
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
324
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
330
325
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
331
326
  */
332
327
  timezone: PropTypes.string,
@@ -90,16 +90,11 @@ MobileDateRangePicker.propTypes = {
90
90
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
91
91
  /**
92
92
  * Formats the day of week displayed in the calendar header.
93
- * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
94
93
  * @param {TDate} date The date of the day of week provided by the adapter.
95
94
  * @returns {string} The name to display.
96
95
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
97
96
  */
98
97
  dayOfWeekFormatter: PropTypes.func,
99
- /**
100
- * Default calendar month displayed when `value={[null, null]}`.
101
- */
102
- defaultCalendarMonth: PropTypes.any,
103
98
  /**
104
99
  * The initial position in the edited date range.
105
100
  * Used when the component is not controlled.
@@ -326,7 +321,7 @@ MobileDateRangePicker.propTypes = {
326
321
  * Choose which timezone to use for the value.
327
322
  * Example: "default", "system", "UTC", "America/New_York".
328
323
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
329
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
324
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
330
325
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
331
326
  */
332
327
  timezone: PropTypes.string,
@@ -325,7 +325,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
325
325
  * Choose which timezone to use for the value.
326
326
  * Example: "default", "system", "UTC", "America/New_York".
327
327
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
328
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
328
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
329
329
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
330
330
  */
331
331
  timezone: PropTypes.string,
@@ -308,14 +308,6 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
308
308
  endIndex: PropTypes.number.isRequired,
309
309
  startIndex: PropTypes.number.isRequired
310
310
  })]),
311
- /**
312
- * Disable specific clock time.
313
- * @param {number} clockValue The value to check.
314
- * @param {TimeView} view The clock type of the timeValue.
315
- * @returns {boolean} If `true` the time will be disabled.
316
- * @deprecated Consider using `shouldDisableTime`.
317
- */
318
- shouldDisableClock: PropTypes.func,
319
311
  /**
320
312
  * Disable specific date.
321
313
  *
@@ -374,7 +366,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
374
366
  * Choose which timezone to use for the value.
375
367
  * Example: "default", "system", "UTC", "America/New_York".
376
368
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
377
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
369
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
378
370
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
379
371
  */
380
372
  timezone: PropTypes.string,
@@ -292,14 +292,6 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
292
292
  endIndex: PropTypes.number.isRequired,
293
293
  startIndex: PropTypes.number.isRequired
294
294
  })]),
295
- /**
296
- * Disable specific clock time.
297
- * @param {number} clockValue The value to check.
298
- * @param {TimeView} view The clock type of the timeValue.
299
- * @returns {boolean} If `true` the time will be disabled.
300
- * @deprecated Consider using `shouldDisableTime`.
301
- */
302
- shouldDisableClock: PropTypes.func,
303
295
  /**
304
296
  * Disable specific time.
305
297
  * @template TDate
@@ -347,7 +339,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
347
339
  * Choose which timezone to use for the value.
348
340
  * Example: "default", "system", "UTC", "America/New_York".
349
341
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
350
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
342
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
351
343
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
352
344
  */
353
345
  timezone: PropTypes.string,
@@ -320,7 +320,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
320
320
  * Choose which timezone to use for the value.
321
321
  * Example: "default", "system", "UTC", "America/New_York".
322
322
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
323
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
323
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
324
324
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
325
325
  */
326
326
  timezone: PropTypes.string,
@@ -304,14 +304,6 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
304
304
  endIndex: PropTypes.number.isRequired,
305
305
  startIndex: PropTypes.number.isRequired
306
306
  })]),
307
- /**
308
- * Disable specific clock time.
309
- * @param {number} clockValue The value to check.
310
- * @param {TimeView} view The clock type of the timeValue.
311
- * @returns {boolean} If `true` the time will be disabled.
312
- * @deprecated Consider using `shouldDisableTime`.
313
- */
314
- shouldDisableClock: PropTypes.func,
315
307
  /**
316
308
  * Disable specific date.
317
309
  *
@@ -369,7 +361,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
369
361
  * Choose which timezone to use for the value.
370
362
  * Example: "default", "system", "UTC", "America/New_York".
371
363
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
372
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
364
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
373
365
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
374
366
  */
375
367
  timezone: PropTypes.string,
@@ -288,14 +288,6 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
288
288
  endIndex: PropTypes.number.isRequired,
289
289
  startIndex: PropTypes.number.isRequired
290
290
  })]),
291
- /**
292
- * Disable specific clock time.
293
- * @param {number} clockValue The value to check.
294
- * @param {TimeView} view The clock type of the timeValue.
295
- * @returns {boolean} If `true` the time will be disabled.
296
- * @deprecated Consider using `shouldDisableTime`.
297
- */
298
- shouldDisableClock: PropTypes.func,
299
291
  /**
300
292
  * Disable specific time.
301
293
  * @template TDate
@@ -342,7 +334,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
342
334
  * Choose which timezone to use for the value.
343
335
  * Example: "default", "system", "UTC", "America/New_York".
344
336
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
345
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
337
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
346
338
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
347
339
  */
348
340
  timezone: PropTypes.string,
@@ -76,16 +76,11 @@ StaticDateRangePicker.propTypes = {
76
76
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
77
77
  /**
78
78
  * Formats the day of week displayed in the calendar header.
79
- * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
80
79
  * @param {TDate} date The date of the day of week provided by the adapter.
81
80
  * @returns {string} The name to display.
82
81
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
83
82
  */
84
83
  dayOfWeekFormatter: PropTypes.func,
85
- /**
86
- * Default calendar month displayed when `value={[null, null]}`.
87
- */
88
- defaultCalendarMonth: PropTypes.any,
89
84
  /**
90
85
  * The initial position in the edited date range.
91
86
  * Used when the component is not controlled.
@@ -264,7 +259,7 @@ StaticDateRangePicker.propTypes = {
264
259
  * Choose which timezone to use for the value.
265
260
  * Example: "default", "system", "UTC", "America/New_York".
266
261
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
267
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
262
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
268
263
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
269
264
  */
270
265
  timezone: PropTypes.string,
@@ -10,4 +10,4 @@ export interface DateRangeViewRendererProps<TDate, TView extends DateOrTimeViewW
10
10
  * We don't pass all the props down to `DateRangeCalendar`,
11
11
  * because otherwise some unwanted props would be passed to the HTML element.
12
12
  */
13
- export declare const renderDateRangeViewCalendar: <TDate extends unknown>({ value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minDate, maxDate, shouldDisableDate, reduceAnimations, onMonthChange, defaultCalendarMonth, rangePosition, defaultRangePosition, onRangePositionChange, calendars, currentMonthCalendarPosition, slots, slotProps, loading, renderLoading, disableHighlightToday, readOnly, disabled, showDaysOutsideCurrentMonth, dayOfWeekFormatter, disableAutoMonthSwitching, sx, autoFocus, fixedWeekNumber, disableDragEditing, displayWeekNumber, timezone, }: DateRangeViewRendererProps<TDate, any>) => React.JSX.Element;
13
+ export declare const renderDateRangeViewCalendar: <TDate extends unknown>({ value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minDate, maxDate, shouldDisableDate, reduceAnimations, onMonthChange, rangePosition, defaultRangePosition, onRangePositionChange, calendars, currentMonthCalendarPosition, slots, slotProps, loading, renderLoading, disableHighlightToday, readOnly, disabled, showDaysOutsideCurrentMonth, dayOfWeekFormatter, disableAutoMonthSwitching, sx, autoFocus, fixedWeekNumber, disableDragEditing, displayWeekNumber, timezone, }: DateRangeViewRendererProps<TDate, any>) => React.JSX.Element;
@@ -19,7 +19,6 @@ export const renderDateRangeViewCalendar = ({
19
19
  shouldDisableDate,
20
20
  reduceAnimations,
21
21
  onMonthChange,
22
- defaultCalendarMonth,
23
22
  rangePosition,
24
23
  defaultRangePosition,
25
24
  onRangePositionChange,
@@ -55,7 +54,6 @@ export const renderDateRangeViewCalendar = ({
55
54
  shouldDisableDate: shouldDisableDate,
56
55
  reduceAnimations: reduceAnimations,
57
56
  onMonthChange: onMonthChange,
58
- defaultCalendarMonth: defaultCalendarMonth,
59
57
  rangePosition: rangePosition,
60
58
  defaultRangePosition: defaultRangePosition,
61
59
  onRangePositionChange: onRangePositionChange,
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.0.0-alpha.0
2
+ * @mui/x-date-pickers-pro v7.0.0-alpha.2
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -12,7 +12,6 @@ export declare const removeLastSeparator: (dateSections: RangeFieldSection[]) =>
12
12
  placeholder: string;
13
13
  type: import("@mui/x-date-pickers").FieldSectionType;
14
14
  contentType: import("@mui/x-date-pickers").FieldSectionContentType;
15
- hasLeadingZeros: boolean;
16
15
  hasLeadingZerosInFormat: boolean;
17
16
  hasLeadingZerosInInput: boolean;
18
17
  modified: boolean;
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTY5OTU3MDgwMDAwMA==";
3
+ const releaseInfo = "MTcwMDY5MDQwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat