@mui/x-date-pickers-pro 7.22.3 → 8.0.0-alpha.1

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 (170) hide show
  1. package/CHANGELOG.md +348 -12
  2. package/DateRangeCalendar/DateRangeCalendar.d.ts +1 -2
  3. package/DateRangeCalendar/DateRangeCalendar.js +24 -22
  4. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +24 -36
  5. package/DateRangeCalendar/useDragRange.d.ts +10 -9
  6. package/DateRangeCalendar/useDragRange.js +3 -3
  7. package/DateRangePicker/DateRangePicker.d.ts +1 -2
  8. package/DateRangePicker/DateRangePicker.js +12 -8
  9. package/DateRangePicker/DateRangePicker.types.d.ts +12 -6
  10. package/DateRangePicker/DateRangePickerToolbar.d.ts +3 -5
  11. package/DateRangePicker/DateRangePickerToolbar.js +2 -4
  12. package/DateRangePicker/index.d.ts +1 -1
  13. package/DateRangePicker/shared.d.ts +12 -12
  14. package/DateRangePickerDay/DateRangePickerDay.d.ts +2 -3
  15. package/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -2
  16. package/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
  17. package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +12 -6
  18. package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +1 -2
  19. package/DateTimeRangePicker/DateTimeRangePickerTabs.js +2 -2
  20. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +8 -9
  21. package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +4 -6
  22. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -7
  23. package/DateTimeRangePicker/index.d.ts +1 -1
  24. package/DateTimeRangePicker/shared.d.ts +13 -13
  25. package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +1 -2
  26. package/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
  27. package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +6 -7
  28. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +1 -2
  29. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
  30. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +6 -7
  31. package/MobileDateRangePicker/MobileDateRangePicker.d.ts +1 -2
  32. package/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
  33. package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +6 -7
  34. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +1 -2
  35. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
  36. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +6 -7
  37. package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +1 -2
  38. package/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
  39. package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +9 -10
  40. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +1 -2
  41. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
  42. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +9 -10
  43. package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +1 -2
  44. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
  45. package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +9 -10
  46. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.d.ts +1 -2
  47. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
  48. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.d.ts +3 -3
  49. package/README.md +4 -4
  50. package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +1 -2
  51. package/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
  52. package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +8 -8
  53. package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -2
  54. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +1 -2
  55. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
  56. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +8 -8
  57. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -2
  58. package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +1 -2
  59. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
  60. package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +8 -8
  61. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -2
  62. package/StaticDateRangePicker/StaticDateRangePicker.d.ts +1 -2
  63. package/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
  64. package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +6 -7
  65. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -3
  66. package/index.d.ts +0 -7
  67. package/index.js +1 -7
  68. package/internals/hooks/models/useRangePicker.d.ts +6 -7
  69. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -2
  70. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +22 -16
  71. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +6 -7
  72. package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +16 -14
  73. package/internals/hooks/useEnrichedRangePickerFieldProps.js +13 -13
  74. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -2
  75. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +23 -17
  76. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +6 -7
  77. package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +1 -1
  78. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +1 -2
  79. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +2 -0
  80. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +1 -2
  81. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +2 -0
  82. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +1 -2
  83. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +3 -1
  84. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -2
  85. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +6 -6
  86. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +8 -9
  87. package/internals/models/dateRange.d.ts +3 -4
  88. package/internals/models/dateTimeRange.d.ts +5 -10
  89. package/internals/models/fields.d.ts +26 -0
  90. package/internals/models/fields.js +1 -0
  91. package/internals/models/timeRange.d.ts +5 -9
  92. package/internals/utils/date-range-manager.d.ts +11 -10
  93. package/internals/utils/date-utils.d.ts +5 -5
  94. package/internals/utils/releaseInfo.js +1 -1
  95. package/internals/utils/valueManagers.d.ts +5 -6
  96. package/models/dateRange.d.ts +4 -5
  97. package/models/fields.d.ts +5 -32
  98. package/models/range.d.ts +1 -1
  99. package/modern/DateRangeCalendar/DateRangeCalendar.js +24 -22
  100. package/modern/DateRangeCalendar/useDragRange.js +3 -3
  101. package/modern/DateRangePicker/DateRangePicker.js +12 -8
  102. package/modern/DateRangePicker/DateRangePickerToolbar.js +2 -4
  103. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
  104. package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +2 -2
  105. package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -7
  106. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
  107. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
  108. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
  109. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
  110. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
  111. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
  112. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
  113. package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
  114. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
  115. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
  116. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
  117. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
  118. package/modern/index.js +1 -7
  119. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +22 -16
  120. package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +13 -13
  121. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +23 -17
  122. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +2 -0
  123. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +2 -0
  124. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +3 -1
  125. package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +6 -6
  126. package/modern/internals/models/fields.js +1 -0
  127. package/modern/internals/utils/releaseInfo.js +1 -1
  128. package/modern/validation/validateDateRange.js +5 -0
  129. package/modern/validation/validateDateTimeRange.js +5 -0
  130. package/modern/validation/validateTimeRange.js +5 -0
  131. package/node/DateRangeCalendar/DateRangeCalendar.js +23 -21
  132. package/node/DateRangeCalendar/useDragRange.js +3 -3
  133. package/node/DateRangePicker/DateRangePicker.js +12 -8
  134. package/node/DateRangePicker/DateRangePickerToolbar.js +1 -3
  135. package/node/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
  136. package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +1 -1
  137. package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +6 -6
  138. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
  139. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
  140. package/node/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
  141. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
  142. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
  143. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
  144. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
  145. package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +1 -1
  146. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
  147. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
  148. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
  149. package/node/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
  150. package/node/index.js +2 -41
  151. package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +21 -15
  152. package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +12 -12
  153. package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -15
  154. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +2 -0
  155. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +2 -0
  156. package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +3 -1
  157. package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +5 -5
  158. package/node/internals/models/fields.js +5 -0
  159. package/node/internals/utils/releaseInfo.js +1 -1
  160. package/node/validation/validateDateRange.js +4 -0
  161. package/node/validation/validateDateTimeRange.js +4 -0
  162. package/node/validation/validateTimeRange.js +4 -0
  163. package/package.json +7 -7
  164. package/themeAugmentation/props.d.ts +16 -17
  165. package/validation/validateDateRange.d.ts +9 -5
  166. package/validation/validateDateRange.js +5 -0
  167. package/validation/validateDateTimeRange.d.ts +11 -6
  168. package/validation/validateDateTimeRange.js +5 -0
  169. package/validation/validateTimeRange.d.ts +9 -4
  170. package/validation/validateTimeRange.js +5 -0
