@mui/x-date-pickers-pro 6.2.0 → 6.2.1
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 +49 -1
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
- package/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
- package/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
- package/index.js +1 -1
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -1
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +9 -9
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +1 -1
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -1
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +9 -9
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +1 -1
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -1
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -10
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +1 -1
- package/internal/utils/releaseInfo.js +1 -1
- package/internal/utils/valueManagers.js +1 -1
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
- package/legacy/index.js +1 -1
- package/legacy/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +5 -6
- package/legacy/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +5 -6
- package/legacy/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +6 -7
- package/legacy/internal/utils/releaseInfo.js +1 -1
- package/legacy/internal/utils/valueManagers.js +2 -2
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
- package/modern/index.js +1 -1
- package/modern/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +9 -9
- package/modern/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +9 -9
- package/modern/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -10
- package/modern/internal/utils/releaseInfo.js +1 -1
- package/modern/internal/utils/valueManagers.js +1 -1
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -0
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +1 -0
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
- package/node/index.js +1 -1
- package/node/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +9 -9
- package/node/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +9 -9
- package/node/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -10
- package/node/internal/utils/releaseInfo.js +1 -1
- package/node/internal/utils/valueManagers.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,57 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.2.1
|
|
7
|
+
|
|
8
|
+
_Apr 20, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Add virtualization to row detail panels (#7969) @yaredtsy
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 📚 Documentation improvements
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v6.2.1` / `@mui/x-data-grid-pro@v6.2.1` / `@mui/x-data-grid-premium@v6.2.1`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Add `getTogglableColumns` to `Hide all` and `Show all` actions (#8496) @MBilalShafi
|
|
21
|
+
- [DataGrid] Add Grid + Joy UI experiment page (#8067) @cherniavskii
|
|
22
|
+
- [DataGrid] Fix print style when rendering inside Shadow DOM (#8656) @Bwatermelon
|
|
23
|
+
- [DataGrid] Replace `GridAutoSizer` with `ResizeObserver` (#8091) @m4theushw
|
|
24
|
+
- [DataGrid] Use stable ID for the placeholder filter item (#8603) @m4theushw
|
|
25
|
+
- [DataGridPro] Virtualize row detail panels (#7969) @yaredtsy
|
|
26
|
+
|
|
27
|
+
### `@mui/x-date-pickers@v6.2.1` / `@mui/x-date-pickers-pro@v6.2.1`
|
|
28
|
+
|
|
29
|
+
#### Changes
|
|
30
|
+
|
|
31
|
+
- [pickers] Do not include the time in date components when going to today (#8657) @flaviendelangle
|
|
32
|
+
- [pickers] Sync internal state with controlled value (#8674) @alexfauquette
|
|
33
|
+
|
|
34
|
+
### `@mui/x-codemod@v6.0.6`
|
|
35
|
+
|
|
36
|
+
#### Changes
|
|
37
|
+
|
|
38
|
+
- [codemod] Avoid filter failures on object prototype properties (#8647) @LukasTy
|
|
39
|
+
|
|
40
|
+
### Docs
|
|
41
|
+
|
|
42
|
+
- [docs] Add no-op service worker to fix stale cache issue (#8598) @cherniavskii
|
|
43
|
+
- [docs] Clarify what `AdapterDayjs` is in the Getting Started page (#8219) @flaviendelangle
|
|
44
|
+
- [docs] Fix typo on picker page description (#8611) @maxolasersquad
|
|
45
|
+
- [docs] Improve section title in Getting Started page (#8648) @flaviendelangle
|
|
46
|
+
- [docs] Inform about input format modification (#8458) @alexfauquette
|
|
47
|
+
|
|
48
|
+
### Core
|
|
49
|
+
|
|
50
|
+
- [core] Fix release date (#8618) @flaviendelangle
|
|
51
|
+
- [core] Upgrade monorepo (#8668) @MBilalShafi
|
|
52
|
+
- [charts] Support Tooltip (#8356) @alexfauquette
|
|
53
|
+
|
|
6
54
|
## 6.2.0
|
|
7
55
|
|
|
8
|
-
_Apr
|
|
56
|
+
_Apr 14, 2023_
|
|
9
57
|
|
|
10
58
|
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
11
59
|
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DateOrTimeView } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { UseDesktopRangePickerParams, UseDesktopRangePickerProps } from './useDesktopRangePicker.types';
|
|
4
|
-
export declare const useDesktopRangePicker: <TDate, TView extends DateOrTimeView, TExternalProps extends UseDesktopRangePickerProps<TDate, TView, any, TExternalProps>>({ props,
|
|
4
|
+
export declare const useDesktopRangePicker: <TDate, TView extends DateOrTimeView, TExternalProps extends UseDesktopRangePickerProps<TDate, TView, any, TExternalProps>>({ props, ...pickerParams }: UseDesktopRangePickerParams<TDate, TView, TExternalProps>) => {
|
|
5
5
|
renderPicker: () => JSX.Element;
|
|
6
6
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["props"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
6
|
import { useLicenseVerifier } from '@mui/x-license-pro';
|
|
@@ -11,12 +13,12 @@ import { useRangePosition } from '../useRangePosition';
|
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
15
|
const releaseInfo = getReleaseInfo();
|
|
14
|
-
export const useDesktopRangePicker =
|
|
15
|
-
props,
|
|
16
|
-
valueManager,
|
|
17
|
-
validator
|
|
18
|
-
}) => {
|
|
16
|
+
export const useDesktopRangePicker = _ref => {
|
|
19
17
|
var _fieldType, _slots$layout;
|
|
18
|
+
let {
|
|
19
|
+
props
|
|
20
|
+
} = _ref,
|
|
21
|
+
pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
22
|
useLicenseVerifier('x-date-pickers-pro', releaseInfo);
|
|
21
23
|
const {
|
|
22
24
|
slots,
|
|
@@ -47,17 +49,15 @@ export const useDesktopRangePicker = ({
|
|
|
47
49
|
renderCurrentView,
|
|
48
50
|
shouldRestoreFocus,
|
|
49
51
|
fieldProps: pickerFieldProps
|
|
50
|
-
} = usePicker({
|
|
52
|
+
} = usePicker(_extends({}, pickerParams, {
|
|
51
53
|
props,
|
|
52
|
-
valueManager,
|
|
53
54
|
wrapperVariant: 'desktop',
|
|
54
|
-
validator,
|
|
55
55
|
autoFocusView: true,
|
|
56
56
|
additionalViewProps: {
|
|
57
57
|
rangePosition,
|
|
58
58
|
onRangePositionChange
|
|
59
59
|
}
|
|
60
|
-
});
|
|
60
|
+
}));
|
|
61
61
|
const handleBlur = () => {
|
|
62
62
|
executeInTheNextEventLoopTick(() => {
|
|
63
63
|
var _fieldContainerRef$cu, _popperRef$current;
|
|
@@ -29,6 +29,6 @@ export interface UseDesktopRangePickerProps<TDate, TView extends DateOrTimeView,
|
|
|
29
29
|
}
|
|
30
30
|
export interface DesktopRangePickerAdditionalViewProps extends Pick<UseRangePositionResponse, 'rangePosition' | 'onRangePositionChange'> {
|
|
31
31
|
}
|
|
32
|
-
export interface UseDesktopRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseDesktopRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, RangeFieldSection, TExternalProps, DesktopRangePickerAdditionalViewProps>, 'valueManager' | 'validator'> {
|
|
32
|
+
export interface UseDesktopRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseDesktopRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, RangeFieldSection, TExternalProps, DesktopRangePickerAdditionalViewProps>, 'valueManager' | 'valueType' | 'validator'> {
|
|
33
33
|
props: TExternalProps;
|
|
34
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DateOrTimeView } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { UseMobileRangePickerParams, UseMobileRangePickerProps } from './useMobileRangePicker.types';
|
|
4
|
-
export declare const useMobileRangePicker: <TDate, TView extends DateOrTimeView, TExternalProps extends UseMobileRangePickerProps<TDate, TView, any, TExternalProps>>({ props,
|
|
4
|
+
export declare const useMobileRangePicker: <TDate, TView extends DateOrTimeView, TExternalProps extends UseMobileRangePickerProps<TDate, TView, any, TExternalProps>>({ props, ...pickerParams }: UseMobileRangePickerParams<TDate, TView, TExternalProps>) => {
|
|
5
5
|
renderPicker: () => JSX.Element;
|
|
6
6
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["props"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
6
|
import { useLicenseVerifier } from '@mui/x-license-pro';
|
|
@@ -12,12 +14,12 @@ import { useRangePosition } from '../useRangePosition';
|
|
|
12
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
16
|
const releaseInfo = getReleaseInfo();
|
|
15
|
-
export const useMobileRangePicker =
|
|
16
|
-
props,
|
|
17
|
-
valueManager,
|
|
18
|
-
validator
|
|
19
|
-
}) => {
|
|
17
|
+
export const useMobileRangePicker = _ref => {
|
|
20
18
|
var _fieldType, _innerSlotProps$toolb, _innerSlotProps$toolb2, _slots$layout;
|
|
19
|
+
let {
|
|
20
|
+
props
|
|
21
|
+
} = _ref,
|
|
22
|
+
pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21
23
|
useLicenseVerifier('x-date-pickers-pro', releaseInfo);
|
|
22
24
|
const {
|
|
23
25
|
slots,
|
|
@@ -46,17 +48,15 @@ export const useMobileRangePicker = ({
|
|
|
46
48
|
layoutProps,
|
|
47
49
|
renderCurrentView,
|
|
48
50
|
fieldProps: pickerFieldProps
|
|
49
|
-
} = usePicker({
|
|
51
|
+
} = usePicker(_extends({}, pickerParams, {
|
|
50
52
|
props,
|
|
51
|
-
valueManager,
|
|
52
53
|
wrapperVariant: 'mobile',
|
|
53
|
-
validator,
|
|
54
54
|
autoFocusView: true,
|
|
55
55
|
additionalViewProps: {
|
|
56
56
|
rangePosition,
|
|
57
57
|
onRangePositionChange
|
|
58
58
|
}
|
|
59
|
-
});
|
|
59
|
+
}));
|
|
60
60
|
const Field = slots.field;
|
|
61
61
|
const fieldType = (_fieldType = Field.fieldType) != null ? _fieldType : 'multi-input';
|
|
62
62
|
const fieldProps = useSlotProps({
|
|
@@ -25,6 +25,6 @@ export interface UseMobileRangePickerProps<TDate, TView extends DateOrTimeView,
|
|
|
25
25
|
}
|
|
26
26
|
export interface MobileRangePickerAdditionalViewProps extends Pick<UseRangePositionResponse, 'rangePosition' | 'onRangePositionChange'> {
|
|
27
27
|
}
|
|
28
|
-
export interface UseMobileRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseMobileRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, RangeFieldSection, TExternalProps, MobileRangePickerAdditionalViewProps>, 'valueManager' | 'validator'> {
|
|
28
|
+
export interface UseMobileRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseMobileRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, RangeFieldSection, TExternalProps, MobileRangePickerAdditionalViewProps>, 'valueManager' | 'valueType' | 'validator'> {
|
|
29
29
|
props: TExternalProps;
|
|
30
30
|
}
|
|
@@ -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, TExternalProps>>({ props,
|
|
8
|
+
export declare const useStaticRangePicker: <TDate, TView extends DateOrTimeView, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>>({ props, ref, ...pickerParams }: UseStaticRangePickerParams<TDate, TView, TExternalProps>) => {
|
|
9
9
|
renderPicker: () => JSX.Element;
|
|
10
10
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["props", "ref"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import clsx from 'clsx';
|
|
4
6
|
import { styled } from '@mui/material/styles';
|
|
@@ -19,13 +21,13 @@ const PickerStaticLayout = styled(PickersLayout)(({
|
|
|
19
21
|
* Hook managing all the range static pickers:
|
|
20
22
|
* - StaticDateRangePicker
|
|
21
23
|
*/
|
|
22
|
-
export const useStaticRangePicker =
|
|
23
|
-
props,
|
|
24
|
-
valueManager,
|
|
25
|
-
validator,
|
|
26
|
-
ref
|
|
27
|
-
}) => {
|
|
24
|
+
export const useStaticRangePicker = _ref => {
|
|
28
25
|
var _slots$layout;
|
|
26
|
+
let {
|
|
27
|
+
props,
|
|
28
|
+
ref
|
|
29
|
+
} = _ref,
|
|
30
|
+
pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
29
31
|
const {
|
|
30
32
|
localeText,
|
|
31
33
|
slots,
|
|
@@ -42,17 +44,15 @@ export const useStaticRangePicker = ({
|
|
|
42
44
|
const {
|
|
43
45
|
layoutProps,
|
|
44
46
|
renderCurrentView
|
|
45
|
-
} = usePicker({
|
|
47
|
+
} = usePicker(_extends({}, pickerParams, {
|
|
46
48
|
props,
|
|
47
|
-
valueManager,
|
|
48
|
-
validator,
|
|
49
49
|
autoFocusView: autoFocus != null ? autoFocus : false,
|
|
50
50
|
additionalViewProps: {
|
|
51
51
|
rangePosition,
|
|
52
52
|
onRangePositionChange
|
|
53
53
|
},
|
|
54
54
|
wrapperVariant: displayStaticWrapperAs
|
|
55
|
-
});
|
|
55
|
+
}));
|
|
56
56
|
const Layout = (_slots$layout = slots == null ? void 0 : slots.layout) != null ? _slots$layout : PickerStaticLayout;
|
|
57
57
|
const slotPropsForLayout = _extends({}, slotProps, {
|
|
58
58
|
toolbar: _extends({}, slotProps == null ? void 0 : slotProps.toolbar, {
|
|
@@ -24,7 +24,7 @@ export interface UseStaticRangePickerProps<TDate, TView extends DateOrTimeView,
|
|
|
24
24
|
*/
|
|
25
25
|
slotProps?: UseStaticRangePickerSlotsComponentsProps<TDate, TView>;
|
|
26
26
|
}
|
|
27
|
-
export interface UseStaticRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, RangeFieldSection, TExternalProps, {}>, 'valueManager' | 'validator'> {
|
|
27
|
+
export interface UseStaticRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, RangeFieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
|
|
28
28
|
props: TExternalProps;
|
|
29
29
|
/**
|
|
30
30
|
* Ref to pass to the root element
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY4MTkzMDgwMDAwMA==";
|
|
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
|
|
@@ -3,7 +3,7 @@ import { replaceInvalidDateByNull, addPositionPropertiesToSections, createDateSt
|
|
|
3
3
|
import { splitDateRangeSections, removeLastSeparator } from './date-fields-utils';
|
|
4
4
|
export const rangeValueManager = {
|
|
5
5
|
emptyValue: [null, null],
|
|
6
|
-
getTodayValue: utils => [utils.date(), utils.date()],
|
|
6
|
+
getTodayValue: (utils, valueType) => valueType === 'date' ? [utils.startOfDay(utils.date()), utils.startOfDay(utils.date())] : [utils.date(), utils.date()],
|
|
7
7
|
cleanValue: (utils, value) => value.map(date => replaceInvalidDateByNull(utils, date)),
|
|
8
8
|
areValuesEqual: (utils, a, b) => areDatesEqual(utils, a[0], b[0]) && areDatesEqual(utils, a[1], b[1]),
|
|
9
9
|
isSameError: (a, b) => b !== null && a[1] === b[1] && a[0] === b[0],
|
|
@@ -39,6 +39,7 @@ var DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDateR
|
|
|
39
39
|
var _useDesktopRangePicke = useDesktopRangePicker({
|
|
40
40
|
props: props,
|
|
41
41
|
valueManager: rangeValueManager,
|
|
42
|
+
valueType: 'date',
|
|
42
43
|
validator: validateDateRange
|
|
43
44
|
}),
|
|
44
45
|
renderPicker = _useDesktopRangePicke.renderPicker;
|
|
@@ -44,6 +44,7 @@ var MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateRan
|
|
|
44
44
|
var _useMobileRangePicker = useMobileRangePicker({
|
|
45
45
|
props: props,
|
|
46
46
|
valueManager: rangeValueManager,
|
|
47
|
+
valueType: 'date',
|
|
47
48
|
validator: validateDateRange
|
|
48
49
|
}),
|
|
49
50
|
renderPicker = _useMobileRangePicker.renderPicker;
|
package/legacy/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["props"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
6
|
import { useLicenseVerifier } from '@mui/x-license-pro';
|
|
@@ -14,8 +16,7 @@ var releaseInfo = getReleaseInfo();
|
|
|
14
16
|
export var useDesktopRangePicker = function useDesktopRangePicker(_ref) {
|
|
15
17
|
var _fieldType, _slots$layout;
|
|
16
18
|
var props = _ref.props,
|
|
17
|
-
|
|
18
|
-
validator = _ref.validator;
|
|
19
|
+
pickerParams = _objectWithoutProperties(_ref, _excluded);
|
|
19
20
|
useLicenseVerifier('x-date-pickers-pro', releaseInfo);
|
|
20
21
|
var slots = props.slots,
|
|
21
22
|
slotProps = props.slotProps,
|
|
@@ -36,17 +37,15 @@ export var useDesktopRangePicker = function useDesktopRangePicker(_ref) {
|
|
|
36
37
|
rangePosition = _useRangePosition.rangePosition,
|
|
37
38
|
onRangePositionChange = _useRangePosition.onRangePositionChange,
|
|
38
39
|
singleInputFieldRef = _useRangePosition.singleInputFieldRef;
|
|
39
|
-
var _usePicker = usePicker({
|
|
40
|
+
var _usePicker = usePicker(_extends({}, pickerParams, {
|
|
40
41
|
props: props,
|
|
41
|
-
valueManager: valueManager,
|
|
42
42
|
wrapperVariant: 'desktop',
|
|
43
|
-
validator: validator,
|
|
44
43
|
autoFocusView: true,
|
|
45
44
|
additionalViewProps: {
|
|
46
45
|
rangePosition: rangePosition,
|
|
47
46
|
onRangePositionChange: onRangePositionChange
|
|
48
47
|
}
|
|
49
|
-
}),
|
|
48
|
+
})),
|
|
50
49
|
open = _usePicker.open,
|
|
51
50
|
actions = _usePicker.actions,
|
|
52
51
|
layoutProps = _usePicker.layoutProps,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["props"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
6
|
import { useLicenseVerifier } from '@mui/x-license-pro';
|
|
@@ -15,8 +17,7 @@ var releaseInfo = getReleaseInfo();
|
|
|
15
17
|
export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
16
18
|
var _fieldType, _innerSlotProps$toolb, _innerSlotProps$toolb2, _slots$layout;
|
|
17
19
|
var props = _ref.props,
|
|
18
|
-
|
|
19
|
-
validator = _ref.validator;
|
|
20
|
+
pickerParams = _objectWithoutProperties(_ref, _excluded);
|
|
20
21
|
useLicenseVerifier('x-date-pickers-pro', releaseInfo);
|
|
21
22
|
var slots = props.slots,
|
|
22
23
|
innerSlotProps = props.slotProps,
|
|
@@ -36,17 +37,15 @@ export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
|
36
37
|
singleInputFieldRef = _useRangePosition.singleInputFieldRef;
|
|
37
38
|
var labelId = useId();
|
|
38
39
|
var contextLocaleText = useLocaleText();
|
|
39
|
-
var _usePicker = usePicker({
|
|
40
|
+
var _usePicker = usePicker(_extends({}, pickerParams, {
|
|
40
41
|
props: props,
|
|
41
|
-
valueManager: valueManager,
|
|
42
42
|
wrapperVariant: 'mobile',
|
|
43
|
-
validator: validator,
|
|
44
43
|
autoFocusView: true,
|
|
45
44
|
additionalViewProps: {
|
|
46
45
|
rangePosition: rangePosition,
|
|
47
46
|
onRangePositionChange: onRangePositionChange
|
|
48
47
|
}
|
|
49
|
-
}),
|
|
48
|
+
})),
|
|
50
49
|
open = _usePicker.open,
|
|
51
50
|
actions = _usePicker.actions,
|
|
52
51
|
layoutProps = _usePicker.layoutProps,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["props", "ref"];
|
|
3
5
|
import * as React from 'react';
|
|
4
6
|
import clsx from 'clsx';
|
|
5
7
|
import { styled } from '@mui/material/styles';
|
|
@@ -24,9 +26,8 @@ var PickerStaticLayout = styled(PickersLayout)(function (_ref) {
|
|
|
24
26
|
export var useStaticRangePicker = function useStaticRangePicker(_ref2) {
|
|
25
27
|
var _slots$layout;
|
|
26
28
|
var props = _ref2.props,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
ref = _ref2.ref;
|
|
29
|
+
ref = _ref2.ref,
|
|
30
|
+
pickerParams = _objectWithoutProperties(_ref2, _excluded);
|
|
30
31
|
var localeText = props.localeText,
|
|
31
32
|
slots = props.slots,
|
|
32
33
|
slotProps = props.slotProps,
|
|
@@ -37,17 +38,15 @@ export var useStaticRangePicker = function useStaticRangePicker(_ref2) {
|
|
|
37
38
|
var _useRangePosition = useRangePosition(props),
|
|
38
39
|
rangePosition = _useRangePosition.rangePosition,
|
|
39
40
|
onRangePositionChange = _useRangePosition.onRangePositionChange;
|
|
40
|
-
var _usePicker = usePicker({
|
|
41
|
+
var _usePicker = usePicker(_extends({}, pickerParams, {
|
|
41
42
|
props: props,
|
|
42
|
-
valueManager: valueManager,
|
|
43
|
-
validator: validator,
|
|
44
43
|
autoFocusView: autoFocus != null ? autoFocus : false,
|
|
45
44
|
additionalViewProps: {
|
|
46
45
|
rangePosition: rangePosition,
|
|
47
46
|
onRangePositionChange: onRangePositionChange
|
|
48
47
|
},
|
|
49
48
|
wrapperVariant: displayStaticWrapperAs
|
|
50
|
-
}),
|
|
49
|
+
})),
|
|
51
50
|
layoutProps = _usePicker.layoutProps,
|
|
52
51
|
renderCurrentView = _usePicker.renderCurrentView;
|
|
53
52
|
var Layout = (_slots$layout = slots == null ? void 0 : slots.layout) != null ? _slots$layout : PickerStaticLayout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY4MTkzMDgwMDAwMA==";
|
|
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
|
|
@@ -5,8 +5,8 @@ import { replaceInvalidDateByNull, addPositionPropertiesToSections, createDateSt
|
|
|
5
5
|
import { splitDateRangeSections, removeLastSeparator } from './date-fields-utils';
|
|
6
6
|
export var rangeValueManager = {
|
|
7
7
|
emptyValue: [null, null],
|
|
8
|
-
getTodayValue: function getTodayValue(utils) {
|
|
9
|
-
return [utils.date(), utils.date()];
|
|
8
|
+
getTodayValue: function getTodayValue(utils, valueType) {
|
|
9
|
+
return valueType === 'date' ? [utils.startOfDay(utils.date()), utils.startOfDay(utils.date())] : [utils.date(), utils.date()];
|
|
10
10
|
},
|
|
11
11
|
cleanValue: function cleanValue(utils, value) {
|
|
12
12
|
return value.map(function (date) {
|
package/modern/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["props"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
6
|
import { useLicenseVerifier } from '@mui/x-license-pro';
|
|
@@ -11,11 +13,11 @@ import { useRangePosition } from '../useRangePosition';
|
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
15
|
const releaseInfo = getReleaseInfo();
|
|
14
|
-
export const useDesktopRangePicker =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export const useDesktopRangePicker = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
props
|
|
19
|
+
} = _ref,
|
|
20
|
+
pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
21
|
useLicenseVerifier('x-date-pickers-pro', releaseInfo);
|
|
20
22
|
const {
|
|
21
23
|
slots,
|
|
@@ -46,17 +48,15 @@ export const useDesktopRangePicker = ({
|
|
|
46
48
|
renderCurrentView,
|
|
47
49
|
shouldRestoreFocus,
|
|
48
50
|
fieldProps: pickerFieldProps
|
|
49
|
-
} = usePicker({
|
|
51
|
+
} = usePicker(_extends({}, pickerParams, {
|
|
50
52
|
props,
|
|
51
|
-
valueManager,
|
|
52
53
|
wrapperVariant: 'desktop',
|
|
53
|
-
validator,
|
|
54
54
|
autoFocusView: true,
|
|
55
55
|
additionalViewProps: {
|
|
56
56
|
rangePosition,
|
|
57
57
|
onRangePositionChange
|
|
58
58
|
}
|
|
59
|
-
});
|
|
59
|
+
}));
|
|
60
60
|
const handleBlur = () => {
|
|
61
61
|
executeInTheNextEventLoopTick(() => {
|
|
62
62
|
if (fieldContainerRef.current?.contains(getActiveElement(document)) || popperRef.current?.contains(getActiveElement(document))) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["props"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
6
|
import { useLicenseVerifier } from '@mui/x-license-pro';
|
|
@@ -12,11 +14,11 @@ import { useRangePosition } from '../useRangePosition';
|
|
|
12
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
16
|
const releaseInfo = getReleaseInfo();
|
|
15
|
-
export const useMobileRangePicker =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
export const useMobileRangePicker = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
props
|
|
20
|
+
} = _ref,
|
|
21
|
+
pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
22
|
useLicenseVerifier('x-date-pickers-pro', releaseInfo);
|
|
21
23
|
const {
|
|
22
24
|
slots,
|
|
@@ -45,17 +47,15 @@ export const useMobileRangePicker = ({
|
|
|
45
47
|
layoutProps,
|
|
46
48
|
renderCurrentView,
|
|
47
49
|
fieldProps: pickerFieldProps
|
|
48
|
-
} = usePicker({
|
|
50
|
+
} = usePicker(_extends({}, pickerParams, {
|
|
49
51
|
props,
|
|
50
|
-
valueManager,
|
|
51
52
|
wrapperVariant: 'mobile',
|
|
52
|
-
validator,
|
|
53
53
|
autoFocusView: true,
|
|
54
54
|
additionalViewProps: {
|
|
55
55
|
rangePosition,
|
|
56
56
|
onRangePositionChange
|
|
57
57
|
}
|
|
58
|
-
});
|
|
58
|
+
}));
|
|
59
59
|
const Field = slots.field;
|
|
60
60
|
const fieldType = Field.fieldType ?? 'multi-input';
|
|
61
61
|
const fieldProps = useSlotProps({
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["props", "ref"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import clsx from 'clsx';
|
|
4
6
|
import { styled } from '@mui/material/styles';
|
|
@@ -19,12 +21,12 @@ const PickerStaticLayout = styled(PickersLayout)(({
|
|
|
19
21
|
* Hook managing all the range static pickers:
|
|
20
22
|
* - StaticDateRangePicker
|
|
21
23
|
*/
|
|
22
|
-
export const useStaticRangePicker =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
export const useStaticRangePicker = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
props,
|
|
27
|
+
ref
|
|
28
|
+
} = _ref,
|
|
29
|
+
pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
28
30
|
const {
|
|
29
31
|
localeText,
|
|
30
32
|
slots,
|
|
@@ -41,17 +43,15 @@ export const useStaticRangePicker = ({
|
|
|
41
43
|
const {
|
|
42
44
|
layoutProps,
|
|
43
45
|
renderCurrentView
|
|
44
|
-
} = usePicker({
|
|
46
|
+
} = usePicker(_extends({}, pickerParams, {
|
|
45
47
|
props,
|
|
46
|
-
valueManager,
|
|
47
|
-
validator,
|
|
48
48
|
autoFocusView: autoFocus ?? false,
|
|
49
49
|
additionalViewProps: {
|
|
50
50
|
rangePosition,
|
|
51
51
|
onRangePositionChange
|
|
52
52
|
},
|
|
53
53
|
wrapperVariant: displayStaticWrapperAs
|
|
54
|
-
});
|
|
54
|
+
}));
|
|
55
55
|
const Layout = slots?.layout ?? PickerStaticLayout;
|
|
56
56
|
const slotPropsForLayout = _extends({}, slotProps, {
|
|
57
57
|
toolbar: _extends({}, slotProps?.toolbar, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY4MTkzMDgwMDAwMA==";
|
|
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
|
|
@@ -3,7 +3,7 @@ import { replaceInvalidDateByNull, addPositionPropertiesToSections, createDateSt
|
|
|
3
3
|
import { splitDateRangeSections, removeLastSeparator } from './date-fields-utils';
|
|
4
4
|
export const rangeValueManager = {
|
|
5
5
|
emptyValue: [null, null],
|
|
6
|
-
getTodayValue: utils => [utils.date(), utils.date()],
|
|
6
|
+
getTodayValue: (utils, valueType) => valueType === 'date' ? [utils.startOfDay(utils.date()), utils.startOfDay(utils.date())] : [utils.date(), utils.date()],
|
|
7
7
|
cleanValue: (utils, value) => value.map(date => replaceInvalidDateByNull(utils, date)),
|
|
8
8
|
areValuesEqual: (utils, a, b) => areDatesEqual(utils, a[0], b[0]) && areDatesEqual(utils, a[1], b[1]),
|
|
9
9
|
isSameError: (a, b) => b !== null && a[1] === b[1] && a[0] === b[0],
|
|
@@ -46,6 +46,7 @@ const DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDat
|
|
|
46
46
|
} = (0, _useDesktopRangePicker.useDesktopRangePicker)({
|
|
47
47
|
props,
|
|
48
48
|
valueManager: _valueManagers.rangeValueManager,
|
|
49
|
+
valueType: 'date',
|
|
49
50
|
validator: _useDateRangeValidation.validateDateRange
|
|
50
51
|
});
|
|
51
52
|
return renderPicker();
|
|
@@ -49,6 +49,7 @@ const MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateR
|
|
|
49
49
|
} = (0, _useMobileRangePicker.useMobileRangePicker)({
|
|
50
50
|
props,
|
|
51
51
|
valueManager: _valueManagers.rangeValueManager,
|
|
52
|
+
valueType: 'date',
|
|
52
53
|
validator: _useDateRangeValidation.validateDateRange
|
|
53
54
|
});
|
|
54
55
|
return renderPicker();
|
|
@@ -40,6 +40,7 @@ const StaticDateRangePicker = /*#__PURE__*/React.forwardRef(function StaticDateR
|
|
|
40
40
|
} = (0, _useStaticRangePicker.useStaticRangePicker)({
|
|
41
41
|
props,
|
|
42
42
|
valueManager: _valueManagers.rangeValueManager,
|
|
43
|
+
valueType: 'date',
|
|
43
44
|
validator: _useDateRangeValidation.validateDateRange,
|
|
44
45
|
ref
|
|
45
46
|
});
|
package/node/index.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useDesktopRangePicker = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _utils = require("@mui/base/utils");
|
|
11
12
|
var _xLicensePro = require("@mui/x-license-pro");
|
|
@@ -16,14 +17,15 @@ var _useEnrichedRangePickerFieldProps = require("../useEnrichedRangePickerFieldP
|
|
|
16
17
|
var _releaseInfo = require("../../utils/releaseInfo");
|
|
17
18
|
var _useRangePosition = require("../useRangePosition");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
const _excluded = ["props"];
|
|
19
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
23
|
const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
|
|
22
|
-
const useDesktopRangePicker =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const useDesktopRangePicker = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
props
|
|
27
|
+
} = _ref,
|
|
28
|
+
pickerParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
27
29
|
(0, _xLicensePro.useLicenseVerifier)('x-date-pickers-pro', releaseInfo);
|
|
28
30
|
const {
|
|
29
31
|
slots,
|
|
@@ -54,17 +56,15 @@ const useDesktopRangePicker = ({
|
|
|
54
56
|
renderCurrentView,
|
|
55
57
|
shouldRestoreFocus,
|
|
56
58
|
fieldProps: pickerFieldProps
|
|
57
|
-
} = (0, _internals.usePicker)({
|
|
59
|
+
} = (0, _internals.usePicker)((0, _extends2.default)({}, pickerParams, {
|
|
58
60
|
props,
|
|
59
|
-
valueManager,
|
|
60
61
|
wrapperVariant: 'desktop',
|
|
61
|
-
validator,
|
|
62
62
|
autoFocusView: true,
|
|
63
63
|
additionalViewProps: {
|
|
64
64
|
rangePosition,
|
|
65
65
|
onRangePositionChange
|
|
66
66
|
}
|
|
67
|
-
});
|
|
67
|
+
}));
|
|
68
68
|
const handleBlur = () => {
|
|
69
69
|
(0, _internals.executeInTheNextEventLoopTick)(() => {
|
|
70
70
|
if (fieldContainerRef.current?.contains((0, _internals.getActiveElement)(document)) || popperRef.current?.contains((0, _internals.getActiveElement)(document))) {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useMobileRangePicker = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _utils = require("@mui/base/utils");
|
|
11
12
|
var _xLicensePro = require("@mui/x-license-pro");
|
|
@@ -17,14 +18,15 @@ var _useEnrichedRangePickerFieldProps = require("../useEnrichedRangePickerFieldP
|
|
|
17
18
|
var _releaseInfo = require("../../utils/releaseInfo");
|
|
18
19
|
var _useRangePosition = require("../useRangePosition");
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
const _excluded = ["props"];
|
|
20
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
24
|
const releaseInfo = (0, _releaseInfo.getReleaseInfo)();
|
|
23
|
-
const useMobileRangePicker =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const useMobileRangePicker = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
props
|
|
28
|
+
} = _ref,
|
|
29
|
+
pickerParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
28
30
|
(0, _xLicensePro.useLicenseVerifier)('x-date-pickers-pro', releaseInfo);
|
|
29
31
|
const {
|
|
30
32
|
slots,
|
|
@@ -53,17 +55,15 @@ const useMobileRangePicker = ({
|
|
|
53
55
|
layoutProps,
|
|
54
56
|
renderCurrentView,
|
|
55
57
|
fieldProps: pickerFieldProps
|
|
56
|
-
} = (0, _internals.usePicker)({
|
|
58
|
+
} = (0, _internals.usePicker)((0, _extends2.default)({}, pickerParams, {
|
|
57
59
|
props,
|
|
58
|
-
valueManager,
|
|
59
60
|
wrapperVariant: 'mobile',
|
|
60
|
-
validator,
|
|
61
61
|
autoFocusView: true,
|
|
62
62
|
additionalViewProps: {
|
|
63
63
|
rangePosition,
|
|
64
64
|
onRangePositionChange
|
|
65
65
|
}
|
|
66
|
-
});
|
|
66
|
+
}));
|
|
67
67
|
const Field = slots.field;
|
|
68
68
|
const fieldType = Field.fieldType ?? 'multi-input';
|
|
69
69
|
const fieldProps = (0, _utils.useSlotProps)({
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useStaticRangePicker = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
12
|
var _styles = require("@mui/material/styles");
|
|
@@ -14,6 +15,7 @@ var _PickersLayout = require("@mui/x-date-pickers/PickersLayout");
|
|
|
14
15
|
var _internals = require("@mui/x-date-pickers/internals");
|
|
15
16
|
var _useRangePosition = require("../useRangePosition");
|
|
16
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
const _excluded = ["props", "ref"];
|
|
17
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
21
|
const PickerStaticLayout = (0, _styles.styled)(_PickersLayout.PickersLayout)(({
|
|
@@ -28,12 +30,12 @@ const PickerStaticLayout = (0, _styles.styled)(_PickersLayout.PickersLayout)(({
|
|
|
28
30
|
* Hook managing all the range static pickers:
|
|
29
31
|
* - StaticDateRangePicker
|
|
30
32
|
*/
|
|
31
|
-
const useStaticRangePicker =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const useStaticRangePicker = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
props,
|
|
36
|
+
ref
|
|
37
|
+
} = _ref,
|
|
38
|
+
pickerParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
37
39
|
const {
|
|
38
40
|
localeText,
|
|
39
41
|
slots,
|
|
@@ -50,17 +52,15 @@ const useStaticRangePicker = ({
|
|
|
50
52
|
const {
|
|
51
53
|
layoutProps,
|
|
52
54
|
renderCurrentView
|
|
53
|
-
} = (0, _internals.usePicker)({
|
|
55
|
+
} = (0, _internals.usePicker)((0, _extends2.default)({}, pickerParams, {
|
|
54
56
|
props,
|
|
55
|
-
valueManager,
|
|
56
|
-
validator,
|
|
57
57
|
autoFocusView: autoFocus ?? false,
|
|
58
58
|
additionalViewProps: {
|
|
59
59
|
rangePosition,
|
|
60
60
|
onRangePositionChange
|
|
61
61
|
},
|
|
62
62
|
wrapperVariant: displayStaticWrapperAs
|
|
63
|
-
});
|
|
63
|
+
}));
|
|
64
64
|
const Layout = slots?.layout ?? PickerStaticLayout;
|
|
65
65
|
const slotPropsForLayout = (0, _extends2.default)({}, slotProps, {
|
|
66
66
|
toolbar: (0, _extends2.default)({}, slotProps?.toolbar, {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTY4MTkzMDgwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -10,7 +10,7 @@ var _internals = require("@mui/x-date-pickers/internals");
|
|
|
10
10
|
var _dateFieldsUtils = require("./date-fields-utils");
|
|
11
11
|
const rangeValueManager = {
|
|
12
12
|
emptyValue: [null, null],
|
|
13
|
-
getTodayValue: utils => [utils.date(), utils.date()],
|
|
13
|
+
getTodayValue: (utils, valueType) => valueType === 'date' ? [utils.startOfDay(utils.date()), utils.startOfDay(utils.date())] : [utils.date(), utils.date()],
|
|
14
14
|
cleanValue: (utils, value) => value.map(date => (0, _internals.replaceInvalidDateByNull)(utils, date)),
|
|
15
15
|
areValuesEqual: (utils, a, b) => (0, _internals.areDatesEqual)(utils, a[0], b[0]) && (0, _internals.areDatesEqual)(utils, a[1], b[1]),
|
|
16
16
|
isSameError: (a, b) => b !== null && a[1] === b[1] && a[0] === b[0],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers-pro",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.1",
|
|
4
4
|
"description": "The commercial edition of the date picker components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@date-io/luxon": "^2.16.1",
|
|
36
36
|
"@date-io/moment": "^2.16.1",
|
|
37
37
|
"@mui/utils": "^5.11.13",
|
|
38
|
-
"@mui/x-date-pickers": "6.2.
|
|
38
|
+
"@mui/x-date-pickers": "6.2.1",
|
|
39
39
|
"@mui/x-license-pro": "6.0.4",
|
|
40
40
|
"clsx": "^1.2.1",
|
|
41
41
|
"prop-types": "^15.8.1",
|