@mui/x-date-pickers 7.16.0 → 7.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/AdapterDateFns.js +1 -1
- package/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
- package/AdapterDayjs/AdapterDayjs.js +1 -1
- package/CHANGELOG.md +184 -4
- package/DateCalendar/DateCalendar.js +11 -1
- package/DateCalendar/useCalendarState.js +2 -0
- package/DateCalendar/useIsDateDisabled.d.ts +4 -3
- package/DateCalendar/useIsDateDisabled.js +5 -3
- package/DateField/DateField.js +2 -0
- package/DateField/DateField.types.d.ts +7 -2
- package/DateField/index.d.ts +1 -1
- package/DateField/useDateField.d.ts +1 -1
- package/DateField/useDateField.js +5 -3
- package/DatePicker/DatePicker.js +8 -0
- package/DatePicker/DatePicker.types.d.ts +5 -5
- package/DatePicker/DatePickerToolbar.js +2 -0
- package/DateTimeField/DateTimeField.js +2 -0
- package/DateTimeField/DateTimeField.types.d.ts +7 -2
- package/DateTimeField/index.d.ts +1 -1
- package/DateTimeField/useDateTimeField.d.ts +1 -1
- package/DateTimeField/useDateTimeField.js +5 -3
- package/DateTimePicker/DateTimePicker.js +8 -0
- package/DateTimePicker/DateTimePicker.types.d.ts +7 -6
- package/DateTimePicker/DateTimePickerTabs.js +2 -0
- package/DateTimePicker/DateTimePickerToolbar.js +2 -0
- package/DayCalendarSkeleton/DayCalendarSkeleton.js +2 -0
- package/DesktopDatePicker/DesktopDatePicker.js +16 -3
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +7 -6
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +16 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +11 -10
- package/DesktopTimePicker/DesktopTimePicker.js +10 -3
- package/DigitalClock/DigitalClock.js +2 -0
- package/LocalizationProvider/LocalizationProvider.js +2 -0
- package/MobileDatePicker/MobileDatePicker.js +16 -3
- package/MobileDatePicker/MobileDatePicker.types.d.ts +5 -0
- package/MobileDateTimePicker/MobileDateTimePicker.js +16 -3
- package/MobileTimePicker/MobileTimePicker.js +10 -3
- package/MonthCalendar/MonthCalendar.js +2 -0
- package/MonthCalendar/MonthCalendar.types.d.ts +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/PickersActionBar/PickersActionBar.js +2 -0
- package/PickersCalendarHeader/PickersCalendarHeader.js +2 -0
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +1 -1
- package/PickersDay/PickersDay.js +2 -0
- package/PickersLayout/PickersLayout.js +2 -0
- package/PickersLayout/usePickerLayout.js +2 -0
- package/PickersSectionList/PickersSectionList.js +2 -0
- package/PickersShortcuts/PickersShortcuts.js +2 -0
- package/PickersTextField/PickersTextField.js +2 -0
- package/StaticDatePicker/StaticDatePicker.js +10 -2
- package/StaticDatePicker/StaticDatePicker.types.d.ts +5 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +10 -2
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +5 -0
- package/StaticTimePicker/StaticTimePicker.js +3 -1
- package/TimeClock/Clock.js +1 -1
- package/TimeClock/TimeClock.js +2 -0
- package/TimeField/TimeField.js +2 -0
- package/TimeField/TimeField.types.d.ts +7 -2
- package/TimeField/index.d.ts +1 -1
- package/TimeField/useTimeField.d.ts +1 -1
- package/TimeField/useTimeField.js +5 -3
- package/TimePicker/TimePicker.js +2 -0
- package/TimePicker/TimePickerToolbar.js +2 -0
- package/YearCalendar/YearCalendar.js +21 -6
- package/YearCalendar/YearCalendar.types.d.ts +7 -1
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.js +2 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useClearableField.js +2 -0
- package/hooks/usePickersTranslations.js +2 -0
- package/hooks/useSplitFieldProps.d.ts +19 -0
- package/hooks/useSplitFieldProps.js +43 -0
- package/index.d.ts +1 -0
- package/index.js +3 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +2 -2
- package/internals/hooks/useField/useField.js +11 -6
- package/internals/hooks/useField/useField.types.d.ts +4 -22
- package/internals/hooks/useField/useFieldState.js +2 -4
- package/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +2 -2
- package/internals/hooks/usePicker/usePicker.d.ts +1 -2
- package/internals/hooks/usePicker/usePicker.js +1 -1
- package/internals/hooks/usePicker/usePickerValue.d.ts +1 -2
- package/internals/hooks/usePicker/usePickerValue.js +12 -16
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +4 -15
- package/internals/index.d.ts +0 -8
- package/internals/index.js +0 -7
- package/locales/beBY.d.ts +3 -3
- package/locales/beBY.js +4 -4
- package/locales/caES.d.ts +3 -3
- package/locales/caES.js +3 -3
- package/locales/csCZ.d.ts +3 -3
- package/locales/csCZ.js +4 -4
- package/locales/daDK.d.ts +3 -3
- package/locales/daDK.js +3 -3
- package/locales/deDE.d.ts +3 -3
- package/locales/deDE.js +3 -3
- package/locales/elGR.d.ts +3 -3
- package/locales/elGR.js +4 -4
- package/locales/enUS.d.ts +3 -3
- package/locales/enUS.js +4 -4
- package/locales/esES.d.ts +3 -3
- package/locales/esES.js +3 -3
- package/locales/eu.d.ts +3 -3
- package/locales/eu.js +3 -3
- package/locales/faIR.d.ts +3 -3
- package/locales/faIR.js +3 -3
- package/locales/fiFI.d.ts +3 -3
- package/locales/fiFI.js +3 -3
- package/locales/frFR.d.ts +3 -3
- package/locales/frFR.js +3 -3
- package/locales/heIL.d.ts +3 -3
- package/locales/heIL.js +3 -3
- package/locales/huHU.d.ts +3 -3
- package/locales/huHU.js +3 -3
- package/locales/isIS.d.ts +3 -3
- package/locales/isIS.js +4 -4
- package/locales/itIT.d.ts +3 -3
- package/locales/itIT.js +3 -3
- package/locales/jaJP.d.ts +3 -3
- package/locales/jaJP.js +3 -3
- package/locales/koKR.d.ts +3 -3
- package/locales/koKR.js +3 -3
- package/locales/kzKZ.d.ts +3 -3
- package/locales/kzKZ.js +4 -4
- package/locales/mk.d.ts +3 -3
- package/locales/mk.js +3 -3
- package/locales/nbNO.d.ts +3 -3
- package/locales/nbNO.js +4 -4
- package/locales/nlNL.d.ts +3 -3
- package/locales/nlNL.js +3 -3
- package/locales/nnNO.d.ts +3 -3
- package/locales/nnNO.js +3 -3
- package/locales/plPL.d.ts +3 -3
- package/locales/plPL.js +4 -4
- package/locales/ptBR.d.ts +3 -3
- package/locales/ptBR.js +4 -4
- package/locales/roRO.d.ts +3 -3
- package/locales/roRO.js +3 -3
- package/locales/ruRU.d.ts +3 -3
- package/locales/ruRU.js +3 -3
- package/locales/skSK.d.ts +3 -3
- package/locales/skSK.js +4 -4
- package/locales/svSE.d.ts +3 -3
- package/locales/svSE.js +3 -3
- package/locales/trTR.d.ts +3 -3
- package/locales/trTR.js +4 -4
- package/locales/ukUA.d.ts +3 -3
- package/locales/ukUA.js +3 -3
- package/locales/urPK.d.ts +3 -3
- package/locales/urPK.js +4 -4
- package/locales/utils/getPickersLocalization.d.ts +10 -3
- package/locales/utils/getPickersLocalization.js +13 -0
- package/locales/utils/pickersLocaleTextApi.d.ts +27 -3
- package/locales/viVN.d.ts +3 -3
- package/locales/viVN.js +3 -3
- package/locales/zhCN.d.ts +3 -3
- package/locales/zhCN.js +3 -3
- package/locales/zhHK.d.ts +3 -3
- package/locales/zhHK.js +3 -3
- package/models/validation.d.ts +13 -0
- package/modern/AdapterDateFns/AdapterDateFns.js +1 -1
- package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
- package/modern/AdapterDayjs/AdapterDayjs.js +1 -1
- package/modern/DateCalendar/DateCalendar.js +11 -1
- package/modern/DateCalendar/useCalendarState.js +2 -0
- package/modern/DateCalendar/useIsDateDisabled.js +5 -3
- package/modern/DateField/DateField.js +2 -0
- package/modern/DateField/useDateField.js +5 -3
- package/modern/DatePicker/DatePicker.js +8 -0
- package/modern/DatePicker/DatePickerToolbar.js +2 -0
- package/modern/DateTimeField/DateTimeField.js +2 -0
- package/modern/DateTimeField/useDateTimeField.js +5 -3
- package/modern/DateTimePicker/DateTimePicker.js +8 -0
- package/modern/DateTimePicker/DateTimePickerTabs.js +2 -0
- package/modern/DateTimePicker/DateTimePickerToolbar.js +2 -0
- package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +2 -0
- package/modern/DesktopDatePicker/DesktopDatePicker.js +16 -3
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +16 -3
- package/modern/DesktopTimePicker/DesktopTimePicker.js +10 -3
- package/modern/DigitalClock/DigitalClock.js +2 -0
- package/modern/LocalizationProvider/LocalizationProvider.js +2 -0
- package/modern/MobileDatePicker/MobileDatePicker.js +16 -3
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +16 -3
- package/modern/MobileTimePicker/MobileTimePicker.js +10 -3
- package/modern/MonthCalendar/MonthCalendar.js +2 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/modern/PickersActionBar/PickersActionBar.js +2 -0
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +2 -0
- package/modern/PickersDay/PickersDay.js +2 -0
- package/modern/PickersLayout/PickersLayout.js +2 -0
- package/modern/PickersLayout/usePickerLayout.js +2 -0
- package/modern/PickersSectionList/PickersSectionList.js +2 -0
- package/modern/PickersShortcuts/PickersShortcuts.js +2 -0
- package/modern/PickersTextField/PickersTextField.js +2 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +10 -2
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +10 -2
- package/modern/StaticTimePicker/StaticTimePicker.js +3 -1
- package/modern/TimeClock/Clock.js +1 -1
- package/modern/TimeClock/TimeClock.js +2 -0
- package/modern/TimeField/TimeField.js +2 -0
- package/modern/TimeField/useTimeField.js +5 -3
- package/modern/TimePicker/TimePicker.js +2 -0
- package/modern/TimePicker/TimePickerToolbar.js +2 -0
- package/modern/YearCalendar/YearCalendar.js +21 -6
- package/modern/dateViewRenderers/dateViewRenderers.js +2 -0
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/useClearableField.js +2 -0
- package/modern/hooks/usePickersTranslations.js +2 -0
- package/modern/hooks/useSplitFieldProps.js +43 -0
- package/modern/index.js +3 -2
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
- package/modern/internals/hooks/useField/useField.js +11 -6
- package/modern/internals/hooks/useField/useFieldState.js +2 -4
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
- package/modern/internals/hooks/usePicker/usePicker.js +1 -1
- package/modern/internals/hooks/usePicker/usePickerValue.js +12 -16
- package/modern/internals/index.js +0 -7
- package/modern/locales/beBY.js +4 -4
- package/modern/locales/caES.js +3 -3
- package/modern/locales/csCZ.js +4 -4
- package/modern/locales/daDK.js +3 -3
- package/modern/locales/deDE.js +3 -3
- package/modern/locales/elGR.js +4 -4
- package/modern/locales/enUS.js +4 -4
- package/modern/locales/esES.js +3 -3
- package/modern/locales/eu.js +3 -3
- package/modern/locales/faIR.js +3 -3
- package/modern/locales/fiFI.js +3 -3
- package/modern/locales/frFR.js +3 -3
- package/modern/locales/heIL.js +3 -3
- package/modern/locales/huHU.js +3 -3
- package/modern/locales/isIS.js +4 -4
- package/modern/locales/itIT.js +3 -3
- package/modern/locales/jaJP.js +3 -3
- package/modern/locales/koKR.js +3 -3
- package/modern/locales/kzKZ.js +4 -4
- package/modern/locales/mk.js +3 -3
- package/modern/locales/nbNO.js +4 -4
- package/modern/locales/nlNL.js +3 -3
- package/modern/locales/nnNO.js +3 -3
- package/modern/locales/plPL.js +4 -4
- package/modern/locales/ptBR.js +4 -4
- package/modern/locales/roRO.js +3 -3
- package/modern/locales/ruRU.js +3 -3
- package/modern/locales/skSK.js +4 -4
- package/modern/locales/svSE.js +3 -3
- package/modern/locales/trTR.js +4 -4
- package/modern/locales/ukUA.js +3 -3
- package/modern/locales/urPK.js +4 -4
- package/modern/locales/utils/getPickersLocalization.js +13 -0
- package/modern/locales/viVN.js +3 -3
- package/modern/locales/zhCN.js +3 -3
- package/modern/locales/zhHK.js +3 -3
- package/modern/validation/index.js +5 -0
- package/modern/validation/useValidation.js +54 -0
- package/{internals/utils → modern}/validation/validateDate.js +6 -4
- package/modern/{internals/utils/validation → validation}/validateDateTime.js +8 -3
- package/{internals/utils → modern}/validation/validateTime.js +6 -4
- package/node/AdapterDateFns/AdapterDateFns.js +1 -1
- package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
- package/node/AdapterDayjs/AdapterDayjs.js +1 -1
- package/node/DateCalendar/DateCalendar.js +10 -1
- package/node/DateCalendar/useCalendarState.js +1 -0
- package/node/DateCalendar/useIsDateDisabled.js +5 -4
- package/node/DateField/DateField.js +1 -0
- package/node/DateField/useDateField.js +5 -4
- package/node/DatePicker/DatePicker.js +7 -0
- package/node/DatePicker/DatePickerToolbar.js +1 -0
- package/node/DateTimeField/DateTimeField.js +1 -0
- package/node/DateTimeField/useDateTimeField.js +5 -4
- package/node/DateTimePicker/DateTimePicker.js +7 -0
- package/node/DateTimePicker/DateTimePickerTabs.js +1 -0
- package/node/DateTimePicker/DateTimePickerToolbar.js +1 -0
- package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -0
- package/node/DesktopDatePicker/DesktopDatePicker.js +17 -5
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +17 -5
- package/node/DesktopTimePicker/DesktopTimePicker.js +11 -5
- package/node/DigitalClock/DigitalClock.js +1 -0
- package/node/LocalizationProvider/LocalizationProvider.js +1 -0
- package/node/MobileDatePicker/MobileDatePicker.js +17 -5
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +17 -5
- package/node/MobileTimePicker/MobileTimePicker.js +11 -5
- package/node/MonthCalendar/MonthCalendar.js +1 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/node/PickersActionBar/PickersActionBar.js +1 -0
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +1 -0
- package/node/PickersDay/PickersDay.js +1 -0
- package/node/PickersLayout/PickersLayout.js +1 -0
- package/node/PickersLayout/usePickerLayout.js +1 -0
- package/node/PickersSectionList/PickersSectionList.js +1 -0
- package/node/PickersShortcuts/PickersShortcuts.js +1 -0
- package/node/PickersTextField/PickersTextField.js +1 -0
- package/node/StaticDatePicker/StaticDatePicker.js +10 -3
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +10 -3
- package/node/StaticTimePicker/StaticTimePicker.js +3 -2
- package/node/TimeClock/Clock.js +1 -1
- package/node/TimeClock/TimeClock.js +1 -0
- package/node/TimeField/TimeField.js +1 -0
- package/node/TimeField/useTimeField.js +5 -4
- package/node/TimePicker/TimePicker.js +1 -0
- package/node/TimePicker/TimePickerToolbar.js +1 -0
- package/node/YearCalendar/YearCalendar.js +20 -6
- package/node/dateViewRenderers/dateViewRenderers.js +2 -0
- package/node/hooks/index.js +8 -1
- package/node/hooks/useClearableField.js +1 -0
- package/node/hooks/usePickersTranslations.js +1 -0
- package/node/hooks/useSplitFieldProps.js +51 -0
- package/node/index.js +13 -1
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -3
- package/node/internals/hooks/useField/useField.js +11 -6
- package/node/internals/hooks/useField/useFieldState.js +2 -4
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +1 -3
- package/node/internals/hooks/usePicker/usePicker.js +1 -1
- package/node/internals/hooks/usePicker/usePickerValue.js +12 -16
- package/node/internals/index.js +0 -49
- package/node/locales/beBY.js +4 -4
- package/node/locales/caES.js +3 -3
- package/node/locales/csCZ.js +4 -4
- package/node/locales/daDK.js +3 -3
- package/node/locales/deDE.js +3 -3
- package/node/locales/elGR.js +4 -4
- package/node/locales/enUS.js +4 -4
- package/node/locales/esES.js +3 -3
- package/node/locales/eu.js +3 -3
- package/node/locales/faIR.js +3 -3
- package/node/locales/fiFI.js +3 -3
- package/node/locales/frFR.js +3 -3
- package/node/locales/heIL.js +3 -3
- package/node/locales/huHU.js +3 -3
- package/node/locales/isIS.js +4 -4
- package/node/locales/itIT.js +3 -3
- package/node/locales/jaJP.js +3 -3
- package/node/locales/koKR.js +3 -3
- package/node/locales/kzKZ.js +4 -4
- package/node/locales/mk.js +3 -3
- package/node/locales/nbNO.js +4 -4
- package/node/locales/nlNL.js +3 -3
- package/node/locales/nnNO.js +3 -3
- package/node/locales/plPL.js +4 -4
- package/node/locales/ptBR.js +4 -4
- package/node/locales/roRO.js +3 -3
- package/node/locales/ruRU.js +3 -3
- package/node/locales/skSK.js +4 -4
- package/node/locales/svSE.js +3 -3
- package/node/locales/trTR.js +4 -4
- package/node/locales/ukUA.js +3 -3
- package/node/locales/urPK.js +4 -4
- package/node/locales/utils/getPickersLocalization.js +16 -2
- package/node/locales/viVN.js +3 -3
- package/node/locales/zhCN.js +3 -3
- package/node/locales/zhHK.js +3 -3
- package/node/validation/index.js +40 -0
- package/node/validation/useValidation.js +61 -0
- package/node/{internals/utils/validation → validation}/validateDate.js +6 -4
- package/node/{internals/utils/validation → validation}/validateDateTime.js +8 -3
- package/node/{internals/utils/validation → validation}/validateTime.js +6 -4
- package/package.json +4 -4
- package/{internals/utils/validation → validation}/extractValidationProps.d.ts +1 -1
- package/validation/index.d.ts +9 -0
- package/validation/index.js +5 -0
- package/validation/package.json +6 -0
- package/validation/useValidation.d.ts +68 -0
- package/validation/useValidation.js +54 -0
- package/validation/validateDate.d.ts +6 -0
- package/{modern/internals/utils/validation → validation}/validateDate.js +6 -4
- package/validation/validateDateTime.d.ts +7 -0
- package/{internals/utils/validation → validation}/validateDateTime.js +8 -3
- package/validation/validateTime.d.ts +6 -0
- package/{modern/internals/utils/validation → validation}/validateTime.js +6 -4
- package/internals/hooks/useValidation.d.ts +0 -24
- package/internals/hooks/useValidation.js +0 -22
- package/internals/utils/fields.d.ts +0 -5
- package/internals/utils/fields.js +0 -28
- package/internals/utils/validation/validateDate.d.ts +0 -7
- package/internals/utils/validation/validateDateTime.d.ts +0 -7
- package/internals/utils/validation/validateTime.d.ts +0 -7
- package/internals/utils/warning.d.ts +0 -2
- package/internals/utils/warning.js +0 -21
- package/modern/internals/hooks/useValidation.js +0 -22
- package/modern/internals/utils/fields.js +0 -28
- package/modern/internals/utils/warning.js +0 -21
- package/node/internals/hooks/useValidation.js +0 -29
- package/node/internals/utils/fields.js +0 -36
- package/node/internals/utils/warning.js +0 -28
- /package/{internals/utils → modern}/validation/extractValidationProps.js +0 -0
- /package/node/{internals/utils/validation → validation}/extractValidationProps.js +0 -0
- /package/{modern/internals/utils/validation → validation}/extractValidationProps.js +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["autoFocus", "className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
5
|
+
const _excluded = ["autoFocus", "className", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "readOnly", "shouldDisableYear", "disableHighlightToday", "onYearFocus", "hasFocus", "onFocusedViewChange", "yearsOrder", "yearsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
8
|
import clsx from 'clsx';
|
|
@@ -86,6 +88,7 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
86
88
|
onYearFocus,
|
|
87
89
|
hasFocus,
|
|
88
90
|
onFocusedViewChange,
|
|
91
|
+
yearsOrder = 'asc',
|
|
89
92
|
yearsPerRow,
|
|
90
93
|
timezone: timezoneProp,
|
|
91
94
|
gridLabelId,
|
|
@@ -175,22 +178,24 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
175
178
|
React.useEffect(() => {
|
|
176
179
|
setFocusedYear(prevFocusedYear => selectedYear !== null && prevFocusedYear !== selectedYear ? selectedYear : prevFocusedYear);
|
|
177
180
|
}, [selectedYear]);
|
|
181
|
+
const verticalDirection = yearsOrder !== 'desc' ? yearsPerRow * 1 : yearsPerRow * -1;
|
|
182
|
+
const horizontalDirection = isRtl || yearsOrder === 'desc' ? -1 : 1;
|
|
178
183
|
const handleKeyDown = useEventCallback((event, year) => {
|
|
179
184
|
switch (event.key) {
|
|
180
185
|
case 'ArrowUp':
|
|
181
|
-
focusYear(year -
|
|
186
|
+
focusYear(year - verticalDirection);
|
|
182
187
|
event.preventDefault();
|
|
183
188
|
break;
|
|
184
189
|
case 'ArrowDown':
|
|
185
|
-
focusYear(year +
|
|
190
|
+
focusYear(year + verticalDirection);
|
|
186
191
|
event.preventDefault();
|
|
187
192
|
break;
|
|
188
193
|
case 'ArrowLeft':
|
|
189
|
-
focusYear(year
|
|
194
|
+
focusYear(year - horizontalDirection);
|
|
190
195
|
event.preventDefault();
|
|
191
196
|
break;
|
|
192
197
|
case 'ArrowRight':
|
|
193
|
-
focusYear(year +
|
|
198
|
+
focusYear(year + horizontalDirection);
|
|
194
199
|
event.preventDefault();
|
|
195
200
|
break;
|
|
196
201
|
default:
|
|
@@ -228,6 +233,10 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
228
233
|
}
|
|
229
234
|
scrollerRef.current.scrollTop = elementBottom - clientHeight / 2 - offsetHeight / 2;
|
|
230
235
|
}, [autoFocus]);
|
|
236
|
+
const yearRange = utils.getYearRange([minDate, maxDate]);
|
|
237
|
+
if (yearsOrder === 'desc') {
|
|
238
|
+
yearRange.reverse();
|
|
239
|
+
}
|
|
231
240
|
return /*#__PURE__*/_jsx(YearCalendarRoot, _extends({
|
|
232
241
|
ref: handleRef,
|
|
233
242
|
className: clsx(classes.root, className),
|
|
@@ -235,7 +244,7 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
235
244
|
role: "radiogroup",
|
|
236
245
|
"aria-labelledby": gridLabelId
|
|
237
246
|
}, other, {
|
|
238
|
-
children:
|
|
247
|
+
children: yearRange.map(year => {
|
|
239
248
|
const yearNumber = utils.getYear(year);
|
|
240
249
|
const isSelected = yearNumber === selectedYear;
|
|
241
250
|
const isDisabled = disabled || isYearDisabled(year);
|
|
@@ -356,6 +365,12 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
|
356
365
|
* Used when the component is controlled.
|
|
357
366
|
*/
|
|
358
367
|
value: PropTypes.object,
|
|
368
|
+
/**
|
|
369
|
+
* Years are displayed in ascending (chronological) order by default.
|
|
370
|
+
* If `desc`, years are displayed in descending order.
|
|
371
|
+
* @default 'asc'
|
|
372
|
+
*/
|
|
373
|
+
yearsOrder: PropTypes.oneOf(['asc', 'desc']),
|
|
359
374
|
/**
|
|
360
375
|
* Years rendered per row.
|
|
361
376
|
* @default 3
|
|
@@ -25,6 +25,7 @@ export const renderDateViewCalendar = ({
|
|
|
25
25
|
onMonthChange,
|
|
26
26
|
monthsPerRow,
|
|
27
27
|
onYearChange,
|
|
28
|
+
yearsOrder,
|
|
28
29
|
yearsPerRow,
|
|
29
30
|
slots,
|
|
30
31
|
slotProps,
|
|
@@ -63,6 +64,7 @@ export const renderDateViewCalendar = ({
|
|
|
63
64
|
onMonthChange: onMonthChange,
|
|
64
65
|
monthsPerRow: monthsPerRow,
|
|
65
66
|
onYearChange: onYearChange,
|
|
67
|
+
yearsOrder: yearsOrder,
|
|
66
68
|
yearsPerRow: yearsPerRow,
|
|
67
69
|
slots: slots,
|
|
68
70
|
slotProps: slotProps,
|
package/modern/hooks/index.js
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { DATE_TIME_VALIDATION_PROP_NAMES, DATE_VALIDATION_PROP_NAMES, TIME_VALIDATION_PROP_NAMES } from "../validation/extractValidationProps.js";
|
|
6
|
+
const SHARED_FIELD_INTERNAL_PROP_NAMES = ['value', 'defaultValue', 'referenceDate', 'format', 'formatDensity', 'onChange', 'timezone', 'onError', 'shouldRespectLeadingZeros', 'selectedSections', 'onSelectedSectionsChange', 'unstableFieldRef', 'enableAccessibleFieldDOMStructure', 'disabled', 'readOnly', 'dateSeparator'];
|
|
7
|
+
/**
|
|
8
|
+
* Split the props received by the field component into:
|
|
9
|
+
* - `internalProps` which are used by the various hooks called by the field component.
|
|
10
|
+
* - `forwardedProps` which are passed to the underlying component.
|
|
11
|
+
* Note that some forwarded props might be used by the hooks as well.
|
|
12
|
+
* For instance, hooks like `useDateField` need props like `autoFocus` to know how to behave.
|
|
13
|
+
* @template TProps, TValueType
|
|
14
|
+
* @param {TProps} props The props received by the field component.
|
|
15
|
+
* @param {TValueType} valueType The type of the field value ('date', 'time', or 'date-time').
|
|
16
|
+
*/
|
|
17
|
+
export const useSplitFieldProps = (props, valueType) => {
|
|
18
|
+
return React.useMemo(() => {
|
|
19
|
+
const forwardedProps = _extends({}, props);
|
|
20
|
+
const internalProps = {};
|
|
21
|
+
const extractProp = propName => {
|
|
22
|
+
if (forwardedProps.hasOwnProperty(propName)) {
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
internalProps[propName] = forwardedProps[propName];
|
|
25
|
+
delete forwardedProps[propName];
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
SHARED_FIELD_INTERNAL_PROP_NAMES.forEach(extractProp);
|
|
29
|
+
if (valueType === 'date') {
|
|
30
|
+
DATE_VALIDATION_PROP_NAMES.forEach(extractProp);
|
|
31
|
+
} else if (valueType === 'time') {
|
|
32
|
+
TIME_VALIDATION_PROP_NAMES.forEach(extractProp);
|
|
33
|
+
} else if (valueType === 'date-time') {
|
|
34
|
+
DATE_VALIDATION_PROP_NAMES.forEach(extractProp);
|
|
35
|
+
TIME_VALIDATION_PROP_NAMES.forEach(extractProp);
|
|
36
|
+
DATE_TIME_VALIDATION_PROP_NAMES.forEach(extractProp);
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
forwardedProps,
|
|
40
|
+
internalProps
|
|
41
|
+
};
|
|
42
|
+
}, [props, valueType]);
|
|
43
|
+
};
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers v7.
|
|
2
|
+
* @mui/x-date-pickers v7.18.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -56,4 +56,5 @@ export * from "./PickersSectionList/index.js";
|
|
|
56
56
|
export { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from "./internals/utils/utils.js";
|
|
57
57
|
export * from "./models/index.js";
|
|
58
58
|
export * from "./icons/index.js";
|
|
59
|
-
export * from "./hooks/index.js";
|
|
59
|
+
export * from "./hooks/index.js";
|
|
60
|
+
export * from "./validation/index.js";
|
|
@@ -10,7 +10,6 @@ import IconButton from '@mui/material/IconButton';
|
|
|
10
10
|
import useForkRef from '@mui/utils/useForkRef';
|
|
11
11
|
import useId from '@mui/utils/useId';
|
|
12
12
|
import { PickersPopper } from "../../components/PickersPopper.js";
|
|
13
|
-
import { useUtils } from "../useUtils.js";
|
|
14
13
|
import { usePicker } from "../usePicker/index.js";
|
|
15
14
|
import { LocalizationProvider } from "../../../LocalizationProvider/index.js";
|
|
16
15
|
import { PickersLayout } from "../../../PickersLayout/index.js";
|
|
@@ -47,7 +46,6 @@ export const useDesktopPicker = _ref => {
|
|
|
47
46
|
localeText,
|
|
48
47
|
reduceAnimations
|
|
49
48
|
} = props;
|
|
50
|
-
const utils = useUtils();
|
|
51
49
|
const containerRef = React.useRef(null);
|
|
52
50
|
const fieldRef = React.useRef(null);
|
|
53
51
|
const labelId = useId();
|
|
@@ -89,7 +87,7 @@ export const useDesktopPicker = _ref => {
|
|
|
89
87
|
additionalProps: {
|
|
90
88
|
disabled: disabled || readOnly,
|
|
91
89
|
onClick: open ? actions.onClose : actions.onOpen,
|
|
92
|
-
'aria-label': getOpenDialogAriaText(pickerFieldProps.value
|
|
90
|
+
'aria-label': getOpenDialogAriaText(pickerFieldProps.value),
|
|
93
91
|
edge: inputAdornmentProps.position
|
|
94
92
|
},
|
|
95
93
|
ownerState: props
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
4
4
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
5
5
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
6
|
-
import { useValidation } from "
|
|
6
|
+
import { useValidation } from "../../../validation/index.js";
|
|
7
7
|
import { useUtils } from "../useUtils.js";
|
|
8
8
|
import { adjustSectionValue, getSectionOrder } from "./useField.utils.js";
|
|
9
9
|
import { useFieldState } from "./useFieldState.js";
|
|
@@ -158,18 +158,23 @@ export const useField = params => {
|
|
|
158
158
|
useEnhancedEffect(() => {
|
|
159
159
|
interactions.syncSelectionToDOM();
|
|
160
160
|
});
|
|
161
|
-
const
|
|
161
|
+
const {
|
|
162
|
+
hasValidationError
|
|
163
|
+
} = useValidation({
|
|
164
|
+
props: internalProps,
|
|
165
|
+
validator,
|
|
166
|
+
timezone,
|
|
162
167
|
value: state.value,
|
|
163
|
-
|
|
164
|
-
})
|
|
168
|
+
onError: internalProps.onError
|
|
169
|
+
});
|
|
165
170
|
const inputError = React.useMemo(() => {
|
|
166
171
|
// only override when `error` is undefined.
|
|
167
172
|
// in case of multi input fields, the `error` value is provided externally and will always be defined.
|
|
168
173
|
if (error !== undefined) {
|
|
169
174
|
return error;
|
|
170
175
|
}
|
|
171
|
-
return
|
|
172
|
-
}, [
|
|
176
|
+
return hasValidationError;
|
|
177
|
+
}, [hasValidationError, error]);
|
|
173
178
|
React.useEffect(() => {
|
|
174
179
|
if (!inputError && activeSectionIndex == null) {
|
|
175
180
|
resetCharacterQuery();
|
|
@@ -110,10 +110,8 @@ export const useFieldState = params => {
|
|
|
110
110
|
validationError: validator({
|
|
111
111
|
adapter,
|
|
112
112
|
value,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
timezone
|
|
116
|
-
})
|
|
113
|
+
timezone,
|
|
114
|
+
props: internalProps
|
|
117
115
|
})
|
|
118
116
|
};
|
|
119
117
|
handleValueChange(value, context);
|
|
@@ -8,7 +8,6 @@ import useId from '@mui/utils/useId';
|
|
|
8
8
|
import { PickersModalDialog } from "../../components/PickersModalDialog.js";
|
|
9
9
|
import { usePicker } from "../usePicker/index.js";
|
|
10
10
|
import { onSpaceOrEnter } from "../../utils/utils.js";
|
|
11
|
-
import { useUtils } from "../useUtils.js";
|
|
12
11
|
import { LocalizationProvider } from "../../../LocalizationProvider/index.js";
|
|
13
12
|
import { PickersLayout } from "../../../PickersLayout/index.js";
|
|
14
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -42,7 +41,6 @@ export const useMobilePicker = _ref => {
|
|
|
42
41
|
disabled,
|
|
43
42
|
localeText
|
|
44
43
|
} = props;
|
|
45
|
-
const utils = useUtils();
|
|
46
44
|
const fieldRef = React.useRef(null);
|
|
47
45
|
const labelId = useId();
|
|
48
46
|
const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
|
|
@@ -89,7 +87,7 @@ export const useMobilePicker = _ref => {
|
|
|
89
87
|
|
|
90
88
|
// TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
|
|
91
89
|
fieldProps.inputProps = _extends({}, fieldProps.inputProps, {
|
|
92
|
-
'aria-label': getOpenDialogAriaText(pickerFieldProps.value
|
|
90
|
+
'aria-label': getOpenDialogAriaText(pickerFieldProps.value)
|
|
93
91
|
});
|
|
94
92
|
const slotsForField = _extends({
|
|
95
93
|
textField: slots.textField
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
1
2
|
import { usePickerValue } from "./usePickerValue.js";
|
|
2
3
|
import { usePickerViews } from "./usePickerViews.js";
|
|
3
4
|
import { usePickerLayoutProps } from "./usePickerLayoutProps.js";
|
|
4
|
-
import { warnOnce } from "../../utils/warning.js";
|
|
5
5
|
export const usePicker = ({
|
|
6
6
|
props,
|
|
7
7
|
valueManager,
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
4
4
|
import { useOpenState } from "../useOpenState.js";
|
|
5
5
|
import { useLocalizationContext, useUtils } from "../useUtils.js";
|
|
6
|
-
import { useValidation } from "
|
|
6
|
+
import { useValidation } from "../../../validation/index.js";
|
|
7
7
|
import { useValueWithTimezone } from "../useValueWithTimezone.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -180,10 +180,15 @@ export const usePickerValue = ({
|
|
|
180
180
|
hasBeenModifiedSinceMount: false
|
|
181
181
|
};
|
|
182
182
|
});
|
|
183
|
-
|
|
183
|
+
const {
|
|
184
|
+
getValidationErrorForNewValue
|
|
185
|
+
} = useValidation({
|
|
186
|
+
props,
|
|
187
|
+
validator,
|
|
188
|
+
timezone,
|
|
184
189
|
value: dateState.draft,
|
|
185
|
-
|
|
186
|
-
})
|
|
190
|
+
onError: props.onError
|
|
191
|
+
});
|
|
187
192
|
const updateDate = useEventCallback(action => {
|
|
188
193
|
const updaterParams = {
|
|
189
194
|
action,
|
|
@@ -204,14 +209,7 @@ export const usePickerValue = ({
|
|
|
204
209
|
let cachedContext = null;
|
|
205
210
|
const getContext = () => {
|
|
206
211
|
if (!cachedContext) {
|
|
207
|
-
const validationError = action.name === 'setValueFromField' ? action.context.validationError :
|
|
208
|
-
adapter,
|
|
209
|
-
value: action.value,
|
|
210
|
-
props: _extends({}, props, {
|
|
211
|
-
value: action.value,
|
|
212
|
-
timezone
|
|
213
|
-
})
|
|
214
|
-
});
|
|
212
|
+
const validationError = action.name === 'setValueFromField' ? action.context.validationError : getValidationErrorForNewValue(action.value);
|
|
215
213
|
cachedContext = {
|
|
216
214
|
validationError
|
|
217
215
|
};
|
|
@@ -325,10 +323,8 @@ export const usePickerValue = ({
|
|
|
325
323
|
const error = validator({
|
|
326
324
|
adapter,
|
|
327
325
|
value: testedValue,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
timezone
|
|
331
|
-
})
|
|
326
|
+
timezone,
|
|
327
|
+
props
|
|
332
328
|
});
|
|
333
329
|
return !valueManager.hasError(error);
|
|
334
330
|
};
|
|
@@ -15,22 +15,15 @@ export { usePicker } from "./hooks/usePicker/index.js";
|
|
|
15
15
|
export { useStaticPicker } from "./hooks/useStaticPicker/index.js";
|
|
16
16
|
export { useLocalizationContext, useDefaultDates, useUtils, useNow } from "./hooks/useUtils.js";
|
|
17
17
|
export { useViews } from "./hooks/useViews.js";
|
|
18
|
-
export { useValidation } from "./hooks/useValidation.js";
|
|
19
18
|
export { usePreviousMonthDisabled, useNextMonthDisabled } from "./hooks/date-helpers-hooks.js";
|
|
20
19
|
export { convertFieldResponseIntoMuiTextFieldProps } from "./utils/convertFieldResponseIntoMuiTextFieldProps.js";
|
|
21
20
|
export { applyDefaultDate, replaceInvalidDateByNull, areDatesEqual, getTodayDate, isDatePickerView, mergeDateAndTime, formatMeridiem } from "./utils/date-utils.js";
|
|
22
21
|
export { resolveTimeViewsResponse, resolveDateTimeFormat } from "./utils/date-time-utils.js";
|
|
23
|
-
export { splitFieldInternalAndForwardedProps } from "./utils/fields.js";
|
|
24
22
|
export { getDefaultReferenceDate } from "./utils/getDefaultReferenceDate.js";
|
|
25
23
|
export { executeInTheNextEventLoopTick, getActiveElement, onSpaceOrEnter, DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from "./utils/utils.js";
|
|
26
24
|
export { useDefaultizedDateField, useDefaultizedTimeField, useDefaultizedDateTimeField } from "./hooks/defaultizedFieldProps.js";
|
|
27
25
|
export { useDefaultReduceAnimations } from "./hooks/useDefaultReduceAnimations.js";
|
|
28
|
-
export { extractValidationProps } from "./utils/validation/extractValidationProps.js";
|
|
29
|
-
export { validateDate } from "./utils/validation/validateDate.js";
|
|
30
|
-
export { validateDateTime } from "./utils/validation/validateDateTime.js";
|
|
31
|
-
export { validateTime } from "./utils/validation/validateTime.js";
|
|
32
26
|
export { applyDefaultViewProps } from "./utils/views.js";
|
|
33
|
-
export { warnOnce } from "./utils/warning.js";
|
|
34
27
|
export { DayCalendar } from "../DateCalendar/DayCalendar.js";
|
|
35
28
|
export { useCalendarState } from "../DateCalendar/useCalendarState.js";
|
|
36
29
|
export { isInternalTimeView, isTimeView } from "./utils/time-utils.js";
|
package/modern/locales/beBY.js
CHANGED
|
@@ -33,7 +33,7 @@ const beBYPickers = {
|
|
|
33
33
|
timePickerToolbarTitle: 'Абраць час',
|
|
34
34
|
dateRangePickerToolbarTitle: 'Абраць каляндарны перыяд',
|
|
35
35
|
// Clock labels
|
|
36
|
-
clockLabelText: (view, time,
|
|
36
|
+
clockLabelText: (view, time, utils, formattedTime) => `Абярыце ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Час не абраны' : `Абраны час ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
37
37
|
hoursClockNumberText: hours => `${hours} гадзін`,
|
|
38
38
|
minutesClockNumberText: minutes => `${minutes} хвілін`,
|
|
39
39
|
secondsClockNumberText: seconds => `${seconds} секунд`,
|
|
@@ -45,9 +45,9 @@ const beBYPickers = {
|
|
|
45
45
|
calendarWeekNumberAriaLabelText: weekNumber => `Тыдзень ${weekNumber}`,
|
|
46
46
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
47
47
|
// Open picker labels
|
|
48
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Абраць дату, абрана дата ${utils.format(value, 'fullDate')}` : 'Абраць дату',
|
|
49
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Абраць час, абрыны час ${utils.format(value, 'fullTime')}` : 'Абраць час',
|
|
50
|
-
// fieldClearLabel: 'Clear
|
|
48
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Абраць дату, абрана дата ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Абраць дату',
|
|
49
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Абраць час, абрыны час ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Абраць час',
|
|
50
|
+
// fieldClearLabel: 'Clear',
|
|
51
51
|
|
|
52
52
|
// Table labels
|
|
53
53
|
timeTableLabel: 'абраць час',
|
package/modern/locales/caES.js
CHANGED
|
@@ -31,7 +31,7 @@ const caESPickers = {
|
|
|
31
31
|
timePickerToolbarTitle: 'Seleccionar hora',
|
|
32
32
|
dateRangePickerToolbarTitle: 'Seleccionar rang de dates',
|
|
33
33
|
// Clock labels
|
|
34
|
-
clockLabelText: (view, time,
|
|
34
|
+
clockLabelText: (view, time, utils, formattedTime) => `Selecciona ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Hora no seleccionada' : `L'hora seleccionada és ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
35
35
|
hoursClockNumberText: hours => `${hours} hores`,
|
|
36
36
|
minutesClockNumberText: minutes => `${minutes} minuts`,
|
|
37
37
|
secondsClockNumberText: seconds => `${seconds} segons`,
|
|
@@ -43,8 +43,8 @@ const caESPickers = {
|
|
|
43
43
|
calendarWeekNumberAriaLabelText: weekNumber => `Setmana ${weekNumber}`,
|
|
44
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
45
45
|
// Open picker labels
|
|
46
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Tria la data, la data triada és ${utils.format(value, 'fullDate')}` : 'Tria la data',
|
|
47
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Tria l'hora, l'hora triada és ${utils.format(value, 'fullTime')}` : "Tria l'hora",
|
|
46
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Tria la data, la data triada és ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Tria la data',
|
|
47
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Tria l'hora, l'hora triada és ${formattedTime ?? utils.format(value, 'fullTime')}` : "Tria l'hora",
|
|
48
48
|
fieldClearLabel: 'Netega el valor',
|
|
49
49
|
// Table labels
|
|
50
50
|
timeTableLabel: 'tria la data',
|
package/modern/locales/csCZ.js
CHANGED
|
@@ -33,7 +33,7 @@ const csCZPickers = {
|
|
|
33
33
|
timePickerToolbarTitle: 'Vyberte čas',
|
|
34
34
|
dateRangePickerToolbarTitle: 'Vyberete rozmezí dat',
|
|
35
35
|
// Clock labels
|
|
36
|
-
clockLabelText: (view, time,
|
|
36
|
+
clockLabelText: (view, time, utils, formattedTime) => `${timeViews[view] ?? view} vybrány. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Není vybrán čas' : `Vybraný čas je ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
37
37
|
hoursClockNumberText: hours => `${hours} hodin`,
|
|
38
38
|
minutesClockNumberText: minutes => `${minutes} minut`,
|
|
39
39
|
secondsClockNumberText: seconds => `${seconds} sekund`,
|
|
@@ -45,9 +45,9 @@ const csCZPickers = {
|
|
|
45
45
|
calendarWeekNumberAriaLabelText: weekNumber => `${weekNumber} týden v roce`,
|
|
46
46
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
47
47
|
// Open picker labels
|
|
48
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Vyberte datum, vybrané datum je ${utils.format(value, 'fullDate')}` : 'Vyberte datum',
|
|
49
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Vyberte čas, vybraný čas je ${utils.format(value, 'fullTime')}` : 'Vyberte čas',
|
|
50
|
-
// fieldClearLabel: 'Clear
|
|
48
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Vyberte datum, vybrané datum je ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Vyberte datum',
|
|
49
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Vyberte čas, vybraný čas je ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Vyberte čas',
|
|
50
|
+
// fieldClearLabel: 'Clear',
|
|
51
51
|
|
|
52
52
|
// Table labels
|
|
53
53
|
timeTableLabel: 'vyberte čas',
|
package/modern/locales/daDK.js
CHANGED
|
@@ -32,7 +32,7 @@ const daDKPickers = {
|
|
|
32
32
|
timePickerToolbarTitle: 'Vælg tidspunkt',
|
|
33
33
|
dateRangePickerToolbarTitle: 'Vælg datointerval',
|
|
34
34
|
// Clock labels
|
|
35
|
-
clockLabelText: (view, time,
|
|
35
|
+
clockLabelText: (view, time, utils, formattedTime) => `Vælg ${timeViews[view] ?? view}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Intet tidspunkt valgt' : `Valgte tidspunkt er ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
36
36
|
hoursClockNumberText: hours => `${hours} timer`,
|
|
37
37
|
minutesClockNumberText: minutes => `${minutes} minutter`,
|
|
38
38
|
secondsClockNumberText: seconds => `${seconds} sekunder`,
|
|
@@ -44,8 +44,8 @@ const daDKPickers = {
|
|
|
44
44
|
calendarWeekNumberAriaLabelText: weekNumber => `Uge ${weekNumber}`,
|
|
45
45
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
46
46
|
// Open picker labels
|
|
47
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Vælg dato, valgte dato er ${utils.format(value, 'fullDate')}` : 'Vælg dato',
|
|
48
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Vælg tidspunkt, valgte tidspunkt er ${utils.format(value, 'fullTime')}` : 'Vælg tidspunkt',
|
|
47
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Vælg dato, valgte dato er ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Vælg dato',
|
|
48
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Vælg tidspunkt, valgte tidspunkt er ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Vælg tidspunkt',
|
|
49
49
|
fieldClearLabel: 'ryd felt',
|
|
50
50
|
// Table labels
|
|
51
51
|
timeTableLabel: 'vælg tidspunkt',
|
package/modern/locales/deDE.js
CHANGED
|
@@ -32,7 +32,7 @@ const deDEPickers = {
|
|
|
32
32
|
timePickerToolbarTitle: 'Uhrzeit auswählen',
|
|
33
33
|
dateRangePickerToolbarTitle: 'Datumsbereich auswählen',
|
|
34
34
|
// Clock labels
|
|
35
|
-
clockLabelText: (view, time,
|
|
35
|
+
clockLabelText: (view, time, utils, formattedTime) => `${timeViews[view] ?? view} auswählen. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Keine Uhrzeit ausgewählt' : `Gewählte Uhrzeit ist ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
36
36
|
hoursClockNumberText: hours => `${hours} ${timeViews.hours}`,
|
|
37
37
|
minutesClockNumberText: minutes => `${minutes} ${timeViews.minutes}`,
|
|
38
38
|
secondsClockNumberText: seconds => `${seconds} ${timeViews.seconds}`,
|
|
@@ -44,8 +44,8 @@ const deDEPickers = {
|
|
|
44
44
|
calendarWeekNumberAriaLabelText: weekNumber => `Woche ${weekNumber}`,
|
|
45
45
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
46
46
|
// Open picker labels
|
|
47
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Datum auswählen, gewähltes Datum ist ${utils.format(value, 'fullDate')}` : 'Datum auswählen',
|
|
48
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Uhrzeit auswählen, gewählte Uhrzeit ist ${utils.format(value, 'fullTime')}` : 'Uhrzeit auswählen',
|
|
47
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Datum auswählen, gewähltes Datum ist ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Datum auswählen',
|
|
48
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Uhrzeit auswählen, gewählte Uhrzeit ist ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Uhrzeit auswählen',
|
|
49
49
|
fieldClearLabel: 'Wert leeren',
|
|
50
50
|
// Table labels
|
|
51
51
|
timeTableLabel: 'Uhrzeit auswählen',
|
package/modern/locales/elGR.js
CHANGED
|
@@ -32,7 +32,7 @@ const elGRPickers = {
|
|
|
32
32
|
timePickerToolbarTitle: 'Επιλέξτε ώρα',
|
|
33
33
|
dateRangePickerToolbarTitle: 'Επιλέξτε εύρος ημερομηνιών',
|
|
34
34
|
// Clock labels
|
|
35
|
-
clockLabelText: (view, time,
|
|
35
|
+
clockLabelText: (view, time, utils, formattedTime) => `Επιλέξτε ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Δεν έχει επιλεγεί ώρα' : `Η επιλεγμένη ώρα είναι ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
36
36
|
hoursClockNumberText: hours => `${hours} ώρες`,
|
|
37
37
|
minutesClockNumberText: minutes => `${minutes} λεπτά`,
|
|
38
38
|
secondsClockNumberText: seconds => `${seconds} δευτερόλεπτα`,
|
|
@@ -44,9 +44,9 @@ const elGRPickers = {
|
|
|
44
44
|
calendarWeekNumberAriaLabelText: weekNumber => `Εβδομάδα ${weekNumber}`,
|
|
45
45
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
46
46
|
// Open picker labels
|
|
47
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Επιλέξτε ημερομηνία, η επιλεγμένη ημερομηνία είναι ${utils.format(value, 'fullDate')}` : 'Επιλέξτε ημερομηνία',
|
|
48
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Επιλέξτε ώρα, η επιλεγμένη ώρα είναι ${utils.format(value, 'fullTime')}` : 'Επιλέξτε ώρα',
|
|
49
|
-
// fieldClearLabel: 'Clear
|
|
47
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Επιλέξτε ημερομηνία, η επιλεγμένη ημερομηνία είναι ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Επιλέξτε ημερομηνία',
|
|
48
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Επιλέξτε ώρα, η επιλεγμένη ώρα είναι ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Επιλέξτε ώρα',
|
|
49
|
+
// fieldClearLabel: 'Clear',
|
|
50
50
|
|
|
51
51
|
// Table labels
|
|
52
52
|
timeTableLabel: 'επιλέξτε ώρα',
|
package/modern/locales/enUS.js
CHANGED
|
@@ -28,7 +28,7 @@ const enUSPickers = {
|
|
|
28
28
|
timePickerToolbarTitle: 'Select time',
|
|
29
29
|
dateRangePickerToolbarTitle: 'Select date range',
|
|
30
30
|
// Clock labels
|
|
31
|
-
clockLabelText: (view, time,
|
|
31
|
+
clockLabelText: (view, time, utils, formattedTime) => `Select ${view}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'No time selected' : `Selected time is ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
32
32
|
hoursClockNumberText: hours => `${hours} hours`,
|
|
33
33
|
minutesClockNumberText: minutes => `${minutes} minutes`,
|
|
34
34
|
secondsClockNumberText: seconds => `${seconds} seconds`,
|
|
@@ -40,9 +40,9 @@ const enUSPickers = {
|
|
|
40
40
|
calendarWeekNumberAriaLabelText: weekNumber => `Week ${weekNumber}`,
|
|
41
41
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
42
42
|
// Open picker labels
|
|
43
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Choose date, selected date is ${utils.format(value, 'fullDate')}` : 'Choose date',
|
|
44
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Choose time, selected time is ${utils.format(value, 'fullTime')}` : 'Choose time',
|
|
45
|
-
fieldClearLabel: 'Clear
|
|
43
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Choose date, selected date is ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Choose date',
|
|
44
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Choose time, selected time is ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Choose time',
|
|
45
|
+
fieldClearLabel: 'Clear',
|
|
46
46
|
// Table labels
|
|
47
47
|
timeTableLabel: 'pick time',
|
|
48
48
|
dateTableLabel: 'pick date',
|
package/modern/locales/esES.js
CHANGED
|
@@ -31,7 +31,7 @@ const esESPickers = {
|
|
|
31
31
|
timePickerToolbarTitle: 'Seleccionar hora',
|
|
32
32
|
dateRangePickerToolbarTitle: 'Seleccionar rango de fecha',
|
|
33
33
|
// Clock labels
|
|
34
|
-
clockLabelText: (view, time,
|
|
34
|
+
clockLabelText: (view, time, utils, formattedTime) => `Seleccione ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'No hay hora seleccionada' : `La hora seleccionada es ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
35
35
|
hoursClockNumberText: hours => `${hours} horas`,
|
|
36
36
|
minutesClockNumberText: minutes => `${minutes} minutos`,
|
|
37
37
|
secondsClockNumberText: seconds => `${seconds} segundos`,
|
|
@@ -43,8 +43,8 @@ const esESPickers = {
|
|
|
43
43
|
calendarWeekNumberAriaLabelText: weekNumber => `Semana ${weekNumber}`,
|
|
44
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
45
45
|
// Open picker labels
|
|
46
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige fecha, la fecha elegida es ${utils.format(value, 'fullDate')}` : 'Elige fecha',
|
|
47
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige hora, la hora elegida es ${utils.format(value, 'fullTime')}` : 'Elige hora',
|
|
46
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Elige fecha, la fecha elegida es ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Elige fecha',
|
|
47
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Elige hora, la hora elegida es ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Elige hora',
|
|
48
48
|
fieldClearLabel: 'Limpiar valor',
|
|
49
49
|
// Table labels
|
|
50
50
|
timeTableLabel: 'elige hora',
|
package/modern/locales/eu.js
CHANGED
|
@@ -32,7 +32,7 @@ const euPickers = {
|
|
|
32
32
|
timePickerToolbarTitle: 'Ordua aukeratu',
|
|
33
33
|
dateRangePickerToolbarTitle: 'Data tartea aukeratu',
|
|
34
34
|
// Clock labels
|
|
35
|
-
clockLabelText: (view, time,
|
|
35
|
+
clockLabelText: (view, time, utils, formattedTime) => `Aukeratu ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Ez da ordurik aukertau' : `Aukeratutako ordua ${formattedTime ?? utils.format(time, 'fullTime')} da`}`,
|
|
36
36
|
hoursClockNumberText: hours => `${hours} ordu`,
|
|
37
37
|
minutesClockNumberText: minutes => `${minutes} minutu`,
|
|
38
38
|
secondsClockNumberText: seconds => `${seconds} segundu`,
|
|
@@ -44,8 +44,8 @@ const euPickers = {
|
|
|
44
44
|
calendarWeekNumberAriaLabelText: weekNumber => `${weekNumber} astea`,
|
|
45
45
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
46
46
|
// Open picker labels
|
|
47
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Data aukeratu, aukeratutako data ${utils.format(value, 'fullDate')} da` : 'Data aukeratu',
|
|
48
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Ordua aukeratu, aukeratutako ordua ${utils.format(value, 'fullTime')} da` : 'Ordua aukeratu',
|
|
47
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Data aukeratu, aukeratutako data ${formattedDate ?? utils.format(value, 'fullDate')} da` : 'Data aukeratu',
|
|
48
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Ordua aukeratu, aukeratutako ordua ${formattedTime ?? utils.format(value, 'fullTime')} da` : 'Ordua aukeratu',
|
|
49
49
|
fieldClearLabel: 'Balioa garbitu',
|
|
50
50
|
// Table labels
|
|
51
51
|
timeTableLabel: 'ordua aukeratu',
|
package/modern/locales/faIR.js
CHANGED
|
@@ -31,7 +31,7 @@ const faIRPickers = {
|
|
|
31
31
|
timePickerToolbarTitle: 'ساعت را انتخاب کنید',
|
|
32
32
|
dateRangePickerToolbarTitle: 'محدوده تاریخ را انتخاب کنید',
|
|
33
33
|
// Clock labels
|
|
34
|
-
clockLabelText: (view, time,
|
|
34
|
+
clockLabelText: (view, time, utils, formattedTime) => ` را انتخاب کنید ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'هیچ ساعتی انتخاب نشده است' : `ساعت انتخاب ${formattedTime ?? utils.format(time, 'fullTime')} می باشد`}`,
|
|
35
35
|
hoursClockNumberText: hours => `${hours} ساعتها`,
|
|
36
36
|
minutesClockNumberText: minutes => `${minutes} دقیقهها`,
|
|
37
37
|
secondsClockNumberText: seconds => `${seconds} ثانیهها`,
|
|
@@ -43,8 +43,8 @@ const faIRPickers = {
|
|
|
43
43
|
calendarWeekNumberAriaLabelText: weekNumber => `هفته ${weekNumber}`,
|
|
44
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
45
45
|
// Open picker labels
|
|
46
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `تاریخ را انتخاب کنید، تاریخ انتخاب شده ${utils.format(value, 'fullDate')} میباشد` : 'تاریخ را انتخاب کنید',
|
|
47
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `ساعت را انتخاب کنید، ساعت انتخاب شده ${utils.format(value, 'fullTime')} میباشد` : 'ساعت را انتخاب کنید',
|
|
46
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `تاریخ را انتخاب کنید، تاریخ انتخاب شده ${formattedDate ?? utils.format(value, 'fullDate')} میباشد` : 'تاریخ را انتخاب کنید',
|
|
47
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `ساعت را انتخاب کنید، ساعت انتخاب شده ${formattedTime ?? utils.format(value, 'fullTime')} میباشد` : 'ساعت را انتخاب کنید',
|
|
48
48
|
fieldClearLabel: 'پاک کردن مقدار',
|
|
49
49
|
// Table labels
|
|
50
50
|
timeTableLabel: 'انتخاب تاریخ',
|
package/modern/locales/fiFI.js
CHANGED
|
@@ -31,7 +31,7 @@ const fiFIPickers = {
|
|
|
31
31
|
timePickerToolbarTitle: 'Valitse aika',
|
|
32
32
|
dateRangePickerToolbarTitle: 'Valitse aikaväli',
|
|
33
33
|
// Clock labels
|
|
34
|
-
clockLabelText: (view, time,
|
|
34
|
+
clockLabelText: (view, time, utils, formattedTime) => `Valitse ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Ei aikaa valittuna' : `Valittu aika on ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
35
35
|
hoursClockNumberText: hours => `${hours} tuntia`,
|
|
36
36
|
minutesClockNumberText: minutes => `${minutes} minuuttia`,
|
|
37
37
|
secondsClockNumberText: seconds => `${seconds} sekuntia`,
|
|
@@ -43,8 +43,8 @@ const fiFIPickers = {
|
|
|
43
43
|
calendarWeekNumberAriaLabelText: weekNumber => `Viikko ${weekNumber}`,
|
|
44
44
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
45
45
|
// Open picker labels
|
|
46
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Valitse päivä, valittu päivä on ${utils.format(value, 'fullDate')}` : 'Valitse päivä',
|
|
47
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Valitse aika, valittu aika on ${utils.format(value, 'fullTime')}` : 'Valitse aika',
|
|
46
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Valitse päivä, valittu päivä on ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Valitse päivä',
|
|
47
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Valitse aika, valittu aika on ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Valitse aika',
|
|
48
48
|
fieldClearLabel: 'Tyhjennä arvo',
|
|
49
49
|
// Table labels
|
|
50
50
|
timeTableLabel: 'valitse aika',
|