@mui/x-date-pickers-pro 7.0.0-beta.6 → 7.0.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 +311 -12
- package/DateRangeCalendar/DateRangeCalendar.js +34 -74
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +3 -2
- package/DateRangeCalendar/useDragRange.js +1 -2
- package/DateRangePicker/DateRangePicker.js +1 -1
- package/DateRangePicker/shared.js +3 -5
- package/DateTimeRangePicker/DateTimeRangePicker.d.ts +10 -0
- package/DateTimeRangePicker/DateTimeRangePicker.js +11 -1
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +4 -5
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -3
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +2 -2
- package/DateTimeRangePicker/shared.d.ts +5 -4
- package/DateTimeRangePicker/shared.js +9 -10
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -10
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +10 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +31 -28
- package/MobileDateRangePicker/MobileDateRangePicker.js +5 -9
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +10 -0
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -14
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +21 -17
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +21 -17
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +20 -16
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.d.ts +8 -0
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +124 -0
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.d.ts +18 -0
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.js +1 -0
- package/PickersRangeCalendarHeader/index.d.ts +2 -0
- package/PickersRangeCalendarHeader/index.js +1 -0
- package/PickersRangeCalendarHeader/package.json +6 -0
- package/README.md +1 -1
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +8 -4
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +6 -2
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +8 -4
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +6 -2
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +7 -3
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +6 -2
- package/StaticDateRangePicker/StaticDateRangePicker.js +4 -5
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +9 -11
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +25 -31
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +9 -10
- package/internals/hooks/useMultiInputFieldSelectedSections.js +3 -6
- package/internals/hooks/useRangePosition.js +3 -5
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +14 -18
- package/internals/models/dateRange.d.ts +3 -3
- package/internals/models/dateTimeRange.d.ts +2 -2
- package/internals/models/timeRange.d.ts +2 -2
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/validation/validateDateRange.js +2 -2
- package/internals/utils/validation/validateDateTimeRange.js +2 -2
- package/internals/utils/valueManagers.d.ts +3 -1
- package/internals/utils/valueManagers.js +9 -7
- package/models/fields.d.ts +8 -1
- package/modern/DateRangeCalendar/DateRangeCalendar.js +40 -72
- package/modern/DateRangePicker/DateRangePicker.js +1 -1
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +11 -1
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -9
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -5
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +14 -6
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -6
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -5
- package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +124 -0
- package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.js +1 -0
- package/modern/PickersRangeCalendarHeader/index.js +1 -0
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -1
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +6 -2
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -1
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +6 -2
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +5 -0
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +6 -2
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/modern/index.js +2 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/internals/utils/valueManagers.js +7 -5
- package/node/DateRangeCalendar/DateRangeCalendar.js +39 -71
- package/node/DateRangePicker/DateRangePicker.js +1 -1
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +11 -1
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -9
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -5
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +14 -6
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -6
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -5
- package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +132 -0
- package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.js +5 -0
- package/node/PickersRangeCalendarHeader/index.js +12 -0
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -1
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +7 -1
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -1
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +7 -1
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +5 -0
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +7 -1
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/node/index.js +13 -1
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/internals/utils/valueManagers.js +9 -6
- package/package.json +7 -7
- package/themeAugmentation/components.d.ts +3 -0
- package/themeAugmentation/props.d.ts +2 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.d.ts +0 -9
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -52
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -51
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -59
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["calendars", "month", "monthIndex"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { styled } from '@mui/material/styles';
|
|
7
|
+
import { PickersCalendarHeader } from '@mui/x-date-pickers/PickersCalendarHeader';
|
|
8
|
+
import { PickersArrowSwitcher, useLocaleText, useNextMonthDisabled, usePreviousMonthDisabled, useUtils } from '@mui/x-date-pickers/internals';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
const PickersRangeCalendarHeaderContentMultipleCalendars = styled(PickersArrowSwitcher)({
|
|
11
|
+
padding: '12px 16px 4px 16px',
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'space-between'
|
|
15
|
+
});
|
|
16
|
+
const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersRangeCalendarHeader(props, ref) {
|
|
17
|
+
const utils = useUtils();
|
|
18
|
+
const localeText = useLocaleText();
|
|
19
|
+
const {
|
|
20
|
+
calendars,
|
|
21
|
+
month,
|
|
22
|
+
monthIndex
|
|
23
|
+
} = props,
|
|
24
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
25
|
+
const {
|
|
26
|
+
format,
|
|
27
|
+
slots,
|
|
28
|
+
slotProps,
|
|
29
|
+
currentMonth,
|
|
30
|
+
onMonthChange,
|
|
31
|
+
disableFuture,
|
|
32
|
+
disablePast,
|
|
33
|
+
minDate,
|
|
34
|
+
maxDate,
|
|
35
|
+
timezone
|
|
36
|
+
} = props;
|
|
37
|
+
const isNextMonthDisabled = useNextMonthDisabled(currentMonth, {
|
|
38
|
+
disableFuture,
|
|
39
|
+
maxDate,
|
|
40
|
+
timezone
|
|
41
|
+
});
|
|
42
|
+
const isPreviousMonthDisabled = usePreviousMonthDisabled(currentMonth, {
|
|
43
|
+
disablePast,
|
|
44
|
+
minDate,
|
|
45
|
+
timezone
|
|
46
|
+
});
|
|
47
|
+
if (calendars === 1) {
|
|
48
|
+
return /*#__PURE__*/_jsx(PickersCalendarHeader, _extends({}, other, {
|
|
49
|
+
ref: ref
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
const selectNextMonth = () => onMonthChange(utils.addMonths(currentMonth, 1), 'left');
|
|
53
|
+
const selectPreviousMonth = () => onMonthChange(utils.addMonths(currentMonth, -1), 'right');
|
|
54
|
+
return /*#__PURE__*/_jsx(PickersRangeCalendarHeaderContentMultipleCalendars, {
|
|
55
|
+
ref: ref,
|
|
56
|
+
onGoToPrevious: selectPreviousMonth,
|
|
57
|
+
onGoToNext: selectNextMonth,
|
|
58
|
+
isPreviousHidden: monthIndex !== 0,
|
|
59
|
+
isPreviousDisabled: isPreviousMonthDisabled,
|
|
60
|
+
previousLabel: localeText.previousMonth,
|
|
61
|
+
isNextHidden: monthIndex !== calendars - 1,
|
|
62
|
+
isNextDisabled: isNextMonthDisabled,
|
|
63
|
+
nextLabel: localeText.nextMonth,
|
|
64
|
+
slots: slots,
|
|
65
|
+
slotProps: slotProps,
|
|
66
|
+
children: utils.formatByString(month, format ?? `${utils.formats.month} ${utils.formats.year}`)
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
process.env.NODE_ENV !== "production" ? PickersRangeCalendarHeader.propTypes = {
|
|
70
|
+
// ----------------------------- Warning --------------------------------
|
|
71
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
72
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
73
|
+
// ----------------------------------------------------------------------
|
|
74
|
+
/**
|
|
75
|
+
* The number of calendars rendered.
|
|
76
|
+
*/
|
|
77
|
+
calendars: PropTypes.oneOf([1, 2, 3]).isRequired,
|
|
78
|
+
/**
|
|
79
|
+
* Override or extend the styles applied to the component.
|
|
80
|
+
*/
|
|
81
|
+
classes: PropTypes.object,
|
|
82
|
+
className: PropTypes.string,
|
|
83
|
+
currentMonth: PropTypes.object.isRequired,
|
|
84
|
+
disabled: PropTypes.bool,
|
|
85
|
+
disableFuture: PropTypes.bool,
|
|
86
|
+
disablePast: PropTypes.bool,
|
|
87
|
+
/**
|
|
88
|
+
* Format used to display the date.
|
|
89
|
+
* @default `${adapter.formats.month} ${adapter.formats.year}`
|
|
90
|
+
*/
|
|
91
|
+
format: PropTypes.string,
|
|
92
|
+
labelId: PropTypes.string,
|
|
93
|
+
maxDate: PropTypes.object.isRequired,
|
|
94
|
+
minDate: PropTypes.object.isRequired,
|
|
95
|
+
/**
|
|
96
|
+
* Month used for this header.
|
|
97
|
+
*/
|
|
98
|
+
month: PropTypes.object.isRequired,
|
|
99
|
+
/**
|
|
100
|
+
* Index of the month used for this header.
|
|
101
|
+
*/
|
|
102
|
+
monthIndex: PropTypes.number.isRequired,
|
|
103
|
+
onMonthChange: PropTypes.func.isRequired,
|
|
104
|
+
onViewChange: PropTypes.func,
|
|
105
|
+
reduceAnimations: PropTypes.bool.isRequired,
|
|
106
|
+
/**
|
|
107
|
+
* The props used for each component slot.
|
|
108
|
+
* @default {}
|
|
109
|
+
*/
|
|
110
|
+
slotProps: PropTypes.object,
|
|
111
|
+
/**
|
|
112
|
+
* Overridable component slots.
|
|
113
|
+
* @default {}
|
|
114
|
+
*/
|
|
115
|
+
slots: PropTypes.object,
|
|
116
|
+
/**
|
|
117
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
118
|
+
*/
|
|
119
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
120
|
+
timezone: PropTypes.string.isRequired,
|
|
121
|
+
view: PropTypes.oneOf(['day', 'month', 'year']).isRequired,
|
|
122
|
+
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired).isRequired
|
|
123
|
+
} : void 0;
|
|
124
|
+
export { PickersRangeCalendarHeader };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PickersRangeCalendarHeader } from './PickersRangeCalendarHeader';
|
|
@@ -82,6 +82,11 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
82
82
|
*/
|
|
83
83
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
84
84
|
component: PropTypes.elementType,
|
|
85
|
+
/**
|
|
86
|
+
* String displayed between the start and the end dates.
|
|
87
|
+
* @default "–"
|
|
88
|
+
*/
|
|
89
|
+
dateSeparator: PropTypes.string,
|
|
85
90
|
/**
|
|
86
91
|
* The default value. Use when the component is not controlled.
|
|
87
92
|
*/
|
|
@@ -242,7 +247,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
242
247
|
/**
|
|
243
248
|
* Disable specific date.
|
|
244
249
|
*
|
|
245
|
-
* Warning: This function can be called multiple times (
|
|
250
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
246
251
|
*
|
|
247
252
|
* @template TDate
|
|
248
253
|
* @param {TDate} day The date to test.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { useField, splitFieldInternalAndForwardedProps, useDefaultizedDateField } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import { rangeValueManager,
|
|
3
|
+
import { rangeValueManager, getRangeFieldValueManager } from '../internals/utils/valueManagers';
|
|
3
4
|
import { validateDateRange } from '../internals/utils/validation/validateDateRange';
|
|
4
5
|
export const useSingleInputDateRangeField = inProps => {
|
|
5
6
|
const props = useDefaultizedDateField(inProps);
|
|
@@ -7,11 +8,14 @@ export const useSingleInputDateRangeField = inProps => {
|
|
|
7
8
|
forwardedProps,
|
|
8
9
|
internalProps
|
|
9
10
|
} = splitFieldInternalAndForwardedProps(props, 'date');
|
|
11
|
+
const fieldValueManager = React.useMemo(() => getRangeFieldValueManager({
|
|
12
|
+
dateSeparator: internalProps.dateSeparator
|
|
13
|
+
}), [internalProps.dateSeparator]);
|
|
10
14
|
return useField({
|
|
11
15
|
forwardedProps,
|
|
12
16
|
internalProps,
|
|
13
17
|
valueManager: rangeValueManager,
|
|
14
|
-
fieldValueManager
|
|
18
|
+
fieldValueManager,
|
|
15
19
|
validator: validateDateRange,
|
|
16
20
|
valueType: 'date'
|
|
17
21
|
});
|
|
@@ -87,6 +87,11 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
87
87
|
*/
|
|
88
88
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
89
89
|
component: PropTypes.elementType,
|
|
90
|
+
/**
|
|
91
|
+
* String displayed between the start and the end dates.
|
|
92
|
+
* @default "–"
|
|
93
|
+
*/
|
|
94
|
+
dateSeparator: PropTypes.string,
|
|
90
95
|
/**
|
|
91
96
|
* The default value. Use when the component is not controlled.
|
|
92
97
|
*/
|
|
@@ -275,7 +280,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
275
280
|
/**
|
|
276
281
|
* Disable specific date.
|
|
277
282
|
*
|
|
278
|
-
* Warning: This function can be called multiple times (
|
|
283
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
279
284
|
*
|
|
280
285
|
* @template TDate
|
|
281
286
|
* @param {TDate} day The date to test.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { useField, splitFieldInternalAndForwardedProps, useDefaultizedDateTimeField } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import { rangeValueManager,
|
|
3
|
+
import { rangeValueManager, getRangeFieldValueManager } from '../internals/utils/valueManagers';
|
|
3
4
|
import { validateDateTimeRange } from '../internals/utils/validation/validateDateTimeRange';
|
|
4
5
|
export const useSingleInputDateTimeRangeField = inProps => {
|
|
5
6
|
const props = useDefaultizedDateTimeField(inProps);
|
|
@@ -7,11 +8,14 @@ export const useSingleInputDateTimeRangeField = inProps => {
|
|
|
7
8
|
forwardedProps,
|
|
8
9
|
internalProps
|
|
9
10
|
} = splitFieldInternalAndForwardedProps(props, 'date-time');
|
|
11
|
+
const fieldValueManager = React.useMemo(() => getRangeFieldValueManager({
|
|
12
|
+
dateSeparator: internalProps.dateSeparator
|
|
13
|
+
}), [internalProps.dateSeparator]);
|
|
10
14
|
return useField({
|
|
11
15
|
forwardedProps,
|
|
12
16
|
internalProps,
|
|
13
17
|
valueManager: rangeValueManager,
|
|
14
|
-
fieldValueManager
|
|
18
|
+
fieldValueManager,
|
|
15
19
|
validator: validateDateTimeRange,
|
|
16
20
|
valueType: 'date-time'
|
|
17
21
|
});
|
|
@@ -87,6 +87,11 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
87
87
|
*/
|
|
88
88
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
89
89
|
component: PropTypes.elementType,
|
|
90
|
+
/**
|
|
91
|
+
* String displayed between the start and the end dates.
|
|
92
|
+
* @default "–"
|
|
93
|
+
*/
|
|
94
|
+
dateSeparator: PropTypes.string,
|
|
90
95
|
/**
|
|
91
96
|
* The default value. Use when the component is not controlled.
|
|
92
97
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { useField, splitFieldInternalAndForwardedProps, useDefaultizedTimeField } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import { rangeValueManager,
|
|
3
|
+
import { rangeValueManager, getRangeFieldValueManager } from '../internals/utils/valueManagers';
|
|
3
4
|
import { validateTimeRange } from '../internals/utils/validation/validateTimeRange';
|
|
4
5
|
export const useSingleInputTimeRangeField = inProps => {
|
|
5
6
|
const props = useDefaultizedTimeField(inProps);
|
|
@@ -7,11 +8,14 @@ export const useSingleInputTimeRangeField = inProps => {
|
|
|
7
8
|
forwardedProps,
|
|
8
9
|
internalProps
|
|
9
10
|
} = splitFieldInternalAndForwardedProps(props, 'time');
|
|
11
|
+
const fieldValueManager = React.useMemo(() => getRangeFieldValueManager({
|
|
12
|
+
dateSeparator: internalProps.dateSeparator
|
|
13
|
+
}), [internalProps.dateSeparator]);
|
|
10
14
|
return useField({
|
|
11
15
|
forwardedProps,
|
|
12
16
|
internalProps,
|
|
13
17
|
valueManager: rangeValueManager,
|
|
14
|
-
fieldValueManager
|
|
18
|
+
fieldValueManager,
|
|
15
19
|
validator: validateTimeRange,
|
|
16
20
|
valueType: 'time'
|
|
17
21
|
});
|
|
@@ -217,7 +217,7 @@ StaticDateRangePicker.propTypes = {
|
|
|
217
217
|
/**
|
|
218
218
|
* Disable specific date.
|
|
219
219
|
*
|
|
220
|
-
* Warning: This function can be called multiple times (
|
|
220
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
221
221
|
*
|
|
222
222
|
* @template TDate
|
|
223
223
|
* @param {TDate} day The date to test.
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers-pro v7.0.0
|
|
2
|
+
* @mui/x-date-pickers-pro v7.0.0
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
@@ -24,6 +24,7 @@ export * from './SingleInputDateTimeRangeField';
|
|
|
24
24
|
|
|
25
25
|
// Calendars
|
|
26
26
|
export * from './DateRangeCalendar';
|
|
27
|
+
export * from './PickersRangeCalendarHeader';
|
|
27
28
|
|
|
28
29
|
// New pickers
|
|
29
30
|
export * from './DateRangePicker';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcxMTA1ODQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -35,7 +35,9 @@ export const rangeValueManager = {
|
|
|
35
35
|
},
|
|
36
36
|
setTimezone: (utils, timezone, value) => [value[0] == null ? null : utils.setTimezone(value[0], timezone), value[1] == null ? null : utils.setTimezone(value[1], timezone)]
|
|
37
37
|
};
|
|
38
|
-
export const
|
|
38
|
+
export const getRangeFieldValueManager = ({
|
|
39
|
+
dateSeparator = '–'
|
|
40
|
+
}) => ({
|
|
39
41
|
updateReferenceValue: (utils, value, prevReferenceValue) => {
|
|
40
42
|
const shouldKeepStartDate = value[0] != null && utils.isValid(value[0]);
|
|
41
43
|
const shouldKeepEndDate = value[1] != null && utils.isValid(value[1]);
|
|
@@ -66,7 +68,7 @@ export const rangeFieldValueManager = {
|
|
|
66
68
|
return _extends({}, section, {
|
|
67
69
|
dateName: position,
|
|
68
70
|
// TODO: Check if RTL still works
|
|
69
|
-
endSeparator: `${section.endSeparator}
|
|
71
|
+
endSeparator: `${section.endSeparator} ${dateSeparator} `
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
74
|
return _extends({}, section, {
|
|
@@ -85,8 +87,8 @@ export const rangeFieldValueManager = {
|
|
|
85
87
|
return createDateStrForV6InputFromSections([...dateRangeSections.startDate, ...dateRangeSections.endDate], localizedDigits, isRTL);
|
|
86
88
|
},
|
|
87
89
|
parseValueStr: (valueStr, referenceValue, parseDate) => {
|
|
88
|
-
// TODO: Improve because it would not work if
|
|
89
|
-
const [startStr, endStr] = valueStr.split(
|
|
90
|
+
// TODO: Improve because it would not work if some section have the same separator as the dateSeparator.
|
|
91
|
+
const [startStr, endStr] = valueStr.split(dateSeparator);
|
|
90
92
|
return [startStr, endStr].map((dateStr, index) => {
|
|
91
93
|
if (dateStr == null) {
|
|
92
94
|
return null;
|
|
@@ -113,4 +115,4 @@ export const rangeFieldValueManager = {
|
|
|
113
115
|
})
|
|
114
116
|
};
|
|
115
117
|
}
|
|
116
|
-
};
|
|
118
|
+
});
|
|
@@ -16,7 +16,6 @@ var _utils = require("@mui/base/utils");
|
|
|
16
16
|
var _styles = require("@mui/material/styles");
|
|
17
17
|
var _utils2 = require("@mui/utils");
|
|
18
18
|
var _xLicense = require("@mui/x-license");
|
|
19
|
-
var _PickersCalendarHeader = require("@mui/x-date-pickers/PickersCalendarHeader");
|
|
20
19
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
21
20
|
var _releaseInfo = require("../internals/utils/releaseInfo");
|
|
22
21
|
var _dateRangeCalendarClasses = require("./dateRangeCalendarClasses");
|
|
@@ -27,6 +26,7 @@ var _valueManagers = require("../internals/utils/valueManagers");
|
|
|
27
26
|
var _useDragRange2 = require("./useDragRange");
|
|
28
27
|
var _useRangePosition = require("../internals/hooks/useRangePosition");
|
|
29
28
|
var _dimensions = require("../internals/constants/dimensions");
|
|
29
|
+
var _PickersRangeCalendarHeader = require("../PickersRangeCalendarHeader");
|
|
30
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
31
|
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"],
|
|
32
32
|
_excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
|
|
@@ -52,12 +52,6 @@ const DateRangeCalendarMonthContainer = (0, _styles.styled)('div', {
|
|
|
52
52
|
borderRight: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
53
53
|
}
|
|
54
54
|
}));
|
|
55
|
-
const DateRangeCalendarArrowSwitcher = (0, _styles.styled)(_internals.PickersArrowSwitcher)({
|
|
56
|
-
padding: '12px 16px 4px 16px',
|
|
57
|
-
display: 'flex',
|
|
58
|
-
alignItems: 'center',
|
|
59
|
-
justifyContent: 'space-between'
|
|
60
|
-
});
|
|
61
55
|
const weeksContainerHeight = (_dimensions.DAY_RANGE_SIZE + _dimensions.DAY_MARGIN * 2) * 6;
|
|
62
56
|
const warnInvalidCurrentMonthCalendarPosition = (0, _internals.buildWarning)(['The `currentMonthCalendarPosition` prop must be an integer between `1` and the amount of calendars rendered.', 'For example if you have 2 calendars rendered, it should be equal to either 1 or 2.']);
|
|
63
57
|
const DayCalendarForRange = (0, _styles.styled)(_internals.DayCalendar)(({
|
|
@@ -198,7 +192,6 @@ const DateRangeCalendar = exports.DateRangeCalendar = /*#__PURE__*/React.forward
|
|
|
198
192
|
autoFocus
|
|
199
193
|
});
|
|
200
194
|
const utils = (0, _internals.useUtils)();
|
|
201
|
-
const localeText = (0, _internals.useLocaleText)();
|
|
202
195
|
const now = (0, _internals.useNow)(timezone);
|
|
203
196
|
const {
|
|
204
197
|
rangePosition,
|
|
@@ -296,15 +289,12 @@ const DateRangeCalendar = exports.DateRangeCalendar = /*#__PURE__*/React.forward
|
|
|
296
289
|
shouldDisableDate: wrappedShouldDisableDate,
|
|
297
290
|
timezone
|
|
298
291
|
});
|
|
299
|
-
|
|
300
|
-
// When disabled, limit the view to the selected date
|
|
301
|
-
const minDateWithDisabled = disabled && value[0] || minDate;
|
|
302
|
-
const maxDateWithDisabled = disabled && value[1] || maxDate;
|
|
303
|
-
const CalendarHeader = slots?.calendarHeader ?? _PickersCalendarHeader.PickersCalendarHeader;
|
|
292
|
+
const CalendarHeader = slots?.calendarHeader ?? _PickersRangeCalendarHeader.PickersRangeCalendarHeader;
|
|
304
293
|
const calendarHeaderProps = (0, _utils.useSlotProps)({
|
|
305
294
|
elementType: CalendarHeader,
|
|
306
295
|
externalSlotProps: slotProps?.calendarHeader,
|
|
307
296
|
additionalProps: {
|
|
297
|
+
calendars,
|
|
308
298
|
views: ['day'],
|
|
309
299
|
view: 'day',
|
|
310
300
|
currentMonth: calendarState.currentMonth,
|
|
@@ -312,15 +302,15 @@ const DateRangeCalendar = exports.DateRangeCalendar = /*#__PURE__*/React.forward
|
|
|
312
302
|
newMonth,
|
|
313
303
|
direction
|
|
314
304
|
}),
|
|
315
|
-
minDate
|
|
316
|
-
maxDate
|
|
305
|
+
minDate,
|
|
306
|
+
maxDate,
|
|
317
307
|
disabled,
|
|
318
308
|
disablePast,
|
|
319
309
|
disableFuture,
|
|
320
310
|
reduceAnimations,
|
|
311
|
+
timezone,
|
|
321
312
|
slots,
|
|
322
|
-
slotProps
|
|
323
|
-
timezone
|
|
313
|
+
slotProps
|
|
324
314
|
},
|
|
325
315
|
ownerState: props
|
|
326
316
|
});
|
|
@@ -349,22 +339,6 @@ const DateRangeCalendar = exports.DateRangeCalendar = /*#__PURE__*/React.forward
|
|
|
349
339
|
}
|
|
350
340
|
}, [rangePosition, value]); // eslint-disable-line
|
|
351
341
|
|
|
352
|
-
const selectNextMonth = React.useCallback(() => {
|
|
353
|
-
changeMonth(utils.addMonths(calendarState.currentMonth, 1));
|
|
354
|
-
}, [changeMonth, calendarState.currentMonth, utils]);
|
|
355
|
-
const selectPreviousMonth = React.useCallback(() => {
|
|
356
|
-
changeMonth(utils.addMonths(calendarState.currentMonth, -1));
|
|
357
|
-
}, [changeMonth, calendarState.currentMonth, utils]);
|
|
358
|
-
const isNextMonthDisabled = (0, _internals.useNextMonthDisabled)(calendarState.currentMonth, {
|
|
359
|
-
disableFuture,
|
|
360
|
-
maxDate,
|
|
361
|
-
timezone
|
|
362
|
-
});
|
|
363
|
-
const isPreviousMonthDisabled = (0, _internals.usePreviousMonthDisabled)(calendarState.currentMonth, {
|
|
364
|
-
disablePast,
|
|
365
|
-
minDate,
|
|
366
|
-
timezone
|
|
367
|
-
});
|
|
368
342
|
const baseDateValidationProps = {
|
|
369
343
|
disablePast,
|
|
370
344
|
disableFuture,
|
|
@@ -470,43 +444,37 @@ const DateRangeCalendar = exports.DateRangeCalendar = /*#__PURE__*/React.forward
|
|
|
470
444
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_xLicense.Watermark, {
|
|
471
445
|
packageName: "x-date-pickers-pro",
|
|
472
446
|
releaseInfo: releaseInfo
|
|
473
|
-
}), calendarMonths.map(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
autoFocus: visibleMonths[month] === focusedMonth,
|
|
505
|
-
fixedWeekNumber: fixedWeekNumber,
|
|
506
|
-
displayWeekNumber: displayWeekNumber,
|
|
507
|
-
timezone: timezone
|
|
508
|
-
}), index)]
|
|
509
|
-
}, month))]
|
|
447
|
+
}), calendarMonths.map(monthIndex => {
|
|
448
|
+
const month = visibleMonths[monthIndex];
|
|
449
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(DateRangeCalendarMonthContainer, {
|
|
450
|
+
className: classes.monthContainer,
|
|
451
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CalendarHeader, (0, _extends2.default)({}, calendarHeaderProps, {
|
|
452
|
+
month: month,
|
|
453
|
+
monthIndex: monthIndex
|
|
454
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(DayCalendarForRange, (0, _extends2.default)({
|
|
455
|
+
className: classes.dayCalendar
|
|
456
|
+
}, calendarState, baseDateValidationProps, commonViewProps, {
|
|
457
|
+
onMonthSwitchingAnimationEnd: onMonthSwitchingAnimationEnd,
|
|
458
|
+
onFocusedDayChange: changeFocusedDay,
|
|
459
|
+
reduceAnimations: reduceAnimations,
|
|
460
|
+
selectedDays: value,
|
|
461
|
+
onSelectedDaysChange: handleSelectedDayChange,
|
|
462
|
+
currentMonth: month,
|
|
463
|
+
TransitionProps: CalendarTransitionProps,
|
|
464
|
+
shouldDisableDate: wrappedShouldDisableDate,
|
|
465
|
+
showDaysOutsideCurrentMonth: calendars === 1 && showDaysOutsideCurrentMonth,
|
|
466
|
+
dayOfWeekFormatter: dayOfWeekFormatter,
|
|
467
|
+
loading: loading,
|
|
468
|
+
renderLoading: renderLoading,
|
|
469
|
+
slots: slotsForDayCalendar,
|
|
470
|
+
slotProps: slotPropsForDayCalendar,
|
|
471
|
+
autoFocus: month === focusedMonth,
|
|
472
|
+
fixedWeekNumber: fixedWeekNumber,
|
|
473
|
+
displayWeekNumber: displayWeekNumber,
|
|
474
|
+
timezone: timezone
|
|
475
|
+
}))]
|
|
476
|
+
}, monthIndex);
|
|
477
|
+
})]
|
|
510
478
|
}));
|
|
511
479
|
});
|
|
512
480
|
process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
@@ -687,7 +655,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
687
655
|
/**
|
|
688
656
|
* Disable specific date.
|
|
689
657
|
*
|
|
690
|
-
* Warning: This function can be called multiple times (
|
|
658
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
691
659
|
*
|
|
692
660
|
* @template TDate
|
|
693
661
|
* @param {TDate} day The date to test.
|
|
@@ -286,7 +286,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
286
286
|
/**
|
|
287
287
|
* Disable specific date.
|
|
288
288
|
*
|
|
289
|
-
* Warning: This function can be called multiple times (
|
|
289
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
290
290
|
*
|
|
291
291
|
* @template TDate
|
|
292
292
|
* @param {TDate} day The date to test.
|
|
@@ -18,6 +18,16 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
18
18
|
const _excluded = ["desktopModeMediaQuery"];
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
/**
|
|
22
|
+
* Demos:
|
|
23
|
+
*
|
|
24
|
+
* - [DateTimeRangePicker](https://mui.com/x/react-date-pickers/date-time-range-picker/)
|
|
25
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
26
|
+
*
|
|
27
|
+
* API:
|
|
28
|
+
*
|
|
29
|
+
* - [DateTimeRangePicker API](https://mui.com/x/api/date-pickers/date-time-range-picker/)
|
|
30
|
+
*/
|
|
21
31
|
const DateTimeRangePicker = exports.DateTimeRangePicker = /*#__PURE__*/React.forwardRef(function DateTimeRangePicker(inProps, ref) {
|
|
22
32
|
const props = (0, _styles.useThemeProps)({
|
|
23
33
|
props: inProps,
|
|
@@ -321,7 +331,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
321
331
|
/**
|
|
322
332
|
* Disable specific date.
|
|
323
333
|
*
|
|
324
|
-
* Warning: This function can be called multiple times (
|
|
334
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
325
335
|
*
|
|
326
336
|
* @template TDate
|
|
327
337
|
* @param {TDate} day The date to test.
|
|
@@ -291,7 +291,7 @@ DesktopDateRangePicker.propTypes = {
|
|
|
291
291
|
/**
|
|
292
292
|
* Disable specific date.
|
|
293
293
|
*
|
|
294
|
-
* Warning: This function can be called multiple times (
|
|
294
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
295
295
|
*
|
|
296
296
|
* @template TDate
|
|
297
297
|
* @param {TDate} day The date to test.
|
|
@@ -16,6 +16,7 @@ var _timeViewRenderers = require("@mui/x-date-pickers/timeViewRenderers");
|
|
|
16
16
|
var _MultiSectionDigitalClock = require("@mui/x-date-pickers/MultiSectionDigitalClock");
|
|
17
17
|
var _Divider = _interopRequireDefault(require("@mui/material/Divider"));
|
|
18
18
|
var _DigitalClock = require("@mui/x-date-pickers/DigitalClock");
|
|
19
|
+
var _DesktopDateTimePicker = require("@mui/x-date-pickers/DesktopDateTimePicker");
|
|
19
20
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
20
21
|
var _dateRangeViewRenderers = require("../dateRangeViewRenderers");
|
|
21
22
|
var _useDesktopRangePicker = require("../internals/hooks/useDesktopRangePicker");
|
|
@@ -24,28 +25,27 @@ var _shared = require("../DateTimeRangePicker/shared");
|
|
|
24
25
|
var _MultiInputDateTimeRangeField = require("../MultiInputDateTimeRangeField");
|
|
25
26
|
var _DateTimeRangePickerTimeWrapper = require("../DateTimeRangePicker/DateTimeRangePickerTimeWrapper");
|
|
26
27
|
var _dimensions = require("../internals/constants/dimensions");
|
|
27
|
-
var _DesktopDateTimeRangePickerLayout = require("./DesktopDateTimeRangePickerLayout");
|
|
28
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
-
const _excluded = ["openTo", "rangePosition"
|
|
29
|
+
const _excluded = ["openTo", "rangePosition"];
|
|
30
30
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
31
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
32
|
const rendererInterceptor = function rendererInterceptor(inViewRenderers, popperView, rendererProps) {
|
|
33
33
|
const {
|
|
34
34
|
openTo,
|
|
35
|
-
rangePosition
|
|
36
|
-
sx
|
|
35
|
+
rangePosition
|
|
37
36
|
} = rendererProps,
|
|
38
37
|
otherProps = (0, _objectWithoutPropertiesLoose2.default)(rendererProps, _excluded);
|
|
39
38
|
const finalProps = (0, _extends2.default)({}, otherProps, {
|
|
40
39
|
rangePosition,
|
|
41
40
|
focusedView: null,
|
|
42
41
|
sx: [{
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
[`&.${_MultiSectionDigitalClock.multiSectionDigitalClockClasses.root}`]: {
|
|
43
|
+
borderBottom: 0
|
|
44
|
+
},
|
|
45
45
|
[`&.${_MultiSectionDigitalClock.multiSectionDigitalClockClasses.root}, .${_MultiSectionDigitalClock.multiSectionDigitalClockSectionClasses.root}, &.${_DigitalClock.digitalClockClasses.root}`]: {
|
|
46
46
|
maxHeight: _dimensions.RANGE_VIEW_HEIGHT
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}]
|
|
49
49
|
});
|
|
50
50
|
const isTimeViewActive = (0, _internals.isInternalTimeView)(popperView);
|
|
51
51
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
@@ -57,11 +57,22 @@ const rendererInterceptor = function rendererInterceptor(inViewRenderers, popper
|
|
|
57
57
|
orientation: "vertical"
|
|
58
58
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateTimeRangePickerTimeWrapper.DateTimeRangePickerTimeWrapper, (0, _extends2.default)({}, finalProps, {
|
|
59
59
|
view: isTimeViewActive ? popperView : 'hours',
|
|
60
|
+
views: finalProps.views.filter(_internals.isInternalTimeView),
|
|
60
61
|
openTo: (0, _internals.isInternalTimeView)(openTo) ? openTo : 'hours',
|
|
61
62
|
viewRenderer: inViewRenderers[isTimeViewActive ? popperView : 'hours']
|
|
62
63
|
}))]
|
|
63
64
|
});
|
|
64
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Demos:
|
|
68
|
+
*
|
|
69
|
+
* - [DateTimeRangePicker](https://mui.com/x/react-date-pickers/date-time-range-picker/)
|
|
70
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
71
|
+
*
|
|
72
|
+
* API:
|
|
73
|
+
*
|
|
74
|
+
* - [DesktopDateTimeRangePicker API](https://mui.com/x/api/date-pickers/desktop-date-time-range-picker/)
|
|
75
|
+
*/
|
|
65
76
|
const DesktopDateTimeRangePicker = exports.DesktopDateTimeRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTimeRangePicker(inProps, ref) {
|
|
66
77
|
// Props with the default values common to all date time range pickers
|
|
67
78
|
const defaultizedProps = (0, _shared.useDateTimeRangePickerDefaultizedProps)(inProps, 'MuiDesktopDateTimeRangePicker');
|
|
@@ -86,7 +97,7 @@ const DesktopDateTimeRangePicker = exports.DesktopDateTimeRangePicker = /*#__PUR
|
|
|
86
97
|
calendars: defaultizedProps.calendars ?? 1,
|
|
87
98
|
slots: (0, _extends2.default)({
|
|
88
99
|
field: _MultiInputDateTimeRangeField.MultiInputDateTimeRangeField,
|
|
89
|
-
layout:
|
|
100
|
+
layout: _DesktopDateTimePicker.DesktopDateTimePickerLayout
|
|
90
101
|
}, defaultizedProps.slots),
|
|
91
102
|
slotProps: (0, _extends2.default)({}, defaultizedProps.slotProps, {
|
|
92
103
|
field: ownerState => (0, _extends2.default)({}, (0, _utils.resolveComponentProps)(defaultizedProps.slotProps?.field, ownerState), (0, _internals.extractValidationProps)(defaultizedProps), {
|
|
@@ -389,7 +400,7 @@ DesktopDateTimeRangePicker.propTypes = {
|
|
|
389
400
|
/**
|
|
390
401
|
* Disable specific date.
|
|
391
402
|
*
|
|
392
|
-
* Warning: This function can be called multiple times (
|
|
403
|
+
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
393
404
|
*
|
|
394
405
|
* @template TDate
|
|
395
406
|
* @param {TDate} day The date to test.
|