@mui/x-date-pickers-pro 7.0.0-beta.1 → 7.0.0-beta.4
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 +437 -4
- package/DateRangeCalendar/DateRangeCalendar.d.ts +2 -1
- package/DateRangeCalendar/DateRangeCalendar.js +9 -7
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +10 -7
- package/DateRangeCalendar/useDragRange.d.ts +4 -4
- package/DateRangePicker/DateRangePicker.d.ts +2 -1
- package/DateRangePicker/DateRangePicker.js +14 -14
- package/DateRangePicker/DateRangePicker.types.d.ts +5 -4
- package/DateRangePicker/DateRangePickerToolbar.d.ts +6 -2
- package/DateRangePicker/DateRangePickerToolbar.js +7 -1
- package/DateRangePicker/shared.d.ts +6 -5
- package/DateRangePickerDay/DateRangePickerDay.d.ts +3 -2
- package/DateRangePickerDay/DateRangePickerDay.js +2 -2
- package/DateTimeRangePicker/DateTimeRangePicker.d.ts +2 -1
- package/DateTimeRangePicker/DateTimeRangePicker.js +20 -21
- package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +5 -4
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +7 -1
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +3 -2
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +6 -2
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -1
- package/DateTimeRangePicker/shared.d.ts +6 -5
- package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +2 -1
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +14 -14
- package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +5 -4
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +2 -1
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -21
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +5 -4
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.d.ts +2 -1
- package/MobileDateRangePicker/MobileDateRangePicker.d.ts +2 -1
- package/MobileDateRangePicker/MobileDateRangePicker.js +14 -14
- package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +5 -4
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +2 -1
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -21
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +5 -4
- package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +2 -1
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +22 -24
- package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +12 -14
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +2 -1
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +26 -28
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +13 -16
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +2 -1
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +22 -24
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +13 -16
- package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +3 -2
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +17 -15
- package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +11 -13
- package/SingleInputDateRangeField/index.d.ts +1 -1
- package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +3 -3
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -15
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +3 -2
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +21 -19
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +12 -14
- package/SingleInputDateTimeRangeField/index.d.ts +1 -1
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +3 -3
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -20
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +3 -2
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +16 -14
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +12 -14
- package/SingleInputTimeRangeField/index.d.ts +1 -1
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +3 -3
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -14
- package/StaticDateRangePicker/StaticDateRangePicker.d.ts +2 -1
- package/StaticDateRangePicker/StaticDateRangePicker.js +5 -6
- package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +4 -3
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +3 -2
- package/index.d.ts +7 -2
- package/index.js +8 -2
- package/internals/hooks/models/useRangePicker.d.ts +8 -7
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +2 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +17 -8
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +7 -6
- package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +15 -15
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +37 -40
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +2 -1
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +18 -9
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +7 -6
- package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +21 -0
- package/internals/hooks/useMultiInputFieldSelectedSections.js +43 -0
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +2 -1
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +17 -12
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +3 -3
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +23 -31
- package/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +4 -4
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +3 -3
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +23 -25
- package/internals/hooks/useRangePosition.d.ts +2 -4
- package/internals/hooks/useRangePosition.js +3 -6
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +2 -1
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -0
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +6 -6
- package/internals/models/dateRange.d.ts +5 -16
- package/internals/models/dateTimeRange.d.ts +5 -6
- package/internals/models/index.d.ts +0 -1
- package/internals/models/index.js +0 -1
- package/internals/models/timeRange.d.ts +4 -6
- package/internals/utils/date-fields-utils.d.ts +1 -5
- package/internals/utils/date-range-manager.d.ts +5 -5
- package/internals/utils/date-utils.d.ts +5 -5
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/validation/validateDateRange.d.ts +2 -2
- package/internals/utils/validation/validateDateTimeRange.d.ts +2 -2
- package/internals/utils/valueManagers.d.ts +3 -3
- package/internals/utils/valueManagers.js +11 -6
- package/models/fields.d.ts +69 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +1 -0
- package/models/range.d.ts +3 -2
- package/modern/DateRangeCalendar/DateRangeCalendar.js +9 -7
- package/modern/DateRangePicker/DateRangePicker.js +14 -14
- package/modern/DateRangePicker/DateRangePickerToolbar.js +7 -1
- package/modern/DateRangePickerDay/DateRangePickerDay.js +2 -2
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +20 -21
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +7 -1
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -1
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +14 -14
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -21
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +14 -14
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -21
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +22 -24
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +26 -28
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +22 -24
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +17 -15
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -14
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +21 -19
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -19
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +16 -14
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -13
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +5 -6
- package/modern/index.js +8 -2
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +17 -8
- package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +34 -37
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +18 -9
- package/modern/internals/hooks/useMultiInputFieldSelectedSections.js +40 -0
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +17 -12
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +23 -30
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +23 -24
- package/modern/internals/hooks/useRangePosition.js +3 -6
- package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -0
- package/modern/internals/models/index.js +0 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/internals/utils/valueManagers.js +11 -6
- package/modern/models/index.js +1 -0
- package/node/DateRangeCalendar/DateRangeCalendar.js +10 -8
- package/node/DateRangePicker/DateRangePicker.js +14 -14
- package/node/DateRangePicker/DateRangePickerToolbar.js +7 -1
- package/node/DateRangePickerDay/DateRangePickerDay.js +3 -3
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +20 -21
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +7 -1
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +7 -1
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +14 -14
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -21
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +14 -14
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +22 -23
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +22 -24
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +26 -28
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +22 -24
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +17 -15
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +2 -16
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +24 -22
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +2 -21
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +16 -14
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +2 -15
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +5 -6
- package/node/index.js +18 -9
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +18 -9
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +33 -36
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +19 -10
- package/node/internals/hooks/useMultiInputFieldSelectedSections.js +50 -0
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +16 -11
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +23 -31
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +23 -25
- package/node/internals/hooks/useRangePosition.js +3 -8
- package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +1 -0
- package/node/internals/models/index.js +0 -11
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/internals/utils/valueManagers.js +10 -5
- package/node/models/index.js +11 -0
- package/package.json +6 -6
- package/themeAugmentation/props.d.ts +17 -17
- package/internals/models/fields.d.ts +0 -49
- package/legacy/AdapterDateFns/index.js +0 -1
- package/legacy/AdapterDateFnsJalali/index.js +0 -1
- package/legacy/AdapterDateFnsV3/index.js +0 -1
- package/legacy/AdapterDayjs/index.js +0 -1
- package/legacy/AdapterLuxon/index.js +0 -1
- package/legacy/AdapterMoment/index.js +0 -1
- package/legacy/AdapterMomentHijri/index.js +0 -1
- package/legacy/AdapterMomentJalaali/index.js +0 -1
- package/legacy/DateRangeCalendar/DateRangeCalendar.js +0 -764
- package/legacy/DateRangeCalendar/DateRangeCalendar.types.js +0 -1
- package/legacy/DateRangeCalendar/dateRangeCalendarClasses.js +0 -5
- package/legacy/DateRangeCalendar/index.js +0 -2
- package/legacy/DateRangeCalendar/useDragRange.js +0 -258
- package/legacy/DateRangePicker/DateRangePicker.js +0 -334
- package/legacy/DateRangePicker/DateRangePicker.types.js +0 -1
- package/legacy/DateRangePicker/DateRangePickerToolbar.js +0 -127
- package/legacy/DateRangePicker/dateRangePickerToolbarClasses.js +0 -5
- package/legacy/DateRangePicker/index.js +0 -3
- package/legacy/DateRangePicker/shared.js +0 -33
- package/legacy/DateRangePickerDay/DateRangePickerDay.js +0 -366
- package/legacy/DateRangePickerDay/dateRangePickerDayClasses.js +0 -5
- package/legacy/DateRangePickerDay/index.js +0 -2
- package/legacy/DateTimeRangePicker/DateTimeRangePicker.js +0 -413
- package/legacy/DateTimeRangePicker/DateTimeRangePicker.types.js +0 -1
- package/legacy/DateTimeRangePicker/DateTimeRangePickerTabs.js +0 -191
- package/legacy/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +0 -57
- package/legacy/DateTimeRangePicker/DateTimeRangePickerToolbar.js +0 -184
- package/legacy/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +0 -6
- package/legacy/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +0 -5
- package/legacy/DateTimeRangePicker/index.js +0 -5
- package/legacy/DateTimeRangePicker/shared.js +0 -54
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -343
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.types.js +0 -1
- package/legacy/DesktopDateRangePicker/index.js +0 -1
- package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +0 -491
- package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +0 -1
- package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -48
- package/legacy/DesktopDateTimeRangePicker/index.js +0 -1
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +0 -339
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.types.js +0 -1
- package/legacy/MobileDateRangePicker/index.js +0 -1
- package/legacy/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +0 -484
- package/legacy/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +0 -1
- package/legacy/MobileDateTimeRangePicker/index.js +0 -1
- package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +0 -316
- package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.types.js +0 -1
- package/legacy/MultiInputDateRangeField/index.js +0 -2
- package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +0 -357
- package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js +0 -1
- package/legacy/MultiInputDateTimeRangeField/index.js +0 -2
- package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +0 -330
- package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -1
- package/legacy/MultiInputTimeRangeField/index.js +0 -2
- package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +0 -307
- package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.types.js +0 -1
- package/legacy/SingleInputDateRangeField/index.js +0 -2
- package/legacy/SingleInputDateRangeField/useSingleInputDateRangeField.js +0 -30
- package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +0 -348
- package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.js +0 -1
- package/legacy/SingleInputDateTimeRangeField/index.js +0 -2
- package/legacy/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +0 -35
- package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +0 -321
- package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.types.js +0 -1
- package/legacy/SingleInputTimeRangeField/index.js +0 -2
- package/legacy/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +0 -29
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +0 -276
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.types.js +0 -1
- package/legacy/StaticDateRangePicker/index.js +0 -1
- package/legacy/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -87
- package/legacy/dateRangeViewRenderers/index.js +0 -1
- package/legacy/index.js +0 -33
- package/legacy/internals/constants/dimensions.js +0 -5
- package/legacy/internals/hooks/models/index.js +0 -1
- package/legacy/internals/hooks/models/useRangePicker.js +0 -1
- package/legacy/internals/hooks/useDesktopRangePicker/index.js +0 -1
- package/legacy/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +0 -154
- package/legacy/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.js +0 -1
- package/legacy/internals/hooks/useEnrichedRangePickerFieldProps.js +0 -258
- package/legacy/internals/hooks/useMobileRangePicker/index.js +0 -1
- package/legacy/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +0 -144
- package/legacy/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.js +0 -1
- package/legacy/internals/hooks/useMultiInputRangeField/shared.js +0 -9
- package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -102
- package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -115
- package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -1
- package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -109
- package/legacy/internals/hooks/useRangePosition.js +0 -39
- package/legacy/internals/hooks/useStaticRangePicker/index.js +0 -1
- package/legacy/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +0 -76
- package/legacy/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.js +0 -1
- package/legacy/internals/models/dateRange.js +0 -1
- package/legacy/internals/models/dateTimeRange.js +0 -1
- package/legacy/internals/models/index.js +0 -5
- package/legacy/internals/models/rangePickerProps.js +0 -1
- package/legacy/internals/models/timeRange.js +0 -1
- package/legacy/internals/utils/date-fields-utils.js +0 -26
- package/legacy/internals/utils/date-range-manager.js +0 -65
- package/legacy/internals/utils/date-utils.js +0 -12
- package/legacy/internals/utils/releaseInfo.js +0 -13
- package/legacy/internals/utils/validation/validateDateRange.js +0 -45
- package/legacy/internals/utils/validation/validateDateTimeRange.js +0 -45
- package/legacy/internals/utils/validation/validateTimeRange.js +0 -32
- package/legacy/internals/utils/valueManagers.js +0 -135
- package/legacy/locales/index.js +0 -1
- package/legacy/models/index.js +0 -3
- package/legacy/models/multiInputRangeFieldClasses.js +0 -1
- package/legacy/models/range.js +0 -1
- package/legacy/models/validation.js +0 -1
- package/legacy/themeAugmentation/index.js +0 -4
- package/modern/internals/models/fields.js +0 -1
- /package/{internals/models → models}/fields.js +0 -0
- /package/{legacy/internals → modern}/models/fields.js +0 -0
- /package/node/{internals/models → models}/fields.js +0 -0
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _excluded = ["slots", "slotProps", "disabled", "autoFocus", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
import Stack from '@mui/material/Stack';
|
|
8
|
-
import MuiTextField from '@mui/material/TextField';
|
|
9
|
-
import Typography from '@mui/material/Typography';
|
|
10
|
-
import { styled, useThemeProps } from '@mui/material/styles';
|
|
11
|
-
import { useSlotProps } from '@mui/base/utils';
|
|
12
|
-
import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
13
|
-
import { splitFieldInternalAndForwardedProps, convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
14
|
-
import { useMultiInputDateRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
-
export var multiInputDateRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateRangeField', ['root', 'separator']);
|
|
18
|
-
export var getMultiInputDateRangeFieldUtilityClass = function getMultiInputDateRangeFieldUtilityClass(slot) {
|
|
19
|
-
return generateUtilityClass('MuiMultiInputDateRangeField', slot);
|
|
20
|
-
};
|
|
21
|
-
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
22
|
-
var classes = ownerState.classes;
|
|
23
|
-
var slots = {
|
|
24
|
-
root: ['root'],
|
|
25
|
-
separator: ['separator']
|
|
26
|
-
};
|
|
27
|
-
return composeClasses(slots, getMultiInputDateRangeFieldUtilityClass, classes);
|
|
28
|
-
};
|
|
29
|
-
var MultiInputDateRangeFieldRoot = styled( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
30
|
-
return /*#__PURE__*/_jsx(Stack, _extends({
|
|
31
|
-
ref: ref,
|
|
32
|
-
spacing: 2,
|
|
33
|
-
direction: "row",
|
|
34
|
-
alignItems: "baseline"
|
|
35
|
-
}, props));
|
|
36
|
-
}), {
|
|
37
|
-
name: 'MuiMultiInputDateRangeField',
|
|
38
|
-
slot: 'Root',
|
|
39
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
40
|
-
return styles.root;
|
|
41
|
-
}
|
|
42
|
-
})({});
|
|
43
|
-
var MultiInputDateRangeFieldSeparator = styled(function (props) {
|
|
44
|
-
var _props$children;
|
|
45
|
-
return /*#__PURE__*/_jsx(Typography, _extends({}, props, {
|
|
46
|
-
children: (_props$children = props.children) != null ? _props$children : ' – '
|
|
47
|
-
}));
|
|
48
|
-
}, {
|
|
49
|
-
name: 'MuiMultiInputDateRangeField',
|
|
50
|
-
slot: 'Separator',
|
|
51
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
52
|
-
return styles.separator;
|
|
53
|
-
}
|
|
54
|
-
})({});
|
|
55
|
-
/**
|
|
56
|
-
* Demos:
|
|
57
|
-
*
|
|
58
|
-
* - [DateRangeField](http://mui.com/x/react-date-pickers/date-range-field/)
|
|
59
|
-
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
60
|
-
*
|
|
61
|
-
* API:
|
|
62
|
-
*
|
|
63
|
-
* - [MultiInputDateRangeField API](https://mui.com/x/api/multi-input-date-range-field/)
|
|
64
|
-
*/
|
|
65
|
-
var MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInputDateRangeField(inProps, ref) {
|
|
66
|
-
var _slots$root, _slots$textField, _slots$separator;
|
|
67
|
-
var themeProps = useThemeProps({
|
|
68
|
-
props: inProps,
|
|
69
|
-
name: 'MuiMultiInputDateRangeField'
|
|
70
|
-
});
|
|
71
|
-
var _splitFieldInternalAn = splitFieldInternalAndForwardedProps(themeProps, 'date'),
|
|
72
|
-
dateFieldInternalProps = _splitFieldInternalAn.internalProps,
|
|
73
|
-
forwardedProps = _splitFieldInternalAn.forwardedProps;
|
|
74
|
-
var slots = forwardedProps.slots,
|
|
75
|
-
slotProps = forwardedProps.slotProps,
|
|
76
|
-
disabled = forwardedProps.disabled,
|
|
77
|
-
autoFocus = forwardedProps.autoFocus,
|
|
78
|
-
unstableStartFieldRef = forwardedProps.unstableStartFieldRef,
|
|
79
|
-
unstableEndFieldRef = forwardedProps.unstableEndFieldRef,
|
|
80
|
-
className = forwardedProps.className,
|
|
81
|
-
otherForwardedProps = _objectWithoutProperties(forwardedProps, _excluded);
|
|
82
|
-
var ownerState = themeProps;
|
|
83
|
-
var classes = useUtilityClasses(ownerState);
|
|
84
|
-
var Root = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : MultiInputDateRangeFieldRoot;
|
|
85
|
-
var rootProps = useSlotProps({
|
|
86
|
-
elementType: Root,
|
|
87
|
-
externalSlotProps: slotProps == null ? void 0 : slotProps.root,
|
|
88
|
-
externalForwardedProps: otherForwardedProps,
|
|
89
|
-
additionalProps: {
|
|
90
|
-
ref: ref
|
|
91
|
-
},
|
|
92
|
-
ownerState: ownerState,
|
|
93
|
-
className: clsx(className, classes.root)
|
|
94
|
-
});
|
|
95
|
-
var TextField = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : MuiTextField;
|
|
96
|
-
var startTextFieldProps = useSlotProps({
|
|
97
|
-
elementType: TextField,
|
|
98
|
-
externalSlotProps: slotProps == null ? void 0 : slotProps.textField,
|
|
99
|
-
additionalProps: {
|
|
100
|
-
autoFocus: autoFocus
|
|
101
|
-
},
|
|
102
|
-
ownerState: _extends({}, ownerState, {
|
|
103
|
-
position: 'start'
|
|
104
|
-
})
|
|
105
|
-
});
|
|
106
|
-
var endTextFieldProps = useSlotProps({
|
|
107
|
-
elementType: TextField,
|
|
108
|
-
externalSlotProps: slotProps == null ? void 0 : slotProps.textField,
|
|
109
|
-
ownerState: _extends({}, ownerState, {
|
|
110
|
-
position: 'end'
|
|
111
|
-
})
|
|
112
|
-
});
|
|
113
|
-
var Separator = (_slots$separator = slots == null ? void 0 : slots.separator) != null ? _slots$separator : MultiInputDateRangeFieldSeparator;
|
|
114
|
-
var separatorProps = useSlotProps({
|
|
115
|
-
elementType: Separator,
|
|
116
|
-
externalSlotProps: slotProps == null ? void 0 : slotProps.separator,
|
|
117
|
-
ownerState: ownerState,
|
|
118
|
-
className: classes.separator
|
|
119
|
-
});
|
|
120
|
-
var fieldResponse = useMultiInputDateRangeField({
|
|
121
|
-
sharedProps: _extends({}, dateFieldInternalProps, {
|
|
122
|
-
disabled: disabled
|
|
123
|
-
}),
|
|
124
|
-
startTextFieldProps: startTextFieldProps,
|
|
125
|
-
endTextFieldProps: endTextFieldProps,
|
|
126
|
-
unstableStartFieldRef: unstableStartFieldRef,
|
|
127
|
-
unstableEndFieldRef: unstableEndFieldRef
|
|
128
|
-
});
|
|
129
|
-
var startDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.startDate);
|
|
130
|
-
var endDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.endDate);
|
|
131
|
-
return /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
132
|
-
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
133
|
-
fullWidth: true
|
|
134
|
-
}, startDateProps)), /*#__PURE__*/_jsx(Separator, _extends({}, separatorProps)), /*#__PURE__*/_jsx(TextField, _extends({
|
|
135
|
-
fullWidth: true
|
|
136
|
-
}, endDateProps))]
|
|
137
|
-
}));
|
|
138
|
-
});
|
|
139
|
-
process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
140
|
-
// ----------------------------- Warning --------------------------------
|
|
141
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
142
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
143
|
-
// ----------------------------------------------------------------------
|
|
144
|
-
autoFocus: PropTypes.bool,
|
|
145
|
-
/**
|
|
146
|
-
* Override or extend the styles applied to the component.
|
|
147
|
-
*/
|
|
148
|
-
classes: PropTypes.object,
|
|
149
|
-
className: PropTypes.string,
|
|
150
|
-
component: PropTypes.elementType,
|
|
151
|
-
/**
|
|
152
|
-
* The default value. Use when the component is not controlled.
|
|
153
|
-
*/
|
|
154
|
-
defaultValue: PropTypes.arrayOf(PropTypes.any),
|
|
155
|
-
/**
|
|
156
|
-
* Defines the `flex-direction` style property.
|
|
157
|
-
* It is applied for all screen sizes.
|
|
158
|
-
* @default 'column'
|
|
159
|
-
*/
|
|
160
|
-
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
161
|
-
/**
|
|
162
|
-
* If `true`, the component is disabled.
|
|
163
|
-
* @default false
|
|
164
|
-
*/
|
|
165
|
-
disabled: PropTypes.bool,
|
|
166
|
-
/**
|
|
167
|
-
* If `true`, disable values after the current date for date components, time for time components and both for date time components.
|
|
168
|
-
* @default false
|
|
169
|
-
*/
|
|
170
|
-
disableFuture: PropTypes.bool,
|
|
171
|
-
/**
|
|
172
|
-
* If `true`, disable values before the current date for date components, time for time components and both for date time components.
|
|
173
|
-
* @default false
|
|
174
|
-
*/
|
|
175
|
-
disablePast: PropTypes.bool,
|
|
176
|
-
/**
|
|
177
|
-
* Add an element between each child.
|
|
178
|
-
*/
|
|
179
|
-
divider: PropTypes.node,
|
|
180
|
-
/**
|
|
181
|
-
* Format of the date when rendered in the input(s).
|
|
182
|
-
*/
|
|
183
|
-
format: PropTypes.string,
|
|
184
|
-
/**
|
|
185
|
-
* Density of the format when rendered in the input.
|
|
186
|
-
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
187
|
-
* @default "dense"
|
|
188
|
-
*/
|
|
189
|
-
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
190
|
-
/**
|
|
191
|
-
* Maximal selectable date.
|
|
192
|
-
*/
|
|
193
|
-
maxDate: PropTypes.any,
|
|
194
|
-
/**
|
|
195
|
-
* Minimal selectable date.
|
|
196
|
-
*/
|
|
197
|
-
minDate: PropTypes.any,
|
|
198
|
-
/**
|
|
199
|
-
* Callback fired when the value changes.
|
|
200
|
-
* @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.
|
|
201
|
-
* @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
|
|
202
|
-
* @param {TValue} value The new value.
|
|
203
|
-
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
204
|
-
*/
|
|
205
|
-
onChange: PropTypes.func,
|
|
206
|
-
/**
|
|
207
|
-
* Callback fired when the error associated to the current value changes.
|
|
208
|
-
* @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.
|
|
209
|
-
* @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
|
|
210
|
-
* @param {TError} error The new error.
|
|
211
|
-
* @param {TValue} value The value associated to the error.
|
|
212
|
-
*/
|
|
213
|
-
onError: PropTypes.func,
|
|
214
|
-
/**
|
|
215
|
-
* Callback fired when the selected sections change.
|
|
216
|
-
* @param {FieldSelectedSections} newValue The new selected sections.
|
|
217
|
-
*/
|
|
218
|
-
onSelectedSectionsChange: PropTypes.func,
|
|
219
|
-
/**
|
|
220
|
-
* It prevents the user from changing the value of the field
|
|
221
|
-
* (not from interacting with the field).
|
|
222
|
-
* @default false
|
|
223
|
-
*/
|
|
224
|
-
readOnly: PropTypes.bool,
|
|
225
|
-
/**
|
|
226
|
-
* The date used to generate a part of the new value that is not present in the format when both `value` and `defaultValue` are empty.
|
|
227
|
-
* For example, on time fields it will be used to determine the date to set.
|
|
228
|
-
* @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used.
|
|
229
|
-
*/
|
|
230
|
-
referenceDate: PropTypes.any,
|
|
231
|
-
/**
|
|
232
|
-
* The currently selected sections.
|
|
233
|
-
* This prop accept four formats:
|
|
234
|
-
* 1. If a number is provided, the section at this index will be selected.
|
|
235
|
-
* 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
|
|
236
|
-
* 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
|
|
237
|
-
* 4. If `null` is provided, no section will be selected
|
|
238
|
-
* If not provided, the selected sections will be handled internally.
|
|
239
|
-
*/
|
|
240
|
-
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
241
|
-
endIndex: PropTypes.number.isRequired,
|
|
242
|
-
startIndex: PropTypes.number.isRequired
|
|
243
|
-
})]),
|
|
244
|
-
/**
|
|
245
|
-
* Disable specific date.
|
|
246
|
-
*
|
|
247
|
-
* 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.
|
|
248
|
-
*
|
|
249
|
-
* @template TDate
|
|
250
|
-
* @param {TDate} day The date to test.
|
|
251
|
-
* @param {string} position The date to test, 'start' or 'end'.
|
|
252
|
-
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
253
|
-
*/
|
|
254
|
-
shouldDisableDate: PropTypes.func,
|
|
255
|
-
/**
|
|
256
|
-
* If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
257
|
-
* If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
258
|
-
*
|
|
259
|
-
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
260
|
-
*
|
|
261
|
-
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
262
|
-
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
263
|
-
*
|
|
264
|
-
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
265
|
-
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
266
|
-
*
|
|
267
|
-
* @default `false`
|
|
268
|
-
*/
|
|
269
|
-
shouldRespectLeadingZeros: PropTypes.bool,
|
|
270
|
-
/**
|
|
271
|
-
* The props used for each component slot.
|
|
272
|
-
* @default {}
|
|
273
|
-
*/
|
|
274
|
-
slotProps: PropTypes.object,
|
|
275
|
-
/**
|
|
276
|
-
* Overridable component slots.
|
|
277
|
-
* @default {}
|
|
278
|
-
*/
|
|
279
|
-
slots: PropTypes.object,
|
|
280
|
-
/**
|
|
281
|
-
* Defines the space between immediate children.
|
|
282
|
-
* @default 0
|
|
283
|
-
*/
|
|
284
|
-
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
285
|
-
style: PropTypes.object,
|
|
286
|
-
/**
|
|
287
|
-
* The system prop, which allows defining system overrides as well as additional CSS styles.
|
|
288
|
-
*/
|
|
289
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
290
|
-
/**
|
|
291
|
-
* Choose which timezone to use for the value.
|
|
292
|
-
* Example: "default", "system", "UTC", "America/New_York".
|
|
293
|
-
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
294
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
295
|
-
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
296
|
-
*/
|
|
297
|
-
timezone: PropTypes.string,
|
|
298
|
-
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
299
|
-
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
300
|
-
/**
|
|
301
|
-
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
302
|
-
*
|
|
303
|
-
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
|
|
304
|
-
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
305
|
-
*
|
|
306
|
-
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
307
|
-
* @default false
|
|
308
|
-
*/
|
|
309
|
-
useFlexGap: PropTypes.bool,
|
|
310
|
-
/**
|
|
311
|
-
* The selected value.
|
|
312
|
-
* Used when the component is controlled.
|
|
313
|
-
*/
|
|
314
|
-
value: PropTypes.arrayOf(PropTypes.any)
|
|
315
|
-
} : void 0;
|
|
316
|
-
export { MultiInputDateRangeField };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { MultiInputDateRangeField, getMultiInputDateRangeFieldUtilityClass, multiInputDateRangeFieldClasses } from './MultiInputDateRangeField';
|
|
2
|
-
export { useMultiInputDateRangeField as unstable_useMultiInputDateRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField';
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _excluded = ["slots", "slotProps", "disabled", "autoFocus", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
import Stack from '@mui/material/Stack';
|
|
8
|
-
import MuiTextField from '@mui/material/TextField';
|
|
9
|
-
import Typography from '@mui/material/Typography';
|
|
10
|
-
import { styled, useThemeProps } from '@mui/material/styles';
|
|
11
|
-
import { useSlotProps } from '@mui/base/utils';
|
|
12
|
-
import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
13
|
-
import { splitFieldInternalAndForwardedProps, convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
14
|
-
import { useMultiInputDateTimeRangeField } from '../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
-
export var multiInputDateTimeRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateTimeRangeField', ['root', 'separator']);
|
|
18
|
-
export var getMultiInputDateTimeRangeFieldUtilityClass = function getMultiInputDateTimeRangeFieldUtilityClass(slot) {
|
|
19
|
-
return generateUtilityClass('MuiMultiInputDateTimeRangeField', slot);
|
|
20
|
-
};
|
|
21
|
-
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
22
|
-
var classes = ownerState.classes;
|
|
23
|
-
var slots = {
|
|
24
|
-
root: ['root'],
|
|
25
|
-
separator: ['separator']
|
|
26
|
-
};
|
|
27
|
-
return composeClasses(slots, getMultiInputDateTimeRangeFieldUtilityClass, classes);
|
|
28
|
-
};
|
|
29
|
-
var MultiInputDateTimeRangeFieldRoot = styled( /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
30
|
-
return /*#__PURE__*/_jsx(Stack, _extends({
|
|
31
|
-
ref: ref,
|
|
32
|
-
spacing: 2,
|
|
33
|
-
direction: "row",
|
|
34
|
-
alignItems: "baseline"
|
|
35
|
-
}, props));
|
|
36
|
-
}), {
|
|
37
|
-
name: 'MuiMultiInputDateTimeRangeField',
|
|
38
|
-
slot: 'Root',
|
|
39
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
40
|
-
return styles.root;
|
|
41
|
-
}
|
|
42
|
-
})({});
|
|
43
|
-
var MultiInputDateTimeRangeFieldSeparator = styled(function (props) {
|
|
44
|
-
var _props$children;
|
|
45
|
-
return /*#__PURE__*/_jsx(Typography, _extends({}, props, {
|
|
46
|
-
children: (_props$children = props.children) != null ? _props$children : ' – '
|
|
47
|
-
}));
|
|
48
|
-
}, {
|
|
49
|
-
name: 'MuiMultiInputDateTimeRangeField',
|
|
50
|
-
slot: 'Separator',
|
|
51
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
52
|
-
return styles.separator;
|
|
53
|
-
}
|
|
54
|
-
})({});
|
|
55
|
-
/**
|
|
56
|
-
* Demos:
|
|
57
|
-
*
|
|
58
|
-
* - [DateTimeRangeField](http://mui.com/x/react-date-pickers/date-time-range-field/)
|
|
59
|
-
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
60
|
-
*
|
|
61
|
-
* API:
|
|
62
|
-
*
|
|
63
|
-
* - [MultiInputDateTimeRangeField API](https://mui.com/x/api/multi-input-date-time-range-field/)
|
|
64
|
-
*/
|
|
65
|
-
var MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInputDateTimeRangeField(inProps, ref) {
|
|
66
|
-
var _slots$root, _slots$textField, _slots$separator;
|
|
67
|
-
var themeProps = useThemeProps({
|
|
68
|
-
props: inProps,
|
|
69
|
-
name: 'MuiMultiInputDateTimeRangeField'
|
|
70
|
-
});
|
|
71
|
-
var _splitFieldInternalAn = splitFieldInternalAndForwardedProps(themeProps, 'date-time'),
|
|
72
|
-
dateTimeFieldInternalProps = _splitFieldInternalAn.internalProps,
|
|
73
|
-
forwardedProps = _splitFieldInternalAn.forwardedProps;
|
|
74
|
-
var slots = forwardedProps.slots,
|
|
75
|
-
slotProps = forwardedProps.slotProps,
|
|
76
|
-
disabled = forwardedProps.disabled,
|
|
77
|
-
autoFocus = forwardedProps.autoFocus,
|
|
78
|
-
unstableStartFieldRef = forwardedProps.unstableStartFieldRef,
|
|
79
|
-
unstableEndFieldRef = forwardedProps.unstableEndFieldRef,
|
|
80
|
-
className = forwardedProps.className,
|
|
81
|
-
otherForwardedProps = _objectWithoutProperties(forwardedProps, _excluded);
|
|
82
|
-
var ownerState = themeProps;
|
|
83
|
-
var classes = useUtilityClasses(ownerState);
|
|
84
|
-
var Root = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : MultiInputDateTimeRangeFieldRoot;
|
|
85
|
-
var rootProps = useSlotProps({
|
|
86
|
-
elementType: Root,
|
|
87
|
-
externalSlotProps: slotProps == null ? void 0 : slotProps.root,
|
|
88
|
-
externalForwardedProps: otherForwardedProps,
|
|
89
|
-
additionalProps: {
|
|
90
|
-
ref: ref
|
|
91
|
-
},
|
|
92
|
-
ownerState: ownerState,
|
|
93
|
-
className: clsx(className, classes.root)
|
|
94
|
-
});
|
|
95
|
-
var TextField = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : MuiTextField;
|
|
96
|
-
var startTextFieldProps = useSlotProps({
|
|
97
|
-
elementType: TextField,
|
|
98
|
-
externalSlotProps: slotProps == null ? void 0 : slotProps.textField,
|
|
99
|
-
additionalProps: {
|
|
100
|
-
autoFocus: autoFocus
|
|
101
|
-
},
|
|
102
|
-
ownerState: _extends({}, ownerState, {
|
|
103
|
-
position: 'start'
|
|
104
|
-
})
|
|
105
|
-
});
|
|
106
|
-
var endTextFieldProps = useSlotProps({
|
|
107
|
-
elementType: TextField,
|
|
108
|
-
externalSlotProps: slotProps == null ? void 0 : slotProps.textField,
|
|
109
|
-
ownerState: _extends({}, ownerState, {
|
|
110
|
-
position: 'end'
|
|
111
|
-
})
|
|
112
|
-
});
|
|
113
|
-
var Separator = (_slots$separator = slots == null ? void 0 : slots.separator) != null ? _slots$separator : MultiInputDateTimeRangeFieldSeparator;
|
|
114
|
-
var separatorProps = useSlotProps({
|
|
115
|
-
elementType: Separator,
|
|
116
|
-
externalSlotProps: slotProps == null ? void 0 : slotProps.separator,
|
|
117
|
-
ownerState: ownerState,
|
|
118
|
-
className: classes.separator
|
|
119
|
-
});
|
|
120
|
-
var fieldResponse = useMultiInputDateTimeRangeField({
|
|
121
|
-
sharedProps: _extends({}, dateTimeFieldInternalProps, {
|
|
122
|
-
disabled: disabled
|
|
123
|
-
}),
|
|
124
|
-
startTextFieldProps: startTextFieldProps,
|
|
125
|
-
endTextFieldProps: endTextFieldProps,
|
|
126
|
-
unstableStartFieldRef: unstableStartFieldRef,
|
|
127
|
-
unstableEndFieldRef: unstableEndFieldRef
|
|
128
|
-
});
|
|
129
|
-
var startDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.startDate);
|
|
130
|
-
var endDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.endDate);
|
|
131
|
-
return /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
132
|
-
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
133
|
-
fullWidth: true
|
|
134
|
-
}, startDateProps)), /*#__PURE__*/_jsx(Separator, _extends({}, separatorProps)), /*#__PURE__*/_jsx(TextField, _extends({
|
|
135
|
-
fullWidth: true
|
|
136
|
-
}, endDateProps))]
|
|
137
|
-
}));
|
|
138
|
-
});
|
|
139
|
-
process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes = {
|
|
140
|
-
// ----------------------------- Warning --------------------------------
|
|
141
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
142
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
143
|
-
// ----------------------------------------------------------------------
|
|
144
|
-
/**
|
|
145
|
-
* 12h/24h view for hour selection clock.
|
|
146
|
-
* @default `utils.is12HourCycleInCurrentLocale()`
|
|
147
|
-
*/
|
|
148
|
-
ampm: PropTypes.bool,
|
|
149
|
-
autoFocus: PropTypes.bool,
|
|
150
|
-
/**
|
|
151
|
-
* Override or extend the styles applied to the component.
|
|
152
|
-
*/
|
|
153
|
-
classes: PropTypes.object,
|
|
154
|
-
className: PropTypes.string,
|
|
155
|
-
component: PropTypes.elementType,
|
|
156
|
-
/**
|
|
157
|
-
* The default value. Use when the component is not controlled.
|
|
158
|
-
*/
|
|
159
|
-
defaultValue: PropTypes.arrayOf(PropTypes.any),
|
|
160
|
-
/**
|
|
161
|
-
* Defines the `flex-direction` style property.
|
|
162
|
-
* It is applied for all screen sizes.
|
|
163
|
-
* @default 'column'
|
|
164
|
-
*/
|
|
165
|
-
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
166
|
-
/**
|
|
167
|
-
* If `true`, the component is disabled.
|
|
168
|
-
* @default false
|
|
169
|
-
*/
|
|
170
|
-
disabled: PropTypes.bool,
|
|
171
|
-
/**
|
|
172
|
-
* If `true`, disable values after the current date for date components, time for time components and both for date time components.
|
|
173
|
-
* @default false
|
|
174
|
-
*/
|
|
175
|
-
disableFuture: PropTypes.bool,
|
|
176
|
-
/**
|
|
177
|
-
* Do not ignore date part when validating min/max time.
|
|
178
|
-
* @default false
|
|
179
|
-
*/
|
|
180
|
-
disableIgnoringDatePartForTimeValidation: PropTypes.bool,
|
|
181
|
-
/**
|
|
182
|
-
* If `true`, disable values before the current date for date components, time for time components and both for date time components.
|
|
183
|
-
* @default false
|
|
184
|
-
*/
|
|
185
|
-
disablePast: PropTypes.bool,
|
|
186
|
-
/**
|
|
187
|
-
* Add an element between each child.
|
|
188
|
-
*/
|
|
189
|
-
divider: PropTypes.node,
|
|
190
|
-
/**
|
|
191
|
-
* Format of the date when rendered in the input(s).
|
|
192
|
-
*/
|
|
193
|
-
format: PropTypes.string,
|
|
194
|
-
/**
|
|
195
|
-
* Density of the format when rendered in the input.
|
|
196
|
-
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
197
|
-
* @default "dense"
|
|
198
|
-
*/
|
|
199
|
-
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
200
|
-
/**
|
|
201
|
-
* Maximal selectable date.
|
|
202
|
-
*/
|
|
203
|
-
maxDate: PropTypes.any,
|
|
204
|
-
/**
|
|
205
|
-
* Maximal selectable moment of time with binding to date, to set max time in each day use `maxTime`.
|
|
206
|
-
*/
|
|
207
|
-
maxDateTime: PropTypes.any,
|
|
208
|
-
/**
|
|
209
|
-
* Maximal selectable time.
|
|
210
|
-
* The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
|
|
211
|
-
*/
|
|
212
|
-
maxTime: PropTypes.any,
|
|
213
|
-
/**
|
|
214
|
-
* Minimal selectable date.
|
|
215
|
-
*/
|
|
216
|
-
minDate: PropTypes.any,
|
|
217
|
-
/**
|
|
218
|
-
* Minimal selectable moment of time with binding to date, to set min time in each day use `minTime`.
|
|
219
|
-
*/
|
|
220
|
-
minDateTime: PropTypes.any,
|
|
221
|
-
/**
|
|
222
|
-
* Minimal selectable time.
|
|
223
|
-
* The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
|
|
224
|
-
*/
|
|
225
|
-
minTime: PropTypes.any,
|
|
226
|
-
/**
|
|
227
|
-
* Step over minutes.
|
|
228
|
-
* @default 1
|
|
229
|
-
*/
|
|
230
|
-
minutesStep: PropTypes.number,
|
|
231
|
-
/**
|
|
232
|
-
* Callback fired when the value changes.
|
|
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 {TValue} value The new value.
|
|
236
|
-
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
237
|
-
*/
|
|
238
|
-
onChange: PropTypes.func,
|
|
239
|
-
/**
|
|
240
|
-
* Callback fired when the error associated to the current value changes.
|
|
241
|
-
* @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.
|
|
242
|
-
* @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.
|
|
243
|
-
* @param {TError} error The new error.
|
|
244
|
-
* @param {TValue} value The value associated to the error.
|
|
245
|
-
*/
|
|
246
|
-
onError: PropTypes.func,
|
|
247
|
-
/**
|
|
248
|
-
* Callback fired when the selected sections change.
|
|
249
|
-
* @param {FieldSelectedSections} newValue The new selected sections.
|
|
250
|
-
*/
|
|
251
|
-
onSelectedSectionsChange: PropTypes.func,
|
|
252
|
-
/**
|
|
253
|
-
* It prevents the user from changing the value of the field
|
|
254
|
-
* (not from interacting with the field).
|
|
255
|
-
* @default false
|
|
256
|
-
*/
|
|
257
|
-
readOnly: PropTypes.bool,
|
|
258
|
-
/**
|
|
259
|
-
* The date used to generate a part of the new value that is not present in the format when both `value` and `defaultValue` are empty.
|
|
260
|
-
* For example, on time fields it will be used to determine the date to set.
|
|
261
|
-
* @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used.
|
|
262
|
-
*/
|
|
263
|
-
referenceDate: PropTypes.any,
|
|
264
|
-
/**
|
|
265
|
-
* The currently selected sections.
|
|
266
|
-
* This prop accept four formats:
|
|
267
|
-
* 1. If a number is provided, the section at this index will be selected.
|
|
268
|
-
* 2. If an object with a `startIndex` and `endIndex` properties are provided, the sections between those two indexes will be selected.
|
|
269
|
-
* 3. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
|
|
270
|
-
* 4. If `null` is provided, no section will be selected
|
|
271
|
-
* If not provided, the selected sections will be handled internally.
|
|
272
|
-
*/
|
|
273
|
-
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number, PropTypes.shape({
|
|
274
|
-
endIndex: PropTypes.number.isRequired,
|
|
275
|
-
startIndex: PropTypes.number.isRequired
|
|
276
|
-
})]),
|
|
277
|
-
/**
|
|
278
|
-
* Disable specific date.
|
|
279
|
-
*
|
|
280
|
-
* 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.
|
|
281
|
-
*
|
|
282
|
-
* @template TDate
|
|
283
|
-
* @param {TDate} day The date to test.
|
|
284
|
-
* @param {string} position The date to test, 'start' or 'end'.
|
|
285
|
-
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
286
|
-
*/
|
|
287
|
-
shouldDisableDate: PropTypes.func,
|
|
288
|
-
/**
|
|
289
|
-
* Disable specific time.
|
|
290
|
-
* @template TDate
|
|
291
|
-
* @param {TDate} value The value to check.
|
|
292
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
293
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
294
|
-
*/
|
|
295
|
-
shouldDisableTime: PropTypes.func,
|
|
296
|
-
/**
|
|
297
|
-
* If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
298
|
-
* If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
299
|
-
*
|
|
300
|
-
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
301
|
-
*
|
|
302
|
-
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
303
|
-
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
304
|
-
*
|
|
305
|
-
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
306
|
-
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
307
|
-
*
|
|
308
|
-
* @default `false`
|
|
309
|
-
*/
|
|
310
|
-
shouldRespectLeadingZeros: PropTypes.bool,
|
|
311
|
-
/**
|
|
312
|
-
* The props used for each component slot.
|
|
313
|
-
* @default {}
|
|
314
|
-
*/
|
|
315
|
-
slotProps: PropTypes.object,
|
|
316
|
-
/**
|
|
317
|
-
* Overridable component slots.
|
|
318
|
-
* @default {}
|
|
319
|
-
*/
|
|
320
|
-
slots: PropTypes.object,
|
|
321
|
-
/**
|
|
322
|
-
* Defines the space between immediate children.
|
|
323
|
-
* @default 0
|
|
324
|
-
*/
|
|
325
|
-
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
326
|
-
style: PropTypes.object,
|
|
327
|
-
/**
|
|
328
|
-
* The system prop, which allows defining system overrides as well as additional CSS styles.
|
|
329
|
-
*/
|
|
330
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
331
|
-
/**
|
|
332
|
-
* Choose which timezone to use for the value.
|
|
333
|
-
* Example: "default", "system", "UTC", "America/New_York".
|
|
334
|
-
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
335
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
336
|
-
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
337
|
-
*/
|
|
338
|
-
timezone: PropTypes.string,
|
|
339
|
-
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
340
|
-
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
341
|
-
/**
|
|
342
|
-
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
343
|
-
*
|
|
344
|
-
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
|
|
345
|
-
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
346
|
-
*
|
|
347
|
-
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
348
|
-
* @default false
|
|
349
|
-
*/
|
|
350
|
-
useFlexGap: PropTypes.bool,
|
|
351
|
-
/**
|
|
352
|
-
* The selected value.
|
|
353
|
-
* Used when the component is controlled.
|
|
354
|
-
*/
|
|
355
|
-
value: PropTypes.arrayOf(PropTypes.any)
|
|
356
|
-
} : void 0;
|
|
357
|
-
export { MultiInputDateTimeRangeField };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|