@mui/x-date-pickers 8.0.0-alpha.4 → 8.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +182 -0
- package/DatePicker/DatePickerToolbar.d.ts +1 -2
- package/DatePicker/DatePickerToolbar.js +6 -17
- package/DateTimePicker/DateTimePicker.types.d.ts +2 -2
- package/DateTimePicker/DateTimePickerTabs.d.ts +2 -5
- package/DateTimePicker/DateTimePickerTabs.js +6 -13
- package/DateTimePicker/DateTimePickerToolbar.d.ts +8 -4
- package/DateTimePicker/DateTimePickerToolbar.js +13 -24
- package/DateTimePicker/shared.d.ts +2 -2
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +2 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +1 -2
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -11
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -2
- package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -3
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +4 -4
- package/MobileTimePicker/MobileTimePicker.types.d.ts +4 -4
- package/MonthCalendar/MonthCalendar.d.ts +1 -1
- package/MonthCalendar/MonthCalendar.js +31 -11
- package/MonthCalendar/MonthCalendar.types.d.ts +2 -2
- package/MonthCalendar/MonthCalendarButton.d.ts +24 -0
- package/MonthCalendar/{PickersMonth.js → MonthCalendarButton.js} +20 -61
- package/MonthCalendar/index.d.ts +0 -3
- package/MonthCalendar/index.js +1 -2
- package/MonthCalendar/monthCalendarClasses.d.ts +7 -1
- package/MonthCalendar/monthCalendarClasses.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -0
- package/PickersActionBar/PickersActionBar.d.ts +0 -4
- package/PickersActionBar/PickersActionBar.js +12 -13
- package/PickersLayout/PickersLayout.d.ts +2 -2
- package/PickersLayout/PickersLayout.js +1 -11
- package/PickersLayout/PickersLayout.types.d.ts +12 -14
- package/PickersLayout/usePickerLayout.d.ts +2 -2
- package/PickersLayout/usePickerLayout.js +3 -18
- package/PickersSectionList/PickersSectionList.js +21 -16
- package/PickersSectionList/PickersSectionList.types.d.ts +13 -6
- package/PickersTextField/PickersFilledInput/PickersFilledInput.d.ts +7 -0
- package/PickersTextField/PickersFilledInput/PickersFilledInput.js +34 -28
- package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +1 -1
- package/PickersTextField/PickersInput/PickersInput.js +20 -14
- package/PickersTextField/PickersInput/pickersInputClasses.d.ts +3 -2
- package/PickersTextField/PickersInput/pickersInputClasses.js +1 -1
- package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +3 -6
- package/PickersTextField/PickersInputBase/PickersInputBase.js +36 -37
- package/PickersTextField/PickersInputBase/PickersInputBase.types.d.ts +1 -0
- package/PickersTextField/PickersOutlinedInput/Outline.d.ts +0 -1
- package/PickersTextField/PickersOutlinedInput/Outline.js +13 -10
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +8 -14
- package/PickersTextField/PickersTextField.js +75 -62
- package/PickersTextField/PickersTextField.types.d.ts +43 -4
- package/PickersTextField/usePickerTextFieldOwnerState.d.ts +4 -0
- package/PickersTextField/usePickerTextFieldOwnerState.js +11 -0
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -3
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -2
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -2
- package/TimeClock/Clock.d.ts +4 -0
- package/TimeClock/Clock.js +9 -6
- package/TimeClock/TimeClock.js +21 -4
- package/TimePicker/TimePicker.types.d.ts +2 -2
- package/TimePicker/TimePickerToolbar.d.ts +2 -2
- package/TimePicker/TimePickerToolbar.js +6 -20
- package/YearCalendar/YearCalendar.js +46 -13
- package/YearCalendar/YearCalendar.types.d.ts +2 -2
- package/YearCalendar/YearCalendarButton.d.ts +23 -0
- package/YearCalendar/{PickersYear.js → YearCalendarButton.js} +20 -59
- package/YearCalendar/index.d.ts +0 -3
- package/YearCalendar/index.js +1 -2
- package/YearCalendar/yearCalendarClasses.d.ts +7 -1
- package/YearCalendar/yearCalendarClasses.js +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/usePickerActionsContext.d.ts +5 -0
- package/hooks/usePickerActionsContext.js +16 -0
- package/hooks/usePickerContext.d.ts +3 -1
- package/hooks/usePickerContext.js +0 -1
- package/index.js +1 -1
- package/internals/components/PickerProvider.d.ts +11 -6
- package/internals/components/PickerProvider.js +12 -6
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +3 -3
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +1 -1
- package/internals/components/PickersModalDialog.d.ts +1 -3
- package/internals/components/PickersModalDialog.js +9 -3
- package/internals/components/PickersPopper.d.ts +1 -3
- package/internals/components/PickersPopper.js +11 -6
- package/internals/components/PickersToolbar.d.ts +3 -3
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +9 -9
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +5 -5
- package/internals/hooks/useFieldOwnerState.d.ts +1 -0
- package/internals/hooks/useFieldOwnerState.js +6 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.js +8 -7
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +5 -5
- package/internals/hooks/usePicker/usePicker.js +1 -3
- package/internals/hooks/usePicker/usePicker.types.d.ts +2 -2
- package/internals/hooks/usePicker/usePickerProvider.js +5 -4
- package/internals/hooks/usePicker/usePickerValue.js +46 -64
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +38 -17
- package/internals/hooks/usePicker/usePickerViews.d.ts +15 -4
- package/internals/hooks/usePicker/usePickerViews.js +9 -7
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +4 -4
- package/internals/index.d.ts +4 -4
- package/internals/index.js +1 -1
- package/internals/models/props/tabs.d.ts +0 -13
- package/internals/models/props/toolbar.d.ts +1 -16
- package/models/fields.d.ts +11 -1
- package/modern/DatePicker/DatePickerToolbar.js +6 -17
- package/modern/DateTimePicker/DateTimePickerTabs.js +6 -13
- package/modern/DateTimePicker/DateTimePickerToolbar.js +13 -24
- package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -11
- package/modern/MonthCalendar/MonthCalendar.js +31 -11
- package/modern/MonthCalendar/{PickersMonth.js → MonthCalendarButton.js} +20 -61
- package/modern/MonthCalendar/index.js +1 -2
- package/modern/MonthCalendar/monthCalendarClasses.js +1 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -0
- package/modern/PickersActionBar/PickersActionBar.js +12 -13
- package/modern/PickersLayout/PickersLayout.js +1 -11
- package/modern/PickersLayout/usePickerLayout.js +3 -18
- package/modern/PickersSectionList/PickersSectionList.js +21 -16
- package/modern/PickersTextField/PickersFilledInput/PickersFilledInput.js +34 -28
- package/modern/PickersTextField/PickersInput/PickersInput.js +20 -14
- package/modern/PickersTextField/PickersInput/pickersInputClasses.js +1 -1
- package/modern/PickersTextField/PickersInputBase/PickersInputBase.js +36 -37
- package/modern/PickersTextField/PickersOutlinedInput/Outline.js +13 -10
- package/modern/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +8 -14
- package/modern/PickersTextField/PickersTextField.js +75 -62
- package/modern/PickersTextField/usePickerTextFieldOwnerState.js +11 -0
- package/modern/TimeClock/Clock.js +9 -6
- package/modern/TimeClock/TimeClock.js +21 -4
- package/modern/TimePicker/TimePickerToolbar.js +6 -20
- package/modern/YearCalendar/YearCalendar.js +46 -13
- package/modern/YearCalendar/{PickersYear.js → YearCalendarButton.js} +20 -59
- package/modern/YearCalendar/index.js +1 -2
- package/modern/YearCalendar/yearCalendarClasses.js +1 -1
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/usePickerActionsContext.js +16 -0
- package/modern/hooks/usePickerContext.js +0 -1
- package/modern/index.js +1 -1
- package/modern/internals/components/PickerProvider.js +12 -6
- package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +3 -3
- package/modern/internals/components/PickersModalDialog.js +9 -3
- package/modern/internals/components/PickersPopper.js +11 -6
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +9 -9
- package/modern/internals/hooks/useFieldOwnerState.js +6 -2
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +8 -7
- package/modern/internals/hooks/usePicker/usePicker.js +1 -3
- package/modern/internals/hooks/usePicker/usePickerProvider.js +5 -4
- package/modern/internals/hooks/usePicker/usePickerValue.js +46 -64
- package/modern/internals/hooks/usePicker/usePickerViews.js +9 -7
- package/modern/internals/index.js +1 -1
- package/node/DatePicker/DatePickerToolbar.js +6 -17
- package/node/DateTimePicker/DateTimePickerTabs.js +6 -13
- package/node/DateTimePicker/DateTimePickerToolbar.js +14 -25
- package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +1 -11
- package/node/MonthCalendar/MonthCalendar.js +31 -11
- package/node/MonthCalendar/{PickersMonth.js → MonthCalendarButton.js} +20 -61
- package/node/MonthCalendar/index.js +1 -8
- package/node/MonthCalendar/monthCalendarClasses.js +1 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -0
- package/node/PickersActionBar/PickersActionBar.js +12 -13
- package/node/PickersLayout/PickersLayout.js +1 -11
- package/node/PickersLayout/usePickerLayout.js +3 -18
- package/node/PickersSectionList/PickersSectionList.js +21 -16
- package/node/PickersTextField/PickersFilledInput/PickersFilledInput.js +34 -28
- package/node/PickersTextField/PickersInput/PickersInput.js +20 -14
- package/node/PickersTextField/PickersInput/pickersInputClasses.js +1 -1
- package/node/PickersTextField/PickersInputBase/PickersInputBase.js +36 -37
- package/node/PickersTextField/PickersOutlinedInput/Outline.js +13 -10
- package/node/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +8 -14
- package/node/PickersTextField/PickersTextField.js +75 -62
- package/node/PickersTextField/usePickerTextFieldOwnerState.js +18 -0
- package/node/TimeClock/Clock.js +9 -6
- package/node/TimeClock/TimeClock.js +21 -4
- package/node/TimePicker/TimePickerToolbar.js +6 -20
- package/node/YearCalendar/YearCalendar.js +45 -12
- package/node/YearCalendar/{PickersYear.js → YearCalendarButton.js} +20 -59
- package/node/YearCalendar/index.js +1 -8
- package/node/YearCalendar/yearCalendarClasses.js +1 -1
- package/node/hooks/index.js +8 -1
- package/node/hooks/usePickerActionsContext.js +22 -0
- package/node/index.js +1 -1
- package/node/internals/components/PickerProvider.js +13 -7
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +3 -3
- package/node/internals/components/PickersModalDialog.js +9 -3
- package/node/internals/components/PickersPopper.js +11 -6
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +9 -9
- package/node/internals/hooks/useFieldOwnerState.js +6 -2
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +8 -7
- package/node/internals/hooks/usePicker/usePicker.js +1 -3
- package/node/internals/hooks/usePicker/usePickerProvider.js +5 -4
- package/node/internals/hooks/usePicker/usePickerValue.js +46 -64
- package/node/internals/hooks/usePicker/usePickerViews.js +9 -7
- package/node/internals/index.js +2 -2
- package/package.json +3 -3
- package/themeAugmentation/components.d.ts +0 -8
- package/themeAugmentation/overrides.d.ts +2 -4
- package/themeAugmentation/props.d.ts +4 -7
- package/MonthCalendar/PickersMonth.d.ts +0 -28
- package/MonthCalendar/pickersMonthClasses.d.ts +0 -13
- package/MonthCalendar/pickersMonthClasses.js +0 -5
- package/YearCalendar/PickersYear.d.ts +0 -27
- package/YearCalendar/pickersYearClasses.d.ts +0 -13
- package/YearCalendar/pickersYearClasses.js +0 -5
- package/modern/MonthCalendar/pickersMonthClasses.js +0 -5
- package/modern/YearCalendar/pickersYearClasses.js +0 -5
- package/node/MonthCalendar/pickersMonthClasses.js +0 -12
- package/node/YearCalendar/pickersYearClasses.js +0 -12
|
@@ -31,8 +31,9 @@ export const usePickerViews = ({
|
|
|
31
31
|
}) => {
|
|
32
32
|
const {
|
|
33
33
|
onChange,
|
|
34
|
+
value,
|
|
34
35
|
open,
|
|
35
|
-
|
|
36
|
+
setOpen
|
|
36
37
|
} = propsFromPickerValue;
|
|
37
38
|
const {
|
|
38
39
|
view: inView,
|
|
@@ -92,7 +93,7 @@ export const usePickerViews = ({
|
|
|
92
93
|
useEnhancedEffect(() => {
|
|
93
94
|
// Handle case of `DateTimePicker` without time renderers
|
|
94
95
|
if (currentViewMode === 'field' && open) {
|
|
95
|
-
|
|
96
|
+
setOpen(false);
|
|
96
97
|
setTimeout(() => {
|
|
97
98
|
fieldRef?.current?.setSelectedSections(view);
|
|
98
99
|
// focusing the input before the range selection is done
|
|
@@ -123,18 +124,18 @@ export const usePickerViews = ({
|
|
|
123
124
|
setFocusedView(newView, true);
|
|
124
125
|
}, [open]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
125
126
|
|
|
126
|
-
const
|
|
127
|
+
const contextValue = React.useMemo(() => ({
|
|
127
128
|
views,
|
|
128
129
|
view: popperView,
|
|
129
130
|
onViewChange: setView
|
|
130
|
-
};
|
|
131
|
+
}), [views, popperView, setView]);
|
|
131
132
|
const providerParams = {
|
|
132
133
|
hasUIView,
|
|
133
|
-
views
|
|
134
|
+
views,
|
|
135
|
+
contextValue
|
|
134
136
|
};
|
|
135
137
|
return {
|
|
136
138
|
shouldRestoreFocus,
|
|
137
|
-
layoutProps,
|
|
138
139
|
provider: providerParams,
|
|
139
140
|
renderCurrentView: () => {
|
|
140
141
|
if (popperView == null) {
|
|
@@ -144,9 +145,10 @@ export const usePickerViews = ({
|
|
|
144
145
|
if (renderer == null) {
|
|
145
146
|
return null;
|
|
146
147
|
}
|
|
147
|
-
const rendererProps = _extends({}, propsToForwardToView, additionalViewProps,
|
|
148
|
+
const rendererProps = _extends({}, propsToForwardToView, additionalViewProps, {
|
|
148
149
|
views,
|
|
149
150
|
timezone,
|
|
151
|
+
value,
|
|
150
152
|
onChange: setValueAndGoToNextView,
|
|
151
153
|
view: popperView,
|
|
152
154
|
onViewChange: setView,
|
|
@@ -4,9 +4,9 @@ import { BasePickerProps } from '../../models/props/basePickerProps';
|
|
|
4
4
|
import { UsePickerParams } from '../usePicker';
|
|
5
5
|
import { UsePickerViewsProps } from '../usePicker/usePickerViews';
|
|
6
6
|
import { DateOrTimeViewWithMeridiem, PickerValue } from '../../models';
|
|
7
|
-
export interface UseStaticPickerSlots
|
|
7
|
+
export interface UseStaticPickerSlots extends ExportedPickersLayoutSlots<PickerValue> {
|
|
8
8
|
}
|
|
9
|
-
export interface UseStaticPickerSlotProps
|
|
9
|
+
export interface UseStaticPickerSlotProps extends ExportedPickersLayoutSlotProps<PickerValue> {
|
|
10
10
|
}
|
|
11
11
|
export interface StaticOnlyPickerProps {
|
|
12
12
|
/**
|
|
@@ -31,12 +31,12 @@ export interface UseStaticPickerProps<TView extends DateOrTimeViewWithMeridiem,
|
|
|
31
31
|
* Overridable component slots.
|
|
32
32
|
* @default {}
|
|
33
33
|
*/
|
|
34
|
-
slots?: UseStaticPickerSlots
|
|
34
|
+
slots?: UseStaticPickerSlots;
|
|
35
35
|
/**
|
|
36
36
|
* The props used for each component slot.
|
|
37
37
|
* @default {}
|
|
38
38
|
*/
|
|
39
|
-
slotProps?: UseStaticPickerSlotProps
|
|
39
|
+
slotProps?: UseStaticPickerSlotProps;
|
|
40
40
|
}
|
|
41
41
|
export interface UseStaticPickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticPickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParams<PickerValue, TView, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
|
|
42
42
|
props: TExternalProps;
|
package/internals/index.d.ts
CHANGED
|
@@ -29,8 +29,8 @@ export type { UseFieldInternalProps, UseFieldParams, UseFieldResponse, FieldValu
|
|
|
29
29
|
export { useFieldOwnerState } from './hooks/useFieldOwnerState';
|
|
30
30
|
export type { MobileOnlyPickerProps } from './hooks/useMobilePicker';
|
|
31
31
|
export { usePicker } from './hooks/usePicker';
|
|
32
|
-
export type {
|
|
33
|
-
export type { UsePickerValueNonStaticProps, PickerValueManager, PickerSelectionState, } from './hooks/usePicker/usePickerValue.types';
|
|
32
|
+
export type { UsePickerParams, UsePickerProps, UsePickerValueFieldResponse, PickerViewsRendererProps, } from './hooks/usePicker';
|
|
33
|
+
export type { UsePickerValueContextValue, UsePickerValueNonStaticProps, PickerValueManager, PickerSelectionState, } from './hooks/usePicker/usePickerValue.types';
|
|
34
34
|
export type { PickerViewRendererLookup, PickerViewRenderer, UsePickerViewsProps, } from './hooks/usePicker/usePickerViews';
|
|
35
35
|
export type { UsePickerProviderNonStaticProps } from './hooks/usePicker/usePickerProvider';
|
|
36
36
|
export { usePickerPrivateContext } from './hooks/usePickerPrivateContext';
|
|
@@ -46,7 +46,7 @@ export type { RangePosition } from './models/pickers';
|
|
|
46
46
|
export type { BaseSingleInputFieldProps, FieldRangeSection } from './models/fields';
|
|
47
47
|
export type { BasePickerProps, BasePickerInputProps, BaseNonStaticPickerProps, } from './models/props/basePickerProps';
|
|
48
48
|
export type { BaseClockProps, DesktopOnlyTimePickerProps, AmPmProps } from './models/props/time';
|
|
49
|
-
export type {
|
|
49
|
+
export type { ExportedBaseTabsProps } from './models/props/tabs';
|
|
50
50
|
export type { BaseToolbarProps, ExportedBaseToolbarProps } from './models/props/toolbar';
|
|
51
51
|
export type { FormProps } from './models/formProps';
|
|
52
52
|
export type { PickerVariant, TimeViewWithMeridiem, DateOrTimeViewWithMeridiem, } from './models/common';
|
|
@@ -65,4 +65,4 @@ export type { DayCalendarProps, DayCalendarSlots, DayCalendarSlotProps, Exported
|
|
|
65
65
|
export type { ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
|
|
66
66
|
export { useCalendarState } from '../DateCalendar/useCalendarState';
|
|
67
67
|
export { isInternalTimeView, isTimeView } from './utils/time-utils';
|
|
68
|
-
export {
|
|
68
|
+
export { DateTimePickerToolbarOverrideContext } from '../DateTimePicker/DateTimePickerToolbar';
|
package/internals/index.js
CHANGED
|
@@ -31,4 +31,4 @@ export { applyDefaultViewProps } from "./utils/views.js";
|
|
|
31
31
|
export { DayCalendar } from "../DateCalendar/DayCalendar.js";
|
|
32
32
|
export { useCalendarState } from "../DateCalendar/useCalendarState.js";
|
|
33
33
|
export { isInternalTimeView, isTimeView } from "./utils/time-utils.js";
|
|
34
|
-
export {
|
|
34
|
+
export { DateTimePickerToolbarOverrideContext } from "../DateTimePicker/DateTimePickerToolbar.js";
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { SxProps } from '@mui/system';
|
|
2
2
|
import { Theme } from '@mui/material/styles';
|
|
3
|
-
import { DateOrTimeViewWithMeridiem } from '../common';
|
|
4
|
-
export interface BaseTabsProps<TView extends DateOrTimeViewWithMeridiem> {
|
|
5
|
-
/**
|
|
6
|
-
* Currently visible picker view.
|
|
7
|
-
*/
|
|
8
|
-
view: TView;
|
|
9
|
-
/**
|
|
10
|
-
* Callback called when a tab is clicked.
|
|
11
|
-
* @template TView
|
|
12
|
-
* @param {TView} view The view to open
|
|
13
|
-
*/
|
|
14
|
-
onViewChange: (view: TView) => void;
|
|
15
|
-
}
|
|
16
3
|
export interface ExportedBaseTabsProps {
|
|
17
4
|
className?: string;
|
|
18
5
|
/**
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import { Theme } from '@mui/material/styles';
|
|
4
|
-
import { DateOrTimeViewWithMeridiem } from '../common';
|
|
5
4
|
import { PickerValidValue } from '../value';
|
|
6
|
-
export interface BaseToolbarProps<TValue extends PickerValidValue
|
|
5
|
+
export interface BaseToolbarProps<TValue extends PickerValidValue> extends ExportedBaseToolbarProps {
|
|
7
6
|
isLandscape: boolean;
|
|
8
7
|
onChange: (newValue: TValue) => void;
|
|
9
8
|
value: TValue;
|
|
10
|
-
/**
|
|
11
|
-
* Currently visible picker view.
|
|
12
|
-
*/
|
|
13
|
-
view: TView;
|
|
14
|
-
/**
|
|
15
|
-
* Callback called when a toolbar is clicked
|
|
16
|
-
* @template TView
|
|
17
|
-
* @param {TView} view The view to open
|
|
18
|
-
*/
|
|
19
|
-
onViewChange: (view: TView) => void;
|
|
20
|
-
/**
|
|
21
|
-
* Available views.
|
|
22
|
-
*/
|
|
23
|
-
views: readonly TView[];
|
|
24
9
|
titleId?: string;
|
|
25
10
|
}
|
|
26
11
|
export interface ExportedBaseToolbarProps {
|
package/models/fields.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
3
|
import type { ExportedUseClearableFieldProps, UseClearableFieldResponse } from '../hooks/useClearableField';
|
|
4
|
-
import { ExportedPickersSectionListProps } from '../PickersSectionList';
|
|
4
|
+
import type { ExportedPickersSectionListProps } from '../PickersSectionList';
|
|
5
5
|
import type { UseFieldInternalProps, UseFieldResponse } from '../internals/hooks/useField';
|
|
6
6
|
import type { PickersTextFieldProps } from '../PickersTextField';
|
|
7
7
|
import { BaseForwardedSingleInputFieldProps, FieldRangeSection, PickerRangeValue, PickerValidValue } from '../internals/models';
|
|
@@ -110,6 +110,16 @@ export interface FieldOwnerState extends PickerOwnerState {
|
|
|
110
110
|
* `true` if the field is read-only, `false` otherwise.
|
|
111
111
|
*/
|
|
112
112
|
isFieldReadOnly: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* `true` if the field is required, `false` otherwise.
|
|
115
|
+
*/
|
|
116
|
+
isFieldRequired: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* The direction of the field.
|
|
119
|
+
* Is equal to "ltr" when the field is in left-to-right direction.
|
|
120
|
+
* Is equal to "rtl" when the field is in right-to-left direction.
|
|
121
|
+
*/
|
|
122
|
+
fieldDirection: 'ltr' | 'rtl';
|
|
113
123
|
}
|
|
114
124
|
/**
|
|
115
125
|
* Props the prop `slotProps.field` of a picker can receive.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "
|
|
5
|
+
const _excluded = ["value", "isLandscape", "onChange", "toolbarFormat", "toolbarPlaceholder", "className", "classes"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
@@ -15,6 +15,7 @@ import { useUtils } from "../internals/hooks/useUtils.js";
|
|
|
15
15
|
import { getDatePickerToolbarUtilityClass } from "./datePickerToolbarClasses.js";
|
|
16
16
|
import { resolveDateFormat } from "../internals/utils/date-utils.js";
|
|
17
17
|
import { useToolbarOwnerState } from "../internals/hooks/useToolbarOwnerState.js";
|
|
18
|
+
import { usePickerContext } from "../hooks/index.js";
|
|
18
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
20
|
const useUtilityClasses = classes => {
|
|
20
21
|
const slots = {
|
|
@@ -62,12 +63,14 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
|
|
|
62
63
|
isLandscape,
|
|
63
64
|
toolbarFormat,
|
|
64
65
|
toolbarPlaceholder = '––',
|
|
65
|
-
views,
|
|
66
66
|
className,
|
|
67
67
|
classes: classesProp
|
|
68
68
|
} = props,
|
|
69
69
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
70
70
|
const utils = useUtils();
|
|
71
|
+
const {
|
|
72
|
+
views
|
|
73
|
+
} = usePickerContext();
|
|
71
74
|
const translations = usePickerTranslations();
|
|
72
75
|
const ownerState = useToolbarOwnerState();
|
|
73
76
|
const classes = useUtilityClasses(classesProp);
|
|
@@ -113,12 +116,6 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
113
116
|
hidden: PropTypes.bool,
|
|
114
117
|
isLandscape: PropTypes.bool.isRequired,
|
|
115
118
|
onChange: PropTypes.func.isRequired,
|
|
116
|
-
/**
|
|
117
|
-
* Callback called when a toolbar is clicked
|
|
118
|
-
* @template TView
|
|
119
|
-
* @param {TView} view The view to open
|
|
120
|
-
*/
|
|
121
|
-
onViewChange: PropTypes.func.isRequired,
|
|
122
119
|
/**
|
|
123
120
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
124
121
|
*/
|
|
@@ -133,13 +130,5 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
133
130
|
* @default "––"
|
|
134
131
|
*/
|
|
135
132
|
toolbarPlaceholder: PropTypes.node,
|
|
136
|
-
value: PropTypes.object
|
|
137
|
-
/**
|
|
138
|
-
* Currently visible picker view.
|
|
139
|
-
*/
|
|
140
|
-
view: PropTypes.oneOf(['day', 'month', 'year']).isRequired,
|
|
141
|
-
/**
|
|
142
|
-
* Available views.
|
|
143
|
-
*/
|
|
144
|
-
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired).isRequired
|
|
133
|
+
value: PropTypes.object
|
|
145
134
|
} : void 0;
|
|
@@ -12,6 +12,7 @@ import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
|
|
|
12
12
|
import { getDateTimePickerTabsUtilityClass } from "./dateTimePickerTabsClasses.js";
|
|
13
13
|
import { isDatePickerView } from "../internals/utils/date-utils.js";
|
|
14
14
|
import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
|
|
15
|
+
import { usePickerContext } from "../hooks/index.js";
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
const viewToTab = view => {
|
|
17
18
|
if (isDatePickerView(view)) {
|
|
@@ -65,9 +66,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
65
66
|
});
|
|
66
67
|
const {
|
|
67
68
|
dateIcon = /*#__PURE__*/_jsx(DateRangeIcon, {}),
|
|
68
|
-
onViewChange,
|
|
69
69
|
timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
|
|
70
|
-
view,
|
|
71
70
|
hidden = typeof window === 'undefined' || window.innerHeight < 667,
|
|
72
71
|
className,
|
|
73
72
|
classes: classesProp,
|
|
@@ -77,6 +76,10 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
77
76
|
const {
|
|
78
77
|
ownerState
|
|
79
78
|
} = usePickerPrivateContext();
|
|
79
|
+
const {
|
|
80
|
+
view,
|
|
81
|
+
onViewChange
|
|
82
|
+
} = usePickerContext();
|
|
80
83
|
const classes = useUtilityClasses(classesProp);
|
|
81
84
|
const handleChange = (event, value) => {
|
|
82
85
|
onViewChange(tabToView(value));
|
|
@@ -126,12 +129,6 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
126
129
|
* @default `window.innerHeight < 667` for `DesktopDateTimePicker` and `MobileDateTimePicker`, `displayStaticWrapperAs === 'desktop'` for `StaticDateTimePicker`
|
|
127
130
|
*/
|
|
128
131
|
hidden: PropTypes.bool,
|
|
129
|
-
/**
|
|
130
|
-
* Callback called when a tab is clicked.
|
|
131
|
-
* @template TView
|
|
132
|
-
* @param {TView} view The view to open
|
|
133
|
-
*/
|
|
134
|
-
onViewChange: PropTypes.func.isRequired,
|
|
135
132
|
/**
|
|
136
133
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
137
134
|
*/
|
|
@@ -140,10 +137,6 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
140
137
|
* Time tab icon.
|
|
141
138
|
* @default Time
|
|
142
139
|
*/
|
|
143
|
-
timeIcon: PropTypes.node
|
|
144
|
-
/**
|
|
145
|
-
* Currently visible picker view.
|
|
146
|
-
*/
|
|
147
|
-
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired
|
|
140
|
+
timeIcon: PropTypes.node
|
|
148
141
|
} : void 0;
|
|
149
142
|
export { DateTimePickerTabs };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["ampm", "ampmInClock", "value", "onChange", "
|
|
5
|
+
const _excluded = ["ampm", "ampmInClock", "value", "onChange", "isLandscape", "toolbarFormat", "toolbarPlaceholder", "toolbarTitle", "className", "classes"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
@@ -206,10 +206,11 @@ const DateTimePickerToolbarAmPmSelection = styled('div', {
|
|
|
206
206
|
});
|
|
207
207
|
|
|
208
208
|
/**
|
|
209
|
-
* If
|
|
209
|
+
* If `forceDesktopVariant` is set to `true`, the toolbar will always be rendered in the desktop mode.
|
|
210
|
+
* If `onViewChange` is defined, the toolbar will call it instead of calling the default handler from `usePickerContext`.
|
|
210
211
|
* This is used by the Date Time Range Picker Toolbar.
|
|
211
212
|
*/
|
|
212
|
-
export const
|
|
213
|
+
export const DateTimePickerToolbarOverrideContext = /*#__PURE__*/React.createContext(null);
|
|
213
214
|
|
|
214
215
|
/**
|
|
215
216
|
* Demos:
|
|
@@ -231,12 +232,9 @@ function DateTimePickerToolbar(inProps) {
|
|
|
231
232
|
ampmInClock,
|
|
232
233
|
value,
|
|
233
234
|
onChange,
|
|
234
|
-
view,
|
|
235
235
|
isLandscape,
|
|
236
|
-
onViewChange,
|
|
237
236
|
toolbarFormat,
|
|
238
237
|
toolbarPlaceholder = '––',
|
|
239
|
-
views,
|
|
240
238
|
toolbarTitle: inToolbarTitle,
|
|
241
239
|
className,
|
|
242
240
|
classes: classesProp
|
|
@@ -245,7 +243,10 @@ function DateTimePickerToolbar(inProps) {
|
|
|
245
243
|
const {
|
|
246
244
|
disabled,
|
|
247
245
|
readOnly,
|
|
248
|
-
variant
|
|
246
|
+
variant,
|
|
247
|
+
view: viewCtx,
|
|
248
|
+
onViewChange: onViewChangeCtx,
|
|
249
|
+
views
|
|
249
250
|
} = usePickerContext();
|
|
250
251
|
const ownerState = useToolbarOwnerState();
|
|
251
252
|
const classes = useUtilityClasses(classesProp, ownerState);
|
|
@@ -255,11 +256,13 @@ function DateTimePickerToolbar(inProps) {
|
|
|
255
256
|
handleMeridiemChange
|
|
256
257
|
} = useMeridiemMode(value, ampm, onChange);
|
|
257
258
|
const translations = usePickerTranslations();
|
|
258
|
-
const
|
|
259
|
-
const toolbarVariant = forceDesktopVariant ? 'desktop' : variant;
|
|
259
|
+
const overrides = React.useContext(DateTimePickerToolbarOverrideContext);
|
|
260
|
+
const toolbarVariant = overrides?.forceDesktopVariant ? 'desktop' : variant;
|
|
260
261
|
const isDesktop = toolbarVariant === 'desktop';
|
|
261
262
|
const showAmPmControl = Boolean(ampm && !ampmInClock);
|
|
262
263
|
const toolbarTitle = inToolbarTitle ?? translations.dateTimePickerToolbarTitle;
|
|
264
|
+
const view = overrides ? overrides.view : viewCtx;
|
|
265
|
+
const onViewChange = overrides ? overrides.onViewChange : onViewChangeCtx;
|
|
263
266
|
const formatHours = time => ampm ? utils.format(time, 'hours12h') : utils.format(time, 'hours24h');
|
|
264
267
|
const dateText = React.useMemo(() => {
|
|
265
268
|
if (!value) {
|
|
@@ -384,12 +387,6 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
384
387
|
hidden: PropTypes.bool,
|
|
385
388
|
isLandscape: PropTypes.bool.isRequired,
|
|
386
389
|
onChange: PropTypes.func.isRequired,
|
|
387
|
-
/**
|
|
388
|
-
* Callback called when a toolbar is clicked
|
|
389
|
-
* @template TView
|
|
390
|
-
* @param {TView} view The view to open
|
|
391
|
-
*/
|
|
392
|
-
onViewChange: PropTypes.func.isRequired,
|
|
393
390
|
/**
|
|
394
391
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
395
392
|
*/
|
|
@@ -408,14 +405,6 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
408
405
|
* If provided, it will be used instead of `dateTimePickerToolbarTitle` from localization.
|
|
409
406
|
*/
|
|
410
407
|
toolbarTitle: PropTypes.node,
|
|
411
|
-
value: PropTypes.object
|
|
412
|
-
/**
|
|
413
|
-
* Currently visible picker view.
|
|
414
|
-
*/
|
|
415
|
-
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
416
|
-
/**
|
|
417
|
-
* Available views.
|
|
418
|
-
*/
|
|
419
|
-
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired).isRequired
|
|
408
|
+
value: PropTypes.object
|
|
420
409
|
} : void 0;
|
|
421
410
|
export { DateTimePickerToolbar };
|
|
@@ -66,16 +66,8 @@ process.env.NODE_ENV !== "production" ? DesktopDateTimePickerLayout.propTypes =
|
|
|
66
66
|
classes: PropTypes.object,
|
|
67
67
|
className: PropTypes.string,
|
|
68
68
|
isValid: PropTypes.func.isRequired,
|
|
69
|
-
onAccept: PropTypes.func.isRequired,
|
|
70
|
-
onCancel: PropTypes.func.isRequired,
|
|
71
69
|
onChange: PropTypes.func.isRequired,
|
|
72
|
-
onClear: PropTypes.func.isRequired,
|
|
73
|
-
onClose: PropTypes.func.isRequired,
|
|
74
|
-
onDismiss: PropTypes.func.isRequired,
|
|
75
|
-
onOpen: PropTypes.func.isRequired,
|
|
76
70
|
onSelectShortcut: PropTypes.func.isRequired,
|
|
77
|
-
onSetToday: PropTypes.func.isRequired,
|
|
78
|
-
onViewChange: PropTypes.func.isRequired,
|
|
79
71
|
/**
|
|
80
72
|
* The props used for each component slot.
|
|
81
73
|
* @default {}
|
|
@@ -90,8 +82,6 @@ process.env.NODE_ENV !== "production" ? DesktopDateTimePickerLayout.propTypes =
|
|
|
90
82
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
91
83
|
*/
|
|
92
84
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
93
|
-
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object])
|
|
94
|
-
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
95
|
-
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired).isRequired
|
|
85
|
+
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object])
|
|
96
86
|
} : void 0;
|
|
97
87
|
export { DesktopDateTimePickerLayout };
|
|
@@ -2,14 +2,15 @@
|
|
|
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 = ["className", "classes", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "
|
|
5
|
+
const _excluded = ["autoFocus", "className", "classes", "value", "defaultValue", "referenceDate", "disabled", "disableFuture", "disablePast", "maxDate", "minDate", "onChange", "shouldDisableMonth", "readOnly", "disableHighlightToday", "onMonthFocus", "hasFocus", "onFocusedViewChange", "monthsPerRow", "timezone", "gridLabelId", "slots", "slotProps"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
10
|
+
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
10
11
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
11
12
|
import { unstable_useControlled as useControlled, unstable_composeClasses as composeClasses, unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
12
|
-
import {
|
|
13
|
+
import { MonthCalendarButton } from "./MonthCalendarButton.js";
|
|
13
14
|
import { useUtils, useNow, useDefaultDates } from "../internals/hooks/useUtils.js";
|
|
14
15
|
import { getMonthCalendarUtilityClass } from "./monthCalendarClasses.js";
|
|
15
16
|
import { applyDefaultDate, getMonthsInYear } from "../internals/utils/date-utils.js";
|
|
@@ -36,6 +37,7 @@ export function useMonthCalendarDefaultizedProps(props, name) {
|
|
|
36
37
|
disableFuture: false,
|
|
37
38
|
disablePast: false
|
|
38
39
|
}, themeProps, {
|
|
40
|
+
monthsPerRow: themeProps.monthsPerRow ?? 3,
|
|
39
41
|
minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),
|
|
40
42
|
maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate)
|
|
41
43
|
});
|
|
@@ -43,15 +45,32 @@ export function useMonthCalendarDefaultizedProps(props, name) {
|
|
|
43
45
|
const MonthCalendarRoot = styled('div', {
|
|
44
46
|
name: 'MuiMonthCalendar',
|
|
45
47
|
slot: 'Root',
|
|
46
|
-
overridesResolver: (props, styles) => styles.root
|
|
48
|
+
overridesResolver: (props, styles) => styles.root,
|
|
49
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'monthsPerRow'
|
|
47
50
|
})({
|
|
48
51
|
display: 'flex',
|
|
49
52
|
flexWrap: 'wrap',
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
justifyContent: 'space-evenly',
|
|
54
|
+
rowGap: 16,
|
|
55
|
+
padding: '8px 0',
|
|
52
56
|
width: DIALOG_WIDTH,
|
|
53
57
|
// avoid padding increasing width over defined
|
|
54
|
-
boxSizing: 'border-box'
|
|
58
|
+
boxSizing: 'border-box',
|
|
59
|
+
variants: [{
|
|
60
|
+
props: {
|
|
61
|
+
monthsPerRow: 3
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
columnGap: 24
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
props: {
|
|
68
|
+
monthsPerRow: 4
|
|
69
|
+
},
|
|
70
|
+
style: {
|
|
71
|
+
columnGap: 0
|
|
72
|
+
}
|
|
73
|
+
}]
|
|
55
74
|
});
|
|
56
75
|
/**
|
|
57
76
|
* Demos:
|
|
@@ -65,6 +84,7 @@ const MonthCalendarRoot = styled('div', {
|
|
|
65
84
|
export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(inProps, ref) {
|
|
66
85
|
const props = useMonthCalendarDefaultizedProps(inProps, 'MuiMonthCalendar');
|
|
67
86
|
const {
|
|
87
|
+
autoFocus,
|
|
68
88
|
className,
|
|
69
89
|
classes: classesProp,
|
|
70
90
|
value: valueProp,
|
|
@@ -78,11 +98,10 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
78
98
|
onChange,
|
|
79
99
|
shouldDisableMonth,
|
|
80
100
|
readOnly,
|
|
81
|
-
autoFocus = false,
|
|
82
101
|
onMonthFocus,
|
|
83
102
|
hasFocus,
|
|
84
103
|
onFocusedViewChange,
|
|
85
|
-
monthsPerRow
|
|
104
|
+
monthsPerRow,
|
|
86
105
|
timezone: timezoneProp,
|
|
87
106
|
gridLabelId,
|
|
88
107
|
slots,
|
|
@@ -209,7 +228,8 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
209
228
|
className: clsx(classes.root, className),
|
|
210
229
|
ownerState: ownerState,
|
|
211
230
|
role: "radiogroup",
|
|
212
|
-
"aria-labelledby": gridLabelId
|
|
231
|
+
"aria-labelledby": gridLabelId,
|
|
232
|
+
monthsPerRow: monthsPerRow
|
|
213
233
|
}, other, {
|
|
214
234
|
children: getMonthsInYear(utils, value ?? referenceDate).map(month => {
|
|
215
235
|
const monthNumber = utils.getMonth(month);
|
|
@@ -217,7 +237,7 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
217
237
|
const monthLabel = utils.format(month, 'month');
|
|
218
238
|
const isSelected = monthNumber === selectedMonth;
|
|
219
239
|
const isDisabled = disabled || isMonthDisabled(month);
|
|
220
|
-
return /*#__PURE__*/_jsx(
|
|
240
|
+
return /*#__PURE__*/_jsx(MonthCalendarButton, {
|
|
221
241
|
selected: isSelected,
|
|
222
242
|
value: monthNumber,
|
|
223
243
|
onClick: handleMonthSelection,
|
|
@@ -229,9 +249,9 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
229
249
|
onBlur: handleMonthBlur,
|
|
230
250
|
"aria-current": todayMonth === monthNumber ? 'date' : undefined,
|
|
231
251
|
"aria-label": monthLabel,
|
|
232
|
-
monthsPerRow: monthsPerRow,
|
|
233
252
|
slots: slots,
|
|
234
253
|
slotProps: slotProps,
|
|
254
|
+
classes: classesProp,
|
|
235
255
|
children: monthText
|
|
236
256
|
}, monthText);
|
|
237
257
|
})
|