@mui/x-date-pickers-pro 7.22.2 → 8.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +142 -155
- package/DateRangeCalendar/DateRangeCalendar.d.ts +1 -2
- package/DateRangeCalendar/DateRangeCalendar.js +23 -22
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +24 -36
- package/DateRangeCalendar/useDragRange.d.ts +10 -9
- package/DateRangeCalendar/useDragRange.js +3 -3
- package/DateRangePicker/DateRangePicker.d.ts +1 -2
- package/DateRangePicker/DateRangePicker.js +12 -8
- package/DateRangePicker/DateRangePicker.types.d.ts +12 -6
- package/DateRangePicker/DateRangePickerToolbar.d.ts +3 -5
- package/DateRangePicker/DateRangePickerToolbar.js +12 -2
- package/DateRangePicker/index.d.ts +1 -1
- package/DateRangePicker/shared.d.ts +12 -12
- package/DateRangePickerDay/DateRangePickerDay.d.ts +2 -3
- package/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -2
- package/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
- package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +12 -6
- package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +1 -2
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +2 -2
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +8 -9
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +3 -5
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +12 -2
- package/DateTimeRangePicker/index.d.ts +1 -1
- package/DateTimeRangePicker/shared.d.ts +13 -13
- package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +1 -2
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
- package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +6 -7
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +1 -2
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +6 -7
- package/MobileDateRangePicker/MobileDateRangePicker.d.ts +1 -2
- package/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
- package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +6 -7
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +1 -2
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +6 -7
- package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +1 -2
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
- package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +9 -10
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +1 -2
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +9 -10
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +1 -2
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +9 -10
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.d.ts +1 -2
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.d.ts +3 -3
- package/README.md +2 -2
- package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +1 -2
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
- package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +8 -8
- package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -2
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +1 -2
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +8 -8
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -2
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +1 -2
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +8 -8
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -2
- package/StaticDateRangePicker/StaticDateRangePicker.d.ts +1 -2
- package/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
- package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +6 -7
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -3
- package/index.d.ts +0 -7
- package/index.js +1 -7
- package/internals/hooks/models/useRangePicker.d.ts +6 -7
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -2
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +20 -14
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +6 -7
- package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +15 -13
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +4 -4
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -2
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -15
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +6 -7
- package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +1 -1
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +1 -2
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +1 -2
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +1 -2
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -2
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +5 -5
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +8 -9
- package/internals/models/dateRange.d.ts +3 -4
- package/internals/models/dateTimeRange.d.ts +5 -10
- package/internals/models/fields.d.ts +26 -0
- package/internals/models/fields.js +1 -0
- package/internals/models/timeRange.d.ts +5 -9
- package/internals/utils/date-range-manager.d.ts +10 -9
- package/internals/utils/date-utils.d.ts +5 -5
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/valueManagers.d.ts +5 -6
- package/models/dateRange.d.ts +4 -5
- package/models/fields.d.ts +5 -32
- package/models/range.d.ts +1 -1
- package/modern/DateRangeCalendar/DateRangeCalendar.js +23 -22
- package/modern/DateRangeCalendar/useDragRange.js +3 -3
- package/modern/DateRangePicker/DateRangePicker.js +12 -8
- package/modern/DateRangePicker/DateRangePickerToolbar.js +12 -2
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +2 -2
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +12 -2
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
- package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
- package/modern/index.js +1 -7
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +20 -14
- package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +4 -4
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -15
- package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +5 -5
- package/modern/internals/models/fields.js +1 -0
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/validation/validateDateRange.js +5 -0
- package/modern/validation/validateDateTimeRange.js +5 -0
- package/modern/validation/validateTimeRange.js +5 -0
- package/node/DateRangeCalendar/DateRangeCalendar.js +22 -21
- package/node/DateRangeCalendar/useDragRange.js +3 -3
- package/node/DateRangePicker/DateRangePicker.js +12 -8
- package/node/DateRangePicker/DateRangePickerToolbar.js +11 -1
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +1 -1
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +11 -1
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
- package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +1 -1
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
- package/node/index.js +2 -41
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +19 -13
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +3 -3
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +19 -13
- package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +4 -4
- package/node/internals/models/fields.js +5 -0
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/validation/validateDateRange.js +4 -0
- package/node/validation/validateDateTimeRange.js +4 -0
- package/node/validation/validateTimeRange.js +4 -0
- package/package.json +5 -5
- package/themeAugmentation/props.d.ts +16 -17
- package/validation/validateDateRange.d.ts +9 -5
- package/validation/validateDateRange.js +5 -0
- package/validation/validateDateTimeRange.d.ts +11 -6
- package/validation/validateDateTimeRange.js +5 -0
- package/validation/validateTimeRange.d.ts +9 -4
- package/validation/validateTimeRange.js +5 -0
|
@@ -5,8 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
6
6
|
import { useLicenseVerifier } from '@mui/x-license';
|
|
7
7
|
import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
|
|
8
|
-
import { usePicker, PickersModalDialog,
|
|
9
|
-
import {
|
|
8
|
+
import { usePicker, PickersModalDialog, PickerProvider } from '@mui/x-date-pickers/internals';
|
|
9
|
+
import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
|
|
10
10
|
import useId from '@mui/utils/useId';
|
|
11
11
|
import { useEnrichedRangePickerFieldProps } from "../useEnrichedRangePickerFieldProps.js";
|
|
12
12
|
import { getReleaseInfo } from "../../utils/releaseInfo.js";
|
|
@@ -46,19 +46,21 @@ export const useMobileRangePicker = _ref => {
|
|
|
46
46
|
onRangePositionChange
|
|
47
47
|
} = useRangePosition(props, fieldType === 'single-input' ? startFieldRef : undefined);
|
|
48
48
|
const labelId = useId();
|
|
49
|
-
const contextTranslations =
|
|
49
|
+
const contextTranslations = usePickerTranslations();
|
|
50
50
|
const {
|
|
51
51
|
open,
|
|
52
52
|
actions,
|
|
53
53
|
layoutProps,
|
|
54
|
+
providerProps,
|
|
54
55
|
renderCurrentView,
|
|
55
56
|
fieldProps: pickerFieldProps,
|
|
56
|
-
|
|
57
|
+
ownerState
|
|
57
58
|
} = usePicker(_extends({}, pickerParams, {
|
|
58
59
|
props,
|
|
59
60
|
wrapperVariant: 'mobile',
|
|
60
61
|
autoFocusView: true,
|
|
61
62
|
fieldRef: rangePosition === 'start' ? startFieldRef : endFieldRef,
|
|
63
|
+
localeText,
|
|
62
64
|
additionalViewProps: {
|
|
63
65
|
rangePosition,
|
|
64
66
|
onRangePositionChange
|
|
@@ -68,22 +70,28 @@ export const useMobileRangePicker = _ref => {
|
|
|
68
70
|
const fieldProps = useSlotProps({
|
|
69
71
|
elementType: Field,
|
|
70
72
|
externalSlotProps: innerSlotProps?.field,
|
|
71
|
-
additionalProps: _extends({
|
|
73
|
+
additionalProps: _extends({
|
|
74
|
+
// Internal props
|
|
72
75
|
readOnly: readOnly ?? true,
|
|
73
76
|
disabled,
|
|
74
|
-
className,
|
|
75
|
-
sx,
|
|
76
77
|
format,
|
|
77
78
|
formatDensity,
|
|
78
79
|
enableAccessibleFieldDOMStructure,
|
|
79
80
|
selectedSections,
|
|
80
81
|
onSelectedSectionsChange,
|
|
81
82
|
timezone
|
|
82
|
-
},
|
|
83
|
-
|
|
83
|
+
}, pickerFieldProps, {
|
|
84
|
+
// onChange and value
|
|
85
|
+
|
|
86
|
+
// Forwarded props
|
|
87
|
+
className,
|
|
88
|
+
sx
|
|
89
|
+
}, fieldType === 'single-input' && !!inputRef && {
|
|
90
|
+
inputRef
|
|
91
|
+
}, fieldType === 'single-input' && {
|
|
84
92
|
name
|
|
85
|
-
}
|
|
86
|
-
ownerState
|
|
93
|
+
}),
|
|
94
|
+
ownerState
|
|
87
95
|
});
|
|
88
96
|
const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
|
|
89
97
|
const enrichedFieldProps = useEnrichedRangePickerFieldProps({
|
|
@@ -137,9 +145,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
137
145
|
'aria-labelledby': labelledById
|
|
138
146
|
}, innerSlotProps?.mobilePaper)
|
|
139
147
|
});
|
|
140
|
-
const renderPicker = () => /*#__PURE__*/_jsxs(
|
|
141
|
-
contextValue: contextValue,
|
|
142
|
-
localeText: localeText,
|
|
148
|
+
const renderPicker = () => /*#__PURE__*/_jsxs(PickerProvider, _extends({}, providerProps, {
|
|
143
149
|
children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldProps)), /*#__PURE__*/_jsx(PickersModalDialog, _extends({}, actions, {
|
|
144
150
|
open: open,
|
|
145
151
|
slots: slots,
|
|
@@ -150,7 +156,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
150
156
|
children: renderCurrentView()
|
|
151
157
|
}))
|
|
152
158
|
}))]
|
|
153
|
-
});
|
|
159
|
+
}));
|
|
154
160
|
return {
|
|
155
161
|
renderPicker
|
|
156
162
|
};
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { PickersModalDialogSlots, PickersModalDialogSlotProps, UsePickerViewsProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
3
2
|
import { RangeOnlyPickerProps, RangePickerAdditionalViewProps, UseRangePickerParams, UseRangePickerProps, UseRangePickerSlotProps, UseRangePickerSlots } from '../models/useRangePicker';
|
|
4
|
-
export interface UseMobileRangePickerSlots<
|
|
3
|
+
export interface UseMobileRangePickerSlots<TView extends DateOrTimeViewWithMeridiem> extends UseRangePickerSlots<TView>, PickersModalDialogSlots {
|
|
5
4
|
}
|
|
6
|
-
export interface UseMobileRangePickerSlotProps<
|
|
5
|
+
export interface UseMobileRangePickerSlotProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean> extends UseRangePickerSlotProps<TView, TEnableAccessibleFieldDOMStructure>, PickersModalDialogSlotProps {
|
|
7
6
|
}
|
|
8
7
|
export interface MobileRangeOnlyPickerProps extends RangeOnlyPickerProps {
|
|
9
8
|
}
|
|
10
|
-
export interface UseMobileRangePickerProps<
|
|
9
|
+
export interface UseMobileRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends UseRangePickerProps<TView, TError, TExternalProps, MobileRangePickerAdditionalViewProps> {
|
|
11
10
|
/**
|
|
12
11
|
* Overridable component slots.
|
|
13
12
|
* @default {}
|
|
14
13
|
*/
|
|
15
|
-
slots: UseMobileRangePickerSlots<
|
|
14
|
+
slots: UseMobileRangePickerSlots<TView>;
|
|
16
15
|
/**
|
|
17
16
|
* The props used for each component slot.
|
|
18
17
|
* @default {}
|
|
19
18
|
*/
|
|
20
|
-
slotProps?: UseMobileRangePickerSlotProps<
|
|
19
|
+
slotProps?: UseMobileRangePickerSlotProps<TView, TEnableAccessibleFieldDOMStructure>;
|
|
21
20
|
}
|
|
22
21
|
export interface MobileRangePickerAdditionalViewProps extends RangePickerAdditionalViewProps {
|
|
23
22
|
}
|
|
24
|
-
export interface UseMobileRangePickerParams<
|
|
23
|
+
export interface UseMobileRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends UseRangePickerParams<TView, TExternalProps, MobileRangePickerAdditionalViewProps> {
|
|
25
24
|
}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { UseFieldInternalProps } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { FieldRef, FieldSelectedSections } from '@mui/x-date-pickers/models';
|
|
4
4
|
import { RangeFieldSection } from '../../models';
|
|
5
|
-
interface UseMultiInputFieldSelectedSectionsParams extends Pick<UseFieldInternalProps<any,
|
|
5
|
+
interface UseMultiInputFieldSelectedSectionsParams extends Pick<UseFieldInternalProps<any, RangeFieldSection, any, any>, 'selectedSections' | 'onSelectedSectionsChange'> {
|
|
6
6
|
unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
7
7
|
unstableEndFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
8
8
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
1
|
import { UseMultiInputDateRangeFieldParams } from '../../../MultiInputDateRangeField/MultiInputDateRangeField.types';
|
|
3
2
|
import type { UseMultiInputRangeFieldResponse } from './useMultiInputRangeField.types';
|
|
4
|
-
export declare const useMultiInputDateRangeField: <
|
|
3
|
+
export declare const useMultiInputDateRangeField: <TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}>({ sharedProps: inSharedProps, startTextFieldProps, unstableStartFieldRef, endTextFieldProps, unstableEndFieldRef, }: UseMultiInputDateRangeFieldParams<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>) => UseMultiInputRangeFieldResponse<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
1
|
import type { UseMultiInputDateTimeRangeFieldParams } from '../../../MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types';
|
|
3
2
|
import type { UseMultiInputRangeFieldResponse } from './useMultiInputRangeField.types';
|
|
4
|
-
export declare const useMultiInputDateTimeRangeField: <
|
|
3
|
+
export declare const useMultiInputDateTimeRangeField: <TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}>({ sharedProps: inSharedProps, startTextFieldProps, unstableStartFieldRef, endTextFieldProps, unstableEndFieldRef, }: UseMultiInputDateTimeRangeFieldParams<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>) => UseMultiInputRangeFieldResponse<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
1
|
import type { UseMultiInputTimeRangeFieldParams } from '../../../MultiInputTimeRangeField/MultiInputTimeRangeField.types';
|
|
3
2
|
import type { UseMultiInputRangeFieldResponse } from './useMultiInputRangeField.types';
|
|
4
|
-
export declare const useMultiInputTimeRangeField: <
|
|
3
|
+
export declare const useMultiInputTimeRangeField: <TEnableAccessibleFieldDOMStructure extends boolean, TTextFieldSlotProps extends {}>({ sharedProps: inSharedProps, startTextFieldProps, unstableStartFieldRef, endTextFieldProps, unstableEndFieldRef, }: UseMultiInputTimeRangeFieldParams<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>) => UseMultiInputRangeFieldResponse<TEnableAccessibleFieldDOMStructure, TTextFieldSlotProps>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
3
|
-
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
4
3
|
import { UseStaticRangePickerParams, UseStaticRangePickerProps } from './useStaticRangePicker.types';
|
|
5
4
|
/**
|
|
6
5
|
* Hook managing all the range static pickers:
|
|
7
6
|
* - StaticDateRangePicker
|
|
8
7
|
*/
|
|
9
|
-
export declare const useStaticRangePicker: <
|
|
8
|
+
export declare const useStaticRangePicker: <TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>>({ props, ref, ...pickerParams }: UseStaticRangePickerParams<TView, TExternalProps>) => {
|
|
10
9
|
renderPicker: () => React.JSX.Element;
|
|
11
10
|
};
|
|
@@ -4,9 +4,8 @@ const _excluded = ["props", "ref"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
|
-
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
8
7
|
import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
|
|
9
|
-
import { usePicker, DIALOG_WIDTH } from '@mui/x-date-pickers/internals';
|
|
8
|
+
import { usePicker, DIALOG_WIDTH, PickerProvider } from '@mui/x-date-pickers/internals';
|
|
10
9
|
import { useRangePosition } from "../useRangePosition.js";
|
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
11
|
const PickerStaticLayout = styled(PickersLayout)(({
|
|
@@ -42,11 +41,13 @@ export const useStaticRangePicker = _ref => {
|
|
|
42
41
|
} = useRangePosition(props);
|
|
43
42
|
const {
|
|
44
43
|
layoutProps,
|
|
44
|
+
providerProps,
|
|
45
45
|
renderCurrentView
|
|
46
46
|
} = usePicker(_extends({}, pickerParams, {
|
|
47
47
|
props,
|
|
48
48
|
autoFocusView: autoFocus ?? false,
|
|
49
49
|
fieldRef: undefined,
|
|
50
|
+
localeText,
|
|
50
51
|
additionalViewProps: {
|
|
51
52
|
rangePosition,
|
|
52
53
|
onRangePositionChange
|
|
@@ -60,8 +61,7 @@ export const useStaticRangePicker = _ref => {
|
|
|
60
61
|
onRangePositionChange
|
|
61
62
|
})
|
|
62
63
|
});
|
|
63
|
-
const renderPicker = () => /*#__PURE__*/_jsx(
|
|
64
|
-
localeText: localeText,
|
|
64
|
+
const renderPicker = () => /*#__PURE__*/_jsx(PickerProvider, _extends({}, providerProps, {
|
|
65
65
|
children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps?.layout, {
|
|
66
66
|
slots: slots,
|
|
67
67
|
slotProps: slotPropsForLayout,
|
|
@@ -70,7 +70,7 @@ export const useStaticRangePicker = _ref => {
|
|
|
70
70
|
ref: ref,
|
|
71
71
|
children: renderCurrentView()
|
|
72
72
|
}))
|
|
73
|
-
});
|
|
73
|
+
}));
|
|
74
74
|
return {
|
|
75
75
|
renderPicker
|
|
76
76
|
};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BasePickerProps, UsePickerParams, ExportedBaseToolbarProps, StaticOnlyPickerProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
3
|
-
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
|
+
import { BasePickerProps, UsePickerParams, ExportedBaseToolbarProps, StaticOnlyPickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
4
3
|
import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps } from '@mui/x-date-pickers/PickersLayout';
|
|
5
|
-
import { RangeFieldSection
|
|
4
|
+
import { RangeFieldSection } from '../../../models';
|
|
6
5
|
import { UseRangePositionProps } from '../useRangePosition';
|
|
7
|
-
export interface UseStaticRangePickerSlots<
|
|
6
|
+
export interface UseStaticRangePickerSlots<TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlots<PickerRangeValue, TView> {
|
|
8
7
|
}
|
|
9
|
-
export interface UseStaticRangePickerSlotProps<
|
|
8
|
+
export interface UseStaticRangePickerSlotProps<TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlotProps<PickerRangeValue, TView> {
|
|
10
9
|
toolbar?: ExportedBaseToolbarProps;
|
|
11
10
|
}
|
|
12
11
|
export interface StaticRangeOnlyPickerProps extends StaticOnlyPickerProps, UseRangePositionProps {
|
|
13
12
|
}
|
|
14
|
-
export interface UseStaticRangePickerProps<
|
|
13
|
+
export interface UseStaticRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends BasePickerProps<PickerRangeValue, TView, TError, TExternalProps, {}>, StaticRangeOnlyPickerProps {
|
|
15
14
|
/**
|
|
16
15
|
* Overridable components.
|
|
17
16
|
* @default {}
|
|
18
17
|
*/
|
|
19
|
-
slots?: UseStaticRangePickerSlots<
|
|
18
|
+
slots?: UseStaticRangePickerSlots<TView>;
|
|
20
19
|
/**
|
|
21
20
|
* The props used for each component slot.
|
|
22
21
|
* @default {}
|
|
23
22
|
*/
|
|
24
|
-
slotProps?: UseStaticRangePickerSlotProps<
|
|
23
|
+
slotProps?: UseStaticRangePickerSlotProps<TView>;
|
|
25
24
|
}
|
|
26
|
-
export interface UseStaticRangePickerParams<
|
|
25
|
+
export interface UseStaticRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParams<PickerRangeValue, TView, RangeFieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
|
|
27
26
|
props: TExternalProps;
|
|
28
27
|
/**
|
|
29
28
|
* Ref to pass to the root element
|
|
@@ -2,16 +2,15 @@ import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
|
2
2
|
/**
|
|
3
3
|
* Props used to validate a day value in range pickers.
|
|
4
4
|
*/
|
|
5
|
-
export interface DayRangeValidationProps
|
|
5
|
+
export interface DayRangeValidationProps {
|
|
6
6
|
/**
|
|
7
7
|
* Disable specific date.
|
|
8
8
|
*
|
|
9
9
|
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
12
|
-
* @param {TDate} day The date to test.
|
|
11
|
+
* @param {PickerValidDate} day The date to test.
|
|
13
12
|
* @param {string} position The date to test, 'start' or 'end'.
|
|
14
13
|
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
15
14
|
*/
|
|
16
|
-
shouldDisableDate?: (day:
|
|
15
|
+
shouldDisableDate?: (day: PickerValidDate, position: 'start' | 'end') => boolean;
|
|
17
16
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export interface UseDateTimeRangeFieldProps<
|
|
6
|
-
/**
|
|
7
|
-
* 12h/24h view for hour selection clock.
|
|
8
|
-
* @default utils.is12HourCycleInCurrentLocale()
|
|
9
|
-
*/
|
|
10
|
-
ampm?: boolean;
|
|
1
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import { UseFieldInternalProps, DateOrTimeViewWithMeridiem, AmPmProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
3
|
+
import { DateTimeRangeValidationError, RangeFieldSection, RangeFieldSeparatorProps } from '../../models';
|
|
4
|
+
import { ExportedValidateDateTimeRangeProps } from '../../validation/validateDateTimeRange';
|
|
5
|
+
export interface UseDateTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<PickerRangeValue, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateTimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, ExportedValidateDateTimeRangeProps, AmPmProps {
|
|
11
6
|
}
|
|
12
7
|
export type DateTimeRangePickerView = Exclude<DateOrTimeViewWithMeridiem, 'month' | 'year'>;
|
|
13
8
|
export type DateTimeRangePickerViewExternal = Exclude<DateTimeRangePickerView, 'meridiem'>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material/styles';
|
|
2
|
+
import { SlotComponentProps } from '@mui/utils';
|
|
3
|
+
import { MakeRequired } from '@mui/x-internals/types';
|
|
4
|
+
import { UseFieldInternalProps } from '@mui/x-date-pickers/internals';
|
|
5
|
+
import { FieldSection } from '@mui/x-date-pickers/models';
|
|
6
|
+
import { PickersTextField } from '@mui/x-date-pickers/PickersTextField';
|
|
7
|
+
import type { MultiInputFieldRefs, MultiInputFieldSlotRootProps, RangeFieldSeparatorProps, RangePosition } from '../../models';
|
|
8
|
+
/**
|
|
9
|
+
* Props the multi input field can receive when used inside a picker.
|
|
10
|
+
* Only contains what the MUI components are passing to the field, not what users can pass using the `props.slotProps.field`.
|
|
11
|
+
*/
|
|
12
|
+
export interface BaseMultiInputFieldProps<TValue, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean, TError> extends MakeRequired<Pick<UseFieldInternalProps<TValue, TSection, TEnableAccessibleFieldDOMStructure, TError>, 'readOnly' | 'disabled' | 'format' | 'formatDensity' | 'enableAccessibleFieldDOMStructure' | 'selectedSections' | 'onSelectedSectionsChange' | 'timezone' | 'autoFocus' | 'value' | 'onChange'>, 'format' | 'value' | 'onChange' | 'timezone'>, RangeFieldSeparatorProps, MultiInputFieldRefs {
|
|
13
|
+
className: string | undefined;
|
|
14
|
+
sx: SxProps<any> | undefined;
|
|
15
|
+
slots?: {
|
|
16
|
+
root?: React.ElementType;
|
|
17
|
+
separator?: React.ElementType;
|
|
18
|
+
textField?: React.ElementType;
|
|
19
|
+
};
|
|
20
|
+
slotProps?: {
|
|
21
|
+
root?: SlotComponentProps<React.ElementType<MultiInputFieldSlotRootProps>, {}, Record<string, any>>;
|
|
22
|
+
textField?: SlotComponentProps<typeof PickersTextField, {}, {
|
|
23
|
+
position?: RangePosition;
|
|
24
|
+
} & Record<string, any>>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { TimeRangeValidationError, RangeFieldSection,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* 12h/24h view for hour selection clock.
|
|
7
|
-
* @default utils.is12HourCycleInCurrentLocale()
|
|
8
|
-
*/
|
|
9
|
-
ampm?: boolean;
|
|
1
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import { UseFieldInternalProps, AmPmProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
3
|
+
import { TimeRangeValidationError, RangeFieldSection, RangeFieldSeparatorProps } from '../../models';
|
|
4
|
+
import type { ExportedValidateTimeRangeProps } from '../../validation/validateTimeRange';
|
|
5
|
+
export interface UseTimeRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<PickerRangeValue, RangeFieldSection, TEnableAccessibleFieldDOMStructure, TimeRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, ExportedValidateTimeRangeProps, AmPmProps {
|
|
10
6
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { MuiPickersAdapter, PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
3
|
+
import { RangePosition } from '../../models';
|
|
4
|
+
interface CalculateRangeChangeOptions {
|
|
5
|
+
utils: MuiPickersAdapter;
|
|
6
|
+
range: PickerRangeValue;
|
|
7
|
+
newDate: PickerValidDate | null;
|
|
7
8
|
rangePosition: RangePosition;
|
|
8
9
|
/**
|
|
9
10
|
* Should allow flipping range `start` and `end` dates if the `newDate` would result in a new range creation.
|
|
@@ -13,10 +14,10 @@ interface CalculateRangeChangeOptions<TDate extends PickerValidDate> {
|
|
|
13
14
|
allowRangeFlip?: boolean;
|
|
14
15
|
shouldMergeDateAndTime?: boolean;
|
|
15
16
|
}
|
|
16
|
-
interface CalculateRangeChangeResponse
|
|
17
|
+
interface CalculateRangeChangeResponse {
|
|
17
18
|
nextSelection: RangePosition;
|
|
18
|
-
newRange:
|
|
19
|
+
newRange: PickerRangeValue;
|
|
19
20
|
}
|
|
20
|
-
export declare function calculateRangeChange
|
|
21
|
-
export declare function calculateRangePreview
|
|
21
|
+
export declare function calculateRangeChange({ utils, range, newDate: selectedDate, rangePosition, allowRangeFlip, shouldMergeDateAndTime, }: CalculateRangeChangeOptions): CalculateRangeChangeResponse;
|
|
22
|
+
export declare function calculateRangePreview(options: CalculateRangeChangeOptions): PickerRangeValue;
|
|
22
23
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MuiPickersAdapter, PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
|
-
import {
|
|
3
|
-
export declare const isRangeValid:
|
|
4
|
-
export declare const isWithinRange:
|
|
5
|
-
export declare const isStartOfRange:
|
|
6
|
-
export declare const isEndOfRange:
|
|
2
|
+
import { PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
3
|
+
export declare const isRangeValid: (utils: MuiPickersAdapter, range: PickerRangeValue | null) => range is [PickerValidDate, PickerValidDate];
|
|
4
|
+
export declare const isWithinRange: (utils: MuiPickersAdapter, day: PickerValidDate, range: PickerRangeValue | null) => boolean;
|
|
5
|
+
export declare const isStartOfRange: (utils: MuiPickersAdapter, day: PickerValidDate, range: PickerRangeValue | null) => boolean;
|
|
6
|
+
export declare const isEndOfRange: (utils: MuiPickersAdapter, day: PickerValidDate, range: PickerRangeValue | null) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTczMTUzODgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { PickerValueManager, FieldValueManager } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export type RangePickerValueManager<TValue = [any, any], TDate extends PickerValidDate = any, TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerValueManager<TValue, TDate, TError>;
|
|
1
|
+
import { PickerValueManager, FieldValueManager, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
2
|
+
import type { DateRangeValidationError, DateTimeRangeValidationError, TimeRangeValidationError, RangeFieldSection } from '../../models';
|
|
3
|
+
export type RangePickerValueManager<TValue = [any, any], TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerValueManager<TValue, TError>;
|
|
5
4
|
export declare const rangeValueManager: RangePickerValueManager;
|
|
6
|
-
export declare const getRangeFieldValueManager:
|
|
5
|
+
export declare const getRangeFieldValueManager: ({ dateSeparator, }: {
|
|
7
6
|
dateSeparator: string | undefined;
|
|
8
|
-
}) => FieldValueManager<
|
|
7
|
+
}) => FieldValueManager<PickerRangeValue, RangeFieldSection>;
|
package/models/dateRange.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import { UseFieldInternalProps, PickerRangeValue } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { RangeFieldSection, RangeFieldSeparatorProps } from './fields';
|
|
4
4
|
import { DateRangeValidationError } from './validation';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export interface UseDateRangeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, DayRangeValidationProps<TDate>, BaseDateValidationProps<TDate> {
|
|
5
|
+
import type { ExportedValidateDateRangeProps } from '../validation/validateDateRange';
|
|
6
|
+
export interface UseDateRangeFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<Omit<UseFieldInternalProps<PickerRangeValue, RangeFieldSection, TEnableAccessibleFieldDOMStructure, DateRangeValidationError>, 'unstableFieldRef'>, 'format'>, RangeFieldSeparatorProps, ExportedValidateDateRangeProps {
|
|
8
7
|
}
|
package/models/fields.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { BaseSingleInputPickersTextFieldProps, FieldRef, FieldSection, PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
|
+
import { UseFieldResponse, FormProps } from '@mui/x-date-pickers/internals';
|
|
3
|
+
import { FieldRef, FieldSection, PickerFieldSlotProps } from '@mui/x-date-pickers/models';
|
|
5
4
|
import { UseClearableFieldResponse } from '@mui/x-date-pickers/hooks';
|
|
6
|
-
import { SxProps } from '@mui/material/styles';
|
|
7
|
-
import TextField from '@mui/material/TextField';
|
|
8
5
|
import { RangePosition } from './range';
|
|
9
6
|
export interface RangeFieldSection extends FieldSection {
|
|
10
7
|
dateName: RangePosition;
|
|
@@ -13,11 +10,9 @@ export type FieldType = 'single-input' | 'multi-input';
|
|
|
13
10
|
/**
|
|
14
11
|
* Props the `textField` slot of the multi input field can receive when used inside a picker.
|
|
15
12
|
*/
|
|
16
|
-
export interface MultiInputFieldSlotTextFieldProps {
|
|
13
|
+
export interface MultiInputFieldSlotTextFieldProps extends FormProps {
|
|
17
14
|
label?: React.ReactNode;
|
|
18
15
|
id?: string;
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
readOnly?: boolean;
|
|
21
16
|
onKeyDown?: React.KeyboardEventHandler;
|
|
22
17
|
onClick?: React.MouseEventHandler;
|
|
23
18
|
onFocus?: React.FocusEventHandler;
|
|
@@ -46,33 +41,11 @@ export interface RangeFieldSeparatorProps {
|
|
|
46
41
|
dateSeparator?: string;
|
|
47
42
|
}
|
|
48
43
|
/**
|
|
49
|
-
* Props the
|
|
50
|
-
* Only contains what the MUI components are passing to the field,
|
|
51
|
-
* not what users can pass using the `props.slotProps.field`.
|
|
44
|
+
* Props the `slotProps.field` of a range picker component can receive.
|
|
52
45
|
*/
|
|
53
|
-
export
|
|
54
|
-
sx?: SxProps<any>;
|
|
55
|
-
unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
56
|
-
unstableEndFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
57
|
-
slots?: {
|
|
58
|
-
root?: React.ElementType;
|
|
59
|
-
separator?: React.ElementType;
|
|
60
|
-
textField?: React.ElementType;
|
|
61
|
-
};
|
|
62
|
-
slotProps?: {
|
|
63
|
-
root?: SlotComponentProps<React.ElementType<MultiInputFieldSlotRootProps>, {}, Record<string, any>>;
|
|
64
|
-
textField?: SlotComponentProps<typeof TextField, {}, {
|
|
65
|
-
position?: RangePosition;
|
|
66
|
-
} & Record<string, any>>;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
46
|
+
export type PickerRangeFieldSlotProps<TValue, TSection extends FieldSection, TEnableAccessibleFieldDOMStructure extends boolean> = PickerFieldSlotProps<TValue, TSection, TEnableAccessibleFieldDOMStructure> & RangeFieldSeparatorProps;
|
|
69
47
|
/**
|
|
70
48
|
* Props the text field receives when used with a multi input picker.
|
|
71
49
|
* Only contains what the MUI components are passing to the text field, not what users can pass using the `props.slotProps.textField`.
|
|
72
50
|
*/
|
|
73
51
|
export type BaseMultiInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = UseClearableFieldResponse<UseFieldResponse<TEnableAccessibleFieldDOMStructure, MultiInputFieldSlotTextFieldProps>>;
|
|
74
|
-
/**
|
|
75
|
-
* Props the text field receives when used with a single or multi input picker.
|
|
76
|
-
* Only contains what the MUI components are passing to the text field, not what users can pass using the `props.slotProps.field` or `props.slotProps.textField`.
|
|
77
|
-
*/
|
|
78
|
-
export type BasePickersTextFieldProps<TEnableAccessibleFieldDOMStructure extends boolean> = BaseSingleInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure> & BaseMultiInputPickersTextFieldProps<TEnableAccessibleFieldDOMStructure>;
|
package/models/range.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
2
2
|
export type DateRange<TDate extends PickerValidDate> = [TDate | null, TDate | null];
|
|
3
|
-
export type NonEmptyDateRange
|
|
3
|
+
export type NonEmptyDateRange = [PickerValidDate, PickerValidDate];
|
|
4
4
|
export type RangePosition = 'start' | 'end';
|