@mui/x-date-pickers 8.3.1 → 8.4.0

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 (122) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/DateCalendar/DateCalendar.js +1 -0
  3. package/DateField/DateField.js +1 -0
  4. package/DatePicker/DatePicker.js +1 -0
  5. package/DatePicker/DatePickerToolbar.js +1 -0
  6. package/DateTimeField/DateTimeField.js +1 -0
  7. package/DateTimePicker/DateTimePicker.js +1 -0
  8. package/DateTimePicker/DateTimePickerTabs.js +1 -0
  9. package/DateTimePicker/DateTimePickerToolbar.js +1 -0
  10. package/DesktopDatePicker/DesktopDatePicker.js +1 -0
  11. package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -0
  12. package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -0
  13. package/DesktopTimePicker/DesktopTimePicker.js +1 -0
  14. package/DigitalClock/DigitalClock.js +1 -0
  15. package/LocalizationProvider/LocalizationProvider.js +2 -3
  16. package/MobileDatePicker/MobileDatePicker.js +1 -0
  17. package/MobileDateTimePicker/MobileDateTimePicker.js +1 -0
  18. package/MobileTimePicker/MobileTimePicker.js +1 -0
  19. package/MonthCalendar/MonthCalendar.js +1 -0
  20. package/MonthCalendar/MonthCalendarButton.js +2 -1
  21. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -4
  22. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -1
  23. package/PickersActionBar/PickersActionBar.js +2 -1
  24. package/PickersCalendarHeader/PickersCalendarHeader.js +1 -0
  25. package/PickersDay/PickersDay.js +3 -1
  26. package/PickersLayout/PickersLayout.js +1 -0
  27. package/PickersSectionList/PickersSectionList.js +1 -0
  28. package/PickersTextField/PickersFilledInput/PickersFilledInput.js +1 -0
  29. package/PickersTextField/PickersInput/PickersInput.js +1 -0
  30. package/PickersTextField/PickersInputBase/PickersInputBase.js +1 -0
  31. package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +1 -0
  32. package/PickersTextField/PickersTextField.js +4 -1
  33. package/PickersTextField/usePickerTextFieldOwnerState.js +1 -0
  34. package/StaticDatePicker/StaticDatePicker.js +1 -0
  35. package/StaticDateTimePicker/StaticDateTimePicker.js +1 -0
  36. package/StaticTimePicker/StaticTimePicker.js +1 -0
  37. package/TimeClock/TimeClock.js +1 -0
  38. package/TimeField/TimeField.js +1 -0
  39. package/TimePicker/TimePicker.js +1 -0
  40. package/YearCalendar/YearCalendar.js +1 -0
  41. package/YearCalendar/YearCalendarButton.js +2 -1
  42. package/dateViewRenderers/dateViewRenderers.js +2 -1
  43. package/esm/DateCalendar/DateCalendar.js +1 -0
  44. package/esm/DateField/DateField.js +1 -0
  45. package/esm/DatePicker/DatePicker.js +1 -0
  46. package/esm/DatePicker/DatePickerToolbar.js +1 -0
  47. package/esm/DateTimeField/DateTimeField.js +1 -0
  48. package/esm/DateTimePicker/DateTimePicker.js +1 -0
  49. package/esm/DateTimePicker/DateTimePickerTabs.js +1 -0
  50. package/esm/DateTimePicker/DateTimePickerToolbar.js +1 -0
  51. package/esm/DesktopDatePicker/DesktopDatePicker.js +1 -0
  52. package/esm/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -0
  53. package/esm/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -0
  54. package/esm/DesktopTimePicker/DesktopTimePicker.js +1 -0
  55. package/esm/DigitalClock/DigitalClock.js +1 -0
  56. package/esm/LocalizationProvider/LocalizationProvider.js +2 -3
  57. package/esm/MobileDatePicker/MobileDatePicker.js +1 -0
  58. package/esm/MobileDateTimePicker/MobileDateTimePicker.js +1 -0
  59. package/esm/MobileTimePicker/MobileTimePicker.js +1 -0
  60. package/esm/MonthCalendar/MonthCalendar.js +1 -0
  61. package/esm/MonthCalendar/MonthCalendarButton.js +2 -1
  62. package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
  63. package/esm/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -1
  64. package/esm/PickersActionBar/PickersActionBar.js +1 -0
  65. package/esm/PickersCalendarHeader/PickersCalendarHeader.js +1 -0
  66. package/esm/PickersDay/PickersDay.js +3 -1
  67. package/esm/PickersLayout/PickersLayout.js +1 -0
  68. package/esm/PickersSectionList/PickersSectionList.js +1 -0
  69. package/esm/PickersTextField/PickersFilledInput/PickersFilledInput.js +1 -0
  70. package/esm/PickersTextField/PickersInput/PickersInput.js +1 -0
  71. package/esm/PickersTextField/PickersInputBase/PickersInputBase.js +1 -0
  72. package/esm/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +1 -0
  73. package/esm/PickersTextField/PickersTextField.js +4 -1
  74. package/esm/PickersTextField/usePickerTextFieldOwnerState.js +1 -0
  75. package/esm/StaticDatePicker/StaticDatePicker.js +1 -0
  76. package/esm/StaticDateTimePicker/StaticDateTimePicker.js +1 -0
  77. package/esm/StaticTimePicker/StaticTimePicker.js +1 -0
  78. package/esm/TimeClock/TimeClock.js +1 -0
  79. package/esm/TimeField/TimeField.js +1 -0
  80. package/esm/TimePicker/TimePicker.js +1 -0
  81. package/esm/YearCalendar/YearCalendar.js +1 -0
  82. package/esm/YearCalendar/YearCalendarButton.js +2 -1
  83. package/esm/dateViewRenderers/dateViewRenderers.js +2 -1
  84. package/esm/hooks/useIsValidValue.js +1 -0
  85. package/esm/hooks/usePickerContext.js +1 -0
  86. package/esm/index.js +1 -1
  87. package/esm/internals/components/PickerFieldUI.js +1 -0
  88. package/esm/internals/components/PickerPopper/PickerPopper.js +1 -0
  89. package/esm/internals/components/PickerProvider.js +2 -0
  90. package/esm/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -1
  91. package/esm/internals/components/PickersToolbar.js +2 -1
  92. package/esm/internals/components/PickersToolbarButton.js +2 -1
  93. package/esm/internals/components/PickersToolbarText.js +2 -1
  94. package/esm/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -0
  95. package/esm/internals/hooks/useField/useFieldCharacterEditing.js +27 -11
  96. package/esm/internals/hooks/useField/useFieldSectionContainerProps.js +2 -3
  97. package/esm/internals/hooks/useField/useFieldSectionContentProps.js +2 -2
  98. package/esm/internals/hooks/useField/useFieldState.js +2 -2
  99. package/esm/internals/hooks/useMobilePicker/useMobilePicker.js +1 -0
  100. package/esm/internals/hooks/useNullableFieldPrivateContext.js +1 -0
  101. package/esm/internals/hooks/useStaticPicker/useStaticPicker.js +1 -0
  102. package/esm/timeViewRenderers/timeViewRenderers.js +4 -1
  103. package/hooks/useIsValidValue.js +1 -0
  104. package/hooks/usePickerContext.js +1 -0
  105. package/index.js +1 -1
  106. package/internals/components/PickerFieldUI.js +1 -0
  107. package/internals/components/PickerPopper/PickerPopper.js +1 -0
  108. package/internals/components/PickerProvider.js +2 -0
  109. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -1
  110. package/internals/components/PickersToolbar.js +2 -1
  111. package/internals/components/PickersToolbarButton.js +2 -1
  112. package/internals/components/PickersToolbarText.js +2 -1
  113. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -0
  114. package/internals/hooks/useField/useFieldCharacterEditing.js +27 -11
  115. package/internals/hooks/useField/useFieldSectionContainerProps.js +2 -4
  116. package/internals/hooks/useField/useFieldSectionContentProps.js +2 -2
  117. package/internals/hooks/useField/useFieldState.js +2 -2
  118. package/internals/hooks/useMobilePicker/useMobilePicker.js +1 -0
  119. package/internals/hooks/useNullableFieldPrivateContext.js +1 -0
  120. package/internals/hooks/useStaticPicker/useStaticPicker.js +1 -0
  121. package/package.json +2 -2
  122. package/timeViewRenderers/timeViewRenderers.js +4 -1
