@mui/x-date-pickers 5.0.2 → 5.0.4

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 (101) hide show
  1. package/CHANGELOG.md +95 -1
  2. package/CalendarPicker/CalendarPicker.js +12 -4
  3. package/CalendarPicker/PickersCalendarHeader.d.ts +1 -1
  4. package/ClockPicker/ClockPicker.d.ts +6 -6
  5. package/ClockPicker/ClockPicker.js +6 -6
  6. package/DatePicker/DatePicker.js +1 -1
  7. package/DateTimePicker/DateTimePicker.js +2 -2
  8. package/DesktopDatePicker/DesktopDatePicker.js +1 -1
  9. package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  10. package/DesktopTimePicker/DesktopTimePicker.js +1 -1
  11. package/MobileDatePicker/MobileDatePicker.js +1 -1
  12. package/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  13. package/MobileTimePicker/MobileTimePicker.js +1 -1
  14. package/StaticDatePicker/StaticDatePicker.js +1 -1
  15. package/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  16. package/StaticTimePicker/StaticTimePicker.js +1 -1
  17. package/TimePicker/TimePicker.js +1 -1
  18. package/YearPicker/PickersYear.js +2 -2
  19. package/YearPicker/YearPicker.js +32 -3
  20. package/index.js +1 -1
  21. package/internals/models/muiPickersAdapter.d.ts +12 -7
  22. package/legacy/CalendarPicker/CalendarPicker.js +12 -4
  23. package/legacy/ClockPicker/ClockPicker.js +6 -6
  24. package/legacy/DatePicker/DatePicker.js +1 -1
  25. package/legacy/DateTimePicker/DateTimePicker.js +2 -2
  26. package/legacy/DesktopDatePicker/DesktopDatePicker.js +1 -1
  27. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  28. package/legacy/DesktopTimePicker/DesktopTimePicker.js +1 -1
  29. package/legacy/MobileDatePicker/MobileDatePicker.js +1 -1
  30. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  31. package/legacy/MobileTimePicker/MobileTimePicker.js +1 -1
  32. package/legacy/StaticDatePicker/StaticDatePicker.js +1 -1
  33. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  34. package/legacy/StaticTimePicker/StaticTimePicker.js +1 -1
  35. package/legacy/TimePicker/TimePicker.js +1 -1
  36. package/legacy/YearPicker/PickersYear.js +2 -2
  37. package/legacy/YearPicker/YearPicker.js +32 -3
  38. package/legacy/index.js +1 -1
  39. package/legacy/locales/faIR.js +52 -0
  40. package/legacy/locales/fiFI.js +61 -0
  41. package/legacy/locales/index.js +3 -0
  42. package/legacy/locales/isIS.js +0 -1
  43. package/legacy/locales/jaJP.js +65 -0
  44. package/locales/faIR.d.ts +35 -0
  45. package/locales/faIR.js +36 -0
  46. package/locales/fiFI.d.ts +35 -0
  47. package/locales/fiFI.js +45 -0
  48. package/locales/index.d.ts +3 -0
  49. package/locales/index.js +3 -0
  50. package/locales/isIS.js +0 -1
  51. package/locales/jaJP.d.ts +35 -0
  52. package/locales/jaJP.js +51 -0
  53. package/modern/CalendarPicker/CalendarPicker.js +12 -4
  54. package/modern/ClockPicker/ClockPicker.js +6 -6
  55. package/modern/DatePicker/DatePicker.js +1 -1
  56. package/modern/DateTimePicker/DateTimePicker.js +2 -2
  57. package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
  58. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  59. package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -1
  60. package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
  61. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  62. package/modern/MobileTimePicker/MobileTimePicker.js +1 -1
  63. package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
  64. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  65. package/modern/StaticTimePicker/StaticTimePicker.js +1 -1
  66. package/modern/TimePicker/TimePicker.js +1 -1
  67. package/modern/YearPicker/PickersYear.js +2 -2
  68. package/modern/YearPicker/YearPicker.js +32 -3
  69. package/modern/index.js +1 -1
  70. package/modern/locales/faIR.js +36 -0
  71. package/modern/locales/fiFI.js +45 -0
  72. package/modern/locales/index.js +3 -0
  73. package/modern/locales/isIS.js +0 -1
  74. package/modern/locales/jaJP.js +47 -0
  75. package/node/CalendarPicker/CalendarPicker.js +12 -4
  76. package/node/ClockPicker/ClockPicker.js +6 -6
  77. package/node/DatePicker/DatePicker.js +1 -1
  78. package/node/DateTimePicker/DateTimePicker.js +2 -2
  79. package/node/DesktopDatePicker/DesktopDatePicker.js +1 -1
  80. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
  81. package/node/DesktopTimePicker/DesktopTimePicker.js +1 -1
  82. package/node/MobileDatePicker/MobileDatePicker.js +1 -1
  83. package/node/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
  84. package/node/MobileTimePicker/MobileTimePicker.js +1 -1
  85. package/node/StaticDatePicker/StaticDatePicker.js +1 -1
  86. package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
  87. package/node/StaticTimePicker/StaticTimePicker.js +1 -1
  88. package/node/TimePicker/TimePicker.js +1 -1
  89. package/node/YearPicker/PickersYear.js +2 -2
  90. package/node/YearPicker/YearPicker.js +34 -4
  91. package/node/index.js +1 -1
  92. package/node/locales/faIR.js +45 -0
  93. package/node/locales/fiFI.js +54 -0
  94. package/node/locales/index.js +39 -0
  95. package/node/locales/isIS.js +0 -1
  96. package/node/locales/jaJP.js +60 -0
  97. package/package.json +2 -2
  98. package/internals/models/muiPickersAdapter.js +0 -1
  99. package/legacy/internals/models/muiPickersAdapter.js +0 -1
  100. package/modern/internals/models/muiPickersAdapter.js +0 -1
  101. package/node/internals/models/muiPickersAdapter.js +0 -5
