@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
|
@@ -81,10 +81,6 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
81
81
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
82
82
|
*/
|
|
83
83
|
dayOfWeekFormatter: PropTypes.func,
|
|
84
|
-
/**
|
|
85
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
86
|
-
*/
|
|
87
|
-
defaultCalendarMonth: PropTypes.any,
|
|
88
84
|
/**
|
|
89
85
|
* The default value.
|
|
90
86
|
* Used when the component is not controlled.
|
|
@@ -131,8 +127,8 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
131
127
|
*/
|
|
132
128
|
displayWeekNumber: PropTypes.bool,
|
|
133
129
|
/**
|
|
134
|
-
*
|
|
135
|
-
* Put it to 6
|
|
130
|
+
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
131
|
+
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
136
132
|
* @default undefined
|
|
137
133
|
*/
|
|
138
134
|
fixedWeekNumber: PropTypes.number,
|
|
@@ -304,14 +300,6 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
304
300
|
endIndex: PropTypes.number.isRequired,
|
|
305
301
|
startIndex: PropTypes.number.isRequired
|
|
306
302
|
})]),
|
|
307
|
-
/**
|
|
308
|
-
* Disable specific clock time.
|
|
309
|
-
* @param {number} clockValue The value to check.
|
|
310
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
311
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
312
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
313
|
-
*/
|
|
314
|
-
shouldDisableClock: PropTypes.func,
|
|
315
303
|
/**
|
|
316
304
|
* Disable specific date.
|
|
317
305
|
*
|
|
@@ -394,7 +382,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
394
382
|
* Choose which timezone to use for the value.
|
|
395
383
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
396
384
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
397
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
385
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
398
386
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
399
387
|
*/
|
|
400
388
|
timezone: PropTypes.string,
|
|
@@ -91,10 +91,6 @@ DesktopDatePicker.propTypes = {
|
|
|
91
91
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
92
92
|
*/
|
|
93
93
|
dayOfWeekFormatter: PropTypes.func,
|
|
94
|
-
/**
|
|
95
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
96
|
-
*/
|
|
97
|
-
defaultCalendarMonth: PropTypes.any,
|
|
98
94
|
/**
|
|
99
95
|
* The default value.
|
|
100
96
|
* Used when the component is not controlled.
|
|
@@ -130,8 +126,8 @@ DesktopDatePicker.propTypes = {
|
|
|
130
126
|
*/
|
|
131
127
|
displayWeekNumber: PropTypes.bool,
|
|
132
128
|
/**
|
|
133
|
-
*
|
|
134
|
-
* Put it to 6
|
|
129
|
+
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
130
|
+
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
135
131
|
* @default undefined
|
|
136
132
|
*/
|
|
137
133
|
fixedWeekNumber: PropTypes.number,
|
|
@@ -333,7 +329,7 @@ DesktopDatePicker.propTypes = {
|
|
|
333
329
|
* Choose which timezone to use for the value.
|
|
334
330
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
335
331
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
336
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
332
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
337
333
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
338
334
|
*/
|
|
339
335
|
timezone: PropTypes.string,
|
|
@@ -140,10 +140,6 @@ DesktopDateTimePicker.propTypes = {
|
|
|
140
140
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
141
141
|
*/
|
|
142
142
|
dayOfWeekFormatter: PropTypes.func,
|
|
143
|
-
/**
|
|
144
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
145
|
-
*/
|
|
146
|
-
defaultCalendarMonth: PropTypes.any,
|
|
147
143
|
/**
|
|
148
144
|
* The default value.
|
|
149
145
|
* Used when the component is not controlled.
|
|
@@ -184,8 +180,8 @@ DesktopDateTimePicker.propTypes = {
|
|
|
184
180
|
*/
|
|
185
181
|
displayWeekNumber: PropTypes.bool,
|
|
186
182
|
/**
|
|
187
|
-
*
|
|
188
|
-
* Put it to 6
|
|
183
|
+
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
184
|
+
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
189
185
|
* @default undefined
|
|
190
186
|
*/
|
|
191
187
|
fixedWeekNumber: PropTypes.number,
|
|
@@ -357,14 +353,6 @@ DesktopDateTimePicker.propTypes = {
|
|
|
357
353
|
endIndex: PropTypes.number.isRequired,
|
|
358
354
|
startIndex: PropTypes.number.isRequired
|
|
359
355
|
})]),
|
|
360
|
-
/**
|
|
361
|
-
* Disable specific clock time.
|
|
362
|
-
* @param {number} clockValue The value to check.
|
|
363
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
364
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
365
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
366
|
-
*/
|
|
367
|
-
shouldDisableClock: PropTypes.func,
|
|
368
356
|
/**
|
|
369
357
|
* Disable specific date.
|
|
370
358
|
*
|
|
@@ -447,7 +435,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
447
435
|
* Choose which timezone to use for the value.
|
|
448
436
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
449
437
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
450
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
438
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
451
439
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
452
440
|
*/
|
|
453
441
|
timezone: PropTypes.string,
|
|
@@ -269,14 +269,6 @@ DesktopTimePicker.propTypes = {
|
|
|
269
269
|
endIndex: PropTypes.number.isRequired,
|
|
270
270
|
startIndex: PropTypes.number.isRequired
|
|
271
271
|
})]),
|
|
272
|
-
/**
|
|
273
|
-
* Disable specific clock time.
|
|
274
|
-
* @param {number} clockValue The value to check.
|
|
275
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
276
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
277
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
278
|
-
*/
|
|
279
|
-
shouldDisableClock: PropTypes.func,
|
|
280
272
|
/**
|
|
281
273
|
* Disable specific time.
|
|
282
274
|
* @template TDate
|
|
@@ -324,7 +316,7 @@ DesktopTimePicker.propTypes = {
|
|
|
324
316
|
* Choose which timezone to use for the value.
|
|
325
317
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
326
318
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
327
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
319
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
328
320
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
329
321
|
*/
|
|
330
322
|
timezone: PropTypes.string,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["ampm", "timeStep", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "
|
|
3
|
+
const _excluded = ["ampm", "timeStep", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "onChange", "view", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "views", "skipDisabled", "timezone"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -112,7 +112,6 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
112
112
|
disableFuture,
|
|
113
113
|
disablePast,
|
|
114
114
|
minutesStep = 1,
|
|
115
|
-
shouldDisableClock,
|
|
116
115
|
shouldDisableTime,
|
|
117
116
|
onChange,
|
|
118
117
|
view: inView,
|
|
@@ -212,16 +211,13 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
212
211
|
if (utils.getMinutes(valueToCheck) % minutesStep !== 0) {
|
|
213
212
|
return false;
|
|
214
213
|
}
|
|
215
|
-
if (shouldDisableClock?.(utils.toJsDate(valueToCheck).getTime(), 'hours')) {
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
214
|
if (shouldDisableTime) {
|
|
219
215
|
return !shouldDisableTime(valueToCheck, 'hours');
|
|
220
216
|
}
|
|
221
217
|
return true;
|
|
222
218
|
};
|
|
223
219
|
return !containsValidTime() || !isValidValue();
|
|
224
|
-
}, [disableIgnoringDatePartForTimeValidation, utils, minTime, maxTime, disableFuture, now, disablePast, minutesStep,
|
|
220
|
+
}, [disableIgnoringDatePartForTimeValidation, utils, minTime, maxTime, disableFuture, now, disablePast, minutesStep, shouldDisableTime]);
|
|
225
221
|
const timeOptions = React.useMemo(() => {
|
|
226
222
|
const startOfDay = utils.startOfDay(valueOrReferenceDate);
|
|
227
223
|
return [startOfDay, ...Array.from({
|
|
@@ -366,14 +362,6 @@ process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
|
|
|
366
362
|
* @default The closest valid time using the validation props, except callbacks such as `shouldDisableTime`.
|
|
367
363
|
*/
|
|
368
364
|
referenceDate: PropTypes.any,
|
|
369
|
-
/**
|
|
370
|
-
* Disable specific clock time.
|
|
371
|
-
* @param {number} clockValue The value to check.
|
|
372
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
373
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
374
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
375
|
-
*/
|
|
376
|
-
shouldDisableClock: PropTypes.func,
|
|
377
365
|
/**
|
|
378
366
|
* Disable specific time.
|
|
379
367
|
* @template TDate
|
|
@@ -411,7 +399,7 @@ process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
|
|
|
411
399
|
* Choose which timezone to use for the value.
|
|
412
400
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
413
401
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
414
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
402
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
415
403
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
416
404
|
*/
|
|
417
405
|
timezone: PropTypes.string,
|
|
@@ -88,10 +88,6 @@ MobileDatePicker.propTypes = {
|
|
|
88
88
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
89
89
|
*/
|
|
90
90
|
dayOfWeekFormatter: PropTypes.func,
|
|
91
|
-
/**
|
|
92
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
93
|
-
*/
|
|
94
|
-
defaultCalendarMonth: PropTypes.any,
|
|
95
91
|
/**
|
|
96
92
|
* The default value.
|
|
97
93
|
* Used when the component is not controlled.
|
|
@@ -127,8 +123,8 @@ MobileDatePicker.propTypes = {
|
|
|
127
123
|
*/
|
|
128
124
|
displayWeekNumber: PropTypes.bool,
|
|
129
125
|
/**
|
|
130
|
-
*
|
|
131
|
-
* Put it to 6
|
|
126
|
+
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
127
|
+
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
132
128
|
* @default undefined
|
|
133
129
|
*/
|
|
134
130
|
fixedWeekNumber: PropTypes.number,
|
|
@@ -330,7 +326,7 @@ MobileDatePicker.propTypes = {
|
|
|
330
326
|
* Choose which timezone to use for the value.
|
|
331
327
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
332
328
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
333
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
329
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
334
330
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
335
331
|
*/
|
|
336
332
|
timezone: PropTypes.string,
|
|
@@ -109,10 +109,6 @@ MobileDateTimePicker.propTypes = {
|
|
|
109
109
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
110
110
|
*/
|
|
111
111
|
dayOfWeekFormatter: PropTypes.func,
|
|
112
|
-
/**
|
|
113
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
114
|
-
*/
|
|
115
|
-
defaultCalendarMonth: PropTypes.any,
|
|
116
112
|
/**
|
|
117
113
|
* The default value.
|
|
118
114
|
* Used when the component is not controlled.
|
|
@@ -153,8 +149,8 @@ MobileDateTimePicker.propTypes = {
|
|
|
153
149
|
*/
|
|
154
150
|
displayWeekNumber: PropTypes.bool,
|
|
155
151
|
/**
|
|
156
|
-
*
|
|
157
|
-
* Put it to 6
|
|
152
|
+
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
153
|
+
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
158
154
|
* @default undefined
|
|
159
155
|
*/
|
|
160
156
|
fixedWeekNumber: PropTypes.number,
|
|
@@ -326,14 +322,6 @@ MobileDateTimePicker.propTypes = {
|
|
|
326
322
|
endIndex: PropTypes.number.isRequired,
|
|
327
323
|
startIndex: PropTypes.number.isRequired
|
|
328
324
|
})]),
|
|
329
|
-
/**
|
|
330
|
-
* Disable specific clock time.
|
|
331
|
-
* @param {number} clockValue The value to check.
|
|
332
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
333
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
334
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
335
|
-
*/
|
|
336
|
-
shouldDisableClock: PropTypes.func,
|
|
337
325
|
/**
|
|
338
326
|
* Disable specific date.
|
|
339
327
|
*
|
|
@@ -395,7 +383,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
395
383
|
* Choose which timezone to use for the value.
|
|
396
384
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
397
385
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
398
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
386
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
399
387
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
400
388
|
*/
|
|
401
389
|
timezone: PropTypes.string,
|
|
@@ -248,14 +248,6 @@ MobileTimePicker.propTypes = {
|
|
|
248
248
|
endIndex: PropTypes.number.isRequired,
|
|
249
249
|
startIndex: PropTypes.number.isRequired
|
|
250
250
|
})]),
|
|
251
|
-
/**
|
|
252
|
-
* Disable specific clock time.
|
|
253
|
-
* @param {number} clockValue The value to check.
|
|
254
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
255
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
256
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
257
|
-
*/
|
|
258
|
-
shouldDisableClock: PropTypes.func,
|
|
259
251
|
/**
|
|
260
252
|
* Disable specific time.
|
|
261
253
|
* @template TDate
|
|
@@ -282,7 +274,7 @@ MobileTimePicker.propTypes = {
|
|
|
282
274
|
* Choose which timezone to use for the value.
|
|
283
275
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
284
276
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
285
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
277
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
286
278
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
287
279
|
*/
|
|
288
280
|
timezone: PropTypes.string,
|
|
@@ -315,7 +315,7 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
|
315
315
|
* Choose which timezone to use for the value.
|
|
316
316
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
317
317
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
318
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
318
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
319
319
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
320
320
|
*/
|
|
321
321
|
timezone: PropTypes.string,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["ampm", "timeSteps", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "
|
|
3
|
+
const _excluded = ["ampm", "timeSteps", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "skipDisabled", "timezone"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -72,7 +72,6 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
72
72
|
disableFuture,
|
|
73
73
|
disablePast,
|
|
74
74
|
minutesStep = 1,
|
|
75
|
-
shouldDisableClock,
|
|
76
75
|
shouldDisableTime,
|
|
77
76
|
onChange,
|
|
78
77
|
view: inView,
|
|
@@ -166,9 +165,6 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
166
165
|
if (timeValue % step !== 0) {
|
|
167
166
|
return false;
|
|
168
167
|
}
|
|
169
|
-
if (shouldDisableClock?.(timeValue, viewType)) {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
168
|
if (shouldDisableTime) {
|
|
173
169
|
switch (viewType) {
|
|
174
170
|
case 'hours':
|
|
@@ -218,7 +214,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
218
214
|
default:
|
|
219
215
|
throw new Error('not supported');
|
|
220
216
|
}
|
|
221
|
-
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep,
|
|
217
|
+
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableTime, utils, disableFuture, disablePast, now, views]);
|
|
222
218
|
const handleSectionChange = useEventCallback((sectionView, newValue) => {
|
|
223
219
|
const viewIndex = views.indexOf(sectionView);
|
|
224
220
|
const nextView = views[viewIndex + 1];
|
|
@@ -253,6 +249,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
253
249
|
},
|
|
254
250
|
items: getTimeSectionOptions({
|
|
255
251
|
value: utils.getMinutes(valueOrReferenceDate),
|
|
252
|
+
utils,
|
|
256
253
|
isDisabled: minutes => disabled || isTimeDisabled(minutes, 'minutes'),
|
|
257
254
|
resolveLabel: minutes => utils.format(utils.setMinutes(now, minutes), 'minutes'),
|
|
258
255
|
timeStep: timeSteps.minutes,
|
|
@@ -269,6 +266,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
269
266
|
},
|
|
270
267
|
items: getTimeSectionOptions({
|
|
271
268
|
value: utils.getSeconds(valueOrReferenceDate),
|
|
269
|
+
utils,
|
|
272
270
|
isDisabled: seconds => disabled || isTimeDisabled(seconds, 'seconds'),
|
|
273
271
|
resolveLabel: seconds => utils.format(utils.setSeconds(now, seconds), 'seconds'),
|
|
274
272
|
timeStep: timeSteps.seconds,
|
|
@@ -434,14 +432,6 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
434
432
|
* @default The closest valid time using the validation props, except callbacks such as `shouldDisableTime`.
|
|
435
433
|
*/
|
|
436
434
|
referenceDate: PropTypes.any,
|
|
437
|
-
/**
|
|
438
|
-
* Disable specific clock time.
|
|
439
|
-
* @param {number} clockValue The value to check.
|
|
440
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
441
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
442
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
443
|
-
*/
|
|
444
|
-
shouldDisableClock: PropTypes.func,
|
|
445
435
|
/**
|
|
446
436
|
* Disable specific time.
|
|
447
437
|
* @template TDate
|
|
@@ -483,7 +473,7 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
483
473
|
* Choose which timezone to use for the value.
|
|
484
474
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
485
475
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
486
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
476
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
487
477
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
488
478
|
*/
|
|
489
479
|
timezone: PropTypes.string,
|
|
@@ -44,6 +44,7 @@ export const getHourSectionOptions = ({
|
|
|
44
44
|
};
|
|
45
45
|
export const getTimeSectionOptions = ({
|
|
46
46
|
value,
|
|
47
|
+
utils,
|
|
47
48
|
isDisabled,
|
|
48
49
|
timeStep,
|
|
49
50
|
resolveLabel,
|
|
@@ -65,7 +66,7 @@ export const getTimeSectionOptions = ({
|
|
|
65
66
|
const timeValue = timeStep * index;
|
|
66
67
|
return {
|
|
67
68
|
value: timeValue,
|
|
68
|
-
label: resolveLabel(timeValue),
|
|
69
|
+
label: utils.formatNumber(resolveLabel(timeValue)),
|
|
69
70
|
isDisabled,
|
|
70
71
|
isSelected,
|
|
71
72
|
isFocused,
|
|
@@ -156,7 +156,7 @@ const PickersDayRaw = /*#__PURE__*/React.forwardRef(function PickersDay(inProps,
|
|
|
156
156
|
}
|
|
157
157
|
}, [autoFocus, disabled, isAnimating, outsideCurrentMonth]);
|
|
158
158
|
|
|
159
|
-
// For day outside
|
|
159
|
+
// For a day outside the current month, move the focus from mouseDown to mouseUp
|
|
160
160
|
// Goal: have the onClick ends before sliding to the new month
|
|
161
161
|
const handleMouseDown = event => {
|
|
162
162
|
onMouseDown(event);
|
|
@@ -70,10 +70,6 @@ StaticDatePicker.propTypes = {
|
|
|
70
70
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
71
71
|
*/
|
|
72
72
|
dayOfWeekFormatter: PropTypes.func,
|
|
73
|
-
/**
|
|
74
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
75
|
-
*/
|
|
76
|
-
defaultCalendarMonth: PropTypes.any,
|
|
77
73
|
/**
|
|
78
74
|
* The default value.
|
|
79
75
|
* Used when the component is not controlled.
|
|
@@ -109,8 +105,8 @@ StaticDatePicker.propTypes = {
|
|
|
109
105
|
*/
|
|
110
106
|
displayWeekNumber: PropTypes.bool,
|
|
111
107
|
/**
|
|
112
|
-
*
|
|
113
|
-
* Put it to 6
|
|
108
|
+
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
109
|
+
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
114
110
|
* @default undefined
|
|
115
111
|
*/
|
|
116
112
|
fixedWeekNumber: PropTypes.number,
|
|
@@ -266,7 +262,7 @@ StaticDatePicker.propTypes = {
|
|
|
266
262
|
* Choose which timezone to use for the value.
|
|
267
263
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
268
264
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
269
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
265
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
270
266
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
271
267
|
*/
|
|
272
268
|
timezone: PropTypes.string,
|
|
@@ -90,10 +90,6 @@ StaticDateTimePicker.propTypes = {
|
|
|
90
90
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
91
91
|
*/
|
|
92
92
|
dayOfWeekFormatter: PropTypes.func,
|
|
93
|
-
/**
|
|
94
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
95
|
-
*/
|
|
96
|
-
defaultCalendarMonth: PropTypes.any,
|
|
97
93
|
/**
|
|
98
94
|
* The default value.
|
|
99
95
|
* Used when the component is not controlled.
|
|
@@ -134,8 +130,8 @@ StaticDateTimePicker.propTypes = {
|
|
|
134
130
|
*/
|
|
135
131
|
displayWeekNumber: PropTypes.bool,
|
|
136
132
|
/**
|
|
137
|
-
*
|
|
138
|
-
* Put it to 6
|
|
133
|
+
* The day view will show as many weeks as needed after the end of the current month to match this value.
|
|
134
|
+
* Put it to 6 to have a fixed number of weeks in Gregorian calendars
|
|
139
135
|
* @default undefined
|
|
140
136
|
*/
|
|
141
137
|
fixedWeekNumber: PropTypes.number,
|
|
@@ -261,14 +257,6 @@ StaticDateTimePicker.propTypes = {
|
|
|
261
257
|
* @default () => <span data-mui-test="loading-progress">...</span>
|
|
262
258
|
*/
|
|
263
259
|
renderLoading: PropTypes.func,
|
|
264
|
-
/**
|
|
265
|
-
* Disable specific clock time.
|
|
266
|
-
* @param {number} clockValue The value to check.
|
|
267
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
268
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
269
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
270
|
-
*/
|
|
271
|
-
shouldDisableClock: PropTypes.func,
|
|
272
260
|
/**
|
|
273
261
|
* Disable specific date.
|
|
274
262
|
*
|
|
@@ -330,7 +318,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
330
318
|
* Choose which timezone to use for the value.
|
|
331
319
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
332
320
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
333
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
321
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
334
322
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
335
323
|
*/
|
|
336
324
|
timezone: PropTypes.string,
|
|
@@ -182,14 +182,6 @@ StaticTimePicker.propTypes = {
|
|
|
182
182
|
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
183
183
|
*/
|
|
184
184
|
referenceDate: PropTypes.any,
|
|
185
|
-
/**
|
|
186
|
-
* Disable specific clock time.
|
|
187
|
-
* @param {number} clockValue The value to check.
|
|
188
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
189
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
190
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
191
|
-
*/
|
|
192
|
-
shouldDisableClock: PropTypes.func,
|
|
193
185
|
/**
|
|
194
186
|
* Disable specific time.
|
|
195
187
|
* @template TDate
|
|
@@ -216,7 +208,7 @@ StaticTimePicker.propTypes = {
|
|
|
216
208
|
* Choose which timezone to use for the value.
|
|
217
209
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
218
210
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
219
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
211
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
220
212
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
221
213
|
*/
|
|
222
214
|
timezone: PropTypes.string,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "
|
|
3
|
+
const _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "showViewSwitcher", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "timezone"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -81,7 +81,6 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
81
81
|
disableFuture,
|
|
82
82
|
disablePast,
|
|
83
83
|
minutesStep = 1,
|
|
84
|
-
shouldDisableClock,
|
|
85
84
|
shouldDisableTime,
|
|
86
85
|
showViewSwitcher,
|
|
87
86
|
onChange,
|
|
@@ -162,9 +161,6 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
162
161
|
if (timeValue % step !== 0) {
|
|
163
162
|
return false;
|
|
164
163
|
}
|
|
165
|
-
if (shouldDisableClock?.(timeValue, viewType)) {
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
164
|
if (shouldDisableTime) {
|
|
169
165
|
switch (viewType) {
|
|
170
166
|
case 'hours':
|
|
@@ -214,7 +210,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
214
210
|
default:
|
|
215
211
|
throw new Error('not supported');
|
|
216
212
|
}
|
|
217
|
-
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep,
|
|
213
|
+
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableTime, utils, disableFuture, disablePast, now, views]);
|
|
218
214
|
const selectedId = useId();
|
|
219
215
|
const viewProps = React.useMemo(() => {
|
|
220
216
|
switch (view) {
|
|
@@ -422,14 +418,6 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
422
418
|
* @default The closest valid time using the validation props, except callbacks such as `shouldDisableTime`.
|
|
423
419
|
*/
|
|
424
420
|
referenceDate: PropTypes.any,
|
|
425
|
-
/**
|
|
426
|
-
* Disable specific clock time.
|
|
427
|
-
* @param {number} clockValue The value to check.
|
|
428
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
429
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
430
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
431
|
-
*/
|
|
432
|
-
shouldDisableClock: PropTypes.func,
|
|
433
421
|
/**
|
|
434
422
|
* Disable specific time.
|
|
435
423
|
* @template TDate
|
|
@@ -457,7 +445,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
457
445
|
* Choose which timezone to use for the value.
|
|
458
446
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
459
447
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
460
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
448
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
461
449
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
462
450
|
*/
|
|
463
451
|
timezone: PropTypes.string,
|
|
@@ -286,14 +286,6 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
286
286
|
endIndex: PropTypes.number.isRequired,
|
|
287
287
|
startIndex: PropTypes.number.isRequired
|
|
288
288
|
})]),
|
|
289
|
-
/**
|
|
290
|
-
* Disable specific clock time.
|
|
291
|
-
* @param {number} clockValue The value to check.
|
|
292
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
293
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
294
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
295
|
-
*/
|
|
296
|
-
shouldDisableClock: PropTypes.func,
|
|
297
289
|
/**
|
|
298
290
|
* Disable specific time.
|
|
299
291
|
* @template TDate
|
|
@@ -340,7 +332,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
340
332
|
* Choose which timezone to use for the value.
|
|
341
333
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
342
334
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
343
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
335
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
344
336
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
345
337
|
*/
|
|
346
338
|
timezone: PropTypes.string,
|