@mui/x-date-pickers 6.16.2 → 6.17.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 (197) hide show
  1. package/AdapterDateFns/AdapterDateFns.js +1 -1
  2. package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +1 -1
  3. package/AdapterDayjs/AdapterDayjs.js +1 -1
  4. package/AdapterLuxon/AdapterLuxon.js +1 -1
  5. package/CHANGELOG.md +131 -0
  6. package/DateCalendar/DayCalendar.js +1 -3
  7. package/DateField/DateField.js +1 -1
  8. package/DatePicker/DatePicker.d.ts +10 -0
  9. package/DatePicker/DatePicker.js +10 -0
  10. package/DatePicker/DatePickerToolbar.d.ts +10 -0
  11. package/DatePicker/DatePickerToolbar.js +10 -0
  12. package/DateTimeField/DateTimeField.js +1 -1
  13. package/DateTimePicker/DateTimePickerTabs.d.ts +10 -0
  14. package/DateTimePicker/DateTimePickerTabs.js +11 -0
  15. package/DateTimePicker/DateTimePickerToolbar.d.ts +10 -0
  16. package/DateTimePicker/DateTimePickerToolbar.js +11 -0
  17. package/DayCalendarSkeleton/DayCalendarSkeleton.d.ts +1 -2
  18. package/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -2
  19. package/DesktopDatePicker/DesktopDatePicker.d.ts +10 -0
  20. package/DesktopDatePicker/DesktopDatePicker.js +10 -0
  21. package/DigitalClock/DigitalClock.d.ts +10 -0
  22. package/DigitalClock/DigitalClock.js +10 -0
  23. package/LocalizationProvider/LocalizationProvider.d.ts +12 -0
  24. package/LocalizationProvider/LocalizationProvider.js +12 -0
  25. package/MobileDatePicker/MobileDatePicker.d.ts +10 -0
  26. package/MobileDatePicker/MobileDatePicker.js +10 -0
  27. package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +10 -0
  28. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -0
  29. package/PickersActionBar/PickersActionBar.d.ts +10 -0
  30. package/PickersActionBar/PickersActionBar.js +10 -0
  31. package/PickersCalendarHeader/PickersCalendarHeader.d.ts +11 -0
  32. package/PickersCalendarHeader/PickersCalendarHeader.js +11 -0
  33. package/PickersDay/PickersDay.d.ts +1 -3
  34. package/PickersDay/PickersDay.js +1 -3
  35. package/PickersLayout/PickersLayout.d.ts +9 -0
  36. package/PickersLayout/PickersLayout.js +10 -0
  37. package/PickersShortcuts/PickersShortcuts.d.ts +9 -0
  38. package/PickersShortcuts/PickersShortcuts.js +9 -0
  39. package/StaticDatePicker/StaticDatePicker.d.ts +10 -0
  40. package/StaticDatePicker/StaticDatePicker.js +10 -0
  41. package/TimeClock/TimeClock.d.ts +4 -0
  42. package/TimeClock/TimeClock.js +4 -0
  43. package/TimeField/TimeField.js +1 -1
  44. package/TimePicker/TimePickerToolbar.d.ts +10 -0
  45. package/TimePicker/TimePickerToolbar.js +11 -0
  46. package/index.js +1 -1
  47. package/internals/components/FakeTextField/FakeTextField.d.ts +18 -3
  48. package/internals/components/FakeTextField/FakeTextField.js +39 -14
  49. package/internals/hooks/useField/useField.js +14 -4
  50. package/internals/hooks/useField/useField.utils.js +1 -1
  51. package/internals/hooks/useField/useFieldState.js +5 -8
  52. package/legacy/AdapterDateFns/AdapterDateFns.js +1 -1
  53. package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +1 -1
  54. package/legacy/AdapterDayjs/AdapterDayjs.js +1 -1
  55. package/legacy/AdapterLuxon/AdapterLuxon.js +1 -1
  56. package/legacy/DateCalendar/DayCalendar.js +1 -3
  57. package/legacy/DateField/DateField.js +1 -1
  58. package/legacy/DatePicker/DatePicker.js +10 -0
  59. package/legacy/DatePicker/DatePickerToolbar.js +10 -0
  60. package/legacy/DateTimeField/DateTimeField.js +1 -1
  61. package/legacy/DateTimePicker/DateTimePickerTabs.js +11 -0
  62. package/legacy/DateTimePicker/DateTimePickerToolbar.js +11 -0
  63. package/legacy/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -2
  64. package/legacy/DesktopDatePicker/DesktopDatePicker.js +10 -0
  65. package/legacy/DigitalClock/DigitalClock.js +10 -0
  66. package/legacy/LocalizationProvider/LocalizationProvider.js +12 -0
  67. package/legacy/MobileDatePicker/MobileDatePicker.js +10 -0
  68. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -0
  69. package/legacy/PickersActionBar/PickersActionBar.js +10 -0
  70. package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +11 -0
  71. package/legacy/PickersDay/PickersDay.js +1 -3
  72. package/legacy/PickersLayout/PickersLayout.js +10 -0
  73. package/legacy/PickersShortcuts/PickersShortcuts.js +9 -0
  74. package/legacy/StaticDatePicker/StaticDatePicker.js +10 -0
  75. package/legacy/TimeClock/TimeClock.js +4 -0
  76. package/legacy/TimeField/TimeField.js +1 -1
  77. package/legacy/TimePicker/TimePickerToolbar.js +11 -0
  78. package/legacy/index.js +1 -1
  79. package/legacy/internals/components/FakeTextField/FakeTextField.js +45 -15
  80. package/legacy/internals/hooks/useField/useField.js +14 -4
  81. package/legacy/internals/hooks/useField/useField.utils.js +1 -1
  82. package/legacy/internals/hooks/useField/useFieldState.js +5 -8
  83. package/modern/AdapterDateFns/AdapterDateFns.js +1 -1
  84. package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +1 -1
  85. package/modern/AdapterDayjs/AdapterDayjs.js +1 -1
  86. package/modern/AdapterLuxon/AdapterLuxon.js +1 -1
  87. package/modern/DateCalendar/DayCalendar.js +1 -3
  88. package/modern/DateField/DateField.js +1 -1
  89. package/modern/DatePicker/DatePicker.js +10 -0
  90. package/modern/DatePicker/DatePickerToolbar.js +10 -0
  91. package/modern/DateTimeField/DateTimeField.js +1 -1
  92. package/modern/DateTimePicker/DateTimePickerTabs.js +11 -0
  93. package/modern/DateTimePicker/DateTimePickerToolbar.js +11 -0
  94. package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -2
  95. package/modern/DesktopDatePicker/DesktopDatePicker.js +10 -0
  96. package/modern/DigitalClock/DigitalClock.js +10 -0
  97. package/modern/LocalizationProvider/LocalizationProvider.js +12 -0
  98. package/modern/MobileDatePicker/MobileDatePicker.js +10 -0
  99. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -0
  100. package/modern/PickersActionBar/PickersActionBar.js +10 -0
  101. package/modern/PickersCalendarHeader/PickersCalendarHeader.js +11 -0
  102. package/modern/PickersDay/PickersDay.js +1 -3
  103. package/modern/PickersLayout/PickersLayout.js +10 -0
  104. package/modern/PickersShortcuts/PickersShortcuts.js +9 -0
  105. package/modern/StaticDatePicker/StaticDatePicker.js +10 -0
  106. package/modern/TimeClock/TimeClock.js +4 -0
  107. package/modern/TimeField/TimeField.js +1 -1
  108. package/modern/TimePicker/TimePickerToolbar.js +11 -0
  109. package/modern/index.js +1 -1
  110. package/modern/internals/components/FakeTextField/FakeTextField.js +39 -14
  111. package/modern/internals/hooks/useField/useField.js +14 -4
  112. package/modern/internals/hooks/useField/useField.utils.js +1 -1
  113. package/modern/internals/hooks/useField/useFieldState.js +5 -8
  114. package/node/AdapterDateFns/AdapterDateFns.js +1 -1
  115. package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +1 -1
  116. package/node/AdapterDayjs/AdapterDayjs.js +1 -1
  117. package/node/AdapterLuxon/AdapterLuxon.js +1 -1
  118. package/node/DateCalendar/DateCalendar.js +2 -2
  119. package/node/DateCalendar/DayCalendar.js +3 -5
  120. package/node/DateCalendar/PickersFadeTransitionGroup.js +2 -2
  121. package/node/DateCalendar/PickersSlideTransition.js +2 -2
  122. package/node/DateCalendar/useCalendarState.js +2 -2
  123. package/node/DateCalendar/useIsDateDisabled.js +2 -2
  124. package/node/DateField/DateField.js +3 -3
  125. package/node/DatePicker/DatePicker.js +12 -2
  126. package/node/DatePicker/DatePickerToolbar.js +12 -2
  127. package/node/DatePicker/shared.js +2 -2
  128. package/node/DateTimeField/DateTimeField.js +3 -3
  129. package/node/DateTimePicker/DateTimePicker.js +2 -2
  130. package/node/DateTimePicker/DateTimePickerTabs.js +13 -2
  131. package/node/DateTimePicker/DateTimePickerToolbar.js +13 -2
  132. package/node/DateTimePicker/shared.js +2 -2
  133. package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +3 -4
  134. package/node/DesktopDatePicker/DesktopDatePicker.js +12 -2
  135. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  136. package/node/DesktopTimePicker/DesktopTimePicker.js +2 -2
  137. package/node/DigitalClock/DigitalClock.js +12 -2
  138. package/node/LocalizationProvider/LocalizationProvider.js +14 -2
  139. package/node/MobileDatePicker/MobileDatePicker.js +12 -2
  140. package/node/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  141. package/node/MobileTimePicker/MobileTimePicker.js +2 -2
  142. package/node/MonthCalendar/MonthCalendar.js +2 -2
  143. package/node/MonthCalendar/PickersMonth.js +2 -2
  144. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +12 -2
  145. package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -2
  146. package/node/PickersActionBar/PickersActionBar.js +12 -2
  147. package/node/PickersCalendarHeader/PickersCalendarHeader.js +13 -2
  148. package/node/PickersDay/PickersDay.js +3 -5
  149. package/node/PickersLayout/PickersLayout.js +12 -2
  150. package/node/PickersLayout/usePickerLayout.js +2 -2
  151. package/node/PickersShortcuts/PickersShortcuts.js +11 -2
  152. package/node/StaticDatePicker/StaticDatePicker.js +12 -2
  153. package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  154. package/node/StaticTimePicker/StaticTimePicker.js +2 -2
  155. package/node/TimeClock/Clock.js +2 -2
  156. package/node/TimeClock/ClockNumber.js +2 -2
  157. package/node/TimeClock/ClockNumbers.js +2 -2
  158. package/node/TimeClock/ClockPointer.js +2 -2
  159. package/node/TimeClock/TimeClock.js +6 -2
  160. package/node/TimeField/TimeField.js +3 -3
  161. package/node/TimePicker/TimePicker.js +2 -2
  162. package/node/TimePicker/TimePickerToolbar.js +13 -2
  163. package/node/TimePicker/shared.js +2 -2
  164. package/node/YearCalendar/PickersYear.js +2 -2
  165. package/node/YearCalendar/YearCalendar.js +2 -2
  166. package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -2
  167. package/node/dateViewRenderers/dateViewRenderers.js +2 -2
  168. package/node/hooks/useClearableField.js +2 -2
  169. package/node/icons/index.js +2 -2
  170. package/node/index.js +1 -1
  171. package/node/internals/components/FakeTextField/FakeTextField.js +43 -18
  172. package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -2
  173. package/node/internals/components/PickersModalDialog.js +2 -2
  174. package/node/internals/components/PickersPopper.js +2 -2
  175. package/node/internals/components/PickersToolbar.js +2 -2
  176. package/node/internals/components/PickersToolbarButton.js +2 -2
  177. package/node/internals/components/PickersToolbarText.js +2 -2
  178. package/node/internals/demo/DemoContainer.js +2 -2
  179. package/node/internals/hooks/date-helpers-hooks.js +2 -2
  180. package/node/internals/hooks/useClockReferenceDate.js +2 -2
  181. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -2
  182. package/node/internals/hooks/useField/useField.js +16 -6
  183. package/node/internals/hooks/useField/useField.utils.js +1 -1
  184. package/node/internals/hooks/useField/useFieldCharacterEditing.js +2 -2
  185. package/node/internals/hooks/useField/useFieldState.js +7 -10
  186. package/node/internals/hooks/useIsLandscape.js +2 -2
  187. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +2 -2
  188. package/node/internals/hooks/useOpenState.js +2 -2
  189. package/node/internals/hooks/usePicker/usePickerValue.js +2 -2
  190. package/node/internals/hooks/usePicker/usePickerViews.js +2 -2
  191. package/node/internals/hooks/useStaticPicker/useStaticPicker.js +2 -2
  192. package/node/internals/hooks/useUtils.js +2 -2
  193. package/node/internals/hooks/useValidation.js +2 -2
  194. package/node/internals/hooks/useValueWithTimezone.js +2 -2
  195. package/node/internals/hooks/useViews.js +2 -2
  196. package/node/timeViewRenderers/timeViewRenderers.js +2 -2
  197. package/package.json +5 -5