@@ -108,6 +108,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
108
108
  })]
109
109
  });
110
110
  };
111
+ if (process.env.NODE_ENV !== "production") DateTimePickerTabs.displayName = "DateTimePickerTabs";
111
112
  process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
112
113
  // ----------------------------- Warning --------------------------------
113
114
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -217,6 +217,7 @@ export const DateTimePickerToolbarOverrideContext = /*#__PURE__*/React.createCon
217
217
  *
218
218
  * - [DateTimePickerToolbar API](https://mui.com/x/api/date-pickers/date-time-picker-toolbar/)
219
219
  */
220
+ if (process.env.NODE_ENV !== "production") DateTimePickerToolbarOverrideContext.displayName = "DateTimePickerToolbarOverrideContext";
220
221
  function DateTimePickerToolbar(inProps) {
221
222
  const props = useThemeProps({
222
223
  props: inProps,
@@ -62,6 +62,7 @@ const DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePick
62
62
  });
63
63
  return renderPicker();
64
64
  });
65
+ if (process.env.NODE_ENV !== "production") DesktopDatePicker.displayName = "DesktopDatePicker";
65
66
  DesktopDatePicker.propTypes = {
66
67
  // ----------------------------- Warning --------------------------------
67
68
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -78,6 +78,7 @@ const rendererInterceptor = function RendererInterceptor(props) {
78
78
  })]
