@mui/x-date-pickers 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/AdapterMoment/AdapterMoment.d.ts +5 -0
- package/AdapterMoment/AdapterMoment.js +17 -3
- package/CHANGELOG.md +184 -47
- package/DateField/DateField.js +0 -4
- package/DatePicker/DatePicker.js +5 -0
- package/DateTimeField/DateTimeField.js +0 -4
- package/DateTimePicker/DateTimePicker.js +5 -0
- package/DesktopDatePicker/DesktopDatePicker.js +5 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -0
- package/DesktopTimePicker/DesktopTimePicker.js +5 -0
- package/LocalizationProvider/LocalizationProvider.d.ts +0 -3
- package/LocalizationProvider/LocalizationProvider.js +0 -3
- package/MobileDatePicker/MobileDatePicker.js +5 -0
- package/MobileDateTimePicker/MobileDateTimePicker.js +5 -0
- package/MobileTimePicker/MobileTimePicker.js +5 -0
- package/PickersDay/PickersDay.js +3 -3
- package/README.md +0 -1
- package/StaticDatePicker/StaticDatePicker.js +5 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +5 -0
- package/StaticTimePicker/StaticTimePicker.js +5 -0
- package/TimeField/TimeField.js +0 -4
- package/TimePicker/TimePicker.js +5 -0
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +1 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +3 -0
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.js +2 -0
- package/index.js +1 -1
- package/internals/demo/DemoContainer.d.ts +8 -0
- package/internals/demo/DemoContainer.js +9 -0
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +2 -2
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +2 -2
- package/internals/hooks/usePicker/usePicker.d.ts +1 -1
- package/internals/hooks/usePicker/usePicker.types.d.ts +3 -3
- package/internals/hooks/usePicker/usePickerViews.d.ts +10 -5
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +1 -1
- package/internals/models/props/basePickerProps.d.ts +1 -1
- package/legacy/AdapterMoment/AdapterMoment.js +19 -1
- package/legacy/DateField/DateField.js +0 -4
- package/legacy/DatePicker/DatePicker.js +5 -0
- package/legacy/DateTimeField/DateTimeField.js +0 -4
- package/legacy/DateTimePicker/DateTimePicker.js +5 -0
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +5 -0
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -0
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +5 -0
- package/legacy/LocalizationProvider/LocalizationProvider.js +0 -3
- package/legacy/MobileDatePicker/MobileDatePicker.js +5 -0
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +5 -0
- package/legacy/MobileTimePicker/MobileTimePicker.js +5 -0
- package/legacy/PickersDay/PickersDay.js +3 -3
- package/legacy/StaticDatePicker/StaticDatePicker.js +5 -0
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +5 -0
- package/legacy/StaticTimePicker/StaticTimePicker.js +5 -0
- package/legacy/TimeField/TimeField.js +0 -4
- package/legacy/TimePicker/TimePicker.js +5 -0
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +3 -0
- package/legacy/dateViewRenderers/dateViewRenderers.js +2 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/demo/DemoContainer.js +9 -0
- package/legacy/timeViewRenderers/timeViewRenderers.js +6 -0
- package/modern/AdapterMoment/AdapterMoment.js +16 -3
- package/modern/DateField/DateField.js +0 -4
- package/modern/DatePicker/DatePicker.js +5 -0
- package/modern/DateTimeField/DateTimeField.js +0 -4
- package/modern/DateTimePicker/DateTimePicker.js +5 -0
- package/modern/DesktopDatePicker/DesktopDatePicker.js +5 -0
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -0
- package/modern/DesktopTimePicker/DesktopTimePicker.js +5 -0
- package/modern/LocalizationProvider/LocalizationProvider.js +0 -3
- package/modern/MobileDatePicker/MobileDatePicker.js +5 -0
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +5 -0
- package/modern/MobileTimePicker/MobileTimePicker.js +5 -0
- package/modern/PickersDay/PickersDay.js +3 -3
- package/modern/StaticDatePicker/StaticDatePicker.js +5 -0
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +5 -0
- package/modern/StaticTimePicker/StaticTimePicker.js +5 -0
- package/modern/TimeField/TimeField.js +0 -4
- package/modern/TimePicker/TimePicker.js +5 -0
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +3 -0
- package/modern/dateViewRenderers/dateViewRenderers.js +2 -0
- package/modern/index.js +1 -1
- package/modern/internals/demo/DemoContainer.js +9 -0
- package/modern/timeViewRenderers/timeViewRenderers.js +6 -0
- package/node/AdapterMoment/AdapterMoment.js +16 -3
- package/node/DateField/DateField.js +0 -4
- package/node/DatePicker/DatePicker.js +5 -0
- package/node/DateTimeField/DateTimeField.js +0 -4
- package/node/DateTimePicker/DateTimePicker.js +5 -0
- package/node/DesktopDatePicker/DesktopDatePicker.js +5 -0
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +5 -0
- package/node/DesktopTimePicker/DesktopTimePicker.js +5 -0
- package/node/LocalizationProvider/LocalizationProvider.js +0 -3
- package/node/MobileDatePicker/MobileDatePicker.js +5 -0
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +5 -0
- package/node/MobileTimePicker/MobileTimePicker.js +5 -0
- package/node/PickersDay/PickersDay.js +3 -3
- package/node/StaticDatePicker/StaticDatePicker.js +5 -0
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +5 -0
- package/node/StaticTimePicker/StaticTimePicker.js +5 -0
- package/node/TimeField/TimeField.js +0 -4
- package/node/TimePicker/TimePicker.js +5 -0
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +3 -0
- package/node/dateViewRenderers/dateViewRenderers.js +2 -0
- package/node/index.js +1 -1
- package/node/internals/demo/DemoContainer.js +9 -0
- package/node/timeViewRenderers/timeViewRenderers.js +6 -0
- package/package.json +4 -4
- package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
- package/timeViewRenderers/timeViewRenderers.js +6 -0
|
@@ -180,6 +180,11 @@ StaticTimePicker.propTypes = {
|
|
|
180
180
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
181
181
|
*/
|
|
182
182
|
reduceAnimations: PropTypes.bool,
|
|
183
|
+
/**
|
|
184
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
185
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
186
|
+
*/
|
|
187
|
+
referenceDate: PropTypes.any,
|
|
183
188
|
/**
|
|
184
189
|
* Disable specific clock time.
|
|
185
190
|
* @param {number} clockValue The value to check.
|
package/TimeField/TimeField.js
CHANGED
|
@@ -225,10 +225,6 @@ process.env.NODE_ENV !== "production" ? TimeField.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.
|
package/TimePicker/TimePicker.js
CHANGED
|
@@ -218,6 +218,11 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
218
218
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
219
219
|
*/
|
|
220
220
|
reduceAnimations: PropTypes.bool,
|
|
221
|
+
/**
|
|
222
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
223
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
224
|
+
*/
|
|
225
|
+
referenceDate: PropTypes.any,
|
|
221
226
|
/**
|
|
222
227
|
* The currently selected sections.
|
|
223
228
|
* This prop accept four formats:
|
|
@@ -10,4 +10,4 @@ export interface DateTimeViewRendererProps<TDate> extends Omit<DateCalendarProps
|
|
|
10
10
|
focusedView: DateOrTimeViewWithMeridiem | null;
|
|
11
11
|
timeViewsCount: number;
|
|
12
12
|
}
|
|
13
|
-
export declare const renderDesktopDateTimeView: <TDate extends unknown>({ view, onViewChange, views, focusedView, onFocusedViewChange, value, defaultValue, onChange, className, classes, disableFuture, disablePast, minDate, minTime, maxDate, maxTime, shouldDisableDate, shouldDisableMonth, shouldDisableYear, shouldDisableTime, shouldDisableClock, reduceAnimations, minutesStep, ampm, onMonthChange, monthsPerRow, onYearChange, yearsPerRow, defaultCalendarMonth, components, componentsProps, slots, slotProps, loading, renderLoading, disableHighlightToday, readOnly, disabled, showDaysOutsideCurrentMonth, dayOfWeekFormatter, sx, autoFocus, fixedWeekNumber, displayWeekNumber, timezone, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timeViewsCount, }: DateTimeViewRendererProps<TDate>) => React.JSX.Element;
|
|
13
|
+
export declare const renderDesktopDateTimeView: <TDate extends unknown>({ view, onViewChange, views, focusedView, onFocusedViewChange, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minDate, minTime, maxDate, maxTime, shouldDisableDate, shouldDisableMonth, shouldDisableYear, shouldDisableTime, shouldDisableClock, reduceAnimations, minutesStep, ampm, onMonthChange, monthsPerRow, onYearChange, yearsPerRow, defaultCalendarMonth, components, componentsProps, slots, slotProps, loading, renderLoading, disableHighlightToday, readOnly, disabled, showDaysOutsideCurrentMonth, dayOfWeekFormatter, sx, autoFocus, fixedWeekNumber, displayWeekNumber, timezone, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timeViewsCount, }: DateTimeViewRendererProps<TDate>) => React.JSX.Element;
|
|
@@ -17,6 +17,7 @@ export const renderDesktopDateTimeView = ({
|
|
|
17
17
|
onFocusedViewChange,
|
|
18
18
|
value,
|
|
19
19
|
defaultValue,
|
|
20
|
+
referenceDate,
|
|
20
21
|
onChange,
|
|
21
22
|
className,
|
|
22
23
|
classes,
|
|
@@ -72,6 +73,7 @@ export const renderDesktopDateTimeView = ({
|
|
|
72
73
|
onFocusedViewChange: onFocusedViewChange,
|
|
73
74
|
value: value,
|
|
74
75
|
defaultValue: defaultValue,
|
|
76
|
+
referenceDate: referenceDate,
|
|
75
77
|
onChange: onChange,
|
|
76
78
|
className: className,
|
|
77
79
|
classes: classes,
|
|
@@ -115,6 +117,7 @@ export const renderDesktopDateTimeView = ({
|
|
|
115
117
|
views: views.filter(isInternalTimeView),
|
|
116
118
|
value: value,
|
|
117
119
|
defaultValue: defaultValue,
|
|
120
|
+
referenceDate: referenceDate,
|
|
118
121
|
onChange: onChange,
|
|
119
122
|
className: className,
|
|
120
123
|
classes: classes,
|
|
@@ -8,4 +8,4 @@ export interface DateViewRendererProps<TDate, TView extends DateOrTimeViewWithMe
|
|
|
8
8
|
views: readonly TView[];
|
|
9
9
|
focusedView: TView | null;
|
|
10
10
|
}
|
|
11
|
-
export declare const renderDateViewCalendar: <TDate extends unknown>({ view, onViewChange, views, focusedView, onFocusedViewChange, value, defaultValue, onChange, className, classes, disableFuture, disablePast, minDate, maxDate, shouldDisableDate, shouldDisableMonth, shouldDisableYear, reduceAnimations, onMonthChange, monthsPerRow, onYearChange, yearsPerRow, defaultCalendarMonth, components, componentsProps, slots, slotProps, loading, renderLoading, disableHighlightToday, readOnly, disabled, showDaysOutsideCurrentMonth, dayOfWeekFormatter, sx, autoFocus, fixedWeekNumber, displayWeekNumber, timezone, }: DateViewRendererProps<TDate, DateView>) => React.JSX.Element;
|
|
11
|
+
export declare const renderDateViewCalendar: <TDate extends unknown>({ view, onViewChange, views, focusedView, onFocusedViewChange, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minDate, maxDate, shouldDisableDate, shouldDisableMonth, shouldDisableYear, reduceAnimations, onMonthChange, monthsPerRow, onYearChange, yearsPerRow, defaultCalendarMonth, components, componentsProps, slots, slotProps, loading, renderLoading, disableHighlightToday, readOnly, disabled, showDaysOutsideCurrentMonth, dayOfWeekFormatter, sx, autoFocus, fixedWeekNumber, displayWeekNumber, timezone, }: DateViewRendererProps<TDate, DateView>) => React.JSX.Element;
|
|
@@ -10,6 +10,7 @@ export const renderDateViewCalendar = ({
|
|
|
10
10
|
onFocusedViewChange,
|
|
11
11
|
value,
|
|
12
12
|
defaultValue,
|
|
13
|
+
referenceDate,
|
|
13
14
|
onChange,
|
|
14
15
|
className,
|
|
15
16
|
classes,
|
|
@@ -50,6 +51,7 @@ export const renderDateViewCalendar = ({
|
|
|
50
51
|
onFocusedViewChange: onFocusedViewChange,
|
|
51
52
|
value: value,
|
|
52
53
|
defaultValue: defaultValue,
|
|
54
|
+
referenceDate: referenceDate,
|
|
53
55
|
onChange: onChange,
|
|
54
56
|
className: className,
|
|
55
57
|
classes: classes,
|
package/index.js
CHANGED
|
@@ -10,6 +10,14 @@ interface DemoItemProps {
|
|
|
10
10
|
component?: string;
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
15
|
+
* Please do not use it in your application.
|
|
16
|
+
*/
|
|
13
17
|
export declare function DemoItem(props: DemoItemProps): React.JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
20
|
+
* Please do not use it in your application.
|
|
21
|
+
*/
|
|
14
22
|
export declare function DemoContainer(props: DemoGridProps): React.JSX.Element;
|
|
15
23
|
export {};
|
|
@@ -32,6 +32,10 @@ const getSupportedSectionFromChildName = childName => {
|
|
|
32
32
|
}
|
|
33
33
|
return 'time';
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
37
|
+
* Please do not use it in your application.
|
|
38
|
+
*/
|
|
35
39
|
export function DemoItem(props) {
|
|
36
40
|
const {
|
|
37
41
|
label,
|
|
@@ -62,6 +66,11 @@ export function DemoItem(props) {
|
|
|
62
66
|
}), children]
|
|
63
67
|
});
|
|
64
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
72
|
+
* Please do not use it in your application.
|
|
73
|
+
*/
|
|
65
74
|
export function DemoContainer(props) {
|
|
66
75
|
const {
|
|
67
76
|
children,
|
|
@@ -41,7 +41,7 @@ export interface UseDesktopPickerSlotsComponent<TDate, TView extends DateOrTimeV
|
|
|
41
41
|
export interface UseDesktopPickerSlotsComponentsProps<TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedUseDesktopPickerSlotsComponentsProps<TDate, TView>, Pick<PickersLayoutSlotsComponentsProps<TDate | null, TDate, TView>, 'toolbar'> {
|
|
42
42
|
}
|
|
43
43
|
export interface ExportedUseDesktopPickerSlotsComponentsProps<TDate, TView extends DateOrTimeViewWithMeridiem> extends PickersPopperSlotsComponentsProps, ExportedPickersLayoutSlotsComponentsProps<TDate | null, TDate, TView> {
|
|
44
|
-
field?: SlotComponentProps<React.ElementType<BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, unknown>>, {}, UsePickerProps<TDate | null, any, FieldSection, any, any, any>>;
|
|
44
|
+
field?: SlotComponentProps<React.ElementType<BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, unknown>>, {}, UsePickerProps<TDate | null, TDate, any, FieldSection, any, any, any>>;
|
|
45
45
|
textField?: SlotComponentProps<typeof TextField, {}, Record<string, any>>;
|
|
46
46
|
inputAdornment?: Partial<InputAdornmentProps>;
|
|
47
47
|
openPickerButton?: SlotComponentProps<typeof IconButton, {}, UseDesktopPickerProps<TDate, any, any, any>>;
|
|
@@ -53,7 +53,7 @@ export interface DesktopOnlyPickerProps<TDate> extends BaseNonStaticPickerProps,
|
|
|
53
53
|
*/
|
|
54
54
|
autoFocus?: boolean;
|
|
55
55
|
}
|
|
56
|
-
export interface UseDesktopPickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends BasePickerProps<TDate | null, TDate, TView, TError, TExternalProps, {}>, DesktopOnlyPickerProps<TDate> {
|
|
56
|
+
export interface UseDesktopPickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<any, any, TView, any, any>> extends BasePickerProps<TDate | null, TDate, TView, TError, TExternalProps, {}>, DesktopOnlyPickerProps<TDate> {
|
|
57
57
|
/**
|
|
58
58
|
* Overridable component slots.
|
|
59
59
|
* @default {}
|
|
@@ -23,14 +23,14 @@ export interface UseMobilePickerSlotsComponent<TDate, TView extends DateOrTimeVi
|
|
|
23
23
|
TextField?: React.ElementType<TextFieldProps>;
|
|
24
24
|
}
|
|
25
25
|
export interface ExportedUseMobilePickerSlotsComponentsProps<TDate, TView extends DateOrTimeViewWithMeridiem> extends PickersModalDialogSlotsComponentsProps, ExportedPickersLayoutSlotsComponentsProps<TDate | null, TDate, TView> {
|
|
26
|
-
field?: SlotComponentProps<React.ElementType<BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, unknown>>, {}, UsePickerProps<TDate | null, any, FieldSection, any, any, any>>;
|
|
26
|
+
field?: SlotComponentProps<React.ElementType<BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, unknown>>, {}, UsePickerProps<TDate | null, TDate, any, FieldSection, any, any, any>>;
|
|
27
27
|
textField?: SlotComponentProps<typeof TextField, {}, Record<string, any>>;
|
|
28
28
|
}
|
|
29
29
|
export interface UseMobilePickerSlotsComponentsProps<TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedUseMobilePickerSlotsComponentsProps<TDate, TView>, Pick<PickersLayoutSlotsComponentsProps<TDate | null, TDate, TView>, 'toolbar'> {
|
|
30
30
|
}
|
|
31
31
|
export interface MobileOnlyPickerProps<TDate> extends BaseNonStaticPickerProps, BaseNonRangeNonStaticPickerProps, UsePickerValueNonStaticProps<TDate | null, FieldSection>, UsePickerViewsNonStaticProps {
|
|
32
32
|
}
|
|
33
|
-
export interface UseMobilePickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends BasePickerProps<TDate | null, TDate, TView, TError, TExternalProps, {}>, MobileOnlyPickerProps<TDate> {
|
|
33
|
+
export interface UseMobilePickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<any, any, TView, any, any>> extends BasePickerProps<TDate | null, TDate, TView, TError, TExternalProps, {}>, MobileOnlyPickerProps<TDate> {
|
|
34
34
|
/**
|
|
35
35
|
* Overridable component slots.
|
|
36
36
|
* @default {}
|
|
@@ -2,4 +2,4 @@ import { UsePickerParams, UsePickerProps, UsePickerResponse } from './usePicker.
|
|
|
2
2
|
import { InferError } from '../useValidation';
|
|
3
3
|
import { FieldSection } from '../../../models';
|
|
4
4
|
import { DateOrTimeViewWithMeridiem } from '../../models';
|
|
5
|
-
export declare const usePicker: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TView, TSection, any, any, any>, TAdditionalProps extends {}>({ props, valueManager, valueType, wrapperVariant, inputRef, additionalViewProps, validator, autoFocusView, }: UsePickerParams<TValue, TDate, TView, TSection, TExternalProps, TAdditionalProps>) => UsePickerResponse<TValue, TView, TSection, InferError<TExternalProps>>;
|
|
5
|
+
export declare const usePicker: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, TSection, any, any, any>, TAdditionalProps extends {}>({ props, valueManager, valueType, wrapperVariant, inputRef, additionalViewProps, validator, autoFocusView, }: UsePickerParams<TValue, TDate, TView, TSection, TExternalProps, TAdditionalProps>) => UsePickerResponse<TValue, TView, TSection, InferError<TExternalProps>>;
|
|
@@ -6,11 +6,11 @@ import { DateOrTimeViewWithMeridiem } from '../../models';
|
|
|
6
6
|
/**
|
|
7
7
|
* Props common to all picker headless implementations.
|
|
8
8
|
*/
|
|
9
|
-
export interface UsePickerBaseProps<TValue, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueBaseProps<TValue, TError>, UsePickerViewsBaseProps<TValue, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
|
|
9
|
+
export interface UsePickerBaseProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueBaseProps<TValue, TError>, UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
|
|
10
10
|
}
|
|
11
|
-
export interface UsePickerProps<TValue, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TError, TExternalProps extends UsePickerViewsProps<TValue, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueProps<TValue, TSection, TError>, UsePickerViewsProps<TValue, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
|
|
11
|
+
export interface UsePickerProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerValueProps<TValue, TSection, TError>, UsePickerViewsProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerLayoutProps {
|
|
12
12
|
}
|
|
13
|
-
export interface UsePickerParams<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TView, TSection, any, any, any>, TAdditionalProps extends {}> extends Pick<UsePickerValueParams<TValue, TDate, TSection, TExternalProps>, 'valueManager' | 'valueType' | 'wrapperVariant' | 'validator'>, Pick<UsePickerViewParams<TValue, TView, TExternalProps, TAdditionalProps>, 'additionalViewProps' | 'inputRef' | 'autoFocusView'> {
|
|
13
|
+
export interface UsePickerParams<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TExternalProps extends UsePickerProps<TValue, TDate, TView, TSection, any, any, any>, TAdditionalProps extends {}> extends Pick<UsePickerValueParams<TValue, TDate, TSection, TExternalProps>, 'valueManager' | 'valueType' | 'wrapperVariant' | 'validator'>, Pick<UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>, 'additionalViewProps' | 'inputRef' | 'autoFocusView'> {
|
|
14
14
|
props: TExternalProps;
|
|
15
15
|
}
|
|
16
16
|
export interface UsePickerResponse<TValue, TView extends DateOrTimeViewWithMeridiem, TSection extends FieldSection, TError> extends Omit<UsePickerValueResponse<TValue, TSection, TError>, 'viewProps' | 'layoutProps'>, Omit<UsePickerViewsResponse<TView>, 'layoutProps'>, UsePickerLayoutPropsResponse<TValue, TView> {
|
|
@@ -5,7 +5,7 @@ import { UseViewsOptions } from '../useViews';
|
|
|
5
5
|
import type { UsePickerValueViewsResponse } from './usePickerValue.types';
|
|
6
6
|
import { DateOrTimeViewWithMeridiem } from '../../models';
|
|
7
7
|
import { TimezoneProps } from '../../../models';
|
|
8
|
-
interface PickerViewsRendererBaseExternalProps<TView extends DateOrTimeViewWithMeridiem> extends Omit<UsePickerViewsProps<any, TView, any, any>, 'openTo' | 'viewRenderers'> {
|
|
8
|
+
interface PickerViewsRendererBaseExternalProps<TView extends DateOrTimeViewWithMeridiem> extends Omit<UsePickerViewsProps<any, any, TView, any, any>, 'openTo' | 'viewRenderers'> {
|
|
9
9
|
}
|
|
10
10
|
export type PickerViewsRendererProps<TValue, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends PickerViewsRendererBaseExternalProps<TView>, TAdditionalProps extends {}> = TExternalProps & TAdditionalProps & UsePickerValueViewsResponse<TValue> & {
|
|
11
11
|
view: TView;
|
|
@@ -20,7 +20,7 @@ export type PickerViewRendererLookup<TValue, TView extends DateOrTimeViewWithMer
|
|
|
20
20
|
/**
|
|
21
21
|
* Props used to handle the views that are common to all pickers.
|
|
22
22
|
*/
|
|
23
|
-
export interface UsePickerViewsBaseProps<TValue, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TView, any, any>, TAdditionalProps extends {}> extends Omit<UseViewsOptions<any, TView>, 'onChange' | 'onFocusedViewChange' | 'focusedView'>, TimezoneProps {
|
|
23
|
+
export interface UsePickerViewsBaseProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends Omit<UseViewsOptions<any, TView>, 'onChange' | 'onFocusedViewChange' | 'focusedView'>, TimezoneProps {
|
|
24
24
|
/**
|
|
25
25
|
* If `true`, the picker and text field are disabled.
|
|
26
26
|
* @default false
|
|
@@ -36,6 +36,11 @@ export interface UsePickerViewsBaseProps<TValue, TView extends DateOrTimeViewWit
|
|
|
36
36
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
37
37
|
*/
|
|
38
38
|
reduceAnimations?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
41
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
42
|
+
*/
|
|
43
|
+
referenceDate?: TDate;
|
|
39
44
|
}
|
|
40
45
|
/**
|
|
41
46
|
* Props used to handle the views of the pickers.
|
|
@@ -50,11 +55,11 @@ export interface UsePickerViewsNonStaticProps {
|
|
|
50
55
|
/**
|
|
51
56
|
* Props used to handle the value of the pickers.
|
|
52
57
|
*/
|
|
53
|
-
export interface UsePickerViewsProps<TValue, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TView, any, any>, TAdditionalProps extends {}> extends UsePickerViewsBaseProps<TValue, TView, TExternalProps, TAdditionalProps>, UsePickerViewsNonStaticProps {
|
|
58
|
+
export interface UsePickerViewsProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerViewsNonStaticProps {
|
|
54
59
|
className?: string;
|
|
55
60
|
sx?: SxProps<Theme>;
|
|
56
61
|
}
|
|
57
|
-
export interface UsePickerViewParams<TValue, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TView, TExternalProps, TAdditionalProps>, TAdditionalProps extends {}> {
|
|
62
|
+
export interface UsePickerViewParams<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, TAdditionalProps extends {}> {
|
|
58
63
|
props: TExternalProps;
|
|
59
64
|
propsFromPickerValue: UsePickerValueViewsResponse<TValue>;
|
|
60
65
|
additionalViewProps: TAdditionalProps;
|
|
@@ -82,5 +87,5 @@ export interface UsePickerViewsLayoutResponse<TView extends DateOrTimeViewWithMe
|
|
|
82
87
|
* - Handles the switch between UI views and field views
|
|
83
88
|
* - Handles the focus management when switching views
|
|
84
89
|
*/
|
|
85
|
-
export declare const usePickerViews: <TValue, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TView, any, any>, TAdditionalProps extends {}>({ props, propsFromPickerValue, additionalViewProps, inputRef, autoFocusView, }: UsePickerViewParams<TValue, TView, TExternalProps, TAdditionalProps>) => UsePickerViewsResponse<TView>;
|
|
90
|
+
export declare const usePickerViews: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}>({ props, propsFromPickerValue, additionalViewProps, inputRef, autoFocusView, }: UsePickerViewParams<TValue, TDate, TView, TExternalProps, TAdditionalProps>) => UsePickerViewsResponse<TView>;
|
|
86
91
|
export {};
|
|
@@ -27,7 +27,7 @@ export interface StaticOnlyPickerProps {
|
|
|
27
27
|
*/
|
|
28
28
|
onClose?: () => void;
|
|
29
29
|
}
|
|
30
|
-
export interface UseStaticPickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TDate | null, TView, any, any>> extends BasePickerProps<TDate | null, TDate, TView, TError, TExternalProps, {}>, StaticOnlyPickerProps {
|
|
30
|
+
export interface UseStaticPickerProps<TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TDate | null, TDate, TView, any, any>> extends BasePickerProps<TDate | null, TDate, TView, TError, TExternalProps, {}>, StaticOnlyPickerProps {
|
|
31
31
|
/**
|
|
32
32
|
* Overridable components.
|
|
33
33
|
* @default {}
|
|
@@ -9,7 +9,7 @@ import { DateOrTimeViewWithMeridiem } from '../common';
|
|
|
9
9
|
/**
|
|
10
10
|
* Props common to all pickers after applying the default props on each picker.
|
|
11
11
|
*/
|
|
12
|
-
export interface BasePickerProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TView, any, any>, TAdditionalProps extends {}> extends UsePickerBaseProps<TValue, TView, TError, TExternalProps, TAdditionalProps> {
|
|
12
|
+
export interface BasePickerProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerBaseProps<TValue, TDate, TView, TError, TExternalProps, TAdditionalProps> {
|
|
13
13
|
/**
|
|
14
14
|
* Class name applied to the root element.
|
|
15
15
|
*/
|
|
@@ -181,6 +181,22 @@ export var AdapterMoment = /*#__PURE__*/_createClass(function AdapterMoment() {
|
|
|
181
181
|
}
|
|
182
182
|
return value.locale(expectedLocale);
|
|
183
183
|
};
|
|
184
|
+
/**
|
|
185
|
+
* Some methods from moment can't take the locale as a parameter and always use the current locale.
|
|
186
|
+
* To respect the adapter locale, we need to set it as the current locale and then reset the previous locale.
|
|
187
|
+
*/
|
|
188
|
+
this.syncMomentLocale = function (runner) {
|
|
189
|
+
var _this$locale;
|
|
190
|
+
var momentLocale = defaultMoment.locale();
|
|
191
|
+
var adapterLocale = (_this$locale = _this.locale) != null ? _this$locale : 'en-us';
|
|
192
|
+
if (momentLocale !== adapterLocale) {
|
|
193
|
+
defaultMoment.locale(adapterLocale);
|
|
194
|
+
var result = runner();
|
|
195
|
+
defaultMoment.locale(momentLocale);
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
return runner();
|
|
199
|
+
};
|
|
184
200
|
this.hasTimezonePlugin = function () {
|
|
185
201
|
return typeof _this.moment.tz !== 'undefined';
|
|
186
202
|
};
|
|
@@ -478,7 +494,9 @@ export var AdapterMoment = /*#__PURE__*/_createClass(function AdapterMoment() {
|
|
|
478
494
|
return dateParam.clone().hour(timeParam.hour()).minute(timeParam.minute()).second(timeParam.second());
|
|
479
495
|
};
|
|
480
496
|
this.getWeekdays = function () {
|
|
481
|
-
return
|
|
497
|
+
return _this.syncMomentLocale(function () {
|
|
498
|
+
return defaultMoment.weekdaysShort(true);
|
|
499
|
+
});
|
|
482
500
|
};
|
|
483
501
|
this.getWeekArray = function (value) {
|
|
484
502
|
var cleanValue = _this.setLocaleToValue(value);
|
|
@@ -202,10 +202,6 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
202
202
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
203
203
|
*/
|
|
204
204
|
onChange: PropTypes.func,
|
|
205
|
-
/**
|
|
206
|
-
* @ignore
|
|
207
|
-
*/
|
|
208
|
-
onClick: PropTypes.func,
|
|
209
205
|
/**
|
|
210
206
|
* Callback fired when the error associated to the current value changes.
|
|
211
207
|
* @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.
|
|
@@ -244,6 +244,11 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
244
244
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
245
245
|
*/
|
|
246
246
|
reduceAnimations: PropTypes.bool,
|
|
247
|
+
/**
|
|
248
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
249
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
250
|
+
*/
|
|
251
|
+
referenceDate: PropTypes.any,
|
|
247
252
|
/**
|
|
248
253
|
* Component displaying when passed `loading` true.
|
|
249
254
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -235,10 +235,6 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
235
235
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
236
236
|
*/
|
|
237
237
|
onChange: PropTypes.func,
|
|
238
|
-
/**
|
|
239
|
-
* @ignore
|
|
240
|
-
*/
|
|
241
|
-
onClick: PropTypes.func,
|
|
242
238
|
/**
|
|
243
239
|
* Callback fired when the error associated to the current value changes.
|
|
244
240
|
* @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.
|
|
@@ -282,6 +282,11 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
282
282
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
283
283
|
*/
|
|
284
284
|
reduceAnimations: PropTypes.bool,
|
|
285
|
+
/**
|
|
286
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
287
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
288
|
+
*/
|
|
289
|
+
referenceDate: PropTypes.any,
|
|
285
290
|
/**
|
|
286
291
|
* Component displaying when passed `loading` true.
|
|
287
292
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -262,6 +262,11 @@ DesktopDatePicker.propTypes = {
|
|
|
262
262
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
263
263
|
*/
|
|
264
264
|
reduceAnimations: PropTypes.bool,
|
|
265
|
+
/**
|
|
266
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
267
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
268
|
+
*/
|
|
269
|
+
referenceDate: PropTypes.any,
|
|
265
270
|
/**
|
|
266
271
|
* Component displaying when passed `loading` true.
|
|
267
272
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -337,6 +337,11 @@ DesktopDateTimePicker.propTypes = {
|
|
|
337
337
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
338
338
|
*/
|
|
339
339
|
reduceAnimations: PropTypes.bool,
|
|
340
|
+
/**
|
|
341
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
342
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
343
|
+
*/
|
|
344
|
+
referenceDate: PropTypes.any,
|
|
340
345
|
/**
|
|
341
346
|
* Component displaying when passed `loading` true.
|
|
342
347
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -259,6 +259,11 @@ DesktopTimePicker.propTypes = {
|
|
|
259
259
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
260
260
|
*/
|
|
261
261
|
reduceAnimations: PropTypes.bool,
|
|
262
|
+
/**
|
|
263
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
264
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
265
|
+
*/
|
|
266
|
+
referenceDate: PropTypes.any,
|
|
262
267
|
/**
|
|
263
268
|
* The currently selected sections.
|
|
264
269
|
* This prop accept four formats:
|
|
@@ -9,9 +9,6 @@ export var MuiPickersAdapterContext = /*#__PURE__*/React.createContext(null);
|
|
|
9
9
|
if (process.env.NODE_ENV !== 'production') {
|
|
10
10
|
MuiPickersAdapterContext.displayName = 'MuiPickersAdapterContext';
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
* @ignore - do not document.
|
|
14
|
-
*/
|
|
15
12
|
export var LocalizationProvider = function LocalizationProvider(inProps) {
|
|
16
13
|
var _React$useContext;
|
|
17
14
|
var inLocaleText = inProps.localeText,
|
|
@@ -259,6 +259,11 @@ MobileDatePicker.propTypes = {
|
|
|
259
259
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
260
260
|
*/
|
|
261
261
|
reduceAnimations: PropTypes.bool,
|
|
262
|
+
/**
|
|
263
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
264
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
265
|
+
*/
|
|
266
|
+
referenceDate: PropTypes.any,
|
|
262
267
|
/**
|
|
263
268
|
* Component displaying when passed `loading` true.
|
|
264
269
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -308,6 +308,11 @@ MobileDateTimePicker.propTypes = {
|
|
|
308
308
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
309
309
|
*/
|
|
310
310
|
reduceAnimations: PropTypes.bool,
|
|
311
|
+
/**
|
|
312
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
313
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
314
|
+
*/
|
|
315
|
+
referenceDate: PropTypes.any,
|
|
311
316
|
/**
|
|
312
317
|
* Component displaying when passed `loading` true.
|
|
313
318
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -236,6 +236,11 @@ MobileTimePicker.propTypes = {
|
|
|
236
236
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
237
237
|
*/
|
|
238
238
|
reduceAnimations: PropTypes.bool,
|
|
239
|
+
/**
|
|
240
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
241
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
242
|
+
*/
|
|
243
|
+
referenceDate: PropTypes.any,
|
|
239
244
|
/**
|
|
240
245
|
* The currently selected sections.
|
|
241
246
|
* This prop accept four formats:
|
|
@@ -39,6 +39,9 @@ var styleArg = function styleArg(_ref) {
|
|
|
39
39
|
padding: 0,
|
|
40
40
|
// explicitly setting to `transparent` to avoid potentially getting impacted by change from the overridden component
|
|
41
41
|
backgroundColor: 'transparent',
|
|
42
|
+
transition: theme.transitions.create('background-color', {
|
|
43
|
+
duration: theme.transitions.duration.short
|
|
44
|
+
}),
|
|
42
45
|
color: (theme.vars || theme).palette.text.primary,
|
|
43
46
|
'@media (pointer: fine)': {
|
|
44
47
|
'&:hover': {
|
|
@@ -55,9 +58,6 @@ var styleArg = function styleArg(_ref) {
|
|
|
55
58
|
color: (theme.vars || theme).palette.primary.contrastText,
|
|
56
59
|
backgroundColor: (theme.vars || theme).palette.primary.main,
|
|
57
60
|
fontWeight: theme.typography.fontWeightMedium,
|
|
58
|
-
transition: theme.transitions.create('background-color', {
|
|
59
|
-
duration: theme.transitions.duration.short
|
|
60
|
-
}),
|
|
61
61
|
'&:hover': {
|
|
62
62
|
willChange: 'background-color',
|
|
63
63
|
backgroundColor: (theme.vars || theme).palette.primary.dark
|
|
@@ -204,6 +204,11 @@ StaticDatePicker.propTypes = {
|
|
|
204
204
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
205
205
|
*/
|
|
206
206
|
reduceAnimations: PropTypes.bool,
|
|
207
|
+
/**
|
|
208
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
209
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
210
|
+
*/
|
|
211
|
+
referenceDate: PropTypes.any,
|
|
207
212
|
/**
|
|
208
213
|
* Component displaying when passed `loading` true.
|
|
209
214
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -252,6 +252,11 @@ StaticDateTimePicker.propTypes = {
|
|
|
252
252
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
253
253
|
*/
|
|
254
254
|
reduceAnimations: PropTypes.bool,
|
|
255
|
+
/**
|
|
256
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
257
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
258
|
+
*/
|
|
259
|
+
referenceDate: PropTypes.any,
|
|
255
260
|
/**
|
|
256
261
|
* Component displaying when passed `loading` true.
|
|
257
262
|
* @returns {React.ReactNode} The node to render when loading.
|
|
@@ -179,6 +179,11 @@ StaticTimePicker.propTypes = {
|
|
|
179
179
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
180
180
|
*/
|
|
181
181
|
reduceAnimations: PropTypes.bool,
|
|
182
|
+
/**
|
|
183
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
184
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
185
|
+
*/
|
|
186
|
+
referenceDate: PropTypes.any,
|
|
182
187
|
/**
|
|
183
188
|
* Disable specific clock time.
|
|
184
189
|
* @param {number} clockValue The value to check.
|
|
@@ -219,10 +219,6 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
219
219
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
220
220
|
*/
|
|
221
221
|
onChange: PropTypes.func,
|
|
222
|
-
/**
|
|
223
|
-
* @ignore
|
|
224
|
-
*/
|
|
225
|
-
onClick: PropTypes.func,
|
|
226
222
|
/**
|
|
227
223
|
* Callback fired when the error associated to the current value changes.
|
|
228
224
|
* @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.
|
|
@@ -217,6 +217,11 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
217
217
|
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
|
|
218
218
|
*/
|
|
219
219
|
reduceAnimations: PropTypes.bool,
|
|
220
|
+
/**
|
|
221
|
+
* The date used to generate the new value when both `value` and `defaultValue` are empty.
|
|
222
|
+
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
223
|
+
*/
|
|
224
|
+
referenceDate: PropTypes.any,
|
|
220
225
|
/**
|
|
221
226
|
* The currently selected sections.
|
|
222
227
|
* This prop accept four formats:
|
|
@@ -19,6 +19,7 @@ export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref)
|
|
|
19
19
|
onFocusedViewChange = _ref.onFocusedViewChange,
|
|
20
20
|
value = _ref.value,
|
|
21
21
|
defaultValue = _ref.defaultValue,
|
|
22
|
+
referenceDate = _ref.referenceDate,
|
|
22
23
|
onChange = _ref.onChange,
|
|
23
24
|
className = _ref.className,
|
|
24
25
|
classes = _ref.classes,
|
|
@@ -72,6 +73,7 @@ export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref)
|
|
|
72
73
|
onFocusedViewChange: onFocusedViewChange,
|
|
73
74
|
value: value,
|
|
74
75
|
defaultValue: defaultValue,
|
|
76
|
+
referenceDate: referenceDate,
|
|
75
77
|
onChange: onChange,
|
|
76
78
|
className: className,
|
|
77
79
|
classes: classes,
|
|
@@ -115,6 +117,7 @@ export var renderDesktopDateTimeView = function renderDesktopDateTimeView(_ref)
|
|
|
115
117
|
views: views.filter(isInternalTimeView),
|
|
116
118
|
value: value,
|
|
117
119
|
defaultValue: defaultValue,
|
|
120
|
+
referenceDate: referenceDate,
|
|
118
121
|
onChange: onChange,
|
|
119
122
|
className: className,
|
|
120
123
|
classes: classes,
|
|
@@ -10,6 +10,7 @@ export var renderDateViewCalendar = function renderDateViewCalendar(_ref) {
|
|
|
10
10
|
onFocusedViewChange = _ref.onFocusedViewChange,
|
|
11
11
|
value = _ref.value,
|
|
12
12
|
defaultValue = _ref.defaultValue,
|
|
13
|
+
referenceDate = _ref.referenceDate,
|
|
13
14
|
onChange = _ref.onChange,
|
|
14
15
|
className = _ref.className,
|
|
15
16
|
classes = _ref.classes,
|
|
@@ -50,6 +51,7 @@ export var renderDateViewCalendar = function renderDateViewCalendar(_ref) {
|
|
|
50
51
|
onFocusedViewChange: onFocusedViewChange,
|
|
51
52
|
value: value,
|
|
52
53
|
defaultValue: defaultValue,
|
|
54
|
+
referenceDate: referenceDate,
|
|
53
55
|
onChange: onChange,
|
|
54
56
|
className: className,
|
|
55
57
|
classes: classes,
|
package/legacy/index.js
CHANGED
|
@@ -33,6 +33,10 @@ var getSupportedSectionFromChildName = function getSupportedSectionFromChildName
|
|
|
33
33
|
}
|
|
34
34
|
return 'time';
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
38
|
+
* Please do not use it in your application.
|
|
39
|
+
*/
|
|
36
40
|
export function DemoItem(props) {
|
|
37
41
|
var label = props.label,
|
|
38
42
|
children = props.children,
|
|
@@ -59,6 +63,11 @@ export function DemoItem(props) {
|
|
|
59
63
|
}), children]
|
|
60
64
|
});
|
|
61
65
|
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* WARNING: This is an internal component used in documentation to achieve a desired layout.
|
|
69
|
+
* Please do not use it in your application.
|
|
70
|
+
*/
|
|
62
71
|
export function DemoContainer(props) {
|
|
63
72
|
var children = props.children,
|
|
64
73
|
components = props.components,
|