@mui/x-date-pickers 6.6.0 → 6.8.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 (194) hide show
  1. package/AdapterDateFns/AdapterDateFns.js +20 -19
  2. package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +17 -16
  3. package/AdapterDayjs/AdapterDayjs.js +12 -11
  4. package/AdapterLuxon/AdapterLuxon.js +20 -19
  5. package/AdapterMoment/AdapterMoment.js +12 -11
  6. package/AdapterMomentHijri/AdapterMomentHijri.js +20 -19
  7. package/AdapterMomentJalaali/AdapterMomentJalaali.js +20 -19
  8. package/CHANGELOG.md +147 -13
  9. package/DateCalendar/DateCalendar.js +16 -6
  10. package/DateCalendar/DateCalendar.types.d.ts +6 -1
  11. package/DateCalendar/useCalendarState.d.ts +3 -2
  12. package/DateCalendar/useCalendarState.js +36 -15
  13. package/DateField/DateField.js +1 -1
  14. package/DatePicker/DatePicker.js +1 -1
  15. package/DatePicker/DatePickerToolbar.js +6 -15
  16. package/DatePicker/shared.d.ts +1 -5
  17. package/DatePicker/shared.js +1 -16
  18. package/DateTimeField/DateTimeField.js +1 -1
  19. package/DateTimePicker/DateTimePicker.js +1 -1
  20. package/DesktopDatePicker/DesktopDatePicker.js +4 -3
  21. package/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -2
  22. package/DesktopTimePicker/DesktopTimePicker.js +5 -1
  23. package/LocalizationProvider/LocalizationProvider.js +1 -0
  24. package/MobileDatePicker/MobileDatePicker.js +4 -3
  25. package/MobileDateTimePicker/MobileDateTimePicker.js +6 -2
  26. package/MobileTimePicker/MobileTimePicker.js +5 -1
  27. package/MonthCalendar/MonthCalendar.js +28 -11
  28. package/MonthCalendar/MonthCalendar.types.d.ts +5 -0
  29. package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +1 -1
  30. package/PickersLayout/PickersLayout.js +1 -0
  31. package/PickersLayout/usePickerLayout.js +4 -3
  32. package/PickersShortcuts/PickersShortcuts.d.ts +12 -2
  33. package/PickersShortcuts/PickersShortcuts.js +10 -2
  34. package/PickersShortcuts/index.d.ts +1 -1
  35. package/StaticDatePicker/StaticDatePicker.js +1 -1
  36. package/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
  37. package/TimeField/TimeField.js +1 -1
  38. package/TimePicker/shared.d.ts +1 -1
  39. package/YearCalendar/YearCalendar.js +26 -9
  40. package/YearCalendar/YearCalendar.types.d.ts +5 -0
  41. package/index.js +1 -1
  42. package/internals/hooks/useField/useField.types.d.ts +1 -1
  43. package/internals/hooks/useField/useFieldState.js +0 -1
  44. package/internals/hooks/usePicker/usePickerValue.js +22 -2
  45. package/internals/hooks/usePicker/usePickerValue.types.d.ts +6 -2
  46. package/internals/utils/date-time-utils.d.ts +6 -0
  47. package/internals/utils/date-time-utils.js +41 -0
  48. package/internals/utils/date-utils.d.ts +5 -2
  49. package/internals/utils/date-utils.js +33 -10
  50. package/internals/utils/getDefaultReferenceDate.d.ts +11 -3
  51. package/internals/utils/getDefaultReferenceDate.js +2 -3
  52. package/internals/utils/time-utils.d.ts +6 -1
  53. package/internals/utils/time-utils.js +27 -0
  54. package/internals/utils/validation/extractValidationProps.d.ts +1 -1
  55. package/internals/utils/views.d.ts +2 -3
  56. package/internals/utils/views.js +6 -2
  57. package/legacy/AdapterDateFns/AdapterDateFns.js +20 -19
  58. package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +17 -16
  59. package/legacy/AdapterDayjs/AdapterDayjs.js +12 -11
  60. package/legacy/AdapterLuxon/AdapterLuxon.js +20 -19
  61. package/legacy/AdapterMoment/AdapterMoment.js +12 -11
  62. package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +20 -19
  63. package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +20 -19
  64. package/legacy/DateCalendar/DateCalendar.js +16 -6
  65. package/legacy/DateCalendar/useCalendarState.js +35 -15
  66. package/legacy/DateField/DateField.js +1 -1
  67. package/legacy/DatePicker/DatePicker.js +1 -1
  68. package/legacy/DatePicker/DatePickerToolbar.js +6 -15
  69. package/legacy/DatePicker/shared.js +1 -15
  70. package/legacy/DateTimeField/DateTimeField.js +1 -1
  71. package/legacy/DateTimePicker/DateTimePicker.js +1 -1
  72. package/legacy/DesktopDatePicker/DesktopDatePicker.js +4 -3
  73. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -2
  74. package/legacy/DesktopTimePicker/DesktopTimePicker.js +5 -1
  75. package/legacy/LocalizationProvider/LocalizationProvider.js +1 -0
  76. package/legacy/MobileDatePicker/MobileDatePicker.js +4 -3
  77. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +6 -2
  78. package/legacy/MobileTimePicker/MobileTimePicker.js +5 -1
  79. package/legacy/MonthCalendar/MonthCalendar.js +30 -13
  80. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +1 -1
  81. package/legacy/PickersLayout/PickersLayout.js +1 -0
  82. package/legacy/PickersLayout/usePickerLayout.js +3 -2
  83. package/legacy/PickersShortcuts/PickersShortcuts.js +10 -2
  84. package/legacy/StaticDatePicker/StaticDatePicker.js +1 -1
  85. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
  86. package/legacy/TimeField/TimeField.js +1 -1
  87. package/legacy/YearCalendar/YearCalendar.js +28 -11
  88. package/legacy/index.js +1 -1
  89. package/legacy/internals/hooks/useField/useFieldState.js +0 -1
  90. package/legacy/internals/hooks/usePicker/usePickerValue.js +24 -2
  91. package/legacy/internals/utils/date-time-utils.js +39 -0
  92. package/legacy/internals/utils/date-utils.js +31 -9
  93. package/legacy/internals/utils/getDefaultReferenceDate.js +2 -3
  94. package/legacy/internals/utils/time-utils.js +26 -0
  95. package/legacy/internals/utils/views.js +7 -5
  96. package/legacy/locales/deDE.js +2 -2
  97. package/legacy/locales/elGR.js +93 -0
  98. package/legacy/locales/index.js +17 -15
  99. package/legacy/locales/roRO.js +81 -0
  100. package/locales/deDE.js +2 -2
  101. package/locales/elGR.d.ts +53 -0
  102. package/locales/elGR.js +57 -0
  103. package/locales/index.d.ts +17 -15
  104. package/locales/index.js +17 -15
  105. package/locales/roRO.d.ts +53 -0
  106. package/locales/roRO.js +63 -0
  107. package/models/adapters.d.ts +137 -37
  108. package/modern/AdapterDateFns/AdapterDateFns.js +20 -19
  109. package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +17 -16
  110. package/modern/AdapterDayjs/AdapterDayjs.js +12 -11
  111. package/modern/AdapterLuxon/AdapterLuxon.js +20 -19
  112. package/modern/AdapterMoment/AdapterMoment.js +12 -11
  113. package/modern/AdapterMomentHijri/AdapterMomentHijri.js +20 -19
  114. package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +20 -19
  115. package/modern/DateCalendar/DateCalendar.js +16 -6
  116. package/modern/DateCalendar/useCalendarState.js +36 -14
  117. package/modern/DateField/DateField.js +1 -1
  118. package/modern/DatePicker/DatePicker.js +1 -1
  119. package/modern/DatePicker/DatePickerToolbar.js +6 -15
  120. package/modern/DatePicker/shared.js +1 -16
  121. package/modern/DateTimeField/DateTimeField.js +1 -1
  122. package/modern/DateTimePicker/DateTimePicker.js +1 -1
  123. package/modern/DesktopDatePicker/DesktopDatePicker.js +4 -3
  124. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +6 -2
  125. package/modern/DesktopTimePicker/DesktopTimePicker.js +5 -1
  126. package/modern/LocalizationProvider/LocalizationProvider.js +1 -0
  127. package/modern/MobileDatePicker/MobileDatePicker.js +4 -3
  128. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +6 -2
  129. package/modern/MobileTimePicker/MobileTimePicker.js +5 -1
  130. package/modern/MonthCalendar/MonthCalendar.js +28 -11
  131. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +1 -1
  132. package/modern/PickersLayout/PickersLayout.js +1 -0
  133. package/modern/PickersLayout/usePickerLayout.js +4 -3
  134. package/modern/PickersShortcuts/PickersShortcuts.js +10 -2
  135. package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
  136. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
  137. package/modern/TimeField/TimeField.js +1 -1
  138. package/modern/YearCalendar/YearCalendar.js +26 -9
  139. package/modern/index.js +1 -1
  140. package/modern/internals/hooks/useField/useFieldState.js +0 -1
  141. package/modern/internals/hooks/usePicker/usePickerValue.js +22 -2
  142. package/modern/internals/utils/date-time-utils.js +41 -0
  143. package/modern/internals/utils/date-utils.js +33 -10
  144. package/modern/internals/utils/getDefaultReferenceDate.js +2 -3
  145. package/modern/internals/utils/time-utils.js +27 -0
  146. package/modern/internals/utils/views.js +6 -2
  147. package/modern/locales/deDE.js +2 -2
  148. package/modern/locales/elGR.js +57 -0
  149. package/modern/locales/index.js +17 -15
  150. package/modern/locales/roRO.js +60 -0
  151. package/node/AdapterDateFns/AdapterDateFns.js +20 -19
  152. package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +17 -16
  153. package/node/AdapterDayjs/AdapterDayjs.js +12 -11
  154. package/node/AdapterLuxon/AdapterLuxon.js +20 -19
  155. package/node/AdapterMoment/AdapterMoment.js +12 -11
  156. package/node/AdapterMomentHijri/AdapterMomentHijri.js +20 -19
  157. package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +20 -19
  158. package/node/DateCalendar/DateCalendar.js +16 -6
  159. package/node/DateCalendar/useCalendarState.js +36 -14
  160. package/node/DateField/DateField.js +1 -1
  161. package/node/DatePicker/DatePicker.js +1 -1
  162. package/node/DatePicker/DatePickerToolbar.js +6 -15
  163. package/node/DatePicker/shared.js +0 -17
  164. package/node/DateTimeField/DateTimeField.js +1 -1
  165. package/node/DateTimePicker/DateTimePicker.js +1 -1
  166. package/node/DesktopDatePicker/DesktopDatePicker.js +3 -2
  167. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +8 -4
  168. package/node/DesktopTimePicker/DesktopTimePicker.js +7 -3
  169. package/node/LocalizationProvider/LocalizationProvider.js +1 -0
  170. package/node/MobileDatePicker/MobileDatePicker.js +3 -2
  171. package/node/MobileDateTimePicker/MobileDateTimePicker.js +8 -4
  172. package/node/MobileTimePicker/MobileTimePicker.js +7 -3
  173. package/node/MonthCalendar/MonthCalendar.js +28 -11
  174. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +1 -1
  175. package/node/PickersLayout/PickersLayout.js +1 -0
  176. package/node/PickersLayout/usePickerLayout.js +4 -3
  177. package/node/PickersShortcuts/PickersShortcuts.js +10 -2
  178. package/node/StaticDatePicker/StaticDatePicker.js +1 -1
  179. package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
  180. package/node/TimeField/TimeField.js +1 -1
  181. package/node/YearCalendar/YearCalendar.js +26 -9
  182. package/node/index.js +1 -1
  183. package/node/internals/hooks/useField/useFieldState.js +0 -1
  184. package/node/internals/hooks/usePicker/usePickerValue.js +22 -2
  185. package/node/internals/utils/date-time-utils.js +49 -0
  186. package/node/internals/utils/date-utils.js +35 -12
  187. package/node/internals/utils/getDefaultReferenceDate.js +3 -3
  188. package/node/internals/utils/time-utils.js +30 -2
  189. package/node/internals/utils/views.js +8 -5
  190. package/node/locales/deDE.js +2 -2
  191. package/node/locales/elGR.js +64 -0
  192. package/node/locales/index.js +112 -90
  193. package/node/locales/roRO.js +67 -0
  194. package/package.json +1 -1
