@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,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 = ["value", "defaultValue", "referenceDate", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone", "availableRangePositions", "views", "view", "openTo", "onViewChange"],
|
|
@@ -13,17 +15,18 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
13
15
|
import composeClasses from '@mui/utils/composeClasses';
|
|
14
16
|
import useId from '@mui/utils/useId';
|
|
15
17
|
import { Watermark } from '@mui/x-license';
|
|
16
|
-
import { applyDefaultDate, DayCalendar, useDefaultReduceAnimations, useCalendarState, useDefaultDates, useUtils, useNow, DEFAULT_DESKTOP_MODE_MEDIA_QUERY,
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
18
|
+
import { applyDefaultDate, DayCalendar, useDefaultReduceAnimations, useCalendarState, useDefaultDates, useUtils, useNow, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, useControlledValueWithTimezone, useViews } from '@mui/x-date-pickers/internals';
|
|
19
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
20
|
+
import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
|
|
21
|
+
import { dateRangeCalendarClasses, getDateRangeCalendarUtilityClass } from "./dateRangeCalendarClasses.js";
|
|
22
|
+
import { isEndOfRange, isRangeValid, isStartOfRange, isWithinRange } from "../internals/utils/date-utils.js";
|
|
23
|
+
import { calculateRangeChange, calculateRangePreview } from "../internals/utils/date-range-manager.js";
|
|
24
|
+
import { DateRangePickerDay, dateRangePickerDayClasses as dayClasses } from "../DateRangePickerDay/index.js";
|
|
25
|
+
import { rangeValueManager } from "../internals/utils/valueManagers.js";
|
|
26
|
+
import { useDragRange } from "./useDragRange.js";
|
|
27
|
+
import { useRangePosition } from "../internals/hooks/useRangePosition.js";
|
|
28
|
+
import { DAY_RANGE_SIZE, DAY_MARGIN } from "../internals/constants/dimensions.js";
|
|
29
|
+
import { PickersRangeCalendarHeader } from "../PickersRangeCalendarHeader/index.js";
|
|
27
30
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
31
|
const releaseInfo = getReleaseInfo();
|
|
29
32
|
const DateRangeCalendarRoot = styled('div', {
|
|
@@ -321,7 +324,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
321
324
|
if (disableAutoMonthSwitching && prevDate && utils.isEqual(prevDate, date)) {
|
|
322
325
|
return;
|
|
323
326
|
}
|
|
324
|
-
const displayingMonthRange = calendars -
|
|
327
|
+
const displayingMonthRange = calendars - currentMonthCalendarPosition;
|
|
325
328
|
const currentMonthNumber = utils.getMonth(calendarState.currentMonth);
|
|
326
329
|
const requestedMonthNumber = utils.getMonth(date);
|
|
327
330
|
if (!utils.isSameYear(calendarState.currentMonth, date) || requestedMonthNumber < currentMonthNumber || requestedMonthNumber > currentMonthNumber + displayingMonthRange) {
|
|
@@ -587,7 +590,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
587
590
|
minDate: PropTypes.object,
|
|
588
591
|
/**
|
|
589
592
|
* Callback fired when the value changes.
|
|
590
|
-
* @template TValue The value type.
|
|
593
|
+
* @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.
|
|
591
594
|
* @template TView The view type. Will be one of date or time views.
|
|
592
595
|
* @param {TValue} value The new value.
|
|
593
596
|
* @param {PickerSelectionState | undefined} selectionState Indicates if the date selection is complete.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DateRangeCalendar } from
|
|
2
|
-
export { getDateRangeCalendarUtilityClass, dateRangeCalendarClasses } from
|
|
1
|
+
export { DateRangeCalendar } from "./DateRangeCalendar.js";
|
|
2
|
+
export { getDateRangeCalendarUtilityClass, dateRangeCalendarClasses } from "./dateRangeCalendarClasses.js";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
4
|
-
import { isEndOfRange, isStartOfRange } from
|
|
6
|
+
import { isEndOfRange, isStartOfRange } from "../internals/utils/date-utils.js";
|
|
5
7
|
const resolveDateFromTarget = (target, utils, timezone) => {
|
|
6
8
|
const timestampString = target.dataset.timestamp;
|
|
7
9
|
if (!timestampString) {
|
|
@@ -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 = ["desktopModeMediaQuery"];
|
|
@@ -6,8 +8,8 @@ import PropTypes from 'prop-types';
|
|
|
6
8
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
7
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
10
|
import { refType } from '@mui/utils';
|
|
9
|
-
import { DesktopDateRangePicker } from
|
|
10
|
-
import { MobileDateRangePicker } from
|
|
11
|
+
import { DesktopDateRangePicker } from "../DesktopDateRangePicker/index.js";
|
|
12
|
+
import { MobileDateRangePicker } from "../MobileDateRangePicker/index.js";
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
/**
|
|
13
15
|
* Demos:
|
|
@@ -191,16 +193,16 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
191
193
|
name: PropTypes.string,
|
|
192
194
|
/**
|
|
193
195
|
* Callback fired when the value is accepted.
|
|
194
|
-
* @template TValue The value type.
|
|
195
|
-
* @template TError The validation error type.
|
|
196
|
+
* @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.
|
|
197
|
+
* @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.
|
|
196
198
|
* @param {TValue} value The value that was just accepted.
|
|
197
199
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
198
200
|
*/
|
|
199
201
|
onAccept: PropTypes.func,
|
|
200
202
|
/**
|
|
201
203
|
* Callback fired when the value changes.
|
|
202
|
-
* @template TValue The value type.
|
|
203
|
-
* @template TError The validation error type.
|
|
204
|
+
* @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.
|
|
205
|
+
* @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.
|
|
204
206
|
* @param {TValue} value The new value.
|
|
205
207
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
206
208
|
*/
|
|
@@ -211,13 +213,13 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
211
213
|
*/
|
|
212
214
|
onClose: PropTypes.func,
|
|
213
215
|
/**
|
|
214
|
-
* Callback fired when the error associated
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* @template
|
|
218
|
-
* @template
|
|
219
|
-
* @param {TError} error The
|
|
220
|
-
* @param {TValue} value The value associated
|
|
216
|
+
* Callback fired when the error associated with the current value changes.
|
|
217
|
+
* When a validation error is detected, the `error` parameter contains a non-null value.
|
|
218
|
+
* This can be used to render an appropriate form error.
|
|
219
|
+
* @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
|
+
* @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.
|
|
221
|
+
* @param {TError} error The reason why the current value is not valid.
|
|
222
|
+
* @param {TValue} value The value associated with the error.
|
|
221
223
|
*/
|
|
222
224
|
onError: PropTypes.func,
|
|
223
225
|
/**
|
|
@@ -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 = ["value", "rangePosition", "onRangePositionChange", "toolbarFormat", "className", "onViewChange", "view", "views"];
|
|
@@ -9,7 +11,7 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
9
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
12
|
import { PickersToolbar, PickersToolbarButton, useUtils } from '@mui/x-date-pickers/internals';
|
|
11
13
|
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
12
|
-
import { getDateRangePickerToolbarUtilityClass } from
|
|
14
|
+
import { getDateRangePickerToolbarUtilityClass } from "./dateRangePickerToolbarClasses.js";
|
|
13
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
16
|
const useUtilityClasses = ownerState => {
|
|
15
17
|
const {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DateRangePicker } from
|
|
2
|
-
export { DateRangePickerToolbar } from
|
|
3
|
-
export { getDateRangePickerToolbarUtilityClass, dateRangePickerToolbarClasses } from
|
|
1
|
+
export { DateRangePicker } from "./DateRangePicker.js";
|
|
2
|
+
export { DateRangePickerToolbar } from "./DateRangePickerToolbar.js";
|
|
3
|
+
export { getDateRangePickerToolbarUtilityClass, dateRangePickerToolbarClasses } from "./dateRangePickerToolbarClasses.js";
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
4
|
import { useDefaultDates, useUtils, applyDefaultDate } from '@mui/x-date-pickers/internals';
|
|
5
|
-
import { DateRangePickerToolbar } from
|
|
5
|
+
import { DateRangePickerToolbar } from "./DateRangePickerToolbar.js";
|
|
6
6
|
export function useDateRangePickerDefaultizedProps(props, name) {
|
|
7
7
|
const utils = useUtils();
|
|
8
8
|
const defaultDates = useDefaultDates();
|
|
@@ -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 = ["className", "day", "outsideCurrentMonth", "isEndOfHighlighting", "isEndOfPreviewing", "isHighlighting", "isPreviewing", "isStartOfHighlighting", "isStartOfPreviewing", "selected", "isVisuallySelected", "sx", "draggable", "isFirstVisibleCell", "isLastVisibleCell"];
|
|
@@ -9,8 +11,8 @@ import { alpha, styled, useThemeProps } from '@mui/material/styles';
|
|
|
9
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
12
|
import { useUtils } from '@mui/x-date-pickers/internals';
|
|
11
13
|
import { PickersDay } from '@mui/x-date-pickers/PickersDay';
|
|
12
|
-
import { getDateRangePickerDayUtilityClass, dateRangePickerDayClasses } from
|
|
13
|
-
import { getReleaseInfo } from
|
|
14
|
+
import { getDateRangePickerDayUtilityClass, dateRangePickerDayClasses } from "./dateRangePickerDayClasses.js";
|
|
15
|
+
import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
|
|
14
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
17
|
const releaseInfo = getReleaseInfo();
|
|
16
18
|
const useUtilityClasses = ownerState => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DateRangePickerDay } from
|
|
2
|
-
export { getDateRangePickerDayUtilityClass, dateRangePickerDayClasses } from
|
|
1
|
+
export { DateRangePickerDay } from "./DateRangePickerDay.js";
|
|
2
|
+
export { getDateRangePickerDayUtilityClass, dateRangePickerDayClasses } from "./dateRangePickerDayClasses.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 = ["desktopModeMediaQuery"];
|
|
@@ -6,8 +8,8 @@ import PropTypes from 'prop-types';
|
|
|
6
8
|
import { refType } from '@mui/utils';
|
|
7
9
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
8
10
|
import { useThemeProps } from '@mui/material/styles';
|
|
9
|
-
import { DesktopDateTimeRangePicker } from
|
|
10
|
-
import { MobileDateTimeRangePicker } from
|
|
11
|
+
import { DesktopDateTimeRangePicker } from "../DesktopDateTimeRangePicker/index.js";
|
|
12
|
+
import { MobileDateTimeRangePicker } from "../MobileDateTimeRangePicker/index.js";
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
/**
|
|
13
15
|
* Demos:
|
|
@@ -224,16 +226,16 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
224
226
|
name: PropTypes.string,
|
|
225
227
|
/**
|
|
226
228
|
* Callback fired when the value is accepted.
|
|
227
|
-
* @template TValue The value type.
|
|
228
|
-
* @template TError The validation error type.
|
|
229
|
+
* @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.
|
|
230
|
+
* @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.
|
|
229
231
|
* @param {TValue} value The value that was just accepted.
|
|
230
232
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
231
233
|
*/
|
|
232
234
|
onAccept: PropTypes.func,
|
|
233
235
|
/**
|
|
234
236
|
* Callback fired when the value changes.
|
|
235
|
-
* @template TValue The value type.
|
|
236
|
-
* @template TError The validation error type.
|
|
237
|
+
* @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.
|
|
238
|
+
* @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.
|
|
237
239
|
* @param {TValue} value The new value.
|
|
238
240
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
239
241
|
*/
|
|
@@ -244,13 +246,13 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
244
246
|
*/
|
|
245
247
|
onClose: PropTypes.func,
|
|
246
248
|
/**
|
|
247
|
-
* Callback fired when the error associated
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
* @template
|
|
251
|
-
* @template
|
|
252
|
-
* @param {TError} error The
|
|
253
|
-
* @param {TValue} value The value associated
|
|
249
|
+
* Callback fired when the error associated with the current value changes.
|
|
250
|
+
* When a validation error is detected, the `error` parameter contains a non-null value.
|
|
251
|
+
* This can be used to render an appropriate form error.
|
|
252
|
+
* @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.
|
|
253
|
+
* @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.
|
|
254
|
+
* @param {TError} error The reason why the current value is not valid.
|
|
255
|
+
* @param {TValue} value The value associated with the error.
|
|
254
256
|
*/
|
|
255
257
|
onError: PropTypes.func,
|
|
256
258
|
/**
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import clsx from 'clsx';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -9,7 +11,7 @@ import { isDatePickerView } from '@mui/x-date-pickers/internals';
|
|
|
9
11
|
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
10
12
|
import IconButton from '@mui/material/IconButton';
|
|
11
13
|
import Button from '@mui/material/Button';
|
|
12
|
-
import { getDateTimeRangePickerTabsUtilityClass } from
|
|
14
|
+
import { getDateTimeRangePickerTabsUtilityClass } from "./dateTimeRangePickerTabsClasses.js";
|
|
13
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
16
|
const viewToTab = (view, rangePosition) => {
|
|
15
17
|
if (isDatePickerView(view)) {
|
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["rangePosition", "onRangePositionChange", "viewRenderer", "value", "onChange", "defaultValue", "onViewChange", "views", "className"];
|
|
4
4
|
import { isInternalTimeView, useUtils } from '@mui/x-date-pickers/internals';
|
|
5
|
-
import { isRangeValid } from
|
|
6
|
-
import { calculateRangeChange } from
|
|
5
|
+
import { isRangeValid } from "../internals/utils/date-utils.js";
|
|
6
|
+
import { calculateRangeChange } from "../internals/utils/date-range-manager.js";
|
|
7
7
|
/**
|
|
8
8
|
* @ignore - internal component.
|
|
9
9
|
*/
|
|
@@ -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 = ["value", "rangePosition", "onRangePositionChange", "className", "onViewChange", "toolbarVariant", "onChange", "classes", "view", "isLandscape", "views", "ampm", "disabled", "readOnly", "hidden", "toolbarFormat", "toolbarPlaceholder", "titleId", "sx"];
|
|
@@ -9,8 +11,8 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
9
11
|
import { useUtils } from '@mui/x-date-pickers/internals';
|
|
10
12
|
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
|
|
11
13
|
import { DateTimePickerToolbar } from '@mui/x-date-pickers/DateTimePicker';
|
|
12
|
-
import { getDateTimeRangePickerToolbarUtilityClass } from
|
|
13
|
-
import { calculateRangeChange } from
|
|
14
|
+
import { getDateTimeRangePickerToolbarUtilityClass } from "./dateTimeRangePickerToolbarClasses.js";
|
|
15
|
+
import { calculateRangeChange } from "../internals/utils/date-range-manager.js";
|
|
14
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
17
|
const useUtilityClasses = ownerState => {
|
|
16
18
|
const {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { DateTimeRangePicker } from
|
|
2
|
-
export { DateTimeRangePickerTabs } from
|
|
3
|
-
export { getDateTimeRangePickerTabsUtilityClass, dateTimeRangePickerTabsClasses } from
|
|
4
|
-
export { DateTimeRangePickerToolbar } from
|
|
5
|
-
export { getDateTimeRangePickerToolbarUtilityClass, dateTimeRangePickerToolbarClasses } from
|
|
1
|
+
export { DateTimeRangePicker } from "./DateTimeRangePicker.js";
|
|
2
|
+
export { DateTimeRangePickerTabs } from "./DateTimeRangePickerTabs.js";
|
|
3
|
+
export { getDateTimeRangePickerTabsUtilityClass, dateTimeRangePickerTabsClasses } from "./dateTimeRangePickerTabsClasses.js";
|
|
4
|
+
export { DateTimeRangePickerToolbar } from "./DateTimeRangePickerToolbar.js";
|
|
5
|
+
export { getDateTimeRangePickerToolbarUtilityClass, dateTimeRangePickerToolbarClasses } from "./dateTimeRangePickerToolbarClasses.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { useThemeProps } from '@mui/material/styles';
|
|
3
3
|
import { useDefaultDates, useUtils, applyDefaultDate, applyDefaultViewProps, resolveTimeViewsResponse } from '@mui/x-date-pickers/internals';
|
|
4
|
-
import { DateTimeRangePickerToolbar } from
|
|
5
|
-
import { DateTimeRangePickerTabs } from
|
|
4
|
+
import { DateTimeRangePickerToolbar } from "./DateTimeRangePickerToolbar.js";
|
|
5
|
+
import { DateTimeRangePickerTabs } from "./DateTimeRangePickerTabs.js";
|
|
6
6
|
export function useDateTimeRangePickerDefaultizedProps(props, name) {
|
|
7
7
|
const utils = useUtils();
|
|
8
8
|
const defaultDates = useDefaultDates();
|
|
@@ -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 { useDesktopRangePicker } 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 { useDesktopRangePicker } from "../internals/hooks/useDesktopRangePicker/index.js";
|
|
14
|
+
import { validateDateRange } from "../validation/index.js";
|
|
13
15
|
/**
|
|
14
16
|
* Demos:
|
|
15
17
|
*
|
|
@@ -196,16 +198,16 @@ DesktopDateRangePicker.propTypes = {
|
|
|
196
198
|
name: PropTypes.string,
|
|
197
199
|
/**
|
|
198
200
|
* Callback fired when the value is accepted.
|
|
199
|
-
* @template TValue The value type.
|
|
200
|
-
* @template TError The validation error type.
|
|
201
|
+
* @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.
|
|
202
|
+
* @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.
|
|
201
203
|
* @param {TValue} value The value that was just accepted.
|
|
202
204
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
203
205
|
*/
|
|
204
206
|
onAccept: PropTypes.func,
|
|
205
207
|
/**
|
|
206
208
|
* Callback fired when the value changes.
|
|
207
|
-
* @template TValue The value type.
|
|
208
|
-
* @template TError The validation error type.
|
|
209
|
+
* @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.
|
|
210
|
+
* @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.
|
|
209
211
|
* @param {TValue} value The new value.
|
|
210
212
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
211
213
|
*/
|
|
@@ -216,13 +218,13 @@ DesktopDateRangePicker.propTypes = {
|
|
|
216
218
|
*/
|
|
217
219
|
onClose: PropTypes.func,
|
|
218
220
|
/**
|
|
219
|
-
* Callback fired when the error associated
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
* @template
|
|
223
|
-
* @template
|
|
224
|
-
* @param {TError} error The
|
|
225
|
-
* @param {TValue} value The value associated
|
|
221
|
+
* Callback fired when the error associated with the current value changes.
|
|
222
|
+
* When a validation error is detected, the `error` parameter contains a non-null value.
|
|
223
|
+
* This can be used to render an appropriate form error.
|
|
224
|
+
* @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.
|
|
225
|
+
* @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.
|
|
226
|
+
* @param {TError} error The reason why the current value is not valid.
|
|
227
|
+
* @param {TValue} value The value associated with the error.
|
|
226
228
|
*/
|
|
227
229
|
onError: PropTypes.func,
|
|
228
230
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DesktopDateRangePicker } from
|
|
1
|
+
export { DesktopDateRangePicker } from "./DesktopDateRangePicker.js";
|
|
@@ -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";
|