@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,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcwODYyODQwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TimezoneProps } from '@mui/x-date-pickers/models';
|
|
1
|
+
import { PickerValidDate, TimezoneProps } from '@mui/x-date-pickers/models';
|
|
2
2
|
import { Validator, BaseDateValidationProps, DefaultizedProps } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { DayRangeValidationProps } from '../../models';
|
|
4
4
|
import { DateRangeValidationError, DateRange } from '../../../models';
|
|
5
|
-
export interface DateRangeComponentValidationProps<TDate> extends DayRangeValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
|
|
5
|
+
export interface DateRangeComponentValidationProps<TDate extends PickerValidDate> extends DayRangeValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
|
|
6
6
|
}
|
|
7
7
|
export declare const validateDateRange: Validator<DateRange<any>, any, DateRangeValidationError, DateRangeComponentValidationProps<any>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TimezoneProps } from '@mui/x-date-pickers/models';
|
|
1
|
+
import { PickerValidDate, TimezoneProps } from '@mui/x-date-pickers/models';
|
|
2
2
|
import { Validator, BaseDateValidationProps, TimeValidationProps, DefaultizedProps } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { DayRangeValidationProps } from '../../models/dateRange';
|
|
4
4
|
import { DateTimeRangeValidationError, DateRange } from '../../../models';
|
|
5
|
-
export interface DateTimeRangeComponentValidationProps<TDate> extends DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
|
|
5
|
+
export interface DateTimeRangeComponentValidationProps<TDate extends PickerValidDate> extends DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
|
|
6
6
|
}
|
|
7
7
|
export declare const validateDateTimeRange: Validator<DateRange<any>, any, DateTimeRangeValidationError, DateTimeRangeComponentValidationProps<any>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PickerValueManager, FieldValueManager } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import
|
|
3
|
-
import { RangeFieldSection } from '
|
|
4
|
-
export type RangePickerValueManager<TValue = [any, any], TDate = any, TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerValueManager<TValue, TDate, TError>;
|
|
2
|
+
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
3
|
+
import type { DateRangeValidationError, DateTimeRangeValidationError, TimeRangeValidationError, RangeFieldSection, DateRange } from '../../models';
|
|
4
|
+
export type RangePickerValueManager<TValue = [any, any], TDate extends PickerValidDate = any, TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerValueManager<TValue, TDate, TError>;
|
|
5
5
|
export declare const rangeValueManager: RangePickerValueManager;
|
|
6
6
|
export declare const rangeFieldValueManager: FieldValueManager<DateRange<any>, any, RangeFieldSection>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["value", "referenceDate"];
|
|
4
|
-
import { replaceInvalidDateByNull,
|
|
4
|
+
import { replaceInvalidDateByNull, createDateStrForV7HiddenInputFromSections, createDateStrForV6InputFromSections, areDatesEqual, getTodayDate, getDefaultReferenceDate } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { splitDateRangeSections, removeLastSeparator } from './date-fields-utils';
|
|
6
6
|
export const rangeValueManager = {
|
|
7
7
|
emptyValue: [null, null],
|
|
@@ -50,7 +50,7 @@ export const rangeFieldValueManager = {
|
|
|
50
50
|
}
|
|
51
51
|
return [prevReferenceValue[1], value[1]];
|
|
52
52
|
},
|
|
53
|
-
getSectionsFromValue: (utils, [start, end], fallbackSections,
|
|
53
|
+
getSectionsFromValue: (utils, [start, end], fallbackSections, getSectionsFromDate) => {
|
|
54
54
|
const separatedFallbackSections = fallbackSections == null ? {
|
|
55
55
|
startDate: null,
|
|
56
56
|
endDate: null
|
|
@@ -65,7 +65,8 @@ export const rangeFieldValueManager = {
|
|
|
65
65
|
if (sectionIndex === sections.length - 1 && position === 'start') {
|
|
66
66
|
return _extends({}, section, {
|
|
67
67
|
dateName: position,
|
|
68
|
-
|
|
68
|
+
// TODO: Check if RTL still works
|
|
69
|
+
endSeparator: `${section.endSeparator} – `
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
72
|
return _extends({}, section, {
|
|
@@ -73,11 +74,15 @@ export const rangeFieldValueManager = {
|
|
|
73
74
|
});
|
|
74
75
|
});
|
|
75
76
|
};
|
|
76
|
-
return
|
|
77
|
+
return [...getSections(start, separatedFallbackSections.startDate, 'start'), ...getSections(end, separatedFallbackSections.endDate, 'end')];
|
|
77
78
|
},
|
|
78
|
-
|
|
79
|
+
getV7HiddenInputValueFromSections: sections => {
|
|
79
80
|
const dateRangeSections = splitDateRangeSections(sections);
|
|
80
|
-
return
|
|
81
|
+
return createDateStrForV7HiddenInputFromSections([...dateRangeSections.startDate, ...dateRangeSections.endDate]);
|
|
82
|
+
},
|
|
83
|
+
getV6InputValueFromSections: (sections, localizedDigits, isRTL) => {
|
|
84
|
+
const dateRangeSections = splitDateRangeSections(sections);
|
|
85
|
+
return createDateStrForV6InputFromSections([...dateRangeSections.startDate, ...dateRangeSections.endDate], localizedDigits, isRTL);
|
|
81
86
|
},
|
|
82
87
|
parseValueStr: (valueStr, referenceValue, parseDate) => {
|
|
83
88
|
// TODO: Improve because it would not work if the date format has `–` as a separator.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
|
+
import { BaseFieldProps, UseFieldResponse } from '@mui/x-date-pickers/internals';
|
|
4
|
+
import { BaseSingleInputPickersTextFieldProps, FieldRef, FieldSection, PickerValidDate } from '@mui/x-date-pickers/models';
|
|
5
|
+
import { UseClearableFieldResponse } from '@mui/x-date-pickers/hooks';
|
|
6
|
+
import { SxProps } from '@mui/material/styles';
|
|
7
|
+
export interface RangeFieldSection extends FieldSection {
|
|
8
|
+
dateName: 'start' | 'end';
|
|
9
|
+
}
|
|
10
|
+
export type FieldType = 'single-input' | 'multi-input';
|
|
11
|
+
/**
|
|
12
|
+
* Props the `textField` slot of the multi input field can receive when used inside a picker.
|
|
13
|
+
*/
|
|
14
|
+
export interface MultiInputFieldSlotTextFieldProps {
|
|
15
|
+
label?: React.ReactNode;
|
|
16
|
+
id?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
readOnly?: boolean;
|
|
19
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
20
|
+
onClick?: React.MouseEventHandler;
|
|
21
|
+
onFocus?: React.FocusEventHandler;
|
|
22
|
+
focused?: boolean;
|
|
23
|
+
InputProps?: {
|
|
24
|
+
ref?: React.Ref<any>;
|
|
25
|
+
endAdornment?: React.ReactNode;
|
|
26
|
+
startAdornment?: React.ReactNode;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Props the `root` slot of the multi input field can receive when used inside a picker.
|
|
31
|
+
*/
|
|
32
|
+
export interface MultiInputFieldSlotRootProps {
|
|
33
|
+
onBlur?: React.FocusEventHandler;
|
|
34
|
+
}
|
|
35
|
+
export interface MultiInputFieldRefs {
|
|
36
|
+
unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
37
|
+
unstableEndFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props the multi input field can receive when used inside a picker.
|
|
41
|
+
* Only contains what the MUI components are passing to the field,
|
|
42
|
+
* not what users can pass using the `props.slotProps.field`.
|
|
43
|
+
*/
|
|
44
|
+
export interface BaseMultiInputFieldProps<TValue, TDate extends PickerValidDate, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TError> extends Omit<BaseFieldProps<TValue, TDate, TSection, TEnableAccessibleFieldDOMStructure, TError>, 'unstableFieldRef'> {
|
|
45
|
+
sx?: SxProps<any>;
|
|
46
|
+
unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
47
|
+
unstableEndFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
48
|
+
slots?: {
|
|
49
|
+
root?: React.ElementType;
|
|
50
|
+
separator?: React.ElementType;
|
|
51
|
+
textField?: React.ElementType;
|
|
52
|
+
};
|
|
53
|
+
slotProps?: {
|
|
54
|
+
root?: SlotComponentProps<React.ElementType<MultiInputFieldSlotRootProps>, {}, Record<string, any>>;
|
|
55
|
+
textField?: SlotComponentProps<React.ElementType<MultiInputFieldSlotTextFieldProps>, {}, {
|
|
56
|
+
position?: 'start' | 'end';
|
|
57
|
+
} & Record<string, any>>;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Props the text field receives when used with a multi input picker.
|
|
62
|
+
* Only contains what the MUI components are passing to the text field, not what users can pass using the `props.slotProps.textField`.
|
|
63
|
+
*/
|
|
64
|
+
export type BaseMultiInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = UseClearableFieldResponse<UseFieldResponse<TEnableAccessibleFieldDOMStructure, MultiInputFieldSlotTextFieldProps>>;
|
|
65
|
+
/**
|
|
66
|
+
* Props the text field receives when used with a single or multi input picker.
|
|
67
|
+
* Only contains what the MUI components are passing to the text field, not what users can pass using the `props.slotProps.field` or `props.slotProps.textField`.
|
|
68
|
+
*/
|
|
69
|
+
export type BasePickersTextFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = BaseSingleInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure> & BaseMultiInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure>;
|
package/models/index.d.ts
CHANGED
package/models/index.js
CHANGED
package/models/range.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
1
|
+
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
|
+
export type DateRange<TDate extends PickerValidDate> = [TDate | null, TDate | null];
|
|
3
|
+
export type NonEmptyDateRange<TDate extends PickerValidDate> = [TDate, TDate];
|
|
3
4
|
export type RangePosition = 'start' | 'end';
|
|
@@ -10,7 +10,7 @@ import useMediaQuery from '@mui/material/useMediaQuery';
|
|
|
10
10
|
import { resolveComponentProps, useSlotProps } from '@mui/base/utils';
|
|
11
11
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
12
12
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
13
|
-
import { Watermark } from '@mui/x-license
|
|
13
|
+
import { Watermark } from '@mui/x-license';
|
|
14
14
|
import { PickersCalendarHeader } from '@mui/x-date-pickers/PickersCalendarHeader';
|
|
15
15
|
import { applyDefaultDate, DayCalendar, useDefaultReduceAnimations, PickersArrowSwitcher, useCalendarState, useDefaultDates, useLocaleText, useNextMonthDisabled, usePreviousMonthDisabled, useUtils, useNow, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, buildWarning, useControlledValueWithTimezone, useViews } from '@mui/x-date-pickers/internals';
|
|
16
16
|
import { getReleaseInfo } from '../internals/utils/releaseInfo';
|
|
@@ -526,6 +526,9 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
526
526
|
* @default 2
|
|
527
527
|
*/
|
|
528
528
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
529
|
+
/**
|
|
530
|
+
* Override or extend the styles applied to the component.
|
|
531
|
+
*/
|
|
529
532
|
classes: PropTypes.object,
|
|
530
533
|
className: PropTypes.string,
|
|
531
534
|
/**
|
|
@@ -550,7 +553,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
550
553
|
* The default selected value.
|
|
551
554
|
* Used when the component is not controlled.
|
|
552
555
|
*/
|
|
553
|
-
defaultValue: PropTypes.arrayOf(PropTypes.
|
|
556
|
+
defaultValue: PropTypes.arrayOf(PropTypes.object),
|
|
554
557
|
/**
|
|
555
558
|
* If `true`, after selecting `start` date calendar will not automatically switch to the month of `end` date.
|
|
556
559
|
* @default false
|
|
@@ -588,7 +591,6 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
588
591
|
/**
|
|
589
592
|
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
590
593
|
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
591
|
-
* @default undefined
|
|
592
594
|
*/
|
|
593
595
|
fixedWeekNumber: PropTypes.number,
|
|
594
596
|
/**
|
|
@@ -604,11 +606,11 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
604
606
|
/**
|
|
605
607
|
* Maximal selectable date.
|
|
606
608
|
*/
|
|
607
|
-
maxDate: PropTypes.
|
|
609
|
+
maxDate: PropTypes.object,
|
|
608
610
|
/**
|
|
609
611
|
* Minimal selectable date.
|
|
610
612
|
*/
|
|
611
|
-
minDate: PropTypes.
|
|
613
|
+
minDate: PropTypes.object,
|
|
612
614
|
/**
|
|
613
615
|
* Callback fired when the value changes.
|
|
614
616
|
* @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.
|
|
@@ -667,7 +669,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
667
669
|
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
668
670
|
* @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`.
|
|
669
671
|
*/
|
|
670
|
-
referenceDate: PropTypes.
|
|
672
|
+
referenceDate: PropTypes.object,
|
|
671
673
|
/**
|
|
672
674
|
* Component rendered on the "day" view when `props.loading` is true.
|
|
673
675
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -722,7 +724,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
722
724
|
* The selected value.
|
|
723
725
|
* Used when the component is controlled.
|
|
724
726
|
*/
|
|
725
|
-
value: PropTypes.arrayOf(PropTypes.
|
|
727
|
+
value: PropTypes.arrayOf(PropTypes.object),
|
|
726
728
|
/**
|
|
727
729
|
* The visible view.
|
|
728
730
|
* Used when the component view is controlled.
|
|
@@ -87,7 +87,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
87
87
|
* The default value.
|
|
88
88
|
* Used when the component is not controlled.
|
|
89
89
|
*/
|
|
90
|
-
defaultValue: PropTypes.arrayOf(PropTypes.
|
|
90
|
+
defaultValue: PropTypes.arrayOf(PropTypes.object),
|
|
91
91
|
/**
|
|
92
92
|
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
93
93
|
* @default '@media (pointer: fine)'
|
|
@@ -133,10 +133,13 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
133
133
|
* If `true`, the week number will be display in the calendar.
|
|
134
134
|
*/
|
|
135
135
|
displayWeekNumber: PropTypes.bool,
|
|
136
|
+
/**
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
139
|
+
enableAccessibleFieldDOMStructure: PropTypes.any,
|
|
136
140
|
/**
|
|
137
141
|
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
138
142
|
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
139
|
-
* @default undefined
|
|
140
143
|
*/
|
|
141
144
|
fixedWeekNumber: PropTypes.number,
|
|
142
145
|
/**
|
|
@@ -174,11 +177,11 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
174
177
|
/**
|
|
175
178
|
* Maximal selectable date.
|
|
176
179
|
*/
|
|
177
|
-
maxDate: PropTypes.
|
|
180
|
+
maxDate: PropTypes.object,
|
|
178
181
|
/**
|
|
179
182
|
* Minimal selectable date.
|
|
180
183
|
*/
|
|
181
|
-
minDate: PropTypes.
|
|
184
|
+
minDate: PropTypes.object,
|
|
182
185
|
/**
|
|
183
186
|
* Name attribute used by the `input` element in the Field.
|
|
184
187
|
* Ignored if the field has several inputs.
|
|
@@ -254,7 +257,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
254
257
|
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
255
258
|
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
256
259
|
*/
|
|
257
|
-
referenceDate: PropTypes.
|
|
260
|
+
referenceDate: PropTypes.object,
|
|
258
261
|
/**
|
|
259
262
|
* Component rendered on the "day" view when `props.loading` is true.
|
|
260
263
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -263,17 +266,14 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
263
266
|
renderLoading: PropTypes.func,
|
|
264
267
|
/**
|
|
265
268
|
* The currently selected sections.
|
|
266
|
-
* This prop
|
|
269
|
+
* This prop accepts four formats:
|
|
267
270
|
* 1. If a number is provided, the section at this index will be selected.
|
|
268
|
-
* 2. If
|
|
269
|
-
* 3. If
|
|
270
|
-
* 4. If `null` is provided, no section will be selected
|
|
271
|
+
* 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
|
|
272
|
+
* 3. If `"all"` is provided, all the sections will be selected.
|
|
273
|
+
* 4. If `null` is provided, no section will be selected.
|
|
271
274
|
* If not provided, the selected sections will be handled internally.
|
|
272
275
|
*/
|
|
273
|
-
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number,
|
|
274
|
-
endIndex: PropTypes.number.isRequired,
|
|
275
|
-
startIndex: PropTypes.number.isRequired
|
|
276
|
-
})]),
|
|
276
|
+
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
|
|
277
277
|
/**
|
|
278
278
|
* Disable specific date.
|
|
279
279
|
*
|
|
@@ -322,7 +322,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
322
322
|
* The selected value.
|
|
323
323
|
* Used when the component is controlled.
|
|
324
324
|
*/
|
|
325
|
-
value: PropTypes.arrayOf(PropTypes.
|
|
325
|
+
value: PropTypes.arrayOf(PropTypes.object),
|
|
326
326
|
/**
|
|
327
327
|
* Define custom view renderers for each section.
|
|
328
328
|
* If `null`, the section will only have field editing.
|
|
@@ -93,6 +93,9 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
93
93
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
94
94
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
95
95
|
// ----------------------------------------------------------------------
|
|
96
|
+
/**
|
|
97
|
+
* Override or extend the styles applied to the component.
|
|
98
|
+
*/
|
|
96
99
|
classes: PropTypes.object,
|
|
97
100
|
className: PropTypes.string,
|
|
98
101
|
disabled: PropTypes.bool,
|
|
@@ -104,6 +107,9 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
104
107
|
onRangePositionChange: PropTypes.func.isRequired,
|
|
105
108
|
rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
|
|
106
109
|
readOnly: PropTypes.bool,
|
|
110
|
+
/**
|
|
111
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
112
|
+
*/
|
|
107
113
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
108
114
|
titleId: PropTypes.string,
|
|
109
115
|
/**
|
|
@@ -115,6 +121,6 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
115
121
|
* @default "––"
|
|
116
122
|
*/
|
|
117
123
|
toolbarPlaceholder: PropTypes.node,
|
|
118
|
-
value: PropTypes.arrayOf(PropTypes.
|
|
124
|
+
value: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
119
125
|
} : void 0;
|
|
120
126
|
export { DateRangePickerToolbar };
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className", "day", "outsideCurrentMonth", "isEndOfHighlighti
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { useLicenseVerifier } from '@mui/x-license
|
|
7
|
+
import { useLicenseVerifier } from '@mui/x-license';
|
|
8
8
|
import { alpha, styled, useThemeProps } from '@mui/material/styles';
|
|
9
9
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
10
10
|
import { useUtils } from '@mui/x-date-pickers/internals';
|
|
@@ -237,7 +237,7 @@ process.env.NODE_ENV !== "production" ? DateRangePickerDayRaw.propTypes = {
|
|
|
237
237
|
/**
|
|
238
238
|
* The date to show.
|
|
239
239
|
*/
|
|
240
|
-
day: PropTypes.
|
|
240
|
+
day: PropTypes.object.isRequired,
|
|
241
241
|
/**
|
|
242
242
|
* If `true`, renders as disabled.
|
|
243
243
|
* @default false
|
|
@@ -3,6 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["desktopModeMediaQuery"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import { refType } from '@mui/utils';
|
|
6
7
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
7
8
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
9
|
import { DesktopDateTimeRangePicker } from '../DesktopDateTimeRangePicker';
|
|
@@ -81,7 +82,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
81
82
|
* The default value.
|
|
82
83
|
* Used when the component is not controlled.
|
|
83
84
|
*/
|
|
84
|
-
defaultValue: PropTypes.arrayOf(PropTypes.
|
|
85
|
+
defaultValue: PropTypes.arrayOf(PropTypes.object),
|
|
85
86
|
/**
|
|
86
87
|
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
87
88
|
* @default '@media (pointer: fine)'
|
|
@@ -132,10 +133,13 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
132
133
|
* If `true`, the week number will be display in the calendar.
|
|
133
134
|
*/
|
|
134
135
|
displayWeekNumber: PropTypes.bool,
|
|
136
|
+
/**
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
139
|
+
enableAccessibleFieldDOMStructure: PropTypes.any,
|
|
135
140
|
/**
|
|
136
141
|
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
137
142
|
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
138
|
-
* @default undefined
|
|
139
143
|
*/
|
|
140
144
|
fixedWeekNumber: PropTypes.number,
|
|
141
145
|
/**
|
|
@@ -153,9 +157,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
153
157
|
* Pass a ref to the `input` element.
|
|
154
158
|
* Ignored if the field has several inputs.
|
|
155
159
|
*/
|
|
156
|
-
inputRef:
|
|
157
|
-
current: PropTypes.object
|
|
158
|
-
})]),
|
|
160
|
+
inputRef: refType,
|
|
159
161
|
/**
|
|
160
162
|
* The label content.
|
|
161
163
|
* Ignored if the field has several inputs.
|
|
@@ -175,29 +177,29 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
175
177
|
/**
|
|
176
178
|
* Maximal selectable date.
|
|
177
179
|
*/
|
|
178
|
-
maxDate: PropTypes.
|
|
180
|
+
maxDate: PropTypes.object,
|
|
179
181
|
/**
|
|
180
182
|
* Maximal selectable moment of time with binding to date, to set max time in each day use `maxTime`.
|
|
181
183
|
*/
|
|
182
|
-
maxDateTime: PropTypes.
|
|
184
|
+
maxDateTime: PropTypes.object,
|
|
183
185
|
/**
|
|
184
186
|
* Maximal selectable time.
|
|
185
187
|
* The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
|
|
186
188
|
*/
|
|
187
|
-
maxTime: PropTypes.
|
|
189
|
+
maxTime: PropTypes.object,
|
|
188
190
|
/**
|
|
189
191
|
* Minimal selectable date.
|
|
190
192
|
*/
|
|
191
|
-
minDate: PropTypes.
|
|
193
|
+
minDate: PropTypes.object,
|
|
192
194
|
/**
|
|
193
195
|
* Minimal selectable moment of time with binding to date, to set min time in each day use `minTime`.
|
|
194
196
|
*/
|
|
195
|
-
minDateTime: PropTypes.
|
|
197
|
+
minDateTime: PropTypes.object,
|
|
196
198
|
/**
|
|
197
199
|
* Minimal selectable time.
|
|
198
200
|
* The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
|
|
199
201
|
*/
|
|
200
|
-
minTime: PropTypes.
|
|
202
|
+
minTime: PropTypes.object,
|
|
201
203
|
/**
|
|
202
204
|
* Step over minutes.
|
|
203
205
|
* @default 1
|
|
@@ -290,7 +292,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
290
292
|
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
291
293
|
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
292
294
|
*/
|
|
293
|
-
referenceDate: PropTypes.
|
|
295
|
+
referenceDate: PropTypes.object,
|
|
294
296
|
/**
|
|
295
297
|
* Component rendered on the "day" view when `props.loading` is true.
|
|
296
298
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -299,17 +301,14 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
299
301
|
renderLoading: PropTypes.func,
|
|
300
302
|
/**
|
|
301
303
|
* The currently selected sections.
|
|
302
|
-
* This prop
|
|
304
|
+
* This prop accepts four formats:
|
|
303
305
|
* 1. If a number is provided, the section at this index will be selected.
|
|
304
|
-
* 2. If
|
|
305
|
-
* 3. If
|
|
306
|
-
* 4. If `null` is provided, no section will be selected
|
|
306
|
+
* 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
|
|
307
|
+
* 3. If `"all"` is provided, all the sections will be selected.
|
|
308
|
+
* 4. If `null` is provided, no section will be selected.
|
|
307
309
|
* If not provided, the selected sections will be handled internally.
|
|
308
310
|
*/
|
|
309
|
-
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number,
|
|
310
|
-
endIndex: PropTypes.number.isRequired,
|
|
311
|
-
startIndex: PropTypes.number.isRequired
|
|
312
|
-
})]),
|
|
311
|
+
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
|
|
313
312
|
/**
|
|
314
313
|
* Disable specific date.
|
|
315
314
|
*
|
|
@@ -387,7 +386,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
|
|
|
387
386
|
* The selected value.
|
|
388
387
|
* Used when the component is controlled.
|
|
389
388
|
*/
|
|
390
|
-
value: PropTypes.arrayOf(PropTypes.
|
|
389
|
+
value: PropTypes.arrayOf(PropTypes.object),
|
|
391
390
|
/**
|
|
392
391
|
* The visible view.
|
|
393
392
|
* Used when the component view is controlled.
|
|
@@ -76,7 +76,8 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
76
76
|
hidden = typeof window === 'undefined' || window.innerHeight < 667,
|
|
77
77
|
rangePosition,
|
|
78
78
|
onRangePositionChange,
|
|
79
|
-
className
|
|
79
|
+
className,
|
|
80
|
+
sx
|
|
80
81
|
} = props;
|
|
81
82
|
const localeText = useLocaleText();
|
|
82
83
|
const classes = useUtilityClasses(props);
|
|
@@ -120,6 +121,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
|
|
|
120
121
|
return /*#__PURE__*/_jsxs(DateTimeRangePickerTabsRoot, {
|
|
121
122
|
ownerState: props,
|
|
122
123
|
className: clsx(classes.root, className),
|
|
124
|
+
sx: sx,
|
|
123
125
|
children: [!isPreviousHidden ? /*#__PURE__*/_jsx(IconButton, {
|
|
124
126
|
onClick: changeToPreviousTab,
|
|
125
127
|
className: classes.navigationButton,
|
|
@@ -170,6 +172,10 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerTabs.propTypes = {
|
|
|
170
172
|
*/
|
|
171
173
|
onViewChange: PropTypes.func.isRequired,
|
|
172
174
|
rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
|
|
175
|
+
/**
|
|
176
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
177
|
+
*/
|
|
178
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
173
179
|
/**
|
|
174
180
|
* Time tab icon.
|
|
175
181
|
* @default TimeIcon
|
|
@@ -135,6 +135,9 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
|
|
|
135
135
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
136
136
|
// ----------------------------------------------------------------------
|
|
137
137
|
ampm: PropTypes.bool,
|
|
138
|
+
/**
|
|
139
|
+
* Override or extend the styles applied to the component.
|
|
140
|
+
*/
|
|
138
141
|
classes: PropTypes.object,
|
|
139
142
|
className: PropTypes.string,
|
|
140
143
|
disabled: PropTypes.bool,
|
|
@@ -154,6 +157,9 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
|
|
|
154
157
|
onViewChange: PropTypes.func.isRequired,
|
|
155
158
|
rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
|
|
156
159
|
readOnly: PropTypes.bool,
|
|
160
|
+
/**
|
|
161
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
162
|
+
*/
|
|
157
163
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
158
164
|
titleId: PropTypes.string,
|
|
159
165
|
/**
|
|
@@ -166,7 +172,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
|
|
|
166
172
|
*/
|
|
167
173
|
toolbarPlaceholder: PropTypes.node,
|
|
168
174
|
toolbarVariant: PropTypes.oneOf(['desktop', 'mobile']),
|
|
169
|
-
value: PropTypes.arrayOf(PropTypes.
|
|
175
|
+
value: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
170
176
|
/**
|
|
171
177
|
* Currently visible picker view.
|
|
172
178
|
*/
|
|
@@ -98,7 +98,7 @@ DesktopDateRangePicker.propTypes = {
|
|
|
98
98
|
* The default value.
|
|
99
99
|
* Used when the component is not controlled.
|
|
100
100
|
*/
|
|
101
|
-
defaultValue: PropTypes.arrayOf(PropTypes.
|
|
101
|
+
defaultValue: PropTypes.arrayOf(PropTypes.object),
|
|
102
102
|
/**
|
|
103
103
|
* If `true`, after selecting `start` date calendar will not automatically switch to the month of `end` date.
|
|
104
104
|
* @default false
|
|
@@ -138,10 +138,13 @@ DesktopDateRangePicker.propTypes = {
|
|
|
138
138
|
* If `true`, the week number will be display in the calendar.
|
|
139
139
|
*/
|
|
140
140
|
displayWeekNumber: PropTypes.bool,
|
|
141
|
+
/**
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
enableAccessibleFieldDOMStructure: PropTypes.any,
|
|
141
145
|
/**
|
|
142
146
|
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
143
147
|
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
144
|
-
* @default undefined
|
|
145
148
|
*/
|
|
146
149
|
fixedWeekNumber: PropTypes.number,
|
|
147
150
|
/**
|
|
@@ -179,11 +182,11 @@ DesktopDateRangePicker.propTypes = {
|
|
|
179
182
|
/**
|
|
180
183
|
* Maximal selectable date.
|
|
181
184
|
*/
|
|
182
|
-
maxDate: PropTypes.
|
|
185
|
+
maxDate: PropTypes.object,
|
|
183
186
|
/**
|
|
184
187
|
* Minimal selectable date.
|
|
185
188
|
*/
|
|
186
|
-
minDate: PropTypes.
|
|
189
|
+
minDate: PropTypes.object,
|
|
187
190
|
/**
|
|
188
191
|
* Name attribute used by the `input` element in the Field.
|
|
189
192
|
* Ignored if the field has several inputs.
|
|
@@ -259,7 +262,7 @@ DesktopDateRangePicker.propTypes = {
|
|
|
259
262
|
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
260
263
|
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
261
264
|
*/
|
|
262
|
-
referenceDate: PropTypes.
|
|
265
|
+
referenceDate: PropTypes.object,
|
|
263
266
|
/**
|
|
264
267
|
* Component rendered on the "day" view when `props.loading` is true.
|
|
265
268
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -268,17 +271,14 @@ DesktopDateRangePicker.propTypes = {
|
|
|
268
271
|
renderLoading: PropTypes.func,
|
|
269
272
|
/**
|
|
270
273
|
* The currently selected sections.
|
|
271
|
-
* This prop
|
|
274
|
+
* This prop accepts four formats:
|
|
272
275
|
* 1. If a number is provided, the section at this index will be selected.
|
|
273
|
-
* 2. If
|
|
274
|
-
* 3. If
|
|
275
|
-
* 4. If `null` is provided, no section will be selected
|
|
276
|
+
* 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.
|
|
277
|
+
* 3. If `"all"` is provided, all the sections will be selected.
|
|
278
|
+
* 4. If `null` is provided, no section will be selected.
|
|
276
279
|
* If not provided, the selected sections will be handled internally.
|
|
277
280
|
*/
|
|
278
|
-
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number,
|
|
279
|
-
endIndex: PropTypes.number.isRequired,
|
|
280
|
-
startIndex: PropTypes.number.isRequired
|
|
281
|
-
})]),
|
|
281
|
+
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
|
|
282
282
|
/**
|
|
283
283
|
* Disable specific date.
|
|
284
284
|
*
|
|
@@ -327,7 +327,7 @@ DesktopDateRangePicker.propTypes = {
|
|
|
327
327
|
* The selected value.
|
|
328
328
|
* Used when the component is controlled.
|
|
329
329
|
*/
|
|
330
|
-
value: PropTypes.arrayOf(PropTypes.
|
|
330
|
+
value: PropTypes.arrayOf(PropTypes.object),
|
|
331
331
|
/**
|
|
332
332
|
* Define custom view renderers for each section.
|
|
333
333
|
* If `null`, the section will only have field editing.
|