@mui/x-date-pickers-pro 7.15.0 → 7.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 (187) hide show
  1. package/CHANGELOG.md +185 -1
  2. package/DateRangeCalendar/DateRangeCalendar.js +16 -13
  3. package/DateRangeCalendar/index.js +2 -2
  4. package/DateRangeCalendar/useDragRange.js +3 -1
  5. package/DateRangePicker/DateRangePicker.js +15 -13
  6. package/DateRangePicker/DateRangePickerToolbar.js +3 -1
  7. package/DateRangePicker/index.js +3 -3
  8. package/DateRangePicker/shared.js +1 -1
  9. package/DateRangePickerDay/DateRangePickerDay.js +4 -2
  10. package/DateRangePickerDay/index.js +2 -2
  11. package/DateTimeRangePicker/DateTimeRangePicker.js +15 -13
  12. package/DateTimeRangePicker/DateTimeRangePickerTabs.js +3 -1
  13. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -2
  14. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +4 -2
  15. package/DateTimeRangePicker/index.js +5 -5
  16. package/DateTimeRangePicker/shared.js +2 -2
  17. package/DesktopDateRangePicker/DesktopDateRangePicker.js +20 -18
  18. package/DesktopDateRangePicker/index.js +1 -1
  19. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +23 -20
  20. package/DesktopDateTimeRangePicker/index.js +1 -1
  21. package/MobileDateRangePicker/MobileDateRangePicker.js +20 -18
  22. package/MobileDateRangePicker/index.js +1 -1
  23. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +23 -20
  24. package/MobileDateTimeRangePicker/index.js +1 -1
  25. package/MultiInputDateRangeField/MultiInputDateRangeField.js +16 -11
  26. package/MultiInputDateRangeField/index.js +2 -2
  27. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +16 -11
  28. package/MultiInputDateTimeRangeField/index.js +2 -2
  29. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +16 -11
  30. package/MultiInputTimeRangeField/index.js +2 -2
  31. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -0
  32. package/PickersRangeCalendarHeader/index.js +1 -1
  33. package/SingleInputDateRangeField/SingleInputDateRangeField.js +12 -8
  34. package/SingleInputDateRangeField/index.js +2 -2
  35. package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
  36. package/SingleInputDateRangeField/useSingleInputDateRangeField.js +7 -4
  37. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +12 -8
  38. package/SingleInputDateTimeRangeField/index.js +2 -2
  39. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
  40. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +7 -4
  41. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +12 -8
  42. package/SingleInputTimeRangeField/index.js +2 -2
  43. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
  44. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +7 -4
  45. package/StaticDateRangePicker/StaticDateRangePicker.js +18 -16
  46. package/StaticDateRangePicker/index.js +1 -1
  47. package/dateRangeViewRenderers/dateRangeViewRenderers.js +1 -1
  48. package/dateRangeViewRenderers/index.js +1 -1
  49. package/index.d.ts +1 -0
  50. package/index.js +20 -19
  51. package/internals/hooks/useDesktopRangePicker/index.js +1 -1
  52. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +3 -3
  53. package/internals/hooks/useMobileRangePicker/index.js +1 -1
  54. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -3
  55. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +17 -17
  56. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +17 -17
  57. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +17 -17
  58. package/internals/hooks/useStaticRangePicker/index.js +1 -1
  59. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -1
  60. package/internals/models/index.js +4 -4
  61. package/internals/utils/releaseInfo.js +1 -1
  62. package/internals/utils/valueManagers.js +1 -1
  63. package/models/index.js +5 -5
  64. package/modern/DateRangeCalendar/DateRangeCalendar.js +16 -13
  65. package/modern/DateRangeCalendar/index.js +2 -2
  66. package/modern/DateRangeCalendar/useDragRange.js +3 -1
  67. package/modern/DateRangePicker/DateRangePicker.js +15 -13
  68. package/modern/DateRangePicker/DateRangePickerToolbar.js +3 -1
  69. package/modern/DateRangePicker/index.js +3 -3
  70. package/modern/DateRangePicker/shared.js +1 -1
  71. package/modern/DateRangePickerDay/DateRangePickerDay.js +4 -2
  72. package/modern/DateRangePickerDay/index.js +2 -2
  73. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +15 -13
  74. package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +3 -1
  75. package/modern/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -2
  76. package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +4 -2
  77. package/modern/DateTimeRangePicker/index.js +5 -5
  78. package/modern/DateTimeRangePicker/shared.js +2 -2
  79. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +20 -18
  80. package/modern/DesktopDateRangePicker/index.js +1 -1
  81. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +23 -20
  82. package/modern/DesktopDateTimeRangePicker/index.js +1 -1
  83. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +20 -18
  84. package/modern/MobileDateRangePicker/index.js +1 -1
  85. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +23 -20
  86. package/modern/MobileDateTimeRangePicker/index.js +1 -1
  87. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +16 -11
  88. package/modern/MultiInputDateRangeField/index.js +2 -2
  89. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +16 -11
  90. package/modern/MultiInputDateTimeRangeField/index.js +2 -2
  91. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +16 -11
  92. package/modern/MultiInputTimeRangeField/index.js +2 -2
  93. package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -0
  94. package/modern/PickersRangeCalendarHeader/index.js +1 -1
  95. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +12 -8
  96. package/modern/SingleInputDateRangeField/index.js +2 -2
  97. package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +7 -4
  98. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +12 -8
  99. package/modern/SingleInputDateTimeRangeField/index.js +2 -2
  100. package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +7 -4
  101. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +12 -8
  102. package/modern/SingleInputTimeRangeField/index.js +2 -2
  103. package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +7 -4
  104. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +18 -16
  105. package/modern/StaticDateRangePicker/index.js +1 -1
  106. package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +1 -1
  107. package/modern/dateRangeViewRenderers/index.js +1 -1
  108. package/modern/index.js +20 -19
  109. package/modern/internals/hooks/useDesktopRangePicker/index.js +1 -1
  110. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +3 -3
  111. package/modern/internals/hooks/useMobileRangePicker/index.js +1 -1
  112. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -3
  113. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +17 -17
  114. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +17 -17
  115. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +17 -17
  116. package/modern/internals/hooks/useStaticRangePicker/index.js +1 -1
  117. package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -1
  118. package/modern/internals/models/index.js +4 -4
  119. package/modern/internals/utils/releaseInfo.js +1 -1
  120. package/modern/internals/utils/valueManagers.js +1 -1
  121. package/modern/models/index.js +5 -5
  122. package/modern/themeAugmentation/index.js +1 -4
  123. package/modern/validation/index.js +3 -0
  124. package/modern/{internals/utils/validation → validation}/validateDateRange.js +10 -5
  125. package/modern/{internals/utils/validation → validation}/validateDateTimeRange.js +10 -5
  126. package/{internals/utils → modern}/validation/validateTimeRange.js +10 -5
  127. package/node/DateRangeCalendar/DateRangeCalendar.js +7 -6
  128. package/node/DateRangeCalendar/useDragRange.js +3 -3
  129. package/node/DateRangePicker/DateRangePicker.js +14 -14
  130. package/node/DateRangePicker/DateRangePickerToolbar.js +3 -3
  131. package/node/DateRangePicker/shared.js +2 -3
  132. package/node/DateRangePickerDay/DateRangePickerDay.js +3 -3
  133. package/node/DateTimeRangePicker/DateTimeRangePicker.js +14 -14
  134. package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +3 -3
  135. package/node/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +1 -1
  136. package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +3 -3
  137. package/node/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +1 -1
  138. package/node/DateTimeRangePicker/shared.js +1 -1
  139. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +18 -18
  140. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +18 -17
  141. package/node/MobileDateRangePicker/MobileDateRangePicker.js +18 -18
  142. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +18 -17
  143. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +15 -12
  144. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +15 -12
  145. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +15 -12
  146. package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +3 -3
  147. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +12 -10
  148. package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +6 -5
  149. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +12 -10
  150. package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +6 -5
  151. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +12 -10
  152. package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +6 -5
  153. package/node/StaticDateRangePicker/StaticDateRangePicker.js +16 -16
  154. package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +1 -2
  155. package/node/index.js +13 -1
  156. package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +2 -3
  157. package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +2 -3
  158. package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +2 -3
  159. package/node/internals/hooks/useMultiInputFieldSelectedSections.js +2 -3
  160. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +14 -14
  161. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +14 -14
  162. package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +14 -14
  163. package/node/internals/hooks/useRangePosition.js +1 -1
  164. package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +2 -3
  165. package/node/internals/utils/date-fields-utils.js +1 -1
  166. package/node/internals/utils/releaseInfo.js +1 -1
  167. package/node/internals/utils/valueManagers.js +1 -1
  168. package/node/themeAugmentation/index.js +0 -33
  169. package/node/validation/index.js +26 -0
  170. package/node/{internals/utils/validation → validation}/validateDateRange.js +13 -8
  171. package/node/{internals/utils/validation → validation}/validateDateTimeRange.js +13 -8
  172. package/node/{internals/utils/validation → validation}/validateTimeRange.js +12 -7
  173. package/package.json +5 -4
  174. package/themeAugmentation/index.d.ts +3 -3
  175. package/themeAugmentation/index.js +1 -4
  176. package/validation/index.d.ts +6 -0
  177. package/validation/index.js +3 -0
  178. package/validation/package.json +6 -0
  179. package/validation/validateDateRange.d.ts +8 -0
  180. package/{internals/utils/validation → validation}/validateDateRange.js +10 -5
  181. package/validation/validateDateTimeRange.d.ts +8 -0
  182. package/{internals/utils/validation → validation}/validateDateTimeRange.js +10 -5
  183. package/validation/validateTimeRange.d.ts +6 -0
  184. package/{modern/internals/utils/validation → validation}/validateTimeRange.js +10 -5
  185. package/internals/utils/validation/validateDateRange.d.ts +0 -7
  186. package/internals/utils/validation/validateDateTimeRange.d.ts +0 -7
  187. package/internals/utils/validation/validateTimeRange.d.ts +0 -6
