@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.
Files changed (252) hide show
  1. package/CHANGELOG.md +212 -3
  2. package/CalendarPicker/CalendarPicker.d.ts +8 -2
  3. package/CalendarPicker/CalendarPicker.js +54 -71
  4. package/CalendarPicker/DayPicker.d.ts +2 -2
  5. package/CalendarPicker/DayPicker.js +6 -2
  6. package/CalendarPicker/PickersCalendarHeader.d.ts +3 -10
  7. package/CalendarPicker/PickersCalendarHeader.js +7 -20
  8. package/CalendarPicker/useCalendarState.d.ts +2 -2
  9. package/CalendarPicker/useCalendarState.js +7 -7
  10. package/ClockPicker/Clock.d.ts +9 -4
  11. package/ClockPicker/Clock.js +13 -13
  12. package/ClockPicker/ClockNumbers.d.ts +3 -3
  13. package/ClockPicker/ClockNumbers.js +2 -2
  14. package/ClockPicker/ClockPicker.d.ts +8 -58
  15. package/ClockPicker/ClockPicker.js +52 -128
  16. package/ClockPicker/ClockPointer.d.ts +1 -1
  17. package/ClockPicker/ClockPointer.js +4 -4
  18. package/DateField/useDateField.d.ts +1 -1
  19. package/DateField/useDateField.js +5 -1
  20. package/DatePicker/DatePicker.js +10 -20
  21. package/DateTimePicker/DateTimePicker.js +10 -39
  22. package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
  23. package/DesktopDatePicker/DesktopDatePicker.js +14 -22
  24. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
  25. package/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
  26. package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
  27. package/DesktopTimePicker/DesktopTimePicker.js +9 -21
  28. package/LocalizationProvider/LocalizationProvider.d.ts +10 -11
  29. package/LocalizationProvider/LocalizationProvider.js +31 -24
  30. package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
  31. package/MobileDatePicker/MobileDatePicker.js +14 -22
  32. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
  33. package/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
  34. package/MobileTimePicker/MobileTimePicker.d.ts +1 -1
  35. package/MobileTimePicker/MobileTimePicker.js +9 -21
  36. package/MonthPicker/MonthPicker.d.ts +12 -9
  37. package/MonthPicker/MonthPicker.js +60 -57
  38. package/MonthPicker/PickersMonth.d.ts +10 -7
  39. package/MonthPicker/PickersMonth.js +76 -44
  40. package/MonthPicker/pickersMonthClasses.d.ts +9 -1
  41. package/MonthPicker/pickersMonthClasses.js +1 -1
  42. package/PickersDay/PickersDay.d.ts +0 -6
  43. package/PickersDay/PickersDay.js +0 -5
  44. package/StaticDatePicker/StaticDatePicker.d.ts +1 -1
  45. package/StaticDatePicker/StaticDatePicker.js +17 -23
  46. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -1
  47. package/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
  48. package/StaticTimePicker/StaticTimePicker.d.ts +1 -1
  49. package/StaticTimePicker/StaticTimePicker.js +17 -22
  50. package/TimePicker/TimePicker.js +5 -19
  51. package/YearPicker/PickersYear.d.ts +7 -6
  52. package/YearPicker/PickersYear.js +34 -23
  53. package/YearPicker/YearPicker.d.ts +21 -4
  54. package/YearPicker/YearPicker.js +109 -49
  55. package/YearPicker/pickersYearClasses.d.ts +1 -1
  56. package/index.js +1 -1
  57. package/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
  58. package/internals/components/PickerStaticWrapper/PickerStaticWrapper.d.ts +20 -6
  59. package/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +38 -22
  60. package/internals/components/PickerStaticWrapper/index.d.ts +1 -1
  61. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.d.ts +3 -0
  62. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +166 -0
  63. package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +63 -0
  64. package/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
  65. package/internals/components/PickersArrowSwitcher/index.d.ts +2 -0
  66. package/internals/components/PickersArrowSwitcher/index.js +1 -0
  67. package/internals/components/{pickersArrowSwitcherClasses.d.ts → PickersArrowSwitcher/pickersArrowSwitcherClasses.d.ts} +0 -0
  68. package/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
  69. package/internals/components/PickersPopper.d.ts +2 -6
  70. package/internals/components/PickersPopper.js +5 -5
  71. package/internals/components/PickersToolbar.d.ts +1 -1
  72. package/internals/components/PickersToolbar.js +1 -2
  73. package/internals/components/PickersToolbarText.d.ts +1 -1
  74. package/internals/components/wrappers/DesktopTooltipWrapper.d.ts +1 -1
  75. package/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
  76. package/internals/components/wrappers/DesktopWrapper.d.ts +8 -3
  77. package/internals/components/wrappers/DesktopWrapper.js +26 -21
  78. package/internals/components/wrappers/MobileWrapper.d.ts +8 -3
  79. package/internals/components/wrappers/MobileWrapper.js +23 -18
  80. package/internals/hooks/useField/useField.interfaces.d.ts +0 -1
  81. package/internals/hooks/useField/useField.js +19 -23
  82. package/internals/hooks/useField/useField.utils.js +10 -2
  83. package/internals/hooks/useUtils.d.ts +5 -2
  84. package/internals/hooks/useUtils.js +11 -2
  85. package/internals/hooks/validation/useDateValidation.d.ts +4 -4
  86. package/internals/hooks/validation/useDateValidation.js +12 -2
  87. package/internals/index.d.ts +5 -5
  88. package/internals/index.js +3 -3
  89. package/internals/models/muiPickersAdapter.d.ts +12 -7
  90. package/internals/models/props/baseToolbarProps.d.ts +0 -8
  91. package/internals/models/props/staticPickerProps.d.ts +2 -8
  92. package/legacy/CalendarPicker/CalendarPicker.js +52 -69
  93. package/legacy/CalendarPicker/DayPicker.js +6 -2
  94. package/legacy/CalendarPicker/PickersCalendarHeader.js +7 -20
  95. package/legacy/CalendarPicker/useCalendarState.js +7 -7
  96. package/legacy/ClockPicker/Clock.js +13 -13
  97. package/legacy/ClockPicker/ClockNumbers.js +2 -2
  98. package/legacy/ClockPicker/ClockPicker.js +57 -133
  99. package/legacy/ClockPicker/ClockPointer.js +4 -4
  100. package/legacy/DateField/useDateField.js +5 -1
  101. package/legacy/DatePicker/DatePicker.js +10 -20
  102. package/legacy/DateTimePicker/DateTimePicker.js +10 -39
  103. package/legacy/DesktopDatePicker/DesktopDatePicker.js +13 -21
  104. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
  105. package/legacy/DesktopTimePicker/DesktopTimePicker.js +8 -20
  106. package/legacy/LocalizationProvider/LocalizationProvider.js +28 -23
  107. package/legacy/MobileDatePicker/MobileDatePicker.js +13 -21
  108. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
  109. package/legacy/MobileTimePicker/MobileTimePicker.js +8 -20
  110. package/legacy/MonthPicker/MonthPicker.js +67 -62
  111. package/legacy/MonthPicker/PickersMonth.js +89 -57
  112. package/legacy/MonthPicker/pickersMonthClasses.js +1 -1
  113. package/legacy/PickersDay/PickersDay.js +0 -5
  114. package/legacy/StaticDatePicker/StaticDatePicker.js +17 -24
  115. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +17 -43
  116. package/legacy/StaticTimePicker/StaticTimePicker.js +17 -23
  117. package/legacy/TimePicker/TimePicker.js +5 -19
  118. package/legacy/YearPicker/PickersYear.js +35 -25
  119. package/legacy/YearPicker/YearPicker.js +111 -51
  120. package/legacy/index.js +1 -1
  121. package/legacy/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
  122. package/legacy/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +41 -24
  123. package/legacy/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +180 -0
  124. package/legacy/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
  125. package/legacy/internals/components/PickersArrowSwitcher/index.js +1 -0
  126. package/legacy/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
  127. package/legacy/internals/components/PickersPopper.js +5 -5
  128. package/legacy/internals/components/PickersToolbar.js +1 -2
  129. package/legacy/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
  130. package/legacy/internals/components/wrappers/DesktopWrapper.js +26 -21
  131. package/legacy/internals/components/wrappers/MobileWrapper.js +22 -17
  132. package/legacy/internals/hooks/useField/useField.js +21 -23
  133. package/legacy/internals/hooks/useField/useField.utils.js +10 -2
  134. package/legacy/internals/hooks/useUtils.js +13 -2
  135. package/legacy/internals/hooks/validation/useDateValidation.js +12 -2
  136. package/legacy/internals/index.js +3 -3
  137. package/legacy/locales/faIR.js +52 -0
  138. package/legacy/locales/fiFI.js +61 -0
  139. package/legacy/locales/index.js +2 -0
  140. package/legacy/locales/isIS.js +0 -1
  141. package/locales/faIR.d.ts +35 -0
  142. package/locales/faIR.js +36 -0
  143. package/locales/fiFI.d.ts +35 -0
  144. package/locales/fiFI.js +45 -0
  145. package/locales/index.d.ts +2 -0
  146. package/locales/index.js +2 -0
  147. package/locales/isIS.js +0 -1
  148. package/locales/utils/pickersLocaleTextApi.d.ts +1 -0
  149. package/modern/CalendarPicker/CalendarPicker.js +54 -71
  150. package/modern/CalendarPicker/DayPicker.js +6 -2
  151. package/modern/CalendarPicker/PickersCalendarHeader.js +7 -20
  152. package/modern/CalendarPicker/useCalendarState.js +7 -7
  153. package/modern/ClockPicker/Clock.js +13 -13
  154. package/modern/ClockPicker/ClockNumbers.js +2 -2
  155. package/modern/ClockPicker/ClockPicker.js +52 -128
  156. package/modern/ClockPicker/ClockPointer.js +4 -4
  157. package/modern/DateField/useDateField.js +5 -1
  158. package/modern/DatePicker/DatePicker.js +10 -20
  159. package/modern/DateTimePicker/DateTimePicker.js +10 -39
  160. package/modern/DesktopDatePicker/DesktopDatePicker.js +14 -22
  161. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
  162. package/modern/DesktopTimePicker/DesktopTimePicker.js +9 -21
  163. package/modern/LocalizationProvider/LocalizationProvider.js +29 -24
  164. package/modern/MobileDatePicker/MobileDatePicker.js +14 -22
  165. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
  166. package/modern/MobileTimePicker/MobileTimePicker.js +9 -21
  167. package/modern/MonthPicker/MonthPicker.js +60 -57
  168. package/modern/MonthPicker/PickersMonth.js +76 -44
  169. package/modern/MonthPicker/pickersMonthClasses.js +1 -1
  170. package/modern/PickersDay/PickersDay.js +0 -5
  171. package/modern/StaticDatePicker/StaticDatePicker.js +17 -23
  172. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
  173. package/modern/StaticTimePicker/StaticTimePicker.js +17 -22
  174. package/modern/TimePicker/TimePicker.js +5 -19
  175. package/modern/YearPicker/PickersYear.js +34 -23
  176. package/modern/YearPicker/YearPicker.js +109 -49
  177. package/modern/index.js +1 -1
  178. package/modern/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
  179. package/modern/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +38 -22
  180. package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +164 -0
  181. package/modern/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
  182. package/modern/internals/components/PickersArrowSwitcher/index.js +1 -0
  183. package/modern/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
  184. package/modern/internals/components/PickersPopper.js +5 -5
  185. package/modern/internals/components/PickersToolbar.js +1 -2
  186. package/modern/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
  187. package/modern/internals/components/wrappers/DesktopWrapper.js +26 -21
  188. package/modern/internals/components/wrappers/MobileWrapper.js +23 -18
  189. package/modern/internals/hooks/useField/useField.js +19 -21
  190. package/modern/internals/hooks/useField/useField.utils.js +10 -2
  191. package/modern/internals/hooks/useUtils.js +11 -2
  192. package/modern/internals/hooks/validation/useDateValidation.js +12 -2
  193. package/modern/internals/index.js +3 -3
  194. package/modern/locales/faIR.js +36 -0
  195. package/modern/locales/fiFI.js +45 -0
  196. package/modern/locales/index.js +2 -0
  197. package/modern/locales/isIS.js +0 -1
  198. package/node/CalendarPicker/CalendarPicker.js +54 -71
  199. package/node/CalendarPicker/DayPicker.js +5 -1
  200. package/node/CalendarPicker/PickersCalendarHeader.js +7 -21
  201. package/node/CalendarPicker/useCalendarState.js +6 -6
  202. package/node/ClockPicker/Clock.js +12 -12
  203. package/node/ClockPicker/ClockNumbers.js +2 -2
  204. package/node/ClockPicker/ClockPicker.js +52 -129
  205. package/node/ClockPicker/ClockPointer.js +4 -4
  206. package/node/DateField/useDateField.js +5 -1
  207. package/node/DatePicker/DatePicker.js +10 -20
  208. package/node/DateTimePicker/DateTimePicker.js +10 -39
  209. package/node/DesktopDatePicker/DesktopDatePicker.js +14 -22
  210. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
  211. package/node/DesktopTimePicker/DesktopTimePicker.js +9 -21
  212. package/node/LocalizationProvider/LocalizationProvider.js +31 -25
  213. package/node/MobileDatePicker/MobileDatePicker.js +14 -22
  214. package/node/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
  215. package/node/MobileTimePicker/MobileTimePicker.js +9 -21
  216. package/node/MonthPicker/MonthPicker.js +61 -58
  217. package/node/MonthPicker/PickersMonth.js +71 -43
  218. package/node/MonthPicker/pickersMonthClasses.js +1 -1
  219. package/node/PickersDay/PickersDay.js +0 -5
  220. package/node/StaticDatePicker/StaticDatePicker.js +17 -23
  221. package/node/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
  222. package/node/StaticTimePicker/StaticTimePicker.js +17 -22
  223. package/node/TimePicker/TimePicker.js +5 -19
  224. package/node/YearPicker/PickersYear.js +33 -22
  225. package/node/YearPicker/YearPicker.js +111 -49
  226. package/node/index.js +1 -1
  227. package/node/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
  228. package/node/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +39 -22
  229. package/node/internals/components/{PickersArrowSwitcher.js → PickersArrowSwitcher/PickersArrowSwitcher.js} +102 -58
  230. package/node/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
  231. package/node/internals/components/PickersArrowSwitcher/index.js +13 -0
  232. package/node/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
  233. package/node/internals/components/PickersPopper.js +5 -5
  234. package/node/internals/components/PickersToolbar.js +1 -2
  235. package/node/internals/components/wrappers/DesktopTooltipWrapper.js +30 -24
  236. package/node/internals/components/wrappers/DesktopWrapper.js +27 -21
  237. package/node/internals/components/wrappers/MobileWrapper.js +24 -18
  238. package/node/internals/hooks/useField/useField.js +19 -23
  239. package/node/internals/hooks/useField/useField.utils.js +10 -2
  240. package/node/internals/hooks/useUtils.js +15 -2
  241. package/node/internals/hooks/validation/useDateValidation.js +14 -4
  242. package/node/internals/index.js +8 -2
  243. package/node/locales/faIR.js +45 -0
  244. package/node/locales/fiFI.js +54 -0
  245. package/node/locales/index.js +26 -0
  246. package/node/locales/isIS.js +0 -1
  247. package/package.json +4 -4
  248. package/themeAugmentation/props.d.ts +3 -3
  249. package/internals/components/PickersArrowSwitcher.d.ts +0 -62
  250. package/internals/components/PickersArrowSwitcher.js +0 -124
  251. package/legacy/internals/components/PickersArrowSwitcher.js +0 -128
  252. 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 _inputRef$current$sel, _inputRef$current;