79
79
  });
80
80
  };
81
+ if (process.env.NODE_ENV !== "production") rendererInterceptor.displayName = "rendererInterceptor";
81
82
  /**
82
83
  * Demos:
83
84
  *
@@ -143,6 +144,7 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
143
144
  });
144
145
  return renderPicker();
145
146
  });
147
+ if (process.env.NODE_ENV !== "production") DesktopDateTimePicker.displayName = "DesktopDateTimePicker";
146
148
  DesktopDateTimePicker.propTypes = {
147
149
  // ----------------------------- Warning --------------------------------
148
150
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -54,6 +54,7 @@ const DesktopDateTimePickerLayout = /*#__PURE__*/React.forwardRef(function Deskt
54
54
  }), actionBar]
55
55
  });
56
56
  });
57
+ if (process.env.NODE_ENV !== "production") DesktopDateTimePickerLayout.displayName = "DesktopDateTimePickerLayout";
57
58
  process.env.NODE_ENV !== "production" ? DesktopDateTimePickerLayout.propTypes = {
58
59
  // ----------------------------- Warning --------------------------------
59
60
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -78,6 +78,7 @@ const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePick
78
78
  });
79
79
  return renderPicker();
80
80
  });
81
+ if (process.env.NODE_ENV !== "production") DesktopTimePicker.displayName = "DesktopTimePicker";
81
82
  DesktopTimePicker.propTypes = {
82
83
  // ----------------------------- Warning --------------------------------
83
84
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -314,6 +314,7 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
314
314
  })
315
315
  }));
316
316
  });
317
+ if (process.env.NODE_ENV !== "production") DigitalClock.displayName = "DigitalClock";
317
318
  process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
318
319
  // ----------------------------- Warning --------------------------------
319
320
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -8,9 +8,7 @@ import PropTypes from 'prop-types';
8
8
  import { useThemeProps } from '@mui/material/styles';
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  export const MuiPickersAdapterContext = /*#__PURE__*/React.createContext(null);
11
- if (process.env.NODE_ENV !== 'production') {
12
- MuiPickersAdapterContext.displayName = 'MuiPickersAdapterContext';
13
- }
11
+ if (process.env.NODE_ENV !== "production") MuiPickersAdapterContext.displayName = "MuiPickersAdapterContext";
14
12
  /**
15
13
  * Demos:
16
14
  *
@@ -88,6 +86,7 @@ export const LocalizationProvider = function LocalizationProvider(inProps) {
88
86
  children: children
89
87
  });
90
88
  };
89
+ if (process.env.NODE_ENV !== "production") LocalizationProvider.displayName = "LocalizationProvider";
91
90
  process.env.NODE_ENV !== "production" ? LocalizationProvider.propTypes = {
92
91
  // ----------------------------- Warning --------------------------------
93
92
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -60,6 +60,7 @@ const MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker
60
60
  });
61
61
  return renderPicker();
62
62
  });
63
+ if (process.env.NODE_ENV !== "production") MobileDatePicker.displayName = "MobileDatePicker";
63
64
  MobileDatePicker.propTypes = {
64
65
  // ----------------------------- Warning --------------------------------
65
66
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -110,6 +110,7 @@ const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTi
110
110
  });
111
111
  return renderPicker();
112
112
  });
113
+ if (process.env.NODE_ENV !== "production") MobileDateTimePicker.displayName = "MobileDateTimePicker";
113
114
  MobileDateTimePicker.propTypes = {
114
115
  // ----------------------------- Warning --------------------------------
115
116
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -63,6 +63,7 @@ const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker
63
63
  });
64
64
  return renderPicker();
65
65
  });
66
+ if (process.env.NODE_ENV !== "production") MobileTimePicker.displayName = "MobileTimePicker";
66
67
  MobileTimePicker.propTypes = {
67
68
  // ----------------------------- Warning --------------------------------
68
69
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -251,6 +251,7 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
251
251
  })
252
252
  }));
253
253
  });
254
+ if (process.env.NODE_ENV !== "production") MonthCalendar.displayName = "MonthCalendar";
254
255
  process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
255
256
  // ----------------------------- Warning --------------------------------
256
257
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -112,4 +112,5 @@ export const MonthCalendarButton = /*#__PURE__*/React.memo(function MonthCalenda
112
112
  className: classes.button
113
113
  });
