@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
|
@@ -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
|
});
|
|
@@ -17,9 +17,8 @@ import { validateDateRange } from '../internals/utils/validation/validateDateRan
|
|
|
17
17
|
* - [StaticDateRangePicker API](https://mui.com/x/api/date-pickers/static-date-range-picker/)
|
|
18
18
|
*/
|
|
19
19
|
const StaticDateRangePicker = /*#__PURE__*/React.forwardRef(function StaticDateRangePicker(inProps, ref) {
|
|
20
|
-
var _defaultizedProps$dis, _defaultizedProps$cal, _defaultizedProps$slo;
|
|
21
20
|
const defaultizedProps = useDateRangePickerDefaultizedProps(inProps, 'MuiStaticDateRangePicker');
|
|
22
|
-
const displayStaticWrapperAs =
|
|
21
|
+
const displayStaticWrapperAs = defaultizedProps.displayStaticWrapperAs ?? 'mobile';
|
|
23
22
|
const viewRenderers = _extends({
|
|
24
23
|
day: renderDateRangeViewCalendar
|
|
25
24
|
}, defaultizedProps.viewRenderers);
|
|
@@ -30,11 +29,11 @@ const StaticDateRangePicker = /*#__PURE__*/React.forwardRef(function StaticDateR
|
|
|
30
29
|
displayStaticWrapperAs,
|
|
31
30
|
views: ['day'],
|
|
32
31
|
openTo: 'day',
|
|
33
|
-
calendars:
|
|
32
|
+
calendars: defaultizedProps.calendars ?? (displayStaticWrapperAs === 'mobile' ? 1 : 2),
|
|
34
33
|
slotProps: _extends({}, defaultizedProps.slotProps, {
|
|
35
34
|
toolbar: _extends({
|
|
36
35
|
hidden: displayStaticWrapperAs === 'desktop'
|
|
37
|
-
},
|
|
36
|
+
}, defaultizedProps.slotProps?.toolbar)
|
|
38
37
|
})
|
|
39
38
|
});
|
|
40
39
|
const {
|
|
@@ -218,7 +217,7 @@ StaticDateRangePicker.propTypes = {
|
|
|
218
217
|
/**
|
|
219
218
|
* Disable specific date.
|
|
220
219
|
*
|
|
221
|
-
* 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.
|
|
222
221
|
*
|
|
223
222
|
* @template TDate
|
|
224
223
|
* @param {TDate} day The date to test.
|
package/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './SingleInputDateRangeField';
|
|
|
14
14
|
export * from './SingleInputTimeRangeField';
|
|
15
15
|
export * from './SingleInputDateTimeRangeField';
|
|
16
16
|
export * from './DateRangeCalendar';
|
|
17
|
+
export * from './PickersRangeCalendarHeader';
|
|
17
18
|
export * from './DateRangePicker';
|
|
18
19
|
export * from './DesktopDateRangePicker';
|
|
19
20
|
export * from './MobileDateRangePicker';
|
package/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';
|
|
@@ -14,7 +14,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
const releaseInfo = getReleaseInfo();
|
|
16
16
|
export const useDesktopRangePicker = _ref => {
|
|
17
|
-
var _props$openTo, _fieldType, _initialView$current, _slots$layout;
|
|
18
17
|
let {
|
|
19
18
|
props
|
|
20
19
|
} = _ref,
|
|
@@ -46,8 +45,8 @@ export const useDesktopRangePicker = _ref => {
|
|
|
46
45
|
const popperRef = React.useRef(null);
|
|
47
46
|
const startFieldRef = React.useRef(null);
|
|
48
47
|
const endFieldRef = React.useRef(null);
|
|
49
|
-
const initialView = React.useRef(
|
|
50
|
-
const fieldType =
|
|
48
|
+
const initialView = React.useRef(props.openTo ?? null);
|
|
49
|
+
const fieldType = slots.field.fieldType ?? 'multi-input';
|
|
51
50
|
const {
|
|
52
51
|
rangePosition,
|
|
53
52
|
onRangePositionChange
|
|
@@ -77,8 +76,7 @@ export const useDesktopRangePicker = _ref => {
|
|
|
77
76
|
}, []);
|
|
78
77
|
const handleBlur = () => {
|
|
79
78
|
executeInTheNextEventLoopTick(() => {
|
|
80
|
-
|
|
81
|
-
if ((_fieldContainerRef$cu = fieldContainerRef.current) != null && _fieldContainerRef$cu.contains(getActiveElement(document)) || (_popperRef$current = popperRef.current) != null && _popperRef$current.contains(getActiveElement(document))) {
|
|
79
|
+
if (fieldContainerRef.current?.contains(getActiveElement(document)) || popperRef.current?.contains(getActiveElement(document))) {
|
|
82
80
|
return;
|
|
83
81
|
}
|
|
84
82
|
actions.onDismiss();
|
|
@@ -87,7 +85,7 @@ export const useDesktopRangePicker = _ref => {
|
|
|
87
85
|
const Field = slots.field;
|
|
88
86
|
const fieldProps = useSlotProps({
|
|
89
87
|
elementType: Field,
|
|
90
|
-
externalSlotProps: slotProps
|
|
88
|
+
externalSlotProps: slotProps?.field,
|
|
91
89
|
additionalProps: _extends({}, pickerFieldProps, {
|
|
92
90
|
readOnly,
|
|
93
91
|
disabled,
|
|
@@ -126,20 +124,20 @@ export const useDesktopRangePicker = _ref => {
|
|
|
126
124
|
startFieldRef,
|
|
127
125
|
endFieldRef,
|
|
128
126
|
currentView: layoutProps.view !== props.openTo ? layoutProps.view : undefined,
|
|
129
|
-
initialView:
|
|
127
|
+
initialView: initialView.current ?? undefined,
|
|
130
128
|
onViewChange: layoutProps.onViewChange
|
|
131
129
|
});
|
|
132
130
|
const slotPropsForLayout = _extends({}, slotProps, {
|
|
133
|
-
tabs: _extends({}, slotProps
|
|
131
|
+
tabs: _extends({}, slotProps?.tabs, {
|
|
134
132
|
rangePosition,
|
|
135
133
|
onRangePositionChange
|
|
136
134
|
}),
|
|
137
|
-
toolbar: _extends({}, slotProps
|
|
135
|
+
toolbar: _extends({}, slotProps?.toolbar, {
|
|
138
136
|
rangePosition,
|
|
139
137
|
onRangePositionChange
|
|
140
138
|
})
|
|
141
139
|
});
|
|
142
|
-
const Layout =
|
|
140
|
+
const Layout = slots?.layout ?? PickersLayout;
|
|
143
141
|
const renderPicker = () => /*#__PURE__*/_jsxs(LocalizationProvider, {
|
|
144
142
|
localeText: localeText,
|
|
145
143
|
children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldProps)), /*#__PURE__*/_jsx(PickersPopper, _extends({
|
|
@@ -154,7 +152,7 @@ export const useDesktopRangePicker = _ref => {
|
|
|
154
152
|
slotProps: slotProps,
|
|
155
153
|
shouldRestoreFocus: shouldRestoreFocus,
|
|
156
154
|
reduceAnimations: reduceAnimations,
|
|
157
|
-
children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps
|
|
155
|
+
children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps?.layout, {
|
|
158
156
|
slots: slots,
|
|
159
157
|
slotProps: slotPropsForLayout,
|
|
160
158
|
children: renderCurrentView()
|
|
@@ -32,12 +32,11 @@ const useMultiInputFieldSlotProps = ({
|
|
|
32
32
|
const handleEndFieldRef = useForkRef(fieldProps.unstableEndFieldRef, endFieldRef);
|
|
33
33
|
const previousRangePosition = React.useRef(rangePosition);
|
|
34
34
|
React.useEffect(() => {
|
|
35
|
-
var _currentFieldRef$curr;
|
|
36
35
|
if (!open) {
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
39
38
|
const currentFieldRef = rangePosition === 'start' ? startFieldRef : endFieldRef;
|
|
40
|
-
|
|
39
|
+
currentFieldRef.current?.focusField();
|
|
41
40
|
if (!currentFieldRef.current || !currentView) {
|
|
42
41
|
// could happen when the user is switching between the inputs
|
|
43
42
|
previousRangePosition.current = rangePosition;
|
|
@@ -68,7 +67,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
68
67
|
if (open) {
|
|
69
68
|
onRangePositionChange('start');
|
|
70
69
|
if (previousRangePosition.current !== 'start' && initialView) {
|
|
71
|
-
onViewChange
|
|
70
|
+
onViewChange?.(initialView);
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
};
|
|
@@ -76,24 +75,23 @@ const useMultiInputFieldSlotProps = ({
|
|
|
76
75
|
if (open) {
|
|
77
76
|
onRangePositionChange('end');
|
|
78
77
|
if (previousRangePosition.current !== 'end' && initialView) {
|
|
79
|
-
onViewChange
|
|
78
|
+
onViewChange?.(initialView);
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
};
|
|
83
82
|
const slots = _extends({
|
|
84
|
-
textField: pickerSlots
|
|
85
|
-
root: pickerSlots
|
|
86
|
-
separator: pickerSlots
|
|
83
|
+
textField: pickerSlots?.textField,
|
|
84
|
+
root: pickerSlots?.fieldRoot,
|
|
85
|
+
separator: pickerSlots?.fieldSeparator
|
|
87
86
|
}, fieldProps.slots);
|
|
88
87
|
const slotProps = _extends({}, fieldProps.slotProps, {
|
|
89
88
|
textField: ownerState => {
|
|
90
|
-
const resolvedComponentProps = resolveComponentProps(pickerSlotProps
|
|
89
|
+
const resolvedComponentProps = resolveComponentProps(pickerSlotProps?.textField, ownerState);
|
|
91
90
|
let textFieldProps;
|
|
92
91
|
let InputProps;
|
|
93
92
|
if (ownerState.position === 'start') {
|
|
94
|
-
var _inLocaleText$start;
|
|
95
93
|
textFieldProps = _extends({
|
|
96
|
-
label:
|
|
94
|
+
label: inLocaleText?.start ?? localeText.start,
|
|
97
95
|
onKeyDown: onSpaceOrEnter(openRangeStartSelection),
|
|
98
96
|
onFocus: handleFocusStart,
|
|
99
97
|
focused: open ? rangePosition === 'start' : undefined
|
|
@@ -103,14 +101,13 @@ const useMultiInputFieldSlotProps = ({
|
|
|
103
101
|
readOnly: true
|
|
104
102
|
});
|
|
105
103
|
if (anchorRef) {
|
|
106
|
-
InputProps = _extends({}, resolvedComponentProps
|
|
104
|
+
InputProps = _extends({}, resolvedComponentProps?.InputProps, {
|
|
107
105
|
ref: anchorRef
|
|
108
106
|
});
|
|
109
107
|
}
|
|
110
108
|
} else {
|
|
111
|
-
var _inLocaleText$end;
|
|
112
109
|
textFieldProps = _extends({
|
|
113
|
-
label:
|
|
110
|
+
label: inLocaleText?.end ?? localeText.end,
|
|
114
111
|
onKeyDown: onSpaceOrEnter(openRangeEndSelection),
|
|
115
112
|
onFocus: handleFocusEnd,
|
|
116
113
|
focused: open ? rangePosition === 'end' : undefined
|
|
@@ -119,11 +116,11 @@ const useMultiInputFieldSlotProps = ({
|
|
|
119
116
|
}, wrapperVariant === 'mobile' && {
|
|
120
117
|
readOnly: true
|
|
121
118
|
});
|
|
122
|
-
InputProps = resolvedComponentProps
|
|
119
|
+
InputProps = resolvedComponentProps?.InputProps;
|
|
123
120
|
}
|
|
124
121
|
return _extends({}, labelId != null && {
|
|
125
122
|
id: `${labelId}-${ownerState.position}`
|
|
126
|
-
}, textFieldProps, resolveComponentProps(pickerSlotProps
|
|
123
|
+
}, textFieldProps, resolveComponentProps(pickerSlotProps?.textField, ownerState), {
|
|
127
124
|
InputProps
|
|
128
125
|
});
|
|
129
126
|
},
|
|
@@ -131,9 +128,9 @@ const useMultiInputFieldSlotProps = ({
|
|
|
131
128
|
const rootProps = {
|
|
132
129
|
onBlur
|
|
133
130
|
};
|
|
134
|
-
return _extends({}, rootProps, resolveComponentProps(pickerSlotProps
|
|
131
|
+
return _extends({}, rootProps, resolveComponentProps(pickerSlotProps?.fieldRoot, ownerState));
|
|
135
132
|
},
|
|
136
|
-
separator: pickerSlotProps
|
|
133
|
+
separator: pickerSlotProps?.fieldSeparator
|
|
137
134
|
});
|
|
138
135
|
|
|
139
136
|
/* TODO: remove this when a clearable behavior for multiple input range fields is implemented */
|
|
@@ -177,28 +174,25 @@ const useSingleInputFieldSlotProps = ({
|
|
|
177
174
|
|
|
178
175
|
// bring back focus to the field with the current view section selected
|
|
179
176
|
if (currentView) {
|
|
180
|
-
var _startFieldRef$curren;
|
|
181
177
|
const sections = startFieldRef.current.getSections().map(section => section.type);
|
|
182
178
|
const newSelectedSection = rangePosition === 'start' ? sections.indexOf(currentView) : sections.lastIndexOf(currentView);
|
|
183
|
-
|
|
179
|
+
startFieldRef.current?.focusField(newSelectedSection);
|
|
184
180
|
}
|
|
185
181
|
}, [rangePosition, open, currentView, startFieldRef]);
|
|
186
182
|
const updateRangePosition = () => {
|
|
187
|
-
|
|
188
|
-
if (!((_startFieldRef$curren2 = startFieldRef.current) != null && _startFieldRef$curren2.isFieldFocused())) {
|
|
183
|
+
if (!startFieldRef.current?.isFieldFocused()) {
|
|
189
184
|
return;
|
|
190
185
|
}
|
|
191
186
|
const sections = startFieldRef.current.getSections();
|
|
192
|
-
const activeSectionIndex =
|
|
187
|
+
const activeSectionIndex = startFieldRef.current?.getActiveSectionIndex();
|
|
193
188
|
const domRangePosition = activeSectionIndex == null || activeSectionIndex < sections.length / 2 ? 'start' : 'end';
|
|
194
189
|
if (domRangePosition != null && domRangePosition !== rangePosition) {
|
|
195
190
|
onRangePositionChange(domRangePosition);
|
|
196
191
|
}
|
|
197
192
|
};
|
|
198
193
|
const handleSelectedSectionsChange = useEventCallback(selectedSection => {
|
|
199
|
-
var _fieldProps$onSelecte;
|
|
200
194
|
setTimeout(updateRangePosition);
|
|
201
|
-
|
|
195
|
+
fieldProps.onSelectedSectionsChange?.(selectedSection);
|
|
202
196
|
});
|
|
203
197
|
const openPicker = event => {
|
|
204
198
|
event.stopPropagation();
|
|
@@ -207,14 +201,14 @@ const useSingleInputFieldSlotProps = ({
|
|
|
207
201
|
}
|
|
208
202
|
};
|
|
209
203
|
const slots = _extends({}, fieldProps.slots, {
|
|
210
|
-
textField: pickerSlots
|
|
211
|
-
clearButton: pickerSlots
|
|
212
|
-
clearIcon: pickerSlots
|
|
204
|
+
textField: pickerSlots?.textField,
|
|
205
|
+
clearButton: pickerSlots?.clearButton,
|
|
206
|
+
clearIcon: pickerSlots?.clearIcon
|
|
213
207
|
});
|
|
214
208
|
const slotProps = _extends({}, fieldProps.slotProps, {
|
|
215
|
-
textField: pickerSlotProps
|
|
216
|
-
clearButton: pickerSlots
|
|
217
|
-
clearIcon: pickerSlots
|
|
209
|
+
textField: pickerSlotProps?.textField,
|
|
210
|
+
clearButton: pickerSlots?.clearButton,
|
|
211
|
+
clearIcon: pickerSlots?.clearIcon
|
|
218
212
|
});
|
|
219
213
|
const enrichedFieldProps = _extends({}, fieldProps, {
|
|
220
214
|
slots,
|
|
@@ -226,7 +220,7 @@ const useSingleInputFieldSlotProps = ({
|
|
|
226
220
|
onBlur,
|
|
227
221
|
InputProps: _extends({
|
|
228
222
|
ref: anchorRef
|
|
229
|
-
}, fieldProps
|
|
223
|
+
}, fieldProps?.InputProps),
|
|
230
224
|
focused: open
|
|
231
225
|
}, labelId != null && {
|
|
232
226
|
id: labelId
|
|
@@ -15,7 +15,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
15
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const releaseInfo = getReleaseInfo();
|
|
17
17
|
export const useMobileRangePicker = _ref => {
|
|
18
|
-
var _fieldType, _innerSlotProps$toolb, _innerSlotProps$toolb2, _slots$layout;
|
|
19
18
|
let {
|
|
20
19
|
props
|
|
21
20
|
} = _ref,
|
|
@@ -42,7 +41,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
42
41
|
} = props;
|
|
43
42
|
const startFieldRef = React.useRef(null);
|
|
44
43
|
const endFieldRef = React.useRef(null);
|
|
45
|
-
const fieldType =
|
|
44
|
+
const fieldType = slots.field.fieldType ?? 'multi-input';
|
|
46
45
|
const {
|
|
47
46
|
rangePosition,
|
|
48
47
|
onRangePositionChange
|
|
@@ -68,9 +67,9 @@ export const useMobileRangePicker = _ref => {
|
|
|
68
67
|
const Field = slots.field;
|
|
69
68
|
const fieldProps = useSlotProps({
|
|
70
69
|
elementType: Field,
|
|
71
|
-
externalSlotProps: innerSlotProps
|
|
70
|
+
externalSlotProps: innerSlotProps?.field,
|
|
72
71
|
additionalProps: _extends({}, pickerFieldProps, {
|
|
73
|
-
readOnly: readOnly
|
|
72
|
+
readOnly: readOnly ?? true,
|
|
74
73
|
disabled,
|
|
75
74
|
className,
|
|
76
75
|
sx,
|
|
@@ -86,7 +85,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
86
85
|
} : {}),
|
|
87
86
|
ownerState: props
|
|
88
87
|
});
|
|
89
|
-
const isToolbarHidden =
|
|
88
|
+
const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
|
|
90
89
|
const enrichedFieldProps = useEnrichedRangePickerFieldProps({
|
|
91
90
|
wrapperVariant: 'mobile',
|
|
92
91
|
fieldType,
|
|
@@ -106,17 +105,17 @@ export const useMobileRangePicker = _ref => {
|
|
|
106
105
|
endFieldRef
|
|
107
106
|
});
|
|
108
107
|
const slotPropsForLayout = _extends({}, innerSlotProps, {
|
|
109
|
-
tabs: _extends({}, innerSlotProps
|
|
108
|
+
tabs: _extends({}, innerSlotProps?.tabs, {
|
|
110
109
|
rangePosition,
|
|
111
110
|
onRangePositionChange
|
|
112
111
|
}),
|
|
113
|
-
toolbar: _extends({}, innerSlotProps
|
|
112
|
+
toolbar: _extends({}, innerSlotProps?.toolbar, {
|
|
114
113
|
titleId: labelId,
|
|
115
114
|
rangePosition,
|
|
116
115
|
onRangePositionChange
|
|
117
116
|
})
|
|
118
117
|
});
|
|
119
|
-
const Layout =
|
|
118
|
+
const Layout = slots?.layout ?? PickersLayout;
|
|
120
119
|
const finalLocaleText = _extends({}, contextLocaleText, localeText);
|
|
121
120
|
let labelledById = pickerParams.valueType === 'date-time' ? `${labelId}-start-toolbar ${labelId}-end-toolbar` : labelId;
|
|
122
121
|
if (isToolbarHidden) {
|
|
@@ -136,7 +135,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
136
135
|
const slotProps = _extends({}, innerSlotProps, {
|
|
137
136
|
mobilePaper: _extends({
|
|
138
137
|
'aria-labelledby': labelledById
|
|
139
|
-
}, innerSlotProps
|
|
138
|
+
}, innerSlotProps?.mobilePaper)
|
|
140
139
|
});
|
|
141
140
|
const renderPicker = () => /*#__PURE__*/_jsxs(LocalizationProvider, {
|
|
142
141
|
localeText: localeText,
|
|
@@ -144,7 +143,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
144
143
|
open: open,
|
|
145
144
|
slots: slots,
|
|
146
145
|
slotProps: slotProps,
|
|
147
|
-
children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps
|
|
146
|
+
children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps?.layout, {
|
|
148
147
|
slots: slots,
|
|
149
148
|
slotProps: slotPropsForLayout,
|
|
150
149
|
children: renderCurrentView()
|
|
@@ -2,10 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import useForkRef from '@mui/utils/useForkRef';
|
|
3
3
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
4
4
|
export const useMultiInputFieldSelectedSections = params => {
|
|
5
|
-
var _params$selectedSecti;
|
|
6
5
|
const unstableEndFieldRef = React.useRef(null);
|
|
7
6
|
const handleUnstableEndFieldRef = useForkRef(params.unstableEndFieldRef, unstableEndFieldRef);
|
|
8
|
-
const [startSelectedSection, setStartSelectedSection] = React.useState(
|
|
7
|
+
const [startSelectedSection, setStartSelectedSection] = React.useState(params.selectedSections ?? null);
|
|
9
8
|
const [endSelectedSection, setEndSelectedSection] = React.useState(null);
|
|
10
9
|
const getActiveField = () => {
|
|
11
10
|
if (unstableEndFieldRef.current && unstableEndFieldRef.current.isFieldFocused()) {
|
|
@@ -16,15 +15,13 @@ export const useMultiInputFieldSelectedSections = params => {
|
|
|
16
15
|
const handleStartSelectedSectionChange = useEventCallback(newSelectedSections => {
|
|
17
16
|
setStartSelectedSection(newSelectedSections);
|
|
18
17
|
if (getActiveField() === 'start') {
|
|
19
|
-
|
|
20
|
-
(_params$onSelectedSec = params.onSelectedSectionsChange) == null || _params$onSelectedSec.call(params, newSelectedSections);
|
|
18
|
+
params.onSelectedSectionsChange?.(newSelectedSections);
|
|
21
19
|
}
|
|
22
20
|
});
|
|
23
21
|
const handleEndSelectedSectionChange = useEventCallback(newSelectedSections => {
|
|
24
22
|
setEndSelectedSection(newSelectedSections);
|
|
25
23
|
if (getActiveField() === 'end') {
|
|
26
|
-
|
|
27
|
-
(_params$onSelectedSec2 = params.onSelectedSectionsChange) == null || _params$onSelectedSec2.call(params, newSelectedSections);
|
|
24
|
+
params.onSelectedSectionsChange?.(newSelectedSections);
|
|
28
25
|
}
|
|
29
26
|
});
|
|
30
27
|
const activeField = getActiveField();
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import useControlled from '@mui/utils/useControlled';
|
|
2
2
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
3
3
|
export const useRangePosition = (props, singleInputFieldRef) => {
|
|
4
|
-
var _props$defaultRangePo;
|
|
5
4
|
const [rangePosition, setRangePosition] = useControlled({
|
|
6
5
|
name: 'useRangePosition',
|
|
7
6
|
state: 'rangePosition',
|
|
8
7
|
controlled: props.rangePosition,
|
|
9
|
-
default:
|
|
8
|
+
default: props.defaultRangePosition ?? 'start'
|
|
10
9
|
});
|
|
11
10
|
|
|
12
11
|
// When using a single input field,
|
|
13
12
|
// we want to select the 1st section of the edited date when updating the range position.
|
|
14
13
|
const syncRangePositionWithSingleInputField = newRangePosition => {
|
|
15
|
-
if (
|
|
14
|
+
if (singleInputFieldRef?.current == null) {
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
18
17
|
const sections = singleInputFieldRef.current.getSections();
|
|
@@ -20,9 +19,8 @@ export const useRangePosition = (props, singleInputFieldRef) => {
|
|
|
20
19
|
singleInputFieldRef.current.setSelectedSections(targetActiveSectionIndex);
|
|
21
20
|
};
|
|
22
21
|
const handleRangePositionChange = useEventCallback(newRangePosition => {
|
|
23
|
-
var _props$onRangePositio;
|
|
24
22
|
setRangePosition(newRangePosition);
|
|
25
|
-
|
|
23
|
+
props.onRangePositionChange?.(newRangePosition);
|
|
26
24
|
syncRangePositionWithSingleInputField(newRangePosition);
|
|
27
25
|
});
|
|
28
26
|
return {
|
|
@@ -22,7 +22,6 @@ const PickerStaticLayout = styled(PickersLayout)(({
|
|
|
22
22
|
* - StaticDateRangePicker
|
|
23
23
|
*/
|
|
24
24
|
export const useStaticRangePicker = _ref => {
|
|
25
|
-
var _slots$layout;
|
|
26
25
|
let {
|
|
27
26
|
props,
|
|
28
27
|
ref
|
|
@@ -46,7 +45,7 @@ export const useStaticRangePicker = _ref => {
|
|
|
46
45
|
renderCurrentView
|
|
47
46
|
} = usePicker(_extends({}, pickerParams, {
|
|
48
47
|
props,
|
|
49
|
-
autoFocusView: autoFocus
|
|
48
|
+
autoFocusView: autoFocus ?? false,
|
|
50
49
|
fieldRef: undefined,
|
|
51
50
|
additionalViewProps: {
|
|
52
51
|
rangePosition,
|
|
@@ -54,27 +53,24 @@ export const useStaticRangePicker = _ref => {
|
|
|
54
53
|
},
|
|
55
54
|
wrapperVariant: displayStaticWrapperAs
|
|
56
55
|
}));
|
|
57
|
-
const Layout =
|
|
56
|
+
const Layout = slots?.layout ?? PickerStaticLayout;
|
|
58
57
|
const slotPropsForLayout = _extends({}, slotProps, {
|
|
59
|
-
toolbar: _extends({}, slotProps
|
|
58
|
+
toolbar: _extends({}, slotProps?.toolbar, {
|
|
60
59
|
rangePosition,
|
|
61
60
|
onRangePositionChange
|
|
62
61
|
})
|
|
63
62
|
});
|
|
64
|
-
const renderPicker = () => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}))
|
|
76
|
-
});
|
|
77
|
-
};
|
|
63
|
+
const renderPicker = () => /*#__PURE__*/_jsx(LocalizationProvider, {
|
|
64
|
+
localeText: localeText,
|
|
65
|
+
children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps?.layout, {
|
|
66
|
+
slots: slots,
|
|
67
|
+
slotProps: slotPropsForLayout,
|
|
68
|
+
sx: [...(Array.isArray(sx) ? sx : [sx]), ...(Array.isArray(slotProps?.layout?.sx) ? slotProps.layout.sx : [slotProps?.layout?.sx])],
|
|
69
|
+
className: clsx(className, slotProps?.layout?.className),
|
|
70
|
+
ref: ref,
|
|
71
|
+
children: renderCurrentView()
|
|
72
|
+
}))
|
|
73
|
+
});
|
|
78
74
|
return {
|
|
79
75
|
renderPicker
|
|
80
76
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseDateValidationProps, MakeOptional, UseFieldInternalProps } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
3
|
-
import
|
|
3
|
+
import { DateRangeValidationError, RangeFieldSection, DateRange, RangeFieldSeparatorProps } from '../../models';
|
|
4
4
|
/**
|
|
5
5
|
* Props used to validate a day value in range pickers.
|
|
6
6
|
*/
|
|
@@ -8,7 +8,7 @@ export interface DayRangeValidationProps<TDate extends PickerValidDate> {
|
|
|
8
8
|
/**
|
|
9
9
|
* Disable specific date.
|
|
10
10
|
*
|
|
11
|
-
* Warning: This function can be called multiple times (
|
|
11
|
+
* 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.
|
|
12
12
|
*
|
|
13
13
|
* @template TDate
|
|
14
14
|
* @param {TDate} day The date to test.
|
|
@@ -17,5 +17,5 @@ export interface DayRangeValidationProps<TDate extends PickerValidDate> {
|
|
|
17
17
|
*/
|
|
18
18
|
shouldDisableDate?: (day: TDate, position: 'start' | 'end') => boolean;
|
|
19
19
|
}
|
|
20
|
-
export interface UseDateRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateRangeValidationError>, 'unstableFieldRef'>, 'format'>, DayRangeValidationProps<TDate>, BaseDateValidationProps<TDate> {
|
|
20
|
+
export interface UseDateRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, DayRangeValidationProps<TDate>, BaseDateValidationProps<TDate> {
|
|
21
21
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseDateValidationProps, TimeValidationProps, MakeOptional, UseFieldInternalProps, DateTimeValidationProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { DayRangeValidationProps } from './dateRange';
|
|
4
|
-
import { DateTimeRangeValidationError, RangeFieldSection, DateRange } from '../../models';
|
|
5
|
-
export interface UseDateTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateTimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, BaseDateValidationProps<TDate>, DateTimeValidationProps<TDate> {
|
|
4
|
+
import { DateTimeRangeValidationError, RangeFieldSection, DateRange, RangeFieldSeparatorProps } from '../../models';
|
|
5
|
+
export interface UseDateTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateTimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, BaseDateValidationProps<TDate>, DateTimeValidationProps<TDate> {
|
|
6
6
|
/**
|
|
7
7
|
* 12h/24h view for hour selection clock.
|
|
8
8
|
* @default `utils.is12HourCycleInCurrentLocale()`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseTimeValidationProps, TimeValidationProps, MakeOptional, UseFieldInternalProps } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
3
|
-
import { TimeRangeValidationError, RangeFieldSection, DateRange } from '../../models';
|
|
4
|
-
export interface UseTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, TimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, TimeValidationProps<TDate>, BaseTimeValidationProps {
|
|
3
|
+
import { TimeRangeValidationError, RangeFieldSection, DateRange, RangeFieldSeparatorProps } from '../../models';
|
|
4
|
+
export interface UseTimeRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, TimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, TimeValidationProps<TDate>, BaseTimeValidationProps {
|
|
5
5
|
/**
|
|
6
6
|
* 12h/24h view for hour selection clock.
|
|
7
7
|
* @default `utils.is12HourCycleInCurrentLocale()`
|
|
@@ -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
|
|
@@ -17,13 +17,13 @@ export const validateDateRange = ({
|
|
|
17
17
|
adapter,
|
|
18
18
|
value: start,
|
|
19
19
|
props: _extends({}, otherProps, {
|
|
20
|
-
shouldDisableDate: day => !!
|
|
20
|
+
shouldDisableDate: day => !!shouldDisableDate?.(day, 'start')
|
|
21
21
|
})
|
|
22
22
|
}), validateDate({
|
|
23
23
|
adapter,
|
|
24
24
|
value: end,
|
|
25
25
|
props: _extends({}, otherProps, {
|
|
26
|
-
shouldDisableDate: day => !!
|
|
26
|
+
shouldDisableDate: day => !!shouldDisableDate?.(day, 'end')
|
|
27
27
|
})
|
|
28
28
|
})];
|
|
29
29
|
if (dateValidations[0] || dateValidations[1]) {
|
|
@@ -17,13 +17,13 @@ export const validateDateTimeRange = ({
|
|
|
17
17
|
adapter,
|
|
18
18
|
value: start,
|
|
19
19
|
props: _extends({}, otherProps, {
|
|
20
|
-
shouldDisableDate: day => !!
|
|
20
|
+
shouldDisableDate: day => !!shouldDisableDate?.(day, 'start')
|
|
21
21
|
})
|
|
22
22
|
}), validateDateTime({
|
|
23
23
|
adapter,
|
|
24
24
|
value: end,
|
|
25
25
|
props: _extends({}, otherProps, {
|
|
26
|
-
shouldDisableDate: day => !!
|
|
26
|
+
shouldDisableDate: day => !!shouldDisableDate?.(day, 'end')
|
|
27
27
|
})
|
|
28
28
|
})];
|
|
29
29
|
if (dateTimeValidations[0] || dateTimeValidations[1]) {
|
|
@@ -3,4 +3,6 @@ import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
|
3
3
|
import type { DateRangeValidationError, DateTimeRangeValidationError, TimeRangeValidationError, RangeFieldSection, DateRange } from '../../models';
|
|
4
4
|
export type RangePickerValueManager<TValue = [any, any], TDate extends PickerValidDate = any, TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerValueManager<TValue, TDate, TError>;
|
|
5
5
|
export declare const rangeValueManager: RangePickerValueManager;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const getRangeFieldValueManager: <TDate extends PickerValidDate>({ dateSeparator, }: {
|
|
7
|
+
dateSeparator: string | undefined;
|
|
8
|
+
}) => FieldValueManager<DateRange<TDate>, TDate, RangeFieldSection>;
|