@mui/x-date-pickers 9.0.0-alpha.4 → 9.0.0-rc.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/AdapterDateFnsBase/AdapterDateFnsBase.mjs +1 -1
- package/AdapterDayjs/AdapterDayjs.mjs +1 -1
- package/AdapterLuxon/AdapterLuxon.mjs +1 -1
- package/AdapterMoment/AdapterMoment.mjs +1 -1
- package/AdapterMomentHijri/AdapterMomentHijri.mjs +1 -1
- package/AdapterMomentJalaali/AdapterMomentJalaali.mjs +1 -1
- package/CHANGELOG.md +262 -2
- package/DateCalendar/DateCalendar.js +1 -1
- package/DateCalendar/DateCalendar.mjs +1 -1
- package/DateCalendar/DayCalendar.d.mts +7 -7
- package/DateCalendar/DayCalendar.d.ts +7 -7
- package/DateCalendar/DayCalendar.js +23 -25
- package/DateCalendar/DayCalendar.mjs +23 -25
- package/DateField/DateField.d.mts +1 -1
- package/DateField/DateField.d.ts +1 -1
- package/DateField/DateField.js +22 -4
- package/DateField/DateField.mjs +22 -4
- package/DateField/DateField.types.d.mts +3 -3
- package/DateField/DateField.types.d.ts +3 -3
- package/DateField/useDateField.d.mts +1 -1
- package/DateField/useDateField.d.ts +1 -1
- package/DateField/useDateField.js +1 -1
- package/DateField/useDateField.mjs +1 -1
- package/DatePicker/DatePicker.d.mts +1 -1
- package/DatePicker/DatePicker.d.ts +1 -1
- package/DatePicker/DatePicker.js +1 -5
- package/DatePicker/DatePicker.mjs +1 -5
- package/DatePicker/DatePicker.types.d.mts +3 -3
- package/DatePicker/DatePicker.types.d.ts +3 -3
- package/DateTimeField/DateTimeField.d.mts +1 -1
- package/DateTimeField/DateTimeField.d.ts +1 -1
- package/DateTimeField/DateTimeField.js +22 -4
- package/DateTimeField/DateTimeField.mjs +22 -4
- package/DateTimeField/DateTimeField.types.d.mts +2 -2
- package/DateTimeField/DateTimeField.types.d.ts +2 -2
- package/DateTimeField/useDateTimeField.d.mts +1 -1
- package/DateTimeField/useDateTimeField.d.ts +1 -1
- package/DateTimeField/useDateTimeField.js +1 -1
- package/DateTimeField/useDateTimeField.mjs +1 -1
- package/DateTimePicker/DateTimePicker.d.mts +1 -1
- package/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/DateTimePicker/DateTimePicker.js +1 -5
- package/DateTimePicker/DateTimePicker.mjs +1 -5
- package/DateTimePicker/DateTimePicker.types.d.mts +3 -3
- package/DateTimePicker/DateTimePicker.types.d.ts +3 -3
- package/DesktopDatePicker/DesktopDatePicker.d.mts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.js +1 -5
- package/DesktopDatePicker/DesktopDatePicker.mjs +1 -5
- package/DesktopDatePicker/DesktopDatePicker.types.d.mts +3 -3
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +3 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.mts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -5
- package/DesktopDateTimePicker/DesktopDateTimePicker.mjs +1 -5
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.mts +3 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +3 -3
- package/DesktopTimePicker/DesktopTimePicker.d.mts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.js +0 -4
- package/DesktopTimePicker/DesktopTimePicker.mjs +0 -4
- package/DesktopTimePicker/DesktopTimePicker.types.d.mts +3 -3
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +3 -3
- package/DigitalClock/DigitalClock.d.mts +1 -1
- package/DigitalClock/DigitalClock.d.ts +1 -1
- package/DigitalClock/DigitalClock.js +2 -2
- package/DigitalClock/DigitalClock.mjs +3 -3
- package/MobileDatePicker/MobileDatePicker.d.mts +1 -1
- package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
- package/MobileDatePicker/MobileDatePicker.js +1 -5
- package/MobileDatePicker/MobileDatePicker.mjs +1 -5
- package/MobileDatePicker/MobileDatePicker.types.d.mts +3 -3
- package/MobileDatePicker/MobileDatePicker.types.d.ts +3 -3
- package/MobileDateTimePicker/MobileDateTimePicker.d.mts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +1 -5
- package/MobileDateTimePicker/MobileDateTimePicker.mjs +1 -5
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.mts +3 -3
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +3 -3
- package/MobileTimePicker/MobileTimePicker.d.mts +1 -1
- package/MobileTimePicker/MobileTimePicker.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.js +0 -4
- package/MobileTimePicker/MobileTimePicker.mjs +0 -4
- package/MobileTimePicker/MobileTimePicker.types.d.mts +3 -3
- package/MobileTimePicker/MobileTimePicker.types.d.ts +3 -3
- package/MonthCalendar/MonthCalendarButton.js +2 -2
- package/MonthCalendar/MonthCalendarButton.mjs +3 -3
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.mjs +3 -3
- package/PickerDay/PickerDay.d.mts +14 -0
- package/PickerDay/PickerDay.d.ts +14 -0
- package/{PickerDay2/PickerDay2.js → PickerDay/PickerDay.js} +110 -45
- package/{PickerDay2/PickerDay2.mjs → PickerDay/PickerDay.mjs} +110 -45
- package/PickerDay/PickerDay.types.d.mts +137 -0
- package/PickerDay/PickerDay.types.d.ts +137 -0
- package/PickerDay/index.d.mts +4 -0
- package/PickerDay/index.d.ts +4 -0
- package/PickerDay/index.js +25 -0
- package/PickerDay/index.mjs +2 -0
- package/{PickerDay2/pickerDay2Classes.d.mts → PickerDay/pickerDayClasses.d.mts} +4 -4
- package/{PickerDay2/pickerDay2Classes.d.ts → PickerDay/pickerDayClasses.d.ts} +4 -4
- package/PickerDay/pickerDayClasses.js +14 -0
- package/PickerDay/pickerDayClasses.mjs +6 -0
- package/PickersTextField/PickersFilledInput/PickersFilledInput.js +27 -1
- package/PickersTextField/PickersFilledInput/PickersFilledInput.mjs +27 -1
- package/PickersTextField/PickersInput/PickersInput.js +27 -1
- package/PickersTextField/PickersInput/PickersInput.mjs +27 -1
- package/PickersTextField/PickersInputBase/PickersInputBase.js +26 -0
- package/PickersTextField/PickersInputBase/PickersInputBase.mjs +26 -0
- package/PickersTextField/PickersInputBase/PickersInputBase.types.d.mts +26 -0
- package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +26 -0
- package/PickersTextField/PickersOutlinedInput/Outline.js +1 -1
- package/PickersTextField/PickersOutlinedInput/Outline.mjs +1 -1
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +27 -1
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.mjs +27 -1
- package/PickersTextField/PickersTextField.js +42 -2
- package/PickersTextField/PickersTextField.mjs +42 -2
- package/PickersTextField/PickersTextField.types.d.mts +22 -6
- package/PickersTextField/PickersTextField.types.d.ts +22 -6
- package/StaticDatePicker/StaticDatePicker.js +1 -1
- package/StaticDatePicker/StaticDatePicker.mjs +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.mjs +1 -1
- package/TimeField/TimeField.d.mts +1 -1
- package/TimeField/TimeField.d.ts +1 -1
- package/TimeField/TimeField.js +22 -4
- package/TimeField/TimeField.mjs +22 -4
- package/TimeField/TimeField.types.d.mts +2 -2
- package/TimeField/TimeField.types.d.ts +2 -2
- package/TimeField/useTimeField.d.mts +1 -1
- package/TimeField/useTimeField.d.ts +1 -1
- package/TimePicker/TimePicker.d.mts +1 -1
- package/TimePicker/TimePicker.d.ts +1 -1
- package/TimePicker/TimePicker.js +0 -4
- package/TimePicker/TimePicker.mjs +0 -4
- package/TimePicker/TimePicker.types.d.mts +3 -3
- package/TimePicker/TimePicker.types.d.ts +3 -3
- package/YearCalendar/YearCalendarButton.js +2 -2
- package/YearCalendar/YearCalendarButton.mjs +3 -3
- package/hooks/useParsedFormat.js +5 -7
- package/hooks/useParsedFormat.mjs +5 -7
- package/hooks/useSplitFieldProps.d.mts +1 -1
- package/hooks/useSplitFieldProps.d.ts +1 -1
- package/hooks/useSplitFieldProps.js +1 -1
- package/hooks/useSplitFieldProps.mjs +1 -1
- package/index.d.mts +1 -2
- package/index.d.ts +1 -2
- package/index.js +2 -14
- package/index.mjs +2 -3
- package/internals/components/PickerFieldUI.d.mts +22 -13
- package/internals/components/PickerFieldUI.d.ts +22 -13
- package/internals/components/PickerFieldUI.js +22 -80
- package/internals/components/PickerFieldUI.mjs +22 -80
- package/internals/components/PickerPopper/PickerPopper.js +3 -0
- package/internals/components/PickerPopper/PickerPopper.mjs +3 -0
- package/internals/components/PickersToolbar.js +3 -1
- package/internals/components/PickersToolbar.mjs +3 -1
- package/internals/demo/DemoContainer.js +6 -8
- package/internals/demo/DemoContainer.mjs +6 -8
- package/internals/hooks/PickerDay.types.d.mts +12 -0
- package/internals/hooks/PickerDay.types.d.ts +12 -0
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.mts +2 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.d.ts +2 -2
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.mts +6 -6
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +6 -6
- package/internals/hooks/useField/buildSectionsFromFormat.d.mts +0 -1
- package/internals/hooks/useField/buildSectionsFromFormat.d.ts +0 -1
- package/internals/hooks/useField/buildSectionsFromFormat.js +1 -1
- package/internals/hooks/useField/buildSectionsFromFormat.mjs +1 -1
- package/internals/hooks/useField/index.d.mts +1 -1
- package/internals/hooks/useField/index.d.ts +1 -1
- package/internals/hooks/useField/index.js +2 -8
- package/internals/hooks/useField/index.mjs +1 -1
- package/internals/hooks/useField/useField.d.mts +2 -2
- package/internals/hooks/useField/useField.d.ts +2 -2
- package/internals/hooks/useField/useField.js +265 -8
- package/internals/hooks/useField/useField.mjs +264 -8
- package/internals/hooks/useField/useField.types.d.mts +11 -50
- package/internals/hooks/useField/useField.types.d.ts +11 -50
- package/internals/hooks/useField/useField.utils.d.mts +2 -3
- package/internals/hooks/useField/useField.utils.d.ts +2 -3
- package/internals/hooks/useField/useField.utils.js +8 -65
- package/internals/hooks/useField/useField.utils.mjs +6 -62
- package/internals/hooks/useField/useFieldHiddenInputProps.d.mts +2 -4
- package/internals/hooks/useField/useFieldHiddenInputProps.d.ts +2 -4
- package/internals/hooks/useField/useFieldHiddenInputProps.js +1 -3
- package/internals/hooks/useField/useFieldHiddenInputProps.mjs +1 -3
- package/internals/hooks/useField/useFieldInternalPropsWithDefaults.js +0 -1
- package/internals/hooks/useField/useFieldInternalPropsWithDefaults.mjs +0 -1
- package/internals/hooks/useField/useFieldRootProps.d.mts +5 -5
- package/internals/hooks/useField/useFieldRootProps.d.ts +5 -5
- package/internals/hooks/useField/useFieldRootProps.js +183 -11
- package/internals/hooks/useField/useFieldRootProps.mjs +183 -11
- package/internals/hooks/useField/useFieldSectionContainerProps.d.mts +3 -5
- package/internals/hooks/useField/useFieldSectionContainerProps.d.ts +3 -5
- package/internals/hooks/useField/useFieldSectionContainerProps.js +2 -4
- package/internals/hooks/useField/useFieldSectionContainerProps.mjs +2 -4
- package/internals/hooks/useField/useFieldSectionContentProps.d.mts +6 -7
- package/internals/hooks/useField/useFieldSectionContentProps.d.ts +6 -7
- package/internals/hooks/useField/useFieldSectionContentProps.js +2 -4
- package/internals/hooks/useField/useFieldSectionContentProps.mjs +2 -4
- package/internals/hooks/useField/useFieldState.d.mts +4 -4
- package/internals/hooks/useField/useFieldState.d.ts +4 -4
- package/internals/hooks/useField/useFieldState.js +3 -6
- package/internals/hooks/useField/useFieldState.mjs +3 -6
- package/internals/hooks/useMobilePicker/useMobilePicker.d.mts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.mts +6 -6
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +6 -6
- package/internals/hooks/useNullableFieldPrivateContext.d.mts +1 -1
- package/internals/hooks/useNullableFieldPrivateContext.d.ts +1 -1
- package/internals/hooks/usePicker/usePicker.js +1 -3
- package/internals/hooks/usePicker/usePicker.mjs +1 -3
- package/{PickersDay → internals/hooks}/usePickerDayOwnerState.d.mts +2 -3
- package/{PickersDay → internals/hooks}/usePickerDayOwnerState.d.ts +2 -3
- package/{PickersDay → internals/hooks}/usePickerDayOwnerState.js +3 -5
- package/{PickersDay → internals/hooks}/usePickerDayOwnerState.mjs +3 -5
- package/internals/index.d.mts +4 -4
- package/internals/index.d.ts +4 -4
- package/internals/index.js +9 -9
- package/internals/index.mjs +3 -3
- package/internals/models/manager.d.mts +3 -5
- package/internals/models/manager.d.ts +3 -5
- package/internals/utils/valueManagers.js +1 -2
- package/internals/utils/valueManagers.mjs +2 -3
- package/managers/index.d.mts +2 -2
- package/managers/index.d.ts +2 -2
- package/managers/useDateManager.d.mts +3 -6
- package/managers/useDateManager.d.ts +3 -6
- package/managers/useDateManager.js +2 -6
- package/managers/useDateManager.mjs +2 -6
- package/managers/useDateTimeManager.d.mts +3 -6
- package/managers/useDateTimeManager.d.ts +3 -6
- package/managers/useDateTimeManager.js +2 -6
- package/managers/useDateTimeManager.mjs +2 -6
- package/managers/useTimeManager.d.mts +4 -6
- package/managers/useTimeManager.d.ts +4 -6
- package/managers/useTimeManager.js +1 -3
- package/managers/useTimeManager.mjs +1 -3
- package/models/fields.d.mts +3 -4
- package/models/fields.d.ts +3 -4
- package/models/manager.d.mts +2 -8
- package/models/manager.d.ts +2 -8
- package/package.json +55 -69
- package/themeAugmentation/components.d.mts +4 -8
- package/themeAugmentation/components.d.ts +4 -8
- package/themeAugmentation/overrides.d.mts +2 -4
- package/themeAugmentation/overrides.d.ts +2 -4
- package/themeAugmentation/props.d.mts +5 -7
- package/themeAugmentation/props.d.ts +5 -7
- package/PickerDay2/PickerDay2.d.mts +0 -7
- package/PickerDay2/PickerDay2.d.ts +0 -7
- package/PickerDay2/PickerDay2.types.d.mts +0 -18
- package/PickerDay2/PickerDay2.types.d.ts +0 -18
- package/PickerDay2/index.d.mts +0 -4
- package/PickerDay2/index.d.ts +0 -4
- package/PickerDay2/index.js +0 -25
- package/PickerDay2/index.mjs +0 -2
- package/PickerDay2/pickerDay2Classes.js +0 -14
- package/PickerDay2/pickerDay2Classes.mjs +0 -6
- package/PickersDay/PickersDay.d.mts +0 -15
- package/PickersDay/PickersDay.d.ts +0 -15
- package/PickersDay/PickersDay.js +0 -384
- package/PickersDay/PickersDay.mjs +0 -377
- package/PickersDay/PickersDay.types.d.mts +0 -114
- package/PickersDay/PickersDay.types.d.ts +0 -114
- package/PickersDay/index.d.mts +0 -4
- package/PickersDay/index.d.ts +0 -4
- package/PickersDay/index.js +0 -25
- package/PickersDay/index.mjs +0 -2
- package/PickersDay/pickersDayClasses.d.mts +0 -19
- package/PickersDay/pickersDayClasses.d.ts +0 -19
- package/PickersDay/pickersDayClasses.js +0 -14
- package/PickersDay/pickersDayClasses.mjs +0 -6
- package/internals/hooks/useField/useFieldRootHandleKeyDown.d.mts +0 -16
- package/internals/hooks/useField/useFieldRootHandleKeyDown.d.ts +0 -16
- package/internals/hooks/useField/useFieldRootHandleKeyDown.js +0 -211
- package/internals/hooks/useField/useFieldRootHandleKeyDown.mjs +0 -205
- package/internals/hooks/useField/useFieldV6TextField.d.mts +0 -26
- package/internals/hooks/useField/useFieldV6TextField.d.ts +0 -26
- package/internals/hooks/useField/useFieldV6TextField.js +0 -422
- package/internals/hooks/useField/useFieldV6TextField.mjs +0 -413
- package/internals/hooks/useField/useFieldV7TextField.d.mts +0 -3
- package/internals/hooks/useField/useFieldV7TextField.d.ts +0 -3
- package/internals/hooks/useField/useFieldV7TextField.js +0 -272
- package/internals/hooks/useField/useFieldV7TextField.mjs +0 -264
- /package/{PickerDay2/PickerDay2.types.js → PickerDay/PickerDay.types.js} +0 -0
- /package/{PickerDay2/PickerDay2.types.mjs → PickerDay/PickerDay.types.mjs} +0 -0
- /package/{PickersDay/PickersDay.types.js → internals/hooks/PickerDay.types.js} +0 -0
- /package/{PickersDay/PickersDay.types.mjs → internals/hooks/PickerDay.types.mjs} +0 -0
|
@@ -6,7 +6,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
-
exports.
|
|
9
|
+
exports.PickerDay = void 0;
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -18,11 +18,11 @@ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
|
18
18
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
19
19
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
20
20
|
var _dimensions = require("../internals/constants/dimensions");
|
|
21
|
-
var
|
|
21
|
+
var _pickerDayClasses = require("./pickerDayClasses");
|
|
22
22
|
var _usePickerAdapter = require("../hooks/usePickerAdapter");
|
|
23
|
-
var _usePickerDayOwnerState = require("../
|
|
23
|
+
var _usePickerDayOwnerState = require("../internals/hooks/usePickerDayOwnerState");
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
const _excluded = ["autoFocus", "className", "classes", "hidden", "isAnimating", "onClick", "onDaySelect", "onFocus", "onBlur", "onKeyDown", "onMouseDown", "onMouseEnter", "children", "isFirstVisibleCell", "isLastVisibleCell", "day", "selected", "disabled", "today", "outsideCurrentMonth", "
|
|
25
|
+
const _excluded = ["autoFocus", "className", "classes", "hidden", "isAnimating", "onClick", "onDaySelect", "onFocus", "onBlur", "onKeyDown", "onMouseDown", "onMouseEnter", "children", "isFirstVisibleCell", "isLastVisibleCell", "day", "selected", "disabled", "today", "outsideCurrentMonth", "disableHighlightToday", "showDaysOutsideCurrentMonth", "isVisuallySelected", "isDayFillerCell"];
|
|
26
26
|
const useUtilityClasses = (ownerState, classes) => {
|
|
27
27
|
const {
|
|
28
28
|
isDaySelected,
|
|
@@ -35,16 +35,16 @@ const useUtilityClasses = (ownerState, classes) => {
|
|
|
35
35
|
const slots = {
|
|
36
36
|
root: ['root', isDaySelected && !isDayFillerCell && 'selected', isDayDisabled && 'disabled', !disableHighlightToday && isDayCurrent && !isDaySelected && !isDayFillerCell && 'today', isDayOutsideMonth && 'dayOutsideMonth', isDayFillerCell && 'fillerCell']
|
|
37
37
|
};
|
|
38
|
-
return (0, _composeClasses.default)(slots,
|
|
38
|
+
return (0, _composeClasses.default)(slots, _pickerDayClasses.getPickerDayUtilityClass, classes);
|
|
39
39
|
};
|
|
40
|
-
const
|
|
41
|
-
name: '
|
|
40
|
+
const PickerDayRoot = (0, _styles.styled)(_ButtonBase.default, {
|
|
41
|
+
name: 'MuiPickerDay',
|
|
42
42
|
slot: 'Root',
|
|
43
43
|
overridesResolver: (props, styles) => {
|
|
44
44
|
const {
|
|
45
45
|
ownerState
|
|
46
46
|
} = props;
|
|
47
|
-
return [styles.root, !ownerState.disableHighlightToday && ownerState.isDayCurrent && styles.today,
|
|
47
|
+
return [styles.root, !ownerState.disableHighlightToday && ownerState.isDayCurrent && styles.today, ownerState.isDayOutsideMonth && styles.dayOutsideMonth, ownerState.isDayFillerCell && styles.fillerCell];
|
|
48
48
|
}
|
|
49
49
|
})(({
|
|
50
50
|
theme
|
|
@@ -52,6 +52,8 @@ const PickerDay2Root = (0, _styles.styled)(_ButtonBase.default, {
|
|
|
52
52
|
'--PickerDay-horizontalMargin': `${_dimensions.DAY_MARGIN}px`,
|
|
53
53
|
'--PickerDay-size': `${_dimensions.DAY_SIZE}px`
|
|
54
54
|
}, theme.typography.caption, {
|
|
55
|
+
lineHeight: 1,
|
|
56
|
+
display: 'flex',
|
|
55
57
|
width: 'var(--PickerDay-size)',
|
|
56
58
|
height: 'var(--PickerDay-size)',
|
|
57
59
|
borderRadius: 'calc(var(--PickerDay-size) / 2)',
|
|
@@ -64,11 +66,11 @@ const PickerDay2Root = (0, _styles.styled)(_ButtonBase.default, {
|
|
|
64
66
|
color: (theme.vars || theme).palette.text.primary,
|
|
65
67
|
'@media (pointer: fine)': {
|
|
66
68
|
'&:hover': {
|
|
67
|
-
backgroundColor: theme.
|
|
69
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.hoverOpacity)
|
|
68
70
|
}
|
|
69
71
|
},
|
|
70
72
|
'&:focus': {
|
|
71
|
-
backgroundColor: theme.
|
|
73
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.focusOpacity)
|
|
72
74
|
},
|
|
73
75
|
marginLeft: 'var(--PickerDay-horizontalMargin)',
|
|
74
76
|
marginRight: 'var(--PickerDay-horizontalMargin)',
|
|
@@ -84,7 +86,7 @@ const PickerDay2Root = (0, _styles.styled)(_ButtonBase.default, {
|
|
|
84
86
|
willChange: 'background-color',
|
|
85
87
|
backgroundColor: (theme.vars || theme).palette.primary.dark
|
|
86
88
|
},
|
|
87
|
-
[`&.${
|
|
89
|
+
[`&.${_pickerDayClasses.pickerDayClasses.disabled}`]: {
|
|
88
90
|
opacity: 0.6
|
|
89
91
|
}
|
|
90
92
|
}
|
|
@@ -124,10 +126,10 @@ const PickerDay2Root = (0, _styles.styled)(_ButtonBase.default, {
|
|
|
124
126
|
}]
|
|
125
127
|
}));
|
|
126
128
|
const noop = () => {};
|
|
127
|
-
const
|
|
129
|
+
const PickerDayRaw = /*#__PURE__*/React.forwardRef(function PickerDay(inProps, forwardedRef) {
|
|
128
130
|
const props = (0, _styles.useThemeProps)({
|
|
129
131
|
props: inProps,
|
|
130
|
-
name: '
|
|
132
|
+
name: 'MuiPickerDay'
|
|
131
133
|
});
|
|
132
134
|
const adapter = (0, _usePickerAdapter.usePickerAdapter)();
|
|
133
135
|
const {
|
|
@@ -148,24 +150,23 @@ const PickerDay2Raw = /*#__PURE__*/React.forwardRef(function PickerDay2(inProps,
|
|
|
148
150
|
disabled,
|
|
149
151
|
today,
|
|
150
152
|
outsideCurrentMonth,
|
|
151
|
-
disableMargin,
|
|
152
153
|
disableHighlightToday,
|
|
153
|
-
showDaysOutsideCurrentMonth
|
|
154
|
+
showDaysOutsideCurrentMonth,
|
|
155
|
+
isDayFillerCell: isDayFillerCellProp
|
|
154
156
|
} = props,
|
|
155
157
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
156
|
-
const
|
|
158
|
+
const pickerDayOwnerState = (0, _usePickerDayOwnerState.usePickerDayOwnerState)({
|
|
157
159
|
day,
|
|
158
160
|
selected,
|
|
159
161
|
disabled,
|
|
160
162
|
today,
|
|
161
163
|
outsideCurrentMonth,
|
|
162
|
-
disableMargin,
|
|
163
164
|
disableHighlightToday,
|
|
164
165
|
showDaysOutsideCurrentMonth
|
|
165
166
|
});
|
|
166
|
-
const ownerState = (0, _extends2.default)({},
|
|
167
|
+
const ownerState = (0, _extends2.default)({}, pickerDayOwnerState, {
|
|
167
168
|
// Properties specific to the MUI implementation (some might be removed in the next major)
|
|
168
|
-
isDayFillerCell: outsideCurrentMonth && !showDaysOutsideCurrentMonth
|
|
169
|
+
isDayFillerCell: isDayFillerCellProp ?? (outsideCurrentMonth && !showDaysOutsideCurrentMonth)
|
|
169
170
|
});
|
|
170
171
|
const classes = useUtilityClasses(ownerState, classesProp);
|
|
171
172
|
const ref = React.useRef(null);
|
|
@@ -200,12 +201,18 @@ const PickerDay2Raw = /*#__PURE__*/React.forwardRef(function PickerDay2(inProps,
|
|
|
200
201
|
onClick(event);
|
|
201
202
|
}
|
|
202
203
|
};
|
|
203
|
-
|
|
204
|
+
if (ownerState.isDayFillerCell) {
|
|
205
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PickerDayRoot, {
|
|
206
|
+
ref: handleRef,
|
|
207
|
+
role: other.role,
|
|
208
|
+
ownerState: ownerState,
|
|
209
|
+
className: (0, _clsx.default)(classes.root, className),
|
|
210
|
+
as: "div"
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PickerDayRoot, (0, _extends2.default)({
|
|
204
214
|
ref: handleRef,
|
|
205
|
-
centerRipple: true
|
|
206
|
-
// compat with PickersDay for tests
|
|
207
|
-
,
|
|
208
|
-
|
|
215
|
+
centerRipple: true,
|
|
209
216
|
disabled: disabled,
|
|
210
217
|
tabIndex: selected ? 0 : -1,
|
|
211
218
|
onKeyDown: event => onKeyDown(event, day),
|
|
@@ -217,11 +224,11 @@ const PickerDay2Raw = /*#__PURE__*/React.forwardRef(function PickerDay2(inProps,
|
|
|
217
224
|
}, other, {
|
|
218
225
|
ownerState: ownerState,
|
|
219
226
|
className: (0, _clsx.default)(classes.root, className),
|
|
220
|
-
children: children ??
|
|
227
|
+
children: children ?? adapter.format(day, 'dayOfMonth')
|
|
221
228
|
}));
|
|
222
229
|
});
|
|
223
|
-
if (process.env.NODE_ENV !== "production")
|
|
224
|
-
process.env.NODE_ENV !== "production" ?
|
|
230
|
+
if (process.env.NODE_ENV !== "production") PickerDayRaw.displayName = "PickerDayRaw";
|
|
231
|
+
process.env.NODE_ENV !== "production" ? PickerDayRaw.propTypes = {
|
|
225
232
|
// ----------------------------- Warning --------------------------------
|
|
226
233
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
227
234
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -252,20 +259,15 @@ process.env.NODE_ENV !== "production" ? PickerDay2Raw.propTypes = {
|
|
|
252
259
|
*/
|
|
253
260
|
day: _propTypes.default.object.isRequired,
|
|
254
261
|
/**
|
|
255
|
-
* If `true`,
|
|
262
|
+
* If `true`, the day is disabled.
|
|
256
263
|
* @default false
|
|
257
264
|
*/
|
|
258
265
|
disabled: _propTypes.default.bool,
|
|
259
266
|
/**
|
|
260
|
-
* If `true`, today's
|
|
267
|
+
* If `true`, today's day is not highlighted.
|
|
261
268
|
* @default false
|
|
262
269
|
*/
|
|
263
270
|
disableHighlightToday: _propTypes.default.bool,
|
|
264
|
-
/**
|
|
265
|
-
* If `true`, days are rendering without margin. Useful for displaying linked range of days.
|
|
266
|
-
* @default false
|
|
267
|
-
*/
|
|
268
|
-
disableMargin: _propTypes.default.bool,
|
|
269
271
|
/**
|
|
270
272
|
* If `true`, the ripple effect is disabled.
|
|
271
273
|
*
|
|
@@ -293,35 +295,90 @@ process.env.NODE_ENV !== "production" ? PickerDay2Raw.propTypes = {
|
|
|
293
295
|
* if needed.
|
|
294
296
|
*/
|
|
295
297
|
focusVisibleClassName: _propTypes.default.string,
|
|
298
|
+
/**
|
|
299
|
+
* If `true`, the day is being animated.
|
|
300
|
+
* @default false
|
|
301
|
+
*/
|
|
296
302
|
isAnimating: _propTypes.default.bool,
|
|
297
303
|
/**
|
|
298
|
-
* If `true`, day is
|
|
299
|
-
*
|
|
304
|
+
* If `true`, the day is a filler day (its content is hidden).
|
|
305
|
+
* @default false
|
|
306
|
+
*/
|
|
307
|
+
isDayFillerCell: _propTypes.default.bool,
|
|
308
|
+
/**
|
|
309
|
+
* If `true`, the day is the first visible cell of the month.
|
|
310
|
+
* @default false
|
|
300
311
|
*/
|
|
301
|
-
isFirstVisibleCell: _propTypes.default.bool
|
|
312
|
+
isFirstVisibleCell: _propTypes.default.bool,
|
|
302
313
|
/**
|
|
303
|
-
* If `true`, day is the last visible cell of the month.
|
|
304
|
-
*
|
|
314
|
+
* If `true`, the day is the last visible cell of the month.
|
|
315
|
+
* @default false
|
|
305
316
|
*/
|
|
306
|
-
isLastVisibleCell: _propTypes.default.bool
|
|
317
|
+
isLastVisibleCell: _propTypes.default.bool,
|
|
307
318
|
/**
|
|
308
319
|
* Indicates if the day should be visually selected.
|
|
309
320
|
*/
|
|
310
321
|
isVisuallySelected: _propTypes.default.bool,
|
|
322
|
+
/**
|
|
323
|
+
* Whether the custom component is expected to render a native `<button>` element
|
|
324
|
+
* when passing a React component to the `component` or `slots` prop.
|
|
325
|
+
*/
|
|
326
|
+
nativeButton: _propTypes.default.bool,
|
|
327
|
+
/**
|
|
328
|
+
* Callback fired when the component is blurred.
|
|
329
|
+
* @param {React.FocusEvent<HTMLButtonElement>} event The event object.
|
|
330
|
+
* @param {PickerValidDate} day The day.
|
|
331
|
+
* @default () => {}
|
|
332
|
+
*/
|
|
311
333
|
onBlur: _propTypes.default.func,
|
|
334
|
+
/**
|
|
335
|
+
* Callback fired when the component is clicked.
|
|
336
|
+
* @param {MuiEvent<React.MouseEvent<HTMLButtonElement>>} event The event object.
|
|
337
|
+
* @default () => {}
|
|
338
|
+
*/
|
|
339
|
+
onClick: _propTypes.default.func,
|
|
340
|
+
/**
|
|
341
|
+
* Callback fired when the day is selected.
|
|
342
|
+
* @param {PickerValidDate} day The day to select.
|
|
343
|
+
*/
|
|
312
344
|
onDaySelect: _propTypes.default.func.isRequired,
|
|
345
|
+
/**
|
|
346
|
+
* Callback fired when the component is focused.
|
|
347
|
+
* @param {React.FocusEvent<HTMLButtonElement>} event The event object.
|
|
348
|
+
* @param {PickerValidDate} day The day.
|
|
349
|
+
* @default () => {}
|
|
350
|
+
*/
|
|
313
351
|
onFocus: _propTypes.default.func,
|
|
314
352
|
/**
|
|
315
353
|
* Callback fired when the component is focused with a keyboard.
|
|
316
354
|
* We trigger a `onFocus` callback too.
|
|
317
355
|
*/
|
|
318
356
|
onFocusVisible: _propTypes.default.func,
|
|
357
|
+
/**
|
|
358
|
+
* Callback fired when a key is pressed.
|
|
359
|
+
* @param {React.KeyboardEvent<HTMLButtonElement>} event The event object.
|
|
360
|
+
* @param {PickerValidDate} day The day.
|
|
361
|
+
* @default () => {}
|
|
362
|
+
*/
|
|
319
363
|
onKeyDown: _propTypes.default.func,
|
|
364
|
+
/**
|
|
365
|
+
* Callback fired when the mouse button is pressed.
|
|
366
|
+
* @param {React.MouseEvent<HTMLButtonElement>} event The event object.
|
|
367
|
+
* @default () => {}
|
|
368
|
+
*/
|
|
369
|
+
onMouseDown: _propTypes.default.func,
|
|
370
|
+
/**
|
|
371
|
+
* Callback fired when the mouse enters the component.
|
|
372
|
+
* @param {React.MouseEvent<HTMLButtonElement>} event The event object.
|
|
373
|
+
* @param {PickerValidDate} day The day.
|
|
374
|
+
* @default () => {}
|
|
375
|
+
*/
|
|
320
376
|
onMouseEnter: _propTypes.default.func,
|
|
321
377
|
/**
|
|
322
|
-
* If `true`, day is outside
|
|
378
|
+
* If `true`, the day is outside the current month.
|
|
379
|
+
* @default false
|
|
323
380
|
*/
|
|
324
|
-
outsideCurrentMonth: _propTypes.default.bool
|
|
381
|
+
outsideCurrentMonth: _propTypes.default.bool,
|
|
325
382
|
/**
|
|
326
383
|
* If `true`, renders as selected.
|
|
327
384
|
* @default false
|
|
@@ -348,7 +405,7 @@ process.env.NODE_ENV !== "production" ? PickerDay2Raw.propTypes = {
|
|
|
348
405
|
*/
|
|
349
406
|
tabIndex: _propTypes.default.number,
|
|
350
407
|
/**
|
|
351
|
-
* If `true`,
|
|
408
|
+
* If `true`, today's day is highlighted.
|
|
352
409
|
* @default false
|
|
353
410
|
*/
|
|
354
411
|
today: _propTypes.default.bool,
|
|
@@ -367,5 +424,13 @@ process.env.NODE_ENV !== "production" ? PickerDay2Raw.propTypes = {
|
|
|
367
424
|
})
|
|
368
425
|
})])
|
|
369
426
|
} : void 0;
|
|
370
|
-
|
|
371
|
-
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Demos:
|
|
430
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
431
|
+
*
|
|
432
|
+
* API:
|
|
433
|
+
* - [PickerDay API](https://mui.com/x/api/date-pickers/picker-day/)
|
|
434
|
+
*/
|
|
435
|
+
const PickerDay = exports.PickerDay = /*#__PURE__*/React.memo(PickerDayRaw);
|
|
436
|
+
if (process.env.NODE_ENV !== "production") PickerDay.displayName = "PickerDay";
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["autoFocus", "className", "classes", "hidden", "isAnimating", "onClick", "onDaySelect", "onFocus", "onBlur", "onKeyDown", "onMouseDown", "onMouseEnter", "children", "isFirstVisibleCell", "isLastVisibleCell", "day", "selected", "disabled", "today", "outsideCurrentMonth", "
|
|
5
|
+
const _excluded = ["autoFocus", "className", "classes", "hidden", "isAnimating", "onClick", "onDaySelect", "onFocus", "onBlur", "onKeyDown", "onMouseDown", "onMouseEnter", "children", "isFirstVisibleCell", "isLastVisibleCell", "day", "selected", "disabled", "today", "outsideCurrentMonth", "disableHighlightToday", "showDaysOutsideCurrentMonth", "isVisuallySelected", "isDayFillerCell"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import {
|
|
9
|
+
import { styled, useThemeProps } from '@mui/material/styles';
|
|
10
10
|
import ButtonBase from '@mui/material/ButtonBase';
|
|
11
11
|
import useForkRef from '@mui/utils/useForkRef';
|
|
12
12
|
import composeClasses from '@mui/utils/composeClasses';
|
|
13
13
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
14
14
|
import { DAY_MARGIN, DAY_SIZE } from "../internals/constants/dimensions.mjs";
|
|
15
|
-
import {
|
|
15
|
+
import { pickerDayClasses, getPickerDayUtilityClass } from "./pickerDayClasses.mjs";
|
|
16
16
|
import { usePickerAdapter } from "../hooks/usePickerAdapter.mjs";
|
|
17
|
-
import { usePickerDayOwnerState } from "../
|
|
17
|
+
import { usePickerDayOwnerState } from "../internals/hooks/usePickerDayOwnerState.mjs";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
const useUtilityClasses = (ownerState, classes) => {
|
|
20
20
|
const {
|
|
@@ -28,16 +28,16 @@ const useUtilityClasses = (ownerState, classes) => {
|
|
|
28
28
|
const slots = {
|
|
29
29
|
root: ['root', isDaySelected && !isDayFillerCell && 'selected', isDayDisabled && 'disabled', !disableHighlightToday && isDayCurrent && !isDaySelected && !isDayFillerCell && 'today', isDayOutsideMonth && 'dayOutsideMonth', isDayFillerCell && 'fillerCell']
|
|
30
30
|
};
|
|
31
|
-
return composeClasses(slots,
|
|
31
|
+
return composeClasses(slots, getPickerDayUtilityClass, classes);
|
|
32
32
|
};
|
|
33
|
-
const
|
|
34
|
-
name: '
|
|
33
|
+
const PickerDayRoot = styled(ButtonBase, {
|
|
34
|
+
name: 'MuiPickerDay',
|
|
35
35
|
slot: 'Root',
|
|
36
36
|
overridesResolver: (props, styles) => {
|
|
37
37
|
const {
|
|
38
38
|
ownerState
|
|
39
39
|
} = props;
|
|
40
|
-
return [styles.root, !ownerState.disableHighlightToday && ownerState.isDayCurrent && styles.today,
|
|
40
|
+
return [styles.root, !ownerState.disableHighlightToday && ownerState.isDayCurrent && styles.today, ownerState.isDayOutsideMonth && styles.dayOutsideMonth, ownerState.isDayFillerCell && styles.fillerCell];
|
|
41
41
|
}
|
|
42
42
|
})(({
|
|
43
43
|
theme
|
|
@@ -45,6 +45,8 @@ const PickerDay2Root = styled(ButtonBase, {
|
|
|
45
45
|
'--PickerDay-horizontalMargin': `${DAY_MARGIN}px`,
|
|
46
46
|
'--PickerDay-size': `${DAY_SIZE}px`
|
|
47
47
|
}, theme.typography.caption, {
|
|
48
|
+
lineHeight: 1,
|
|
49
|
+
display: 'flex',
|
|
48
50
|
width: 'var(--PickerDay-size)',
|
|
49
51
|
height: 'var(--PickerDay-size)',
|
|
50
52
|
borderRadius: 'calc(var(--PickerDay-size) / 2)',
|
|
@@ -57,11 +59,11 @@ const PickerDay2Root = styled(ButtonBase, {
|
|
|
57
59
|
color: (theme.vars || theme).palette.text.primary,
|
|
58
60
|
'@media (pointer: fine)': {
|
|
59
61
|
'&:hover': {
|
|
60
|
-
backgroundColor: theme.
|
|
62
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.hoverOpacity)
|
|
61
63
|
}
|
|
62
64
|
},
|
|
63
65
|
'&:focus': {
|
|
64
|
-
backgroundColor: theme.
|
|
66
|
+
backgroundColor: theme.alpha((theme.vars || theme).palette.primary.main, (theme.vars || theme).palette.action.focusOpacity)
|
|
65
67
|
},
|
|
66
68
|
marginLeft: 'var(--PickerDay-horizontalMargin)',
|
|
67
69
|
marginRight: 'var(--PickerDay-horizontalMargin)',
|
|
@@ -77,7 +79,7 @@ const PickerDay2Root = styled(ButtonBase, {
|
|
|
77
79
|
willChange: 'background-color',
|
|
78
80
|
backgroundColor: (theme.vars || theme).palette.primary.dark
|
|
79
81
|
},
|
|
80
|
-
[`&.${
|
|
82
|
+
[`&.${pickerDayClasses.disabled}`]: {
|
|
81
83
|
opacity: 0.6
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -117,10 +119,10 @@ const PickerDay2Root = styled(ButtonBase, {
|
|
|
117
119
|
}]
|
|
118
120
|
}));
|
|
119
121
|
const noop = () => {};
|
|
120
|
-
const
|
|
122
|
+
const PickerDayRaw = /*#__PURE__*/React.forwardRef(function PickerDay(inProps, forwardedRef) {
|
|
121
123
|
const props = useThemeProps({
|
|
122
124
|
props: inProps,
|
|
123
|
-
name: '
|
|
125
|
+
name: 'MuiPickerDay'
|
|
124
126
|
});
|
|
125
127
|
const adapter = usePickerAdapter();
|
|
126
128
|
const {
|
|
@@ -141,24 +143,23 @@ const PickerDay2Raw = /*#__PURE__*/React.forwardRef(function PickerDay2(inProps,
|
|
|
141
143
|
disabled,
|
|
142
144
|
today,
|
|
143
145
|
outsideCurrentMonth,
|
|
144
|
-
disableMargin,
|
|
145
146
|
disableHighlightToday,
|
|
146
|
-
showDaysOutsideCurrentMonth
|
|
147
|
+
showDaysOutsideCurrentMonth,
|
|
148
|
+
isDayFillerCell: isDayFillerCellProp
|
|
147
149
|
} = props,
|
|
148
150
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
149
|
-
const
|
|
151
|
+
const pickerDayOwnerState = usePickerDayOwnerState({
|
|
150
152
|
day,
|
|
151
153
|
selected,
|
|
152
154
|
disabled,
|
|
153
155
|
today,
|
|
154
156
|
outsideCurrentMonth,
|
|
155
|
-
disableMargin,
|
|
156
157
|
disableHighlightToday,
|
|
157
158
|
showDaysOutsideCurrentMonth
|
|
158
159
|
});
|
|
159
|
-
const ownerState = _extends({},
|
|
160
|
+
const ownerState = _extends({}, pickerDayOwnerState, {
|
|
160
161
|
// Properties specific to the MUI implementation (some might be removed in the next major)
|
|
161
|
-
isDayFillerCell: outsideCurrentMonth && !showDaysOutsideCurrentMonth
|
|
162
|
+
isDayFillerCell: isDayFillerCellProp ?? (outsideCurrentMonth && !showDaysOutsideCurrentMonth)
|
|
162
163
|
});
|
|
163
164
|
const classes = useUtilityClasses(ownerState, classesProp);
|
|
164
165
|
const ref = React.useRef(null);
|
|
@@ -193,12 +194,18 @@ const PickerDay2Raw = /*#__PURE__*/React.forwardRef(function PickerDay2(inProps,
|
|
|
193
194
|
onClick(event);
|
|
194
195
|
}
|
|
195
196
|
};
|
|
196
|
-
|
|
197
|
+
if (ownerState.isDayFillerCell) {
|
|
198
|
+
return /*#__PURE__*/_jsx(PickerDayRoot, {
|
|
199
|
+
ref: handleRef,
|
|
200
|
+
role: other.role,
|
|
201
|
+
ownerState: ownerState,
|
|
202
|
+
className: clsx(classes.root, className),
|
|
203
|
+
as: "div"
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return /*#__PURE__*/_jsx(PickerDayRoot, _extends({
|
|
197
207
|
ref: handleRef,
|
|
198
|
-
centerRipple: true
|
|
199
|
-
// compat with PickersDay for tests
|
|
200
|
-
,
|
|
201
|
-
|
|
208
|
+
centerRipple: true,
|
|
202
209
|
disabled: disabled,
|
|
203
210
|
tabIndex: selected ? 0 : -1,
|
|
204
211
|
onKeyDown: event => onKeyDown(event, day),
|
|
@@ -210,11 +217,11 @@ const PickerDay2Raw = /*#__PURE__*/React.forwardRef(function PickerDay2(inProps,
|
|
|
210
217
|
}, other, {
|
|
211
218
|
ownerState: ownerState,
|
|
212
219
|
className: clsx(classes.root, className),
|
|
213
|
-
children: children ??
|
|
220
|
+
children: children ?? adapter.format(day, 'dayOfMonth')
|
|
214
221
|
}));
|
|
215
222
|
});
|
|
216
|
-
if (process.env.NODE_ENV !== "production")
|
|
217
|
-
process.env.NODE_ENV !== "production" ?
|
|
223
|
+
if (process.env.NODE_ENV !== "production") PickerDayRaw.displayName = "PickerDayRaw";
|
|
224
|
+
process.env.NODE_ENV !== "production" ? PickerDayRaw.propTypes = {
|
|
218
225
|
// ----------------------------- Warning --------------------------------
|
|
219
226
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
220
227
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -245,20 +252,15 @@ process.env.NODE_ENV !== "production" ? PickerDay2Raw.propTypes = {
|
|
|
245
252
|
*/
|
|
246
253
|
day: PropTypes.object.isRequired,
|
|
247
254
|
/**
|
|
248
|
-
* If `true`,
|
|
255
|
+
* If `true`, the day is disabled.
|
|
249
256
|
* @default false
|
|
250
257
|
*/
|
|
251
258
|
disabled: PropTypes.bool,
|
|
252
259
|
/**
|
|
253
|
-
* If `true`, today's
|
|
260
|
+
* If `true`, today's day is not highlighted.
|
|
254
261
|
* @default false
|
|
255
262
|
*/
|
|
256
263
|
disableHighlightToday: PropTypes.bool,
|
|
257
|
-
/**
|
|
258
|
-
* If `true`, days are rendering without margin. Useful for displaying linked range of days.
|
|
259
|
-
* @default false
|
|
260
|
-
*/
|
|
261
|
-
disableMargin: PropTypes.bool,
|
|
262
264
|
/**
|
|
263
265
|
* If `true`, the ripple effect is disabled.
|
|
264
266
|
*
|
|
@@ -286,35 +288,90 @@ process.env.NODE_ENV !== "production" ? PickerDay2Raw.propTypes = {
|
|
|
286
288
|
* if needed.
|
|
287
289
|
*/
|
|
288
290
|
focusVisibleClassName: PropTypes.string,
|
|
291
|
+
/**
|
|
292
|
+
* If `true`, the day is being animated.
|
|
293
|
+
* @default false
|
|
294
|
+
*/
|
|
289
295
|
isAnimating: PropTypes.bool,
|
|
290
296
|
/**
|
|
291
|
-
* If `true`, day is
|
|
292
|
-
*
|
|
297
|
+
* If `true`, the day is a filler day (its content is hidden).
|
|
298
|
+
* @default false
|
|
299
|
+
*/
|
|
300
|
+
isDayFillerCell: PropTypes.bool,
|
|
301
|
+
/**
|
|
302
|
+
* If `true`, the day is the first visible cell of the month.
|
|
303
|
+
* @default false
|
|
293
304
|
*/
|
|
294
|
-
isFirstVisibleCell: PropTypes.bool
|
|
305
|
+
isFirstVisibleCell: PropTypes.bool,
|
|
295
306
|
/**
|
|
296
|
-
* If `true`, day is the last visible cell of the month.
|
|
297
|
-
*
|
|
307
|
+
* If `true`, the day is the last visible cell of the month.
|
|
308
|
+
* @default false
|
|
298
309
|
*/
|
|
299
|
-
isLastVisibleCell: PropTypes.bool
|
|
310
|
+
isLastVisibleCell: PropTypes.bool,
|
|
300
311
|
/**
|
|
301
312
|
* Indicates if the day should be visually selected.
|
|
302
313
|
*/
|
|
303
314
|
isVisuallySelected: PropTypes.bool,
|
|
315
|
+
/**
|
|
316
|
+
* Whether the custom component is expected to render a native `<button>` element
|
|
317
|
+
* when passing a React component to the `component` or `slots` prop.
|
|
318
|
+
*/
|
|
319
|
+
nativeButton: PropTypes.bool,
|
|
320
|
+
/**
|
|
321
|
+
* Callback fired when the component is blurred.
|
|
322
|
+
* @param {React.FocusEvent<HTMLButtonElement>} event The event object.
|
|
323
|
+
* @param {PickerValidDate} day The day.
|
|
324
|
+
* @default () => {}
|
|
325
|
+
*/
|
|
304
326
|
onBlur: PropTypes.func,
|
|
327
|
+
/**
|
|
328
|
+
* Callback fired when the component is clicked.
|
|
329
|
+
* @param {MuiEvent<React.MouseEvent<HTMLButtonElement>>} event The event object.
|
|
330
|
+
* @default () => {}
|
|
331
|
+
*/
|
|
332
|
+
onClick: PropTypes.func,
|
|
333
|
+
/**
|
|
334
|
+
* Callback fired when the day is selected.
|
|
335
|
+
* @param {PickerValidDate} day The day to select.
|
|
336
|
+
*/
|
|
305
337
|
onDaySelect: PropTypes.func.isRequired,
|
|
338
|
+
/**
|
|
339
|
+
* Callback fired when the component is focused.
|
|
340
|
+
* @param {React.FocusEvent<HTMLButtonElement>} event The event object.
|
|
341
|
+
* @param {PickerValidDate} day The day.
|
|
342
|
+
* @default () => {}
|
|
343
|
+
*/
|
|
306
344
|
onFocus: PropTypes.func,
|
|
307
345
|
/**
|
|
308
346
|
* Callback fired when the component is focused with a keyboard.
|
|
309
347
|
* We trigger a `onFocus` callback too.
|
|
310
348
|
*/
|
|
311
349
|
onFocusVisible: PropTypes.func,
|
|
350
|
+
/**
|
|
351
|
+
* Callback fired when a key is pressed.
|
|
352
|
+
* @param {React.KeyboardEvent<HTMLButtonElement>} event The event object.
|
|
353
|
+
* @param {PickerValidDate} day The day.
|
|
354
|
+
* @default () => {}
|
|
355
|
+
*/
|
|
312
356
|
onKeyDown: PropTypes.func,
|
|
357
|
+
/**
|
|
358
|
+
* Callback fired when the mouse button is pressed.
|
|
359
|
+
* @param {React.MouseEvent<HTMLButtonElement>} event The event object.
|
|
360
|
+
* @default () => {}
|
|
361
|
+
*/
|
|
362
|
+
onMouseDown: PropTypes.func,
|
|
363
|
+
/**
|
|
364
|
+
* Callback fired when the mouse enters the component.
|
|
365
|
+
* @param {React.MouseEvent<HTMLButtonElement>} event The event object.
|
|
366
|
+
* @param {PickerValidDate} day The day.
|
|
367
|
+
* @default () => {}
|
|
368
|
+
*/
|
|
313
369
|
onMouseEnter: PropTypes.func,
|
|
314
370
|
/**
|
|
315
|
-
* If `true`, day is outside
|
|
371
|
+
* If `true`, the day is outside the current month.
|
|
372
|
+
* @default false
|
|
316
373
|
*/
|
|
317
|
-
outsideCurrentMonth: PropTypes.bool
|
|
374
|
+
outsideCurrentMonth: PropTypes.bool,
|
|
318
375
|
/**
|
|
319
376
|
* If `true`, renders as selected.
|
|
320
377
|
* @default false
|
|
@@ -341,7 +398,7 @@ process.env.NODE_ENV !== "production" ? PickerDay2Raw.propTypes = {
|
|
|
341
398
|
*/
|
|
342
399
|
tabIndex: PropTypes.number,
|
|
343
400
|
/**
|
|
344
|
-
* If `true`,
|
|
401
|
+
* If `true`, today's day is highlighted.
|
|
345
402
|
* @default false
|
|
346
403
|
*/
|
|
347
404
|
today: PropTypes.bool,
|
|
@@ -360,5 +417,13 @@ process.env.NODE_ENV !== "production" ? PickerDay2Raw.propTypes = {
|
|
|
360
417
|
})
|
|
361
418
|
})])
|
|
362
419
|
} : void 0;
|
|
363
|
-
|
|
364
|
-
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Demos:
|
|
423
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
424
|
+
*
|
|
425
|
+
* API:
|
|
426
|
+
* - [PickerDay API](https://mui.com/x/api/date-pickers/picker-day/)
|
|
427
|
+
*/
|
|
428
|
+
export const PickerDay = /*#__PURE__*/React.memo(PickerDayRaw);
|
|
429
|
+
if (process.env.NODE_ENV !== "production") PickerDay.displayName = "PickerDay";
|