@@ -5,10 +5,10 @@ import * as React from 'react';
5
5
  import resolveComponentProps from '@mui/utils/resolveComponentProps';
6
6
  import useEventCallback from '@mui/utils/useEventCallback';
7
7
  import useForkRef from '@mui/utils/useForkRef';
8
- import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
8
+ import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
9
9
  import { onSpaceOrEnter } from '@mui/x-date-pickers/internals';
10
10
  const useMultiInputFieldSlotProps = ({
11
- wrapperVariant,
11
+ variant,
12
12
  open,
13
13
  actions,
14
14
  readOnly,
@@ -28,12 +28,12 @@ const useMultiInputFieldSlotProps = ({
28
28
  startFieldRef,
29
29
  endFieldRef
30
30
  }) => {
31
- const translations = usePickersTranslations();
31
+ const translations = usePickerTranslations();
32
32
  const handleStartFieldRef = useForkRef(fieldProps.unstableStartFieldRef, startFieldRef);
33
33
  const handleEndFieldRef = useForkRef(fieldProps.unstableEndFieldRef, endFieldRef);
34
34
  const previousRangePosition = React.useRef(rangePosition);
35
35
  React.useEffect(() => {
36
- if (!open) {
36
+ if (!open || variant === 'mobile') {
37
37
  return;
38
38
  }
39
39
  const currentFieldRef = rangePosition === 'start' ? startFieldRef : endFieldRef;
@@ -49,7 +49,7 @@ const useMultiInputFieldSlotProps = ({
49
49
  // use the current view or `0` when the range position has just been swapped
50
50
  previousRangePosition.current === rangePosition ? currentView : 0);
51
51
  previousRangePosition.current = rangePosition;
52
- }, [rangePosition, open, currentView, startFieldRef, endFieldRef]);
52
+ }, [rangePosition, open, currentView, startFieldRef, endFieldRef, variant]);
53
53
  const openRangeStartSelection = event => {
54
54
  event.stopPropagation();
55
55
  onRangePositionChange('start');
@@ -98,7 +98,7 @@ const useMultiInputFieldSlotProps = ({
98
98
  focused: open ? rangePosition === 'start' : undefined
99
99
  }, !readOnly && !fieldProps.disabled && {
100
100
  onClick: openRangeStartSelection
101
- }, wrapperVariant === 'mobile' && {
101
+ }, variant === 'mobile' && {
102
102
  readOnly: true
103
103
  });
104
104
  if (anchorRef) {
@@ -114,7 +114,7 @@ const useMultiInputFieldSlotProps = ({
114
114
  focused: open ? rangePosition === 'end' : undefined
115
115
  }, !readOnly && !fieldProps.disabled && {
116
116
  onClick: openRangeEndSelection
117
- }, wrapperVariant === 'mobile' && {
117
+ }, variant === 'mobile' && {
118
118
  readOnly: true
119
119
  });
120
120
  InputProps = resolvedComponentProps?.InputProps;
@@ -146,7 +146,7 @@ const useMultiInputFieldSlotProps = ({
146
146
  return enrichedFieldProps;
147
147
  };
148
148
  const useSingleInputFieldSlotProps = ({
149
- wrapperVariant,
149
+ variant,
150
150
  open,
151
151
  actions,
152
152
  readOnly,
@@ -166,7 +166,7 @@ const useSingleInputFieldSlotProps = ({
166
166
  }) => {
167
167
  const handleFieldRef = useForkRef(fieldProps.unstableFieldRef, startFieldRef, endFieldRef);
168
168
  React.useEffect(() => {
169
- if (!open || !startFieldRef.current) {
169
+ if (!open || !startFieldRef.current || variant === 'mobile') {
170
170
  return;
171
171
  }
172
172
  if (startFieldRef.current.isFieldFocused()) {
@@ -179,7 +179,7 @@ const useSingleInputFieldSlotProps = ({
179
179
  const newSelectedSection = rangePosition === 'start' ? sections.indexOf(currentView) : sections.lastIndexOf(currentView);
180
180
  startFieldRef.current?.focusField(newSelectedSection);
181
181
  }
182
- }, [rangePosition, open, currentView, startFieldRef]);
182
+ }, [rangePosition, open, currentView, startFieldRef, variant]);
183
183
  const updateRangePosition = () => {
184
184
  if (!startFieldRef.current?.isFieldFocused()) {
185
185
  return;
@@ -208,8 +208,8 @@ const useSingleInputFieldSlotProps = ({
208
208
  });
209
209
  const slotProps = _extends({}, fieldProps.slotProps, {
210
210
  textField: pickerSlotProps?.textField,
211
- clearButton: pickerSlots?.clearButton,
212
- clearIcon: pickerSlots?.clearIcon
211
+ clearButton: pickerSlotProps?.clearButton,
212
+ clearIcon: pickerSlotProps?.clearIcon
213
213
  });
214
214
  const enrichedFieldProps = _extends({}, fieldProps, {
215
215
  slots,
@@ -225,7 +225,7 @@ const useSingleInputFieldSlotProps = ({
225
225
  focused: open ? true : undefined
226
226
  }, labelId != null && {
227
227
  id: labelId
228
- }, wrapperVariant === 'mobile' && {
228
+ }, variant === 'mobile' && {
229
229
  readOnly: true
230
230
  }, !readOnly && !fieldProps.disabled && {
231
231
  onClick: openPicker
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
3
- import { PickerValidDate } from '@mui/x-date-pickers/models';
4
3
  import { UseMobileRangePickerParams, UseMobileRangePickerProps } from './useMobileRangePicker.types';
5
- export declare const useMobileRangePicker: <TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TDate, TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({ props, ...pickerParams }: UseMobileRangePickerParams<TDate, TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
4
+ export declare const useMobileRangePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({ props, ...pickerParams }: UseMobileRangePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
6
5
  renderPicker: () => React.JSX.Element;
7
6
  };
@@ -5,8 +5,8 @@ import * as React from 'react';
5
5
  import useSlotProps from '@mui/utils/useSlotProps';
6
6
  import { useLicenseVerifier } from '@mui/x-license';
7
7
  import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
8
- import { usePicker, PickersModalDialog, PickersProvider } from '@mui/x-date-pickers/internals';
9
- import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
8
+ import { usePicker, PickersModalDialog, PickerProvider } from '@mui/x-date-pickers/internals';
9
+ import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
10
10
  import useId from '@mui/utils/useId';
11
11
  import { useEnrichedRangePickerFieldProps } from "../useEnrichedRangePickerFieldProps.js";
12
12
  import { getReleaseInfo } from "../../utils/releaseInfo.js";
@@ -46,19 +46,21 @@ export const useMobileRangePicker = _ref => {
46
46
  onRangePositionChange
47
47
  } = useRangePosition(props, fieldType === 'single-input' ? startFieldRef : undefined);
48
48
  const labelId = useId();
49
- const contextTranslations = usePickersTranslations();
49
+ const contextTranslations = usePickerTranslations();
50
50
  const {
51
51
  open,
52
52
  actions,
53
53
  layoutProps,
54
+ providerProps,
54
55
  renderCurrentView,
55
56
  fieldProps: pickerFieldProps,
56
- contextValue
57
+ ownerState
57
58
  } = usePicker(_extends({}, pickerParams, {
58
59
  props,
59
- wrapperVariant: 'mobile',
60
+ variant: 'mobile',
60
61
  autoFocusView: true,
61
62
  fieldRef: rangePosition === 'start' ? startFieldRef : endFieldRef,
63
+ localeText,
62
64
  additionalViewProps: {
63
65
  rangePosition,
64
66
  onRangePositionChange
@@ -68,26 +70,32 @@ export const useMobileRangePicker = _ref => {
68
70
  const fieldProps = useSlotProps({
69
71
  elementType: Field,
70
72
  externalSlotProps: innerSlotProps?.field,
71
- additionalProps: _extends({}, pickerFieldProps, {
73
+ additionalProps: _extends({
74
+ // Internal props
72
75
  readOnly: readOnly ?? true,
73
76
  disabled,
74
- className,
75
- sx,
76
77
  format,
77
78
  formatDensity,
78
79
  enableAccessibleFieldDOMStructure,
79
80
  selectedSections,
80
81
  onSelectedSectionsChange,
81
82
  timezone
82
- }, fieldType === 'single-input' ? {
83
- inputRef,
83
+ }, pickerFieldProps, {
84
+ // onChange and value
85
+
86
+ // Forwarded props
87
+ className,
88
+ sx
89
+ }, fieldType === 'single-input' && !!inputRef && {
90
+ inputRef
91
+ }, fieldType === 'single-input' && {
84
92
  name
85
- } : {}),
86
- ownerState: props
93
+ }),
94
+ ownerState
87
95
  });
88
96
  const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
89
97
  const enrichedFieldProps = useEnrichedRangePickerFieldProps({
90
- wrapperVariant: 'mobile',
98
+ variant: 'mobile',
91
99
  fieldType,
92
100
  open,
93
101
  actions,
@@ -137,9 +145,7 @@ export const useMobileRangePicker = _ref => {
137
145
  'aria-labelledby': labelledById
138
146
  }, innerSlotProps?.mobilePaper)
139
147
  });
140
- const renderPicker = () => /*#__PURE__*/_jsxs(PickersProvider, {
141
- contextValue: contextValue,
142
- localeText: localeText,
148
+ const renderPicker = () => /*#__PURE__*/_jsxs(PickerProvider, _extends({}, providerProps, {
143
149
  children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldProps)), /*#__PURE__*/_jsx(PickersModalDialog, _extends({}, actions, {
144
150
  open: open,
145
151
  slots: slots,
@@ -150,7 +156,7 @@ export const useMobileRangePicker = _ref => {
150
156
  children: renderCurrentView()
151
157
  }))
152
158
  }))]
153
- });
159
+ }));
154
160
  return {
155
161
  renderPicker
156
162
  };
@@ -1,25 +1,24 @@
1
1
  import { PickersModalDialogSlots, PickersModalDialogSlotProps, UsePickerViewsProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
2
- import { PickerValidDate } from '@mui/x-date-pickers/models';
3
2
  import { RangeOnlyPickerProps, RangePickerAdditionalViewProps, UseRangePickerParams, UseRangePickerProps, UseRangePickerSlotProps, UseRangePickerSlots } from '../models/useRangePicker';
4
- export interface UseMobileRangePickerSlots<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem> extends UseRangePickerSlots<TDate, TView>, PickersModalDialogSlots {
3
+ export interface UseMobileRangePickerSlots<TView extends DateOrTimeViewWithMeridiem> extends UseRangePickerSlots<TView>, PickersModalDialogSlots {
5
4
  }
6
- export interface UseMobileRangePickerSlotProps<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean> extends UseRangePickerSlotProps<TDate, TView, TEnableAccessibleFieldDOMStructure>, PickersModalDialogSlotProps {
5
+ export interface UseMobileRangePickerSlotProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean> extends UseRangePickerSlotProps<TView, TEnableAccessibleFieldDOMStructure>, PickersModalDialogSlotProps {
7
6
  }
8
7
  export interface MobileRangeOnlyPickerProps extends RangeOnlyPickerProps {
9
8
  }
10
- export interface UseMobileRangePickerProps<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerViewsProps<any, any, TView, any, any>> extends UseRangePickerProps<TDate, TView, TError, TExternalProps, MobileRangePickerAdditionalViewProps> {
9
+ export interface UseMobileRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends UseRangePickerProps<TView, TError, TExternalProps, MobileRangePickerAdditionalViewProps> {
11
10
  /**
12
11
  * Overridable component slots.
13
12
  * @default {}
14
13
  */
15
- slots: UseMobileRangePickerSlots<TDate, TView>;
14
+ slots: UseMobileRangePickerSlots<TView>;
16
15
  /**
17
16
  * The props used for each component slot.
18
17
  * @default {}
19
18
  */
20
- slotProps?: UseMobileRangePickerSlotProps<TDate, TView, TEnableAccessibleFieldDOMStructure>;
19
+ slotProps?: UseMobileRangePickerSlotProps<TView, TEnableAccessibleFieldDOMStructure>;
21
20
  }
22
21
  export interface MobileRangePickerAdditionalViewProps extends RangePickerAdditionalViewProps {
23
22
  }
24
- export interface UseMobileRangePickerParams<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TDate, TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends UseRangePickerParams<TDate, TView, TExternalProps, MobileRangePickerAdditionalViewProps> {
23
+ export interface UseMobileRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends UseRangePickerParams<TView, TExternalProps, MobileRangePickerAdditionalViewProps> {
25
24
  }
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { UseFieldInternalProps } from '@mui/x-date-pickers/internals';
3
3
  import { FieldRef, FieldSelectedSections } from '@mui/x-date-pickers/models';
4
4
  import { RangeFieldSection } from '../../models';
5
- interface UseMultiInputFieldSelectedSectionsParams extends Pick<UseFieldInternalProps<any, any, RangeFieldSection, any, any>, 'selectedSections' | 'onSelectedSectionsChange'> {
5
+ interface UseMultiInputFieldSelectedSectionsParams extends Pick<UseFieldInternalProps<any, RangeFieldSection, any, any>, 'selectedSections' | 'onSelectedSectionsChange'> {
6
6
  unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
7
7
  unstableEndFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
8
8
  }
@@ -1,4 +1,3 @@
1
- import { PickerValidDate } from '@mui/x-date-pickers/models';
2
1
  import { UseMultiInputDateRangeFieldParams } from '../../../MultiInputDateRangeField/MultiInputDateRangeField.types';
3
2
  import type { UseMultiInputRangeFieldResponse } from './useMultiInputRangeField.types';
4
- export declare const useMultiInputDateRangeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}>({ sharedProps: inSharedProps, startTextFieldProps, unstableStartFieldRef, endTextFieldProps, unstableEndFieldRef, }: UseMultiInputDateRangeFieldParams<TDate, TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>) => UseMultiInputRangeFieldResponse<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>;
3
+ export declare const useMultiInputDateRangeField: <TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}>({ sharedProps: inSharedProps, startTextFieldProps, unstableStartFieldRef, endTextFieldProps, unstableEndFieldRef, }: UseMultiInputDateRangeFieldParams<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>) => UseMultiInputRangeFieldResponse<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>;
@@ -18,6 +18,7 @@ export const useMultiInputDateRangeField = ({
18
18
  const {
19
19
  value: valueProp,
20
20
  defaultValue,
21
+ referenceDate,
21
22
  format,
22
23
  formatDensity,
23
24
  shouldRespectLeadingZeros,
@@ -39,6 +40,7 @@ export const useMultiInputDateRangeField = ({
39
40
  timezone: timezoneProp,
40
41
  value: valueProp,
41
42
  defaultValue,
43
+ referenceDate,
42
44
  onChange,
43
45
  valueManager: rangeValueManager
44
46
  });
@@ -1,4 +1,3 @@
1
- import { PickerValidDate } from '@mui/x-date-pickers/models';
2
1
  import type { UseMultiInputDateTimeRangeFieldParams } from '../../../MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types';
3
2
  import type { UseMultiInputRangeFieldResponse } from './useMultiInputRangeField.types';
4
- export declare const useMultiInputDateTimeRangeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}>({ sharedProps: inSharedProps, startTextFieldProps, unstableStartFieldRef, endTextFieldProps, unstableEndFieldRef, }: UseMultiInputDateTimeRangeFieldParams<TDate, TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>) => UseMultiInputRangeFieldResponse<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>;
3
+ export declare const useMultiInputDateTimeRangeField: <TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}>({ sharedProps: inSharedProps, startTextFieldProps, unstableStartFieldRef, endTextFieldProps, unstableEndFieldRef, }: UseMultiInputDateTimeRangeFieldParams<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>) => UseMultiInputRangeFieldResponse<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>;
@@ -18,6 +18,7 @@ export const useMultiInputDateTimeRangeField = ({
18
18
  const {
19
19
  value: valueProp,
20
20
  defaultValue,
21
+ referenceDate,
21
22
  format,
22
23
  formatDensity,
23
24
  shouldRespectLeadingZeros,
@@ -39,6 +40,7 @@ export const useMultiInputDateTimeRangeField = ({
39
40
  timezone: timezoneProp,
40
41
  value: valueProp,
41
42
  defaultValue,
43
+ referenceDate,
42
44
  onChange,
43
45
  valueManager: rangeValueManager
44
46
  });
@@ -1,4 +1,3 @@
1
- import { PickerValidDate } from '@mui/x-date-pickers/models';
2
1
  import type { UseMultiInputTimeRangeFieldParams } from '../../../MultiInputTimeRangeField/MultiInputTimeRangeField.types';
3
2
  import type { UseMultiInputRangeFieldResponse } from './useMultiInputRangeField.types';
4
- export declare const useMultiInputTimeRangeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}>({ sharedProps: inSharedProps, startTextFieldProps, unstableStartFieldRef, endTextFieldProps, unstableEndFieldRef, }: UseMultiInputTimeRangeFieldParams<TDate, TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>) => UseMultiInputRangeFieldResponse<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>;
3
+ export declare const useMultiInputTimeRangeField: <TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}>({ sharedProps: inSharedProps, startTextFieldProps, unstableStartFieldRef, endTextFieldProps, unstableEndFieldRef, }: UseMultiInputTimeRangeFieldParams<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>) => UseMultiInputRangeFieldResponse<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>;
@@ -18,6 +18,7 @@ export const useMultiInputTimeRangeField = ({
18
18
  const {
19
19
  value: valueProp,
20
20
  defaultValue,
21
+ referenceDate,
21
22
  format,
22
23
  formatDensity,
23
24
  shouldRespectLeadingZeros,
@@ -40,7 +41,8 @@ export const useMultiInputTimeRangeField = ({
40
41
  value: valueProp,
41
42
  defaultValue,
42
43
  onChange,
43
- valueManager: rangeValueManager
44
+ valueManager: rangeValueManager,
45
+ referenceDate
44
46
  });
45
47
  const {
46
48
  validationError,
@@ -1,11 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
3
- import { PickerValidDate } from '@mui/x-date-pickers/models';
4
3
  import { UseStaticRangePickerParams, UseStaticRangePickerProps } from './useStaticRangePicker.types';
5
4
  /**
6
5
  * Hook managing all the range static pickers:
7
6
  * - StaticDateRangePicker
8
7
  */
9
- export declare const useStaticRangePicker: <TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>>({ props, ref, ...pickerParams }: UseStaticRangePickerParams<TDate, TView, TExternalProps>) => {
8
+ export declare const useStaticRangePicker: <TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>>({ props, ref, ...pickerParams }: UseStaticRangePickerParams<TView, TExternalProps>) => {
10
9
  renderPicker: () => React.JSX.Element;
11
10
  };
@@ -4,9 +4,8 @@ const _excluded = ["props", "ref"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { styled } from '@mui/material/styles';
7
- import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
8
7
  import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
9
- import { usePicker, DIALOG_WIDTH } from '@mui/x-date-pickers/internals';
8
+ import { usePicker, DIALOG_WIDTH, PickerProvider } from '@mui/x-date-pickers/internals';
10
9
  import { useRangePosition } from "../useRangePosition.js";
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
11
  const PickerStaticLayout = styled(PickersLayout)(({
@@ -42,16 +41,18 @@ export const useStaticRangePicker = _ref => {
42
41
  } = useRangePosition(props);
43
42
  const {
44
43
  layoutProps,
44
+ providerProps,
45
45
  renderCurrentView
46
46
  } = usePicker(_extends({}, pickerParams, {
47
47
  props,
48
48
  autoFocusView: autoFocus ?? false,
49
49
  fieldRef: undefined,
50
+ localeText,
50
51
  additionalViewProps: {
51
52
  rangePosition,
52
53
  onRangePositionChange
53
54
  },
54
- wrapperVariant: displayStaticWrapperAs
55
+ variant: displayStaticWrapperAs
55
56
  }));
56
57
  const Layout = slots?.layout ?? PickerStaticLayout;
57
58
  const slotPropsForLayout = _extends({}, slotProps, {
@@ -60,8 +61,7 @@ export const useStaticRangePicker = _ref => {
60
61
  onRangePositionChange
61
62
  })
62
63
  });
63
- const renderPicker = () => /*#__PURE__*/_jsx(LocalizationProvider, {
64
- localeText: localeText,
64
+ const renderPicker = () => /*#__PURE__*/_jsx(PickerProvider, _extends({}, providerProps, {
65
65
  children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps?.layout, {
66
66
  slots: slots,
67
67
  slotProps: slotPropsForLayout,
@@ -70,7 +70,7 @@ export const useStaticRangePicker = _ref => {
70
70
  ref: ref,
71
71
  children: renderCurrentView()
72
72
  }))
73
- });
73
+ }));
74
74
  return {
75
75
  renderPicker
76
76
  };
@@ -1,29 +1,28 @@
1
1
  import * as React from 'react';
2
- import { BasePickerProps, UsePickerParams, ExportedBaseToolbarProps, StaticOnlyPickerProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
3
- import { PickerValidDate } from '@mui/x-date-pickers/models';
2
+ import { BasePickerProps, UsePickerParams, ExportedBaseToolbarProps, StaticOnlyPickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue } from '@mui/x-date-pickers/internals';
4
3
  import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps } from '@mui/x-date-pickers/PickersLayout';
5
- import { RangeFieldSection, DateRange } from '../../../models';
4
+ import { RangeFieldSection } from '../../../models';
6
5
  import { UseRangePositionProps } from '../useRangePosition';
7
- export interface UseStaticRangePickerSlots<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlots<DateRange<TDate>, TDate, TView> {
6
+ export interface UseStaticRangePickerSlots<TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlots<PickerRangeValue, TView> {
8
7
  }
9
- export interface UseStaticRangePickerSlotProps<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlotProps<DateRange<TDate>, TDate, TView> {
8
+ export interface UseStaticRangePickerSlotProps<TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlotProps<PickerRangeValue, TView> {
10
9
  toolbar?: ExportedBaseToolbarProps;
11
10
  }
12
11
  export interface StaticRangeOnlyPickerProps extends StaticOnlyPickerProps, UseRangePositionProps {
13
12
  }
14
- export interface UseStaticRangePickerProps<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>> extends BasePickerProps<DateRange<TDate>, TDate, TView, TError, TExternalProps, {}>, StaticRangeOnlyPickerProps {
13
+ export interface UseStaticRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends BasePickerProps<PickerRangeValue, TView, TError, TExternalProps, {}>, StaticRangeOnlyPickerProps {
15
14
  /**
16
15
  * Overridable components.
17
16
  * @default {}
18
17
  */
19
- slots?: UseStaticRangePickerSlots<TDate, TView>;
18
+ slots?: UseStaticRangePickerSlots<TView>;
20
19
  /**
21
20
  * The props used for each component slot.
22
21
  * @default {}
23
22
  */
24
- slotProps?: UseStaticRangePickerSlotProps<TDate, TView>;
23
+ slotProps?: UseStaticRangePickerSlotProps<TView>;
25
24
  }
26
- export interface UseStaticRangePickerParams<TDate extends PickerValidDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, RangeFieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
25
+ export interface UseStaticRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParams<PickerRangeValue, TView, RangeFieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
27
26
  props: TExternalProps;
28
27
  /**
29
28
  * Ref to pass to the root element
@@ -2,16 +2,15 @@ import { PickerValidDate } from '@mui/x-date-pickers/models';
2
2
  /**
3
3
  * Props used to validate a day value in range pickers.
4
4
  */
5
- export interface DayRangeValidationProps<TDate extends PickerValidDate> {
5
+ export interface DayRangeValidationProps {
6
6
  /**
7
7
  * Disable specific date.
8
8
  *
9
9
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
10
10
  *
11
- * @template TDate
12
- * @param {TDate} day The date to test.
11
+ * @param {PickerValidDate} day The date to test.
13
12
  * @param {string} position The date to test, 'start' or 'end'.
14
13
  * @returns {boolean} Returns `true` if the date should be disabled.
15
14
  */
16
- shouldDisableDate?: (day: TDate, position: 'start' | 'end') => boolean;
15
+ shouldDisableDate?: (day: PickerValidDate, position: 'start' | 'end') => boolean;
17
16
  }
@@ -1,13 +1,8 @@
1
- import { BaseDateValidationProps, TimeValidationProps, MakeOptional, UseFieldInternalProps, DateTimeValidationProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
2
- import { PickerValidDate } from '@mui/x-date-pickers/models';
3
- import { DayRangeValidationProps } from './dateRange';
4
- import { DateTimeRangeValidationError, RangeFieldSection, DateRange, RangeFieldSeparatorProps } from '../../models';
5
- export interface UseDateTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateTimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, BaseDateValidationProps<TDate>, DateTimeValidationProps<TDate> {
6
- /**
7
- * 12h/24h view for hour selection clock.
8
- * @default utils.is12HourCycleInCurrentLocale()
9
- */
10
- ampm?: boolean;
1
+ import { MakeOptional } from '@mui/x-internals/types';
2
+ import { UseFieldInternalProps, DateOrTimeViewWithMeridiem, AmPmProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
3
+ import { DateTimeRangeValidationError, RangeFieldSection, RangeFieldSeparatorProps } from '../../models';
4
+ import { ExportedValidateDateTimeRangeProps } from '../../validation/validateDateTimeRange';
5
+ export interface UseDateTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<PickerRangeValue, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateTimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, ExportedValidateDateTimeRangeProps, AmPmProps {
11
6
  }
12
7
  export type DateTimeRangePickerView = Exclude<DateOrTimeViewWithMeridiem, 'month' | 'year'>;
13
8
  export type DateTimeRangePickerViewExternal = Exclude<DateTimeRangePickerView, 'meridiem'>;
@@ -0,0 +1,26 @@
1
+ import { SxProps } from '@mui/material/styles';
2
+ import { SlotComponentProps } from '@mui/utils';
3
+ import { MakeRequired } from '@mui/x-internals/types';
4
+ import { UseFieldInternalProps } from '@mui/x-date-pickers/internals';
5
+ import { FieldSection } from '@mui/x-date-pickers/models';
6
+ import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
7
+ import type { MultiInputFieldRefs, MultiInputFieldSlotRootProps, RangeFieldSeparatorProps, RangePosition } from '../../models';
8
+ /**
9
+ * Props the multi input field can receive when used inside a picker.
10
+ * Only contains what the MUI components are passing to the field, not what users can pass using the `props.slotProps.field`.
11
+ */
12
+ export interface BaseMultiInputFieldProps<TValue, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TError> extends MakeRequired<Pick<UseFieldInternalProps<TValue, TSection, TEnableAccessibleFieldDOMStructure, TError>, 'readOnly' | 'disabled' | 'format' | 'formatDensity' | 'enableAccessibleFieldDOMStructure' | 'selectedSections' | 'onSelectedSectionsChange' | 'timezone' | 'autoFocus' | 'value' | 'onChange'>, 'format' | 'value' | 'onChange' | 'timezone'>, RangeFieldSeparatorProps, MultiInputFieldRefs {
13
+ className: string | undefined;
14
+ sx: SxProps<any> | undefined;
15
+ slots?: {
16
+ root?: React.ElementType;
17
+ separator?: React.ElementType;
18
+ textField?: React.ElementType;
19
+ };
20
+ slotProps?: {
21
+ root?: SlotComponentProps<React.ElementType<MultiInputFieldSlotRootProps>, {}, Record<string, any>>;
22
+ textField?: SlotComponentProps<typeof PickersTextField, {}, {
23
+ position?: RangePosition;
24
+ } & Record<string, any>>;
25
+ };
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,6 @@
1
- import { BaseTimeValidationProps, TimeValidationProps, MakeOptional, UseFieldInternalProps } from '@mui/x-date-pickers/internals';
2
- import { PickerValidDate } from '@mui/x-date-pickers/models';
3
- import { TimeRangeValidationError, RangeFieldSection, DateRange, RangeFieldSeparatorProps } from '../../models';
4
- export interface UseTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, TimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, TimeValidationProps<TDate>, BaseTimeValidationProps {
5
- /**
6
- * 12h/24h view for hour selection clock.
7
- * @default utils.is12HourCycleInCurrentLocale()
8
- */
9
- ampm?: boolean;
1
+ import { MakeOptional } from '@mui/x-internals/types';
2
+ import { UseFieldInternalProps, AmPmProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
3
+ import { TimeRangeValidationError, RangeFieldSection, RangeFieldSeparatorProps } from '../../models';
4
+ import type { ExportedValidateTimeRangeProps } from '../../validation/validateTimeRange';
5
+ export interface UseTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<PickerRangeValue, RangeFieldSection, TEnableAccessibleFieldDOMStructure, TimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, ExportedValidateTimeRangeProps, AmPmProps {
10
6
  }
@@ -1,9 +1,10 @@
1
1
  import { MuiPickersAdapter, PickerValidDate } from '@mui/x-date-pickers/models';
2
- import { DateRange, RangePosition } from '../../models';
3
- interface CalculateRangeChangeOptions<TDate extends PickerValidDate> {
4
- utils: MuiPickersAdapter<TDate>;
5
- range: DateRange<TDate>;
6
- newDate: TDate | null;
2
+ import { PickerRangeValue } from '@mui/x-date-pickers/internals';
3
+ import { RangePosition } from '../../models';
4
+ interface CalculateRangeChangeOptions {
5
+ utils: MuiPickersAdapter;
6
+ range: PickerRangeValue;
7
+ newDate: PickerValidDate | null;
7
8
  rangePosition: RangePosition;
8
9
  /**
9
10
  * Should allow flipping range `start` and `end` dates if the `newDate` would result in a new range creation.
@@ -12,12 +13,12 @@ interface CalculateRangeChangeOptions<TDate extends PickerValidDate> {
12
13
  */
13
14
  allowRangeFlip?: boolean;
14
15
  shouldMergeDateAndTime?: boolean;
15
- referenceDate?: TDate | null;
16
+ referenceDate?: PickerValidDate;
16
17
  }
17
- interface CalculateRangeChangeResponse<TDate extends PickerValidDate> {
18
+ interface CalculateRangeChangeResponse {
18
19
  nextSelection: RangePosition;
19
- newRange: DateRange<TDate>;
20
+ newRange: PickerRangeValue;
20
21
  }
21
- export declare function calculateRangeChange<TDate extends PickerValidDate>({ utils, range, newDate: selectedDate, rangePosition, allowRangeFlip, shouldMergeDateAndTime, referenceDate, }: CalculateRangeChangeOptions<TDate>): CalculateRangeChangeResponse<TDate>;
22
- export declare function calculateRangePreview<TDate extends PickerValidDate>(options: CalculateRangeChangeOptions<TDate>): DateRange<TDate>;
22
+ export declare function calculateRangeChange({ utils, range, newDate: selectedDate, rangePosition, allowRangeFlip, shouldMergeDateAndTime, referenceDate, }: CalculateRangeChangeOptions): CalculateRangeChangeResponse;
23
+ export declare function calculateRangePreview(options: CalculateRangeChangeOptions): PickerRangeValue;
23
24
  export {};
@@ -1,6 +1,6 @@
1
1
  import { MuiPickersAdapter, PickerValidDate } from '@mui/x-date-pickers/models';
2
- import { DateRange, NonEmptyDateRange } from '../../models';
3
- export declare const isRangeValid: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, range: DateRange<TDate> | null) => range is NonEmptyDateRange<TDate>;
4
- export declare const isWithinRange: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, day: TDate, range: DateRange<TDate> | null) => boolean;
5
- export declare const isStartOfRange: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, day: TDate, range: DateRange<TDate> | null) => boolean;
6
- export declare const isEndOfRange: <TDate extends PickerValidDate>(utils: MuiPickersAdapter<TDate>, day: TDate, range: DateRange<TDate> | null) => boolean;
2
+ import { PickerRangeValue } from '@mui/x-date-pickers/internals';
3
+ export declare const isRangeValid: (utils: MuiPickersAdapter, range: PickerRangeValue | null) => range is [PickerValidDate, PickerValidDate];
4
+ export declare const isWithinRange: (utils: MuiPickersAdapter, day: PickerValidDate, range: PickerRangeValue | null) => boolean;
5
+ export declare const isStartOfRange: (utils: MuiPickersAdapter, day: PickerValidDate, range: PickerRangeValue | null) => boolean;
6
+ export declare const isEndOfRange: (utils: MuiPickersAdapter, day: PickerValidDate, range: PickerRangeValue | null) => boolean;
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTczMjE0MzYwMDAwMA==";
3
+ const releaseInfo = "MTczMjIzMDAwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -1,8 +1,7 @@
1
- import { PickerValueManager, FieldValueManager } from '@mui/x-date-pickers/internals';
2
- import { PickerValidDate } from '@mui/x-date-pickers/models';
3
- import type { DateRangeValidationError, DateTimeRangeValidationError, TimeRangeValidationError, RangeFieldSection, DateRange } from '../../models';
4
- export type RangePickerValueManager<TValue = [any, any], TDate extends PickerValidDate = any, TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerValueManager<TValue, TDate, TError>;
1
+ import { PickerValueManager, FieldValueManager, PickerRangeValue } from '@mui/x-date-pickers/internals';
2
+ import type { DateRangeValidationError, DateTimeRangeValidationError, TimeRangeValidationError, RangeFieldSection } from '../../models';
3
+ export type RangePickerValueManager<TValue = [any, any], TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerValueManager<TValue, TError>;
5
4
  export declare const rangeValueManager: RangePickerValueManager;
6
- export declare const getRangeFieldValueManager: <TDate extends PickerValidDate>({ dateSeparator, }: {
5
+ export declare const getRangeFieldValueManager: ({ dateSeparator, }: {
7
6
  dateSeparator: string | undefined;
8
- }) => FieldValueManager<DateRange<TDate>, TDate, RangeFieldSection>;
7
+ }) => FieldValueManager<PickerRangeValue, RangeFieldSection>;
@@ -1,8 +1,7 @@
1
- import { BaseDateValidationProps, MakeOptional, UseFieldInternalProps } from '@mui/x-date-pickers/internals';
2
- import { PickerValidDate } from '@mui/x-date-pickers/models';
1
+ import { MakeOptional } from '@mui/x-internals/types';
2
+ import { UseFieldInternalProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
3
3
  import { RangeFieldSection, RangeFieldSeparatorProps } from './fields';
4
4
  import { DateRangeValidationError } from './validation';
5
- import { DateRange } from './range';
6
- import { DayRangeValidationProps } from '../internals/models/dateRange';
7
- export interface UseDateRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, DayRangeValidationProps<TDate>, BaseDateValidationProps<TDate> {
5
+ import type { ExportedValidateDateRangeProps } from '../validation/validateDateRange';
6
+ export interface UseDateRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<PickerRangeValue, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, ExportedValidateDateRangeProps {
8
7
  }