114
114
  return /*#__PURE__*/_jsx(MonthButton, _extends({}, monthButtonProps));
115
- });
115
+ });
116
+ if (process.env.NODE_ENV !== "production") MonthCalendarButton.displayName = "MonthCalendarButton";
@@ -343,6 +343,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
343
343
  }, timeView))
344
344
  }));
345
345
  });
346
+ if (process.env.NODE_ENV !== "production") MultiSectionDigitalClock.displayName = "MultiSectionDigitalClock";
346
347
  process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
347
348
  // ----------------------------- Warning --------------------------------
348
349
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -206,4 +206,5 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
206
206
  }), option.label);
207
207
  })
208
208
  }));
209
- });
209
+ });
210
+ if (process.env.NODE_ENV !== "production") MultiSectionDigitalClockSection.displayName = "MultiSectionDigitalClockSection";
@@ -113,4 +113,5 @@ process.env.NODE_ENV !== "production" ? PickersActionBarComponent.propTypes = {
113
113
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
114
114
  } : void 0;
115
115
  const PickersActionBar = /*#__PURE__*/React.memo(PickersActionBarComponent);
116
+ if (process.env.NODE_ENV !== "production") PickersActionBar.displayName = "PickersActionBar";
116
117
  export { PickersActionBar };
@@ -225,6 +225,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
225
225
  })]
226
226
  }));
227
227
  });
228
+ if (process.env.NODE_ENV !== "production") PickersCalendarHeader.displayName = "PickersCalendarHeader";
228
229
  process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
229
230
  // ----------------------------- Warning --------------------------------
230
231
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -218,6 +218,7 @@ const PickersDayRaw = /*#__PURE__*/React.forwardRef(function PickersDay(inProps,
218
218
  children: !children ? utils.format(day, 'dayOfMonth') : children
219
219
  }));
220
220
  });
221
+ if (process.env.NODE_ENV !== "production") PickersDayRaw.displayName = "PickersDayRaw";
221
222
  process.env.NODE_ENV !== "production" ? PickersDayRaw.propTypes = {
222
223
  // ----------------------------- Warning --------------------------------
223
224
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -369,4 +370,5 @@ process.env.NODE_ENV !== "production" ? PickersDayRaw.propTypes = {
369
370
  *
370
371
  * - [PickersDay API](https://mui.com/x/api/date-pickers/pickers-day/)
371
372
  */
372
- export const PickersDay = /*#__PURE__*/React.memo(PickersDayRaw);
373
+ export const PickersDay = /*#__PURE__*/React.memo(PickersDayRaw);
374
+ if (process.env.NODE_ENV !== "production") PickersDay.displayName = "PickersDay";
@@ -137,6 +137,7 @@ const PickersLayout = /*#__PURE__*/React.forwardRef(function PickersLayout(inPro
137
137
  }), actionBar]
138
138
  });
139
139
  });
140
+ if (process.env.NODE_ENV !== "production") PickersLayout.displayName = "PickersLayout";
140
141
  process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
141
142
  // ----------------------------- Warning --------------------------------
142
143
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -204,6 +204,7 @@ const PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSection
204
204
  })
205
205
  }));
206
206
  });
207
+ if (process.env.NODE_ENV !== "production") PickersSectionList.displayName = "PickersSectionList";
207
208
  process.env.NODE_ENV !== "production" ? PickersSectionList.propTypes = {
208
209
  // ----------------------------- Warning --------------------------------
209
210
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -226,6 +226,7 @@ const PickersFilledInput = /*#__PURE__*/React.forwardRef(function PickersFilledI
226
226
  ownerState: ownerState
227
227
  }));
228
228
  });
