@mui/x-date-pickers-pro 7.0.0-alpha.1 → 7.0.0-alpha.3

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 (66) hide show
  1. package/CHANGELOG.md +607 -188
  2. package/DateRangeCalendar/DateRangeCalendar.js +5 -11
  3. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +0 -4
  4. package/DateRangeCalendar/useDragRange.js +1 -1
  5. package/DateRangePicker/DateRangePicker.js +4 -8
  6. package/DesktopDateRangePicker/DesktopDateRangePicker.js +4 -8
  7. package/MobileDateRangePicker/MobileDateRangePicker.js +4 -8
  8. package/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  9. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +1 -9
  10. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +1 -9
  11. package/README.md +0 -1
  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 +4 -8
  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/releaseInfo.js +1 -1
  20. package/legacy/DateRangeCalendar/DateRangeCalendar.js +10 -17
  21. package/legacy/DateRangeCalendar/useDragRange.js +1 -1
  22. package/legacy/DateRangePicker/DateRangePicker.js +4 -8
  23. package/legacy/DateRangePickerDay/DateRangePickerDay.js +3 -4
  24. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +4 -8
  25. package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +4 -8
  26. package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  27. package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +1 -9
  28. package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +1 -9
  29. package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  30. package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +1 -9
  31. package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +1 -9
  32. package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +4 -8
  33. package/legacy/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -2
  34. package/legacy/index.js +1 -1
  35. package/legacy/internals/utils/releaseInfo.js +1 -1
  36. package/modern/DateRangeCalendar/DateRangeCalendar.js +5 -11
  37. package/modern/DateRangeCalendar/useDragRange.js +1 -1
  38. package/modern/DateRangePicker/DateRangePicker.js +4 -8
  39. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +4 -8
  40. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +4 -8
  41. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  42. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +1 -9
  43. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +1 -9
  44. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  45. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +1 -9
  46. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +1 -9
  47. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +4 -8
  48. package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -2
  49. package/modern/index.js +1 -1
  50. package/modern/internals/utils/releaseInfo.js +1 -1
  51. package/node/DateRangeCalendar/DateRangeCalendar.js +5 -11
  52. package/node/DateRangeCalendar/useDragRange.js +1 -1
  53. package/node/DateRangePicker/DateRangePicker.js +4 -8
  54. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +4 -8
  55. package/node/MobileDateRangePicker/MobileDateRangePicker.js +4 -8
  56. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +1 -1
  57. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +1 -9
  58. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +1 -9
  59. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +1 -1
  60. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +1 -9
  61. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +1 -9
  62. package/node/StaticDateRangePicker/StaticDateRangePicker.js +4 -8
  63. package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -2
  64. package/node/index.js +1 -1
  65. package/node/internals/utils/releaseInfo.js +1 -1
  66. package/package.json +7 -6
@@ -1,6 +1,6 @@
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';
@@ -138,7 +138,6 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
138
138
  shouldDisableDate,
139
139
  reduceAnimations,
140
140
  onMonthChange,
141
- defaultCalendarMonth,
142
141
  rangePosition: rangePositionProp,
143
142
  defaultRangePosition: inDefaultRangePosition,
144
143
  onRangePositionChange: inOnRangePositionChange,
