@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.
- package/CHANGELOG.md +311 -12
- package/DateRangeCalendar/DateRangeCalendar.js +34 -74
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +3 -2
- package/DateRangeCalendar/useDragRange.js +1 -2
- package/DateRangePicker/DateRangePicker.js +1 -1
- package/DateRangePicker/shared.js +3 -5
- package/DateTimeRangePicker/DateTimeRangePicker.d.ts +10 -0
- package/DateTimeRangePicker/DateTimeRangePicker.js +11 -1
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +4 -5
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +2 -3
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +2 -2
- package/DateTimeRangePicker/shared.d.ts +5 -4
- package/DateTimeRangePicker/shared.js +9 -10
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -10
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +10 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +31 -28
- package/MobileDateRangePicker/MobileDateRangePicker.js +5 -9
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +10 -0
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +20 -14
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +21 -17
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +21 -17
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +20 -16
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.d.ts +8 -0
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +124 -0
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.d.ts +18 -0
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.js +1 -0
- package/PickersRangeCalendarHeader/index.d.ts +2 -0
- package/PickersRangeCalendarHeader/index.js +1 -0
- package/PickersRangeCalendarHeader/package.json +6 -0
- package/README.md +1 -1
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +8 -4
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +6 -2
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +8 -4
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +6 -2
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +7 -3
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +6 -2
- package/StaticDateRangePicker/StaticDateRangePicker.js +4 -5
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +9 -11
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +25 -31
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +9 -10
- package/internals/hooks/useMultiInputFieldSelectedSections.js +3 -6
- package/internals/hooks/useRangePosition.js +3 -5
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +14 -18
- package/internals/models/dateRange.d.ts +3 -3
- package/internals/models/dateTimeRange.d.ts +2 -2
- package/internals/models/timeRange.d.ts +2 -2
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/validation/validateDateRange.js +2 -2
- package/internals/utils/validation/validateDateTimeRange.js +2 -2
- package/internals/utils/valueManagers.d.ts +3 -1
- package/internals/utils/valueManagers.js +9 -7
- package/models/fields.d.ts +8 -1
- package/modern/DateRangeCalendar/DateRangeCalendar.js +40 -72
- package/modern/DateRangePicker/DateRangePicker.js +1 -1
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +11 -1
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -9
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -5
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +14 -6
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -6
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -5
- package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +124 -0
- package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.js +1 -0
- package/modern/PickersRangeCalendarHeader/index.js +1 -0
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -1
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +6 -2
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -1
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +6 -2
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +5 -0
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +6 -2
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/modern/index.js +2 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/internals/utils/valueManagers.js +7 -5
- package/node/DateRangeCalendar/DateRangeCalendar.js +39 -71
- package/node/DateRangePicker/DateRangePicker.js +1 -1
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +11 -1
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +20 -9
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +15 -5
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +14 -6
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -6
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -5
- package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +132 -0
- package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.js +5 -0
- package/node/PickersRangeCalendarHeader/index.js +12 -0
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -1
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +7 -1
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -1
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +7 -1
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +5 -0
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +7 -1
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/node/index.js +13 -1
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/internals/utils/valueManagers.js +9 -6
- package/package.json +7 -7
- package/themeAugmentation/components.d.ts +3 -0
- package/themeAugmentation/props.d.ts +2 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.d.ts +0 -9
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -52
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +0 -51
- 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
|
-
}
|