@mui/x-date-pickers-pro 6.0.0-alpha.11 → 6.0.0-alpha.13

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.
Files changed (147) hide show
  1. package/CHANGELOG.md +260 -0
  2. package/DateRangeCalendar/DateRangeCalendar.js +30 -3
  3. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +37 -37
  4. package/DateRangePicker/DateRangePicker.js +0 -6
  5. package/DateRangePicker/DateRangePickerView.d.ts +3 -3
  6. package/DateRangePicker/DateRangePickerView.js +6 -3
  7. package/DateRangePicker/DateRangePickerViewMobile.js +1 -1
  8. package/DateRangePickerDay/DateRangePickerDay.js +72 -1
  9. package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +5 -0
  10. package/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -6
  11. package/DesktopNextDateRangePicker/DesktopNextDateRangePicker.js +22 -9
  12. package/MobileDateRangePicker/MobileDateRangePicker.d.ts +5 -0
  13. package/MobileDateRangePicker/MobileDateRangePicker.js +0 -6
  14. package/MobileNextDateRangePicker/MobileNextDateRangePicker.js +22 -9
  15. package/MultiInputDateRangeField/MultiInputDateRangeField.js +51 -11
  16. package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +4 -2
  17. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +45 -10
  18. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +3 -3
  19. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +45 -10
  20. package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +2 -2
  21. package/NextDateRangePicker/NextDateRangePicker.js +16 -2
  22. package/NextDateRangePicker/shared.d.ts +9 -2
  23. package/SingleInputDateRangeField/SingleInputDateRangeField.js +110 -5
  24. package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +3 -2
  25. package/StaticDateRangePicker/StaticDateRangePicker.js +0 -5
  26. package/StaticNextDateRangePicker/StaticNextDateRangePicker.js +20 -6
  27. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +13 -0
  28. package/{internal/utils/viewRenderers.js → dateRangeViewRenderers/dateRangeViewRenderers.js} +3 -4
  29. package/dateRangeViewRenderers/index.d.ts +2 -0
  30. package/dateRangeViewRenderers/index.js +1 -0
  31. package/dateRangeViewRenderers/package.json +6 -0
  32. package/index.d.ts +2 -1
  33. package/index.js +5 -2
  34. package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -1
  35. package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +6 -4
  36. package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +4 -5
  37. package/internal/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -1
  38. package/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -4
  39. package/internal/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +4 -5
  40. package/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +7 -1
  41. package/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +7 -1
  42. package/internal/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +2 -0
  43. package/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +7 -1
  44. package/internal/hooks/useRangePickerInputProps.d.ts +7 -7
  45. package/internal/hooks/useRangePickerInputProps.js +12 -11
  46. package/internal/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -1
  47. package/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +3 -3
  48. package/internal/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +2 -2
  49. package/internal/models/dateRange.d.ts +11 -1
  50. package/internal/models/dateTimeRange.d.ts +2 -2
  51. package/internal/models/fields.d.ts +6 -1
  52. package/internal/models/range.d.ts +0 -4
  53. package/internal/models/timeRange.d.ts +2 -1
  54. package/internal/utils/date-fields-utils.d.ts +21 -5
  55. package/internal/utils/releaseInfo.js +1 -1
  56. package/internal/utils/valueManagers.d.ts +3 -2
  57. package/internal/utils/valueManagers.js +21 -22
  58. package/legacy/DateRangeCalendar/DateRangeCalendar.js +36 -3
  59. package/legacy/DateRangePicker/DateRangePicker.js +0 -6
  60. package/legacy/DateRangePicker/DateRangePickerView.js +7 -2
  61. package/legacy/DateRangePicker/DateRangePickerViewMobile.js +1 -1
  62. package/legacy/DateRangePickerDay/DateRangePickerDay.js +72 -1
  63. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -6
  64. package/legacy/DesktopNextDateRangePicker/DesktopNextDateRangePicker.js +22 -9
  65. package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +0 -6
  66. package/legacy/MobileNextDateRangePicker/MobileNextDateRangePicker.js +22 -9
  67. package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +48 -8
  68. package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +43 -8
  69. package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +43 -8
  70. package/legacy/NextDateRangePicker/NextDateRangePicker.js +16 -2
  71. package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +109 -4
  72. package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +0 -5
  73. package/legacy/StaticNextDateRangePicker/StaticNextDateRangePicker.js +20 -6
  74. package/legacy/{internal/utils/viewRenderers.js → dateRangeViewRenderers/dateRangeViewRenderers.js} +3 -4
  75. package/legacy/dateRangeViewRenderers/index.js +1 -0
  76. package/legacy/index.js +5 -2
  77. package/legacy/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +6 -4
  78. package/legacy/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -4
  79. package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +7 -1
  80. package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +7 -1
  81. package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +7 -1
  82. package/legacy/internal/hooks/useRangePickerInputProps.js +12 -11
  83. package/legacy/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +3 -3
  84. package/legacy/internal/utils/releaseInfo.js +1 -1
  85. package/legacy/internal/utils/valueManagers.js +20 -23
  86. package/legacy/tests/describeRangeValidation/testTextFieldRangeValidation.js +1 -1
  87. package/modern/DateRangeCalendar/DateRangeCalendar.js +29 -3
  88. package/modern/DateRangePicker/DateRangePicker.js +0 -6
  89. package/modern/DateRangePicker/DateRangePickerView.js +6 -3
  90. package/modern/DateRangePicker/DateRangePickerViewMobile.js +1 -1
  91. package/modern/DateRangePickerDay/DateRangePickerDay.js +72 -1
  92. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -6
  93. package/modern/DesktopNextDateRangePicker/DesktopNextDateRangePicker.js +22 -9
  94. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +0 -6
  95. package/modern/MobileNextDateRangePicker/MobileNextDateRangePicker.js +22 -9
  96. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +51 -11
  97. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +45 -10
  98. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +45 -10
  99. package/modern/NextDateRangePicker/NextDateRangePicker.js +16 -2
  100. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +110 -5
  101. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +0 -5
  102. package/modern/StaticNextDateRangePicker/StaticNextDateRangePicker.js +20 -6
  103. package/modern/{internal/utils/viewRenderers.js → dateRangeViewRenderers/dateRangeViewRenderers.js} +3 -4
  104. package/modern/dateRangeViewRenderers/index.js +1 -0
  105. package/modern/index.js +5 -2
  106. package/modern/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +6 -4
  107. package/modern/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -4
  108. package/modern/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +7 -1
  109. package/modern/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +7 -1
  110. package/modern/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +7 -1
  111. package/modern/internal/hooks/useRangePickerInputProps.js +11 -11
  112. package/modern/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +3 -3
  113. package/modern/internal/utils/releaseInfo.js +1 -1
  114. package/modern/internal/utils/valueManagers.js +21 -22
  115. package/modern/tests/describeRangeValidation/testTextFieldRangeValidation.js +1 -1
  116. package/node/DateRangeCalendar/DateRangeCalendar.js +28 -2
  117. package/node/DateRangePicker/DateRangePicker.js +0 -6
  118. package/node/DateRangePicker/DateRangePickerView.js +6 -3
  119. package/node/DateRangePicker/DateRangePickerViewMobile.js +1 -1
  120. package/node/DateRangePickerDay/DateRangePickerDay.js +72 -1
  121. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -6
  122. package/node/DesktopNextDateRangePicker/DesktopNextDateRangePicker.js +22 -9
  123. package/node/MobileDateRangePicker/MobileDateRangePicker.js +0 -6
  124. package/node/MobileNextDateRangePicker/MobileNextDateRangePicker.js +22 -9
  125. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +51 -11
  126. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +45 -10
  127. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +45 -10
  128. package/node/NextDateRangePicker/NextDateRangePicker.js +16 -2
  129. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +110 -5
  130. package/node/StaticDateRangePicker/StaticDateRangePicker.js +0 -5
  131. package/node/StaticNextDateRangePicker/StaticNextDateRangePicker.js +20 -6
  132. package/node/{internal/utils/viewRenderers.js → dateRangeViewRenderers/dateRangeViewRenderers.js} +4 -4
  133. package/node/dateRangeViewRenderers/index.js +12 -0
  134. package/node/index.js +13 -1
  135. package/node/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +6 -4
  136. package/node/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -4
  137. package/node/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +7 -1
  138. package/node/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +7 -1
  139. package/node/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +7 -1
  140. package/node/internal/hooks/useRangePickerInputProps.js +11 -11
  141. package/node/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +3 -3
  142. package/node/internal/utils/releaseInfo.js +1 -1
  143. package/node/internal/utils/valueManagers.js +20 -21
  144. package/node/tests/describeRangeValidation/testTextFieldRangeValidation.js +1 -1
  145. package/package.json +4 -4
  146. package/tests/describeRangeValidation/testTextFieldRangeValidation.js +1 -1
  147. package/internal/utils/viewRenderers.d.ts +0 -7
