@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,9 +1,12 @@
|
|
|
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 = ["openTo", "rangePosition"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
|
-
import {
|
|
8
|
+
import { isDatePickerView, isInternalTimeView, resolveDateTimeFormat, useUtils } from '@mui/x-date-pickers/internals';
|
|
9
|
+
import { extractValidationProps } from '@mui/x-date-pickers/validation';
|
|
7
10
|
import resolveComponentProps from '@mui/utils/resolveComponentProps';
|
|
8
11
|
import { refType } from '@mui/utils';
|
|
9
12
|
import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from '@mui/x-date-pickers/timeViewRenderers';
|
|
@@ -11,14 +14,14 @@ import { multiSectionDigitalClockClasses, multiSectionDigitalClockSectionClasses
|
|
|
11
14
|
import Divider from '@mui/material/Divider';
|
|
12
15
|
import { digitalClockClasses } from '@mui/x-date-pickers/DigitalClock';
|
|
13
16
|
import { DesktopDateTimePickerLayout } from '@mui/x-date-pickers/DesktopDateTimePicker';
|
|
14
|
-
import { rangeValueManager } from
|
|
15
|
-
import { renderDateRangeViewCalendar } from
|
|
16
|
-
import { useDesktopRangePicker } from
|
|
17
|
-
import { validateDateTimeRange } from
|
|
18
|
-
import { useDateTimeRangePickerDefaultizedProps } from
|
|
19
|
-
import { MultiInputDateTimeRangeField } from
|
|
20
|
-
import { DateTimeRangePickerTimeWrapper } from
|
|
21
|
-
import { RANGE_VIEW_HEIGHT } from
|
|
17
|
+
import { rangeValueManager } from "../internals/utils/valueManagers.js";
|
|
18
|
+
import { renderDateRangeViewCalendar } from "../dateRangeViewRenderers/index.js";
|
|
19
|
+
import { useDesktopRangePicker } from "../internals/hooks/useDesktopRangePicker/index.js";
|
|
20
|
+
import { validateDateTimeRange } from "../validation/index.js";
|
|
21
|
+
import { useDateTimeRangePickerDefaultizedProps } from "../DateTimeRangePicker/shared.js";
|
|
22
|
+
import { MultiInputDateTimeRangeField } from "../MultiInputDateTimeRangeField/index.js";
|
|
23
|
+
import { DateTimeRangePickerTimeWrapper } from "../DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js";
|
|
24
|
+
import { RANGE_VIEW_HEIGHT } from "../internals/constants/dimensions.js";
|
|
22
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
26
|
const rendererInterceptor = function rendererInterceptor(inViewRenderers, popperView, rendererProps) {
|
|
24
27
|
const {
|
|
@@ -304,16 +307,16 @@ DesktopDateTimeRangePicker.propTypes = {
|
|
|
304
307
|
name: PropTypes.string,
|
|
305
308
|
/**
|
|
306
309
|
* Callback fired when the value is accepted.
|
|
307
|
-
* @template TValue The value type.
|
|
308
|
-
* @template TError The validation error type.
|
|
310
|
+
* @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.
|
|
311
|
+
* @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.
|
|
309
312
|
* @param {TValue} value The value that was just accepted.
|
|
310
313
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
311
314
|
*/
|
|
312
315
|
onAccept: PropTypes.func,
|
|
313
316
|
/**
|
|
314
317
|
* Callback fired when the value changes.
|
|
315
|
-
* @template TValue The value type.
|
|
316
|
-
* @template TError The validation error type.
|
|
318
|
+
* @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.
|
|
319
|
+
* @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.
|
|
317
320
|
* @param {TValue} value The new value.
|
|
318
321
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
319
322
|
*/
|
|
@@ -324,13 +327,13 @@ DesktopDateTimeRangePicker.propTypes = {
|
|
|
324
327
|
*/
|
|
325
328
|
onClose: PropTypes.func,
|
|
326
329
|
/**
|
|
327
|
-
* Callback fired when the error associated
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
* @template
|
|
331
|
-
* @template
|
|
332
|
-
* @param {TError} error The
|
|
333
|
-
* @param {TValue} value The value associated
|
|
330
|
+
* Callback fired when the error associated with the current value changes.
|
|
331
|
+
* When a validation error is detected, the `error` parameter contains a non-null value.
|
|
332
|
+
* This can be used to render an appropriate form error.
|
|
333
|
+
* @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.
|
|
334
|
+
* @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.
|
|
335
|
+
* @param {TError} error The reason why the current value is not valid.
|
|
336
|
+
* @param {TValue} value The value associated with the error.
|
|
334
337
|
*/
|
|
335
338
|
onError: PropTypes.func,
|
|
336
339
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DesktopDateTimeRangePicker } from
|
|
1
|
+
export { DesktopDateTimeRangePicker } from "./DesktopDateTimeRangePicker.js";
|
|
@@ -1,15 +1,17 @@
|
|
|
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 { extractValidationProps } from '@mui/x-date-pickers/
|
|
6
|
+
import { extractValidationProps } from '@mui/x-date-pickers/validation';
|
|
5
7
|
import resolveComponentProps from '@mui/utils/resolveComponentProps';
|
|
6
8
|
import { refType } from '@mui/utils';
|
|
7
|
-
import { rangeValueManager } from
|
|
8
|
-
import { useDateRangePickerDefaultizedProps } from
|
|
9
|
-
import { renderDateRangeViewCalendar } from
|
|
10
|
-
import { MultiInputDateRangeField } from
|
|
11
|
-
import { useMobileRangePicker } from
|
|
12
|
-
import { validateDateRange } from
|
|
9
|
+
import { rangeValueManager } from "../internals/utils/valueManagers.js";
|
|
10
|
+
import { useDateRangePickerDefaultizedProps } from "../DateRangePicker/shared.js";
|
|
11
|
+
import { renderDateRangeViewCalendar } from "../dateRangeViewRenderers/index.js";
|
|
12
|
+
import { MultiInputDateRangeField } from "../MultiInputDateRangeField/index.js";
|
|
13
|
+
import { useMobileRangePicker } from "../internals/hooks/useMobileRangePicker/index.js";
|
|
14
|
+
import { validateDateRange } from "../validation/index.js";
|
|
13
15
|
/**
|
|
14
16
|
* Demos:
|
|
15
17
|
*
|
|
@@ -192,16 +194,16 @@ MobileDateRangePicker.propTypes = {
|
|
|
192
194
|
name: PropTypes.string,
|
|
193
195
|
/**
|
|
194
196
|
* Callback fired when the value is accepted.
|
|
195
|
-
* @template TValue The value type.
|
|
196
|
-
* @template TError The validation error type.
|
|
197
|
+
* @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.
|
|
198
|
+
* @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.
|
|
197
199
|
* @param {TValue} value The value that was just accepted.
|
|
198
200
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
199
201
|
*/
|
|
200
202
|
onAccept: PropTypes.func,
|
|
201
203
|
/**
|
|
202
204
|
* Callback fired when the value changes.
|
|
203
|
-
* @template TValue The value type.
|
|
204
|
-
* @template TError The validation error type.
|
|
205
|
+
* @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.
|
|
206
|
+
* @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
207
|
* @param {TValue} value The new value.
|
|
206
208
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
207
209
|
*/
|
|
@@ -212,13 +214,13 @@ MobileDateRangePicker.propTypes = {
|
|
|
212
214
|
*/
|
|
213
215
|
onClose: PropTypes.func,
|
|
214
216
|
/**
|
|
215
|
-
* Callback fired when the error associated
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* @template
|
|
219
|
-
* @template
|
|
220
|
-
* @param {TError} error The
|
|
221
|
-
* @param {TValue} value The value associated
|
|
217
|
+
* Callback fired when the error associated with the current value changes.
|
|
218
|
+
* When a validation error is detected, the `error` parameter contains a non-null value.
|
|
219
|
+
* This can be used to render an appropriate form error.
|
|
220
|
+
* @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.
|
|
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
|
+
* @param {TError} error The reason why the current value is not valid.
|
|
223
|
+
* @param {TValue} value The value associated with the error.
|
|
222
224
|
*/
|
|
223
225
|
onError: PropTypes.func,
|
|
224
226
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MobileDateRangePicker } from
|
|
1
|
+
export { MobileDateRangePicker } from "./MobileDateRangePicker.js";
|
|
@@ -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,3 +1,3 @@
|
|
|
1
1
|
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
2
|
import { UseSingleInputDateRangeFieldProps } from './SingleInputDateRangeField.types';
|
|
3
|
-
export declare const useSingleInputDateRangeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseSingleInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("@mui/x-date-pickers/internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseSingleInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("@mui/x-date-pickers/internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>> & Required<Pick<UseSingleInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("@mui/x-date-pickers/internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>>>, keyof
|
|
3
|
+
export declare const useSingleInputDateRangeField: <TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TAllProps extends UseSingleInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>>(inProps: TAllProps) => import("@mui/x-date-pickers/internals").UseFieldResponse<TEnableAccessibleFieldDOMStructure, Omit<TAllProps & Omit<UseSingleInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("@mui/x-date-pickers/internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>> & Required<Pick<UseSingleInputDateRangeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, keyof import("@mui/x-date-pickers/internals/hooks/defaultizedFieldProps").UseDefaultizedDateFieldBaseProps<any>>>, "disabled" | "format" | "onChange" | "onError" | "defaultValue" | "value" | "readOnly" | "referenceDate" | "timezone" | "formatDensity" | "enableAccessibleFieldDOMStructure" | "selectedSections" | "onSelectedSectionsChange" | "shouldRespectLeadingZeros" | "unstableFieldRef" | "shouldDisableDate" | "shouldDisableMonth" | "shouldDisableYear" | keyof import("@mui/x-date-pickers/internals").BaseDateValidationProps<any> | "dateSeparator">>;
|
|
@@ -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]);
|