@mui/x-date-pickers-pro 7.0.0-beta.6 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +311 -12
  2. package/DateRangeCalendar/DateRangeCalendar.js +34 -74
  3. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +3 -2
  4. package/DateRangeCalendar/useDragRange.js +1 -2
  5. package/DateRangePicker/DateRangePicker.js +1 -1
  6. package/DateRangePicker/shared.js +3 -5
  7. package/DateTimeRangePicker/DateTimeRangePicker.d.ts +10 -0
  8. package/DateTimeRangePicker/DateTimeRangePicker.js +11 -1
  9. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +4 -5
  10. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -3
  11. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +2 -2
  12. package/DateTimeRangePicker/shared.d.ts +5 -4
  13. package/DateTimeRangePicker/shared.js +9 -10
  14. package/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -10
  15. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +10 -0
  16. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +31 -28
  17. package/MobileDateRangePicker/MobileDateRangePicker.js +5 -9
  18. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +10 -0
  19. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -14
  20. package/MultiInputDateRangeField/MultiInputDateRangeField.js +21 -17
  21. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +21 -17
  22. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +20 -16
  23. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.d.ts +8 -0
  24. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +124 -0
  25. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.d.ts +18 -0
  26. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.js +1 -0
  27. package/PickersRangeCalendarHeader/index.d.ts +2 -0
  28. package/PickersRangeCalendarHeader/index.js +1 -0
  29. package/PickersRangeCalendarHeader/package.json +6 -0
  30. package/README.md +1 -1
  31. package/SingleInputDateRangeField/SingleInputDateRangeField.js +8 -4
  32. package/SingleInputDateRangeField/useSingleInputDateRangeField.js +6 -2
  33. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +8 -4
  34. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +6 -2
  35. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +7 -3
  36. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +6 -2
  37. package/StaticDateRangePicker/StaticDateRangePicker.js +4 -5
  38. package/index.d.ts +1 -0
  39. package/index.js +2 -1
  40. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +9 -11
  41. package/internals/hooks/useEnrichedRangePickerFieldProps.js +25 -31
  42. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +9 -10
  43. package/internals/hooks/useMultiInputFieldSelectedSections.js +3 -6
  44. package/internals/hooks/useRangePosition.js +3 -5
  45. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +14 -18
  46. package/internals/models/dateRange.d.ts +3 -3
  47. package/internals/models/dateTimeRange.d.ts +2 -2
  48. package/internals/models/timeRange.d.ts +2 -2
  49. package/internals/utils/releaseInfo.js +1 -1
  50. package/internals/utils/validation/validateDateRange.js +2 -2
  51. package/internals/utils/validation/validateDateTimeRange.js +2 -2
  52. package/internals/utils/valueManagers.d.ts +3 -1
  53. package/internals/utils/valueManagers.js +9 -7
  54. package/models/fields.d.ts +8 -1
  55. package/modern/DateRangeCalendar/DateRangeCalendar.js +40 -72
  56. package/modern/DateRangePicker/DateRangePicker.js +1 -1
  57. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +11 -1
  58. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
  59. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -9
  60. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
  61. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -5
  62. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +14 -6
  63. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -6
  64. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -5
  65. package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +124 -0
  66. package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.js +1 -0
  67. package/modern/PickersRangeCalendarHeader/index.js +1 -0
  68. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -1
  69. package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +6 -2
  70. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -1
  71. package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +6 -2
  72. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +5 -0
  73. package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +6 -2
  74. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
  75. package/modern/index.js +2 -1
  76. package/modern/internals/utils/releaseInfo.js +1 -1
  77. package/modern/internals/utils/valueManagers.js +7 -5
  78. package/node/DateRangeCalendar/DateRangeCalendar.js +39 -71
  79. package/node/DateRangePicker/DateRangePicker.js +1 -1
  80. package/node/DateTimeRangePicker/DateTimeRangePicker.js +11 -1
  81. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
  82. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -9
  83. package/node/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
  84. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -5
  85. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +14 -6
  86. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -6
  87. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -5
  88. package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +132 -0
  89. package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.js +5 -0
  90. package/node/PickersRangeCalendarHeader/index.js +12 -0
  91. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -1
  92. package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +7 -1
  93. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -1
  94. package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +7 -1
  95. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +5 -0
  96. package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +7 -1
  97. package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
  98. package/node/index.js +13 -1
  99. package/node/internals/utils/releaseInfo.js +1 -1
  100. package/node/internals/utils/valueManagers.js +9 -6
  101. package/package.json +7 -7
  102. package/themeAugmentation/components.d.ts +3 -0
  103. package/themeAugmentation/props.d.ts +2 -0
  104. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.d.ts +0 -9
  105. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -52
  106. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -51
  107. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -59
