@mui/x-date-pickers-pro 7.0.0-alpha.7 → 7.0.0-alpha.9
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/AdapterDateFnsV3/index.d.ts +1 -0
- package/AdapterDateFnsV3/index.js +1 -0
- package/AdapterDateFnsV3/package.json +6 -0
- package/CHANGELOG.md +554 -51
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +2 -1
- package/DateRangeCalendar/useDragRange.d.ts +1 -1
- package/DateRangePicker/DateRangePicker.js +0 -3
- package/DateRangePicker/DateRangePickerToolbar.d.ts +1 -1
- package/DateRangePicker/DateRangePickerToolbar.js +0 -3
- package/DateRangePicker/shared.d.ts +1 -2
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
- package/MobileDateRangePicker/MobileDateRangePicker.js +0 -3
- package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +1 -2
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +1 -2
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +1 -2
- package/README.md +1 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +1 -1
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +1 -1
- package/StaticDateRangePicker/StaticDateRangePicker.js +0 -3
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +1 -1
- package/index.d.ts +0 -1
- package/index.js +1 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +3 -3
- package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +3 -3
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -1
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +3 -3
- package/internals/hooks/useRangePosition.d.ts +1 -1
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -1
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +2 -3
- package/internals/models/dateRange.d.ts +1 -2
- package/internals/models/dateTimeRange.d.ts +1 -2
- package/internals/models/index.d.ts +0 -1
- package/internals/models/index.js +0 -1
- package/internals/models/timeRange.d.ts +1 -2
- package/internals/utils/date-range-manager.d.ts +1 -1
- package/internals/utils/date-utils.d.ts +1 -1
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/validation/validateDateRange.d.ts +2 -2
- package/internals/utils/validation/validateDateTimeRange.d.ts +1 -2
- package/internals/utils/validation/validateTimeRange.d.ts +1 -2
- package/internals/utils/valueManagers.d.ts +1 -2
- package/internals/utils/valueManagers.js +5 -5
- package/legacy/AdapterDateFnsV3/index.js +1 -0
- package/legacy/DateRangePicker/DateRangePicker.js +0 -3
- package/legacy/DateRangePicker/DateRangePickerToolbar.js +0 -3
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +0 -3
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +0 -3
- package/legacy/index.js +1 -1
- package/legacy/internals/models/index.js +0 -1
- package/legacy/internals/utils/releaseInfo.js +1 -1
- package/legacy/internals/utils/valueManagers.js +5 -5
- package/legacy/locales/index.js +1 -0
- package/legacy/models/index.js +1 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/package.json +6 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +1 -0
- package/modern/AdapterDateFnsV3/index.js +1 -0
- package/modern/DateRangePicker/DateRangePicker.js +0 -3
- package/modern/DateRangePicker/DateRangePickerToolbar.js +0 -3
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +0 -3
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +0 -3
- package/modern/index.js +1 -1
- package/modern/internals/models/index.js +0 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/internals/utils/valueManagers.js +5 -5
- package/modern/locales/index.js +1 -0
- package/modern/models/index.js +1 -0
- package/node/AdapterDateFnsV3/index.js +12 -0
- package/node/DateRangePicker/DateRangePicker.js +0 -3
- package/node/DateRangePicker/DateRangePickerToolbar.js +0 -3
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +0 -3
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +0 -3
- package/node/index.js +1 -1
- package/node/internals/models/index.js +0 -11
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/internals/utils/valueManagers.js +5 -5
- package/node/locales/index.js +16 -0
- package/node/models/index.js +11 -0
- package/package.json +10 -10
- /package/{internals → legacy}/models/range.js +0 -0
- /package/{internals/models → models}/range.d.ts +0 -0
- /package/{legacy/internals/models → models}/range.js +0 -0
- /package/modern/{internals/models → models}/range.js +0 -0
- /package/node/{internals/models → models}/range.js +0 -0
|
@@ -5,7 +5,8 @@ import { Theme } from '@mui/material/styles';
|
|
|
5
5
|
import { TimezoneProps } from '@mui/x-date-pickers/models';
|
|
6
6
|
import { PickersCalendarHeader, PickersCalendarHeaderProps, PickersCalendarHeaderSlots, PickersCalendarHeaderSlotProps } from '@mui/x-date-pickers/PickersCalendarHeader';
|
|
7
7
|
import { BaseDateValidationProps, DefaultizedProps, ExportedDayCalendarProps, DayCalendarSlots, DayCalendarSlotProps, PickersArrowSwitcherSlots, PickersArrowSwitcherSlotProps, PickerSelectionState, DayCalendarProps, ExportedUseViewsOptions } from '@mui/x-date-pickers/internals';
|
|
8
|
-
import {
|
|
8
|
+
import { DayRangeValidationProps } from '../internals/models';
|
|
9
|
+
import { DateRange } from '../models';
|
|
9
10
|
import { DateRangeCalendarClasses } from './dateRangeCalendarClasses';
|
|
10
11
|
import { DateRangePickerDay, DateRangePickerDayProps } from '../DateRangePickerDay';
|
|
11
12
|
import { UseRangePositionProps } from '../internals/hooks/useRangePosition';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MuiPickersAdapter, PickersTimezone } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { DateRangePosition } from './DateRangeCalendar.types';
|
|
4
|
-
import { DateRange } from '../
|
|
4
|
+
import { DateRange } from '../models';
|
|
5
5
|
interface UseDragRangeParams<TDate> {
|
|
6
6
|
disableDragEditing?: boolean;
|
|
7
7
|
utils: MuiPickersAdapter<TDate>;
|
|
@@ -59,9 +59,6 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
59
59
|
* @default 2
|
|
60
60
|
*/
|
|
61
61
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
62
|
-
/**
|
|
63
|
-
* Class name applied to the root element.
|
|
64
|
-
*/
|
|
65
62
|
className: PropTypes.string,
|
|
66
63
|
/**
|
|
67
64
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '@mui/x-date-pickers/internals';
|
|
3
|
-
import { DateRange } from '../
|
|
3
|
+
import { DateRange } from '../models';
|
|
4
4
|
import { UseRangePositionResponse } from '../internals/hooks/useRangePosition';
|
|
5
5
|
import { DateRangePickerToolbarClasses } from './dateRangePickerToolbarClasses';
|
|
6
6
|
export interface DateRangePickerToolbarProps<TDate> extends Omit<BaseToolbarProps<DateRange<TDate>, 'day'>, 'views' | 'view' | 'onViewChange' | 'onChange' | 'isLandscape'>, Pick<UseRangePositionResponse, 'rangePosition' | 'onRangePositionChange'> {
|
|
@@ -94,9 +94,6 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
94
94
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
95
95
|
// ----------------------------------------------------------------------
|
|
96
96
|
classes: PropTypes.object,
|
|
97
|
-
/**
|
|
98
|
-
* className applied to the root component.
|
|
99
|
-
*/
|
|
100
97
|
className: PropTypes.string,
|
|
101
98
|
disabled: PropTypes.bool,
|
|
102
99
|
/**
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LocalizedComponent } from '@mui/x-date-pickers/locales';
|
|
3
3
|
import { DefaultizedProps, BaseDateValidationProps, BasePickerInputProps, PickerViewRendererLookup } from '@mui/x-date-pickers/internals';
|
|
4
|
-
import { DateRangeValidationError } from '../models';
|
|
5
|
-
import { DateRange } from '../internals/models';
|
|
4
|
+
import { DateRangeValidationError, DateRange } from '../models';
|
|
6
5
|
import { DateRangeCalendarSlots, DateRangeCalendarSlotProps, ExportedDateRangeCalendarProps } from '../DateRangeCalendar';
|
|
7
6
|
import { DateRangePickerToolbarProps, ExportedDateRangePickerToolbarProps } from './DateRangePickerToolbar';
|
|
8
7
|
import { DateRangeViewRendererProps } from '../dateRangeViewRenderers';
|
|
@@ -74,9 +74,6 @@ DesktopDateRangePicker.propTypes = {
|
|
|
74
74
|
* @default 2
|
|
75
75
|
*/
|
|
76
76
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
77
|
-
/**
|
|
78
|
-
* Class name applied to the root element.
|
|
79
|
-
*/
|
|
80
77
|
className: PropTypes.string,
|
|
81
78
|
/**
|
|
82
79
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -74,9 +74,6 @@ MobileDateRangePicker.propTypes = {
|
|
|
74
74
|
* @default 2
|
|
75
75
|
*/
|
|
76
76
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
77
|
-
/**
|
|
78
|
-
* Class name applied to the root element.
|
|
79
|
-
*/
|
|
80
77
|
className: PropTypes.string,
|
|
81
78
|
/**
|
|
82
79
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -5,10 +5,9 @@ import Stack, { StackProps } from '@mui/material/Stack';
|
|
|
5
5
|
import TextField from '@mui/material/TextField';
|
|
6
6
|
import { FieldRef } from '@mui/x-date-pickers/models';
|
|
7
7
|
import { UseDateRangeFieldProps } from '../internals/models/dateRange';
|
|
8
|
-
import { RangePosition } from '../internals/models/range';
|
|
9
8
|
import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types';
|
|
10
9
|
import { RangeFieldSection } from '../internals/models/fields';
|
|
11
|
-
import { MultiInputRangeFieldClasses } from '../models';
|
|
10
|
+
import { MultiInputRangeFieldClasses, RangePosition } from '../models';
|
|
12
11
|
export type UseMultiInputDateRangeFieldParams<TDate, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputDateRangeFieldProps<TDate>, TTextFieldSlotProps>;
|
|
13
12
|
export interface UseMultiInputDateRangeFieldProps<TDate> extends Omit<UseDateRangeFieldProps<TDate>, 'unstableFieldRef' | 'clearable' | 'onClear'> {
|
|
14
13
|
unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
@@ -5,10 +5,9 @@ import Typography from '@mui/material/Typography';
|
|
|
5
5
|
import Stack, { StackProps } from '@mui/material/Stack';
|
|
6
6
|
import TextField from '@mui/material/TextField';
|
|
7
7
|
import { UseDateTimeRangeFieldDefaultizedProps, UseDateTimeRangeFieldProps } from '../internals/models/dateTimeRange';
|
|
8
|
-
import { RangePosition } from '../internals/models/range';
|
|
9
8
|
import { RangeFieldSection } from '../internals/models/fields';
|
|
10
9
|
import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types';
|
|
11
|
-
import { MultiInputRangeFieldClasses } from '../models';
|
|
10
|
+
import { MultiInputRangeFieldClasses, RangePosition } from '../models';
|
|
12
11
|
export type UseMultiInputDateTimeRangeFieldParams<TDate, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputDateTimeRangeFieldProps<TDate>, TTextFieldSlotProps>;
|
|
13
12
|
export interface UseMultiInputDateTimeRangeFieldProps<TDate> extends Omit<UseDateTimeRangeFieldProps<TDate>, 'unstableFieldRef' | 'clearable' | 'onClear'> {
|
|
14
13
|
unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
|
@@ -5,10 +5,9 @@ import Stack, { StackProps } from '@mui/material/Stack';
|
|
|
5
5
|
import TextField from '@mui/material/TextField';
|
|
6
6
|
import { FieldRef } from '@mui/x-date-pickers/models';
|
|
7
7
|
import { UseTimeRangeFieldDefaultizedProps, UseTimeRangeFieldProps } from '../internals/models/timeRange';
|
|
8
|
-
import { RangePosition } from '../internals/models/range';
|
|
9
8
|
import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types';
|
|
10
9
|
import { RangeFieldSection } from '../internals/models/fields';
|
|
11
|
-
import { MultiInputRangeFieldClasses } from '../models';
|
|
10
|
+
import { MultiInputRangeFieldClasses, RangePosition } from '../models';
|
|
12
11
|
export type UseMultiInputTimeRangeFieldParams<TDate, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputTimeRangeFieldProps<TDate>, TTextFieldSlotProps>;
|
|
13
12
|
export interface UseMultiInputTimeRangeFieldProps<TDate> extends Omit<UseTimeRangeFieldProps<TDate>, 'unstableFieldRef' | 'clearable' | 'onClear'> {
|
|
14
13
|
unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
-
import { FieldsTextFieldProps } from '@mui/x-date-pickers/internals
|
|
4
|
+
import { FieldsTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { UseClearableFieldSlots, UseClearableFieldSlotProps } from '@mui/x-date-pickers/hooks';
|
|
6
6
|
import { UseDateTimeRangeFieldDefaultizedProps, UseDateTimeRangeFieldProps } from '../internals/models';
|
|
7
7
|
export interface UseSingleInputDateTimeRangeFieldProps<TDate> extends UseDateTimeRangeFieldProps<TDate> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
-
import { FieldsTextFieldProps } from '@mui/x-date-pickers/internals
|
|
4
|
+
import { FieldsTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { UseClearableFieldSlots, UseClearableFieldSlotProps } from '@mui/x-date-pickers/hooks';
|
|
6
6
|
import { UseTimeRangeFieldDefaultizedProps, UseTimeRangeFieldProps } from '../internals/models';
|
|
7
7
|
export interface UseSingleInputTimeRangeFieldProps<TDate> extends UseTimeRangeFieldProps<TDate> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals
|
|
2
|
+
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { DateRangeCalendarProps } from '../DateRangeCalendar';
|
|
4
4
|
export interface DateRangeViewRendererProps<TDate, TView extends DateOrTimeViewWithMeridiem> extends DateRangeCalendarProps<TDate> {
|
|
5
5
|
view: TView;
|
package/index.d.ts
CHANGED
|
@@ -14,6 +14,5 @@ export * from './DesktopDateRangePicker';
|
|
|
14
14
|
export * from './MobileDateRangePicker';
|
|
15
15
|
export * from './StaticDateRangePicker';
|
|
16
16
|
export * from './dateRangeViewRenderers';
|
|
17
|
-
export type { DateRange, RangePosition } from './internals/models/range';
|
|
18
17
|
export type { UseDateRangeFieldProps } from './internals/models/dateRange';
|
|
19
18
|
export * from './models';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals
|
|
2
|
+
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { UseDesktopRangePickerParams, UseDesktopRangePickerProps } from './useDesktopRangePicker.types';
|
|
4
4
|
export declare const useDesktopRangePicker: <TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseDesktopRangePickerProps<TDate, TView, any, TExternalProps>>({ props, ...pickerParams }: UseDesktopRangePickerParams<TDate, TView, TExternalProps>) => {
|
|
5
5
|
renderPicker: () => React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UsePickerParams, BasePickerProps, PickersPopperSlots, PickersPopperSlotProps, ExportedBaseToolbarProps, UsePickerViewsProps, BaseNonStaticPickerProps, UsePickerValueNonStaticProps, UsePickerViewsNonStaticProps } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals/models';
|
|
1
|
+
import { UsePickerParams, BasePickerProps, PickersPopperSlots, PickersPopperSlotProps, ExportedBaseToolbarProps, UsePickerViewsProps, BaseNonStaticPickerProps, UsePickerValueNonStaticProps, UsePickerViewsNonStaticProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
3
2
|
import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps } from '@mui/x-date-pickers/PickersLayout';
|
|
4
|
-
import {
|
|
3
|
+
import { RangeFieldSection, BaseRangeNonStaticPickerProps } from '../../models';
|
|
4
|
+
import { DateRange } from '../../../models';
|
|
5
5
|
import { UseRangePositionProps, UseRangePositionResponse } from '../useRangePosition';
|
|
6
6
|
import { RangePickerFieldSlots, RangePickerFieldSlotProps } from '../useEnrichedRangePickerFieldProps';
|
|
7
7
|
export interface UseDesktopRangePickerSlots<TDate, TView extends DateOrTimeViewWithMeridiem> extends PickersPopperSlots, ExportedPickersLayoutSlots<DateRange<TDate>, TDate, TView>, RangePickerFieldSlots {
|
|
@@ -5,10 +5,10 @@ import TextField, { TextFieldProps } from '@mui/material/TextField';
|
|
|
5
5
|
import { SlotComponentProps } from '@mui/base/utils';
|
|
6
6
|
import { BaseSingleInputFieldProps } from '@mui/x-date-pickers/models';
|
|
7
7
|
import { UseClearableFieldSlots, UseClearableFieldSlotProps } from '@mui/x-date-pickers/hooks';
|
|
8
|
-
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals/models';
|
|
9
8
|
import { PickersInputLocaleText } from '@mui/x-date-pickers/locales';
|
|
10
|
-
import { BaseFieldProps, UsePickerResponse, WrapperVariant, UsePickerProps } from '@mui/x-date-pickers/internals';
|
|
11
|
-
import { BaseMultiInputFieldProps,
|
|
9
|
+
import { BaseFieldProps, UsePickerResponse, WrapperVariant, UsePickerProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
10
|
+
import { BaseMultiInputFieldProps, RangeFieldSection, UseDateRangeFieldProps } from '../models';
|
|
11
|
+
import { DateRange, RangePosition } from '../../models';
|
|
12
12
|
import { UseRangePositionResponse } from './useRangePosition';
|
|
13
13
|
export interface RangePickerFieldSlots extends UseClearableFieldSlots {
|
|
14
14
|
field: React.ElementType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals
|
|
2
|
+
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { UseMobileRangePickerParams, UseMobileRangePickerProps } from './useMobileRangePicker.types';
|
|
4
4
|
export declare const useMobileRangePicker: <TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseMobileRangePickerProps<TDate, TView, any, TExternalProps>>({ props, ...pickerParams }: UseMobileRangePickerParams<TDate, TView, TExternalProps>) => {
|
|
5
5
|
renderPicker: () => React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UsePickerParams, BasePickerProps, PickersModalDialogSlots, PickersModalDialogSlotProps, ExportedBaseToolbarProps, UsePickerViewsProps, BaseNonStaticPickerProps, UsePickerValueNonStaticProps, UsePickerViewsNonStaticProps } from '@mui/x-date-pickers/internals';
|
|
1
|
+
import { UsePickerParams, BasePickerProps, PickersModalDialogSlots, PickersModalDialogSlotProps, ExportedBaseToolbarProps, UsePickerViewsProps, BaseNonStaticPickerProps, UsePickerValueNonStaticProps, UsePickerViewsNonStaticProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps } from '@mui/x-date-pickers/PickersLayout';
|
|
3
|
-
import {
|
|
4
|
-
import { DateRange
|
|
3
|
+
import { RangeFieldSection, BaseRangeNonStaticPickerProps } from '../../models';
|
|
4
|
+
import { DateRange } from '../../../models';
|
|
5
5
|
import { UseRangePositionProps, UseRangePositionResponse } from '../useRangePosition';
|
|
6
6
|
import { RangePickerFieldSlots, RangePickerFieldSlotProps } from '../useEnrichedRangePickerFieldProps';
|
|
7
7
|
export interface UseMobileRangePickerSlots<TDate, TView extends DateOrTimeViewWithMeridiem> extends PickersModalDialogSlots, ExportedPickersLayoutSlots<DateRange<TDate>, TDate, TView>, RangePickerFieldSlots {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FieldRef } from '@mui/x-date-pickers/models';
|
|
3
|
-
import { RangePosition } from '
|
|
3
|
+
import { RangePosition } from '../../models';
|
|
4
4
|
import { RangeFieldSection } from '../models/fields';
|
|
5
5
|
export interface UseRangePositionProps {
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals
|
|
2
|
+
import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { UseStaticRangePickerParams, UseStaticRangePickerProps } from './useStaticRangePicker.types';
|
|
4
4
|
/**
|
|
5
5
|
* Hook managing all the range static pickers:
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BasePickerProps, UsePickerParams, ExportedBaseToolbarProps, StaticOnlyPickerProps } from '@mui/x-date-pickers/internals';
|
|
2
|
+
import { BasePickerProps, UsePickerParams, ExportedBaseToolbarProps, StaticOnlyPickerProps, DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps } from '@mui/x-date-pickers/PickersLayout';
|
|
4
|
-
import {
|
|
5
|
-
import { DateRange } from '../../models/range';
|
|
4
|
+
import { DateRange } from '../../../models';
|
|
6
5
|
import { UseRangePositionProps } from '../useRangePosition';
|
|
7
6
|
import { RangeFieldSection } from '../../models/fields';
|
|
8
7
|
export interface UseStaticRangePickerSlots<TDate, TView extends DateOrTimeViewWithMeridiem> extends ExportedPickersLayoutSlots<DateRange<TDate>, TDate, TView> {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseDateValidationProps, DefaultizedProps, MakeOptional, UseFieldInternalProps } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import { DateRange } from '
|
|
3
|
-
import type { DateRangeValidationError } from '../../models';
|
|
2
|
+
import type { DateRangeValidationError, DateRange } from '../../models';
|
|
4
3
|
import { RangeFieldSection } from './fields';
|
|
5
4
|
/**
|
|
6
5
|
* Props used to validate a day value in range pickers.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseDateValidationProps, TimeValidationProps, DefaultizedProps, MakeOptional, UseFieldInternalProps, DateTimeValidationProps } from '@mui/x-date-pickers/internals';
|
|
2
2
|
import { BaseRangeProps, DayRangeValidationProps } from './dateRange';
|
|
3
|
-
import { DateRange } from '
|
|
4
|
-
import { DateTimeRangeValidationError } from '../../models';
|
|
3
|
+
import { DateTimeRangeValidationError, DateRange } from '../../models';
|
|
5
4
|
import { RangeFieldSection } from './fields';
|
|
6
5
|
export interface UseDateTimeRangeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, DateTimeRangeValidationError>, 'format'>, DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, BaseDateValidationProps<TDate>, DateTimeValidationProps<TDate>, BaseRangeProps {
|
|
7
6
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseTimeValidationProps, TimeValidationProps, DefaultizedProps, MakeOptional, UseFieldInternalProps } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import { DateRange } from '
|
|
3
|
-
import { TimeRangeValidationError } from '../../models';
|
|
2
|
+
import { TimeRangeValidationError, DateRange } from '../../models';
|
|
4
3
|
import { BaseRangeProps } from './dateRange';
|
|
5
4
|
import { RangeFieldSection } from './fields';
|
|
6
5
|
export interface UseTimeRangeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<DateRange<TDate>, TDate, RangeFieldSection, TimeRangeValidationError>, 'format'>, TimeValidationProps<TDate>, BaseTimeValidationProps, BaseRangeProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MuiPickersAdapter } from '@mui/x-date-pickers/models';
|
|
2
|
-
import { DateRange, RangePosition } from '
|
|
2
|
+
import { DateRange, RangePosition } from '../../models';
|
|
3
3
|
interface CalculateRangeChangeOptions<TDate> {
|
|
4
4
|
utils: MuiPickersAdapter<TDate>;
|
|
5
5
|
range: DateRange<TDate>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MuiPickersAdapter } from '@mui/x-date-pickers/models';
|
|
2
|
-
import { DateRange, NonEmptyDateRange } from '
|
|
2
|
+
import { DateRange, NonEmptyDateRange } from '../../models';
|
|
3
3
|
export declare const isRangeValid: <TDate>(utils: MuiPickersAdapter<TDate, any>, range: DateRange<TDate> | null) => range is NonEmptyDateRange<TDate>;
|
|
4
4
|
export declare const isWithinRange: <TDate>(utils: MuiPickersAdapter<TDate, any>, day: TDate, range: DateRange<TDate> | null) => boolean;
|
|
5
5
|
export declare const isStartOfRange: <TDate>(utils: MuiPickersAdapter<TDate, any>, day: TDate, range: DateRange<TDate> | null) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcwNTYxODgwMDAwMA==";
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import { TimezoneProps } from '@mui/x-date-pickers/models';
|
|
2
2
|
import { Validator, BaseDateValidationProps, DefaultizedProps } from '@mui/x-date-pickers/internals';
|
|
3
|
-
import {
|
|
4
|
-
import { DateRangeValidationError } from '../../../models';
|
|
3
|
+
import { DayRangeValidationProps } from '../../models';
|
|
4
|
+
import { DateRangeValidationError, DateRange } from '../../../models';
|
|
5
5
|
export interface DateRangeComponentValidationProps<TDate> extends DayRangeValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
|
|
6
6
|
}
|
|
7
7
|
export declare const validateDateRange: Validator<DateRange<any>, any, DateRangeValidationError, DateRangeComponentValidationProps<any>>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { TimezoneProps } from '@mui/x-date-pickers/models';
|
|
2
2
|
import { Validator, BaseDateValidationProps, TimeValidationProps, DefaultizedProps } from '@mui/x-date-pickers/internals';
|
|
3
3
|
import { DayRangeValidationProps } from '../../models/dateRange';
|
|
4
|
-
import { DateRange } from '
|
|
5
|
-
import { DateTimeRangeValidationError } from '../../../models';
|
|
4
|
+
import { DateTimeRangeValidationError, DateRange } from '../../../models';
|
|
6
5
|
export interface DateTimeRangeComponentValidationProps<TDate> extends DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, Required<BaseDateValidationProps<TDate>>, DefaultizedProps<TimezoneProps, 'timezone'> {
|
|
7
6
|
}
|
|
8
7
|
export declare const validateDateTimeRange: Validator<DateRange<any>, any, DateTimeRangeValidationError, DateTimeRangeComponentValidationProps<any>>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TimezoneProps } from '@mui/x-date-pickers/models';
|
|
2
2
|
import { Validator, BaseTimeValidationProps, DefaultizedProps } from '@mui/x-date-pickers/internals';
|
|
3
|
-
import { DateRange } from '
|
|
4
|
-
import { TimeRangeValidationError } from '../../../models';
|
|
3
|
+
import { TimeRangeValidationError, DateRange } from '../../../models';
|
|
5
4
|
export interface TimeRangeComponentValidationProps extends Required<BaseTimeValidationProps>, DefaultizedProps<TimezoneProps, 'timezone'> {
|
|
6
5
|
}
|
|
7
6
|
export declare const validateTimeRange: Validator<DateRange<any>, any, TimeRangeValidationError, TimeRangeComponentValidationProps>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PickerValueManager, FieldValueManager } from '@mui/x-date-pickers/internals';
|
|
2
|
-
import { DateRange } from '
|
|
3
|
-
import type { DateRangeValidationError, DateTimeRangeValidationError, TimeRangeValidationError } from '../../models';
|
|
2
|
+
import type { DateRangeValidationError, DateTimeRangeValidationError, TimeRangeValidationError, DateRange } from '../../models';
|
|
4
3
|
import { RangeFieldSection } from '../models/fields';
|
|
5
4
|
export type RangePickerValueManager<TValue = [any, any], TDate = any, TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerValueManager<TValue, TDate, TError>;
|
|
6
5
|
export declare const rangeValueManager: RangePickerValueManager;
|
|
@@ -29,7 +29,7 @@ export const rangeValueManager = {
|
|
|
29
29
|
const timezoneStart = value[0] == null || !utils.isValid(value[0]) ? null : utils.getTimezone(value[0]);
|
|
30
30
|
const timezoneEnd = value[1] == null || !utils.isValid(value[1]) ? null : utils.getTimezone(value[1]);
|
|
31
31
|
if (timezoneStart != null && timezoneEnd != null && timezoneStart !== timezoneEnd) {
|
|
32
|
-
throw new Error('MUI: The timezone of the start and the end date should be the same');
|
|
32
|
+
throw new Error('MUI X: The timezone of the start and the end date should be the same.');
|
|
33
33
|
}
|
|
34
34
|
return timezoneStart != null ? timezoneStart : timezoneEnd;
|
|
35
35
|
},
|
|
@@ -50,7 +50,7 @@ export const rangeFieldValueManager = {
|
|
|
50
50
|
}
|
|
51
51
|
return [prevReferenceValue[1], value[1]];
|
|
52
52
|
},
|
|
53
|
-
getSectionsFromValue: (utils, [start, end], fallbackSections, isRTL, getSectionsFromDate) => {
|
|
53
|
+
getSectionsFromValue: (utils, [start, end], fallbackSections, localizedDigits, isRTL, getSectionsFromDate) => {
|
|
54
54
|
const separatedFallbackSections = fallbackSections == null ? {
|
|
55
55
|
startDate: null,
|
|
56
56
|
endDate: null
|
|
@@ -73,11 +73,11 @@ export const rangeFieldValueManager = {
|
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
-
return addPositionPropertiesToSections([...getSections(start, separatedFallbackSections.startDate, 'start'), ...getSections(end, separatedFallbackSections.endDate, 'end')], isRTL);
|
|
76
|
+
return addPositionPropertiesToSections([...getSections(start, separatedFallbackSections.startDate, 'start'), ...getSections(end, separatedFallbackSections.endDate, 'end')], localizedDigits, isRTL);
|
|
77
77
|
},
|
|
78
|
-
getValueStrFromSections: (sections, isRTL) => {
|
|
78
|
+
getValueStrFromSections: (sections, localizedDigits, isRTL) => {
|
|
79
79
|
const dateRangeSections = splitDateRangeSections(sections);
|
|
80
|
-
return createDateStrForInputFromSections([...dateRangeSections.startDate, ...dateRangeSections.endDate], isRTL);
|
|
80
|
+
return createDateStrForInputFromSections([...dateRangeSections.startDate, ...dateRangeSections.endDate], localizedDigits, isRTL);
|
|
81
81
|
},
|
|
82
82
|
parseValueStr: (valueStr, referenceValue, parseDate) => {
|
|
83
83
|
// TODO: Improve because it would not work if the date format has `–` as a separator.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
|
|
@@ -58,9 +58,6 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
58
58
|
* @default 2
|
|
59
59
|
*/
|
|
60
60
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
61
|
-
/**
|
|
62
|
-
* Class name applied to the root element.
|
|
63
|
-
*/
|
|
64
61
|
className: PropTypes.string,
|
|
65
62
|
/**
|
|
66
63
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -101,9 +101,6 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
|
|
|
101
101
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
102
102
|
// ----------------------------------------------------------------------
|
|
103
103
|
classes: PropTypes.object,
|
|
104
|
-
/**
|
|
105
|
-
* className applied to the root component.
|
|
106
|
-
*/
|
|
107
104
|
className: PropTypes.string,
|
|
108
105
|
disabled: PropTypes.bool,
|
|
109
106
|
/**
|
|
@@ -73,9 +73,6 @@ DesktopDateRangePicker.propTypes = {
|
|
|
73
73
|
* @default 2
|
|
74
74
|
*/
|
|
75
75
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
76
|
-
/**
|
|
77
|
-
* Class name applied to the root element.
|
|
78
|
-
*/
|
|
79
76
|
className: PropTypes.string,
|
|
80
77
|
/**
|
|
81
78
|
* If `true`, the popover or modal will close after submitting the full date.
|
|
@@ -73,9 +73,6 @@ MobileDateRangePicker.propTypes = {
|
|
|
73
73
|
* @default 2
|
|
74
74
|
*/
|
|
75
75
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
76
|
-
/**
|
|
77
|
-
* Class name applied to the root element.
|
|
78
|
-
*/
|
|
79
76
|
className: PropTypes.string,
|
|
80
77
|
/**
|
|
81
78
|
* If `true`, the popover or modal will close after submitting the full date.
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTcwNTYxODgwMDAwMA==";
|
|
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
|
|
@@ -41,7 +41,7 @@ export var rangeValueManager = {
|
|
|
41
41
|
var timezoneStart = value[0] == null || !utils.isValid(value[0]) ? null : utils.getTimezone(value[0]);
|
|
42
42
|
var timezoneEnd = value[1] == null || !utils.isValid(value[1]) ? null : utils.getTimezone(value[1]);
|
|
43
43
|
if (timezoneStart != null && timezoneEnd != null && timezoneStart !== timezoneEnd) {
|
|
44
|
-
throw new Error('MUI: The timezone of the start and the end date should be the same');
|
|
44
|
+
throw new Error('MUI X: The timezone of the start and the end date should be the same.');
|
|
45
45
|
}
|
|
46
46
|
return timezoneStart != null ? timezoneStart : timezoneEnd;
|
|
47
47
|
},
|
|
@@ -64,7 +64,7 @@ export var rangeFieldValueManager = {
|
|
|
64
64
|
}
|
|
65
65
|
return [prevReferenceValue[1], value[1]];
|
|
66
66
|
},
|
|
67
|
-
getSectionsFromValue: function getSectionsFromValue(utils, _ref2, fallbackSections, isRTL, getSectionsFromDate) {
|
|
67
|
+
getSectionsFromValue: function getSectionsFromValue(utils, _ref2, fallbackSections, localizedDigits, isRTL, getSectionsFromDate) {
|
|
68
68
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
69
69
|
start = _ref3[0],
|
|
70
70
|
end = _ref3[1];
|
|
@@ -90,11 +90,11 @@ export var rangeFieldValueManager = {
|
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
};
|
|
93
|
-
return addPositionPropertiesToSections([].concat(_toConsumableArray(getSections(start, separatedFallbackSections.startDate, 'start')), _toConsumableArray(getSections(end, separatedFallbackSections.endDate, 'end'))), isRTL);
|
|
93
|
+
return addPositionPropertiesToSections([].concat(_toConsumableArray(getSections(start, separatedFallbackSections.startDate, 'start')), _toConsumableArray(getSections(end, separatedFallbackSections.endDate, 'end'))), localizedDigits, isRTL);
|
|
94
94
|
},
|
|
95
|
-
getValueStrFromSections: function getValueStrFromSections(sections, isRTL) {
|
|
95
|
+
getValueStrFromSections: function getValueStrFromSections(sections, localizedDigits, isRTL) {
|
|
96
96
|
var dateRangeSections = splitDateRangeSections(sections);
|
|
97
|
-
return createDateStrForInputFromSections([].concat(_toConsumableArray(dateRangeSections.startDate), _toConsumableArray(dateRangeSections.endDate)), isRTL);
|
|
97
|
+
return createDateStrForInputFromSections([].concat(_toConsumableArray(dateRangeSections.startDate), _toConsumableArray(dateRangeSections.endDate)), localizedDigits, isRTL);
|
|
98
98
|
},
|
|
99
99
|
parseValueStr: function parseValueStr(valueStr, referenceValue, parseDate) {
|
|
100
100
|
// TODO: Improve because it would not work if the date format has `–` as a separator.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-date-pickers/locales';
|
package/legacy/models/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-date-pickers/locales';
|
package/locales/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-date-pickers/locales';
|
package/models/index.d.ts
CHANGED
package/models/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
|
|
@@ -59,9 +59,6 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
59
59
|
* @default 2
|
|
60
60
|
*/
|
|
61
61
|
calendars: PropTypes.oneOf([1, 2, 3]),
|
|
62
|
-
/**
|
|
63
|
-
* Class name applied to the root element.
|
|
64
|
-
*/
|
|
65
62
|
className: PropTypes.string,
|
|
66
63
|
/**
|
|
67
64
|
* If `true`, the popover or modal will close after submitting the full date.
|