@mui/x-date-pickers-pro 6.16.1 → 6.16.3
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 +169 -0
- package/DateRangeCalendar/useDragRange.js +15 -7
- package/DateRangePicker/DateRangePicker.d.ts +10 -0
- package/DateRangePicker/DateRangePicker.js +10 -0
- package/DateRangePicker/DateRangePickerToolbar.d.ts +10 -0
- package/DateRangePicker/DateRangePickerToolbar.js +11 -0
- package/DateRangePickerDay/DateRangePickerDay.d.ts +1 -2
- package/DateRangePickerDay/DateRangePickerDay.js +1 -2
- package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +10 -0
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +10 -0
- package/MobileDateRangePicker/MobileDateRangePicker.d.ts +10 -0
- package/MobileDateRangePicker/MobileDateRangePicker.js +10 -0
- package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +10 -0
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +10 -0
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +10 -0
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +10 -0
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +10 -0
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +10 -0
- package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +10 -0
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +11 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +10 -0
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +11 -1
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +10 -0
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +11 -1
- package/StaticDateRangePicker/StaticDateRangePicker.d.ts +10 -0
- package/StaticDateRangePicker/StaticDateRangePicker.js +10 -0
- package/index.js +1 -1
- package/internals/utils/releaseInfo.js +1 -1
- package/legacy/DateRangeCalendar/useDragRange.js +15 -7
- package/legacy/DateRangePicker/DateRangePicker.js +10 -0
- package/legacy/DateRangePicker/DateRangePickerToolbar.js +11 -0
- package/legacy/DateRangePickerDay/DateRangePickerDay.js +1 -2
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +10 -0
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +10 -0
- package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +10 -0
- package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +10 -0
- package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +10 -0
- package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +11 -1
- package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +11 -1
- package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +11 -1
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +10 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/utils/releaseInfo.js +1 -1
- package/modern/DateRangeCalendar/useDragRange.js +15 -7
- package/modern/DateRangePicker/DateRangePicker.js +10 -0
- package/modern/DateRangePicker/DateRangePickerToolbar.js +11 -0
- package/modern/DateRangePickerDay/DateRangePickerDay.js +1 -2
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +10 -0
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +10 -0
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +10 -0
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +10 -0
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +10 -0
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +11 -1
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +11 -1
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +11 -1
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +10 -0
- package/modern/index.js +1 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/node/DateRangeCalendar/DateRangeCalendar.js +2 -2
- package/node/DateRangeCalendar/useDragRange.js +17 -9
- package/node/DateRangePicker/DateRangePicker.js +12 -2
- package/node/DateRangePicker/DateRangePickerToolbar.js +13 -2
- package/node/DateRangePicker/shared.js +2 -2
- package/node/DateRangePickerDay/DateRangePickerDay.js +3 -4
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +12 -2
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +12 -2
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +12 -2
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +12 -2
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +12 -2
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +13 -3
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +13 -3
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +13 -3
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +12 -2
- package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +2 -2
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +2 -2
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +2 -2
- package/node/internals/hooks/useRangePosition.js +2 -2
- package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +2 -2
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY5Nzc3NDQwMDAwMA==";
|
|
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
|
|
@@ -97,12 +97,6 @@ var useDragRangeEvents = function useDragRangeEvents(_ref) {
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
setRangeDragDay(newDate);
|
|
100
|
-
setIsDragging(true);
|
|
101
|
-
var button = event.target;
|
|
102
|
-
var buttonDataset = button.dataset;
|
|
103
|
-
if (buttonDataset.position) {
|
|
104
|
-
onDatePositionChange(buttonDataset.position);
|
|
105
|
-
}
|
|
106
100
|
});
|
|
107
101
|
var handleDragEnter = useEventCallback(function (event) {
|
|
108
102
|
if (!isDragging) {
|
|
@@ -115,13 +109,27 @@ var useDragRangeEvents = function useDragRangeEvents(_ref) {
|
|
|
115
109
|
});
|
|
116
110
|
var handleTouchMove = useEventCallback(function (event) {
|
|
117
111
|
var target = resolveElementFromTouch(event);
|
|
118
|
-
if (!
|
|
112
|
+
if (!target) {
|
|
119
113
|
return;
|
|
120
114
|
}
|
|
121
115
|
var newDate = resolveDateFromTarget(target, utils, timezone);
|
|
122
116
|
if (newDate) {
|
|
123
117
|
setRangeDragDay(newDate);
|
|
124
118
|
}
|
|
119
|
+
|
|
120
|
+
// this prevents initiating drag when user starts touchmove outside and then moves over a draggable element
|
|
121
|
+
var targetsAreIdentical = target === event.changedTouches[0].target;
|
|
122
|
+
if (!targetsAreIdentical || !isElementDraggable(newDate)) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// on mobile we should only initialize dragging state after move is detected
|
|
127
|
+
setIsDragging(true);
|
|
128
|
+
var button = event.target;
|
|
129
|
+
var buttonDataset = button.dataset;
|
|
130
|
+
if (buttonDataset.position) {
|
|
131
|
+
onDatePositionChange(buttonDataset.position);
|
|
132
|
+
}
|
|
125
133
|
});
|
|
126
134
|
var handleDragLeave = useEventCallback(function (event) {
|
|
127
135
|
if (!isDragging) {
|
|
@@ -9,6 +9,16 @@ import { refType } from '@mui/utils';
|
|
|
9
9
|
import { DesktopDateRangePicker } from '../DesktopDateRangePicker';
|
|
10
10
|
import { MobileDateRangePicker } from '../MobileDateRangePicker';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* Demos:
|
|
14
|
+
*
|
|
15
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
16
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
17
|
+
*
|
|
18
|
+
* API:
|
|
19
|
+
*
|
|
20
|
+
* - [DateRangePicker API](https://mui.com/x/api/date-pickers/date-range-picker/)
|
|
21
|
+
*/
|
|
12
22
|
var DateRangePicker = /*#__PURE__*/React.forwardRef(function DateRangePicker(inProps, ref) {
|
|
13
23
|
var props = useThemeProps({
|
|
14
24
|
props: inProps,
|
|
@@ -36,6 +36,17 @@ var DateRangePickerToolbarContainer = styled('div', {
|
|
|
36
36
|
})({
|
|
37
37
|
display: 'flex'
|
|
38
38
|
});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Demos:
|
|
42
|
+
*
|
|
43
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
44
|
+
* - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)
|
|
45
|
+
*
|
|
46
|
+
* API:
|
|
47
|
+
*
|
|
48
|
+
* - [DateRangePickerToolbar API](https://mui.com/x/api/date-pickers/date-range-picker-toolbar/)
|
|
49
|
+
*/
|
|
39
50
|
var DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangePickerToolbar(inProps, ref) {
|
|
40
51
|
var utils = useUtils();
|
|
41
52
|
var props = useThemeProps({
|
|
@@ -356,10 +356,9 @@ process.env.NODE_ENV !== "production" ? DateRangePickerDayRaw.propTypes = {
|
|
|
356
356
|
} : void 0;
|
|
357
357
|
|
|
358
358
|
/**
|
|
359
|
-
*
|
|
360
359
|
* Demos:
|
|
361
360
|
*
|
|
362
|
-
* - [
|
|
361
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
363
362
|
*
|
|
364
363
|
* API:
|
|
365
364
|
*
|
|
@@ -10,6 +10,16 @@ import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
|
|
|
10
10
|
import { MultiInputDateRangeField } from '../MultiInputDateRangeField';
|
|
11
11
|
import { useDesktopRangePicker } from '../internals/hooks/useDesktopRangePicker';
|
|
12
12
|
import { validateDateRange } from '../internals/utils/validation/validateDateRange';
|
|
13
|
+
/**
|
|
14
|
+
* Demos:
|
|
15
|
+
*
|
|
16
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
17
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [DesktopDateRangePicker API](https://mui.com/x/api/date-pickers/desktop-date-range-picker/)
|
|
22
|
+
*/
|
|
13
23
|
var DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDateRangePicker(inProps, ref) {
|
|
14
24
|
var _defaultizedProps$cal, _defaultizedProps$slo2;
|
|
15
25
|
// Props with the default values common to all date time pickers
|
|
@@ -10,6 +10,16 @@ import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
|
|
|
10
10
|
import { MultiInputDateRangeField } from '../MultiInputDateRangeField';
|
|
11
11
|
import { useMobileRangePicker } from '../internals/hooks/useMobileRangePicker';
|
|
12
12
|
import { validateDateRange } from '../internals/utils/validation/validateDateRange';
|
|
13
|
+
/**
|
|
14
|
+
* Demos:
|
|
15
|
+
*
|
|
16
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
17
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [MobileDateRangePicker API](https://mui.com/x/api/date-pickers/mobile-date-range-picker/)
|
|
22
|
+
*/
|
|
13
23
|
var MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateRangePicker(inProps, ref) {
|
|
14
24
|
var _defaultizedProps$slo2;
|
|
15
25
|
// Props with the default values common to all date time pickers
|
|
@@ -54,6 +54,16 @@ var MultiInputDateRangeFieldSeparator = styled(function (props) {
|
|
|
54
54
|
return styles.separator;
|
|
55
55
|
}
|
|
56
56
|
})({});
|
|
57
|
+
/**
|
|
58
|
+
* Demos:
|
|
59
|
+
*
|
|
60
|
+
* - [DateRangeField](http://mui.com/x/react-date-pickers/date-range-field/)
|
|
61
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
62
|
+
*
|
|
63
|
+
* API:
|
|
64
|
+
*
|
|
65
|
+
* - [MultiInputDateRangeField API](https://mui.com/x/api/multi-input-date-range-field/)
|
|
66
|
+
*/
|
|
57
67
|
var MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInputDateRangeField(inProps, ref) {
|
|
58
68
|
var _slots$root, _slots$textField, _slots$separator, _slotProps$separator;
|
|
59
69
|
var themeProps = useThemeProps({
|
|
@@ -54,6 +54,16 @@ var MultiInputDateTimeRangeFieldSeparator = styled(function (props) {
|
|
|
54
54
|
return styles.separator;
|
|
55
55
|
}
|
|
56
56
|
})({});
|
|
57
|
+
/**
|
|
58
|
+
* Demos:
|
|
59
|
+
*
|
|
60
|
+
* - [DateTimeRangeField](http://mui.com/x/react-date-pickers/date-time-range-field/)
|
|
61
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
62
|
+
*
|
|
63
|
+
* API:
|
|
64
|
+
*
|
|
65
|
+
* - [MultiInputDateTimeRangeField API](https://mui.com/x/api/multi-input-date-time-range-field/)
|
|
66
|
+
*/
|
|
57
67
|
var MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInputDateTimeRangeField(inProps, ref) {
|
|
58
68
|
var _slots$root, _slots$textField, _slots$separator;
|
|
59
69
|
var themeProps = useThemeProps({
|
|
@@ -54,6 +54,16 @@ var MultiInputTimeRangeFieldSeparator = styled(function (props) {
|
|
|
54
54
|
return styles.separator;
|
|
55
55
|
}
|
|
56
56
|
})({});
|
|
57
|
+
/**
|
|
58
|
+
* Demos:
|
|
59
|
+
*
|
|
60
|
+
* - [TimeRangeField](http://mui.com/x/react-date-pickers/time-range-field/)
|
|
61
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
62
|
+
*
|
|
63
|
+
* API:
|
|
64
|
+
*
|
|
65
|
+
* - [MultiInputTimeRangeField API](https://mui.com/x/api/multi-input-time-range-field/)
|
|
66
|
+
*/
|
|
57
67
|
var MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInputTimeRangeField(inProps, ref) {
|
|
58
68
|
var _slots$root, _slots$textField, _slots$separator;
|
|
59
69
|
var themeProps = useThemeProps({
|
|
@@ -12,6 +12,16 @@ import { useClearableField } from '@mui/x-date-pickers/hooks';
|
|
|
12
12
|
import { refType } from '@mui/utils';
|
|
13
13
|
import { useSingleInputDateRangeField } from './useSingleInputDateRangeField';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [DateRangeField](http://mui.com/x/react-date-pickers/date-range-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [SingleInputDateRangeField API](https://mui.com/x/api/single-input-date-range-field/)
|
|
24
|
+
*/
|
|
15
25
|
var SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleInputDateRangeField(inProps, ref) {
|
|
16
26
|
var _ref, _slots$textField, _slotProps$textField;
|
|
17
27
|
var themeProps = useThemeProps({
|
|
@@ -97,7 +107,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
97
107
|
/**
|
|
98
108
|
* The color of the component.
|
|
99
109
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
100
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
110
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
101
111
|
* @default 'primary'
|
|
102
112
|
*/
|
|
103
113
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
@@ -12,6 +12,16 @@ import { useClearableField } from '@mui/x-date-pickers/hooks';
|
|
|
12
12
|
import { refType } from '@mui/utils';
|
|
13
13
|
import { useSingleInputDateTimeRangeField } from './useSingleInputDateTimeRangeField';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [DateTimeRangeField](http://mui.com/x/react-date-pickers/date-time-range-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [SingleInputDateTimeRangeField API](https://mui.com/x/api/single-input-date-time-range-field/)
|
|
24
|
+
*/
|
|
15
25
|
var SingleInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleInputDateTimeRangeField(inProps, ref) {
|
|
16
26
|
var _ref, _slots$textField, _slotProps$textField;
|
|
17
27
|
var themeProps = useThemeProps({
|
|
@@ -102,7 +112,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
102
112
|
/**
|
|
103
113
|
* The color of the component.
|
|
104
114
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
105
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
115
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
106
116
|
* @default 'primary'
|
|
107
117
|
*/
|
|
108
118
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
@@ -12,6 +12,16 @@ import { useSlotProps } from '@mui/base/utils';
|
|
|
12
12
|
import { refType } from '@mui/utils';
|
|
13
13
|
import { useSingleInputTimeRangeField } from './useSingleInputTimeRangeField';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [TimeRangeField](http://mui.com/x/react-date-pickers/time-range-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [SingleInputTimeRangeField API](https://mui.com/x/api/single-input-time-range-field/)
|
|
24
|
+
*/
|
|
15
25
|
var SingleInputTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleInputTimeRangeField(inProps, ref) {
|
|
16
26
|
var _ref, _slots$textField, _slotProps$textField;
|
|
17
27
|
var themeProps = useThemeProps({
|
|
@@ -102,7 +112,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
102
112
|
/**
|
|
103
113
|
* The color of the component.
|
|
104
114
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
105
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
115
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
106
116
|
* @default 'primary'
|
|
107
117
|
*/
|
|
108
118
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
@@ -6,6 +6,16 @@ import { useDateRangePickerDefaultizedProps } from '../DateRangePicker/shared';
|
|
|
6
6
|
import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
|
|
7
7
|
import { rangeValueManager } from '../internals/utils/valueManagers';
|
|
8
8
|
import { validateDateRange } from '../internals/utils/validation/validateDateRange';
|
|
9
|
+
/**
|
|
10
|
+
* Demos:
|
|
11
|
+
*
|
|
12
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
13
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
14
|
+
*
|
|
15
|
+
* API:
|
|
16
|
+
*
|
|
17
|
+
* - [StaticDateRangePicker API](https://mui.com/x/api/date-pickers/static-date-range-picker/)
|
|
18
|
+
*/
|
|
9
19
|
var StaticDateRangePicker = /*#__PURE__*/React.forwardRef(function StaticDateRangePicker(inProps, ref) {
|
|
10
20
|
var _defaultizedProps$dis, _defaultizedProps$cal, _defaultizedProps$slo;
|
|
11
21
|
var defaultizedProps = useDateRangePickerDefaultizedProps(inProps, 'MuiStaticDateRangePicker');
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY5Nzc3NDQwMDAwMA==";
|
|
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
|
|
@@ -96,12 +96,6 @@ const useDragRangeEvents = ({
|
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
setRangeDragDay(newDate);
|
|
99
|
-
setIsDragging(true);
|
|
100
|
-
const button = event.target;
|
|
101
|
-
const buttonDataset = button.dataset;
|
|
102
|
-
if (buttonDataset.position) {
|
|
103
|
-
onDatePositionChange(buttonDataset.position);
|
|
104
|
-
}
|
|
105
99
|
});
|
|
106
100
|
const handleDragEnter = useEventCallback(event => {
|
|
107
101
|
if (!isDragging) {
|
|
@@ -114,13 +108,27 @@ const useDragRangeEvents = ({
|
|
|
114
108
|
});
|
|
115
109
|
const handleTouchMove = useEventCallback(event => {
|
|
116
110
|
const target = resolveElementFromTouch(event);
|
|
117
|
-
if (!
|
|
111
|
+
if (!target) {
|
|
118
112
|
return;
|
|
119
113
|
}
|
|
120
114
|
const newDate = resolveDateFromTarget(target, utils, timezone);
|
|
121
115
|
if (newDate) {
|
|
122
116
|
setRangeDragDay(newDate);
|
|
123
117
|
}
|
|
118
|
+
|
|
119
|
+
// this prevents initiating drag when user starts touchmove outside and then moves over a draggable element
|
|
120
|
+
const targetsAreIdentical = target === event.changedTouches[0].target;
|
|
121
|
+
if (!targetsAreIdentical || !isElementDraggable(newDate)) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// on mobile we should only initialize dragging state after move is detected
|
|
126
|
+
setIsDragging(true);
|
|
127
|
+
const button = event.target;
|
|
128
|
+
const buttonDataset = button.dataset;
|
|
129
|
+
if (buttonDataset.position) {
|
|
130
|
+
onDatePositionChange(buttonDataset.position);
|
|
131
|
+
}
|
|
124
132
|
});
|
|
125
133
|
const handleDragLeave = useEventCallback(event => {
|
|
126
134
|
if (!isDragging) {
|
|
@@ -9,6 +9,16 @@ import { refType } from '@mui/utils';
|
|
|
9
9
|
import { DesktopDateRangePicker } from '../DesktopDateRangePicker';
|
|
10
10
|
import { MobileDateRangePicker } from '../MobileDateRangePicker';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* Demos:
|
|
14
|
+
*
|
|
15
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
16
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
17
|
+
*
|
|
18
|
+
* API:
|
|
19
|
+
*
|
|
20
|
+
* - [DateRangePicker API](https://mui.com/x/api/date-pickers/date-range-picker/)
|
|
21
|
+
*/
|
|
12
22
|
const DateRangePicker = /*#__PURE__*/React.forwardRef(function DateRangePicker(inProps, ref) {
|
|
13
23
|
const props = useThemeProps({
|
|
14
24
|
props: inProps,
|
|
@@ -33,6 +33,17 @@ const DateRangePickerToolbarContainer = styled('div', {
|
|
|
33
33
|
})({
|
|
34
34
|
display: 'flex'
|
|
35
35
|
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Demos:
|
|
39
|
+
*
|
|
40
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
41
|
+
* - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)
|
|
42
|
+
*
|
|
43
|
+
* API:
|
|
44
|
+
*
|
|
45
|
+
* - [DateRangePickerToolbar API](https://mui.com/x/api/date-pickers/date-range-picker-toolbar/)
|
|
46
|
+
*/
|
|
36
47
|
const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangePickerToolbar(inProps, ref) {
|
|
37
48
|
const utils = useUtils();
|
|
38
49
|
const props = useThemeProps({
|
|
@@ -377,10 +377,9 @@ process.env.NODE_ENV !== "production" ? DateRangePickerDayRaw.propTypes = {
|
|
|
377
377
|
} : void 0;
|
|
378
378
|
|
|
379
379
|
/**
|
|
380
|
-
*
|
|
381
380
|
* Demos:
|
|
382
381
|
*
|
|
383
|
-
* - [
|
|
382
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
384
383
|
*
|
|
385
384
|
* API:
|
|
386
385
|
*
|
|
@@ -10,6 +10,16 @@ import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
|
|
|
10
10
|
import { MultiInputDateRangeField } from '../MultiInputDateRangeField';
|
|
11
11
|
import { useDesktopRangePicker } from '../internals/hooks/useDesktopRangePicker';
|
|
12
12
|
import { validateDateRange } from '../internals/utils/validation/validateDateRange';
|
|
13
|
+
/**
|
|
14
|
+
* Demos:
|
|
15
|
+
*
|
|
16
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
17
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [DesktopDateRangePicker API](https://mui.com/x/api/date-pickers/desktop-date-range-picker/)
|
|
22
|
+
*/
|
|
13
23
|
const DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDateRangePicker(inProps, ref) {
|
|
14
24
|
// Props with the default values common to all date time pickers
|
|
15
25
|
const defaultizedProps = useDateRangePickerDefaultizedProps(inProps, 'MuiDesktopDateRangePicker');
|
|
@@ -10,6 +10,16 @@ import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
|
|
|
10
10
|
import { MultiInputDateRangeField } from '../MultiInputDateRangeField';
|
|
11
11
|
import { useMobileRangePicker } from '../internals/hooks/useMobileRangePicker';
|
|
12
12
|
import { validateDateRange } from '../internals/utils/validation/validateDateRange';
|
|
13
|
+
/**
|
|
14
|
+
* Demos:
|
|
15
|
+
*
|
|
16
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
17
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [MobileDateRangePicker API](https://mui.com/x/api/date-pickers/mobile-date-range-picker/)
|
|
22
|
+
*/
|
|
13
23
|
const MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateRangePicker(inProps, ref) {
|
|
14
24
|
// Props with the default values common to all date time pickers
|
|
15
25
|
const defaultizedProps = useDateRangePickerDefaultizedProps(inProps, 'MuiMobileDateRangePicker');
|
|
@@ -45,6 +45,16 @@ const MultiInputDateRangeFieldSeparator = styled(props => /*#__PURE__*/_jsx(Typo
|
|
|
45
45
|
slot: 'Separator',
|
|
46
46
|
overridesResolver: (props, styles) => styles.separator
|
|
47
47
|
})({});
|
|
48
|
+
/**
|
|
49
|
+
* Demos:
|
|
50
|
+
*
|
|
51
|
+
* - [DateRangeField](http://mui.com/x/react-date-pickers/date-range-field/)
|
|
52
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
53
|
+
*
|
|
54
|
+
* API:
|
|
55
|
+
*
|
|
56
|
+
* - [MultiInputDateRangeField API](https://mui.com/x/api/multi-input-date-range-field/)
|
|
57
|
+
*/
|
|
48
58
|
const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInputDateRangeField(inProps, ref) {
|
|
49
59
|
const themeProps = useThemeProps({
|
|
50
60
|
props: inProps,
|
|
@@ -45,6 +45,16 @@ const MultiInputDateTimeRangeFieldSeparator = styled(props => /*#__PURE__*/_jsx(
|
|
|
45
45
|
slot: 'Separator',
|
|
46
46
|
overridesResolver: (props, styles) => styles.separator
|
|
47
47
|
})({});
|
|
48
|
+
/**
|
|
49
|
+
* Demos:
|
|
50
|
+
*
|
|
51
|
+
* - [DateTimeRangeField](http://mui.com/x/react-date-pickers/date-time-range-field/)
|
|
52
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
53
|
+
*
|
|
54
|
+
* API:
|
|
55
|
+
*
|
|
56
|
+
* - [MultiInputDateTimeRangeField API](https://mui.com/x/api/multi-input-date-time-range-field/)
|
|
57
|
+
*/
|
|
48
58
|
const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInputDateTimeRangeField(inProps, ref) {
|
|
49
59
|
const themeProps = useThemeProps({
|
|
50
60
|
props: inProps,
|
|
@@ -45,6 +45,16 @@ const MultiInputTimeRangeFieldSeparator = styled(props => /*#__PURE__*/_jsx(Typo
|
|
|
45
45
|
slot: 'Separator',
|
|
46
46
|
overridesResolver: (props, styles) => styles.separator
|
|
47
47
|
})({});
|
|
48
|
+
/**
|
|
49
|
+
* Demos:
|
|
50
|
+
*
|
|
51
|
+
* - [TimeRangeField](http://mui.com/x/react-date-pickers/time-range-field/)
|
|
52
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
53
|
+
*
|
|
54
|
+
* API:
|
|
55
|
+
*
|
|
56
|
+
* - [MultiInputTimeRangeField API](https://mui.com/x/api/multi-input-time-range-field/)
|
|
57
|
+
*/
|
|
48
58
|
const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInputTimeRangeField(inProps, ref) {
|
|
49
59
|
const themeProps = useThemeProps({
|
|
50
60
|
props: inProps,
|
|
@@ -12,6 +12,16 @@ import { useClearableField } from '@mui/x-date-pickers/hooks';
|
|
|
12
12
|
import { refType } from '@mui/utils';
|
|
13
13
|
import { useSingleInputDateRangeField } from './useSingleInputDateRangeField';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [DateRangeField](http://mui.com/x/react-date-pickers/date-range-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [SingleInputDateRangeField API](https://mui.com/x/api/single-input-date-range-field/)
|
|
24
|
+
*/
|
|
15
25
|
const SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleInputDateRangeField(inProps, ref) {
|
|
16
26
|
const themeProps = useThemeProps({
|
|
17
27
|
props: inProps,
|
|
@@ -103,7 +113,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
103
113
|
/**
|
|
104
114
|
* The color of the component.
|
|
105
115
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
106
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
116
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
107
117
|
* @default 'primary'
|
|
108
118
|
*/
|
|
109
119
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
@@ -12,6 +12,16 @@ import { useClearableField } from '@mui/x-date-pickers/hooks';
|
|
|
12
12
|
import { refType } from '@mui/utils';
|
|
13
13
|
import { useSingleInputDateTimeRangeField } from './useSingleInputDateTimeRangeField';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [DateTimeRangeField](http://mui.com/x/react-date-pickers/date-time-range-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [SingleInputDateTimeRangeField API](https://mui.com/x/api/single-input-date-time-range-field/)
|
|
24
|
+
*/
|
|
15
25
|
const SingleInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleInputDateTimeRangeField(inProps, ref) {
|
|
16
26
|
const themeProps = useThemeProps({
|
|
17
27
|
props: inProps,
|
|
@@ -108,7 +118,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
108
118
|
/**
|
|
109
119
|
* The color of the component.
|
|
110
120
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
111
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
121
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
112
122
|
* @default 'primary'
|
|
113
123
|
*/
|
|
114
124
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
@@ -12,6 +12,16 @@ import { useSlotProps } from '@mui/base/utils';
|
|
|
12
12
|
import { refType } from '@mui/utils';
|
|
13
13
|
import { useSingleInputTimeRangeField } from './useSingleInputTimeRangeField';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [TimeRangeField](http://mui.com/x/react-date-pickers/time-range-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [SingleInputTimeRangeField API](https://mui.com/x/api/single-input-time-range-field/)
|
|
24
|
+
*/
|
|
15
25
|
const SingleInputTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleInputTimeRangeField(inProps, ref) {
|
|
16
26
|
const themeProps = useThemeProps({
|
|
17
27
|
props: inProps,
|
|
@@ -108,7 +118,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
108
118
|
/**
|
|
109
119
|
* The color of the component.
|
|
110
120
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
111
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
121
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
112
122
|
* @default 'primary'
|
|
113
123
|
*/
|
|
114
124
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
@@ -6,6 +6,16 @@ import { useDateRangePickerDefaultizedProps } from '../DateRangePicker/shared';
|
|
|
6
6
|
import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
|
|
7
7
|
import { rangeValueManager } from '../internals/utils/valueManagers';
|
|
8
8
|
import { validateDateRange } from '../internals/utils/validation/validateDateRange';
|
|
9
|
+
/**
|
|
10
|
+
* Demos:
|
|
11
|
+
*
|
|
12
|
+
* - [DateRangePicker](https://mui.com/x/react-date-pickers/date-range-picker/)
|
|
13
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
14
|
+
*
|
|
15
|
+
* API:
|
|
16
|
+
*
|
|
17
|
+
* - [StaticDateRangePicker API](https://mui.com/x/api/date-pickers/static-date-range-picker/)
|
|
18
|
+
*/
|
|
9
19
|
const StaticDateRangePicker = /*#__PURE__*/React.forwardRef(function StaticDateRangePicker(inProps, ref) {
|
|
10
20
|
const defaultizedProps = useDateRangePickerDefaultizedProps(inProps, 'MuiStaticDateRangePicker');
|
|
11
21
|
const displayStaticWrapperAs = defaultizedProps.displayStaticWrapperAs ?? 'mobile';
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY5Nzc3NDQwMDAwMA==";
|
|
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
|
|
@@ -29,8 +29,8 @@ var _useRangePosition = require("../internals/hooks/useRangePosition");
|
|
|
29
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
30
|
const _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "defaultCalendarMonth", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "components", "componentsProps", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone"],
|
|
31
31
|
_excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
|
|
32
|
-
function _getRequireWildcardCache(
|
|
33
|
-
function _interopRequireWildcard(
|
|
32
|
+
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); }
|
|
33
|
+
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; }
|
|
34
34
|
const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
|
|
35
35
|
const DateRangeCalendarRoot = (0, _styles.styled)('div', {
|
|
36
36
|
name: 'MuiDateRangeCalendar',
|