@@ -343,11 +343,9 @@ process.env.NODE_ENV !== "production" ? PickersDayRaw.propTypes = {
343
343
  } : void 0;
344
344
 
345
345
  /**
346
- *
347
346
  * Demos:
348
347
  *
349
- * - [Date Picker](https://mui.com/x/react-date-pickers/date-picker/)
350
- *
348
+ * - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
351
349
  * API:
352
350
  *
353
351
  * - [PickersDay API](https://mui.com/x/api/date-pickers/pickers-day/)
@@ -8,6 +8,15 @@ declare const PickersLayoutRoot: import("@emotion/styled").StyledComponent<impor
8
8
  }, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
9
9
  export { PickersLayoutRoot };
10
10
  export declare const PickersLayoutContentWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
11
+ /**
12
+ * Demos:
13
+ *
14
+ * - [Custom layout](https://mui.com/x/react-date-pickers/custom-layout/)
15
+ *
16
+ * API:
17
+ *
18
+ * - [PickersLayout API](https://mui.com/x/api/date-pickers/pickers-layout/)
19
+ */
11
20
  declare const PickersLayout: {
12
21
  <TValue, TDate, TView extends DateOrTimeViewWithMeridiem>(inProps: PickersLayoutProps<TValue, TDate, TView>): React.JSX.Element;
13
22
  propTypes: any;
@@ -70,6 +70,16 @@ export const PickersLayoutContentWrapper = styled('div', {
70
70
  display: 'flex',
71
71
  flexDirection: 'column'
72
72
  });
73
+
74
+ /**
75
+ * Demos:
76
+ *
77
+ * - [Custom layout](https://mui.com/x/react-date-pickers/custom-layout/)
78
+ *
79
+ * API:
80
+ *
81
+ * - [PickersLayout API](https://mui.com/x/api/date-pickers/pickers-layout/)
82
+ */
73
83
  const PickersLayout = function PickersLayout(inProps) {
74
84
  const props = useThemeProps({
75
85
  props: inProps,
@@ -29,6 +29,15 @@ export interface PickersShortcutsProps<TValue> extends ExportedPickersShortcutPr
29
29
  onChange: (newValue: TValue, changeImportance?: PickerShortcutChangeImportance, shortcut?: PickersShortcutsItemContext) => void;
30
30
  isValid: (value: TValue) => boolean;
31
31
  }
32
+ /**
33
+ * Demos:
34
+ *
35
+ * - [Shortcuts](https://mui.com/x/react-date-pickers/shortcuts/)
36
+ *
37
+ * API:
38
+ *
39
+ * - [PickersShortcuts API](https://mui.com/x/api/date-pickers/pickers-shortcuts/)
40
+ */
32
41
  declare function PickersShortcuts<TValue>(props: PickersShortcutsProps<TValue>): React.JSX.Element | null;
33
42
  declare namespace PickersShortcuts {
34
43
  var propTypes: any;
@@ -9,6 +9,15 @@ import ListItem from '@mui/material/ListItem';
9
9
  import Chip from '@mui/material/Chip';
10
10
  import { VIEW_HEIGHT } from '../internals/constants/dimensions';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
+ /**
13
+ * Demos:
14
+ *
15
+ * - [Shortcuts](https://mui.com/x/react-date-pickers/shortcuts/)
16
+ *
17
+ * API:
18
+ *
19
+ * - [PickersShortcuts API](https://mui.com/x/api/date-pickers/pickers-shortcuts/)
20
+ */
12
21
  function PickersShortcuts(props) {
13
22
  const {
14
23
  items,
@@ -3,5 +3,15 @@ import { StaticDatePickerProps } from './StaticDatePicker.types';
3
3
  type StaticDatePickerComponent = (<TDate>(props: StaticDatePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
4
4
  propTypes?: any;
5
5
  };
6
+ /**
7
+ * Demos:
8
+ *
9
+ * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
10
+ * - [Validation](https://mui.com/x/react-date-pickers/validation/)
11
+ *
12
+ * API:
13
+ *
14
+ * - [StaticDatePicker API](https://mui.com/x/api/date-pickers/static-date-picker/)
15
+ */
6
16
  declare const StaticDatePicker: StaticDatePickerComponent;
7
17
  export { StaticDatePicker };
@@ -6,6 +6,16 @@ import { renderDateViewCalendar } from '../dateViewRenderers';
6
6
  import { useStaticPicker } from '../internals/hooks/useStaticPicker';
7
7
  import { validateDate } from '../internals';
8
8
  import { singleItemValueManager } from '../internals/utils/valueManagers';
9
+ /**
10
+ * Demos:
11
+ *
12
+ * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
13
+ * - [Validation](https://mui.com/x/react-date-pickers/validation/)
14
+ *
15
+ * API:
16
+ *
17
+ * - [StaticDatePicker API](https://mui.com/x/api/date-pickers/static-date-picker/)
18
+ */
9
19
  const StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDatePicker(inProps, ref) {
10
20
  var _defaultizedProps$dis, _defaultizedProps$yea, _defaultizedProps$slo;
11
21
  const defaultizedProps = useDatePickerDefaultizedProps(inProps, 'MuiStaticDatePicker');
@@ -4,6 +4,10 @@ type TimeClockComponent = (<TDate>(props: TimeClockProps<TDate> & React.RefAttri
4
4
  propTypes?: any;
5
5
  };
6
6
  /**
7
+ * Demos:
8
+ *
9
+ * - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
10
+ * - [TimeClock](https://mui.com/x/react-date-pickers/time-clock/)
7
11
  *
8
12
  * API:
9
13
  *
@@ -52,6 +52,10 @@ const TimeClockArrowSwitcher = styled(PickersArrowSwitcher, {
52
52
  const TIME_CLOCK_DEFAULT_VIEWS = ['hours', 'minutes'];
53
53
 
54
54
  /**
55
+ * Demos:
56
+ *
57
+ * - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
58
+ * - [TimeClock](https://mui.com/x/react-date-pickers/time-clock/)
55
59
  *
56
60
  * API:
57
61
  *
@@ -118,7 +118,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
118
118
  /**
119
119
  * The color of the component.
120
120
  * It supports both default and custom theme colors, which can be added as shown in the
121
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
121
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
122
122
  * @default 'primary'
123
123
  */
124
124
  color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
@@ -11,6 +11,16 @@ export interface ExportedTimePickerToolbarProps extends ExportedBaseToolbarProps
11
11
  ampm?: boolean;
12
12
  ampmInClock?: boolean;
13
13
  }
14
+ /**
15
+ * Demos:
16
+ *
17
+ * - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
18
+ * - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)
19
+ *
20
+ * API:
21
+ *
22
+ * - [TimePickerToolbar API](https://mui.com/x/api/date-pickers/time-picker-toolbar/)
23
+ */
14
24
  declare function TimePickerToolbar<TDate extends unknown>(inProps: TimePickerToolbarProps<TDate>): React.JSX.Element;
15
25
  declare namespace TimePickerToolbar {
16
26
  var propTypes: any;
@@ -106,6 +106,17 @@ TimePickerToolbarAmPmSelection.propTypes = {
106
106
  ownerState: PropTypes.object.isRequired,
107
107
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
108
108
  };
109
+
110
+ /**
111
+ * Demos:
112
+ *
113
+ * - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
114
+ * - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)
115
+ *
116
+ * API:
117
+ *
118
+ * - [TimePickerToolbar API](https://mui.com/x/api/date-pickers/time-picker-toolbar/)
119
+ */
109
120
  function TimePickerToolbar(inProps) {
110
121
  const props = useThemeProps({
111
122
  props: inProps,
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.16.2
2
+ * @mui/x-date-pickers v6.17.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,7 +1,22 @@
1
1
  import * as React from 'react';
2
- import { FieldSection } from '../../../models';
2
+ export interface FakeTextFieldElement {
3
+ container: React.HTMLAttributes<HTMLSpanElement>;
4
+ content: React.HTMLAttributes<HTMLSpanElement>;
5
+ before: React.HTMLAttributes<HTMLSpanElement>;
6
+ after: React.HTMLAttributes<HTMLSpanElement>;
7
+ }
3
8
  interface FakeTextFieldProps {
4
- sections: FieldSection[];
9
+ elements: FakeTextFieldElement[];
10
+ valueStr: string;
11
+ onValueStrChange: React.ChangeEventHandler<HTMLInputElement>;
12
+ error: boolean;
13
+ id?: string;
14
+ InputProps: any;
15
+ inputProps: any;
16
+ disabled?: boolean;
17
+ autoFocus?: boolean;
18
+ ownerState?: any;
19
+ valueType: 'value' | 'placeholder';
5
20
  }
6
- export declare function FakeTextField(props: FakeTextFieldProps): React.JSX.Element;
21
+ export declare const FakeTextField: React.ForwardRefExoticComponent<FakeTextFieldProps & React.RefAttributes<HTMLDivElement>>;
7
22
  export {};
@@ -1,19 +1,44 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["elements", "valueStr", "onValueStrChange", "id", "error", "InputProps", "inputProps", "autoFocus", "disabled", "valueType", "ownerState"];
1
4
  import * as React from 'react';
2
- import Stack from '@mui/material/Stack';
5
+ import Box from '@mui/material/Box';
3
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { createElement as _createElement } from "react";
4
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
5
- export function FakeTextField(props) {
9
+ export const FakeTextField = /*#__PURE__*/React.forwardRef(function FakeTextField(props, ref) {
6
10
  const {
7
- sections
8
- } = props;
9
- return /*#__PURE__*/_jsx(Stack, {
10
- direction: "row",
11
- spacing: 1,
12
- children: sections.map(section => /*#__PURE__*/_jsxs(React.Fragment, {
13
- children: [section.startSeparator, /*#__PURE__*/_jsx("input", {
14
- value: section.value,
15
- onChange: () => {}
16
- }), section.endSeparator]
17
- }))
11
+ elements,
12
+ valueStr,
13
+ onValueStrChange,
14
+ id,
15
+ valueType
16
+ } = props,
17
+ other = _objectWithoutPropertiesLoose(props, _excluded);
18
+ return /*#__PURE__*/_jsxs(React.Fragment, {
19
+ children: [/*#__PURE__*/_jsx(Box, _extends({
20
+ ref: ref
21
+ }, other, {
22
+ style: {
23
+ display: 'inline-block',
24
+ border: '1px solid black',
25
+ borderRadius: 4,
26
+ padding: '2px 4px',
27
+ color: valueType === 'placeholder' ? 'grey' : 'black'
28
+ },
29
+ children: elements.map(({
30
+ container,
31
+ content,
32
+ before,
33
+ after
34
+ }, elementIndex) => /*#__PURE__*/_createElement("span", _extends({}, container, {
35
+ key: elementIndex
36
+ }), /*#__PURE__*/_jsx("span", _extends({}, before)), /*#__PURE__*/_jsx("span", _extends({}, content)), /*#__PURE__*/_jsx("span", _extends({}, after))))
37
+ })), /*#__PURE__*/_jsx("input", {
38
+ type: "hidden",
39
+ value: valueStr,
40
+ onChange: onValueStrChange,
41
+ id: id
42
+ })]
18
43
  });
19
- }
44
+ });
@@ -162,6 +162,11 @@ export const useField = params => {
162
162
  return;
163
163
  }
164
164
  const targetValue = event.target.value;
165
+ if (targetValue === '') {
166
+ resetCharacterQuery();
167
+ clearValue();
168
+ return;
169
+ }
165
170
  const eventData = event.nativeEvent.data;
166
171
  // Calling `.fill(04/11/2022)` in playwright will trigger a change event with the requested content to insert in `event.nativeEvent.data`
167
172
  // usual changes have only the currently typed character in the `event.nativeEvent.data`
@@ -201,8 +206,13 @@ export const useField = params => {
201
206
  const activeSectionEndRelativeToNewValue = cleanValueStr.length - prevValueStr.length + activeSection.end - cleanString(activeSection.endSeparator || '').length;
202
207
  keyPressed = cleanValueStr.slice(activeSection.start + cleanString(activeSection.startSeparator || '').length, activeSectionEndRelativeToNewValue);
203
208
  }
204
- if (isAndroid() && keyPressed.length === 0) {
205
- setTempAndroidValueStr(valueStr);
209
+ if (keyPressed.length === 0) {
210
+ if (isAndroid()) {
211
+ setTempAndroidValueStr(valueStr);
212
+ } else {
213
+ resetCharacterQuery();
214
+ clearActiveSection();
215
+ }
206
216
  return;
207
217
  }
208
218
  applyCharacterEditing({
@@ -260,7 +270,7 @@ export const useField = params => {
260
270
  }
261
271
 
262
272
  // Reset the value of the selected section
263
- case ['Backspace', 'Delete'].includes(event.key):
273
+ case event.key === 'Delete':
264
274
  {
265
275
  event.preventDefault();
266
276
  if (readOnly) {
@@ -321,7 +331,7 @@ export const useField = params => {
321
331
  // Fix scroll jumping on iOS browser: https://github.com/mui/mui-x/issues/8321
322
332
  const currentScrollTop = inputRef.current.scrollTop;
323
333
  // On multi input range pickers we want to update selection range only for the active input
324
- // This helps avoiding the focus jumping on Safari https://github.com/mui/mui-x/issues/9003
334
+ // This helps to avoid the focus jumping on Safari https://github.com/mui/mui-x/issues/9003
325
335
  // because WebKit implements the `setSelectionRange` based on the spec: https://bugs.webkit.org/show_bug.cgi?id=224425
326
336
  if (inputRef.current === getActiveElement(document)) {
327
337
  inputRef.current.setSelectionRange(selectionStart, selectionEnd);
@@ -300,7 +300,7 @@ export const doesSectionFormatHaveLeadingZeros = (utils, timezone, contentType,
300
300
  }
301
301
  case 'seconds':
302
302
  {
303
- return utils.formatByString(utils.setMinutes(now, 1), format).length > 1;
303
+ return utils.formatByString(utils.setSeconds(now, 1), format).length > 1;
304
304
  }
305
305
  default:
306
306
  {
@@ -117,6 +117,9 @@ export const useFieldState = params => {
117
117
  referenceValue,
118
118
  tempValueStrAndroid: null
119
119
  }));
120
+ if (valueManager.areValuesEqual(utils, state.value, value)) {
121
+ return;
122
+ }
120
123
  const context = {
121
124
  validationError: validator({
122
125
  adapter,
@@ -138,9 +141,6 @@ export const useFieldState = params => {
138
141
  return addPositionPropertiesToSections(newSections, isRTL);
139
142
  };
140
143
  const clearValue = () => {
141
- if (valueManager.areValuesEqual(utils, state.value, valueManager.emptyValue)) {
142
- return;
143
- }
144
144
  publishValue({
145
145
  value: valueManager.emptyValue,
146
146
  referenceValue: state.referenceValue,
@@ -152,14 +152,11 @@ export const useFieldState = params => {
152
152
  return;
153
153
  }
154
154
  const activeSection = state.sections[selectedSectionIndexes.startIndex];
155
- if (activeSection.value === '') {
156
- return;
157
- }
158
155
  const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);
159
156
  const nonEmptySectionCountBefore = activeDateManager.getSections(state.sections).filter(section => section.value !== '').length;
160
- const isTheOnlyNonEmptySection = nonEmptySectionCountBefore === 1;
157
+ const hasNoOtherNonEmptySections = nonEmptySectionCountBefore === (activeSection.value === '' ? 0 : 1);
161
158
  const newSections = setSectionValue(selectedSectionIndexes.startIndex, '');
162
- const newActiveDate = isTheOnlyNonEmptySection ? null : utils.date(new Date(''));
159
+ const newActiveDate = hasNoOtherNonEmptySections ? null : utils.date(new Date(''));
163
160
  const newValues = activeDateManager.getNewValuesFromNewActiveDate(newActiveDate);
164
161
  if ((newActiveDate != null && !utils.isValid(newActiveDate)) !== (activeDateManager.date != null && !utils.isValid(activeDateManager.date))) {
165
162
  publishValue(_extends({}, newValues, {
@@ -231,7 +231,7 @@ var defaultFormats = {
231
231
  monthShort: 'MMM',
232
232
  dayOfMonth: 'd',
233
233
  weekday: 'EEEE',
234
- weekdayShort: 'EEE',
234
+ weekdayShort: 'EEEEEE',
235
235
  hours24h: 'HH',
236
236
  hours12h: 'hh',
237
237
  meridiem: 'aa',
@@ -231,7 +231,7 @@ var defaultFormats = {
231
231
  monthShort: 'MMM',
232
232
  dayOfMonth: 'd',
233
233
  weekday: 'EEEE',
234
- weekdayShort: 'EEE',
234
+ weekdayShort: 'EEEEEE',
235
235
  hours24h: 'HH',
236
236
  hours12h: 'hh',
237
237
  meridiem: 'aa',
@@ -102,7 +102,7 @@ var defaultFormats = {
102
102
  monthShort: 'MMM',
103
103
  dayOfMonth: 'D',
104
104
  weekday: 'dddd',
105
- weekdayShort: 'ddd',
105
+ weekdayShort: 'dd',
106
106
  hours24h: 'HH',
107
107
  hours12h: 'hh',
108
108
  meridiem: 'A',
@@ -116,7 +116,7 @@ var defaultFormats = {
116
116
  monthShort: 'MMM',
117
117
  dayOfMonth: 'd',
118
118
  weekday: 'cccc',
119
- weekdayShort: 'ccc',
119
+ weekdayShort: 'ccccc',
120
120
  hours24h: 'HH',
121
121
  hours12h: 'hh',
122
122
  meridiem: 'a',
@@ -458,9 +458,7 @@ export function DayCalendar(inProps) {
458
458
  children: localeText.calendarWeekNumberHeaderText
459
459
  }), getWeekdays(utils, now).map(function (weekday, i) {
460
460
  var _dayOfWeekFormatter;
461
- // regression-prevention:
462
- // since 'weekdayShort' now always returns an abbreviated form we slice the first 2 letters from it.
463
- var day = utils.format(weekday, 'weekdayShort').slice(0, 2);
461
+ var day = utils.format(weekday, 'weekdayShort');
464
462
  return /*#__PURE__*/_jsx(PickersCalendarWeekDayLabel, {
465
463
  variant: "caption",
466
464
  role: "columnheader",
@@ -106,7 +106,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
106
106
  /**
107
107
  * The color of the component.
108
108
  * It supports both default and custom theme colors, which can be added as shown in the
109
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
109
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
110
110
  * @default 'primary'
111
111
  */
112
112
  color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
@@ -10,6 +10,16 @@ import { DesktopDatePicker } from '../DesktopDatePicker';
10
10
  import { MobileDatePicker } from '../MobileDatePicker';
11
11
  import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ * Demos:
15
+ *
16
+ * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
17
+ * - [Validation](https://mui.com/x/react-date-pickers/validation/)
18
+ *
19
+ * API:
20
+ *
21
+ * - [DatePicker API](https://mui.com/x/api/date-pickers/date-picker/)
22
+ */
13
23
  var DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker(inProps, ref) {
14
24
  var props = useThemeProps({
15
25
  props: inProps,
@@ -42,6 +42,16 @@ var DatePickerToolbarTitle = styled(Typography, {
42
42
  margin: 'auto 16px auto auto'
43
43
  });
44
44
  });
45
+ /**
46
+ * Demos:
47
+ *
48
+ * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
49
+ * - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)
50
+ *
51
+ * API:
52
+ *
53
+ * - [DatePickerToolbar API](https://mui.com/x/api/date-pickers/date-picker-toolbar/)
54
+ */
45
55
  var DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePickerToolbar(inProps, ref) {
46
56
  var props = useThemeProps({
47
57
  props: inProps,
@@ -111,7 +111,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
111
111
  /**
112
112
  * The color of the component.
113
113
  * It supports both default and custom theme colors, which can be added as shown in the
114
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
114
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
115
115
  * @default 'primary'
116
116
  */
117
117
  color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
@@ -48,6 +48,17 @@ var DateTimePickerTabsRoot = styled(Tabs, {
48
48
  })
49
49
  };
50
50
  });
51
+
52
+ /**
53
+ * Demos:
54
+ *
55
+ * - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
56
+ * - [Custom slots and subcomponents](https://mui.com/x/react-date-pickers/custom-components/)
57
+ *
58
+ * API:
59
+ *
60
+ * - [DateTimePickerTabs API](https://mui.com/x/api/date-pickers/date-time-picker-tabs/)
61
+ */
51
62
  var DateTimePickerTabs = function DateTimePickerTabs(inProps) {
52
63
  var props = useThemeProps({
53
64
  props: inProps,
@@ -161,6 +161,17 @@ var DateTimePickerToolbarAmPmSelection = styled('div', {
161
161
  fontSize: 17
162
162
  }));
163
163
  });
164
+
165
+ /**
166
+ * Demos:
167
+ *
168
+ * - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
169
+ * - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)
170
+ *
171
+ * API:
172
+ *
173
+ * - [DateTimePickerToolbar API](https://mui.com/x/api/date-pickers/date-time-picker-toolbar/)
174
+ */
164
175
  function DateTimePickerToolbar(inProps) {
165
176
  var props = useThemeProps({
166
177
  props: inProps,
@@ -65,10 +65,9 @@ DayCalendarSkeletonDay.propTypes = {
65
65
  var monthMap = [[0, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 0, 0, 0]];
66
66
 
67
67
  /**
68
- *
69
68
  * Demos:
70
69
  *
71
- * - [Date Picker](https://mui.com/x/react-date-pickers/date-picker/)
70
+ * - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
72
71
  *
73
72
  * API:
74
73
  *
@@ -12,6 +12,16 @@ import { DateField } from '../DateField';
12
12
  import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
13
13
  import { renderDateViewCalendar } from '../dateViewRenderers';
14
14
  import { resolveDateFormat } from '../internals/utils/date-utils';
15
+ /**
16
+ * Demos:
17
+ *
18
+ * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
19
+ * - [Validation](https://mui.com/x/react-date-pickers/validation/)
20
+ *
21
+ * API:
22
+ *
23
+ * - [DesktopDatePicker API](https://mui.com/x/api/date-pickers/desktop-date-picker/)
24
+ */
15
25
  var DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePicker(inProps, ref) {
16
26
  var _defaultizedProps$yea, _defaultizedProps$slo2, _props$localeText$ope, _props$localeText;
17
27
  var localeText = useLocaleText();
@@ -86,6 +86,16 @@ var DigitalClockItem = styled(MenuItem, {
86
86
  }
87
87
  };
88
88
  });
89
+ /**
90
+ * Demos:
91
+ *
92
+ * - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
93
+ * - [DigitalClock](https://mui.com/x/react-date-pickers/digital-clock/)
94
+ *
95
+ * API:
96
+ *
97
+ * - [DigitalClock API](https://mui.com/x/api/date-pickers/digital-clock/)
98
+ */
89
99
  export var DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(inProps, ref) {
90
100
  var _ref3, _slots$digitalClockIt, _slotProps$digitalClo;
91
101
  var utils = useUtils();
@@ -9,6 +9,18 @@ export var MuiPickersAdapterContext = /*#__PURE__*/React.createContext(null);
9
9
  if (process.env.NODE_ENV !== 'production') {
10
10
  MuiPickersAdapterContext.displayName = 'MuiPickersAdapterContext';
11
11
  }
12
+ /**
13
+ * Demos:
14
+ *
15
+ * - [Date format and localization](https://mui.com/x/react-date-pickers/adapters-locale/)
16
+ * - [Calendar systems](https://mui.com/x/react-date-pickers/calendar-systems/)
17
+ * - [Translated components](https://mui.com/x/react-date-pickers/localization/)
18
+ * - [UTC and timezones](https://mui.com/x/react-date-pickers/timezone/)
19
+ *
20
+ * API:
21
+ *
22
+ * - [LocalizationProvider API](https://mui.com/x/api/date-pickers/localization-provider/)
23
+ */
12
24
  export var LocalizationProvider = function LocalizationProvider(inProps) {
13
25
  var _React$useContext;
14
26
  var inLocaleText = inProps.localeText,
@@ -11,6 +11,16 @@ import { extractValidationProps } from '../internals/utils/validation/extractVal
11
11
  import { singleItemValueManager } from '../internals/utils/valueManagers';
12
12
  import { renderDateViewCalendar } from '../dateViewRenderers';
13
13
  import { resolveDateFormat } from '../internals/utils/date-utils';
14
+ /**
15
+ * Demos:
16
+ *
17
+ * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
18
+ * - [Validation](https://mui.com/x/react-date-pickers/validation/)
19
+ *
20
+ * API:
21
+ *
22
+ * - [MobileDatePicker API](https://mui.com/x/api/date-pickers/mobile-date-picker/)
23
+ */
14
24
  var MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker(inProps, ref) {
15
25
  var _defaultizedProps$slo2, _props$localeText$ope, _props$localeText;
16
26
  var localeText = useLocaleText();
@@ -45,6 +45,16 @@ var MultiSectionDigitalClockRoot = styled(PickerViewRoot, {
45
45
  borderBottom: "1px solid ".concat((theme.vars || theme).palette.divider)
46
46
  };
47
47
  });
48
+ /**
49
+ * Demos:
50
+ *
51
+ * - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
52
+ * - [DigitalClock](https://mui.com/x/react-date-pickers/digital-clock/)
53
+ *
54
+ * API:
55
+ *
56
+ * - [MultiSectionDigitalClock API](https://mui.com/x/api/date-pickers/multi-section-digital-clock/)
57
+ */
48
58
  export var MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function MultiSectionDigitalClock(inProps, ref) {
49
59
  var utils = useUtils();
50
60
  var props = useThemeProps({
@@ -7,6 +7,16 @@ import Button from '@mui/material/Button';
7
7
  import DialogActions from '@mui/material/DialogActions';
8
8
  import { useLocaleText } from '../internals/hooks/useUtils';
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
+ /**
11
+ * Demos:
12
+ *
13
+ * - [Custom slots and subcomponents](https://mui.com/x/react-date-pickers/custom-components/)
14
+ * - [Custom layout](https://mui.com/x/react-date-pickers/custom-layout/)
15
+ *
16
+ * API:
17
+ *
18
+ * - [PickersActionBar API](https://mui.com/x/api/date-pickers/pickers-action-bar/)
19
+ */
10
20
  function PickersActionBar(props) {
11
21
  var onAccept = props.onAccept,
12
22
  onClear = props.onClear,