@mui/x-date-pickers 7.1.0 → 7.2.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/CHANGELOG.md +261 -4
- package/DateCalendar/DateCalendar.js +1 -1
- package/DateCalendar/DayCalendar.d.ts +1 -1
- package/DateField/DateField.js +1 -1
- package/DatePicker/DatePicker.js +1 -1
- package/DateTimeField/DateTimeField.js +2 -2
- package/DateTimeField/DateTimeField.types.d.ts +1 -1
- package/DateTimePicker/DateTimePicker.js +2 -2
- package/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +14 -5
- package/DesktopTimePicker/DesktopTimePicker.js +1 -1
- package/DigitalClock/DigitalClock.js +1 -1
- package/MobileDatePicker/MobileDatePicker.js +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/MobileTimePicker/MobileTimePicker.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
- package/PickersShortcuts/PickersShortcuts.d.ts +1 -1
- package/PickersShortcuts/PickersShortcuts.js +1 -1
- package/README.md +1 -1
- package/StaticDatePicker/StaticDatePicker.js +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/StaticTimePicker/StaticTimePicker.js +1 -1
- package/TimeClock/TimeClock.js +1 -1
- package/TimeField/TimeField.js +2 -2
- package/TimeField/TimeField.types.d.ts +1 -1
- package/TimePicker/TimePicker.js +1 -1
- package/index.js +1 -1
- package/internals/hooks/useField/useField.types.d.ts +1 -1
- package/internals/hooks/useField/useFieldV6TextField.js +3 -1
- package/internals/hooks/usePicker/usePickerValue.js +8 -2
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +4 -3
- package/internals/models/props/clock.d.ts +1 -1
- package/locales/deDE.js +14 -17
- package/locales/faIR.js +7 -8
- package/locales/frFR.js +16 -20
- package/locales/ptBR.js +14 -17
- package/locales/svSE.js +23 -28
- package/locales/ukUA.js +15 -19
- package/modern/DateCalendar/DateCalendar.js +1 -1
- package/modern/DateField/DateField.js +1 -1
- package/modern/DatePicker/DatePicker.js +1 -1
- package/modern/DateTimeField/DateTimeField.js +2 -2
- package/modern/DateTimePicker/DateTimePicker.js +2 -2
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +14 -5
- package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -1
- package/modern/DigitalClock/DigitalClock.js +1 -1
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/modern/MobileTimePicker/MobileTimePicker.js +1 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
- package/modern/PickersShortcuts/PickersShortcuts.js +1 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/modern/StaticTimePicker/StaticTimePicker.js +1 -1
- package/modern/TimeClock/TimeClock.js +1 -1
- package/modern/TimeField/TimeField.js +2 -2
- package/modern/TimePicker/TimePicker.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useField/useFieldV6TextField.js +3 -1
- package/modern/internals/hooks/usePicker/usePickerValue.js +8 -2
- package/modern/locales/deDE.js +14 -17
- package/modern/locales/faIR.js +7 -8
- package/modern/locales/frFR.js +16 -20
- package/modern/locales/ptBR.js +14 -17
- package/modern/locales/svSE.js +23 -28
- package/modern/locales/ukUA.js +15 -19
- package/node/DateCalendar/DateCalendar.js +1 -1
- package/node/DateField/DateField.js +1 -1
- package/node/DatePicker/DatePicker.js +1 -1
- package/node/DateTimeField/DateTimeField.js +2 -2
- package/node/DateTimePicker/DateTimePicker.js +2 -2
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +14 -5
- package/node/DesktopTimePicker/DesktopTimePicker.js +1 -1
- package/node/DigitalClock/DigitalClock.js +1 -1
- package/node/MobileDatePicker/MobileDatePicker.js +1 -1
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/node/MobileTimePicker/MobileTimePicker.js +1 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
- package/node/PickersShortcuts/PickersShortcuts.js +1 -1
- package/node/StaticDatePicker/StaticDatePicker.js +1 -1
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/node/StaticTimePicker/StaticTimePicker.js +1 -1
- package/node/TimeClock/TimeClock.js +1 -1
- package/node/TimeField/TimeField.js +2 -2
- package/node/TimePicker/TimePicker.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/hooks/useField/useFieldV6TextField.js +3 -1
- package/node/internals/hooks/usePicker/usePickerValue.js +8 -2
- package/node/locales/deDE.js +14 -17
- package/node/locales/faIR.js +7 -8
- package/node/locales/frFR.js +16 -20
- package/node/locales/ptBR.js +14 -17
- package/node/locales/svSE.js +23 -28
- package/node/locales/ukUA.js +15 -19
- package/package.json +2 -2
|
@@ -112,7 +112,8 @@ export const useFieldV6TextField = params => {
|
|
|
112
112
|
getActiveSectionIndexFromDOM: () => {
|
|
113
113
|
const browserStartIndex = inputRef.current.selectionStart ?? 0;
|
|
114
114
|
const browserEndIndex = inputRef.current.selectionEnd ?? 0;
|
|
115
|
-
|
|
115
|
+
const isInputReadOnly = !!inputRef.current?.readOnly;
|
|
116
|
+
if (browserStartIndex === 0 && browserEndIndex === 0 || isInputReadOnly) {
|
|
116
117
|
return null;
|
|
117
118
|
}
|
|
118
119
|
const nextSectionIndex = browserStartIndex <= sections[0].startInInput ? 1 // Special case if browser index is in invisible characters at the beginning.
|
|
@@ -128,6 +129,7 @@ export const useFieldV6TextField = params => {
|
|
|
128
129
|
}), [inputRef, parsedSelectedSections, sections, setSelectedSections]);
|
|
129
130
|
const syncSelectionFromDOM = () => {
|
|
130
131
|
if (readOnly) {
|
|
132
|
+
setSelectedSections(null);
|
|
131
133
|
return;
|
|
132
134
|
}
|
|
133
135
|
const browserStartIndex = inputRef.current.selectionStart ?? 0;
|
|
@@ -270,8 +270,14 @@ export const usePickerValue = ({
|
|
|
270
270
|
pickerAction: 'today'
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
|
-
const handleOpen = useEventCallback(
|
|
274
|
-
|
|
273
|
+
const handleOpen = useEventCallback(event => {
|
|
274
|
+
event.preventDefault();
|
|
275
|
+
setIsOpen(true);
|
|
276
|
+
});
|
|
277
|
+
const handleClose = useEventCallback(event => {
|
|
278
|
+
event?.preventDefault();
|
|
279
|
+
setIsOpen(false);
|
|
280
|
+
});
|
|
275
281
|
const handleChange = useEventCallback((newValue, selectionState = 'partial') => updateDate({
|
|
276
282
|
name: 'setValueFromView',
|
|
277
283
|
value: newValue,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FieldChangeHandlerContext, UseFieldInternalProps } from '../useField';
|
|
2
3
|
import { InferError, Validator } from '../useValidation';
|
|
3
4
|
import { UseFieldValidationProps } from '../useField/useField.types';
|
|
@@ -249,8 +250,8 @@ export interface UsePickerValueActions {
|
|
|
249
250
|
onDismiss: () => void;
|
|
250
251
|
onCancel: () => void;
|
|
251
252
|
onSetToday: () => void;
|
|
252
|
-
onOpen: () => void;
|
|
253
|
-
onClose: () => void;
|
|
253
|
+
onOpen: (event: React.UIEvent) => void;
|
|
254
|
+
onClose: (event?: React.UIEvent) => void;
|
|
254
255
|
}
|
|
255
256
|
export type UsePickerValueFieldResponse<TValue, TSection extends FieldSection, TError> = Required<Pick<UseFieldInternalProps<TValue, PickerValidDate, TSection, any, TError>, 'value' | 'onChange'>>;
|
|
256
257
|
/**
|
|
@@ -260,7 +261,7 @@ export interface UsePickerValueViewsResponse<TValue> {
|
|
|
260
261
|
value: TValue;
|
|
261
262
|
onChange: (value: TValue, selectionState?: PickerSelectionState) => void;
|
|
262
263
|
open: boolean;
|
|
263
|
-
onClose: () => void;
|
|
264
|
+
onClose: (event?: React.MouseEvent) => void;
|
|
264
265
|
}
|
|
265
266
|
/**
|
|
266
267
|
* Props passed to `usePickerLayoutProps`.
|
|
@@ -8,7 +8,7 @@ import { TimeViewWithMeridiem } from '../common';
|
|
|
8
8
|
export interface ExportedBaseClockProps<TDate extends PickerValidDate> extends TimeValidationProps<TDate>, BaseTimeValidationProps, TimezoneProps {
|
|
9
9
|
/**
|
|
10
10
|
* 12h/24h view for hour selection clock.
|
|
11
|
-
* @default
|
|
11
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
12
12
|
*/
|
|
13
13
|
ampm?: boolean;
|
|
14
14
|
}
|
package/locales/deDE.js
CHANGED
|
@@ -17,11 +17,10 @@ const deDEPickers = {
|
|
|
17
17
|
// DateRange labels
|
|
18
18
|
start: 'Beginn',
|
|
19
19
|
end: 'Ende',
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
startDate: 'Startdatum',
|
|
21
|
+
startTime: 'Startzeit',
|
|
22
|
+
endDate: 'Enddatum',
|
|
23
|
+
endTime: 'Endzeit',
|
|
25
24
|
// Action bar
|
|
26
25
|
cancelButtonLabel: 'Abbrechen',
|
|
27
26
|
clearButtonLabel: 'Löschen',
|
|
@@ -59,19 +58,17 @@ const deDEPickers = {
|
|
|
59
58
|
fieldHoursPlaceholder: () => 'hh',
|
|
60
59
|
fieldMinutesPlaceholder: () => 'mm',
|
|
61
60
|
fieldSecondsPlaceholder: () => 'ss',
|
|
62
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
63
|
-
|
|
61
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
64
62
|
// View names
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
year: 'Jahr',
|
|
64
|
+
month: 'Monat',
|
|
65
|
+
day: 'Tag',
|
|
66
|
+
weekDay: 'Wochentag',
|
|
67
|
+
hours: 'Stunden',
|
|
68
|
+
minutes: 'Minuten',
|
|
69
|
+
seconds: 'Sekunden',
|
|
70
|
+
meridiem: 'Tageszeit',
|
|
74
71
|
// Common
|
|
75
|
-
|
|
72
|
+
empty: 'Leer'
|
|
76
73
|
};
|
|
77
74
|
export const deDE = getPickersLocalization(deDEPickers);
|
package/locales/faIR.js
CHANGED
|
@@ -59,16 +59,15 @@ const faIRPickers = {
|
|
|
59
59
|
fieldHoursPlaceholder: () => 'hh',
|
|
60
60
|
fieldMinutesPlaceholder: () => 'mm',
|
|
61
61
|
fieldSecondsPlaceholder: () => 'ss',
|
|
62
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
63
|
-
|
|
62
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
64
63
|
// View names
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
year: 'سال',
|
|
65
|
+
month: 'ماه',
|
|
66
|
+
day: 'روز',
|
|
68
67
|
// weekDay: 'Week day',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
hours: 'ساعت ها',
|
|
69
|
+
minutes: 'دقیقه ها',
|
|
70
|
+
seconds: 'ثانیه ها'
|
|
72
71
|
// meridiem: 'Meridiem',
|
|
73
72
|
|
|
74
73
|
// Common
|
package/locales/frFR.js
CHANGED
|
@@ -16,11 +16,10 @@ const frFRPickers = {
|
|
|
16
16
|
// DateRange labels
|
|
17
17
|
start: 'Début',
|
|
18
18
|
end: 'Fin',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
startDate: 'Date de début',
|
|
20
|
+
startTime: 'Heure de début',
|
|
21
|
+
endDate: 'Date de fin',
|
|
22
|
+
endTime: 'Heure de fin',
|
|
24
23
|
// Action bar
|
|
25
24
|
cancelButtonLabel: 'Annuler',
|
|
26
25
|
clearButtonLabel: 'Vider',
|
|
@@ -46,8 +45,7 @@ const frFRPickers = {
|
|
|
46
45
|
// Open picker labels
|
|
47
46
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Choisir la date, la date sélectionnée est ${utils.format(value, 'fullDate')}` : 'Choisir la date',
|
|
48
47
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Choisir l'heure, l'heure sélectionnée est ${utils.format(value, 'fullTime')}` : "Choisir l'heure",
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
fieldClearLabel: 'Effacer la valeur',
|
|
51
49
|
// Table labels
|
|
52
50
|
timeTableLabel: "choix de l'heure",
|
|
53
51
|
dateTableLabel: 'choix de la date',
|
|
@@ -55,23 +53,21 @@ const frFRPickers = {
|
|
|
55
53
|
fieldYearPlaceholder: params => 'A'.repeat(params.digitAmount),
|
|
56
54
|
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
57
55
|
fieldDayPlaceholder: () => 'JJ',
|
|
58
|
-
|
|
56
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
59
57
|
fieldHoursPlaceholder: () => 'hh',
|
|
60
58
|
fieldMinutesPlaceholder: () => 'mm',
|
|
61
59
|
fieldSecondsPlaceholder: () => 'ss',
|
|
62
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
63
|
-
|
|
60
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
64
61
|
// View names
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
year: 'Année',
|
|
63
|
+
month: 'Mois',
|
|
64
|
+
day: 'Jour',
|
|
65
|
+
weekDay: 'Jour de la semaine',
|
|
66
|
+
hours: 'Heures',
|
|
67
|
+
minutes: 'Minutes',
|
|
68
|
+
seconds: 'Secondes',
|
|
69
|
+
meridiem: 'Méridien',
|
|
74
70
|
// Common
|
|
75
|
-
|
|
71
|
+
empty: 'Vider'
|
|
76
72
|
};
|
|
77
73
|
export const frFR = getPickersLocalization(frFRPickers);
|
package/locales/ptBR.js
CHANGED
|
@@ -16,11 +16,10 @@ const ptBRPickers = {
|
|
|
16
16
|
// DateRange labels
|
|
17
17
|
start: 'Início',
|
|
18
18
|
end: 'Fim',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
startDate: 'Data de início',
|
|
20
|
+
startTime: 'Hora de início',
|
|
21
|
+
endDate: 'Data de Término',
|
|
22
|
+
endTime: 'Hora de Término',
|
|
24
23
|
// Action bar
|
|
25
24
|
cancelButtonLabel: 'Cancelar',
|
|
26
25
|
clearButtonLabel: 'Limpar',
|
|
@@ -59,19 +58,17 @@ const ptBRPickers = {
|
|
|
59
58
|
fieldHoursPlaceholder: () => 'hh',
|
|
60
59
|
fieldMinutesPlaceholder: () => 'mm',
|
|
61
60
|
fieldSecondsPlaceholder: () => 'ss',
|
|
62
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
63
|
-
|
|
61
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
64
62
|
// View names
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
year: 'Ano',
|
|
64
|
+
month: 'Mês',
|
|
65
|
+
day: 'Dia',
|
|
66
|
+
weekDay: 'Dia da Semana',
|
|
67
|
+
hours: 'Horas',
|
|
68
|
+
minutes: 'Minutos',
|
|
69
|
+
seconds: 'Segundos',
|
|
70
|
+
meridiem: 'Meio dia',
|
|
74
71
|
// Common
|
|
75
|
-
|
|
72
|
+
empty: 'Vazio'
|
|
76
73
|
};
|
|
77
74
|
export const ptBR = getPickersLocalization(ptBRPickers);
|
package/locales/svSE.js
CHANGED
|
@@ -16,11 +16,10 @@ const svSEPickers = {
|
|
|
16
16
|
// DateRange labels
|
|
17
17
|
start: 'Start',
|
|
18
18
|
end: 'Slut',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
startDate: 'Startdatum',
|
|
20
|
+
startTime: 'Starttid',
|
|
21
|
+
endDate: 'Slutdatum',
|
|
22
|
+
endTime: 'Sluttid',
|
|
24
23
|
// Action bar
|
|
25
24
|
cancelButtonLabel: 'Avbryt',
|
|
26
25
|
clearButtonLabel: 'Rensa',
|
|
@@ -46,33 +45,29 @@ const svSEPickers = {
|
|
|
46
45
|
// Open picker labels
|
|
47
46
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Välj datum, valt datum är ${utils.format(value, 'fullDate')}` : 'Välj datum',
|
|
48
47
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Välj tid, vald tid är ${utils.format(value, 'fullTime')}` : 'Välj tid',
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
fieldClearLabel: 'Rensa värde',
|
|
51
49
|
// Table labels
|
|
52
50
|
timeTableLabel: 'välj tid',
|
|
53
|
-
dateTableLabel: 'välj datum'
|
|
54
|
-
|
|
51
|
+
dateTableLabel: 'välj datum',
|
|
55
52
|
// Field section placeholders
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
fieldYearPlaceholder: params => 'Å'.repeat(params.digitAmount),
|
|
54
|
+
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
55
|
+
fieldDayPlaceholder: () => 'DD',
|
|
56
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
57
|
+
fieldHoursPlaceholder: () => 'tt',
|
|
58
|
+
fieldMinutesPlaceholder: () => 'mm',
|
|
59
|
+
fieldSecondsPlaceholder: () => 'ss',
|
|
60
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
65
61
|
// View names
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
year: 'År',
|
|
63
|
+
month: 'Månad',
|
|
64
|
+
day: 'Dag',
|
|
65
|
+
weekDay: 'Veckodag',
|
|
66
|
+
hours: 'Timmar',
|
|
67
|
+
minutes: 'Minuter',
|
|
68
|
+
seconds: 'Sekunder',
|
|
69
|
+
meridiem: 'Meridiem',
|
|
75
70
|
// Common
|
|
76
|
-
|
|
71
|
+
empty: 'Tom'
|
|
77
72
|
};
|
|
78
73
|
export const svSE = getPickersLocalization(svSEPickers);
|
package/locales/ukUA.js
CHANGED
|
@@ -16,11 +16,10 @@ const ukUAPickers = {
|
|
|
16
16
|
// DateRange labels
|
|
17
17
|
start: 'Початок',
|
|
18
18
|
end: 'Кінець',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
startDate: 'День початку',
|
|
20
|
+
startTime: 'Час початку',
|
|
21
|
+
endDate: 'День закінчення',
|
|
22
|
+
endTime: 'Час закінчення',
|
|
24
23
|
// Action bar
|
|
25
24
|
cancelButtonLabel: 'Відміна',
|
|
26
25
|
clearButtonLabel: 'Очистити',
|
|
@@ -46,8 +45,7 @@ const ukUAPickers = {
|
|
|
46
45
|
// Open picker labels
|
|
47
46
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Оберіть дату, обрана дата ${utils.format(value, 'fullDate')}` : 'Оберіть дату',
|
|
48
47
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Оберіть час, обраний час ${utils.format(value, 'fullTime')}` : 'Оберіть час',
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
fieldClearLabel: 'Очистити дані',
|
|
51
49
|
// Table labels
|
|
52
50
|
timeTableLabel: 'оберіть час',
|
|
53
51
|
dateTableLabel: 'оберіть дату',
|
|
@@ -59,19 +57,17 @@ const ukUAPickers = {
|
|
|
59
57
|
fieldHoursPlaceholder: () => 'hh',
|
|
60
58
|
fieldMinutesPlaceholder: () => 'mm',
|
|
61
59
|
fieldSecondsPlaceholder: () => 'ss',
|
|
62
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
63
|
-
|
|
60
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
64
61
|
// View names
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
year: 'Рік',
|
|
63
|
+
month: 'Місяць',
|
|
64
|
+
day: 'День',
|
|
65
|
+
weekDay: 'День тижня',
|
|
66
|
+
hours: 'Годин',
|
|
67
|
+
minutes: 'Хвилин',
|
|
68
|
+
seconds: 'Секунд',
|
|
69
|
+
meridiem: 'Меридіем',
|
|
74
70
|
// Common
|
|
75
|
-
|
|
71
|
+
empty: 'Порожній'
|
|
76
72
|
};
|
|
77
73
|
export const ukUA = getPickersLocalization(ukUAPickers);
|
|
@@ -363,7 +363,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
363
363
|
* Formats the day of week displayed in the calendar header.
|
|
364
364
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
365
365
|
* @returns {string} The name to display.
|
|
366
|
-
* @default (
|
|
366
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
367
367
|
*/
|
|
368
368
|
dayOfWeekFormatter: PropTypes.func,
|
|
369
369
|
/**
|
|
@@ -274,7 +274,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
274
274
|
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
275
275
|
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
276
276
|
*
|
|
277
|
-
* @default
|
|
277
|
+
* @default false
|
|
278
278
|
*/
|
|
279
279
|
shouldRespectLeadingZeros: PropTypes.bool,
|
|
280
280
|
/**
|
|
@@ -65,7 +65,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
65
65
|
* Formats the day of week displayed in the calendar header.
|
|
66
66
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
67
67
|
* @returns {string} The name to display.
|
|
68
|
-
* @default (
|
|
68
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
69
69
|
*/
|
|
70
70
|
dayOfWeekFormatter: PropTypes.func,
|
|
71
71
|
/**
|
|
@@ -64,7 +64,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
64
64
|
// ----------------------------------------------------------------------
|
|
65
65
|
/**
|
|
66
66
|
* 12h/24h view for hour selection clock.
|
|
67
|
-
* @default
|
|
67
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
68
68
|
*/
|
|
69
69
|
ampm: PropTypes.bool,
|
|
70
70
|
/**
|
|
@@ -315,7 +315,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
315
315
|
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
316
316
|
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
317
317
|
*
|
|
318
|
-
* @default
|
|
318
|
+
* @default false
|
|
319
319
|
*/
|
|
320
320
|
shouldRespectLeadingZeros: PropTypes.bool,
|
|
321
321
|
/**
|
|
@@ -50,7 +50,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
50
50
|
// ----------------------------------------------------------------------
|
|
51
51
|
/**
|
|
52
52
|
* 12h/24h view for hour selection clock.
|
|
53
|
-
* @default
|
|
53
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
54
54
|
*/
|
|
55
55
|
ampm: PropTypes.bool,
|
|
56
56
|
/**
|
|
@@ -75,7 +75,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
75
75
|
* Formats the day of week displayed in the calendar header.
|
|
76
76
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
77
77
|
* @returns {string} The name to display.
|
|
78
|
-
* @default (
|
|
78
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
79
79
|
*/
|
|
80
80
|
dayOfWeekFormatter: PropTypes.func,
|
|
81
81
|
/**
|
|
@@ -86,7 +86,7 @@ DesktopDatePicker.propTypes = {
|
|
|
86
86
|
* Formats the day of week displayed in the calendar header.
|
|
87
87
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
88
88
|
* @returns {string} The name to display.
|
|
89
|
-
* @default (
|
|
89
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
90
90
|
*/
|
|
91
91
|
dayOfWeekFormatter: PropTypes.func,
|
|
92
92
|
/**
|
|
@@ -46,15 +46,24 @@ const rendererInterceptor = function rendererInterceptor(inViewRenderers, popper
|
|
|
46
46
|
children: [inViewRenderers[!isTimeViewActive ? popperView : 'day']?.(_extends({}, rendererProps, {
|
|
47
47
|
view: !isTimeViewActive ? popperView : 'day',
|
|
48
48
|
focusedView: focusedView && isDatePickerView(focusedView) ? focusedView : null,
|
|
49
|
-
views: rendererProps.views.filter(isDatePickerView)
|
|
49
|
+
views: rendererProps.views.filter(isDatePickerView),
|
|
50
|
+
sx: [{
|
|
51
|
+
gridColumn: 1
|
|
52
|
+
}, ...finalProps.sx]
|
|
50
53
|
})), timeViewsCount > 0 && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
51
54
|
children: [/*#__PURE__*/_jsx(Divider, {
|
|
52
|
-
orientation: "vertical"
|
|
55
|
+
orientation: "vertical",
|
|
56
|
+
sx: {
|
|
57
|
+
gridColumn: 2
|
|
58
|
+
}
|
|
53
59
|
}), inViewRenderers[isTimeViewActive ? popperView : 'hours']?.(_extends({}, finalProps, {
|
|
54
60
|
view: isTimeViewActive ? popperView : 'hours',
|
|
55
61
|
focusedView: focusedView && isInternalTimeView(focusedView) ? focusedView : null,
|
|
56
62
|
openTo: isInternalTimeView(openTo) ? openTo : 'hours',
|
|
57
|
-
views: rendererProps.views.filter(isInternalTimeView)
|
|
63
|
+
views: rendererProps.views.filter(isInternalTimeView),
|
|
64
|
+
sx: [{
|
|
65
|
+
gridColumn: 3
|
|
66
|
+
}, ...finalProps.sx]
|
|
58
67
|
}))]
|
|
59
68
|
})]
|
|
60
69
|
});
|
|
@@ -148,7 +157,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
148
157
|
// ----------------------------------------------------------------------
|
|
149
158
|
/**
|
|
150
159
|
* 12h/24h view for hour selection clock.
|
|
151
|
-
* @default
|
|
160
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
152
161
|
*/
|
|
153
162
|
ampm: PropTypes.bool,
|
|
154
163
|
/**
|
|
@@ -173,7 +182,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
173
182
|
* Formats the day of week displayed in the calendar header.
|
|
174
183
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
175
184
|
* @returns {string} The name to display.
|
|
176
|
-
* @default (
|
|
185
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
177
186
|
*/
|
|
178
187
|
dayOfWeekFormatter: PropTypes.func,
|
|
179
188
|
/**
|
|
@@ -92,7 +92,7 @@ DesktopTimePicker.propTypes = {
|
|
|
92
92
|
// ----------------------------------------------------------------------
|
|
93
93
|
/**
|
|
94
94
|
* 12h/24h view for hour selection clock.
|
|
95
|
-
* @default
|
|
95
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
96
96
|
*/
|
|
97
97
|
ampm: PropTypes.bool,
|
|
98
98
|
/**
|
|
@@ -274,7 +274,7 @@ process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
|
|
|
274
274
|
// ----------------------------------------------------------------------
|
|
275
275
|
/**
|
|
276
276
|
* 12h/24h view for hour selection clock.
|
|
277
|
-
* @default
|
|
277
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
278
278
|
*/
|
|
279
279
|
ampm: PropTypes.bool,
|
|
280
280
|
/**
|
|
@@ -83,7 +83,7 @@ MobileDatePicker.propTypes = {
|
|
|
83
83
|
* Formats the day of week displayed in the calendar header.
|
|
84
84
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
85
85
|
* @returns {string} The name to display.
|
|
86
|
-
* @default (
|
|
86
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
87
87
|
*/
|
|
88
88
|
dayOfWeekFormatter: PropTypes.func,
|
|
89
89
|
/**
|
|
@@ -78,7 +78,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
78
78
|
// ----------------------------------------------------------------------
|
|
79
79
|
/**
|
|
80
80
|
* 12h/24h view for hour selection clock.
|
|
81
|
-
* @default
|
|
81
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
82
82
|
*/
|
|
83
83
|
ampm: PropTypes.bool,
|
|
84
84
|
/**
|
|
@@ -103,7 +103,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
103
103
|
* Formats the day of week displayed in the calendar header.
|
|
104
104
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
105
105
|
* @returns {string} The name to display.
|
|
106
|
-
* @default (
|
|
106
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
107
107
|
*/
|
|
108
108
|
dayOfWeekFormatter: PropTypes.func,
|
|
109
109
|
/**
|
|
@@ -71,7 +71,7 @@ MobileTimePicker.propTypes = {
|
|
|
71
71
|
// ----------------------------------------------------------------------
|
|
72
72
|
/**
|
|
73
73
|
* 12h/24h view for hour selection clock.
|
|
74
|
-
* @default
|
|
74
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
75
75
|
*/
|
|
76
76
|
ampm: PropTypes.bool,
|
|
77
77
|
/**
|
|
@@ -331,7 +331,7 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
331
331
|
// ----------------------------------------------------------------------
|
|
332
332
|
/**
|
|
333
333
|
* 12h/24h view for hour selection clock.
|
|
334
|
-
* @default
|
|
334
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
335
335
|
*/
|
|
336
336
|
ampm: PropTypes.bool,
|
|
337
337
|
/**
|
|
@@ -91,7 +91,7 @@ process.env.NODE_ENV !== "production" ? PickersShortcuts.propTypes = {
|
|
|
91
91
|
/**
|
|
92
92
|
* Ordered array of shortcuts to display.
|
|
93
93
|
* If empty, does not display the shortcuts.
|
|
94
|
-
* @default
|
|
94
|
+
* @default []
|
|
95
95
|
*/
|
|
96
96
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
97
97
|
getValue: PropTypes.func.isRequired,
|
|
@@ -64,7 +64,7 @@ StaticDatePicker.propTypes = {
|
|
|
64
64
|
* Formats the day of week displayed in the calendar header.
|
|
65
65
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
66
66
|
* @returns {string} The name to display.
|
|
67
|
-
* @default (
|
|
67
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
68
68
|
*/
|
|
69
69
|
dayOfWeekFormatter: PropTypes.func,
|
|
70
70
|
/**
|
|
@@ -64,7 +64,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
64
64
|
// ----------------------------------------------------------------------
|
|
65
65
|
/**
|
|
66
66
|
* 12h/24h view for hour selection clock.
|
|
67
|
-
* @default
|
|
67
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
68
68
|
*/
|
|
69
69
|
ampm: PropTypes.bool,
|
|
70
70
|
/**
|
|
@@ -84,7 +84,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
84
84
|
* Formats the day of week displayed in the calendar header.
|
|
85
85
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
86
86
|
* @returns {string} The name to display.
|
|
87
|
-
* @default (
|
|
87
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
88
88
|
*/
|
|
89
89
|
dayOfWeekFormatter: PropTypes.func,
|
|
90
90
|
/**
|
|
@@ -56,7 +56,7 @@ StaticTimePicker.propTypes = {
|
|
|
56
56
|
// ----------------------------------------------------------------------
|
|
57
57
|
/**
|
|
58
58
|
* 12h/24h view for hour selection clock.
|
|
59
|
-
* @default
|
|
59
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
60
60
|
*/
|
|
61
61
|
ampm: PropTypes.bool,
|
|
62
62
|
/**
|
|
@@ -317,7 +317,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
317
317
|
// ----------------------------------------------------------------------
|
|
318
318
|
/**
|
|
319
319
|
* 12h/24h view for hour selection clock.
|
|
320
|
-
* @default
|
|
320
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
321
321
|
*/
|
|
322
322
|
ampm: PropTypes.bool,
|
|
323
323
|
/**
|