@@ -258,7 +257,6 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
258
257
  } = useCalendarState({
259
258
  value: value[0] || value[1],
260
259
  referenceDate,
261
- defaultCalendarMonth,
262
260
  disableFuture,
263
261
  disablePast,
264
262
  disableSwitchToMonthOnDayFocus: true,
@@ -519,10 +517,6 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
519
517
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
520
518
  */
521
519
  dayOfWeekFormatter: PropTypes.func,
522
- /**
523
- * Default calendar month displayed when `value={[null, null]}`.
524
- */
525
- defaultCalendarMonth: PropTypes.any,
526
520
  /**
527
521
  * The initial position in the edited date range.
528
522
  * Used when the component is not controlled.
@@ -569,8 +563,8 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
569
563
  */
570
564
  displayWeekNumber: PropTypes.bool,
571
565
  /**
572
- * Calendar will show more weeks in order to match this value.
573
- * Put it to 6 for having fix number of week in Gregorian calendars
566
+ * The day view will show as many weeks as needed after the end of the current month to match this value.
567
+ * Put it to 6 to have a fixed number of weeks in Gregorian calendars
574
568
  * @default undefined
575
569
  */
576
570
  fixedWeekNumber: PropTypes.number,
@@ -627,7 +621,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
627
621
  */
628
622
  referenceDate: PropTypes.any,
629
623
  /**
630
- * Component displaying when passed `loading` true.
624
+ * Component rendered on the "day" view when `props.loading` is true.
631
625
  * @returns {React.ReactNode} The node to render when loading.
632
626
  * @default () => "..."
633
627
  */
@@ -672,7 +666,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
672
666
  * Choose which timezone to use for the value.
673
667
  * Example: "default", "system", "UTC", "America/New_York".
674
668
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
675
- * @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.
676
670
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
677
671
  */
678
672
  timezone: PropTypes.string,
@@ -37,10 +37,6 @@ export interface ExportedDateRangeCalendarProps<TDate> extends ExportedDayCalend
37
37
  * @default false
38
38
  */
39
39
  disableAutoMonthSwitching?: boolean;
40
- /**
41
- * Default calendar month displayed when `value={[null, null]}`.
42
- */
43
- defaultCalendarMonth?: TDate;
44
40
  /**
45
41
  * If `true`, the picker and text field are disabled.
46
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;
@@ -80,10 +80,6 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
80
80
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
81
81
  */
82
82
  dayOfWeekFormatter: PropTypes.func,
83
- /**
84
- * Default calendar month displayed when `value={[null, null]}`.
85
- */
86
- defaultCalendarMonth: PropTypes.any,
87
83
  /**
88
84
  * The initial position in the edited date range.
89
85
  * Used when the component is not controlled.
@@ -141,8 +137,8 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
141
137
  */
142
138
  displayWeekNumber: PropTypes.bool,
143
139
  /**
144
- * Calendar will show more weeks in order to match this value.
145
- * Put it to 6 for having fix number of week in Gregorian calendars
140
+ * The day view will show as many weeks as needed after the end of the current month to match this value.
141
+ * Put it to 6 to have a fixed number of weeks in Gregorian calendars
146
142
  * @default undefined
147
143
  */
148
144
  fixedWeekNumber: PropTypes.number,
@@ -258,7 +254,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
258
254
  */
259
255
  referenceDate: PropTypes.any,
260
256
  /**
261
- * Component displaying when passed `loading` true.
257
+ * Component rendered on the "day" view when `props.loading` is true.
262
258
  * @returns {React.ReactNode} The node to render when loading.
263
259
  * @default () => "..."
264
260
  */
@@ -316,7 +312,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
316
312
  * Choose which timezone to use for the value.
317
313
  * Example: "default", "system", "UTC", "America/New_York".
318
314
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
319
- * @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.
320
316
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
321
317
  */
322
318
  timezone: PropTypes.string,
@@ -95,10 +95,6 @@ DesktopDateRangePicker.propTypes = {
95
95
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
96
96
  */
97
97
  dayOfWeekFormatter: PropTypes.func,
98
- /**
99
- * Default calendar month displayed when `value={[null, null]}`.
100
- */
101
- defaultCalendarMonth: PropTypes.any,
102
98
  /**
103
99
  * The initial position in the edited date range.
104
100
  * Used when the component is not controlled.
@@ -150,8 +146,8 @@ DesktopDateRangePicker.propTypes = {
150
146
  */
151
147
  displayWeekNumber: PropTypes.bool,
152
148
  /**
153
- * Calendar will show more weeks in order to match this value.
154
- * Put it to 6 for having fix number of week in Gregorian calendars
149
+ * The day view will show as many weeks as needed after the end of the current month to match this value.
150
+ * Put it to 6 to have a fixed number of weeks in Gregorian calendars
155
151
  * @default undefined
156
152
  */
157
153
  fixedWeekNumber: PropTypes.number,
@@ -267,7 +263,7 @@ DesktopDateRangePicker.propTypes = {
267
263
  */
268
264
  referenceDate: PropTypes.any,
269
265
  /**
270
- * Component displaying when passed `loading` true.
266
+ * Component rendered on the "day" view when `props.loading` is true.
271
267
  * @returns {React.ReactNode} The node to render when loading.
272
268
  * @default () => "..."
273
269
  */
@@ -325,7 +321,7 @@ DesktopDateRangePicker.propTypes = {
325
321
  * Choose which timezone to use for the value.
326
322
  * Example: "default", "system", "UTC", "America/New_York".
327
323
  * 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.
324
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
329
325
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
330
326
  */
331
327
  timezone: PropTypes.string,
@@ -95,10 +95,6 @@ MobileDateRangePicker.propTypes = {
95
95
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
96
96
  */
97
97
  dayOfWeekFormatter: PropTypes.func,
98
- /**
99
- * Default calendar month displayed when `value={[null, null]}`.
100
- */
101
- defaultCalendarMonth: PropTypes.any,
102
98
  /**
103
99
  * The initial position in the edited date range.
104
100
  * Used when the component is not controlled.
@@ -150,8 +146,8 @@ MobileDateRangePicker.propTypes = {
150
146
  */
151
147
  displayWeekNumber: PropTypes.bool,
152
148
  /**
153
- * Calendar will show more weeks in order to match this value.
154
- * Put it to 6 for having fix number of week in Gregorian calendars
149
+ * The day view will show as many weeks as needed after the end of the current month to match this value.
150
+ * Put it to 6 to have a fixed number of weeks in Gregorian calendars
155
151
  * @default undefined
156
152
  */
157
153
  fixedWeekNumber: PropTypes.number,
@@ -267,7 +263,7 @@ MobileDateRangePicker.propTypes = {
267
263
  */
268
264
  referenceDate: PropTypes.any,
269
265
  /**
270
- * Component displaying when passed `loading` true.
266
+ * Component rendered on the "day" view when `props.loading` is true.
271
267
  * @returns {React.ReactNode} The node to render when loading.
272
268
  * @default () => "..."
273
269
  */
@@ -325,7 +321,7 @@ MobileDateRangePicker.propTypes = {
325
321
  * Choose which timezone to use for the value.
326
322
  * Example: "default", "system", "UTC", "America/New_York".
327
323
  * 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.
324
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
329
325
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
330
326
  */
331
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,
package/README.md CHANGED
@@ -35,7 +35,6 @@ This component has the following peer dependencies that you will need to install
35
35
  ```json
36
36
  "peerDependencies": {
37
37
  "@mui/material": "^5.8.6",
38
- "@mui/system": "^5.8.0",
39
38
  "react": "^17.0.0 || ^18.0.0",
40
39
  "react-dom": "^17.0.0 || ^18.0.0"
41
40
  },
@@ -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,
@@ -81,10 +81,6 @@ StaticDateRangePicker.propTypes = {
81
81
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
82
82
  */
83
83
  dayOfWeekFormatter: PropTypes.func,
84
- /**
85
- * Default calendar month displayed when `value={[null, null]}`.
86
- */
87
- defaultCalendarMonth: PropTypes.any,
88
84
  /**
89
85
  * The initial position in the edited date range.
90
86
  * Used when the component is not controlled.
@@ -136,8 +132,8 @@ StaticDateRangePicker.propTypes = {
136
132
  */
137
133
  displayWeekNumber: PropTypes.bool,
138
134
  /**
139
- * Calendar will show more weeks in order to match this value.
140
- * Put it to 6 for having fix number of week in Gregorian calendars
135
+ * The day view will show as many weeks as needed after the end of the current month to match this value.
136
+ * Put it to 6 to have a fixed number of weeks in Gregorian calendars
141
137
  * @default undefined
142
138
  */
143
139
  fixedWeekNumber: PropTypes.number,
@@ -218,7 +214,7 @@ StaticDateRangePicker.propTypes = {
218
214
  */
219
215
  referenceDate: PropTypes.any,
220
216
  /**
221
- * Component displaying when passed `loading` true.
217
+ * Component rendered on the "day" view when `props.loading` is true.
222
218
  * @returns {React.ReactNode} The node to render when loading.
223
219
  * @default () => "..."
224
220
  */
@@ -263,7 +259,7 @@ StaticDateRangePicker.propTypes = {
263
259
  * Choose which timezone to use for the value.
264
260
  * Example: "default", "system", "UTC", "America/New_York".
265
261
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
266
- * @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.
267
263
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
268
264
  */
269
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.1
2
+ * @mui/x-date-pickers-pro v7.0.0-alpha.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTcwMDE3MjAwMDAwMA==";
3
+ const releaseInfo = "MTcwMTY0MDgwMDAwMA==";
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
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
- var _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"],
5
+ var _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"],
6
6
  _excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
@@ -60,23 +60,22 @@ var DAY_RANGE_SIZE = 40;
60
60
  var weeksContainerHeight = (DAY_RANGE_SIZE + DAY_MARGIN * 2) * 6;
61
61
  var warnInvalidCurrentMonthCalendarPosition = buildWarning(['The `currentMonthCalendarPosition` prop must be an integer between `1` and the amount of calendars rendered.', 'For example if you have 2 calendars rendered, it should be equal to either 1 or 2.']);
62
62
  var DayCalendarForRange = styled(DayCalendar)(function (_ref2) {
63
- var _$concat, _ref3;
64
63
  var theme = _ref2.theme;
65
- return _ref3 = {
64
+ return _defineProperty(_defineProperty({
66
65
  minWidth: 312,
67
66
  minHeight: weeksContainerHeight
68
- }, _defineProperty(_ref3, "&.".concat(dateRangeCalendarClasses.dayDragging), (_$concat = {}, _defineProperty(_$concat, "& .".concat(dayClasses.day), {
67
+ }, "&.".concat(dateRangeCalendarClasses.dayDragging), _defineProperty(_defineProperty({}, "& .".concat(dayClasses.day), {
69
68
  cursor: 'grabbing'
70
- }), _defineProperty(_$concat, "& .".concat(dayClasses.root, ":not(.").concat(dayClasses.rangeIntervalDayHighlightStart, "):not(.").concat(dayClasses.rangeIntervalDayHighlightEnd, ") .").concat(dayClasses.day, ":not(.").concat(dayClasses.notSelectedDate, ")"), {
69
+ }), "& .".concat(dayClasses.root, ":not(.").concat(dayClasses.rangeIntervalDayHighlightStart, "):not(.").concat(dayClasses.rangeIntervalDayHighlightEnd, ") .").concat(dayClasses.day, ":not(.").concat(dayClasses.notSelectedDate, ")"), {
71
70
  // we can't override `PickersDay` background color here, because it's styles take precedence
72
71
  opacity: 0.6
73
- }), _$concat)), _defineProperty(_ref3, "&:not(.".concat(dateRangeCalendarClasses.dayDragging, ") .").concat(dayClasses.dayOutsideRangeInterval), {
72
+ })), "&:not(.".concat(dateRangeCalendarClasses.dayDragging, ") .").concat(dayClasses.dayOutsideRangeInterval), {
74
73
  '@media (pointer: fine)': {
75
74
  '&:hover': {
76
75
  border: "1px solid ".concat((theme.vars || theme).palette.grey[500])
77
76
  }
78
77
  }
79
- }), _ref3;
78
+ });
80
79
  });
81
80
  function useDateRangeCalendarDefaultizedProps(props, name) {
82
81
  var _themeProps$renderLoa, _themeProps$reduceAni, _props$loading, _props$disablePast, _props$disableFuture, _themeProps$calendars, _themeProps$disableDr;
@@ -141,7 +140,6 @@ var DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalendar
141
140
  shouldDisableDate = props.shouldDisableDate,
142
141
  reduceAnimations = props.reduceAnimations,
143
142
  onMonthChange = props.onMonthChange,
144
- defaultCalendarMonth = props.defaultCalendarMonth,
145
143
  rangePositionProp = props.rangePosition,
146
144
  inDefaultRangePosition = props.defaultRangePosition,
147
145
  inOnRangePositionChange = props.onRangePositionChange,
@@ -255,7 +253,6 @@ var DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalendar
255
253
  var _useCalendarState = useCalendarState({
256
254
  value: value[0] || value[1],
257
255
  referenceDate: referenceDate,
258
- defaultCalendarMonth: defaultCalendarMonth,
259
256
  disableFuture: disableFuture,
260
257
  disablePast: disablePast,
261
258
  disableSwitchToMonthOnDayFocus: true,
@@ -540,10 +537,6 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
540
537
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
541
538
  */
542
539
  dayOfWeekFormatter: PropTypes.func,
543
- /**
544
- * Default calendar month displayed when `value={[null, null]}`.
545
- */
546
- defaultCalendarMonth: PropTypes.any,
547
540
  /**
548
541
  * The initial position in the edited date range.
549
542
  * Used when the component is not controlled.
@@ -590,8 +583,8 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
590
583
  */
591
584
  displayWeekNumber: PropTypes.bool,
592
585
  /**
593
- * Calendar will show more weeks in order to match this value.
594
- * Put it to 6 for having fix number of week in Gregorian calendars
586
+ * The day view will show as many weeks as needed after the end of the current month to match this value.
587
+ * Put it to 6 to have a fixed number of weeks in Gregorian calendars
595
588
  * @default undefined
596
589
  */
597
590
  fixedWeekNumber: PropTypes.number,
@@ -648,7 +641,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
648
641
  */
649
642
  referenceDate: PropTypes.any,
650
643
  /**
651
- * Component displaying when passed `loading` true.
644
+ * Component rendered on the "day" view when `props.loading` is true.
652
645
  * @returns {React.ReactNode} The node to render when loading.
653
646
  * @default () => "..."
654
647
  */
@@ -693,7 +686,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
693
686
  * Choose which timezone to use for the value.
694
687
  * Example: "default", "system", "UTC", "America/New_York".
695
688
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
696
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
689
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
697
690
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
698
691
  */
699
692
  timezone: PropTypes.string,
@@ -9,7 +9,7 @@ var resolveDateFromTarget = function resolveDateFromTarget(target, utils, timezo
9
9
  return null;
10
10
  }
11
11
  var timestamp = +timestampString;
12
- return utils.dateWithTimezone(new Date(timestamp).toISOString(), timezone);
12
+ return utils.date(new Date(timestamp).toISOString(), timezone);
13
13
  };
14
14
  var isSameAsDraggingDate = function isSameAsDraggingDate(event) {
15
15
  var timestampString = event.target.dataset.timestamp;
@@ -79,10 +79,6 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
79
79
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
80
80
  */
81
81
  dayOfWeekFormatter: PropTypes.func,
82
- /**
83
- * Default calendar month displayed when `value={[null, null]}`.
84
- */
85
- defaultCalendarMonth: PropTypes.any,
86
82
  /**
87
83
  * The initial position in the edited date range.
88
84
  * Used when the component is not controlled.
@@ -140,8 +136,8 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
140
136
  */
141
137
  displayWeekNumber: PropTypes.bool,
142
138
  /**
143
- * Calendar will show more weeks in order to match this value.
144
- * Put it to 6 for having fix number of week in Gregorian calendars
139
+ * The day view will show as many weeks as needed after the end of the current month to match this value.
140
+ * Put it to 6 to have a fixed number of weeks in Gregorian calendars
145
141
  * @default undefined
146
142
  */
147
143
  fixedWeekNumber: PropTypes.number,
@@ -257,7 +253,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
257
253
  */
258
254
  referenceDate: PropTypes.any,
259
255
  /**
260
- * Component displaying when passed `loading` true.
256
+ * Component rendered on the "day" view when `props.loading` is true.
261
257
  * @returns {React.ReactNode} The node to render when loading.
262
258
  * @default () => "..."
263
259
  */
@@ -315,7 +311,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
315
311
  * Choose which timezone to use for the value.
316
312
  * Example: "default", "system", "UTC", "America/New_York".
317
313
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
318
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
314
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
319
315
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
320
316
  */
321
317
  timezone: PropTypes.string,
@@ -51,14 +51,13 @@ var DateRangePickerDayRoot = styled('div', {
51
51
  return [_defineProperty({}, "&.".concat(dateRangePickerDayClasses.rangeIntervalDayHighlight), styles.rangeIntervalDayHighlight), _defineProperty({}, "&.".concat(dateRangePickerDayClasses.rangeIntervalDayHighlightStart), styles.rangeIntervalDayHighlightStart), _defineProperty({}, "&.".concat(dateRangePickerDayClasses.rangeIntervalDayHighlightEnd), styles.rangeIntervalDayHighlightEnd), _defineProperty({}, "&.".concat(dateRangePickerDayClasses.firstVisibleCell), styles.firstVisibleCell), _defineProperty({}, "&.".concat(dateRangePickerDayClasses.lastVisibleCell), styles.lastVisibleCell), _defineProperty({}, "&.".concat(dateRangePickerDayClasses.startOfMonth), styles.startOfMonth), _defineProperty({}, "&.".concat(dateRangePickerDayClasses.endOfMonth), styles.endOfMonth), _defineProperty({}, "&.".concat(dateRangePickerDayClasses.outsideCurrentMonth), styles.outsideCurrentMonth), _defineProperty({}, "&.".concat(dateRangePickerDayClasses.hiddenDayFiller), styles.hiddenDayFiller), styles.root];
52
52
  }
53
53
  })(function (_ref10) {
54
- var _extends2;
55
54
  var theme = _ref10.theme,
56
55
  ownerState = _ref10.ownerState;
57
- return ownerState.isHiddenDayFiller ? {} : _extends((_extends2 = {}, _defineProperty(_extends2, "&:first-of-type .".concat(dateRangePickerDayClasses.rangeIntervalDayPreview), _extends({}, startBorderStyle, {
56
+ return ownerState.isHiddenDayFiller ? {} : _extends(_defineProperty(_defineProperty({}, "&:first-of-type .".concat(dateRangePickerDayClasses.rangeIntervalDayPreview), _extends({}, startBorderStyle, {
58
57
  borderLeftColor: (theme.vars || theme).palette.divider
59
- })), _defineProperty(_extends2, "&:last-of-type .".concat(dateRangePickerDayClasses.rangeIntervalDayPreview), _extends({}, endBorderStyle, {
58
+ })), "&:last-of-type .".concat(dateRangePickerDayClasses.rangeIntervalDayPreview), _extends({}, endBorderStyle, {
60
59
  borderRightColor: (theme.vars || theme).palette.divider
61
- })), _extends2), ownerState.isHighlighting && {
60
+ })), ownerState.isHighlighting && {
62
61
  borderRadius: 0,
63
62
  color: (theme.vars || theme).palette.primary.contrastText,
64
63
  backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.primary.mainChannel, " / ").concat(theme.vars.palette.action.focusOpacity, ")") : alpha(theme.palette.primary.main, theme.palette.action.focusOpacity),
@@ -94,10 +94,6 @@ DesktopDateRangePicker.propTypes = {
94
94
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
95
95
  */
96
96
  dayOfWeekFormatter: PropTypes.func,
97
- /**
98
- * Default calendar month displayed when `value={[null, null]}`.
99
- */
100
- defaultCalendarMonth: PropTypes.any,
101
97
  /**
102
98
  * The initial position in the edited date range.
103
99
  * Used when the component is not controlled.
@@ -149,8 +145,8 @@ DesktopDateRangePicker.propTypes = {
149
145
  */
150
146
  displayWeekNumber: PropTypes.bool,
151
147
  /**
152
- * Calendar will show more weeks in order to match this value.
153
- * Put it to 6 for having fix number of week in Gregorian calendars
148
+ * The day view will show as many weeks as needed after the end of the current month to match this value.
149
+ * Put it to 6 to have a fixed number of weeks in Gregorian calendars
154
150
  * @default undefined
155
151
  */
156
152
  fixedWeekNumber: PropTypes.number,
@@ -266,7 +262,7 @@ DesktopDateRangePicker.propTypes = {
266
262
  */
267
263
  referenceDate: PropTypes.any,
268
264
  /**
269
- * Component displaying when passed `loading` true.
265
+ * Component rendered on the "day" view when `props.loading` is true.
270
266
  * @returns {React.ReactNode} The node to render when loading.
271
267
  * @default () => "..."
272
268
  */
@@ -324,7 +320,7 @@ DesktopDateRangePicker.propTypes = {
324
320
  * Choose which timezone to use for the value.
325
321
  * Example: "default", "system", "UTC", "America/New_York".
326
322
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
327
- * @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.
328
324
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
329
325
  */
330
326
  timezone: PropTypes.string,