@@ -1,22 +1,25 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["view", "openTo", "rangePosition"];
4
6
  import * as React from 'react';
5
7
  import PropTypes from 'prop-types';
6
8
  import { refType } from '@mui/utils';
7
- import { DIALOG_WIDTH, VIEW_HEIGHT, extractValidationProps, isInternalTimeView, isDatePickerView, resolveDateTimeFormat, useUtils } from '@mui/x-date-pickers/internals';
9
+ import { DIALOG_WIDTH, VIEW_HEIGHT, isInternalTimeView, isDatePickerView, resolveDateTimeFormat, useUtils } from '@mui/x-date-pickers/internals';
10
+ import { extractValidationProps } from '@mui/x-date-pickers/validation';
8
11
  import resolveComponentProps from '@mui/utils/resolveComponentProps';
9
12
  import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from '@mui/x-date-pickers/timeViewRenderers';
10
13
  import { multiSectionDigitalClockClasses, multiSectionDigitalClockSectionClasses } from '@mui/x-date-pickers/MultiSectionDigitalClock';
11
14
  import { digitalClockClasses } from '@mui/x-date-pickers/DigitalClock';
12
- import { rangeValueManager } from '../internals/utils/valueManagers';
13
- import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
14
- import { useMobileRangePicker } from '../internals/hooks/useMobileRangePicker';
15
- import { validateDateTimeRange } from '../internals/utils/validation/validateDateTimeRange';
16
- import { useDateTimeRangePickerDefaultizedProps } from '../DateTimeRangePicker/shared';
17
- import { MultiInputDateTimeRangeField } from '../MultiInputDateTimeRangeField';
18
- import { DateTimeRangePickerTimeWrapper } from '../DateTimeRangePicker/DateTimeRangePickerTimeWrapper';
19
- import { RANGE_VIEW_HEIGHT } from '../internals/constants/dimensions';
15
+ import { rangeValueManager } from "../internals/utils/valueManagers.js";
16
+ import { renderDateRangeViewCalendar } from "../dateRangeViewRenderers/index.js";
17
+ import { useMobileRangePicker } from "../internals/hooks/useMobileRangePicker/index.js";
18
+ import { validateDateTimeRange } from "../validation/index.js";
19
+ import { useDateTimeRangePickerDefaultizedProps } from "../DateTimeRangePicker/shared.js";
20
+ import { MultiInputDateTimeRangeField } from "../MultiInputDateTimeRangeField/index.js";
21
+ import { DateTimeRangePickerTimeWrapper } from "../DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js";
22
+ import { RANGE_VIEW_HEIGHT } from "../internals/constants/dimensions.js";
20
23
  import { jsx as _jsx } from "react/jsx-runtime";
