@mui/x-date-pickers 7.0.0-alpha.7 → 7.0.0-alpha.9
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.d.ts +4 -21
- package/AdapterDateFns/AdapterDateFns.js +11 -255
- package/AdapterDateFnsBase/AdapterDateFnsBase.d.ts +62 -0
- package/AdapterDateFnsBase/AdapterDateFnsBase.js +291 -0
- package/AdapterDateFnsBase/index.d.ts +1 -0
- package/AdapterDateFnsBase/index.js +1 -0
- package/AdapterDateFnsBase/package.json +6 -0
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -0
- package/AdapterDateFnsV3/AdapterDateFnsV3.d.ts +80 -0
- package/AdapterDateFnsV3/AdapterDateFnsV3.js +287 -0
- package/AdapterDateFnsV3/index.d.ts +1 -0
- package/AdapterDateFnsV3/index.js +1 -0
- package/AdapterDateFnsV3/package.json +6 -0
- package/AdapterLuxon/AdapterLuxon.d.ts +1 -1
- package/AdapterLuxon/AdapterLuxon.js +4 -12
- package/CHANGELOG.md +554 -51
- package/DatePicker/DatePicker.js +0 -3
- package/DatePicker/DatePickerToolbar.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.js +2 -10
- package/DateTimePicker/DateTimePicker.js +0 -3
- package/DateTimePicker/DateTimePickerToolbar.js +0 -3
- package/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/DigitalClock/DigitalClock.js +1 -0
- package/DigitalClock/DigitalClock.types.d.ts +5 -0
- package/LocalizationProvider/LocalizationProvider.js +1 -1
- 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/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +5 -0
- package/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +0 -3
- package/PickersSectionList/PickersSectionList.js +7 -2
- 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 -28
- 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 +1 -1
- package/StaticDatePicker/StaticDatePicker.js +0 -3
- package/StaticDateTimePicker/StaticDateTimePicker.js +0 -3
- package/StaticTimePicker/StaticTimePicker.js +0 -3
- package/TimeClock/TimeClock.js +1 -0
- package/TimeClock/TimeClock.types.d.ts +5 -0
- 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/hooks/useClearableField.js +3 -3
- 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 +73 -26
- 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/index.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/internals/hooks/useUtils.js +2 -2
- package/internals/hooks/useViews.js +2 -2
- package/internals/index.d.ts +9 -3
- package/internals/index.js +6 -2
- package/internals/models/common.d.ts +1 -1
- package/internals/models/helpers.d.ts +1 -0
- package/internals/models/props/basePickerProps.d.ts +0 -3
- package/internals/models/props/toolbar.d.ts +0 -3
- package/internals/utils/valueManagers.js +2 -2
- package/internals/utils/views.js +1 -1
- package/legacy/AdapterDateFns/AdapterDateFns.js +222 -458
- package/legacy/AdapterDateFnsBase/AdapterDateFnsBase.js +293 -0
- package/legacy/AdapterDateFnsBase/index.js +1 -0
- package/legacy/AdapterDateFnsV3/AdapterDateFnsV3.js +306 -0
- package/legacy/AdapterDateFnsV3/index.js +1 -0
- package/legacy/AdapterLuxon/AdapterLuxon.js +4 -12
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -6
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -6
- package/legacy/DatePicker/DatePicker.js +0 -3
- package/legacy/DatePicker/DatePickerToolbar.js +2 -10
- package/legacy/DateTimePicker/DateTimePicker.js +0 -3
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +0 -3
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/legacy/DigitalClock/DigitalClock.js +1 -0
- package/legacy/LocalizationProvider/LocalizationProvider.js +1 -1
- 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/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/legacy/PickersSectionList/PickersSectionList.js +7 -2
- 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 -28
- 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 +1 -0
- package/legacy/TimePicker/TimePicker.js +0 -3
- package/legacy/TimePicker/TimePickerToolbar.js +0 -3
- package/legacy/YearCalendar/YearCalendar.js +0 -3
- package/legacy/hooks/useClearableField.js +3 -3
- package/legacy/index.js +3 -2
- package/legacy/internals/hooks/useField/useField.js +6 -4
- package/legacy/internals/hooks/useField/useField.utils.js +76 -25
- package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
- package/legacy/internals/hooks/useField/useFieldState.js +15 -11
- package/legacy/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/legacy/internals/hooks/useUtils.js +2 -2
- package/legacy/internals/hooks/useViews.js +2 -2
- package/legacy/internals/index.js +6 -2
- package/legacy/internals/utils/valueManagers.js +2 -2
- package/legacy/internals/utils/views.js +1 -1
- package/legacy/locales/index.js +1 -0
- package/locales/enUS.d.ts +1 -1
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/mk.d.ts +1 -1
- package/locales/utils/getPickersLocalization.d.ts +1 -1
- package/modern/AdapterDateFns/AdapterDateFns.js +11 -254
- package/modern/AdapterDateFnsBase/AdapterDateFnsBase.js +290 -0
- package/modern/AdapterDateFnsBase/index.js +1 -0
- package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +287 -0
- package/modern/AdapterDateFnsV3/index.js +1 -0
- package/modern/AdapterLuxon/AdapterLuxon.js +3 -11
- package/modern/DatePicker/DatePicker.js +0 -3
- package/modern/DatePicker/DatePickerToolbar.js +2 -10
- package/modern/DateTimePicker/DateTimePicker.js +0 -3
- package/modern/DateTimePicker/DateTimePickerToolbar.js +0 -3
- package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/modern/DigitalClock/DigitalClock.js +1 -0
- package/modern/LocalizationProvider/LocalizationProvider.js +1 -1
- 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/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/modern/PickersSectionList/PickersSectionList.js +7 -2
- 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 -28
- 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 +1 -0
- package/modern/TimePicker/TimePicker.js +0 -3
- package/modern/TimePicker/TimePickerToolbar.js +0 -3
- package/modern/YearCalendar/YearCalendar.js +0 -3
- package/modern/hooks/useClearableField.js +3 -3
- package/modern/index.js +3 -2
- package/modern/internals/hooks/useField/useField.js +5 -3
- package/modern/internals/hooks/useField/useField.utils.js +73 -26
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +12 -8
- package/modern/internals/hooks/useField/useFieldState.js +9 -7
- package/modern/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/modern/internals/hooks/useUtils.js +2 -2
- package/modern/internals/hooks/useViews.js +2 -2
- package/modern/internals/index.js +6 -2
- package/modern/internals/utils/valueManagers.js +2 -2
- package/modern/internals/utils/views.js +1 -1
- package/modern/locales/index.js +1 -0
- package/node/AdapterDateFns/AdapterDateFns.js +11 -254
- package/node/AdapterDateFnsBase/AdapterDateFnsBase.js +298 -0
- package/node/AdapterDateFnsBase/index.js +12 -0
- package/node/AdapterDateFnsV3/AdapterDateFnsV3.js +295 -0
- package/node/AdapterDateFnsV3/index.js +12 -0
- package/node/AdapterLuxon/AdapterLuxon.js +3 -11
- package/node/DatePicker/DatePicker.js +0 -3
- package/node/DatePicker/DatePickerToolbar.js +0 -7
- package/node/DateTimePicker/DateTimePicker.js +0 -3
- package/node/DateTimePicker/DateTimePickerToolbar.js +0 -3
- package/node/DesktopDatePicker/DesktopDatePicker.js +0 -3
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -3
- package/node/DesktopTimePicker/DesktopTimePicker.js +0 -3
- package/node/DigitalClock/DigitalClock.js +1 -0
- package/node/LocalizationProvider/LocalizationProvider.js +1 -1
- 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/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +0 -3
- package/node/PickersSectionList/PickersSectionList.js +7 -2
- 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 -28
- 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 +1 -0
- package/node/TimePicker/TimePicker.js +0 -3
- package/node/TimePicker/TimePickerToolbar.js +0 -3
- package/node/YearCalendar/YearCalendar.js +0 -3
- package/node/hooks/useClearableField.js +3 -3
- package/node/index.js +17 -5
- package/node/internals/hooks/useField/useField.js +5 -3
- package/node/internals/hooks/useField/useField.utils.js +78 -27
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +11 -7
- package/node/internals/hooks/useField/useFieldState.js +8 -6
- package/node/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/node/internals/hooks/useUtils.js +2 -2
- package/node/internals/hooks/useViews.js +2 -2
- package/node/internals/index.js +47 -1
- package/node/internals/utils/valueManagers.js +2 -2
- package/node/internals/utils/views.js +1 -1
- package/node/locales/index.js +11 -0
- package/package.json +8 -8
- package/themeAugmentation/components.d.ts +26 -0
- package/themeAugmentation/overrides.d.ts +16 -0
- package/themeAugmentation/props.d.ts +16 -0
- package/internals/components/PickersInput/PickersFilledInput.d.ts +0 -3
- package/internals/components/PickersInput/PickersInput.d.ts +0 -15
- 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
package/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from './DigitalClock';
|
|
|
3
3
|
export * from './MultiSectionDigitalClock';
|
|
4
4
|
export * from './LocalizationProvider';
|
|
5
5
|
export * from './PickersDay';
|
|
6
|
-
export * from './locales';
|
|
6
|
+
export * from './locales/utils/pickersLocaleTextApi';
|
|
7
7
|
export * from './DateField';
|
|
8
8
|
export * from './TimeField';
|
|
9
9
|
export * from './DateTimeField';
|
|
@@ -29,6 +29,7 @@ export * from './PickersLayout';
|
|
|
29
29
|
export * from './PickersActionBar';
|
|
30
30
|
export * from './PickersShortcuts';
|
|
31
31
|
export * from './PickersCalendarHeader';
|
|
32
|
+
export * from './PickersTextField';
|
|
32
33
|
export * from './PickersSectionList';
|
|
33
34
|
export { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from './internals/utils/utils';
|
|
34
35
|
export * from './models';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers v7.0.0-alpha.
|
|
2
|
+
* @mui/x-date-pickers v7.0.0-alpha.9
|
|
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
|
});
|
|
@@ -191,7 +193,7 @@ export const useField = params => {
|
|
|
191
193
|
if (selectedSectionIndexes.startIndex === 0 && selectedSectionIndexes.endIndex === state.sections.length - 1 && cleanValueStr.length === 1) {
|
|
192
194
|
keyPressed = cleanValueStr;
|
|
193
195
|
} else {
|
|
194
|
-
const prevValueStr = cleanString(fieldValueManager.getValueStrFromSections(state.sections, isRTL));
|
|
196
|
+
const prevValueStr = cleanString(fieldValueManager.getValueStrFromSections(state.sections, localizedDigits, isRTL));
|
|
195
197
|
let startOfDiffIndex = -1;
|
|
196
198
|
let endOfDiffIndex = -1;
|
|
197
199
|
for (let i = 0; i < prevValueStr.length; i += 1) {
|
|
@@ -301,7 +303,7 @@ export const useField = params => {
|
|
|
301
303
|
}
|
|
302
304
|
const activeSection = state.sections[selectedSectionIndexes.startIndex];
|
|
303
305
|
const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);
|
|
304
|
-
const newSectionValue = adjustSectionValue(utils, timezone, activeSection, event.key, sectionsValueBoundaries, activeDateManager.date, {
|
|
306
|
+
const newSectionValue = adjustSectionValue(utils, timezone, activeSection, event.key, sectionsValueBoundaries, localizedDigits, activeDateManager.date, {
|
|
305
307
|
minutesStep
|
|
306
308
|
});
|
|
307
309
|
updateSectionValue({
|
|
@@ -386,8 +388,8 @@ export const useField = params => {
|
|
|
386
388
|
|
|
387
389
|
const valueStr = React.useMemo(() => {
|
|
388
390
|
var _state$tempValueStrAn;
|
|
389
|
-
return (_state$tempValueStrAn = state.tempValueStrAndroid) != null ? _state$tempValueStrAn : fieldValueManager.getValueStrFromSections(state.sections, isRTL);
|
|
390
|
-
}, [state.sections, fieldValueManager, state.tempValueStrAndroid, isRTL]);
|
|
391
|
+
return (_state$tempValueStrAn = state.tempValueStrAndroid) != null ? _state$tempValueStrAn : fieldValueManager.getValueStrFromSections(state.sections, localizedDigits, isRTL);
|
|
392
|
+
}, [state.sections, fieldValueManager, state.tempValueStrAndroid, localizedDigits, isRTL]);
|
|
391
393
|
const inputMode = React.useMemo(() => {
|
|
392
394
|
if (selectedSectionIndexes == null) {
|
|
393
395
|
return 'text';
|
|
@@ -208,19 +208,21 @@ export interface FieldValueManager<TValue, TDate, TSection extends FieldSection>
|
|
|
208
208
|
* @param {MuiPickersAdapter<TDate>} utils The utils to manipulate the date.
|
|
209
209
|
* @param {TValue} value The current value to generate sections from.
|
|
210
210
|
* @param {TSection[] | null} fallbackSections The sections to use as a fallback if a date is null or invalid.
|
|
211
|
+
* @param {string} localizedDigits The conversion table from localized to 0-9 digits.
|
|
211
212
|
* @param {boolean} isRTL `true` if the direction is "right to left".
|
|
212
213
|
* @param {(date: TDate) => FieldSectionWithoutPosition[]} getSectionsFromDate Returns the sections of the given date.
|
|
213
214
|
* @returns {TSection[]} The new section list.
|
|
214
215
|
*/
|
|
215
|
-
getSectionsFromValue: (utils: MuiPickersAdapter<TDate>, value: TValue, fallbackSections: TSection[] | null, isRTL: boolean, getSectionsFromDate: (date: TDate) => FieldSectionWithoutPosition[]) => TSection[];
|
|
216
|
+
getSectionsFromValue: (utils: MuiPickersAdapter<TDate>, value: TValue, fallbackSections: TSection[] | null, localizedDigits: string[], isRTL: boolean, getSectionsFromDate: (date: TDate) => FieldSectionWithoutPosition[]) => TSection[];
|
|
216
217
|
/**
|
|
217
218
|
* Creates the string value to render in the input based on the current section list.
|
|
218
219
|
* @template TSection
|
|
219
220
|
* @param {TSection[]} sections The current section list.
|
|
221
|
+
* @param {string} localizedDigits The conversion table from localized to 0-9 digits.
|
|
220
222
|
* @param {boolean} isRTL `true` if the current orientation is "right to left"
|
|
221
223
|
* @returns {string} The string value to render in the input.
|
|
222
224
|
*/
|
|
223
|
-
getValueStrFromSections: (sections: TSection[], isRTL: boolean) => string;
|
|
225
|
+
getValueStrFromSections: (sections: TSection[], localizedDigits: string[], isRTL: boolean) => string;
|
|
224
226
|
/**
|
|
225
227
|
* Returns the manager of the active date.
|
|
226
228
|
* @template TValue, TDate, TSection
|
|
@@ -6,24 +6,34 @@ export declare const getDateSectionConfigFromFormatToken: <TDate>(utils: MuiPick
|
|
|
6
6
|
};
|
|
7
7
|
export declare const getDaysInWeekStr: <TDate>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone, format: string) => string[];
|
|
8
8
|
export declare const getLetterEditingOptions: <TDate>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone, sectionType: FieldSectionType, format: string) => string[];
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
9
|
+
export declare const FORMAT_SECONDS_NO_LEADING_ZEROS = "s";
|
|
10
|
+
export declare const getLocalizedDigits: <TDate>(utils: MuiPickersAdapter<TDate, any>) => string[];
|
|
11
|
+
export declare const removeLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
12
|
+
export declare const applyLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
13
|
+
export declare const isStringNumber: (valueStr: string, localizedDigits: string[]) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Remove the leading zeroes to a digit section value.
|
|
16
|
+
* E.g.: `03` => `3`
|
|
17
|
+
* Warning: Should only be called with non-localized digits. Call `removeLocalizedDigits` with your value if needed.
|
|
18
|
+
*/
|
|
19
|
+
export declare const cleanLeadingZeros: (valueStr: string, size: number) => string;
|
|
20
|
+
export declare const cleanDigitSectionValue: <TDate>(utils: MuiPickersAdapter<TDate, any>, value: number, sectionBoundaries: FieldSectionValueBoundaries<TDate, any>, localizedDigits: string[], section: Pick<FieldSection, 'format' | 'type' | 'contentType' | 'hasLeadingZerosInFormat' | 'hasLeadingZerosInInput' | 'maxLength'>) => string;
|
|
21
|
+
export declare const adjustSectionValue: <TDate, TSection extends FieldSection>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone, section: TSection, keyCode: AvailableAdjustKeyCode, sectionsValueBoundaries: FieldSectionsValueBoundaries<TDate>, localizedDigits: string[], activeDate: TDate | null, stepsAttributes?: {
|
|
12
22
|
minutesStep?: number;
|
|
13
23
|
}) => string;
|
|
14
|
-
export declare const getSectionVisibleValue: (section: FieldSectionWithoutPosition, target: 'input-rtl' | 'input-ltr' | 'non-input') => string;
|
|
24
|
+
export declare const getSectionVisibleValue: (section: FieldSectionWithoutPosition, target: 'input-rtl' | 'input-ltr' | 'non-input', localizedDigits: string[]) => string;
|
|
15
25
|
export declare const cleanString: (dirtyString: string) => string;
|
|
16
|
-
export declare const addPositionPropertiesToSections: <TSection extends FieldSection>(sections: FieldSectionWithoutPosition<TSection>[], isRTL: boolean) => TSection[];
|
|
26
|
+
export declare const addPositionPropertiesToSections: <TSection extends FieldSection>(sections: FieldSectionWithoutPosition<TSection>[], localizedDigits: string[], isRTL: boolean) => TSection[];
|
|
17
27
|
export declare const changeSectionValueFormat: <TDate>(utils: MuiPickersAdapter<TDate, any>, valueStr: string, currentFormat: string, newFormat: string) => string;
|
|
18
28
|
export declare const doesSectionFormatHaveLeadingZeros: <TDate>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone, contentType: FieldSectionContentType, sectionType: FieldSectionType, format: string) => boolean;
|
|
19
|
-
export declare const splitFormatIntoSections: <TDate>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone, localeText: PickersLocaleText<TDate>, format: string, date: TDate | null, formatDensity: 'dense' | 'spacious', shouldRespectLeadingZeros: boolean, isRTL: boolean) => FieldSectionWithoutPosition[];
|
|
29
|
+
export declare const splitFormatIntoSections: <TDate>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone, localeText: PickersLocaleText<TDate>, localizedDigits: string[], format: string, date: TDate | null, formatDensity: 'dense' | 'spacious', shouldRespectLeadingZeros: boolean, isRTL: boolean) => FieldSectionWithoutPosition[];
|
|
20
30
|
/**
|
|
21
31
|
* Some date libraries like `dayjs` don't support parsing from date with escaped characters.
|
|
22
32
|
* To make sure that the parsing works, we are building a format and a date without any separator.
|
|
23
33
|
*/
|
|
24
|
-
export declare const getDateFromDateSections: <TDate>(utils: MuiPickersAdapter<TDate, any>, sections: FieldSection[]) => NonNullable<TDate>;
|
|
25
|
-
export declare const createDateStrForInputFromSections: (sections: FieldSection[], isRTL: boolean) => string;
|
|
26
|
-
export declare const getSectionsBoundaries: <TDate>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone) => FieldSectionsValueBoundaries<TDate>;
|
|
34
|
+
export declare const getDateFromDateSections: <TDate>(utils: MuiPickersAdapter<TDate, any>, sections: FieldSection[], localizedDigits: string[]) => NonNullable<TDate>;
|
|
35
|
+
export declare const createDateStrForInputFromSections: (sections: FieldSection[], localizedDigits: string[], isRTL: boolean) => string;
|
|
36
|
+
export declare const getSectionsBoundaries: <TDate>(utils: MuiPickersAdapter<TDate, any>, localizedDigits: string[], timezone: PickersTimezone) => FieldSectionsValueBoundaries<TDate>;
|
|
27
37
|
export declare const validateSections: <TSection extends FieldSection>(sections: TSection[], valueType: FieldValueType) => void;
|
|
28
38
|
export declare const mergeDateIntoReferenceDate: <TDate>(utils: MuiPickersAdapter<TDate, any>, timezone: PickersTimezone, dateToTransferFrom: TDate, sections: FieldSectionWithoutPosition[], referenceDate: TDate, shouldLimitToEditedSections: boolean) => TDate;
|
|
29
39
|
export declare const isAndroid: () => boolean;
|
|
@@ -3,7 +3,7 @@ import { getMonthsInYear } from '../../utils/date-utils';
|
|
|
3
3
|
export const getDateSectionConfigFromFormatToken = (utils, formatToken) => {
|
|
4
4
|
const config = utils.formatTokenMap[formatToken];
|
|
5
5
|
if (config == null) {
|
|
6
|
-
throw new Error([`MUI: The token "${formatToken}" is not supported by the Date and Time Pickers.`, 'Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported.'].join('\n'));
|
|
6
|
+
throw new Error([`MUI X: The token "${formatToken}" is not supported by the Date and Time Pickers.`, 'Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported.'].join('\n'));
|
|
7
7
|
}
|
|
8
8
|
if (typeof config === 'string') {
|
|
9
9
|
return {
|
|
@@ -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,10 +124,10 @@ 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
|
-
throw new Error([`MUI: The token "${section.format}" is a digit format with letter in it.'
|
|
130
|
+
throw new Error([`MUI X: The token "${section.format}" is a digit format with letter in it.'
|
|
84
131
|
This type of format is only supported for 'day' sections`].join('\n'));
|
|
85
132
|
}
|
|
86
133
|
}
|
|
@@ -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 != null && 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();
|
|
@@ -356,11 +403,11 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
|
|
|
356
403
|
maxLength = sectionValue === '' ? utils.formatByString(now, token).length : sectionValue.length;
|
|
357
404
|
} else {
|
|
358
405
|
if (sectionConfig.maxLength == null) {
|
|
359
|
-
throw new Error(`MUI: The token ${token} should have a 'maxDigitNumber' property on it's adapter`);
|
|
406
|
+
throw new Error(`MUI X: The token ${token} should have a 'maxDigitNumber' property on it's adapter`);
|
|
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
|
}
|
|
@@ -387,7 +434,7 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
|
|
|
387
434
|
nextFormat = utils.expandFormat(prevFormat);
|
|
388
435
|
formatExpansionOverflow -= 1;
|
|
389
436
|
if (formatExpansionOverflow < 0) {
|
|
390
|
-
throw new Error('MUI: The format expansion seems to be enter in an infinite loop. Please open an issue with the format passed to the picker component');
|
|
437
|
+
throw new Error('MUI X: The format expansion seems to be enter in an infinite loop. Please open an issue with the format passed to the picker component.');
|
|
391
438
|
}
|
|
392
439
|
}
|
|
393
440
|
const expandedFormat = nextFormat;
|
|
@@ -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 {
|
|
@@ -601,7 +648,7 @@ export const validateSections = (sections, valueType) => {
|
|
|
601
648
|
}
|
|
602
649
|
const invalidSection = sections.find(section => !supportedSections.includes(section.type));
|
|
603
650
|
if (invalidSection) {
|
|
604
|
-
console.warn(`MUI: The field component you are using is not compatible with the "${invalidSection.type}" date section.`, `The supported date sections are ["${supportedSections.join('", "')}"]\`.`);
|
|
651
|
+
console.warn(`MUI X: The field component you are using is not compatible with the "${invalidSection.type}" date section.`, `The supported date sections are ["${supportedSections.join('", "')}"]\`.`);
|
|
605
652
|
warnedOnceInvalidSection = true;
|
|
606
653
|
}
|
|
607
654
|
}
|
|
@@ -9,6 +9,7 @@ interface UseFieldEditingParams<TDate, TSection extends FieldSection> {
|
|
|
9
9
|
sections: TSection[];
|
|
10
10
|
updateSectionValue: (params: UpdateSectionValueParams<TSection>) => void;
|
|
11
11
|
sectionsValueBoundaries: FieldSectionsValueBoundaries<TDate>;
|
|
12
|
+
localizedDigits: string[];
|
|
12
13
|
setTempAndroidValueStr: (newValue: string | null) => void;
|
|
13
14
|
timezone: PickersTimezone;
|
|
14
15
|
}
|
|
@@ -19,7 +20,7 @@ interface UseFieldEditingParams<TDate, TSection extends FieldSection> {
|
|
|
19
20
|
* 1. The numeric editing when the user presses a digit
|
|
20
21
|
* 2. The letter editing when the user presses another key
|
|
21
22
|
*/
|
|
22
|
-
export declare const useFieldCharacterEditing: <TDate, TSection extends FieldSection>({ sections, updateSectionValue, sectionsValueBoundaries, setTempAndroidValueStr, timezone, }: UseFieldEditingParams<TDate, TSection>) => {
|
|
23
|
+
export declare const useFieldCharacterEditing: <TDate, TSection extends FieldSection>({ sections, updateSectionValue, sectionsValueBoundaries, localizedDigits, setTempAndroidValueStr, timezone, }: UseFieldEditingParams<TDate, TSection>) => {
|
|
23
24
|
applyCharacterEditing: (params: ApplyCharacterEditingParams) => void;
|
|
24
25
|
resetCharacterQuery: () => void;
|
|
25
26
|
};
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
4
4
|
import { useUtils } from '../useUtils';
|
|
5
|
-
import { changeSectionValueFormat, cleanDigitSectionValue, doesSectionFormatHaveLeadingZeros, getDateSectionConfigFromFormatToken, getDaysInWeekStr, getLetterEditingOptions } from './useField.utils';
|
|
5
|
+
import { changeSectionValueFormat, cleanDigitSectionValue, doesSectionFormatHaveLeadingZeros, getDateSectionConfigFromFormatToken, getDaysInWeekStr, getLetterEditingOptions, applyLocalizedDigits, removeLocalizedDigits, isStringNumber } from './useField.utils';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The letter editing and the numeric editing each define a `CharacterEditingApplier`.
|
|
@@ -40,6 +40,7 @@ export const useFieldCharacterEditing = ({
|
|
|
40
40
|
sections,
|
|
41
41
|
updateSectionValue,
|
|
42
42
|
sectionsValueBoundaries,
|
|
43
|
+
localizedDigits,
|
|
43
44
|
setTempAndroidValueStr,
|
|
44
45
|
timezone
|
|
45
46
|
}) => {
|
|
@@ -69,7 +70,7 @@ export const useFieldCharacterEditing = ({
|
|
|
69
70
|
const activeSection = sections[sectionIndex];
|
|
70
71
|
|
|
71
72
|
// The current query targets the section being editing
|
|
72
|
-
// We can try to
|
|
73
|
+
// We can try to concatenate the value
|
|
73
74
|
if (query != null && (!isValidQueryValue || isValidQueryValue(query.value)) && query.sectionIndex === sectionIndex) {
|
|
74
75
|
const concatenatedQueryValue = `${query.value}${cleanKeyPressed}`;
|
|
75
76
|
const queryResponse = getFirstSectionValueMatchingWithQuery(concatenatedQueryValue, activeSection);
|
|
@@ -163,7 +164,8 @@ export const useFieldCharacterEditing = ({
|
|
|
163
164
|
};
|
|
164
165
|
const applyNumericEditing = params => {
|
|
165
166
|
const getNewSectionValue = (queryValue, section) => {
|
|
166
|
-
const
|
|
167
|
+
const cleanQueryValue = removeLocalizedDigits(queryValue, localizedDigits);
|
|
168
|
+
const queryValueNumber = Number(cleanQueryValue);
|
|
167
169
|
const sectionBoundaries = sectionsValueBoundaries[section.type]({
|
|
168
170
|
currentDate: null,
|
|
169
171
|
format: section.format,
|
|
@@ -183,8 +185,8 @@ export const useFieldCharacterEditing = ({
|
|
|
183
185
|
saveQuery: true
|
|
184
186
|
};
|
|
185
187
|
}
|
|
186
|
-
const shouldGoToNextSection =
|
|
187
|
-
const newSectionValue = cleanDigitSectionValue(utils,
|
|
188
|
+
const shouldGoToNextSection = queryValueNumber * 10 > sectionBoundaries.maximum || cleanQueryValue.length === sectionBoundaries.maximum.toString().length;
|
|
189
|
+
const newSectionValue = cleanDigitSectionValue(utils, queryValueNumber, sectionBoundaries, localizedDigits, section);
|
|
188
190
|
return {
|
|
189
191
|
sectionValue: newSectionValue,
|
|
190
192
|
shouldGoToNextSection
|
|
@@ -232,12 +234,14 @@ export const useFieldCharacterEditing = ({
|
|
|
232
234
|
saveQuery: false
|
|
233
235
|
};
|
|
234
236
|
};
|
|
235
|
-
return applyQuery(params, getFirstSectionValueMatchingWithQuery, queryValue =>
|
|
237
|
+
return applyQuery(params, getFirstSectionValueMatchingWithQuery, queryValue => isStringNumber(queryValue, localizedDigits));
|
|
236
238
|
};
|
|
237
239
|
const applyCharacterEditing = useEventCallback(params => {
|
|
238
240
|
const activeSection = sections[params.sectionIndex];
|
|
239
|
-
const isNumericEditing =
|
|
240
|
-
const response = isNumericEditing ? applyNumericEditing(params
|
|
241
|
+
const isNumericEditing = isStringNumber(params.keyPressed, localizedDigits);
|
|
242
|
+
const response = isNumericEditing ? applyNumericEditing(_extends({}, params, {
|
|
243
|
+
keyPressed: applyLocalizedDigits(params.keyPressed, localizedDigits)
|
|
244
|
+
})) : applyLetterEditing(params);
|
|
241
245
|
if (response == null) {
|
|
242
246
|
setTempAndroidValueStr(null);
|
|
243
247
|
} else {
|
|
@@ -24,6 +24,7 @@ export declare const useFieldState: <TValue, TDate, TSection extends FieldSectio
|
|
|
24
24
|
updateValueFromValueStr: (valueStr: string) => void;
|
|
25
25
|
setTempAndroidValueStr: (tempValueStrAndroid: string | null) => void;
|
|
26
26
|
sectionsValueBoundaries: import("./useField.types").FieldSectionsValueBoundaries<TDate>;
|
|
27
|
+
localizedDigits: string[];
|
|
27
28
|
placeholder: string;
|
|
28
29
|
timezone: string;
|
|
29
30
|
};
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import useControlled from '@mui/utils/useControlled';
|
|
4
4
|
import { useTheme } from '@mui/material/styles';
|
|
5
5
|
import { useUtils, useLocaleText, useLocalizationContext } from '../useUtils';
|
|
6
|
-
import { addPositionPropertiesToSections, splitFormatIntoSections, mergeDateIntoReferenceDate, getSectionsBoundaries, validateSections, getDateFromDateSections } from './useField.utils';
|
|
6
|
+
import { addPositionPropertiesToSections, splitFormatIntoSections, mergeDateIntoReferenceDate, getSectionsBoundaries, validateSections, getDateFromDateSections, getLocalizedDigits } from './useField.utils';
|
|
7
7
|
import { useValueWithTimezone } from '../useValueWithTimezone';
|
|
8
8
|
import { getSectionTypeGranularity } from '../../utils/getDefaultReferenceDate';
|
|
9
9
|
export const useFieldState = params => {
|
|
@@ -42,9 +42,10 @@ export const useFieldState = params => {
|
|
|
42
42
|
onChange,
|
|
43
43
|
valueManager
|
|
44
44
|
});
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
45
|
+
const localizedDigits = React.useMemo(() => getLocalizedDigits(utils), [utils]);
|
|
46
|
+
const sectionsValueBoundaries = React.useMemo(() => getSectionsBoundaries(utils, localizedDigits, timezone), [utils, localizedDigits, timezone]);
|
|
47
|
+
const getSectionsFromValue = React.useCallback((value, fallbackSections = null) => fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, localizedDigits, isRTL, date => splitFormatIntoSections(utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL)), [fieldValueManager, format, localeText, localizedDigits, isRTL, shouldRespectLeadingZeros, utils, formatDensity, timezone]);
|
|
48
|
+
const placeholder = React.useMemo(() => fieldValueManager.getValueStrFromSections(getSectionsFromValue(valueManager.emptyValue), localizedDigits, isRTL), [fieldValueManager, getSectionsFromValue, valueManager.emptyValue, localizedDigits, isRTL]);
|
|
48
49
|
const [state, setState] = React.useState(() => {
|
|
49
50
|
const sections = getSectionsFromValue(valueFromTheOutside);
|
|
50
51
|
validateSections(sections, valueType);
|
|
@@ -142,7 +143,7 @@ export const useFieldState = params => {
|
|
|
142
143
|
value: newSectionValue,
|
|
143
144
|
modified: true
|
|
144
145
|
});
|
|
145
|
-
return addPositionPropertiesToSections(newSections, isRTL);
|
|
146
|
+
return addPositionPropertiesToSections(newSections, localizedDigits, isRTL);
|
|
146
147
|
};
|
|
147
148
|
const clearValue = () => {
|
|
148
149
|
publishValue({
|
|
@@ -179,7 +180,7 @@ export const useFieldState = params => {
|
|
|
179
180
|
if (date == null || !utils.isValid(date)) {
|
|
180
181
|
return null;
|
|
181
182
|
}
|
|
182
|
-
const sections = splitFormatIntoSections(utils, timezone, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL);
|
|
183
|
+
const sections = splitFormatIntoSections(utils, timezone, localeText, localizedDigits, format, date, formatDensity, shouldRespectLeadingZeros, isRTL);
|
|
183
184
|
return mergeDateIntoReferenceDate(utils, timezone, date, sections, referenceDate, false);
|
|
184
185
|
};
|
|
185
186
|
const newValue = fieldValueManager.parseValueStr(valueStr, state.referenceValue, parseDateStr);
|
|
@@ -210,7 +211,7 @@ export const useFieldState = params => {
|
|
|
210
211
|
const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);
|
|
211
212
|
const newSections = setSectionValue(selectedSectionIndexes.startIndex, newSectionValue);
|
|
212
213
|
const newActiveDateSections = activeDateManager.getSections(newSections);
|
|
213
|
-
const newActiveDate = getDateFromDateSections(utils, newActiveDateSections);
|
|
214
|
+
const newActiveDate = getDateFromDateSections(utils, newActiveDateSections, localizedDigits);
|
|
214
215
|
let values;
|
|
215
216
|
let shouldPublish;
|
|
216
217
|
|
|
@@ -278,6 +279,7 @@ export const useFieldState = params => {
|
|
|
278
279
|
updateValueFromValueStr,
|
|
279
280
|
setTempAndroidValueStr,
|
|
280
281
|
sectionsValueBoundaries,
|
|
282
|
+
localizedDigits,
|
|
281
283
|
placeholder,
|
|
282
284
|
timezone
|
|
283
285
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { usePicker } from './usePicker';
|
|
2
2
|
export type { UsePickerProps, UsePickerBaseProps, UsePickerParams, UsePickerResponse, } from './usePicker.types';
|
|
3
|
-
export type { PickerValueManager, PickerSelectionState } from './usePickerValue.types';
|
|
3
|
+
export type { PickerValueManager, PickerSelectionState, UsePickerValueFieldResponse, } from './usePickerValue.types';
|
|
@@ -138,12 +138,12 @@ export const usePickerValue = ({
|
|
|
138
138
|
if (process.env.NODE_ENV !== 'production') {
|
|
139
139
|
React.useEffect(() => {
|
|
140
140
|
if (isControlled !== (inValue !== undefined)) {
|
|
141
|
-
console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled value of a picker to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled value` + 'for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
|
|
141
|
+
console.error([`MUI X: A component is changing the ${isControlled ? '' : 'un'}controlled value of a picker to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled value` + 'for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
|
|
142
142
|
}
|
|
143
143
|
}, [inValue]);
|
|
144
144
|
React.useEffect(() => {
|
|
145
145
|
if (!isControlled && defaultValue !== inDefaultValue) {
|
|
146
|
-
console.error([`MUI: A component is changing the defaultValue of an uncontrolled picker after being initialized. ` + `To suppress this warning opt to use a controlled value.`].join('\n'));
|
|
146
|
+
console.error([`MUI X: A component is changing the defaultValue of an uncontrolled picker after being initialized. ` + `To suppress this warning opt to use a controlled value.`].join('\n'));
|
|
147
147
|
}
|
|
148
148
|
}, [JSON.stringify(defaultValue)]);
|
|
149
149
|
}
|
|
@@ -5,10 +5,10 @@ import { DEFAULT_LOCALE } from '../../locales/enUS';
|
|
|
5
5
|
export const useLocalizationContext = () => {
|
|
6
6
|
const localization = React.useContext(MuiPickersAdapterContext);
|
|
7
7
|
if (localization === null) {
|
|
8
|
-
throw new Error(['MUI: Can not find the date and time pickers localization context.', 'It looks like you forgot to wrap your component in LocalizationProvider.', 'This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package'].join('\n'));
|
|
8
|
+
throw new Error(['MUI X: Can not find the date and time pickers localization context.', 'It looks like you forgot to wrap your component in LocalizationProvider.', 'This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package'].join('\n'));
|
|
9
9
|
}
|
|
10
10
|
if (localization.utils === null) {
|
|
11
|
-
throw new Error(['MUI: Can not find the date and time pickers adapter from its localization context.', 'It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.'].join('\n'));
|
|
11
|
+
throw new Error(['MUI X: Can not find the date and time pickers adapter from its localization context.', 'It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.'].join('\n'));
|
|
12
12
|
}
|
|
13
13
|
const localeText = React.useMemo(() => _extends({}, DEFAULT_LOCALE, localization.localeText), [localization.localeText]);
|
|
14
14
|
return React.useMemo(() => _extends({}, localization, {
|
|
@@ -16,11 +16,11 @@ export function useViews({
|
|
|
16
16
|
if (process.env.NODE_ENV !== 'production') {
|
|
17
17
|
if (!warnedOnceNotValidView) {
|
|
18
18
|
if (inView != null && !views.includes(inView)) {
|
|
19
|
-
console.warn(`MUI: \`view="${inView}"\` is not a valid prop.`, `It must be an element of \`views=["${views.join('", "')}"]\`.`);
|
|
19
|
+
console.warn(`MUI X: \`view="${inView}"\` is not a valid prop.`, `It must be an element of \`views=["${views.join('", "')}"]\`.`);
|
|
20
20
|
warnedOnceNotValidView = true;
|
|
21
21
|
}
|
|
22
22
|
if (inView == null && openTo != null && !views.includes(openTo)) {
|
|
23
|
-
console.warn(`MUI: \`openTo="${openTo}"\` is not a valid prop.`, `It must be an element of \`views=["${views.join('", "')}"]\`.`);
|
|
23
|
+
console.warn(`MUI X: \`openTo="${openTo}"\` is not a valid prop.`, `It must be an element of \`views=["${views.join('", "')}"]\`.`);
|
|
24
24
|
warnedOnceNotValidView = true;
|
|
25
25
|
}
|
|
26
26
|
}
|