@@ -3,13 +3,14 @@ import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { resolveComponentProps } from '@mui/base/utils';
5
5
  import { singleItemValueManager } from '../internals/utils/valueManagers';
6
- import { getDatePickerFieldFormat, useDatePickerDefaultizedProps } from '../DatePicker/shared';
6
+ import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
7
7
  import { useLocaleText, useUtils, validateDate } from '../internals';
8
8
  import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
9
9
  import { CalendarIcon } from '../icons';
10
10
  import { DateField } from '../DateField';
11
11
  import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
12
12
  import { renderDateViewCalendar } from '../dateViewRenderers';
13
+ import { resolveDateFormat } from '../internals/utils/date-utils';
13
14
  var DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePicker(inProps, ref) {
14
15
  var _defaultizedProps$yea, _defaultizedProps$slo2;
15
16
  var localeText = useLocaleText();
@@ -26,7 +27,7 @@ var DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePicker
26
27
  // Props with the default values specific to the desktop variant
27
28
  var props = _extends({}, defaultizedProps, {
28
29
  viewRenderers: viewRenderers,
29
- format: getDatePickerFieldFormat(utils, defaultizedProps),
30
+ format: resolveDateFormat(utils, defaultizedProps, false),
30
31
  yearsPerRow: (_defaultizedProps$yea = defaultizedProps.yearsPerRow) != null ? _defaultizedProps$yea : 4,
31
32
  slots: _extends({
32
33
  openPickerIcon: CalendarIcon,
@@ -95,7 +96,7 @@ DesktopDatePicker.propTypes = {
95
96
  */
96
97
  dayOfWeekFormatter: PropTypes.func,
97
98
  /**
98
- * Default calendar month displayed when `value={null}`.
99
+ * Default calendar month displayed when `value` and `defaultValue` are empty.
99
100
  */
100
101
  defaultCalendarMonth: PropTypes.any,
101
102
  /**
@@ -8,13 +8,16 @@ import { DateTimeField } from '../DateTimeField';
8
8
  import { useDateTimePickerDefaultizedProps } from '../DateTimePicker/shared';
9
9
  import { renderDateViewCalendar } from '../dateViewRenderers/dateViewRenderers';
10
10
  import { renderDesktopDateTimeView } from '../dateTimeViewRenderers';
11
- import { useLocaleText, validateDateTime } from '../internals';
11
+ import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
12
+ import { validateDateTime } from '../internals/utils/validation/validateDateTime';
12
13
  import { CalendarIcon } from '../icons';
13
14
  import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
14
15
  import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
16
+ import { resolveDateTimeFormat } from '../internals/utils/date-time-utils';
15
17
  var DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTimePicker(inProps, ref) {
16
18
  var _defaultizedProps$amp, _defaultizedProps$yea, _defaultizedProps$slo2, _defaultizedProps$slo3, _defaultizedProps$slo4;
17
19
  var localeText = useLocaleText();
20
+ var utils = useUtils();
18
21
 
19
22
  // Props with the default values common to all date time pickers
20
23
  var defaultizedProps = useDateTimePickerDefaultizedProps(inProps, 'MuiDesktopDateTimePicker');
@@ -50,6 +53,7 @@ var DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTi
50
53
  // Props with the default values specific to the desktop variant
51
54
  var props = _extends({}, defaultizedProps, {
52
55
  viewRenderers: viewRenderers,
56
+ format: resolveDateTimeFormat(utils, defaultizedProps),
53
57
  views: defaultizedProps.ampm ? [].concat(_toConsumableArray(defaultizedProps.views), ['meridiem']) : defaultizedProps.views,
54
58
  yearsPerRow: (_defaultizedProps$yea = defaultizedProps.yearsPerRow) != null ? _defaultizedProps$yea : 4,
55
59
  ampmInClock: ampmInClock,
@@ -139,7 +143,7 @@ DesktopDateTimePicker.propTypes = {
139
143
  */
140
144
  dayOfWeekFormatter: PropTypes.func,
141
145
  /**
142
- * Default calendar month displayed when `value={null}`.
146
+ * Default calendar month displayed when `value` and `defaultValue` are empty.
143
147
  */
144
148
  defaultCalendarMonth: PropTypes.any,
145
149
  /**
@@ -6,14 +6,17 @@ import { resolveComponentProps } from '@mui/base/utils';
6
6
  import { singleItemValueManager } from '../internals/utils/valueManagers';
7
7
  import { TimeField } from '../TimeField';
8
8
  import { useTimePickerDefaultizedProps } from '../TimePicker/shared';
9
- import { useLocaleText, validateTime } from '../internals';
9
+ import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
10
+ import { validateTime } from '../internals/utils/validation/validateTime';
10
11
  import { ClockIcon } from '../icons';
11
12
  import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
12
13
  import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
13
14
  import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from '../timeViewRenderers';
15
+ import { resolveTimeFormat } from '../internals/utils/time-utils';
14
16
  var DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePicker(inProps, ref) {
15
17
  var _defaultizedProps$thr, _defaultizedProps$amp, _viewRenderers$hours, _defaultizedProps$slo2, _defaultizedProps$slo3;
16
18
  var localeText = useLocaleText();
19
+ var utils = useUtils();
17
20
 
18
21
  // Props with the default values common to all time pickers
19
22
  var defaultizedProps = useTimePickerDefaultizedProps(inProps, 'MuiDesktopTimePicker');
@@ -42,6 +45,7 @@ var DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePicker
42
45
  ampmInClock: ampmInClock,
43
46
  timeSteps: timeSteps,
44
47
  viewRenderers: viewRenderers,
48
+ format: resolveTimeFormat(utils, defaultizedProps),
45
49
  // Setting only `hours` time view in case of single column time picker
46
50
  // Allows for easy view lifecycle management
47
51
  views: shouldRenderTimeInASingleColumn ? ['hours'] : views,
@@ -109,6 +109,7 @@ process.env.NODE_ENV !== "production" ? LocalizationProvider.propTypes = {
109
109
  keyboardDateTime: PropTypes.string,
110
110
  keyboardDateTime12h: PropTypes.string,
111
111
  keyboardDateTime24h: PropTypes.string,
112
+ meridiem: PropTypes.string,
112
113
  minutes: PropTypes.string,
113
114
  month: PropTypes.string,
114
115
  monthAndDate: PropTypes.string,
@@ -3,12 +3,13 @@ import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { resolveComponentProps } from '@mui/base/utils';
5
5
  import { useMobilePicker } from '../internals/hooks/useMobilePicker';
6
- import { getDatePickerFieldFormat, useDatePickerDefaultizedProps } from '../DatePicker/shared';
6
+ import { useDatePickerDefaultizedProps } from '../DatePicker/shared';
7
7
  import { useLocaleText, useUtils, validateDate } from '../internals';
8
8
  import { DateField } from '../DateField';
9
9
  import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
10
10
  import { singleItemValueManager } from '../internals/utils/valueManagers';
11
11
  import { renderDateViewCalendar } from '../dateViewRenderers';
12
+ import { resolveDateFormat } from '../internals/utils/date-utils';
12
13
  var MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker(inProps, ref) {
13
14
  var _defaultizedProps$slo2;
14
15
  var localeText = useLocaleText();
@@ -25,7 +26,7 @@ var MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker(i
25
26
  // Props with the default values specific to the mobile variant
26
27
  var props = _extends({}, defaultizedProps, {
27
28
  viewRenderers: viewRenderers,
28
- format: getDatePickerFieldFormat(utils, defaultizedProps),
29
+ format: resolveDateFormat(utils, defaultizedProps, false),
29
30
  slots: _extends({
30
31
  field: DateField
31
32
  }, defaultizedProps.slots),
@@ -92,7 +93,7 @@ MobileDatePicker.propTypes = {
92
93
  */
93
94
  dayOfWeekFormatter: PropTypes.func,
94
95
  /**
95
- * Default calendar month displayed when `value={null}`.
96
+ * Default calendar month displayed when `value` and `defaultValue` are empty.
96
97
  */
97
98
  defaultCalendarMonth: PropTypes.any,
98
99
  /**
@@ -5,14 +5,17 @@ import { resolveComponentProps } from '@mui/base/utils';
5
5
  import { singleItemValueManager } from '../internals/utils/valueManagers';
6
6
  import { DateTimeField } from '../DateTimeField';
7
7
  import { useDateTimePickerDefaultizedProps } from '../DateTimePicker/shared';
8
- import { useLocaleText, validateDateTime } from '../internals';
8
+ import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
9
+ import { validateDateTime } from '../internals/utils/validation/validateDateTime';
9
10
  import { useMobilePicker } from '../internals/hooks/useMobilePicker';
10
11
  import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
11
12
  import { renderDateViewCalendar } from '../dateViewRenderers';
12
13
  import { renderTimeViewClock } from '../timeViewRenderers';
14
+ import { resolveDateTimeFormat } from '../internals/utils/date-time-utils';
13
15
  var MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTimePicker(inProps, ref) {
14
16
  var _defaultizedProps$amp, _defaultizedProps$slo2, _defaultizedProps$slo3;
15
17
  var localeText = useLocaleText();
18
+ var utils = useUtils();
16
19
 
17
20
  // Props with the default values common to all date time pickers
18
21
  var defaultizedProps = useDateTimePickerDefaultizedProps(inProps, 'MuiMobileDateTimePicker');
@@ -29,6 +32,7 @@ var MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTime
29
32
  // Props with the default values specific to the mobile variant
30
33
  var props = _extends({}, defaultizedProps, {
31
34
  viewRenderers: viewRenderers,
35
+ format: resolveDateTimeFormat(utils, defaultizedProps),
32
36
  ampmInClock: ampmInClock,
33
37
  slots: _extends({
34
38
  field: DateTimeField
@@ -110,7 +114,7 @@ MobileDateTimePicker.propTypes = {
110
114
  */
111
115
  dayOfWeekFormatter: PropTypes.func,
112
116
  /**
113
- * Default calendar month displayed when `value={null}`.
117
+ * Default calendar month displayed when `value` and `defaultValue` are empty.
114
118
  */
115
119
  defaultCalendarMonth: PropTypes.any,
116
120
  /**
@@ -5,13 +5,16 @@ import { resolveComponentProps } from '@mui/base/utils';
5
5
  import { singleItemValueManager } from '../internals/utils/valueManagers';
6
6
  import { TimeField } from '../TimeField';
7
7
  import { useTimePickerDefaultizedProps } from '../TimePicker/shared';
8
- import { useLocaleText, validateTime } from '../internals';
8
+ import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
9
+ import { validateTime } from '../internals/utils/validation/validateTime';
9
10
  import { useMobilePicker } from '../internals/hooks/useMobilePicker';
10
11
  import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
11
12
  import { renderTimeViewClock } from '../timeViewRenderers';
13
+ import { resolveTimeFormat } from '../internals/utils/time-utils';
12
14
  var MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker(inProps, ref) {
13
15
  var _defaultizedProps$amp, _defaultizedProps$slo2;
14
16
  var localeText = useLocaleText();
17
+ var utils = useUtils();
15
18
 
16
19
  // Props with the default values common to all time pickers
17
20
  var defaultizedProps = useTimePickerDefaultizedProps(inProps, 'MuiMobileTimePicker');
@@ -26,6 +29,7 @@ var MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker(i
26
29
  var props = _extends({}, defaultizedProps, {
27
30
  ampmInClock: ampmInClock,
28
31
  viewRenderers: viewRenderers,
32
+ format: resolveTimeFormat(utils, defaultizedProps),
29
33
  slots: _extends({
30
34
  field: TimeField
31
35
  }, defaultizedProps.slots),
@@ -1,7 +1,7 @@
1
1
  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
- var _excluded = ["className", "value", "defaultValue", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow"];
4
+ var _excluded = ["className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "autoFocus", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
@@ -12,6 +12,8 @@ import { PickersMonth } from './PickersMonth';
12
12
  import { useUtils, useNow, useDefaultDates } from '../internals/hooks/useUtils';
13
13
  import { getMonthCalendarUtilityClass } from './monthCalendarClasses';
14
14
  import { applyDefaultDate, getMonthsInYear } from '../internals/utils/date-utils';
15
+ import { singleItemValueManager } from '../internals/utils/valueManagers';
16
+ import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
15
17
  import { jsx as _jsx } from "react/jsx-runtime";
16
18
  var useUtilityClasses = function useUtilityClasses(ownerState) {
17
19
  var classes = ownerState.classes;
@@ -56,6 +58,7 @@ export var MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(
56
58
  var className = props.className,
57
59
  valueProp = props.value,
58
60
  defaultValue = props.defaultValue,
61
+ referenceDateProp = props.referenceDate,
59
62
  disabled = props.disabled,
60
63
  disableFuture = props.disableFuture,
61
64
  disablePast = props.disablePast,
@@ -84,12 +87,20 @@ export var MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(
84
87
  _useControlled2 = _slicedToArray(_useControlled, 2),
85
88
  value = _useControlled2[0],
86
89
  setValue = _useControlled2[1];
90
+ var referenceDate = React.useMemo(function () {
91
+ return singleItemValueManager.getInitialReferenceValue({
92
+ value: value,
93
+ utils: utils,
94
+ props: props,
95
+ referenceDate: referenceDateProp,
96
+ granularity: SECTION_TYPE_GRANULARITY.month
97
+ });
98
+ }, [] // eslint-disable-line react-hooks/exhaustive-deps
99
+ );
100
+
87
101
  var todayMonth = React.useMemo(function () {
88
102
  return utils.getMonth(now);
89
103
  }, [utils, now]);
90
- var selectedDateOrStartOfMonth = React.useMemo(function () {
91
- return value != null ? value : utils.startOfMonth(now);
92
- }, [now, utils, value]);
93
104
  var selectedMonth = React.useMemo(function () {
94
105
  if (value != null) {
95
106
  return utils.getMonth(value);
@@ -97,8 +108,8 @@ export var MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(
97
108
  if (disableHighlightToday) {
98
109
  return null;
99
110
  }
100
- return utils.getMonth(now);
101
- }, [now, value, utils, disableHighlightToday]);
111
+ return utils.getMonth(referenceDate);
112
+ }, [value, utils, disableHighlightToday, referenceDate]);
102
113
  var _React$useState = React.useState(function () {
103
114
  return selectedMonth || todayMonth;
104
115
  }),
@@ -120,30 +131,31 @@ export var MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(
120
131
  onFocusedViewChange(newHasFocus);
121
132
  }
122
133
  });
123
- var isMonthDisabled = React.useCallback(function (month) {
134
+ var isMonthDisabled = React.useCallback(function (dateToValidate) {
124
135
  var firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, minDate) ? now : minDate);
125
136
  var lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, maxDate) ? now : maxDate);
126
- if (utils.isBefore(month, firstEnabledMonth)) {
137
+ var monthToValidate = utils.startOfMonth(dateToValidate);
138
+ if (utils.isBefore(monthToValidate, firstEnabledMonth)) {
127
139
  return true;
128
140
  }
129
- if (utils.isAfter(month, lastEnabledMonth)) {
141
+ if (utils.isAfter(monthToValidate, lastEnabledMonth)) {
130
142
  return true;
131
143
  }
132
144
  if (!shouldDisableMonth) {
133
145
  return false;
134
146
  }
135
- return shouldDisableMonth(month);
147
+ return shouldDisableMonth(monthToValidate);
136
148
  }, [disableFuture, disablePast, maxDate, minDate, now, shouldDisableMonth, utils]);
137
149
  var handleMonthSelection = useEventCallback(function (event, month) {
138
150
  if (readOnly) {
139
151
  return;
140
152
  }
141
- var newDate = utils.setMonth(selectedDateOrStartOfMonth, month);
153
+ var newDate = utils.setMonth(value != null ? value : referenceDate, month);
142
154
  setValue(newDate);
143
155
  onChange == null ? void 0 : onChange(newDate);
144
156
  });
145
157
  var focusMonth = useEventCallback(function (month) {
146
- if (!isMonthDisabled(utils.setMonth(selectedDateOrStartOfMonth, month))) {
158
+ if (!isMonthDisabled(utils.setMonth(value != null ? value : referenceDate, month))) {
147
159
  setFocusedMonth(month);
148
160
  changeHasFocus(true);
149
161
  if (onMonthFocus) {
@@ -193,7 +205,7 @@ export var MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(
193
205
  className: clsx(classes.root, className),
194
206
  ownerState: ownerState
195
207
  }, other, {
196
- children: getMonthsInYear(utils, selectedDateOrStartOfMonth).map(function (month) {
208
+ children: getMonthsInYear(utils, value != null ? value : referenceDate).map(function (month) {
197
209
  var monthNumber = utils.getMonth(month);
198
210
  var monthText = utils.format(month, 'monthShort');
199
211
  var isSelected = monthNumber === selectedMonth;
@@ -279,6 +291,11 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
279
291
  * If `true` picker is readonly
280
292
  */
281
293
  readOnly: PropTypes.bool,
294
+ /**
295
+ * The date used to generate the new value when both `value` and `defaultValue` are empty.
296
+ * @default The closest valid month using the validation props, except callbacks such as `shouldDisableDate`.
297
+ */
298
+ referenceDate: PropTypes.any,
282
299
  /**
283
300
  * Disable specific month.
284
301
  * @template TDate
@@ -142,7 +142,7 @@ export var MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(funct
142
142
  return !readOnly && onChange(option.value);
143
143
  },
144
144
  selected: isSelected,
145
- disabled: disabled != null ? disabled : (_option$isDisabled2 = option.isDisabled) == null ? void 0 : _option$isDisabled2.call(option, option.value),
145
+ disabled: disabled || ((_option$isDisabled2 = option.isDisabled) == null ? void 0 : _option$isDisabled2.call(option, option.value)),
146
146
  disableRipple: readOnly,
147
147
  role: "option"
148
148
  // aria-readonly is not supported here and does not have any effect
@@ -135,6 +135,7 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
135
135
  onClose: PropTypes.func.isRequired,
136
136
  onDismiss: PropTypes.func.isRequired,
137
137
  onOpen: PropTypes.func.isRequired,
138
+ onSelectShortcut: PropTypes.func.isRequired,
138
139
  onSetToday: PropTypes.func.isRequired,
139
140
  onViewChange: PropTypes.func.isRequired,
140
141
  /**
@@ -37,6 +37,7 @@ var usePickerLayout = function usePickerLayout(props) {
37
37
  onViewChange = _ref.onViewChange,
38
38
  value = _ref.value,
39
39
  onChange = _ref.onChange,
40
+ onSelectShortcut = _ref.onSelectShortcut,
40
41
  isValid = _ref.isValid,
41
42
  isLandscape = _ref.isLandscape,
42
43
  disabled = _ref.disabled,
@@ -114,13 +115,13 @@ var usePickerLayout = function usePickerLayout(props) {
114
115
  additionalProps: {
115
116
  isValid: isValid,
116
117
  isLandscape: isLandscape,
117
- onChange: onChange,
118
+ onChange: onSelectShortcut,
118
119
  className: classes.shortcuts
119
120
  },
120
121
  ownerState: {
121
122
  isValid: isValid,
122
123
  isLandscape: isLandscape,
123
- onChange: onChange,
124
+ onChange: onSelectShortcut,
124
125
  className: classes.shortcuts,
125
126
  wrapperVariant: wrapperVariant
126
127
  }
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["items", "isLandscape", "onChange", "isValid"];
4
+ var _excluded = ["items", "changeImportance", "isLandscape", "onChange", "isValid"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import List from '@mui/material/List';
@@ -11,6 +11,7 @@ import { VIEW_HEIGHT } from '../internals/constants/dimensions';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  function PickersShortcuts(props) {
13
13
  var items = props.items,
14
+ changeImportance = props.changeImportance,
14
15
  isLandscape = props.isLandscape,
15
16
  onChange = props.onChange,
16
17
  isValid = props.isValid,
@@ -25,7 +26,7 @@ function PickersShortcuts(props) {
25
26
  return {
26
27
  label: item.label,
27
28
  onClick: function onClick() {
28
- onChange(newValue);
29
+ onChange(newValue, changeImportance);
29
30
  },
30
31
  disabled: !isValid(newValue)
31
32
  };
@@ -50,6 +51,13 @@ process.env.NODE_ENV !== "production" ? PickersShortcuts.propTypes = {
50
51
  // | These PropTypes are generated from the TypeScript type definitions |
51
52
  // | To update them edit the TypeScript types and run "yarn proptypes" |
52
53
  // ----------------------------------------------------------------------
54
+ /**
55
+ * Importance of the change when picking a shortcut:
56
+ * - "accept": fires `onChange`, fires `onAccept` and closes the picker.
57
+ * - "set": fires `onChange` but do not fire `onAccept` and does not close the picker.
58
+ * @default "accept"
59
+ */
60
+ changeImportance: PropTypes.oneOf(['accept', 'set']),
53
61
  className: PropTypes.string,
54
62
  /**
55
63
  * If `true`, compact vertical padding designed for keyboard and mouse input is used for
@@ -73,7 +73,7 @@ StaticDatePicker.propTypes = {
73
73
  */
74
74
  dayOfWeekFormatter: PropTypes.func,
75
75
  /**
76
- * Default calendar month displayed when `value={null}`.
76
+ * Default calendar month displayed when `value` and `defaultValue` are empty.
77
77
  */
78
78
  defaultCalendarMonth: PropTypes.any,
79
79
  /**
@@ -93,7 +93,7 @@ StaticDateTimePicker.propTypes = {
93
93
  */
94
94
  dayOfWeekFormatter: PropTypes.func,
95
95
  /**
96
- * Default calendar month displayed when `value={null}`.
96
+ * Default calendar month displayed when `value` and `defaultValue` are empty.
97
97
  */
98
98
  defaultCalendarMonth: PropTypes.any,
99
99
  /**
@@ -241,7 +241,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
241
241
  */
242
242
  readOnly: PropTypes.bool,
243
243
  /**
244
- * The date used to generate a part of the date-time that is not present in the format when both `value` and `defaultValue` are not present.
244
+ * The date used to generate a part of the new value that is not present in the format when both `value` and `defaultValue` are empty.
245
245
  * For example, on time fields it will be used to determine the date to set.
246
246
  * @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used.
247
247
  */
@@ -1,7 +1,7 @@
1
1
  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
- var _excluded = ["autoFocus", "className", "value", "defaultValue", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsPerRow"];
4
+ var _excluded = ["autoFocus", "className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsPerRow"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
@@ -12,6 +12,8 @@ import { PickersYear } from './PickersYear';
12
12
  import { useUtils, useNow, useDefaultDates } from '../internals/hooks/useUtils';
13
13
  import { getYearCalendarUtilityClass } from './yearCalendarClasses';
14
14
  import { applyDefaultDate } from '../internals/utils/date-utils';
15
+ import { singleItemValueManager } from '../internals/utils/valueManagers';
16
+ import { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';
15
17
  import { jsx as _jsx } from "react/jsx-runtime";
16
18
  var useUtilityClasses = function useUtilityClasses(ownerState) {
17
19
  var classes = ownerState.classes;
@@ -60,6 +62,7 @@ export var YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(in
60
62
  className = props.className,
61
63
  valueProp = props.value,
62
64
  defaultValue = props.defaultValue,
65
+ referenceDateProp = props.referenceDate,
63
66
  disabled = props.disabled,
64
67
  disableFuture = props.disableFuture,
65
68
  disablePast = props.disablePast,
@@ -86,9 +89,17 @@ export var YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(in
86
89
  _useControlled2 = _slicedToArray(_useControlled, 2),
87
90
  value = _useControlled2[0],
88
91
  setValue = _useControlled2[1];
89
- var selectedDateOrStartOfYear = React.useMemo(function () {
90
- return value != null ? value : utils.startOfYear(now);
91
- }, [now, utils, value]);
92
+ var referenceDate = React.useMemo(function () {
93
+ return singleItemValueManager.getInitialReferenceValue({
94
+ value: value,
95
+ utils: utils,
96
+ props: props,
97
+ referenceDate: referenceDateProp,
98
+ granularity: SECTION_TYPE_GRANULARITY.year
99
+ });
100
+ }, [] // eslint-disable-line react-hooks/exhaustive-deps
101
+ );
102
+
92
103
  var todayYear = React.useMemo(function () {
93
104
  return utils.getYear(now);
94
105
  }, [utils, now]);
@@ -99,8 +110,8 @@ export var YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(in
99
110
  if (disableHighlightToday) {
100
111
  return null;
101
112
  }
102
- return utils.getYear(now);
103
- }, [now, value, utils, disableHighlightToday]);
113
+ return utils.getYear(referenceDate);
114
+ }, [value, utils, disableHighlightToday, referenceDate]);
104
115
  var _React$useState = React.useState(function () {
105
116
  return selectedYear || todayYear;
106
117
  }),
@@ -135,21 +146,22 @@ export var YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(in
135
146
  if (maxDate && utils.isAfterYear(dateToValidate, maxDate)) {
136
147
  return true;
137
148
  }
138
- if (shouldDisableYear && shouldDisableYear(dateToValidate)) {
139
- return true;
149
+ if (!shouldDisableYear) {
150
+ return false;
140
151
  }
141
- return false;
152
+ var yearToValidate = utils.startOfYear(dateToValidate);
153
+ return shouldDisableYear(yearToValidate);
142
154
  }, [disableFuture, disablePast, maxDate, minDate, now, shouldDisableYear, utils]);
143
155
  var handleYearSelection = useEventCallback(function (event, year) {
144
156
  if (readOnly) {
145
157
  return;
146
158
  }
147
- var newDate = utils.setYear(selectedDateOrStartOfYear, year);
159
+ var newDate = utils.setYear(value != null ? value : referenceDate, year);
148
160
  setValue(newDate);
149
161
  onChange == null ? void 0 : onChange(newDate);
150
162
  });
151
163
  var focusYear = useEventCallback(function (year) {
152
- if (!isYearDisabled(utils.setYear(selectedDateOrStartOfYear, year))) {
164
+ if (!isYearDisabled(utils.setYear(value != null ? value : referenceDate, year))) {
153
165
  setFocusedYear(year);
154
166
  changeHasFocus(true);
155
167
  onYearFocus == null ? void 0 : onYearFocus(year);
@@ -298,6 +310,11 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
298
310
  * If `true` picker is readonly
299
311
  */
300
312
  readOnly: PropTypes.bool,
313
+ /**
314
+ * The date used to generate the new value when both `value` and `defaultValue` are empty.
315
+ * @default The closest valid year using the validation props, except callbacks such as `shouldDisableDate`.
316
+ */
317
+ referenceDate: PropTypes.any,
301
318
  /**
302
319
  * Disable specific year.
303
320
  * @template TDate
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.6.0
2
+ * @mui/x-date-pickers v6.8.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -58,7 +58,6 @@ export var useFieldState = function useFieldState(params) {
58
58
  var referenceValue = valueManager.getInitialReferenceValue({
59
59
  referenceDate: referenceDateProp,
60
60
  value: valueFromTheOutside,
61
- valueType: valueType,
62
61
  utils: utils,
63
62
  props: internalProps,
64
63
  granularity: granularity
@@ -37,6 +37,14 @@ var shouldPublishValue = function shouldPublishValue(params) {
37
37
  }
38
38
  return hasChanged(dateState.lastPublishedValue);
39
39
  }
40
+ if (action.name === 'setValueFromShortcut' && action.changeImportance === 'accept') {
41
+ // On the first view,
42
+ // If the value is not controlled, then clicking on any value (including the one equal to `defaultValue`) should call `onChange`
43
+ if (isCurrentValueTheDefaultValue) {
44
+ return true;
45
+ }
46
+ return hasChanged(dateState.lastPublishedValue);
47
+ }
40
48
  return false;
41
49
  };
42
50
 
@@ -68,6 +76,9 @@ var shouldCommitValue = function shouldCommitValue(params) {
68
76
  }
69
77
  return hasChanged(dateState.lastCommittedValue);
70
78
  }
79
+ if (action.name === 'setValueFromShortcut') {
80
+ return action.changeImportance === 'accept' && hasChanged(dateState.lastCommittedValue);
81
+ }
71
82
  return false;
72
83
  };
73
84
 
@@ -83,6 +94,9 @@ var shouldClosePicker = function shouldClosePicker(params) {
83
94
  if (action.name === 'setValueFromView') {
84
95
  return action.selectionState === 'finish' && closeOnSelect;
85
96
  }
97
+ if (action.name === 'setValueFromShortcut') {
98
+ return action.changeImportance === 'accept';
99
+ }
86
100
  return false;
87
101
  };
88
102
 
@@ -263,7 +277,14 @@ export var usePickerValue = function usePickerValue(_ref) {
263
277
  selectionState: selectionState
264
278
  });
265
279
  });
266
- var handleChangeField = useEventCallback(function (newValue, context) {
280
+ var handleSelectShortcut = useEventCallback(function (newValue, changeImportance) {
281
+ return updateDate({
282
+ name: 'setValueFromShortcut',
283
+ value: newValue,
284
+ changeImportance: changeImportance != null ? changeImportance : 'accept'
285
+ });
286
+ });
287
+ var handleChangeFromField = useEventCallback(function (newValue, context) {
267
288
  return updateDate({
268
289
  name: 'setValueFromField',
269
290
  value: newValue,
@@ -285,7 +306,7 @@ export var usePickerValue = function usePickerValue(_ref) {
285
306
  };
286
307
  var fieldResponse = {
287
308
  value: dateState.draft,
288
- onChange: handleChangeField,
309
+ onChange: handleChangeFromField,
289
310
  selectedSections: selectedSections,
290
311
  onSelectedSectionsChange: handleFieldSelectedSectionsChange
291
312
  };
@@ -312,6 +333,7 @@ export var usePickerValue = function usePickerValue(_ref) {
312
333
  var layoutResponse = _extends({}, actions, {
313
334
  value: viewValue,
314
335
  onChange: handleChange,
336
+ onSelectShortcut: handleSelectShortcut,
315
337
  isValid: isValid
316
338
  });
317
339
  return {