@mui/x-date-pickers-pro 8.0.0-beta.2 → 8.0.0-beta.3

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 (87) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/DesktopDateRangePicker/DesktopDateRangePicker.js +2 -1
  3. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +9 -1
  4. package/DesktopTimeRangePicker/DesktopTimeRangePicker.js +9 -1
  5. package/MobileDateRangePicker/MobileDateRangePicker.js +2 -1
  6. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -1
  7. package/MobileTimeRangePicker/MobileTimeRangePicker.js +9 -1
  8. package/SingleInputDateRangeField/SingleInputDateRangeField.js +4 -4
  9. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +4 -4
  10. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +4 -4
  11. package/StaticDateRangePicker/StaticDateRangePicker.js +2 -1
  12. package/esm/DesktopDateRangePicker/DesktopDateRangePicker.js +2 -1
  13. package/esm/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +9 -1
  14. package/esm/DesktopTimeRangePicker/DesktopTimeRangePicker.js +9 -1
  15. package/esm/MobileDateRangePicker/MobileDateRangePicker.js +2 -1
  16. package/esm/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +16 -2
  17. package/esm/MobileTimeRangePicker/MobileTimeRangePicker.js +9 -1
  18. package/esm/SingleInputDateRangeField/SingleInputDateRangeField.js +4 -4
  19. package/esm/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +4 -4
  20. package/esm/SingleInputTimeRangeField/SingleInputTimeRangeField.js +4 -4
  21. package/esm/StaticDateRangePicker/StaticDateRangePicker.js +2 -1
  22. package/esm/index.js +1 -1
  23. package/esm/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -0
  24. package/esm/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +10 -3
  25. package/esm/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +3 -3
  26. package/esm/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -0
  27. package/esm/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +10 -3
  28. package/esm/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +3 -3
  29. package/esm/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -0
  30. package/esm/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -3
  31. package/esm/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +7 -0
  32. package/esm/internals/models/rangePickerProps.d.ts +14 -0
  33. package/esm/internals/utils/createRangePickerStepNavigation.d.ts +16 -0
  34. package/esm/internals/utils/createRangePickerStepNavigation.js +31 -0
  35. package/esm/internals/utils/releaseInfo.js +1 -1
  36. package/index.js +1 -1
  37. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -0
  38. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +10 -3
  39. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +3 -3
  40. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -0
  41. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +10 -3
  42. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +3 -3
  43. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -0
  44. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -3
  45. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +7 -0
  46. package/internals/models/rangePickerProps.d.ts +14 -0
  47. package/internals/utils/createRangePickerStepNavigation.d.ts +16 -0
  48. package/internals/utils/createRangePickerStepNavigation.js +37 -0
  49. package/internals/utils/releaseInfo.js +1 -1
  50. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +2 -1
  51. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +9 -1
  52. package/modern/DesktopTimeRangePicker/DesktopTimeRangePicker.js +9 -1
  53. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +2 -1
  54. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +16 -2
  55. package/modern/MobileTimeRangePicker/MobileTimeRangePicker.js +9 -1
  56. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +4 -4
  57. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +4 -4
  58. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +4 -4
  59. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +2 -1
  60. package/modern/index.js +1 -1
  61. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -0
  62. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +10 -3
  63. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +3 -3
  64. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -0
  65. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +10 -3
  66. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +3 -3
  67. package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -0
  68. package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -3
  69. package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +7 -0
  70. package/modern/internals/models/rangePickerProps.d.ts +14 -0
  71. package/modern/internals/utils/createRangePickerStepNavigation.d.ts +16 -0
  72. package/modern/internals/utils/createRangePickerStepNavigation.js +31 -0
  73. package/modern/internals/utils/releaseInfo.js +1 -1
  74. package/package.json +8 -8
  75. package/tsconfig.build.tsbuildinfo +1 -1
  76. package/esm/internals/hooks/models/index.d.ts +0 -1
  77. package/esm/internals/hooks/models/index.js +0 -1
  78. package/esm/internals/hooks/models/useRangePicker.d.ts +0 -8
  79. package/esm/internals/hooks/models/useRangePicker.js +0 -1
  80. package/internals/hooks/models/index.d.ts +0 -1
  81. package/internals/hooks/models/index.js +0 -5
  82. package/internals/hooks/models/useRangePicker.d.ts +0 -8
  83. package/internals/hooks/models/useRangePicker.js +0 -5
  84. package/modern/internals/hooks/models/index.d.ts +0 -1
  85. package/modern/internals/hooks/models/index.js +0 -1
  86. package/modern/internals/hooks/models/useRangePicker.d.ts +0 -8
  87. package/modern/internals/hooks/models/useRangePicker.js +0 -1
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v8.0.0-beta.2
2
+ * @mui/x-date-pickers-pro v8.0.0-beta.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -3,6 +3,7 @@ import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
3
3
  import { UseDesktopRangePickerParams, UseDesktopRangePickerProps } from "./useDesktopRangePicker.types.js";
