@mui/x-date-pickers 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -7
- package/DateCalendar/DateCalendar.js +2 -2
- package/DateCalendar/PickersCalendarHeader.d.ts +2 -2
- package/DateField/DateField.js +2 -2
- package/DatePicker/DatePicker.js +2 -2
- package/DatePicker/DatePicker.types.d.ts +2 -2
- package/DatePicker/shared.d.ts +2 -2
- package/DateTimeField/DateTimeField.js +2 -2
- package/DateTimeField/DateTimeField.types.d.ts +2 -2
- package/DateTimePicker/DateTimePicker.js +2 -2
- package/DateTimePicker/DateTimePicker.types.d.ts +2 -2
- package/DateTimePicker/shared.d.ts +2 -2
- package/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -2
- package/DesktopTimePicker/DesktopTimePicker.js +2 -2
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -2
- package/MobileDatePicker/MobileDatePicker.js +2 -2
- package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -2
- package/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +2 -2
- package/MobileTimePicker/MobileTimePicker.js +2 -2
- package/MobileTimePicker/MobileTimePicker.types.d.ts +2 -2
- package/PickersLayout/PickersLayout.js +2 -2
- package/PickersLayout/PickersLayout.types.d.ts +2 -2
- package/StaticDatePicker/StaticDatePicker.js +2 -2
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -2
- package/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -2
- package/StaticTimePicker/StaticTimePicker.js +2 -2
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -2
- package/TimeClock/TimeClock.js +2 -2
- package/TimeClock/TimeClock.types.d.ts +2 -2
- package/TimeField/TimeField.js +2 -2
- package/TimeField/TimeField.types.d.ts +2 -2
- package/TimePicker/TimePicker.js +2 -2
- package/TimePicker/TimePicker.types.d.ts +2 -2
- package/TimePicker/shared.d.ts +2 -2
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +2 -2
- package/internals/components/PickersModalDialog.d.ts +2 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +13 -11
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +1 -1
- package/internals/hooks/usePicker/usePicker.js +7 -0
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +2 -2
- package/internals/hooks/useViews.js +1 -1
- package/internals/utils/slots-migration.d.ts +2 -2
- package/legacy/DateCalendar/DateCalendar.js +2 -2
- package/legacy/DateField/DateField.js +2 -2
- package/legacy/DatePicker/DatePicker.js +2 -2
- package/legacy/DateTimeField/DateTimeField.js +2 -2
- package/legacy/DateTimePicker/DateTimePicker.js +2 -2
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +2 -2
- package/legacy/MobileDatePicker/MobileDatePicker.js +2 -2
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/legacy/MobileTimePicker/MobileTimePicker.js +2 -2
- package/legacy/PickersLayout/PickersLayout.js +2 -2
- package/legacy/StaticDatePicker/StaticDatePicker.js +2 -2
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/legacy/StaticTimePicker/StaticTimePicker.js +2 -2
- package/legacy/TimeClock/TimeClock.js +2 -2
- package/legacy/TimeField/TimeField.js +2 -2
- package/legacy/TimePicker/TimePicker.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/useDesktopPicker/useDesktopPicker.js +15 -12
- package/legacy/internals/hooks/usePicker/usePicker.js +7 -0
- package/legacy/internals/hooks/useViews.js +1 -1
- package/legacy/locales/frFR.js +4 -5
- package/locales/frFR.js +4 -5
- package/modern/DateCalendar/DateCalendar.js +2 -2
- package/modern/DateField/DateField.js +2 -2
- package/modern/DatePicker/DatePicker.js +2 -2
- package/modern/DateTimeField/DateTimeField.js +2 -2
- package/modern/DateTimePicker/DateTimePicker.js +2 -2
- package/modern/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/modern/DesktopTimePicker/DesktopTimePicker.js +2 -2
- package/modern/MobileDatePicker/MobileDatePicker.js +2 -2
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/modern/MobileTimePicker/MobileTimePicker.js +2 -2
- package/modern/PickersLayout/PickersLayout.js +2 -2
- package/modern/StaticDatePicker/StaticDatePicker.js +2 -2
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/modern/StaticTimePicker/StaticTimePicker.js +2 -2
- package/modern/TimeClock/TimeClock.js +2 -2
- package/modern/TimeField/TimeField.js +2 -2
- package/modern/TimePicker/TimePicker.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +13 -11
- package/modern/internals/hooks/usePicker/usePicker.js +7 -0
- package/modern/internals/hooks/useViews.js +1 -1
- package/modern/locales/frFR.js +4 -5
- package/node/DateCalendar/DateCalendar.js +2 -2
- package/node/DateField/DateField.js +2 -2
- package/node/DatePicker/DatePicker.js +2 -2
- package/node/DateTimeField/DateTimeField.js +2 -2
- package/node/DateTimePicker/DateTimePicker.js +2 -2
- package/node/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/node/DesktopTimePicker/DesktopTimePicker.js +2 -2
- package/node/MobileDatePicker/MobileDatePicker.js +2 -2
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/node/MobileTimePicker/MobileTimePicker.js +2 -2
- package/node/PickersLayout/PickersLayout.js +2 -2
- package/node/StaticDatePicker/StaticDatePicker.js +2 -2
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/node/StaticTimePicker/StaticTimePicker.js +2 -2
- package/node/TimeClock/TimeClock.js +2 -2
- package/node/TimeField/TimeField.js +2 -2
- package/node/TimePicker/TimePicker.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +13 -11
- package/node/internals/hooks/usePicker/usePicker.js +7 -0
- package/node/internals/hooks/useViews.js +1 -1
- package/node/locales/frFR.js +4 -5
- package/package.json +2 -2
|
@@ -75,7 +75,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
75
75
|
*/
|
|
76
76
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Overridable components.
|
|
79
79
|
* @default {}
|
|
80
80
|
* @deprecated Please use `slots`.
|
|
81
81
|
*/
|
|
@@ -265,7 +265,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
265
265
|
*/
|
|
266
266
|
slotProps: PropTypes.object,
|
|
267
267
|
/**
|
|
268
|
-
*
|
|
268
|
+
* Overridable component slots.
|
|
269
269
|
* @default {}
|
|
270
270
|
*/
|
|
271
271
|
slots: PropTypes.object,
|
|
@@ -63,7 +63,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
63
63
|
*/
|
|
64
64
|
closeOnSelect: PropTypes.bool,
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Overridable components.
|
|
67
67
|
* @default {}
|
|
68
68
|
* @deprecated Please use `slots`.
|
|
69
69
|
*/
|
|
@@ -240,7 +240,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
240
240
|
*/
|
|
241
241
|
slotProps: PropTypes.object,
|
|
242
242
|
/**
|
|
243
|
-
*
|
|
243
|
+
* Overridable component slots.
|
|
244
244
|
* @default {}
|
|
245
245
|
*/
|
|
246
246
|
slots: PropTypes.object,
|
package/legacy/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["ownerState"]
|
|
4
|
+
var _excluded = ["ownerState"],
|
|
5
|
+
_excluded2 = ["ownerState"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import { useSlotProps } from '@mui/base/utils';
|
|
7
8
|
import MuiInputAdornment from '@mui/material/InputAdornment';
|
|
@@ -60,16 +61,18 @@ export var useDesktopPicker = function useDesktopPicker(_ref) {
|
|
|
60
61
|
shouldRestoreFocus = _usePicker.shouldRestoreFocus,
|
|
61
62
|
pickerFieldProps = _usePicker.fieldProps;
|
|
62
63
|
var InputAdornment = (_slots$inputAdornment = slots.inputAdornment) != null ? _slots$inputAdornment : MuiInputAdornment;
|
|
63
|
-
var inputAdornmentProps = useSlotProps({
|
|
64
|
-
elementType: InputAdornment,
|
|
65
|
-
externalSlotProps: innerSlotProps == null ? void 0 : innerSlotProps.inputAdornment,
|
|
66
|
-
additionalProps: {
|
|
67
|
-
position: 'end'
|
|
68
|
-
},
|
|
69
|
-
ownerState: props
|
|
70
|
-
});
|
|
71
|
-
var OpenPickerButton = (_slots$openPickerButt = slots.openPickerButton) != null ? _slots$openPickerButt : IconButton;
|
|
72
64
|
var _useSlotProps = useSlotProps({
|
|
65
|
+
elementType: InputAdornment,
|
|
66
|
+
externalSlotProps: innerSlotProps == null ? void 0 : innerSlotProps.inputAdornment,
|
|
67
|
+
additionalProps: {
|
|
68
|
+
position: 'end'
|
|
69
|
+
},
|
|
70
|
+
ownerState: props
|
|
71
|
+
}),
|
|
72
|
+
inputAdornmentOwnerState = _useSlotProps.ownerState,
|
|
73
|
+
inputAdornmentProps = _objectWithoutProperties(_useSlotProps, _excluded);
|
|
74
|
+
var OpenPickerButton = (_slots$openPickerButt = slots.openPickerButton) != null ? _slots$openPickerButt : IconButton;
|
|
75
|
+
var _useSlotProps2 = useSlotProps({
|
|
73
76
|
elementType: OpenPickerButton,
|
|
74
77
|
externalSlotProps: innerSlotProps == null ? void 0 : innerSlotProps.openPickerButton,
|
|
75
78
|
additionalProps: {
|
|
@@ -80,8 +83,8 @@ export var useDesktopPicker = function useDesktopPicker(_ref) {
|
|
|
80
83
|
},
|
|
81
84
|
ownerState: props
|
|
82
85
|
}),
|
|
83
|
-
openPickerButtonOwnerState =
|
|
84
|
-
openPickerButtonProps = _objectWithoutProperties(
|
|
86
|
+
openPickerButtonOwnerState = _useSlotProps2.ownerState,
|
|
87
|
+
openPickerButtonProps = _objectWithoutProperties(_useSlotProps2, _excluded2);
|
|
85
88
|
var OpenPickerIcon = slots.openPickerIcon;
|
|
86
89
|
var Field = slots.field;
|
|
87
90
|
var fieldProps = useSlotProps({
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { usePickerValue } from './usePickerValue';
|
|
2
2
|
import { usePickerViews } from './usePickerViews';
|
|
3
3
|
import { usePickerLayoutProps } from './usePickerLayoutProps';
|
|
4
|
+
import { buildWarning } from '../../utils/warning';
|
|
5
|
+
var warnRenderInputIsDefined = buildWarning(['The `renderInput` prop has been removed in version 6.0 of the Date and Time Pickers.', 'You can replace it with the `textField` component slot in most cases.', 'For more information, please have a look at the migration guide (https://mui.com/x/migration/migration-pickers-v5/#input-renderer-required-in-v5).']);
|
|
4
6
|
export var usePicker = function usePicker(_ref) {
|
|
5
7
|
var props = _ref.props,
|
|
6
8
|
valueManager = _ref.valueManager,
|
|
@@ -9,6 +11,11 @@ export var usePicker = function usePicker(_ref) {
|
|
|
9
11
|
additionalViewProps = _ref.additionalViewProps,
|
|
10
12
|
validator = _ref.validator,
|
|
11
13
|
autoFocusView = _ref.autoFocusView;
|
|
14
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
15
|
+
if (props.renderInput != null) {
|
|
16
|
+
warnRenderInputIsDefined();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
12
19
|
var pickerValueResponse = usePickerValue({
|
|
13
20
|
props: props,
|
|
14
21
|
valueManager: valueManager,
|
|
@@ -75,7 +75,7 @@ export function useViews(_ref) {
|
|
|
75
75
|
// Blur event
|
|
76
76
|
setFocusedView(function (prevFocusedView) {
|
|
77
77
|
return viewToFocus === prevFocusedView ? null : prevFocusedView;
|
|
78
|
-
} // If false the blur is due to view
|
|
78
|
+
} // If false the blur is due to view switching
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
|
package/legacy/locales/frFR.js
CHANGED
|
@@ -23,11 +23,10 @@ var frFRPickers = {
|
|
|
23
23
|
okButtonLabel: 'OK',
|
|
24
24
|
todayButtonLabel: "Aujourd'hui",
|
|
25
25
|
// Toolbar titles
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
datePickerToolbarTitle: 'Choisir une date',
|
|
27
|
+
dateTimePickerToolbarTitle: "Choisir la date et l'heure",
|
|
28
|
+
timePickerToolbarTitle: "Choisir l'heure",
|
|
29
|
+
dateRangePickerToolbarTitle: 'Choisir la plage de dates',
|
|
31
30
|
// Clock labels
|
|
32
31
|
clockLabelText: function clockLabelText(view, time, adapter) {
|
|
33
32
|
return "Choix des ".concat(views[view], ". ").concat(time === null ? 'Aucune heure choisie' : "L'heure choisie est ".concat(adapter.format(time, 'fullTime')));
|
package/locales/frFR.js
CHANGED
|
@@ -21,11 +21,10 @@ const frFRPickers = {
|
|
|
21
21
|
okButtonLabel: 'OK',
|
|
22
22
|
todayButtonLabel: "Aujourd'hui",
|
|
23
23
|
// Toolbar titles
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
datePickerToolbarTitle: 'Choisir une date',
|
|
25
|
+
dateTimePickerToolbarTitle: "Choisir la date et l'heure",
|
|
26
|
+
timePickerToolbarTitle: "Choisir l'heure",
|
|
27
|
+
dateRangePickerToolbarTitle: 'Choisir la plage de dates',
|
|
29
28
|
// Clock labels
|
|
30
29
|
clockLabelText: (view, time, adapter) => `Choix des ${views[view]}. ${time === null ? 'Aucune heure choisie' : `L'heure choisie est ${adapter.format(time, 'fullTime')}`}`,
|
|
31
30
|
hoursClockNumberText: hours => `${hours} heures`,
|
|
@@ -339,7 +339,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
339
339
|
classes: PropTypes.object,
|
|
340
340
|
className: PropTypes.string,
|
|
341
341
|
/**
|
|
342
|
-
*
|
|
342
|
+
* Overridable components.
|
|
343
343
|
* @default {}
|
|
344
344
|
* @deprecated Please use `slots`.
|
|
345
345
|
*/
|
|
@@ -511,7 +511,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
511
511
|
*/
|
|
512
512
|
slotProps: PropTypes.object,
|
|
513
513
|
/**
|
|
514
|
-
*
|
|
514
|
+
* Overridable component slots.
|
|
515
515
|
* @default {}
|
|
516
516
|
*/
|
|
517
517
|
slots: PropTypes.object,
|
|
@@ -75,7 +75,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
75
75
|
*/
|
|
76
76
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Overridable components.
|
|
79
79
|
* @default {}
|
|
80
80
|
* @deprecated Please use `slots`.
|
|
81
81
|
*/
|
|
@@ -259,7 +259,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
259
259
|
*/
|
|
260
260
|
slotProps: PropTypes.object,
|
|
261
261
|
/**
|
|
262
|
-
*
|
|
262
|
+
* Overridable component slots.
|
|
263
263
|
* @default {}
|
|
264
264
|
*/
|
|
265
265
|
slots: PropTypes.object,
|
|
@@ -54,7 +54,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
54
54
|
*/
|
|
55
55
|
closeOnSelect: PropTypes.bool,
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Overridable components.
|
|
58
58
|
* @default {}
|
|
59
59
|
* @deprecated Please use `slots`.
|
|
60
60
|
*/
|
|
@@ -296,7 +296,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
296
296
|
*/
|
|
297
297
|
slotProps: PropTypes.object,
|
|
298
298
|
/**
|
|
299
|
-
*
|
|
299
|
+
* Overridable component slots.
|
|
300
300
|
* @default {}
|
|
301
301
|
*/
|
|
302
302
|
slots: PropTypes.object,
|
|
@@ -80,7 +80,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
80
80
|
*/
|
|
81
81
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Overridable components.
|
|
84
84
|
* @default {}
|
|
85
85
|
* @deprecated Please use `slots`.
|
|
86
86
|
*/
|
|
@@ -307,7 +307,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
307
307
|
*/
|
|
308
308
|
slotProps: PropTypes.object,
|
|
309
309
|
/**
|
|
310
|
-
*
|
|
310
|
+
* Overridable component slots.
|
|
311
311
|
* @default {}
|
|
312
312
|
*/
|
|
313
313
|
slots: PropTypes.object,
|
|
@@ -64,7 +64,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
64
64
|
*/
|
|
65
65
|
closeOnSelect: PropTypes.bool,
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* Overridable components.
|
|
68
68
|
* @default {}
|
|
69
69
|
* @deprecated Please use `slots`.
|
|
70
70
|
*/
|
|
@@ -349,7 +349,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
349
349
|
*/
|
|
350
350
|
slotProps: PropTypes.object,
|
|
351
351
|
/**
|
|
352
|
-
*
|
|
352
|
+
* Overridable component slots.
|
|
353
353
|
* @default {}
|
|
354
354
|
*/
|
|
355
355
|
slots: PropTypes.object,
|
|
@@ -72,7 +72,7 @@ DesktopDatePicker.propTypes = {
|
|
|
72
72
|
*/
|
|
73
73
|
closeOnSelect: PropTypes.bool,
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* Overridable components.
|
|
76
76
|
* @default {}
|
|
77
77
|
* @deprecated Please use `slots`.
|
|
78
78
|
*/
|
|
@@ -308,7 +308,7 @@ DesktopDatePicker.propTypes = {
|
|
|
308
308
|
*/
|
|
309
309
|
slotProps: PropTypes.object,
|
|
310
310
|
/**
|
|
311
|
-
*
|
|
311
|
+
* Overridable component slots.
|
|
312
312
|
* @default {}
|
|
313
313
|
*/
|
|
314
314
|
slots: PropTypes.object,
|
|
@@ -90,7 +90,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
90
90
|
*/
|
|
91
91
|
closeOnSelect: PropTypes.bool,
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* Overridable components.
|
|
94
94
|
* @default {}
|
|
95
95
|
* @deprecated Please use `slots`.
|
|
96
96
|
*/
|
|
@@ -369,7 +369,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
369
369
|
*/
|
|
370
370
|
slotProps: PropTypes.object,
|
|
371
371
|
/**
|
|
372
|
-
*
|
|
372
|
+
* Overridable component slots.
|
|
373
373
|
* @default {}
|
|
374
374
|
*/
|
|
375
375
|
slots: PropTypes.object,
|
|
@@ -82,7 +82,7 @@ DesktopTimePicker.propTypes = {
|
|
|
82
82
|
*/
|
|
83
83
|
closeOnSelect: PropTypes.bool,
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Overridable components.
|
|
86
86
|
* @default {}
|
|
87
87
|
* @deprecated Please use `slots`.
|
|
88
88
|
*/
|
|
@@ -253,7 +253,7 @@ DesktopTimePicker.propTypes = {
|
|
|
253
253
|
*/
|
|
254
254
|
slotProps: PropTypes.object,
|
|
255
255
|
/**
|
|
256
|
-
*
|
|
256
|
+
* Overridable component slots.
|
|
257
257
|
* @default {}
|
|
258
258
|
*/
|
|
259
259
|
slots: PropTypes.object,
|
|
@@ -69,7 +69,7 @@ MobileDatePicker.propTypes = {
|
|
|
69
69
|
*/
|
|
70
70
|
closeOnSelect: PropTypes.bool,
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Overridable components.
|
|
73
73
|
* @default {}
|
|
74
74
|
* @deprecated Please use `slots`.
|
|
75
75
|
*/
|
|
@@ -305,7 +305,7 @@ MobileDatePicker.propTypes = {
|
|
|
305
305
|
*/
|
|
306
306
|
slotProps: PropTypes.object,
|
|
307
307
|
/**
|
|
308
|
-
*
|
|
308
|
+
* Overridable component slots.
|
|
309
309
|
* @default {}
|
|
310
310
|
*/
|
|
311
311
|
slots: PropTypes.object,
|
|
@@ -88,7 +88,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
88
88
|
*/
|
|
89
89
|
closeOnSelect: PropTypes.bool,
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* Overridable components.
|
|
92
92
|
* @default {}
|
|
93
93
|
* @deprecated Please use `slots`.
|
|
94
94
|
*/
|
|
@@ -367,7 +367,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
367
367
|
*/
|
|
368
368
|
slotProps: PropTypes.object,
|
|
369
369
|
/**
|
|
370
|
-
*
|
|
370
|
+
* Overridable component slots.
|
|
371
371
|
* @default {}
|
|
372
372
|
*/
|
|
373
373
|
slots: PropTypes.object,
|
|
@@ -81,7 +81,7 @@ MobileTimePicker.propTypes = {
|
|
|
81
81
|
*/
|
|
82
82
|
closeOnSelect: PropTypes.bool,
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Overridable components.
|
|
85
85
|
* @default {}
|
|
86
86
|
* @deprecated Please use `slots`.
|
|
87
87
|
*/
|
|
@@ -252,7 +252,7 @@ MobileTimePicker.propTypes = {
|
|
|
252
252
|
*/
|
|
253
253
|
slotProps: PropTypes.object,
|
|
254
254
|
/**
|
|
255
|
-
*
|
|
255
|
+
* Overridable component slots.
|
|
256
256
|
* @default {}
|
|
257
257
|
*/
|
|
258
258
|
slots: PropTypes.object,
|
|
@@ -115,7 +115,7 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
115
115
|
classes: PropTypes.object,
|
|
116
116
|
className: PropTypes.string,
|
|
117
117
|
/**
|
|
118
|
-
*
|
|
118
|
+
* Overridable components.
|
|
119
119
|
* @default {}
|
|
120
120
|
* @deprecated Please use `slots`.
|
|
121
121
|
*/
|
|
@@ -149,7 +149,7 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
|
149
149
|
*/
|
|
150
150
|
slotProps: PropTypes.object,
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
152
|
+
* Overridable component slots.
|
|
153
153
|
* @default {}
|
|
154
154
|
*/
|
|
155
155
|
slots: PropTypes.object,
|
|
@@ -53,7 +53,7 @@ StaticDatePicker.propTypes = {
|
|
|
53
53
|
*/
|
|
54
54
|
className: PropTypes.string,
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Overridable components.
|
|
57
57
|
* @default {}
|
|
58
58
|
* @deprecated Please use `slots`.
|
|
59
59
|
*/
|
|
@@ -247,7 +247,7 @@ StaticDatePicker.propTypes = {
|
|
|
247
247
|
*/
|
|
248
248
|
slotProps: PropTypes.object,
|
|
249
249
|
/**
|
|
250
|
-
*
|
|
250
|
+
* Overridable component slots.
|
|
251
251
|
* @default {}
|
|
252
252
|
*/
|
|
253
253
|
slots: PropTypes.object,
|
|
@@ -73,7 +73,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
73
73
|
*/
|
|
74
74
|
className: PropTypes.string,
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* Overridable components.
|
|
77
77
|
* @default {}
|
|
78
78
|
* @deprecated Please use `slots`.
|
|
79
79
|
*/
|
|
@@ -310,7 +310,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
310
310
|
*/
|
|
311
311
|
slotProps: PropTypes.object,
|
|
312
312
|
/**
|
|
313
|
-
*
|
|
313
|
+
* Overridable component slots.
|
|
314
314
|
* @default {}
|
|
315
315
|
*/
|
|
316
316
|
slots: PropTypes.object,
|
|
@@ -65,7 +65,7 @@ StaticTimePicker.propTypes = {
|
|
|
65
65
|
*/
|
|
66
66
|
className: PropTypes.string,
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* Overridable components.
|
|
69
69
|
* @default {}
|
|
70
70
|
* @deprecated Please use `slots`.
|
|
71
71
|
*/
|
|
@@ -194,7 +194,7 @@ StaticTimePicker.propTypes = {
|
|
|
194
194
|
*/
|
|
195
195
|
slotProps: PropTypes.object,
|
|
196
196
|
/**
|
|
197
|
-
*
|
|
197
|
+
* Overridable component slots.
|
|
198
198
|
* @default {}
|
|
199
199
|
*/
|
|
200
200
|
slots: PropTypes.object,
|
|
@@ -321,7 +321,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
321
321
|
classes: PropTypes.object,
|
|
322
322
|
className: PropTypes.string,
|
|
323
323
|
/**
|
|
324
|
-
*
|
|
324
|
+
* Overridable components.
|
|
325
325
|
* @default {}
|
|
326
326
|
* @deprecated Please use `slots`.
|
|
327
327
|
*/
|
|
@@ -416,7 +416,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
416
416
|
*/
|
|
417
417
|
slotProps: PropTypes.object,
|
|
418
418
|
/**
|
|
419
|
-
*
|
|
419
|
+
* Overridable component slots.
|
|
420
420
|
* @default {}
|
|
421
421
|
*/
|
|
422
422
|
slots: PropTypes.object,
|
|
@@ -80,7 +80,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
80
80
|
*/
|
|
81
81
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Overridable components.
|
|
84
84
|
* @default {}
|
|
85
85
|
* @deprecated Please use `slots`.
|
|
86
86
|
*/
|
|
@@ -270,7 +270,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
270
270
|
*/
|
|
271
271
|
slotProps: PropTypes.object,
|
|
272
272
|
/**
|
|
273
|
-
*
|
|
273
|
+
* Overridable component slots.
|
|
274
274
|
* @default {}
|
|
275
275
|
*/
|
|
276
276
|
slots: PropTypes.object,
|
|
@@ -64,7 +64,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
64
64
|
*/
|
|
65
65
|
closeOnSelect: PropTypes.bool,
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* Overridable components.
|
|
68
68
|
* @default {}
|
|
69
69
|
* @deprecated Please use `slots`.
|
|
70
70
|
*/
|
|
@@ -241,7 +241,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
241
241
|
*/
|
|
242
242
|
slotProps: PropTypes.object,
|
|
243
243
|
/**
|
|
244
|
-
*
|
|
244
|
+
* Overridable component slots.
|
|
245
245
|
* @default {}
|
|
246
246
|
*/
|
|
247
247
|
slots: PropTypes.object,
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["ownerState"]
|
|
3
|
+
const _excluded = ["ownerState"],
|
|
4
|
+
_excluded2 = ["ownerState"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import { useSlotProps } from '@mui/base/utils';
|
|
6
7
|
import MuiInputAdornment from '@mui/material/InputAdornment';
|
|
@@ -62,16 +63,17 @@ export const useDesktopPicker = ({
|
|
|
62
63
|
wrapperVariant: 'desktop'
|
|
63
64
|
});
|
|
64
65
|
const InputAdornment = slots.inputAdornment ?? MuiInputAdornment;
|
|
65
|
-
const inputAdornmentProps = useSlotProps({
|
|
66
|
-
elementType: InputAdornment,
|
|
67
|
-
externalSlotProps: innerSlotProps?.inputAdornment,
|
|
68
|
-
additionalProps: {
|
|
69
|
-
position: 'end'
|
|
70
|
-
},
|
|
71
|
-
ownerState: props
|
|
72
|
-
});
|
|
73
|
-
const OpenPickerButton = slots.openPickerButton ?? IconButton;
|
|
74
66
|
const _useSlotProps = useSlotProps({
|
|
67
|
+
elementType: InputAdornment,
|
|
68
|
+
externalSlotProps: innerSlotProps?.inputAdornment,
|
|
69
|
+
additionalProps: {
|
|
70
|
+
position: 'end'
|
|
71
|
+
},
|
|
72
|
+
ownerState: props
|
|
73
|
+
}),
|
|
74
|
+
inputAdornmentProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded);
|
|
75
|
+
const OpenPickerButton = slots.openPickerButton ?? IconButton;
|
|
76
|
+
const _useSlotProps2 = useSlotProps({
|
|
75
77
|
elementType: OpenPickerButton,
|
|
76
78
|
externalSlotProps: innerSlotProps?.openPickerButton,
|
|
77
79
|
additionalProps: {
|
|
@@ -82,7 +84,7 @@ export const useDesktopPicker = ({
|
|
|
82
84
|
},
|
|
83
85
|
ownerState: props
|
|
84
86
|
}),
|
|
85
|
-
openPickerButtonProps = _objectWithoutPropertiesLoose(
|
|
87
|
+
openPickerButtonProps = _objectWithoutPropertiesLoose(_useSlotProps2, _excluded2);
|
|
86
88
|
const OpenPickerIcon = slots.openPickerIcon;
|
|
87
89
|
const Field = slots.field;
|
|
88
90
|
const fieldProps = useSlotProps({
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { usePickerValue } from './usePickerValue';
|
|
2
2
|
import { usePickerViews } from './usePickerViews';
|
|
3
3
|
import { usePickerLayoutProps } from './usePickerLayoutProps';
|
|
4
|
+
import { buildWarning } from '../../utils/warning';
|
|
5
|
+
const warnRenderInputIsDefined = buildWarning(['The `renderInput` prop has been removed in version 6.0 of the Date and Time Pickers.', 'You can replace it with the `textField` component slot in most cases.', 'For more information, please have a look at the migration guide (https://mui.com/x/migration/migration-pickers-v5/#input-renderer-required-in-v5).']);
|
|
4
6
|
export const usePicker = ({
|
|
5
7
|
props,
|
|
6
8
|
valueManager,
|
|
@@ -10,6 +12,11 @@ export const usePicker = ({
|
|
|
10
12
|
validator,
|
|
11
13
|
autoFocusView
|
|
12
14
|
}) => {
|
|
15
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
16
|
+
if (props.renderInput != null) {
|
|
17
|
+
warnRenderInputIsDefined();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
13
20
|
const pickerValueResponse = usePickerValue({
|
|
14
21
|
props,
|
|
15
22
|
valueManager,
|
|
@@ -66,7 +66,7 @@ export function useViews({
|
|
|
66
66
|
setFocusedView(viewToFocus);
|
|
67
67
|
} else {
|
|
68
68
|
// Blur event
|
|
69
|
-
setFocusedView(prevFocusedView => viewToFocus === prevFocusedView ? null : prevFocusedView // If false the blur is due to view
|
|
69
|
+
setFocusedView(prevFocusedView => viewToFocus === prevFocusedView ? null : prevFocusedView // If false the blur is due to view switching
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
|
package/modern/locales/frFR.js
CHANGED
|
@@ -21,11 +21,10 @@ const frFRPickers = {
|
|
|
21
21
|
okButtonLabel: 'OK',
|
|
22
22
|
todayButtonLabel: "Aujourd'hui",
|
|
23
23
|
// Toolbar titles
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
datePickerToolbarTitle: 'Choisir une date',
|
|
25
|
+
dateTimePickerToolbarTitle: "Choisir la date et l'heure",
|
|
26
|
+
timePickerToolbarTitle: "Choisir l'heure",
|
|
27
|
+
dateRangePickerToolbarTitle: 'Choisir la plage de dates',
|
|
29
28
|
// Clock labels
|
|
30
29
|
clockLabelText: (view, time, adapter) => `Choix des ${views[view]}. ${time === null ? 'Aucune heure choisie' : `L'heure choisie est ${adapter.format(time, 'fullTime')}`}`,
|
|
31
30
|
hoursClockNumberText: hours => `${hours} heures`,
|
|
@@ -348,7 +348,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
348
348
|
classes: _propTypes.default.object,
|
|
349
349
|
className: _propTypes.default.string,
|
|
350
350
|
/**
|
|
351
|
-
*
|
|
351
|
+
* Overridable components.
|
|
352
352
|
* @default {}
|
|
353
353
|
* @deprecated Please use `slots`.
|
|
354
354
|
*/
|
|
@@ -520,7 +520,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
520
520
|
*/
|
|
521
521
|
slotProps: _propTypes.default.object,
|
|
522
522
|
/**
|
|
523
|
-
*
|
|
523
|
+
* Overridable component slots.
|
|
524
524
|
* @default {}
|
|
525
525
|
*/
|
|
526
526
|
slots: _propTypes.default.object,
|
|
@@ -85,7 +85,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
85
85
|
*/
|
|
86
86
|
color: _propTypes.default.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* Overridable components.
|
|
89
89
|
* @default {}
|
|
90
90
|
* @deprecated Please use `slots`.
|
|
91
91
|
*/
|
|
@@ -269,7 +269,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
269
269
|
*/
|
|
270
270
|
slotProps: _propTypes.default.object,
|
|
271
271
|
/**
|
|
272
|
-
*
|
|
272
|
+
* Overridable component slots.
|
|
273
273
|
* @default {}
|
|
274
274
|
*/
|
|
275
275
|
slots: _propTypes.default.object,
|
|
@@ -64,7 +64,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
64
64
|
*/
|
|
65
65
|
closeOnSelect: _propTypes.default.bool,
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* Overridable components.
|
|
68
68
|
* @default {}
|
|
69
69
|
* @deprecated Please use `slots`.
|
|
70
70
|
*/
|
|
@@ -306,7 +306,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
306
306
|
*/
|
|
307
307
|
slotProps: _propTypes.default.object,
|
|
308
308
|
/**
|
|
309
|
-
*
|
|
309
|
+
* Overridable component slots.
|
|
310
310
|
* @default {}
|
|
311
311
|
*/
|
|
312
312
|
slots: _propTypes.default.object,
|