@mui/x-date-pickers 7.0.0-alpha.8 → 7.0.0-beta.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/AdapterLuxon/AdapterLuxon.d.ts +1 -1
- package/AdapterLuxon/AdapterLuxon.js +4 -12
- package/CHANGELOG.md +508 -30
- package/DatePicker/DatePicker.js +0 -3
- package/DatePicker/DatePickerToolbar.js +0 -3
- package/DateTimePicker/DateTimePicker.js +0 -3
- package/DateTimePicker/DateTimePickerTabs.js +7 -4
- package/DateTimePicker/DateTimePickerToolbar.d.ts +6 -1
- package/DateTimePicker/DateTimePickerToolbar.js +33 -20
- package/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/MobileDatePicker/MobileDatePicker.js +0 -3
- package/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
- package/MobileTimePicker/MobileTimePicker.js +0 -3
- package/MonthCalendar/MonthCalendar.js +0 -3
- package/MonthCalendar/MonthCalendar.types.d.ts +0 -3
- package/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +0 -3
- package/PickersLayout/PickersLayout.types.d.ts +6 -5
- package/PickersLayout/pickersLayoutClasses.js +3 -2
- package/PickersLayout/usePickerLayout.d.ts +2 -2
- package/PickersLayout/usePickerLayout.js +2 -1
- package/PickersSectionList/PickersSectionList.js +6 -1
- package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +11 -0
- package/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +98 -25
- package/PickersTextField/PickersFilledInput/index.d.ts +4 -0
- package/PickersTextField/PickersFilledInput/index.js +2 -0
- package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +23 -0
- package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
- package/PickersTextField/PickersInput/PickersInput.d.ts +10 -0
- package/PickersTextField/PickersInput/PickersInput.js +196 -0
- package/{internals/components → PickersTextField}/PickersInput/index.d.ts +2 -2
- package/PickersTextField/PickersInput/index.js +2 -0
- package/PickersTextField/PickersInput/pickersInputClasses.d.ts +22 -0
- package/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
- package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +16 -0
- package/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -27
- package/{internals/components/PickersInput/PickersInput.types.d.ts → PickersTextField/PickersInputBase/PickersInputBase.types.d.ts} +3 -13
- package/PickersTextField/PickersInputBase/index.d.ts +4 -0
- package/PickersTextField/PickersInputBase/index.js +2 -0
- package/PickersTextField/PickersInputBase/pickersInputBaseClasses.d.ts +31 -0
- package/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
- package/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.d.ts +3 -0
- package/{modern/internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.d.ts +10 -0
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +190 -0
- package/PickersTextField/PickersOutlinedInput/index.d.ts +4 -0
- package/PickersTextField/PickersOutlinedInput/index.js +2 -0
- package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.ts +22 -0
- package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
- package/PickersTextField/PickersTextField.d.ts +3 -0
- package/PickersTextField/PickersTextField.js +258 -0
- package/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.d.ts +5 -2
- package/PickersTextField/index.d.ts +8 -0
- package/PickersTextField/index.js +6 -0
- package/PickersTextField/package.json +6 -0
- package/README.md +3 -3
- package/StaticDatePicker/StaticDatePicker.js +0 -3
- package/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
- package/StaticTimePicker/StaticTimePicker.js +0 -3
- package/TimeClock/TimeClock.js +3 -3
- package/TimePicker/TimePicker.js +0 -3
- package/TimePicker/TimePickerToolbar.js +0 -3
- package/YearCalendar/YearCalendar.js +0 -3
- package/YearCalendar/YearCalendar.types.d.ts +0 -3
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +4 -4
- package/index.d.ts +2 -1
- package/index.js +3 -2
- package/internals/hooks/useField/useField.js +6 -4
- package/internals/hooks/useField/useField.types.d.ts +4 -2
- package/internals/hooks/useField/useField.utils.d.ts +19 -9
- package/internals/hooks/useField/useField.utils.js +68 -21
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -1
- package/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
- package/internals/hooks/useField/useFieldState.d.ts +1 -0
- package/internals/hooks/useField/useFieldState.js +9 -7
- package/internals/hooks/usePicker/usePicker.d.ts +1 -1
- package/internals/hooks/usePicker/usePicker.js +4 -2
- package/internals/hooks/usePicker/usePicker.types.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerViews.d.ts +11 -2
- package/internals/hooks/usePicker/usePickerViews.js +8 -3
- package/internals/index.d.ts +4 -4
- package/internals/index.js +2 -2
- package/internals/models/props/basePickerProps.d.ts +0 -3
- package/internals/models/props/tabs.d.ts +2 -1
- package/internals/models/props/toolbar.d.ts +0 -3
- package/internals/utils/valueManagers.js +2 -2
- package/legacy/AdapterLuxon/AdapterLuxon.js +4 -12
- package/legacy/DatePicker/DatePicker.js +0 -3
- package/legacy/DatePicker/DatePickerToolbar.js +0 -3
- package/legacy/DateTimePicker/DateTimePicker.js +0 -3
- package/legacy/DateTimePicker/DateTimePickerTabs.js +7 -4
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +43 -32
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/legacy/MobileDatePicker/MobileDatePicker.js +0 -3
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
- package/legacy/MobileTimePicker/MobileTimePicker.js +0 -3
- package/legacy/MonthCalendar/MonthCalendar.js +0 -3
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/legacy/PickersLayout/pickersLayoutClasses.js +3 -2
- package/legacy/PickersLayout/usePickerLayout.js +2 -1
- package/legacy/PickersSectionList/PickersSectionList.js +6 -1
- package/legacy/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +99 -26
- package/legacy/PickersTextField/PickersFilledInput/index.js +2 -0
- package/legacy/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
- package/legacy/PickersTextField/PickersInput/PickersInput.js +190 -0
- package/legacy/PickersTextField/PickersInput/index.js +2 -0
- package/legacy/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
- package/legacy/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -27
- package/legacy/PickersTextField/PickersInputBase/index.js +2 -0
- package/legacy/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
- package/legacy/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +7 -1
- package/legacy/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +183 -0
- package/legacy/PickersTextField/PickersOutlinedInput/index.js +2 -0
- package/legacy/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
- package/legacy/{internals/components/PickersTextField → PickersTextField}/PickersTextField.js +128 -8
- package/legacy/PickersTextField/index.js +6 -0
- package/legacy/StaticDatePicker/StaticDatePicker.js +0 -3
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
- package/legacy/StaticTimePicker/StaticTimePicker.js +0 -3
- package/legacy/TimeClock/TimeClock.js +3 -3
- package/legacy/TimePicker/TimePicker.js +0 -3
- package/legacy/TimePicker/TimePickerToolbar.js +0 -3
- package/legacy/YearCalendar/YearCalendar.js +0 -3
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +5 -4
- package/legacy/index.js +3 -2
- package/legacy/internals/hooks/useField/useField.js +6 -4
- package/legacy/internals/hooks/useField/useField.utils.js +71 -20
- package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
- package/legacy/internals/hooks/useField/useFieldState.js +15 -11
- package/legacy/internals/hooks/usePicker/usePicker.js +4 -2
- package/legacy/internals/hooks/usePicker/usePickerViews.js +8 -3
- package/legacy/internals/index.js +2 -2
- package/legacy/internals/utils/valueManagers.js +2 -2
- package/legacy/locales/beBY.js +8 -3
- package/legacy/locales/caES.js +7 -2
- package/legacy/locales/csCZ.js +8 -3
- package/legacy/locales/daDK.js +8 -3
- package/legacy/locales/deDE.js +6 -1
- package/legacy/locales/elGR.js +8 -3
- package/legacy/locales/enUS.js +7 -3
- package/legacy/locales/esES.js +8 -3
- package/legacy/locales/eu.js +6 -1
- package/legacy/locales/faIR.js +6 -1
- package/legacy/locales/fiFI.js +8 -3
- package/legacy/locales/frFR.js +6 -1
- package/legacy/locales/heIL.js +6 -1
- package/legacy/locales/huHU.js +6 -1
- package/legacy/locales/isIS.js +8 -3
- package/legacy/locales/itIT.js +8 -3
- package/legacy/locales/jaJP.js +6 -1
- package/legacy/locales/koKR.js +6 -1
- package/legacy/locales/kzKZ.js +6 -1
- package/legacy/locales/mk.js +6 -1
- package/legacy/locales/nbNO.js +8 -3
- package/legacy/locales/nlNL.js +8 -3
- package/legacy/locales/plPL.js +8 -3
- package/legacy/locales/ptBR.js +6 -1
- package/legacy/locales/roRO.js +6 -1
- package/legacy/locales/ruRU.js +8 -3
- package/legacy/locales/skSK.js +8 -3
- package/legacy/locales/svSE.js +8 -3
- package/legacy/locales/trTR.js +8 -3
- package/legacy/locales/ukUA.js +8 -3
- package/legacy/locales/urPK.js +6 -1
- package/legacy/locales/viVN.js +8 -3
- package/legacy/locales/zhCN.js +6 -1
- package/legacy/locales/zhHK.js +6 -1
- package/locales/beBY.d.ts +4 -0
- package/locales/beBY.js +8 -3
- package/locales/caES.d.ts +4 -0
- package/locales/caES.js +7 -2
- package/locales/csCZ.d.ts +4 -0
- package/locales/csCZ.js +8 -3
- package/locales/daDK.d.ts +4 -0
- package/locales/daDK.js +8 -3
- package/locales/deDE.d.ts +4 -0
- package/locales/deDE.js +6 -1
- package/locales/elGR.d.ts +4 -0
- package/locales/elGR.js +8 -3
- package/locales/enUS.d.ts +4 -0
- package/locales/enUS.js +7 -3
- package/locales/esES.d.ts +4 -0
- package/locales/esES.js +8 -3
- package/locales/eu.d.ts +4 -0
- package/locales/eu.js +6 -1
- package/locales/faIR.d.ts +4 -0
- package/locales/faIR.js +6 -1
- package/locales/fiFI.d.ts +4 -0
- package/locales/fiFI.js +8 -3
- package/locales/frFR.d.ts +4 -0
- package/locales/frFR.js +6 -1
- package/locales/heIL.d.ts +4 -0
- package/locales/heIL.js +6 -1
- package/locales/huHU.d.ts +4 -0
- package/locales/huHU.js +6 -1
- package/locales/isIS.d.ts +4 -0
- package/locales/isIS.js +8 -3
- package/locales/itIT.d.ts +4 -0
- package/locales/itIT.js +8 -3
- package/locales/jaJP.d.ts +4 -0
- package/locales/jaJP.js +6 -1
- package/locales/koKR.d.ts +4 -0
- package/locales/koKR.js +6 -1
- package/locales/kzKZ.d.ts +4 -0
- package/locales/kzKZ.js +6 -1
- package/locales/mk.d.ts +4 -0
- package/locales/mk.js +6 -1
- package/locales/nbNO.d.ts +4 -0
- package/locales/nbNO.js +8 -3
- package/locales/nlNL.d.ts +4 -0
- package/locales/nlNL.js +8 -3
- package/locales/plPL.d.ts +4 -0
- package/locales/plPL.js +8 -3
- package/locales/ptBR.d.ts +4 -0
- package/locales/ptBR.js +6 -1
- package/locales/roRO.d.ts +4 -0
- package/locales/roRO.js +6 -1
- package/locales/ruRU.d.ts +4 -0
- package/locales/ruRU.js +8 -3
- package/locales/skSK.d.ts +4 -0
- package/locales/skSK.js +8 -3
- package/locales/svSE.d.ts +4 -0
- package/locales/svSE.js +8 -3
- package/locales/trTR.d.ts +4 -0
- package/locales/trTR.js +8 -3
- package/locales/ukUA.d.ts +4 -0
- package/locales/ukUA.js +8 -3
- package/locales/urPK.d.ts +4 -0
- package/locales/urPK.js +6 -1
- package/locales/utils/getPickersLocalization.d.ts +4 -0
- package/locales/utils/pickersLocaleTextApi.d.ts +4 -0
- package/locales/viVN.d.ts +4 -0
- package/locales/viVN.js +8 -3
- package/locales/zhCN.d.ts +4 -0
- package/locales/zhCN.js +6 -1
- package/locales/zhHK.d.ts +4 -0
- package/locales/zhHK.js +6 -1
- package/modern/AdapterLuxon/AdapterLuxon.js +3 -11
- package/modern/DatePicker/DatePicker.js +0 -3
- package/modern/DatePicker/DatePickerToolbar.js +0 -3
- package/modern/DateTimePicker/DateTimePicker.js +0 -3
- package/modern/DateTimePicker/DateTimePickerTabs.js +7 -4
- package/modern/DateTimePicker/DateTimePickerToolbar.js +33 -20
- package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/modern/MobileDatePicker/MobileDatePicker.js +0 -3
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
- package/modern/MobileTimePicker/MobileTimePicker.js +0 -3
- package/modern/MonthCalendar/MonthCalendar.js +0 -3
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/modern/PickersLayout/pickersLayoutClasses.js +3 -2
- package/modern/PickersLayout/usePickerLayout.js +2 -1
- package/modern/PickersSectionList/PickersSectionList.js +6 -1
- package/modern/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +98 -25
- package/modern/PickersTextField/PickersFilledInput/index.js +2 -0
- package/modern/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +8 -0
- package/modern/PickersTextField/PickersInput/PickersInput.js +196 -0
- package/modern/PickersTextField/PickersInput/index.js +2 -0
- package/modern/PickersTextField/PickersInput/pickersInputClasses.js +8 -0
- package/modern/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +106 -27
- package/modern/PickersTextField/PickersInputBase/index.js +2 -0
- package/modern/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +6 -0
- package/{internals/components/PickersInput → modern/PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
- package/modern/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +190 -0
- package/modern/PickersTextField/PickersOutlinedInput/index.js +2 -0
- package/modern/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +8 -0
- package/modern/PickersTextField/PickersTextField.js +258 -0
- package/modern/PickersTextField/index.js +6 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +0 -3
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
- package/modern/StaticTimePicker/StaticTimePicker.js +0 -3
- package/modern/TimeClock/TimeClock.js +3 -3
- package/modern/TimePicker/TimePicker.js +0 -3
- package/modern/TimePicker/TimePickerToolbar.js +0 -3
- package/modern/YearCalendar/YearCalendar.js +0 -3
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +4 -4
- package/modern/index.js +3 -2
- package/modern/internals/hooks/useField/useField.js +5 -3
- package/modern/internals/hooks/useField/useField.utils.js +68 -21
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
- package/modern/internals/hooks/useField/useFieldState.js +9 -7
- package/modern/internals/hooks/usePicker/usePicker.js +4 -2
- package/modern/internals/hooks/usePicker/usePickerViews.js +8 -3
- package/modern/internals/index.js +2 -2
- package/modern/internals/utils/valueManagers.js +2 -2
- package/modern/locales/beBY.js +8 -3
- package/modern/locales/caES.js +7 -2
- package/modern/locales/csCZ.js +8 -3
- package/modern/locales/daDK.js +8 -3
- package/modern/locales/deDE.js +6 -1
- package/modern/locales/elGR.js +8 -3
- package/modern/locales/enUS.js +7 -3
- package/modern/locales/esES.js +8 -3
- package/modern/locales/eu.js +6 -1
- package/modern/locales/faIR.js +6 -1
- package/modern/locales/fiFI.js +8 -3
- package/modern/locales/frFR.js +6 -1
- package/modern/locales/heIL.js +6 -1
- package/modern/locales/huHU.js +6 -1
- package/modern/locales/isIS.js +8 -3
- package/modern/locales/itIT.js +8 -3
- package/modern/locales/jaJP.js +6 -1
- package/modern/locales/koKR.js +6 -1
- package/modern/locales/kzKZ.js +6 -1
- package/modern/locales/mk.js +6 -1
- package/modern/locales/nbNO.js +8 -3
- package/modern/locales/nlNL.js +8 -3
- package/modern/locales/plPL.js +8 -3
- package/modern/locales/ptBR.js +6 -1
- package/modern/locales/roRO.js +6 -1
- package/modern/locales/ruRU.js +8 -3
- package/modern/locales/skSK.js +8 -3
- package/modern/locales/svSE.js +8 -3
- package/modern/locales/trTR.js +8 -3
- package/modern/locales/ukUA.js +8 -3
- package/modern/locales/urPK.js +6 -1
- package/modern/locales/viVN.js +8 -3
- package/modern/locales/zhCN.js +6 -1
- package/modern/locales/zhHK.js +6 -1
- package/node/AdapterLuxon/AdapterLuxon.js +3 -11
- package/node/DatePicker/DatePicker.js +0 -3
- package/node/DatePicker/DatePickerToolbar.js +0 -3
- package/node/DateTimePicker/DateTimePicker.js +0 -3
- package/node/DateTimePicker/DateTimePickerTabs.js +8 -5
- package/node/DateTimePicker/DateTimePickerToolbar.js +34 -21
- package/node/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/node/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/node/MobileDatePicker/MobileDatePicker.js +0 -3
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -3
- package/node/MobileTimePicker/MobileTimePicker.js +0 -3
- package/node/MonthCalendar/MonthCalendar.js +0 -3
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/node/PickersLayout/pickersLayoutClasses.js +5 -3
- package/node/PickersLayout/usePickerLayout.js +2 -1
- package/node/PickersSectionList/PickersSectionList.js +6 -1
- package/node/{internals/components/PickersInput → PickersTextField/PickersFilledInput}/PickersFilledInput.js +102 -30
- package/node/PickersTextField/PickersFilledInput/index.js +25 -0
- package/node/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js +16 -0
- package/node/PickersTextField/PickersInput/PickersInput.js +204 -0
- package/node/{internals/components → PickersTextField}/PickersInput/index.js +0 -7
- package/node/PickersTextField/PickersInput/pickersInputClasses.js +16 -0
- package/node/{internals/components/PickersInput/PickersInput.js → PickersTextField/PickersInputBase/PickersInputBase.js} +105 -27
- package/node/PickersTextField/PickersInputBase/index.js +25 -0
- package/node/PickersTextField/PickersInputBase/pickersInputBaseClasses.js +14 -0
- package/node/{internals/components/PickersInput → PickersTextField/PickersOutlinedInput}/Outline.js +5 -1
- package/node/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +197 -0
- package/node/PickersTextField/PickersOutlinedInput/index.js +25 -0
- package/node/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js +16 -0
- package/node/{internals/components/PickersTextField → PickersTextField}/PickersTextField.js +128 -9
- package/node/PickersTextField/index.js +78 -0
- package/node/StaticDatePicker/StaticDatePicker.js +0 -3
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
- package/node/StaticTimePicker/StaticTimePicker.js +0 -3
- package/node/TimeClock/TimeClock.js +3 -3
- package/node/TimePicker/TimePicker.js +0 -3
- package/node/TimePicker/TimePickerToolbar.js +0 -3
- package/node/YearCalendar/YearCalendar.js +0 -3
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +4 -4
- package/node/index.js +17 -5
- package/node/internals/hooks/useField/useField.js +5 -3
- package/node/internals/hooks/useField/useField.utils.js +73 -22
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +11 -7
- package/node/internals/hooks/useField/useFieldState.js +8 -6
- package/node/internals/hooks/usePicker/usePicker.js +4 -2
- package/node/internals/hooks/usePicker/usePickerViews.js +8 -3
- package/node/internals/index.js +12 -0
- package/node/internals/utils/valueManagers.js +2 -2
- package/node/locales/beBY.js +8 -3
- package/node/locales/caES.js +7 -2
- package/node/locales/csCZ.js +8 -3
- package/node/locales/daDK.js +8 -3
- package/node/locales/deDE.js +6 -1
- package/node/locales/elGR.js +8 -3
- package/node/locales/enUS.js +7 -3
- package/node/locales/esES.js +8 -3
- package/node/locales/eu.js +6 -1
- package/node/locales/faIR.js +6 -1
- package/node/locales/fiFI.js +8 -3
- package/node/locales/frFR.js +6 -1
- package/node/locales/heIL.js +6 -1
- package/node/locales/huHU.js +6 -1
- package/node/locales/isIS.js +8 -3
- package/node/locales/itIT.js +8 -3
- package/node/locales/jaJP.js +6 -1
- package/node/locales/koKR.js +6 -1
- package/node/locales/kzKZ.js +6 -1
- package/node/locales/mk.js +6 -1
- package/node/locales/nbNO.js +8 -3
- package/node/locales/nlNL.js +8 -3
- package/node/locales/plPL.js +8 -3
- package/node/locales/ptBR.js +6 -1
- package/node/locales/roRO.js +6 -1
- package/node/locales/ruRU.js +8 -3
- package/node/locales/skSK.js +8 -3
- package/node/locales/svSE.js +8 -3
- package/node/locales/trTR.js +8 -3
- package/node/locales/ukUA.js +8 -3
- package/node/locales/urPK.js +6 -1
- package/node/locales/viVN.js +8 -3
- package/node/locales/zhCN.js +6 -1
- package/node/locales/zhHK.js +6 -1
- package/package.json +7 -7
- package/themeAugmentation/components.d.ts +26 -0
- package/themeAugmentation/overrides.d.ts +16 -0
- package/themeAugmentation/props.d.ts +16 -0
- package/timeViewRenderers/timeViewRenderers.d.ts +1 -1
- package/internals/components/PickersInput/PickersFilledInput.d.ts +0 -3
- package/internals/components/PickersInput/PickersInput.d.ts +0 -13
- package/internals/components/PickersInput/PickersOutlinedInput.d.ts +0 -3
- package/internals/components/PickersInput/PickersOutlinedInput.js +0 -117
- package/internals/components/PickersInput/PickersStandardInput.d.ts +0 -3
- package/internals/components/PickersInput/PickersStandardInput.js +0 -123
- package/internals/components/PickersInput/index.js +0 -3
- package/internals/components/PickersInput/pickersInputClasses.d.ts +0 -84
- package/internals/components/PickersInput/pickersInputClasses.js +0 -18
- package/internals/components/PickersTextField/PickersTextField.d.ts +0 -2
- package/internals/components/PickersTextField/PickersTextField.js +0 -138
- package/internals/components/PickersTextField/index.d.ts +0 -1
- package/internals/components/PickersTextField/index.js +0 -1
- package/legacy/internals/components/PickersInput/PickersOutlinedInput.js +0 -110
- package/legacy/internals/components/PickersInput/PickersStandardInput.js +0 -117
- package/legacy/internals/components/PickersInput/index.js +0 -3
- package/legacy/internals/components/PickersInput/pickersInputClasses.js +0 -18
- package/legacy/internals/components/PickersTextField/index.js +0 -1
- package/modern/internals/components/PickersInput/PickersOutlinedInput.js +0 -117
- package/modern/internals/components/PickersInput/PickersStandardInput.js +0 -123
- package/modern/internals/components/PickersInput/index.js +0 -3
- package/modern/internals/components/PickersInput/pickersInputClasses.js +0 -18
- package/modern/internals/components/PickersTextField/PickersTextField.js +0 -138
- package/modern/internals/components/PickersTextField/index.js +0 -1
- package/node/internals/components/PickersInput/PickersOutlinedInput.js +0 -125
- package/node/internals/components/PickersInput/PickersStandardInput.js +0 -132
- package/node/internals/components/PickersInput/pickersInputClasses.js +0 -29
- package/node/internals/components/PickersTextField/index.js +0 -12
- /package/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
- /package/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
- /package/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.d.ts +0 -0
- /package/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
- /package/legacy/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
- /package/legacy/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
- /package/legacy/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
- /package/modern/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
- /package/modern/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
- /package/modern/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
- /package/node/{internals/components/PickersInput/PickersInput.types.js → PickersTextField/PickersInputBase/PickersInputBase.types.js} +0 -0
- /package/node/{internals/components/PickersTextField → PickersTextField}/PickersTextField.types.js +0 -0
- /package/node/{internals/components/PickersTextField → PickersTextField}/pickersTextFieldClasses.js +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["onFocus", "onBlur", "className", "color", "disabled", "error", "variant", "required", "InputProps", "inputProps", "inputRef", "sectionListRef", "elements", "areAllSectionsEmpty", "onClick", "onKeyDown", "onKeyUp", "onPaste", "onInput", "endAdornment", "startAdornment", "tabIndex", "contentEditable", "focused", "value", "onChange", "fullWidth", "id", "helperText", "FormHelperTextProps", "label", "InputLabelProps"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { styled, useThemeProps } from '@mui/material/styles';
|
|
8
|
+
import useForkRef from '@mui/utils/useForkRef';
|
|
9
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
+
import useId from '@mui/utils/useId';
|
|
11
|
+
import InputLabel from '@mui/material/InputLabel';
|
|
12
|
+
import FormHelperText from '@mui/material/FormHelperText';
|
|
13
|
+
import FormControl from '@mui/material/FormControl';
|
|
14
|
+
import { getPickersTextFieldUtilityClass } from './pickersTextFieldClasses';
|
|
15
|
+
import { PickersOutlinedInput } from './PickersOutlinedInput';
|
|
16
|
+
import { PickersFilledInput } from './PickersFilledInput';
|
|
17
|
+
import { PickersInput } from './PickersInput';
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
const VARIANT_COMPONENT = {
|
|
21
|
+
standard: PickersInput,
|
|
22
|
+
filled: PickersFilledInput,
|
|
23
|
+
outlined: PickersOutlinedInput
|
|
24
|
+
};
|
|
25
|
+
const PickersTextFieldRoot = styled(FormControl, {
|
|
26
|
+
name: 'MuiPickersTextField',
|
|
27
|
+
slot: 'Root',
|
|
28
|
+
overridesResolver: (props, styles) => styles.root
|
|
29
|
+
})({});
|
|
30
|
+
const useUtilityClasses = ownerState => {
|
|
31
|
+
const {
|
|
32
|
+
focused,
|
|
33
|
+
disabled,
|
|
34
|
+
classes,
|
|
35
|
+
required
|
|
36
|
+
} = ownerState;
|
|
37
|
+
const slots = {
|
|
38
|
+
root: ['root', focused && !disabled && 'focused', disabled && 'disabled', required && 'required']
|
|
39
|
+
};
|
|
40
|
+
return composeClasses(slots, getPickersTextFieldUtilityClass, classes);
|
|
41
|
+
};
|
|
42
|
+
const PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField(inProps, ref) {
|
|
43
|
+
const props = useThemeProps({
|
|
44
|
+
props: inProps,
|
|
45
|
+
name: 'MuiPickersTextField'
|
|
46
|
+
});
|
|
47
|
+
const {
|
|
48
|
+
// Props used by FormControl
|
|
49
|
+
onFocus,
|
|
50
|
+
onBlur,
|
|
51
|
+
className,
|
|
52
|
+
color = 'primary',
|
|
53
|
+
disabled = false,
|
|
54
|
+
error = false,
|
|
55
|
+
variant = 'outlined',
|
|
56
|
+
required = false,
|
|
57
|
+
// Props used by PickersInput
|
|
58
|
+
InputProps,
|
|
59
|
+
inputProps,
|
|
60
|
+
inputRef,
|
|
61
|
+
sectionListRef,
|
|
62
|
+
elements,
|
|
63
|
+
areAllSectionsEmpty,
|
|
64
|
+
onClick,
|
|
65
|
+
onKeyDown,
|
|
66
|
+
onPaste,
|
|
67
|
+
onInput,
|
|
68
|
+
endAdornment,
|
|
69
|
+
startAdornment,
|
|
70
|
+
tabIndex,
|
|
71
|
+
contentEditable,
|
|
72
|
+
focused,
|
|
73
|
+
value,
|
|
74
|
+
onChange,
|
|
75
|
+
fullWidth,
|
|
76
|
+
id: idProp,
|
|
77
|
+
// Props used by FormHelperText
|
|
78
|
+
helperText,
|
|
79
|
+
FormHelperTextProps,
|
|
80
|
+
// Props used by InputLabel
|
|
81
|
+
label,
|
|
82
|
+
InputLabelProps
|
|
83
|
+
} = props,
|
|
84
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
85
|
+
const rootRef = React.useRef(null);
|
|
86
|
+
const handleRootRef = useForkRef(ref, rootRef);
|
|
87
|
+
const id = useId(idProp);
|
|
88
|
+
const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
|
|
89
|
+
const inputLabelId = label && id ? `${id}-label` : undefined;
|
|
90
|
+
const ownerState = _extends({}, props, {
|
|
91
|
+
color,
|
|
92
|
+
disabled,
|
|
93
|
+
error,
|
|
94
|
+
focused,
|
|
95
|
+
required,
|
|
96
|
+
variant
|
|
97
|
+
});
|
|
98
|
+
const classes = useUtilityClasses(ownerState);
|
|
99
|
+
const PickersInputComponent = VARIANT_COMPONENT[variant];
|
|
100
|
+
return /*#__PURE__*/_jsxs(PickersTextFieldRoot, _extends({
|
|
101
|
+
className: clsx(classes.root, className),
|
|
102
|
+
ref: handleRootRef,
|
|
103
|
+
focused: focused,
|
|
104
|
+
onFocus: onFocus,
|
|
105
|
+
onBlur: onBlur,
|
|
106
|
+
disabled: disabled,
|
|
107
|
+
variant: variant,
|
|
108
|
+
error: error,
|
|
109
|
+
color: color,
|
|
110
|
+
fullWidth: fullWidth,
|
|
111
|
+
required: required,
|
|
112
|
+
ownerState: ownerState
|
|
113
|
+
}, other, {
|
|
114
|
+
children: [/*#__PURE__*/_jsx(InputLabel, _extends({
|
|
115
|
+
htmlFor: id,
|
|
116
|
+
id: inputLabelId
|
|
117
|
+
}, InputLabelProps, {
|
|
118
|
+
children: label
|
|
119
|
+
})), /*#__PURE__*/_jsx(PickersInputComponent, _extends({
|
|
120
|
+
elements: elements,
|
|
121
|
+
areAllSectionsEmpty: areAllSectionsEmpty,
|
|
122
|
+
onClick: onClick,
|
|
123
|
+
onKeyDown: onKeyDown,
|
|
124
|
+
onInput: onInput,
|
|
125
|
+
onPaste: onPaste,
|
|
126
|
+
endAdornment: endAdornment,
|
|
127
|
+
startAdornment: startAdornment,
|
|
128
|
+
tabIndex: tabIndex,
|
|
129
|
+
contentEditable: contentEditable,
|
|
130
|
+
value: value,
|
|
131
|
+
onChange: onChange,
|
|
132
|
+
id: id,
|
|
133
|
+
fullWidth: fullWidth,
|
|
134
|
+
inputProps: inputProps,
|
|
135
|
+
inputRef: inputRef,
|
|
136
|
+
sectionListRef: sectionListRef,
|
|
137
|
+
label: label
|
|
138
|
+
}, InputProps)), helperText && /*#__PURE__*/_jsx(FormHelperText, _extends({
|
|
139
|
+
id: helperTextId
|
|
140
|
+
}, FormHelperTextProps, {
|
|
141
|
+
children: helperText
|
|
142
|
+
}))]
|
|
143
|
+
}));
|
|
144
|
+
});
|
|
145
|
+
process.env.NODE_ENV !== "production" ? PickersTextField.propTypes = {
|
|
146
|
+
// ----------------------------- Warning --------------------------------
|
|
147
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
148
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
149
|
+
// ----------------------------------------------------------------------
|
|
150
|
+
/**
|
|
151
|
+
* Is `true` if the current values equals the empty value.
|
|
152
|
+
* For a single item value, it means that `value === null`
|
|
153
|
+
* For a range value, it means that `value === [null, null]`
|
|
154
|
+
*/
|
|
155
|
+
areAllSectionsEmpty: PropTypes.bool.isRequired,
|
|
156
|
+
className: PropTypes.string,
|
|
157
|
+
/**
|
|
158
|
+
* The color of the component.
|
|
159
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
160
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
161
|
+
* @default 'primary'
|
|
162
|
+
*/
|
|
163
|
+
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
164
|
+
component: PropTypes.elementType,
|
|
165
|
+
/**
|
|
166
|
+
* If true, the whole element is editable.
|
|
167
|
+
* Useful when all the sections are selected.
|
|
168
|
+
*/
|
|
169
|
+
contentEditable: PropTypes.bool.isRequired,
|
|
170
|
+
disabled: PropTypes.bool.isRequired,
|
|
171
|
+
/**
|
|
172
|
+
* The elements to render.
|
|
173
|
+
* Each element contains the prop to edit a section of the value.
|
|
174
|
+
*/
|
|
175
|
+
elements: PropTypes.arrayOf(PropTypes.shape({
|
|
176
|
+
after: PropTypes.object.isRequired,
|
|
177
|
+
before: PropTypes.object.isRequired,
|
|
178
|
+
container: PropTypes.object.isRequired,
|
|
179
|
+
content: PropTypes.object.isRequired
|
|
180
|
+
})).isRequired,
|
|
181
|
+
endAdornment: PropTypes.node,
|
|
182
|
+
error: PropTypes.bool.isRequired,
|
|
183
|
+
/**
|
|
184
|
+
* If `true`, the component is displayed in focused state.
|
|
185
|
+
*/
|
|
186
|
+
focused: PropTypes.bool,
|
|
187
|
+
FormHelperTextProps: PropTypes.object,
|
|
188
|
+
fullWidth: PropTypes.bool,
|
|
189
|
+
/**
|
|
190
|
+
* The helper text content.
|
|
191
|
+
*/
|
|
192
|
+
helperText: PropTypes.node,
|
|
193
|
+
/**
|
|
194
|
+
* If `true`, the label is hidden.
|
|
195
|
+
* This is used to increase density for a `FilledInput`.
|
|
196
|
+
* Be sure to add `aria-label` to the `input` element.
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
hiddenLabel: PropTypes.bool,
|
|
200
|
+
id: PropTypes.string,
|
|
201
|
+
InputLabelProps: PropTypes.object,
|
|
202
|
+
inputProps: PropTypes.object,
|
|
203
|
+
/**
|
|
204
|
+
* Props applied to the Input element.
|
|
205
|
+
* It will be a [`FilledInput`](/material-ui/api/filled-input/),
|
|
206
|
+
* [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)
|
|
207
|
+
* component depending on the `variant` prop value.
|
|
208
|
+
*/
|
|
209
|
+
InputProps: PropTypes.object,
|
|
210
|
+
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
211
|
+
current: PropTypes.object
|
|
212
|
+
})]),
|
|
213
|
+
label: PropTypes.node,
|
|
214
|
+
/**
|
|
215
|
+
* If `dense` or `normal`, will adjust vertical spacing of this and contained components.
|
|
216
|
+
* @default 'none'
|
|
217
|
+
*/
|
|
218
|
+
margin: PropTypes.oneOf(['dense', 'none', 'normal']),
|
|
219
|
+
onBlur: PropTypes.func.isRequired,
|
|
220
|
+
onChange: PropTypes.func.isRequired,
|
|
221
|
+
onClick: PropTypes.func.isRequired,
|
|
222
|
+
onFocus: PropTypes.func.isRequired,
|
|
223
|
+
onInput: PropTypes.func.isRequired,
|
|
224
|
+
onKeyDown: PropTypes.func.isRequired,
|
|
225
|
+
onPaste: PropTypes.func.isRequired,
|
|
226
|
+
readOnly: PropTypes.bool,
|
|
227
|
+
/**
|
|
228
|
+
* If `true`, the label will indicate that the `input` is required.
|
|
229
|
+
* @default false
|
|
230
|
+
*/
|
|
231
|
+
required: PropTypes.bool,
|
|
232
|
+
sectionListRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
233
|
+
current: PropTypes.shape({
|
|
234
|
+
getRoot: PropTypes.func.isRequired,
|
|
235
|
+
getSectionContainer: PropTypes.func.isRequired,
|
|
236
|
+
getSectionContent: PropTypes.func.isRequired,
|
|
237
|
+
getSectionIndexFromDOMElement: PropTypes.func.isRequired
|
|
238
|
+
})
|
|
239
|
+
})]),
|
|
240
|
+
/**
|
|
241
|
+
* The size of the component.
|
|
242
|
+
* @default 'medium'
|
|
243
|
+
*/
|
|
244
|
+
size: PropTypes.oneOf(['medium', 'small']),
|
|
245
|
+
startAdornment: PropTypes.node,
|
|
246
|
+
style: PropTypes.object,
|
|
247
|
+
/**
|
|
248
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
249
|
+
*/
|
|
250
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
251
|
+
value: PropTypes.string.isRequired,
|
|
252
|
+
/**
|
|
253
|
+
* The variant to use.
|
|
254
|
+
* @default 'outlined'
|
|
255
|
+
*/
|
|
256
|
+
variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])
|
|
257
|
+
} : void 0;
|
|
258
|
+
export { PickersTextField };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PickersTextField } from './PickersTextField';
|
|
2
|
+
export { pickersTextFieldClasses, getPickersTextFieldUtilityClass } from './pickersTextFieldClasses';
|
|
3
|
+
export * from './PickersInput';
|
|
4
|
+
export * from './PickersFilledInput';
|
|
5
|
+
export * from './PickersOutlinedInput';
|
|
6
|
+
export * from './PickersInputBase';
|
|
@@ -59,9 +59,6 @@ StaticDatePicker.propTypes = {
|
|
|
59
59
|
* - the `input` element if there is a field rendered.
|
|
60
60
|
*/
|
|
61
61
|
autoFocus: PropTypes.bool,
|
|
62
|
-
/**
|
|
63
|
-
* Class name applied to the root element.
|
|
64
|
-
*/
|
|
65
62
|
className: PropTypes.string,
|
|
66
63
|
/**
|
|
67
64
|
* Formats the day of week displayed in the calendar header.
|
|
@@ -79,9 +79,6 @@ StaticDateTimePicker.propTypes = {
|
|
|
79
79
|
* - the `input` element if there is a field rendered.
|
|
80
80
|
*/
|
|
81
81
|
autoFocus: PropTypes.bool,
|
|
82
|
-
/**
|
|
83
|
-
* Class name applied to the root element.
|
|
84
|
-
*/
|
|
85
82
|
className: PropTypes.string,
|
|
86
83
|
/**
|
|
87
84
|
* Formats the day of week displayed in the calendar header.
|
|
@@ -218,7 +218,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
218
218
|
{
|
|
219
219
|
const handleHoursChange = (hourValue, isFinish) => {
|
|
220
220
|
const valueWithMeridiem = convertValueToMeridiem(hourValue, meridiemMode, ampm);
|
|
221
|
-
setValueAndGoToNextView(utils.setHours(valueOrReferenceDate, valueWithMeridiem), isFinish);
|
|
221
|
+
setValueAndGoToNextView(utils.setHours(valueOrReferenceDate, valueWithMeridiem), isFinish, 'hours');
|
|
222
222
|
};
|
|
223
223
|
return {
|
|
224
224
|
onChange: handleHoursChange,
|
|
@@ -238,7 +238,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
238
238
|
{
|
|
239
239
|
const minutesValue = utils.getMinutes(valueOrReferenceDate);
|
|
240
240
|
const handleMinutesChange = (minuteValue, isFinish) => {
|
|
241
|
-
setValueAndGoToNextView(utils.setMinutes(valueOrReferenceDate, minuteValue), isFinish);
|
|
241
|
+
setValueAndGoToNextView(utils.setMinutes(valueOrReferenceDate, minuteValue), isFinish, 'minutes');
|
|
242
242
|
};
|
|
243
243
|
return {
|
|
244
244
|
viewValue: minutesValue,
|
|
@@ -257,7 +257,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
257
257
|
{
|
|
258
258
|
const secondsValue = utils.getSeconds(valueOrReferenceDate);
|
|
259
259
|
const handleSecondsChange = (secondValue, isFinish) => {
|
|
260
|
-
setValueAndGoToNextView(utils.setSeconds(valueOrReferenceDate, secondValue), isFinish);
|
|
260
|
+
setValueAndGoToNextView(utils.setSeconds(valueOrReferenceDate, secondValue), isFinish, 'seconds');
|
|
261
261
|
};
|
|
262
262
|
return {
|
|
263
263
|
viewValue: secondsValue,
|
|
@@ -65,9 +65,6 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
65
65
|
* - the `input` element if there is a field rendered.
|
|
66
66
|
*/
|
|
67
67
|
autoFocus: PropTypes.bool,
|
|
68
|
-
/**
|
|
69
|
-
* Class name applied to the root element.
|
|
70
|
-
*/
|
|
71
68
|
className: PropTypes.string,
|
|
72
69
|
/**
|
|
73
70
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -214,9 +214,6 @@ process.env.NODE_ENV !== "production" ? TimePickerToolbar.propTypes = {
|
|
|
214
214
|
ampm: PropTypes.bool,
|
|
215
215
|
ampmInClock: PropTypes.bool,
|
|
216
216
|
classes: PropTypes.object,
|
|
217
|
-
/**
|
|
218
|
-
* className applied to the root component.
|
|
219
|
-
*/
|
|
220
217
|
className: PropTypes.string,
|
|
221
218
|
disabled: PropTypes.bool,
|
|
222
219
|
/**
|
|
@@ -264,9 +264,6 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
|
264
264
|
* Override or extend the styles applied to the component.
|
|
265
265
|
*/
|
|
266
266
|
classes: PropTypes.object,
|
|
267
|
-
/**
|
|
268
|
-
* className applied to the root element.
|
|
269
|
-
*/
|
|
270
267
|
className: PropTypes.string,
|
|
271
268
|
/**
|
|
272
269
|
* The default selected value.
|
|
@@ -138,23 +138,23 @@ export const renderDesktopDateTimeView = ({
|
|
|
138
138
|
view: 'hours',
|
|
139
139
|
views: ['hours'],
|
|
140
140
|
focusedView: focusedView && isInternalTimeView(focusedView) ? 'hours' : null,
|
|
141
|
-
sx:
|
|
141
|
+
sx: [{
|
|
142
142
|
width: 'auto',
|
|
143
143
|
[`&.${digitalClockClasses.root}`]: {
|
|
144
144
|
maxHeight: VIEW_HEIGHT
|
|
145
145
|
}
|
|
146
|
-
}, Array.isArray(sx) ? sx : [sx])
|
|
146
|
+
}, ...(Array.isArray(sx) ? sx : [sx])]
|
|
147
147
|
})) : renderMultiSectionDigitalClockTimeView(_extends({}, commonTimeProps, {
|
|
148
148
|
view: isInternalTimeView(view) ? view : 'hours',
|
|
149
149
|
views: views.filter(isInternalTimeView),
|
|
150
150
|
focusedView: focusedView && isInternalTimeView(focusedView) ? focusedView : null,
|
|
151
|
-
sx:
|
|
151
|
+
sx: [{
|
|
152
152
|
borderBottom: 0,
|
|
153
153
|
width: 'auto',
|
|
154
154
|
[`.${multiSectionDigitalClockSectionClasses.root}`]: {
|
|
155
155
|
maxHeight: '100%'
|
|
156
156
|
}
|
|
157
|
-
}, Array.isArray(sx) ? sx : [sx])
|
|
157
|
+
}, ...(Array.isArray(sx) ? sx : [sx])]
|
|
158
158
|
}))]
|
|
159
159
|
})]
|
|
160
160
|
}), isActionBarVisible && /*#__PURE__*/_jsx(Divider, {})]
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers v7.0.0-
|
|
2
|
+
* @mui/x-date-pickers v7.0.0-beta.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -11,7 +11,7 @@ export * from './DigitalClock';
|
|
|
11
11
|
export * from './MultiSectionDigitalClock';
|
|
12
12
|
export * from './LocalizationProvider';
|
|
13
13
|
export * from './PickersDay';
|
|
14
|
-
export * from './locales';
|
|
14
|
+
export * from './locales/utils/pickersLocaleTextApi';
|
|
15
15
|
|
|
16
16
|
// Fields
|
|
17
17
|
export * from './DateField';
|
|
@@ -51,6 +51,7 @@ export * from './PickersShortcuts';
|
|
|
51
51
|
export * from './PickersCalendarHeader';
|
|
52
52
|
|
|
53
53
|
// Field utilities
|
|
54
|
+
export * from './PickersTextField';
|
|
54
55
|
export * from './PickersSectionList';
|
|
55
56
|
export { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from './internals/utils/utils';
|
|
56
57
|
export * from './models';
|
|
@@ -24,6 +24,7 @@ export const useField = params => {
|
|
|
24
24
|
updateValueFromValueStr,
|
|
25
25
|
setTempAndroidValueStr,
|
|
26
26
|
sectionsValueBoundaries,
|
|
27
|
+
localizedDigits,
|
|
27
28
|
placeholder,
|
|
28
29
|
timezone
|
|
29
30
|
} = useFieldState(params);
|
|
@@ -59,6 +60,7 @@ export const useField = params => {
|
|
|
59
60
|
sections: state.sections,
|
|
60
61
|
updateSectionValue,
|
|
61
62
|
sectionsValueBoundaries,
|
|
63
|
+
localizedDigits,
|
|
62
64
|
setTempAndroidValueStr,
|
|
63
65
|
timezone
|
|
64
66
|
});
|
|
@@ -190,7 +192,7 @@ export const useField = params => {
|
|
|
190
192
|
if (selectedSectionIndexes.startIndex === 0 && selectedSectionIndexes.endIndex === state.sections.length - 1 && cleanValueStr.length === 1) {
|
|
191
193
|
keyPressed = cleanValueStr;
|
|
192
194
|
} else {
|
|
193
|
-
const prevValueStr = cleanString(fieldValueManager.getValueStrFromSections(state.sections, isRTL));
|
|
195
|
+
const prevValueStr = cleanString(fieldValueManager.getValueStrFromSections(state.sections, localizedDigits, isRTL));
|
|
194
196
|
let startOfDiffIndex = -1;
|
|
195
197
|
let endOfDiffIndex = -1;
|
|
196
198
|
for (let i = 0; i < prevValueStr.length; i += 1) {
|
|
@@ -300,7 +302,7 @@ export const useField = params => {
|
|
|
300
302
|
}
|
|
301
303
|
const activeSection = state.sections[selectedSectionIndexes.startIndex];
|
|
302
304
|
const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);
|
|
303
|
-
const newSectionValue = adjustSectionValue(utils, timezone, activeSection, event.key, sectionsValueBoundaries, activeDateManager.date, {
|
|
305
|
+
const newSectionValue = adjustSectionValue(utils, timezone, activeSection, event.key, sectionsValueBoundaries, localizedDigits, activeDateManager.date, {
|
|
304
306
|
minutesStep
|
|
305
307
|
});
|
|
306
308
|
updateSectionValue({
|
|
@@ -383,7 +385,7 @@ export const useField = params => {
|
|
|
383
385
|
}
|
|
384
386
|
}, [state.tempValueStrAndroid]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
385
387
|
|
|
386
|
-
const valueStr = React.useMemo(() => state.tempValueStrAndroid ?? fieldValueManager.getValueStrFromSections(state.sections, isRTL), [state.sections, fieldValueManager, state.tempValueStrAndroid, isRTL]);
|
|
388
|
+
const valueStr = React.useMemo(() => state.tempValueStrAndroid ?? fieldValueManager.getValueStrFromSections(state.sections, localizedDigits, isRTL), [state.sections, fieldValueManager, state.tempValueStrAndroid, localizedDigits, isRTL]);
|
|
387
389
|
const inputMode = React.useMemo(() => {
|
|
388
390
|
if (selectedSectionIndexes == null) {
|
|
389
391
|
return 'text';
|
|
@@ -65,7 +65,54 @@ export const getLetterEditingOptions = (utils, timezone, sectionType, format) =>
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
|
|
69
|
+
// This format should be the same on all the adapters
|
|
70
|
+
// If some adapter does not respect this convention, then we will need to hardcode the format on each adapter.
|
|
71
|
+
export const FORMAT_SECONDS_NO_LEADING_ZEROS = 's';
|
|
72
|
+
const NON_LOCALIZED_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
73
|
+
export const getLocalizedDigits = utils => {
|
|
74
|
+
const today = utils.date(undefined);
|
|
75
|
+
const formattedZero = utils.formatByString(utils.setSeconds(today, 0), FORMAT_SECONDS_NO_LEADING_ZEROS);
|
|
76
|
+
if (formattedZero === '0') {
|
|
77
|
+
return NON_LOCALIZED_DIGITS;
|
|
78
|
+
}
|
|
79
|
+
return Array.from({
|
|
80
|
+
length: 10
|
|
81
|
+
}).map((_, index) => utils.formatByString(utils.setSeconds(today, index), FORMAT_SECONDS_NO_LEADING_ZEROS));
|
|
82
|
+
};
|
|
83
|
+
export const removeLocalizedDigits = (valueStr, localizedDigits) => {
|
|
84
|
+
if (localizedDigits[0] === '0') {
|
|
85
|
+
return valueStr;
|
|
86
|
+
}
|
|
87
|
+
const digits = [];
|
|
88
|
+
let currentFormattedDigit = '';
|
|
89
|
+
for (let i = 0; i < valueStr.length; i += 1) {
|
|
90
|
+
currentFormattedDigit += valueStr[i];
|
|
91
|
+
const matchingDigitIndex = localizedDigits.indexOf(currentFormattedDigit);
|
|
92
|
+
if (matchingDigitIndex > -1) {
|
|
93
|
+
digits.push(matchingDigitIndex.toString());
|
|
94
|
+
currentFormattedDigit = '';
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return digits.join('');
|
|
98
|
+
};
|
|
99
|
+
export const applyLocalizedDigits = (valueStr, localizedDigits) => {
|
|
100
|
+
if (localizedDigits[0] === '0') {
|
|
101
|
+
return valueStr;
|
|
102
|
+
}
|
|
103
|
+
return valueStr.split('').map(char => localizedDigits[Number(char)]).join('');
|
|
104
|
+
};
|
|
105
|
+
export const isStringNumber = (valueStr, localizedDigits) => {
|
|
106
|
+
const nonLocalizedValueStr = removeLocalizedDigits(valueStr, localizedDigits);
|
|
107
|
+
return !Number.isNaN(Number(nonLocalizedValueStr));
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Remove the leading zeroes to a digit section value.
|
|
112
|
+
* E.g.: `03` => `3`
|
|
113
|
+
* Warning: Should only be called with non-localized digits. Call `removeLocalizedDigits` with your value if needed.
|
|
114
|
+
*/
|
|
115
|
+
export const cleanLeadingZeros = (valueStr, size) => {
|
|
69
116
|
let cleanValueStr = valueStr;
|
|
70
117
|
|
|
71
118
|
// Remove the leading zeros
|
|
@@ -77,7 +124,7 @@ export const cleanLeadingZeros = (utils, valueStr, size) => {
|
|
|
77
124
|
}
|
|
78
125
|
return cleanValueStr;
|
|
79
126
|
};
|
|
80
|
-
export const cleanDigitSectionValue = (utils,
|
|
127
|
+
export const cleanDigitSectionValue = (utils, value, sectionBoundaries, localizedDigits, section) => {
|
|
81
128
|
if (process.env.NODE_ENV !== 'production') {
|
|
82
129
|
if (section.type !== 'day' && section.contentType === 'digit-with-letter') {
|
|
83
130
|
throw new Error([`MUI X: The token "${section.format}" is a digit format with letter in it.'
|
|
@@ -90,13 +137,13 @@ export const cleanDigitSectionValue = (utils, timezone, value, sectionBoundaries
|
|
|
90
137
|
}
|
|
91
138
|
|
|
92
139
|
// queryValue without leading `0` (`01` => `1`)
|
|
93
|
-
|
|
140
|
+
let valueStr = value.toString();
|
|
94
141
|
if (section.hasLeadingZerosInInput) {
|
|
95
|
-
|
|
142
|
+
valueStr = cleanLeadingZeros(valueStr, section.maxLength);
|
|
96
143
|
}
|
|
97
|
-
return valueStr;
|
|
144
|
+
return applyLocalizedDigits(valueStr, localizedDigits);
|
|
98
145
|
};
|
|
99
|
-
export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoundaries, activeDate, stepsAttributes) => {
|
|
146
|
+
export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoundaries, localizedDigits, activeDate, stepsAttributes) => {
|
|
100
147
|
const delta = getDeltaFromKeyCode(keyCode);
|
|
101
148
|
const isStart = keyCode === 'Home';
|
|
102
149
|
const isEnd = keyCode === 'End';
|
|
@@ -107,9 +154,9 @@ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsVa
|
|
|
107
154
|
format: section.format,
|
|
108
155
|
contentType: section.contentType
|
|
109
156
|
});
|
|
110
|
-
const getCleanValue = value => cleanDigitSectionValue(utils,
|
|
157
|
+
const getCleanValue = value => cleanDigitSectionValue(utils, value, sectionBoundaries, localizedDigits, section);
|
|
111
158
|
const step = section.type === 'minutes' && stepsAttributes?.minutesStep ? stepsAttributes.minutesStep : 1;
|
|
112
|
-
const currentSectionValue = parseInt(section.value, 10);
|
|
159
|
+
const currentSectionValue = parseInt(removeLocalizedDigits(section.value, localizedDigits), 10);
|
|
113
160
|
let newSectionValueNumber = currentSectionValue + delta * step;
|
|
114
161
|
if (shouldSetAbsolute) {
|
|
115
162
|
if (section.type === 'year' && !isEnd && !isStart) {
|
|
@@ -157,11 +204,11 @@ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsVa
|
|
|
157
204
|
}
|
|
158
205
|
return adjustLetterSection();
|
|
159
206
|
};
|
|
160
|
-
export const getSectionVisibleValue = (section, target) => {
|
|
207
|
+
export const getSectionVisibleValue = (section, target, localizedDigits) => {
|
|
161
208
|
let value = section.value || section.placeholder;
|
|
162
209
|
const hasLeadingZeros = target === 'non-input' ? section.hasLeadingZerosInFormat : section.hasLeadingZerosInInput;
|
|
163
210
|
if (target === 'non-input' && section.hasLeadingZerosInInput && !section.hasLeadingZerosInFormat) {
|
|
164
|
-
value = Number(value).toString();
|
|
211
|
+
value = Number(removeLocalizedDigits(value, localizedDigits)).toString();
|
|
165
212
|
}
|
|
166
213
|
|
|
167
214
|
// In the input, we add an empty character at the end of each section without leading zeros.
|
|
@@ -179,13 +226,13 @@ export const getSectionVisibleValue = (section, target) => {
|
|
|
179
226
|
return value;
|
|
180
227
|
};
|
|
181
228
|
export const cleanString = dirtyString => dirtyString.replace(/[\u2066\u2067\u2068\u2069]/g, '');
|
|
182
|
-
export const addPositionPropertiesToSections = (sections, isRTL) => {
|
|
229
|
+
export const addPositionPropertiesToSections = (sections, localizedDigits, isRTL) => {
|
|
183
230
|
let position = 0;
|
|
184
231
|
let positionInInput = isRTL ? 1 : 0;
|
|
185
232
|
const newSections = [];
|
|
186
233
|
for (let i = 0; i < sections.length; i += 1) {
|
|
187
234
|
const section = sections[i];
|
|
188
|
-
const renderedValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr');
|
|
235
|
+
const renderedValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);
|
|
189
236
|
const sectionStr = `${section.startSeparator}${renderedValue}${section.endSeparator}`;
|
|
190
237
|
const sectionLength = cleanString(sectionStr).length;
|
|
191
238
|
const sectionLengthInInput = sectionStr.length;
|
|
@@ -337,7 +384,7 @@ const getEscapedPartsFromFormat = (utils, format) => {
|
|
|
337
384
|
}
|
|
338
385
|
return escapedParts;
|
|
339
386
|
};
|
|
340
|
-
export const splitFormatIntoSections = (utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL) => {
|
|
387
|
+
export const splitFormatIntoSections = (utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL) => {
|
|
341
388
|
let startSeparator = '';
|
|
342
389
|
const sections = [];
|
|
343
390
|
const now = utils.date();
|
|
@@ -360,7 +407,7 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
|
|
|
360
407
|
}
|
|
361
408
|
maxLength = sectionConfig.maxLength;
|
|
362
409
|
if (isValidDate) {
|
|
363
|
-
sectionValue = cleanLeadingZeros(
|
|
410
|
+
sectionValue = applyLocalizedDigits(cleanLeadingZeros(removeLocalizedDigits(sectionValue, localizedDigits), maxLength), localizedDigits);
|
|
364
411
|
}
|
|
365
412
|
}
|
|
366
413
|
}
|
|
@@ -461,7 +508,7 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
|
|
|
461
508
|
* Some date libraries like `dayjs` don't support parsing from date with escaped characters.
|
|
462
509
|
* To make sure that the parsing works, we are building a format and a date without any separator.
|
|
463
510
|
*/
|
|
464
|
-
export const getDateFromDateSections = (utils, sections) => {
|
|
511
|
+
export const getDateFromDateSections = (utils, sections, localizedDigits) => {
|
|
465
512
|
// If we have both a day and a weekDay section,
|
|
466
513
|
// Then we skip the weekDay in the parsing because libraries like dayjs can't parse complicated formats containing a weekDay.
|
|
467
514
|
// dayjs(dayjs().format('dddd MMMM D YYYY'), 'dddd MMMM D YYYY')) // returns `Invalid Date` even if the format is valid.
|
|
@@ -473,16 +520,16 @@ export const getDateFromDateSections = (utils, sections) => {
|
|
|
473
520
|
const shouldSkip = shouldSkipWeekDays && section.type === 'weekDay';
|
|
474
521
|
if (!shouldSkip) {
|
|
475
522
|
sectionFormats.push(section.format);
|
|
476
|
-
sectionValues.push(getSectionVisibleValue(section, 'non-input'));
|
|
523
|
+
sectionValues.push(getSectionVisibleValue(section, 'non-input', localizedDigits));
|
|
477
524
|
}
|
|
478
525
|
}
|
|
479
526
|
const formatWithoutSeparator = sectionFormats.join(' ');
|
|
480
527
|
const dateWithoutSeparatorStr = sectionValues.join(' ');
|
|
481
528
|
return utils.parse(dateWithoutSeparatorStr, formatWithoutSeparator);
|
|
482
529
|
};
|
|
483
|
-
export const createDateStrForInputFromSections = (sections, isRTL) => {
|
|
530
|
+
export const createDateStrForInputFromSections = (sections, localizedDigits, isRTL) => {
|
|
484
531
|
const formattedSections = sections.map(section => {
|
|
485
|
-
const dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr');
|
|
532
|
+
const dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);
|
|
486
533
|
return `${section.startSeparator}${dateValue}${section.endSeparator}`;
|
|
487
534
|
});
|
|
488
535
|
const dateStr = formattedSections.join('');
|
|
@@ -497,7 +544,7 @@ export const createDateStrForInputFromSections = (sections, isRTL) => {
|
|
|
497
544
|
// wrap into an isolated group such that separators can split the string in smaller ones by adding \u2069\u2068
|
|
498
545
|
return `\u2066${dateStr}\u2069`;
|
|
499
546
|
};
|
|
500
|
-
export const getSectionsBoundaries = (utils, timezone) => {
|
|
547
|
+
export const getSectionsBoundaries = (utils, localizedDigits, timezone) => {
|
|
501
548
|
const today = utils.date(undefined, timezone);
|
|
502
549
|
const endOfYear = utils.endOfYear(today);
|
|
503
550
|
const endOfDay = utils.endOfDay(today);
|
|
@@ -556,11 +603,11 @@ export const getSectionsBoundaries = (utils, timezone) => {
|
|
|
556
603
|
format
|
|
557
604
|
}) => {
|
|
558
605
|
const lastHourInDay = utils.getHours(endOfDay);
|
|
559
|
-
const hasMeridiem = utils.formatByString(utils.endOfDay(today), format) !== lastHourInDay.toString();
|
|
606
|
+
const hasMeridiem = removeLocalizedDigits(utils.formatByString(utils.endOfDay(today), format), localizedDigits) !== lastHourInDay.toString();
|
|
560
607
|
if (hasMeridiem) {
|
|
561
608
|
return {
|
|
562
609
|
minimum: 1,
|
|
563
|
-
maximum: Number(utils.formatByString(utils.startOfDay(today), format))
|
|
610
|
+
maximum: Number(removeLocalizedDigits(utils.formatByString(utils.startOfDay(today), format), localizedDigits))
|
|
564
611
|
};
|
|
565
612
|
}
|
|
566
613
|
return {
|