@mui/x-date-pickers-pro 8.0.0-alpha.0 → 8.0.0-alpha.10
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/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.d.ts +1 -1
- package/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
- package/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/package.json +1 -1
- package/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.d.ts +1 -1
- package/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
- package/{AdapterDateFnsV3 → AdapterDateFnsV2}/package.json +1 -1
- package/CHANGELOG.md +2215 -119
- package/DateRangeCalendar/DateRangeCalendar.js +18 -14
- package/DateRangePicker/DateRangePicker.js +1 -4
- package/DateRangePicker/DateRangePicker.types.d.ts +6 -2
- package/DateRangePicker/DateRangePickerToolbar.d.ts +2 -3
- package/DateRangePicker/DateRangePickerToolbar.js +33 -53
- package/DateRangePicker/shared.d.ts +4 -3
- package/DateTimeRangePicker/DateTimeRangePicker.js +2 -5
- package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +1 -2
- package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +4 -5
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +35 -33
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +8 -10
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +8 -6
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +2 -5
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +85 -123
- package/DateTimeRangePicker/shared.d.ts +6 -5
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +11 -9
- package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +7 -2
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -22
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +2 -3
- package/MobileDateRangePicker/MobileDateRangePicker.js +4 -8
- package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +2 -2
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +18 -16
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +2 -3
- package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +9 -4
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +15 -121
- package/MultiInputDateRangeField/index.d.ts +5 -3
- package/MultiInputDateRangeField/index.js +2 -2
- package/MultiInputDateRangeField/multiInputDateRangeFieldClasses.d.ts +6 -0
- package/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +4 -0
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +9 -4
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +15 -121
- package/MultiInputDateTimeRangeField/index.d.ts +5 -3
- package/MultiInputDateTimeRangeField/index.js +2 -2
- package/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.d.ts +6 -0
- package/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +4 -0
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +9 -4
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +16 -122
- package/MultiInputTimeRangeField/index.d.ts +5 -3
- package/MultiInputTimeRangeField/index.js +2 -2
- package/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.d.ts +6 -0
- package/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +4 -0
- package/README.md +10 -7
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +23 -33
- package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +6 -16
- package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +14 -14
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +23 -33
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +6 -17
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +14 -14
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +23 -33
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +6 -17
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +14 -14
- package/StaticDateRangePicker/StaticDateRangePicker.js +2 -2
- package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +2 -2
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -2
- package/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +2 -0
- package/hooks/package.json +6 -0
- package/hooks/useMultiInputRangeField/index.d.ts +1 -0
- package/hooks/useMultiInputRangeField/index.js +1 -0
- package/hooks/useMultiInputRangeField/useMultiInputRangeField.d.ts +53 -0
- package/hooks/useMultiInputRangeField/useMultiInputRangeField.js +149 -0
- package/hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.d.ts +17 -0
- package/{modern/internals/hooks/useMultiInputFieldSelectedSections.js → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +10 -8
- package/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.d.ts +17 -0
- package/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +59 -0
- package/hooks/usePickerRangePositionContext.d.ts +7 -0
- package/hooks/usePickerRangePositionContext.js +15 -0
- package/index.d.ts +2 -0
- package/index.js +4 -2
- package/internals/hooks/models/index.d.ts +1 -1
- package/internals/hooks/models/useRangePicker.d.ts +8 -11
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +70 -102
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +8 -10
- package/internals/hooks/{useEnrichedRangePickerFieldProps.d.ts → useEnrichedRangePickerField.d.ts} +26 -17
- package/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +55 -68
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +59 -82
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +7 -9
- package/internals/hooks/useNullablePickerRangePositionContext.d.ts +5 -0
- package/internals/hooks/useNullablePickerRangePositionContext.js +10 -0
- package/internals/hooks/useRangePosition.d.ts +4 -3
- package/internals/hooks/useRangePosition.js +1 -1
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -1
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +18 -31
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +6 -12
- package/internals/models/dateTimeRange.d.ts +1 -6
- package/internals/models/fields.d.ts +7 -11
- package/internals/models/index.d.ts +0 -1
- package/internals/models/index.js +0 -1
- package/internals/models/managers.d.ts +3 -0
- package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.d.ts +3 -0
- package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +136 -0
- package/internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.d.ts +72 -0
- package/internals/utils/createMultiInputRangeField/index.d.ts +3 -0
- package/internals/utils/createMultiInputRangeField/index.js +2 -0
- package/internals/utils/date-fields-utils.d.ts +6 -6
- package/internals/utils/date-range-manager.d.ts +2 -1
- package/internals/utils/date-range-manager.js +13 -10
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/valueManagers.d.ts +4 -3
- package/internals/utils/valueManagers.js +7 -7
- package/managers/index.d.ts +6 -0
- package/managers/index.js +3 -0
- package/managers/package.json +6 -0
- package/managers/useDateRangeManager.d.ts +15 -0
- package/managers/useDateRangeManager.js +33 -0
- package/managers/useDateTimeRangeManager.d.ts +15 -0
- package/managers/useDateTimeRangeManager.js +33 -0
- package/managers/useTimeRangeManager.d.ts +15 -0
- package/managers/useTimeRangeManager.js +31 -0
- package/models/fields.d.ts +7 -11
- package/models/index.d.ts +1 -2
- package/models/index.js +1 -2
- package/models/range.d.ts +0 -2
- package/modern/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
- package/modern/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
- package/modern/DateRangeCalendar/DateRangeCalendar.js +18 -14
- package/modern/DateRangePicker/DateRangePicker.js +1 -4
- package/modern/DateRangePicker/DateRangePickerToolbar.js +33 -53
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +2 -5
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +35 -33
- package/modern/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +8 -6
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +85 -123
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +11 -9
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -22
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +4 -8
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +18 -16
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +15 -121
- package/modern/MultiInputDateRangeField/index.js +2 -2
- package/modern/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +4 -0
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +15 -121
- package/modern/MultiInputDateTimeRangeField/index.js +2 -2
- package/modern/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +4 -0
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +16 -122
- package/modern/MultiInputTimeRangeField/index.js +2 -2
- package/modern/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +4 -0
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +23 -33
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +14 -14
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +23 -33
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +14 -14
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +23 -33
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +14 -14
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +2 -2
- package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
- package/modern/hooks/index.js +2 -0
- package/modern/hooks/useMultiInputRangeField/index.js +1 -0
- package/modern/hooks/useMultiInputRangeField/useMultiInputRangeField.js +149 -0
- package/{internals/hooks/useMultiInputFieldSelectedSections.js → modern/hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +10 -8
- package/modern/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +59 -0
- package/modern/hooks/usePickerRangePositionContext.js +15 -0
- package/modern/index.js +4 -2
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +70 -102
- package/modern/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +55 -68
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +59 -82
- package/modern/internals/hooks/useNullablePickerRangePositionContext.js +10 -0
- package/modern/internals/hooks/useRangePosition.js +1 -1
- package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +18 -31
- package/modern/internals/models/index.js +0 -1
- package/modern/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +136 -0
- package/modern/internals/utils/createMultiInputRangeField/index.js +2 -0
- package/modern/internals/utils/date-range-manager.js +13 -10
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/internals/utils/valueManagers.js +7 -7
- package/modern/managers/index.js +3 -0
- package/modern/managers/useDateRangeManager.js +33 -0
- package/modern/managers/useDateTimeRangeManager.js +33 -0
- package/modern/managers/useTimeRangeManager.js +31 -0
- package/modern/models/index.js +1 -2
- package/modern/validation/validateDateRange.js +8 -0
- package/modern/validation/validateDateTimeRange.js +4 -0
- package/modern/validation/validateTimeRange.js +8 -0
- package/node/{AdapterDateFnsJalaliV3 → AdapterDateFnsJalaliV2}/index.js +1 -1
- package/node/{AdapterDateFnsV3 → AdapterDateFnsV2}/index.js +1 -1
- package/node/DateRangeCalendar/DateRangeCalendar.js +17 -13
- package/node/DateRangePicker/DateRangePicker.js +1 -4
- package/node/DateRangePicker/DateRangePickerToolbar.js +31 -51
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +2 -5
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +33 -31
- package/node/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +8 -6
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +83 -121
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +11 -9
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -22
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +4 -8
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +18 -16
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +14 -124
- package/node/MultiInputDateRangeField/index.js +3 -9
- package/node/MultiInputDateRangeField/multiInputDateRangeFieldClasses.js +12 -0
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -124
- package/node/MultiInputDateTimeRangeField/index.js +3 -9
- package/node/MultiInputDateTimeRangeField/multiInputDateTimeRangeFieldClasses.js +12 -0
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +15 -125
- package/node/MultiInputTimeRangeField/index.js +3 -9
- package/node/MultiInputTimeRangeField/multiInputTimeRangeFieldClasses.js +12 -0
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +22 -32
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +13 -14
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +22 -32
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +13 -14
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +22 -32
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +13 -14
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +2 -2
- package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +0 -6
- package/node/hooks/index.js +19 -0
- package/node/hooks/useMultiInputRangeField/index.js +12 -0
- package/node/hooks/useMultiInputRangeField/useMultiInputRangeField.js +155 -0
- package/node/{internals/hooks/useMultiInputFieldSelectedSections.js → hooks/useMultiInputRangeField/useMultiInputRangeFieldSelectedSections.js} +11 -10
- package/node/hooks/useMultiInputRangeField/useMultiInputRangeFieldTextFieldProps.js +66 -0
- package/node/hooks/usePickerRangePositionContext.js +22 -0
- package/node/index.js +23 -1
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +70 -102
- package/node/internals/hooks/{useEnrichedRangePickerFieldProps.js → useEnrichedRangePickerField.js} +57 -70
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +59 -82
- package/node/internals/hooks/useNullablePickerRangePositionContext.js +16 -0
- package/node/internals/hooks/useRangePosition.js +1 -1
- package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +17 -30
- package/node/internals/models/index.js +0 -11
- package/node/internals/utils/createMultiInputRangeField/createMultiInputRangeField.js +143 -0
- package/node/internals/utils/createMultiInputRangeField/index.js +19 -0
- package/node/internals/utils/date-range-manager.js +13 -10
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/internals/utils/valueManagers.js +7 -7
- package/node/managers/index.js +26 -0
- package/node/managers/useDateRangeManager.js +40 -0
- package/node/managers/useDateTimeRangeManager.js +40 -0
- package/node/managers/useTimeRangeManager.js +38 -0
- package/node/models/index.js +0 -22
- package/node/validation/validateDateRange.js +8 -0
- package/node/validation/validateDateTimeRange.js +4 -0
- package/node/validation/validateTimeRange.js +8 -0
- package/package.json +8 -8
- package/themeAugmentation/overrides.d.ts +6 -4
- package/themeAugmentation/props.d.ts +2 -2
- package/validation/validateDateRange.d.ts +9 -1
- package/validation/validateDateRange.js +8 -0
- package/validation/validateDateTimeRange.d.ts +6 -2
- package/validation/validateDateTimeRange.js +4 -0
- package/validation/validateTimeRange.d.ts +9 -1
- package/validation/validateTimeRange.js +8 -0
- package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +0 -53
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +0 -54
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +0 -54
- package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +0 -21
- package/internals/hooks/useMultiInputRangeField/shared.d.ts +0 -1
- package/internals/hooks/useMultiInputRangeField/shared.js +0 -9
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +0 -3
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -111
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +0 -3
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -111
- package/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +0 -11
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +0 -3
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -111
- package/internals/models/timeRange.d.ts +0 -6
- package/internals/models/timeRange.js +0 -1
- package/models/dateRange.d.ts +0 -7
- package/models/dateRange.js +0 -1
- package/models/multiInputRangeFieldClasses.d.ts +0 -7
- package/models/multiInputRangeFieldClasses.js +0 -1
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.types.js +0 -1
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js +0 -1
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -1
- package/modern/internals/hooks/useMultiInputRangeField/shared.js +0 -9
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -111
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -111
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -1
- package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -111
- package/modern/internals/models/timeRange.js +0 -1
- package/modern/models/dateRange.js +0 -1
- package/modern/models/multiInputRangeFieldClasses.js +0 -1
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.types.js +0 -5
- package/node/internals/hooks/useMultiInputRangeField/shared.js +0 -16
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +0 -119
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +0 -119
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js +0 -5
- package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +0 -119
- package/node/internals/models/timeRange.js +0 -5
- package/node/models/dateRange.js +0 -5
- package/node/models/multiInputRangeFieldClasses.js +0 -5
- /package/{MultiInputDateRangeField/MultiInputDateRangeField.types.js → internals/models/managers.js} +0 -0
- /package/{MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js → internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
- /package/{MultiInputTimeRangeField/MultiInputTimeRangeField.types.js → modern/internals/models/managers.js} +0 -0
- /package/{internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.js → modern/internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
- /package/node/{MultiInputDateRangeField/MultiInputDateRangeField.types.js → internals/models/managers.js} +0 -0
- /package/node/{MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.js → internals/utils/createMultiInputRangeField/createMultiInputRangeField.types.js} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["view", "openTo"
|
|
5
|
+
const _excluded = ["view", "openTo"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { refType } from '@mui/utils';
|
|
@@ -20,16 +20,23 @@ import { useDateTimeRangePickerDefaultizedProps } from "../DateTimeRangePicker/s
|
|
|
20
20
|
import { MultiInputDateTimeRangeField } from "../MultiInputDateTimeRangeField/index.js";
|
|
21
21
|
import { DateTimeRangePickerTimeWrapper } from "../DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js";
|
|
22
22
|
import { RANGE_VIEW_HEIGHT } from "../internals/constants/dimensions.js";
|
|
23
|
+
import { usePickerRangePositionContext } from "../hooks/index.js";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
const rendererInterceptor = function
|
|
25
|
+
const rendererInterceptor = function RendererInterceptor(props) {
|
|
26
|
+
const {
|
|
27
|
+
viewRenderers,
|
|
28
|
+
popperView,
|
|
29
|
+
rendererProps
|
|
30
|
+
} = props;
|
|
31
|
+
const {
|
|
32
|
+
rangePosition
|
|
33
|
+
} = usePickerRangePositionContext();
|
|
25
34
|
const {
|
|
26
35
|
view,
|
|
27
|
-
openTo
|
|
28
|
-
rangePosition
|
|
36
|
+
openTo
|
|
29
37
|
} = rendererProps,
|
|
30
38
|
otherRendererProps = _objectWithoutPropertiesLoose(rendererProps, _excluded);
|
|
31
39
|
const finalProps = _extends({}, otherRendererProps, {
|
|
32
|
-
rangePosition,
|
|
33
40
|
focusedView: null,
|
|
34
41
|
sx: [{
|
|
35
42
|
width: DIALOG_WIDTH,
|
|
@@ -53,7 +60,7 @@ const rendererInterceptor = function rendererInterceptor(inViewRenderers, popper
|
|
|
53
60
|
}]
|
|
54
61
|
});
|
|
55
62
|
const isTimeView = isInternalTimeView(popperView);
|
|
56
|
-
const viewRenderer =
|
|
63
|
+
const viewRenderer = viewRenderers[popperView];
|
|
57
64
|
if (!viewRenderer) {
|
|
58
65
|
return null;
|
|
59
66
|
}
|
|
@@ -107,21 +114,19 @@ const MobileDateTimeRangePicker = /*#__PURE__*/React.forwardRef(function MobileD
|
|
|
107
114
|
field: MultiInputDateTimeRangeField
|
|
108
115
|
}, defaultizedProps.slots),
|
|
109
116
|
slotProps: _extends({}, defaultizedProps.slotProps, {
|
|
110
|
-
field: ownerState => _extends({}, resolveComponentProps(defaultizedProps.slotProps?.field, ownerState), extractValidationProps(defaultizedProps),
|
|
111
|
-
ref
|
|
112
|
-
}),
|
|
117
|
+
field: ownerState => _extends({}, resolveComponentProps(defaultizedProps.slotProps?.field, ownerState), extractValidationProps(defaultizedProps)),
|
|
113
118
|
tabs: _extends({
|
|
114
119
|
hidden: false
|
|
115
120
|
}, defaultizedProps.slotProps?.tabs),
|
|
116
121
|
toolbar: _extends({
|
|
117
|
-
hidden: false
|
|
118
|
-
toolbarVariant: 'mobile'
|
|
122
|
+
hidden: false
|
|
119
123
|
}, defaultizedProps.slotProps?.toolbar)
|
|
120
124
|
})
|
|
121
125
|
});
|
|
122
126
|
const {
|
|
123
127
|
renderPicker
|
|
124
128
|
} = useMobileRangePicker({
|
|
129
|
+
ref,
|
|
125
130
|
props,
|
|
126
131
|
valueManager: rangeValueManager,
|
|
127
132
|
valueType: 'date-time',
|
|
@@ -149,8 +154,8 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
149
154
|
autoFocus: PropTypes.bool,
|
|
150
155
|
className: PropTypes.string,
|
|
151
156
|
/**
|
|
152
|
-
* If `true`, the
|
|
153
|
-
* @default
|
|
157
|
+
* If `true`, the Picker will close after submitting the full date.
|
|
158
|
+
* @default false
|
|
154
159
|
*/
|
|
155
160
|
closeOnSelect: PropTypes.bool,
|
|
156
161
|
/**
|
|
@@ -243,12 +248,10 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
243
248
|
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
244
249
|
/**
|
|
245
250
|
* Pass a ref to the `input` element.
|
|
246
|
-
* Ignored if the field has several inputs.
|
|
247
251
|
*/
|
|
248
252
|
inputRef: refType,
|
|
249
253
|
/**
|
|
250
254
|
* The label content.
|
|
251
|
-
* Ignored if the field has several inputs.
|
|
252
255
|
*/
|
|
253
256
|
label: PropTypes.node,
|
|
254
257
|
/**
|
|
@@ -297,7 +300,6 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
297
300
|
minutesStep: PropTypes.number,
|
|
298
301
|
/**
|
|
299
302
|
* Name attribute used by the `input` element in the Field.
|
|
300
|
-
* Ignored if the field has several inputs.
|
|
301
303
|
*/
|
|
302
304
|
name: PropTypes.string,
|
|
303
305
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
2
|
import { UseMobileRangePickerSlots, UseMobileRangePickerSlotProps, MobileRangeOnlyPickerProps } from '../internals/hooks/useMobileRangePicker';
|
|
3
3
|
import { BaseDateTimeRangePickerProps, BaseDateTimeRangePickerSlots, BaseDateTimeRangePickerSlotProps } from '../DateTimeRangePicker/shared';
|
|
4
|
-
|
|
5
|
-
export interface MobileDateTimeRangePickerSlots extends BaseDateTimeRangePickerSlots, MakeOptional<UseMobileRangePickerSlots<DateTimeRangePickerView>, 'field'> {
|
|
4
|
+
export interface MobileDateTimeRangePickerSlots extends BaseDateTimeRangePickerSlots, MakeOptional<UseMobileRangePickerSlots, 'field'> {
|
|
6
5
|
}
|
|
7
|
-
export interface MobileDateTimeRangePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDateTimeRangePickerSlotProps, Omit<UseMobileRangePickerSlotProps<
|
|
6
|
+
export interface MobileDateTimeRangePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends BaseDateTimeRangePickerSlotProps, Omit<UseMobileRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>, 'tabs' | 'toolbar'> {
|
|
8
7
|
}
|
|
9
8
|
export interface MobileDateTimeRangePickerProps<TEnableAccessibleFieldDOMStructure extends boolean = true> extends BaseDateTimeRangePickerProps, MobileRangeOnlyPickerProps {
|
|
10
9
|
/**
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { UseDateRangeManagerReturnValue } from '../managers';
|
|
3
|
+
import { MultiInputRangeFieldProps } from '../internals/utils/createMultiInputRangeField';
|
|
4
|
+
import { MultiInputDateRangeFieldClasses } from './multiInputDateRangeFieldClasses';
|
|
5
|
+
export interface MultiInputDateRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MultiInputRangeFieldProps<UseDateRangeManagerReturnValue<TEnableAccessibleFieldDOMStructure>> {
|
|
6
|
+
/**
|
|
7
|
+
* Override or extend the styles applied to the component.
|
|
8
|
+
*/
|
|
9
|
+
classes?: Partial<MultiInputDateRangeFieldClasses>;
|
|
10
|
+
}
|
|
6
11
|
type MultiInputDateRangeFieldComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: MultiInputDateRangeFieldProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
7
12
|
propTypes?: any;
|
|
8
13
|
};
|
|
@@ -1,51 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
|
|
6
|
-
import * as React from 'react';
|
|
7
3
|
import PropTypes from 'prop-types';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import useSlotProps from '@mui/utils/useSlotProps';
|
|
14
|
-
import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
15
|
-
import { convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
16
|
-
import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
|
|
17
|
-
import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
|
|
18
|
-
import { useMultiInputDateRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js";
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
export const multiInputDateRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateRangeField', ['root', 'separator']);
|
|
21
|
-
export const getMultiInputDateRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateRangeField', slot);
|
|
22
|
-
const useUtilityClasses = ownerState => {
|
|
23
|
-
const {
|
|
24
|
-
classes
|
|
25
|
-
} = ownerState;
|
|
26
|
-
const slots = {
|
|
27
|
-
root: ['root'],
|
|
28
|
-
separator: ['separator']
|
|
29
|
-
};
|
|
30
|
-
return composeClasses(slots, getMultiInputDateRangeFieldUtilityClass, classes);
|
|
31
|
-
};
|
|
32
|
-
const MultiInputDateRangeFieldRoot = styled(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
|
|
33
|
-
ref: ref,
|
|
34
|
-
spacing: 2,
|
|
35
|
-
direction: "row",
|
|
36
|
-
alignItems: "center"
|
|
37
|
-
}, props))), {
|
|
38
|
-
name: 'MuiMultiInputDateRangeField',
|
|
39
|
-
slot: 'Root',
|
|
40
|
-
overridesResolver: (props, styles) => styles.root
|
|
41
|
-
})({});
|
|
42
|
-
const MultiInputDateRangeFieldSeparator = styled(Typography, {
|
|
43
|
-
name: 'MuiMultiInputDateRangeField',
|
|
44
|
-
slot: 'Separator',
|
|
45
|
-
overridesResolver: (props, styles) => styles.separator
|
|
46
|
-
})({
|
|
47
|
-
lineHeight: '1.4375em' // 23px
|
|
48
|
-
});
|
|
4
|
+
import { useDateRangeManager } from "../managers/index.js";
|
|
5
|
+
import {
|
|
6
|
+
// The alias is needed to have the doc gen working.
|
|
7
|
+
createMultiInputRangeField as createMultiInputDateRangeField } from "../internals/utils/createMultiInputRangeField/index.js";
|
|
8
|
+
import { getMultiInputDateRangeFieldUtilityClass } from "./multiInputDateRangeFieldClasses.js";
|
|
49
9
|
/**
|
|
50
10
|
* Demos:
|
|
51
11
|
*
|
|
@@ -56,85 +16,19 @@ const MultiInputDateRangeFieldSeparator = styled(Typography, {
|
|
|
56
16
|
*
|
|
57
17
|
* - [MultiInputDateRangeField API](https://mui.com/x/api/multi-input-date-range-field/)
|
|
58
18
|
*/
|
|
59
|
-
const MultiInputDateRangeField =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
});
|
|
64
|
-
const {
|
|
65
|
-
internalProps,
|
|
66
|
-
forwardedProps
|
|
67
|
-
} = useSplitFieldProps(themeProps, 'date');
|
|
68
|
-
const {
|
|
69
|
-
slots,
|
|
70
|
-
slotProps,
|
|
71
|
-
unstableStartFieldRef,
|
|
72
|
-
unstableEndFieldRef,
|
|
73
|
-
className
|
|
74
|
-
} = forwardedProps,
|
|
75
|
-
otherForwardedProps = _objectWithoutPropertiesLoose(forwardedProps, _excluded);
|
|
76
|
-
const ownerState = themeProps;
|
|
77
|
-
const classes = useUtilityClasses(ownerState);
|
|
78
|
-
const Root = slots?.root ?? MultiInputDateRangeFieldRoot;
|
|
79
|
-
const rootProps = useSlotProps({
|
|
80
|
-
elementType: Root,
|
|
81
|
-
externalSlotProps: slotProps?.root,
|
|
82
|
-
externalForwardedProps: otherForwardedProps,
|
|
83
|
-
additionalProps: {
|
|
84
|
-
ref
|
|
85
|
-
},
|
|
86
|
-
ownerState,
|
|
87
|
-
className: clsx(className, classes.root)
|
|
88
|
-
});
|
|
89
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
90
|
-
const startTextFieldProps = useSlotProps({
|
|
91
|
-
elementType: TextField,
|
|
92
|
-
externalSlotProps: slotProps?.textField,
|
|
93
|
-
ownerState: _extends({}, ownerState, {
|
|
94
|
-
position: 'start'
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
const endTextFieldProps = useSlotProps({
|
|
98
|
-
elementType: TextField,
|
|
99
|
-
externalSlotProps: slotProps?.textField,
|
|
100
|
-
ownerState: _extends({}, ownerState, {
|
|
101
|
-
position: 'end'
|
|
102
|
-
})
|
|
103
|
-
});
|
|
104
|
-
const Separator = slots?.separator ?? MultiInputDateRangeFieldSeparator;
|
|
105
|
-
const separatorProps = useSlotProps({
|
|
106
|
-
elementType: Separator,
|
|
107
|
-
externalSlotProps: slotProps?.separator,
|
|
108
|
-
additionalProps: {
|
|
109
|
-
children: ` ${internalProps.dateSeparator ?? '–'} `
|
|
110
|
-
},
|
|
111
|
-
ownerState,
|
|
112
|
-
className: classes.separator
|
|
113
|
-
});
|
|
114
|
-
const fieldResponse = useMultiInputDateRangeField({
|
|
115
|
-
sharedProps: internalProps,
|
|
116
|
-
startTextFieldProps,
|
|
117
|
-
endTextFieldProps,
|
|
118
|
-
unstableStartFieldRef,
|
|
119
|
-
unstableEndFieldRef
|
|
120
|
-
});
|
|
121
|
-
const startDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.startDate);
|
|
122
|
-
const endDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.endDate);
|
|
123
|
-
return /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
124
|
-
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
125
|
-
fullWidth: true
|
|
126
|
-
}, startDateProps)), /*#__PURE__*/_jsx(Separator, _extends({}, separatorProps)), /*#__PURE__*/_jsx(TextField, _extends({
|
|
127
|
-
fullWidth: true
|
|
128
|
-
}, endDateProps))]
|
|
129
|
-
}));
|
|
19
|
+
const MultiInputDateRangeField = createMultiInputDateRangeField({
|
|
20
|
+
name: 'MuiMultiInputDateRangeField',
|
|
21
|
+
getUtilityClass: getMultiInputDateRangeFieldUtilityClass,
|
|
22
|
+
useManager: useDateRangeManager
|
|
130
23
|
});
|
|
131
|
-
|
|
24
|
+
MultiInputDateRangeField.propTypes = {
|
|
132
25
|
// ----------------------------- Warning --------------------------------
|
|
133
26
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
134
27
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
135
28
|
// ----------------------------------------------------------------------
|
|
136
29
|
/**
|
|
137
30
|
* If `true`, the `input` element is focused during the first mount.
|
|
31
|
+
* @default false
|
|
138
32
|
*/
|
|
139
33
|
autoFocus: PropTypes.bool,
|
|
140
34
|
/**
|
|
@@ -258,10 +152,10 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
258
152
|
*/
|
|
259
153
|
shouldDisableDate: PropTypes.func,
|
|
260
154
|
/**
|
|
261
|
-
* If `true`, the format will respect the leading zeroes (
|
|
262
|
-
* If `false`, the format will always add leading zeroes (
|
|
155
|
+
* If `true`, the format will respect the leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
156
|
+
* If `false`, the format will always add leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
263
157
|
*
|
|
264
|
-
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (
|
|
158
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (for example "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
265
159
|
*
|
|
266
160
|
* 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.
|
|
267
161
|
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
@@ -317,5 +211,5 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
317
211
|
* Used when the component is controlled.
|
|
318
212
|
*/
|
|
319
213
|
value: PropTypes.arrayOf(PropTypes.object)
|
|
320
|
-
}
|
|
214
|
+
};
|
|
321
215
|
export { MultiInputDateRangeField };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export { MultiInputDateRangeField
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
export { MultiInputDateRangeField } from './MultiInputDateRangeField';
|
|
2
|
+
export type { MultiInputDateRangeFieldProps } from './MultiInputDateRangeField';
|
|
3
|
+
export { multiInputDateRangeFieldClasses, getMultiInputDateRangeFieldUtilityClass, } from './multiInputDateRangeFieldClasses';
|
|
4
|
+
export type { MultiInputDateRangeFieldClassKey, MultiInputDateRangeFieldClasses, } from './multiInputDateRangeFieldClasses';
|
|
5
|
+
export type { MultiInputRangeFieldSlots as MultiInputDateRangeFieldSlots, MultiInputRangeFieldSlotProps as MultiInputDateRangeFieldSlotProps, } from '../internals/utils/createMultiInputRangeField';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MultiInputDateRangeField
|
|
2
|
-
export {
|
|
1
|
+
export { MultiInputDateRangeField } from "./MultiInputDateRangeField.js";
|
|
2
|
+
export { multiInputDateRangeFieldClasses, getMultiInputDateRangeFieldUtilityClass } from "./multiInputDateRangeFieldClasses.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MultiInputRangeFieldClasses } from '../internals/utils/createMultiInputRangeField';
|
|
2
|
+
export interface MultiInputDateRangeFieldClasses extends MultiInputRangeFieldClasses {
|
|
3
|
+
}
|
|
4
|
+
export type MultiInputDateRangeFieldClassKey = keyof MultiInputRangeFieldClasses;
|
|
5
|
+
export declare const multiInputDateRangeFieldClasses: MultiInputRangeFieldClasses;
|
|
6
|
+
export declare const getMultiInputDateRangeFieldUtilityClass: (slot: string) => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
3
|
+
export const multiInputDateRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateRangeField', ['root', 'separator']);
|
|
4
|
+
export const getMultiInputDateRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateRangeField', slot);
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { UseDateTimeRangeManagerReturnValue } from '../managers';
|
|
3
|
+
import { MultiInputRangeFieldProps } from '../internals/utils/createMultiInputRangeField';
|
|
4
|
+
import { MultiInputDateTimeRangeFieldClasses } from './multiInputDateTimeRangeFieldClasses';
|
|
5
|
+
export interface MultiInputDateTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MultiInputRangeFieldProps<UseDateTimeRangeManagerReturnValue<TEnableAccessibleFieldDOMStructure>> {
|
|
6
|
+
/**
|
|
7
|
+
* Override or extend the styles applied to the component.
|
|
8
|
+
*/
|
|
9
|
+
classes?: Partial<MultiInputDateTimeRangeFieldClasses>;
|
|
10
|
+
}
|
|
6
11
|
type MultiInputDateTimeRangeFieldComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: MultiInputDateTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
7
12
|
propTypes?: any;
|
|
8
13
|
};
|
|
@@ -1,51 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["slots", "slotProps", "unstableStartFieldRef", "unstableEndFieldRef", "className"];
|
|
6
|
-
import * as React from 'react';
|
|
7
3
|
import PropTypes from 'prop-types';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import useSlotProps from '@mui/utils/useSlotProps';
|
|
14
|
-
import { unstable_composeClasses as composeClasses, unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
15
|
-
import { convertFieldResponseIntoMuiTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
16
|
-
import { useSplitFieldProps } from '@mui/x-date-pickers/hooks';
|
|
17
|
-
import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
|
|
18
|
-
import { useMultiInputDateTimeRangeField } from "../internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js";
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
export const multiInputDateTimeRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateTimeRangeField', ['root', 'separator']);
|
|
21
|
-
export const getMultiInputDateTimeRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateTimeRangeField', slot);
|
|
22
|
-
const useUtilityClasses = ownerState => {
|
|
23
|
-
const {
|
|
24
|
-
classes
|
|
25
|
-
} = ownerState;
|
|
26
|
-
const slots = {
|
|
27
|
-
root: ['root'],
|
|
28
|
-
separator: ['separator']
|
|
29
|
-
};
|
|
30
|
-
return composeClasses(slots, getMultiInputDateTimeRangeFieldUtilityClass, classes);
|
|
31
|
-
};
|
|
32
|
-
const MultiInputDateTimeRangeFieldRoot = styled(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/_jsx(Stack, _extends({
|
|
33
|
-
ref: ref,
|
|
34
|
-
spacing: 2,
|
|
35
|
-
direction: "row",
|
|
36
|
-
alignItems: "center"
|
|
37
|
-
}, props))), {
|
|
38
|
-
name: 'MuiMultiInputDateTimeRangeField',
|
|
39
|
-
slot: 'Root',
|
|
40
|
-
overridesResolver: (props, styles) => styles.root
|
|
41
|
-
})({});
|
|
42
|
-
const MultiInputDateTimeRangeFieldSeparator = styled(Typography, {
|
|
43
|
-
name: 'MuiMultiInputDateTimeRangeField',
|
|
44
|
-
slot: 'Separator',
|
|
45
|
-
overridesResolver: (props, styles) => styles.separator
|
|
46
|
-
})({
|
|
47
|
-
lineHeight: '1.4375em' // 23px
|
|
48
|
-
});
|
|
4
|
+
import { useDateTimeRangeManager } from "../managers/index.js";
|
|
5
|
+
import {
|
|
6
|
+
// The alias is needed to have the doc gen working.
|
|
7
|
+
createMultiInputRangeField as createMultiInputDateTimeRangeField } from "../internals/utils/createMultiInputRangeField/index.js";
|
|
8
|
+
import { getMultiInputDateTimeRangeFieldUtilityClass } from "./multiInputDateTimeRangeFieldClasses.js";
|
|
49
9
|
/**
|
|
50
10
|
* Demos:
|
|
51
11
|
*
|
|
@@ -56,79 +16,12 @@ const MultiInputDateTimeRangeFieldSeparator = styled(Typography, {
|
|
|
56
16
|
*
|
|
57
17
|
* - [MultiInputDateTimeRangeField API](https://mui.com/x/api/multi-input-date-time-range-field/)
|
|
58
18
|
*/
|
|
59
|
-
const MultiInputDateTimeRangeField =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
});
|
|
64
|
-
const {
|
|
65
|
-
internalProps,
|
|
66
|
-
forwardedProps
|
|
67
|
-
} = useSplitFieldProps(themeProps, 'date-time');
|
|
68
|
-
const {
|
|
69
|
-
slots,
|
|
70
|
-
slotProps,
|
|
71
|
-
unstableStartFieldRef,
|
|
72
|
-
unstableEndFieldRef,
|
|
73
|
-
className
|
|
74
|
-
} = forwardedProps,
|
|
75
|
-
otherForwardedProps = _objectWithoutPropertiesLoose(forwardedProps, _excluded);
|
|
76
|
-
const ownerState = themeProps;
|
|
77
|
-
const classes = useUtilityClasses(ownerState);
|
|
78
|
-
const Root = slots?.root ?? MultiInputDateTimeRangeFieldRoot;
|
|
79
|
-
const rootProps = useSlotProps({
|
|
80
|
-
elementType: Root,
|
|
81
|
-
externalSlotProps: slotProps?.root,
|
|
82
|
-
externalForwardedProps: otherForwardedProps,
|
|
83
|
-
additionalProps: {
|
|
84
|
-
ref
|
|
85
|
-
},
|
|
86
|
-
ownerState,
|
|
87
|
-
className: clsx(className, classes.root)
|
|
88
|
-
});
|
|
89
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
90
|
-
const startTextFieldProps = useSlotProps({
|
|
91
|
-
elementType: TextField,
|
|
92
|
-
externalSlotProps: slotProps?.textField,
|
|
93
|
-
ownerState: _extends({}, ownerState, {
|
|
94
|
-
position: 'start'
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
const endTextFieldProps = useSlotProps({
|
|
98
|
-
elementType: TextField,
|
|
99
|
-
externalSlotProps: slotProps?.textField,
|
|
100
|
-
ownerState: _extends({}, ownerState, {
|
|
101
|
-
position: 'end'
|
|
102
|
-
})
|
|
103
|
-
});
|
|
104
|
-
const Separator = slots?.separator ?? MultiInputDateTimeRangeFieldSeparator;
|
|
105
|
-
const separatorProps = useSlotProps({
|
|
106
|
-
elementType: Separator,
|
|
107
|
-
externalSlotProps: slotProps?.separator,
|
|
108
|
-
additionalProps: {
|
|
109
|
-
children: ` ${internalProps.dateSeparator ?? '–'} `
|
|
110
|
-
},
|
|
111
|
-
ownerState,
|
|
112
|
-
className: classes.separator
|
|
113
|
-
});
|
|
114
|
-
const fieldResponse = useMultiInputDateTimeRangeField({
|
|
115
|
-
sharedProps: internalProps,
|
|
116
|
-
startTextFieldProps,
|
|
117
|
-
endTextFieldProps,
|
|
118
|
-
unstableStartFieldRef,
|
|
119
|
-
unstableEndFieldRef
|
|
120
|
-
});
|
|
121
|
-
const startDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.startDate);
|
|
122
|
-
const endDateProps = convertFieldResponseIntoMuiTextFieldProps(fieldResponse.endDate);
|
|
123
|
-
return /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
124
|
-
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
125
|
-
fullWidth: true
|
|
126
|
-
}, startDateProps)), /*#__PURE__*/_jsx(Separator, _extends({}, separatorProps)), /*#__PURE__*/_jsx(TextField, _extends({
|
|
127
|
-
fullWidth: true
|
|
128
|
-
}, endDateProps))]
|
|
129
|
-
}));
|
|
19
|
+
const MultiInputDateTimeRangeField = createMultiInputDateTimeRangeField({
|
|
20
|
+
name: 'MuiMultiInputDateTimeRangeField',
|
|
21
|
+
getUtilityClass: getMultiInputDateTimeRangeFieldUtilityClass,
|
|
22
|
+
useManager: useDateTimeRangeManager
|
|
130
23
|
});
|
|
131
|
-
|
|
24
|
+
MultiInputDateTimeRangeField.propTypes = {
|
|
132
25
|
// ----------------------------- Warning --------------------------------
|
|
133
26
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
134
27
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -140,6 +33,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
140
33
|
ampm: PropTypes.bool,
|
|
141
34
|
/**
|
|
142
35
|
* If `true`, the `input` element is focused during the first mount.
|
|
36
|
+
* @default false
|
|
143
37
|
*/
|
|
144
38
|
autoFocus: PropTypes.bool,
|
|
145
39
|
/**
|
|
@@ -298,10 +192,10 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
298
192
|
*/
|
|
299
193
|
shouldDisableTime: PropTypes.func,
|
|
300
194
|
/**
|
|
301
|
-
* If `true`, the format will respect the leading zeroes (
|
|
302
|
-
* If `false`, the format will always add leading zeroes (
|
|
195
|
+
* If `true`, the format will respect the leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
196
|
+
* If `false`, the format will always add leading zeroes (for example on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
303
197
|
*
|
|
304
|
-
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (
|
|
198
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (for example "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
305
199
|
*
|
|
306
200
|
* 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.
|
|
307
201
|
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
@@ -357,5 +251,5 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
357
251
|
* Used when the component is controlled.
|
|
358
252
|
*/
|
|
359
253
|
value: PropTypes.arrayOf(PropTypes.object)
|
|
360
|
-
}
|
|
254
|
+
};
|
|
361
255
|
export { MultiInputDateTimeRangeField };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export { MultiInputDateTimeRangeField
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
export { MultiInputDateTimeRangeField } from './MultiInputDateTimeRangeField';
|
|
2
|
+
export type { MultiInputDateTimeRangeFieldProps } from './MultiInputDateTimeRangeField';
|
|
3
|
+
export { multiInputDateTimeRangeFieldClasses, getMultiInputDateTimeRangeFieldUtilityClass, } from './multiInputDateTimeRangeFieldClasses';
|
|
4
|
+
export type { MultiInputDateTimeRangeFieldClassKey, MultiInputDateTimeRangeFieldClasses, } from './multiInputDateTimeRangeFieldClasses';
|
|
5
|
+
export type { MultiInputRangeFieldSlots as MultiInputDateTimeRangeFieldSlots, MultiInputRangeFieldSlotProps as MultiInputDateTimeRangeFieldSlotProps, } from '../internals/utils/createMultiInputRangeField';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MultiInputDateTimeRangeField
|
|
2
|
-
export {
|
|
1
|
+
export { MultiInputDateTimeRangeField } from "./MultiInputDateTimeRangeField.js";
|
|
2
|
+
export { multiInputDateTimeRangeFieldClasses, getMultiInputDateTimeRangeFieldUtilityClass } from "./multiInputDateTimeRangeFieldClasses.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MultiInputRangeFieldClasses } from '../internals/utils/createMultiInputRangeField';
|
|
2
|
+
export interface MultiInputDateTimeRangeFieldClasses extends MultiInputRangeFieldClasses {
|
|
3
|
+
}
|
|
4
|
+
export type MultiInputDateTimeRangeFieldClassKey = keyof MultiInputRangeFieldClasses;
|
|
5
|
+
export declare const multiInputDateTimeRangeFieldClasses: MultiInputRangeFieldClasses;
|
|
6
|
+
export declare const getMultiInputDateTimeRangeFieldUtilityClass: (slot: string) => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
3
|
+
export const multiInputDateTimeRangeFieldClasses = generateUtilityClasses('MuiMultiInputDateTimeRangeField', ['root', 'separator']);
|
|
4
|
+
export const getMultiInputDateTimeRangeFieldUtilityClass = slot => generateUtilityClass('MuiMultiInputDateTimeRangeField', slot);
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { UseTimeRangeManagerReturnValue } from '../managers';
|
|
3
|
+
import { MultiInputRangeFieldProps } from '../internals/utils/createMultiInputRangeField';
|
|
4
|
+
import { MultiInputTimeRangeFieldClasses } from './multiInputTimeRangeFieldClasses';
|
|
5
|
+
export interface MultiInputTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MultiInputRangeFieldProps<UseTimeRangeManagerReturnValue<TEnableAccessibleFieldDOMStructure>> {
|
|
6
|
+
/**
|
|
7
|
+
* Override or extend the styles applied to the component.
|
|
8
|
+
*/
|
|
9
|
+
classes?: Partial<MultiInputTimeRangeFieldClasses>;
|
|
10
|
+
}
|
|
6
11
|
type MultiInputTimeRangeFieldComponent = (<TEnableAccessibleFieldDOMStructure extends boolean = true>(props: MultiInputTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
7
12
|
propTypes?: any;
|
|
8
13
|
};
|