@mui/x-date-pickers 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 (252) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +6 -17
  2. package/AdapterDateFns/AdapterDateFns.js +9 -93
  3. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +6 -17
  4. package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +9 -93
  5. package/AdapterDayjs/AdapterDayjs.d.ts +7 -19
  6. package/AdapterDayjs/AdapterDayjs.js +13 -67
  7. package/AdapterLuxon/AdapterLuxon.d.ts +6 -17
  8. package/AdapterLuxon/AdapterLuxon.js +5 -96
  9. package/AdapterMoment/AdapterMoment.d.ts +6 -22
  10. package/AdapterMoment/AdapterMoment.js +11 -75
  11. package/AdapterMomentHijri/AdapterMomentHijri.d.ts +2 -9
  12. package/AdapterMomentHijri/AdapterMomentHijri.js +1 -33
  13. package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +2 -11
  14. package/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -43
  15. package/CHANGELOG.md +591 -5
  16. package/DateCalendar/DateCalendar.js +2 -9
  17. package/DateCalendar/DateCalendar.types.d.ts +0 -4
  18. package/DateCalendar/DayCalendar.d.ts +1 -2
  19. package/DateCalendar/DayCalendar.js +9 -16
  20. package/DateCalendar/dayCalendarClasses.d.ts +1 -1
  21. package/DateCalendar/dayCalendarClasses.js +1 -1
  22. package/DateCalendar/index.d.ts +1 -2
  23. package/DateCalendar/index.js +2 -4
  24. package/DateCalendar/useCalendarState.d.ts +1 -1
  25. package/DateCalendar/useCalendarState.js +1 -9
  26. package/DateField/DateField.js +1 -1
  27. package/DatePicker/DatePicker.js +1 -6
  28. package/DatePicker/shared.d.ts +1 -1
  29. package/DateTimeField/DateTimeField.js +1 -9
  30. package/DateTimePicker/DateTimePicker.js +1 -14
  31. package/DateTimePicker/shared.d.ts +1 -1
  32. package/DesktopDatePicker/DesktopDatePicker.js +1 -6
  33. package/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -14
  34. package/DesktopTimePicker/DesktopTimePicker.js +1 -9
  35. package/DigitalClock/DigitalClock.js +6 -17
  36. package/LocalizationProvider/LocalizationProvider.js +0 -6
  37. package/MobileDatePicker/MobileDatePicker.js +1 -6
  38. package/MobileDateTimePicker/MobileDateTimePicker.js +1 -14
  39. package/MobileTimePicker/MobileTimePicker.js +1 -9
  40. package/MonthCalendar/MonthCalendar.js +1 -1
  41. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
  42. package/PickersCalendarHeader/PickersCalendarHeader.js +11 -4
  43. package/PickersDay/PickersDay.js +1 -1
  44. package/StaticDatePicker/StaticDatePicker.js +1 -6
  45. package/StaticDateTimePicker/StaticDateTimePicker.js +1 -14
  46. package/StaticTimePicker/StaticTimePicker.js +1 -9
  47. package/TimeClock/Clock.js +1 -1
  48. package/TimeClock/TimeClock.js +3 -15
  49. package/TimeField/TimeField.js +1 -9
  50. package/TimePicker/TimePicker.js +1 -9
  51. package/TimePicker/shared.d.ts +1 -1
  52. package/YearCalendar/YearCalendar.js +2 -2
  53. package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -2
  54. package/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
  55. package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
  56. package/dateViewRenderers/dateViewRenderers.js +0 -2
  57. package/index.d.ts +1 -0
  58. package/index.js +4 -1
  59. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +5 -0
  60. package/internals/hooks/date-helpers-hooks.js +2 -2
  61. package/internals/hooks/useField/useField.utils.js +8 -9
  62. package/internals/hooks/useField/useFieldState.js +2 -2
  63. package/internals/hooks/usePicker/usePickerValue.types.d.ts +1 -1
  64. package/internals/hooks/useUtils.js +1 -1
  65. package/internals/hooks/useViews.js +2 -2
  66. package/internals/models/validation.d.ts +0 -8
  67. package/internals/utils/date-utils.js +2 -2
  68. package/internals/utils/getDefaultReferenceDate.d.ts +1 -2
  69. package/internals/utils/getDefaultReferenceDate.js +0 -4
  70. package/internals/utils/validation/extractValidationProps.d.ts +1 -1
  71. package/internals/utils/validation/extractValidationProps.js +1 -1
  72. package/internals/utils/validation/validateDate.js +1 -1
  73. package/internals/utils/validation/validateTime.js +1 -8
  74. package/legacy/AdapterDateFns/AdapterDateFns.js +13 -94
  75. package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +13 -94
  76. package/legacy/AdapterDayjs/AdapterDayjs.js +19 -69
  77. package/legacy/AdapterLuxon/AdapterLuxon.js +10 -97
  78. package/legacy/AdapterMoment/AdapterMoment.js +16 -78
  79. package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -33
  80. package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -43
  81. package/legacy/DateCalendar/DateCalendar.js +2 -9
  82. package/legacy/DateCalendar/DayCalendar.js +7 -11
  83. package/legacy/DateCalendar/PickersSlideTransition.js +8 -9
  84. package/legacy/DateCalendar/dayCalendarClasses.js +1 -1
  85. package/legacy/DateCalendar/index.js +2 -4
  86. package/legacy/DateCalendar/useCalendarState.js +1 -9
  87. package/legacy/DateField/DateField.js +1 -1
  88. package/legacy/DatePicker/DatePicker.js +1 -6
  89. package/legacy/DateTimeField/DateTimeField.js +1 -9
  90. package/legacy/DateTimePicker/DateTimePicker.js +1 -14
  91. package/legacy/DesktopDatePicker/DesktopDatePicker.js +1 -6
  92. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -14
  93. package/legacy/DesktopTimePicker/DesktopTimePicker.js +1 -9
  94. package/legacy/DigitalClock/DigitalClock.js +6 -17
  95. package/legacy/LocalizationProvider/LocalizationProvider.js +0 -6
  96. package/legacy/MobileDatePicker/MobileDatePicker.js +1 -6
  97. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +1 -14
  98. package/legacy/MobileTimePicker/MobileTimePicker.js +1 -9
  99. package/legacy/MonthCalendar/MonthCalendar.js +1 -1
  100. package/legacy/MonthCalendar/PickersMonth.js +4 -5
  101. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
  102. package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +11 -3
  103. package/legacy/PickersDay/PickersDay.js +6 -7
  104. package/legacy/PickersLayout/PickersLayout.js +5 -6
  105. package/legacy/StaticDatePicker/StaticDatePicker.js +1 -6
  106. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +1 -14
  107. package/legacy/StaticTimePicker/StaticTimePicker.js +1 -9
  108. package/legacy/TimeClock/Clock.js +1 -1
  109. package/legacy/TimeClock/ClockNumber.js +4 -5
  110. package/legacy/TimeClock/TimeClock.js +3 -15
  111. package/legacy/TimeField/TimeField.js +1 -9
  112. package/legacy/TimePicker/TimePicker.js +1 -9
  113. package/legacy/TimePicker/TimePickerToolbar.js +1 -2
  114. package/legacy/YearCalendar/PickersYear.js +4 -5
  115. package/legacy/YearCalendar/YearCalendar.js +2 -2
  116. package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
  117. package/legacy/dateViewRenderers/dateViewRenderers.js +0 -2
  118. package/legacy/index.js +4 -1
  119. package/legacy/internals/components/PickersModalDialog.js +3 -4
  120. package/legacy/internals/hooks/date-helpers-hooks.js +2 -2
  121. package/legacy/internals/hooks/useField/useField.utils.js +8 -9
  122. package/legacy/internals/hooks/useField/useFieldState.js +2 -2
  123. package/legacy/internals/hooks/useUtils.js +1 -1
  124. package/legacy/internals/hooks/useViews.js +2 -2
  125. package/legacy/internals/utils/date-utils.js +2 -2
  126. package/legacy/internals/utils/getDefaultReferenceDate.js +0 -6
  127. package/legacy/internals/utils/validation/extractValidationProps.js +1 -1
  128. package/legacy/internals/utils/validation/validateDate.js +1 -1
  129. package/legacy/internals/utils/validation/validateTime.js +1 -8
  130. package/legacy/locales/deDE.js +4 -3
  131. package/legacy/locales/index.js +1 -0
  132. package/legacy/locales/mk.js +91 -0
  133. package/legacy/timeViewRenderers/timeViewRenderers.js +0 -6
  134. package/locales/deDE.js +2 -3
  135. package/locales/index.d.ts +1 -0
  136. package/locales/index.js +1 -0
  137. package/locales/mk.d.ts +53 -0
  138. package/locales/mk.js +55 -0
  139. package/models/adapters.d.ts +16 -145
  140. package/models/fields.d.ts +0 -6
  141. package/models/timezone.d.ts +1 -1
  142. package/models/validation.d.ts +1 -1
  143. package/modern/AdapterDateFns/AdapterDateFns.js +9 -93
  144. package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +9 -93
  145. package/modern/AdapterDayjs/AdapterDayjs.js +13 -66
  146. package/modern/AdapterLuxon/AdapterLuxon.js +5 -96
  147. package/modern/AdapterMoment/AdapterMoment.js +11 -74
  148. package/modern/AdapterMomentHijri/AdapterMomentHijri.js +1 -33
  149. package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -43
  150. package/modern/DateCalendar/DateCalendar.js +2 -9
  151. package/modern/DateCalendar/DayCalendar.js +9 -15
  152. package/modern/DateCalendar/dayCalendarClasses.js +1 -1
  153. package/modern/DateCalendar/index.js +2 -4
  154. package/modern/DateCalendar/useCalendarState.js +1 -9
  155. package/modern/DateField/DateField.js +1 -1
  156. package/modern/DatePicker/DatePicker.js +1 -6
  157. package/modern/DateTimeField/DateTimeField.js +1 -9
  158. package/modern/DateTimePicker/DateTimePicker.js +1 -14
  159. package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -6
  160. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -14
  161. package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -9
  162. package/modern/DigitalClock/DigitalClock.js +6 -17
  163. package/modern/LocalizationProvider/LocalizationProvider.js +0 -6
  164. package/modern/MobileDatePicker/MobileDatePicker.js +1 -6
  165. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -14
  166. package/modern/MobileTimePicker/MobileTimePicker.js +1 -9
  167. package/modern/MonthCalendar/MonthCalendar.js +1 -1
  168. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
  169. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +11 -4
  170. package/modern/PickersDay/PickersDay.js +1 -1
  171. package/modern/StaticDatePicker/StaticDatePicker.js +1 -6
  172. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -14
  173. package/modern/StaticTimePicker/StaticTimePicker.js +1 -9
  174. package/modern/TimeClock/Clock.js +1 -1
  175. package/modern/TimeClock/TimeClock.js +3 -15
  176. package/modern/TimeField/TimeField.js +1 -9
  177. package/modern/TimePicker/TimePicker.js +1 -9
  178. package/modern/YearCalendar/YearCalendar.js +2 -2
  179. package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
  180. package/modern/dateViewRenderers/dateViewRenderers.js +0 -2
  181. package/modern/index.js +4 -1
  182. package/modern/internals/hooks/date-helpers-hooks.js +2 -2
  183. package/modern/internals/hooks/useField/useField.utils.js +8 -9
  184. package/modern/internals/hooks/useField/useFieldState.js +2 -2
  185. package/modern/internals/hooks/useUtils.js +1 -1
  186. package/modern/internals/hooks/useViews.js +2 -2
  187. package/modern/internals/utils/date-utils.js +2 -2
  188. package/modern/internals/utils/getDefaultReferenceDate.js +0 -1
  189. package/modern/internals/utils/validation/extractValidationProps.js +1 -1
  190. package/modern/internals/utils/validation/validateDate.js +1 -1
  191. package/modern/internals/utils/validation/validateTime.js +1 -8
  192. package/modern/locales/deDE.js +2 -3
  193. package/modern/locales/index.js +1 -0
  194. package/modern/locales/mk.js +55 -0
  195. package/modern/timeViewRenderers/timeViewRenderers.js +0 -6
  196. package/node/AdapterDateFns/AdapterDateFns.js +9 -93
  197. package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +9 -93
  198. package/node/AdapterDayjs/AdapterDayjs.js +13 -66
  199. package/node/AdapterLuxon/AdapterLuxon.js +5 -96
  200. package/node/AdapterMoment/AdapterMoment.js +11 -74
  201. package/node/AdapterMomentHijri/AdapterMomentHijri.js +1 -33
  202. package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -43
  203. package/node/DateCalendar/DateCalendar.js +2 -9
  204. package/node/DateCalendar/DayCalendar.js +9 -15
  205. package/node/DateCalendar/dayCalendarClasses.js +2 -2
  206. package/node/DateCalendar/index.js +3 -23
  207. package/node/DateCalendar/useCalendarState.js +1 -9
  208. package/node/DateField/DateField.js +1 -1
  209. package/node/DatePicker/DatePicker.js +1 -6
  210. package/node/DateTimeField/DateTimeField.js +1 -9
  211. package/node/DateTimePicker/DateTimePicker.js +1 -14
  212. package/node/DesktopDatePicker/DesktopDatePicker.js +1 -6
  213. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -14
  214. package/node/DesktopTimePicker/DesktopTimePicker.js +1 -9
  215. package/node/DigitalClock/DigitalClock.js +6 -17
  216. package/node/LocalizationProvider/LocalizationProvider.js +0 -6
  217. package/node/MobileDatePicker/MobileDatePicker.js +1 -6
  218. package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -14
  219. package/node/MobileTimePicker/MobileTimePicker.js +1 -9
  220. package/node/MonthCalendar/MonthCalendar.js +1 -1
  221. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
  222. package/node/PickersCalendarHeader/PickersCalendarHeader.js +11 -4
  223. package/node/PickersDay/PickersDay.js +1 -1
  224. package/node/StaticDatePicker/StaticDatePicker.js +1 -6
  225. package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -14
  226. package/node/StaticTimePicker/StaticTimePicker.js +1 -9
  227. package/node/TimeClock/Clock.js +1 -1
  228. package/node/TimeClock/TimeClock.js +3 -15
  229. package/node/TimeField/TimeField.js +1 -9
  230. package/node/TimePicker/TimePicker.js +1 -9
  231. package/node/YearCalendar/YearCalendar.js +2 -2
  232. package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
  233. package/node/dateViewRenderers/dateViewRenderers.js +0 -2
  234. package/node/index.js +13 -1
  235. package/node/internals/hooks/date-helpers-hooks.js +2 -2
  236. package/node/internals/hooks/useField/useField.utils.js +8 -9
  237. package/node/internals/hooks/useField/useFieldState.js +2 -2
  238. package/node/internals/hooks/useUtils.js +1 -1
  239. package/node/internals/hooks/useViews.js +2 -2
  240. package/node/internals/utils/date-utils.js +2 -2
  241. package/node/internals/utils/getDefaultReferenceDate.js +1 -3
  242. package/node/internals/utils/validation/extractValidationProps.js +1 -1
  243. package/node/internals/utils/validation/validateDate.js +1 -1
  244. package/node/internals/utils/validation/validateTime.js +1 -8
  245. package/node/locales/deDE.js +2 -3
  246. package/node/locales/index.js +11 -0
  247. package/node/locales/mk.js +60 -0
  248. package/node/timeViewRenderers/timeViewRenderers.js +0 -6
  249. package/package.json +7 -6
  250. package/themeAugmentation/overrides.d.ts +1 -1
  251. package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
  252. package/timeViewRenderers/timeViewRenderers.js +0 -6
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
- var _excluded = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone"],
4
+ var _excluded = ["slots", "slotProps", "currentMonth", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onMonthChange", "onViewChange", "view", "reduceAnimations", "views", "labelId", "className", "timezone", "format"],
5
5
  _excluded2 = ["ownerState"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
@@ -137,6 +137,8 @@ var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalend
137
137
  labelId = props.labelId,
138
138
  className = props.className,
139
139
  timezone = props.timezone,
140
+ _props$format = props.format,
141
+ format = _props$format === void 0 ? "".concat(utils.formats.month, " ").concat(utils.formats.year) : _props$format,
140
142
  other = _objectWithoutProperties(props, _excluded);
141
143
  var ownerState = props;
142
144
  var classes = useUtilityClasses(props);
@@ -196,6 +198,7 @@ var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalend
196
198
  if (views.length === 1 && views[0] === 'year') {
197
199
  return null;
198
200
  }
201
+ var label = utils.formatByString(month, format);
199
202
  return /*#__PURE__*/_jsxs(PickersCalendarHeaderRoot, _extends({}, other, {
200
203
  ownerState: ownerState,
201
204
  className: clsx(className, classes.root),
@@ -210,12 +213,12 @@ var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalend
210
213
  className: classes.labelContainer,
211
214
  children: [/*#__PURE__*/_jsx(PickersFadeTransitionGroup, {
212
215
  reduceAnimations: reduceAnimations,
213
- transKey: utils.format(month, 'monthAndYear'),
216
+ transKey: label,
214
217
  children: /*#__PURE__*/_jsx(PickersCalendarHeaderLabel, {
215
218
  id: labelId,
216
219
  ownerState: ownerState,
217
220
  className: classes.label,
218
- children: utils.format(month, 'monthAndYear')
221
+ children: label
219
222
  })
220
223
  }), views.length > 1 && !disabled && /*#__PURE__*/_jsx(SwitchViewButton, _extends({}, switchViewButtonProps, {
221
224
  children: /*#__PURE__*/_jsx(SwitchViewIcon, _extends({}, switchViewIconProps))
@@ -252,6 +255,11 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
252
255
  disabled: PropTypes.bool,
253
256
  disableFuture: PropTypes.bool,
254
257
  disablePast: PropTypes.bool,
258
+ /**
259
+ * Format used to display the date.
260
+ * @default `${adapter.formats.month} ${adapter.formats.year}`
261
+ */
262
+ format: PropTypes.string,
255
263
  labelId: PropTypes.string,
256
264
  maxDate: PropTypes.any.isRequired,
257
265
  minDate: PropTypes.any.isRequired,
@@ -29,10 +29,9 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
29
29
  return composeClasses(slots, getPickersDayUtilityClass, classes);
30
30
  };
31
31
  var styleArg = function styleArg(_ref) {
32
- var _extends2;
33
32
  var theme = _ref.theme,
34
33
  ownerState = _ref.ownerState;
35
- return _extends({}, theme.typography.caption, (_extends2 = {
34
+ return _extends({}, theme.typography.caption, _defineProperty(_defineProperty(_defineProperty({
36
35
  width: DAY_SIZE,
37
36
  height: DAY_SIZE,
38
37
  borderRadius: '50%',
@@ -54,7 +53,7 @@ var styleArg = function styleArg(_ref) {
54
53
  willChange: 'background-color',
55
54
  backgroundColor: (theme.vars || theme).palette.primary.dark
56
55
  })
57
- }, _defineProperty(_extends2, "&.".concat(pickersDayClasses.selected), {
56
+ }, "&.".concat(pickersDayClasses.selected), {
58
57
  color: (theme.vars || theme).palette.primary.contrastText,
59
58
  backgroundColor: (theme.vars || theme).palette.primary.main,
60
59
  fontWeight: theme.typography.fontWeightMedium,
@@ -62,11 +61,11 @@ var styleArg = function styleArg(_ref) {
62
61
  willChange: 'background-color',
63
62
  backgroundColor: (theme.vars || theme).palette.primary.dark
64
63
  }
65
- }), _defineProperty(_extends2, "&.".concat(pickersDayClasses.disabled, ":not(.").concat(pickersDayClasses.selected, ")"), {
64
+ }), "&.".concat(pickersDayClasses.disabled, ":not(.").concat(pickersDayClasses.selected, ")"), {
66
65
  color: (theme.vars || theme).palette.text.disabled
67
- }), _defineProperty(_extends2, "&.".concat(pickersDayClasses.disabled, "&.").concat(pickersDayClasses.selected), {
66
+ }), "&.".concat(pickersDayClasses.disabled, "&.").concat(pickersDayClasses.selected), {
68
67
  opacity: 0.6
69
- }), _extends2), !ownerState.disableMargin && {
68
+ }), !ownerState.disableMargin && {
70
69
  margin: "0 ".concat(DAY_MARGIN, "px")
71
70
  }, ownerState.outsideCurrentMonth && ownerState.showDaysOutsideCurrentMonth && {
72
71
  color: (theme.vars || theme).palette.text.secondary
@@ -163,7 +162,7 @@ var PickersDayRaw = /*#__PURE__*/React.forwardRef(function PickersDay(inProps, f
163
162
  }
164
163
  }, [autoFocus, disabled, isAnimating, outsideCurrentMonth]);
165
164
 
166
- // For day outside of current month, move focus from mouseDown to mouseUp
165
+ // For a day outside the current month, move the focus from mouseDown to mouseUp
167
166
  // Goal: have the onClick ends before sliding to the new month
168
167
  var handleMouseDown = function handleMouseDown(event) {
169
168
  onMouseDown(event);
@@ -24,29 +24,28 @@ var PickersLayoutRoot = styled('div', {
24
24
  return styles.root;
25
25
  }
26
26
  })(function (_ref) {
27
- var _ref2;
28
27
  var theme = _ref.theme,
29
28
  ownerState = _ref.ownerState;
30
- return _ref2 = {
29
+ return _defineProperty(_defineProperty(_defineProperty({
31
30
  display: 'grid',
32
31
  gridAutoColumns: 'max-content auto max-content',
33
32
  gridAutoRows: 'max-content auto max-content'
34
- }, _defineProperty(_ref2, "& .".concat(pickersLayoutClasses.toolbar), ownerState.isLandscape ? {
33
+ }, "& .".concat(pickersLayoutClasses.toolbar), ownerState.isLandscape ? {
35
34
  gridColumn: theme.direction === 'rtl' ? 3 : 1,
36
35
  gridRow: '2 / 3'
37
36
  } : {
38
37
  gridColumn: '2 / 4',
39
38
  gridRow: 1
40
- }), _defineProperty(_ref2, ".".concat(pickersLayoutClasses.shortcuts), ownerState.isLandscape ? {
39
+ }), ".".concat(pickersLayoutClasses.shortcuts), ownerState.isLandscape ? {
41
40
  gridColumn: '2 / 4',
42
41
  gridRow: 1
43
42
  } : {
44
43
  gridColumn: theme.direction === 'rtl' ? 3 : 1,
45
44
  gridRow: '2 / 3'
46
- }), _defineProperty(_ref2, "& .".concat(pickersLayoutClasses.actionBar), {
45
+ }), "& .".concat(pickersLayoutClasses.actionBar), {
47
46
  gridColumn: '1 / 4',
48
47
  gridRow: 3
49
- }), _ref2;
48
+ });
50
49
  });
51
50
  PickersLayoutRoot.propTypes = {
52
51
  // ----------------------------- Warning --------------------------------
@@ -65,16 +65,11 @@ StaticDatePicker.propTypes = {
65
65
  className: PropTypes.string,
66
66
  /**
67
67
  * Formats the day of week displayed in the calendar header.
68
- * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
69
68
  * @param {TDate} date The date of the day of week provided by the adapter.
70
69
  * @returns {string} The name to display.
71
70
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
72
71
  */
73
72
  dayOfWeekFormatter: PropTypes.func,
74
- /**
75
- * Default calendar month displayed when `value` and `defaultValue` are empty.
76
- */
77
- defaultCalendarMonth: PropTypes.any,
78
73
  /**
79
74
  * The default value.
80
75
  * Used when the component is not controlled.
@@ -267,7 +262,7 @@ StaticDatePicker.propTypes = {
267
262
  * Choose which timezone to use for the value.
268
263
  * Example: "default", "system", "UTC", "America/New_York".
269
264
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
270
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
265
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
271
266
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
272
267
  */
273
268
  timezone: PropTypes.string,
@@ -85,16 +85,11 @@ StaticDateTimePicker.propTypes = {
85
85
  className: PropTypes.string,
86
86
  /**
87
87
  * Formats the day of week displayed in the calendar header.
88
- * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
89
88
  * @param {TDate} date The date of the day of week provided by the adapter.
90
89
  * @returns {string} The name to display.
91
90
  * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
92
91
  */
93
92
  dayOfWeekFormatter: PropTypes.func,
94
- /**
95
- * Default calendar month displayed when `value` and `defaultValue` are empty.
96
- */
97
- defaultCalendarMonth: PropTypes.any,
98
93
  /**
99
94
  * The default value.
100
95
  * Used when the component is not controlled.
@@ -262,14 +257,6 @@ StaticDateTimePicker.propTypes = {
262
257
  * @default () => <span data-mui-test="loading-progress">...</span>
263
258
  */
264
259
  renderLoading: PropTypes.func,
265
- /**
266
- * Disable specific clock time.
267
- * @param {number} clockValue The value to check.
268
- * @param {TimeView} view The clock type of the timeValue.
269
- * @returns {boolean} If `true` the time will be disabled.
270
- * @deprecated Consider using `shouldDisableTime`.
271
- */
272
- shouldDisableClock: PropTypes.func,
273
260
  /**
274
261
  * Disable specific date.
275
262
  *
@@ -331,7 +318,7 @@ StaticDateTimePicker.propTypes = {
331
318
  * Choose which timezone to use for the value.
332
319
  * Example: "default", "system", "UTC", "America/New_York".
333
320
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
334
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
321
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
335
322
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
336
323
  */
337
324
  timezone: PropTypes.string,
@@ -182,14 +182,6 @@ StaticTimePicker.propTypes = {
182
182
  * @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
183
183
  */
184
184
  referenceDate: PropTypes.any,
185
- /**
186
- * Disable specific clock time.
187
- * @param {number} clockValue The value to check.
188
- * @param {TimeView} view The clock type of the timeValue.
189
- * @returns {boolean} If `true` the time will be disabled.
190
- * @deprecated Consider using `shouldDisableTime`.
191
- */
192
- shouldDisableClock: PropTypes.func,
193
185
  /**
194
186
  * Disable specific time.
195
187
  * @template TDate
@@ -216,7 +208,7 @@ StaticTimePicker.propTypes = {
216
208
  * Choose which timezone to use for the value.
217
209
  * Example: "default", "system", "UTC", "America/New_York".
218
210
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
219
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
211
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
220
212
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
221
213
  */
222
214
  timezone: PropTypes.string,
@@ -273,7 +273,7 @@ export function Clock(inProps) {
273
273
  }
274
274
  switch (event.key) {
275
275
  case 'Home':
276
- // annulate both hours and minutes
276
+ // reset both hours and minutes
277
277
  handleValueChange(0, 'partial');
278
278
  event.preventDefault();
279
279
  break;
@@ -25,10 +25,9 @@ var ClockNumberRoot = styled('span', {
25
25
  return [styles.root, _defineProperty({}, "&.".concat(clockNumberClasses.disabled), styles.disabled), _defineProperty({}, "&.".concat(clockNumberClasses.selected), styles.selected)];
26
26
  }
27
27
  })(function (_ref3) {
28
- var _extends2;
29
28
  var theme = _ref3.theme,
30
29
  ownerState = _ref3.ownerState;
31
- return _extends((_extends2 = {
30
+ return _extends(_defineProperty(_defineProperty({
32
31
  height: CLOCK_HOUR_WIDTH,
33
32
  width: CLOCK_HOUR_WIDTH,
34
33
  position: 'absolute',
@@ -42,12 +41,12 @@ var ClockNumberRoot = styled('span', {
42
41
  '&:focused': {
43
42
  backgroundColor: (theme.vars || theme).palette.background.paper
44
43
  }
45
- }, _defineProperty(_extends2, "&.".concat(clockNumberClasses.selected), {
44
+ }, "&.".concat(clockNumberClasses.selected), {
46
45
  color: (theme.vars || theme).palette.primary.contrastText
47
- }), _defineProperty(_extends2, "&.".concat(clockNumberClasses.disabled), {
46
+ }), "&.".concat(clockNumberClasses.disabled), {
48
47
  pointerEvents: 'none',
49
48
  color: (theme.vars || theme).palette.text.disabled
50
- }), _extends2), ownerState.inner && _extends({}, theme.typography.body2, {
49
+ }), ownerState.inner && _extends({}, theme.typography.body2, {
51
50
  color: (theme.vars || theme).palette.text.secondary
52
51
  }));
53
52
  });
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableClock", "shouldDisableTime", "showViewSwitcher", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "timezone"];
3
+ var _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "showViewSwitcher", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "timezone"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import PropTypes from 'prop-types';
@@ -86,7 +86,6 @@ export var TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProps,
86
86
  disablePast = props.disablePast,
87
87
  _props$minutesStep = props.minutesStep,
88
88
  minutesStep = _props$minutesStep === void 0 ? 1 : _props$minutesStep,
89
- shouldDisableClock = props.shouldDisableClock,
90
89
  shouldDisableTime = props.shouldDisableTime,
91
90
  showViewSwitcher = props.showViewSwitcher,
92
91
  onChange = props.onChange,
@@ -164,9 +163,6 @@ export var TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProps,
164
163
  if (timeValue % step !== 0) {
165
164
  return false;
166
165
  }
167
- if (shouldDisableClock != null && shouldDisableClock(timeValue, viewType)) {
168
- return false;
169
- }
170
166
  if (shouldDisableTime) {
171
167
  switch (viewType) {
172
168
  case 'hours':
@@ -216,7 +212,7 @@ export var TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProps,
216
212
  default:
217
213
  throw new Error('not supported');
218
214
  }
219
- }, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableClock, shouldDisableTime, utils, disableFuture, disablePast, now, views]);
215
+ }, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableTime, utils, disableFuture, disablePast, now, views]);
220
216
  var selectedId = useId();
221
217
  var viewProps = React.useMemo(function () {
222
218
  switch (view) {
@@ -434,14 +430,6 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
434
430
  * @default The closest valid time using the validation props, except callbacks such as `shouldDisableTime`.
435
431
  */
436
432
  referenceDate: PropTypes.any,
437
- /**
438
- * Disable specific clock time.
439
- * @param {number} clockValue The value to check.
440
- * @param {TimeView} view The clock type of the timeValue.
441
- * @returns {boolean} If `true` the time will be disabled.
442
- * @deprecated Consider using `shouldDisableTime`.
443
- */
444
- shouldDisableClock: PropTypes.func,
445
433
  /**
446
434
  * Disable specific time.
447
435
  * @template TDate
@@ -469,7 +457,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
469
457
  * Choose which timezone to use for the value.
470
458
  * Example: "default", "system", "UTC", "America/New_York".
471
459
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
472
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
460
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
473
461
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
474
462
  */
475
463
  timezone: PropTypes.string,
@@ -280,14 +280,6 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
280
280
  endIndex: PropTypes.number.isRequired,
281
281
  startIndex: PropTypes.number.isRequired
282
282
  })]),
283
- /**
284
- * Disable specific clock time.
285
- * @param {number} clockValue The value to check.
286
- * @param {TimeView} view The clock type of the timeValue.
287
- * @returns {boolean} If `true` the time will be disabled.
288
- * @deprecated Consider using `shouldDisableTime`.
289
- */
290
- shouldDisableClock: PropTypes.func,
291
283
  /**
292
284
  * Disable specific time.
293
285
  * @template TDate
@@ -334,7 +326,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
334
326
  * Choose which timezone to use for the value.
335
327
  * Example: "default", "system", "UTC", "America/New_York".
336
328
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
337
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
329
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
338
330
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
339
331
  */
340
332
  timezone: PropTypes.string,
@@ -232,14 +232,6 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
232
232
  endIndex: PropTypes.number.isRequired,
233
233
  startIndex: PropTypes.number.isRequired
234
234
  })]),
235
- /**
236
- * Disable specific clock time.
237
- * @param {number} clockValue The value to check.
238
- * @param {TimeView} view The clock type of the timeValue.
239
- * @returns {boolean} If `true` the time will be disabled.
240
- * @deprecated Consider using `shouldDisableTime`.
241
- */
242
- shouldDisableClock: PropTypes.func,
243
235
  /**
244
236
  * Disable specific time.
245
237
  * @template TDate
@@ -287,7 +279,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
287
279
  * Choose which timezone to use for the value.
288
280
  * Example: "default", "system", "UTC", "America/New_York".
289
281
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
290
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
282
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
291
283
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
292
284
  */
293
285
  timezone: PropTypes.string,
@@ -51,8 +51,7 @@ var TimePickerToolbarHourMinuteLabel = styled('div', {
51
51
  name: 'MuiTimePickerToolbar',
52
52
  slot: 'HourMinuteLabel',
53
53
  overridesResolver: function overridesResolver(props, styles) {
54
- var _ref;
55
- return [(_ref = {}, _defineProperty(_ref, "&.".concat(timePickerToolbarClasses.hourMinuteLabelLandscape), styles.hourMinuteLabelLandscape), _defineProperty(_ref, "&.".concat(timePickerToolbarClasses.hourMinuteLabelReverse), styles.hourMinuteLabelReverse), _ref), styles.hourMinuteLabel];
54
+ return [_defineProperty(_defineProperty({}, "&.".concat(timePickerToolbarClasses.hourMinuteLabelLandscape), styles.hourMinuteLabelLandscape), "&.".concat(timePickerToolbarClasses.hourMinuteLabelReverse), styles.hourMinuteLabelReverse), styles.hourMinuteLabel];
56
55
  }
57
56
  })(function (_ref2) {
58
57
  var theme = _ref2.theme,
@@ -40,14 +40,13 @@ var PickersYearButton = styled('button', {
40
40
  return [styles.yearButton, _defineProperty({}, "&.".concat(pickersYearClasses.disabled), styles.disabled), _defineProperty({}, "&.".concat(pickersYearClasses.selected), styles.selected)];
41
41
  }
42
42
  })(function (_ref4) {
43
- var _extends2;
44
43
  var theme = _ref4.theme;
45
44
  return _extends({
46
45
  color: 'unset',
47
46
  backgroundColor: 'transparent',
48
47
  border: 0,
49
48
  outline: 0
50
- }, theme.typography.subtitle1, (_extends2 = {
49
+ }, theme.typography.subtitle1, _defineProperty(_defineProperty({
51
50
  margin: '6px 0',
52
51
  height: 36,
53
52
  width: 72,
@@ -63,15 +62,15 @@ var PickersYearButton = styled('button', {
63
62
  cursor: 'auto',
64
63
  pointerEvents: 'none'
65
64
  }
66
- }, _defineProperty(_extends2, "&.".concat(pickersYearClasses.disabled), {
65
+ }, "&.".concat(pickersYearClasses.disabled), {
67
66
  color: (theme.vars || theme).palette.text.secondary
68
- }), _defineProperty(_extends2, "&.".concat(pickersYearClasses.selected), {
67
+ }), "&.".concat(pickersYearClasses.selected), {
69
68
  color: (theme.vars || theme).palette.primary.contrastText,
70
69
  backgroundColor: (theme.vars || theme).palette.primary.main,
71
70
  '&:focus, &:hover': {
72
71
  backgroundColor: (theme.vars || theme).palette.primary.dark
73
72
  }
74
- }), _extends2));
73
+ }));
75
74
  });
76
75
 
77
76
  /**
@@ -248,7 +248,7 @@ export var YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(in
248
248
  role: "radiogroup",
249
249
  "aria-labelledby": gridLabelId
250
250
  }, other, {
251
- children: utils.getYearRange(minDate, maxDate).map(function (year) {
251
+ children: utils.getYearRange([minDate, maxDate]).map(function (year) {
252
252
  var yearNumber = utils.getYear(year);
253
253
  var isSelected = yearNumber === selectedYear;
254
254
  var isDisabled = disabled || isYearDisabled(year);
@@ -349,7 +349,7 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
349
349
  * Choose which timezone to use for the value.
350
350
  * Example: "default", "system", "UTC", "America/New_York".
351
351
  * If you pass values from other timezones to some props, they will be converted to this timezone before being used.
352
- * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documention} for more details.
352
+ * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
353
353
  * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
354
354
  */
355
355
  timezone: PropTypes.string,
@@ -36,7 +36,6 @@ export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref)
36
36
  shouldDisableMonth = _ref.shouldDisableMonth,
37
37
  shouldDisableYear = _ref.shouldDisableYear,
38
38
  shouldDisableTime = _ref.shouldDisableTime,
39
- shouldDisableClock = _ref.shouldDisableClock,
40
39
  reduceAnimations = _ref.reduceAnimations,
41
40
  minutesStep = _ref.minutesStep,
42
41
  ampm = _ref.ampm,
@@ -44,7 +43,6 @@ export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref)
44
43
  monthsPerRow = _ref.monthsPerRow,
45
44
  onYearChange = _ref.onYearChange,
46
45
  yearsPerRow = _ref.yearsPerRow,
47
- defaultCalendarMonth = _ref.defaultCalendarMonth,
48
46
  slots = _ref.slots,
49
47
  slotProps = _ref.slotProps,
50
48
  loading = _ref.loading,
@@ -82,7 +80,6 @@ export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref)
82
80
  minTime: minTime,
83
81
  maxTime: maxTime,
84
82
  shouldDisableTime: shouldDisableTime,
85
- shouldDisableClock: shouldDisableClock,
86
83
  minutesStep: minutesStep,
87
84
  ampm: ampm,
88
85
  slots: slots,
@@ -121,7 +118,6 @@ export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref)
121
118
  monthsPerRow: monthsPerRow,
122
119
  onYearChange: onYearChange,
123
120
  yearsPerRow: yearsPerRow,
124
- defaultCalendarMonth: defaultCalendarMonth,
125
121
  slots: slots,
126
122
  slotProps: slotProps,
127
123
  loading: loading,
@@ -26,7 +26,6 @@ export var renderDateViewCalendar = function renderDateViewCalendar(_ref) {
26
26
  monthsPerRow = _ref.monthsPerRow,
27
27
  onYearChange = _ref.onYearChange,
28
28
  yearsPerRow = _ref.yearsPerRow,
29
- defaultCalendarMonth = _ref.defaultCalendarMonth,
30
29
  slots = _ref.slots,
31
30
  slotProps = _ref.slotProps,
32
31
  loading = _ref.loading,
@@ -65,7 +64,6 @@ export var renderDateViewCalendar = function renderDateViewCalendar(_ref) {
65
64
  monthsPerRow: monthsPerRow,
66
65
  onYearChange: onYearChange,
67
66
  yearsPerRow: yearsPerRow,
68
- defaultCalendarMonth: defaultCalendarMonth,
69
67
  slots: slots,
70
68
  slotProps: slotProps,
71
69
  loading: loading,
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v7.0.0-alpha.0
2
+ * @mui/x-date-pickers v7.0.0-alpha.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -46,6 +46,9 @@ export * from './timeViewRenderers';
46
46
  export * from './PickersLayout';
47
47
  export * from './PickersActionBar';
48
48
  export * from './PickersShortcuts';
49
+
50
+ // Other slots
51
+ export * from './PickersCalendarHeader';
49
52
  export { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from './internals/utils/utils';
50
53
  export * from './models';
51
54
  export * from './icons';
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
- var _styled;
4
3
  import * as React from 'react';
5
4
  import DialogContent from '@mui/material/DialogContent';
6
5
  import Fade from '@mui/material/Fade';
@@ -8,12 +7,12 @@ import MuiDialog, { dialogClasses } from '@mui/material/Dialog';
8
7
  import { styled } from '@mui/material/styles';
9
8
  import { DIALOG_WIDTH } from '../constants/dimensions';
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
11
- var PickersModalDialogRoot = styled(MuiDialog)((_styled = {}, _defineProperty(_styled, "& .".concat(dialogClasses.container), {
10
+ var PickersModalDialogRoot = styled(MuiDialog)(_defineProperty(_defineProperty({}, "& .".concat(dialogClasses.container), {
12
11
  outline: 0
13
- }), _defineProperty(_styled, "& .".concat(dialogClasses.paper), {
12
+ }), "& .".concat(dialogClasses.paper), {
14
13
  outline: 0,
15
14
  minWidth: DIALOG_WIDTH
16
- }), _styled));
15
+ }));
17
16
  var PickersModalDialogContent = styled(DialogContent)({
18
17
  '&:first-of-type': {
19
18
  padding: 0
@@ -7,7 +7,7 @@ export function useNextMonthDisabled(month, _ref) {
7
7
  timezone = _ref.timezone;
8
8
  var utils = useUtils();
9
9
  return React.useMemo(function () {
10
- var now = utils.dateWithTimezone(undefined, timezone);
10
+ var now = utils.date(undefined, timezone);
11
11
  var lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, maxDate) ? now : maxDate);
12
12
  return !utils.isAfter(lastEnabledMonth, month);
13
13
  }, [disableFuture, maxDate, month, utils, timezone]);
@@ -18,7 +18,7 @@ export function usePreviousMonthDisabled(month, _ref2) {
18
18
  timezone = _ref2.timezone;
19
19
  var utils = useUtils();
20
20
  return React.useMemo(function () {
21
- var now = utils.dateWithTimezone(undefined, timezone);
21
+ var now = utils.date(undefined, timezone);
22
22
  var firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, minDate) ? now : minDate);
23
23
  return !utils.isBefore(firstEnabledMonth, month);
24
24
  }, [disablePast, minDate, month, utils, timezone]);
@@ -35,7 +35,7 @@ var getDeltaFromKeyCode = function getDeltaFromKeyCode(keyCode) {
35
35
  };
36
36
  export var getDaysInWeekStr = function getDaysInWeekStr(utils, timezone, format) {
37
37
  var elements = [];
38
- var now = utils.dateWithTimezone(undefined, timezone);
38
+ var now = utils.date(undefined, timezone);
39
39
  var startDate = utils.startOfWeek(now);
40
40
  var endDate = utils.endOfWeek(now);
41
41
  var current = startDate;
@@ -51,7 +51,7 @@ export var getLetterEditingOptions = function getLetterEditingOptions(utils, tim
51
51
  switch (sectionType) {
52
52
  case 'month':
53
53
  {
54
- return getMonthsInYear(utils, utils.dateWithTimezone(undefined, timezone)).map(function (month) {
54
+ return getMonthsInYear(utils, utils.date(undefined, timezone)).map(function (month) {
55
55
  return utils.formatByString(month, format);
56
56
  });
57
57
  }
@@ -61,7 +61,7 @@ export var getLetterEditingOptions = function getLetterEditingOptions(utils, tim
61
61
  }
62
62
  case 'meridiem':
63
63
  {
64
- var now = utils.dateWithTimezone(undefined, timezone);
64
+ var now = utils.date(undefined, timezone);
65
65
  return [utils.startOfDay(now), utils.endOfDay(now)].map(function (date) {
66
66
  return utils.formatByString(date, format);
67
67
  });
@@ -121,7 +121,7 @@ export var adjustSectionValue = function adjustSectionValue(utils, timezone, sec
121
121
  var newSectionValueNumber = currentSectionValue + delta * step;
122
122
  if (shouldSetAbsolute) {
123
123
  if (section.type === 'year' && !isEnd && !isStart) {
124
- return utils.formatByString(utils.dateWithTimezone(undefined, timezone), section.format);
124
+ return utils.formatByString(utils.date(undefined, timezone), section.format);
125
125
  }
126
126
  if (delta > 0 || isStart) {
127
127
  newSectionValueNumber = sectionBoundaries.minimum;
@@ -222,7 +222,7 @@ var getSectionPlaceholder = function getSectionPlaceholder(utils, timezone, loca
222
222
  case 'year':
223
223
  {
224
224
  return localeText.fieldYearPlaceholder({
225
- digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone), currentTokenValue).length
225
+ digitAmount: utils.formatByString(utils.date(undefined, timezone), currentTokenValue).length
226
226
  });
227
227
  }
228
228
  case 'month':
@@ -272,13 +272,13 @@ export var changeSectionValueFormat = function changeSectionValueFormat(utils, v
272
272
  return utils.formatByString(utils.parse(valueStr, currentFormat), newFormat);
273
273
  };
274
274
  var isFourDigitYearFormat = function isFourDigitYearFormat(utils, timezone, format) {
275
- return utils.formatByString(utils.dateWithTimezone(undefined, timezone), format).length === 4;
275
+ return utils.formatByString(utils.date(undefined, timezone), format).length === 4;
276
276
  };
277
277
  export var doesSectionFormatHaveLeadingZeros = function doesSectionFormatHaveLeadingZeros(utils, timezone, contentType, sectionType, format) {
278
278
  if (contentType !== 'digit') {
279
279
  return false;
280
280
  }
281
- var now = utils.dateWithTimezone(undefined, timezone);
281
+ var now = utils.date(undefined, timezone);
282
282
  switch (sectionType) {
283
283
  // We can't use `changeSectionValueFormat`, because `utils.parse('1', 'YYYY')` returns `1971` instead of `1`.
284
284
  case 'year':
@@ -368,7 +368,6 @@ export var splitFormatIntoSections = function splitFormatIntoSections(utils, tim
368
368
  maxLength: maxLength,
369
369
  value: sectionValue,
370
370
  placeholder: getSectionPlaceholder(utils, timezone, localeText, sectionConfig, token),
371
- hasLeadingZeros: hasLeadingZerosInFormat,
372
371
  hasLeadingZerosInFormat: hasLeadingZerosInFormat,
373
372
  hasLeadingZerosInInput: hasLeadingZerosInInput,
374
373
  startSeparator: sections.length === 0 ? startSeparator : '',
@@ -494,7 +493,7 @@ export var createDateStrForInputFromSections = function createDateStrForInputFro
494
493
  return "\u2066".concat(dateStr, "\u2069");
495
494
  };
496
495
  export var getSectionsBoundaries = function getSectionsBoundaries(utils, timezone) {
497
- var today = utils.dateWithTimezone(undefined, timezone);
496
+ var today = utils.date(undefined, timezone);
498
497
  var endOfYear = utils.endOfYear(today);
499
498
  var endOfDay = utils.endOfDay(today);
500
499
  var _getMonthsInYear$redu = getMonthsInYear(utils, today).reduce(function (acc, month) {
@@ -178,7 +178,7 @@ export var useFieldState = function useFieldState(params) {
178
178
  }).length;
179
179
  var hasNoOtherNonEmptySections = nonEmptySectionCountBefore === (activeSection.value === '' ? 0 : 1);
180
180
  var newSections = setSectionValue(selectedSectionIndexes.startIndex, '');
181
- var newActiveDate = hasNoOtherNonEmptySections ? null : utils.date(new Date(''));
181
+ var newActiveDate = hasNoOtherNonEmptySections ? null : utils.getInvalidDate();
182
182
  var newValues = activeDateManager.getNewValuesFromNewActiveDate(newActiveDate);
183
183
  if ((newActiveDate != null && !utils.isValid(newActiveDate)) !== (activeDateManager.date != null && !utils.isValid(activeDateManager.date))) {
184
184
  publishValue(_extends({}, newValues, {
@@ -280,7 +280,7 @@ export var useFieldState = function useFieldState(params) {
280
280
  }, [format, utils.locale]); // eslint-disable-line react-hooks/exhaustive-deps
281
281
 
282
282
  React.useEffect(function () {
283
- var shouldUpdate = false;
283
+ var shouldUpdate;
284
284
  if (!valueManager.areValuesEqual(utils, state.value, valueFromTheOutside)) {
285
285
  shouldUpdate = true;
286
286
  } else {