@@ -12,7 +12,6 @@ const releaseInfo = getReleaseInfo();
12
12
  export const useDesktopRangePicker = ({
13
13
  props,
14
14
  valueManager,
15
- viewLookup,
16
15
  validator
17
16
  }) => {
18
17
  useLicenseVerifier('x-date-pickers-pro', releaseInfo);
@@ -23,6 +22,7 @@ export const useDesktopRangePicker = ({
23
22
  format,
24
23
  readOnly,
25
24
  disabled,
25
+ autoFocus,
26
26
  disableOpenPicker,
27
27
  localeText
28
28
  } = props;
@@ -40,8 +40,8 @@ export const useDesktopRangePicker = ({
40
40
  props,
41
41
  valueManager,
42
42
  wrapperVariant: 'desktop',
43
- viewLookup,
44
43
  validator,
44
+ autoFocusView: true,
45
45
  additionalViewProps: {
46
46
  rangePosition,
47
47
  onRangePositionChange: setRangePosition
@@ -57,12 +57,13 @@ export const useDesktopRangePicker = ({
57
57
  });
58
58
  };
59
59
  const fieldSlotsProps = useRangePickerInputProps({
60
- wrapperVariant: 'mobile',
60
+ wrapperVariant: 'desktop',
61
61
  open,
62
62
  actions,
63
63
  readOnly,
64
64
  disabled,
65
65
  disableOpenPicker,
66
+ localeText,
66
67
  onBlur: handleBlur,
67
68
  rangePosition,
68
69
  onRangePositionChange: setRangePosition
@@ -76,6 +77,7 @@ export const useDesktopRangePicker = ({
76
77
  disabled,
77
78
  className,
78
79
  format,
80
+ autoFocus: autoFocus && !props.open,
79
81
  ref: fieldRef
80
82
  }),
81
83
  ownerState: props
@@ -92,7 +94,7 @@ export const useDesktopRangePicker = ({
92
94
  const inputPropsPassedByField = resolveComponentProps((_fieldProps$component = fieldProps.componentsProps) == null ? void 0 : _fieldProps$component.input, ownerState);
93
95
  const inputPropsPassedByPicker = ownerState.position === 'start' ? fieldSlotsProps.startInput : fieldSlotsProps.endInput;
94
96
  return _extends({}, externalInputProps, inputPropsPassedByField, inputPropsPassedByPicker, {
95
- inputProps: _extends({}, externalInputProps == null ? void 0 : externalInputProps.inputProps, inputPropsPassedByField == null ? void 0 : inputPropsPassedByField.inputProps, inputPropsPassedByPicker == null ? void 0 : inputPropsPassedByPicker.inputProps)
97
+ inputProps: _extends({}, externalInputProps == null ? void 0 : externalInputProps.inputProps, inputPropsPassedByField == null ? void 0 : inputPropsPassedByField.inputProps)
96
98
  });
97
99
  },
98
100
  root: ownerState => {
@@ -3,7 +3,7 @@ import TextField, { TextFieldProps } from '@mui/material/TextField';
3
3
  import Stack, { StackProps } from '@mui/material/Stack';
4
4
  import Typography, { TypographyProps } from '@mui/material/Typography';
5
5
  import { SlotComponentProps } from '@mui/base/utils';
6
- import { DateOrTimeView, UsePickerParams, BaseNextPickerProps, PickersPopperSlotsComponent, PickersPopperSlotsComponentsProps, ExportedPickersViewLayoutSlotsComponent, ExportedPickersViewLayoutSlotsComponentsProps, ExportedBaseToolbarProps, DesktopOnlyPickerProps } from '@mui/x-date-pickers/internals';
6
+ import { DateOrTimeView, UsePickerParams, BaseNextPickerProps, PickersPopperSlotsComponent, PickersPopperSlotsComponentsProps, ExportedPickersViewLayoutSlotsComponent, ExportedPickersViewLayoutSlotsComponentsProps, ExportedBaseToolbarProps, DesktopOnlyPickerProps, UsePickerViewsProps } from '@mui/x-date-pickers/internals';
7
7
  import { DateRange, RangePositionProps } from '../../models';
8
8
  import { BaseMultiInputFieldProps } from '../../models/fields';
9
9
  export interface UseDesktopRangePickerSlotsComponent extends PickersPopperSlotsComponent, ExportedPickersViewLayoutSlotsComponent {
@@ -21,7 +21,7 @@ export interface UseDesktopRangePickerSlotsComponentsProps<TDate, TView extends
21
21
  }
22
22
  export interface DesktopRangeOnlyPickerProps<TDate> extends DesktopOnlyPickerProps<TDate> {
23
23
  }
24
- export interface UseDesktopRangePickerProps<TDate, TView extends DateOrTimeView, TError> extends DesktopRangeOnlyPickerProps<TDate>, BaseNextPickerProps<DateRange<TDate>, TDate, TView, TError> {
24
+ export interface UseDesktopRangePickerProps<TDate, TView extends DateOrTimeView, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends DesktopRangeOnlyPickerProps<TDate>, BaseNextPickerProps<DateRange<TDate>, TDate, TView, TError, TExternalProps, DesktopRangePickerAdditionalViewProps> {
25
25
  /**
26
26
  * Overrideable components.
27
27
  * @default {}
@@ -33,9 +33,8 @@ export interface UseDesktopRangePickerProps<TDate, TView extends DateOrTimeView,
33
33
  */
34
34
  componentsProps?: UseDesktopRangePickerSlotsComponentsProps<TDate, TView>;
35
35
  }
36
- interface DesktopRangePickerAdditionalViewProps extends RangePositionProps {
36
+ export interface DesktopRangePickerAdditionalViewProps extends RangePositionProps {
37
37
  }
38
- export interface UseDesktopRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseDesktopRangePickerProps<TDate, TView, any>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, TExternalProps, DesktopRangePickerAdditionalViewProps>, 'valueManager' | 'viewLookup' | 'validator'> {
38
+ export interface UseDesktopRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseDesktopRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, TExternalProps, DesktopRangePickerAdditionalViewProps>, 'valueManager' | 'validator'> {
39
39
  props: TExternalProps;
40
40
  }
41
- export {};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { DateOrTimeView } from '@mui/x-date-pickers/internals';
3
3
  import { UseMobileRangePickerParams, UseMobileRangePickerProps } from './useMobileRangePicker.types';
4
- export declare const useMobileRangePicker: <TDate, TView extends DateOrTimeView, TExternalProps extends UseMobileRangePickerProps<TDate, TView, any>>({ props, valueManager, viewLookup, validator, }: UseMobileRangePickerParams<TDate, TView, TExternalProps>) => {
4
+ export declare const useMobileRangePicker: <TDate, TView extends DateOrTimeView, TExternalProps extends UseMobileRangePickerProps<TDate, TView, any, TExternalProps>>({ props, valueManager, validator, }: UseMobileRangePickerParams<TDate, TView, TExternalProps>) => {
5
5
  renderPicker: () => JSX.Element;
6
6
  };
@@ -12,7 +12,6 @@ const releaseInfo = getReleaseInfo();
12
12
  export const useMobileRangePicker = ({
13
13
  props,
14
14
  valueManager,
15
- viewLookup,
16
15
  validator
17
16
  }) => {
18
17
  useLicenseVerifier('x-date-pickers-pro', releaseInfo);
@@ -38,8 +37,8 @@ export const useMobileRangePicker = ({
38
37
  props,
39
38
  valueManager,
40
39
  wrapperVariant: 'mobile',
41
- viewLookup,
42
40
  validator,
41
+ autoFocusView: true,
43
42
  additionalViewProps: {
44
43
  rangePosition,
45
44
  onRangePositionChange: setRangePosition
@@ -52,6 +51,7 @@ export const useMobileRangePicker = ({
52
51
  readOnly,
53
52
  disabled,
54
53
  disableOpenPicker,
54
+ localeText,
55
55
  rangePosition,
56
56
  onRangePositionChange: setRangePosition
57
57
  });
@@ -60,7 +60,7 @@ export const useMobileRangePicker = ({
60
60
  elementType: Field,
61
61
  externalSlotProps: componentsProps.field,
62
62
  additionalProps: _extends({}, pickerFieldProps, {
63
- readOnly,
63
+ readOnly: readOnly != null ? readOnly : true,
64
64
  disabled,
65
65
  className,
66
66
  format,
@@ -78,7 +78,7 @@ export const useMobileRangePicker = ({
78
78
  const inputPropsPassedByField = resolveComponentProps((_fieldProps$component = fieldProps.componentsProps) == null ? void 0 : _fieldProps$component.input, ownerState);
79
79
  const inputPropsPassedByPicker = ownerState.position === 'start' ? fieldSlotsProps.startInput : fieldSlotsProps.endInput;
80
80
  return _extends({}, externalInputProps, inputPropsPassedByField, inputPropsPassedByPicker, {
81
- inputProps: _extends({}, externalInputProps == null ? void 0 : externalInputProps.inputProps, inputPropsPassedByField == null ? void 0 : inputPropsPassedByField.inputProps, inputPropsPassedByPicker == null ? void 0 : inputPropsPassedByPicker.inputProps)
81
+ inputProps: _extends({}, externalInputProps == null ? void 0 : externalInputProps.inputProps, inputPropsPassedByField == null ? void 0 : inputPropsPassedByField.inputProps)
82
82
  });
83
83
  },
84
84
  root: ownerState => {
@@ -3,7 +3,7 @@ import TextField, { TextFieldProps } from '@mui/material/TextField';
3
3
  import Stack, { StackProps } from '@mui/material/Stack';
4
4
  import Typography, { TypographyProps } from '@mui/material/Typography';
5
5
  import { SlotComponentProps } from '@mui/base/utils';
6
- import { DateOrTimeView, UsePickerParams, BaseNextPickerProps, PickersModalDialogSlotsComponent, PickersModalDialogSlotsComponentsProps, ExportedPickersViewLayoutSlotsComponent, ExportedPickersViewLayoutSlotsComponentsProps, ExportedBaseToolbarProps, MobileOnlyPickerProps } from '@mui/x-date-pickers/internals';
6
+ import { DateOrTimeView, UsePickerParams, BaseNextPickerProps, PickersModalDialogSlotsComponent, PickersModalDialogSlotsComponentsProps, ExportedPickersViewLayoutSlotsComponent, ExportedPickersViewLayoutSlotsComponentsProps, ExportedBaseToolbarProps, MobileOnlyPickerProps, UsePickerViewsProps } from '@mui/x-date-pickers/internals';
7
7
  import { DateRange, RangePositionProps } from '../../models';
8
8
  import { BaseMultiInputFieldProps } from '../../models/fields';
9
9
  export interface UseMobileRangePickerSlotsComponent extends PickersModalDialogSlotsComponent, ExportedPickersViewLayoutSlotsComponent {
@@ -21,7 +21,7 @@ export interface UseMobileRangePickerSlotsComponentsProps<TDate, TView extends D
21
21
  }
22
22
  export interface MobileRangeOnlyPickerProps<TDate> extends MobileOnlyPickerProps<TDate> {
23
23
  }
24
- export interface UseMobileRangePickerProps<TDate, TView extends DateOrTimeView, TError> extends MobileRangeOnlyPickerProps<TDate>, BaseNextPickerProps<DateRange<TDate>, TDate, TView, TError> {
24
+ export interface UseMobileRangePickerProps<TDate, TView extends DateOrTimeView, TError, TExternalProps extends UsePickerViewsProps<any, TView, any, any>> extends MobileRangeOnlyPickerProps<TDate>, BaseNextPickerProps<DateRange<TDate>, TDate, TView, TError, TExternalProps, MobileRangePickerAdditionalViewProps> {
25
25
  /**
26
26
  * Overrideable components.
27
27
  * @default {}
@@ -33,9 +33,8 @@ export interface UseMobileRangePickerProps<TDate, TView extends DateOrTimeView,
33
33
  */
34
34
  componentsProps?: UseMobileRangePickerSlotsComponentsProps<TDate, TView>;
35
35
  }
36
- interface MobileRangePickerAdditionalViewProps extends RangePositionProps {
36
+ export interface MobileRangePickerAdditionalViewProps extends RangePositionProps {
37
37
  }
38
- export interface UseMobileRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseMobileRangePickerProps<TDate, TView, any>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, TExternalProps, MobileRangePickerAdditionalViewProps>, 'valueManager' | 'viewLookup' | 'validator'> {
38
+ export interface UseMobileRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseMobileRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, TExternalProps, MobileRangePickerAdditionalViewProps>, 'valueManager' | 'validator'> {
39
39
  props: TExternalProps;
40
40
  }
41
- export {};
@@ -20,7 +20,9 @@ export const useMultiInputDateRangeField = ({
20
20
  value: valueProp,
21
21
  defaultValue,
22
22
  format,
23
- onChange
23
+ onChange,
24
+ disabled,
25
+ readOnly
24
26
  } = sharedProps;
25
27
  const firstDefaultValue = React.useRef(defaultValue);
26
28
 
@@ -48,6 +50,8 @@ export const useMultiInputDateRangeField = ({
48
50
  const handleStartDateChange = useEventCallback(buildChangeHandler(0));
49
51
  const handleEndDateChange = useEventCallback(buildChangeHandler(1));
50
52
  const startInputProps = _extends({}, inStartInputProps, {
53
+ disabled,
54
+ readOnly,
51
55
  format,
52
56
  value: valueProp === undefined ? undefined : valueProp[0],
53
57
  defaultValue: defaultValue === undefined ? undefined : defaultValue[0],
@@ -55,6 +59,8 @@ export const useMultiInputDateRangeField = ({
55
59
  });
56
60
  const endInputProps = _extends({}, inEndInputProps, {
57
61
  format,
62
+ disabled,
63
+ readOnly,
58
64
  value: valueProp === undefined ? undefined : valueProp[1],
59
65
  defaultValue: defaultValue === undefined ? undefined : defaultValue[1],
60
66
  onChange: handleEndDateChange
@@ -36,7 +36,9 @@ export const useMultiInputDateTimeRangeField = ({
36
36
  value: valueProp,
37
37
  defaultValue,
38
38
  format,
39
- onChange
39
+ onChange,
40
+ disabled,
41
+ readOnly
40
42
  } = sharedProps;
41
43
  const firstDefaultValue = React.useRef(defaultValue);
42
44
 
@@ -65,12 +67,16 @@ export const useMultiInputDateTimeRangeField = ({
65
67
  const handleEndDateChange = useEventCallback(buildChangeHandler(1));
66
68
  const startInputProps = _extends({}, inStartInputProps, {
67
69
  format,
70
+ disabled,
71
+ readOnly,
68
72
  value: valueProp === undefined ? undefined : valueProp[0],
69
73
  defaultValue: defaultValue === undefined ? undefined : defaultValue[0],
70
74
  onChange: handleStartDateChange
71
75
  });
72
76
  const endInputProps = _extends({}, inEndInputProps, {
73
77
  format,
78
+ disabled,
79
+ readOnly,
74
80
  value: valueProp === undefined ? undefined : valueProp[1],
75
81
  defaultValue: defaultValue === undefined ? undefined : defaultValue[1],
76
82
  onChange: handleEndDateChange
@@ -2,8 +2,10 @@ import { UseFieldResponse } from '@mui/x-date-pickers/internals';
2
2
  export interface UseMultiInputRangeFieldResponse<TChildProps extends {}> {
3
3
  startDate: UseFieldResponse<TChildProps> & {
4
4
  error: boolean;
5
+ readOnly: boolean;
5
6
  };
6
7
  endDate: UseFieldResponse<TChildProps> & {
7
8
  error: boolean;
9
+ readOnly: boolean;
8
10
  };
9
11
  }
@@ -32,7 +32,9 @@ export const useMultiInputTimeRangeField = ({
32
32
  value: valueProp,
33
33
  defaultValue,
34
34
  format,
35
- onChange
35
+ onChange,
36
+ disabled,
37
+ readOnly
36
38
  } = sharedProps;
37
39
  const firstDefaultValue = React.useRef(defaultValue);
38
40
 
@@ -61,12 +63,16 @@ export const useMultiInputTimeRangeField = ({
61
63
  const handleEndDateChange = useEventCallback(buildChangeHandler(1));
62
64
  const startInputProps = _extends({}, inStartInputProps, {
63
65
  format,
66
+ disabled,
67
+ readOnly,
64
68
  value: valueProp === undefined ? undefined : valueProp[0],
65
69
  defaultValue: defaultValue === undefined ? undefined : defaultValue[0],
66
70
  onChange: handleStartDateChange
67
71
  });
68
72
  const endInputProps = _extends({}, inEndInputProps, {
69
73
  format,
74
+ disabled,
75
+ readOnly,
70
76
  value: valueProp === undefined ? undefined : valueProp[1],
71
77
  defaultValue: defaultValue === undefined ? undefined : defaultValue[1],
72
78
  onChange: handleEndDateChange
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { PickersInputLocaleText } from '@mui/x-date-pickers';
2
3
  import { DateOrTimeView, UsePickerResponse, WrapperVariant } from '@mui/x-date-pickers/internals';
3
4
  import { DateRange, RangePosition } from '../models';
4
5
  interface UseRangePickerFieldParams<TDate, TView extends DateOrTimeView> extends Pick<UsePickerResponse<DateRange<TDate>, TView, any>, 'open' | 'actions'> {
@@ -9,12 +10,12 @@ interface UseRangePickerFieldParams<TDate, TView extends DateOrTimeView> extends
9
10
  onBlur?: () => void;
10
11
  rangePosition: RangePosition;
11
12
  onRangePositionChange: (newPosition: RangePosition) => void;
13
+ localeText: PickersInputLocaleText<TDate> | undefined;
12
14
  }
13
- export declare const useRangePickerInputProps: <TDate, TView extends DateOrTimeView>({ wrapperVariant, open, actions, readOnly, disabled, disableOpenPicker, onBlur, rangePosition, onRangePositionChange, }: UseRangePickerFieldParams<TDate, TView>) => {
15
+ export declare const useRangePickerInputProps: <TDate, TView extends DateOrTimeView>({ wrapperVariant, open, actions, readOnly, disabled, disableOpenPicker, onBlur, rangePosition, onRangePositionChange, localeText: inLocaleText, }: UseRangePickerFieldParams<TDate, TView>) => {
14
16
  startInput: {
15
- inputProps: {
16
- readOnly: boolean;
17
- };
17
+ readOnly: boolean;
18
+ disabled: boolean | undefined;
18
19
  onClick?: ((event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void) | undefined;
19
20
  inputRef: React.RefObject<HTMLInputElement>;
20
21
  label: string;
@@ -23,9 +24,8 @@ export declare const useRangePickerInputProps: <TDate, TView extends DateOrTimeV
23
24
  focused: boolean | undefined;
24
25
  };
25
26
  endInput: {
26
- inputProps: {
27
- readOnly: boolean;
28
- };
27
+ readOnly: boolean;
28
+ disabled: boolean | undefined;
29
29
  onClick?: ((event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void) | undefined;
30
30
  inputRef: React.RefObject<HTMLInputElement>;
31
31
  label: string;
@@ -10,8 +10,10 @@ export const useRangePickerInputProps = ({
10
10
  disableOpenPicker,
11
11
  onBlur,
12
12
  rangePosition,
13
- onRangePositionChange
13
+ onRangePositionChange,
14
+ localeText: inLocaleText
14
15
  }) => {
16
+ var _inLocaleText$start, _inLocaleText$end;
15
17
  const localeText = useLocaleText();
16
18
  const startRef = React.useRef(null);
17
19
  const endRef = React.useRef(null);
@@ -28,14 +30,14 @@ export const useRangePickerInputProps = ({
28
30
  }
29
31
  }, [rangePosition, open]);
30
32
  const openRangeStartSelection = event => {
31
- event == null ? void 0 : event.stopPropagation();
33
+ event.stopPropagation();
32
34
  onRangePositionChange('start');
33
35
  if (!readOnly && !disableOpenPicker) {
34
36
  actions.onOpen();
35
37
  }
36
38
  };
37
39
  const openRangeEndSelection = event => {
38
- event == null ? void 0 : event.stopPropagation();
40
+ event.stopPropagation();
39
41
  onRangePositionChange('end');
40
42
  if (!readOnly && !disableOpenPicker) {
41
43
  actions.onOpen();
@@ -51,31 +53,30 @@ export const useRangePickerInputProps = ({
51
53
  onRangePositionChange('end');
52
54
  }
53
55
  };
56
+ const readOnlyInput = readOnly != null ? readOnly : wrapperVariant === 'mobile';
54
57
  const startInputProps = _extends({
55
58
  inputRef: startRef,
56
- label: localeText.start,
59
+ label: (_inLocaleText$start = inLocaleText == null ? void 0 : inLocaleText.start) != null ? _inLocaleText$start : localeText.start,
57
60
  onKeyDown: onSpaceOrEnter(openRangeStartSelection),
58
61
  onFocus: focusOnRangeStart,
59
62
  focused: open ? rangePosition === 'start' : undefined
60
63
  }, !readOnly && !disabled && {
61
64
  onClick: openRangeStartSelection
62
65
  }, {
63
- inputProps: {
64
- readOnly: wrapperVariant === 'mobile'
65
- }
66
+ readOnly: readOnlyInput,
67
+ disabled
66
68
  });
67
69
  const endInputProps = _extends({
68
70
  inputRef: endRef,
69
- label: localeText.end,
71
+ label: (_inLocaleText$end = inLocaleText == null ? void 0 : inLocaleText.end) != null ? _inLocaleText$end : localeText.end,
70
72
  onKeyDown: onSpaceOrEnter(openRangeEndSelection),
71
73
  onFocus: focusOnRangeEnd,
72
74
  focused: open ? rangePosition === 'end' : undefined
73
75
  }, !readOnly && !disabled && {
74
76
  onClick: openRangeEndSelection
75
77
  }, {
76
- inputProps: {
77
- readOnly: wrapperVariant === 'mobile'
78
- }
78
+ readOnly: readOnlyInput,
79
+ disabled
79
80
  });
80
81
  const rootProps = {
81
82
  onBlur
@@ -5,6 +5,6 @@ import { UseStaticRangePickerParams, UseStaticRangePickerProps } from './useStat
5
5
  * Hook managing all the range static pickers:
6
6
  * - StaticDateRangePicker
7
7
  */
8
- export declare const useStaticRangePicker: <TDate, TView extends DateOrTimeView, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any>>({ props, valueManager, viewLookup, validator, ref, }: UseStaticRangePickerParams<TDate, TView, TExternalProps>) => {
8
+ export declare const useStaticRangePicker: <TDate, TView extends DateOrTimeView, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>>({ props, valueManager, validator, ref, }: UseStaticRangePickerParams<TDate, TView, TExternalProps>) => {
9
9
  renderPicker: () => JSX.Element;
10
10
  };
@@ -19,7 +19,6 @@ const PickerStaticViewLayout = styled(PickersViewLayout)(({
19
19
  export const useStaticRangePicker = ({
20
20
  props,
21
21
  valueManager,
22
- viewLookup,
23
22
  validator,
24
23
  ref
25
24
  }) => {
@@ -27,7 +26,8 @@ export const useStaticRangePicker = ({
27
26
  localeText,
28
27
  components,
29
28
  componentsProps,
30
- displayStaticWrapperAs
29
+ displayStaticWrapperAs,
30
+ autoFocus
31
31
  } = props;
32
32
  const [rangePosition, setRangePosition] = React.useState('start');
33
33
  const {
@@ -35,9 +35,9 @@ export const useStaticRangePicker = ({
35
35
  renderCurrentView
36
36
  } = usePicker({
37
37
  props,
38
- viewLookup,
39
38
  valueManager,
40
39
  validator,
40
+ autoFocusView: autoFocus != null ? autoFocus : false,
41
41
  additionalViewProps: {},
42
42
  wrapperVariant: displayStaticWrapperAs
43
43
  });
@@ -8,7 +8,7 @@ export interface UseStaticRangePickerSlotsComponentsProps<TDate, TView extends D
8
8
  }
9
9
  export interface StaticRangeOnlyPickerProps extends StaticOnlyPickerProps {
10
10
  }
11
- export interface UseStaticRangePickerProps<TDate, TView extends DateOrTimeView, TError> extends BaseNextPickerProps<DateRange<TDate>, TDate, TView, TError>, StaticRangeOnlyPickerProps {
11
+ export interface UseStaticRangePickerProps<TDate, TView extends DateOrTimeView, TError, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>> extends BaseNextPickerProps<DateRange<TDate>, TDate, TView, TError, TExternalProps, {}>, StaticRangeOnlyPickerProps {
12
12
  /**
13
13
  * Overrideable components.
14
14
  * @default {}
@@ -20,7 +20,7 @@ export interface UseStaticRangePickerProps<TDate, TView extends DateOrTimeView,
20
20
  */
21
21
  componentsProps?: UseStaticRangePickerSlotsComponentsProps<TDate, TView>;
22
22
  }
23
- export interface UseStaticRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, TExternalProps, {}>, 'valueManager' | 'viewLookup' | 'validator'> {
23
+ export interface UseStaticRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, TExternalProps, {}>, 'valueManager' | 'validator'> {
24
24
  props: TExternalProps;
25
25
  /**
26
26
  * Ref to pass to the root element
@@ -14,6 +14,16 @@ export interface DayRangeValidationProps<TDate> {
14
14
  */
15
15
  shouldDisableDate?: (day: TDate, position: 'start' | 'end') => boolean;
16
16
  }
17
- export interface UseDateRangeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<DateRange<TDate>, DateRangeValidationError>, 'format'>, DayRangeValidationProps<TDate>, BaseDateValidationProps<TDate> {
17
+ /**
18
+ * Props used in every range picker.
19
+ */
20
+ export interface BaseRangeProps {
21
+ /**
22
+ * If `true`, the component is disabled.
23
+ * @default false
24
+ */
25
+ disabled?: boolean;
26
+ }
27
+ export interface UseDateRangeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<DateRange<TDate>, DateRangeValidationError>, 'format'>, DayRangeValidationProps<TDate>, BaseDateValidationProps<TDate>, BaseRangeProps {
18
28
  }
19
29
  export type UseDateRangeFieldDefaultizedProps<TDate> = DefaultizedProps<UseDateRangeFieldProps<TDate>, keyof BaseDateValidationProps<TDate> | 'format'>;
@@ -1,8 +1,8 @@
1
1
  import { BaseDateValidationProps, TimeValidationProps, DefaultizedProps, MakeOptional, UseFieldInternalProps } from '@mui/x-date-pickers/internals';
2
- import { DayRangeValidationProps } from './dateRange';
2
+ import { BaseRangeProps, DayRangeValidationProps } from './dateRange';
3
3
  import { DateRange } from './range';
4
4
  import { DateTimeRangeValidationError } from '../hooks/validation/useDateTimeRangeValidation';
5
- export interface UseDateTimeRangeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<DateRange<TDate>, DateTimeRangeValidationError>, 'format'>, DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, BaseDateValidationProps<TDate> {
5
+ export interface UseDateTimeRangeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<DateRange<TDate>, DateTimeRangeValidationError>, 'format'>, DayRangeValidationProps<TDate>, TimeValidationProps<TDate>, BaseDateValidationProps<TDate>, BaseRangeProps {
6
6
  /**
7
7
  * Minimal selectable moment of time with binding to date, to set min time in each day use `minTime`.
8
8
  */
@@ -3,7 +3,12 @@ import { SlotComponentProps } from '@mui/base/utils';
3
3
  import TextField, { TextFieldProps } from '@mui/material/TextField';
4
4
  import Stack, { StackProps } from '@mui/material/Stack';
5
5
  import Typography, { TypographyProps } from '@mui/material/Typography';
6
- import { BaseFieldProps } from '@mui/x-date-pickers/internals';
6
+ import { BaseFieldProps, FieldSection } from '@mui/x-date-pickers/internals';
7
+ export interface RangeFieldSection extends FieldSection {
8
+ dateName: 'start' | 'end';
9
+ }
10
+ export interface RangeFieldSectionWithoutPosition extends Omit<RangeFieldSection, 'start' | 'end' | 'startInInput' | 'endInInput'> {
11
+ }
7
12
  export interface BaseMultiInputFieldProps<TValue, TError> extends Omit<BaseFieldProps<TValue, TError>, 'components' | 'componentsProps'> {
8
13
  components?: {
9
14
  Root?: React.ElementType<StackProps>;
@@ -1,4 +1,3 @@
1
- import { FieldSection } from '@mui/x-date-pickers/internals';
2
1
  export type DateRange<TDate> = [TDate | null, TDate | null];
3
2
  export type NonEmptyDateRange<TDate> = [TDate, TDate];
4
3
  export type RangePosition = 'start' | 'end';
@@ -6,6 +5,3 @@ export interface RangePositionProps {
6
5
  rangePosition: RangePosition;
7
6
  onRangePositionChange: (newPosition: RangePosition) => void;
8
7
  }
9
- export interface DateRangeFieldSection extends FieldSection {
10
- dateName: 'start' | 'end';
11
- }
@@ -1,7 +1,8 @@
1
1
  import { BaseTimeValidationProps, TimeValidationProps, DefaultizedProps, MakeOptional, UseFieldInternalProps } from '@mui/x-date-pickers/internals';
2
2
  import { DateRange } from './range';
3
3
  import { TimeRangeValidationError } from '../hooks/validation/useTimeRangeValidation';
4
- export interface UseTimeRangeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<DateRange<TDate>, TimeRangeValidationError>, 'format'>, TimeValidationProps<TDate>, BaseTimeValidationProps {
4
+ import { BaseRangeProps } from './dateRange';
5
+ export interface UseTimeRangeFieldProps<TDate> extends MakeOptional<UseFieldInternalProps<DateRange<TDate>, TimeRangeValidationError>, 'format'>, TimeValidationProps<TDate>, BaseTimeValidationProps, BaseRangeProps {
5
6
  /**
6
7
  * 12h/24h view for hour selection clock.
7
8
  * @default `utils.is12HourCycleInCurrentLocale()`
@@ -1,6 +1,22 @@
1
- import { DateRangeFieldSection } from '../models/range';
2
- export declare const splitDateRangeSections: (sections: DateRangeFieldSection[]) => {
3
- startDate: DateRangeFieldSection[];
4
- endDate: DateRangeFieldSection[];
1
+ import { RangeFieldSection } from '../models/fields';
2
+ export declare const splitDateRangeSections: (sections: RangeFieldSection[]) => {
3
+ startDate: RangeFieldSection[];
4
+ endDate: RangeFieldSection[];
5
5
  };
6
- export declare const removeLastSeparator: (dateSections: DateRangeFieldSection[]) => DateRangeFieldSection[];
6
+ export declare const removeLastSeparator: (dateSections: RangeFieldSection[]) => (RangeFieldSection | {
7
+ separator: null;
8
+ dateName: "start" | "end";
9
+ start: number;
10
+ end: number;
11
+ startInInput: number;
12
+ endInInput: number;
13
+ value: string;
14
+ placeholder: string;
15
+ startSeparator: string;
16
+ endSeparator: string;
17
+ dateSectionName: import("@mui/x-date-pickers").MuiDateSectionName;
18
+ contentType: "digit" | "letter";
19
+ formatValue: string;
20
+ edited: boolean;
21
+ hasTrailingZeroes: boolean;
22
+ })[];
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTY3MDQ1NDAwMDAwMA==";
3
+ const releaseInfo = "MTY3MTgzMjgwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -1,8 +1,9 @@
1
1
  import { PickerStateValueManager, FieldValueManager } from '@mui/x-date-pickers/internals';
2
- import { DateRange, DateRangeFieldSection } from '../models/range';
2
+ import { DateRange } from '../models/range';
3
3
  import type { DateRangeValidationError } from '../hooks/validation/useDateRangeValidation';
4
4
  import type { TimeRangeValidationError } from '../hooks/validation/useTimeRangeValidation';
5
5
  import type { DateTimeRangeValidationError } from '../hooks/validation/useDateTimeRangeValidation';
6
+ import { RangeFieldSection } from '../models/fields';
6
7
  export type RangePickerStateValueManager<TValue = [any, any], TDate = any, TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerStateValueManager<TValue, TDate, TError>;
7
8
  export declare const rangeValueManager: RangePickerStateValueManager;
8
- export declare const rangeFieldValueManager: FieldValueManager<DateRange<any>, any, DateRangeFieldSection, DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError>;
9
+ export declare const rangeFieldValueManager: FieldValueManager<DateRange<any>, any, RangeFieldSection, DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError>;
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { replaceInvalidDateByNull, splitFormatIntoSections, addPositionPropertiesToSections, createDateStrFromSections } from '@mui/x-date-pickers/internals';
2
+ import { replaceInvalidDateByNull, splitFormatIntoSections, addPositionPropertiesToSections, createDateStrForInputFromSections, getSectionOrder } from '@mui/x-date-pickers/internals';
3
3
  import { splitDateRangeSections, removeLastSeparator } from './date-fields-utils';
4
4
  export const rangeValueManager = {
5
5
  emptyValue: [null, null],
@@ -29,36 +29,29 @@ export const rangeFieldValueManager = {
29
29
  startDate: null,
30
30
  endDate: null
31
31
  } : splitDateRangeSections(prevSections);
32
- const getSections = (newDate, prevDateSections) => {
32
+ const getSections = (newDate, prevDateSections, position) => {
33
33
  const shouldReUsePrevDateSections = !utils.isValid(newDate) && !!prevDateSections;
34
34
  if (shouldReUsePrevDateSections) {
35
35
  return prevDateSections;
36
36
  }
37
- return splitFormatIntoSections(utils, localeText, format, newDate);
38
- };
39
- const rawSectionsOfStartDate = getSections(start, prevDateRangeSections.startDate);
40
- const rawSectionsOfEndDate = getSections(end, prevDateRangeSections.endDate);
41
- const sectionsOfStartDate = rawSectionsOfStartDate.map((section, sectionIndex) => {
42
- if (sectionIndex === rawSectionsOfStartDate.length - 1) {
37
+ const sections = splitFormatIntoSections(utils, localeText, format, newDate);
38
+ return sections.map((section, sectionIndex) => {
39
+ if (sectionIndex === sections.length - 1 && position === 'start') {
40
+ return _extends({}, section, {
41
+ dateName: position,
42
+ endSeparator: `${section.endSeparator}\u2069 \u2066`
43
+ });
44
+ }
43
45
  return _extends({}, section, {
44
- dateName: 'start',
45
- separator: ' – '
46
+ dateName: position
46
47
  });
47
- }
48
- return _extends({}, section, {
49
- dateName: 'start'
50
48
  });
51
- });
52
- const sectionsOfEndDate = rawSectionsOfEndDate.map(section => _extends({}, section, {
53
- dateName: 'end'
54
- }));
55
- return addPositionPropertiesToSections([...sectionsOfStartDate, ...sectionsOfEndDate]);
49
+ };
50
+ return addPositionPropertiesToSections([...getSections(start, prevDateRangeSections.startDate, 'start'), ...getSections(end, prevDateRangeSections.endDate, 'end')]);
56
51
  },
57
52
  getValueStrFromSections: sections => {
58
53
  const dateRangeSections = splitDateRangeSections(sections);
59
- const startDateStr = createDateStrFromSections(dateRangeSections.startDate, true);
60
- const endDateStr = createDateStrFromSections(dateRangeSections.endDate, true);
61
- return `${startDateStr}${endDateStr}`;
54
+ return createDateStrForInputFromSections([...dateRangeSections.startDate, ...dateRangeSections.endDate]);
62
55
  },
63
56
  getActiveDateSections: (sections, activeSection) => {
64
57
  const index = activeSection.dateName === 'start' ? 0 : 1;
@@ -87,5 +80,11 @@ export const rangeFieldValueManager = {
87
80
  })
88
81
  };
89
82
  },
90
- hasError: error => error[0] != null || error[1] != null
83
+ hasError: error => error[0] != null || error[1] != null,
84
+ getSectionOrder: (utils, localeText, format, isRTL) => {
85
+ const splitedFormat = splitFormatIntoSections(utils, localeText, format, null);
86
+ return getSectionOrder([...splitedFormat.slice(0, splitedFormat.length - 1), _extends({}, splitedFormat[splitedFormat.length - 1], {
87
+ endSeparator: ' – '
88
+ }), ...splitedFormat], isRTL);
89
+ }
91
90
  };