@mui/x-date-pickers 5.0.2 → 6.0.0-alpha.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 +212 -3
- package/CalendarPicker/CalendarPicker.d.ts +8 -2
- package/CalendarPicker/CalendarPicker.js +54 -71
- package/CalendarPicker/DayPicker.d.ts +2 -2
- package/CalendarPicker/DayPicker.js +6 -2
- package/CalendarPicker/PickersCalendarHeader.d.ts +3 -10
- package/CalendarPicker/PickersCalendarHeader.js +7 -20
- package/CalendarPicker/useCalendarState.d.ts +2 -2
- package/CalendarPicker/useCalendarState.js +7 -7
- package/ClockPicker/Clock.d.ts +9 -4
- package/ClockPicker/Clock.js +13 -13
- package/ClockPicker/ClockNumbers.d.ts +3 -3
- package/ClockPicker/ClockNumbers.js +2 -2
- package/ClockPicker/ClockPicker.d.ts +8 -58
- package/ClockPicker/ClockPicker.js +52 -128
- package/ClockPicker/ClockPointer.d.ts +1 -1
- package/ClockPicker/ClockPointer.js +4 -4
- package/DateField/useDateField.d.ts +1 -1
- package/DateField/useDateField.js +5 -1
- package/DatePicker/DatePicker.js +10 -20
- package/DateTimePicker/DateTimePicker.js +10 -39
- package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.js +14 -22
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
- package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.js +9 -21
- package/LocalizationProvider/LocalizationProvider.d.ts +10 -11
- package/LocalizationProvider/LocalizationProvider.js +31 -24
- package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
- package/MobileDatePicker/MobileDatePicker.js +14 -22
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
- package/MobileTimePicker/MobileTimePicker.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.js +9 -21
- package/MonthPicker/MonthPicker.d.ts +12 -9
- package/MonthPicker/MonthPicker.js +60 -57
- package/MonthPicker/PickersMonth.d.ts +10 -7
- package/MonthPicker/PickersMonth.js +76 -44
- package/MonthPicker/pickersMonthClasses.d.ts +9 -1
- package/MonthPicker/pickersMonthClasses.js +1 -1
- package/PickersDay/PickersDay.d.ts +0 -6
- package/PickersDay/PickersDay.js +0 -5
- package/StaticDatePicker/StaticDatePicker.d.ts +1 -1
- package/StaticDatePicker/StaticDatePicker.js +17 -23
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
- package/StaticTimePicker/StaticTimePicker.d.ts +1 -1
- package/StaticTimePicker/StaticTimePicker.js +17 -22
- package/TimePicker/TimePicker.js +5 -19
- package/YearPicker/PickersYear.d.ts +7 -6
- package/YearPicker/PickersYear.js +34 -23
- package/YearPicker/YearPicker.d.ts +21 -4
- package/YearPicker/YearPicker.js +109 -49
- package/YearPicker/pickersYearClasses.d.ts +1 -1
- package/index.js +1 -1
- package/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
- package/internals/components/PickerStaticWrapper/PickerStaticWrapper.d.ts +20 -6
- package/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +38 -22
- package/internals/components/PickerStaticWrapper/index.d.ts +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.d.ts +3 -0
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +166 -0
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +63 -0
- package/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
- package/internals/components/PickersArrowSwitcher/index.d.ts +2 -0
- package/internals/components/PickersArrowSwitcher/index.js +1 -0
- package/internals/components/{pickersArrowSwitcherClasses.d.ts → PickersArrowSwitcher/pickersArrowSwitcherClasses.d.ts} +0 -0
- package/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
- package/internals/components/PickersPopper.d.ts +2 -6
- package/internals/components/PickersPopper.js +5 -5
- package/internals/components/PickersToolbar.d.ts +1 -1
- package/internals/components/PickersToolbar.js +1 -2
- package/internals/components/PickersToolbarText.d.ts +1 -1
- package/internals/components/wrappers/DesktopTooltipWrapper.d.ts +1 -1
- package/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
- package/internals/components/wrappers/DesktopWrapper.d.ts +8 -3
- package/internals/components/wrappers/DesktopWrapper.js +26 -21
- package/internals/components/wrappers/MobileWrapper.d.ts +8 -3
- package/internals/components/wrappers/MobileWrapper.js +23 -18
- package/internals/hooks/useField/useField.interfaces.d.ts +0 -1
- package/internals/hooks/useField/useField.js +19 -23
- package/internals/hooks/useField/useField.utils.js +10 -2
- package/internals/hooks/useUtils.d.ts +5 -2
- package/internals/hooks/useUtils.js +11 -2
- package/internals/hooks/validation/useDateValidation.d.ts +4 -4
- package/internals/hooks/validation/useDateValidation.js +12 -2
- package/internals/index.d.ts +5 -5
- package/internals/index.js +3 -3
- package/internals/models/muiPickersAdapter.d.ts +12 -7
- package/internals/models/props/baseToolbarProps.d.ts +0 -8
- package/internals/models/props/staticPickerProps.d.ts +2 -8
- package/legacy/CalendarPicker/CalendarPicker.js +52 -69
- package/legacy/CalendarPicker/DayPicker.js +6 -2
- package/legacy/CalendarPicker/PickersCalendarHeader.js +7 -20
- package/legacy/CalendarPicker/useCalendarState.js +7 -7
- package/legacy/ClockPicker/Clock.js +13 -13
- package/legacy/ClockPicker/ClockNumbers.js +2 -2
- package/legacy/ClockPicker/ClockPicker.js +57 -133
- package/legacy/ClockPicker/ClockPointer.js +4 -4
- package/legacy/DateField/useDateField.js +5 -1
- package/legacy/DatePicker/DatePicker.js +10 -20
- package/legacy/DateTimePicker/DateTimePicker.js +10 -39
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +13 -21
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +8 -20
- package/legacy/LocalizationProvider/LocalizationProvider.js +28 -23
- package/legacy/MobileDatePicker/MobileDatePicker.js +13 -21
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
- package/legacy/MobileTimePicker/MobileTimePicker.js +8 -20
- package/legacy/MonthPicker/MonthPicker.js +67 -62
- package/legacy/MonthPicker/PickersMonth.js +89 -57
- package/legacy/MonthPicker/pickersMonthClasses.js +1 -1
- package/legacy/PickersDay/PickersDay.js +0 -5
- package/legacy/StaticDatePicker/StaticDatePicker.js +17 -24
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +17 -43
- package/legacy/StaticTimePicker/StaticTimePicker.js +17 -23
- package/legacy/TimePicker/TimePicker.js +5 -19
- package/legacy/YearPicker/PickersYear.js +35 -25
- package/legacy/YearPicker/YearPicker.js +111 -51
- package/legacy/index.js +1 -1
- package/legacy/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
- package/legacy/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +41 -24
- package/legacy/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +180 -0
- package/legacy/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
- package/legacy/internals/components/PickersArrowSwitcher/index.js +1 -0
- package/legacy/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
- package/legacy/internals/components/PickersPopper.js +5 -5
- package/legacy/internals/components/PickersToolbar.js +1 -2
- package/legacy/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
- package/legacy/internals/components/wrappers/DesktopWrapper.js +26 -21
- package/legacy/internals/components/wrappers/MobileWrapper.js +22 -17
- package/legacy/internals/hooks/useField/useField.js +21 -23
- package/legacy/internals/hooks/useField/useField.utils.js +10 -2
- package/legacy/internals/hooks/useUtils.js +13 -2
- package/legacy/internals/hooks/validation/useDateValidation.js +12 -2
- package/legacy/internals/index.js +3 -3
- package/legacy/locales/faIR.js +52 -0
- package/legacy/locales/fiFI.js +61 -0
- package/legacy/locales/index.js +2 -0
- package/legacy/locales/isIS.js +0 -1
- package/locales/faIR.d.ts +35 -0
- package/locales/faIR.js +36 -0
- package/locales/fiFI.d.ts +35 -0
- package/locales/fiFI.js +45 -0
- package/locales/index.d.ts +2 -0
- package/locales/index.js +2 -0
- package/locales/isIS.js +0 -1
- package/locales/utils/pickersLocaleTextApi.d.ts +1 -0
- package/modern/CalendarPicker/CalendarPicker.js +54 -71
- package/modern/CalendarPicker/DayPicker.js +6 -2
- package/modern/CalendarPicker/PickersCalendarHeader.js +7 -20
- package/modern/CalendarPicker/useCalendarState.js +7 -7
- package/modern/ClockPicker/Clock.js +13 -13
- package/modern/ClockPicker/ClockNumbers.js +2 -2
- package/modern/ClockPicker/ClockPicker.js +52 -128
- package/modern/ClockPicker/ClockPointer.js +4 -4
- package/modern/DateField/useDateField.js +5 -1
- package/modern/DatePicker/DatePicker.js +10 -20
- package/modern/DateTimePicker/DateTimePicker.js +10 -39
- package/modern/DesktopDatePicker/DesktopDatePicker.js +14 -22
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
- package/modern/DesktopTimePicker/DesktopTimePicker.js +9 -21
- package/modern/LocalizationProvider/LocalizationProvider.js +29 -24
- package/modern/MobileDatePicker/MobileDatePicker.js +14 -22
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
- package/modern/MobileTimePicker/MobileTimePicker.js +9 -21
- package/modern/MonthPicker/MonthPicker.js +60 -57
- package/modern/MonthPicker/PickersMonth.js +76 -44
- package/modern/MonthPicker/pickersMonthClasses.js +1 -1
- package/modern/PickersDay/PickersDay.js +0 -5
- package/modern/StaticDatePicker/StaticDatePicker.js +17 -23
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
- package/modern/StaticTimePicker/StaticTimePicker.js +17 -22
- package/modern/TimePicker/TimePicker.js +5 -19
- package/modern/YearPicker/PickersYear.js +34 -23
- package/modern/YearPicker/YearPicker.js +109 -49
- package/modern/index.js +1 -1
- package/modern/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
- package/modern/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +38 -22
- package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +164 -0
- package/modern/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
- package/modern/internals/components/PickersArrowSwitcher/index.js +1 -0
- package/modern/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
- package/modern/internals/components/PickersPopper.js +5 -5
- package/modern/internals/components/PickersToolbar.js +1 -2
- package/modern/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
- package/modern/internals/components/wrappers/DesktopWrapper.js +26 -21
- package/modern/internals/components/wrappers/MobileWrapper.js +23 -18
- package/modern/internals/hooks/useField/useField.js +19 -21
- package/modern/internals/hooks/useField/useField.utils.js +10 -2
- package/modern/internals/hooks/useUtils.js +11 -2
- package/modern/internals/hooks/validation/useDateValidation.js +12 -2
- package/modern/internals/index.js +3 -3
- package/modern/locales/faIR.js +36 -0
- package/modern/locales/fiFI.js +45 -0
- package/modern/locales/index.js +2 -0
- package/modern/locales/isIS.js +0 -1
- package/node/CalendarPicker/CalendarPicker.js +54 -71
- package/node/CalendarPicker/DayPicker.js +5 -1
- package/node/CalendarPicker/PickersCalendarHeader.js +7 -21
- package/node/CalendarPicker/useCalendarState.js +6 -6
- package/node/ClockPicker/Clock.js +12 -12
- package/node/ClockPicker/ClockNumbers.js +2 -2
- package/node/ClockPicker/ClockPicker.js +52 -129
- package/node/ClockPicker/ClockPointer.js +4 -4
- package/node/DateField/useDateField.js +5 -1
- package/node/DatePicker/DatePicker.js +10 -20
- package/node/DateTimePicker/DateTimePicker.js +10 -39
- package/node/DesktopDatePicker/DesktopDatePicker.js +14 -22
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
- package/node/DesktopTimePicker/DesktopTimePicker.js +9 -21
- package/node/LocalizationProvider/LocalizationProvider.js +31 -25
- package/node/MobileDatePicker/MobileDatePicker.js +14 -22
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
- package/node/MobileTimePicker/MobileTimePicker.js +9 -21
- package/node/MonthPicker/MonthPicker.js +61 -58
- package/node/MonthPicker/PickersMonth.js +71 -43
- package/node/MonthPicker/pickersMonthClasses.js +1 -1
- package/node/PickersDay/PickersDay.js +0 -5
- package/node/StaticDatePicker/StaticDatePicker.js +17 -23
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
- package/node/StaticTimePicker/StaticTimePicker.js +17 -22
- package/node/TimePicker/TimePicker.js +5 -19
- package/node/YearPicker/PickersYear.js +33 -22
- package/node/YearPicker/YearPicker.js +111 -49
- package/node/index.js +1 -1
- package/node/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
- package/node/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +39 -22
- package/node/internals/components/{PickersArrowSwitcher.js → PickersArrowSwitcher/PickersArrowSwitcher.js} +102 -58
- package/node/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
- package/node/internals/components/PickersArrowSwitcher/index.js +13 -0
- package/node/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
- package/node/internals/components/PickersPopper.js +5 -5
- package/node/internals/components/PickersToolbar.js +1 -2
- package/node/internals/components/wrappers/DesktopTooltipWrapper.js +30 -24
- package/node/internals/components/wrappers/DesktopWrapper.js +27 -21
- package/node/internals/components/wrappers/MobileWrapper.js +24 -18
- package/node/internals/hooks/useField/useField.js +19 -23
- package/node/internals/hooks/useField/useField.utils.js +10 -2
- package/node/internals/hooks/useUtils.js +15 -2
- package/node/internals/hooks/validation/useDateValidation.js +14 -4
- package/node/internals/index.js +8 -2
- package/node/locales/faIR.js +45 -0
- package/node/locales/fiFI.js +54 -0
- package/node/locales/index.js +26 -0
- package/node/locales/isIS.js +0 -1
- package/package.json +4 -4
- package/themeAugmentation/props.d.ts +3 -3
- package/internals/components/PickersArrowSwitcher.d.ts +0 -62
- package/internals/components/PickersArrowSwitcher.js +0 -124
- package/legacy/internals/components/PickersArrowSwitcher.js +0 -128
- package/modern/internals/components/PickersArrowSwitcher.js +0 -124
|
@@ -51,7 +51,6 @@ export var useField = function useField(params) {
|
|
|
51
51
|
return {
|
|
52
52
|
sections: sections,
|
|
53
53
|
valueParsed: valueParsed,
|
|
54
|
-
valueStr: fieldValueManager.getValueStrFromSections(sections),
|
|
55
54
|
selectedSectionIndexes: null
|
|
56
55
|
};
|
|
57
56
|
}),
|
|
@@ -67,7 +66,6 @@ export var useField = function useField(params) {
|
|
|
67
66
|
setState(function (prevState) {
|
|
68
67
|
return _extends({}, prevState, {
|
|
69
68
|
sections: sections,
|
|
70
|
-
valueStr: fieldValueManager.getValueStrFromSections(sections),
|
|
71
69
|
valueParsed: newValueParsed
|
|
72
70
|
});
|
|
73
71
|
});
|
|
@@ -95,15 +93,10 @@ export var useField = function useField(params) {
|
|
|
95
93
|
}
|
|
96
94
|
|
|
97
95
|
onClick == null ? void 0 : onClick.apply(void 0, _toConsumableArray(args));
|
|
98
|
-
|
|
99
|
-
if (state.sections.length === 0) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
96
|
var nextSectionIndex = state.sections.findIndex(function (section) {
|
|
104
|
-
var
|
|
97
|
+
var _selectionStart;
|
|
105
98
|
|
|
106
|
-
return section.start > ((
|
|
99
|
+
return section.start > ((_selectionStart = inputRef.current.selectionStart) != null ? _selectionStart : 0);
|
|
107
100
|
});
|
|
108
101
|
var sectionIndex = nextSectionIndex === -1 ? state.sections.length - 1 : nextSectionIndex - 1;
|
|
109
102
|
updateSelectedSections(sectionIndex);
|
|
@@ -113,14 +106,20 @@ export var useField = function useField(params) {
|
|
|
113
106
|
args[_key2] = arguments[_key2];
|
|
114
107
|
}
|
|
115
108
|
|
|
116
|
-
onFocus == null ? void 0 : onFocus.apply(void 0, _toConsumableArray(args));
|
|
109
|
+
onFocus == null ? void 0 : onFocus.apply(void 0, _toConsumableArray(args)); // The ref is guaranteed to be resolved that this point.
|
|
110
|
+
|
|
111
|
+
var input = inputRef.current;
|
|
112
|
+
clearTimeout(focusTimeoutRef.current);
|
|
117
113
|
focusTimeoutRef.current = setTimeout(function () {
|
|
118
|
-
|
|
114
|
+
// The ref changed, the component got remounted, the focus event is no longer relevant.
|
|
115
|
+
if (input !== inputRef.current) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
119
118
|
|
|
120
|
-
if ((
|
|
121
|
-
handleInputClick();
|
|
122
|
-
} else {
|
|
119
|
+
if (Number(input.selectionEnd) - Number(input.selectionStart) === input.value.length) {
|
|
123
120
|
updateSelectedSections(0, state.sections.length - 1);
|
|
121
|
+
} else {
|
|
122
|
+
handleInputClick();
|
|
124
123
|
}
|
|
125
124
|
});
|
|
126
125
|
});
|
|
@@ -133,17 +132,14 @@ export var useField = function useField(params) {
|
|
|
133
132
|
updateSelectedSections();
|
|
134
133
|
});
|
|
135
134
|
var handleInputKeyDown = useEventCallback(function (event) {
|
|
136
|
-
onKeyDown == null ? void 0 : onKeyDown(event);
|
|
137
|
-
|
|
138
|
-
if (!inputRef.current || state.sections.length === 0) {
|
|
139
|
-
return;
|
|
140
|
-
} // eslint-disable-next-line default-case
|
|
141
|
-
|
|
135
|
+
onKeyDown == null ? void 0 : onKeyDown(event); // eslint-disable-next-line default-case
|
|
142
136
|
|
|
143
137
|
switch (true) {
|
|
144
138
|
// Select all
|
|
145
139
|
case event.key === 'a' && (event.ctrlKey || event.metaKey):
|
|
146
140
|
{
|
|
141
|
+
// prevent default to make sure that the next line "select all" while updating
|
|
142
|
+
// the internal state at the same time.
|
|
147
143
|
event.preventDefault();
|
|
148
144
|
updateSelectedSections(0, state.sections.length - 1);
|
|
149
145
|
return;
|
|
@@ -292,7 +288,7 @@ export var useField = function useField(params) {
|
|
|
292
288
|
}
|
|
293
289
|
});
|
|
294
290
|
useEnhancedEffect(function () {
|
|
295
|
-
if (
|
|
291
|
+
if (state.selectedSectionIndexes == null) {
|
|
296
292
|
return;
|
|
297
293
|
}
|
|
298
294
|
|
|
@@ -312,7 +308,6 @@ export var useField = function useField(params) {
|
|
|
312
308
|
setState(function (prevState) {
|
|
313
309
|
return _extends({}, prevState, {
|
|
314
310
|
valueParsed: valueParsed,
|
|
315
|
-
valueStr: fieldValueManager.getValueStrFromSections(sections),
|
|
316
311
|
sections: sections
|
|
317
312
|
});
|
|
318
313
|
});
|
|
@@ -331,9 +326,12 @@ export var useField = function useField(params) {
|
|
|
331
326
|
return window.clearTimeout(focusTimeoutRef.current);
|
|
332
327
|
};
|
|
333
328
|
}, []);
|
|
329
|
+
var valueStr = React.useMemo(function () {
|
|
330
|
+
return fieldValueManager.getValueStrFromSections(state.sections);
|
|
331
|
+
}, [state.sections, fieldValueManager]);
|
|
334
332
|
return {
|
|
335
333
|
inputProps: _extends({}, otherForwardedProps, {
|
|
336
|
-
value:
|
|
334
|
+
value: valueStr,
|
|
337
335
|
onClick: handleInputClick,
|
|
338
336
|
onFocus: handleInputFocus,
|
|
339
337
|
onBlur: handleInputBlur,
|
|
@@ -157,12 +157,20 @@ export var adjustInvalidDateSectionValue = function adjustInvalidDateSectionValu
|
|
|
157
157
|
|
|
158
158
|
if (shouldSetAbsolute) {
|
|
159
159
|
if (delta > 0 || isEnd) {
|
|
160
|
-
_newDate = utils.endOfMonth(today);
|
|
161
|
-
} else {
|
|
162
160
|
_newDate = utils.startOfMonth(today);
|
|
161
|
+
} else {
|
|
162
|
+
_newDate = utils.endOfMonth(today);
|
|
163
163
|
}
|
|
164
164
|
} else {
|
|
165
165
|
_newDate = utils.addDays(utils.parse(section.value, section.formatValue), delta);
|
|
166
|
+
|
|
167
|
+
if (!utils.isSameMonth(_newDate, today)) {
|
|
168
|
+
if (delta > 0) {
|
|
169
|
+
_newDate = utils.startOfMonth(today);
|
|
170
|
+
} else {
|
|
171
|
+
_newDate = utils.endOfMonth(today);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
return utils.formatByString(_newDate, section.formatValue);
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { MuiPickersAdapterContext } from '../../LocalizationProvider/LocalizationProvider';
|
|
4
|
+
import { DEFAULT_LOCALE } from '../../locales/enUS';
|
|
3
5
|
export var useLocalizationContext = function useLocalizationContext() {
|
|
4
6
|
var localization = React.useContext(MuiPickersAdapterContext);
|
|
5
7
|
|
|
6
8
|
if (localization === null) {
|
|
7
|
-
throw new Error('MUI: Can not find
|
|
9
|
+
throw new Error(['MUI: Can not find the date and time pickers localization context.', 'It looks like you forgot to wrap your component in LocalizationProvider.', 'This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package'].join('\n'));
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
if (localization.utils === null) {
|
|
13
|
+
throw new Error(['MUI: Can not find the date and time pickers adapter from its localization context.', 'It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.'].join('\n'));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var localeText = React.useMemo(function () {
|
|
17
|
+
return _extends({}, DEFAULT_LOCALE, localization.localeText);
|
|
18
|
+
}, [localization.localeText]);
|
|
19
|
+
return _extends({}, localization, {
|
|
20
|
+
localeText: localeText
|
|
21
|
+
});
|
|
11
22
|
};
|
|
12
23
|
export var useUtils = function useUtils() {
|
|
13
24
|
return useLocalizationContext().utils;
|
|
@@ -22,6 +22,12 @@ export var validateDate = function validateDate(_ref) {
|
|
|
22
22
|
case Boolean(props.shouldDisableDate && props.shouldDisableDate(date)):
|
|
23
23
|
return 'shouldDisableDate';
|
|
24
24
|
|
|
25
|
+
case Boolean(props.shouldDisableMonth && props.shouldDisableMonth(date)):
|
|
26
|
+
return 'shouldDisableMonth';
|
|
27
|
+
|
|
28
|
+
case Boolean(props.shouldDisableYear && props.shouldDisableYear(date)):
|
|
29
|
+
return 'shouldDisableYear';
|
|
30
|
+
|
|
25
31
|
case Boolean(props.disableFuture && adapter.utils.isAfterDay(date, now)):
|
|
26
32
|
return 'disableFuture';
|
|
27
33
|
|
|
@@ -38,8 +44,10 @@ export var validateDate = function validateDate(_ref) {
|
|
|
38
44
|
return null;
|
|
39
45
|
}
|
|
40
46
|
};
|
|
41
|
-
export var
|
|
47
|
+
export var useIsDateDisabled = function useIsDateDisabled(_ref2) {
|
|
42
48
|
var shouldDisableDate = _ref2.shouldDisableDate,
|
|
49
|
+
shouldDisableMonth = _ref2.shouldDisableMonth,
|
|
50
|
+
shouldDisableYear = _ref2.shouldDisableYear,
|
|
43
51
|
minDate = _ref2.minDate,
|
|
44
52
|
maxDate = _ref2.maxDate,
|
|
45
53
|
disableFuture = _ref2.disableFuture,
|
|
@@ -51,13 +59,15 @@ export var useIsDayDisabled = function useIsDayDisabled(_ref2) {
|
|
|
51
59
|
value: day,
|
|
52
60
|
props: {
|
|
53
61
|
shouldDisableDate: shouldDisableDate,
|
|
62
|
+
shouldDisableMonth: shouldDisableMonth,
|
|
63
|
+
shouldDisableYear: shouldDisableYear,
|
|
54
64
|
minDate: minDate,
|
|
55
65
|
maxDate: maxDate,
|
|
56
66
|
disableFuture: disableFuture,
|
|
57
67
|
disablePast: disablePast
|
|
58
68
|
}
|
|
59
69
|
}) !== null;
|
|
60
|
-
}, [adapter, shouldDisableDate, minDate, maxDate, disableFuture, disablePast]);
|
|
70
|
+
}, [adapter, shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast]);
|
|
61
71
|
};
|
|
62
72
|
export var isSameDateError = function isSameDateError(a, b) {
|
|
63
73
|
return a === b;
|
|
@@ -2,13 +2,13 @@ export { DesktopTooltipWrapper } from './components/wrappers/DesktopTooltipWrapp
|
|
|
2
2
|
export { MobileWrapper } from './components/wrappers/MobileWrapper';
|
|
3
3
|
export { MobileKeyboardInputView } from './components/CalendarOrClockPicker/CalendarOrClockPicker';
|
|
4
4
|
export { calendarOrClockPickerClasses } from './components/CalendarOrClockPicker/calendarOrClockPickerClasses';
|
|
5
|
-
export { PickersArrowSwitcher } from './components/PickersArrowSwitcher';
|
|
5
|
+
export { PickersArrowSwitcher } from './components/PickersArrowSwitcher/PickersArrowSwitcher';
|
|
6
6
|
export { PickerStaticWrapper } from './components/PickerStaticWrapper/PickerStaticWrapper';
|
|
7
7
|
export { PickersToolbar } from './components/PickersToolbar';
|
|
8
8
|
export { pickersToolbarClasses } from './components/pickersToolbarClasses';
|
|
9
9
|
export { pickersToolbarButtonClasses } from './components/pickersToolbarButtonClasses';
|
|
10
10
|
export { pickersToolbarTextClasses } from './components/pickersToolbarTextClasses';
|
|
11
|
-
export { pickersArrowSwitcherClasses } from './components/pickersArrowSwitcherClasses';
|
|
11
|
+
export { pickersArrowSwitcherClasses } from './components/PickersArrowSwitcher/pickersArrowSwitcherClasses';
|
|
12
12
|
export { pickersPopperClasses } from './components/pickersPopperClasses';
|
|
13
13
|
export { PickersToolbarButton } from './components/PickersToolbarButton';
|
|
14
14
|
export { pickerStaticWrapperClasses } from './components/PickerStaticWrapper/pickerStaticWrapperClasses';
|
|
@@ -16,7 +16,7 @@ export { WrapperVariantContext } from './components/wrappers/WrapperVariantConte
|
|
|
16
16
|
export { DAY_MARGIN } from './constants/dimensions';
|
|
17
17
|
export { useMaskedInput } from './hooks/useMaskedInput';
|
|
18
18
|
export { usePickerState } from './hooks/usePickerState';
|
|
19
|
-
export { useDefaultDates, useUtils, useLocaleText } from './hooks/useUtils';
|
|
19
|
+
export { useLocalizationContext, useDefaultDates, useUtils, useLocaleText } from './hooks/useUtils';
|
|
20
20
|
export { useValidation } from './hooks/validation/useValidation';
|
|
21
21
|
export { validateDate } from './hooks/validation/useDateValidation';
|
|
22
22
|
export { usePreviousMonthDisabled, useNextMonthDisabled } from './hooks/date-helpers-hooks';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
+
var faIRPickers = {
|
|
3
|
+
// Calendar navigation
|
|
4
|
+
previousMonth: 'ماه گذشته',
|
|
5
|
+
nextMonth: 'ماه آینده',
|
|
6
|
+
// View navigation
|
|
7
|
+
openPreviousView: 'نمای قبلی',
|
|
8
|
+
openNextView: 'نمای بعدی',
|
|
9
|
+
calendarViewSwitchingButtonAriaLabel: function calendarViewSwitchingButtonAriaLabel(view) {
|
|
10
|
+
return view === 'year' ? 'نمای سال باز است، رفتن به نمای تقویم' : 'نمای تقویم باز است، رفتن به نمای سال';
|
|
11
|
+
},
|
|
12
|
+
inputModeToggleButtonAriaLabel: function inputModeToggleButtonAriaLabel(isKeyboardInputOpen, viewType) {
|
|
13
|
+
return isKeyboardInputOpen ? "\u0646\u0645\u0627\u06CC \u0648\u0631\u0648\u062F\u06CC \u0645\u062A\u0646 \u0628\u0627\u0632 \u0627\u0633\u062A\u060C \u0631\u0641\u062A\u0646 \u0628\u0647 \u0646\u0645\u0627\u06CC ".concat(viewType) : "\u0646\u0645\u0627\u06CC ".concat(viewType, " \u0628\u0627\u0632 \u0627\u0633\u062A\u060C \u0631\u0641\u062A\u0646 \u0628\u0647 \u0646\u0645\u0627\u06CC \u0648\u0631\u0648\u062F\u06CC \u0645\u062A\u0646");
|
|
14
|
+
},
|
|
15
|
+
// DateRange placeholders
|
|
16
|
+
start: 'شروع',
|
|
17
|
+
end: 'پایان',
|
|
18
|
+
// Action bar
|
|
19
|
+
cancelButtonLabel: 'لغو',
|
|
20
|
+
clearButtonLabel: 'پاک کردن',
|
|
21
|
+
okButtonLabel: 'اوکی',
|
|
22
|
+
todayButtonLabel: 'امروز',
|
|
23
|
+
// Toolbar titles
|
|
24
|
+
datePickerDefaultToolbarTitle: 'تاریخ را انتخاب کنید',
|
|
25
|
+
dateTimePickerDefaultToolbarTitle: 'تاریخ و ساعت را انتخاب کنید',
|
|
26
|
+
timePickerDefaultToolbarTitle: 'ساعت را انتخاب کنید',
|
|
27
|
+
dateRangePickerDefaultToolbarTitle: 'محدوده تاریخ را انتخاب کنید',
|
|
28
|
+
// Clock labels
|
|
29
|
+
clockLabelText: function clockLabelText(view, time, adapter) {
|
|
30
|
+
return "Select ".concat(view, ". ").concat(time === null ? 'هیچ ساعتی انتخاب نشده است' : "\u0633\u0627\u0639\u062A \u0627\u0646\u062A\u062E\u0627\u0628 ".concat(adapter.format(time, 'fullTime'), " \u0645\u06CC \u0628\u0627\u0634\u062F"));
|
|
31
|
+
},
|
|
32
|
+
hoursClockNumberText: function hoursClockNumberText(hours) {
|
|
33
|
+
return "".concat(hours, " \u0633\u0627\u0639\u062A \u0647\u0627");
|
|
34
|
+
},
|
|
35
|
+
minutesClockNumberText: function minutesClockNumberText(minutes) {
|
|
36
|
+
return "".concat(minutes, " \u062F\u0642\u06CC\u0642\u0647 \u0647\u0627");
|
|
37
|
+
},
|
|
38
|
+
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
39
|
+
return "".concat(seconds, " \u062B\u0627\u0646\u06CC\u0647 \u0647\u0627");
|
|
40
|
+
},
|
|
41
|
+
// Open picker labels
|
|
42
|
+
openDatePickerDialogue: function openDatePickerDialogue(rawValue, utils) {
|
|
43
|
+
return rawValue && utils.isValid(utils.date(rawValue)) ? "\u062A\u0627\u0631\u06CC\u062E \u0631\u0627 \u0627\u0646\u062A\u062E\u0627\u0628 \u06A9\u0646\u06CC\u062F\u060C \u062A\u0627\u0631\u06CC\u062E \u0627\u0646\u062A\u062E\u0627\u0628 \u0634\u062F\u0647 ".concat(utils.format(utils.date(rawValue), 'fullDate'), " \u0645\u06CC \u0628\u0627\u0634\u062F") : 'تاریخ را انتخاب کنید';
|
|
44
|
+
},
|
|
45
|
+
openTimePickerDialogue: function openTimePickerDialogue(rawValue, utils) {
|
|
46
|
+
return rawValue && utils.isValid(utils.date(rawValue)) ? "\u0633\u0627\u0639\u062A \u0631\u0627 \u0627\u0646\u062A\u062E\u0627\u0628 \u06A9\u0646\u06CC\u062F\u060C \u0633\u0627\u0639\u062A \u0627\u0646\u062A\u062E\u0627\u0628 \u0634\u062F\u0647 ".concat(utils.format(utils.date(rawValue), 'fullTime'), " \u0645\u06CC \u0628\u0627\u0634\u062F") : 'ساعت را انتخاب کنید';
|
|
47
|
+
},
|
|
48
|
+
// Table labels
|
|
49
|
+
timeTableLabel: 'انتخاب تاریخ',
|
|
50
|
+
dateTableLabel: 'انتخاب ساعت'
|
|
51
|
+
};
|
|
52
|
+
export var faIR = getPickersLocalization(faIRPickers);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
+
var views = {
|
|
3
|
+
hours: 'tunnit',
|
|
4
|
+
minutes: 'minuutit',
|
|
5
|
+
seconds: 'sekuntit'
|
|
6
|
+
};
|
|
7
|
+
var viewTranslation = {
|
|
8
|
+
calendar: 'kalenteri',
|
|
9
|
+
clock: 'kello'
|
|
10
|
+
};
|
|
11
|
+
var fiFIPickers = {
|
|
12
|
+
// Calendar navigation
|
|
13
|
+
previousMonth: 'Edellinen kuukausi',
|
|
14
|
+
nextMonth: 'Seuraava kuukausi',
|
|
15
|
+
// View navigation
|
|
16
|
+
openPreviousView: 'avaa edellinen kuukausi',
|
|
17
|
+
openNextView: 'avaa seuraava kuukausi',
|
|
18
|
+
calendarViewSwitchingButtonAriaLabel: function calendarViewSwitchingButtonAriaLabel(view) {
|
|
19
|
+
return view === 'year' ? 'vuosinäkymä on auki, vaihda kalenterinäkymään' : 'kalenterinäkymä on auki, vaihda vuosinäkymään';
|
|
20
|
+
},
|
|
21
|
+
inputModeToggleButtonAriaLabel: function inputModeToggleButtonAriaLabel(isKeyboardInputOpen, viewType) {
|
|
22
|
+
return isKeyboardInputOpen ? "tekstikentt\xE4 on auki, mene ".concat(viewTranslation[viewType], "n\xE4kym\xE4\xE4n") : "".concat(viewTranslation[viewType], "n\xE4kym\xE4 on auki, mene tekstikentt\xE4\xE4n");
|
|
23
|
+
},
|
|
24
|
+
// DateRange placeholders
|
|
25
|
+
start: 'Alku',
|
|
26
|
+
end: 'Loppu',
|
|
27
|
+
// Action bar
|
|
28
|
+
cancelButtonLabel: 'Peruuta',
|
|
29
|
+
clearButtonLabel: 'Tyhjennä',
|
|
30
|
+
okButtonLabel: 'OK',
|
|
31
|
+
todayButtonLabel: 'Tänään',
|
|
32
|
+
// Toolbar titles
|
|
33
|
+
datePickerDefaultToolbarTitle: 'Valitse päivä',
|
|
34
|
+
dateTimePickerDefaultToolbarTitle: 'Valitse päivä ja aika',
|
|
35
|
+
timePickerDefaultToolbarTitle: 'Valitse aika',
|
|
36
|
+
dateRangePickerDefaultToolbarTitle: 'Valitse aikaväli',
|
|
37
|
+
// Clock labels
|
|
38
|
+
clockLabelText: function clockLabelText(view, time, adapter) {
|
|
39
|
+
return "Valitse ".concat(views[view], ". ").concat(time === null ? 'Ei aikaa valittuna' : "Valittu aika on ".concat(adapter.format(time, 'fullTime')));
|
|
40
|
+
},
|
|
41
|
+
hoursClockNumberText: function hoursClockNumberText(hours) {
|
|
42
|
+
return "".concat(hours, " tuntia");
|
|
43
|
+
},
|
|
44
|
+
minutesClockNumberText: function minutesClockNumberText(minutes) {
|
|
45
|
+
return "".concat(minutes, " minuuttia");
|
|
46
|
+
},
|
|
47
|
+
secondsClockNumberText: function secondsClockNumberText(seconds) {
|
|
48
|
+
return "".concat(seconds, " sekunttia");
|
|
49
|
+
},
|
|
50
|
+
// Open picker labels
|
|
51
|
+
openDatePickerDialogue: function openDatePickerDialogue(rawValue, utils) {
|
|
52
|
+
return rawValue && utils.isValid(utils.date(rawValue)) ? "Valitse p\xE4iv\xE4, valittu p\xE4iv\xE4 on ".concat(utils.format(utils.date(rawValue), 'fullDate')) : 'Valitse päivä';
|
|
53
|
+
},
|
|
54
|
+
openTimePickerDialogue: function openTimePickerDialogue(rawValue, utils) {
|
|
55
|
+
return rawValue && utils.isValid(utils.date(rawValue)) ? "Valitse aika, valittu aika on ".concat(utils.format(utils.date(rawValue), 'fullTime')) : 'Valitse aika';
|
|
56
|
+
},
|
|
57
|
+
// Table labels
|
|
58
|
+
timeTableLabel: 'valitse aika',
|
|
59
|
+
dateTableLabel: 'valitse päivä'
|
|
60
|
+
};
|
|
61
|
+
export var fiFI = getPickersLocalization(fiFIPickers);
|
package/legacy/locales/index.js
CHANGED
package/legacy/locales/isIS.js
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CalendarPickerView } from '../internals/models';
|
|
2
|
+
export declare const faIR: {
|
|
3
|
+
components: {
|
|
4
|
+
MuiLocalizationProvider: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
localeText: {
|
|
7
|
+
previousMonth?: string | undefined;
|
|
8
|
+
nextMonth?: string | undefined;
|
|
9
|
+
openPreviousView?: string | undefined;
|
|
10
|
+
openNextView?: string | undefined;
|
|
11
|
+
cancelButtonLabel?: string | undefined;
|
|
12
|
+
clearButtonLabel?: string | undefined;
|
|
13
|
+
okButtonLabel?: string | undefined;
|
|
14
|
+
todayButtonLabel?: string | undefined;
|
|
15
|
+
start?: string | undefined;
|
|
16
|
+
end?: string | undefined;
|
|
17
|
+
calendarViewSwitchingButtonAriaLabel?: ((currentView: CalendarPickerView) => string) | undefined;
|
|
18
|
+
inputModeToggleButtonAriaLabel?: ((isKeyboardInputOpen: boolean, viewType: "calendar" | "clock") => string) | undefined;
|
|
19
|
+
clockLabelText?: ((view: import("../internals/models").ClockPickerView, time: any, adapter: import("../internals/models").MuiPickersAdapter<any>) => string) | undefined;
|
|
20
|
+
hoursClockNumberText?: ((hours: string) => string) | undefined;
|
|
21
|
+
minutesClockNumberText?: ((minutes: string) => string) | undefined;
|
|
22
|
+
secondsClockNumberText?: ((seconds: string) => string) | undefined;
|
|
23
|
+
openDatePickerDialogue?: ((date: any, utils: import("../internals/models").MuiPickersAdapter<any>) => string) | undefined;
|
|
24
|
+
openTimePickerDialogue?: ((date: any, utils: import("../internals/models").MuiPickersAdapter<any>) => string) | undefined;
|
|
25
|
+
timeTableLabel?: string | undefined;
|
|
26
|
+
dateTableLabel?: string | undefined;
|
|
27
|
+
datePickerDefaultToolbarTitle?: string | undefined;
|
|
28
|
+
dateTimePickerDefaultToolbarTitle?: string | undefined;
|
|
29
|
+
timePickerDefaultToolbarTitle?: string | undefined;
|
|
30
|
+
dateRangePickerDefaultToolbarTitle?: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
package/locales/faIR.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
+
const faIRPickers = {
|
|
3
|
+
// Calendar navigation
|
|
4
|
+
previousMonth: 'ماه گذشته',
|
|
5
|
+
nextMonth: 'ماه آینده',
|
|
6
|
+
// View navigation
|
|
7
|
+
openPreviousView: 'نمای قبلی',
|
|
8
|
+
openNextView: 'نمای بعدی',
|
|
9
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'نمای سال باز است، رفتن به نمای تقویم' : 'نمای تقویم باز است، رفتن به نمای سال',
|
|
10
|
+
inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) => isKeyboardInputOpen ? `نمای ورودی متن باز است، رفتن به نمای ${viewType}` : `نمای ${viewType} باز است، رفتن به نمای ورودی متن`,
|
|
11
|
+
// DateRange placeholders
|
|
12
|
+
start: 'شروع',
|
|
13
|
+
end: 'پایان',
|
|
14
|
+
// Action bar
|
|
15
|
+
cancelButtonLabel: 'لغو',
|
|
16
|
+
clearButtonLabel: 'پاک کردن',
|
|
17
|
+
okButtonLabel: 'اوکی',
|
|
18
|
+
todayButtonLabel: 'امروز',
|
|
19
|
+
// Toolbar titles
|
|
20
|
+
datePickerDefaultToolbarTitle: 'تاریخ را انتخاب کنید',
|
|
21
|
+
dateTimePickerDefaultToolbarTitle: 'تاریخ و ساعت را انتخاب کنید',
|
|
22
|
+
timePickerDefaultToolbarTitle: 'ساعت را انتخاب کنید',
|
|
23
|
+
dateRangePickerDefaultToolbarTitle: 'محدوده تاریخ را انتخاب کنید',
|
|
24
|
+
// Clock labels
|
|
25
|
+
clockLabelText: (view, time, adapter) => `Select ${view}. ${time === null ? 'هیچ ساعتی انتخاب نشده است' : `ساعت انتخاب ${adapter.format(time, 'fullTime')} می باشد`}`,
|
|
26
|
+
hoursClockNumberText: hours => `${hours} ساعت ها`,
|
|
27
|
+
minutesClockNumberText: minutes => `${minutes} دقیقه ها`,
|
|
28
|
+
secondsClockNumberText: seconds => `${seconds} ثانیه ها`,
|
|
29
|
+
// Open picker labels
|
|
30
|
+
openDatePickerDialogue: (rawValue, utils) => rawValue && utils.isValid(utils.date(rawValue)) ? `تاریخ را انتخاب کنید، تاریخ انتخاب شده ${utils.format(utils.date(rawValue), 'fullDate')} می باشد` : 'تاریخ را انتخاب کنید',
|
|
31
|
+
openTimePickerDialogue: (rawValue, utils) => rawValue && utils.isValid(utils.date(rawValue)) ? `ساعت را انتخاب کنید، ساعت انتخاب شده ${utils.format(utils.date(rawValue), 'fullTime')} می باشد` : 'ساعت را انتخاب کنید',
|
|
32
|
+
// Table labels
|
|
33
|
+
timeTableLabel: 'انتخاب تاریخ',
|
|
34
|
+
dateTableLabel: 'انتخاب ساعت'
|
|
35
|
+
};
|
|
36
|
+
export const faIR = getPickersLocalization(faIRPickers);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CalendarPickerView } from '../internals/models';
|
|
2
|
+
export declare const fiFI: {
|
|
3
|
+
components: {
|
|
4
|
+
MuiLocalizationProvider: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
localeText: {
|
|
7
|
+
previousMonth?: string | undefined;
|
|
8
|
+
nextMonth?: string | undefined;
|
|
9
|
+
openPreviousView?: string | undefined;
|
|
10
|
+
openNextView?: string | undefined;
|
|
11
|
+
cancelButtonLabel?: string | undefined;
|
|
12
|
+
clearButtonLabel?: string | undefined;
|
|
13
|
+
okButtonLabel?: string | undefined;
|
|
14
|
+
todayButtonLabel?: string | undefined;
|
|
15
|
+
start?: string | undefined;
|
|
16
|
+
end?: string | undefined;
|
|
17
|
+
calendarViewSwitchingButtonAriaLabel?: ((currentView: CalendarPickerView) => string) | undefined;
|
|
18
|
+
inputModeToggleButtonAriaLabel?: ((isKeyboardInputOpen: boolean, viewType: "calendar" | "clock") => string) | undefined;
|
|
19
|
+
clockLabelText?: ((view: import("../internals/models").ClockPickerView, time: any, adapter: import("../internals/models").MuiPickersAdapter<any>) => string) | undefined;
|
|
20
|
+
hoursClockNumberText?: ((hours: string) => string) | undefined;
|
|
21
|
+
minutesClockNumberText?: ((minutes: string) => string) | undefined;
|
|
22
|
+
secondsClockNumberText?: ((seconds: string) => string) | undefined;
|
|
23
|
+
openDatePickerDialogue?: ((date: any, utils: import("../internals/models").MuiPickersAdapter<any>) => string) | undefined;
|
|
24
|
+
openTimePickerDialogue?: ((date: any, utils: import("../internals/models").MuiPickersAdapter<any>) => string) | undefined;
|
|
25
|
+
timeTableLabel?: string | undefined;
|
|
26
|
+
dateTableLabel?: string | undefined;
|
|
27
|
+
datePickerDefaultToolbarTitle?: string | undefined;
|
|
28
|
+
dateTimePickerDefaultToolbarTitle?: string | undefined;
|
|
29
|
+
timePickerDefaultToolbarTitle?: string | undefined;
|
|
30
|
+
dateRangePickerDefaultToolbarTitle?: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
package/locales/fiFI.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getPickersLocalization } from './utils/getPickersLocalization';
|
|
2
|
+
const views = {
|
|
3
|
+
hours: 'tunnit',
|
|
4
|
+
minutes: 'minuutit',
|
|
5
|
+
seconds: 'sekuntit'
|
|
6
|
+
};
|
|
7
|
+
const viewTranslation = {
|
|
8
|
+
calendar: 'kalenteri',
|
|
9
|
+
clock: 'kello'
|
|
10
|
+
};
|
|
11
|
+
const fiFIPickers = {
|
|
12
|
+
// Calendar navigation
|
|
13
|
+
previousMonth: 'Edellinen kuukausi',
|
|
14
|
+
nextMonth: 'Seuraava kuukausi',
|
|
15
|
+
// View navigation
|
|
16
|
+
openPreviousView: 'avaa edellinen kuukausi',
|
|
17
|
+
openNextView: 'avaa seuraava kuukausi',
|
|
18
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'vuosinäkymä on auki, vaihda kalenterinäkymään' : 'kalenterinäkymä on auki, vaihda vuosinäkymään',
|
|
19
|
+
inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) => isKeyboardInputOpen ? `tekstikenttä on auki, mene ${viewTranslation[viewType]}näkymään` : `${viewTranslation[viewType]}näkymä on auki, mene tekstikenttään`,
|
|
20
|
+
// DateRange placeholders
|
|
21
|
+
start: 'Alku',
|
|
22
|
+
end: 'Loppu',
|
|
23
|
+
// Action bar
|
|
24
|
+
cancelButtonLabel: 'Peruuta',
|
|
25
|
+
clearButtonLabel: 'Tyhjennä',
|
|
26
|
+
okButtonLabel: 'OK',
|
|
27
|
+
todayButtonLabel: 'Tänään',
|
|
28
|
+
// Toolbar titles
|
|
29
|
+
datePickerDefaultToolbarTitle: 'Valitse päivä',
|
|
30
|
+
dateTimePickerDefaultToolbarTitle: 'Valitse päivä ja aika',
|
|
31
|
+
timePickerDefaultToolbarTitle: 'Valitse aika',
|
|
32
|
+
dateRangePickerDefaultToolbarTitle: 'Valitse aikaväli',
|
|
33
|
+
// Clock labels
|
|
34
|
+
clockLabelText: (view, time, adapter) => `Valitse ${views[view]}. ${time === null ? 'Ei aikaa valittuna' : `Valittu aika on ${adapter.format(time, 'fullTime')}`}`,
|
|
35
|
+
hoursClockNumberText: hours => `${hours} tuntia`,
|
|
36
|
+
minutesClockNumberText: minutes => `${minutes} minuuttia`,
|
|
37
|
+
secondsClockNumberText: seconds => `${seconds} sekunttia`,
|
|
38
|
+
// Open picker labels
|
|
39
|
+
openDatePickerDialogue: (rawValue, utils) => rawValue && utils.isValid(utils.date(rawValue)) ? `Valitse päivä, valittu päivä on ${utils.format(utils.date(rawValue), 'fullDate')}` : 'Valitse päivä',
|
|
40
|
+
openTimePickerDialogue: (rawValue, utils) => rawValue && utils.isValid(utils.date(rawValue)) ? `Valitse aika, valittu aika on ${utils.format(utils.date(rawValue), 'fullTime')}` : 'Valitse aika',
|
|
41
|
+
// Table labels
|
|
42
|
+
timeTableLabel: 'valitse aika',
|
|
43
|
+
dateTableLabel: 'valitse päivä'
|
|
44
|
+
};
|
|
45
|
+
export const fiFI = getPickersLocalization(fiFIPickers);
|
package/locales/index.d.ts
CHANGED
package/locales/index.js
CHANGED
package/locales/isIS.js
CHANGED
|
@@ -28,4 +28,5 @@ export interface PickersLocaleText<TDate> {
|
|
|
28
28
|
timePickerDefaultToolbarTitle: string;
|
|
29
29
|
dateRangePickerDefaultToolbarTitle: string;
|
|
30
30
|
}
|
|
31
|
+
export declare type PickersInputLocaleText<TDate> = Partial<PickersLocaleText<TDate>>;
|
|
31
32
|
export declare type PickersTranslationKeys = keyof PickersLocaleText<any>;
|