@mui/x-date-pickers 7.0.0-alpha.1 → 7.0.0-alpha.3
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 +2 -2
- package/AdapterDateFns/AdapterDateFns.js +11 -17
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +2 -2
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +13 -19
- package/AdapterDayjs/AdapterDayjs.d.ts +2 -2
- package/AdapterDayjs/AdapterDayjs.js +13 -15
- package/AdapterLuxon/AdapterLuxon.d.ts +3 -3
- package/AdapterLuxon/AdapterLuxon.js +31 -39
- package/AdapterMoment/AdapterMoment.d.ts +3 -3
- package/AdapterMoment/AdapterMoment.js +16 -23
- package/AdapterMomentHijri/AdapterMomentHijri.d.ts +1 -3
- package/AdapterMomentHijri/AdapterMomentHijri.js +1 -27
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +1 -4
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -29
- package/CHANGELOG.md +607 -188
- package/DateCalendar/DateCalendar.js +4 -10
- package/DateCalendar/DateCalendar.types.d.ts +0 -4
- package/DateCalendar/DayCalendar.d.ts +3 -3
- package/DateCalendar/dayCalendarClasses.d.ts +1 -1
- package/DateCalendar/dayCalendarClasses.js +1 -1
- package/DateCalendar/index.d.ts +1 -1
- package/DateCalendar/index.js +1 -1
- package/DateCalendar/useCalendarState.d.ts +1 -1
- package/DateCalendar/useCalendarState.js +1 -9
- package/DateField/DateField.js +1 -1
- package/DatePicker/DatePicker.js +3 -7
- package/DateTimeField/DateTimeField.js +1 -9
- package/DateTimePicker/DateTimePicker.js +3 -15
- package/DesktopDatePicker/DesktopDatePicker.js +3 -7
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -15
- package/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/DigitalClock/DigitalClock.js +3 -15
- package/MobileDatePicker/MobileDatePicker.js +3 -7
- package/MobileDateTimePicker/MobileDateTimePicker.js +3 -15
- package/MobileTimePicker/MobileTimePicker.js +1 -9
- package/MonthCalendar/MonthCalendar.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -15
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +3 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/PickersDay/PickersDay.js +1 -1
- package/PickersShortcuts/PickersShortcuts.d.ts +1 -1
- package/PickersShortcuts/PickersShortcuts.js +1 -1
- package/README.md +0 -1
- package/StaticDatePicker/StaticDatePicker.js +3 -7
- package/StaticDateTimePicker/StaticDateTimePicker.js +3 -15
- package/StaticTimePicker/StaticTimePicker.js +1 -9
- package/TimeClock/Clock.js +1 -1
- package/TimeClock/TimeClock.js +3 -15
- package/TimeField/TimeField.js +1 -9
- package/TimePicker/TimePicker.js +1 -9
- package/YearCalendar/YearCalendar.js +1 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +1 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.js +0 -2
- package/index.js +1 -1
- package/internals/components/PickersTextField/Outline.d.ts +2 -0
- package/internals/components/PickersTextField/Outline.js +99 -0
- package/internals/components/PickersTextField/PickersInput.d.ts +4 -0
- package/internals/components/PickersTextField/PickersInput.js +264 -0
- package/internals/components/PickersTextField/PickersInput.types.d.ts +30 -0
- package/internals/components/PickersTextField/PickersInput.types.js +1 -0
- package/internals/components/PickersTextField/PickersTextField.d.ts +3 -0
- package/internals/components/PickersTextField/PickersTextField.js +120 -0
- package/internals/components/PickersTextField/PickersTextField.types.d.ts +18 -0
- package/internals/components/PickersTextField/PickersTextField.types.js +1 -0
- package/internals/components/PickersTextField/index.d.ts +1 -0
- package/internals/components/PickersTextField/index.js +1 -0
- package/internals/components/PickersTextField/pickersTextFieldClasses.d.ts +42 -0
- package/internals/components/PickersTextField/pickersTextFieldClasses.js +9 -0
- package/internals/hooks/date-helpers-hooks.js +2 -2
- package/internals/hooks/useField/useField.utils.js +30 -17
- package/internals/hooks/useField/useFieldState.js +1 -1
- package/internals/hooks/usePicker/usePickerValue.js +2 -6
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +3 -3
- package/internals/hooks/useUtils.js +1 -1
- package/internals/hooks/useViews.js +2 -2
- package/internals/models/validation.d.ts +0 -8
- package/internals/utils/date-utils.js +2 -2
- package/internals/utils/validation/extractValidationProps.d.ts +1 -1
- package/internals/utils/validation/extractValidationProps.js +1 -1
- package/internals/utils/validation/validateDate.js +1 -1
- package/internals/utils/validation/validateTime.js +1 -8
- package/legacy/AdapterDateFns/AdapterDateFns.js +12 -16
- package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +14 -18
- package/legacy/AdapterDayjs/AdapterDayjs.js +15 -14
- package/legacy/AdapterLuxon/AdapterLuxon.js +34 -39
- package/legacy/AdapterMoment/AdapterMoment.js +326 -324
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +4 -28
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -33
- package/legacy/DateCalendar/DateCalendar.js +4 -10
- package/legacy/DateCalendar/PickersSlideTransition.js +8 -9
- package/legacy/DateCalendar/dayCalendarClasses.js +1 -1
- package/legacy/DateCalendar/index.js +1 -1
- package/legacy/DateCalendar/useCalendarState.js +1 -9
- package/legacy/DateField/DateField.js +1 -1
- package/legacy/DatePicker/DatePicker.js +3 -7
- package/legacy/DateTimeField/DateTimeField.js +1 -9
- package/legacy/DateTimePicker/DateTimePicker.js +3 -15
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +3 -7
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -15
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/legacy/DigitalClock/DigitalClock.js +3 -15
- package/legacy/MobileDatePicker/MobileDatePicker.js +3 -7
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +3 -15
- package/legacy/MobileTimePicker/MobileTimePicker.js +1 -9
- package/legacy/MonthCalendar/MonthCalendar.js +1 -1
- package/legacy/MonthCalendar/PickersMonth.js +4 -5
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -15
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/legacy/PickersDay/PickersDay.js +6 -7
- package/legacy/PickersLayout/PickersLayout.js +5 -6
- package/legacy/PickersShortcuts/PickersShortcuts.js +2 -1
- package/legacy/StaticDatePicker/StaticDatePicker.js +3 -7
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +3 -15
- package/legacy/StaticTimePicker/StaticTimePicker.js +1 -9
- package/legacy/TimeClock/Clock.js +1 -1
- package/legacy/TimeClock/ClockNumber.js +4 -5
- package/legacy/TimeClock/TimeClock.js +3 -15
- package/legacy/TimeField/TimeField.js +1 -9
- package/legacy/TimePicker/TimePicker.js +1 -9
- package/legacy/TimePicker/TimePickerToolbar.js +1 -2
- package/legacy/YearCalendar/PickersYear.js +4 -5
- package/legacy/YearCalendar/YearCalendar.js +1 -1
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/legacy/dateViewRenderers/dateViewRenderers.js +0 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersModalDialog.js +3 -4
- package/legacy/internals/components/PickersTextField/Outline.js +100 -0
- package/legacy/internals/components/PickersTextField/PickersInput.js +273 -0
- package/legacy/internals/components/PickersTextField/PickersInput.types.js +1 -0
- package/legacy/internals/components/PickersTextField/PickersTextField.js +129 -0
- package/legacy/internals/components/PickersTextField/PickersTextField.types.js +1 -0
- package/legacy/internals/components/PickersTextField/index.js +1 -0
- package/legacy/internals/components/PickersTextField/pickersTextFieldClasses.js +9 -0
- package/legacy/internals/hooks/date-helpers-hooks.js +2 -2
- package/legacy/internals/hooks/useField/useField.utils.js +30 -17
- package/legacy/internals/hooks/useField/useFieldState.js +1 -1
- package/legacy/internals/hooks/usePicker/usePickerValue.js +2 -6
- package/legacy/internals/hooks/useUtils.js +1 -1
- package/legacy/internals/hooks/useViews.js +2 -2
- package/legacy/internals/utils/date-utils.js +2 -2
- package/legacy/internals/utils/validation/extractValidationProps.js +1 -1
- package/legacy/internals/utils/validation/validateDate.js +1 -1
- package/legacy/internals/utils/validation/validateTime.js +1 -8
- package/legacy/locales/deDE.js +4 -3
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/mk.js +91 -0
- package/legacy/timeViewRenderers/timeViewRenderers.js +0 -6
- package/locales/beBY.d.ts +18 -5
- package/locales/caES.d.ts +18 -5
- package/locales/csCZ.d.ts +18 -5
- package/locales/daDK.d.ts +18 -5
- package/locales/deDE.d.ts +18 -5
- package/locales/deDE.js +2 -3
- package/locales/elGR.d.ts +18 -5
- package/locales/enUS.d.ts +18 -5
- package/locales/esES.d.ts +18 -5
- package/locales/eu.d.ts +18 -5
- package/locales/faIR.d.ts +18 -5
- package/locales/fiFI.d.ts +18 -5
- package/locales/frFR.d.ts +18 -5
- package/locales/heIL.d.ts +18 -5
- package/locales/huHU.d.ts +18 -5
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/isIS.d.ts +18 -5
- package/locales/itIT.d.ts +18 -5
- package/locales/jaJP.d.ts +18 -5
- package/locales/koKR.d.ts +18 -5
- package/locales/kzKZ.d.ts +18 -5
- package/locales/mk.d.ts +66 -0
- package/locales/mk.js +55 -0
- package/locales/nbNO.d.ts +18 -5
- package/locales/nlNL.d.ts +18 -5
- package/locales/plPL.d.ts +18 -5
- package/locales/ptBR.d.ts +18 -5
- package/locales/roRO.d.ts +18 -5
- package/locales/ruRU.d.ts +18 -5
- package/locales/skSK.d.ts +18 -5
- package/locales/svSE.d.ts +18 -5
- package/locales/trTR.d.ts +18 -5
- package/locales/ukUA.d.ts +18 -5
- package/locales/urPK.d.ts +18 -5
- package/locales/utils/getPickersLocalization.d.ts +18 -5
- package/locales/utils/pickersLocaleTextApi.d.ts +18 -5
- package/locales/viVN.d.ts +18 -5
- package/locales/zhCN.d.ts +18 -5
- package/locales/zhHK.d.ts +18 -5
- package/models/adapters.d.ts +6 -10
- package/models/timezone.d.ts +1 -1
- package/models/validation.d.ts +1 -1
- package/modern/AdapterDateFns/AdapterDateFns.js +11 -17
- package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +13 -19
- package/modern/AdapterDayjs/AdapterDayjs.js +13 -15
- package/modern/AdapterLuxon/AdapterLuxon.js +30 -39
- package/modern/AdapterMoment/AdapterMoment.js +16 -23
- package/modern/AdapterMomentHijri/AdapterMomentHijri.js +1 -27
- package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -29
- package/modern/DateCalendar/DateCalendar.js +4 -10
- package/modern/DateCalendar/dayCalendarClasses.js +1 -1
- package/modern/DateCalendar/index.js +1 -1
- package/modern/DateCalendar/useCalendarState.js +1 -9
- package/modern/DateField/DateField.js +1 -1
- package/modern/DatePicker/DatePicker.js +3 -7
- package/modern/DateTimeField/DateTimeField.js +1 -9
- package/modern/DateTimePicker/DateTimePicker.js +3 -15
- package/modern/DesktopDatePicker/DesktopDatePicker.js +3 -7
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -15
- package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/modern/DigitalClock/DigitalClock.js +3 -15
- package/modern/MobileDatePicker/MobileDatePicker.js +3 -7
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +3 -15
- package/modern/MobileTimePicker/MobileTimePicker.js +1 -9
- package/modern/MonthCalendar/MonthCalendar.js +1 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -15
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/modern/PickersDay/PickersDay.js +1 -1
- package/modern/PickersShortcuts/PickersShortcuts.js +1 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +3 -7
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +3 -15
- package/modern/StaticTimePicker/StaticTimePicker.js +1 -9
- package/modern/TimeClock/Clock.js +1 -1
- package/modern/TimeClock/TimeClock.js +3 -15
- package/modern/TimeField/TimeField.js +1 -9
- package/modern/TimePicker/TimePicker.js +1 -9
- package/modern/YearCalendar/YearCalendar.js +1 -1
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/modern/dateViewRenderers/dateViewRenderers.js +0 -2
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersTextField/Outline.js +99 -0
- package/modern/internals/components/PickersTextField/PickersInput.js +264 -0
- package/modern/internals/components/PickersTextField/PickersInput.types.js +1 -0
- package/modern/internals/components/PickersTextField/PickersTextField.js +119 -0
- package/modern/internals/components/PickersTextField/PickersTextField.types.js +1 -0
- package/modern/internals/components/PickersTextField/index.js +1 -0
- package/modern/internals/components/PickersTextField/pickersTextFieldClasses.js +9 -0
- package/modern/internals/hooks/date-helpers-hooks.js +2 -2
- package/modern/internals/hooks/useField/useField.utils.js +30 -17
- package/modern/internals/hooks/useField/useFieldState.js +1 -1
- package/modern/internals/hooks/usePicker/usePickerValue.js +2 -6
- package/modern/internals/hooks/useUtils.js +1 -1
- package/modern/internals/hooks/useViews.js +2 -2
- package/modern/internals/utils/date-utils.js +2 -2
- package/modern/internals/utils/validation/extractValidationProps.js +1 -1
- package/modern/internals/utils/validation/validateDate.js +1 -1
- package/modern/internals/utils/validation/validateTime.js +1 -8
- package/modern/locales/deDE.js +2 -3
- package/modern/locales/index.js +1 -0
- package/modern/locales/mk.js +55 -0
- package/modern/timeViewRenderers/timeViewRenderers.js +0 -6
- package/node/AdapterDateFns/AdapterDateFns.js +11 -17
- package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +13 -19
- package/node/AdapterDayjs/AdapterDayjs.js +12 -14
- package/node/AdapterLuxon/AdapterLuxon.js +30 -39
- package/node/AdapterMoment/AdapterMoment.js +16 -23
- package/node/AdapterMomentHijri/AdapterMomentHijri.js +1 -27
- package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -29
- package/node/DateCalendar/DateCalendar.js +4 -10
- package/node/DateCalendar/dayCalendarClasses.js +2 -2
- package/node/DateCalendar/index.js +2 -2
- package/node/DateCalendar/useCalendarState.js +1 -9
- package/node/DateField/DateField.js +1 -1
- package/node/DatePicker/DatePicker.js +3 -7
- package/node/DateTimeField/DateTimeField.js +1 -9
- package/node/DateTimePicker/DateTimePicker.js +3 -15
- package/node/DesktopDatePicker/DesktopDatePicker.js +3 -7
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -15
- package/node/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/node/DigitalClock/DigitalClock.js +3 -15
- package/node/MobileDatePicker/MobileDatePicker.js +3 -7
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +3 -15
- package/node/MobileTimePicker/MobileTimePicker.js +1 -9
- package/node/MonthCalendar/MonthCalendar.js +1 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -15
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/node/PickersDay/PickersDay.js +1 -1
- package/node/PickersShortcuts/PickersShortcuts.js +1 -1
- package/node/StaticDatePicker/StaticDatePicker.js +3 -7
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +3 -15
- package/node/StaticTimePicker/StaticTimePicker.js +1 -9
- package/node/TimeClock/Clock.js +1 -1
- package/node/TimeClock/TimeClock.js +3 -15
- package/node/TimeField/TimeField.js +1 -9
- package/node/TimePicker/TimePicker.js +1 -9
- package/node/YearCalendar/YearCalendar.js +1 -1
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/node/dateViewRenderers/dateViewRenderers.js +0 -2
- package/node/index.js +1 -1
- package/node/internals/components/PickersTextField/Outline.js +108 -0
- package/node/internals/components/PickersTextField/PickersInput.js +272 -0
- package/node/internals/components/PickersTextField/PickersInput.types.js +5 -0
- package/node/internals/components/PickersTextField/PickersTextField.js +127 -0
- package/node/internals/components/PickersTextField/PickersTextField.types.js +5 -0
- package/node/internals/components/PickersTextField/index.js +12 -0
- package/node/internals/components/PickersTextField/pickersTextFieldClasses.js +17 -0
- package/node/internals/hooks/date-helpers-hooks.js +2 -2
- package/node/internals/hooks/useField/useField.utils.js +30 -17
- package/node/internals/hooks/useField/useFieldState.js +1 -1
- package/node/internals/hooks/usePicker/usePickerValue.js +2 -6
- package/node/internals/hooks/useUtils.js +1 -1
- package/node/internals/hooks/useViews.js +2 -2
- package/node/internals/utils/date-utils.js +2 -2
- package/node/internals/utils/validation/extractValidationProps.js +1 -1
- package/node/internals/utils/validation/validateDate.js +1 -1
- package/node/internals/utils/validation/validateTime.js +1 -8
- package/node/locales/deDE.js +2 -3
- package/node/locales/index.js +11 -0
- package/node/locales/mk.js +60 -0
- package/node/timeViewRenderers/timeViewRenderers.js +0 -6
- package/package.json +8 -7
- package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
- package/timeViewRenderers/timeViewRenderers.js +0 -6
- package/internals/components/FakeTextField/FakeTextField.d.ts +0 -22
- package/internals/components/FakeTextField/FakeTextField.js +0 -44
- package/internals/components/FakeTextField/index.d.ts +0 -1
- package/internals/components/FakeTextField/index.js +0 -1
- package/legacy/internals/components/FakeTextField/FakeTextField.js +0 -49
- package/legacy/internals/components/FakeTextField/index.js +0 -1
- package/modern/internals/components/FakeTextField/FakeTextField.js +0 -44
- package/modern/internals/components/FakeTextField/index.js +0 -1
- package/node/internals/components/FakeTextField/FakeTextField.js +0 -52
- package/node/internals/components/FakeTextField/index.js +0 -12
|
@@ -42,7 +42,7 @@ const getDeltaFromKeyCode = keyCode => {
|
|
|
42
42
|
};
|
|
43
43
|
const getDaysInWeekStr = (utils, timezone, format) => {
|
|
44
44
|
const elements = [];
|
|
45
|
-
const now = utils.
|
|
45
|
+
const now = utils.date(undefined, timezone);
|
|
46
46
|
const startDate = utils.startOfWeek(now);
|
|
47
47
|
const endDate = utils.endOfWeek(now);
|
|
48
48
|
let current = startDate;
|
|
@@ -57,7 +57,7 @@ const getLetterEditingOptions = (utils, timezone, sectionType, format) => {
|
|
|
57
57
|
switch (sectionType) {
|
|
58
58
|
case 'month':
|
|
59
59
|
{
|
|
60
|
-
return (0, _dateUtils.getMonthsInYear)(utils, utils.
|
|
60
|
+
return (0, _dateUtils.getMonthsInYear)(utils, utils.date(undefined, timezone)).map(month => utils.formatByString(month, format));
|
|
61
61
|
}
|
|
62
62
|
case 'weekDay':
|
|
63
63
|
{
|
|
@@ -65,7 +65,7 @@ const getLetterEditingOptions = (utils, timezone, sectionType, format) => {
|
|
|
65
65
|
}
|
|
66
66
|
case 'meridiem':
|
|
67
67
|
{
|
|
68
|
-
const now = utils.
|
|
68
|
+
const now = utils.date(undefined, timezone);
|
|
69
69
|
return [utils.startOfDay(now), utils.endOfDay(now)].map(date => utils.formatByString(date, format));
|
|
70
70
|
}
|
|
71
71
|
default:
|
|
@@ -125,7 +125,7 @@ const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoun
|
|
|
125
125
|
let newSectionValueNumber = currentSectionValue + delta * step;
|
|
126
126
|
if (shouldSetAbsolute) {
|
|
127
127
|
if (section.type === 'year' && !isEnd && !isStart) {
|
|
128
|
-
return utils.formatByString(utils.
|
|
128
|
+
return utils.formatByString(utils.date(undefined, timezone), section.format);
|
|
129
129
|
}
|
|
130
130
|
if (delta > 0 || isStart) {
|
|
131
131
|
newSectionValueNumber = sectionBoundaries.minimum;
|
|
@@ -223,49 +223,62 @@ const addPositionPropertiesToSections = (sections, isRTL) => {
|
|
|
223
223
|
return newSections;
|
|
224
224
|
};
|
|
225
225
|
exports.addPositionPropertiesToSections = addPositionPropertiesToSections;
|
|
226
|
-
const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig,
|
|
226
|
+
const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig, sectionFormat) => {
|
|
227
227
|
switch (sectionConfig.type) {
|
|
228
228
|
case 'year':
|
|
229
229
|
{
|
|
230
230
|
return localeText.fieldYearPlaceholder({
|
|
231
|
-
digitAmount: utils.formatByString(utils.
|
|
231
|
+
digitAmount: utils.formatByString(utils.date(undefined, timezone), sectionFormat).length,
|
|
232
|
+
format: sectionFormat
|
|
232
233
|
});
|
|
233
234
|
}
|
|
234
235
|
case 'month':
|
|
235
236
|
{
|
|
236
237
|
return localeText.fieldMonthPlaceholder({
|
|
237
|
-
contentType: sectionConfig.contentType
|
|
238
|
+
contentType: sectionConfig.contentType,
|
|
239
|
+
format: sectionFormat
|
|
238
240
|
});
|
|
239
241
|
}
|
|
240
242
|
case 'day':
|
|
241
243
|
{
|
|
242
|
-
return localeText.fieldDayPlaceholder(
|
|
244
|
+
return localeText.fieldDayPlaceholder({
|
|
245
|
+
format: sectionFormat
|
|
246
|
+
});
|
|
243
247
|
}
|
|
244
248
|
case 'weekDay':
|
|
245
249
|
{
|
|
246
250
|
return localeText.fieldWeekDayPlaceholder({
|
|
247
|
-
contentType: sectionConfig.contentType
|
|
251
|
+
contentType: sectionConfig.contentType,
|
|
252
|
+
format: sectionFormat
|
|
248
253
|
});
|
|
249
254
|
}
|
|
250
255
|
case 'hours':
|
|
251
256
|
{
|
|
252
|
-
return localeText.fieldHoursPlaceholder(
|
|
257
|
+
return localeText.fieldHoursPlaceholder({
|
|
258
|
+
format: sectionFormat
|
|
259
|
+
});
|
|
253
260
|
}
|
|
254
261
|
case 'minutes':
|
|
255
262
|
{
|
|
256
|
-
return localeText.fieldMinutesPlaceholder(
|
|
263
|
+
return localeText.fieldMinutesPlaceholder({
|
|
264
|
+
format: sectionFormat
|
|
265
|
+
});
|
|
257
266
|
}
|
|
258
267
|
case 'seconds':
|
|
259
268
|
{
|
|
260
|
-
return localeText.fieldSecondsPlaceholder(
|
|
269
|
+
return localeText.fieldSecondsPlaceholder({
|
|
270
|
+
format: sectionFormat
|
|
271
|
+
});
|
|
261
272
|
}
|
|
262
273
|
case 'meridiem':
|
|
263
274
|
{
|
|
264
|
-
return localeText.fieldMeridiemPlaceholder(
|
|
275
|
+
return localeText.fieldMeridiemPlaceholder({
|
|
276
|
+
format: sectionFormat
|
|
277
|
+
});
|
|
265
278
|
}
|
|
266
279
|
default:
|
|
267
280
|
{
|
|
268
|
-
return
|
|
281
|
+
return sectionFormat;
|
|
269
282
|
}
|
|
270
283
|
}
|
|
271
284
|
};
|
|
@@ -278,12 +291,12 @@ const changeSectionValueFormat = (utils, valueStr, currentFormat, newFormat) =>
|
|
|
278
291
|
return utils.formatByString(utils.parse(valueStr, currentFormat), newFormat);
|
|
279
292
|
};
|
|
280
293
|
exports.changeSectionValueFormat = changeSectionValueFormat;
|
|
281
|
-
const isFourDigitYearFormat = (utils, timezone, format) => utils.formatByString(utils.
|
|
294
|
+
const isFourDigitYearFormat = (utils, timezone, format) => utils.formatByString(utils.date(undefined, timezone), format).length === 4;
|
|
282
295
|
const doesSectionFormatHaveLeadingZeros = (utils, timezone, contentType, sectionType, format) => {
|
|
283
296
|
if (contentType !== 'digit') {
|
|
284
297
|
return false;
|
|
285
298
|
}
|
|
286
|
-
const now = utils.
|
|
299
|
+
const now = utils.date(undefined, timezone);
|
|
287
300
|
switch (sectionType) {
|
|
288
301
|
// We can't use `changeSectionValueFormat`, because `utils.parse('1', 'YYYY')` returns `1971` instead of `1`.
|
|
289
302
|
case 'year':
|
|
@@ -493,7 +506,7 @@ const createDateStrForInputFromSections = (sections, isRTL) => {
|
|
|
493
506
|
};
|
|
494
507
|
exports.createDateStrForInputFromSections = createDateStrForInputFromSections;
|
|
495
508
|
const getSectionsBoundaries = (utils, timezone) => {
|
|
496
|
-
const today = utils.
|
|
509
|
+
const today = utils.date(undefined, timezone);
|
|
497
510
|
const endOfYear = utils.endOfYear(today);
|
|
498
511
|
const endOfDay = utils.endOfDay(today);
|
|
499
512
|
const {
|
|
@@ -165,7 +165,7 @@ const useFieldState = params => {
|
|
|
165
165
|
const nonEmptySectionCountBefore = activeDateManager.getSections(state.sections).filter(section => section.value !== '').length;
|
|
166
166
|
const hasNoOtherNonEmptySections = nonEmptySectionCountBefore === (activeSection.value === '' ? 0 : 1);
|
|
167
167
|
const newSections = setSectionValue(selectedSectionIndexes.startIndex, '');
|
|
168
|
-
const newActiveDate = hasNoOtherNonEmptySections ? null : utils.
|
|
168
|
+
const newActiveDate = hasNoOtherNonEmptySections ? null : utils.getInvalidDate();
|
|
169
169
|
const newValues = activeDateManager.getNewValuesFromNewActiveDate(newActiveDate);
|
|
170
170
|
if ((newActiveDate != null && !utils.isValid(newActiveDate)) !== (activeDateManager.date != null && !utils.isValid(activeDateManager.date))) {
|
|
171
171
|
publishValue((0, _extends2.default)({}, newValues, {
|
|
@@ -229,9 +229,7 @@ const usePickerValue = ({
|
|
|
229
229
|
const context = {
|
|
230
230
|
validationError
|
|
231
231
|
};
|
|
232
|
-
|
|
233
|
-
// TODO v7: Remove 2nd condition
|
|
234
|
-
if (action.name === 'setValueFromShortcut' && action.shortcut != null) {
|
|
232
|
+
if (action.name === 'setValueFromShortcut') {
|
|
235
233
|
context.shortcut = action.shortcut;
|
|
236
234
|
}
|
|
237
235
|
handleValueChange(action.value, context);
|
|
@@ -296,12 +294,10 @@ const usePickerValue = ({
|
|
|
296
294
|
value: newValue,
|
|
297
295
|
selectionState
|
|
298
296
|
}));
|
|
299
|
-
|
|
300
|
-
// TODO v7: Make changeImportance and label mandatory.
|
|
301
297
|
const handleSelectShortcut = (0, _useEventCallback.default)((newValue, changeImportance, shortcut) => updateDate({
|
|
302
298
|
name: 'setValueFromShortcut',
|
|
303
299
|
value: newValue,
|
|
304
|
-
changeImportance
|
|
300
|
+
changeImportance,
|
|
305
301
|
shortcut
|
|
306
302
|
}));
|
|
307
303
|
const handleChangeFromField = (0, _useEventCallback.default)((newValue, context) => updateDate({
|
|
@@ -35,7 +35,7 @@ const useNow = timezone => {
|
|
|
35
35
|
const utils = useUtils();
|
|
36
36
|
const now = React.useRef();
|
|
37
37
|
if (now.current === undefined) {
|
|
38
|
-
now.current = utils.
|
|
38
|
+
now.current = utils.date(undefined, timezone);
|
|
39
39
|
}
|
|
40
40
|
return now.current;
|
|
41
41
|
};
|
|
@@ -92,7 +92,7 @@ function useViews({
|
|
|
92
92
|
const isSelectionFinishedOnCurrentView = currentViewSelectionState === 'finish';
|
|
93
93
|
const hasMoreViews = selectedView ?
|
|
94
94
|
// handles case like `DateTimePicker`, where a view might return a `finish` selection state
|
|
95
|
-
// but
|
|
95
|
+
// but when it's not the final view given all `views` -> overall selection state should be `partial`.
|
|
96
96
|
views.indexOf(selectedView) < views.length - 1 : Boolean(nextView);
|
|
97
97
|
const globalSelectionState = isSelectionFinishedOnCurrentView && hasMoreViews ? 'partial' : currentViewSelectionState;
|
|
98
98
|
onChange(value, globalSelectionState);
|
|
@@ -114,7 +114,7 @@ function useViews({
|
|
|
114
114
|
setFocusedView: handleFocusedViewChange,
|
|
115
115
|
nextView,
|
|
116
116
|
previousView,
|
|
117
|
-
// Always return up
|
|
117
|
+
// Always return up-to-date default view instead of the initial one (i.e. defaultView.current)
|
|
118
118
|
defaultView: views.includes(openTo) ? openTo : views[0],
|
|
119
119
|
goToNextView,
|
|
120
120
|
setValueAndGoToNextView,
|
|
@@ -15,7 +15,7 @@ const findClosestEnabledDate = ({
|
|
|
15
15
|
utils,
|
|
16
16
|
timezone
|
|
17
17
|
}) => {
|
|
18
|
-
const today = utils.startOfDay(utils.
|
|
18
|
+
const today = utils.startOfDay(utils.date(undefined, timezone));
|
|
19
19
|
if (disablePast && utils.isBefore(minDate, today)) {
|
|
20
20
|
minDate = today;
|
|
21
21
|
}
|
|
@@ -91,7 +91,7 @@ const mergeDateAndTime = (utils, dateParam, timeParam) => {
|
|
|
91
91
|
return mergedDate;
|
|
92
92
|
};
|
|
93
93
|
exports.mergeDateAndTime = mergeDateAndTime;
|
|
94
|
-
const getTodayDate = (utils, timezone, valueType) => valueType === 'date' ? utils.startOfDay(utils.
|
|
94
|
+
const getTodayDate = (utils, timezone, valueType) => valueType === 'date' ? utils.startOfDay(utils.date(undefined, timezone)) : utils.date(undefined, timezone);
|
|
95
95
|
exports.getTodayDate = getTodayDate;
|
|
96
96
|
const formatMeridiem = (utils, meridiem) => {
|
|
97
97
|
const date = utils.setHours(utils.date(), meridiem === 'am' ? 2 : 14);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.extractValidationProps = exports.TIME_VALIDATION_PROP_NAMES = exports.DATE_VALIDATION_PROP_NAMES = exports.DATE_TIME_VALIDATION_PROP_NAMES = void 0;
|
|
7
7
|
const DATE_VALIDATION_PROP_NAMES = exports.DATE_VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minDate', 'maxDate', 'shouldDisableDate', 'shouldDisableMonth', 'shouldDisableYear'];
|
|
8
|
-
const TIME_VALIDATION_PROP_NAMES = exports.TIME_VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minTime', 'maxTime', '
|
|
8
|
+
const TIME_VALIDATION_PROP_NAMES = exports.TIME_VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minTime', 'maxTime', 'shouldDisableTime', 'minutesStep', 'ampm', 'disableIgnoringDatePartForTimeValidation'];
|
|
9
9
|
const DATE_TIME_VALIDATION_PROP_NAMES = exports.DATE_TIME_VALIDATION_PROP_NAMES = ['minDateTime', 'maxDateTime'];
|
|
10
10
|
const VALIDATION_PROP_NAMES = [...DATE_VALIDATION_PROP_NAMES, ...TIME_VALIDATION_PROP_NAMES, ...DATE_TIME_VALIDATION_PROP_NAMES];
|
|
11
11
|
/**
|
|
@@ -21,7 +21,7 @@ const validateDate = ({
|
|
|
21
21
|
disableFuture,
|
|
22
22
|
timezone
|
|
23
23
|
} = props;
|
|
24
|
-
const now = adapter.utils.
|
|
24
|
+
const now = adapter.utils.date(undefined, timezone);
|
|
25
25
|
const minDate = (0, _dateUtils.applyDefaultDate)(adapter.utils, props.minDate, adapter.defaultDates.minDate);
|
|
26
26
|
const maxDate = (0, _dateUtils.applyDefaultDate)(adapter.utils, props.maxDate, adapter.defaultDates.maxDate);
|
|
27
27
|
switch (true) {
|
|
@@ -17,14 +17,13 @@ const validateTime = ({
|
|
|
17
17
|
minTime,
|
|
18
18
|
maxTime,
|
|
19
19
|
minutesStep,
|
|
20
|
-
shouldDisableClock,
|
|
21
20
|
shouldDisableTime,
|
|
22
21
|
disableIgnoringDatePartForTimeValidation = false,
|
|
23
22
|
disablePast,
|
|
24
23
|
disableFuture,
|
|
25
24
|
timezone
|
|
26
25
|
} = props;
|
|
27
|
-
const now = adapter.utils.
|
|
26
|
+
const now = adapter.utils.date(undefined, timezone);
|
|
28
27
|
const isAfter = (0, _timeUtils.createIsAfterIgnoreDatePart)(disableIgnoringDatePartForTimeValidation, adapter.utils);
|
|
29
28
|
switch (true) {
|
|
30
29
|
case !adapter.utils.isValid(value):
|
|
@@ -43,12 +42,6 @@ const validateTime = ({
|
|
|
43
42
|
return 'shouldDisableTime-minutes';
|
|
44
43
|
case Boolean(shouldDisableTime && shouldDisableTime(value, 'seconds')):
|
|
45
44
|
return 'shouldDisableTime-seconds';
|
|
46
|
-
case Boolean(shouldDisableClock && shouldDisableClock(adapter.utils.getHours(value), 'hours')):
|
|
47
|
-
return 'shouldDisableClock-hours';
|
|
48
|
-
case Boolean(shouldDisableClock && shouldDisableClock(adapter.utils.getMinutes(value), 'minutes')):
|
|
49
|
-
return 'shouldDisableClock-minutes';
|
|
50
|
-
case Boolean(shouldDisableClock && shouldDisableClock(adapter.utils.getSeconds(value), 'seconds')):
|
|
51
|
-
return 'shouldDisableClock-seconds';
|
|
52
45
|
case Boolean(minutesStep && adapter.utils.getMinutes(value) % minutesStep !== 0):
|
|
53
46
|
return 'minutesStep';
|
|
54
47
|
default:
|
package/node/locales/deDE.js
CHANGED
|
@@ -48,8 +48,7 @@ const deDEPickers = {
|
|
|
48
48
|
// Open picker labels
|
|
49
49
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Datum auswählen, gewähltes Datum ist ${utils.format(value, 'fullDate')}` : 'Datum auswählen',
|
|
50
50
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Uhrzeit auswählen, gewählte Uhrzeit ist ${utils.format(value, 'fullTime')}` : 'Uhrzeit auswählen',
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
fieldClearLabel: 'Wert leeren',
|
|
53
52
|
// Table labels
|
|
54
53
|
timeTableLabel: 'Uhrzeit auswählen',
|
|
55
54
|
dateTableLabel: 'Datum auswählen',
|
|
@@ -57,7 +56,7 @@ const deDEPickers = {
|
|
|
57
56
|
fieldYearPlaceholder: params => 'J'.repeat(params.digitAmount),
|
|
58
57
|
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
59
58
|
fieldDayPlaceholder: () => 'TT',
|
|
60
|
-
|
|
59
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
61
60
|
fieldHoursPlaceholder: () => 'hh',
|
|
62
61
|
fieldMinutesPlaceholder: () => 'mm',
|
|
63
62
|
fieldSecondsPlaceholder: () => 'ss',
|
package/node/locales/index.js
CHANGED
|
@@ -201,6 +201,17 @@ Object.keys(_kzKZ).forEach(function (key) {
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
});
|
|
204
|
+
var _mk = require("./mk");
|
|
205
|
+
Object.keys(_mk).forEach(function (key) {
|
|
206
|
+
if (key === "default" || key === "__esModule") return;
|
|
207
|
+
if (key in exports && exports[key] === _mk[key]) return;
|
|
208
|
+
Object.defineProperty(exports, key, {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () {
|
|
211
|
+
return _mk[key];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
204
215
|
var _nbNO = require("./nbNO");
|
|
205
216
|
Object.keys(_nbNO).forEach(function (key) {
|
|
206
217
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mk = void 0;
|
|
7
|
+
var _getPickersLocalization = require("./utils/getPickersLocalization");
|
|
8
|
+
// This object is not Partial<PickersLocaleText> because it is the default values
|
|
9
|
+
|
|
10
|
+
const mkPickers = {
|
|
11
|
+
// Calendar navigation
|
|
12
|
+
previousMonth: 'Предходен месец',
|
|
13
|
+
nextMonth: 'Следен месец',
|
|
14
|
+
// View navigation
|
|
15
|
+
openPreviousView: 'отвори претходен приказ',
|
|
16
|
+
openNextView: 'отвори следен приказ',
|
|
17
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'годишен приказ, отвори календарски приказ' : 'календарски приказ, отвори годишен приказ',
|
|
18
|
+
// DateRange placeholders
|
|
19
|
+
start: 'Почеток',
|
|
20
|
+
end: 'Крај',
|
|
21
|
+
// Action bar
|
|
22
|
+
cancelButtonLabel: 'Откажи',
|
|
23
|
+
clearButtonLabel: 'Избриши',
|
|
24
|
+
okButtonLabel: 'OK',
|
|
25
|
+
todayButtonLabel: 'Денес',
|
|
26
|
+
// Toolbar titles
|
|
27
|
+
datePickerToolbarTitle: 'Избери датум',
|
|
28
|
+
dateTimePickerToolbarTitle: 'Избери датум и време',
|
|
29
|
+
timePickerToolbarTitle: 'Избери време',
|
|
30
|
+
dateRangePickerToolbarTitle: 'Избери временски опсег',
|
|
31
|
+
// Clock labels
|
|
32
|
+
clockLabelText: (view, time, adapter) => `Select ${view}. ${time === null ? 'Нема избрано време' : `Избраното време е ${adapter.format(time, 'fullTime')}`}`,
|
|
33
|
+
hoursClockNumberText: hours => `${hours} часа`,
|
|
34
|
+
minutesClockNumberText: minutes => `${minutes} минути`,
|
|
35
|
+
secondsClockNumberText: seconds => `${seconds} секунди`,
|
|
36
|
+
// Digital clock labels
|
|
37
|
+
selectViewText: view => `Избери ${view}`,
|
|
38
|
+
// Calendar labels
|
|
39
|
+
calendarWeekNumberHeaderLabel: 'Недела број',
|
|
40
|
+
calendarWeekNumberHeaderText: '#',
|
|
41
|
+
calendarWeekNumberAriaLabelText: weekNumber => `Недела ${weekNumber}`,
|
|
42
|
+
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
43
|
+
// Open picker labels
|
|
44
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Избери датум, избраниот датум е ${utils.format(value, 'fullDate')}` : 'Избери датум',
|
|
45
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Избери време, избраното време е ${utils.format(value, 'fullTime')}` : 'Избери време',
|
|
46
|
+
fieldClearLabel: 'Избриши',
|
|
47
|
+
// Table labels
|
|
48
|
+
timeTableLabel: 'одбери време',
|
|
49
|
+
dateTableLabel: 'одбери датум',
|
|
50
|
+
// Field section placeholders
|
|
51
|
+
fieldYearPlaceholder: params => 'Г'.repeat(params.digitAmount),
|
|
52
|
+
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
53
|
+
fieldDayPlaceholder: () => 'ДД',
|
|
54
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
55
|
+
fieldHoursPlaceholder: () => 'чч',
|
|
56
|
+
fieldMinutesPlaceholder: () => 'мм',
|
|
57
|
+
fieldSecondsPlaceholder: () => 'сс',
|
|
58
|
+
fieldMeridiemPlaceholder: () => 'aa'
|
|
59
|
+
};
|
|
60
|
+
const mk = exports.mk = (0, _getPickersLocalization.getPickersLocalization)(mkPickers);
|
|
@@ -29,7 +29,6 @@ const renderTimeViewClock = ({
|
|
|
29
29
|
minTime,
|
|
30
30
|
maxTime,
|
|
31
31
|
shouldDisableTime,
|
|
32
|
-
shouldDisableClock,
|
|
33
32
|
minutesStep,
|
|
34
33
|
ampm,
|
|
35
34
|
ampmInClock,
|
|
@@ -59,7 +58,6 @@ const renderTimeViewClock = ({
|
|
|
59
58
|
minTime: minTime,
|
|
60
59
|
maxTime: maxTime,
|
|
61
60
|
shouldDisableTime: shouldDisableTime,
|
|
62
|
-
shouldDisableClock: shouldDisableClock,
|
|
63
61
|
minutesStep: minutesStep,
|
|
64
62
|
ampm: ampm,
|
|
65
63
|
ampmInClock: ampmInClock,
|
|
@@ -91,7 +89,6 @@ const renderDigitalClockTimeView = ({
|
|
|
91
89
|
minTime,
|
|
92
90
|
maxTime,
|
|
93
91
|
shouldDisableTime,
|
|
94
|
-
shouldDisableClock,
|
|
95
92
|
minutesStep,
|
|
96
93
|
ampm,
|
|
97
94
|
slots,
|
|
@@ -121,7 +118,6 @@ const renderDigitalClockTimeView = ({
|
|
|
121
118
|
minTime: minTime,
|
|
122
119
|
maxTime: maxTime,
|
|
123
120
|
shouldDisableTime: shouldDisableTime,
|
|
124
|
-
shouldDisableClock: shouldDisableClock,
|
|
125
121
|
minutesStep: minutesStep,
|
|
126
122
|
ampm: ampm,
|
|
127
123
|
slots: slots,
|
|
@@ -153,7 +149,6 @@ const renderMultiSectionDigitalClockTimeView = ({
|
|
|
153
149
|
minTime,
|
|
154
150
|
maxTime,
|
|
155
151
|
shouldDisableTime,
|
|
156
|
-
shouldDisableClock,
|
|
157
152
|
minutesStep,
|
|
158
153
|
ampm,
|
|
159
154
|
slots,
|
|
@@ -183,7 +178,6 @@ const renderMultiSectionDigitalClockTimeView = ({
|
|
|
183
178
|
minTime: minTime,
|
|
184
179
|
maxTime: maxTime,
|
|
185
180
|
shouldDisableTime: shouldDisableTime,
|
|
186
|
-
shouldDisableClock: shouldDisableClock,
|
|
187
181
|
minutesStep: minutesStep,
|
|
188
182
|
ampm: ampm,
|
|
189
183
|
slots: slots,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.3",
|
|
4
4
|
"description": "The community edition of the date picker components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"homepage": "https://mui.com/x/react-date-pickers/",
|
|
12
12
|
"funding": {
|
|
13
13
|
"type": "opencollective",
|
|
14
|
-
"url": "https://opencollective.com/mui"
|
|
14
|
+
"url": "https://opencollective.com/mui-org"
|
|
15
15
|
},
|
|
16
16
|
"sideEffects": false,
|
|
17
17
|
"publishConfig": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"react",
|
|
22
22
|
"react-component",
|
|
23
23
|
"mui",
|
|
24
|
+
"mui-x",
|
|
24
25
|
"material-ui",
|
|
25
26
|
"material design",
|
|
26
27
|
"datepicker",
|
|
@@ -33,10 +34,11 @@
|
|
|
33
34
|
"directory": "packages/x-date-pickers"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@babel/runtime": "^7.23.
|
|
37
|
-
"@mui/base": "^5.0.0-beta.
|
|
38
|
-
"@mui/
|
|
39
|
-
"@
|
|
37
|
+
"@babel/runtime": "^7.23.4",
|
|
38
|
+
"@mui/base": "^5.0.0-beta.24",
|
|
39
|
+
"@mui/system": "^5.14.18",
|
|
40
|
+
"@mui/utils": "^5.14.18",
|
|
41
|
+
"@types/react-transition-group": "^4.4.9",
|
|
40
42
|
"clsx": "^2.0.0",
|
|
41
43
|
"prop-types": "^15.8.1",
|
|
42
44
|
"react-transition-group": "^4.4.5"
|
|
@@ -45,7 +47,6 @@
|
|
|
45
47
|
"@emotion/react": "^11.9.0",
|
|
46
48
|
"@emotion/styled": "^11.8.1",
|
|
47
49
|
"@mui/material": "^5.8.6",
|
|
48
|
-
"@mui/system": "^5.8.0",
|
|
49
50
|
"date-fns": "^2.25.0",
|
|
50
51
|
"date-fns-jalali": "^2.13.0-0",
|
|
51
52
|
"dayjs": "^1.10.7",
|
|
@@ -11,6 +11,6 @@ export type TimeViewRendererProps<TView extends TimeViewWithMeridiem, TComponent
|
|
|
11
11
|
onViewChange?: (view: TView) => void;
|
|
12
12
|
views: readonly TView[];
|
|
13
13
|
};
|
|
14
|
-
export declare const renderTimeViewClock: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime,
|
|
15
|
-
export declare const renderDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime,
|
|
16
|
-
export declare const renderMultiSectionDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime,
|
|
14
|
+
export declare const renderTimeViewClock: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, ampmInClock, slots, slotProps, readOnly, disabled, sx, autoFocus, showViewSwitcher, disableIgnoringDatePartForTimeValidation, timezone, }: TimeViewRendererProps<TimeView, TimeClockProps<TDate, TimeView>>) => React.JSX.Element;
|
|
15
|
+
export declare const renderDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<"hours", Omit<DigitalClockProps<TDate>, "timeStep"> & Pick<TimePickerProps<TDate>, "timeSteps">>) => React.JSX.Element;
|
|
16
|
+
export declare const renderMultiSectionDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps<TDate>>) => React.JSX.Element;
|
|
@@ -21,7 +21,6 @@ export const renderTimeViewClock = ({
|
|
|
21
21
|
minTime,
|
|
22
22
|
maxTime,
|
|
23
23
|
shouldDisableTime,
|
|
24
|
-
shouldDisableClock,
|
|
25
24
|
minutesStep,
|
|
26
25
|
ampm,
|
|
27
26
|
ampmInClock,
|
|
@@ -51,7 +50,6 @@ export const renderTimeViewClock = ({
|
|
|
51
50
|
minTime: minTime,
|
|
52
51
|
maxTime: maxTime,
|
|
53
52
|
shouldDisableTime: shouldDisableTime,
|
|
54
|
-
shouldDisableClock: shouldDisableClock,
|
|
55
53
|
minutesStep: minutesStep,
|
|
56
54
|
ampm: ampm,
|
|
57
55
|
ampmInClock: ampmInClock,
|
|
@@ -82,7 +80,6 @@ export const renderDigitalClockTimeView = ({
|
|
|
82
80
|
minTime,
|
|
83
81
|
maxTime,
|
|
84
82
|
shouldDisableTime,
|
|
85
|
-
shouldDisableClock,
|
|
86
83
|
minutesStep,
|
|
87
84
|
ampm,
|
|
88
85
|
slots,
|
|
@@ -112,7 +109,6 @@ export const renderDigitalClockTimeView = ({
|
|
|
112
109
|
minTime: minTime,
|
|
113
110
|
maxTime: maxTime,
|
|
114
111
|
shouldDisableTime: shouldDisableTime,
|
|
115
|
-
shouldDisableClock: shouldDisableClock,
|
|
116
112
|
minutesStep: minutesStep,
|
|
117
113
|
ampm: ampm,
|
|
118
114
|
slots: slots,
|
|
@@ -143,7 +139,6 @@ export const renderMultiSectionDigitalClockTimeView = ({
|
|
|
143
139
|
minTime,
|
|
144
140
|
maxTime,
|
|
145
141
|
shouldDisableTime,
|
|
146
|
-
shouldDisableClock,
|
|
147
142
|
minutesStep,
|
|
148
143
|
ampm,
|
|
149
144
|
slots,
|
|
@@ -173,7 +168,6 @@ export const renderMultiSectionDigitalClockTimeView = ({
|
|
|
173
168
|
minTime: minTime,
|
|
174
169
|
maxTime: maxTime,
|
|
175
170
|
shouldDisableTime: shouldDisableTime,
|
|
176
|
-
shouldDisableClock: shouldDisableClock,
|
|
177
171
|
minutesStep: minutesStep,
|
|
178
172
|
ampm: ampm,
|
|
179
173
|
slots: slots,
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface FakeTextFieldElement {
|
|
3
|
-
container: React.HTMLAttributes<HTMLSpanElement>;
|
|
4
|
-
content: React.HTMLAttributes<HTMLSpanElement>;
|
|
5
|
-
before: React.HTMLAttributes<HTMLSpanElement>;
|
|
6
|
-
after: React.HTMLAttributes<HTMLSpanElement>;
|
|
7
|
-
}
|
|
8
|
-
interface FakeTextFieldProps {
|
|
9
|
-
elements: FakeTextFieldElement[];
|
|
10
|
-
valueStr: string;
|
|
11
|
-
onValueStrChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
12
|
-
error: boolean;
|
|
13
|
-
id?: string;
|
|
14
|
-
InputProps: any;
|
|
15
|
-
inputProps: any;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
autoFocus?: boolean;
|
|
18
|
-
ownerState?: any;
|
|
19
|
-
valueType: 'value' | 'placeholder';
|
|
20
|
-
}
|
|
21
|
-
export declare const FakeTextField: React.ForwardRefExoticComponent<FakeTextFieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["elements", "valueStr", "onValueStrChange", "id", "error", "InputProps", "inputProps", "autoFocus", "disabled", "valueType", "ownerState"];
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import Box from '@mui/material/Box';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { createElement as _createElement } from "react";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
export const FakeTextField = /*#__PURE__*/React.forwardRef(function FakeTextField(props, ref) {
|
|
10
|
-
const {
|
|
11
|
-
elements,
|
|
12
|
-
valueStr,
|
|
13
|
-
onValueStrChange,
|
|
14
|
-
id,
|
|
15
|
-
valueType
|
|
16
|
-
} = props,
|
|
17
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
|
-
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
19
|
-
children: [/*#__PURE__*/_jsx(Box, _extends({
|
|
20
|
-
ref: ref
|
|
21
|
-
}, other, {
|
|
22
|
-
style: {
|
|
23
|
-
display: 'inline-block',
|
|
24
|
-
border: '1px solid black',
|
|
25
|
-
borderRadius: 4,
|
|
26
|
-
padding: '2px 4px',
|
|
27
|
-
color: valueType === 'placeholder' ? 'grey' : 'black'
|
|
28
|
-
},
|
|
29
|
-
children: elements.map(({
|
|
30
|
-
container,
|
|
31
|
-
content,
|
|
32
|
-
before,
|
|
33
|
-
after
|
|
34
|
-
}, elementIndex) => /*#__PURE__*/_createElement("span", _extends({}, container, {
|
|
35
|
-
key: elementIndex
|
|
36
|
-
}), /*#__PURE__*/_jsx("span", _extends({}, before)), /*#__PURE__*/_jsx("span", _extends({}, content)), /*#__PURE__*/_jsx("span", _extends({}, after))))
|
|
37
|
-
})), /*#__PURE__*/_jsx("input", {
|
|
38
|
-
type: "hidden",
|
|
39
|
-
value: valueStr,
|
|
40
|
-
onChange: onValueStrChange,
|
|
41
|
-
id: id
|
|
42
|
-
})]
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FakeTextField } from './FakeTextField';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FakeTextField } from './FakeTextField';
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["elements", "valueStr", "onValueStrChange", "id", "error", "InputProps", "inputProps", "autoFocus", "disabled", "valueType", "ownerState"];
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import Box from '@mui/material/Box';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { createElement as _createElement } from "react";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
export var FakeTextField = /*#__PURE__*/React.forwardRef(function FakeTextField(props, ref) {
|
|
10
|
-
var elements = props.elements,
|
|
11
|
-
valueStr = props.valueStr,
|
|
12
|
-
onValueStrChange = props.onValueStrChange,
|
|
13
|
-
id = props.id,
|
|
14
|
-
error = props.error,
|
|
15
|
-
InputProps = props.InputProps,
|
|
16
|
-
inputProps = props.inputProps,
|
|
17
|
-
autoFocus = props.autoFocus,
|
|
18
|
-
disabled = props.disabled,
|
|
19
|
-
valueType = props.valueType,
|
|
20
|
-
ownerState = props.ownerState,
|
|
21
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
22
|
-
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
23
|
-
children: [/*#__PURE__*/_jsx(Box, _extends({
|
|
24
|
-
ref: ref
|
|
25
|
-
}, other, {
|
|
26
|
-
style: {
|
|
27
|
-
display: 'inline-block',
|
|
28
|
-
border: '1px solid black',
|
|
29
|
-
borderRadius: 4,
|
|
30
|
-
padding: '2px 4px',
|
|
31
|
-
color: valueType === 'placeholder' ? 'grey' : 'black'
|
|
32
|
-
},
|
|
33
|
-
children: elements.map(function (_ref, elementIndex) {
|
|
34
|
-
var container = _ref.container,
|
|
35
|
-
content = _ref.content,
|
|
36
|
-
before = _ref.before,
|
|
37
|
-
after = _ref.after;
|
|
38
|
-
return /*#__PURE__*/_createElement("span", _extends({}, container, {
|
|
39
|
-
key: elementIndex
|
|
40
|
-
}), /*#__PURE__*/_jsx("span", _extends({}, before)), /*#__PURE__*/_jsx("span", _extends({}, content)), /*#__PURE__*/_jsx("span", _extends({}, after)));
|
|
41
|
-
})
|
|
42
|
-
})), /*#__PURE__*/_jsx("input", {
|
|
43
|
-
type: "hidden",
|
|
44
|
-
value: valueStr,
|
|
45
|
-
onChange: onValueStrChange,
|
|
46
|
-
id: id
|
|
47
|
-
})]
|
|
48
|
-
});
|
|
49
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FakeTextField } from './FakeTextField';
|