229
+ if (process.env.NODE_ENV !== "production") PickersFilledInput.displayName = "PickersFilledInput";
229
230
  process.env.NODE_ENV !== "production" ? PickersFilledInput.propTypes = {
230
231
  // ----------------------------- Warning --------------------------------
231
232
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -143,6 +143,7 @@ const PickersInput = /*#__PURE__*/React.forwardRef(function PickersInput(inProps
143
143
  ref: ref
144
144
  }));
145
145
  });
146
+ if (process.env.NODE_ENV !== "production") PickersInput.displayName = "PickersInput";
146
147
  process.env.NODE_ENV !== "production" ? PickersInput.propTypes = {
147
148
  // ----------------------------- Warning --------------------------------
148
149
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -393,6 +393,7 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
393
393
  })]
394
394
  }));
395
395
  });
396
+ if (process.env.NODE_ENV !== "production") PickersInputBase.displayName = "PickersInputBase";
396
397
  process.env.NODE_ENV !== "production" ? PickersInputBase.propTypes = {
397
398
  // ----------------------------- Warning --------------------------------
398
399
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -120,6 +120,7 @@ const PickersOutlinedInput = /*#__PURE__*/React.forwardRef(function PickersOutli
120
120
  ref: ref
121
121
  }));
122
122
  });
123
+ if (process.env.NODE_ENV !== "production") PickersOutlinedInput.displayName = "PickersOutlinedInput";
123
124
  process.env.NODE_ENV !== "production" ? PickersOutlinedInput.propTypes = {
124
125
  // ----------------------------- Warning --------------------------------
125
126
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -29,7 +29,9 @@ const VARIANT_COMPONENT = {
29
29
  const PickersTextFieldRoot = styled(FormControl, {
30
30
  name: 'MuiPickersTextField',
31
31
  slot: 'Root'
32
- })({});
32
+ })({
33
+ maxWidth: '100%'
34
+ });
33
35
  const useUtilityClasses = (classes, ownerState) => {
34
36
  const {
35
37
  isFieldFocused,
@@ -174,6 +176,7 @@ const PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField
174
176
  }))
175
177
  });
176
178
  });
179
+ if (process.env.NODE_ENV !== "production") PickersTextField.displayName = "PickersTextField";
177
180
  process.env.NODE_ENV !== "production" ? PickersTextField.propTypes = {
178
181
  // ----------------------------- Warning --------------------------------
179
182
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -2,6 +2,7 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  export const PickerTextFieldOwnerStateContext = /*#__PURE__*/React.createContext(null);
5
+ if (process.env.NODE_ENV !== "production") PickerTextFieldOwnerStateContext.displayName = "PickerTextFieldOwnerStateContext";
5
6
  export const usePickerTextFieldOwnerState = () => {
6
7
  const value = React.useContext(PickerTextFieldOwnerStateContext);
7
8
  if (value == null) {
@@ -50,6 +50,7 @@ const StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDatePicker
50
50
  });
51
51
  return renderPicker();
52
52
  });
53
+ if (process.env.NODE_ENV !== "production") StaticDatePicker.displayName = "StaticDatePicker";
53
54
  StaticDatePicker.propTypes = {
54
55
  // ----------------------------- Warning --------------------------------
55
56
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -99,6 +99,7 @@ const StaticDateTimePicker = /*#__PURE__*/React.forwardRef(function StaticDateTi
99
99
  });
100
100
  return renderPicker();
101
101
  });
102
+ if (process.env.NODE_ENV !== "production") StaticDateTimePicker.displayName = "StaticDateTimePicker";
102
103
  StaticDateTimePicker.propTypes = {
103
104
  // ----------------------------- Warning --------------------------------
104
105
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -52,6 +52,7 @@ const StaticTimePicker = /*#__PURE__*/React.forwardRef(function StaticTimePicker
52
52
  });
53
53
  return renderPicker();
54
54
  });
55
+ if (process.env.NODE_ENV !== "production") StaticTimePicker.displayName = "StaticTimePicker";
55
56
  StaticTimePicker.propTypes = {
56
57
  // ----------------------------- Warning --------------------------------
57
58
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -329,6 +329,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
329
329
  })]
330
330
  }));
331
331
  });
332
+ if (process.env.NODE_ENV !== "production") TimeClock.displayName = "TimeClock";
332
333
  process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
333
334
  // ----------------------------- Warning --------------------------------
334
335
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -43,6 +43,7 @@ const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, inRe
43
43
  defaultOpenPickerIcon: ClockIcon