@@ -21,6 +21,9 @@ export interface PickersProComponents<Theme = unknown> {
21
21
  defaultProps?: ComponentsProps['MuiDateTimeRangePickerToolbar'];
22
22
  styleOverrides?: ComponentsOverrides<Theme>['MuiDateTimeRangePickerToolbar'];
23
23
  };
24
+ MuiPickersRangeCalendarHeader?: {
25
+ defaultProps?: ComponentsProps['MuiPickersRangeCalendarHeader'];
26
+ };
24
27
 
25
28
  // Multi input range fields
26
29
  MuiMultiInputDateRangeField?: {
@@ -17,6 +17,7 @@ import { DesktopDateTimeRangePickerProps } from '../DesktopDateTimeRangePicker';
17
17
  import { MobileDateTimeRangePickerProps } from '../MobileDateTimeRangePicker';
18
18
  import { ExportedDateTimeRangePickerTabsProps } from '../DateTimeRangePicker/DateTimeRangePickerTabs';
19
19
  import { ExportedDateTimeRangePickerToolbarProps } from '../DateTimeRangePicker/DateTimeRangePickerToolbar';
20
+ import { ExportedPickersRangeCalendarHeaderProps } from '../PickersRangeCalendarHeader';
20
21
 
21
22
  export interface PickersProComponentsPropsList {
22
23
  MuiDateRangeCalendar: DateRangeCalendarProps<PickerValidDate>;
@@ -24,6 +25,7 @@ export interface PickersProComponentsPropsList {
24
25
  MuiDateTimeRangePickerTabs: ExportedDateTimeRangePickerTabsProps;
25
26
  MuiDateRangePickerToolbar: ExportedDateRangePickerToolbarProps;
26
27
  MuiDateTimeRangePickerToolbar: ExportedDateTimeRangePickerToolbarProps;
28
+ MuiPickersRangeCalendarHeader: ExportedPickersRangeCalendarHeaderProps<PickerValidDate>;
27
29
 
28
30
  // Multi input range fields
29
31
  MuiMultiInputDateRangeField: MultiInputDateRangeFieldProps<PickerValidDate, any>;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { PickersLayoutProps } from '@mui/x-date-pickers/PickersLayout';
3
- import { PickerValidDate } from '@mui/x-date-pickers/models';
4
- import { DateRange } from '../models';
5
- import { DateTimeRangePickerView } from '../internals/models/dateTimeRange';
6
- /**
7
- * @ignore - internal component.
8
- */
9
- export declare function DesktopDateTimeRangePickerLayout<TDate extends PickerValidDate>(props: PickersLayoutProps<DateRange<TDate>, TDate, DateTimeRangePickerView>): React.JSX.Element;
@@ -1,52 +0,0 @@
1
- import * as React from 'react';
2
- import clsx from 'clsx';
3
- import Divider from '@mui/material/Divider';
4
- import { PickersLayoutContentWrapper, PickersLayoutRoot, pickersLayoutClasses, usePickerLayout } from '@mui/x-date-pickers/PickersLayout';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
- /**
8
- * @ignore - internal component.
9
- */
10
- export function DesktopDateTimeRangePickerLayout(props) {
11
- var _actionBar$props$acti, _actionBar$props$acti2;
12
- const {
13
- toolbar,
14
- tabs,
15
- content,
16
- actionBar,
17
- shortcuts
18
- } = usePickerLayout(props);
19
- const {
20
- sx,
21
- className,
22
- isLandscape,
23
- ref
24
- } = props;
25
- const isActionBarVisible = actionBar && ((_actionBar$props$acti = (_actionBar$props$acti2 = actionBar.props.actions) == null ? void 0 : _actionBar$props$acti2.length) != null ? _actionBar$props$acti : 0) > 0;
26
- return /*#__PURE__*/_jsxs(PickersLayoutRoot, {
27
- ref: ref,
28
- className: clsx(className, pickersLayoutClasses.root),
29
- sx: [{
30
- [`& .${pickersLayoutClasses.tabs}`]: {
31
- gridRow: 4,
32
- gridColumn: '1 / 4'
33
- },
34
- [`& .${pickersLayoutClasses.actionBar}`]: {
35
- gridRow: 5
36
- }
37
- }, ...(Array.isArray(sx) ? sx : [sx])],
38
- ownerState: props,
39
- children: [isLandscape ? shortcuts : toolbar, isLandscape ? toolbar : shortcuts, /*#__PURE__*/_jsx(PickersLayoutContentWrapper, {
40
- className: pickersLayoutClasses.contentWrapper,
41
- sx: {
42
- flexDirection: 'row'
43
- },
44
- children: content
45
- }), isActionBarVisible && /*#__PURE__*/_jsx(Divider, {
46
- sx: {
47
- gridRow: 3,
48
- gridColumn: '1/4'
49
- }
50
- }), tabs, actionBar]
51
- });
52
- }
@@ -1,51 +0,0 @@
1
- import * as React from 'react';
2
- import clsx from 'clsx';
3
- import Divider from '@mui/material/Divider';
4
- import { PickersLayoutContentWrapper, PickersLayoutRoot, pickersLayoutClasses, usePickerLayout } from '@mui/x-date-pickers/PickersLayout';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
- /**
8
- * @ignore - internal component.
9
- */
10
- export function DesktopDateTimeRangePickerLayout(props) {
11
- const {
12
- toolbar,
13
- tabs,
14
- content,
15
- actionBar,
16
- shortcuts
17
- } = usePickerLayout(props);
18
- const {
19
- sx,
20
- className,
21
- isLandscape,
22
- ref
23
- } = props;
24
- const isActionBarVisible = actionBar && (actionBar.props.actions?.length ?? 0) > 0;
25
- return /*#__PURE__*/_jsxs(PickersLayoutRoot, {
26
- ref: ref,
27
- className: clsx(className, pickersLayoutClasses.root),
28
- sx: [{
29
- [`& .${pickersLayoutClasses.tabs}`]: {
30
- gridRow: 4,
31
- gridColumn: '1 / 4'
32
- },
33
- [`& .${pickersLayoutClasses.actionBar}`]: {
34
- gridRow: 5
35
- }
36
- }, ...(Array.isArray(sx) ? sx : [sx])],
37
- ownerState: props,
38
- children: [isLandscape ? shortcuts : toolbar, isLandscape ? toolbar : shortcuts, /*#__PURE__*/_jsx(PickersLayoutContentWrapper, {
39
- className: pickersLayoutClasses.contentWrapper,
40
- sx: {
41
- flexDirection: 'row'
42
- },
43
- children: content
44
- }), isActionBarVisible && /*#__PURE__*/_jsx(Divider, {
45
- sx: {
46
- gridRow: 3,
47
- gridColumn: '1/4'
48
- }
49
- }), tabs, actionBar]
50
- });
51
- }
@@ -1,59 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.DesktopDateTimeRangePickerLayout = DesktopDateTimeRangePickerLayout;
8
- var React = _interopRequireWildcard(require("react"));
9
- var _clsx = _interopRequireDefault(require("clsx"));
10
- var _Divider = _interopRequireDefault(require("@mui/material/Divider"));
11
- var _PickersLayout = require("@mui/x-date-pickers/PickersLayout");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
- /**
16
- * @ignore - internal component.
17
- */
18
- function DesktopDateTimeRangePickerLayout(props) {
19
- const {
20
- toolbar,
21
- tabs,
22
- content,
23
- actionBar,
24
- shortcuts
25
- } = (0, _PickersLayout.usePickerLayout)(props);
26
- const {
27
- sx,
28
- className,
29
- isLandscape,
30
- ref
31
- } = props;
32
- const isActionBarVisible = actionBar && (actionBar.props.actions?.length ?? 0) > 0;
33
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PickersLayout.PickersLayoutRoot, {
34
- ref: ref,
35
- className: (0, _clsx.default)(className, _PickersLayout.pickersLayoutClasses.root),
36
- sx: [{
37
- [`& .${_PickersLayout.pickersLayoutClasses.tabs}`]: {
38
- gridRow: 4,
39
- gridColumn: '1 / 4'
40
- },
41
- [`& .${_PickersLayout.pickersLayoutClasses.actionBar}`]: {
42
- gridRow: 5
43
- }
44
- }, ...(Array.isArray(sx) ? sx : [sx])],
45
- ownerState: props,
46
- children: [isLandscape ? shortcuts : toolbar, isLandscape ? toolbar : shortcuts, /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickersLayout.PickersLayoutContentWrapper, {
47
- className: _PickersLayout.pickersLayoutClasses.contentWrapper,
48
- sx: {
49
- flexDirection: 'row'
50
- },
51
- children: content
52
- }), isActionBarVisible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
53
- sx: {
54
- gridRow: 3,
55
- gridColumn: '1/4'
56
- }
57
- }), tabs, actionBar]
58
- });
59
- }