@mui/x-date-pickers 6.0.3 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/index.d.ts +1 -1
- package/AdapterDateFnsJalali/index.d.ts +1 -1
- package/AdapterDateFnsJalali/index.js +68 -0
- package/AdapterDayjs/index.d.ts +2 -3
- package/AdapterLuxon/index.d.ts +2 -2
- package/AdapterLuxon/index.js +12 -3
- package/AdapterMoment/index.d.ts +1 -1
- package/AdapterMomentHijri/index.d.ts +1 -1
- package/AdapterMomentJalaali/index.d.ts +1 -1
- package/CHANGELOG.md +119 -0
- package/DateCalendar/DateCalendar.js +0 -2
- package/DateCalendar/DateCalendar.types.d.ts +1 -1
- package/DateCalendar/PickersCalendarHeader.d.ts +1 -13
- package/DateCalendar/PickersCalendarHeader.js +7 -9
- package/DateCalendar/PickersSlideTransition.js +1 -0
- package/DateCalendar/index.d.ts +0 -1
- package/DateCalendar/useCalendarState.d.ts +1 -1
- package/DateField/DateField.js +8 -2
- package/DateField/DateField.types.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.d.ts +1 -1
- package/DatePicker/shared.d.ts +2 -2
- package/DateTimeField/DateTimeField.js +8 -2
- package/DateTimeField/DateTimeField.types.d.ts +2 -2
- package/DateTimePicker/DateTimePickerTabs.d.ts +1 -1
- package/DateTimePicker/DateTimePickerToolbar.d.ts +1 -1
- package/DateTimePicker/shared.d.ts +1 -2
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +1 -1
- package/LocalizationProvider/LocalizationProvider.d.ts +2 -3
- package/MobileDatePicker/MobileDatePicker.types.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.types.d.ts +1 -1
- package/MonthCalendar/PickersMonth.js +1 -0
- package/PickersLayout/PickersLayout.d.ts +1 -1
- package/PickersLayout/PickersLayout.types.d.ts +1 -1
- package/PickersLayout/index.d.ts +1 -1
- package/PickersLayout/usePickerLayout.d.ts +1 -1
- package/README.md +3 -3
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -1
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -1
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -1
- package/TimeClock/Clock.d.ts +1 -1
- package/TimeClock/ClockNumbers.d.ts +1 -1
- package/TimeClock/ClockPointer.d.ts +1 -1
- package/TimeClock/TimeClock.js +5 -4
- package/TimeClock/TimeClock.types.d.ts +1 -1
- package/TimeClock/index.d.ts +0 -1
- package/TimeField/TimeField.js +8 -2
- package/TimeField/TimeField.types.d.ts +2 -2
- package/TimePicker/TimePickerToolbar.d.ts +1 -1
- package/TimePicker/shared.d.ts +1 -2
- package/YearCalendar/PickersYear.js +1 -0
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -12
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +0 -12
- package/internals/components/PickersModalDialog.d.ts +0 -12
- package/internals/components/PickersModalDialog.js +7 -9
- package/internals/components/PickersPopper.d.ts +0 -2
- package/internals/components/PickersPopper.js +2 -7
- package/internals/components/PickersToolbar.d.ts +1 -1
- package/internals/demo/DemoContainer.js +15 -7
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +3 -5
- package/internals/hooks/useField/index.d.ts +1 -1
- package/internals/hooks/useField/useField.d.ts +2 -1
- package/internals/hooks/useField/useField.js +11 -9
- package/internals/hooks/useField/useField.types.d.ts +25 -113
- package/internals/hooks/useField/useField.utils.d.ts +7 -6
- package/internals/hooks/useField/useField.utils.js +71 -51
- package/internals/hooks/useField/useFieldCharacterEditing.d.ts +2 -1
- package/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
- package/internals/hooks/useField/useFieldState.d.ts +3 -1
- package/internals/hooks/useField/useFieldState.js +88 -62
- package/internals/hooks/useIsLandscape.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +3 -5
- package/internals/hooks/usePicker/usePicker.d.ts +1 -2
- package/internals/hooks/usePicker/usePicker.types.d.ts +1 -2
- package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
- package/internals/hooks/usePicker/usePickerValue.d.ts +9 -2
- package/internals/hooks/usePicker/usePickerValue.js +23 -2
- package/internals/hooks/usePicker/usePickerViews.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerViews.js +13 -0
- package/internals/hooks/useStaticPicker/useStaticPicker.d.ts +1 -1
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +1 -2
- package/internals/hooks/useUtils.d.ts +1 -1
- package/internals/hooks/useViews.d.ts +1 -1
- package/internals/hooks/useViews.js +8 -0
- package/internals/hooks/validation/models.d.ts +1 -1
- package/internals/hooks/validation/useDateTimeValidation.d.ts +3 -3
- package/internals/hooks/validation/useDateValidation.d.ts +2 -2
- package/internals/hooks/validation/useTimeValidation.d.ts +2 -2
- package/internals/index.d.ts +3 -8
- package/internals/index.js +1 -1
- package/internals/models/fields.d.ts +2 -20
- package/internals/models/index.d.ts +0 -2
- package/internals/models/index.js +1 -3
- package/internals/models/props/basePickerProps.d.ts +3 -3
- package/internals/models/props/tabs.d.ts +1 -1
- package/internals/models/props/toolbar.d.ts +1 -1
- package/internals/utils/date-utils.d.ts +1 -1
- package/internals/utils/time-utils.d.ts +1 -1
- package/internals/utils/utils.d.ts +1 -1
- package/internals/utils/utils.js +3 -3
- package/internals/utils/validation.d.ts +1 -1
- package/internals/utils/valueManagers.d.ts +3 -5
- package/internals/utils/valueManagers.js +10 -10
- package/internals/utils/views.d.ts +1 -1
- package/legacy/AdapterDateFnsJalali/index.js +68 -0
- package/legacy/AdapterLuxon/index.js +12 -3
- package/legacy/DateCalendar/DateCalendar.js +0 -2
- package/legacy/DateCalendar/PickersCalendarHeader.js +8 -10
- package/legacy/DateField/DateField.js +7 -1
- package/legacy/DateTimeField/DateTimeField.js +7 -1
- package/legacy/TimeClock/TimeClock.js +5 -4
- package/legacy/TimeField/TimeField.js +7 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -12
- package/legacy/internals/components/PickersModalDialog.js +7 -9
- package/legacy/internals/components/PickersPopper.js +2 -7
- package/legacy/internals/demo/DemoContainer.js +12 -6
- package/legacy/internals/hooks/useField/useField.js +12 -10
- package/legacy/internals/hooks/useField/useField.utils.js +79 -55
- package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
- package/legacy/internals/hooks/useField/useFieldState.js +94 -67
- package/legacy/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
- package/legacy/internals/hooks/usePicker/usePickerValue.js +23 -4
- package/legacy/internals/hooks/usePicker/usePickerViews.js +13 -0
- package/legacy/internals/hooks/useViews.js +10 -0
- package/legacy/internals/index.js +1 -1
- package/legacy/internals/models/index.js +1 -3
- package/legacy/internals/utils/utils.js +3 -3
- package/legacy/internals/utils/valueManagers.js +13 -15
- package/legacy/locales/caES.js +88 -0
- package/legacy/locales/daDK.js +91 -0
- package/legacy/locales/esES.js +34 -17
- package/legacy/locales/heIL.js +33 -16
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/jaJP.js +3 -1
- package/legacy/locales/kzKZ.js +88 -0
- package/legacy/locales/nbNO.js +12 -10
- package/legacy/locales/nlNL.js +25 -11
- package/legacy/locales/ptBR.js +33 -16
- package/legacy/locales/svSE.js +12 -10
- package/legacy/models/index.js +4 -1
- package/legacy/models/views.js +1 -0
- package/locales/beBY.d.ts +3 -3
- package/locales/caES.d.ts +51 -0
- package/locales/caES.js +54 -0
- package/locales/csCZ.d.ts +3 -3
- package/locales/daDK.d.ts +51 -0
- package/locales/daDK.js +59 -0
- package/locales/deDE.d.ts +3 -3
- package/locales/enUS.d.ts +3 -3
- package/locales/esES.d.ts +3 -3
- package/locales/esES.js +14 -17
- package/locales/faIR.d.ts +3 -3
- package/locales/fiFI.d.ts +3 -3
- package/locales/frFR.d.ts +3 -3
- package/locales/heIL.d.ts +3 -3
- package/locales/heIL.js +13 -16
- package/locales/huHU.d.ts +3 -3
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/isIS.d.ts +3 -3
- package/locales/itIT.d.ts +3 -3
- package/locales/jaJP.d.ts +3 -3
- package/locales/jaJP.js +1 -1
- package/locales/koKR.d.ts +3 -3
- package/locales/kzKZ.d.ts +51 -0
- package/locales/kzKZ.js +56 -0
- package/locales/nbNO.d.ts +3 -3
- package/locales/nbNO.js +8 -10
- package/locales/nlNL.d.ts +4 -4
- package/locales/nlNL.js +9 -11
- package/locales/plPL.d.ts +3 -3
- package/locales/ptBR.d.ts +3 -3
- package/locales/ptBR.js +13 -16
- package/locales/ruRU.d.ts +3 -3
- package/locales/svSE.d.ts +3 -3
- package/locales/svSE.js +8 -10
- package/locales/trTR.d.ts +3 -3
- package/locales/ukUA.d.ts +3 -3
- package/locales/urPK.d.ts +3 -3
- package/locales/utils/getPickersLocalization.d.ts +3 -3
- package/locales/utils/pickersLocaleTextApi.d.ts +1 -1
- package/locales/zhCN.d.ts +3 -3
- package/models/adapters.d.ts +567 -0
- package/models/adapters.js +1 -0
- package/models/fields.d.ts +117 -0
- package/models/fields.js +1 -0
- package/models/index.d.ts +4 -6
- package/models/index.js +4 -1
- package/models/validation.d.ts +8 -0
- package/models/validation.js +1 -0
- package/models/views.js +1 -0
- package/modern/AdapterDateFnsJalali/index.js +68 -0
- package/modern/AdapterLuxon/index.js +12 -3
- package/modern/DateCalendar/DateCalendar.js +0 -2
- package/modern/DateCalendar/PickersCalendarHeader.js +6 -8
- package/modern/DateCalendar/PickersSlideTransition.js +1 -0
- package/modern/DateField/DateField.js +8 -2
- package/modern/DateTimeField/DateTimeField.js +8 -2
- package/modern/MonthCalendar/PickersMonth.js +1 -0
- package/modern/TimeClock/TimeClock.js +5 -4
- package/modern/TimeField/TimeField.js +8 -2
- package/modern/YearCalendar/PickersYear.js +1 -0
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +9 -11
- package/modern/internals/components/PickersModalDialog.js +6 -8
- package/modern/internals/components/PickersPopper.js +2 -7
- package/modern/internals/demo/DemoContainer.js +15 -7
- package/modern/internals/hooks/useField/useField.js +10 -8
- package/modern/internals/hooks/useField/useField.utils.js +71 -51
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
- package/modern/internals/hooks/useField/useFieldState.js +88 -62
- package/modern/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
- package/modern/internals/hooks/usePicker/usePickerValue.js +23 -2
- package/modern/internals/hooks/usePicker/usePickerViews.js +13 -0
- package/modern/internals/hooks/useViews.js +8 -0
- package/modern/internals/index.js +1 -1
- package/modern/internals/models/index.js +1 -3
- package/modern/internals/utils/utils.js +3 -3
- package/modern/internals/utils/valueManagers.js +10 -10
- package/modern/locales/caES.js +54 -0
- package/modern/locales/daDK.js +56 -0
- package/modern/locales/esES.js +14 -17
- package/modern/locales/heIL.js +13 -16
- package/modern/locales/index.js +1 -0
- package/modern/locales/jaJP.js +1 -1
- package/modern/locales/kzKZ.js +56 -0
- package/modern/locales/nbNO.js +8 -10
- package/modern/locales/nlNL.js +9 -11
- package/modern/locales/ptBR.js +13 -16
- package/modern/locales/svSE.js +8 -10
- package/modern/models/adapters.js +1 -0
- package/modern/models/fields.js +1 -0
- package/modern/models/index.js +4 -1
- package/modern/models/validation.js +1 -0
- package/modern/models/views.js +1 -0
- package/node/AdapterDateFnsJalali/index.js +68 -0
- package/node/AdapterLuxon/index.js +12 -3
- package/node/AdapterMomentHijri/index.js +2 -0
- package/node/DateCalendar/DateCalendar.js +0 -2
- package/node/DateCalendar/PickersCalendarHeader.js +5 -9
- package/node/DateCalendar/PickersSlideTransition.js +1 -0
- package/node/DateField/DateField.js +8 -2
- package/node/DateTimeField/DateTimeField.js +8 -2
- package/node/MonthCalendar/PickersMonth.js +1 -0
- package/node/TimeClock/TimeClock.js +5 -4
- package/node/TimeField/TimeField.js +8 -2
- package/node/YearCalendar/PickersYear.js +1 -0
- package/node/index.js +1 -1
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +9 -11
- package/node/internals/components/PickersModalDialog.js +6 -8
- package/node/internals/components/PickersPopper.js +2 -7
- package/node/internals/demo/DemoContainer.js +15 -7
- package/node/internals/hooks/useField/useField.js +10 -8
- package/node/internals/hooks/useField/useField.utils.js +74 -53
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +22 -0
- package/node/internals/hooks/useField/useFieldState.js +87 -61
- package/node/internals/hooks/usePicker/usePickerLayoutProps.js +5 -0
- package/node/internals/hooks/usePicker/usePickerValue.js +22 -2
- package/node/internals/hooks/usePicker/usePickerViews.js +12 -0
- package/node/internals/hooks/useViews.js +8 -0
- package/node/internals/index.js +0 -6
- package/node/internals/models/index.js +0 -22
- package/node/internals/utils/utils.js +3 -3
- package/node/internals/utils/valueManagers.js +9 -9
- package/node/locales/caES.js +61 -0
- package/node/locales/csCZ.js +0 -1
- package/node/locales/daDK.js +62 -0
- package/node/locales/esES.js +14 -17
- package/node/locales/heIL.js +13 -16
- package/node/locales/index.js +11 -0
- package/node/locales/jaJP.js +1 -1
- package/node/locales/kzKZ.js +62 -0
- package/node/locales/nbNO.js +8 -10
- package/node/locales/nlNL.js +9 -11
- package/node/locales/ptBR.js +13 -16
- package/node/locales/svSE.js +8 -10
- package/node/models/fields.js +5 -0
- package/node/models/index.js +44 -0
- package/node/models/validation.js +5 -0
- package/node/models/views.js +5 -0
- package/package.json +3 -3
- package/themeAugmentation/props.d.ts +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +1 -1
- package/internals/models/muiPickersAdapter.d.ts +0 -35
- /package/{internals/models/views.js → legacy/models/adapters.js} +0 -0
- /package/legacy/{internals/models/views.js → models/fields.js} +0 -0
- /package/{modern/internals/models/views.js → legacy/models/validation.js} +0 -0
- /package/{internals/models → models}/views.d.ts +0 -0
- /package/node/{internals/models/views.js → models/adapters.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseAdapterDateFns from '@date-io/date-fns';
|
|
2
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
2
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
3
3
|
export declare class AdapterDateFns extends BaseAdapterDateFns implements MuiPickersAdapter<Date> {
|
|
4
4
|
isMUIAdapter: boolean;
|
|
5
5
|
formatTokenMap: FieldFormatTokenMap;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseAdapterDateFnsJalali from '@date-io/date-fns-jalali';
|
|
2
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
2
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
3
3
|
export declare class AdapterDateFnsJalali extends BaseAdapterDateFnsJalali implements MuiPickersAdapter<Date> {
|
|
4
4
|
isMUIAdapter: boolean;
|
|
5
5
|
formatTokenMap: FieldFormatTokenMap;
|
|
@@ -31,6 +31,74 @@ const formatTokenMap = {
|
|
|
31
31
|
// Day of the month
|
|
32
32
|
d: 'day',
|
|
33
33
|
dd: 'day',
|
|
34
|
+
do: 'day',
|
|
35
|
+
// Day of the week
|
|
36
|
+
E: {
|
|
37
|
+
sectionType: 'weekDay',
|
|
38
|
+
contentType: 'letter'
|
|
39
|
+
},
|
|
40
|
+
EE: {
|
|
41
|
+
sectionType: 'weekDay',
|
|
42
|
+
contentType: 'letter'
|
|
43
|
+
},
|
|
44
|
+
EEE: {
|
|
45
|
+
sectionType: 'weekDay',
|
|
46
|
+
contentType: 'letter'
|
|
47
|
+
},
|
|
48
|
+
EEEE: {
|
|
49
|
+
sectionType: 'weekDay',
|
|
50
|
+
contentType: 'letter'
|
|
51
|
+
},
|
|
52
|
+
EEEEE: {
|
|
53
|
+
sectionType: 'weekDay',
|
|
54
|
+
contentType: 'letter'
|
|
55
|
+
},
|
|
56
|
+
i: 'weekDay',
|
|
57
|
+
ii: 'weekDay',
|
|
58
|
+
iii: {
|
|
59
|
+
sectionType: 'weekDay',
|
|
60
|
+
contentType: 'letter'
|
|
61
|
+
},
|
|
62
|
+
iiii: {
|
|
63
|
+
sectionType: 'weekDay',
|
|
64
|
+
contentType: 'letter'
|
|
65
|
+
},
|
|
66
|
+
e: 'weekDay',
|
|
67
|
+
ee: 'weekDay',
|
|
68
|
+
eee: {
|
|
69
|
+
sectionType: 'weekDay',
|
|
70
|
+
contentType: 'letter'
|
|
71
|
+
},
|
|
72
|
+
eeee: {
|
|
73
|
+
sectionType: 'weekDay',
|
|
74
|
+
contentType: 'letter'
|
|
75
|
+
},
|
|
76
|
+
eeeee: {
|
|
77
|
+
sectionType: 'weekDay',
|
|
78
|
+
contentType: 'letter'
|
|
79
|
+
},
|
|
80
|
+
eeeeee: {
|
|
81
|
+
sectionType: 'weekDay',
|
|
82
|
+
contentType: 'letter'
|
|
83
|
+
},
|
|
84
|
+
c: 'weekDay',
|
|
85
|
+
cc: 'weekDay',
|
|
86
|
+
ccc: {
|
|
87
|
+
sectionType: 'weekDay',
|
|
88
|
+
contentType: 'letter'
|
|
89
|
+
},
|
|
90
|
+
cccc: {
|
|
91
|
+
sectionType: 'weekDay',
|
|
92
|
+
contentType: 'letter'
|
|
93
|
+
},
|
|
94
|
+
ccccc: {
|
|
95
|
+
sectionType: 'weekDay',
|
|
96
|
+
contentType: 'letter'
|
|
97
|
+
},
|
|
98
|
+
cccccc: {
|
|
99
|
+
sectionType: 'weekDay',
|
|
100
|
+
contentType: 'letter'
|
|
101
|
+
},
|
|
34
102
|
// Meridiem
|
|
35
103
|
a: 'meridiem',
|
|
36
104
|
aa: 'meridiem',
|
package/AdapterDayjs/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import defaultDayjs, { Dayjs } from 'dayjs';
|
|
2
2
|
import BaseAdapterDayjs from '@date-io/dayjs';
|
|
3
|
-
import {
|
|
4
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../internals/models';
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter, AdapterFormats } from '../models';
|
|
5
4
|
interface Opts {
|
|
6
5
|
locale?: string;
|
|
7
6
|
/** Make sure that your dayjs instance extends customParseFormat and advancedFormat */
|
|
8
7
|
instance?: typeof defaultDayjs;
|
|
9
|
-
formats?: Partial<
|
|
8
|
+
formats?: Partial<AdapterFormats>;
|
|
10
9
|
}
|
|
11
10
|
export declare class AdapterDayjs extends BaseAdapterDayjs implements MuiPickersAdapter<Dayjs> {
|
|
12
11
|
isMUIAdapter: boolean;
|
package/AdapterLuxon/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DateTime } from 'luxon';
|
|
2
2
|
import BaseAdapterLuxon from '@date-io/luxon';
|
|
3
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
4
4
|
export declare class AdapterLuxon extends BaseAdapterLuxon implements MuiPickersAdapter<DateTime> {
|
|
5
5
|
isMUIAdapter: boolean;
|
|
6
6
|
formatTokenMap: FieldFormatTokenMap;
|
|
@@ -10,5 +10,5 @@ export declare class AdapterLuxon extends BaseAdapterLuxon implements MuiPickers
|
|
|
10
10
|
};
|
|
11
11
|
expandFormat: (format: string) => string;
|
|
12
12
|
getFormatHelperText: (format: string) => string;
|
|
13
|
-
getWeekNumber: (date: DateTime) =>
|
|
13
|
+
getWeekNumber: (date: DateTime) => number;
|
|
14
14
|
}
|
package/AdapterLuxon/index.js
CHANGED
|
@@ -84,12 +84,21 @@ export class AdapterLuxon extends BaseAdapterLuxon {
|
|
|
84
84
|
if (!DateTime.expandFormat) {
|
|
85
85
|
throw Error('Your luxon version does not support `expandFormat`. Consider upgrading it to v3.0.2');
|
|
86
86
|
}
|
|
87
|
+
// Extract escaped section to avoid extending them
|
|
88
|
+
const longFormatRegexp = /''|'(''|[^'])+('|$)|[^']*/g;
|
|
89
|
+
return format.match(longFormatRegexp).map(token => {
|
|
90
|
+
const firstCharacter = token[0];
|
|
91
|
+
if (firstCharacter === "'") {
|
|
92
|
+
return token;
|
|
93
|
+
}
|
|
94
|
+
return DateTime.expandFormat(token, {
|
|
95
|
+
locale: this.locale
|
|
96
|
+
});
|
|
97
|
+
}).join('')
|
|
87
98
|
// The returned format can contain `yyyyy` which means year between 4 and 6 digits.
|
|
88
99
|
// This value is supported by luxon parser but not luxon formatter.
|
|
89
100
|
// To avoid conflicts, we replace it by 4 digits which is enough for most use-cases.
|
|
90
|
-
|
|
91
|
-
locale: this.locale
|
|
92
|
-
}).replace('yyyyy', 'yyyy');
|
|
101
|
+
.replace('yyyyy', 'yyyy');
|
|
93
102
|
};
|
|
94
103
|
// Redefined here just to show how it can be written using expandFormat
|
|
95
104
|
this.getFormatHelperText = format => {
|
package/AdapterMoment/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defaultMoment from 'moment';
|
|
2
2
|
import BaseAdapterMoment from '@date-io/moment';
|
|
3
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
4
4
|
export declare class AdapterMoment extends BaseAdapterMoment implements MuiPickersAdapter<defaultMoment.Moment> {
|
|
5
5
|
isMUIAdapter: boolean;
|
|
6
6
|
formatTokenMap: FieldFormatTokenMap;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseAdapterMomentHijri from '@date-io/hijri';
|
|
2
2
|
import defaultMoment from 'moment-hijri';
|
|
3
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
4
4
|
export declare class AdapterMomentHijri extends BaseAdapterMomentHijri implements MuiPickersAdapter<defaultMoment.Moment> {
|
|
5
5
|
isMUIAdapter: boolean;
|
|
6
6
|
formatTokenMap: FieldFormatTokenMap;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseAdapterMomentJalaali from '@date-io/jalaali';
|
|
2
2
|
import defaultMoment from 'moment-jalaali';
|
|
3
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
4
4
|
export declare class AdapterMomentJalaali extends BaseAdapterMomentJalaali implements MuiPickersAdapter<defaultMoment.Moment> {
|
|
5
5
|
isMUIAdapter: boolean;
|
|
6
6
|
formatTokenMap: FieldFormatTokenMap;
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,125 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.1.0
|
|
7
|
+
|
|
8
|
+
_Apr 7, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Add Catalan (ca-ES), Kazakh (kz-KZ) and improve Spanish (es-ES), Dutch (nl-NL), Hebrew (he-IL), Hungarian (hu-HU), Japanese (ja-JP), Portuguese (pt-BR), and Russian (ru-RU) locales
|
|
13
|
+
- ✨ Allow to control visibility of columns shown in the columns panel (#8401) @MBilalShafi
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### `@mui/x-data-grid@v6.1.0` / `@mui/x-data-grid-pro@v6.1.0` / `@mui/x-data-grid-premium@v6.1.0`
|
|
18
|
+
|
|
19
|
+
#### Changes
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Allow to control visibility of columns shown in the `ColumnsPanel` component (#8401) @MBilalShafi
|
|
22
|
+
- [DataGrid] Fix filters with empty array value not being removed from the filter model (#8501) @cherniavskii
|
|
23
|
+
- [DataGrid] Fix memory leaks in development (#8301) @cherniavskii
|
|
24
|
+
- [DataGrid] Sync `date` column value when entering edit mode by pressing a digit (#8364) @m4theushw
|
|
25
|
+
- [DataGrid] Wrap column menu button with a tooltip (#7890) @cherniavskii
|
|
26
|
+
- [l10n] Improve Dutch (nl-NL) locale (#8491) @thedutchruben
|
|
27
|
+
- [l10n] Improve Hungarian (hu-HU) locale (#8486) @PetakCC
|
|
28
|
+
- [l10n] Improve Japanese (ja-JP) locale (#8462) @megos
|
|
29
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#8480) @pwnedev
|
|
30
|
+
- [l10n] Improve Russian (ru-RU) locale (#8510) @alexrapro
|
|
31
|
+
|
|
32
|
+
### `@mui/x-date-pickers@v6.1.0` / `@mui/x-date-pickers-pro@v6.1.0`
|
|
33
|
+
|
|
34
|
+
#### Changes
|
|
35
|
+
|
|
36
|
+
- [fields] Fix RTL navigation (#8490) @alexfauquette
|
|
37
|
+
- [fields] Fix usage of `slotProps.textField.InputProps` (#8428) @flaviendelangle
|
|
38
|
+
- [pickers] Fix `componentsProps.dialog` propagation (#8509) @LukasTy
|
|
39
|
+
- [pickers] Move `hasError` from `fieldValueManager` to `valueManager` (#8453) @flaviendelangle
|
|
40
|
+
- [pickers] Move the adapters interfaces to the X repository (#8412) @flaviendelangle
|
|
41
|
+
- [pickers] Update peer dependency versions (#8531) @LukasTy
|
|
42
|
+
- [pickers] Fix `isValid` regression (#8543) @LukasTy
|
|
43
|
+
- [l10n] Add Catalan (Spain) (ca-ES) and improve Spanish (es-ES) locales (#8498) @makenshikuro
|
|
44
|
+
- [l10n] Add Kazakh (kz-KZ) locale (#8451) @zhunus
|
|
45
|
+
- [l10n] Improve Dutch (nl-NL) locale (#8491) @thedutchruben
|
|
46
|
+
- [l10n] Improve Hebrew (he-IL) locale (#8464) @soris1989
|
|
47
|
+
- [l10n] Improve Japanese (ja-JP) locale (#8462) @megos
|
|
48
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#8480) @pwnedev
|
|
49
|
+
|
|
50
|
+
### Docs
|
|
51
|
+
|
|
52
|
+
- [docs] Fix 301 redirect (#8524) @alexfauquette
|
|
53
|
+
- [docs] Fix 404 links (#8454) @alexfauquette
|
|
54
|
+
- [docs] Fix broken API reference link (#8460) @oliviertassinari
|
|
55
|
+
|
|
56
|
+
### Core
|
|
57
|
+
|
|
58
|
+
- [core] Avoid 301 links (#8383) @oliviertassinari
|
|
59
|
+
- [core] Fix the l10n helper by using danger instead of actions (#8512) @alexfauquette
|
|
60
|
+
- [core] Help contributors for l10n PRs (#8503) @alexfauquette
|
|
61
|
+
- [core] Remove legacy token (#8457) @oliviertassinari
|
|
62
|
+
- [charts] Add a styling system (#8445) @alexfauquette
|
|
63
|
+
|
|
64
|
+
## 6.0.4
|
|
65
|
+
|
|
66
|
+
_Mar 30, 2023_
|
|
67
|
+
|
|
68
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
69
|
+
|
|
70
|
+
- 🌍 Add Danish (da-DK), and improve Norwegian (nb-NO), Spanish (es-ES), and Swedish (sv-SE) locales
|
|
71
|
+
- 🐞 Bugfixes
|
|
72
|
+
- 📚 Documentation improvements
|
|
73
|
+
|
|
74
|
+
### `@mui/x-data-grid@v6.0.4` / `@mui/x-data-grid-pro@v6.0.4` / `@mui/x-data-grid-premium@v6.0.4`
|
|
75
|
+
|
|
76
|
+
#### Changes
|
|
77
|
+
|
|
78
|
+
- [DataGrid] Fix column header tooltip not showing when the title is truncated (#8433) @rohitnatesh
|
|
79
|
+
- [DataGrid] Fix filter model buttons' display condition (#8415) @MBilalShafi
|
|
80
|
+
- [DataGrid] Fix infinite rerender in a flex parent (#8436) @cherniavskii
|
|
81
|
+
- [DataGrid] Prevent reopening column menu when clicking in the button while it is open (#8286) @tanuj-22
|
|
82
|
+
- [DataGrid] Rename `components` by `slots` in column menu API (#7999) @MBilalShafi
|
|
83
|
+
- [DataGrid] Remove hardcoded CSS classes' usages (#8444) @MBilalShafi
|
|
84
|
+
- [DataGridPremium] Fix aggregation initial state causing issue with quick filter (#8441) @MBilalShafi
|
|
85
|
+
- [l10n] Improve Danish (da-DK) locale (#8368) @BossElijah
|
|
86
|
+
- [l10n] Improve Danish (da-DK) locale (#8378) @BossElijah
|
|
87
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#8367) @BossElijah
|
|
88
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#8409) @BossElijah
|
|
89
|
+
- [l10n] Improve Spanish (es-ES) locale (#8420) @martjanz
|
|
90
|
+
- [l10n] Improve Swedish (sv-SE) locale (#8381) @BossElijah
|
|
91
|
+
|
|
92
|
+
### `@mui/x-date-pickers@v6.0.4` / `@mui/x-date-pickers-pro@v6.0.4`
|
|
93
|
+
|
|
94
|
+
#### Changes
|
|
95
|
+
|
|
96
|
+
- [fields] Add missing tokens to `AdapterDateFnsJalali` (#8402) @flaviendelangle
|
|
97
|
+
- [fields] Clean the active date manager (#8370) @flaviendelangle
|
|
98
|
+
- [fields] Cleanup `useFieldState` (#8292) @flaviendelangle
|
|
99
|
+
- [fields] Only add RTL characters when needed (#8325) @flaviendelangle
|
|
100
|
+
- [pickers] Add support for single input fields in range pickers (#7927) @flaviendelangle
|
|
101
|
+
- [pickers] Allows non token characters in format (#8256) @alexfauquette
|
|
102
|
+
- [pickers] Avoid root imports and move public models to the models folder (#8337) @flaviendelangle
|
|
103
|
+
- [pickers] Update `view` when `views` or `openTo` changes (#8361) @LukasTy
|
|
104
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#8382) @BossElijah
|
|
105
|
+
- [l10n] Add Danish (da-DK) locale (#8379) @BossElijah
|
|
106
|
+
- [l10n] Improve Swedish (sv-SE) locale (#8381) @BossElijah
|
|
107
|
+
|
|
108
|
+
### `@mui/x-codemod@v6.0.4`
|
|
109
|
+
|
|
110
|
+
#### Changes
|
|
111
|
+
|
|
112
|
+
- [codemod] Fix `remove-stabilized-experimentalFeatures` codemod (#8289) @alexfauquette
|
|
113
|
+
|
|
114
|
+
### Docs
|
|
115
|
+
|
|
116
|
+
- [docs] Fix `GridCellParams` signature in migration guide (#8427) @cherniavskii
|
|
117
|
+
- [docs] Fix "Custom field" demos responsive styles (#8408) @LukasTy
|
|
118
|
+
- [docs] Remove `label` from demos where it reduces clarity (#8416) @LukasTy
|
|
119
|
+
- [docs] Update slots' references in Data Grid migration guide (#8159) @MBilalShafi
|
|
120
|
+
|
|
121
|
+
### Core
|
|
122
|
+
|
|
123
|
+
- [charts] Work on typing (#8421) @flaviendelangle
|
|
124
|
+
|
|
6
125
|
## 6.0.3
|
|
7
126
|
|
|
8
127
|
_Mar 23, 2023_
|
|
@@ -272,8 +272,6 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
272
272
|
disableFuture: disableFuture,
|
|
273
273
|
reduceAnimations: reduceAnimations,
|
|
274
274
|
labelId: gridLabelId,
|
|
275
|
-
components: components,
|
|
276
|
-
componentsProps: componentsProps,
|
|
277
275
|
slots: slots,
|
|
278
276
|
slotProps: slotProps
|
|
279
277
|
}), /*#__PURE__*/_jsx(DateCalendarViewTransitionContainer, {
|
|
@@ -7,7 +7,7 @@ import { DateCalendarClasses } from './dateCalendarClasses';
|
|
|
7
7
|
import { BaseDateValidationProps, YearValidationProps, MonthValidationProps, DayValidationProps } from '../internals/hooks/validation/models';
|
|
8
8
|
import { PickerSelectionState } from '../internals/hooks/usePicker/usePickerValue';
|
|
9
9
|
import { ExportedUseViewsOptions } from '../internals/hooks/useViews';
|
|
10
|
-
import { DateView } from '../
|
|
10
|
+
import { DateView } from '../models';
|
|
11
11
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
12
12
|
import { SlotsAndSlotProps } from '../internals/utils/slots-migration';
|
|
13
13
|
import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
|
|
@@ -5,7 +5,7 @@ import SvgIcon from '@mui/material/SvgIcon';
|
|
|
5
5
|
import { SlideDirection } from './PickersSlideTransition';
|
|
6
6
|
import { DateComponentValidationProps } from '../internals/hooks/validation/useDateValidation';
|
|
7
7
|
import { ExportedPickersArrowSwitcherProps, PickersArrowSwitcherSlotsComponent, PickersArrowSwitcherSlotsComponentsProps } from '../internals/components/PickersArrowSwitcher';
|
|
8
|
-
import { DateView } from '../
|
|
8
|
+
import { DateView } from '../models';
|
|
9
9
|
import { PickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
10
10
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
11
11
|
export type ExportedCalendarHeaderProps<TDate> = Pick<PickersCalendarHeaderProps<TDate>, 'classes'>;
|
|
@@ -29,18 +29,6 @@ export interface PickersCalendarHeaderSlotsComponentsProps<TDate> extends Picker
|
|
|
29
29
|
switchViewIcon?: SlotComponentProps<typeof SvgIcon, PickersCalendarHeaderComponentsPropsOverrides, undefined>;
|
|
30
30
|
}
|
|
31
31
|
export interface PickersCalendarHeaderProps<TDate> extends ExportedPickersArrowSwitcherProps, DateComponentValidationProps<TDate> {
|
|
32
|
-
/**
|
|
33
|
-
* Overridable components.
|
|
34
|
-
* @default {}
|
|
35
|
-
* @deprecated Please use `slots`.
|
|
36
|
-
*/
|
|
37
|
-
components?: PickersCalendarHeaderSlotsComponent;
|
|
38
|
-
/**
|
|
39
|
-
* The props used for each component slot.
|
|
40
|
-
* @default {}
|
|
41
|
-
* @deprecated Please use `slotProps`.
|
|
42
|
-
*/
|
|
43
|
-
componentsProps?: PickersCalendarHeaderSlotsComponentsProps<TDate>;
|
|
44
32
|
/**
|
|
45
33
|
* Overridable component slots.
|
|
46
34
|
* @default {}
|
|
@@ -13,6 +13,8 @@ import { ArrowDropDown } from '../internals/components/icons';
|
|
|
13
13
|
import { PickersArrowSwitcher } from '../internals/components/PickersArrowSwitcher';
|
|
14
14
|
import { usePreviousMonthDisabled, useNextMonthDisabled } from '../internals/hooks/date-helpers-hooks';
|
|
15
15
|
import { getPickersCalendarHeaderUtilityClass, pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
16
|
+
|
|
17
|
+
// We keep the interface to allow module augmentation
|
|
16
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
20
|
const useUtilityClasses = ownerState => {
|
|
@@ -94,7 +96,7 @@ const PickersCalendarHeaderSwitchViewIcon = styled(ArrowDropDown, {
|
|
|
94
96
|
* @ignore - do not document.
|
|
95
97
|
*/
|
|
96
98
|
export function PickersCalendarHeader(inProps) {
|
|
97
|
-
var
|
|
99
|
+
var _slots$switchViewButt, _slots$switchViewIcon;
|
|
98
100
|
const localeText = useLocaleText();
|
|
99
101
|
const utils = useUtils();
|
|
100
102
|
const props = useThemeProps({
|
|
@@ -102,8 +104,6 @@ export function PickersCalendarHeader(inProps) {
|
|
|
102
104
|
name: 'MuiPickersCalendarHeader'
|
|
103
105
|
});
|
|
104
106
|
const {
|
|
105
|
-
components,
|
|
106
|
-
componentsProps,
|
|
107
107
|
slots,
|
|
108
108
|
slotProps,
|
|
109
109
|
currentMonth: month,
|
|
@@ -121,10 +121,10 @@ export function PickersCalendarHeader(inProps) {
|
|
|
121
121
|
} = props;
|
|
122
122
|
const ownerState = props;
|
|
123
123
|
const classes = useUtilityClasses(props);
|
|
124
|
-
const SwitchViewButton = (
|
|
124
|
+
const SwitchViewButton = (_slots$switchViewButt = slots == null ? void 0 : slots.switchViewButton) != null ? _slots$switchViewButt : PickersCalendarHeaderSwitchViewButton;
|
|
125
125
|
const switchViewButtonProps = useSlotProps({
|
|
126
126
|
elementType: SwitchViewButton,
|
|
127
|
-
externalSlotProps:
|
|
127
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewButton,
|
|
128
128
|
additionalProps: {
|
|
129
129
|
size: 'small',
|
|
130
130
|
'aria-label': localeText.calendarViewSwitchingButtonAriaLabel(view)
|
|
@@ -132,11 +132,11 @@ export function PickersCalendarHeader(inProps) {
|
|
|
132
132
|
ownerState,
|
|
133
133
|
className: classes.switchViewButton
|
|
134
134
|
});
|
|
135
|
-
const SwitchViewIcon = (
|
|
135
|
+
const SwitchViewIcon = (_slots$switchViewIcon = slots == null ? void 0 : slots.switchViewIcon) != null ? _slots$switchViewIcon : PickersCalendarHeaderSwitchViewIcon;
|
|
136
136
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
137
137
|
const _useSlotProps = useSlotProps({
|
|
138
138
|
elementType: SwitchViewIcon,
|
|
139
|
-
externalSlotProps:
|
|
139
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewIcon,
|
|
140
140
|
ownerState: undefined,
|
|
141
141
|
className: classes.switchViewIcon
|
|
142
142
|
}),
|
|
@@ -194,8 +194,6 @@ export function PickersCalendarHeader(inProps) {
|
|
|
194
194
|
}), /*#__PURE__*/_jsx(Fade, {
|
|
195
195
|
in: view === 'day',
|
|
196
196
|
children: /*#__PURE__*/_jsx(PickersArrowSwitcher, {
|
|
197
|
-
components: components,
|
|
198
|
-
componentsProps: componentsProps,
|
|
199
197
|
slots: slots,
|
|
200
198
|
slotProps: slotProps,
|
|
201
199
|
onGoToPrevious: selectPreviousMonth,
|
|
@@ -101,6 +101,7 @@ export function PickersSlideTransition(inProps) {
|
|
|
101
101
|
className,
|
|
102
102
|
reduceAnimations,
|
|
103
103
|
transKey
|
|
104
|
+
// extracting `classes` from `other`
|
|
104
105
|
} = props,
|
|
105
106
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
106
107
|
const classes = useUtilityClasses(props);
|
package/DateCalendar/index.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ export type { PickersFadeTransitionGroupClassKey, PickersFadeTransitionGroupClas
|
|
|
12
12
|
export { pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
|
|
13
13
|
export type { PickersSlideTransitionClassKey, PickersSlideTransitionClasses, } from './pickersSlideTransitionClasses';
|
|
14
14
|
export type { ExportedSlideTransitionProps } from './PickersSlideTransition';
|
|
15
|
-
export type { DateView } from '../internals/models';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SlideDirection } from './PickersSlideTransition';
|
|
2
|
-
import { MuiPickersAdapter } from '../
|
|
2
|
+
import { MuiPickersAdapter } from '../models';
|
|
3
3
|
import { DateCalendarDefaultizedProps } from './DateCalendar.types';
|
|
4
4
|
interface CalendarState<TDate> {
|
|
5
5
|
currentMonth: TDate;
|
package/DateField/DateField.js
CHANGED
|
@@ -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 = ["components", "componentsProps", "slots", "slotProps"],
|
|
3
|
+
const _excluded = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"],
|
|
4
4
|
_excluded2 = ["inputRef"],
|
|
5
5
|
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -20,7 +20,9 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
|
|
|
20
20
|
components,
|
|
21
21
|
componentsProps,
|
|
22
22
|
slots,
|
|
23
|
-
slotProps
|
|
23
|
+
slotProps,
|
|
24
|
+
InputProps,
|
|
25
|
+
inputProps
|
|
24
26
|
} = themeProps,
|
|
25
27
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
26
28
|
const ownerState = themeProps;
|
|
@@ -35,6 +37,10 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
|
|
|
35
37
|
inputRef: externalInputRef
|
|
36
38
|
} = _useSlotProps,
|
|
37
39
|
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
|
+
|
|
41
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
38
44
|
const _useDateField = useDateField({
|
|
39
45
|
props: textFieldProps,
|
|
40
46
|
inputRef: externalInputRef
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { DateValidationError, FieldSection } from '../models';
|
|
5
|
+
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
6
6
|
import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
|
|
7
7
|
import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/hooks/validation/models';
|
|
8
8
|
import { FieldsTextFieldProps } from '../internals';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
3
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
4
|
-
import { DateView } from '../
|
|
4
|
+
import { DateView } from '../models';
|
|
5
5
|
import { DatePickerToolbarClasses } from './datePickerToolbarClasses';
|
|
6
6
|
export interface DatePickerToolbarProps<TDate> extends BaseToolbarProps<TDate | null, DateView> {
|
|
7
7
|
classes?: Partial<DatePickerToolbarClasses>;
|
package/DatePicker/shared.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
3
3
|
import { DateCalendarSlotsComponent, DateCalendarSlotsComponentsProps, ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
|
|
4
|
-
import { DateValidationError } from '../
|
|
4
|
+
import { DateValidationError, DateView, MuiPickersAdapter } from '../models';
|
|
5
5
|
import { BasePickerInputProps } from '../internals/models/props/basePickerProps';
|
|
6
|
-
import { BaseDateValidationProps,
|
|
6
|
+
import { BaseDateValidationProps, UncapitalizeObjectKeys } from '../internals';
|
|
7
7
|
import { LocalizedComponent } from '../locales/utils/pickersLocaleTextApi';
|
|
8
8
|
import { DatePickerToolbarProps, ExportedDatePickerToolbarProps } from './DatePickerToolbar';
|
|
9
9
|
import { PickerViewRendererLookup } from '../internals/hooks/usePicker/usePickerViews';
|
|
@@ -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 = ["components", "componentsProps", "slots", "slotProps"],
|
|
3
|
+
const _excluded = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"],
|
|
4
4
|
_excluded2 = ["inputRef"],
|
|
5
5
|
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -20,7 +20,9 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
|
|
|
20
20
|
components,
|
|
21
21
|
componentsProps,
|
|
22
22
|
slots,
|
|
23
|
-
slotProps
|
|
23
|
+
slotProps,
|
|
24
|
+
InputProps,
|
|
25
|
+
inputProps
|
|
24
26
|
} = themeProps,
|
|
25
27
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
26
28
|
const ownerState = themeProps;
|
|
@@ -35,6 +37,10 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
|
|
|
35
37
|
inputRef: externalInputRef
|
|
36
38
|
} = _useSlotProps,
|
|
37
39
|
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
|
+
|
|
41
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
38
44
|
const _useDateTimeField = useDateTimeField({
|
|
39
45
|
props: textFieldProps,
|
|
40
46
|
inputRef: externalInputRef
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { DateTimeValidationError, FieldSection } from '../models';
|
|
5
|
+
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
6
6
|
import { DefaultizedProps, MakeOptional } from '../internals/models/helpers';
|
|
7
7
|
import { BaseDateValidationProps, BaseTimeValidationProps, DayValidationProps, MonthValidationProps, TimeValidationProps, YearValidationProps } from '../internals/hooks/validation/models';
|
|
8
8
|
import { FieldsTextFieldProps, UncapitalizeObjectKeys } from '../internals';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateOrTimeView } from '../
|
|
2
|
+
import { DateOrTimeView } from '../models';
|
|
3
3
|
import { DateTimePickerTabsClasses } from './dateTimePickerTabsClasses';
|
|
4
4
|
import { BaseTabsProps, ExportedBaseTabsProps } from '../internals/models/props/tabs';
|
|
5
5
|
export interface ExportedDateTimePickerTabsProps extends ExportedBaseTabsProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
3
3
|
import { DateTimePickerToolbarClasses } from './dateTimePickerToolbarClasses';
|
|
4
|
-
import { DateOrTimeView } from '../
|
|
4
|
+
import { DateOrTimeView } from '../models';
|
|
5
5
|
export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
6
6
|
ampm?: boolean;
|
|
7
7
|
ampmInClock?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
3
|
-
import { DateOrTimeView } from '../
|
|
3
|
+
import { DateOrTimeView, DateTimeValidationError } from '../models';
|
|
4
4
|
import { DateCalendarSlotsComponent, DateCalendarSlotsComponentsProps, ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
|
|
5
5
|
import { TimeClockSlotsComponent, TimeClockSlotsComponentsProps, ExportedTimeClockProps } from '../TimeClock/TimeClock.types';
|
|
6
6
|
import { BasePickerInputProps } from '../internals/models/props/basePickerProps';
|
|
@@ -8,7 +8,6 @@ import { DateTimePickerTabsProps, ExportedDateTimePickerTabsProps } from './Date
|
|
|
8
8
|
import { BaseDateValidationProps, BaseTimeValidationProps } from '../internals/hooks/validation/models';
|
|
9
9
|
import { LocalizedComponent } from '../locales/utils/pickersLocaleTextApi';
|
|
10
10
|
import { DateTimePickerToolbarProps, ExportedDateTimePickerToolbarProps } from './DateTimePickerToolbar';
|
|
11
|
-
import { DateTimeValidationError } from '../internals/hooks/validation/useDateTimeValidation';
|
|
12
11
|
import { PickerViewRendererLookup } from '../internals/hooks/usePicker/usePickerViews';
|
|
13
12
|
import { DateViewRendererProps } from '../dateViewRenderers';
|
|
14
13
|
import { TimeViewRendererProps } from '../timeViewRenderers';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
|
|
2
2
|
import { BaseDatePickerProps, BaseDatePickerSlotsComponent, BaseDatePickerSlotsComponentsProps } from '../DatePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateView } from '../
|
|
4
|
+
import { DateView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface DesktopDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, DateView>, 'Field' | 'OpenPickerIcon'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
|
|
2
2
|
import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { DateOrTimeView } from '../
|
|
4
|
+
import { DateOrTimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface DesktopDateTimePickerSlotsComponent<TDate> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, DateOrTimeView>, 'Field' | 'OpenPickerIcon'> {
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
|
|
2
2
|
import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsComponentsProps } from '../TimePicker/shared';
|
|
3
3
|
import { MakeOptional } from '../internals/models/helpers';
|
|
4
|
-
import { TimeView } from '../
|
|
4
|
+
import { TimeView } from '../models';
|
|
5
5
|
import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
6
6
|
export interface DesktopTimePickerSlotsComponent<TDate> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, TimeView>, 'Field' | 'OpenPickerIcon'> {
|
|
7
7
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { MuiPickersAdapter } from '../internals/models';
|
|
2
|
+
import { AdapterFormats, MuiPickersAdapter } from '../models';
|
|
4
3
|
import { PickersInputLocaleText } from '../locales';
|
|
5
4
|
export interface MuiPickersAdapterContextValue<TDate> {
|
|
6
5
|
defaultDates: {
|
|
@@ -22,7 +21,7 @@ export interface LocalizationProviderProps<TDate> {
|
|
|
22
21
|
*/
|
|
23
22
|
dateAdapter?: new (...args: any) => MuiPickersAdapter<TDate>;
|
|
24
23
|
/** Formats that are used for any child pickers */
|
|
25
|
-
dateFormats?: Partial<
|
|
24
|
+
dateFormats?: Partial<AdapterFormats>;
|
|
26
25
|
/**
|
|
27
26
|
* Date library instance you are using, if it has some global overrides
|
|
28
27
|
* ```jsx
|