21
24
  const rendererInterceptor = function rendererInterceptor(inViewRenderers, popperView, rendererProps) {
22
25
  const {
@@ -298,16 +301,16 @@ MobileDateTimeRangePicker.propTypes = {
298
301
  name: PropTypes.string,
299
302
  /**
300
303
  * Callback fired when the value is accepted.
301
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
302
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
304
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
305
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
303
306
  * @param {TValue} value The value that was just accepted.
304
307
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
305
308
  */
306
309
  onAccept: PropTypes.func,
307
310
  /**
308
311
  * Callback fired when the value changes.
309
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
310
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
312
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
313
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
311
314
  * @param {TValue} value The new value.
312
315
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
313
316
  */
@@ -318,13 +321,13 @@ MobileDateTimeRangePicker.propTypes = {
318
321
  */
319
322
  onClose: PropTypes.func,
320
323
  /**
321
- * Callback fired when the error associated to the current value changes.
322
- * If the error has a non-null value, then the `TextField` will be rendered in `error` state.
323
- *
324
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
325
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
326
- * @param {TError} error The new error describing why the current value is not valid.
327
- * @param {TValue} value The value associated to the error.
324
+ * Callback fired when the error associated with the current value changes.
325
+ * When a validation error is detected, the `error` parameter contains a non-null value.
326
+ * This can be used to render an appropriate form error.
327
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
328
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
329
+ * @param {TError} error The reason why the current value is not valid.
330
+ * @param {TValue} value The value associated with the error.
328
331
  */
329
332
  onError: PropTypes.func,
330
333
  /**
@@ -1 +1 @@
1
- export { MobileDateTimeRangePicker } from './MobileDateTimeRangePicker';
1
+ export { MobileDateTimeRangePicker } from "./MobileDateTimeRangePicker.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
@@ -10,9 +12,10 @@ import Typography from '@mui/material/Typography';
10
12
  import { styled, useThemeProps } from '@mui/material/styles';
11
13
  import useSlotProps from '@mui/utils/useSlotProps';
12
14
  import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
13
- import { splitFieldInternalAndForwardedProps, convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
15
+ import { convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
16
+ import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
14
17
  import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
15
- import { useMultiInputDateRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField';
18
+ import { useMultiInputDateRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js";
16
19
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
20
  export const multiInputDateRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateRangeField', ['root', 'separator']);
18
21
  export const getMultiInputDateRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateRangeField', slot);
@@ -26,7 +29,7 @@ const useUtilityClasses = ownerState => {
26
29
  };
27
30
  return composeClasses(slots, getMultiInputDateRangeFieldUtilityClass, classes);
28
31
  };
29
- const MultiInputDateRangeFieldRoot = styled( /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
32
+ const MultiInputDateRangeFieldRoot = styled(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
30
33
  ref: ref,
31
34
  spacing: 2,
32
35
  direction: "row",
@@ -61,7 +64,7 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
61
64
  const {
62
65
  internalProps,
63
66
  forwardedProps
64
- } = splitFieldInternalAndForwardedProps(themeProps, 'date');
67
+ } = useSplitFieldProps(themeProps, 'date');
65
68
  const {
66
69
  slots,
67
70
  slotProps,
@@ -200,18 +203,20 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
200
203
  minDate: PropTypes.object,
201
204
  /**
202
205
  * Callback fired when the value changes.
203
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
204
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
206
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
207
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
205
208
  * @param {TValue} value The new value.
206
209
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
207
210
  */
208
211
  onChange: PropTypes.func,
209
212
  /**
210
- * Callback fired when the error associated to the current value changes.
211
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
212
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
213
- * @param {TError} error The new error.
214
- * @param {TValue} value The value associated to the error.
213
+ * Callback fired when the error associated with the current value changes.
214
+ * When a validation error is detected, the `error` parameter contains a non-null value.
215
+ * This can be used to render an appropriate form error.
216
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
217
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
218
+ * @param {TError} error The reason why the current value is not valid.
219
+ * @param {TValue} value The value associated with the error.
215
220
  */
216
221
  onError: PropTypes.func,
217
222
  /**
@@ -1,2 +1,2 @@
1
- export { MultiInputDateRangeField, getMultiInputDateRangeFieldUtilityClass, multiInputDateRangeFieldClasses } from './MultiInputDateRangeField';
2
- export { useMultiInputDateRangeField as unstable_useMultiInputDateRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField';
1
+ export { MultiInputDateRangeField, getMultiInputDateRangeFieldUtilityClass, multiInputDateRangeFieldClasses } from "./MultiInputDateRangeField.js";
2
+ export { useMultiInputDateRangeField as unstable_useMultiInputDateRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
@@ -10,9 +12,10 @@ import Typography from '@mui/material/Typography';
10
12
  import { styled, useThemeProps } from '@mui/material/styles';
11
13
  import useSlotProps from '@mui/utils/useSlotProps';
12
14
  import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
13
- import { splitFieldInternalAndForwardedProps, convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
15
+ import { convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
16
+ import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
14
17
  import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
15
- import { useMultiInputDateTimeRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField';
18
+ import { useMultiInputDateTimeRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js";
16
19
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
20
  export const multiInputDateTimeRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateTimeRangeField', ['root', 'separator']);
18
21
  export const getMultiInputDateTimeRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateTimeRangeField', slot);
@@ -26,7 +29,7 @@ const useUtilityClasses = ownerState => {
26
29
  };
27
30
  return composeClasses(slots, getMultiInputDateTimeRangeFieldUtilityClass, classes);
28
31
  };
29
- const MultiInputDateTimeRangeFieldRoot = styled( /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
32
+ const MultiInputDateTimeRangeFieldRoot = styled(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
30
33
  ref: ref,
31
34
  spacing: 2,
32
35
  direction: "row",
@@ -61,7 +64,7 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
61
64
  const {
62
65
  internalProps,
63
66
  forwardedProps
64
- } = splitFieldInternalAndForwardedProps(themeProps, 'date-time');
67
+ } = useSplitFieldProps(themeProps, 'date-time');
65
68
  const {
66
69
  slots,
67
70
  slotProps,
@@ -233,18 +236,20 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
233
236
  minutesStep: PropTypes.number,
234
237
  /**
235
238
  * Callback fired when the value changes.
236
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
237
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
239
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
240
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
238
241
  * @param {TValue} value The new value.
239
242
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
240
243
  */
241
244
  onChange: PropTypes.func,
242
245
  /**
243
- * Callback fired when the error associated to the current value changes.
244
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
245
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
246
- * @param {TError} error The new error.
247
- * @param {TValue} value The value associated to the error.
246
+ * Callback fired when the error associated with the current value changes.
247
+ * When a validation error is detected, the `error` parameter contains a non-null value.
248
+ * This can be used to render an appropriate form error.
249
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
250
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
251
+ * @param {TError} error The reason why the current value is not valid.
252
+ * @param {TValue} value The value associated with the error.
248
253
  */
249
254
  onError: PropTypes.func,
250
255
  /**
@@ -1,2 +1,2 @@
1
- export { MultiInputDateTimeRangeField, getMultiInputDateTimeRangeFieldUtilityClass, multiInputDateTimeRangeFieldClasses } from './MultiInputDateTimeRangeField';
2
- export { useMultiInputDateTimeRangeField as unstable_useMultiInputDateTimeRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField';
1
+ export { MultiInputDateTimeRangeField, getMultiInputDateTimeRangeFieldUtilityClass, multiInputDateTimeRangeFieldClasses } from "./MultiInputDateTimeRangeField.js";
2
+ export { useMultiInputDateTimeRangeField as unstable_useMultiInputDateTimeRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
@@ -10,9 +12,10 @@ import Typography from '@mui/material/Typography';
10
12
  import { styled, useThemeProps } from '@mui/material/styles';
11
13
  import useSlotProps from '@mui/utils/useSlotProps';
12
14
  import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
13
- import { splitFieldInternalAndForwardedProps, convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
15
+ import { convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
16
+ import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
14
17
  import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
15
- import { useMultiInputTimeRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField';
18
+ import { useMultiInputTimeRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js";
16
19
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
20
  export const multiInputTimeRangeFieldClasses = generateUtilityClasses('MuiMultiInputTimeRangeField', ['root', 'separator']);
18
21
  export const getMultiInputTimeRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputTimeRangeField', slot);
@@ -26,7 +29,7 @@ const useUtilityClasses = ownerState => {
26
29
  };
27
30
  return composeClasses(slots, getMultiInputTimeRangeFieldUtilityClass, classes);
28
31
  };
29
- const MultiInputTimeRangeFieldRoot = styled( /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
32
+ const MultiInputTimeRangeFieldRoot = styled(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
30
33
  ref: ref,
31
34
  spacing: 2,
32
35
  direction: "row",
@@ -61,7 +64,7 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
61
64
  const {
62
65
  internalProps,
63
66
  forwardedProps
64
- } = splitFieldInternalAndForwardedProps(themeProps, 'time');
67
+ } = useSplitFieldProps(themeProps, 'time');
65
68
  const {
66
69
  slots,
67
70
  slotProps,
@@ -215,18 +218,20 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
215
218
  minutesStep: PropTypes.number,
216
219
  /**
217
220
  * Callback fired when the value changes.
218
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
219
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
221
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
222
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
220
223
  * @param {TValue} value The new value.
221
224
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
222
225
  */
223
226
  onChange: PropTypes.func,
224
227
  /**
225
- * Callback fired when the error associated to the current value changes.
226
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
227
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
228
- * @param {TError} error The new error.
229
- * @param {TValue} value The value associated to the error.
228
+ * Callback fired when the error associated with the current value changes.
229
+ * When a validation error is detected, the `error` parameter contains a non-null value.
230
+ * This can be used to render an appropriate form error.
231
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
232
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
233
+ * @param {TError} error The reason why the current value is not valid.
234
+ * @param {TValue} value The value associated with the error.
230
235
  */
231
236
  onError: PropTypes.func,
232
237
  /**
@@ -1,2 +1,2 @@
1
- export { MultiInputTimeRangeField, getMultiInputTimeRangeFieldUtilityClass, multiInputTimeRangeFieldClasses } from './MultiInputTimeRangeField';
2
- export { useMultiInputTimeRangeField as unstable_useMultiInputTimeRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField';
1
+ export { MultiInputTimeRangeField, getMultiInputTimeRangeFieldUtilityClass, multiInputTimeRangeFieldClasses } from "./MultiInputTimeRangeField.js";
2
+ export { useMultiInputTimeRangeField as unstable_useMultiInputTimeRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["calendars", "month", "monthIndex", "labelId"],
@@ -1 +1 @@
1
- export { PickersRangeCalendarHeader } from './PickersRangeCalendarHeader';
1
+ export { PickersRangeCalendarHeader } from "./PickersRangeCalendarHeader.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["slots", "slotProps", "InputProps", "inputProps"];
@@ -10,7 +12,7 @@ import { refType } from '@mui/utils';
10
12
  import { useClearableField } from '@mui/x-date-pickers/hooks';
11
13
  import { convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
12
14
  import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
13
- import { useSingleInputDateRangeField } from './useSingleInputDateRangeField';
15
+ import { useSingleInputDateRangeField } from "./useSingleInputDateRangeField.js";
14
16
  import { jsx as _jsx } from "react/jsx-runtime";
15
17
  /**
16
18
  * Demos:
@@ -195,8 +197,8 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
195
197
  onBlur: PropTypes.func,
196
198
  /**
197
199
  * Callback fired when the value changes.
198
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
199
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
200
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
201
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
200
202
  * @param {TValue} value The new value.
201
203
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
202
204
  */
@@ -206,11 +208,13 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
206
208
  */
207
209
  onClear: PropTypes.func,
208
210
  /**
209
- * Callback fired when the error associated to the current value changes.
210
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
211
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
212
- * @param {TError} error The new error.
213
- * @param {TValue} value The value associated to the error.
211
+ * Callback fired when the error associated with the current value changes.
212
+ * When a validation error is detected, the `error` parameter contains a non-null value.
213
+ * This can be used to render an appropriate form error.
214
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
215
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
216
+ * @param {TError} error The reason why the current value is not valid.
217
+ * @param {TValue} value The value associated with the error.
214
218
  */
215
219
  onError: PropTypes.func,
216
220
  onFocus: PropTypes.func,
@@ -1,2 +1,2 @@
1
- export { SingleInputDateRangeField } from './SingleInputDateRangeField';
2
- export { useSingleInputDateRangeField as unstable_useSingleInputDateRangeField } from './useSingleInputDateRangeField';
1
+ export { SingleInputDateRangeField } from "./SingleInputDateRangeField.js";
2
+ export { useSingleInputDateRangeField as unstable_useSingleInputDateRangeField } from "./useSingleInputDateRangeField.js";
@@ -1,13 +1,16 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
- import { useField, splitFieldInternalAndForwardedProps, useDefaultizedDateField } from '@mui/x-date-pickers/internals';
3
- import { rangeValueManager, getRangeFieldValueManager } from '../internals/utils/valueManagers';
4
- import { validateDateRange } from '../internals/utils/validation/validateDateRange';
4
+ import { useField, useDefaultizedDateField } from '@mui/x-date-pickers/internals';
5
+ import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
6
+ import { rangeValueManager, getRangeFieldValueManager } from "../internals/utils/valueManagers.js";
7
+ import { validateDateRange } from "../validation/index.js";
5
8
  export const useSingleInputDateRangeField = inProps => {
6
9
  const props = useDefaultizedDateField(inProps);
7
10
  const {
8
11
  forwardedProps,
9
12
  internalProps
10
- } = splitFieldInternalAndForwardedProps(props, 'date');
13
+ } = useSplitFieldProps(props, 'date');
11
14
  const fieldValueManager = React.useMemo(() => getRangeFieldValueManager({
12
15
  dateSeparator: internalProps.dateSeparator
13
16
  }), [internalProps.dateSeparator]);
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["slots", "slotProps", "InputProps", "inputProps"];
@@ -10,7 +12,7 @@ import { useThemeProps } from '@mui/material/styles';
10
12
  import { refType } from '@mui/utils';
11
13
  import useSlotProps from '@mui/utils/useSlotProps';
12
14
  import { useClearableField } from '@mui/x-date-pickers/hooks';
13
- import { useSingleInputDateTimeRangeField } from './useSingleInputDateTimeRangeField';
15
+ import { useSingleInputDateTimeRangeField } from "./useSingleInputDateTimeRangeField.js";
14
16
  import { jsx as _jsx } from "react/jsx-runtime";
15
17
  /**
16
18
  * Demos:
@@ -228,8 +230,8 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
228
230
  onBlur: PropTypes.func,
229
231
  /**
230
232
  * Callback fired when the value changes.
231
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
232
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
233
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
234
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
233
235
  * @param {TValue} value The new value.
234
236
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
235
237
  */
@@ -239,11 +241,13 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
239
241
  */
240
242
  onClear: PropTypes.func,
241
243
  /**
242
- * Callback fired when the error associated to the current value changes.
243
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
244
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
245
- * @param {TError} error The new error.
246
- * @param {TValue} value The value associated to the error.
244
+ * Callback fired when the error associated with the current value changes.
245
+ * When a validation error is detected, the `error` parameter contains a non-null value.
246
+ * This can be used to render an appropriate form error.
247
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
248
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
249
+ * @param {TError} error The reason why the current value is not valid.
250
+ * @param {TValue} value The value associated with the error.
247
251
  */
248
252
  onError: PropTypes.func,
249
253
  onFocus: PropTypes.func,
@@ -1,2 +1,2 @@
1
- export { SingleInputDateTimeRangeField } from './SingleInputDateTimeRangeField';
2
- export { useSingleInputDateTimeRangeField as unstable_useSingleInputDateTimeRangeField } from './useSingleInputDateTimeRangeField';
1
+ export { SingleInputDateTimeRangeField } from "./SingleInputDateTimeRangeField.js";
2
+ export { useSingleInputDateTimeRangeField as unstable_useSingleInputDateTimeRangeField } from "./useSingleInputDateTimeRangeField.js";
@@ -1,13 +1,16 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
- import { useField, splitFieldInternalAndForwardedProps, useDefaultizedDateTimeField } from '@mui/x-date-pickers/internals';
3
- import { rangeValueManager, getRangeFieldValueManager } from '../internals/utils/valueManagers';
4
- import { validateDateTimeRange } from '../internals/utils/validation/validateDateTimeRange';
4
+ import { useField, useDefaultizedDateTimeField } from '@mui/x-date-pickers/internals';
5
+ import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
6
+ import { rangeValueManager, getRangeFieldValueManager } from "../internals/utils/valueManagers.js";
7
+ import { validateDateTimeRange } from "../validation/index.js";
5
8
  export const useSingleInputDateTimeRangeField = inProps => {
6
9
  const props = useDefaultizedDateTimeField(inProps);
7
10
  const {
8
11
  forwardedProps,
9
12
  internalProps
10
- } = splitFieldInternalAndForwardedProps(props, 'date-time');
13
+ } = useSplitFieldProps(props, 'date-time');
11
14
  const fieldValueManager = React.useMemo(() => getRangeFieldValueManager({
12
15
  dateSeparator: internalProps.dateSeparator
13
16
  }), [internalProps.dateSeparator]);
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["slots", "slotProps", "InputProps", "inputProps"];
@@ -10,7 +12,7 @@ import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
10
12
  import { useThemeProps } from '@mui/material/styles';
11
13
  import useSlotProps from '@mui/utils/useSlotProps';
12
14
  import { refType } from '@mui/utils';
13
- import { useSingleInputTimeRangeField } from './useSingleInputTimeRangeField';
15
+ import { useSingleInputTimeRangeField } from "./useSingleInputTimeRangeField.js";
14
16
  import { jsx as _jsx } from "react/jsx-runtime";
15
17
  /**
16
18
  * Demos:
@@ -210,8 +212,8 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
210
212
  onBlur: PropTypes.func,
211
213
  /**
212
214
  * Callback fired when the value changes.
213
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
214
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
215
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
216
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
215
217
  * @param {TValue} value The new value.
216
218
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
217
219
  */
@@ -221,11 +223,13 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
221
223
  */
222
224
  onClear: PropTypes.func,
223
225
  /**
224
- * Callback fired when the error associated to the current value changes.
225
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
226
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
227
- * @param {TError} error The new error.
228
- * @param {TValue} value The value associated to the error.
226
+ * Callback fired when the error associated with the current value changes.
227
+ * When a validation error is detected, the `error` parameter contains a non-null value.
228
+ * This can be used to render an appropriate form error.
229
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
230
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
231
+ * @param {TError} error The reason why the current value is not valid.
232
+ * @param {TValue} value The value associated with the error.
229
233
  */
230
234
  onError: PropTypes.func,
231
235
  onFocus: PropTypes.func,
@@ -1,2 +1,2 @@
1
- export { SingleInputTimeRangeField } from './SingleInputTimeRangeField';
2
- export { useSingleInputTimeRangeField as unstable_useSingleInputTimeRangeField } from './useSingleInputTimeRangeField';
1
+ export { SingleInputTimeRangeField } from "./SingleInputTimeRangeField.js";
2
+ export { useSingleInputTimeRangeField as unstable_useSingleInputTimeRangeField } from "./useSingleInputTimeRangeField.js";
@@ -1,13 +1,16 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
- import { useField, splitFieldInternalAndForwardedProps, useDefaultizedTimeField } from '@mui/x-date-pickers/internals';
3
- import { rangeValueManager, getRangeFieldValueManager } from '../internals/utils/valueManagers';
4
- import { validateTimeRange } from '../internals/utils/validation/validateTimeRange';
4
+ import { useField, useDefaultizedTimeField } from '@mui/x-date-pickers/internals';
5
+ import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
6
+ import { rangeValueManager, getRangeFieldValueManager } from "../internals/utils/valueManagers.js";
7
+ import { validateTimeRange } from "../validation/index.js";
5
8
  export const useSingleInputTimeRangeField = inProps => {
6
9
  const props = useDefaultizedTimeField(inProps);
7
10
  const {
8
11
  forwardedProps,
9
12
  internalProps
10
- } = splitFieldInternalAndForwardedProps(props, 'time');
13
+ } = useSplitFieldProps(props, 'time');
11
14
  const fieldValueManager = React.useMemo(() => getRangeFieldValueManager({
12
15
  dateSeparator: internalProps.dateSeparator
13
16
  }), [internalProps.dateSeparator]);
@@ -1,11 +1,13 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
4
- import { useStaticRangePicker } from '../internals/hooks/useStaticRangePicker';
5
- import { useDateRangePickerDefaultizedProps } from '../DateRangePicker/shared';
6
- import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
7
- import { rangeValueManager } from '../internals/utils/valueManagers';
8
- import { validateDateRange } from '../internals/utils/validation/validateDateRange';
6
+ import { useStaticRangePicker } from "../internals/hooks/useStaticRangePicker/index.js";
7
+ import { useDateRangePickerDefaultizedProps } from "../DateRangePicker/shared.js";
8
+ import { renderDateRangeViewCalendar } from "../dateRangeViewRenderers/index.js";
9
+ import { rangeValueManager } from "../internals/utils/valueManagers.js";
10
+ import { validateDateRange } from "../validation/index.js";
9
11
  /**
10
12
  * Demos:
11
13
  *
@@ -155,16 +157,16 @@ StaticDateRangePicker.propTypes = {
155
157
  minDate: PropTypes.object,
156
158
  /**
157
159
  * Callback fired when the value is accepted.
158
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
159
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
160
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
161
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
160
162
  * @param {TValue} value The value that was just accepted.
161
163
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
162
164
  */
163
165
  onAccept: PropTypes.func,
164
166
  /**
165
167
  * Callback fired when the value changes.
166
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
167
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
168
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
169
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
168
170
  * @param {TValue} value The new value.
169
171
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
170
172
  */
@@ -176,13 +178,13 @@ StaticDateRangePicker.propTypes = {
176
178
  */
177
179
  onClose: PropTypes.func,
178
180
  /**
179
- * Callback fired when the error associated to the current value changes.
180
- * If the error has a non-null value, then the `TextField` will be rendered in `error` state.
181
- *
182
- * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
183
- * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
184
- * @param {TError} error The new error describing why the current value is not valid.
185
- * @param {TValue} value The value associated to the error.
181
+ * Callback fired when the error associated with the current value changes.
182
+ * When a validation error is detected, the `error` parameter contains a non-null value.
183
+ * This can be used to render an appropriate form error.
184
+ * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
185
+ * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
186
+ * @param {TError} error The reason why the current value is not valid.
187
+ * @param {TValue} value The value associated with the error.
186
188
  */
187
189
  onError: PropTypes.func,
188
190
  /**