@mui/lab 5.0.0-alpha.67 → 5.0.0-alpha.68

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 (165) hide show
  1. package/AdapterDateFns/index.d.ts +1 -1
  2. package/AdapterDayjs/index.d.ts +1 -1
  3. package/AdapterLuxon/index.d.ts +1 -1
  4. package/AdapterMoment/index.d.ts +1 -1
  5. package/CHANGELOG.md +100 -28
  6. package/CalendarPicker/CalendarPicker.d.ts +106 -106
  7. package/CalendarPicker/PickersCalendar.d.ts +47 -47
  8. package/CalendarPicker/PickersCalendarHeader.d.ts +43 -43
  9. package/CalendarPicker/PickersFadeTransitionGroup.d.ts +12 -12
  10. package/CalendarPicker/PickersSlideTransition.d.ts +16 -16
  11. package/CalendarPicker/index.d.ts +5 -5
  12. package/CalendarPicker/shared.d.ts +1 -1
  13. package/CalendarPicker/useCalendarState.d.ts +32 -32
  14. package/CalendarPickerSkeleton/CalendarPickerSkeleton.d.ts +41 -41
  15. package/CalendarPickerSkeleton/index.d.ts +3 -3
  16. package/ClockPicker/Clock.d.ts +28 -28
  17. package/ClockPicker/ClockNumber.d.ts +19 -19
  18. package/ClockPicker/ClockNumber.js +1 -0
  19. package/ClockPicker/ClockNumbers.d.ts +24 -24
  20. package/ClockPicker/ClockPicker.d.ts +121 -121
  21. package/ClockPicker/ClockPickerStandalone.d.ts +28 -28
  22. package/ClockPicker/ClockPointer.d.ts +23 -23
  23. package/ClockPicker/index.d.ts +5 -5
  24. package/ClockPicker/shared.d.ts +5 -5
  25. package/DatePicker/DatePicker.d.ts +27 -27
  26. package/DatePicker/DatePickerToolbar.d.ts +23 -23
  27. package/DatePicker/index.d.ts +2 -2
  28. package/DatePicker/shared.d.ts +45 -45
  29. package/DateRangePicker/DateRangePicker.d.ts +65 -65
  30. package/DateRangePicker/DateRangePickerInput.d.ts +35 -35
  31. package/DateRangePicker/DateRangePickerToolbar.d.ts +15 -15
  32. package/DateRangePicker/DateRangePickerView.d.ts +44 -44
  33. package/DateRangePicker/DateRangePickerViewDesktop.d.ts +29 -29
  34. package/DateRangePicker/DateRangePickerViewMobile.d.ts +17 -17
  35. package/DateRangePicker/RangeTypes.d.ts +8 -8
  36. package/DateRangePicker/date-range-manager.d.ts +14 -14
  37. package/DateRangePicker/index.d.ts +3 -3
  38. package/DateRangePickerDay/DateRangePickerDay.d.ts +79 -79
  39. package/DateRangePickerDay/index.d.ts +2 -2
  40. package/DateTimePicker/DateTimePicker.d.ts +27 -27
  41. package/DateTimePicker/DateTimePickerTabs.d.ts +13 -13
  42. package/DateTimePicker/DateTimePickerToolbar.d.ts +7 -7
  43. package/DateTimePicker/index.d.ts +2 -2
  44. package/DateTimePicker/shared.d.ts +67 -67
  45. package/DesktopDatePicker/DesktopDatePicker.d.ts +20 -20
  46. package/DesktopDatePicker/index.d.ts +2 -2
  47. package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +64 -64
  48. package/DesktopDateRangePicker/index.d.ts +2 -2
  49. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +20 -20
  50. package/DesktopDateTimePicker/index.d.ts +2 -2
  51. package/DesktopTimePicker/DesktopTimePicker.d.ts +20 -20
  52. package/DesktopTimePicker/index.d.ts +2 -2
  53. package/LoadingButton/LoadingButton.js +3 -1
  54. package/LoadingButton/loadingButtonClasses.d.ts +22 -22
  55. package/LocalizationProvider/LocalizationProvider.d.ts +35 -35
  56. package/LocalizationProvider/index.d.ts +2 -2
  57. package/Masonry/masonryClasses.d.ts +8 -8
  58. package/MobileDatePicker/MobileDatePicker.d.ts +20 -20
  59. package/MobileDatePicker/index.d.ts +2 -2
  60. package/MobileDateRangePicker/MobileDateRangePicker.d.ts +64 -64
  61. package/MobileDateRangePicker/index.d.ts +2 -2
  62. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +20 -20
  63. package/MobileDateTimePicker/index.d.ts +2 -2
  64. package/MobileTimePicker/MobileTimePicker.d.ts +20 -20
  65. package/MobileTimePicker/index.d.ts +2 -2
  66. package/MonthPicker/MonthPicker.d.ts +53 -53
  67. package/MonthPicker/PickersMonth.d.ts +15 -15
  68. package/MonthPicker/index.d.ts +3 -3
  69. package/PickersDay/PickersDay.d.ts +93 -93
  70. package/PickersDay/index.d.ts +4 -4
  71. package/StaticDatePicker/StaticDatePicker.d.ts +25 -25
  72. package/StaticDatePicker/index.d.ts +2 -2
  73. package/StaticDateRangePicker/StaticDateRangePicker.d.ts +67 -67
  74. package/StaticDateRangePicker/index.d.ts +2 -2
  75. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +25 -25
  76. package/StaticDateTimePicker/index.d.ts +2 -2
  77. package/StaticTimePicker/StaticTimePicker.d.ts +25 -25
  78. package/StaticTimePicker/index.d.ts +2 -2
  79. package/TabPanel/tabPanelClasses.d.ts +8 -8
  80. package/TimePicker/TimePicker.d.ts +27 -27
  81. package/TimePicker/TimePickerToolbar.d.ts +23 -23
  82. package/TimePicker/index.d.ts +2 -2
  83. package/TimePicker/shared.d.ts +36 -36
  84. package/Timeline/Timeline.d.ts +59 -59
  85. package/Timeline/TimelineContext.d.ts +6 -6
  86. package/Timeline/index.d.ts +5 -5
  87. package/Timeline/timelineClasses.d.ts +3 -3
  88. package/TimelineConnector/timelineConnectorClasses.d.ts +8 -8
  89. package/TimelineContent/timelineContentClasses.d.ts +14 -14
  90. package/TimelineDot/timelineDotClasses.d.ts +24 -24
  91. package/TimelineItem/timelineItemClasses.d.ts +16 -16
  92. package/TimelineOppositeContent/timelineOppositeContentClasses.d.ts +14 -14
  93. package/TimelineSeparator/timelineSeparatorClasses.d.ts +8 -8
  94. package/TreeItem/TreeItem.js +1 -1
  95. package/TreeItem/treeItemClasses.d.ts +24 -24
  96. package/TreeView/treeViewClasses.d.ts +8 -8
  97. package/YearPicker/PickersYear.d.ts +28 -28
  98. package/YearPicker/YearPicker.d.ts +44 -44
  99. package/YearPicker/index.d.ts +5 -5
  100. package/YearPicker/yearPickerClasses.d.ts +3 -3
  101. package/index.js +1 -1
  102. package/internal/pickers/KeyboardDateInput.d.ts +4 -4
  103. package/internal/pickers/Picker/Picker.d.ts +33 -33
  104. package/internal/pickers/Picker/PickerView.d.ts +3 -3
  105. package/internal/pickers/PickersArrowSwitcher.d.ts +41 -41
  106. package/internal/pickers/PickersModalDialog.d.ts +47 -47
  107. package/internal/pickers/PickersModalDialog.js +1 -1
  108. package/internal/pickers/PickersPopper.d.ts +33 -33
  109. package/internal/pickers/PickersToolbar.d.ts +14 -14
  110. package/internal/pickers/PickersToolbarButton.d.ts +13 -13
  111. package/internal/pickers/PickersToolbarText.d.ts +8 -8
  112. package/internal/pickers/PureDateInput.d.ts +80 -80
  113. package/internal/pickers/constants/dimensions.d.ts +4 -4
  114. package/internal/pickers/constants/prop-types.d.ts +1 -1
  115. package/internal/pickers/date-time-utils.d.ts +8 -8
  116. package/internal/pickers/date-utils.d.ts +52 -52
  117. package/internal/pickers/hooks/date-helpers-hooks.d.ts +16 -16
  118. package/internal/pickers/hooks/useIsLandscape.d.ts +4 -4
  119. package/internal/pickers/hooks/useMaskedInput.d.ts +7 -7
  120. package/internal/pickers/hooks/useOpenState.d.ts +10 -10
  121. package/internal/pickers/hooks/usePickerState.d.ts +38 -38
  122. package/internal/pickers/hooks/usePickerState.js +6 -4
  123. package/internal/pickers/hooks/useUtils.d.ts +7 -7
  124. package/internal/pickers/hooks/useValidation.d.ts +23 -23
  125. package/internal/pickers/hooks/useViews.d.ts +19 -19
  126. package/internal/pickers/text-field-helper.d.ts +11 -11
  127. package/internal/pickers/time-utils.d.ts +33 -33
  128. package/internal/pickers/typings/BasePicker.d.ts +95 -95
  129. package/internal/pickers/typings/Views.d.ts +1 -1
  130. package/internal/pickers/typings/helpers.d.ts +9 -9
  131. package/internal/pickers/utils.d.ts +7 -7
  132. package/internal/pickers/wrappers/DesktopTooltipWrapper.d.ts +4 -4
  133. package/internal/pickers/wrappers/DesktopWrapper.d.ts +16 -16
  134. package/internal/pickers/wrappers/MobileWrapper.d.ts +14 -14
  135. package/internal/pickers/wrappers/PickerStaticWrapper.d.ts +21 -21
  136. package/internal/pickers/wrappers/ResponsiveWrapper.d.ts +23 -23
  137. package/internal/pickers/wrappers/WrapperProps.d.ts +13 -13
  138. package/internal/pickers/wrappers/WrapperVariantContext.d.ts +11 -11
  139. package/internal/svg-icons/ArrowDropDown.d.ts +7 -7
  140. package/internal/svg-icons/ArrowLeft.d.ts +7 -7
  141. package/internal/svg-icons/ArrowRight.d.ts +7 -7
  142. package/internal/svg-icons/Calendar.d.ts +7 -7
  143. package/internal/svg-icons/Clock.d.ts +7 -7
  144. package/internal/svg-icons/DateRange.d.ts +7 -7
  145. package/internal/svg-icons/Pen.d.ts +7 -7
  146. package/internal/svg-icons/Time.d.ts +7 -7
  147. package/legacy/ClockPicker/ClockNumber.js +1 -0
  148. package/legacy/LoadingButton/LoadingButton.js +3 -1
  149. package/legacy/TreeItem/TreeItem.js +1 -1
  150. package/legacy/index.js +1 -1
  151. package/legacy/internal/pickers/PickersModalDialog.js +1 -1
  152. package/legacy/internal/pickers/hooks/usePickerState.js +11 -6
  153. package/modern/ClockPicker/ClockNumber.js +1 -0
  154. package/modern/LoadingButton/LoadingButton.js +3 -1
  155. package/modern/TreeItem/TreeItem.js +1 -1
  156. package/modern/index.js +1 -1
  157. package/modern/internal/pickers/PickersModalDialog.js +1 -1
  158. package/modern/internal/pickers/hooks/usePickerState.js +6 -4
  159. package/node/ClockPicker/ClockNumber.js +1 -0
  160. package/node/LoadingButton/LoadingButton.js +3 -1
  161. package/node/TreeItem/TreeItem.js +1 -1
  162. package/node/index.js +1 -1
  163. package/node/internal/pickers/PickersModalDialog.js +1 -1
  164. package/node/internal/pickers/hooks/usePickerState.js +6 -4
  165. package/package.json +7 -7
