@mui/x-date-pickers 9.0.0-alpha.4 → 9.0.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 +374 -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 -28
- package/DateField/DateField.mjs +22 -28
- 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 -28
- package/DateTimeField/DateTimeField.mjs +22 -28
- 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/LocalizationProvider/LocalizationProvider.d.mts +0 -6
- package/LocalizationProvider/LocalizationProvider.d.ts +0 -6
- package/LocalizationProvider/LocalizationProvider.js +1 -10
- package/LocalizationProvider/LocalizationProvider.mjs +0 -9
- package/LocalizationProvider/index.d.mts +1 -1
- package/LocalizationProvider/index.d.ts +1 -1
- package/LocalizationProvider/index.js +0 -6
- package/LocalizationProvider/index.mjs +1 -1
- 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 +37 -16
- package/PickersTextField/PickersFilledInput/PickersFilledInput.mjs +37 -16
- package/PickersTextField/PickersInput/PickersInput.js +35 -14
- package/PickersTextField/PickersInput/PickersInput.mjs +35 -14
- package/PickersTextField/PickersInputBase/PickersInputBase.js +38 -8
- package/PickersTextField/PickersInputBase/PickersInputBase.mjs +38 -8
- package/PickersTextField/PickersInputBase/PickersInputBase.types.d.mts +56 -13
- package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +56 -13
- package/PickersTextField/PickersOutlinedInput/Outline.js +1 -1
- package/PickersTextField/PickersOutlinedInput/Outline.mjs +1 -1
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +33 -11
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.mjs +33 -11
- package/PickersTextField/PickersTextField.js +92 -39
- package/PickersTextField/PickersTextField.mjs +92 -39
- package/PickersTextField/PickersTextField.types.d.mts +56 -28
- package/PickersTextField/PickersTextField.types.d.ts +56 -28
- package/PickersTextField/index.d.mts +1 -1
- package/PickersTextField/index.d.ts +1 -1
- 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 +23 -29
- package/TimeField/TimeField.mjs +23 -29
- 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 +11 -17
- package/internals/components/PickerFieldUI.d.ts +11 -17
- package/internals/components/PickerFieldUI.js +65 -114
- package/internals/components/PickerFieldUI.mjs +65 -114
- 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
|
@@ -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";
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { ButtonBaseProps } from '@mui/material/ButtonBase';
|
|
2
|
+
import { MuiEvent } from '@mui/x-internals/types';
|
|
3
|
+
import { PickerValidDate } from "../models/index.mjs";
|
|
4
|
+
import { PickerDayClasses } from "./pickerDayClasses.mjs";
|
|
5
|
+
import { PickerDayOwnerState as PickerDayOwnerStateBase } from "../internals/hooks/PickerDay.types.mjs";
|
|
6
|
+
export interface ExportedPickerDayProps {
|
|
7
|
+
/**
|
|
8
|
+
* If `true`, today's day is not highlighted.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
disableHighlightToday?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* If `true`, days outside the current month are rendered:
|
|
14
|
+
*
|
|
15
|
+
* - if `fixedWeekNumber` is defined, renders days to have the weeks requested.
|
|
16
|
+
*
|
|
17
|
+
* - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.
|
|
18
|
+
*
|
|
19
|
+
* - ignored if `calendars` equals more than `1` on range pickers.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
showDaysOutsideCurrentMonth?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface PickerDayProps extends ExportedPickerDayProps, Omit<ButtonBaseProps, 'classes' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onMouseDown' | 'onClick' | 'onMouseEnter' | 'LinkComponent'> {
|
|
25
|
+
/**
|
|
26
|
+
* The date to show.
|
|
27
|
+
*/
|
|
28
|
+
day: PickerValidDate;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, renders as selected.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
selected?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If `true`, the day is disabled.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* If `true`, today's day is highlighted.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
today?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* If `true`, the day is outside the current month.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
outsideCurrentMonth?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* If `true`, the day is the first visible cell of the month.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
isFirstVisibleCell?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* If `true`, the day is the last visible cell of the month.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
isLastVisibleCell?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* If `true`, the day is being animated.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
isAnimating?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Callback fired when the day is selected.
|
|
66
|
+
* @param {PickerValidDate} day The day to select.
|
|
67
|
+
*/
|
|
68
|
+
onDaySelect: (day: PickerValidDate) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Callback fired when a key is pressed.
|
|
71
|
+
* @param {React.KeyboardEvent<HTMLButtonElement>} event The event object.
|
|
72
|
+
* @param {PickerValidDate} day The day.
|
|
73
|
+
* @default () => {}
|
|
74
|
+
*/
|
|
75
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>, day: PickerValidDate) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Callback fired when the component is focused.
|
|
78
|
+
* @param {React.FocusEvent<HTMLButtonElement>} event The event object.
|
|
79
|
+
* @param {PickerValidDate} day The day.
|
|
80
|
+
* @default () => {}
|
|
81
|
+
*/
|
|
82
|
+
onFocus?: (event: React.FocusEvent<HTMLButtonElement>, day: PickerValidDate) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Callback fired when the component is blurred.
|
|
85
|
+
* @param {React.FocusEvent<HTMLButtonElement>} event The event object.
|
|
86
|
+
* @param {PickerValidDate} day The day.
|
|
87
|
+
* @default () => {}
|
|
88
|
+
*/
|
|
89
|
+
onBlur?: (event: React.FocusEvent<HTMLButtonElement>, day: PickerValidDate) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Callback fired when the mouse enters the component.
|
|
92
|
+
* @param {React.MouseEvent<HTMLButtonElement>} event The event object.
|
|
93
|
+
* @param {PickerValidDate} day The day.
|
|
94
|
+
* @default () => {}
|
|
95
|
+
*/
|
|
96
|
+
onMouseEnter?: (event: React.MouseEvent<HTMLButtonElement>, day: PickerValidDate) => void;
|
|
97
|
+
/**
|
|
98
|
+
* Callback fired when the component is clicked.
|
|
99
|
+
* @param {MuiEvent<React.MouseEvent<HTMLButtonElement>>} event The event object.
|
|
100
|
+
* @default () => {}
|
|
101
|
+
*/
|
|
102
|
+
onClick?: (event: MuiEvent<React.MouseEvent<HTMLButtonElement>>) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Callback fired when the mouse button is pressed.
|
|
105
|
+
* @param {React.MouseEvent<HTMLButtonElement>} event The event object.
|
|
106
|
+
* @default () => {}
|
|
107
|
+
*/
|
|
108
|
+
onMouseDown?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Override or extend the styles applied to the component.
|
|
111
|
+
*/
|
|
112
|
+
classes?: Partial<PickerDayClasses>;
|
|
113
|
+
/**
|
|
114
|
+
* Indicates if the day should be visually selected.
|
|
115
|
+
*/
|
|
116
|
+
isVisuallySelected?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* If `true`, the day is a filler day (its content is hidden).
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
isDayFillerCell?: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface PickerDayOwnerState extends PickerDayOwnerStateBase {
|
|
124
|
+
/**
|
|
125
|
+
* Whether the day is a filler day (its content is hidden).
|
|
126
|
+
*/
|
|
127
|
+
isDayFillerCell?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Whether the day is the first visible cell of the month it's being rendered in.
|
|
130
|
+
*/
|
|
131
|
+
isDayFirstVisibleCell?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Whether the day is the last visible cell of the month it's being rendered in.
|
|
134
|
+
*/
|
|
135
|
+
isDayLastVisibleCell?: boolean;
|
|
136
|
+
}
|
|
137
|
+
export type { PickerDayOwnerStateBase };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { ButtonBaseProps } from '@mui/material/ButtonBase';
|
|
2
|
+
import { MuiEvent } from '@mui/x-internals/types';
|
|
3
|
+
import { PickerValidDate } from "../models/index.js";
|
|
4
|
+
import { PickerDayClasses } from "./pickerDayClasses.js";
|
|
5
|
+
import { PickerDayOwnerState as PickerDayOwnerStateBase } from "../internals/hooks/PickerDay.types.js";
|
|
6
|
+
export interface ExportedPickerDayProps {
|
|
7
|
+
/**
|
|
8
|
+
* If `true`, today's day is not highlighted.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
disableHighlightToday?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* If `true`, days outside the current month are rendered:
|
|
14
|
+
*
|
|
15
|
+
* - if `fixedWeekNumber` is defined, renders days to have the weeks requested.
|
|
16
|
+
*
|
|
17
|
+
* - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.
|
|
18
|
+
*
|
|
19
|
+
* - ignored if `calendars` equals more than `1` on range pickers.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
showDaysOutsideCurrentMonth?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface PickerDayProps extends ExportedPickerDayProps, Omit<ButtonBaseProps, 'classes' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onMouseDown' | 'onClick' | 'onMouseEnter' | 'LinkComponent'> {
|
|
25
|
+
/**
|
|
26
|
+
* The date to show.
|
|
27
|
+
*/
|
|
28
|
+
day: PickerValidDate;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, renders as selected.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
selected?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If `true`, the day is disabled.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* If `true`, today's day is highlighted.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
today?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* If `true`, the day is outside the current month.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
outsideCurrentMonth?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* If `true`, the day is the first visible cell of the month.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
isFirstVisibleCell?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* If `true`, the day is the last visible cell of the month.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
isLastVisibleCell?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* If `true`, the day is being animated.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
isAnimating?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Callback fired when the day is selected.
|
|
66
|
+
* @param {PickerValidDate} day The day to select.
|
|
67
|
+
*/
|
|
68
|
+
onDaySelect: (day: PickerValidDate) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Callback fired when a key is pressed.
|
|
71
|
+
* @param {React.KeyboardEvent<HTMLButtonElement>} event The event object.
|
|
72
|
+
* @param {PickerValidDate} day The day.
|
|
73
|
+
* @default () => {}
|
|
74
|
+
*/
|
|
75
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>, day: PickerValidDate) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Callback fired when the component is focused.
|
|
78
|
+
* @param {React.FocusEvent<HTMLButtonElement>} event The event object.
|
|
79
|
+
* @param {PickerValidDate} day The day.
|
|
80
|
+
* @default () => {}
|
|
81
|
+
*/
|
|
82
|
+
onFocus?: (event: React.FocusEvent<HTMLButtonElement>, day: PickerValidDate) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Callback fired when the component is blurred.
|
|
85
|
+
* @param {React.FocusEvent<HTMLButtonElement>} event The event object.
|
|
86
|
+
* @param {PickerValidDate} day The day.
|
|
87
|
+
* @default () => {}
|
|
88
|
+
*/
|
|
89
|
+
onBlur?: (event: React.FocusEvent<HTMLButtonElement>, day: PickerValidDate) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Callback fired when the mouse enters the component.
|
|
92
|
+
* @param {React.MouseEvent<HTMLButtonElement>} event The event object.
|
|
93
|
+
* @param {PickerValidDate} day The day.
|
|
94
|
+
* @default () => {}
|
|
95
|
+
*/
|
|
96
|
+
onMouseEnter?: (event: React.MouseEvent<HTMLButtonElement>, day: PickerValidDate) => void;
|
|
97
|
+
/**
|
|
98
|
+
* Callback fired when the component is clicked.
|
|
99
|
+
* @param {MuiEvent<React.MouseEvent<HTMLButtonElement>>} event The event object.
|
|
100
|
+
* @default () => {}
|
|
101
|
+
*/
|
|
102
|
+
onClick?: (event: MuiEvent<React.MouseEvent<HTMLButtonElement>>) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Callback fired when the mouse button is pressed.
|
|
105
|
+
* @param {React.MouseEvent<HTMLButtonElement>} event The event object.
|
|
106
|
+
* @default () => {}
|
|
107
|
+
*/
|
|
108
|
+
onMouseDown?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Override or extend the styles applied to the component.
|
|
111
|
+
*/
|
|
112
|
+
classes?: Partial<PickerDayClasses>;
|
|
113
|
+
/**
|
|
114
|
+
* Indicates if the day should be visually selected.
|
|
115
|
+
*/
|
|
116
|
+
isVisuallySelected?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* If `true`, the day is a filler day (its content is hidden).
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
isDayFillerCell?: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface PickerDayOwnerState extends PickerDayOwnerStateBase {
|
|
124
|
+
/**
|
|
125
|
+
* Whether the day is a filler day (its content is hidden).
|
|
126
|
+
*/
|
|
127
|
+
isDayFillerCell?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Whether the day is the first visible cell of the month it's being rendered in.
|
|
130
|
+
*/
|
|
131
|
+
isDayFirstVisibleCell?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Whether the day is the last visible cell of the month it's being rendered in.
|
|
134
|
+
*/
|
|
135
|
+
isDayLastVisibleCell?: boolean;
|
|
136
|
+
}
|
|
137
|
+
export type { PickerDayOwnerStateBase };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { PickerDay } from "./PickerDay.mjs";
|
|
2
|
+
export type { PickerDayProps, PickerDayOwnerState, PickerDayOwnerStateBase } from "./PickerDay.types.mjs";
|
|
3
|
+
export { getPickerDayUtilityClass, pickerDayClasses } from "./pickerDayClasses.mjs";
|
|
4
|
+
export type { PickerDayClassKey } from "./pickerDayClasses.mjs";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { PickerDay } from "./PickerDay.js";
|
|
2
|
+
export type { PickerDayProps, PickerDayOwnerState, PickerDayOwnerStateBase } from "./PickerDay.types.js";
|
|
3
|
+
export { getPickerDayUtilityClass, pickerDayClasses } from "./pickerDayClasses.js";
|
|
4
|
+
export type { PickerDayClassKey } from "./pickerDayClasses.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "PickerDay", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _PickerDay.PickerDay;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "getPickerDayUtilityClass", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _pickerDayClasses.getPickerDayUtilityClass;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "pickerDayClasses", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _pickerDayClasses.pickerDayClasses;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var _PickerDay = require("./PickerDay");
|
|
25
|
+
var _pickerDayClasses = require("./pickerDayClasses");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface PickerDayClasses {
|
|
2
2
|
/** Styles applied to the root element. */
|
|
3
3
|
root: string;
|
|
4
4
|
/** Styles applied to the root element if `outsideCurrentMonth=true` and `showDaysOutsideCurrentMonth=true`. */
|
|
@@ -12,6 +12,6 @@ export interface PickerDay2Classes {
|
|
|
12
12
|
/** State class applied to the root element if `disabled=true`. */
|
|
13
13
|
disabled: string;
|
|
14
14
|
}
|
|
15
|
-
export type
|
|
16
|
-
export declare function
|
|
17
|
-
export declare const
|
|
15
|
+
export type PickerDayClassKey = keyof PickerDayClasses;
|
|
16
|
+
export declare function getPickerDayUtilityClass(slot: string): string;
|
|
17
|
+
export declare const pickerDayClasses: Record<keyof PickerDayClasses, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface PickerDayClasses {
|
|
2
2
|
/** Styles applied to the root element. */
|
|
3
3
|
root: string;
|
|
4
4
|
/** Styles applied to the root element if `outsideCurrentMonth=true` and `showDaysOutsideCurrentMonth=true`. */
|
|
@@ -12,6 +12,6 @@ export interface PickerDay2Classes {
|
|
|
12
12
|
/** State class applied to the root element if `disabled=true`. */
|
|
13
13
|
disabled: string;
|
|
14
14
|
}
|
|
15
|
-
export type
|
|
16
|
-
export declare function
|
|
17
|
-
export declare const
|
|
15
|
+
export type PickerDayClassKey = keyof PickerDayClasses;
|
|
16
|
+
export declare function getPickerDayUtilityClass(slot: string): string;
|
|
17
|
+
export declare const pickerDayClasses: Record<keyof PickerDayClasses, string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getPickerDayUtilityClass = getPickerDayUtilityClass;
|
|
8
|
+
exports.pickerDayClasses = void 0;
|
|
9
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
10
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
11
|
+
function getPickerDayUtilityClass(slot) {
|
|
12
|
+
return (0, _generateUtilityClass.default)('MuiPickerDay', slot);
|
|
13
|
+
}
|
|
14
|
+
const pickerDayClasses = exports.pickerDayClasses = (0, _generateUtilityClasses.default)('MuiPickerDay', ['root', 'dayOutsideMonth', 'today', 'selected', 'disabled', 'fillerCell']);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
3
|
+
export function getPickerDayUtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiPickerDay', slot);
|
|
5
|
+
}
|
|
6
|
+
export const pickerDayClasses = generateUtilityClasses('MuiPickerDay', ['root', 'dayOutsideMonth', 'today', 'selected', 'disabled', 'fillerCell']);
|