@mui/x-date-pickers-pro 7.0.0-alpha.8 → 7.0.0-beta.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 +508 -30
- package/DateRangeCalendar/DateRangeCalendar.js +79 -13
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +15 -14
- package/DateRangePicker/DateRangePicker.js +0 -3
- package/DateRangePicker/DateRangePickerToolbar.js +0 -3
- package/DateTimeRangePicker/DateTimeRangePicker.d.ts +7 -0
- package/DateTimeRangePicker/DateTimeRangePicker.js +414 -0
- package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +24 -0
- package/DateTimeRangePicker/DateTimeRangePicker.types.js +1 -0
- package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +32 -0
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +183 -0
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +20 -0
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +59 -0
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +15 -0
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +176 -0
- package/DateTimeRangePicker/dateTimeRangePickerTabsClasses.d.ts +13 -0
- package/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +6 -0
- package/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.d.ts +11 -0
- package/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +5 -0
- package/DateTimeRangePicker/index.d.ts +10 -0
- package/DateTimeRangePicker/index.js +5 -0
- package/DateTimeRangePicker/package.json +6 -0
- package/DateTimeRangePicker/shared.d.ts +60 -0
- package/DateTimeRangePicker/shared.js +56 -0
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
- package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +1 -1
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +7 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +491 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +25 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +1 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.d.ts +8 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +52 -0
- package/DesktopDateTimeRangePicker/index.d.ts +2 -0
- package/DesktopDateTimeRangePicker/index.js +1 -0
- package/DesktopDateTimeRangePicker/package.json +6 -0
- package/MobileDateRangePicker/MobileDateRangePicker.js +1 -8
- package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +1 -6
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +7 -0
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +490 -0
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +20 -0
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +1 -0
- package/MobileDateTimeRangePicker/index.d.ts +2 -0
- package/MobileDateTimeRangePicker/index.js +1 -0
- package/MobileDateTimeRangePicker/package.json +6 -0
- package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +2 -5
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +2 -5
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +2 -5
- package/README.md +3 -3
- package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +2 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +2 -1
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +2 -1
- package/StaticDateRangePicker/StaticDateRangePicker.js +1 -4
- package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +5 -0
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -4
- package/dateRangeViewRenderers/dateRangeViewRenderers.js +10 -2
- package/index.d.ts +3 -0
- package/index.js +4 -1
- package/internals/constants/dimensions.d.ts +3 -0
- package/internals/constants/dimensions.js +5 -0
- package/internals/hooks/models/index.d.ts +1 -0
- package/internals/hooks/models/index.js +1 -0
- package/internals/hooks/models/useRangePicker.d.ts +21 -0
- package/internals/hooks/models/useRangePicker.js +1 -0
- package/internals/hooks/useDesktopRangePicker/index.d.ts +1 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +17 -3
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +8 -14
- package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +5 -2
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +41 -11
- package/internals/hooks/useMobileRangePicker/index.d.ts +1 -1
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -0
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +8 -14
- package/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +2 -6
- package/internals/models/dateTimeRange.d.ts +3 -1
- package/internals/models/fields.d.ts +7 -2
- package/internals/utils/date-range-manager.d.ts +2 -1
- package/internals/utils/date-range-manager.js +12 -1
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/valueManagers.js +4 -4
- package/legacy/DateRangeCalendar/DateRangeCalendar.js +77 -12
- package/legacy/DateRangePicker/DateRangePicker.js +0 -3
- package/legacy/DateRangePicker/DateRangePickerToolbar.js +0 -3
- package/legacy/DateTimeRangePicker/DateTimeRangePicker.js +413 -0
- package/legacy/DateTimeRangePicker/DateTimeRangePicker.types.js +1 -0
- package/legacy/DateTimeRangePicker/DateTimeRangePickerTabs.js +191 -0
- package/legacy/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +57 -0
- package/legacy/DateTimeRangePicker/DateTimeRangePickerToolbar.js +184 -0
- package/legacy/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +6 -0
- package/legacy/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +5 -0
- package/legacy/DateTimeRangePicker/index.js +5 -0
- package/legacy/DateTimeRangePicker/shared.js +54 -0
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
- package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +491 -0
- package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +1 -0
- package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +48 -0
- package/legacy/DesktopDateTimeRangePicker/index.js +1 -0
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +1 -8
- package/legacy/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +484 -0
- package/legacy/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +1 -0
- package/legacy/MobileDateTimeRangePicker/index.js +1 -0
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +1 -4
- package/legacy/dateRangeViewRenderers/dateRangeViewRenderers.js +10 -2
- package/legacy/index.js +4 -1
- package/legacy/internals/constants/dimensions.js +5 -0
- package/legacy/internals/hooks/models/index.js +1 -0
- package/legacy/internals/hooks/models/useRangePicker.js +1 -0
- package/legacy/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +17 -3
- package/legacy/internals/hooks/useEnrichedRangePickerFieldProps.js +43 -11
- package/legacy/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -0
- package/legacy/internals/utils/date-range-manager.js +13 -1
- package/legacy/internals/utils/releaseInfo.js +1 -1
- package/legacy/internals/utils/valueManagers.js +4 -4
- package/legacy/locales/index.js +1 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/package.json +6 -0
- package/modern/DateRangeCalendar/DateRangeCalendar.js +78 -12
- package/modern/DateRangePicker/DateRangePicker.js +0 -3
- package/modern/DateRangePicker/DateRangePickerToolbar.js +0 -3
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +414 -0
- package/modern/DateTimeRangePicker/DateTimeRangePicker.types.js +1 -0
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +183 -0
- package/modern/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +58 -0
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +176 -0
- package/modern/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +6 -0
- package/modern/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +5 -0
- package/modern/DateTimeRangePicker/index.js +5 -0
- package/modern/DateTimeRangePicker/shared.js +55 -0
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +483 -0
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +1 -0
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +51 -0
- package/modern/DesktopDateTimeRangePicker/index.js +1 -0
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -8
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +486 -0
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +1 -0
- package/modern/MobileDateTimeRangePicker/index.js +1 -0
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -4
- package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +10 -2
- package/modern/index.js +4 -1
- package/modern/internals/constants/dimensions.js +5 -0
- package/modern/internals/hooks/models/index.js +1 -0
- package/modern/internals/hooks/models/useRangePicker.js +1 -0
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +16 -2
- package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +40 -9
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -0
- package/modern/internals/utils/date-range-manager.js +12 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/internals/utils/valueManagers.js +4 -4
- package/modern/locales/index.js +1 -0
- package/node/DateRangeCalendar/DateRangeCalendar.js +78 -12
- package/node/DateRangePicker/DateRangePicker.js +0 -3
- package/node/DateRangePicker/DateRangePickerToolbar.js +0 -3
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +422 -0
- package/node/DateTimeRangePicker/DateTimeRangePicker.types.js +5 -0
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +190 -0
- package/node/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +64 -0
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +183 -0
- package/node/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +14 -0
- package/node/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +12 -0
- package/node/DateTimeRangePicker/index.js +52 -0
- package/node/DateTimeRangePicker/shared.js +62 -0
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +490 -0
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +5 -0
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +59 -0
- package/node/DesktopDateTimeRangePicker/index.js +12 -0
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +1 -8
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +494 -0
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +5 -0
- package/node/MobileDateTimeRangePicker/index.js +12 -0
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -4
- package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +10 -2
- package/node/index.js +37 -1
- package/node/internals/constants/dimensions.js +16 -0
- package/node/internals/hooks/models/index.js +5 -0
- package/node/internals/hooks/models/useRangePicker.js +5 -0
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +16 -2
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +40 -9
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -0
- package/node/internals/utils/date-range-manager.js +12 -1
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/internals/utils/valueManagers.js +4 -4
- package/node/locales/index.js +16 -0
- package/package.json +9 -9
- package/themeAugmentation/components.d.ts +22 -3
- package/themeAugmentation/overrides.d.ts +7 -0
- package/themeAugmentation/props.d.ts +12 -0
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
var _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone"],
|
|
5
|
+
var _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone", "availableRangePositions", "views", "view", "openTo", "onViewChange"],
|
|
6
6
|
_excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
@@ -14,7 +14,7 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
14
14
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
15
15
|
import { Watermark } from '@mui/x-license-pro';
|
|
16
16
|
import { PickersCalendarHeader } from '@mui/x-date-pickers/PickersCalendarHeader';
|
|
17
|
-
import { applyDefaultDate,
|
|
17
|
+
import { applyDefaultDate, DayCalendar, useDefaultReduceAnimations, PickersArrowSwitcher, useCalendarState, useDefaultDates, useLocaleText, useNextMonthDisabled, usePreviousMonthDisabled, useUtils, useNow, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, buildWarning, useControlledValueWithTimezone, useViews } from '@mui/x-date-pickers/internals';
|
|
18
18
|
import { getReleaseInfo } from '../internals/utils/releaseInfo';
|
|
19
19
|
import { dateRangeCalendarClasses, getDateRangeCalendarUtilityClass } from './dateRangeCalendarClasses';
|
|
20
20
|
import { isEndOfRange, isRangeValid, isStartOfRange, isWithinRange } from '../internals/utils/date-utils';
|
|
@@ -23,6 +23,7 @@ import { DateRangePickerDay, dateRangePickerDayClasses as dayClasses } from '../
|
|
|
23
23
|
import { rangeValueManager } from '../internals/utils/valueManagers';
|
|
24
24
|
import { useDragRange } from './useDragRange';
|
|
25
25
|
import { useRangePosition } from '../internals/hooks/useRangePosition';
|
|
26
|
+
import { DAY_RANGE_SIZE, DAY_MARGIN } from '../internals/constants/dimensions';
|
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
28
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
29
|
var releaseInfo = getReleaseInfo();
|
|
@@ -56,7 +57,6 @@ var DateRangeCalendarArrowSwitcher = styled(PickersArrowSwitcher)({
|
|
|
56
57
|
alignItems: 'center',
|
|
57
58
|
justifyContent: 'space-between'
|
|
58
59
|
});
|
|
59
|
-
var DAY_RANGE_SIZE = 40;
|
|
60
60
|
var weeksContainerHeight = (DAY_RANGE_SIZE + DAY_MARGIN * 2) * 6;
|
|
61
61
|
var warnInvalidCurrentMonthCalendarPosition = buildWarning(['The `currentMonthCalendarPosition` prop must be an integer between `1` and the amount of calendars rendered.', 'For example if you have 2 calendars rendered, it should be equal to either 1 or 2.']);
|
|
62
62
|
var DayCalendarForRange = styled(DayCalendar)(function (_ref2) {
|
|
@@ -78,7 +78,7 @@ var DayCalendarForRange = styled(DayCalendar)(function (_ref2) {
|
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
function useDateRangeCalendarDefaultizedProps(props, name) {
|
|
81
|
-
var _themeProps$renderLoa, _themeProps$reduceAni, _props$loading, _props$disablePast, _props$disableFuture, _themeProps$calendars, _themeProps$disableDr;
|
|
81
|
+
var _themeProps$renderLoa, _themeProps$reduceAni, _props$loading, _props$disablePast, _props$disableFuture, _themeProps$openTo, _themeProps$views, _themeProps$calendars, _themeProps$disableDr, _themeProps$available;
|
|
82
82
|
var utils = useUtils();
|
|
83
83
|
var defaultDates = useDefaultDates();
|
|
84
84
|
var defaultReduceAnimations = useDefaultReduceAnimations();
|
|
@@ -96,10 +96,13 @@ function useDateRangeCalendarDefaultizedProps(props, name) {
|
|
|
96
96
|
loading: (_props$loading = props.loading) != null ? _props$loading : false,
|
|
97
97
|
disablePast: (_props$disablePast = props.disablePast) != null ? _props$disablePast : false,
|
|
98
98
|
disableFuture: (_props$disableFuture = props.disableFuture) != null ? _props$disableFuture : false,
|
|
99
|
+
openTo: (_themeProps$openTo = themeProps.openTo) != null ? _themeProps$openTo : 'day',
|
|
100
|
+
views: (_themeProps$views = themeProps.views) != null ? _themeProps$views : ['day'],
|
|
99
101
|
minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),
|
|
100
102
|
maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate),
|
|
101
103
|
calendars: (_themeProps$calendars = themeProps.calendars) != null ? _themeProps$calendars : 2,
|
|
102
|
-
disableDragEditing: (_themeProps$disableDr = themeProps.disableDragEditing) != null ? _themeProps$disableDr : false
|
|
104
|
+
disableDragEditing: (_themeProps$disableDr = themeProps.disableDragEditing) != null ? _themeProps$disableDr : false,
|
|
105
|
+
availableRangePositions: (_themeProps$available = themeProps.availableRangePositions) != null ? _themeProps$available : ['start', 'end']
|
|
103
106
|
});
|
|
104
107
|
}
|
|
105
108
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
@@ -161,6 +164,11 @@ var DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalendar
|
|
|
161
164
|
disableDragEditing = props.disableDragEditing,
|
|
162
165
|
displayWeekNumber = props.displayWeekNumber,
|
|
163
166
|
timezoneProp = props.timezone,
|
|
167
|
+
availableRangePositions = props.availableRangePositions,
|
|
168
|
+
views = props.views,
|
|
169
|
+
inView = props.view,
|
|
170
|
+
openTo = props.openTo,
|
|
171
|
+
onViewChange = props.onViewChange,
|
|
164
172
|
other = _objectWithoutProperties(props, _excluded);
|
|
165
173
|
var _useControlledValueWi = useControlledValueWithTimezone({
|
|
166
174
|
name: 'DateRangeCalendar',
|
|
@@ -173,6 +181,16 @@ var DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalendar
|
|
|
173
181
|
value = _useControlledValueWi.value,
|
|
174
182
|
handleValueChange = _useControlledValueWi.handleValueChange,
|
|
175
183
|
timezone = _useControlledValueWi.timezone;
|
|
184
|
+
var _useViews = useViews({
|
|
185
|
+
view: inView,
|
|
186
|
+
views: views,
|
|
187
|
+
openTo: openTo,
|
|
188
|
+
onChange: handleValueChange,
|
|
189
|
+
onViewChange: onViewChange,
|
|
190
|
+
autoFocus: autoFocus
|
|
191
|
+
}),
|
|
192
|
+
setValueAndGoToNextView = _useViews.setValueAndGoToNextView,
|
|
193
|
+
view = _useViews.view;
|
|
176
194
|
var utils = useUtils();
|
|
177
195
|
var localeText = useLocaleText();
|
|
178
196
|
var now = useNow(timezone);
|
|
@@ -195,13 +213,17 @@ var DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalendar
|
|
|
195
213
|
utils: utils,
|
|
196
214
|
range: value,
|
|
197
215
|
rangePosition: rangePosition,
|
|
198
|
-
allowRangeFlip: allowRangeFlip
|
|
216
|
+
allowRangeFlip: allowRangeFlip,
|
|
217
|
+
shouldMergeDateAndTime: true
|
|
199
218
|
}),
|
|
200
219
|
nextSelection = _calculateRangeChange.nextSelection,
|
|
201
220
|
newRange = _calculateRangeChange.newRange;
|
|
202
|
-
|
|
221
|
+
var isNextSectionAvailable = availableRangePositions.includes(nextSelection);
|
|
222
|
+
if (isNextSectionAvailable) {
|
|
223
|
+
onRangePositionChange(nextSelection);
|
|
224
|
+
}
|
|
203
225
|
var isFullRangeSelected = rangePosition === 'end' && isRangeValid(utils, newRange);
|
|
204
|
-
|
|
226
|
+
setValueAndGoToNextView(newRange, isFullRangeSelected || !isNextSectionAvailable ? 'finish' : 'partial', view);
|
|
205
227
|
});
|
|
206
228
|
var handleDrop = useEventCallback(function (newDate) {
|
|
207
229
|
handleSelectedDayChange(newDate, undefined, true);
|
|
@@ -518,6 +540,14 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
518
540
|
* - the `input` element if there is a field rendered.
|
|
519
541
|
*/
|
|
520
542
|
autoFocus: PropTypes.bool,
|
|
543
|
+
/**
|
|
544
|
+
* Range positions available for selection.
|
|
545
|
+
* This list is checked against when checking if a next range position can be selected.
|
|
546
|
+
*
|
|
547
|
+
* Used on Date Time Range pickers with current `rangePosition` to force a `finish` selection after just one range position selection.
|
|
548
|
+
* @default ['start', 'end']
|
|
549
|
+
*/
|
|
550
|
+
availableRangePositions: PropTypes.arrayOf(PropTypes.oneOf(['end', 'start']).isRequired),
|
|
521
551
|
/**
|
|
522
552
|
* The number of calendars to render.
|
|
523
553
|
* @default 2
|
|
@@ -588,6 +618,10 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
588
618
|
* @default undefined
|
|
589
619
|
*/
|
|
590
620
|
fixedWeekNumber: PropTypes.number,
|
|
621
|
+
/**
|
|
622
|
+
* Controlled focused view.
|
|
623
|
+
*/
|
|
624
|
+
focusedView: PropTypes.oneOf(['day']),
|
|
591
625
|
/**
|
|
592
626
|
* If `true`, calls `renderLoading` instead of rendering the day calendar.
|
|
593
627
|
* Can be used to preload information and show it in calendar.
|
|
@@ -604,11 +638,20 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
604
638
|
minDate: PropTypes.any,
|
|
605
639
|
/**
|
|
606
640
|
* Callback fired when the value changes.
|
|
607
|
-
* @template
|
|
608
|
-
* @
|
|
609
|
-
* @param {
|
|
641
|
+
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
642
|
+
* @template TView The view type. Will be one of date or time views.
|
|
643
|
+
* @param {TValue} value The new value.
|
|
644
|
+
* @param {PickerSelectionState | undefined} selectionState Indicates if the date selection is complete.
|
|
645
|
+
* @param {TView | undefined} selectedView Indicates the view in which the selection has been made.
|
|
610
646
|
*/
|
|
611
647
|
onChange: PropTypes.func,
|
|
648
|
+
/**
|
|
649
|
+
* Callback fired on focused view change.
|
|
650
|
+
* @template TView
|
|
651
|
+
* @param {TView} view The new view to focus or not.
|
|
652
|
+
* @param {boolean} hasFocus `true` if the view should be focused.
|
|
653
|
+
*/
|
|
654
|
+
onFocusedViewChange: PropTypes.func,
|
|
612
655
|
/**
|
|
613
656
|
* Callback fired on month change.
|
|
614
657
|
* @template TDate
|
|
@@ -620,6 +663,18 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
620
663
|
* @param {RangePosition} rangePosition The new range position.
|
|
621
664
|
*/
|
|
622
665
|
onRangePositionChange: PropTypes.func,
|
|
666
|
+
/**
|
|
667
|
+
* Callback fired on view change.
|
|
668
|
+
* @template TView
|
|
669
|
+
* @param {TView} view The new view.
|
|
670
|
+
*/
|
|
671
|
+
onViewChange: PropTypes.func,
|
|
672
|
+
/**
|
|
673
|
+
* The default visible view.
|
|
674
|
+
* Used when the component view is not controlled.
|
|
675
|
+
* Must be a valid option from `views` list.
|
|
676
|
+
*/
|
|
677
|
+
openTo: PropTypes.oneOf(['day']),
|
|
623
678
|
/**
|
|
624
679
|
* The position in the currently edited date range.
|
|
625
680
|
* Used when the component position is controlled.
|
|
@@ -694,6 +749,16 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
694
749
|
* The selected value.
|
|
695
750
|
* Used when the component is controlled.
|
|
696
751
|
*/
|
|
697
|
-
value: PropTypes.arrayOf(PropTypes.any)
|
|
752
|
+
value: PropTypes.arrayOf(PropTypes.any),
|
|
753
|
+
/**
|
|
754
|
+
* The visible view.
|
|
755
|
+
* Used when the component view is controlled.
|
|
756
|
+
* Must be a valid option from `views` list.
|
|
757
|
+
*/
|
|
758
|
+
view: PropTypes.oneOf(['day']),
|
|
759
|
+
/**
|
|
760
|
+
* Available views.
|
|
761
|
+
*/
|
|
762
|
+
views: PropTypes.arrayOf(PropTypes.oneOf(['day']))
|
|
698
763
|
} : void 0;
|
|
699
764
|
export { DateRangeCalendar };
|
|
@@ -58,9 +58,6 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
58
58
|
* @default 2
|
|
59
59
|
*/
|
|
60
60
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
61
|
-
/**
|
|
62
|
-
* Class name applied to the root element.
|
|
63
|
-
*/
|
|
64
61
|
className: PropTypes.string,
|
|
65
62
|
/**
|
|
66
63
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -101,9 +101,6 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
101
101
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
102
102
|
// ----------------------------------------------------------------------
|
|
103
103
|
classes: PropTypes.object,
|
|
104
|
-
/**
|
|
105
|
-
* className applied to the root component.
|
|
106
|
-
*/
|
|
107
104
|
className: PropTypes.string,
|
|
108
105
|
disabled: PropTypes.bool,
|
|
109
106
|
/**
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["desktopModeMediaQuery"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
7
|
+
import { useThemeProps } from '@mui/material/styles';
|
|
8
|
+
import { DesktopDateTimeRangePicker } from '../DesktopDateTimeRangePicker';
|
|
9
|
+
import { MobileDateTimeRangePicker } from '../MobileDateTimeRangePicker';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
var DateTimeRangePicker = /*#__PURE__*/React.forwardRef(function DateTimeRangePicker(inProps, ref) {
|
|
12
|
+
var props = useThemeProps({
|
|
13
|
+
props: inProps,
|
|
14
|
+
name: 'MuiDateTimeRangePicker'
|
|
15
|
+
});
|
|
16
|
+
var _props$desktopModeMed = props.desktopModeMediaQuery,
|
|
17
|
+
desktopModeMediaQuery = _props$desktopModeMed === void 0 ? '@media (pointer: fine)' : _props$desktopModeMed,
|
|
18
|
+
other = _objectWithoutProperties(props, _excluded);
|
|
19
|
+
|
|
20
|
+
// defaults to `true` in environments where `window.matchMedia` would not be available (i.e. test/jsdom)
|
|
21
|
+
var isDesktop = useMediaQuery(desktopModeMediaQuery, {
|
|
22
|
+
defaultMatches: true
|
|
23
|
+
});
|
|
24
|
+
if (isDesktop) {
|
|
25
|
+
return /*#__PURE__*/_jsx(DesktopDateTimeRangePicker, _extends({
|
|
26
|
+
ref: ref
|
|
27
|
+
}, other));
|
|
28
|
+
}
|
|
29
|
+
return /*#__PURE__*/_jsx(MobileDateTimeRangePicker, _extends({
|
|
30
|
+
ref: ref
|
|
31
|
+
}, other));
|
|
32
|
+
});
|
|
33
|
+
process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
34
|
+
// ----------------------------- Warning --------------------------------
|
|
35
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
36
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
37
|
+
// ----------------------------------------------------------------------
|
|
38
|
+
/**
|
|
39
|
+
* 12h/24h view for hour selection clock.
|
|
40
|
+
* @default `utils.is12HourCycleInCurrentLocale()`
|
|
41
|
+
*/
|
|
42
|
+
ampm: PropTypes.bool,
|
|
43
|
+
/**
|
|
44
|
+
* If `true`, the main element is focused during the first mount.
|
|
45
|
+
* This main element is:
|
|
46
|
+
* - the element chosen by the visible view if any (i.e: the selected day on the `day` view).
|
|
47
|
+
* - the `input` element if there is a field rendered.
|
|
48
|
+
*/
|
|
49
|
+
autoFocus: PropTypes.bool,
|
|
50
|
+
/**
|
|
51
|
+
* The number of calendars to render on **desktop**.
|
|
52
|
+
* @default 1
|
|
53
|
+
*/
|
|
54
|
+
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
55
|
+
className: PropTypes.string,
|
|
56
|
+
/**
|
|
57
|
+
* If `true`, the popover or modal will close after submitting the full date.
|
|
58
|
+
* @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
59
|
+
*/
|
|
60
|
+
closeOnSelect: PropTypes.bool,
|
|
61
|
+
/**
|
|
62
|
+
* Position the current month is rendered in.
|
|
63
|
+
* @default 1
|
|
64
|
+
*/
|
|
65
|
+
currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
|
|
66
|
+
/**
|
|
67
|
+
* Formats the day of week displayed in the calendar header.
|
|
68
|
+
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
69
|
+
* @returns {string} The name to display.
|
|
70
|
+
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
71
|
+
*/
|
|
72
|
+
dayOfWeekFormatter: PropTypes.func,
|
|
73
|
+
/**
|
|
74
|
+
* The initial position in the edited date range.
|
|
75
|
+
* Used when the component is not controlled.
|
|
76
|
+
* @default 'start'
|
|
77
|
+
*/
|
|
78
|
+
defaultRangePosition: PropTypes.oneOf(['end', 'start']),
|
|
79
|
+
/**
|
|
80
|
+
* The default value.
|
|
81
|
+
* Used when the component is not controlled.
|
|
82
|
+
*/
|
|
83
|
+
defaultValue: PropTypes.arrayOf(PropTypes.any),
|
|
84
|
+
/**
|
|
85
|
+
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
86
|
+
* @default '@media (pointer: fine)'
|
|
87
|
+
* @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
|
|
88
|
+
*/
|
|
89
|
+
desktopModeMediaQuery: PropTypes.string,
|
|
90
|
+
/**
|
|
91
|
+
* If `true`, after selecting `start` date calendar will not automatically switch to the month of `end` date.
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
disableAutoMonthSwitching: PropTypes.bool,
|
|
95
|
+
/**
|
|
96
|
+
* If `true`, the picker and text field are disabled.
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
disabled: PropTypes.bool,
|
|
100
|
+
/**
|
|
101
|
+
* If `true`, editing dates by dragging is disabled.
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
disableDragEditing: PropTypes.bool,
|
|
105
|
+
/**
|
|
106
|
+
* If `true`, disable values after the current date for date components, time for time components and both for date time components.
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
disableFuture: PropTypes.bool,
|
|
110
|
+
/**
|
|
111
|
+
* If `true`, today's date is rendering without highlighting with circle.
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
disableHighlightToday: PropTypes.bool,
|
|
115
|
+
/**
|
|
116
|
+
* Do not ignore date part when validating min/max time.
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
disableIgnoringDatePartForTimeValidation: PropTypes.bool,
|
|
120
|
+
/**
|
|
121
|
+
* If `true`, the open picker button will not be rendered (renders only the field).
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
disableOpenPicker: PropTypes.bool,
|
|
125
|
+
/**
|
|
126
|
+
* If `true`, disable values before the current date for date components, time for time components and both for date time components.
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
disablePast: PropTypes.bool,
|
|
130
|
+
/**
|
|
131
|
+
* If `true`, the week number will be display in the calendar.
|
|
132
|
+
*/
|
|
133
|
+
displayWeekNumber: PropTypes.bool,
|
|
134
|
+
/**
|
|
135
|
+
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
136
|
+
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
137
|
+
* @default undefined
|
|
138
|
+
*/
|
|
139
|
+
fixedWeekNumber: PropTypes.number,
|
|
140
|
+
/**
|
|
141
|
+
* Format of the date when rendered in the input(s).
|
|
142
|
+
* Defaults to localized format based on the used `views`.
|
|
143
|
+
*/
|
|
144
|
+
format: PropTypes.string,
|
|
145
|
+
/**
|
|
146
|
+
* Density of the format when rendered in the input.
|
|
147
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
148
|
+
* @default "dense"
|
|
149
|
+
*/
|
|
150
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
151
|
+
/**
|
|
152
|
+
* Pass a ref to the `input` element.
|
|
153
|
+
* Ignored if the field has several inputs.
|
|
154
|
+
*/
|
|
155
|
+
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
156
|
+
current: PropTypes.object
|
|
157
|
+
})]),
|
|
158
|
+
/**
|
|
159
|
+
* The label content.
|
|
160
|
+
* Ignored if the field has several inputs.
|
|
161
|
+
*/
|
|
162
|
+
label: PropTypes.node,
|
|
163
|
+
/**
|
|
164
|
+
* If `true`, calls `renderLoading` instead of rendering the day calendar.
|
|
165
|
+
* Can be used to preload information and show it in calendar.
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
loading: PropTypes.bool,
|
|
169
|
+
/**
|
|
170
|
+
* Locale for components texts.
|
|
171
|
+
* Allows overriding texts coming from `LocalizationProvider` and `theme`.
|
|
172
|
+
*/
|
|
173
|
+
localeText: PropTypes.object,
|
|
174
|
+
/**
|
|
175
|
+
* Maximal selectable date.
|
|
176
|
+
*/
|
|
177
|
+
maxDate: PropTypes.any,
|
|
178
|
+
/**
|
|
179
|
+
* Maximal selectable moment of time with binding to date, to set max time in each day use `maxTime`.
|
|
180
|
+
*/
|
|
181
|
+
maxDateTime: PropTypes.any,
|
|
182
|
+
/**
|
|
183
|
+
* Maximal selectable time.
|
|
184
|
+
* The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
|
|
185
|
+
*/
|
|
186
|
+
maxTime: PropTypes.any,
|
|
187
|
+
/**
|
|
188
|
+
* Minimal selectable date.
|
|
189
|
+
*/
|
|
190
|
+
minDate: PropTypes.any,
|
|
191
|
+
/**
|
|
192
|
+
* Minimal selectable moment of time with binding to date, to set min time in each day use `minTime`.
|
|
193
|
+
*/
|
|
194
|
+
minDateTime: PropTypes.any,
|
|
195
|
+
/**
|
|
196
|
+
* Minimal selectable time.
|
|
197
|
+
* The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
|
|
198
|
+
*/
|
|
199
|
+
minTime: PropTypes.any,
|
|
200
|
+
/**
|
|
201
|
+
* Step over minutes.
|
|
202
|
+
* @default 1
|
|
203
|
+
*/
|
|
204
|
+
minutesStep: PropTypes.number,
|
|
205
|
+
/**
|
|
206
|
+
* Name attribute used by the `input` element in the Field.
|
|
207
|
+
* Ignored if the field has several inputs.
|
|
208
|
+
*/
|
|
209
|
+
name: PropTypes.string,
|
|
210
|
+
/**
|
|
211
|
+
* Callback fired when the value is accepted.
|
|
212
|
+
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
213
|
+
* @param {TValue} value The value that was just accepted.
|
|
214
|
+
*/
|
|
215
|
+
onAccept: PropTypes.func,
|
|
216
|
+
/**
|
|
217
|
+
* Callback fired when the value changes.
|
|
218
|
+
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
219
|
+
* @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
|
|
220
|
+
* @param {TValue} value The new value.
|
|
221
|
+
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
222
|
+
*/
|
|
223
|
+
onChange: PropTypes.func,
|
|
224
|
+
/**
|
|
225
|
+
* Callback fired when the popup requests to be closed.
|
|
226
|
+
* Use in controlled mode (see `open`).
|
|
227
|
+
*/
|
|
228
|
+
onClose: PropTypes.func,
|
|
229
|
+
/**
|
|
230
|
+
* Callback fired when the error associated to the current value changes.
|
|
231
|
+
* If the error has a non-null value, then the `TextField` will be rendered in `error` state.
|
|
232
|
+
*
|
|
233
|
+
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
234
|
+
* @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
|
|
235
|
+
* @param {TError} error The new error describing why the current value is not valid.
|
|
236
|
+
* @param {TValue} value The value associated to the error.
|
|
237
|
+
*/
|
|
238
|
+
onError: PropTypes.func,
|
|
239
|
+
/**
|
|
240
|
+
* Callback fired on month change.
|
|
241
|
+
* @template TDate
|
|
242
|
+
* @param {TDate} month The new month.
|
|
243
|
+
*/
|
|
244
|
+
onMonthChange: PropTypes.func,
|
|
245
|
+
/**
|
|
246
|
+
* Callback fired when the popup requests to be opened.
|
|
247
|
+
* Use in controlled mode (see `open`).
|
|
248
|
+
*/
|
|
249
|
+
onOpen: PropTypes.func,
|
|
250
|
+
/**
|
|
251
|
+
* Callback fired when the range position changes.
|
|
252
|
+
* @param {RangePosition} rangePosition The new range position.
|
|
253
|
+
*/
|
|
254
|
+
onRangePositionChange: PropTypes.func,
|
|
255
|
+
/**
|
|
256
|
+
* Callback fired when the selected sections change.
|
|
257
|
+
* @param {FieldSelectedSections} newValue The new selected sections.
|
|
258
|
+
*/
|
|
259
|
+
onSelectedSectionsChange: PropTypes.func,
|
|
260
|
+
/**
|
|
261
|
+
* Callback fired on view change.
|
|
262
|
+
* @template TView
|
|
263
|
+
* @param {TView} view The new view.
|
|
264
|
+
*/
|
|
265
|
+
onViewChange: PropTypes.func,
|
|
266
|
+
/**
|
|
267
|
+
* Control the popup or dialog open state.
|
|
268
|
+
* @default false
|
|
269
|
+
*/
|
|
270
|
+
open: PropTypes.bool,
|
|
271
|
+
/**
|
|
272
|
+
* The default visible view.
|
|
273
|
+
* Used when the component view is not controlled.
|
|
274
|
+
* Must be a valid option from `views` list.
|
|
275
|
+
*/
|
|
276
|
+
openTo: PropTypes.oneOf(['day', 'hours', 'minutes', 'seconds']),
|
|
277
|
+
/**
|
|
278
|
+
* The position in the currently edited date range.
|
|
279
|
+
* Used when the component position is controlled.
|
|
280
|
+
*/
|
|
281
|
+
rangePosition: PropTypes.oneOf(['end', 'start']),
|
|
282
|
+
readOnly: PropTypes.bool,
|
|
283
|
+
/**
|
|
284
|
+
* If `true`, disable heavy animations.
|
|
285
|
+
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
286
|
+
*/
|
|
287
|
+
reduceAnimations: PropTypes.bool,
|
|
288
|
+
/**
|
|
289
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
290
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
291
|
+
*/
|
|
292
|
+
referenceDate: PropTypes.any,
|
|
293
|
+
/**
|
|
294
|
+
* Component rendered on the "day" view when `props.loading` is true.
|
|
295
|
+
* @returns {React.ReactNode} The node to render when loading.
|
|
296
|
+
* @default () => "..."
|
|
297
|
+
*/
|
|
298
|
+
renderLoading: PropTypes.func,
|
|
299
|
+
/**
|
|
300
|
+
* The currently selected sections.
|
|
301
|
+
* This prop accept four formats:
|
|
302
|
+
* 1. If a number is provided, the section at this index will be selected.
|
|
303
|
+
* 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
|
|
304
|
+
* 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
|
|
305
|
+
* 4. If `null` is provided, no section will be selected
|
|
306
|
+
* If not provided, the selected sections will be handled internally.
|
|
307
|
+
*/
|
|
308
|
+
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
309
|
+
endIndex: PropTypes.number.isRequired,
|
|
310
|
+
startIndex: PropTypes.number.isRequired
|
|
311
|
+
})]),
|
|
312
|
+
/**
|
|
313
|
+
* Disable specific date.
|
|
314
|
+
*
|
|
315
|
+
* Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
316
|
+
*
|
|
317
|
+
* @template TDate
|
|
318
|
+
* @param {TDate} day The date to test.
|
|
319
|
+
* @param {string} position The date to test, 'start' or 'end'.
|
|
320
|
+
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
321
|
+
*/
|
|
322
|
+
shouldDisableDate: PropTypes.func,
|
|
323
|
+
/**
|
|
324
|
+
* Disable specific time.
|
|
325
|
+
* @template TDate
|
|
326
|
+
* @param {TDate} value The value to check.
|
|
327
|
+
* @param {TimeView} view The clock type of the timeValue.
|
|
328
|
+
* @returns {boolean} If `true` the time will be disabled.
|
|
329
|
+
*/
|
|
330
|
+
shouldDisableTime: PropTypes.func,
|
|
331
|
+
/**
|
|
332
|
+
* If `true`, days outside the current month are rendered:
|
|
333
|
+
*
|
|
334
|
+
* - if `fixedWeekNumber` is defined, renders days to have the weeks requested.
|
|
335
|
+
*
|
|
336
|
+
* - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.
|
|
337
|
+
*
|
|
338
|
+
* - ignored if `calendars` equals more than `1` on range pickers.
|
|
339
|
+
* @default false
|
|
340
|
+
*/
|
|
341
|
+
showDaysOutsideCurrentMonth: PropTypes.bool,
|
|
342
|
+
/**
|
|
343
|
+
* If `true`, disabled digital clock items will not be rendered.
|
|
344
|
+
* @default false
|
|
345
|
+
*/
|
|
346
|
+
skipDisabled: PropTypes.bool,
|
|
347
|
+
/**
|
|
348
|
+
* The props used for each component slot.
|
|
349
|
+
* @default {}
|
|
350
|
+
*/
|
|
351
|
+
slotProps: PropTypes.object,
|
|
352
|
+
/**
|
|
353
|
+
* Overridable component slots.
|
|
354
|
+
* @default {}
|
|
355
|
+
*/
|
|
356
|
+
slots: PropTypes.object,
|
|
357
|
+
/**
|
|
358
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
359
|
+
*/
|
|
360
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
361
|
+
/**
|
|
362
|
+
* Amount of time options below or at which the single column time renderer is used.
|
|
363
|
+
* @default 24
|
|
364
|
+
*/
|
|
365
|
+
thresholdToRenderTimeInASingleColumn: PropTypes.number,
|
|
366
|
+
/**
|
|
367
|
+
* The time steps between two time unit options.
|
|
368
|
+
* For example, if `timeStep.minutes = 8`, then the available minute options will be `[0, 8, 16, 24, 32, 40, 48, 56]`.
|
|
369
|
+
* When single column time renderer is used, only `timeStep.minutes` will be used.
|
|
370
|
+
* @default{ hours: 1, minutes: 5, seconds: 5 }
|
|
371
|
+
*/
|
|
372
|
+
timeSteps: PropTypes.shape({
|
|
373
|
+
hours: PropTypes.number,
|
|
374
|
+
minutes: PropTypes.number,
|
|
375
|
+
seconds: PropTypes.number
|
|
376
|
+
}),
|
|
377
|
+
/**
|
|
378
|
+
* Choose which timezone to use for the value.
|
|
379
|
+
* Example: "default", "system", "UTC", "America/New_York".
|
|
380
|
+
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
381
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
382
|
+
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
383
|
+
*/
|
|
384
|
+
timezone: PropTypes.string,
|
|
385
|
+
/**
|
|
386
|
+
* The selected value.
|
|
387
|
+
* Used when the component is controlled.
|
|
388
|
+
*/
|
|
389
|
+
value: PropTypes.arrayOf(PropTypes.any),
|
|
390
|
+
/**
|
|
391
|
+
* The visible view.
|
|
392
|
+
* Used when the component view is controlled.
|
|
393
|
+
* Must be a valid option from `views` list.
|
|
394
|
+
*/
|
|
395
|
+
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'seconds']),
|
|
396
|
+
/**
|
|
397
|
+
* Define custom view renderers for each section.
|
|
398
|
+
* If `null`, the section will only have field editing.
|
|
399
|
+
* If `undefined`, internally defined view will be the used.
|
|
400
|
+
*/
|
|
401
|
+
viewRenderers: PropTypes.shape({
|
|
402
|
+
day: PropTypes.func,
|
|
403
|
+
hours: PropTypes.func,
|
|
404
|
+
meridiem: PropTypes.func,
|
|
405
|
+
minutes: PropTypes.func,
|
|
406
|
+
seconds: PropTypes.func
|
|
407
|
+
}),
|
|
408
|
+
/**
|
|
409
|
+
* Available views.
|
|
410
|
+
*/
|
|
411
|
+
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'minutes', 'seconds']).isRequired)
|
|
412
|
+
} : void 0;
|
|
413
|
+
export { DateTimeRangePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|