@@ -1,7 +1,7 @@
1
- declare const _default: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
2
- muiName: string;
3
- };
4
- /**
5
- * @ignore - internal component.
6
- */
7
- export default _default;
1
+ declare const _default: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
2
+ muiName: string;
3
+ };
4
+ /**
5
+ * @ignore - internal component.
6
+ */
7
+ export default _default;
@@ -23,6 +23,7 @@ var ClockNumberRoot = styled('span')(function (_ref) {
23
23
  alignItems: 'center',
24
24
  borderRadius: '50%',
25
25
  color: theme.palette.text.primary,
26
+ fontFamily: theme.typography.fontFamily,
26
27
  '&:focused': {
27
28
  backgroundColor: theme.palette.background.paper
28
29
  }
@@ -229,6 +229,8 @@ process.env.NODE_ENV !== "production" ? LoadingButton.propTypes
229
229
  * The variant to use.
230
230
  * @default 'text'
231
231
  */
232
- variant: PropTypes.oneOf(['contained', 'outlined', 'text'])
232
+ variant: PropTypes
233
+ /* @typescript-to-proptypes-ignore */
234
+ .oneOfType([PropTypes.oneOf(['contained', 'outlined', 'text']), PropTypes.string])
233
235
  } : void 0;
234
236
  export default LoadingButton;
@@ -95,7 +95,7 @@ var StyledTreeItemContent = styled(TreeItemContent, {
95
95
  }
96
96
  }), _defineProperty(_ref4, "& .".concat(treeItemClasses.label), _extends({
97
97
  width: '100%',
98
- // fixes overflow - see https://github.com/mui-org/material-ui/issues/27372
98
+ // fixes overflow - see https://github.com/mui/material-ui/issues/27372
99
99
  minWidth: 0,
100
100
  paddingLeft: 4,
101
101
  position: 'relative'
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.0.0-alpha.67
1
+ /** @license MUI v5.0.0-alpha.68
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -27,7 +27,7 @@ var PickersModalDialogActions = styled(DialogActions)(function (_ref) {
27
27
  var ownerState = _ref.ownerState;
28
28
  return _extends({}, (ownerState.clearable || ownerState.showTodayButton) && {
29
29
  // set justifyContent to default value to fix IE11 layout bug
30
- // see https://github.com/mui-org/material-ui-pickers/pull/267
30
+ // see https://github.com/mui/material-ui-pickers/pull/267
31
31
  justifyContent: 'flex-start',
32
32
  '& > *:first-of-type': {
33
33
  marginRight: 'auto'
@@ -44,19 +44,24 @@ export function usePickerState(props, valueManager) {
44
44
  type: 'reset',
45
45
  payload: parsedDateValue
46
46
  });
47
- } // Mobile keyboard view is a special case.
47
+ }
48
+
49
+ var _React$useState = React.useState(draftState.committed),
50
+ initialDate = _React$useState[0],
51
+ setInitialDate = _React$useState[1]; // Mobile keyboard view is a special case.
48
52
  // When it's open picker should work like closed, cause we are just showing text field
49
53
 
50
54
 
51
- var _React$useState = React.useState(false),
52
- isMobileKeyboardViewOpen = _React$useState[0],
53
- setMobileKeyboardViewOpen = _React$useState[1];
55
+ var _React$useState2 = React.useState(false),
56
+ isMobileKeyboardViewOpen = _React$useState2[0],
57
+ setMobileKeyboardViewOpen = _React$useState2[1];
54
58
 
55
59
  var acceptDate = React.useCallback(function (acceptedDate, needClosePicker) {
56
60
  onChange(acceptedDate);
57
61
 
58
62
  if (needClosePicker) {
59
63
  setIsOpen(false);
64
+ setInitialDate(acceptedDate);
60
65
 
61
66
  if (onAccept) {
62
67
  onAccept(acceptedDate);
@@ -73,7 +78,7 @@ export function usePickerState(props, valueManager) {
73
78
  return acceptDate(draftState.draft, true);
74
79
  },
75
80
  onDismiss: function onDismiss() {
76
- return setIsOpen(false);
81
+ return acceptDate(initialDate, true);
77
82
  },
78
83
  onSetToday: function onSetToday() {
79
84
  var now = utils.date();
@@ -84,7 +89,7 @@ export function usePickerState(props, valueManager) {
84
89
  acceptDate(now, !disableCloseOnSelect);
85
90
  }
86
91
  };
87
- }, [acceptDate, disableCloseOnSelect, isOpen, utils, draftState.draft, setIsOpen, valueManager.emptyValue]);
92
+ }, [acceptDate, disableCloseOnSelect, isOpen, utils, draftState.draft, valueManager.emptyValue, initialDate]);
88
93
  var pickerProps = React.useMemo(function () {
89
94
  return {
90
95
  date: draftState.draft,
@@ -21,6 +21,7 @@ const ClockNumberRoot = styled('span')(({
21
21
  alignItems: 'center',
22
22
  borderRadius: '50%',
23
23
  color: theme.palette.text.primary,
24
+ fontFamily: theme.typography.fontFamily,
24
25
  '&:focused': {
25
26
  backgroundColor: theme.palette.background.paper
26
27
  },
@@ -237,6 +237,8 @@ process.env.NODE_ENV !== "production" ? LoadingButton.propTypes
237
237
  * The variant to use.
238
238
  * @default 'text'
239
239
  */
240
- variant: PropTypes.oneOf(['contained', 'outlined', 'text'])
240
+ variant: PropTypes
241
+ /* @typescript-to-proptypes-ignore */
242
+ .oneOfType([PropTypes.oneOf(['contained', 'outlined', 'text']), PropTypes.string])
241
243
  } : void 0;
242
244
  export default LoadingButton;
@@ -102,7 +102,7 @@ const StyledTreeItemContent = styled(TreeItemContent, {
102
102
  },
103
103
  [`& .${treeItemClasses.label}`]: _extends({
104
104
  width: '100%',
105
- // fixes overflow - see https://github.com/mui-org/material-ui/issues/27372
105
+ // fixes overflow - see https://github.com/mui/material-ui/issues/27372
106
106
  minWidth: 0,
107
107
  paddingLeft: 4,
108
108
  position: 'relative'
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.0.0-alpha.67
1
+ /** @license MUI v5.0.0-alpha.68
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -26,7 +26,7 @@ const PickersModalDialogActions = styled(DialogActions)(({
26
26
  ownerState
27
27
  }) => _extends({}, (ownerState.clearable || ownerState.showTodayButton) && {
28
28
  // set justifyContent to default value to fix IE11 layout bug
29
- // see https://github.com/mui-org/material-ui-pickers/pull/267
29
+ // see https://github.com/mui/material-ui-pickers/pull/267
30
30
  justifyContent: 'flex-start',
31
31
  '& > *:first-of-type': {
32
32
  marginRight: 'auto'
@@ -43,9 +43,10 @@ export function usePickerState(props, valueManager) {
43
43
  type: 'reset',
44
44
  payload: parsedDateValue
45
45
  });
46
- } // Mobile keyboard view is a special case.
47
- // When it's open picker should work like closed, cause we are just showing text field
46
+ }
48
47
 
48
+ const [initialDate, setInitialDate] = React.useState(draftState.committed); // Mobile keyboard view is a special case.
49
+ // When it's open picker should work like closed, cause we are just showing text field
49
50
 
50
51
  const [isMobileKeyboardViewOpen, setMobileKeyboardViewOpen] = React.useState(false);
51
52
  const acceptDate = React.useCallback((acceptedDate, needClosePicker) => {
@@ -53,6 +54,7 @@ export function usePickerState(props, valueManager) {
53
54
 
54
55
  if (needClosePicker) {
55
56
  setIsOpen(false);
57
+ setInitialDate(acceptedDate);
56
58
 
57
59
  if (onAccept) {
58
60
  onAccept(acceptedDate);
@@ -63,7 +65,7 @@ export function usePickerState(props, valueManager) {
63
65
  open: isOpen,
64
66
  onClear: () => acceptDate(valueManager.emptyValue, true),
65
67
  onAccept: () => acceptDate(draftState.draft, true),
66
- onDismiss: () => setIsOpen(false),
68
+ onDismiss: () => acceptDate(initialDate, true),
67
69
  onSetToday: () => {
68
70
  const now = utils.date();
69
71
  dispatch({
@@ -72,7 +74,7 @@ export function usePickerState(props, valueManager) {
72
74
  });
73
75
  acceptDate(now, !disableCloseOnSelect);
74
76
  }
75
- }), [acceptDate, disableCloseOnSelect, isOpen, utils, draftState.draft, setIsOpen, valueManager.emptyValue]);
77
+ }), [acceptDate, disableCloseOnSelect, isOpen, utils, draftState.draft, valueManager.emptyValue, initialDate]);
76
78
  const pickerProps = React.useMemo(() => ({
77
79
  date: draftState.draft,
78
80
  isMobileKeyboardViewOpen,
@@ -44,6 +44,7 @@ const ClockNumberRoot = (0, _styles.styled)('span')(({
44
44
  alignItems: 'center',
45
45
  borderRadius: '50%',
46
46
  color: theme.palette.text.primary,
47
+ fontFamily: theme.typography.fontFamily,
47
48
  '&:focused': {
48
49
  backgroundColor: theme.palette.background.paper
49
50
  },
@@ -256,7 +256,9 @@ process.env.NODE_ENV !== "production" ? LoadingButton.propTypes
256
256
  * The variant to use.
257
257
  * @default 'text'
258
258
  */
259
- variant: _propTypes.default.oneOf(['contained', 'outlined', 'text'])
259
+ variant: _propTypes.default
260
+ /* @typescript-to-proptypes-ignore */
261
+ .oneOfType([_propTypes.default.oneOf(['contained', 'outlined', 'text']), _propTypes.default.string])
260
262
  } : void 0;
261
263
  var _default = LoadingButton;
262
264
  exports.default = _default;
@@ -129,7 +129,7 @@ const StyledTreeItemContent = (0, _styles.styled)(_TreeItemContent.default, {
129
129
  },
130
130
  [`& .${_treeItemClasses.default.label}`]: (0, _extends2.default)({
131
131
  width: '100%',
132
- // fixes overflow - see https://github.com/mui-org/material-ui/issues/27372
132
+ // fixes overflow - see https://github.com/mui/material-ui/issues/27372
133
133
  minWidth: 0,
134
134
  paddingLeft: 4,
135
135
  position: 'relative'
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.0.0-alpha.67
1
+ /** @license MUI v5.0.0-alpha.68
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -47,7 +47,7 @@ const PickersModalDialogActions = (0, _styles.styled)(_DialogActions.default)(({
47
47
  ownerState
48
48
  }) => (0, _extends2.default)({}, (ownerState.clearable || ownerState.showTodayButton) && {
49
49
  // set justifyContent to default value to fix IE11 layout bug
50
- // see https://github.com/mui-org/material-ui-pickers/pull/267
50
+ // see https://github.com/mui/material-ui-pickers/pull/267
51
51
  justifyContent: 'flex-start',
52
52
  '& > *:first-of-type': {
53
53
  marginRight: 'auto'
@@ -60,9 +60,10 @@ function usePickerState(props, valueManager) {
60
60
  type: 'reset',
61
61
  payload: parsedDateValue
62
62
  });
63
- } // Mobile keyboard view is a special case.
64
- // When it's open picker should work like closed, cause we are just showing text field
63
+ }
65
64
 
65
+ const [initialDate, setInitialDate] = React.useState(draftState.committed); // Mobile keyboard view is a special case.
66
+ // When it's open picker should work like closed, cause we are just showing text field
66
67
 
67
68
  const [isMobileKeyboardViewOpen, setMobileKeyboardViewOpen] = React.useState(false);
68
69
  const acceptDate = React.useCallback((acceptedDate, needClosePicker) => {
@@ -70,6 +71,7 @@ function usePickerState(props, valueManager) {
70
71
 
71
72
  if (needClosePicker) {
72
73
  setIsOpen(false);
74
+ setInitialDate(acceptedDate);
73
75
 
74
76
  if (onAccept) {
75
77
  onAccept(acceptedDate);
@@ -80,7 +82,7 @@ function usePickerState(props, valueManager) {
80
82
  open: isOpen,
81
83
  onClear: () => acceptDate(valueManager.emptyValue, true),
82
84
  onAccept: () => acceptDate(draftState.draft, true),
83
- onDismiss: () => setIsOpen(false),
85
+ onDismiss: () => acceptDate(initialDate, true),
84
86
  onSetToday: () => {
85
87
  const now = utils.date();
86
88
  dispatch({
@@ -89,7 +91,7 @@ function usePickerState(props, valueManager) {
89
91
  });
90
92
  acceptDate(now, !disableCloseOnSelect);
91
93
  }
92
- }), [acceptDate, disableCloseOnSelect, isOpen, utils, draftState.draft, setIsOpen, valueManager.emptyValue]);
94
+ }), [acceptDate, disableCloseOnSelect, isOpen, utils, draftState.draft, valueManager.emptyValue, initialDate]);
93
95
  const pickerProps = React.useMemo(() => ({
94
96
  date: draftState.draft,
95
97
  isMobileKeyboardViewOpen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/lab",
3
- "version": "5.0.0-alpha.67",
3
+ "version": "5.0.0-alpha.68",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Laboratory for new MUI modules.",
@@ -15,12 +15,12 @@
15
15
  ],
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "https://github.com/mui-org/material-ui.git",
18
+ "url": "https://github.com/mui/material-ui.git",
19
19
  "directory": "packages/mui-lab"
20
20
  },
21
21
  "license": "MIT",
22
22
  "bugs": {
23
- "url": "https://github.com/mui-org/material-ui/issues"
23
+ "url": "https://github.com/mui/material-ui/issues"
24
24
  },
25
25
  "homepage": "https://mui.com/components/about-the-lab/",
26
26
  "funding": {
@@ -55,14 +55,14 @@
55
55
  }
56
56
  },
57
57
  "dependencies": {
58
- "@babel/runtime": "^7.16.7",
58
+ "@babel/runtime": "^7.17.0",
59
59
  "@date-io/date-fns": "^2.11.0",
60
60
  "@date-io/dayjs": "^2.11.0",
61
61
  "@date-io/luxon": "^2.11.1",
62
62
  "@date-io/moment": "^2.11.0",
63
- "@mui/base": "5.0.0-alpha.67",
64
- "@mui/system": "^5.4.0",
65
- "@mui/utils": "^5.3.0",
63
+ "@mui/base": "5.0.0-alpha.68",
64
+ "@mui/system": "^5.4.1",
65
+ "@mui/utils": "^5.4.1",
66
66
  "clsx": "^1.1.1",
67
67
  "prop-types": "^15.7.2",
68
68
  "react-is": "^17.0.2",