44
44
  });
45
45
  });
46
+ if (process.env.NODE_ENV !== "production") TimeField.displayName = "TimeField";
46
47
  process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
47
48
  // ----------------------------- Warning --------------------------------
48
49
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -45,6 +45,7 @@ const TimePicker = /*#__PURE__*/React.forwardRef(function TimePicker(inProps, re
45
45
  ref: ref
46
46
  }, other));
47
47
  });
48
+ if (process.env.NODE_ENV !== "production") TimePicker.displayName = "TimePicker";
48
49
  process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
49
50
  // ----------------------------- Warning --------------------------------
50
51
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -296,6 +296,7 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
296
296
  }, (_, index) => /*#__PURE__*/_jsx(YearCalendarButtonFiller, {}, index))]
297
297
  }));
298
298
  });
299
+ if (process.env.NODE_ENV !== "production") YearCalendar.displayName = "YearCalendar";
299
300
  process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
300
301
  // ----------------------------- Warning --------------------------------
301
302
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -112,4 +112,5 @@ export const YearCalendarButton = /*#__PURE__*/React.memo(function YearCalendarB
112
112
  className: classes.button
113
113
  });
114
114
  return /*#__PURE__*/_jsx(YearButton, _extends({}, yearButtonProps));
115
- });
115
+ });
116
+ if (process.env.NODE_ENV !== "production") YearCalendarButton.displayName = "YearCalendarButton";
@@ -80,4 +80,5 @@ export const renderDateViewCalendar = ({
80
80
  fixedWeekNumber: fixedWeekNumber,
81
81
  displayWeekNumber: displayWeekNumber,
82
82
  timezone: timezone
83
- });
83
+ });
84
+ if (process.env.NODE_ENV !== "production") renderDateViewCalendar.displayName = "renderDateViewCalendar";
@@ -6,6 +6,7 @@ export const IsValidValueContext = /*#__PURE__*/React.createContext(() => true);
6
6
  /**
7
7
  * Returns a function to check if a value is valid according to the validation props passed to the parent Picker.
8
8
  */
9
+ if (process.env.NODE_ENV !== "production") IsValidValueContext.displayName = "IsValidValueContext";
9
10
  export function useIsValidValue() {
10
11
  return React.useContext(IsValidValueContext);
11
12
  }
@@ -6,6 +6,7 @@ export const PickerContext = /*#__PURE__*/React.createContext(null);
6
6
  /**
7
7
  * Returns the context passed by the Picker wrapping the current component.
8
8
  */
9
+ if (process.env.NODE_ENV !== "production") PickerContext.displayName = "PickerContext";
9
10
  export const usePickerContext = () => {
10
11
  const value = React.useContext(PickerContext);
11
12
  if (value == null) {
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v8.3.1
2
+ * @mui/x-date-pickers v8.4.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -95,6 +95,7 @@ export const PickerFieldUIContext = /*#__PURE__*/React.createContext({
95
95
  * Adds the button to open the Picker and the button to clear the value of the field.
96
96
  * @ignore - internal component.
97
97
  */
98
+ if (process.env.NODE_ENV !== "production") PickerFieldUIContext.displayName = "PickerFieldUIContext";
98
99
  export function PickerFieldUI(props) {
99
100
  const {
100
101
  slots,
@@ -197,6 +197,7 @@ const PickerPopperPaperWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
197
197
  children: children
198
198
  }));
199
199
  });
200
+ if (process.env.NODE_ENV !== "production") PickerPopperPaperWrapper.displayName = "PickerPopperPaperWrapper";
200
201
  export function PickerPopper(inProps) {
201
202
  const props = useThemeProps({
202
203
  props: inProps,
@@ -5,6 +5,7 @@ import { PickerFieldPrivateContext } from "../hooks/useNullableFieldPrivateConte
5
5
  import { PickerContext } from "../../hooks/usePickerContext.js";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  export const PickerActionsContext = /*#__PURE__*/React.createContext(null);
8
+ if (process.env.NODE_ENV !== "production") PickerActionsContext.displayName = "PickerActionsContext";
8
9
  export const PickerPrivateContext = /*#__PURE__*/React.createContext({
9
10
  ownerState: {
10
11
  isPickerDisabled: false,
@@ -34,6 +35,7 @@ export const PickerPrivateContext = /*#__PURE__*/React.createContext({
34
35
  *
35
36
  * @ignore - do not document.
36
37
  */
38
+ if (process.env.NODE_ENV !== "production") PickerPrivateContext.displayName = "PickerPrivateContext";
37
39
  export function PickerProvider(props) {
38
40
  const {
39
41
  contextValue,
@@ -170,4 +170,5 @@ export const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function Picke
170
170
  children: isRtl ? /*#__PURE__*/_jsx(LeftArrowIcon, _extends({}, leftArrowIconProps)) : /*#__PURE__*/_jsx(RightArrowIcon, _extends({}, rightArrowIconProps))
171
171
  }))]
172
172
  }));
173
- });
173
+ });
174
+ if (process.env.NODE_ENV !== "production") PickersArrowSwitcher.displayName = "PickersArrowSwitcher";
@@ -111,4 +111,5 @@ export const PickersToolbar = /*#__PURE__*/React.forwardRef(function PickersTool
111
111
  children: children
112
112
  })]
