@mui/x-date-pickers-pro 6.0.0-alpha.11 → 6.0.0-alpha.13
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 +260 -0
- package/DateRangeCalendar/DateRangeCalendar.js +30 -3
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +37 -37
- package/DateRangePicker/DateRangePicker.js +0 -6
- package/DateRangePicker/DateRangePickerView.d.ts +3 -3
- package/DateRangePicker/DateRangePickerView.js +6 -3
- package/DateRangePicker/DateRangePickerViewMobile.js +1 -1
- package/DateRangePickerDay/DateRangePickerDay.js +72 -1
- package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +5 -0
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -6
- package/DesktopNextDateRangePicker/DesktopNextDateRangePicker.js +22 -9
- package/MobileDateRangePicker/MobileDateRangePicker.d.ts +5 -0
- package/MobileDateRangePicker/MobileDateRangePicker.js +0 -6
- package/MobileNextDateRangePicker/MobileNextDateRangePicker.js +22 -9
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +51 -11
- package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +4 -2
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +45 -10
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +3 -3
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +45 -10
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +2 -2
- package/NextDateRangePicker/NextDateRangePicker.js +16 -2
- package/NextDateRangePicker/shared.d.ts +9 -2
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +110 -5
- package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +3 -2
- package/StaticDateRangePicker/StaticDateRangePicker.js +0 -5
- package/StaticNextDateRangePicker/StaticNextDateRangePicker.js +20 -6
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +13 -0
- package/{internal/utils/viewRenderers.js → dateRangeViewRenderers/dateRangeViewRenderers.js} +3 -4
- package/dateRangeViewRenderers/index.d.ts +2 -0
- package/dateRangeViewRenderers/index.js +1 -0
- package/dateRangeViewRenderers/package.json +6 -0
- package/index.d.ts +2 -1
- package/index.js +5 -2
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -1
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +6 -4
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +4 -5
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -1
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -4
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +4 -5
- package/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +7 -1
- package/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +7 -1
- package/internal/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +2 -0
- package/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +7 -1
- package/internal/hooks/useRangePickerInputProps.d.ts +7 -7
- package/internal/hooks/useRangePickerInputProps.js +12 -11
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -1
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +3 -3
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +2 -2
- package/internal/models/dateRange.d.ts +11 -1
- package/internal/models/dateTimeRange.d.ts +2 -2
- package/internal/models/fields.d.ts +6 -1
- package/internal/models/range.d.ts +0 -4
- package/internal/models/timeRange.d.ts +2 -1
- package/internal/utils/date-fields-utils.d.ts +21 -5
- package/internal/utils/releaseInfo.js +1 -1
- package/internal/utils/valueManagers.d.ts +3 -2
- package/internal/utils/valueManagers.js +21 -22
- package/legacy/DateRangeCalendar/DateRangeCalendar.js +36 -3
- package/legacy/DateRangePicker/DateRangePicker.js +0 -6
- package/legacy/DateRangePicker/DateRangePickerView.js +7 -2
- package/legacy/DateRangePicker/DateRangePickerViewMobile.js +1 -1
- package/legacy/DateRangePickerDay/DateRangePickerDay.js +72 -1
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -6
- package/legacy/DesktopNextDateRangePicker/DesktopNextDateRangePicker.js +22 -9
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +0 -6
- package/legacy/MobileNextDateRangePicker/MobileNextDateRangePicker.js +22 -9
- package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +48 -8
- package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +43 -8
- package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +43 -8
- package/legacy/NextDateRangePicker/NextDateRangePicker.js +16 -2
- package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +109 -4
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +0 -5
- package/legacy/StaticNextDateRangePicker/StaticNextDateRangePicker.js +20 -6
- package/legacy/{internal/utils/viewRenderers.js → dateRangeViewRenderers/dateRangeViewRenderers.js} +3 -4
- package/legacy/dateRangeViewRenderers/index.js +1 -0
- package/legacy/index.js +5 -2
- package/legacy/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +6 -4
- package/legacy/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -4
- package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +7 -1
- package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +7 -1
- package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +7 -1
- package/legacy/internal/hooks/useRangePickerInputProps.js +12 -11
- package/legacy/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +3 -3
- package/legacy/internal/utils/releaseInfo.js +1 -1
- package/legacy/internal/utils/valueManagers.js +20 -23
- package/legacy/tests/describeRangeValidation/testTextFieldRangeValidation.js +1 -1
- package/modern/DateRangeCalendar/DateRangeCalendar.js +29 -3
- package/modern/DateRangePicker/DateRangePicker.js +0 -6
- package/modern/DateRangePicker/DateRangePickerView.js +6 -3
- package/modern/DateRangePicker/DateRangePickerViewMobile.js +1 -1
- package/modern/DateRangePickerDay/DateRangePickerDay.js +72 -1
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -6
- package/modern/DesktopNextDateRangePicker/DesktopNextDateRangePicker.js +22 -9
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +0 -6
- package/modern/MobileNextDateRangePicker/MobileNextDateRangePicker.js +22 -9
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +51 -11
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +45 -10
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +45 -10
- package/modern/NextDateRangePicker/NextDateRangePicker.js +16 -2
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +110 -5
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +0 -5
- package/modern/StaticNextDateRangePicker/StaticNextDateRangePicker.js +20 -6
- package/modern/{internal/utils/viewRenderers.js → dateRangeViewRenderers/dateRangeViewRenderers.js} +3 -4
- package/modern/dateRangeViewRenderers/index.js +1 -0
- package/modern/index.js +5 -2
- package/modern/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +6 -4
- package/modern/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -4
- package/modern/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +7 -1
- package/modern/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +7 -1
- package/modern/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +7 -1
- package/modern/internal/hooks/useRangePickerInputProps.js +11 -11
- package/modern/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +3 -3
- package/modern/internal/utils/releaseInfo.js +1 -1
- package/modern/internal/utils/valueManagers.js +21 -22
- package/modern/tests/describeRangeValidation/testTextFieldRangeValidation.js +1 -1
- package/node/DateRangeCalendar/DateRangeCalendar.js +28 -2
- package/node/DateRangePicker/DateRangePicker.js +0 -6
- package/node/DateRangePicker/DateRangePickerView.js +6 -3
- package/node/DateRangePicker/DateRangePickerViewMobile.js +1 -1
- package/node/DateRangePickerDay/DateRangePickerDay.js +72 -1
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -6
- package/node/DesktopNextDateRangePicker/DesktopNextDateRangePicker.js +22 -9
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +0 -6
- package/node/MobileNextDateRangePicker/MobileNextDateRangePicker.js +22 -9
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +51 -11
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +45 -10
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +45 -10
- package/node/NextDateRangePicker/NextDateRangePicker.js +16 -2
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +110 -5
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +0 -5
- package/node/StaticNextDateRangePicker/StaticNextDateRangePicker.js +20 -6
- package/node/{internal/utils/viewRenderers.js → dateRangeViewRenderers/dateRangeViewRenderers.js} +4 -4
- package/node/dateRangeViewRenderers/index.js +12 -0
- package/node/index.js +13 -1
- package/node/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +6 -4
- package/node/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -4
- package/node/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +7 -1
- package/node/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +7 -1
- package/node/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +7 -1
- package/node/internal/hooks/useRangePickerInputProps.js +11 -11
- package/node/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +3 -3
- package/node/internal/utils/releaseInfo.js +1 -1
- package/node/internal/utils/valueManagers.js +20 -21
- package/node/tests/describeRangeValidation/testTextFieldRangeValidation.js +1 -1
- package/package.json +4 -4
- package/tests/describeRangeValidation/testTextFieldRangeValidation.js +1 -1
- package/internal/utils/viewRenderers.d.ts +0 -7
|
@@ -13,7 +13,6 @@ var releaseInfo = getReleaseInfo();
|
|
|
13
13
|
export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
14
14
|
var props = _ref.props,
|
|
15
15
|
valueManager = _ref.valueManager,
|
|
16
|
-
viewLookup = _ref.viewLookup,
|
|
17
16
|
validator = _ref.validator;
|
|
18
17
|
useLicenseVerifier('x-date-pickers-pro', releaseInfo);
|
|
19
18
|
var components = props.components,
|
|
@@ -34,8 +33,8 @@ export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
|
34
33
|
props: props,
|
|
35
34
|
valueManager: valueManager,
|
|
36
35
|
wrapperVariant: 'mobile',
|
|
37
|
-
viewLookup: viewLookup,
|
|
38
36
|
validator: validator,
|
|
37
|
+
autoFocusView: true,
|
|
39
38
|
additionalViewProps: {
|
|
40
39
|
rangePosition: rangePosition,
|
|
41
40
|
onRangePositionChange: setRangePosition
|
|
@@ -53,6 +52,7 @@ export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
|
53
52
|
readOnly: readOnly,
|
|
54
53
|
disabled: disabled,
|
|
55
54
|
disableOpenPicker: disableOpenPicker,
|
|
55
|
+
localeText: localeText,
|
|
56
56
|
rangePosition: rangePosition,
|
|
57
57
|
onRangePositionChange: setRangePosition
|
|
58
58
|
});
|
|
@@ -61,7 +61,7 @@ export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
|
61
61
|
elementType: Field,
|
|
62
62
|
externalSlotProps: componentsProps.field,
|
|
63
63
|
additionalProps: _extends({}, pickerFieldProps, {
|
|
64
|
-
readOnly: readOnly,
|
|
64
|
+
readOnly: readOnly != null ? readOnly : true,
|
|
65
65
|
disabled: disabled,
|
|
66
66
|
className: className,
|
|
67
67
|
format: format,
|
|
@@ -79,7 +79,7 @@ export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
|
79
79
|
var inputPropsPassedByField = resolveComponentProps((_fieldProps$component = fieldProps.componentsProps) == null ? void 0 : _fieldProps$component.input, ownerState);
|
|
80
80
|
var inputPropsPassedByPicker = ownerState.position === 'start' ? fieldSlotsProps.startInput : fieldSlotsProps.endInput;
|
|
81
81
|
return _extends({}, externalInputProps, inputPropsPassedByField, inputPropsPassedByPicker, {
|
|
82
|
-
inputProps: _extends({}, externalInputProps == null ? void 0 : externalInputProps.inputProps, inputPropsPassedByField == null ? void 0 : inputPropsPassedByField.inputProps
|
|
82
|
+
inputProps: _extends({}, externalInputProps == null ? void 0 : externalInputProps.inputProps, inputPropsPassedByField == null ? void 0 : inputPropsPassedByField.inputProps)
|
|
83
83
|
});
|
|
84
84
|
},
|
|
85
85
|
root: function root(ownerState) {
|
|
@@ -18,7 +18,9 @@ export var useMultiInputDateRangeField = function useMultiInputDateRangeField(_r
|
|
|
18
18
|
var valueProp = sharedProps.value,
|
|
19
19
|
defaultValue = sharedProps.defaultValue,
|
|
20
20
|
format = sharedProps.format,
|
|
21
|
-
onChange = sharedProps.onChange
|
|
21
|
+
onChange = sharedProps.onChange,
|
|
22
|
+
disabled = sharedProps.disabled,
|
|
23
|
+
readOnly = sharedProps.readOnly;
|
|
22
24
|
var firstDefaultValue = React.useRef(defaultValue);
|
|
23
25
|
|
|
24
26
|
// TODO: Maybe export utility from `useField` instead of copy/pasting the logic
|
|
@@ -45,6 +47,8 @@ export var useMultiInputDateRangeField = function useMultiInputDateRangeField(_r
|
|
|
45
47
|
var handleStartDateChange = useEventCallback(buildChangeHandler(0));
|
|
46
48
|
var handleEndDateChange = useEventCallback(buildChangeHandler(1));
|
|
47
49
|
var startInputProps = _extends({}, inStartInputProps, {
|
|
50
|
+
disabled: disabled,
|
|
51
|
+
readOnly: readOnly,
|
|
48
52
|
format: format,
|
|
49
53
|
value: valueProp === undefined ? undefined : valueProp[0],
|
|
50
54
|
defaultValue: defaultValue === undefined ? undefined : defaultValue[0],
|
|
@@ -52,6 +56,8 @@ export var useMultiInputDateRangeField = function useMultiInputDateRangeField(_r
|
|
|
52
56
|
});
|
|
53
57
|
var endInputProps = _extends({}, inEndInputProps, {
|
|
54
58
|
format: format,
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
readOnly: readOnly,
|
|
55
61
|
value: valueProp === undefined ? undefined : valueProp[1],
|
|
56
62
|
defaultValue: defaultValue === undefined ? undefined : defaultValue[1],
|
|
57
63
|
onChange: handleEndDateChange
|
|
@@ -34,7 +34,9 @@ export var useMultiInputDateTimeRangeField = function useMultiInputDateTimeRange
|
|
|
34
34
|
var valueProp = sharedProps.value,
|
|
35
35
|
defaultValue = sharedProps.defaultValue,
|
|
36
36
|
format = sharedProps.format,
|
|
37
|
-
onChange = sharedProps.onChange
|
|
37
|
+
onChange = sharedProps.onChange,
|
|
38
|
+
disabled = sharedProps.disabled,
|
|
39
|
+
readOnly = sharedProps.readOnly;
|
|
38
40
|
var firstDefaultValue = React.useRef(defaultValue);
|
|
39
41
|
|
|
40
42
|
// TODO: Maybe export utility from `useField` instead of copy/pasting the logic
|
|
@@ -62,12 +64,16 @@ export var useMultiInputDateTimeRangeField = function useMultiInputDateTimeRange
|
|
|
62
64
|
var handleEndDateChange = useEventCallback(buildChangeHandler(1));
|
|
63
65
|
var startInputProps = _extends({}, inStartInputProps, {
|
|
64
66
|
format: format,
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
readOnly: readOnly,
|
|
65
69
|
value: valueProp === undefined ? undefined : valueProp[0],
|
|
66
70
|
defaultValue: defaultValue === undefined ? undefined : defaultValue[0],
|
|
67
71
|
onChange: handleStartDateChange
|
|
68
72
|
});
|
|
69
73
|
var endInputProps = _extends({}, inEndInputProps, {
|
|
70
74
|
format: format,
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
readOnly: readOnly,
|
|
71
77
|
value: valueProp === undefined ? undefined : valueProp[1],
|
|
72
78
|
defaultValue: defaultValue === undefined ? undefined : defaultValue[1],
|
|
73
79
|
onChange: handleEndDateChange
|
|
@@ -30,7 +30,9 @@ export var useMultiInputTimeRangeField = function useMultiInputTimeRangeField(_r
|
|
|
30
30
|
var valueProp = sharedProps.value,
|
|
31
31
|
defaultValue = sharedProps.defaultValue,
|
|
32
32
|
format = sharedProps.format,
|
|
33
|
-
onChange = sharedProps.onChange
|
|
33
|
+
onChange = sharedProps.onChange,
|
|
34
|
+
disabled = sharedProps.disabled,
|
|
35
|
+
readOnly = sharedProps.readOnly;
|
|
34
36
|
var firstDefaultValue = React.useRef(defaultValue);
|
|
35
37
|
|
|
36
38
|
// TODO: Maybe export utility from `useField` instead of copy/pasting the logic
|
|
@@ -58,12 +60,16 @@ export var useMultiInputTimeRangeField = function useMultiInputTimeRangeField(_r
|
|
|
58
60
|
var handleEndDateChange = useEventCallback(buildChangeHandler(1));
|
|
59
61
|
var startInputProps = _extends({}, inStartInputProps, {
|
|
60
62
|
format: format,
|
|
63
|
+
disabled: disabled,
|
|
64
|
+
readOnly: readOnly,
|
|
61
65
|
value: valueProp === undefined ? undefined : valueProp[0],
|
|
62
66
|
defaultValue: defaultValue === undefined ? undefined : defaultValue[0],
|
|
63
67
|
onChange: handleStartDateChange
|
|
64
68
|
});
|
|
65
69
|
var endInputProps = _extends({}, inEndInputProps, {
|
|
66
70
|
format: format,
|
|
71
|
+
disabled: disabled,
|
|
72
|
+
readOnly: readOnly,
|
|
67
73
|
value: valueProp === undefined ? undefined : valueProp[1],
|
|
68
74
|
defaultValue: defaultValue === undefined ? undefined : defaultValue[1],
|
|
69
75
|
onChange: handleEndDateChange
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { onSpaceOrEnter, useLocaleText } from '@mui/x-date-pickers/internals';
|
|
4
4
|
export var useRangePickerInputProps = function useRangePickerInputProps(_ref) {
|
|
5
|
+
var _inLocaleText$start, _inLocaleText$end;
|
|
5
6
|
var wrapperVariant = _ref.wrapperVariant,
|
|
6
7
|
open = _ref.open,
|
|
7
8
|
actions = _ref.actions,
|
|
@@ -10,7 +11,8 @@ export var useRangePickerInputProps = function useRangePickerInputProps(_ref) {
|
|
|
10
11
|
disableOpenPicker = _ref.disableOpenPicker,
|
|
11
12
|
onBlur = _ref.onBlur,
|
|
12
13
|
rangePosition = _ref.rangePosition,
|
|
13
|
-
onRangePositionChange = _ref.onRangePositionChange
|
|
14
|
+
onRangePositionChange = _ref.onRangePositionChange,
|
|
15
|
+
inLocaleText = _ref.localeText;
|
|
14
16
|
var localeText = useLocaleText();
|
|
15
17
|
var startRef = React.useRef(null);
|
|
16
18
|
var endRef = React.useRef(null);
|
|
@@ -27,14 +29,14 @@ export var useRangePickerInputProps = function useRangePickerInputProps(_ref) {
|
|
|
27
29
|
}
|
|
28
30
|
}, [rangePosition, open]);
|
|
29
31
|
var openRangeStartSelection = function openRangeStartSelection(event) {
|
|
30
|
-
event
|
|
32
|
+
event.stopPropagation();
|
|
31
33
|
onRangePositionChange('start');
|
|
32
34
|
if (!readOnly && !disableOpenPicker) {
|
|
33
35
|
actions.onOpen();
|
|
34
36
|
}
|
|
35
37
|
};
|
|
36
38
|
var openRangeEndSelection = function openRangeEndSelection(event) {
|
|
37
|
-
event
|
|
39
|
+
event.stopPropagation();
|
|
38
40
|
onRangePositionChange('end');
|
|
39
41
|
if (!readOnly && !disableOpenPicker) {
|
|
40
42
|
actions.onOpen();
|
|
@@ -50,31 +52,30 @@ export var useRangePickerInputProps = function useRangePickerInputProps(_ref) {
|
|
|
50
52
|
onRangePositionChange('end');
|
|
51
53
|
}
|
|
52
54
|
};
|
|
55
|
+
var readOnlyInput = readOnly != null ? readOnly : wrapperVariant === 'mobile';
|
|
53
56
|
var startInputProps = _extends({
|
|
54
57
|
inputRef: startRef,
|
|
55
|
-
label: localeText.start,
|
|
58
|
+
label: (_inLocaleText$start = inLocaleText == null ? void 0 : inLocaleText.start) != null ? _inLocaleText$start : localeText.start,
|
|
56
59
|
onKeyDown: onSpaceOrEnter(openRangeStartSelection),
|
|
57
60
|
onFocus: focusOnRangeStart,
|
|
58
61
|
focused: open ? rangePosition === 'start' : undefined
|
|
59
62
|
}, !readOnly && !disabled && {
|
|
60
63
|
onClick: openRangeStartSelection
|
|
61
64
|
}, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
+
readOnly: readOnlyInput,
|
|
66
|
+
disabled: disabled
|
|
65
67
|
});
|
|
66
68
|
var endInputProps = _extends({
|
|
67
69
|
inputRef: endRef,
|
|
68
|
-
label: localeText.end,
|
|
70
|
+
label: (_inLocaleText$end = inLocaleText == null ? void 0 : inLocaleText.end) != null ? _inLocaleText$end : localeText.end,
|
|
69
71
|
onKeyDown: onSpaceOrEnter(openRangeEndSelection),
|
|
70
72
|
onFocus: focusOnRangeEnd,
|
|
71
73
|
focused: open ? rangePosition === 'end' : undefined
|
|
72
74
|
}, !readOnly && !disabled && {
|
|
73
75
|
onClick: openRangeEndSelection
|
|
74
76
|
}, {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
77
|
+
readOnly: readOnlyInput,
|
|
78
|
+
disabled: disabled
|
|
78
79
|
});
|
|
79
80
|
var rootProps = {
|
|
80
81
|
onBlur: onBlur
|
|
@@ -21,22 +21,22 @@ var PickerStaticViewLayout = styled(PickersViewLayout)(function (_ref) {
|
|
|
21
21
|
export var useStaticRangePicker = function useStaticRangePicker(_ref2) {
|
|
22
22
|
var props = _ref2.props,
|
|
23
23
|
valueManager = _ref2.valueManager,
|
|
24
|
-
viewLookup = _ref2.viewLookup,
|
|
25
24
|
validator = _ref2.validator,
|
|
26
25
|
ref = _ref2.ref;
|
|
27
26
|
var localeText = props.localeText,
|
|
28
27
|
components = props.components,
|
|
29
28
|
componentsProps = props.componentsProps,
|
|
30
|
-
displayStaticWrapperAs = props.displayStaticWrapperAs
|
|
29
|
+
displayStaticWrapperAs = props.displayStaticWrapperAs,
|
|
30
|
+
autoFocus = props.autoFocus;
|
|
31
31
|
var _React$useState = React.useState('start'),
|
|
32
32
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
33
33
|
rangePosition = _React$useState2[0],
|
|
34
34
|
setRangePosition = _React$useState2[1];
|
|
35
35
|
var _usePicker = usePicker({
|
|
36
36
|
props: props,
|
|
37
|
-
viewLookup: viewLookup,
|
|
38
37
|
valueManager: valueManager,
|
|
39
38
|
validator: validator,
|
|
39
|
+
autoFocusView: autoFocus != null ? autoFocus : false,
|
|
40
40
|
additionalViewProps: {},
|
|
41
41
|
wrapperVariant: displayStaticWrapperAs
|
|
42
42
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY3MTgzMjgwMDAwMA==";
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import { replaceInvalidDateByNull, splitFormatIntoSections, addPositionPropertiesToSections,
|
|
4
|
+
import { replaceInvalidDateByNull, splitFormatIntoSections, addPositionPropertiesToSections, createDateStrForInputFromSections, getSectionOrder as _getSectionOrder } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { splitDateRangeSections, removeLastSeparator } from './date-fields-utils';
|
|
6
6
|
export var rangeValueManager = {
|
|
7
7
|
emptyValue: [null, null],
|
|
@@ -44,38 +44,29 @@ export var rangeFieldValueManager = {
|
|
|
44
44
|
startDate: null,
|
|
45
45
|
endDate: null
|
|
46
46
|
} : splitDateRangeSections(prevSections);
|
|
47
|
-
var getSections = function getSections(newDate, prevDateSections) {
|
|
47
|
+
var getSections = function getSections(newDate, prevDateSections, position) {
|
|
48
48
|
var shouldReUsePrevDateSections = !utils.isValid(newDate) && !!prevDateSections;
|
|
49
49
|
if (shouldReUsePrevDateSections) {
|
|
50
50
|
return prevDateSections;
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
var sections = splitFormatIntoSections(utils, localeText, format, newDate);
|
|
53
|
+
return sections.map(function (section, sectionIndex) {
|
|
54
|
+
if (sectionIndex === sections.length - 1 && position === 'start') {
|
|
55
|
+
return _extends({}, section, {
|
|
56
|
+
dateName: position,
|
|
57
|
+
endSeparator: "".concat(section.endSeparator, "\u2069 \u2013 \u2066")
|
|
58
|
+
});
|
|
59
|
+
}
|
|
58
60
|
return _extends({}, section, {
|
|
59
|
-
dateName:
|
|
60
|
-
separator: ' – '
|
|
61
|
+
dateName: position
|
|
61
62
|
});
|
|
62
|
-
}
|
|
63
|
-
return _extends({}, section, {
|
|
64
|
-
dateName: 'start'
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
var sectionsOfEndDate = rawSectionsOfEndDate.map(function (section) {
|
|
68
|
-
return _extends({}, section, {
|
|
69
|
-
dateName: 'end'
|
|
70
63
|
});
|
|
71
|
-
}
|
|
72
|
-
return addPositionPropertiesToSections([].concat(_toConsumableArray(
|
|
64
|
+
};
|
|
65
|
+
return addPositionPropertiesToSections([].concat(_toConsumableArray(getSections(start, prevDateRangeSections.startDate, 'start')), _toConsumableArray(getSections(end, prevDateRangeSections.endDate, 'end'))));
|
|
73
66
|
},
|
|
74
67
|
getValueStrFromSections: function getValueStrFromSections(sections) {
|
|
75
68
|
var dateRangeSections = splitDateRangeSections(sections);
|
|
76
|
-
|
|
77
|
-
var endDateStr = createDateStrFromSections(dateRangeSections.endDate, true);
|
|
78
|
-
return "".concat(startDateStr).concat(endDateStr);
|
|
69
|
+
return createDateStrForInputFromSections([].concat(_toConsumableArray(dateRangeSections.startDate), _toConsumableArray(dateRangeSections.endDate)));
|
|
79
70
|
},
|
|
80
71
|
getActiveDateSections: function getActiveDateSections(sections, activeSection) {
|
|
81
72
|
var index = activeSection.dateName === 'start' ? 0 : 1;
|
|
@@ -113,5 +104,11 @@ export var rangeFieldValueManager = {
|
|
|
113
104
|
},
|
|
114
105
|
hasError: function hasError(error) {
|
|
115
106
|
return error[0] != null || error[1] != null;
|
|
107
|
+
},
|
|
108
|
+
getSectionOrder: function getSectionOrder(utils, localeText, format, isRTL) {
|
|
109
|
+
var splitedFormat = splitFormatIntoSections(utils, localeText, format, null);
|
|
110
|
+
return _getSectionOrder([].concat(_toConsumableArray(splitedFormat.slice(0, splitedFormat.length - 1)), [_extends({}, splitedFormat[splitedFormat.length - 1], {
|
|
111
|
+
endSeparator: ' – '
|
|
112
|
+
})], _toConsumableArray(splitedFormat)), isRTL);
|
|
116
113
|
}
|
|
117
114
|
};
|
|
@@ -29,7 +29,7 @@ export var testTextFieldRangeValidation = function testTextFieldRangeValidation(
|
|
|
29
29
|
isSingleInput = _getOptions.isSingleInput,
|
|
30
30
|
withDate = _getOptions.withDate,
|
|
31
31
|
withTime = _getOptions.withTime;
|
|
32
|
-
if (!['legacy-picker', 'picker'].includes(componentFamily)) {
|
|
32
|
+
if (!['legacy-picker', 'new-picker'].includes(componentFamily)) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
describe('text field:', function () {
|
|
@@ -11,7 +11,7 @@ import { resolveComponentProps } from '@mui/base/utils';
|
|
|
11
11
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
12
12
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
13
13
|
import { Watermark } from '@mui/x-license-pro';
|
|
14
|
-
import { applyDefaultDate, DAY_MARGIN, DayCalendar, defaultReduceAnimations, PickersArrowSwitcher, PickersCalendarHeader, useCalendarState, useDefaultDates, useLocaleText, useNextMonthDisabled, usePreviousMonthDisabled, useUtils, WrapperVariantContext } from '@mui/x-date-pickers/internals';
|
|
14
|
+
import { applyDefaultDate, DAY_MARGIN, DayCalendar, defaultReduceAnimations, PickersArrowSwitcher, PickersCalendarHeader, useCalendarState, useDefaultDates, useLocaleText, useNextMonthDisabled, usePreviousMonthDisabled, useUtils, WrapperVariantContext, useNow } from '@mui/x-date-pickers/internals';
|
|
15
15
|
import { getReleaseInfo } from '../internal/utils/releaseInfo';
|
|
16
16
|
import { dateRangeCalendarClasses, getDateRangeCalendarUtilityClass } from './dateRangeCalendarClasses';
|
|
17
17
|
import { isEndOfRange, isRangeValid, isStartOfRange, isWithinRange } from '../internal/utils/date-utils';
|
|
@@ -107,6 +107,7 @@ const useUtilityClasses = ownerState => {
|
|
|
107
107
|
const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalendar(inProps, ref) {
|
|
108
108
|
const utils = useUtils();
|
|
109
109
|
const localeText = useLocaleText();
|
|
110
|
+
const now = useNow();
|
|
110
111
|
const props = useDateRangeCalendarDefaultizedProps(inProps, 'MuiDateRangeCalendar');
|
|
111
112
|
const isMobile = React.useContext(WrapperVariantContext) === 'mobile';
|
|
112
113
|
const {
|
|
@@ -347,6 +348,25 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
347
348
|
const visibleMonths = React.useMemo(() => Array.from({
|
|
348
349
|
length: calendars
|
|
349
350
|
}).map((_, index) => utils.setMonth(calendarState.currentMonth, utils.getMonth(calendarState.currentMonth) + index)), [utils, calendarState.currentMonth, calendars]);
|
|
351
|
+
const focusedMonth = React.useMemo(() => {
|
|
352
|
+
if (!autoFocus) {
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// The focus priority of the "day" view is as follows:
|
|
357
|
+
// 1. Month of the `start` date
|
|
358
|
+
// 2. Month of the `end` date
|
|
359
|
+
// 3. Month of the current date
|
|
360
|
+
// 4. First visible month
|
|
361
|
+
|
|
362
|
+
if (value[0] != null) {
|
|
363
|
+
return visibleMonths.find(month => utils.isSameMonth(month, value[0]));
|
|
364
|
+
}
|
|
365
|
+
if (value[1] != null) {
|
|
366
|
+
return visibleMonths.find(month => utils.isSameMonth(month, value[1]));
|
|
367
|
+
}
|
|
368
|
+
return visibleMonths.find(month => utils.isSameMonth(month, now)) ?? visibleMonths[0];
|
|
369
|
+
}, [utils, value, visibleMonths, autoFocus, now]);
|
|
350
370
|
return /*#__PURE__*/_jsxs(DateRangeCalendarRoot, _extends({
|
|
351
371
|
ref: ref,
|
|
352
372
|
className: clsx(className, classes.root),
|
|
@@ -359,7 +379,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
359
379
|
className: classes.monthContainer,
|
|
360
380
|
children: [calendars === 1 ? /*#__PURE__*/_jsx(PickersCalendarHeader, {
|
|
361
381
|
views: ['day'],
|
|
362
|
-
|
|
382
|
+
view: 'day',
|
|
363
383
|
currentMonth: calendarState.currentMonth,
|
|
364
384
|
onMonthChange: (newMonth, direction) => handleChangeMonth({
|
|
365
385
|
newMonth,
|
|
@@ -402,7 +422,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
402
422
|
renderLoading: renderLoading,
|
|
403
423
|
components: componentsForDayCalendar,
|
|
404
424
|
componentsProps: componentsPropsForDayCalendar,
|
|
405
|
-
autoFocus:
|
|
425
|
+
autoFocus: month === focusedMonth,
|
|
406
426
|
fixedWeekNumber: fixedWeekNumber,
|
|
407
427
|
displayWeekNumber: displayWeekNumber
|
|
408
428
|
}), index)]
|
|
@@ -414,6 +434,12 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
414
434
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
415
435
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
416
436
|
// ----------------------------------------------------------------------
|
|
437
|
+
/**
|
|
438
|
+
* If `true`, the main element is focused during the first mount.
|
|
439
|
+
* This main element is:
|
|
440
|
+
* - the element chosen by the visible view if any (i.e: the selected day on the `day` view).
|
|
441
|
+
* - the `input` element if there is a field rendered.
|
|
442
|
+
*/
|
|
417
443
|
autoFocus: PropTypes.bool,
|
|
418
444
|
/**
|
|
419
445
|
* The number of calendars to render.
|
|
@@ -55,7 +55,6 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
55
55
|
* @default /\dap/gi
|
|
56
56
|
*/
|
|
57
57
|
acceptRegex: PropTypes.instanceOf(RegExp),
|
|
58
|
-
autoFocus: PropTypes.bool,
|
|
59
58
|
/**
|
|
60
59
|
* The number of calendars that render on **desktop**.
|
|
61
60
|
* @default 2
|
|
@@ -235,11 +234,6 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
235
234
|
* Use in controlled mode (see open).
|
|
236
235
|
*/
|
|
237
236
|
onOpen: PropTypes.func,
|
|
238
|
-
/**
|
|
239
|
-
* Callback fired on view change.
|
|
240
|
-
* @param {DateView} view The new view.
|
|
241
|
-
*/
|
|
242
|
-
onViewChange: PropTypes.func,
|
|
243
237
|
/**
|
|
244
238
|
* Control the popup or dialog open state.
|
|
245
239
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["calendars", "className", "value", "DateInputProps", "defaultCalendarMonth", "disableAutoMonthSwitching", "disableFuture", "disableHighlightToday", "disablePast", "isMobileKeyboardViewOpen", "maxDate", "minDate", "onDateChange", "onMonthChange", "open", "reduceAnimations", "rangePosition", "onRangePositionChange", "shouldDisableDate", "showToolbar", "toggleMobileKeyboardView", "components", "componentsProps"];
|
|
3
|
+
const _excluded = ["calendars", "className", "value", "DateInputProps", "defaultCalendarMonth", "disableAutoMonthSwitching", "disableFuture", "disableHighlightToday", "disablePast", "isMobileKeyboardViewOpen", "maxDate", "minDate", "onDateChange", "onMonthChange", "open", "reduceAnimations", "rangePosition", "onRangePositionChange", "shouldDisableDate", "showToolbar", "toggleMobileKeyboardView", "components", "componentsProps", "onFocusedViewChange"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { Watermark } from '@mui/x-license-pro';
|
|
@@ -40,7 +40,8 @@ function DateRangePickerViewRaw(props) {
|
|
|
40
40
|
showToolbar,
|
|
41
41
|
toggleMobileKeyboardView,
|
|
42
42
|
components,
|
|
43
|
-
componentsProps
|
|
43
|
+
componentsProps,
|
|
44
|
+
onFocusedViewChange
|
|
44
45
|
} = props,
|
|
45
46
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
46
47
|
const utils = useUtils();
|
|
@@ -122,7 +123,9 @@ function DateRangePickerViewRaw(props) {
|
|
|
122
123
|
components,
|
|
123
124
|
componentsProps,
|
|
124
125
|
shouldDisableDate: wrappedShouldDisableDate
|
|
125
|
-
}, calendarState,
|
|
126
|
+
}, calendarState, {
|
|
127
|
+
onFocusedViewChange: onFocusedViewChange ? newHasFocus => onFocusedViewChange('day', newHasFocus) : undefined
|
|
128
|
+
}, other);
|
|
126
129
|
switch (wrapperVariant) {
|
|
127
130
|
case 'desktop':
|
|
128
131
|
{
|
|
@@ -65,7 +65,7 @@ export function DateRangePickerViewMobile(props) {
|
|
|
65
65
|
maxDate: maxDateWithDisabled,
|
|
66
66
|
minDate: minDateWithDisabled,
|
|
67
67
|
onMonthChange: changeMonth,
|
|
68
|
-
|
|
68
|
+
view: "day",
|
|
69
69
|
views: onlyDayView,
|
|
70
70
|
disabled: disabled
|
|
71
71
|
}, other)), /*#__PURE__*/_jsx(DayCalendar, _extends({}, other, {
|
|
@@ -196,10 +196,26 @@ process.env.NODE_ENV !== "production" ? DateRangePickerDayRaw.propTypes = {
|
|
|
196
196
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
197
197
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
198
198
|
// ----------------------------------------------------------------------
|
|
199
|
+
/**
|
|
200
|
+
* A ref for imperative actions.
|
|
201
|
+
* It currently only supports `focusVisible()` action.
|
|
202
|
+
*/
|
|
203
|
+
action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
204
|
+
current: PropTypes.shape({
|
|
205
|
+
focusVisible: PropTypes.func.isRequired
|
|
206
|
+
})
|
|
207
|
+
})]),
|
|
208
|
+
/**
|
|
209
|
+
* If `true`, the ripples are centered.
|
|
210
|
+
* They won't start at the cursor interaction position.
|
|
211
|
+
* @default false
|
|
212
|
+
*/
|
|
213
|
+
centerRipple: PropTypes.bool,
|
|
199
214
|
/**
|
|
200
215
|
* Override or extend the styles applied to the component.
|
|
201
216
|
*/
|
|
202
217
|
classes: PropTypes.object,
|
|
218
|
+
className: PropTypes.string,
|
|
203
219
|
/**
|
|
204
220
|
* The date to show.
|
|
205
221
|
*/
|
|
@@ -219,6 +235,33 @@ process.env.NODE_ENV !== "production" ? DateRangePickerDayRaw.propTypes = {
|
|
|
219
235
|
* @default false
|
|
220
236
|
*/
|
|
221
237
|
disableMargin: PropTypes.bool,
|
|
238
|
+
/**
|
|
239
|
+
* If `true`, the ripple effect is disabled.
|
|
240
|
+
*
|
|
241
|
+
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
242
|
+
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
243
|
+
* @default false
|
|
244
|
+
*/
|
|
245
|
+
disableRipple: PropTypes.bool,
|
|
246
|
+
/**
|
|
247
|
+
* If `true`, the touch ripple effect is disabled.
|
|
248
|
+
* @default false
|
|
249
|
+
*/
|
|
250
|
+
disableTouchRipple: PropTypes.bool,
|
|
251
|
+
/**
|
|
252
|
+
* If `true`, the base button will have a keyboard focus ripple.
|
|
253
|
+
* @default false
|
|
254
|
+
*/
|
|
255
|
+
focusRipple: PropTypes.bool,
|
|
256
|
+
/**
|
|
257
|
+
* This prop can help identify which element has keyboard focus.
|
|
258
|
+
* The class name will be applied when the element gains the focus through keyboard interaction.
|
|
259
|
+
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
|
260
|
+
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
|
261
|
+
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
|
262
|
+
* if needed.
|
|
263
|
+
*/
|
|
264
|
+
focusVisibleClassName: PropTypes.string,
|
|
222
265
|
isAnimating: PropTypes.bool,
|
|
223
266
|
/**
|
|
224
267
|
* Set to `true` if the `day` is the end of a highlighted date range.
|
|
@@ -249,6 +292,11 @@ process.env.NODE_ENV !== "production" ? DateRangePickerDayRaw.propTypes = {
|
|
|
249
292
|
*/
|
|
250
293
|
isVisuallySelected: PropTypes.bool,
|
|
251
294
|
onDaySelect: PropTypes.func.isRequired,
|
|
295
|
+
/**
|
|
296
|
+
* Callback fired when the component is focused with a keyboard.
|
|
297
|
+
* We trigger a `onFocus` callback too.
|
|
298
|
+
*/
|
|
299
|
+
onFocusVisible: PropTypes.func,
|
|
252
300
|
onMouseEnter: PropTypes.func,
|
|
253
301
|
/**
|
|
254
302
|
* If `true`, day is outside of month and will be hidden.
|
|
@@ -264,11 +312,34 @@ process.env.NODE_ENV !== "production" ? DateRangePickerDayRaw.propTypes = {
|
|
|
264
312
|
* @default false
|
|
265
313
|
*/
|
|
266
314
|
showDaysOutsideCurrentMonth: PropTypes.bool,
|
|
315
|
+
style: PropTypes.object,
|
|
316
|
+
/**
|
|
317
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
318
|
+
*/
|
|
319
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
320
|
+
/**
|
|
321
|
+
* @default 0
|
|
322
|
+
*/
|
|
323
|
+
tabIndex: PropTypes.number,
|
|
267
324
|
/**
|
|
268
325
|
* If `true`, renders as today date.
|
|
269
326
|
* @default false
|
|
270
327
|
*/
|
|
271
|
-
today: PropTypes.bool
|
|
328
|
+
today: PropTypes.bool,
|
|
329
|
+
/**
|
|
330
|
+
* Props applied to the `TouchRipple` element.
|
|
331
|
+
*/
|
|
332
|
+
TouchRippleProps: PropTypes.object,
|
|
333
|
+
/**
|
|
334
|
+
* A ref that points to the `TouchRipple` element.
|
|
335
|
+
*/
|
|
336
|
+
touchRippleRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
337
|
+
current: PropTypes.shape({
|
|
338
|
+
pulsate: PropTypes.func.isRequired,
|
|
339
|
+
start: PropTypes.func.isRequired,
|
|
340
|
+
stop: PropTypes.func.isRequired
|
|
341
|
+
})
|
|
342
|
+
})])
|
|
272
343
|
} : void 0;
|
|
273
344
|
|
|
274
345
|
/**
|
|
@@ -75,7 +75,6 @@ process.env.NODE_ENV !== "production" ? DesktopDateRangePicker.propTypes = {
|
|
|
75
75
|
* @default /\dap/gi
|
|
76
76
|
*/
|
|
77
77
|
acceptRegex: PropTypes.instanceOf(RegExp),
|
|
78
|
-
autoFocus: PropTypes.bool,
|
|
79
78
|
/**
|
|
80
79
|
* The number of calendars that render on **desktop**.
|
|
81
80
|
* @default 2
|
|
@@ -249,11 +248,6 @@ process.env.NODE_ENV !== "production" ? DesktopDateRangePicker.propTypes = {
|
|
|
249
248
|
* Use in controlled mode (see open).
|
|
250
249
|
*/
|
|
251
250
|
onOpen: PropTypes.func,
|
|
252
|
-
/**
|
|
253
|
-
* Callback fired on view change.
|
|
254
|
-
* @param {DateView} view The new view.
|
|
255
|
-
*/
|
|
256
|
-
onViewChange: PropTypes.func,
|
|
257
251
|
/**
|
|
258
252
|
* Control the popup or dialog open state.
|
|
259
253
|
*/
|