@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.
- package/CHANGELOG.md +185 -1
- package/DateRangeCalendar/DateRangeCalendar.js +16 -13
- package/DateRangeCalendar/index.js +2 -2
- package/DateRangeCalendar/useDragRange.js +3 -1
- package/DateRangePicker/DateRangePicker.js +15 -13
- package/DateRangePicker/DateRangePickerToolbar.js +3 -1
- package/DateRangePicker/index.js +3 -3
- package/DateRangePicker/shared.js +1 -1
- package/DateRangePickerDay/DateRangePickerDay.js +4 -2
- package/DateRangePickerDay/index.js +2 -2
- package/DateTimeRangePicker/DateTimeRangePicker.js +15 -13
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +3 -1
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -2
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +4 -2
- package/DateTimeRangePicker/index.js +5 -5
- package/DateTimeRangePicker/shared.js +2 -2
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +20 -18
- package/DesktopDateRangePicker/index.js +1 -1
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +23 -20
- package/DesktopDateTimeRangePicker/index.js +1 -1
- package/MobileDateRangePicker/MobileDateRangePicker.js +20 -18
- package/MobileDateRangePicker/index.js +1 -1
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +23 -20
- package/MobileDateTimeRangePicker/index.js +1 -1
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +16 -11
- package/MultiInputDateRangeField/index.js +2 -2
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +16 -11
- package/MultiInputDateTimeRangeField/index.js +2 -2
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +16 -11
- package/MultiInputTimeRangeField/index.js +2 -2
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -0
- package/PickersRangeCalendarHeader/index.js +1 -1
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +12 -8
- package/SingleInputDateRangeField/index.js +2 -2
- package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +7 -4
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +12 -8
- package/SingleInputDateTimeRangeField/index.js +2 -2
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +7 -4
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +12 -8
- package/SingleInputTimeRangeField/index.js +2 -2
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +7 -4
- package/StaticDateRangePicker/StaticDateRangePicker.js +18 -16
- package/StaticDateRangePicker/index.js +1 -1
- package/dateRangeViewRenderers/dateRangeViewRenderers.js +1 -1
- package/dateRangeViewRenderers/index.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +20 -19
- package/internals/hooks/useDesktopRangePicker/index.js +1 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +3 -3
- package/internals/hooks/useMobileRangePicker/index.js +1 -1
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -3
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +17 -17
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +17 -17
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +17 -17
- package/internals/hooks/useStaticRangePicker/index.js +1 -1
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -1
- package/internals/models/index.js +4 -4
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/valueManagers.js +1 -1
- package/models/index.js +5 -5
- package/modern/DateRangeCalendar/DateRangeCalendar.js +16 -13
- package/modern/DateRangeCalendar/index.js +2 -2
- package/modern/DateRangeCalendar/useDragRange.js +3 -1
- package/modern/DateRangePicker/DateRangePicker.js +15 -13
- package/modern/DateRangePicker/DateRangePickerToolbar.js +3 -1
- package/modern/DateRangePicker/index.js +3 -3
- package/modern/DateRangePicker/shared.js +1 -1
- package/modern/DateRangePickerDay/DateRangePickerDay.js +4 -2
- package/modern/DateRangePickerDay/index.js +2 -2
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +15 -13
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +3 -1
- package/modern/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -2
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +4 -2
- package/modern/DateTimeRangePicker/index.js +5 -5
- package/modern/DateTimeRangePicker/shared.js +2 -2
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +20 -18
- package/modern/DesktopDateRangePicker/index.js +1 -1
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +23 -20
- package/modern/DesktopDateTimeRangePicker/index.js +1 -1
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +20 -18
- package/modern/MobileDateRangePicker/index.js +1 -1
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +23 -20
- package/modern/MobileDateTimeRangePicker/index.js +1 -1
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +16 -11
- package/modern/MultiInputDateRangeField/index.js +2 -2
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +16 -11
- package/modern/MultiInputDateTimeRangeField/index.js +2 -2
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +16 -11
- package/modern/MultiInputTimeRangeField/index.js +2 -2
- package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -0
- package/modern/PickersRangeCalendarHeader/index.js +1 -1
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +12 -8
- package/modern/SingleInputDateRangeField/index.js +2 -2
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +7 -4
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +12 -8
- package/modern/SingleInputDateTimeRangeField/index.js +2 -2
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +7 -4
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +12 -8
- package/modern/SingleInputTimeRangeField/index.js +2 -2
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +7 -4
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +18 -16
- package/modern/StaticDateRangePicker/index.js +1 -1
- package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +1 -1
- package/modern/dateRangeViewRenderers/index.js +1 -1
- package/modern/index.js +20 -19
- package/modern/internals/hooks/useDesktopRangePicker/index.js +1 -1
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +3 -3
- package/modern/internals/hooks/useMobileRangePicker/index.js +1 -1
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -3
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +17 -17
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +17 -17
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +17 -17
- package/modern/internals/hooks/useStaticRangePicker/index.js +1 -1
- package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -1
- package/modern/internals/models/index.js +4 -4
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/internals/utils/valueManagers.js +1 -1
- package/modern/models/index.js +5 -5
- package/modern/themeAugmentation/index.js +1 -4
- package/modern/validation/index.js +3 -0
- package/modern/{internals/utils/validation → validation}/validateDateRange.js +10 -5
- package/modern/{internals/utils/validation → validation}/validateDateTimeRange.js +10 -5
- package/{internals/utils → modern}/validation/validateTimeRange.js +10 -5
- package/node/DateRangeCalendar/DateRangeCalendar.js +7 -6
- package/node/DateRangeCalendar/useDragRange.js +3 -3
- package/node/DateRangePicker/DateRangePicker.js +14 -14
- package/node/DateRangePicker/DateRangePickerToolbar.js +3 -3
- package/node/DateRangePicker/shared.js +2 -3
- package/node/DateRangePickerDay/DateRangePickerDay.js +3 -3
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +14 -14
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +3 -3
- package/node/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +1 -1
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +3 -3
- package/node/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +1 -1
- package/node/DateTimeRangePicker/shared.js +1 -1
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +18 -18
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +18 -17
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +18 -18
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +18 -17
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +15 -12
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +15 -12
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +15 -12
- package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +3 -3
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +12 -10
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +6 -5
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +12 -10
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +6 -5
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +12 -10
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +6 -5
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +16 -16
- package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +1 -2
- package/node/index.js +13 -1
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +2 -3
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +2 -3
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +2 -3
- package/node/internals/hooks/useMultiInputFieldSelectedSections.js +2 -3
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +14 -14
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +14 -14
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +14 -14
- package/node/internals/hooks/useRangePosition.js +1 -1
- package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +2 -3
- package/node/internals/utils/date-fields-utils.js +1 -1
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/internals/utils/valueManagers.js +1 -1
- package/node/themeAugmentation/index.js +0 -33
- package/node/validation/index.js +26 -0
- package/node/{internals/utils/validation → validation}/validateDateRange.js +13 -8
- package/node/{internals/utils/validation → validation}/validateDateTimeRange.js +13 -8
- package/node/{internals/utils/validation → validation}/validateTimeRange.js +12 -7
- package/package.json +5 -4
- package/themeAugmentation/index.d.ts +3 -3
- package/themeAugmentation/index.js +1 -4
- package/validation/index.d.ts +6 -0
- package/validation/index.js +3 -0
- package/validation/package.json +6 -0
- package/validation/validateDateRange.d.ts +8 -0
- package/{internals/utils/validation → validation}/validateDateRange.js +10 -5
- package/validation/validateDateTimeRange.d.ts +8 -0
- package/{internals/utils/validation → validation}/validateDateTimeRange.js +10 -5
- package/validation/validateTimeRange.d.ts +6 -0
- package/{modern/internals/utils/validation → validation}/validateTimeRange.js +10 -5
- package/internals/utils/validation/validateDateRange.d.ts +0 -7
- package/internals/utils/validation/validateDateTimeRange.d.ts +0 -7
- 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,
|
|
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
|
|
13
|
-
import { renderDateRangeViewCalendar } from
|
|
14
|
-
import { useMobileRangePicker } from
|
|
15
|
-
import { validateDateTimeRange } from
|
|
16
|
-
import { useDateTimeRangePickerDefaultizedProps } from
|
|
17
|
-
import { MultiInputDateTimeRangeField } from
|
|
18
|
-
import { DateTimeRangePickerTimeWrapper } from
|
|
19
|
-
import { RANGE_VIEW_HEIGHT } from
|
|
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.
|
|
302
|
-
* @template TError The validation error type.
|
|
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.
|
|
310
|
-
* @template TError The validation error type.
|
|
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
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* @template
|
|
325
|
-
* @template
|
|
326
|
-
* @param {TError} error The
|
|
327
|
-
* @param {TValue} value The value associated
|
|
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
|
|
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 {
|
|
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
|
|
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(
|
|
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
|
-
} =
|
|
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.
|
|
204
|
-
* @template TError The validation error type.
|
|
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
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
* @
|
|
214
|
-
* @
|
|
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
|
|
2
|
-
export { useMultiInputDateRangeField as unstable_useMultiInputDateRangeField } from
|
|
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 {
|
|
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
|
|
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(
|
|
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
|
-
} =
|
|
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.
|
|
237
|
-
* @template TError The validation error type.
|
|
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
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
* @
|
|
247
|
-
* @
|
|
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
|
|
2
|
-
export { useMultiInputDateTimeRangeField as unstable_useMultiInputDateTimeRangeField } from
|
|
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 {
|
|
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
|
|
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(
|
|
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
|
-
} =
|
|
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.
|
|
219
|
-
* @template TError The validation error type.
|
|
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
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* @
|
|
229
|
-
* @
|
|
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
|
|
2
|
-
export { useMultiInputTimeRangeField as unstable_useMultiInputTimeRangeField } from
|
|
1
|
+
export { MultiInputTimeRangeField, getMultiInputTimeRangeFieldUtilityClass, multiInputTimeRangeFieldClasses } from "./MultiInputTimeRangeField.js";
|
|
2
|
+
export { useMultiInputTimeRangeField as unstable_useMultiInputTimeRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { PickersRangeCalendarHeader } from
|
|
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
|
|
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.
|
|
199
|
-
* @template TError The validation error type.
|
|
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
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* @
|
|
213
|
-
* @
|
|
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
|
|
2
|
-
export { useSingleInputDateRangeField as unstable_useSingleInputDateRangeField } from
|
|
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,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
-
} =
|
|
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
|
|
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.
|
|
232
|
-
* @template TError The validation error type.
|
|
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
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
* @
|
|
246
|
-
* @
|
|
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
|
|
2
|
-
export { useSingleInputDateTimeRangeField as unstable_useSingleInputDateTimeRangeField } from
|
|
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,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
-
} =
|
|
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
|
|
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.
|
|
214
|
-
* @template TError The validation error type.
|
|
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
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* @
|
|
228
|
-
* @
|
|
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
|
|
2
|
-
export { useSingleInputTimeRangeField as unstable_useSingleInputTimeRangeField } from
|
|
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,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
-
} =
|
|
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
|
|
5
|
-
import { useDateRangePickerDefaultizedProps } from
|
|
6
|
-
import { renderDateRangeViewCalendar } from
|
|
7
|
-
import { rangeValueManager } from
|
|
8
|
-
import { validateDateRange } from
|
|
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.
|
|
159
|
-
* @template TError The validation error type.
|
|
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.
|
|
167
|
-
* @template TError The validation error type.
|
|
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
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* @template
|
|
183
|
-
* @template
|
|
184
|
-
* @param {TError} error The
|
|
185
|
-
* @param {TValue} value The value associated
|
|
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
|
/**
|