@mui/x-date-pickers 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/AdapterDayjs/AdapterDayjs.js +6 -4
- package/AdapterMoment/AdapterMoment.js +2 -5
- package/CHANGELOG.md +169 -0
- package/DateField/DateField.d.ts +10 -0
- package/DateField/DateField.js +11 -1
- package/DatePicker/DatePicker.d.ts +10 -0
- package/DatePicker/DatePicker.js +10 -0
- package/DatePicker/DatePickerToolbar.d.ts +10 -0
- package/DatePicker/DatePickerToolbar.js +10 -0
- package/DateTimeField/DateTimeField.d.ts +10 -0
- package/DateTimeField/DateTimeField.js +11 -1
- package/DateTimePicker/DateTimePicker.d.ts +10 -0
- package/DateTimePicker/DateTimePicker.js +15 -0
- package/DateTimePicker/DateTimePickerTabs.d.ts +10 -0
- package/DateTimePicker/DateTimePickerTabs.js +11 -0
- package/DateTimePicker/DateTimePickerToolbar.d.ts +10 -0
- package/DateTimePicker/DateTimePickerToolbar.js +11 -0
- package/DayCalendarSkeleton/DayCalendarSkeleton.d.ts +1 -2
- package/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -2
- package/DesktopDatePicker/DesktopDatePicker.d.ts +10 -0
- package/DesktopDatePicker/DesktopDatePicker.js +10 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +10 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -7
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +4 -3
- package/DesktopTimePicker/DesktopTimePicker.d.ts +10 -0
- package/DesktopTimePicker/DesktopTimePicker.js +18 -9
- package/DigitalClock/DigitalClock.d.ts +10 -0
- package/DigitalClock/DigitalClock.js +11 -1
- package/LocalizationProvider/LocalizationProvider.d.ts +12 -0
- package/LocalizationProvider/LocalizationProvider.js +12 -0
- package/MobileDatePicker/MobileDatePicker.d.ts +10 -0
- package/MobileDatePicker/MobileDatePicker.js +10 -0
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +10 -0
- package/MobileDateTimePicker/MobileDateTimePicker.js +10 -0
- package/MobileTimePicker/MobileTimePicker.d.ts +10 -0
- package/MobileTimePicker/MobileTimePicker.js +10 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +10 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -0
- package/PickersActionBar/PickersActionBar.d.ts +10 -0
- package/PickersActionBar/PickersActionBar.js +10 -0
- package/PickersCalendarHeader/PickersCalendarHeader.d.ts +11 -0
- package/PickersCalendarHeader/PickersCalendarHeader.js +11 -0
- package/PickersDay/PickersDay.d.ts +1 -3
- package/PickersDay/PickersDay.js +1 -3
- package/PickersLayout/PickersLayout.d.ts +9 -0
- package/PickersLayout/PickersLayout.js +10 -0
- package/PickersShortcuts/PickersShortcuts.d.ts +9 -0
- package/PickersShortcuts/PickersShortcuts.js +9 -0
- package/StaticDatePicker/StaticDatePicker.d.ts +10 -0
- package/StaticDatePicker/StaticDatePicker.js +10 -0
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +10 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +10 -0
- package/StaticTimePicker/StaticTimePicker.d.ts +10 -0
- package/StaticTimePicker/StaticTimePicker.js +10 -0
- package/TimeClock/TimeClock.d.ts +4 -0
- package/TimeClock/TimeClock.js +4 -0
- package/TimeField/TimeField.d.ts +10 -0
- package/TimeField/TimeField.js +11 -1
- package/TimePicker/TimePicker.d.ts +10 -0
- package/TimePicker/TimePicker.js +10 -0
- package/TimePicker/TimePickerToolbar.d.ts +10 -0
- package/TimePicker/TimePickerToolbar.js +11 -0
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +52 -33
- package/index.js +1 -1
- package/internals/components/FakeTextField/FakeTextField.d.ts +10 -0
- package/internals/components/FakeTextField/FakeTextField.js +27 -0
- package/internals/components/FakeTextField/index.d.ts +1 -0
- package/internals/components/FakeTextField/index.js +1 -0
- package/internals/hooks/useField/useField.js +14 -4
- package/internals/hooks/useField/useField.utils.js +1 -1
- package/internals/hooks/useField/useFieldState.js +5 -8
- package/internals/utils/date-time-utils.d.ts +11 -0
- package/internals/utils/date-time-utils.js +32 -2
- package/legacy/AdapterDayjs/AdapterDayjs.js +6 -4
- package/legacy/AdapterMoment/AdapterMoment.js +2 -5
- package/legacy/DateField/DateField.js +11 -1
- package/legacy/DatePicker/DatePicker.js +10 -0
- package/legacy/DatePicker/DatePickerToolbar.js +10 -0
- package/legacy/DateTimeField/DateTimeField.js +11 -1
- package/legacy/DateTimePicker/DateTimePicker.js +15 -0
- package/legacy/DateTimePicker/DateTimePickerTabs.js +11 -0
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +11 -0
- package/legacy/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -2
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +10 -0
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +24 -8
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +19 -10
- package/legacy/DigitalClock/DigitalClock.js +11 -1
- package/legacy/LocalizationProvider/LocalizationProvider.js +12 -0
- package/legacy/MobileDatePicker/MobileDatePicker.js +10 -0
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +10 -0
- package/legacy/MobileTimePicker/MobileTimePicker.js +10 -0
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -0
- package/legacy/PickersActionBar/PickersActionBar.js +10 -0
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +11 -0
- package/legacy/PickersDay/PickersDay.js +1 -3
- package/legacy/PickersLayout/PickersLayout.js +10 -0
- package/legacy/PickersShortcuts/PickersShortcuts.js +9 -0
- package/legacy/StaticDatePicker/StaticDatePicker.js +10 -0
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +10 -0
- package/legacy/StaticTimePicker/StaticTimePicker.js +10 -0
- package/legacy/TimeClock/TimeClock.js +4 -0
- package/legacy/TimeField/TimeField.js +11 -1
- package/legacy/TimePicker/TimePicker.js +10 -0
- package/legacy/TimePicker/TimePickerToolbar.js +11 -0
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +51 -33
- package/legacy/index.js +1 -1
- package/legacy/internals/components/FakeTextField/FakeTextField.js +23 -0
- package/legacy/internals/components/FakeTextField/index.js +1 -0
- package/legacy/internals/hooks/useField/useField.js +14 -4
- package/legacy/internals/hooks/useField/useField.utils.js +1 -1
- package/legacy/internals/hooks/useField/useFieldState.js +5 -8
- package/legacy/internals/utils/date-time-utils.js +34 -2
- package/legacy/locales/esES.js +1 -1
- package/locales/esES.js +1 -1
- package/modern/AdapterDayjs/AdapterDayjs.js +6 -4
- package/modern/AdapterMoment/AdapterMoment.js +2 -5
- package/modern/DateField/DateField.js +11 -1
- package/modern/DatePicker/DatePicker.js +10 -0
- package/modern/DatePicker/DatePickerToolbar.js +10 -0
- package/modern/DateTimeField/DateTimeField.js +11 -1
- package/modern/DateTimePicker/DateTimePicker.js +15 -0
- package/modern/DateTimePicker/DateTimePickerTabs.js +11 -0
- package/modern/DateTimePicker/DateTimePickerToolbar.js +11 -0
- package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -2
- package/modern/DesktopDatePicker/DesktopDatePicker.js +10 -0
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -7
- package/modern/DesktopTimePicker/DesktopTimePicker.js +17 -8
- package/modern/DigitalClock/DigitalClock.js +11 -1
- package/modern/LocalizationProvider/LocalizationProvider.js +12 -0
- package/modern/MobileDatePicker/MobileDatePicker.js +10 -0
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +10 -0
- package/modern/MobileTimePicker/MobileTimePicker.js +10 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -0
- package/modern/PickersActionBar/PickersActionBar.js +10 -0
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +11 -0
- package/modern/PickersDay/PickersDay.js +1 -3
- package/modern/PickersLayout/PickersLayout.js +10 -0
- package/modern/PickersShortcuts/PickersShortcuts.js +9 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +10 -0
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +10 -0
- package/modern/StaticTimePicker/StaticTimePicker.js +10 -0
- package/modern/TimeClock/TimeClock.js +4 -0
- package/modern/TimeField/TimeField.js +11 -1
- package/modern/TimePicker/TimePicker.js +10 -0
- package/modern/TimePicker/TimePickerToolbar.js +11 -0
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +52 -33
- package/modern/index.js +1 -1
- package/modern/internals/components/FakeTextField/FakeTextField.js +27 -0
- package/modern/internals/components/FakeTextField/index.js +1 -0
- package/modern/internals/hooks/useField/useField.js +14 -4
- package/modern/internals/hooks/useField/useField.utils.js +1 -1
- package/modern/internals/hooks/useField/useFieldState.js +5 -8
- package/modern/internals/utils/date-time-utils.js +29 -2
- package/modern/locales/esES.js +1 -1
- package/node/AdapterDayjs/AdapterDayjs.js +6 -4
- package/node/AdapterMoment/AdapterMoment.js +2 -5
- package/node/DateCalendar/DateCalendar.js +2 -2
- package/node/DateCalendar/DayCalendar.js +2 -2
- package/node/DateCalendar/PickersFadeTransitionGroup.js +2 -2
- package/node/DateCalendar/PickersSlideTransition.js +2 -2
- package/node/DateCalendar/useCalendarState.js +2 -2
- package/node/DateCalendar/useIsDateDisabled.js +2 -2
- package/node/DateField/DateField.js +13 -3
- package/node/DatePicker/DatePicker.js +12 -2
- package/node/DatePicker/DatePickerToolbar.js +12 -2
- package/node/DatePicker/shared.js +2 -2
- package/node/DateTimeField/DateTimeField.js +13 -3
- package/node/DateTimePicker/DateTimePicker.js +17 -2
- package/node/DateTimePicker/DateTimePickerTabs.js +13 -2
- package/node/DateTimePicker/DateTimePickerToolbar.js +13 -2
- package/node/DateTimePicker/shared.js +2 -2
- package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +3 -4
- package/node/DesktopDatePicker/DesktopDatePicker.js +12 -2
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +26 -8
- package/node/DesktopTimePicker/DesktopTimePicker.js +19 -10
- package/node/DigitalClock/DigitalClock.js +13 -3
- package/node/LocalizationProvider/LocalizationProvider.js +14 -2
- package/node/MobileDatePicker/MobileDatePicker.js +12 -2
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +12 -2
- package/node/MobileTimePicker/MobileTimePicker.js +12 -2
- package/node/MonthCalendar/MonthCalendar.js +2 -2
- package/node/MonthCalendar/PickersMonth.js +2 -2
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +12 -2
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -2
- package/node/PickersActionBar/PickersActionBar.js +12 -2
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +13 -2
- package/node/PickersDay/PickersDay.js +3 -5
- package/node/PickersLayout/PickersLayout.js +12 -2
- package/node/PickersLayout/usePickerLayout.js +2 -2
- package/node/PickersShortcuts/PickersShortcuts.js +11 -2
- package/node/StaticDatePicker/StaticDatePicker.js +12 -2
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +12 -2
- package/node/StaticTimePicker/StaticTimePicker.js +12 -2
- package/node/TimeClock/Clock.js +2 -2
- package/node/TimeClock/ClockNumber.js +2 -2
- package/node/TimeClock/ClockNumbers.js +2 -2
- package/node/TimeClock/ClockPointer.js +2 -2
- package/node/TimeClock/TimeClock.js +6 -2
- package/node/TimeField/TimeField.js +13 -3
- package/node/TimePicker/TimePicker.js +12 -2
- package/node/TimePicker/TimePickerToolbar.js +13 -2
- package/node/TimePicker/shared.js +2 -2
- package/node/YearCalendar/PickersYear.js +2 -2
- package/node/YearCalendar/YearCalendar.js +2 -2
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +53 -34
- package/node/dateViewRenderers/dateViewRenderers.js +2 -2
- package/node/hooks/useClearableField.js +2 -2
- package/node/icons/index.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/components/FakeTextField/FakeTextField.js +35 -0
- package/node/internals/components/FakeTextField/index.js +12 -0
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -2
- package/node/internals/components/PickersModalDialog.js +2 -2
- package/node/internals/components/PickersPopper.js +2 -2
- package/node/internals/components/PickersToolbar.js +2 -2
- package/node/internals/components/PickersToolbarButton.js +2 -2
- package/node/internals/components/PickersToolbarText.js +2 -2
- package/node/internals/demo/DemoContainer.js +2 -2
- package/node/internals/hooks/date-helpers-hooks.js +2 -2
- package/node/internals/hooks/useClockReferenceDate.js +2 -2
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -2
- package/node/internals/hooks/useField/useField.js +16 -6
- package/node/internals/hooks/useField/useField.utils.js +1 -1
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +2 -2
- package/node/internals/hooks/useField/useFieldState.js +7 -10
- package/node/internals/hooks/useIsLandscape.js +2 -2
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +2 -2
- package/node/internals/hooks/useOpenState.js +2 -2
- package/node/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/node/internals/hooks/usePicker/usePickerViews.js +2 -2
- package/node/internals/hooks/useStaticPicker/useStaticPicker.js +2 -2
- package/node/internals/hooks/useUtils.js +2 -2
- package/node/internals/hooks/useValidation.js +2 -2
- package/node/internals/hooks/useValueWithTimezone.js +2 -2
- package/node/internals/hooks/useViews.js +2 -2
- package/node/internals/utils/date-time-utils.js +29 -1
- package/node/locales/esES.js +1 -1
- package/node/timeViewRenderers/timeViewRenderers.js +2 -2
- package/package.json +4 -4
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
@@ -14,7 +13,17 @@ import { validateDateTime } from '../internals/utils/validation/validateDateTime
|
|
|
14
13
|
import { CalendarIcon } from '../icons';
|
|
15
14
|
import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
16
15
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
17
|
-
import { resolveDateTimeFormat } from '../internals/utils/date-time-utils';
|
|
16
|
+
import { resolveDateTimeFormat, resolveTimeViewsResponse } from '../internals/utils/date-time-utils';
|
|
17
|
+
/**
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
21
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [DesktopDateTimePicker API](https://mui.com/x/api/date-pickers/desktop-date-time-picker/)
|
|
26
|
+
*/
|
|
18
27
|
var DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTimePicker(inProps, ref) {
|
|
19
28
|
var _defaultizedProps$amp, _defaultizedProps$yea, _defaultizedProps$slo2, _defaultizedProps$slo3, _defaultizedProps$slo4, _props$localeText$ope, _props$localeText;
|
|
20
29
|
var localeText = useLocaleText();
|
|
@@ -22,11 +31,11 @@ var DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTi
|
|
|
22
31
|
|
|
23
32
|
// Props with the default values common to all date time pickers
|
|
24
33
|
var defaultizedProps = useDateTimePickerDefaultizedProps(inProps, 'MuiDesktopDateTimePicker');
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
var _resolveTimeViewsResp = resolveTimeViewsResponse(defaultizedProps),
|
|
35
|
+
shouldRenderTimeInASingleColumn = _resolveTimeViewsResp.shouldRenderTimeInASingleColumn,
|
|
36
|
+
thresholdToRenderTimeInASingleColumn = _resolveTimeViewsResp.thresholdToRenderTimeInASingleColumn,
|
|
37
|
+
views = _resolveTimeViewsResp.views,
|
|
38
|
+
timeSteps = _resolveTimeViewsResp.timeSteps;
|
|
30
39
|
var shouldUseNewRenderer = !defaultizedProps.viewRenderers || Object.keys(defaultizedProps.viewRenderers).length === 0;
|
|
31
40
|
var viewRenderers =
|
|
32
41
|
// we can only ensure the expected two-column layout if none of the renderers are overridden
|
|
@@ -55,10 +64,12 @@ var DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTi
|
|
|
55
64
|
var props = _extends({}, defaultizedProps, {
|
|
56
65
|
viewRenderers: viewRenderers,
|
|
57
66
|
format: resolveDateTimeFormat(utils, defaultizedProps),
|
|
58
|
-
views:
|
|
67
|
+
views: views,
|
|
59
68
|
yearsPerRow: (_defaultizedProps$yea = defaultizedProps.yearsPerRow) != null ? _defaultizedProps$yea : 4,
|
|
60
69
|
ampmInClock: ampmInClock,
|
|
61
70
|
timeSteps: timeSteps,
|
|
71
|
+
thresholdToRenderTimeInASingleColumn: thresholdToRenderTimeInASingleColumn,
|
|
72
|
+
shouldRenderTimeInASingleColumn: shouldRenderTimeInASingleColumn,
|
|
62
73
|
slots: _extends({
|
|
63
74
|
field: DateTimeField,
|
|
64
75
|
openPickerIcon: CalendarIcon
|
|
@@ -431,6 +442,11 @@ DesktopDateTimePicker.propTypes = {
|
|
|
431
442
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
432
443
|
*/
|
|
433
444
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
445
|
+
/**
|
|
446
|
+
* Amount of time options below or at which the single column time renderer is used.
|
|
447
|
+
* @default 24
|
|
448
|
+
*/
|
|
449
|
+
thresholdToRenderTimeInASingleColumn: PropTypes.number,
|
|
434
450
|
/**
|
|
435
451
|
* The time steps between two time unit options.
|
|
436
452
|
* For example, if `timeStep.minutes = 8`, then the available minute options will be `[0, 8, 16, 24, 32, 40, 48, 56]`.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
@@ -14,20 +13,28 @@ import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
|
14
13
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
15
14
|
import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from '../timeViewRenderers';
|
|
16
15
|
import { resolveTimeFormat } from '../internals/utils/time-utils';
|
|
16
|
+
import { resolveTimeViewsResponse } from '../internals/utils/date-time-utils';
|
|
17
|
+
/**
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
21
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [DesktopTimePicker API](https://mui.com/x/api/date-pickers/desktop-time-picker/)
|
|
26
|
+
*/
|
|
17
27
|
var DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePicker(inProps, ref) {
|
|
18
|
-
var _defaultizedProps$
|
|
28
|
+
var _defaultizedProps$amp, _viewRenderers$hours, _defaultizedProps$slo2, _defaultizedProps$slo3, _props$localeText$ope, _props$localeText;
|
|
19
29
|
var localeText = useLocaleText();
|
|
20
30
|
var utils = useUtils();
|
|
21
31
|
|
|
22
32
|
// Props with the default values common to all time pickers
|
|
23
33
|
var defaultizedProps = useTimePickerDefaultizedProps(inProps, 'MuiDesktopTimePicker');
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
seconds: 5
|
|
29
|
-
}, defaultizedProps.timeSteps);
|
|
30
|
-
var shouldRenderTimeInASingleColumn = 24 * 60 / (timeSteps.hours * timeSteps.minutes) <= thresholdToRenderTimeInASingleColumn;
|
|
34
|
+
var _resolveTimeViewsResp = resolveTimeViewsResponse(defaultizedProps),
|
|
35
|
+
shouldRenderTimeInASingleColumn = _resolveTimeViewsResp.shouldRenderTimeInASingleColumn,
|
|
36
|
+
resolvedViews = _resolveTimeViewsResp.views,
|
|
37
|
+
timeSteps = _resolveTimeViewsResp.timeSteps;
|
|
31
38
|
var renderTimeView = shouldRenderTimeInASingleColumn ? renderDigitalClockTimeView : renderMultiSectionDigitalClockTimeView;
|
|
32
39
|
var viewRenderers = _extends({
|
|
33
40
|
hours: renderTimeView,
|
|
@@ -39,7 +46,9 @@ var DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePicker
|
|
|
39
46
|
var actionBarActions = shouldRenderTimeInASingleColumn ? [] : ['accept'];
|
|
40
47
|
// Need to avoid adding the `meridiem` view when unexpected renderer is specified
|
|
41
48
|
var shouldHoursRendererContainMeridiemView = ((_viewRenderers$hours = viewRenderers.hours) == null ? void 0 : _viewRenderers$hours.name) === renderMultiSectionDigitalClockTimeView.name;
|
|
42
|
-
var views =
|
|
49
|
+
var views = !shouldHoursRendererContainMeridiemView ? resolvedViews.filter(function (view) {
|
|
50
|
+
return view !== 'meridiem';
|
|
51
|
+
}) : resolvedViews;
|
|
43
52
|
|
|
44
53
|
// Props with the default values specific to the desktop variant
|
|
45
54
|
var props = _extends({}, defaultizedProps, {
|
|
@@ -86,6 +86,16 @@ var DigitalClockItem = styled(MenuItem, {
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
});
|
|
89
|
+
/**
|
|
90
|
+
* Demos:
|
|
91
|
+
*
|
|
92
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
93
|
+
* - [DigitalClock](https://mui.com/x/react-date-pickers/digital-clock/)
|
|
94
|
+
*
|
|
95
|
+
* API:
|
|
96
|
+
*
|
|
97
|
+
* - [DigitalClock API](https://mui.com/x/api/date-pickers/digital-clock/)
|
|
98
|
+
*/
|
|
89
99
|
export var DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(inProps, ref) {
|
|
90
100
|
var _ref3, _slots$digitalClockIt, _slotProps$digitalClo;
|
|
91
101
|
var utils = useUtils();
|
|
@@ -166,7 +176,7 @@ export var DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(in
|
|
|
166
176
|
timezone: timezone
|
|
167
177
|
});
|
|
168
178
|
var handleValueChange = useEventCallback(function (newValue) {
|
|
169
|
-
return handleRawValueChange(newValue, 'finish');
|
|
179
|
+
return handleRawValueChange(newValue, 'finish', 'hours');
|
|
170
180
|
});
|
|
171
181
|
var _useViews = useViews({
|
|
172
182
|
view: inView,
|
|
@@ -9,6 +9,18 @@ export var MuiPickersAdapterContext = /*#__PURE__*/React.createContext(null);
|
|
|
9
9
|
if (process.env.NODE_ENV !== 'production') {
|
|
10
10
|
MuiPickersAdapterContext.displayName = 'MuiPickersAdapterContext';
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Demos:
|
|
14
|
+
*
|
|
15
|
+
* - [Date format and localization](https://mui.com/x/react-date-pickers/adapters-locale/)
|
|
16
|
+
* - [Calendar systems](https://mui.com/x/react-date-pickers/calendar-systems/)
|
|
17
|
+
* - [Translated components](https://mui.com/x/react-date-pickers/localization/)
|
|
18
|
+
* - [UTC and timezones](https://mui.com/x/react-date-pickers/timezone/)
|
|
19
|
+
*
|
|
20
|
+
* API:
|
|
21
|
+
*
|
|
22
|
+
* - [LocalizationProvider API](https://mui.com/x/api/date-pickers/localization-provider/)
|
|
23
|
+
*/
|
|
12
24
|
export var LocalizationProvider = function LocalizationProvider(inProps) {
|
|
13
25
|
var _React$useContext;
|
|
14
26
|
var inLocaleText = inProps.localeText,
|
|
@@ -11,6 +11,16 @@ import { extractValidationProps } from '../internals/utils/validation/extractVal
|
|
|
11
11
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
12
12
|
import { renderDateViewCalendar } from '../dateViewRenderers';
|
|
13
13
|
import { resolveDateFormat } from '../internals/utils/date-utils';
|
|
14
|
+
/**
|
|
15
|
+
* Demos:
|
|
16
|
+
*
|
|
17
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
18
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
19
|
+
*
|
|
20
|
+
* API:
|
|
21
|
+
*
|
|
22
|
+
* - [MobileDatePicker API](https://mui.com/x/api/date-pickers/mobile-date-picker/)
|
|
23
|
+
*/
|
|
14
24
|
var MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker(inProps, ref) {
|
|
15
25
|
var _defaultizedProps$slo2, _props$localeText$ope, _props$localeText;
|
|
16
26
|
var localeText = useLocaleText();
|
|
@@ -13,6 +13,16 @@ import { extractValidationProps } from '../internals/utils/validation/extractVal
|
|
|
13
13
|
import { renderDateViewCalendar } from '../dateViewRenderers';
|
|
14
14
|
import { renderTimeViewClock } from '../timeViewRenderers';
|
|
15
15
|
import { resolveDateTimeFormat } from '../internals/utils/date-time-utils';
|
|
16
|
+
/**
|
|
17
|
+
* Demos:
|
|
18
|
+
*
|
|
19
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
20
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
21
|
+
*
|
|
22
|
+
* API:
|
|
23
|
+
*
|
|
24
|
+
* - [MobileDateTimePicker API](https://mui.com/x/api/date-pickers/mobile-date-time-picker/)
|
|
25
|
+
*/
|
|
16
26
|
var MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTimePicker(inProps, ref) {
|
|
17
27
|
var _defaultizedProps$amp, _defaultizedProps$slo2, _defaultizedProps$slo3, _props$localeText$ope, _props$localeText;
|
|
18
28
|
var localeText = useLocaleText();
|
|
@@ -12,6 +12,16 @@ import { useMobilePicker } from '../internals/hooks/useMobilePicker';
|
|
|
12
12
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
13
13
|
import { renderTimeViewClock } from '../timeViewRenderers';
|
|
14
14
|
import { resolveTimeFormat } from '../internals/utils/time-utils';
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
19
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [MobileTimePicker API](https://mui.com/x/api/date-pickers/mobile-time-picker/)
|
|
24
|
+
*/
|
|
15
25
|
var MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker(inProps, ref) {
|
|
16
26
|
var _defaultizedProps$amp, _defaultizedProps$slo2, _props$localeText$ope, _props$localeText;
|
|
17
27
|
var localeText = useLocaleText();
|
|
@@ -45,6 +45,16 @@ var MultiSectionDigitalClockRoot = styled(PickerViewRoot, {
|
|
|
45
45
|
borderBottom: "1px solid ".concat((theme.vars || theme).palette.divider)
|
|
46
46
|
};
|
|
47
47
|
});
|
|
48
|
+
/**
|
|
49
|
+
* Demos:
|
|
50
|
+
*
|
|
51
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
52
|
+
* - [DigitalClock](https://mui.com/x/react-date-pickers/digital-clock/)
|
|
53
|
+
*
|
|
54
|
+
* API:
|
|
55
|
+
*
|
|
56
|
+
* - [MultiSectionDigitalClock API](https://mui.com/x/api/date-pickers/multi-section-digital-clock/)
|
|
57
|
+
*/
|
|
48
58
|
export var MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function MultiSectionDigitalClock(inProps, ref) {
|
|
49
59
|
var utils = useUtils();
|
|
50
60
|
var props = useThemeProps({
|
|
@@ -7,6 +7,16 @@ import Button from '@mui/material/Button';
|
|
|
7
7
|
import DialogActions from '@mui/material/DialogActions';
|
|
8
8
|
import { useLocaleText } from '../internals/hooks/useUtils';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
/**
|
|
11
|
+
* Demos:
|
|
12
|
+
*
|
|
13
|
+
* - [Custom slots and subcomponents](https://mui.com/x/react-date-pickers/custom-components/)
|
|
14
|
+
* - [Custom layout](https://mui.com/x/react-date-pickers/custom-layout/)
|
|
15
|
+
*
|
|
16
|
+
* API:
|
|
17
|
+
*
|
|
18
|
+
* - [PickersActionBar API](https://mui.com/x/api/date-pickers/pickers-action-bar/)
|
|
19
|
+
*/
|
|
10
20
|
function PickersActionBar(props) {
|
|
11
21
|
var onAccept = props.onAccept,
|
|
12
22
|
onClear = props.onClear,
|
|
@@ -104,6 +104,17 @@ var PickersCalendarHeaderSwitchViewIcon = styled(ArrowDropDownIcon, {
|
|
|
104
104
|
transform: 'rotate(0deg)'
|
|
105
105
|
};
|
|
106
106
|
});
|
|
107
|
+
/**
|
|
108
|
+
* Demos:
|
|
109
|
+
*
|
|
110
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
111
|
+
* - [DateRangeCalendar](https://mui.com/x/react-date-pickers/date-range-calendar/)
|
|
112
|
+
* - [Custom slots and subcomponents](https://mui.com/x/react-date-pickers/custom-components/)
|
|
113
|
+
*
|
|
114
|
+
* API:
|
|
115
|
+
*
|
|
116
|
+
* - [PickersCalendarHeader API](https://mui.com/x/api/date-pickers/pickers-calendar-header/)
|
|
117
|
+
*/
|
|
107
118
|
var PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalendarHeader(inProps, ref) {
|
|
108
119
|
var _slots$switchViewButt, _slots$switchViewIcon;
|
|
109
120
|
var localeText = useLocaleText();
|
|
@@ -358,11 +358,9 @@ process.env.NODE_ENV !== "production" ? PickersDayRaw.propTypes = {
|
|
|
358
358
|
} : void 0;
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
|
-
*
|
|
362
361
|
* Demos:
|
|
363
362
|
*
|
|
364
|
-
* - [
|
|
365
|
-
*
|
|
363
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
366
364
|
* API:
|
|
367
365
|
*
|
|
368
366
|
* - [PickersDay API](https://mui.com/x/api/date-pickers/pickers-day/)
|
|
@@ -72,6 +72,16 @@ export var PickersLayoutContentWrapper = styled('div', {
|
|
|
72
72
|
display: 'flex',
|
|
73
73
|
flexDirection: 'column'
|
|
74
74
|
});
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Demos:
|
|
78
|
+
*
|
|
79
|
+
* - [Custom layout](https://mui.com/x/react-date-pickers/custom-layout/)
|
|
80
|
+
*
|
|
81
|
+
* API:
|
|
82
|
+
*
|
|
83
|
+
* - [PickersLayout API](https://mui.com/x/api/date-pickers/pickers-layout/)
|
|
84
|
+
*/
|
|
75
85
|
var PickersLayout = function PickersLayout(inProps) {
|
|
76
86
|
var props = useThemeProps({
|
|
77
87
|
props: inProps,
|
|
@@ -10,6 +10,15 @@ import ListItem from '@mui/material/ListItem';
|
|
|
10
10
|
import Chip from '@mui/material/Chip';
|
|
11
11
|
import { VIEW_HEIGHT } from '../internals/constants/dimensions';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
* Demos:
|
|
15
|
+
*
|
|
16
|
+
* - [Shortcuts](https://mui.com/x/react-date-pickers/shortcuts/)
|
|
17
|
+
*
|
|
18
|
+
* API:
|
|
19
|
+
*
|
|
20
|
+
* - [PickersShortcuts API](https://mui.com/x/api/date-pickers/pickers-shortcuts/)
|
|
21
|
+
*/
|
|
13
22
|
function PickersShortcuts(props) {
|
|
14
23
|
var items = props.items,
|
|
15
24
|
changeImportance = props.changeImportance,
|
|
@@ -6,6 +6,16 @@ import { renderDateViewCalendar } from '../dateViewRenderers';
|
|
|
6
6
|
import { useStaticPicker } from '../internals/hooks/useStaticPicker';
|
|
7
7
|
import { validateDate } from '../internals';
|
|
8
8
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
9
|
+
/**
|
|
10
|
+
* Demos:
|
|
11
|
+
*
|
|
12
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
13
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
14
|
+
*
|
|
15
|
+
* API:
|
|
16
|
+
*
|
|
17
|
+
* - [StaticDatePicker API](https://mui.com/x/api/date-pickers/static-date-picker/)
|
|
18
|
+
*/
|
|
9
19
|
var StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDatePicker(inProps, ref) {
|
|
10
20
|
var _defaultizedProps$dis, _defaultizedProps$yea, _defaultizedProps$slo;
|
|
11
21
|
var defaultizedProps = useDatePickerDefaultizedProps(inProps, 'MuiStaticDatePicker');
|
|
@@ -7,6 +7,16 @@ import { renderDateViewCalendar } from '../dateViewRenderers';
|
|
|
7
7
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
8
8
|
import { useStaticPicker } from '../internals/hooks/useStaticPicker';
|
|
9
9
|
import { validateDateTime } from '../internals/utils/validation/validateDateTime';
|
|
10
|
+
/**
|
|
11
|
+
* Demos:
|
|
12
|
+
*
|
|
13
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
14
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
15
|
+
*
|
|
16
|
+
* API:
|
|
17
|
+
*
|
|
18
|
+
* - [StaticDateTimePicker API](https://mui.com/x/api/date-pickers/static-date-time-picker/)
|
|
19
|
+
*/
|
|
10
20
|
var StaticDateTimePicker = /*#__PURE__*/React.forwardRef(function StaticDateTimePicker(inProps, ref) {
|
|
11
21
|
var _defaultizedProps$dis, _defaultizedProps$amp, _defaultizedProps$yea, _defaultizedProps$slo, _defaultizedProps$slo2;
|
|
12
22
|
var defaultizedProps = useDateTimePickerDefaultizedProps(inProps, 'MuiStaticDateTimePicker');
|
|
@@ -6,6 +6,16 @@ import { renderTimeViewClock } from '../timeViewRenderers';
|
|
|
6
6
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
7
7
|
import { useStaticPicker } from '../internals/hooks/useStaticPicker';
|
|
8
8
|
import { validateTime } from '../internals/utils/validation/validateTime';
|
|
9
|
+
/**
|
|
10
|
+
* Demos:
|
|
11
|
+
*
|
|
12
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
13
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
14
|
+
*
|
|
15
|
+
* API:
|
|
16
|
+
*
|
|
17
|
+
* - [StaticTimePicker API](https://mui.com/x/api/date-pickers/static-time-picker/)
|
|
18
|
+
*/
|
|
9
19
|
var StaticTimePicker = /*#__PURE__*/React.forwardRef(function StaticTimePicker(inProps, ref) {
|
|
10
20
|
var _defaultizedProps$dis, _defaultizedProps$amp, _defaultizedProps$slo;
|
|
11
21
|
var defaultizedProps = useTimePickerDefaultizedProps(inProps, 'MuiStaticTimePicker');
|
|
@@ -54,6 +54,10 @@ var TimeClockArrowSwitcher = styled(PickersArrowSwitcher, {
|
|
|
54
54
|
var TIME_CLOCK_DEFAULT_VIEWS = ['hours', 'minutes'];
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
+
* Demos:
|
|
58
|
+
*
|
|
59
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
60
|
+
* - [TimeClock](https://mui.com/x/react-date-pickers/time-clock/)
|
|
57
61
|
*
|
|
58
62
|
* API:
|
|
59
63
|
*
|
|
@@ -12,6 +12,16 @@ import { refType } from '@mui/utils';
|
|
|
12
12
|
import { useTimeField } from './useTimeField';
|
|
13
13
|
import { useClearableField } from '../hooks';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [TimeField](http://mui.com/x/react-date-pickers/time-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [TimeField API](https://mui.com/x/api/date-pickers/time-field/)
|
|
24
|
+
*/
|
|
15
25
|
var TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, ref) {
|
|
16
26
|
var _ref, _slots$textField, _slotProps$textField;
|
|
17
27
|
var themeProps = useThemeProps({
|
|
@@ -101,7 +111,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
101
111
|
/**
|
|
102
112
|
* The color of the component.
|
|
103
113
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
104
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
114
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
105
115
|
* @default 'primary'
|
|
106
116
|
*/
|
|
107
117
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
@@ -10,6 +10,16 @@ import { DesktopTimePicker } from '../DesktopTimePicker';
|
|
|
10
10
|
import { MobileTimePicker } from '../MobileTimePicker';
|
|
11
11
|
import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
* Demos:
|
|
15
|
+
*
|
|
16
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
17
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [TimePicker API](https://mui.com/x/api/date-pickers/time-picker/)
|
|
22
|
+
*/
|
|
13
23
|
var TimePicker = /*#__PURE__*/React.forwardRef(function TimePicker(inProps, ref) {
|
|
14
24
|
var props = useThemeProps({
|
|
15
25
|
props: inProps,
|
|
@@ -107,6 +107,17 @@ TimePickerToolbarAmPmSelection.propTypes = {
|
|
|
107
107
|
ownerState: PropTypes.object.isRequired,
|
|
108
108
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
109
109
|
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Demos:
|
|
113
|
+
*
|
|
114
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
115
|
+
* - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)
|
|
116
|
+
*
|
|
117
|
+
* API:
|
|
118
|
+
*
|
|
119
|
+
* - [TimePickerToolbar API](https://mui.com/x/api/date-pickers/time-picker-toolbar/)
|
|
120
|
+
*/
|
|
110
121
|
function TimePickerToolbar(inProps) {
|
|
111
122
|
var props = useThemeProps({
|
|
112
123
|
props: inProps,
|
|
@@ -4,10 +4,13 @@ import * as React from 'react';
|
|
|
4
4
|
import Divider from '@mui/material/Divider';
|
|
5
5
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
6
6
|
import { DateCalendar } from '../DateCalendar';
|
|
7
|
-
import {
|
|
7
|
+
import { multiSectionDigitalClockSectionClasses } from '../MultiSectionDigitalClock';
|
|
8
8
|
import { DateTimeViewWrapper } from '../internals/components/DateTimeViewWrapper';
|
|
9
9
|
import { isInternalTimeView } from '../internals/utils/time-utils';
|
|
10
10
|
import { isDatePickerView } from '../internals/utils/date-utils';
|
|
11
|
+
import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from '../timeViewRenderers';
|
|
12
|
+
import { digitalClockClasses } from '../DigitalClock';
|
|
13
|
+
import { VIEW_HEIGHT } from '../internals/constants/dimensions';
|
|
11
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
16
|
export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref) {
|
|
@@ -61,8 +64,41 @@ export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref)
|
|
|
61
64
|
disableIgnoringDatePartForTimeValidation = _ref.disableIgnoringDatePartForTimeValidation,
|
|
62
65
|
timeSteps = _ref.timeSteps,
|
|
63
66
|
skipDisabled = _ref.skipDisabled,
|
|
64
|
-
timeViewsCount = _ref.timeViewsCount
|
|
67
|
+
timeViewsCount = _ref.timeViewsCount,
|
|
68
|
+
shouldRenderTimeInASingleColumn = _ref.shouldRenderTimeInASingleColumn;
|
|
65
69
|
var isActionBarVisible = !!((_resolveComponentProp = resolveComponentProps((_slotProps$actionBar = slotProps == null ? void 0 : slotProps.actionBar) != null ? _slotProps$actionBar : componentsProps == null ? void 0 : componentsProps.actionBar, {})) != null && (_resolveComponentProp = _resolveComponentProp.actions) != null && _resolveComponentProp.length);
|
|
70
|
+
var commonTimeProps = {
|
|
71
|
+
view: isInternalTimeView(view) ? view : 'hours',
|
|
72
|
+
onViewChange: onViewChange,
|
|
73
|
+
focusedView: focusedView && isInternalTimeView(focusedView) ? focusedView : null,
|
|
74
|
+
onFocusedViewChange: onFocusedViewChange,
|
|
75
|
+
views: views.filter(isInternalTimeView),
|
|
76
|
+
value: value,
|
|
77
|
+
defaultValue: defaultValue,
|
|
78
|
+
referenceDate: referenceDate,
|
|
79
|
+
onChange: onChange,
|
|
80
|
+
className: className,
|
|
81
|
+
classes: classes,
|
|
82
|
+
disableFuture: disableFuture,
|
|
83
|
+
disablePast: disablePast,
|
|
84
|
+
minTime: minTime,
|
|
85
|
+
maxTime: maxTime,
|
|
86
|
+
shouldDisableTime: shouldDisableTime,
|
|
87
|
+
shouldDisableClock: shouldDisableClock,
|
|
88
|
+
minutesStep: minutesStep,
|
|
89
|
+
ampm: ampm,
|
|
90
|
+
components: components,
|
|
91
|
+
componentsProps: componentsProps,
|
|
92
|
+
slots: slots,
|
|
93
|
+
slotProps: slotProps,
|
|
94
|
+
readOnly: readOnly,
|
|
95
|
+
disabled: disabled,
|
|
96
|
+
autoFocus: autoFocus,
|
|
97
|
+
disableIgnoringDatePartForTimeValidation: disableIgnoringDatePartForTimeValidation,
|
|
98
|
+
timeSteps: timeSteps,
|
|
99
|
+
skipDisabled: skipDisabled,
|
|
100
|
+
timezone: timezone
|
|
101
|
+
};
|
|
66
102
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
67
103
|
children: [/*#__PURE__*/_jsxs(DateTimeViewWrapper, {
|
|
68
104
|
children: [/*#__PURE__*/_jsx(DateCalendar, {
|
|
@@ -109,44 +145,26 @@ export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref)
|
|
|
109
145
|
}), timeViewsCount > 0 && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
110
146
|
children: [/*#__PURE__*/_jsx(Divider, {
|
|
111
147
|
orientation: "vertical"
|
|
112
|
-
}),
|
|
148
|
+
}), shouldRenderTimeInASingleColumn ? renderDigitalClockTimeView(_extends({}, commonTimeProps, {
|
|
149
|
+
view: 'hours',
|
|
150
|
+
views: ['hours'],
|
|
151
|
+
focusedView: focusedView && isInternalTimeView(focusedView) ? 'hours' : null,
|
|
152
|
+
sx: _extends(_defineProperty({
|
|
153
|
+
width: 'auto'
|
|
154
|
+
}, "&.".concat(digitalClockClasses.root), {
|
|
155
|
+
maxHeight: VIEW_HEIGHT
|
|
156
|
+
}), Array.isArray(sx) ? sx : [sx])
|
|
157
|
+
})) : renderMultiSectionDigitalClockTimeView(_extends({}, commonTimeProps, {
|
|
113
158
|
view: isInternalTimeView(view) ? view : 'hours',
|
|
114
|
-
onViewChange: onViewChange,
|
|
115
|
-
focusedView: focusedView && isInternalTimeView(focusedView) ? focusedView : null,
|
|
116
|
-
onFocusedViewChange: onFocusedViewChange,
|
|
117
159
|
views: views.filter(isInternalTimeView),
|
|
118
|
-
|
|
119
|
-
defaultValue: defaultValue,
|
|
120
|
-
referenceDate: referenceDate,
|
|
121
|
-
onChange: onChange,
|
|
122
|
-
className: className,
|
|
123
|
-
classes: classes,
|
|
124
|
-
disableFuture: disableFuture,
|
|
125
|
-
disablePast: disablePast,
|
|
126
|
-
minTime: minTime,
|
|
127
|
-
maxTime: maxTime,
|
|
128
|
-
shouldDisableTime: shouldDisableTime,
|
|
129
|
-
shouldDisableClock: shouldDisableClock,
|
|
130
|
-
minutesStep: minutesStep,
|
|
131
|
-
ampm: ampm,
|
|
132
|
-
components: components,
|
|
133
|
-
componentsProps: componentsProps,
|
|
134
|
-
slots: slots,
|
|
135
|
-
slotProps: slotProps,
|
|
136
|
-
readOnly: readOnly,
|
|
137
|
-
disabled: disabled,
|
|
160
|
+
focusedView: focusedView && isInternalTimeView(focusedView) ? focusedView : null,
|
|
138
161
|
sx: _extends(_defineProperty({
|
|
139
162
|
borderBottom: 0,
|
|
140
163
|
width: 'auto'
|
|
141
164
|
}, ".".concat(multiSectionDigitalClockSectionClasses.root), {
|
|
142
165
|
maxHeight: '100%'
|
|
143
|
-
}), Array.isArray(sx) ? sx : [sx])
|
|
144
|
-
|
|
145
|
-
disableIgnoringDatePartForTimeValidation: disableIgnoringDatePartForTimeValidation,
|
|
146
|
-
timeSteps: timeSteps,
|
|
147
|
-
skipDisabled: skipDisabled,
|
|
148
|
-
timezone: timezone
|
|
149
|
-
})]
|
|
166
|
+
}), Array.isArray(sx) ? sx : [sx])
|
|
167
|
+
}))]
|
|
150
168
|
})]
|
|
151
169
|
}), isActionBarVisible && /*#__PURE__*/_jsx(Divider, {})]
|
|
152
170
|
});
|
package/legacy/index.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["before", "after"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import Stack from '@mui/material/Stack';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
export var FakeTextField = /*#__PURE__*/React.forwardRef(function FakeTextField(props, ref) {
|
|
9
|
+
var elements = props.elements;
|
|
10
|
+
return /*#__PURE__*/_jsx(Stack, {
|
|
11
|
+
direction: "row",
|
|
12
|
+
spacing: 1,
|
|
13
|
+
ref: ref,
|
|
14
|
+
children: elements.map(function (_ref, elementIndex) {
|
|
15
|
+
var before = _ref.before,
|
|
16
|
+
after = _ref.after,
|
|
17
|
+
otherElementProps = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
19
|
+
children: [before, /*#__PURE__*/_jsx("input", _extends({}, otherElementProps)), after]
|
|
20
|
+
}, elementIndex);
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FakeTextField } from './FakeTextField';
|