@mui/x-date-pickers 7.1.0 → 7.1.1
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 +175 -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 +2 -2
- 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/models/props/clock.d.ts +1 -1
- package/locales/faIR.js +7 -8
- package/locales/ptBR.js +14 -17
- 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 +2 -2
- 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/locales/faIR.js +7 -8
- package/modern/locales/ptBR.js +14 -17
- 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 +2 -2
- 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/locales/faIR.js +7 -8
- package/node/locales/ptBR.js +14 -17
- package/node/locales/ukUA.js +15 -19
- package/package.json +2 -2
|
@@ -100,7 +100,7 @@ process.env.NODE_ENV !== "production" ? PickersShortcuts.propTypes = {
|
|
|
100
100
|
/**
|
|
101
101
|
* Ordered array of shortcuts to display.
|
|
102
102
|
* If empty, does not display the shortcuts.
|
|
103
|
-
* @default
|
|
103
|
+
* @default []
|
|
104
104
|
*/
|
|
105
105
|
items: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
106
106
|
getValue: _propTypes.default.func.isRequired,
|
|
@@ -73,7 +73,7 @@ StaticDatePicker.propTypes = {
|
|
|
73
73
|
* Formats the day of week displayed in the calendar header.
|
|
74
74
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
75
75
|
* @returns {string} The name to display.
|
|
76
|
-
* @default (
|
|
76
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
77
77
|
*/
|
|
78
78
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
79
79
|
/**
|
|
@@ -73,7 +73,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
73
73
|
// ----------------------------------------------------------------------
|
|
74
74
|
/**
|
|
75
75
|
* 12h/24h view for hour selection clock.
|
|
76
|
-
* @default
|
|
76
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
77
77
|
*/
|
|
78
78
|
ampm: _propTypes.default.bool,
|
|
79
79
|
/**
|
|
@@ -93,7 +93,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
93
93
|
* Formats the day of week displayed in the calendar header.
|
|
94
94
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
95
95
|
* @returns {string} The name to display.
|
|
96
|
-
* @default (
|
|
96
|
+
* @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
97
97
|
*/
|
|
98
98
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
99
99
|
/**
|
|
@@ -65,7 +65,7 @@ StaticTimePicker.propTypes = {
|
|
|
65
65
|
// ----------------------------------------------------------------------
|
|
66
66
|
/**
|
|
67
67
|
* 12h/24h view for hour selection clock.
|
|
68
|
-
* @default
|
|
68
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
69
69
|
*/
|
|
70
70
|
ampm: _propTypes.default.bool,
|
|
71
71
|
/**
|
|
@@ -325,7 +325,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
325
325
|
// ----------------------------------------------------------------------
|
|
326
326
|
/**
|
|
327
327
|
* 12h/24h view for hour selection clock.
|
|
328
|
-
* @default
|
|
328
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
329
329
|
*/
|
|
330
330
|
ampm: _propTypes.default.bool,
|
|
331
331
|
/**
|
|
@@ -73,7 +73,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
73
73
|
// ----------------------------------------------------------------------
|
|
74
74
|
/**
|
|
75
75
|
* 12h/24h view for hour selection clock.
|
|
76
|
-
* @default
|
|
76
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
77
77
|
*/
|
|
78
78
|
ampm: _propTypes.default.bool,
|
|
79
79
|
/**
|
|
@@ -284,7 +284,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
284
284
|
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
285
285
|
* 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.
|
|
286
286
|
*
|
|
287
|
-
* @default
|
|
287
|
+
* @default false
|
|
288
288
|
*/
|
|
289
289
|
shouldRespectLeadingZeros: _propTypes.default.bool,
|
|
290
290
|
/**
|
|
@@ -59,7 +59,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
59
59
|
// ----------------------------------------------------------------------
|
|
60
60
|
/**
|
|
61
61
|
* 12h/24h view for hour selection clock.
|
|
62
|
-
* @default
|
|
62
|
+
* @default utils.is12HourCycleInCurrentLocale()
|
|
63
63
|
*/
|
|
64
64
|
ampm: _propTypes.default.bool,
|
|
65
65
|
/**
|
package/node/index.js
CHANGED
|
@@ -122,7 +122,8 @@ const useFieldV6TextField = params => {
|
|
|
122
122
|
getActiveSectionIndexFromDOM: () => {
|
|
123
123
|
const browserStartIndex = inputRef.current.selectionStart ?? 0;
|
|
124
124
|
const browserEndIndex = inputRef.current.selectionEnd ?? 0;
|
|
125
|
-
|
|
125
|
+
const isInputReadOnly = !!inputRef.current?.readOnly;
|
|
126
|
+
if (browserStartIndex === 0 && browserEndIndex === 0 || isInputReadOnly) {
|
|
126
127
|
return null;
|
|
127
128
|
}
|
|
128
129
|
const nextSectionIndex = browserStartIndex <= sections[0].startInInput ? 1 // Special case if browser index is in invisible characters at the beginning.
|
|
@@ -138,6 +139,7 @@ const useFieldV6TextField = params => {
|
|
|
138
139
|
}), [inputRef, parsedSelectedSections, sections, setSelectedSections]);
|
|
139
140
|
const syncSelectionFromDOM = () => {
|
|
140
141
|
if (readOnly) {
|
|
142
|
+
setSelectedSections(null);
|
|
141
143
|
return;
|
|
142
144
|
}
|
|
143
145
|
const browserStartIndex = inputRef.current.selectionStart ?? 0;
|
package/node/locales/faIR.js
CHANGED
|
@@ -65,16 +65,15 @@ const faIRPickers = {
|
|
|
65
65
|
fieldHoursPlaceholder: () => 'hh',
|
|
66
66
|
fieldMinutesPlaceholder: () => 'mm',
|
|
67
67
|
fieldSecondsPlaceholder: () => 'ss',
|
|
68
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
69
|
-
|
|
68
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
70
69
|
// View names
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
year: 'سال',
|
|
71
|
+
month: 'ماه',
|
|
72
|
+
day: 'روز',
|
|
74
73
|
// weekDay: 'Week day',
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
hours: 'ساعت ها',
|
|
75
|
+
minutes: 'دقیقه ها',
|
|
76
|
+
seconds: 'ثانیه ها'
|
|
78
77
|
// meridiem: 'Meridiem',
|
|
79
78
|
|
|
80
79
|
// Common
|
package/node/locales/ptBR.js
CHANGED
|
@@ -22,11 +22,10 @@ const ptBRPickers = {
|
|
|
22
22
|
// DateRange labels
|
|
23
23
|
start: 'Início',
|
|
24
24
|
end: 'Fim',
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
startDate: 'Data de início',
|
|
26
|
+
startTime: 'Hora de início',
|
|
27
|
+
endDate: 'Data de Término',
|
|
28
|
+
endTime: 'Hora de Término',
|
|
30
29
|
// Action bar
|
|
31
30
|
cancelButtonLabel: 'Cancelar',
|
|
32
31
|
clearButtonLabel: 'Limpar',
|
|
@@ -65,19 +64,17 @@ const ptBRPickers = {
|
|
|
65
64
|
fieldHoursPlaceholder: () => 'hh',
|
|
66
65
|
fieldMinutesPlaceholder: () => 'mm',
|
|
67
66
|
fieldSecondsPlaceholder: () => 'ss',
|
|
68
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
69
|
-
|
|
67
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
70
68
|
// View names
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
year: 'Ano',
|
|
70
|
+
month: 'Mês',
|
|
71
|
+
day: 'Dia',
|
|
72
|
+
weekDay: 'Dia da Semana',
|
|
73
|
+
hours: 'Horas',
|
|
74
|
+
minutes: 'Minutos',
|
|
75
|
+
seconds: 'Segundos',
|
|
76
|
+
meridiem: 'Meio dia',
|
|
80
77
|
// Common
|
|
81
|
-
|
|
78
|
+
empty: 'Vazio'
|
|
82
79
|
};
|
|
83
80
|
const ptBR = exports.ptBR = (0, _getPickersLocalization.getPickersLocalization)(ptBRPickers);
|
package/node/locales/ukUA.js
CHANGED
|
@@ -22,11 +22,10 @@ const ukUAPickers = {
|
|
|
22
22
|
// DateRange labels
|
|
23
23
|
start: 'Початок',
|
|
24
24
|
end: 'Кінець',
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
startDate: 'День початку',
|
|
26
|
+
startTime: 'Час початку',
|
|
27
|
+
endDate: 'День закінчення',
|
|
28
|
+
endTime: 'Час закінчення',
|
|
30
29
|
// Action bar
|
|
31
30
|
cancelButtonLabel: 'Відміна',
|
|
32
31
|
clearButtonLabel: 'Очистити',
|
|
@@ -52,8 +51,7 @@ const ukUAPickers = {
|
|
|
52
51
|
// Open picker labels
|
|
53
52
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Оберіть дату, обрана дата ${utils.format(value, 'fullDate')}` : 'Оберіть дату',
|
|
54
53
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Оберіть час, обраний час ${utils.format(value, 'fullTime')}` : 'Оберіть час',
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
fieldClearLabel: 'Очистити дані',
|
|
57
55
|
// Table labels
|
|
58
56
|
timeTableLabel: 'оберіть час',
|
|
59
57
|
dateTableLabel: 'оберіть дату',
|
|
@@ -65,19 +63,17 @@ const ukUAPickers = {
|
|
|
65
63
|
fieldHoursPlaceholder: () => 'hh',
|
|
66
64
|
fieldMinutesPlaceholder: () => 'mm',
|
|
67
65
|
fieldSecondsPlaceholder: () => 'ss',
|
|
68
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
69
|
-
|
|
66
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
70
67
|
// View names
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
68
|
+
year: 'Рік',
|
|
69
|
+
month: 'Місяць',
|
|
70
|
+
day: 'День',
|
|
71
|
+
weekDay: 'День тижня',
|
|
72
|
+
hours: 'Годин',
|
|
73
|
+
minutes: 'Хвилин',
|
|
74
|
+
seconds: 'Секунд',
|
|
75
|
+
meridiem: 'Меридіем',
|
|
80
76
|
// Common
|
|
81
|
-
|
|
77
|
+
empty: 'Порожній'
|
|
82
78
|
};
|
|
83
79
|
const ukUA = exports.ukUA = (0, _getPickersLocalization.getPickersLocalization)(ukUAPickers);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "7.1.
|
|
4
|
-
"description": "The community edition of the
|
|
3
|
+
"version": "7.1.1",
|
|
4
|
+
"description": "The community edition of the Date and Time Picker components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
7
7
|
"license": "MIT",
|