97
+ var _selectionStart;
105
98
 
106
- return section.start > ((_inputRef$current$sel = (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.selectionStart) != null ? _inputRef$current$sel : 0);
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
- var _inputRef$current$sel2, _inputRef$current2, _inputRef$current$sel3, _inputRef$current3;
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 (((_inputRef$current$sel2 = (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.selectionEnd) != null ? _inputRef$current$sel2 : 0) - ((_inputRef$current$sel3 = (_inputRef$current3 = inputRef.current) == null ? void 0 : _inputRef$current3.selectionStart) != null ? _inputRef$current$sel3 : 0) === 0) {
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 (!inputRef.current || state.selectedSectionIndexes == null) {
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: state.valueStr,
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 utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.');
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
- return localization;
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 useIsDayDisabled = function useIsDayDisabled(_ref2) {
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);
@@ -4,6 +4,8 @@ export * from './ptBR';
4
4
  export * from './trTR';
5
5
  export * from './deDE';
6
6
  export * from './esES';
7
+ export * from './faIR';
8
+ export * from './fiFI';
7
9
  export * from './frFR';
8
10
  export * from './enUS';
9
11
  export * from './nbNO';
@@ -1,5 +1,4 @@
1
1
  import { getPickersLocalization } from './utils/getPickersLocalization';
2
- // This object is not Partial<PickersLocaleText> because it is the default values
3
2
  var isISPickers = {
4
3
  // Calendar navigation
5
4
  previousMonth: 'Fyrri mánuður',
@@ -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
+ };
@@ -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
+ };
@@ -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);
@@ -4,6 +4,8 @@ export * from './ptBR';
4
4
  export * from './trTR';
5
5
  export * from './deDE';
6
6
  export * from './esES';
7
+ export * from './faIR';
8
+ export * from './fiFI';
7
9
  export * from './frFR';
8
10
  export * from './enUS';
9
11
  export * from './nbNO';
package/locales/index.js CHANGED
@@ -4,6 +4,8 @@ export * from './ptBR';
4
4
  export * from './trTR';
5
5
  export * from './deDE';
6
6
  export * from './esES';
7
+ export * from './faIR';
8
+ export * from './fiFI';
7
9
  export * from './frFR';
8
10
  export * from './enUS';
9
11
  export * from './nbNO';
package/locales/isIS.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { getPickersLocalization } from './utils/getPickersLocalization';
2
- // This object is not Partial<PickersLocaleText> because it is the default values
3
2
  const isISPickers = {
4
3
  // Calendar navigation
5
4
  previousMonth: 'Fyrri mánuður',
@@ -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>;