113
113
  }));
114
- });
114
+ });
115
+ if (process.env.NODE_ENV !== "production") PickersToolbar.displayName = "PickersToolbar";
@@ -58,4 +58,5 @@ export const PickersToolbarButton = /*#__PURE__*/React.forwardRef(function Picke
58
58
  selected: selected
59
59
  })
60
60
  }));
61
- });
61
+ });
62
+ if (process.env.NODE_ENV !== "production") PickersToolbarButton.displayName = "PickersToolbarButton";
@@ -49,4 +49,5 @@ export const PickersToolbarText = /*#__PURE__*/React.forwardRef(function Pickers
49
49
  }, other, {
50
50
  children: value
51
51
  }));
52
- });
52
+ });
53
+ if (process.env.NODE_ENV !== "production") PickersToolbarText.displayName = "PickersToolbarText";
@@ -91,6 +91,7 @@ export const useDesktopPicker = _ref => {
91
91
  })]
92
92
  })
93
93
  }));
94
+ if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
94
95
  return {
95
96
  renderPicker
96
97
  };
@@ -126,7 +126,11 @@ export const useFieldCharacterEditing = ({
126
126
  return applyQuery(params, getFirstSectionValueMatchingWithQuery);
127
127
  };
128
128
  const applyNumericEditing = params => {
129
- const getNewSectionValue = (queryValue, section) => {
129
+ const getNewSectionValue = ({
130
+ queryValue,
131
+ skipIfBelowMinimum,
132
+ section
133
+ }) => {
130
134
  const cleanQueryValue = removeLocalizedDigits(queryValue, localizedDigits);
131
135
  const queryValueNumber = Number(cleanQueryValue);
132
136
  const sectionBoundaries = sectionsValueBoundaries[section.type]({
@@ -143,7 +147,7 @@ export const useFieldCharacterEditing = ({
143
147
  // If the user types `0` on a month section,
144
148
  // It is below the minimum, but we want to store the `0` in the query,
145
149
  // So that when he pressed `1`, it will store `01` and move to the next section.
146
- if (queryValueNumber < sectionBoundaries.minimum) {
150
+ if (skipIfBelowMinimum && queryValueNumber < sectionBoundaries.minimum) {
147
151
  return {
148
152
  saveQuery: true
149
153
  };
@@ -157,20 +161,28 @@ export const useFieldCharacterEditing = ({
157
161
  };
158
162
  const getFirstSectionValueMatchingWithQuery = (queryValue, activeSection) => {
159
163
  if (activeSection.contentType === 'digit' || activeSection.contentType === 'digit-with-letter') {
160
- return getNewSectionValue(queryValue, activeSection);
164
+ return getNewSectionValue({
165
+ queryValue,
166
+ skipIfBelowMinimum: false,
167
+ section: activeSection
168
+ });
161
169
  }
162
170
 
163
171
  // When editing a letter-format month and the user presses a digit,
164
172
  // We can support the numeric editing by using the digit-format month and re-formatting the result.
165
173
  if (activeSection.type === 'month') {
166
174
  const hasLeadingZerosInFormat = doesSectionFormatHaveLeadingZeros(utils, 'digit', 'month', 'MM');
167
- const response = getNewSectionValue(queryValue, {
168
- type: activeSection.type,
169
- format: 'MM',
170
- hasLeadingZerosInFormat,
171
- hasLeadingZerosInInput: true,
172
- contentType: 'digit',
173
- maxLength: 2
175
+ const response = getNewSectionValue({
176
+ queryValue,
177
+ skipIfBelowMinimum: true,
178
+ section: {
179
+ type: activeSection.type,
180
+ format: 'MM',
181
+ hasLeadingZerosInFormat,
182
+ hasLeadingZerosInInput: true,
183
+ contentType: 'digit',
184
+ maxLength: 2
185
+ }
174
186
  });
175
187
  if (isQueryResponseWithoutValue(response)) {
176
188
  return response;
@@ -184,7 +196,11 @@ export const useFieldCharacterEditing = ({
184
196
  // When editing a letter-format weekDay and the user presses a digit,
185
197
  // We can support the numeric editing by returning the nth day in the week day array.
186
198
  if (activeSection.type === 'weekDay') {
187
- const response = getNewSectionValue(queryValue, activeSection);
199
+ const response = getNewSectionValue({
200
+ queryValue,
201
+ skipIfBelowMinimum: true,
202
+ section: activeSection
203
+ });
188
204
  if (isQueryResponseWithoutValue(response)) {
189
205
  return response;
190
206
  }
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import useEventCallback from '@mui/utils/useEventCallback';
3
2
  /**
4
3
  * Generate the props to pass to the container element of each section of the field.
5
4
  * It is not used by the non-accessible DOM structure (with an <input /> element for editing).
@@ -17,14 +16,14 @@ export function useFieldSectionContainerProps(parameters) {
17
16
  disabled = false
18
17
  }
19
18
  } = parameters;
20
- const createHandleClick = useEventCallback(sectionIndex => event => {
19
+ const createHandleClick = React.useCallback(sectionIndex => event => {
21
20
  // The click event on the clear button would propagate to the input, trigger this handler and result in a wrong section selection.
22
21
  // We avoid this by checking if the call to this function is actually intended, or a side effect.
23
22
  if (disabled || event.isDefaultPrevented()) {
24
23
  return;
25
24
  }
26
25
  setSelectedSections(sectionIndex);
27
- });
26
+ }, [disabled, setSelectedSections]);
28
27
  return React.useCallback(sectionIndex => ({
29
28
  'data-sectionindex': sectionIndex,
30
29
  onClick: createHandleClick(sectionIndex)
@@ -128,12 +128,12 @@ export function useFieldSectionContentProps(parameters) {
128
128
  event.preventDefault();
129
129
  event.dataTransfer.dropEffect = 'none';
130
130
  });
131
- const createFocusHandler = useEventCallback(sectionIndex => () => {
131
+ const createFocusHandler = React.useCallback(sectionIndex => () => {
132
132
  if (disabled) {
133
133
  return;
134
134
  }
135
135
  setSelectedSections(sectionIndex);
136
- });
136
+ }, [disabled, setSelectedSections]);
137
137
  return React.useCallback((section, sectionIndex) => {
138
138
  const sectionBoundaries = sectionsValueBoundaries[section.type]({
139
139
  currentDate: fieldValueManager.getDateFromSection(value, section),
@@ -268,10 +268,10 @@ export const useFieldState = parameters => {
268
268
  }
269
269
 
270
270
  /**
271
- * If all the sections are filled but the date is invalid,
271
+ * If all the sections are filled but the date is invalid and the previous date is valid or null,
272
272
  * Then we publish an invalid date.
273
273
  */
274
- if (newActiveDateSections.every(sectionBis => sectionBis.value !== '')) {
274
+ if (newActiveDateSections.every(sectionBis => sectionBis.value !== '') && (activeDate == null || utils.isValid(activeDate))) {
275
275
  setSectionUpdateToApplyOnNextInvalidDate(newSectionValue);
276
276
  return publishValue(fieldValueManager.updateDateInValue(value, section, newActiveDate));
277
277
  }
@@ -91,6 +91,7 @@ export const useMobilePicker = _ref => {
91
91
  })]
92
92
  })
93
93
  }));
94
+ if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
94
95
  return {
95
96
  renderPicker
96
97
  };
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  export const PickerFieldPrivateContext = /*#__PURE__*/React.createContext(null);
3
+ if (process.env.NODE_ENV !== "production") PickerFieldPrivateContext.displayName = "PickerFieldPrivateContext";
3
4
  export function useNullableFieldPrivateContext() {
4
5
  return React.useContext(PickerFieldPrivateContext);
5
6
  }
@@ -63,6 +63,7 @@ export const useStaticPicker = _ref => {
63
63
  children: renderCurrentView()
64
64
  }))
65
65
  }));
66
+ if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
66
67
  return {
67
68
  renderPicker
68
69
  };