@@ -393,7 +393,7 @@ process.env.NODE_ENV !== "production" ? ClockPicker.propTypes = {
393
393
  * @param {TDate | null} time The current time.
394
394
  * @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
395
395
  * @returns {string} The clock label.
396
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
396
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
397
397
  * @default <TDate extends any>(
398
398
  * view: ClockView,
399
399
  * time: TDate | null,
@@ -410,7 +410,7 @@ process.env.NODE_ENV !== "production" ? ClockPicker.propTypes = {
410
410
  * @param {string} hours The hours to format.
411
411
  * @returns {string} the formatted hours text.
412
412
  * @default (hours: string) => `${hours} hours`
413
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
413
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
414
414
  */
415
415
  getHoursClockNumberText: _propTypes.default.func,
416
416
 
@@ -419,7 +419,7 @@ process.env.NODE_ENV !== "production" ? ClockPicker.propTypes = {
419
419
  * @param {string} minutes The minutes to format.
420
420
  * @returns {string} the formatted minutes text.
421
421
  * @default (minutes: string) => `${minutes} minutes`
422
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
422
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
423
423
  */
424
424
  getMinutesClockNumberText: _propTypes.default.func,
425
425
 
@@ -428,14 +428,14 @@ process.env.NODE_ENV !== "production" ? ClockPicker.propTypes = {
428
428
  * @param {string} seconds The seconds to format.
429
429
  * @returns {string} the formatted seconds text.
430
430
  * @default (seconds: string) => `${seconds} seconds`
431
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
431
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
432
432
  */
433
433
  getSecondsClockNumberText: _propTypes.default.func,
434
434
 
435
435
  /**
436
436
  * Left arrow icon aria-label text.
437
437
  * @default 'open previous view'
438
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
438
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
439
439
  */
440
440
  leftArrowButtonText: _propTypes.default.string,
441
441
 
@@ -483,7 +483,7 @@ process.env.NODE_ENV !== "production" ? ClockPicker.propTypes = {
483
483
  /**
484
484
  * Right arrow icon aria-label text.
485
485
  * @default 'open next view'
486
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
486
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
487
487
  */
488
488
  rightArrowButtonText: _propTypes.default.string,
489
489
 
@@ -185,7 +185,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
185
185
  * Get aria-label text for switching between views button.
186
186
  * @param {CalendarPickerView} currentView The view from which we want to get the button text.
187
187
  * @returns {string} The label of the view.
188
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
188
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
189
189
  */
190
190
  getViewSwitchingButtonText: _propTypes.default.func,
191
191
  ignoreInvalidInputs: _propTypes.default.bool,
@@ -201,7 +201,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
201
201
  * @param {TDate | null} time The current time.
202
202
  * @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
203
203
  * @returns {string} The clock label.
204
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
204
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
205
205
  * @default <TDate extends any>(
206
206
  * view: ClockView,
207
207
  * time: TDate | null,
@@ -227,7 +227,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
227
227
  * Get aria-label text for switching between views button.
228
228
  * @param {CalendarPickerView} currentView The view from which we want to get the button text.
229
229
  * @returns {string} The label of the view.
230
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
230
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
231
231
  */
232
232
  getViewSwitchingButtonText: _propTypes.default.func,
233
233
 
@@ -189,7 +189,7 @@ process.env.NODE_ENV !== "production" ? DesktopDatePicker.propTypes = {
189
189
  * Get aria-label text for switching between views button.
190
190
  * @param {CalendarPickerView} currentView The view from which we want to get the button text.
191
191
  * @returns {string} The label of the view.
192
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
192
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
193
193
  */
194
194
  getViewSwitchingButtonText: _propTypes.default.func,
195
195
  ignoreInvalidInputs: _propTypes.default.bool,
@@ -212,7 +212,7 @@ process.env.NODE_ENV !== "production" ? DesktopDateTimePicker.propTypes = {
212
212
  * @param {TDate | null} time The current time.
213
213
  * @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
214
214
  * @returns {string} The clock label.
215
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
215
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
216
216
  * @default <TDate extends any>(
217
217
  * view: ClockView,
218
218
  * time: TDate | null,
@@ -238,7 +238,7 @@ process.env.NODE_ENV !== "production" ? DesktopDateTimePicker.propTypes = {
238
238
  * Get aria-label text for switching between views button.
239
239
  * @param {CalendarPickerView} currentView The view from which we want to get the button text.
240
240
  * @returns {string} The label of the view.
241
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
241
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
242
242
  */
243
243
  getViewSwitchingButtonText: _propTypes.default.func,
244
244
 
@@ -168,7 +168,7 @@ process.env.NODE_ENV !== "production" ? DesktopTimePicker.propTypes = {
168
168
  * @param {TDate | null} time The current time.
169
169
  * @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
170
170
  * @returns {string} The clock label.
171
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
171
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
172
172
  * @default <TDate extends any>(
173
173
  * view: ClockView,
174
174
  * time: TDate | null,
@@ -190,7 +190,7 @@ process.env.NODE_ENV !== "production" ? MobileDatePicker.propTypes = {
190
190
  * Get aria-label text for switching between views button.
191
191
  * @param {CalendarPickerView} currentView The view from which we want to get the button text.
192
192
  * @returns {string} The label of the view.
193
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
193
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
194
194
  */
195
195
  getViewSwitchingButtonText: _propTypes.default.func,
196
196
  ignoreInvalidInputs: _propTypes.default.bool,
@@ -213,7 +213,7 @@ process.env.NODE_ENV !== "production" ? MobileDateTimePicker.propTypes = {
213
213
  * @param {TDate | null} time The current time.
214
214
  * @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
215
215
  * @returns {string} The clock label.
216
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
216
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
217
217
  * @default <TDate extends any>(
218
218
  * view: ClockView,
219
219
  * time: TDate | null,
@@ -239,7 +239,7 @@ process.env.NODE_ENV !== "production" ? MobileDateTimePicker.propTypes = {
239
239
  * Get aria-label text for switching between views button.
240
240
  * @param {CalendarPickerView} currentView The view from which we want to get the button text.
241
241
  * @returns {string} The label of the view.
242
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
242
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
243
243
  */
244
244
  getViewSwitchingButtonText: _propTypes.default.func,
245
245
 
@@ -169,7 +169,7 @@ process.env.NODE_ENV !== "production" ? MobileTimePicker.propTypes = {
169
169
  * @param {TDate | null} time The current time.
170
170
  * @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
171
171
  * @returns {string} The clock label.
172
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
172
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
173
173
  * @default <TDate extends any>(
174
174
  * view: ClockView,
175
175
  * time: TDate | null,
@@ -189,7 +189,7 @@ process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes = {
189
189
  * Get aria-label text for switching between views button.
190
190
  * @param {CalendarPickerView} currentView The view from which we want to get the button text.
191
191
  * @returns {string} The label of the view.
192
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
192
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
193
193
  */
194
194
  getViewSwitchingButtonText: _propTypes.default.func,
195
195
  ignoreInvalidInputs: _propTypes.default.bool,
@@ -213,7 +213,7 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes = {
213
213
  * @param {TDate | null} time The current time.
214
214
  * @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
215
215
  * @returns {string} The clock label.
216
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
216
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
217
217
  * @default <TDate extends any>(
218
218
  * view: ClockView,
219
219
  * time: TDate | null,
@@ -239,7 +239,7 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes = {
239
239
  * Get aria-label text for switching between views button.
240
240
  * @param {CalendarPickerView} currentView The view from which we want to get the button text.
241
241
  * @returns {string} The label of the view.
242
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
242
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
243
243
  */
244
244
  getViewSwitchingButtonText: _propTypes.default.func,
245
245
 
@@ -167,7 +167,7 @@ process.env.NODE_ENV !== "production" ? StaticTimePicker.propTypes = {
167
167
  * @param {TDate | null} time The current time.
168
168
  * @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
169
169
  * @returns {string} The clock label.
170
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
170
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
171
171
  * @default <TDate extends any>(
172
172
  * view: ClockView,
173
173
  * time: TDate | null,
@@ -164,7 +164,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
164
164
  * @param {TDate | null} time The current time.
165
165
  * @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
166
166
  * @returns {string} The clock label.
167
- * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
167
+ * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
168
168
  * @default <TDate extends any>(
169
169
  * view: ClockView,
170
170
  * time: TDate | null,
@@ -128,11 +128,11 @@ const PickersYear = /*#__PURE__*/React.forwardRef(function PickersYear(props, fo
128
128
  const ownerState = (0, _extends2.default)({}, props, {
129
129
  wrapperVariant
130
130
  });
131
- const classes = useUtilityClasses(ownerState); // TODO: Can we just forward this to the button?
131
+ const classes = useUtilityClasses(ownerState); // We can't forward the `autoFocus` to the button because it is a native button, not a MUI Button
132
132
 
133
133
  React.useEffect(() => {
134
134
  if (autoFocus) {
135
- // `ref.current` being `null` would be a bug in MUIu
135
+ // `ref.current` being `null` would be a bug in MUI.
136
136
  ref.current.focus();
137
137
  }
138
138
  }, [autoFocus]);
@@ -17,9 +17,11 @@ var _styles = require("@mui/material/styles");
17
17
 
18
18
  var _material = require("@mui/material");
19
19
 
20
+ var _clsx = _interopRequireDefault(require("clsx"));
21
+
20
22
  var _utils = require("@mui/material/utils");
21
23
 
22
- var _clsx = _interopRequireDefault(require("clsx"));
24
+ var _utils2 = require("@mui/utils");
23
25
 
24
26
  var _PickersYear = require("./PickersYear");
25
27
 
@@ -73,7 +75,8 @@ const YearPickerRoot = (0, _styles.styled)('div', {
73
75
  flexWrap: 'wrap',
74
76
  overflowY: 'auto',
75
77
  height: '100%',
76
- margin: '0 4px'
78
+ padding: '0 4px',
79
+ maxHeight: '304px'
77
80
  });
78
81
  const YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inProps, ref) {
79
82
  const now = (0, _useUtils.useNow)();
@@ -114,7 +117,7 @@ const YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inProps, re
114
117
  const wrapperVariant = React.useContext(_WrapperVariantContext.WrapperVariantContext);
115
118
  const selectedYearRef = React.useRef(null);
116
119
  const [focusedYear, setFocusedYear] = React.useState(() => currentYear || utils.getYear(now));
117
- const [internalHasFocus, setInternalHasFocus] = (0, _utils.useControlled)({
120
+ const [internalHasFocus, setInternalHasFocus] = (0, _utils2.unstable_useControlled)({
118
121
  name: 'YearPicker',
119
122
  state: 'hasFocus',
120
123
  controlled: hasFocus,
@@ -206,8 +209,35 @@ const YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inProps, re
206
209
  }
207
210
  }, [focusedYear, changeHasFocus]);
208
211
  const nowYear = utils.getYear(now);
212
+ const scrollerRef = React.useRef(null);
213
+ const handleRef = (0, _utils.useForkRef)(ref, scrollerRef);
214
+ React.useEffect(() => {
215
+ if (autoFocus || scrollerRef.current === null) {
216
+ return;
217
+ }
218
+
219
+ const tabbableButton = scrollerRef.current.querySelector('[tabindex="0"]');
220
+
221
+ if (!tabbableButton) {
222
+ return;
223
+ } // Taken from useScroll in x-data-grid, but vertically centered
224
+
225
+
226
+ const offsetHeight = tabbableButton.offsetHeight;
227
+ const offsetTop = tabbableButton.offsetTop;
228
+ const clientHeight = scrollerRef.current.clientHeight;
229
+ const scrollTop = scrollerRef.current.scrollTop;
230
+ const elementBottom = offsetTop + offsetHeight;
231
+
232
+ if (offsetHeight > clientHeight || offsetTop < scrollTop) {
233
+ // Button already visible
234
+ return;
235
+ }
236
+
237
+ scrollerRef.current.scrollTop = elementBottom - clientHeight / 2 - offsetHeight / 2;
238
+ }, [autoFocus]);
209
239
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(YearPickerRoot, {
210
- ref: ref,
240
+ ref: handleRef,
211
241
  className: (0, _clsx.default)(classes.root, className),
212
242
  ownerState: ownerState,
213
243
  children: utils.getYearRange(minDate, maxDate).map(year => {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.0.2
1
+ /** @license MUI v5.0.4
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.faIR = void 0;
7
+
8
+ var _getPickersLocalization = require("./utils/getPickersLocalization");
9
+
10
+ const faIRPickers = {
11
+ // Calendar navigation
12
+ previousMonth: 'ماه گذشته',
13
+ nextMonth: 'ماه آینده',
14
+ // View navigation
15
+ openPreviousView: 'نمای قبلی',
16
+ openNextView: 'نمای بعدی',
17
+ calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'نمای سال باز است، رفتن به نمای تقویم' : 'نمای تقویم باز است، رفتن به نمای سال',
18
+ inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) => isKeyboardInputOpen ? `نمای ورودی متن باز است، رفتن به نمای ${viewType}` : `نمای ${viewType} باز است، رفتن به نمای ورودی متن`,
19
+ // DateRange placeholders
20
+ start: 'شروع',
21
+ end: 'پایان',
22
+ // Action bar
23
+ cancelButtonLabel: 'لغو',
24
+ clearButtonLabel: 'پاک کردن',
25
+ okButtonLabel: 'اوکی',
26
+ todayButtonLabel: 'امروز',
27
+ // Toolbar titles
28
+ datePickerDefaultToolbarTitle: 'تاریخ را انتخاب کنید',
29
+ dateTimePickerDefaultToolbarTitle: 'تاریخ و ساعت را انتخاب کنید',
30
+ timePickerDefaultToolbarTitle: 'ساعت را انتخاب کنید',
31
+ dateRangePickerDefaultToolbarTitle: 'محدوده تاریخ را انتخاب کنید',
32
+ // Clock labels
33
+ clockLabelText: (view, time, adapter) => `Select ${view}. ${time === null ? 'هیچ ساعتی انتخاب نشده است' : `ساعت انتخاب ${adapter.format(time, 'fullTime')} می باشد`}`,
34
+ hoursClockNumberText: hours => `${hours} ساعت ها`,
35
+ minutesClockNumberText: minutes => `${minutes} دقیقه ها`,
36
+ secondsClockNumberText: seconds => `${seconds} ثانیه ها`,
37
+ // Open picker labels
38
+ openDatePickerDialogue: (rawValue, utils) => rawValue && utils.isValid(utils.date(rawValue)) ? `تاریخ را انتخاب کنید، تاریخ انتخاب شده ${utils.format(utils.date(rawValue), 'fullDate')} می باشد` : 'تاریخ را انتخاب کنید',
39
+ openTimePickerDialogue: (rawValue, utils) => rawValue && utils.isValid(utils.date(rawValue)) ? `ساعت را انتخاب کنید، ساعت انتخاب شده ${utils.format(utils.date(rawValue), 'fullTime')} می باشد` : 'ساعت را انتخاب کنید',
40
+ // Table labels
41
+ timeTableLabel: 'انتخاب تاریخ',
42
+ dateTableLabel: 'انتخاب ساعت'
43
+ };
44
+ const faIR = (0, _getPickersLocalization.getPickersLocalization)(faIRPickers);
45
+ exports.faIR = faIR;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fiFI = void 0;
7
+
8
+ var _getPickersLocalization = require("./utils/getPickersLocalization");
9
+
10
+ const views = {
11
+ hours: 'tunnit',
12
+ minutes: 'minuutit',
13
+ seconds: 'sekuntit'
14
+ };
15
+ const viewTranslation = {
16
+ calendar: 'kalenteri',
17
+ clock: 'kello'
18
+ };
19
+ const fiFIPickers = {
20
+ // Calendar navigation
21
+ previousMonth: 'Edellinen kuukausi',
22
+ nextMonth: 'Seuraava kuukausi',
23
+ // View navigation
24
+ openPreviousView: 'avaa edellinen kuukausi',
25
+ openNextView: 'avaa seuraava kuukausi',
26
+ calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'vuosinäkymä on auki, vaihda kalenterinäkymään' : 'kalenterinäkymä on auki, vaihda vuosinäkymään',
27
+ inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) => isKeyboardInputOpen ? `tekstikenttä on auki, mene ${viewTranslation[viewType]}näkymään` : `${viewTranslation[viewType]}näkymä on auki, mene tekstikenttään`,
28
+ // DateRange placeholders
29
+ start: 'Alku',
30
+ end: 'Loppu',
31
+ // Action bar
32
+ cancelButtonLabel: 'Peruuta',
33
+ clearButtonLabel: 'Tyhjennä',
34
+ okButtonLabel: 'OK',
35
+ todayButtonLabel: 'Tänään',
36
+ // Toolbar titles
37
+ datePickerDefaultToolbarTitle: 'Valitse päivä',
38
+ dateTimePickerDefaultToolbarTitle: 'Valitse päivä ja aika',
39
+ timePickerDefaultToolbarTitle: 'Valitse aika',
40
+ dateRangePickerDefaultToolbarTitle: 'Valitse aikaväli',
41
+ // Clock labels
42
+ clockLabelText: (view, time, adapter) => `Valitse ${views[view]}. ${time === null ? 'Ei aikaa valittuna' : `Valittu aika on ${adapter.format(time, 'fullTime')}`}`,
43
+ hoursClockNumberText: hours => `${hours} tuntia`,
44
+ minutesClockNumberText: minutes => `${minutes} minuuttia`,
45
+ secondsClockNumberText: seconds => `${seconds} sekunttia`,
46
+ // Open picker labels
47
+ 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ä',
48
+ openTimePickerDialogue: (rawValue, utils) => rawValue && utils.isValid(utils.date(rawValue)) ? `Valitse aika, valittu aika on ${utils.format(utils.date(rawValue), 'fullTime')}` : 'Valitse aika',
49
+ // Table labels
50
+ timeTableLabel: 'valitse aika',
51
+ dateTableLabel: 'valitse päivä'
52
+ };
53
+ const fiFI = (0, _getPickersLocalization.getPickersLocalization)(fiFIPickers);
54
+ exports.fiFI = fiFI;
@@ -82,6 +82,32 @@ Object.keys(_esES).forEach(function (key) {
82
82
  });
83
83
  });
84
84
 
85
+ var _faIR = require("./faIR");
86
+
87
+ Object.keys(_faIR).forEach(function (key) {
88
+ if (key === "default" || key === "__esModule") return;
89
+ if (key in exports && exports[key] === _faIR[key]) return;
90
+ Object.defineProperty(exports, key, {
91
+ enumerable: true,
92
+ get: function () {
93
+ return _faIR[key];
94
+ }
95
+ });
96
+ });
97
+
98
+ var _fiFI = require("./fiFI");
99
+
100
+ Object.keys(_fiFI).forEach(function (key) {
101
+ if (key === "default" || key === "__esModule") return;
102
+ if (key in exports && exports[key] === _fiFI[key]) return;
103
+ Object.defineProperty(exports, key, {
104
+ enumerable: true,
105
+ get: function () {
106
+ return _fiFI[key];
107
+ }
108
+ });
109
+ });
110
+
85
111
  var _frFR = require("./frFR");
86
112
 
87
113
  Object.keys(_frFR).forEach(function (key) {
@@ -186,6 +212,19 @@ Object.keys(_isIS).forEach(function (key) {
186
212
  });
187
213
  });
188
214
 
215
+ var _jaJP = require("./jaJP");
216
+
217
+ Object.keys(_jaJP).forEach(function (key) {
218
+ if (key === "default" || key === "__esModule") return;
219
+ if (key in exports && exports[key] === _jaJP[key]) return;
220
+ Object.defineProperty(exports, key, {
221
+ enumerable: true,
222
+ get: function () {
223
+ return _jaJP[key];
224
+ }
225
+ });
226
+ });
227
+
189
228
  var _pickersLocaleTextApi = require("./utils/pickersLocaleTextApi");
190
229
 
191
230
  Object.keys(_pickersLocaleTextApi).forEach(function (key) {
@@ -7,7 +7,6 @@ exports.isIS = void 0;
7
7
 
8
8
  var _getPickersLocalization = require("./utils/getPickersLocalization");
9
9
 
10
- // This object is not Partial<PickersLocaleText> because it is the default values
11
10
  const isISPickers = {
12
11
  // Calendar navigation
13
12
  previousMonth: 'Fyrri mánuður',
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.jaJP = void 0;
7
+
8
+ var _getPickersLocalization = require("./utils/getPickersLocalization");
9
+
10
+ // maps ClockPickerView to its translation
11
+ const clockViews = {
12
+ hours: '時間',
13
+ minutes: '分',
14
+ seconds: '秒'
15
+ }; // maps PickersToolbar["viewType"] to its translation
16
+
17
+ const pickerViews = {
18
+ calendar: 'カレンダー表示',
19
+ clock: '時計表示'
20
+ };
21
+ const jaJPPickers = {
22
+ // Calendar navigation
23
+ previousMonth: '先月',
24
+ nextMonth: '来月',
25
+ // View navigation
26
+ openPreviousView: '前の表示を開く',
27
+ openNextView: '次の表示を開く',
28
+ calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? '年選択表示からカレンダー表示に切り替える' : 'カレンダー表示から年選択表示に切り替える',
29
+ inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) => isKeyboardInputOpen ? `テキスト入力表示から${pickerViews[viewType]}に切り替える` : `${pickerViews[viewType]}からテキスト入力表示に切り替える`,
30
+ // DateRange placeholders
31
+ start: '開始',
32
+ end: '終了',
33
+ // Action bar
34
+ cancelButtonLabel: 'キャンセル',
35
+ clearButtonLabel: 'クリア',
36
+ okButtonLabel: '確定',
37
+ todayButtonLabel: '今日',
38
+ // Toolbar titles
39
+ datePickerDefaultToolbarTitle: '日付を選択',
40
+ dateTimePickerDefaultToolbarTitle: '日時を選択',
41
+ timePickerDefaultToolbarTitle: '時間を選択',
42
+ dateRangePickerDefaultToolbarTitle: '日付の範囲を選択',
43
+ // Clock labels
44
+ clockLabelText: (view, time, adapter) => {
45
+ var _clockViews$view;
46
+
47
+ return `${(_clockViews$view = clockViews[view]) != null ? _clockViews$view : view}を選択してください ${time === null ? '時間が選択されていません' : `選択した時間は ${adapter.format(time, 'fullTime')} です`}`;
48
+ },
49
+ hoursClockNumberText: hours => `${hours} ${clockViews.hours}`,
50
+ minutesClockNumberText: minutes => `${minutes} ${clockViews.minutes}`,
51
+ secondsClockNumberText: seconds => `${seconds} ${clockViews.seconds}`,
52
+ // Open picker labels
53
+ openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `日付を選択してください。選択した日付は ${utils.format(value, 'fullDate')} です` : '日付を選択してください',
54
+ openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `時間を選択してください。選択した時間は ${utils.format(value, 'fullTime')} です` : '時間を選択してください',
55
+ // Table labels
56
+ timeTableLabel: '時間を選択',
57
+ dateTableLabel: '日付を選択'
58
+ };
59
+ const jaJP = (0, _getPickersLocalization.getPickersLocalization)(jaJPPickers);
60
+ exports.jaJP = jaJP;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "https://github.com/mui-org/material-ui-x.git",
32
+ "url": "https://github.com/mui/mui-x.git",
33
33
  "directory": "packages/x-date-pickers"
34
34
  },
35
35
  "dependencies": {
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });