@mui/x-date-pickers-pro 6.12.0 → 6.13.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 +184 -47
- package/DateRangeCalendar/DateRangeCalendar.js +8 -1
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +5 -0
- package/DateRangePicker/DateRangePicker.js +5 -0
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -0
- package/MobileDateRangePicker/MobileDateRangePicker.js +5 -0
- package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +1 -1
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +1 -1
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +1 -1
- package/README.md +0 -1
- package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +1 -1
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +0 -4
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +1 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +0 -4
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +1 -1
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +0 -4
- package/StaticDateRangePicker/StaticDateRangePicker.js +5 -0
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +1 -1
- package/dateRangeViewRenderers/dateRangeViewRenderers.js +2 -0
- package/index.js +1 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +5 -2
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +1 -1
- package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +2 -1
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +17 -3
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +1 -1
- package/internals/models/fields.d.ts +3 -0
- package/internals/utils/releaseInfo.js +1 -1
- package/legacy/DateRangeCalendar/DateRangeCalendar.js +8 -1
- package/legacy/DateRangePicker/DateRangePicker.js +5 -0
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -0
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +5 -0
- package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +0 -4
- package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +0 -4
- package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +0 -4
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +5 -0
- package/legacy/dateRangeViewRenderers/dateRangeViewRenderers.js +2 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +5 -2
- package/legacy/internals/hooks/useEnrichedRangePickerFieldProps.js +17 -3
- package/legacy/internals/utils/releaseInfo.js +1 -1
- package/modern/DateRangeCalendar/DateRangeCalendar.js +8 -1
- package/modern/DateRangePicker/DateRangePicker.js +5 -0
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -0
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +5 -0
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +0 -4
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +0 -4
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +0 -4
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +5 -0
- package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +2 -0
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +5 -2
- package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +17 -3
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/node/DateRangeCalendar/DateRangeCalendar.js +8 -1
- package/node/DateRangePicker/DateRangePicker.js +5 -0
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -0
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +5 -0
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +0 -4
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +0 -4
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +0 -4
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +5 -0
- package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +2 -0
- package/node/index.js +1 -1
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +5 -2
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +17 -3
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
|
@@ -38,6 +38,7 @@ export const useDesktopRangePicker = _ref => {
|
|
|
38
38
|
reduceAnimations
|
|
39
39
|
} = props;
|
|
40
40
|
const fieldContainerRef = React.useRef(null);
|
|
41
|
+
const anchorRef = React.useRef(null);
|
|
41
42
|
const popperRef = React.useRef(null);
|
|
42
43
|
const {
|
|
43
44
|
rangePosition,
|
|
@@ -104,7 +105,8 @@ export const useDesktopRangePicker = _ref => {
|
|
|
104
105
|
singleInputFieldRef,
|
|
105
106
|
pickerSlotProps: slotProps,
|
|
106
107
|
pickerSlots: slots,
|
|
107
|
-
fieldProps
|
|
108
|
+
fieldProps,
|
|
109
|
+
anchorRef
|
|
108
110
|
});
|
|
109
111
|
const slotPropsForLayout = _extends({}, slotProps, {
|
|
110
112
|
toolbar: _extends({}, slotProps == null ? void 0 : slotProps.toolbar, {
|
|
@@ -117,8 +119,9 @@ export const useDesktopRangePicker = _ref => {
|
|
|
117
119
|
localeText: localeText,
|
|
118
120
|
children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldProps)), /*#__PURE__*/_jsx(PickersPopper, _extends({
|
|
119
121
|
role: "tooltip",
|
|
122
|
+
placement: "bottom-start",
|
|
120
123
|
containerRef: popperRef,
|
|
121
|
-
anchorEl:
|
|
124
|
+
anchorEl: anchorRef.current,
|
|
122
125
|
onBlur: handleBlur
|
|
123
126
|
}, actions, {
|
|
124
127
|
open: open,
|
|
@@ -15,7 +15,7 @@ export interface DesktopRangeOnlyPickerProps<TDate> extends BaseNonStaticPickerP
|
|
|
15
15
|
*/
|
|
16
16
|
autoFocus?: boolean;
|
|
17
17
|
}
|
|
18
|
-
export interface UseDesktopRangePickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends DesktopRangeOnlyPickerProps<TDate>, BasePickerProps<DateRange<TDate>, TDate, TView, TError, TExternalProps, DesktopRangePickerAdditionalViewProps> {
|
|
18
|
+
export interface UseDesktopRangePickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<any, any, TView, any, any>> extends DesktopRangeOnlyPickerProps<TDate>, BasePickerProps<DateRange<TDate>, TDate, TView, TError, TExternalProps, DesktopRangePickerAdditionalViewProps> {
|
|
19
19
|
/**
|
|
20
20
|
* Overridable component slots.
|
|
21
21
|
* @default {}
|
|
@@ -30,7 +30,7 @@ export interface RangePickerFieldSlotsComponent {
|
|
|
30
30
|
TextField?: React.ElementType<TextFieldProps>;
|
|
31
31
|
}
|
|
32
32
|
export interface RangePickerFieldSlotsComponentsProps<TDate> {
|
|
33
|
-
field?: SlotComponentProps<React.ElementType<BaseMultiInputFieldProps<DateRange<TDate>, TDate, RangeFieldSection, unknown>>, {}, UsePickerProps<DateRange<TDate>, any, RangeFieldSection, any, any, any>>;
|
|
33
|
+
field?: SlotComponentProps<React.ElementType<BaseMultiInputFieldProps<DateRange<TDate>, TDate, RangeFieldSection, unknown>>, {}, UsePickerProps<DateRange<TDate>, TDate, any, RangeFieldSection, any, any, any>>;
|
|
34
34
|
fieldRoot?: SlotComponentProps<typeof Stack, {}, Record<string, any>>;
|
|
35
35
|
fieldSeparator?: SlotComponentProps<typeof Typography, {}, Record<string, any>>;
|
|
36
36
|
textField?: SlotComponentProps<typeof TextField, {}, UseDateRangeFieldProps<TDate> & {
|
|
@@ -50,5 +50,6 @@ export interface UseEnrichedRangePickerFieldPropsParams<TDate, TView extends Dat
|
|
|
50
50
|
pickerSlotProps: RangePickerFieldSlotsComponentsProps<TDate> | undefined;
|
|
51
51
|
pickerSlots: UncapitalizeObjectKeys<RangePickerFieldSlotsComponent> | undefined;
|
|
52
52
|
fieldProps: FieldProps;
|
|
53
|
+
anchorRef?: React.Ref<HTMLDivElement>;
|
|
53
54
|
}
|
|
54
55
|
export declare const useEnrichedRangePickerFieldProps: <TDate, TView extends DateOrTimeViewWithMeridiem, TError>(params: UseEnrichedRangePickerFieldPropsParams<TDate, TView, TError, BaseFieldProps<DateRange<TDate>, TDate, RangeFieldSection, TError>>) => BaseMultiInputFieldProps<DateRange<TDate>, TDate, RangeFieldSection, TError> | BaseSingleInputFieldProps<DateRange<TDate>, TDate, RangeFieldSection, TError>;
|
|
@@ -17,7 +17,8 @@ const useMultiInputFieldSlotProps = ({
|
|
|
17
17
|
localeText: inLocaleText,
|
|
18
18
|
pickerSlotProps,
|
|
19
19
|
pickerSlots,
|
|
20
|
-
fieldProps
|
|
20
|
+
fieldProps,
|
|
21
|
+
anchorRef
|
|
21
22
|
}) => {
|
|
22
23
|
const localeText = useLocaleText();
|
|
23
24
|
const startRef = React.useRef(null);
|
|
@@ -65,7 +66,9 @@ const useMultiInputFieldSlotProps = ({
|
|
|
65
66
|
}, fieldProps.slots);
|
|
66
67
|
const slotProps = _extends({}, fieldProps.slotProps, {
|
|
67
68
|
textField: ownerState => {
|
|
69
|
+
const resolvedComponentProps = resolveComponentProps(pickerSlotProps == null ? void 0 : pickerSlotProps.textField, ownerState);
|
|
68
70
|
let inputProps;
|
|
71
|
+
let InputProps;
|
|
69
72
|
if (ownerState.position === 'start') {
|
|
70
73
|
var _inLocaleText$start;
|
|
71
74
|
inputProps = _extends({
|
|
@@ -79,6 +82,11 @@ const useMultiInputFieldSlotProps = ({
|
|
|
79
82
|
}, wrapperVariant === 'mobile' && {
|
|
80
83
|
readOnly: true
|
|
81
84
|
});
|
|
85
|
+
if (anchorRef) {
|
|
86
|
+
InputProps = _extends({}, resolvedComponentProps == null ? void 0 : resolvedComponentProps.InputProps, {
|
|
87
|
+
ref: anchorRef
|
|
88
|
+
});
|
|
89
|
+
}
|
|
82
90
|
} else {
|
|
83
91
|
var _inLocaleText$end;
|
|
84
92
|
inputProps = _extends({
|
|
@@ -95,7 +103,9 @@ const useMultiInputFieldSlotProps = ({
|
|
|
95
103
|
}
|
|
96
104
|
return _extends({}, labelId != null && {
|
|
97
105
|
id: `${labelId}-${ownerState.position}`
|
|
98
|
-
}, inputProps, resolveComponentProps(pickerSlotProps == null ? void 0 : pickerSlotProps.textField, ownerState)
|
|
106
|
+
}, inputProps, resolveComponentProps(pickerSlotProps == null ? void 0 : pickerSlotProps.textField, ownerState), {
|
|
107
|
+
InputProps
|
|
108
|
+
});
|
|
99
109
|
},
|
|
100
110
|
root: ownerState => {
|
|
101
111
|
const rootProps = {
|
|
@@ -126,7 +136,8 @@ const useSingleInputFieldSlotProps = ({
|
|
|
126
136
|
singleInputFieldRef,
|
|
127
137
|
pickerSlots,
|
|
128
138
|
pickerSlotProps,
|
|
129
|
-
fieldProps
|
|
139
|
+
fieldProps,
|
|
140
|
+
anchorRef
|
|
130
141
|
}) => {
|
|
131
142
|
const inputRef = React.useRef(null);
|
|
132
143
|
const handleInputRef = useForkRef(inInputRef, inputRef);
|
|
@@ -176,6 +187,9 @@ const useSingleInputFieldSlotProps = ({
|
|
|
176
187
|
onKeyDown: onSpaceOrEnter(openPicker, fieldProps.onKeyDown),
|
|
177
188
|
onSelectedSectionsChange: handleSelectedSectionsChange,
|
|
178
189
|
onBlur,
|
|
190
|
+
InputProps: _extends({
|
|
191
|
+
ref: anchorRef
|
|
192
|
+
}, fieldProps == null ? void 0 : fieldProps.InputProps),
|
|
179
193
|
focused: open
|
|
180
194
|
}, labelId != null && {
|
|
181
195
|
id: labelId
|
|
@@ -11,7 +11,7 @@ export interface UseMobileRangePickerSlotsComponentsProps<TDate, TView extends D
|
|
|
11
11
|
}
|
|
12
12
|
export interface MobileRangeOnlyPickerProps<TDate> extends BaseNonStaticPickerProps, UsePickerValueNonStaticProps<TDate | null, RangeFieldSection>, UsePickerViewsNonStaticProps, BaseRangeNonStaticPickerProps, UseRangePositionProps {
|
|
13
13
|
}
|
|
14
|
-
export interface UseMobileRangePickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends MobileRangeOnlyPickerProps<TDate>, BasePickerProps<DateRange<TDate>, TDate, TView, TError, TExternalProps, MobileRangePickerAdditionalViewProps> {
|
|
14
|
+
export interface UseMobileRangePickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<any, any, TView, any, any>> extends MobileRangeOnlyPickerProps<TDate>, BasePickerProps<DateRange<TDate>, TDate, TView, TError, TExternalProps, MobileRangePickerAdditionalViewProps> {
|
|
15
15
|
/**
|
|
16
16
|
* Overridable component slots.
|
|
17
17
|
* @default {}
|
|
@@ -17,6 +17,9 @@ export interface MultiInputFieldSlotTextFieldProps {
|
|
|
17
17
|
onKeyDown?: React.KeyboardEventHandler;
|
|
18
18
|
onFocus?: React.FocusEventHandler;
|
|
19
19
|
focused?: boolean;
|
|
20
|
+
InputProps?: {
|
|
21
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
22
|
+
};
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
25
|
* Props the `root` slot of the multi input field can receive when used inside a picker.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY5NDEyMDQwMDAwMA==";
|
|
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
|
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
var _excluded = ["value", "defaultValue", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "defaultCalendarMonth", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "components", "componentsProps", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone"],
|
|
5
|
+
var _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "defaultCalendarMonth", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "components", "componentsProps", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone"],
|
|
6
6
|
_excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
@@ -120,6 +120,7 @@ var DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalendar
|
|
|
120
120
|
});
|
|
121
121
|
var valueProp = props.value,
|
|
122
122
|
defaultValue = props.defaultValue,
|
|
123
|
+
referenceDate = props.referenceDate,
|
|
123
124
|
onChange = props.onChange,
|
|
124
125
|
className = props.className,
|
|
125
126
|
disableFuture = props.disableFuture,
|
|
@@ -246,6 +247,7 @@ var DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalendar
|
|
|
246
247
|
}, [shouldDisableDate, rangePosition, draggingDatePosition]);
|
|
247
248
|
var _useCalendarState = useCalendarState({
|
|
248
249
|
value: value[0] || value[1],
|
|
250
|
+
referenceDate: referenceDate,
|
|
249
251
|
defaultCalendarMonth: defaultCalendarMonth,
|
|
250
252
|
disableFuture: disableFuture,
|
|
251
253
|
disablePast: disablePast,
|
|
@@ -637,6 +639,11 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
637
639
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
638
640
|
*/
|
|
639
641
|
reduceAnimations: PropTypes.bool,
|
|
642
|
+
/**
|
|
643
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
644
|
+
* @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`.
|
|
645
|
+
*/
|
|
646
|
+
referenceDate: PropTypes.any,
|
|
640
647
|
/**
|
|
641
648
|
* Component displaying when passed `loading` true.
|
|
642
649
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -254,6 +254,11 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
254
254
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
255
255
|
*/
|
|
256
256
|
reduceAnimations: PropTypes.bool,
|
|
257
|
+
/**
|
|
258
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
259
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
260
|
+
*/
|
|
261
|
+
referenceDate: PropTypes.any,
|
|
257
262
|
/**
|
|
258
263
|
* Component displaying when passed `loading` true.
|
|
259
264
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -263,6 +263,11 @@ DesktopDateRangePicker.propTypes = {
|
|
|
263
263
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
264
264
|
*/
|
|
265
265
|
reduceAnimations: PropTypes.bool,
|
|
266
|
+
/**
|
|
267
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
268
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
269
|
+
*/
|
|
270
|
+
referenceDate: PropTypes.any,
|
|
266
271
|
/**
|
|
267
272
|
* Component displaying when passed `loading` true.
|
|
268
273
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -263,6 +263,11 @@ MobileDateRangePicker.propTypes = {
|
|
|
263
263
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
264
264
|
*/
|
|
265
265
|
reduceAnimations: PropTypes.bool,
|
|
266
|
+
/**
|
|
267
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
268
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
269
|
+
*/
|
|
270
|
+
referenceDate: PropTypes.any,
|
|
266
271
|
/**
|
|
267
272
|
* Component displaying when passed `loading` true.
|
|
268
273
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -203,10 +203,6 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
203
203
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
204
204
|
*/
|
|
205
205
|
onChange: PropTypes.func,
|
|
206
|
-
/**
|
|
207
|
-
* @ignore
|
|
208
|
-
*/
|
|
209
|
-
onClick: PropTypes.func,
|
|
210
206
|
/**
|
|
211
207
|
* Callback fired when the error associated to the current value changes.
|
|
212
208
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -236,10 +236,6 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
236
236
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
237
237
|
*/
|
|
238
238
|
onChange: PropTypes.func,
|
|
239
|
-
/**
|
|
240
|
-
* @ignore
|
|
241
|
-
*/
|
|
242
|
-
onClick: PropTypes.func,
|
|
243
239
|
/**
|
|
244
240
|
* Callback fired when the error associated to the current value changes.
|
|
245
241
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -220,10 +220,6 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
220
220
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
221
221
|
*/
|
|
222
222
|
onChange: PropTypes.func,
|
|
223
|
-
/**
|
|
224
|
-
* @ignore
|
|
225
|
-
*/
|
|
226
|
-
onClick: PropTypes.func,
|
|
227
223
|
/**
|
|
228
224
|
* Callback fired when the error associated to the current value changes.
|
|
229
225
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -213,6 +213,11 @@ StaticDateRangePicker.propTypes = {
|
|
|
213
213
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
214
214
|
*/
|
|
215
215
|
reduceAnimations: PropTypes.bool,
|
|
216
|
+
/**
|
|
217
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
218
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
219
|
+
*/
|
|
220
|
+
referenceDate: PropTypes.any,
|
|
216
221
|
/**
|
|
217
222
|
* Component displaying when passed `loading` true.
|
|
218
223
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -8,6 +8,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
export var renderDateRangeViewCalendar = function renderDateRangeViewCalendar(_ref) {
|
|
9
9
|
var value = _ref.value,
|
|
10
10
|
defaultValue = _ref.defaultValue,
|
|
11
|
+
referenceDate = _ref.referenceDate,
|
|
11
12
|
onChange = _ref.onChange,
|
|
12
13
|
className = _ref.className,
|
|
13
14
|
classes = _ref.classes,
|
|
@@ -45,6 +46,7 @@ export var renderDateRangeViewCalendar = function renderDateRangeViewCalendar(_r
|
|
|
45
46
|
return /*#__PURE__*/_jsx(DateRangeCalendar, {
|
|
46
47
|
value: value,
|
|
47
48
|
defaultValue: defaultValue,
|
|
49
|
+
referenceDate: referenceDate,
|
|
48
50
|
onChange: onChange,
|
|
49
51
|
className: className,
|
|
50
52
|
classes: classes,
|
package/legacy/index.js
CHANGED
|
@@ -34,6 +34,7 @@ export var useDesktopRangePicker = function useDesktopRangePicker(_ref) {
|
|
|
34
34
|
localeText = props.localeText,
|
|
35
35
|
reduceAnimations = props.reduceAnimations;
|
|
36
36
|
var fieldContainerRef = React.useRef(null);
|
|
37
|
+
var anchorRef = React.useRef(null);
|
|
37
38
|
var popperRef = React.useRef(null);
|
|
38
39
|
var _useRangePosition = useRangePosition(props),
|
|
39
40
|
rangePosition = _useRangePosition.rangePosition,
|
|
@@ -98,7 +99,8 @@ export var useDesktopRangePicker = function useDesktopRangePicker(_ref) {
|
|
|
98
99
|
singleInputFieldRef: singleInputFieldRef,
|
|
99
100
|
pickerSlotProps: slotProps,
|
|
100
101
|
pickerSlots: slots,
|
|
101
|
-
fieldProps: fieldProps
|
|
102
|
+
fieldProps: fieldProps,
|
|
103
|
+
anchorRef: anchorRef
|
|
102
104
|
});
|
|
103
105
|
var slotPropsForLayout = _extends({}, slotProps, {
|
|
104
106
|
toolbar: _extends({}, slotProps == null ? void 0 : slotProps.toolbar, {
|
|
@@ -112,8 +114,9 @@ export var useDesktopRangePicker = function useDesktopRangePicker(_ref) {
|
|
|
112
114
|
localeText: localeText,
|
|
113
115
|
children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldProps)), /*#__PURE__*/_jsx(PickersPopper, _extends({
|
|
114
116
|
role: "tooltip",
|
|
117
|
+
placement: "bottom-start",
|
|
115
118
|
containerRef: popperRef,
|
|
116
|
-
anchorEl:
|
|
119
|
+
anchorEl: anchorRef.current,
|
|
117
120
|
onBlur: handleBlur
|
|
118
121
|
}, actions, {
|
|
119
122
|
open: open,
|
|
@@ -17,7 +17,8 @@ var useMultiInputFieldSlotProps = function useMultiInputFieldSlotProps(_ref) {
|
|
|
17
17
|
inLocaleText = _ref.localeText,
|
|
18
18
|
pickerSlotProps = _ref.pickerSlotProps,
|
|
19
19
|
pickerSlots = _ref.pickerSlots,
|
|
20
|
-
fieldProps = _ref.fieldProps
|
|
20
|
+
fieldProps = _ref.fieldProps,
|
|
21
|
+
anchorRef = _ref.anchorRef;
|
|
21
22
|
var localeText = useLocaleText();
|
|
22
23
|
var startRef = React.useRef(null);
|
|
23
24
|
var endRef = React.useRef(null);
|
|
@@ -64,7 +65,9 @@ var useMultiInputFieldSlotProps = function useMultiInputFieldSlotProps(_ref) {
|
|
|
64
65
|
}, fieldProps.slots);
|
|
65
66
|
var slotProps = _extends({}, fieldProps.slotProps, {
|
|
66
67
|
textField: function textField(ownerState) {
|
|
68
|
+
var resolvedComponentProps = resolveComponentProps(pickerSlotProps == null ? void 0 : pickerSlotProps.textField, ownerState);
|
|
67
69
|
var inputProps;
|
|
70
|
+
var InputProps;
|
|
68
71
|
if (ownerState.position === 'start') {
|
|
69
72
|
var _inLocaleText$start;
|
|
70
73
|
inputProps = _extends({
|
|
@@ -78,6 +81,11 @@ var useMultiInputFieldSlotProps = function useMultiInputFieldSlotProps(_ref) {
|
|
|
78
81
|
}, wrapperVariant === 'mobile' && {
|
|
79
82
|
readOnly: true
|
|
80
83
|
});
|
|
84
|
+
if (anchorRef) {
|
|
85
|
+
InputProps = _extends({}, resolvedComponentProps == null ? void 0 : resolvedComponentProps.InputProps, {
|
|
86
|
+
ref: anchorRef
|
|
87
|
+
});
|
|
88
|
+
}
|
|
81
89
|
} else {
|
|
82
90
|
var _inLocaleText$end;
|
|
83
91
|
inputProps = _extends({
|
|
@@ -94,7 +102,9 @@ var useMultiInputFieldSlotProps = function useMultiInputFieldSlotProps(_ref) {
|
|
|
94
102
|
}
|
|
95
103
|
return _extends({}, labelId != null && {
|
|
96
104
|
id: "".concat(labelId, "-").concat(ownerState.position)
|
|
97
|
-
}, inputProps, resolveComponentProps(pickerSlotProps == null ? void 0 : pickerSlotProps.textField, ownerState)
|
|
105
|
+
}, inputProps, resolveComponentProps(pickerSlotProps == null ? void 0 : pickerSlotProps.textField, ownerState), {
|
|
106
|
+
InputProps: InputProps
|
|
107
|
+
});
|
|
98
108
|
},
|
|
99
109
|
root: function root(ownerState) {
|
|
100
110
|
var rootProps = {
|
|
@@ -125,7 +135,8 @@ var useSingleInputFieldSlotProps = function useSingleInputFieldSlotProps(_ref2)
|
|
|
125
135
|
singleInputFieldRef = _ref2.singleInputFieldRef,
|
|
126
136
|
pickerSlots = _ref2.pickerSlots,
|
|
127
137
|
pickerSlotProps = _ref2.pickerSlotProps,
|
|
128
|
-
fieldProps = _ref2.fieldProps
|
|
138
|
+
fieldProps = _ref2.fieldProps,
|
|
139
|
+
anchorRef = _ref2.anchorRef;
|
|
129
140
|
var inputRef = React.useRef(null);
|
|
130
141
|
var handleInputRef = useForkRef(inInputRef, inputRef);
|
|
131
142
|
var handleFieldRef = useForkRef(fieldProps.unstableFieldRef, singleInputFieldRef);
|
|
@@ -174,6 +185,9 @@ var useSingleInputFieldSlotProps = function useSingleInputFieldSlotProps(_ref2)
|
|
|
174
185
|
onKeyDown: onSpaceOrEnter(openPicker, fieldProps.onKeyDown),
|
|
175
186
|
onSelectedSectionsChange: handleSelectedSectionsChange,
|
|
176
187
|
onBlur: onBlur,
|
|
188
|
+
InputProps: _extends({
|
|
189
|
+
ref: anchorRef
|
|
190
|
+
}, fieldProps == null ? void 0 : fieldProps.InputProps),
|
|
177
191
|
focused: open
|
|
178
192
|
}, labelId != null && {
|
|
179
193
|
id: labelId
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY5NDEyMDQwMDAwMA==";
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "defaultValue", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "defaultCalendarMonth", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "components", "componentsProps", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone"],
|
|
3
|
+
const _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "defaultCalendarMonth", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "components", "componentsProps", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone"],
|
|
4
4
|
_excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -116,6 +116,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
116
116
|
const {
|
|
117
117
|
value: valueProp,
|
|
118
118
|
defaultValue,
|
|
119
|
+
referenceDate,
|
|
119
120
|
onChange,
|
|
120
121
|
className,
|
|
121
122
|
disableFuture,
|
|
@@ -248,6 +249,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
|
|
|
248
249
|
onMonthSwitchingAnimationEnd
|
|
249
250
|
} = useCalendarState({
|
|
250
251
|
value: value[0] || value[1],
|
|
252
|
+
referenceDate,
|
|
251
253
|
defaultCalendarMonth,
|
|
252
254
|
disableFuture,
|
|
253
255
|
disablePast,
|
|
@@ -610,6 +612,11 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
|
|
|
610
612
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
611
613
|
*/
|
|
612
614
|
reduceAnimations: PropTypes.bool,
|
|
615
|
+
/**
|
|
616
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
617
|
+
* @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`.
|
|
618
|
+
*/
|
|
619
|
+
referenceDate: PropTypes.any,
|
|
613
620
|
/**
|
|
614
621
|
* Component displaying when passed `loading` true.
|
|
615
622
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -255,6 +255,11 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
255
255
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
256
256
|
*/
|
|
257
257
|
reduceAnimations: PropTypes.bool,
|
|
258
|
+
/**
|
|
259
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
260
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
261
|
+
*/
|
|
262
|
+
referenceDate: PropTypes.any,
|
|
258
263
|
/**
|
|
259
264
|
* Component displaying when passed `loading` true.
|
|
260
265
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -260,6 +260,11 @@ DesktopDateRangePicker.propTypes = {
|
|
|
260
260
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
261
261
|
*/
|
|
262
262
|
reduceAnimations: PropTypes.bool,
|
|
263
|
+
/**
|
|
264
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
265
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
266
|
+
*/
|
|
267
|
+
referenceDate: PropTypes.any,
|
|
263
268
|
/**
|
|
264
269
|
* Component displaying when passed `loading` true.
|
|
265
270
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -260,6 +260,11 @@ MobileDateRangePicker.propTypes = {
|
|
|
260
260
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
261
261
|
*/
|
|
262
262
|
reduceAnimations: PropTypes.bool,
|
|
263
|
+
/**
|
|
264
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
265
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
266
|
+
*/
|
|
267
|
+
referenceDate: PropTypes.any,
|
|
263
268
|
/**
|
|
264
269
|
* Component displaying when passed `loading` true.
|
|
265
270
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -208,10 +208,6 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
208
208
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
209
209
|
*/
|
|
210
210
|
onChange: PropTypes.func,
|
|
211
|
-
/**
|
|
212
|
-
* @ignore
|
|
213
|
-
*/
|
|
214
|
-
onClick: PropTypes.func,
|
|
215
211
|
/**
|
|
216
212
|
* Callback fired when the error associated to the current value changes.
|
|
217
213
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -241,10 +241,6 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
241
241
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
242
242
|
*/
|
|
243
243
|
onChange: PropTypes.func,
|
|
244
|
-
/**
|
|
245
|
-
* @ignore
|
|
246
|
-
*/
|
|
247
|
-
onClick: PropTypes.func,
|
|
248
244
|
/**
|
|
249
245
|
* Callback fired when the error associated to the current value changes.
|
|
250
246
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -225,10 +225,6 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
225
225
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
226
226
|
*/
|
|
227
227
|
onChange: PropTypes.func,
|
|
228
|
-
/**
|
|
229
|
-
* @ignore
|
|
230
|
-
*/
|
|
231
|
-
onClick: PropTypes.func,
|
|
232
228
|
/**
|
|
233
229
|
* Callback fired when the error associated to the current value changes.
|
|
234
230
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -213,6 +213,11 @@ StaticDateRangePicker.propTypes = {
|
|
|
213
213
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
214
214
|
*/
|
|
215
215
|
reduceAnimations: PropTypes.bool,
|
|
216
|
+
/**
|
|
217
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
218
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
219
|
+
*/
|
|
220
|
+
referenceDate: PropTypes.any,
|
|
216
221
|
/**
|
|
217
222
|
* Component displaying when passed `loading` true.
|
|
218
223
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -8,6 +8,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
export const renderDateRangeViewCalendar = ({
|
|
9
9
|
value,
|
|
10
10
|
defaultValue,
|
|
11
|
+
referenceDate,
|
|
11
12
|
onChange,
|
|
12
13
|
className,
|
|
13
14
|
classes,
|
|
@@ -45,6 +46,7 @@ export const renderDateRangeViewCalendar = ({
|
|
|
45
46
|
}) => /*#__PURE__*/_jsx(DateRangeCalendar, {
|
|
46
47
|
value: value,
|
|
47
48
|
defaultValue: defaultValue,
|
|
49
|
+
referenceDate: referenceDate,
|
|
48
50
|
onChange: onChange,
|
|
49
51
|
className: className,
|
|
50
52
|
classes: classes,
|
package/modern/index.js
CHANGED
|
@@ -37,6 +37,7 @@ export const useDesktopRangePicker = _ref => {
|
|
|
37
37
|
reduceAnimations
|
|
38
38
|
} = props;
|
|
39
39
|
const fieldContainerRef = React.useRef(null);
|
|
40
|
+
const anchorRef = React.useRef(null);
|
|
40
41
|
const popperRef = React.useRef(null);
|
|
41
42
|
const {
|
|
42
43
|
rangePosition,
|
|
@@ -102,7 +103,8 @@ export const useDesktopRangePicker = _ref => {
|
|
|
102
103
|
singleInputFieldRef,
|
|
103
104
|
pickerSlotProps: slotProps,
|
|
104
105
|
pickerSlots: slots,
|
|
105
|
-
fieldProps
|
|
106
|
+
fieldProps,
|
|
107
|
+
anchorRef
|
|
106
108
|
});
|
|
107
109
|
const slotPropsForLayout = _extends({}, slotProps, {
|
|
108
110
|
toolbar: _extends({}, slotProps?.toolbar, {
|
|
@@ -115,8 +117,9 @@ export const useDesktopRangePicker = _ref => {
|
|
|
115
117
|
localeText: localeText,
|
|
116
118
|
children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldProps)), /*#__PURE__*/_jsx(PickersPopper, _extends({
|
|
117
119
|
role: "tooltip",
|
|
120
|
+
placement: "bottom-start",
|
|
118
121
|
containerRef: popperRef,
|
|
119
|
-
anchorEl:
|
|
122
|
+
anchorEl: anchorRef.current,
|
|
120
123
|
onBlur: handleBlur
|
|
121
124
|
}, actions, {
|
|
122
125
|
open: open,
|
|
@@ -17,7 +17,8 @@ const useMultiInputFieldSlotProps = ({
|
|
|
17
17
|
localeText: inLocaleText,
|
|
18
18
|
pickerSlotProps,
|
|
19
19
|
pickerSlots,
|
|
20
|
-
fieldProps
|
|
20
|
+
fieldProps,
|
|
21
|
+
anchorRef
|
|
21
22
|
}) => {
|
|
22
23
|
const localeText = useLocaleText();
|
|
23
24
|
const startRef = React.useRef(null);
|
|
@@ -63,7 +64,9 @@ const useMultiInputFieldSlotProps = ({
|
|
|
63
64
|
}, fieldProps.slots);
|
|
64
65
|
const slotProps = _extends({}, fieldProps.slotProps, {
|
|
65
66
|
textField: ownerState => {
|
|
67
|
+
const resolvedComponentProps = resolveComponentProps(pickerSlotProps?.textField, ownerState);
|
|
66
68
|
let inputProps;
|
|
69
|
+
let InputProps;
|
|
67
70
|
if (ownerState.position === 'start') {
|
|
68
71
|
inputProps = _extends({
|
|
69
72
|
inputRef: startRef,
|
|
@@ -76,6 +79,11 @@ const useMultiInputFieldSlotProps = ({
|
|
|
76
79
|
}, wrapperVariant === 'mobile' && {
|
|
77
80
|
readOnly: true
|
|
78
81
|
});
|
|
82
|
+
if (anchorRef) {
|
|
83
|
+
InputProps = _extends({}, resolvedComponentProps?.InputProps, {
|
|
84
|
+
ref: anchorRef
|
|
85
|
+
});
|
|
86
|
+
}
|
|
79
87
|
} else {
|
|
80
88
|
inputProps = _extends({
|
|
81
89
|
inputRef: endRef,
|
|
@@ -91,7 +99,9 @@ const useMultiInputFieldSlotProps = ({
|
|
|
91
99
|
}
|
|
92
100
|
return _extends({}, labelId != null && {
|
|
93
101
|
id: `${labelId}-${ownerState.position}`
|
|
94
|
-
}, inputProps, resolveComponentProps(pickerSlotProps?.textField, ownerState)
|
|
102
|
+
}, inputProps, resolveComponentProps(pickerSlotProps?.textField, ownerState), {
|
|
103
|
+
InputProps
|
|
104
|
+
});
|
|
95
105
|
},
|
|
96
106
|
root: ownerState => {
|
|
97
107
|
const rootProps = {
|
|
@@ -122,7 +132,8 @@ const useSingleInputFieldSlotProps = ({
|
|
|
122
132
|
singleInputFieldRef,
|
|
123
133
|
pickerSlots,
|
|
124
134
|
pickerSlotProps,
|
|
125
|
-
fieldProps
|
|
135
|
+
fieldProps,
|
|
136
|
+
anchorRef
|
|
126
137
|
}) => {
|
|
127
138
|
const inputRef = React.useRef(null);
|
|
128
139
|
const handleInputRef = useForkRef(inInputRef, inputRef);
|
|
@@ -169,6 +180,9 @@ const useSingleInputFieldSlotProps = ({
|
|
|
169
180
|
onKeyDown: onSpaceOrEnter(openPicker, fieldProps.onKeyDown),
|
|
170
181
|
onSelectedSectionsChange: handleSelectedSectionsChange,
|
|
171
182
|
onBlur,
|
|
183
|
+
InputProps: _extends({
|
|
184
|
+
ref: anchorRef
|
|
185
|
+
}, fieldProps?.InputProps),
|
|
172
186
|
focused: open
|
|
173
187
|
}, labelId != null && {
|
|
174
188
|
id: labelId
|