@mui/x-date-pickers 8.3.1 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -0
- package/DateCalendar/DateCalendar.js +1 -0
- package/DateField/DateField.js +1 -0
- package/DatePicker/DatePicker.js +1 -0
- package/DatePicker/DatePickerToolbar.js +1 -0
- package/DateTimeField/DateTimeField.js +1 -0
- package/DateTimePicker/DateTimePicker.js +1 -0
- package/DateTimePicker/DateTimePickerTabs.js +1 -0
- package/DateTimePicker/DateTimePickerToolbar.js +1 -0
- package/DesktopDatePicker/DesktopDatePicker.js +1 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -0
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -0
- package/DesktopTimePicker/DesktopTimePicker.js +1 -0
- package/DigitalClock/DigitalClock.js +1 -0
- package/LocalizationProvider/LocalizationProvider.js +2 -3
- package/MobileDatePicker/MobileDatePicker.js +1 -0
- package/MobileDateTimePicker/MobileDateTimePicker.js +1 -0
- package/MobileTimePicker/MobileTimePicker.js +1 -0
- package/MonthCalendar/MonthCalendar.js +1 -0
- package/MonthCalendar/MonthCalendarButton.js +2 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -4
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -1
- package/PickersActionBar/PickersActionBar.js +2 -1
- package/PickersCalendarHeader/PickersCalendarHeader.js +1 -0
- package/PickersDay/PickersDay.js +3 -1
- package/PickersLayout/PickersLayout.js +1 -0
- package/PickersSectionList/PickersSectionList.js +1 -0
- package/PickersTextField/PickersFilledInput/PickersFilledInput.js +1 -0
- package/PickersTextField/PickersInput/PickersInput.js +1 -0
- package/PickersTextField/PickersInputBase/PickersInputBase.js +1 -0
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +1 -0
- package/PickersTextField/PickersTextField.js +4 -1
- package/PickersTextField/usePickerTextFieldOwnerState.js +1 -0
- package/StaticDatePicker/StaticDatePicker.js +1 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +1 -0
- package/StaticTimePicker/StaticTimePicker.js +1 -0
- package/TimeClock/TimeClock.js +1 -0
- package/TimeField/TimeField.js +1 -0
- package/TimePicker/TimePicker.js +1 -0
- package/YearCalendar/YearCalendar.js +1 -0
- package/YearCalendar/YearCalendarButton.js +2 -1
- package/dateViewRenderers/dateViewRenderers.js +2 -1
- package/esm/DateCalendar/DateCalendar.js +1 -0
- package/esm/DateField/DateField.js +1 -0
- package/esm/DatePicker/DatePicker.js +1 -0
- package/esm/DatePicker/DatePickerToolbar.js +1 -0
- package/esm/DateTimeField/DateTimeField.js +1 -0
- package/esm/DateTimePicker/DateTimePicker.js +1 -0
- package/esm/DateTimePicker/DateTimePickerTabs.js +1 -0
- package/esm/DateTimePicker/DateTimePickerToolbar.js +1 -0
- package/esm/DesktopDatePicker/DesktopDatePicker.js +1 -0
- package/esm/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -0
- package/esm/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -0
- package/esm/DesktopTimePicker/DesktopTimePicker.js +1 -0
- package/esm/DigitalClock/DigitalClock.js +1 -0
- package/esm/LocalizationProvider/LocalizationProvider.js +2 -3
- package/esm/MobileDatePicker/MobileDatePicker.js +1 -0
- package/esm/MobileDateTimePicker/MobileDateTimePicker.js +1 -0
- package/esm/MobileTimePicker/MobileTimePicker.js +1 -0
- package/esm/MonthCalendar/MonthCalendar.js +1 -0
- package/esm/MonthCalendar/MonthCalendarButton.js +2 -1
- package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/esm/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -1
- package/esm/PickersActionBar/PickersActionBar.js +1 -0
- package/esm/PickersCalendarHeader/PickersCalendarHeader.js +1 -0
- package/esm/PickersDay/PickersDay.js +3 -1
- package/esm/PickersLayout/PickersLayout.js +1 -0
- package/esm/PickersSectionList/PickersSectionList.js +1 -0
- package/esm/PickersTextField/PickersFilledInput/PickersFilledInput.js +1 -0
- package/esm/PickersTextField/PickersInput/PickersInput.js +1 -0
- package/esm/PickersTextField/PickersInputBase/PickersInputBase.js +1 -0
- package/esm/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +1 -0
- package/esm/PickersTextField/PickersTextField.js +4 -1
- package/esm/PickersTextField/usePickerTextFieldOwnerState.js +1 -0
- package/esm/StaticDatePicker/StaticDatePicker.js +1 -0
- package/esm/StaticDateTimePicker/StaticDateTimePicker.js +1 -0
- package/esm/StaticTimePicker/StaticTimePicker.js +1 -0
- package/esm/TimeClock/TimeClock.js +1 -0
- package/esm/TimeField/TimeField.js +1 -0
- package/esm/TimePicker/TimePicker.js +1 -0
- package/esm/YearCalendar/YearCalendar.js +1 -0
- package/esm/YearCalendar/YearCalendarButton.js +2 -1
- package/esm/dateViewRenderers/dateViewRenderers.js +2 -1
- package/esm/hooks/useIsValidValue.js +1 -0
- package/esm/hooks/usePickerContext.js +1 -0
- package/esm/index.js +1 -1
- package/esm/internals/components/PickerFieldUI.js +1 -0
- package/esm/internals/components/PickerPopper/PickerPopper.js +1 -0
- package/esm/internals/components/PickerProvider.js +2 -0
- package/esm/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -1
- package/esm/internals/components/PickersToolbar.js +2 -1
- package/esm/internals/components/PickersToolbarButton.js +2 -1
- package/esm/internals/components/PickersToolbarText.js +2 -1
- package/esm/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -0
- package/esm/internals/hooks/useField/useFieldCharacterEditing.js +27 -11
- package/esm/internals/hooks/useField/useFieldSectionContainerProps.js +2 -3
- package/esm/internals/hooks/useField/useFieldSectionContentProps.js +2 -2
- package/esm/internals/hooks/useField/useFieldState.js +2 -2
- package/esm/internals/hooks/useMobilePicker/useMobilePicker.js +1 -0
- package/esm/internals/hooks/useNullableFieldPrivateContext.js +1 -0
- package/esm/internals/hooks/useStaticPicker/useStaticPicker.js +1 -0
- package/esm/timeViewRenderers/timeViewRenderers.js +4 -1
- package/hooks/useIsValidValue.js +1 -0
- package/hooks/usePickerContext.js +1 -0
- package/index.js +1 -1
- package/internals/components/PickerFieldUI.js +1 -0
- package/internals/components/PickerPopper/PickerPopper.js +1 -0
- package/internals/components/PickerProvider.js +2 -0
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -1
- package/internals/components/PickersToolbar.js +2 -1
- package/internals/components/PickersToolbarButton.js +2 -1
- package/internals/components/PickersToolbarText.js +2 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +1 -0
- package/internals/hooks/useField/useFieldCharacterEditing.js +27 -11
- package/internals/hooks/useField/useFieldSectionContainerProps.js +2 -4
- package/internals/hooks/useField/useFieldSectionContentProps.js +2 -2
- package/internals/hooks/useField/useFieldState.js +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.js +1 -0
- package/internals/hooks/useNullableFieldPrivateContext.js +1 -0
- package/internals/hooks/useStaticPicker/useStaticPicker.js +1 -0
- package/package.json +2 -2
- package/timeViewRenderers/timeViewRenderers.js +4 -1
|
@@ -108,6 +108,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
108
108
|
})]
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
|
+
if (process.env.NODE_ENV !== "production") DateTimePickerTabs.displayName = "DateTimePickerTabs";
|
|
111
112
|
process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
112
113
|
// ----------------------------- Warning --------------------------------
|
|
113
114
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -217,6 +217,7 @@ export const DateTimePickerToolbarOverrideContext = /*#__PURE__*/React.createCon
|
|
|
217
217
|
*
|
|
218
218
|
* - [DateTimePickerToolbar API](https://mui.com/x/api/date-pickers/date-time-picker-toolbar/)
|
|
219
219
|
*/
|
|
220
|
+
if (process.env.NODE_ENV !== "production") DateTimePickerToolbarOverrideContext.displayName = "DateTimePickerToolbarOverrideContext";
|
|
220
221
|
function DateTimePickerToolbar(inProps) {
|
|
221
222
|
const props = useThemeProps({
|
|
222
223
|
props: inProps,
|
|
@@ -62,6 +62,7 @@ const DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePick
|
|
|
62
62
|
});
|
|
63
63
|
return renderPicker();
|
|
64
64
|
});
|
|
65
|
+
if (process.env.NODE_ENV !== "production") DesktopDatePicker.displayName = "DesktopDatePicker";
|
|
65
66
|
DesktopDatePicker.propTypes = {
|
|
66
67
|
// ----------------------------- Warning --------------------------------
|
|
67
68
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -78,6 +78,7 @@ const rendererInterceptor = function RendererInterceptor(props) {
|
|
|
78
78
|
})]
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
+
if (process.env.NODE_ENV !== "production") rendererInterceptor.displayName = "rendererInterceptor";
|
|
81
82
|
/**
|
|
82
83
|
* Demos:
|
|
83
84
|
*
|
|
@@ -143,6 +144,7 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
143
144
|
});
|
|
144
145
|
return renderPicker();
|
|
145
146
|
});
|
|
147
|
+
if (process.env.NODE_ENV !== "production") DesktopDateTimePicker.displayName = "DesktopDateTimePicker";
|
|
146
148
|
DesktopDateTimePicker.propTypes = {
|
|
147
149
|
// ----------------------------- Warning --------------------------------
|
|
148
150
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -54,6 +54,7 @@ const DesktopDateTimePickerLayout = /*#__PURE__*/React.forwardRef(function Deskt
|
|
|
54
54
|
}), actionBar]
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
|
+
if (process.env.NODE_ENV !== "production") DesktopDateTimePickerLayout.displayName = "DesktopDateTimePickerLayout";
|
|
57
58
|
process.env.NODE_ENV !== "production" ? DesktopDateTimePickerLayout.propTypes = {
|
|
58
59
|
// ----------------------------- Warning --------------------------------
|
|
59
60
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -78,6 +78,7 @@ const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePick
|
|
|
78
78
|
});
|
|
79
79
|
return renderPicker();
|
|
80
80
|
});
|
|
81
|
+
if (process.env.NODE_ENV !== "production") DesktopTimePicker.displayName = "DesktopTimePicker";
|
|
81
82
|
DesktopTimePicker.propTypes = {
|
|
82
83
|
// ----------------------------- Warning --------------------------------
|
|
83
84
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -314,6 +314,7 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
314
314
|
})
|
|
315
315
|
}));
|
|
316
316
|
});
|
|
317
|
+
if (process.env.NODE_ENV !== "production") DigitalClock.displayName = "DigitalClock";
|
|
317
318
|
process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
|
|
318
319
|
// ----------------------------- Warning --------------------------------
|
|
319
320
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -8,9 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { useThemeProps } from '@mui/material/styles';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
export const MuiPickersAdapterContext = /*#__PURE__*/React.createContext(null);
|
|
11
|
-
if (process.env.NODE_ENV !==
|
|
12
|
-
MuiPickersAdapterContext.displayName = 'MuiPickersAdapterContext';
|
|
13
|
-
}
|
|
11
|
+
if (process.env.NODE_ENV !== "production") MuiPickersAdapterContext.displayName = "MuiPickersAdapterContext";
|
|
14
12
|
/**
|
|
15
13
|
* Demos:
|
|
16
14
|
*
|
|
@@ -88,6 +86,7 @@ export const LocalizationProvider = function LocalizationProvider(inProps) {
|
|
|
88
86
|
children: children
|
|
89
87
|
});
|
|
90
88
|
};
|
|
89
|
+
if (process.env.NODE_ENV !== "production") LocalizationProvider.displayName = "LocalizationProvider";
|
|
91
90
|
process.env.NODE_ENV !== "production" ? LocalizationProvider.propTypes = {
|
|
92
91
|
// ----------------------------- Warning --------------------------------
|
|
93
92
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -60,6 +60,7 @@ const MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker
|
|
|
60
60
|
});
|
|
61
61
|
return renderPicker();
|
|
62
62
|
});
|
|
63
|
+
if (process.env.NODE_ENV !== "production") MobileDatePicker.displayName = "MobileDatePicker";
|
|
63
64
|
MobileDatePicker.propTypes = {
|
|
64
65
|
// ----------------------------- Warning --------------------------------
|
|
65
66
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -110,6 +110,7 @@ const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTi
|
|
|
110
110
|
});
|
|
111
111
|
return renderPicker();
|
|
112
112
|
});
|
|
113
|
+
if (process.env.NODE_ENV !== "production") MobileDateTimePicker.displayName = "MobileDateTimePicker";
|
|
113
114
|
MobileDateTimePicker.propTypes = {
|
|
114
115
|
// ----------------------------- Warning --------------------------------
|
|
115
116
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -63,6 +63,7 @@ const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker
|
|
|
63
63
|
});
|
|
64
64
|
return renderPicker();
|
|
65
65
|
});
|
|
66
|
+
if (process.env.NODE_ENV !== "production") MobileTimePicker.displayName = "MobileTimePicker";
|
|
66
67
|
MobileTimePicker.propTypes = {
|
|
67
68
|
// ----------------------------- Warning --------------------------------
|
|
68
69
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -251,6 +251,7 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
251
251
|
})
|
|
252
252
|
}));
|
|
253
253
|
});
|
|
254
|
+
if (process.env.NODE_ENV !== "production") MonthCalendar.displayName = "MonthCalendar";
|
|
254
255
|
process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
255
256
|
// ----------------------------- Warning --------------------------------
|
|
256
257
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -112,4 +112,5 @@ export const MonthCalendarButton = /*#__PURE__*/React.memo(function MonthCalenda
|
|
|
112
112
|
className: classes.button
|
|
113
113
|
});
|
|
114
114
|
return /*#__PURE__*/_jsx(MonthButton, _extends({}, monthButtonProps));
|
|
115
|
-
});
|
|
115
|
+
});
|
|
116
|
+
if (process.env.NODE_ENV !== "production") MonthCalendarButton.displayName = "MonthCalendarButton";
|
|
@@ -343,6 +343,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
343
343
|
}, timeView))
|
|
344
344
|
}));
|
|
345
345
|
});
|
|
346
|
+
if (process.env.NODE_ENV !== "production") MultiSectionDigitalClock.displayName = "MultiSectionDigitalClock";
|
|
346
347
|
process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
347
348
|
// ----------------------------- Warning --------------------------------
|
|
348
349
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -206,4 +206,5 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
206
206
|
}), option.label);
|
|
207
207
|
})
|
|
208
208
|
}));
|
|
209
|
-
});
|
|
209
|
+
});
|
|
210
|
+
if (process.env.NODE_ENV !== "production") MultiSectionDigitalClockSection.displayName = "MultiSectionDigitalClockSection";
|
|
@@ -113,4 +113,5 @@ process.env.NODE_ENV !== "production" ? PickersActionBarComponent.propTypes = {
|
|
|
113
113
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
114
114
|
} : void 0;
|
|
115
115
|
const PickersActionBar = /*#__PURE__*/React.memo(PickersActionBarComponent);
|
|
116
|
+
if (process.env.NODE_ENV !== "production") PickersActionBar.displayName = "PickersActionBar";
|
|
116
117
|
export { PickersActionBar };
|
|
@@ -225,6 +225,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
225
225
|
})]
|
|
226
226
|
}));
|
|
227
227
|
});
|
|
228
|
+
if (process.env.NODE_ENV !== "production") PickersCalendarHeader.displayName = "PickersCalendarHeader";
|
|
228
229
|
process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
|
|
229
230
|
// ----------------------------- Warning --------------------------------
|
|
230
231
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -218,6 +218,7 @@ const PickersDayRaw = /*#__PURE__*/React.forwardRef(function PickersDay(inProps,
|
|
|
218
218
|
children: !children ? utils.format(day, 'dayOfMonth') : children
|
|
219
219
|
}));
|
|
220
220
|
});
|
|
221
|
+
if (process.env.NODE_ENV !== "production") PickersDayRaw.displayName = "PickersDayRaw";
|
|
221
222
|
process.env.NODE_ENV !== "production" ? PickersDayRaw.propTypes = {
|
|
222
223
|
// ----------------------------- Warning --------------------------------
|
|
223
224
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -369,4 +370,5 @@ process.env.NODE_ENV !== "production" ? PickersDayRaw.propTypes = {
|
|
|
369
370
|
*
|
|
370
371
|
* - [PickersDay API](https://mui.com/x/api/date-pickers/pickers-day/)
|
|
371
372
|
*/
|
|
372
|
-
export const PickersDay = /*#__PURE__*/React.memo(PickersDayRaw);
|
|
373
|
+
export const PickersDay = /*#__PURE__*/React.memo(PickersDayRaw);
|
|
374
|
+
if (process.env.NODE_ENV !== "production") PickersDay.displayName = "PickersDay";
|
|
@@ -137,6 +137,7 @@ const PickersLayout = /*#__PURE__*/React.forwardRef(function PickersLayout(inPro
|
|
|
137
137
|
}), actionBar]
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
|
+
if (process.env.NODE_ENV !== "production") PickersLayout.displayName = "PickersLayout";
|
|
140
141
|
process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
|
|
141
142
|
// ----------------------------- Warning --------------------------------
|
|
142
143
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -204,6 +204,7 @@ const PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSection
|
|
|
204
204
|
})
|
|
205
205
|
}));
|
|
206
206
|
});
|
|
207
|
+
if (process.env.NODE_ENV !== "production") PickersSectionList.displayName = "PickersSectionList";
|
|
207
208
|
process.env.NODE_ENV !== "production" ? PickersSectionList.propTypes = {
|
|
208
209
|
// ----------------------------- Warning --------------------------------
|
|
209
210
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -226,6 +226,7 @@ const PickersFilledInput = /*#__PURE__*/React.forwardRef(function PickersFilledI
|
|
|
226
226
|
ownerState: ownerState
|
|
227
227
|
}));
|
|
228
228
|
});
|
|
229
|
+
if (process.env.NODE_ENV !== "production") PickersFilledInput.displayName = "PickersFilledInput";
|
|
229
230
|
process.env.NODE_ENV !== "production" ? PickersFilledInput.propTypes = {
|
|
230
231
|
// ----------------------------- Warning --------------------------------
|
|
231
232
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -143,6 +143,7 @@ const PickersInput = /*#__PURE__*/React.forwardRef(function PickersInput(inProps
|
|
|
143
143
|
ref: ref
|
|
144
144
|
}));
|
|
145
145
|
});
|
|
146
|
+
if (process.env.NODE_ENV !== "production") PickersInput.displayName = "PickersInput";
|
|
146
147
|
process.env.NODE_ENV !== "production" ? PickersInput.propTypes = {
|
|
147
148
|
// ----------------------------- Warning --------------------------------
|
|
148
149
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -393,6 +393,7 @@ const PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase
|
|
|
393
393
|
})]
|
|
394
394
|
}));
|
|
395
395
|
});
|
|
396
|
+
if (process.env.NODE_ENV !== "production") PickersInputBase.displayName = "PickersInputBase";
|
|
396
397
|
process.env.NODE_ENV !== "production" ? PickersInputBase.propTypes = {
|
|
397
398
|
// ----------------------------- Warning --------------------------------
|
|
398
399
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -120,6 +120,7 @@ const PickersOutlinedInput = /*#__PURE__*/React.forwardRef(function PickersOutli
|
|
|
120
120
|
ref: ref
|
|
121
121
|
}));
|
|
122
122
|
});
|
|
123
|
+
if (process.env.NODE_ENV !== "production") PickersOutlinedInput.displayName = "PickersOutlinedInput";
|
|
123
124
|
process.env.NODE_ENV !== "production" ? PickersOutlinedInput.propTypes = {
|
|
124
125
|
// ----------------------------- Warning --------------------------------
|
|
125
126
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -29,7 +29,9 @@ const VARIANT_COMPONENT = {
|
|
|
29
29
|
const PickersTextFieldRoot = styled(FormControl, {
|
|
30
30
|
name: 'MuiPickersTextField',
|
|
31
31
|
slot: 'Root'
|
|
32
|
-
})({
|
|
32
|
+
})({
|
|
33
|
+
maxWidth: '100%'
|
|
34
|
+
});
|
|
33
35
|
const useUtilityClasses = (classes, ownerState) => {
|
|
34
36
|
const {
|
|
35
37
|
isFieldFocused,
|
|
@@ -174,6 +176,7 @@ const PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField
|
|
|
174
176
|
}))
|
|
175
177
|
});
|
|
176
178
|
});
|
|
179
|
+
if (process.env.NODE_ENV !== "production") PickersTextField.displayName = "PickersTextField";
|
|
177
180
|
process.env.NODE_ENV !== "production" ? PickersTextField.propTypes = {
|
|
178
181
|
// ----------------------------- Warning --------------------------------
|
|
179
182
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
export const PickerTextFieldOwnerStateContext = /*#__PURE__*/React.createContext(null);
|
|
5
|
+
if (process.env.NODE_ENV !== "production") PickerTextFieldOwnerStateContext.displayName = "PickerTextFieldOwnerStateContext";
|
|
5
6
|
export const usePickerTextFieldOwnerState = () => {
|
|
6
7
|
const value = React.useContext(PickerTextFieldOwnerStateContext);
|
|
7
8
|
if (value == null) {
|
|
@@ -50,6 +50,7 @@ const StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDatePicker
|
|
|
50
50
|
});
|
|
51
51
|
return renderPicker();
|
|
52
52
|
});
|
|
53
|
+
if (process.env.NODE_ENV !== "production") StaticDatePicker.displayName = "StaticDatePicker";
|
|
53
54
|
StaticDatePicker.propTypes = {
|
|
54
55
|
// ----------------------------- Warning --------------------------------
|
|
55
56
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -99,6 +99,7 @@ const StaticDateTimePicker = /*#__PURE__*/React.forwardRef(function StaticDateTi
|
|
|
99
99
|
});
|
|
100
100
|
return renderPicker();
|
|
101
101
|
});
|
|
102
|
+
if (process.env.NODE_ENV !== "production") StaticDateTimePicker.displayName = "StaticDateTimePicker";
|
|
102
103
|
StaticDateTimePicker.propTypes = {
|
|
103
104
|
// ----------------------------- Warning --------------------------------
|
|
104
105
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -52,6 +52,7 @@ const StaticTimePicker = /*#__PURE__*/React.forwardRef(function StaticTimePicker
|
|
|
52
52
|
});
|
|
53
53
|
return renderPicker();
|
|
54
54
|
});
|
|
55
|
+
if (process.env.NODE_ENV !== "production") StaticTimePicker.displayName = "StaticTimePicker";
|
|
55
56
|
StaticTimePicker.propTypes = {
|
|
56
57
|
// ----------------------------- Warning --------------------------------
|
|
57
58
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -329,6 +329,7 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
329
329
|
})]
|
|
330
330
|
}));
|
|
331
331
|
});
|
|
332
|
+
if (process.env.NODE_ENV !== "production") TimeClock.displayName = "TimeClock";
|
|
332
333
|
process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
333
334
|
// ----------------------------- Warning --------------------------------
|
|
334
335
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -43,6 +43,7 @@ const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, inRe
|
|
|
43
43
|
defaultOpenPickerIcon: ClockIcon
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
|
+
if (process.env.NODE_ENV !== "production") TimeField.displayName = "TimeField";
|
|
46
47
|
process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
47
48
|
// ----------------------------- Warning --------------------------------
|
|
48
49
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -45,6 +45,7 @@ const TimePicker = /*#__PURE__*/React.forwardRef(function TimePicker(inProps, re
|
|
|
45
45
|
ref: ref
|
|
46
46
|
}, other));
|
|
47
47
|
});
|
|
48
|
+
if (process.env.NODE_ENV !== "production") TimePicker.displayName = "TimePicker";
|
|
48
49
|
process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
49
50
|
// ----------------------------- Warning --------------------------------
|
|
50
51
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -296,6 +296,7 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
296
296
|
}, (_, index) => /*#__PURE__*/_jsx(YearCalendarButtonFiller, {}, index))]
|
|
297
297
|
}));
|
|
298
298
|
});
|
|
299
|
+
if (process.env.NODE_ENV !== "production") YearCalendar.displayName = "YearCalendar";
|
|
299
300
|
process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
300
301
|
// ----------------------------- Warning --------------------------------
|
|
301
302
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -112,4 +112,5 @@ export const YearCalendarButton = /*#__PURE__*/React.memo(function YearCalendarB
|
|
|
112
112
|
className: classes.button
|
|
113
113
|
});
|
|
114
114
|
return /*#__PURE__*/_jsx(YearButton, _extends({}, yearButtonProps));
|
|
115
|
-
});
|
|
115
|
+
});
|
|
116
|
+
if (process.env.NODE_ENV !== "production") YearCalendarButton.displayName = "YearCalendarButton";
|
|
@@ -6,6 +6,7 @@ export const IsValidValueContext = /*#__PURE__*/React.createContext(() => true);
|
|
|
6
6
|
/**
|
|
7
7
|
* Returns a function to check if a value is valid according to the validation props passed to the parent Picker.
|
|
8
8
|
*/
|
|
9
|
+
if (process.env.NODE_ENV !== "production") IsValidValueContext.displayName = "IsValidValueContext";
|
|
9
10
|
export function useIsValidValue() {
|
|
10
11
|
return React.useContext(IsValidValueContext);
|
|
11
12
|
}
|
|
@@ -6,6 +6,7 @@ export const PickerContext = /*#__PURE__*/React.createContext(null);
|
|
|
6
6
|
/**
|
|
7
7
|
* Returns the context passed by the Picker wrapping the current component.
|
|
8
8
|
*/
|
|
9
|
+
if (process.env.NODE_ENV !== "production") PickerContext.displayName = "PickerContext";
|
|
9
10
|
export const usePickerContext = () => {
|
|
10
11
|
const value = React.useContext(PickerContext);
|
|
11
12
|
if (value == null) {
|
package/esm/index.js
CHANGED
|
@@ -95,6 +95,7 @@ export const PickerFieldUIContext = /*#__PURE__*/React.createContext({
|
|
|
95
95
|
* Adds the button to open the Picker and the button to clear the value of the field.
|
|
96
96
|
* @ignore - internal component.
|
|
97
97
|
*/
|
|
98
|
+
if (process.env.NODE_ENV !== "production") PickerFieldUIContext.displayName = "PickerFieldUIContext";
|
|
98
99
|
export function PickerFieldUI(props) {
|
|
99
100
|
const {
|
|
100
101
|
slots,
|
|
@@ -197,6 +197,7 @@ const PickerPopperPaperWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
197
197
|
children: children
|
|
198
198
|
}));
|
|
199
199
|
});
|
|
200
|
+
if (process.env.NODE_ENV !== "production") PickerPopperPaperWrapper.displayName = "PickerPopperPaperWrapper";
|
|
200
201
|
export function PickerPopper(inProps) {
|
|
201
202
|
const props = useThemeProps({
|
|
202
203
|
props: inProps,
|
|
@@ -5,6 +5,7 @@ import { PickerFieldPrivateContext } from "../hooks/useNullableFieldPrivateConte
|
|
|
5
5
|
import { PickerContext } from "../../hooks/usePickerContext.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
export const PickerActionsContext = /*#__PURE__*/React.createContext(null);
|
|
8
|
+
if (process.env.NODE_ENV !== "production") PickerActionsContext.displayName = "PickerActionsContext";
|
|
8
9
|
export const PickerPrivateContext = /*#__PURE__*/React.createContext({
|
|
9
10
|
ownerState: {
|
|
10
11
|
isPickerDisabled: false,
|
|
@@ -34,6 +35,7 @@ export const PickerPrivateContext = /*#__PURE__*/React.createContext({
|
|
|
34
35
|
*
|
|
35
36
|
* @ignore - do not document.
|
|
36
37
|
*/
|
|
38
|
+
if (process.env.NODE_ENV !== "production") PickerPrivateContext.displayName = "PickerPrivateContext";
|
|
37
39
|
export function PickerProvider(props) {
|
|
38
40
|
const {
|
|
39
41
|
contextValue,
|
|
@@ -170,4 +170,5 @@ export const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function Picke
|
|
|
170
170
|
children: isRtl ? /*#__PURE__*/_jsx(LeftArrowIcon, _extends({}, leftArrowIconProps)) : /*#__PURE__*/_jsx(RightArrowIcon, _extends({}, rightArrowIconProps))
|
|
171
171
|
}))]
|
|
172
172
|
}));
|
|
173
|
-
});
|
|
173
|
+
});
|
|
174
|
+
if (process.env.NODE_ENV !== "production") PickersArrowSwitcher.displayName = "PickersArrowSwitcher";
|
|
@@ -126,7 +126,11 @@ export const useFieldCharacterEditing = ({
|
|
|
126
126
|
return applyQuery(params, getFirstSectionValueMatchingWithQuery);
|
|
127
127
|
};
|
|
128
128
|
const applyNumericEditing = params => {
|
|
129
|
-
const getNewSectionValue = (
|
|
129
|
+
const getNewSectionValue = ({
|
|
130
|
+
queryValue,
|
|
131
|
+
skipIfBelowMinimum,
|
|
132
|
+
section
|
|
133
|
+
}) => {
|
|
130
134
|
const cleanQueryValue = removeLocalizedDigits(queryValue, localizedDigits);
|
|
131
135
|
const queryValueNumber = Number(cleanQueryValue);
|
|
132
136
|
const sectionBoundaries = sectionsValueBoundaries[section.type]({
|
|
@@ -143,7 +147,7 @@ export const useFieldCharacterEditing = ({
|
|
|
143
147
|
// If the user types `0` on a month section,
|
|
144
148
|
// It is below the minimum, but we want to store the `0` in the query,
|
|
145
149
|
// So that when he pressed `1`, it will store `01` and move to the next section.
|
|
146
|
-
if (queryValueNumber < sectionBoundaries.minimum) {
|
|
150
|
+
if (skipIfBelowMinimum && queryValueNumber < sectionBoundaries.minimum) {
|
|
147
151
|
return {
|
|
148
152
|
saveQuery: true
|
|
149
153
|
};
|
|
@@ -157,20 +161,28 @@ export const useFieldCharacterEditing = ({
|
|
|
157
161
|
};
|
|
158
162
|
const getFirstSectionValueMatchingWithQuery = (queryValue, activeSection) => {
|
|
159
163
|
if (activeSection.contentType === 'digit' || activeSection.contentType === 'digit-with-letter') {
|
|
160
|
-
return getNewSectionValue(
|
|
164
|
+
return getNewSectionValue({
|
|
165
|
+
queryValue,
|
|
166
|
+
skipIfBelowMinimum: false,
|
|
167
|
+
section: activeSection
|
|
168
|
+
});
|
|
161
169
|
}
|
|
162
170
|
|
|
163
171
|
// When editing a letter-format month and the user presses a digit,
|
|
164
172
|
// We can support the numeric editing by using the digit-format month and re-formatting the result.
|
|
165
173
|
if (activeSection.type === 'month') {
|
|
166
174
|
const hasLeadingZerosInFormat = doesSectionFormatHaveLeadingZeros(utils, 'digit', 'month', 'MM');
|
|
167
|
-
const response = getNewSectionValue(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
const response = getNewSectionValue({
|
|
176
|
+
queryValue,
|
|
177
|
+
skipIfBelowMinimum: true,
|
|
178
|
+
section: {
|
|
179
|
+
type: activeSection.type,
|
|
180
|
+
format: 'MM',
|
|
181
|
+
hasLeadingZerosInFormat,
|
|
182
|
+
hasLeadingZerosInInput: true,
|
|
183
|
+
contentType: 'digit',
|
|
184
|
+
maxLength: 2
|
|
185
|
+
}
|
|
174
186
|
});
|
|
175
187
|
if (isQueryResponseWithoutValue(response)) {
|
|
176
188
|
return response;
|
|
@@ -184,7 +196,11 @@ export const useFieldCharacterEditing = ({
|
|
|
184
196
|
// When editing a letter-format weekDay and the user presses a digit,
|
|
185
197
|
// We can support the numeric editing by returning the nth day in the week day array.
|
|
186
198
|
if (activeSection.type === 'weekDay') {
|
|
187
|
-
const response = getNewSectionValue(
|
|
199
|
+
const response = getNewSectionValue({
|
|
200
|
+
queryValue,
|
|
201
|
+
skipIfBelowMinimum: true,
|
|
202
|
+
section: activeSection
|
|
203
|
+
});
|
|
188
204
|
if (isQueryResponseWithoutValue(response)) {
|
|
189
205
|
return response;
|
|
190
206
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import useEventCallback from '@mui/utils/useEventCallback';
|
|
3
2
|
/**
|
|
4
3
|
* Generate the props to pass to the container element of each section of the field.
|
|
5
4
|
* It is not used by the non-accessible DOM structure (with an <input /> element for editing).
|
|
@@ -17,14 +16,14 @@ export function useFieldSectionContainerProps(parameters) {
|
|
|
17
16
|
disabled = false
|
|
18
17
|
}
|
|
19
18
|
} = parameters;
|
|
20
|
-
const createHandleClick =
|
|
19
|
+
const createHandleClick = React.useCallback(sectionIndex => event => {
|
|
21
20
|
// The click event on the clear button would propagate to the input, trigger this handler and result in a wrong section selection.
|
|
22
21
|
// We avoid this by checking if the call to this function is actually intended, or a side effect.
|
|
23
22
|
if (disabled || event.isDefaultPrevented()) {
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
25
|
setSelectedSections(sectionIndex);
|
|
27
|
-
});
|
|
26
|
+
}, [disabled, setSelectedSections]);
|
|
28
27
|
return React.useCallback(sectionIndex => ({
|
|
29
28
|
'data-sectionindex': sectionIndex,
|
|
30
29
|
onClick: createHandleClick(sectionIndex)
|
|
@@ -128,12 +128,12 @@ export function useFieldSectionContentProps(parameters) {
|
|
|
128
128
|
event.preventDefault();
|
|
129
129
|
event.dataTransfer.dropEffect = 'none';
|
|
130
130
|
});
|
|
131
|
-
const createFocusHandler =
|
|
131
|
+
const createFocusHandler = React.useCallback(sectionIndex => () => {
|
|
132
132
|
if (disabled) {
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
setSelectedSections(sectionIndex);
|
|
136
|
-
});
|
|
136
|
+
}, [disabled, setSelectedSections]);
|
|
137
137
|
return React.useCallback((section, sectionIndex) => {
|
|
138
138
|
const sectionBoundaries = sectionsValueBoundaries[section.type]({
|
|
139
139
|
currentDate: fieldValueManager.getDateFromSection(value, section),
|
|
@@ -268,10 +268,10 @@ export const useFieldState = parameters => {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
/**
|
|
271
|
-
* If all the sections are filled but the date is invalid,
|
|
271
|
+
* If all the sections are filled but the date is invalid and the previous date is valid or null,
|
|
272
272
|
* Then we publish an invalid date.
|
|
273
273
|
*/
|
|
274
|
-
if (newActiveDateSections.every(sectionBis => sectionBis.value !== '')) {
|
|
274
|
+
if (newActiveDateSections.every(sectionBis => sectionBis.value !== '') && (activeDate == null || utils.isValid(activeDate))) {
|
|
275
275
|
setSectionUpdateToApplyOnNextInvalidDate(newSectionValue);
|
|
276
276
|
return publishValue(fieldValueManager.updateDateInValue(value, section, newActiveDate));
|
|
277
277
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export const PickerFieldPrivateContext = /*#__PURE__*/React.createContext(null);
|
|
3
|
+
if (process.env.NODE_ENV !== "production") PickerFieldPrivateContext.displayName = "PickerFieldPrivateContext";
|
|
3
4
|
export function useNullableFieldPrivateContext() {
|
|
4
5
|
return React.useContext(PickerFieldPrivateContext);
|
|
5
6
|
}
|