4
4
  export declare const useDesktopRangePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseDesktopRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({
5
5
  props,
6
+ steps,
6
7
  ...pickerParams
7
8
  }: UseDesktopRangePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
8
9
  renderPicker: () => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["props"],
3
+ const _excluded = ["props", "steps"],
4
4
  _excluded2 = ["ownerState"];
5
5
  import * as React from 'react';
6
6
  import useSlotProps from '@mui/utils/useSlotProps';
@@ -11,11 +11,13 @@ import { getReleaseInfo } from "../../utils/releaseInfo.js";
11
11
  import { useRangePosition } from "../useRangePosition.js";
12
12
  import { PickerRangePositionContext } from "../../../hooks/usePickerRangePositionContext.js";
13
13
  import { getRangeFieldType } from "../../utils/date-fields-utils.js";
14
+ import { createRangePickerStepNavigation } from "../../utils/createRangePickerStepNavigation.js";
14
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
16
  const releaseInfo = getReleaseInfo();
16
17
  export const useDesktopRangePicker = _ref => {
17
18
  let {
18
- props
19
+ props,
20
+ steps
19
21
  } = _ref,
20
22
  pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
21
23
  useLicenseVerifier('x-date-pickers-pro', releaseInfo);
@@ -28,6 +30,10 @@ export const useDesktopRangePicker = _ref => {
28
30
  const fieldType = getRangeFieldType(slots.field);
29
31
  const viewContainerRole = fieldType === 'single-input' ? 'dialog' : 'tooltip';
30
32
  const rangePositionResponse = useRangePosition(props);
33
+ const getStepNavigation = createRangePickerStepNavigation({
34
+ steps,
35
+ rangePositionResponse
36
+ });
31
37
  const {
32
38
  providerProps,
33
39
  renderCurrentView,
@@ -37,7 +43,8 @@ export const useDesktopRangePicker = _ref => {
37
43
  variant: 'desktop',
38
44
  autoFocusView: viewContainerRole === 'dialog',
39
45
  viewContainerRole,
40
- localeText
46
+ localeText,
47
+ getStepNavigation
41
48
  }));
42
49
  const Field = slots.field;
43
50
  const _useSlotProps = useSlotProps({
@@ -2,7 +2,7 @@ import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
2
2
  import { PickerFieldSlotProps, PickerOwnerState } from '@mui/x-date-pickers/models';
3
3
  import { PickerPopperSlots, PickerPopperSlotProps, UsePickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue, PickerFieldUISlotsFromContext, PickerFieldUISlotPropsFromContext } from '@mui/x-date-pickers/internals';
4
4
  import { ExportedPickersLayoutSlotProps, ExportedPickersLayoutSlots } from '@mui/x-date-pickers/PickersLayout';
5
- import { RangeOnlyPickerProps, UseRangePickerParams, UseRangePickerProps } from "../models/useRangePicker.js";
5
+ import { NonStaticRangePickerProps, NonStaticRangePickerHookParameters, UseRangePickerProps } from "../../models/index.js";
6
6
  export interface UseDesktopRangePickerSlots extends PickerPopperSlots, ExportedPickersLayoutSlots<PickerRangeValue>, PickerFieldUISlotsFromContext {
7
7
  /**
8
8
  * Component used to enter the date with the keyboard.
@@ -14,7 +14,7 @@ export interface UseDesktopRangePickerSlotProps<TEnableAccessibleFieldDOMStructu
14
14
  dateSeparator?: string;
15
15
  }, {}, PickerOwnerState>;
16
16
  }
17
- export interface DesktopRangeOnlyPickerProps extends RangeOnlyPickerProps {
17
+ export interface DesktopRangeOnlyPickerProps extends NonStaticRangePickerProps {
18
18
  /**
19
19
  * If `true`, the start `input` element is focused during the first mount.
20
20
  */
@@ -32,4 +32,4 @@ export interface UseDesktopRangePickerProps<TView extends DateOrTimeViewWithMeri
32
32
  */
33
33
  slotProps?: UseDesktopRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
34
34
  }
35
- export interface UseDesktopRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseDesktopRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends UseRangePickerParams<TView, TExternalProps> {}
35
+ export interface UseDesktopRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseDesktopRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends NonStaticRangePickerHookParameters<TView, TExternalProps> {}
@@ -3,6 +3,7 @@ import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
3
3
  import { UseMobileRangePickerParams, UseMobileRangePickerProps } from "./useMobileRangePicker.types.js";
4
4
  export declare const useMobileRangePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({
5
5
  props,
6
+ steps,
6
7
  ...pickerParams
7
8
  }: UseMobileRangePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
8
9
  renderPicker: () => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["props"],
3
+ const _excluded = ["props", "steps"],
4
4
  _excluded2 = ["ownerState"];
5
5
  import * as React from 'react';
6
6
  import useSlotProps from '@mui/utils/useSlotProps';
@@ -13,11 +13,13 @@ import { getReleaseInfo } from "../../utils/releaseInfo.js";
13
13
  import { useRangePosition } from "../useRangePosition.js";
14
14
  import { PickerRangePositionContext } from "../../../hooks/usePickerRangePositionContext.js";
15
15
  import { getRangeFieldType } from "../../utils/date-fields-utils.js";
16
+ import { createRangePickerStepNavigation } from "../../utils/createRangePickerStepNavigation.js";
16
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
18
  const releaseInfo = getReleaseInfo();
18
19
  export const useMobileRangePicker = _ref => {
19
20
  let {
20
- props
21
+ props,
22
+ steps
21
23
  } = _ref,
22
24
  pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
23
25
  useLicenseVerifier('x-date-pickers-pro', releaseInfo);
@@ -31,6 +33,10 @@ export const useMobileRangePicker = _ref => {
31
33
  const fieldType = getRangeFieldType(slots.field);
32
34
  const rangePositionResponse = useRangePosition(props);
33
35
  const contextTranslations = usePickerTranslations();
36
+ const getStepNavigation = createRangePickerStepNavigation({
37
+ steps,
38
+ rangePositionResponse
39
+ });
34
40
  const {
35
41
  providerProps,
36
42
  renderCurrentView,
@@ -40,7 +46,8 @@ export const useMobileRangePicker = _ref => {
40
46
  variant: 'mobile',
41
47
  autoFocusView: true,
42
48
  viewContainerRole: 'dialog',
43
- localeText
49
+ localeText,
50
+ getStepNavigation
44
51
  }));
45
52
  const labelId = providerProps.privateContextValue.labelId;
46
53
  const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
@@ -2,7 +2,7 @@ import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
2
2
  import { PickerFieldSlotProps, PickerOwnerState } from '@mui/x-date-pickers/models';
3
3
  import { PickersModalDialogSlots, PickersModalDialogSlotProps, UsePickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue, PickerFieldUISlotsFromContext, PickerFieldUISlotPropsFromContext } from '@mui/x-date-pickers/internals';
4
4
  import { ExportedPickersLayoutSlotProps, ExportedPickersLayoutSlots, PickersLayoutSlotProps } from '@mui/x-date-pickers/PickersLayout';
5
- import { RangeOnlyPickerProps, UseRangePickerParams, UseRangePickerProps } from "../models/useRangePicker.js";
5
+ import { NonStaticRangePickerProps, NonStaticRangePickerHookParameters, UseRangePickerProps } from "../../models/index.js";
6
6
  export interface UseMobileRangePickerSlots extends PickersModalDialogSlots, ExportedPickersLayoutSlots<PickerRangeValue>, PickerFieldUISlotsFromContext {
7
7
  /**
8
8
  * Component used to enter the date with the keyboard.
@@ -15,7 +15,7 @@ export interface ExportedUseMobileRangePickerSlotProps<TEnableAccessibleFieldDOM
15
15
  }, {}, PickerOwnerState>;
16
16
  }
17
17
  export interface UseMobileRangePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends ExportedUseMobileRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>, Pick<PickersLayoutSlotProps<PickerRangeValue>, 'toolbar'> {}
18
- export interface MobileRangeOnlyPickerProps extends RangeOnlyPickerProps {}
18
+ export interface MobileRangeOnlyPickerProps extends NonStaticRangePickerProps {}
19
19
  export interface UseMobileRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerProps<PickerRangeValue, TView, TError, any>> extends UseRangePickerProps<TView, TError, TExternalProps> {
20
20
  /**
21
21
  * Overridable component slots.
@@ -28,4 +28,4 @@ export interface UseMobileRangePickerProps<TView extends DateOrTimeViewWithMerid
28
28
  */
29
29
  slotProps?: UseMobileRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
30
30
  }
31
- export interface UseMobileRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends UseRangePickerParams<TView, TExternalProps> {}
31
+ export interface UseMobileRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends NonStaticRangePickerHookParameters<TView, TExternalProps> {}
@@ -7,6 +7,7 @@ import { UseStaticRangePickerParams, UseStaticRangePickerProps } from "./useStat
7
7
  */
8
8
  export declare const useStaticRangePicker: <TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>>({
9
9
  props,
10
+ steps,
10
11
  ...pickerParams
11
12
  }: UseStaticRangePickerParams<TView, TExternalProps>) => {
12
13
  renderPicker: () => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["props"];
3
+ const _excluded = ["props", "steps"];
4
4
  import * as React from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { styled } from '@mui/material/styles';
@@ -8,6 +8,7 @@ import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
8
8
  import { usePicker, DIALOG_WIDTH, PickerProvider, mergeSx } from '@mui/x-date-pickers/internals';
9
9
  import { useRangePosition } from "../useRangePosition.js";
10
10
  import { PickerRangePositionContext } from "../../../hooks/usePickerRangePositionContext.js";
11
+ import { createRangePickerStepNavigation } from "../../utils/createRangePickerStepNavigation.js";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  const PickerStaticLayout = styled(PickersLayout)(({
13
14
  theme
@@ -23,7 +24,8 @@ const PickerStaticLayout = styled(PickersLayout)(({
23
24
  */
24
25
  export const useStaticRangePicker = _ref => {
25
26
  let {
26
- props
27
+ props,
28
+ steps
27
29
  } = _ref,
28
30
  pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
29
31
  const {
@@ -34,6 +36,10 @@ export const useStaticRangePicker = _ref => {
34
36
  autoFocus
35
37
  } = props;
36
38
  const rangePositionResponse = useRangePosition(props);
39
+ const getStepNavigation = createRangePickerStepNavigation({
40
+ steps,
41
+ rangePositionResponse
42
+ });
37
43
  const {
38
44
  providerProps,
39
45
  renderCurrentView
@@ -42,7 +48,8 @@ export const useStaticRangePicker = _ref => {
42
48
  variant: displayStaticWrapperAs,
43
49
  autoFocusView: autoFocus ?? false,
44
50
  viewContainerRole: null,
45
- localeText
51
+ localeText,
52
+ getStepNavigation
46
53
  }));
47
54
  const Layout = slots?.layout ?? PickerStaticLayout;
48
55
  const renderPicker = () => /*#__PURE__*/_jsx(PickerRangePositionContext.Provider, {
@@ -1,6 +1,7 @@
1
1
  import { BasePickerProps, UsePickerParameters, ExportedBaseToolbarProps, StaticOnlyPickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue } from '@mui/x-date-pickers/internals';
2
2
  import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps } from '@mui/x-date-pickers/PickersLayout';
3
3
  import { UseRangePositionProps } from "../useRangePosition.js";
4
+ import { PickerRangeStep } from "../../utils/createRangePickerStepNavigation.js";
4
5
  export interface UseStaticRangePickerSlots extends ExportedPickersLayoutSlots<PickerRangeValue> {}
5
6
  export interface UseStaticRangePickerSlotProps extends ExportedPickersLayoutSlotProps<PickerRangeValue> {
6
7
  toolbar?: ExportedBaseToolbarProps;
@@ -20,4 +21,10 @@ export interface UseStaticRangePickerProps<TView extends DateOrTimeViewWithMerid
20
21
  }
21
22
  export interface UseStaticRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParameters<PickerRangeValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'ref'> {
22
23
  props: TExternalProps;
24
+ /**
25
+ * Steps available for the picker.
26
+ * This will be used to define the behavior of navigation actions.
27
+ * If null, the picker will not have any step navigation.
28
+ */
29
+ steps: PickerRangeStep[] | null;
23
30
  }
@@ -1,4 +1,7 @@
1
+ import { BasePickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue, UsePickerNonStaticProps, UsePickerParameters, UsePickerProps } from '@mui/x-date-pickers/internals';
1
2
  import * as React from 'react';
3
+ import { UseRangePositionProps } from "../hooks/useRangePosition.js";
4
+ import { PickerRangeStep } from "../utils/createRangePickerStepNavigation.js";
2
5
  /**
3
6
  * Props common to all range non-static pickers.
4
7
  * These props are handled by the headless wrappers.
@@ -19,4 +22,15 @@ export interface BaseRangeNonStaticPickerProps {
19
22
  * Ignored if the field has several inputs.
20
23
  */
21
24
  name?: string;
25
+ }
26
+ export interface NonStaticRangePickerProps extends UsePickerNonStaticProps, BaseRangeNonStaticPickerProps, UseRangePositionProps {}
27
+ export interface UseRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerProps<PickerRangeValue, TView, TError, any>> extends NonStaticRangePickerProps, BasePickerProps<PickerRangeValue, TView, TError, TExternalProps> {}
28
+ export interface NonStaticRangePickerHookParameters<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseRangePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParameters<PickerRangeValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'rendererInterceptor' | 'ref'> {
29
+ props: TExternalProps;
30
+ /**
31
+ * Steps available for the picker.
32
+ * This will be used to define the behavior of navigation actions.
33
+ * If null, the picker will not have any step navigation.
34
+ */
35
+ steps: PickerRangeStep[] | null;
22
36
  }
@@ -0,0 +1,16 @@
1
+ import { DateOrTimeViewWithMeridiem, RangePosition } from '@mui/x-date-pickers/internals';
2
+ import { UseRangePositionResponse } from "../hooks/useRangePosition.js";
3
+ export declare function createRangePickerStepNavigation(parameters: CreateRangePickerStepNavigationParameters): import("@mui/x-date-pickers/internals/utils/createStepNavigation").CreateStepNavigationReturnValue;
4
+ export interface PickerRangeStep {
5
+ /**
6
+ * The views that are handled inside this step.
7
+ * If null, all views are handled by this step.
8
+ */
9
+ views: readonly DateOrTimeViewWithMeridiem[] | null;
10
+ rangePosition: RangePosition;
11
+ }
12
+ interface CreateRangePickerStepNavigationParameters {
13
+ steps: PickerRangeStep[] | null;
14
+ rangePositionResponse: UseRangePositionResponse;
15
+ }
16
+ export {};
@@ -0,0 +1,31 @@
1
+ import { createStepNavigation } from '@mui/x-date-pickers/internals';
2
+ export function createRangePickerStepNavigation(parameters) {
3
+ const {
4
+ steps,
5
+ rangePositionResponse
6
+ } = parameters;
7
+ return createStepNavigation({
8
+ steps,
9
+ isCurrentViewMatchingStep: (view, step) => {
10
+ if (step.rangePosition !== rangePositionResponse.rangePosition) {
11
+ return false;
12
+ }
13
+ return step.views == null || step.views.includes(view);
14
+ },
15
+ onStepChange: ({
16
+ step,
17
+ initialView,
18
+ setView,
19
+ view,
20
+ views
21
+ }) => {
22
+ if (step.rangePosition !== rangePositionResponse.rangePosition) {
23
+ rangePositionResponse.setRangePosition(step.rangePosition);
24
+ }
25
+ const targetView = step.views == null ? initialView : step.views.find(viewBis => views.includes(viewBis));
26
+ if (targetView !== view) {
27
+ setView(targetView);
28
+ }
29
+ }
30
+ });
31
+ }
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTc0MzExMjgwMDAwMA==";
3
+ const releaseInfo = "MTc0MzYzMTIwMDAwMA==";
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
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v8.0.0-beta.2
2
+ * @mui/x-date-pickers-pro v8.0.0-beta.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -3,6 +3,7 @@ import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
3
3
  import { UseDesktopRangePickerParams, UseDesktopRangePickerProps } from "./useDesktopRangePicker.types.js";
4
4
  export declare const useDesktopRangePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseDesktopRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({
5
5
  props,
6
+ steps,
6
7
  ...pickerParams
7
8
  }: UseDesktopRangePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
8
9
  renderPicker: () => React.JSX.Element;
@@ -17,13 +17,15 @@ var _releaseInfo = require("../../utils/releaseInfo");
17
17
  var _useRangePosition = require("../useRangePosition");
18
18
  var _usePickerRangePositionContext = require("../../../hooks/usePickerRangePositionContext");
19
19
  var _dateFieldsUtils = require("../../utils/date-fields-utils");
20
+ var _createRangePickerStepNavigation = require("../../utils/createRangePickerStepNavigation");
20
21
  var _jsxRuntime = require("react/jsx-runtime");
21
- const _excluded = ["props"],
22
+ const _excluded = ["props", "steps"],
22
23
  _excluded2 = ["ownerState"];
23
24
  const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
24
25
  const useDesktopRangePicker = _ref => {
25
26
  let {
26
- props
27
+ props,
28
+ steps
27
29
  } = _ref,
28
30
  pickerParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
29
31
  (0, _xLicense.useLicenseVerifier)('x-date-pickers-pro', releaseInfo);
@@ -36,6 +38,10 @@ const useDesktopRangePicker = _ref => {
36
38
  const fieldType = (0, _dateFieldsUtils.getRangeFieldType)(slots.field);
37
39
  const viewContainerRole = fieldType === 'single-input' ? 'dialog' : 'tooltip';
38
40
  const rangePositionResponse = (0, _useRangePosition.useRangePosition)(props);
41
+ const getStepNavigation = (0, _createRangePickerStepNavigation.createRangePickerStepNavigation)({
42
+ steps,
43
+ rangePositionResponse
44
+ });
39
45
  const {
40
46
  providerProps,
41
47
  renderCurrentView,
@@ -45,7 +51,8 @@ const useDesktopRangePicker = _ref => {
45
51
  variant: 'desktop',
46
52
  autoFocusView: viewContainerRole === 'dialog',
47
53
  viewContainerRole,
48
- localeText
54
+ localeText,
55
+ getStepNavigation
49
56
  }));
50
57
  const Field = slots.field;
51
58
  const _useSlotProps = (0, _useSlotProps2.default)({
@@ -2,7 +2,7 @@ import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
2
2
  import { PickerFieldSlotProps, PickerOwnerState } from '@mui/x-date-pickers/models';
3
3
  import { PickerPopperSlots, PickerPopperSlotProps, UsePickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue, PickerFieldUISlotsFromContext, PickerFieldUISlotPropsFromContext } from '@mui/x-date-pickers/internals';
4
4
  import { ExportedPickersLayoutSlotProps, ExportedPickersLayoutSlots } from '@mui/x-date-pickers/PickersLayout';
5
- import { RangeOnlyPickerProps, UseRangePickerParams, UseRangePickerProps } from "../models/useRangePicker.js";
5
+ import { NonStaticRangePickerProps, NonStaticRangePickerHookParameters, UseRangePickerProps } from "../../models/index.js";
6
6
  export interface UseDesktopRangePickerSlots extends PickerPopperSlots, ExportedPickersLayoutSlots<PickerRangeValue>, PickerFieldUISlotsFromContext {
7
7
  /**
8
8
  * Component used to enter the date with the keyboard.
@@ -14,7 +14,7 @@ export interface UseDesktopRangePickerSlotProps<TEnableAccessibleFieldDOMStructu
14
14
  dateSeparator?: string;
15
15
  }, {}, PickerOwnerState>;
16
16
  }
17
- export interface DesktopRangeOnlyPickerProps extends RangeOnlyPickerProps {
17
+ export interface DesktopRangeOnlyPickerProps extends NonStaticRangePickerProps {
18
18
  /**
19
19
  * If `true`, the start `input` element is focused during the first mount.
20
20
  */
@@ -32,4 +32,4 @@ export interface UseDesktopRangePickerProps<TView extends DateOrTimeViewWithMeri
32
32
  */
33
33
  slotProps?: UseDesktopRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
34
34
  }
35
- export interface UseDesktopRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseDesktopRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends UseRangePickerParams<TView, TExternalProps> {}
35
+ export interface UseDesktopRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseDesktopRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends NonStaticRangePickerHookParameters<TView, TExternalProps> {}
@@ -3,6 +3,7 @@ import { DateOrTimeViewWithMeridiem } from '@mui/x-date-pickers/internals';
3
3
  import { UseMobileRangePickerParams, UseMobileRangePickerProps } from "./useMobileRangePicker.types.js";
4
4
  export declare const useMobileRangePicker: <TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>>({
5
5
  props,
6
+ steps,
6
7
  ...pickerParams
7
8
  }: UseMobileRangePickerParams<TView, TEnableAccessibleFieldDOMStructure, TExternalProps>) => {
8
9
  renderPicker: () => React.JSX.Element;
@@ -19,13 +19,15 @@ var _releaseInfo = require("../../utils/releaseInfo");
19
19
  var _useRangePosition = require("../useRangePosition");
20
20
  var _usePickerRangePositionContext = require("../../../hooks/usePickerRangePositionContext");
21
21
  var _dateFieldsUtils = require("../../utils/date-fields-utils");
22
+ var _createRangePickerStepNavigation = require("../../utils/createRangePickerStepNavigation");
22
23
  var _jsxRuntime = require("react/jsx-runtime");
23
- const _excluded = ["props"],
24
+ const _excluded = ["props", "steps"],
24
25
  _excluded2 = ["ownerState"];
25
26
  const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
26
27
  const useMobileRangePicker = _ref => {
27
28
  let {
28
- props
29
+ props,
30
+ steps
29
31
  } = _ref,
30
32
  pickerParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
31
33
  (0, _xLicense.useLicenseVerifier)('x-date-pickers-pro', releaseInfo);
@@ -39,6 +41,10 @@ const useMobileRangePicker = _ref => {
39
41
  const fieldType = (0, _dateFieldsUtils.getRangeFieldType)(slots.field);
40
42
  const rangePositionResponse = (0, _useRangePosition.useRangePosition)(props);
41
43
  const contextTranslations = (0, _hooks.usePickerTranslations)();
44
+ const getStepNavigation = (0, _createRangePickerStepNavigation.createRangePickerStepNavigation)({
45
+ steps,
46
+ rangePositionResponse
47
+ });
42
48
  const {
43
49
  providerProps,
44
50
  renderCurrentView,
@@ -48,7 +54,8 @@ const useMobileRangePicker = _ref => {
48
54
  variant: 'mobile',
49
55
  autoFocusView: true,
50
56
  viewContainerRole: 'dialog',
51
- localeText
57
+ localeText,
58
+ getStepNavigation
52
59
  }));
53
60
  const labelId = providerProps.privateContextValue.labelId;
54
61
  const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
@@ -2,7 +2,7 @@ import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
2
2
  import { PickerFieldSlotProps, PickerOwnerState } from '@mui/x-date-pickers/models';
3
3
  import { PickersModalDialogSlots, PickersModalDialogSlotProps, UsePickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue, PickerFieldUISlotsFromContext, PickerFieldUISlotPropsFromContext } from '@mui/x-date-pickers/internals';
4
4
  import { ExportedPickersLayoutSlotProps, ExportedPickersLayoutSlots, PickersLayoutSlotProps } from '@mui/x-date-pickers/PickersLayout';
5
- import { RangeOnlyPickerProps, UseRangePickerParams, UseRangePickerProps } from "../models/useRangePicker.js";
5
+ import { NonStaticRangePickerProps, NonStaticRangePickerHookParameters, UseRangePickerProps } from "../../models/index.js";
6
6
  export interface UseMobileRangePickerSlots extends PickersModalDialogSlots, ExportedPickersLayoutSlots<PickerRangeValue>, PickerFieldUISlotsFromContext {
7
7
  /**
8
8
  * Component used to enter the date with the keyboard.
@@ -15,7 +15,7 @@ export interface ExportedUseMobileRangePickerSlotProps<TEnableAccessibleFieldDOM
15
15
  }, {}, PickerOwnerState>;
16
16
  }
17
17
  export interface UseMobileRangePickerSlotProps<TEnableAccessibleFieldDOMStructure extends boolean> extends ExportedUseMobileRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>, Pick<PickersLayoutSlotProps<PickerRangeValue>, 'toolbar'> {}
18
- export interface MobileRangeOnlyPickerProps extends RangeOnlyPickerProps {}
18
+ export interface MobileRangeOnlyPickerProps extends NonStaticRangePickerProps {}
19
19
  export interface UseMobileRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TError, TExternalProps extends UsePickerProps<PickerRangeValue, TView, TError, any>> extends UseRangePickerProps<TView, TError, TExternalProps> {
20
20
  /**
21
21
  * Overridable component slots.
@@ -28,4 +28,4 @@ export interface UseMobileRangePickerProps<TView extends DateOrTimeViewWithMerid
28
28
  */
29
29
  slotProps?: UseMobileRangePickerSlotProps<TEnableAccessibleFieldDOMStructure>;
30
30
  }
31
- export interface UseMobileRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends UseRangePickerParams<TView, TExternalProps> {}
31
+ export interface UseMobileRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TEnableAccessibleFieldDOMStructure extends boolean, TExternalProps extends UseMobileRangePickerProps<TView, TEnableAccessibleFieldDOMStructure, any, TExternalProps>> extends NonStaticRangePickerHookParameters<TView, TExternalProps> {}
@@ -7,6 +7,7 @@ import { UseStaticRangePickerParams, UseStaticRangePickerProps } from "./useStat
7
7
  */
8
8
  export declare const useStaticRangePicker: <TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>>({
9
9
  props,
10
+ steps,
10
11
  ...pickerParams
11
12
  }: UseStaticRangePickerParams<TView, TExternalProps>) => {
12
13
  renderPicker: () => React.JSX.Element;
@@ -15,8 +15,9 @@ var _PickersLayout = require("@mui/x-date-pickers/PickersLayout");
15
15
  var _internals = require("@mui/x-date-pickers/internals");
16
16
  var _useRangePosition = require("../useRangePosition");
17
17
  var _usePickerRangePositionContext = require("../../../hooks/usePickerRangePositionContext");
18
+ var _createRangePickerStepNavigation = require("../../utils/createRangePickerStepNavigation");
18
19
  var _jsxRuntime = require("react/jsx-runtime");
19
- const _excluded = ["props"];
20
+ const _excluded = ["props", "steps"];
20
21
  const PickerStaticLayout = (0, _styles.styled)(_PickersLayout.PickersLayout)(({
21
22
  theme
22
23
  }) => ({
@@ -31,7 +32,8 @@ const PickerStaticLayout = (0, _styles.styled)(_PickersLayout.PickersLayout)(({
31
32
  */
32
33
  const useStaticRangePicker = _ref => {
33
34
  let {
34
- props
35
+ props,
36
+ steps
35
37
  } = _ref,
36
38
  pickerParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
37
39
  const {
@@ -42,6 +44,10 @@ const useStaticRangePicker = _ref => {
42
44
  autoFocus
43
45
  } = props;
44
46
  const rangePositionResponse = (0, _useRangePosition.useRangePosition)(props);
47
+ const getStepNavigation = (0, _createRangePickerStepNavigation.createRangePickerStepNavigation)({
48
+ steps,
49
+ rangePositionResponse
50
+ });
45
51
  const {
46
52
  providerProps,
47
53
  renderCurrentView
@@ -50,7 +56,8 @@ const useStaticRangePicker = _ref => {
50
56
  variant: displayStaticWrapperAs,
51
57
  autoFocusView: autoFocus ?? false,
52
58
  viewContainerRole: null,
53
- localeText
59
+ localeText,
60
+ getStepNavigation
54
61
  }));
55
62
  const Layout = slots?.layout ?? PickerStaticLayout;
56
63
  const renderPicker = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_usePickerRangePositionContext.PickerRangePositionContext.Provider, {
@@ -1,6 +1,7 @@
1
1
  import { BasePickerProps, UsePickerParameters, ExportedBaseToolbarProps, StaticOnlyPickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue } from '@mui/x-date-pickers/internals';
2
2
  import { ExportedPickersLayoutSlots, ExportedPickersLayoutSlotProps } from '@mui/x-date-pickers/PickersLayout';
3
3
  import { UseRangePositionProps } from "../useRangePosition.js";
4
+ import { PickerRangeStep } from "../../utils/createRangePickerStepNavigation.js";
4
5
  export interface UseStaticRangePickerSlots extends ExportedPickersLayoutSlots<PickerRangeValue> {}
5
6
  export interface UseStaticRangePickerSlotProps extends ExportedPickersLayoutSlotProps<PickerRangeValue> {
6
7
  toolbar?: ExportedBaseToolbarProps;
@@ -20,4 +21,10 @@ export interface UseStaticRangePickerProps<TView extends DateOrTimeViewWithMerid
20
21
  }
21
22
  export interface UseStaticRangePickerParams<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseStaticRangePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParameters<PickerRangeValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'ref'> {
22
23
  props: TExternalProps;
24
+ /**
25
+ * Steps available for the picker.
26
+ * This will be used to define the behavior of navigation actions.
27
+ * If null, the picker will not have any step navigation.
28
+ */
29
+ steps: PickerRangeStep[] | null;
23
30
  }
@@ -1,4 +1,7 @@
1
+ import { BasePickerProps, DateOrTimeViewWithMeridiem, PickerRangeValue, UsePickerNonStaticProps, UsePickerParameters, UsePickerProps } from '@mui/x-date-pickers/internals';
1
2
  import * as React from 'react';
3
+ import { UseRangePositionProps } from "../hooks/useRangePosition.js";
4
+ import { PickerRangeStep } from "../utils/createRangePickerStepNavigation.js";
2
5
  /**
3
6
  * Props common to all range non-static pickers.
4
7
  * These props are handled by the headless wrappers.
@@ -19,4 +22,15 @@ export interface BaseRangeNonStaticPickerProps {
19
22
  * Ignored if the field has several inputs.
20
23
  */
21
24
  name?: string;
25
+ }
26
+ export interface NonStaticRangePickerProps extends UsePickerNonStaticProps, BaseRangeNonStaticPickerProps, UseRangePositionProps {}
27
+ export interface UseRangePickerProps<TView extends DateOrTimeViewWithMeridiem, TError, TExternalProps extends UsePickerProps<PickerRangeValue, TView, TError, any>> extends NonStaticRangePickerProps, BasePickerProps<PickerRangeValue, TView, TError, TExternalProps> {}
28
+ export interface NonStaticRangePickerHookParameters<TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UseRangePickerProps<TView, any, TExternalProps>> extends Pick<UsePickerParameters<PickerRangeValue, TView, TExternalProps>, 'valueManager' | 'valueType' | 'validator' | 'rendererInterceptor' | 'ref'> {
29
+ props: TExternalProps;
30
+ /**
31
+ * Steps available for the picker.
32
+ * This will be used to define the behavior of navigation actions.
33
+ * If null, the picker will not have any step navigation.
34
+ */
35
+ steps: PickerRangeStep[] | null;
22
36
  }
@@ -0,0 +1,16 @@
1
+ import { DateOrTimeViewWithMeridiem, RangePosition } from '@mui/x-date-pickers/internals';
2
+ import { UseRangePositionResponse } from "../hooks/useRangePosition.js";
3
+ export declare function createRangePickerStepNavigation(parameters: CreateRangePickerStepNavigationParameters): import("@mui/x-date-pickers/internals/utils/createStepNavigation").CreateStepNavigationReturnValue;
4
+ export interface PickerRangeStep {
5
+ /**
6
+ * The views that are handled inside this step.
7
+ * If null, all views are handled by this step.
8
+ */
9
+ views: readonly DateOrTimeViewWithMeridiem[] | null;
10
+ rangePosition: RangePosition;
11
+ }
12
+ interface CreateRangePickerStepNavigationParameters {
13
+ steps: PickerRangeStep[] | null;
14
+ rangePositionResponse: UseRangePositionResponse;
15
+ }
16
+ export {};
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createRangePickerStepNavigation = createRangePickerStepNavigation;
7
+ var _internals = require("@mui/x-date-pickers/internals");
8
+ function createRangePickerStepNavigation(parameters) {
9
+ const {
10
+ steps,
11
+ rangePositionResponse
12
+ } = parameters;
13
+ return (0, _internals.createStepNavigation)({
14
+ steps,
15
+ isCurrentViewMatchingStep: (view, step) => {
16
+ if (step.rangePosition !== rangePositionResponse.rangePosition) {
17
+ return false;
18
+ }
19
+ return step.views == null || step.views.includes(view);
20
+ },
21
+ onStepChange: ({
22
+ step,
23
+ initialView,
24
+ setView,
25
+ view,
26
+ views
27
+ }) => {
28
+ if (step.rangePosition !== rangePositionResponse.rangePosition) {
29
+ rangePositionResponse.setRangePosition(step.rangePosition);
30
+ }
31
+ const targetView = step.views == null ? initialView : step.views.find(viewBis => views.includes(viewBis));
32
+ if (targetView !== view) {
33
+ setView(targetView);
34
+ }
35
+ }
36
+ });
37
+ }