@mui/x-date-pickers 7.18.0 → 7.20.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/AdapterDateFnsBase/AdapterDateFnsBase.js +1 -0
- package/AdapterMoment/AdapterMoment.js +1 -0
- package/CHANGELOG.md +213 -11
- package/DateCalendar/DateCalendar.js +1 -1
- package/DateCalendar/DateCalendar.types.d.ts +1 -1
- package/DateField/DateField.types.d.ts +2 -7
- package/DateField/index.d.ts +1 -1
- package/DateField/useDateField.d.ts +1 -1
- package/DatePicker/DatePicker.js +1 -1
- package/DatePicker/DatePicker.types.d.ts +8 -1
- package/DatePicker/index.d.ts +1 -1
- package/DateTimeField/DateTimeField.types.d.ts +2 -7
- package/DateTimeField/index.d.ts +1 -1
- package/DateTimeField/useDateTimeField.d.ts +1 -1
- package/DateTimePicker/DateTimePicker.js +1 -1
- package/DateTimePicker/DateTimePicker.types.d.ts +9 -1
- package/DateTimePicker/index.d.ts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -1
- package/DigitalClock/DigitalClock.js +39 -0
- package/MobileDatePicker/MobileDatePicker.js +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +38 -1
- package/PickersCalendarHeader/PickersCalendarHeader.js +1 -1
- package/PickersLayout/PickersLayout.d.ts +2 -2
- package/PickersLayout/PickersLayout.js +1 -1
- package/PickersSectionList/PickersSectionList.d.ts +4 -4
- package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +2 -2
- package/StaticDatePicker/StaticDatePicker.js +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/TimeClock/Clock.js +9 -1
- package/TimeClock/ClockNumber.js +1 -1
- package/TimeClock/ClockPointer.js +1 -1
- package/TimeField/TimeField.types.d.ts +2 -7
- package/TimeField/index.d.ts +1 -1
- package/TimeField/useTimeField.d.ts +1 -1
- package/TimePicker/TimePicker.types.d.ts +9 -1
- package/TimePicker/index.d.ts +1 -1
- package/YearCalendar/YearCalendar.js +1 -1
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +3 -1
- package/hooks/useParsedFormat.d.ts +15 -0
- package/hooks/useParsedFormat.js +43 -0
- package/hooks/usePickersContext.d.ts +4 -0
- package/hooks/usePickersContext.js +15 -0
- package/index.js +1 -1
- package/internals/components/PickerViewRoot/PickerViewRoot.d.ts +1 -1
- package/internals/components/PickersProvider.d.ts +34 -0
- package/internals/components/PickersProvider.js +26 -0
- package/internals/components/PickersToolbarButton.js +1 -1
- package/internals/components/PickersToolbarText.js +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +7 -4
- package/internals/hooks/useField/buildSectionsFromFormat.d.ts +1 -2
- package/internals/hooks/useField/buildSectionsFromFormat.js +4 -5
- package/internals/hooks/useField/useField.utils.d.ts +3 -3
- package/internals/hooks/useField/useField.utils.js +13 -13
- package/internals/hooks/useField/useFieldCharacterEditing.js +2 -2
- package/internals/hooks/useField/useFieldState.js +3 -5
- package/internals/hooks/useMobilePicker/useMobilePicker.js +7 -4
- package/internals/hooks/usePicker/usePicker.js +3 -1
- package/internals/hooks/usePicker/usePickerValue.js +7 -2
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +2 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/internals/utils/utils.d.ts +7 -0
- package/internals/utils/utils.js +11 -0
- package/locales/bgBG.d.ts +80 -0
- package/locales/bgBG.js +73 -0
- package/locales/csCZ.js +16 -20
- package/locales/hrHR.d.ts +80 -0
- package/locales/hrHR.js +90 -0
- package/locales/index.d.ts +3 -0
- package/locales/index.js +3 -0
- package/locales/ptBR.js +3 -4
- package/locales/ptPT.d.ts +80 -0
- package/locales/ptPT.js +73 -0
- package/models/pickers.d.ts +1 -1
- package/modern/AdapterDateFnsBase/AdapterDateFnsBase.js +1 -0
- package/modern/AdapterMoment/AdapterMoment.js +1 -0
- package/modern/DateCalendar/DateCalendar.js +1 -1
- package/modern/DatePicker/DatePicker.js +1 -1
- package/modern/DateTimePicker/DateTimePicker.js +1 -1
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -1
- package/modern/DigitalClock/DigitalClock.js +39 -0
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +38 -1
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +1 -1
- package/modern/PickersLayout/PickersLayout.js +1 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/modern/TimeClock/Clock.js +9 -1
- package/modern/TimeClock/ClockNumber.js +1 -1
- package/modern/TimeClock/ClockPointer.js +1 -1
- package/modern/YearCalendar/YearCalendar.js +1 -1
- package/modern/hooks/index.js +3 -1
- package/modern/hooks/useParsedFormat.js +43 -0
- package/modern/hooks/usePickersContext.js +15 -0
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersProvider.js +26 -0
- package/modern/internals/components/PickersToolbarButton.js +1 -1
- package/modern/internals/components/PickersToolbarText.js +1 -1
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +7 -4
- package/modern/internals/hooks/useField/buildSectionsFromFormat.js +4 -5
- package/modern/internals/hooks/useField/useField.utils.js +13 -13
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +2 -2
- package/modern/internals/hooks/useField/useFieldState.js +3 -5
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +7 -4
- package/modern/internals/hooks/usePicker/usePicker.js +3 -1
- package/modern/internals/hooks/usePicker/usePickerValue.js +7 -2
- package/modern/internals/index.js +1 -0
- package/modern/internals/utils/utils.js +11 -0
- package/modern/locales/bgBG.js +73 -0
- package/modern/locales/csCZ.js +16 -20
- package/modern/locales/hrHR.js +90 -0
- package/modern/locales/index.js +3 -0
- package/modern/locales/ptBR.js +3 -4
- package/modern/locales/ptPT.js +73 -0
- package/node/AdapterDateFnsBase/AdapterDateFnsBase.js +1 -0
- package/node/AdapterMoment/AdapterMoment.js +1 -0
- package/node/DateCalendar/DateCalendar.js +1 -1
- package/node/DatePicker/DatePicker.js +1 -1
- package/node/DateTimePicker/DateTimePicker.js +1 -1
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -1
- package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -1
- package/node/DigitalClock/DigitalClock.js +39 -0
- package/node/MobileDatePicker/MobileDatePicker.js +1 -1
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +38 -1
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +1 -1
- package/node/PickersLayout/PickersLayout.js +1 -1
- package/node/StaticDatePicker/StaticDatePicker.js +1 -1
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/node/TimeClock/Clock.js +9 -1
- package/node/TimeClock/ClockNumber.js +1 -1
- package/node/TimeClock/ClockPointer.js +1 -1
- package/node/YearCalendar/YearCalendar.js +1 -1
- package/node/hooks/index.js +15 -1
- package/node/hooks/useParsedFormat.js +50 -0
- package/node/hooks/usePickersContext.js +21 -0
- package/node/index.js +1 -1
- package/node/internals/components/PickersProvider.js +34 -0
- package/node/internals/components/PickersToolbarButton.js +1 -1
- package/node/internals/components/PickersToolbarText.js +1 -1
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +5 -3
- package/node/internals/hooks/useField/buildSectionsFromFormat.js +4 -5
- package/node/internals/hooks/useField/useField.utils.js +13 -13
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +2 -2
- package/node/internals/hooks/useField/useFieldState.js +3 -5
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +5 -3
- package/node/internals/hooks/usePicker/usePicker.js +3 -1
- package/node/internals/hooks/usePicker/usePickerValue.js +7 -1
- package/node/internals/index.js +7 -0
- package/node/internals/utils/utils.js +13 -1
- package/node/locales/bgBG.js +79 -0
- package/node/locales/csCZ.js +16 -20
- package/node/locales/hrHR.js +96 -0
- package/node/locales/index.js +33 -0
- package/node/locales/ptBR.js +3 -4
- package/node/locales/ptPT.js +79 -0
- package/package.json +4 -4
package/locales/hrHR.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { getPickersLocalization } from "./utils/getPickersLocalization.js";
|
|
2
|
+
// maps TimeView to its translation
|
|
3
|
+
const timeViews = {
|
|
4
|
+
hours: 'sati',
|
|
5
|
+
minutes: 'minute',
|
|
6
|
+
seconds: 'sekunde',
|
|
7
|
+
meridiem: 'meridiem'
|
|
8
|
+
};
|
|
9
|
+
const hrHRPickers = {
|
|
10
|
+
// Calendar navigation
|
|
11
|
+
previousMonth: 'Prethodni mjesec',
|
|
12
|
+
nextMonth: 'Naredni mjesec',
|
|
13
|
+
// View navigation
|
|
14
|
+
openPreviousView: 'Otvori prethodni prikaz',
|
|
15
|
+
openNextView: 'Otvori naredni prikaz',
|
|
16
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'Otvoren je godišnji prikaz, promijeni na kalendarski prikaz' : 'Otvoren je kalendarski prikaz, promijeni na godišnji prikaz',
|
|
17
|
+
// DateRange labels
|
|
18
|
+
start: 'Početak',
|
|
19
|
+
end: 'Kraj',
|
|
20
|
+
startDate: 'Početni datum',
|
|
21
|
+
startTime: 'Početno vrijeme',
|
|
22
|
+
endDate: 'Krajnji datum',
|
|
23
|
+
endTime: 'Krajnje vrijeme',
|
|
24
|
+
// Action bar
|
|
25
|
+
cancelButtonLabel: 'Otkaži',
|
|
26
|
+
clearButtonLabel: 'Izbriši',
|
|
27
|
+
okButtonLabel: 'U redu',
|
|
28
|
+
todayButtonLabel: 'Danas',
|
|
29
|
+
// Toolbar titles
|
|
30
|
+
datePickerToolbarTitle: 'Odaberi datum',
|
|
31
|
+
dateTimePickerToolbarTitle: 'Odaberi datum i vrijeme',
|
|
32
|
+
timePickerToolbarTitle: 'Odaberi vrijeme',
|
|
33
|
+
dateRangePickerToolbarTitle: 'Odaberi vremenski okvir',
|
|
34
|
+
// Clock labels
|
|
35
|
+
clockLabelText: (view, time, utils, formattedTime) => `Odaberi ${timeViews[view] ?? view}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Vrijeme nije odabrano' : `Odabrano vrijeme je ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
36
|
+
hoursClockNumberText: hours => {
|
|
37
|
+
let suffix = 'sati';
|
|
38
|
+
if (Number(hours) === 1) {
|
|
39
|
+
suffix = 'sat';
|
|
40
|
+
} else if (Number(hours) < 5) {
|
|
41
|
+
suffix = 'sata';
|
|
42
|
+
}
|
|
43
|
+
return `${hours} ${suffix}`;
|
|
44
|
+
},
|
|
45
|
+
minutesClockNumberText: minutes => `${minutes} ${Number(minutes) > 1 && Number(minutes) < 5 ? 'minute' : 'minuta'}`,
|
|
46
|
+
secondsClockNumberText: seconds => {
|
|
47
|
+
let suffix = 'sekundi';
|
|
48
|
+
if (Number(seconds) === 1) {
|
|
49
|
+
suffix = 'sekunda';
|
|
50
|
+
} else if (Number(seconds) < 5) {
|
|
51
|
+
suffix = 'sekunde';
|
|
52
|
+
}
|
|
53
|
+
return `${seconds} ${suffix}`;
|
|
54
|
+
},
|
|
55
|
+
// Digital clock labels
|
|
56
|
+
selectViewText: view => `Odaberi ${timeViews[view]}`,
|
|
57
|
+
// Calendar labels
|
|
58
|
+
calendarWeekNumberHeaderLabel: 'Broj tjedna',
|
|
59
|
+
calendarWeekNumberHeaderText: '#',
|
|
60
|
+
calendarWeekNumberAriaLabelText: weekNumber => `Tjedan ${weekNumber}`,
|
|
61
|
+
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
62
|
+
// Open picker labels
|
|
63
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Odaberi datum, odabrani datum je ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Odaberi datum',
|
|
64
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Odaberi vrijeme, odabrano vrijeme je ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Odaberi vrijeme',
|
|
65
|
+
fieldClearLabel: 'Izbriši',
|
|
66
|
+
// Table labels
|
|
67
|
+
timeTableLabel: 'Odaberi vrijeme',
|
|
68
|
+
dateTableLabel: 'Odaberi datum',
|
|
69
|
+
// Field section placeholders
|
|
70
|
+
fieldYearPlaceholder: params => 'G'.repeat(params.digitAmount),
|
|
71
|
+
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
72
|
+
fieldDayPlaceholder: () => 'DD',
|
|
73
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
74
|
+
fieldHoursPlaceholder: () => 'hh',
|
|
75
|
+
fieldMinutesPlaceholder: () => 'mm',
|
|
76
|
+
fieldSecondsPlaceholder: () => 'ss',
|
|
77
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
78
|
+
// View names
|
|
79
|
+
year: 'Godina',
|
|
80
|
+
month: 'Mjesec',
|
|
81
|
+
day: 'Dan',
|
|
82
|
+
weekDay: 'Dan u tjednu',
|
|
83
|
+
hours: 'Sati',
|
|
84
|
+
minutes: 'Minute',
|
|
85
|
+
seconds: 'Sekunde',
|
|
86
|
+
meridiem: 'Meridiem',
|
|
87
|
+
// Common
|
|
88
|
+
empty: 'Isprazni'
|
|
89
|
+
};
|
|
90
|
+
export const hrHR = getPickersLocalization(hrHRPickers);
|
package/locales/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './beBY';
|
|
2
|
+
export * from './bgBG';
|
|
2
3
|
export * from './caES';
|
|
3
4
|
export * from './csCZ';
|
|
4
5
|
export * from './daDK';
|
|
@@ -11,6 +12,7 @@ export * from './faIR';
|
|
|
11
12
|
export * from './fiFI';
|
|
12
13
|
export * from './frFR';
|
|
13
14
|
export * from './heIL';
|
|
15
|
+
export * from './hrHR';
|
|
14
16
|
export * from './huHU';
|
|
15
17
|
export * from './isIS';
|
|
16
18
|
export * from './itIT';
|
|
@@ -23,6 +25,7 @@ export * from './nlNL';
|
|
|
23
25
|
export * from './nnNO';
|
|
24
26
|
export * from './plPL';
|
|
25
27
|
export * from './ptBR';
|
|
28
|
+
export * from './ptPT';
|
|
26
29
|
export * from './roRO';
|
|
27
30
|
export * from './ruRU';
|
|
28
31
|
export * from './skSK';
|
package/locales/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./beBY.js";
|
|
2
|
+
export * from "./bgBG.js";
|
|
2
3
|
export * from "./caES.js";
|
|
3
4
|
export * from "./csCZ.js";
|
|
4
5
|
export * from "./daDK.js";
|
|
@@ -11,6 +12,7 @@ export * from "./faIR.js";
|
|
|
11
12
|
export * from "./fiFI.js";
|
|
12
13
|
export * from "./frFR.js";
|
|
13
14
|
export * from "./heIL.js";
|
|
15
|
+
export * from "./hrHR.js";
|
|
14
16
|
export * from "./huHU.js";
|
|
15
17
|
export * from "./isIS.js";
|
|
16
18
|
export * from "./itIT.js";
|
|
@@ -23,6 +25,7 @@ export * from "./nlNL.js";
|
|
|
23
25
|
export * from "./nnNO.js";
|
|
24
26
|
export * from "./plPL.js";
|
|
25
27
|
export * from "./ptBR.js";
|
|
28
|
+
export * from "./ptPT.js";
|
|
26
29
|
export * from "./roRO.js";
|
|
27
30
|
export * from "./ruRU.js";
|
|
28
31
|
export * from "./skSK.js";
|
package/locales/ptBR.js
CHANGED
|
@@ -10,8 +10,8 @@ const ptBRPickers = {
|
|
|
10
10
|
previousMonth: 'Mês anterior',
|
|
11
11
|
nextMonth: 'Próximo mês',
|
|
12
12
|
// View navigation
|
|
13
|
-
openPreviousView: 'Abrir
|
|
14
|
-
openNextView: 'Abrir seleção
|
|
13
|
+
openPreviousView: 'Abrir seleção anterior',
|
|
14
|
+
openNextView: 'Abrir próxima seleção',
|
|
15
15
|
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'Seleção de ano está aberta, alternando para seleção de calendário' : 'Seleção de calendários está aberta, alternando para seleção de ano',
|
|
16
16
|
// DateRange labels
|
|
17
17
|
start: 'Início',
|
|
@@ -45,8 +45,7 @@ const ptBRPickers = {
|
|
|
45
45
|
// Open picker labels
|
|
46
46
|
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Escolha uma data, data selecionada ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Escolha uma data',
|
|
47
47
|
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Escolha uma hora, hora selecionada ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Escolha uma hora',
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
fieldClearLabel: 'Limpar valor',
|
|
50
49
|
// Table labels
|
|
51
50
|
timeTableLabel: 'escolha uma hora',
|
|
52
51
|
dateTableLabel: 'escolha uma data',
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { TimeViewWithMeridiem } from '../internals/models';
|
|
2
|
+
export declare const ptPT: {
|
|
3
|
+
components: {
|
|
4
|
+
MuiLocalizationProvider: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
localeText: {
|
|
7
|
+
previousMonth?: string | undefined;
|
|
8
|
+
nextMonth?: string | undefined;
|
|
9
|
+
calendarWeekNumberHeaderLabel?: string | undefined;
|
|
10
|
+
calendarWeekNumberHeaderText?: string | undefined;
|
|
11
|
+
calendarWeekNumberAriaLabelText?: ((weekNumber: number) => string) | undefined;
|
|
12
|
+
calendarWeekNumberText?: ((weekNumber: number) => string) | undefined;
|
|
13
|
+
openPreviousView?: string | undefined;
|
|
14
|
+
openNextView?: string | undefined;
|
|
15
|
+
calendarViewSwitchingButtonAriaLabel?: ((currentView: import("@mui/x-date-pickers/models").DateView) => string) | undefined;
|
|
16
|
+
start?: string | undefined;
|
|
17
|
+
end?: string | undefined;
|
|
18
|
+
startDate?: string | undefined;
|
|
19
|
+
startTime?: string | undefined;
|
|
20
|
+
endDate?: string | undefined;
|
|
21
|
+
endTime?: string | undefined;
|
|
22
|
+
cancelButtonLabel?: string | undefined;
|
|
23
|
+
clearButtonLabel?: string | undefined;
|
|
24
|
+
okButtonLabel?: string | undefined;
|
|
25
|
+
todayButtonLabel?: string | undefined;
|
|
26
|
+
clockLabelText?: ((view: import("@mui/x-date-pickers/models").TimeView, time: any, utils: import("@mui/x-date-pickers/models").MuiPickersAdapter<any, any>, formattedTime?: string | null) => string) | undefined;
|
|
27
|
+
hoursClockNumberText?: ((hours: string) => string) | undefined;
|
|
28
|
+
minutesClockNumberText?: ((minutes: string) => string) | undefined;
|
|
29
|
+
secondsClockNumberText?: ((seconds: string) => string) | undefined;
|
|
30
|
+
selectViewText?: ((view: TimeViewWithMeridiem) => string) | undefined;
|
|
31
|
+
openDatePickerDialogue?: ((date: any, utils: import("@mui/x-date-pickers/models").MuiPickersAdapter<any, any>, formattedDate: string | null) => string) | undefined;
|
|
32
|
+
openTimePickerDialogue?: ((date: any, utils: import("@mui/x-date-pickers/models").MuiPickersAdapter<any, any>, formattedTime: string | null) => string) | undefined;
|
|
33
|
+
fieldClearLabel?: string | undefined;
|
|
34
|
+
timeTableLabel?: string | undefined;
|
|
35
|
+
dateTableLabel?: string | undefined;
|
|
36
|
+
fieldYearPlaceholder?: ((params: {
|
|
37
|
+
digitAmount: number;
|
|
38
|
+
format: string;
|
|
39
|
+
}) => string) | undefined;
|
|
40
|
+
fieldMonthPlaceholder?: ((params: {
|
|
41
|
+
contentType: import("@mui/x-date-pickers/models").FieldSectionContentType;
|
|
42
|
+
format: string;
|
|
43
|
+
}) => string) | undefined;
|
|
44
|
+
fieldDayPlaceholder?: ((params: {
|
|
45
|
+
format: string;
|
|
46
|
+
}) => string) | undefined;
|
|
47
|
+
fieldWeekDayPlaceholder?: ((params: {
|
|
48
|
+
contentType: import("@mui/x-date-pickers/models").FieldSectionContentType;
|
|
49
|
+
format: string;
|
|
50
|
+
}) => string) | undefined;
|
|
51
|
+
fieldHoursPlaceholder?: ((params: {
|
|
52
|
+
format: string;
|
|
53
|
+
}) => string) | undefined;
|
|
54
|
+
fieldMinutesPlaceholder?: ((params: {
|
|
55
|
+
format: string;
|
|
56
|
+
}) => string) | undefined;
|
|
57
|
+
fieldSecondsPlaceholder?: ((params: {
|
|
58
|
+
format: string;
|
|
59
|
+
}) => string) | undefined;
|
|
60
|
+
fieldMeridiemPlaceholder?: ((params: {
|
|
61
|
+
format: string;
|
|
62
|
+
}) => string) | undefined;
|
|
63
|
+
year?: string | undefined;
|
|
64
|
+
month?: string | undefined;
|
|
65
|
+
day?: string | undefined;
|
|
66
|
+
weekDay?: string | undefined;
|
|
67
|
+
hours?: string | undefined;
|
|
68
|
+
minutes?: string | undefined;
|
|
69
|
+
seconds?: string | undefined;
|
|
70
|
+
meridiem?: string | undefined;
|
|
71
|
+
empty?: string | undefined;
|
|
72
|
+
datePickerToolbarTitle?: string | undefined;
|
|
73
|
+
timePickerToolbarTitle?: string | undefined;
|
|
74
|
+
dateTimePickerToolbarTitle?: string | undefined;
|
|
75
|
+
dateRangePickerToolbarTitle?: string | undefined;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
package/locales/ptPT.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { getPickersLocalization } from "./utils/getPickersLocalization.js";
|
|
2
|
+
const timeViews = {
|
|
3
|
+
hours: 'horas',
|
|
4
|
+
minutes: 'minutos',
|
|
5
|
+
seconds: 'segundos',
|
|
6
|
+
meridiem: 'meridiano'
|
|
7
|
+
};
|
|
8
|
+
const ptPTPickers = {
|
|
9
|
+
// Calendar navigation
|
|
10
|
+
previousMonth: 'Mês anterior',
|
|
11
|
+
nextMonth: 'Próximo mês',
|
|
12
|
+
// View navigation
|
|
13
|
+
openPreviousView: 'Abrir seleção anterior',
|
|
14
|
+
openNextView: 'Abrir próxima seleção',
|
|
15
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'A seleção do ano está aberta, altere para a seleção do calendário' : 'A seleção do calendários está aberta, altere para a seleção do ano',
|
|
16
|
+
// DateRange labels
|
|
17
|
+
start: 'Início',
|
|
18
|
+
end: 'Fim',
|
|
19
|
+
startDate: 'Data de início',
|
|
20
|
+
startTime: 'Hora de início',
|
|
21
|
+
endDate: 'Data de fim',
|
|
22
|
+
endTime: 'Hora de fim',
|
|
23
|
+
// Action bar
|
|
24
|
+
cancelButtonLabel: 'Cancelar',
|
|
25
|
+
clearButtonLabel: 'Limpar',
|
|
26
|
+
okButtonLabel: 'OK',
|
|
27
|
+
todayButtonLabel: 'Hoje',
|
|
28
|
+
// Toolbar titles
|
|
29
|
+
datePickerToolbarTitle: 'Selecione a data',
|
|
30
|
+
dateTimePickerToolbarTitle: 'Selecione a data e a hora',
|
|
31
|
+
timePickerToolbarTitle: 'Selecione a hora',
|
|
32
|
+
dateRangePickerToolbarTitle: 'Selecione o intervalo de datas',
|
|
33
|
+
// Clock labels
|
|
34
|
+
clockLabelText: (view, time, utils, formattedTime) => `Selecione ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Hora não selecionada' : `Selecionado a hora ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
|
|
35
|
+
hoursClockNumberText: hours => `${hours} horas`,
|
|
36
|
+
minutesClockNumberText: minutes => `${minutes} minutos`,
|
|
37
|
+
secondsClockNumberText: seconds => `${seconds} segundos`,
|
|
38
|
+
// Digital clock labels
|
|
39
|
+
selectViewText: view => `Selecione ${timeViews[view]}`,
|
|
40
|
+
// Calendar labels
|
|
41
|
+
calendarWeekNumberHeaderLabel: 'Número da semana',
|
|
42
|
+
calendarWeekNumberHeaderText: 'N.º',
|
|
43
|
+
calendarWeekNumberAriaLabelText: weekNumber => `Semana ${weekNumber}`,
|
|
44
|
+
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
45
|
+
// Open picker labels
|
|
46
|
+
openDatePickerDialogue: (value, utils, formattedDate) => formattedDate || value !== null && utils.isValid(value) ? `Escolha uma data, a data selecionada é ${formattedDate ?? utils.format(value, 'fullDate')}` : 'Escolha uma data',
|
|
47
|
+
openTimePickerDialogue: (value, utils, formattedTime) => formattedTime || value !== null && utils.isValid(value) ? `Escolha uma hora, a hora selecionada é ${formattedTime ?? utils.format(value, 'fullTime')}` : 'Escolha uma hora',
|
|
48
|
+
fieldClearLabel: 'Limpar valor',
|
|
49
|
+
// Table labels
|
|
50
|
+
timeTableLabel: 'escolha uma hora',
|
|
51
|
+
dateTableLabel: 'escolha uma data',
|
|
52
|
+
// Field section placeholders
|
|
53
|
+
fieldYearPlaceholder: params => 'A'.repeat(params.digitAmount),
|
|
54
|
+
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
55
|
+
fieldDayPlaceholder: () => 'DD',
|
|
56
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'SSSS' : 'SS',
|
|
57
|
+
fieldHoursPlaceholder: () => 'hh',
|
|
58
|
+
fieldMinutesPlaceholder: () => 'mm',
|
|
59
|
+
fieldSecondsPlaceholder: () => 'ss',
|
|
60
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
61
|
+
// View names
|
|
62
|
+
year: 'Ano',
|
|
63
|
+
month: 'Mês',
|
|
64
|
+
day: 'Dia',
|
|
65
|
+
weekDay: 'Dia da Semana',
|
|
66
|
+
hours: 'Horas',
|
|
67
|
+
minutes: 'Minutos',
|
|
68
|
+
seconds: 'Segundos',
|
|
69
|
+
meridiem: 'Meridiano',
|
|
70
|
+
// Common
|
|
71
|
+
empty: 'Vazio'
|
|
72
|
+
};
|
|
73
|
+
export const ptPT = getPickersLocalization(ptPTPickers);
|
package/models/pickers.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export interface PickerChangeHandlerContext<TError> {
|
|
|
9
9
|
}
|
|
10
10
|
export interface PickerValidDateLookup {
|
|
11
11
|
}
|
|
12
|
-
export type PickerValidDate = PickerValidDateLookup[keyof PickerValidDateLookup];
|
|
12
|
+
export type PickerValidDate = keyof PickerValidDateLookup extends never ? any : PickerValidDateLookup[keyof PickerValidDateLookup];
|
|
@@ -487,7 +487,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
487
487
|
/**
|
|
488
488
|
* Component displaying when passed `loading` true.
|
|
489
489
|
* @returns {React.ReactNode} The node to render when loading.
|
|
490
|
-
* @default () => <span
|
|
490
|
+
* @default () => <span>...</span>
|
|
491
491
|
*/
|
|
492
492
|
renderLoading: PropTypes.func,
|
|
493
493
|
/**
|
|
@@ -256,7 +256,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
256
256
|
/**
|
|
257
257
|
* Component displaying when passed `loading` true.
|
|
258
258
|
* @returns {React.ReactNode} The node to render when loading.
|
|
259
|
-
* @default () => <span
|
|
259
|
+
* @default () => <span>...</span>
|
|
260
260
|
*/
|
|
261
261
|
renderLoading: PropTypes.func,
|
|
262
262
|
/**
|
|
@@ -294,7 +294,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
294
294
|
/**
|
|
295
295
|
* Component displaying when passed `loading` true.
|
|
296
296
|
* @returns {React.ReactNode} The node to render when loading.
|
|
297
|
-
* @default () => <span
|
|
297
|
+
* @default () => <span>...</span>
|
|
298
298
|
*/
|
|
299
299
|
renderLoading: PropTypes.func,
|
|
300
300
|
/**
|
|
@@ -277,7 +277,7 @@ DesktopDatePicker.propTypes = {
|
|
|
277
277
|
/**
|
|
278
278
|
* Component displaying when passed `loading` true.
|
|
279
279
|
* @returns {React.ReactNode} The node to render when loading.
|
|
280
|
-
* @default () => <span
|
|
280
|
+
* @default () => <span>...</span>
|
|
281
281
|
*/
|
|
282
282
|
renderLoading: PropTypes.func,
|
|
283
283
|
/**
|
|
@@ -402,7 +402,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
402
402
|
/**
|
|
403
403
|
* Component displaying when passed `loading` true.
|
|
404
404
|
* @returns {React.ReactNode} The node to render when loading.
|
|
405
|
-
* @default () => <span
|
|
405
|
+
* @default () => <span>...</span>
|
|
406
406
|
*/
|
|
407
407
|
renderLoading: PropTypes.func,
|
|
408
408
|
/**
|
|
@@ -30,7 +30,7 @@ const DesktopDateTimePickerLayout = /*#__PURE__*/React.forwardRef(function Deskt
|
|
|
30
30
|
});
|
|
31
31
|
return /*#__PURE__*/_jsxs(PickersLayoutRoot, {
|
|
32
32
|
ref: ref,
|
|
33
|
-
className: clsx(
|
|
33
|
+
className: clsx(pickersLayoutClasses.root, classes?.root, className),
|
|
34
34
|
sx: [{
|
|
35
35
|
[`& .${pickersLayoutClasses.tabs}`]: {
|
|
36
36
|
gridRow: 4,
|
|
@@ -23,6 +23,7 @@ import { DIGITAL_CLOCK_VIEW_HEIGHT } from "../internals/constants/dimensions.js"
|
|
|
23
23
|
import { useControlledValueWithTimezone } from "../internals/hooks/useValueWithTimezone.js";
|
|
24
24
|
import { singleItemValueManager } from "../internals/utils/valueManagers.js";
|
|
25
25
|
import { useClockReferenceDate } from "../internals/hooks/useClockReferenceDate.js";
|
|
26
|
+
import { getFocusedListItemIndex } from "../internals/utils/utils.js";
|
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
28
|
const useUtilityClasses = ownerState => {
|
|
28
29
|
const {
|
|
@@ -104,6 +105,7 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
104
105
|
const utils = useUtils();
|
|
105
106
|
const containerRef = React.useRef(null);
|
|
106
107
|
const handleRef = useForkRef(ref, containerRef);
|
|
108
|
+
const listRef = React.useRef(null);
|
|
107
109
|
const props = useThemeProps({
|
|
108
110
|
props: inProps,
|
|
109
111
|
name: 'MuiDigitalClock'
|
|
@@ -236,15 +238,52 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
236
238
|
}, (_, index) => utils.addMinutes(startOfDay, timeStep * (index + 1)))];
|
|
237
239
|
}, [valueOrReferenceDate, timeStep, utils]);
|
|
238
240
|
const focusedOptionIndex = timeOptions.findIndex(option => utils.isEqual(option, valueOrReferenceDate));
|
|
241
|
+
const handleKeyDown = event => {
|
|
242
|
+
switch (event.key) {
|
|
243
|
+
case 'PageUp':
|
|
244
|
+
{
|
|
245
|
+
if (!listRef.current) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const newIndex = getFocusedListItemIndex(listRef.current) - 5;
|
|
249
|
+
const children = listRef.current?.children;
|
|
250
|
+
const newFocusedIndex = Math.max(0, newIndex);
|
|
251
|
+
const childToFocus = children[newFocusedIndex];
|
|
252
|
+
if (childToFocus) {
|
|
253
|
+
childToFocus.focus();
|
|
254
|
+
}
|
|
255
|
+
event.preventDefault();
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
case 'PageDown':
|
|
259
|
+
{
|
|
260
|
+
if (!listRef.current) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const newIndex = getFocusedListItemIndex(listRef.current) + 5;
|
|
264
|
+
const children = listRef.current?.children;
|
|
265
|
+
const newFocusedIndex = Math.min(children.length - 1, newIndex);
|
|
266
|
+
const childToFocus = children[newFocusedIndex];
|
|
267
|
+
if (childToFocus) {
|
|
268
|
+
childToFocus.focus();
|
|
269
|
+
}
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
default:
|
|
274
|
+
}
|
|
275
|
+
};
|
|
239
276
|
return /*#__PURE__*/_jsx(DigitalClockRoot, _extends({
|
|
240
277
|
ref: handleRef,
|
|
241
278
|
className: clsx(classes.root, className),
|
|
242
279
|
ownerState: ownerState
|
|
243
280
|
}, other, {
|
|
244
281
|
children: /*#__PURE__*/_jsx(DigitalClockList, {
|
|
282
|
+
ref: listRef,
|
|
245
283
|
role: "listbox",
|
|
246
284
|
"aria-label": translations.timePickerToolbarTitle,
|
|
247
285
|
className: classes.list,
|
|
286
|
+
onKeyDown: handleKeyDown,
|
|
248
287
|
children: timeOptions.map((option, index) => {
|
|
249
288
|
if (skipDisabled && isTimeDisabled(option)) {
|
|
250
289
|
return null;
|
|
@@ -274,7 +274,7 @@ MobileDatePicker.propTypes = {
|
|
|
274
274
|
/**
|
|
275
275
|
* Component displaying when passed `loading` true.
|
|
276
276
|
* @returns {React.ReactNode} The node to render when loading.
|
|
277
|
-
* @default () => <span
|
|
277
|
+
* @default () => <span>...</span>
|
|
278
278
|
*/
|
|
279
279
|
renderLoading: PropTypes.func,
|
|
280
280
|
/**
|
|
@@ -322,7 +322,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
322
322
|
/**
|
|
323
323
|
* Component displaying when passed `loading` true.
|
|
324
324
|
* @returns {React.ReactNode} The node to render when loading.
|
|
325
|
-
* @default () => <span
|
|
325
|
+
* @default () => <span>...</span>
|
|
326
326
|
*/
|
|
327
327
|
renderLoading: PropTypes.func,
|
|
328
328
|
/**
|
|
@@ -10,6 +10,7 @@ import MenuItem from '@mui/material/MenuItem';
|
|
|
10
10
|
import useForkRef from '@mui/utils/useForkRef';
|
|
11
11
|
import { getMultiSectionDigitalClockSectionUtilityClass } from "./multiSectionDigitalClockSectionClasses.js";
|
|
12
12
|
import { DIGITAL_CLOCK_VIEW_HEIGHT, MULTI_SECTION_CLOCK_SECTION_WIDTH } from "../internals/constants/dimensions.js";
|
|
13
|
+
import { getFocusedListItemIndex } from "../internals/utils/utils.js";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
const useUtilityClasses = ownerState => {
|
|
15
16
|
const {
|
|
@@ -138,12 +139,48 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
138
139
|
containerRef.current.scrollTop = offsetTop - 4;
|
|
139
140
|
});
|
|
140
141
|
const focusedOptionIndex = items.findIndex(item => item.isFocused(item.value));
|
|
142
|
+
const handleKeyDown = event => {
|
|
143
|
+
switch (event.key) {
|
|
144
|
+
case 'PageUp':
|
|
145
|
+
{
|
|
146
|
+
if (!containerRef.current) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const newIndex = getFocusedListItemIndex(containerRef.current) - 5;
|
|
150
|
+
const children = containerRef.current?.children;
|
|
151
|
+
const newFocusedIndex = Math.max(0, newIndex);
|
|
152
|
+
const childToFocus = children[newFocusedIndex];
|
|
153
|
+
if (childToFocus) {
|
|
154
|
+
childToFocus.focus();
|
|
155
|
+
}
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
case 'PageDown':
|
|
160
|
+
{
|
|
161
|
+
if (!containerRef.current) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const newIndex = getFocusedListItemIndex(containerRef.current) + 5;
|
|
165
|
+
const children = containerRef.current?.children;
|
|
166
|
+
const newFocusedIndex = Math.min(children.length - 1, newIndex);
|
|
167
|
+
const childToFocus = children[newFocusedIndex];
|
|
168
|
+
if (childToFocus) {
|
|
169
|
+
childToFocus.focus();
|
|
170
|
+
}
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
default:
|
|
175
|
+
}
|
|
176
|
+
};
|
|
141
177
|
return /*#__PURE__*/_jsx(MultiSectionDigitalClockSectionRoot, _extends({
|
|
142
178
|
ref: handleRef,
|
|
143
179
|
className: clsx(classes.root, className),
|
|
144
180
|
ownerState: ownerState,
|
|
145
181
|
autoFocusItem: autoFocus && active,
|
|
146
|
-
role: "listbox"
|
|
182
|
+
role: "listbox",
|
|
183
|
+
onKeyDown: handleKeyDown
|
|
147
184
|
}, other, {
|
|
148
185
|
children: items.map((option, index) => {
|
|
149
186
|
const isItemDisabled = option.isDisabled?.(option.value);
|
|
@@ -190,7 +190,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
190
190
|
const label = utils.formatByString(month, format);
|
|
191
191
|
return /*#__PURE__*/_jsxs(PickersCalendarHeaderRoot, _extends({}, other, {
|
|
192
192
|
ownerState: ownerState,
|
|
193
|
-
className: clsx(
|
|
193
|
+
className: clsx(classes.root, className),
|
|
194
194
|
ref: ref,
|
|
195
195
|
children: [/*#__PURE__*/_jsxs(PickersCalendarHeaderLabelContainer, {
|
|
196
196
|
role: "presentation",
|
|
@@ -122,7 +122,7 @@ const PickersLayout = /*#__PURE__*/React.forwardRef(function PickersLayout(inPro
|
|
|
122
122
|
return /*#__PURE__*/_jsxs(PickersLayoutRoot, {
|
|
123
123
|
ref: ref,
|
|
124
124
|
sx: sx,
|
|
125
|
-
className: clsx(
|
|
125
|
+
className: clsx(classes.root, className),
|
|
126
126
|
ownerState: props,
|
|
127
127
|
children: [isLandscape ? shortcuts : toolbar, isLandscape ? toolbar : shortcuts, /*#__PURE__*/_jsx(PickersLayoutContentWrapper, {
|
|
128
128
|
className: classes.contentWrapper,
|
|
@@ -208,7 +208,7 @@ StaticDatePicker.propTypes = {
|
|
|
208
208
|
/**
|
|
209
209
|
* Component displaying when passed `loading` true.
|
|
210
210
|
* @returns {React.ReactNode} The node to render when loading.
|
|
211
|
-
* @default () => <span
|
|
211
|
+
* @default () => <span>...</span>
|
|
212
212
|
*/
|
|
213
213
|
renderLoading: PropTypes.func,
|
|
214
214
|
/**
|
|
@@ -256,7 +256,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
256
256
|
/**
|
|
257
257
|
* Component displaying when passed `loading` true.
|
|
258
258
|
* @returns {React.ReactNode} The node to render when loading.
|
|
259
|
-
* @default () => <span
|
|
259
|
+
* @default () => <span>...</span>
|
|
260
260
|
*/
|
|
261
261
|
renderLoading: PropTypes.func,
|
|
262
262
|
/**
|
|
@@ -274,6 +274,14 @@ export function Clock(inProps) {
|
|
|
274
274
|
handleValueChange(viewValue - keyboardControlStep, 'partial');
|
|
275
275
|
event.preventDefault();
|
|
276
276
|
break;
|
|
277
|
+
case 'PageUp':
|
|
278
|
+
handleValueChange(viewValue + 5, 'partial');
|
|
279
|
+
event.preventDefault();
|
|
280
|
+
break;
|
|
281
|
+
case 'PageDown':
|
|
282
|
+
handleValueChange(viewValue - 5, 'partial');
|
|
283
|
+
event.preventDefault();
|
|
284
|
+
break;
|
|
277
285
|
case 'Enter':
|
|
278
286
|
case ' ':
|
|
279
287
|
handleValueChange(viewValue, 'finish');
|
|
@@ -284,7 +292,7 @@ export function Clock(inProps) {
|
|
|
284
292
|
}
|
|
285
293
|
};
|
|
286
294
|
return /*#__PURE__*/_jsxs(ClockRoot, {
|
|
287
|
-
className: clsx(
|
|
295
|
+
className: clsx(classes.root, className),
|
|
288
296
|
children: [/*#__PURE__*/_jsxs(ClockClock, {
|
|
289
297
|
className: classes.clock,
|
|
290
298
|
children: [/*#__PURE__*/_jsx(ClockSquareMask, {
|
|
@@ -84,7 +84,7 @@ export function ClockNumber(inProps) {
|
|
|
84
84
|
const x = Math.round(Math.cos(angle) * length);
|
|
85
85
|
const y = Math.round(Math.sin(angle) * length);
|
|
86
86
|
return /*#__PURE__*/_jsx(ClockNumberRoot, _extends({
|
|
87
|
-
className: clsx(
|
|
87
|
+
className: clsx(classes.root, className),
|
|
88
88
|
"aria-disabled": disabled ? true : undefined,
|
|
89
89
|
"aria-selected": selected ? true : undefined,
|
|
90
90
|
role: "option",
|
|
@@ -102,7 +102,7 @@ export function ClockPointer(inProps) {
|
|
|
102
102
|
};
|
|
103
103
|
return /*#__PURE__*/_jsx(ClockPointerRoot, _extends({
|
|
104
104
|
style: getAngleStyle(),
|
|
105
|
-
className: clsx(
|
|
105
|
+
className: clsx(classes.root, className),
|
|
106
106
|
ownerState: ownerState
|
|
107
107
|
}, other, {
|
|
108
108
|
children: /*#__PURE__*/_jsx(ClockPointerThumb, {
|
|
@@ -179,7 +179,7 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
179
179
|
setFocusedYear(prevFocusedYear => selectedYear !== null && prevFocusedYear !== selectedYear ? selectedYear : prevFocusedYear);
|
|
180
180
|
}, [selectedYear]);
|
|
181
181
|
const verticalDirection = yearsOrder !== 'desc' ? yearsPerRow * 1 : yearsPerRow * -1;
|
|
182
|
-
const horizontalDirection = isRtl || yearsOrder === 'desc' ? -1 : 1;
|
|
182
|
+
const horizontalDirection = isRtl && yearsOrder === 'asc' || !isRtl && yearsOrder === 'desc' ? -1 : 1;
|
|
183
183
|
const handleKeyDown = useEventCallback((event, year) => {
|
|
184
184
|
switch (event.key) {
|
|
185
185
|
case 'ArrowUp':
|
package/modern/hooks/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { useClearableField } from "./useClearableField.js";
|
|
2
2
|
export { usePickersTranslations } from "./usePickersTranslations.js";
|
|
3
|
-
export { useSplitFieldProps } from "./useSplitFieldProps.js";
|
|
3
|
+
export { useSplitFieldProps } from "./useSplitFieldProps.js";
|
|
4
|
+
export { useParsedFormat } from "./useParsedFormat.js";
|
|
5
|
+
export { usePickersContext } from "./usePickersContext.js";
|