@mui/x-date-pickers-pro 6.0.4 → 6.1.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 +58 -0
- package/DateRangeCalendar/useDragRange.d.ts +1 -1
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +10 -0
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +10 -0
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +10 -0
- package/README.md +2 -2
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +22 -11
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +26 -15
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +26 -15
- package/index.js +1 -1
- package/internal/utils/date-range-manager.d.ts +1 -1
- package/internal/utils/date-utils.d.ts +1 -1
- package/internal/utils/releaseInfo.js +1 -1
- package/internal/utils/valueManagers.d.ts +1 -1
- package/internal/utils/valueManagers.js +2 -2
- package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +10 -0
- package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +10 -0
- package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +10 -0
- package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +19 -10
- package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +23 -14
- package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +23 -14
- package/legacy/index.js +1 -1
- package/legacy/internal/utils/releaseInfo.js +1 -1
- package/legacy/internal/utils/valueManagers.js +3 -3
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +10 -0
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +10 -0
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +10 -0
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +22 -11
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +26 -15
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +26 -15
- package/modern/index.js +1 -1
- package/modern/internal/utils/releaseInfo.js +1 -1
- package/modern/internal/utils/valueManagers.js +2 -2
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +10 -0
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +10 -0
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +10 -0
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +22 -11
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +25 -14
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +25 -14
- package/node/index.js +1 -1
- package/node/internal/utils/releaseInfo.js +1 -1
- package/node/internal/utils/valueManagers.js +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,64 @@
|
|
|
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.1.0
|
|
7
|
+
|
|
8
|
+
_Apr 7, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Add Catalan (ca-ES), Kazakh (kz-KZ) and improve Spanish (es-ES), Dutch (nl-NL), Hebrew (he-IL), Hungarian (hu-HU), Japanese (ja-JP), Portuguese (pt-BR), and Russian (ru-RU) locales
|
|
13
|
+
- ✨ Allow to control visibility of columns shown in the columns panel (#8401) @MBilalShafi
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### `@mui/x-data-grid@v6.1.0` / `@mui/x-data-grid-pro@v6.1.0` / `@mui/x-data-grid-premium@v6.1.0`
|
|
18
|
+
|
|
19
|
+
#### Changes
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Allow to control visibility of columns shown in the `ColumnsPanel` component (#8401) @MBilalShafi
|
|
22
|
+
- [DataGrid] Fix filters with empty array value not being removed from the filter model (#8501) @cherniavskii
|
|
23
|
+
- [DataGrid] Fix memory leaks in development (#8301) @cherniavskii
|
|
24
|
+
- [DataGrid] Sync `date` column value when entering edit mode by pressing a digit (#8364) @m4theushw
|
|
25
|
+
- [DataGrid] Wrap column menu button with a tooltip (#7890) @cherniavskii
|
|
26
|
+
- [l10n] Improve Dutch (nl-NL) locale (#8491) @thedutchruben
|
|
27
|
+
- [l10n] Improve Hungarian (hu-HU) locale (#8486) @PetakCC
|
|
28
|
+
- [l10n] Improve Japanese (ja-JP) locale (#8462) @megos
|
|
29
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#8480) @pwnedev
|
|
30
|
+
- [l10n] Improve Russian (ru-RU) locale (#8510) @alexrapro
|
|
31
|
+
|
|
32
|
+
### `@mui/x-date-pickers@v6.1.0` / `@mui/x-date-pickers-pro@v6.1.0`
|
|
33
|
+
|
|
34
|
+
#### Changes
|
|
35
|
+
|
|
36
|
+
- [fields] Fix RTL navigation (#8490) @alexfauquette
|
|
37
|
+
- [fields] Fix usage of `slotProps.textField.InputProps` (#8428) @flaviendelangle
|
|
38
|
+
- [pickers] Fix `componentsProps.dialog` propagation (#8509) @LukasTy
|
|
39
|
+
- [pickers] Move `hasError` from `fieldValueManager` to `valueManager` (#8453) @flaviendelangle
|
|
40
|
+
- [pickers] Move the adapters interfaces to the X repository (#8412) @flaviendelangle
|
|
41
|
+
- [pickers] Update peer dependency versions (#8531) @LukasTy
|
|
42
|
+
- [pickers] Fix `isValid` regression (#8543) @LukasTy
|
|
43
|
+
- [l10n] Add Catalan (Spain) (ca-ES) and improve Spanish (es-ES) locales (#8498) @makenshikuro
|
|
44
|
+
- [l10n] Add Kazakh (kz-KZ) locale (#8451) @zhunus
|
|
45
|
+
- [l10n] Improve Dutch (nl-NL) locale (#8491) @thedutchruben
|
|
46
|
+
- [l10n] Improve Hebrew (he-IL) locale (#8464) @soris1989
|
|
47
|
+
- [l10n] Improve Japanese (ja-JP) locale (#8462) @megos
|
|
48
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#8480) @pwnedev
|
|
49
|
+
|
|
50
|
+
### Docs
|
|
51
|
+
|
|
52
|
+
- [docs] Fix 301 redirect (#8524) @alexfauquette
|
|
53
|
+
- [docs] Fix 404 links (#8454) @alexfauquette
|
|
54
|
+
- [docs] Fix broken API reference link (#8460) @oliviertassinari
|
|
55
|
+
|
|
56
|
+
### Core
|
|
57
|
+
|
|
58
|
+
- [core] Avoid 301 links (#8383) @oliviertassinari
|
|
59
|
+
- [core] Fix the l10n helper by using danger instead of actions (#8512) @alexfauquette
|
|
60
|
+
- [core] Help contributors for l10n PRs (#8503) @alexfauquette
|
|
61
|
+
- [core] Remove legacy token (#8457) @oliviertassinari
|
|
62
|
+
- [charts] Add a styling system (#8445) @alexfauquette
|
|
63
|
+
|
|
6
64
|
## 6.0.4
|
|
7
65
|
|
|
8
66
|
_Mar 30, 2023_
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { MuiPickersAdapter } from '@mui/x-date-pickers/
|
|
2
|
+
import { MuiPickersAdapter } from '@mui/x-date-pickers/models';
|
|
3
3
|
import { DateRangePosition } from './DateRangeCalendar.types';
|
|
4
4
|
import { DateRange } from '../internal/models';
|
|
5
5
|
interface UseDragRangeParams<TDate> {
|
|
@@ -289,6 +289,16 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
289
289
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
290
290
|
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
291
291
|
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
292
|
+
/**
|
|
293
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
294
|
+
*
|
|
295
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
|
|
296
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
297
|
+
*
|
|
298
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
299
|
+
* @default false
|
|
300
|
+
*/
|
|
301
|
+
useFlexGap: PropTypes.bool,
|
|
292
302
|
/**
|
|
293
303
|
* The selected value.
|
|
294
304
|
* Used when the component is controlled.
|
|
@@ -355,6 +355,16 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
355
355
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
356
356
|
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
357
357
|
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
358
|
+
/**
|
|
359
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
360
|
+
*
|
|
361
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
|
|
362
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
363
|
+
*
|
|
364
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
365
|
+
* @default false
|
|
366
|
+
*/
|
|
367
|
+
useFlexGap: PropTypes.bool,
|
|
358
368
|
/**
|
|
359
369
|
* The selected value.
|
|
360
370
|
* Used when the component is controlled.
|
|
@@ -321,6 +321,16 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
321
321
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
322
322
|
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
323
323
|
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
324
|
+
/**
|
|
325
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
326
|
+
*
|
|
327
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
|
|
328
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
329
|
+
*
|
|
330
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
331
|
+
* @default false
|
|
332
|
+
*/
|
|
333
|
+
useFlexGap: PropTypes.bool,
|
|
324
334
|
/**
|
|
325
335
|
* The selected value.
|
|
326
336
|
* Used when the component is controlled.
|
package/README.md
CHANGED
|
@@ -34,8 +34,8 @@ This component has the following peer dependencies that you will need to install
|
|
|
34
34
|
|
|
35
35
|
```json
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@mui/material": "^5.
|
|
38
|
-
"@mui/system": "^5.
|
|
37
|
+
"@mui/material": "^5.8.6",
|
|
38
|
+
"@mui/system": "^5.8.0",
|
|
39
39
|
"react": "^17.0.2 || ^18.0.0",
|
|
40
40
|
"react-dom": "^17.0.2 || ^18.0.0"
|
|
41
41
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "components", "componentsProps"],
|
|
4
|
-
_excluded2 = ["
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
|
|
4
|
+
_excluded2 = ["inputRef"],
|
|
5
|
+
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import MuiTextField from '@mui/material/TextField';
|
|
@@ -19,20 +20,30 @@ const SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
19
20
|
slots,
|
|
20
21
|
slotProps,
|
|
21
22
|
components,
|
|
22
|
-
componentsProps
|
|
23
|
+
componentsProps,
|
|
24
|
+
InputProps,
|
|
25
|
+
inputProps
|
|
23
26
|
} = themeProps,
|
|
24
27
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
25
28
|
const ownerState = themeProps;
|
|
26
29
|
const TextField = (_ref = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : components == null ? void 0 : components.TextField) != null ? _ref : MuiTextField;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const _useSlotProps = useSlotProps({
|
|
31
|
+
elementType: TextField,
|
|
32
|
+
externalSlotProps: (_slotProps$textField = slotProps == null ? void 0 : slotProps.textField) != null ? _slotProps$textField : componentsProps == null ? void 0 : componentsProps.textField,
|
|
33
|
+
externalForwardedProps: other,
|
|
34
|
+
ownerState
|
|
35
|
+
}),
|
|
36
|
+
{
|
|
37
|
+
inputRef: externalInputRef
|
|
38
|
+
} = _useSlotProps,
|
|
39
|
+
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
|
+
|
|
41
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
33
44
|
const _useSingleInputDateRa = useSingleInputDateRangeField({
|
|
34
45
|
props: textFieldProps,
|
|
35
|
-
inputRef:
|
|
46
|
+
inputRef: externalInputRef
|
|
36
47
|
}),
|
|
37
48
|
{
|
|
38
49
|
ref: inputRef,
|
|
@@ -40,7 +51,7 @@ const SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
40
51
|
inputMode,
|
|
41
52
|
readOnly
|
|
42
53
|
} = _useSingleInputDateRa,
|
|
43
|
-
fieldProps = _objectWithoutPropertiesLoose(_useSingleInputDateRa,
|
|
54
|
+
fieldProps = _objectWithoutPropertiesLoose(_useSingleInputDateRa, _excluded3);
|
|
44
55
|
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
45
56
|
ref: ref
|
|
46
57
|
}, fieldProps, {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "components", "componentsProps"],
|
|
4
|
-
_excluded2 = ["
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
|
|
4
|
+
_excluded2 = ["inputRef"],
|
|
5
|
+
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
|
-
import
|
|
8
|
+
import MuiTextField from '@mui/material/TextField';
|
|
8
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
9
10
|
import { useSlotProps } from '@mui/base/utils';
|
|
10
11
|
import { useSingleInputDateTimeRangeField } from './useSingleInputDateTimeRangeField';
|
|
@@ -19,20 +20,30 @@ const SingleInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Sin
|
|
|
19
20
|
slots,
|
|
20
21
|
slotProps,
|
|
21
22
|
components,
|
|
22
|
-
componentsProps
|
|
23
|
+
componentsProps,
|
|
24
|
+
InputProps,
|
|
25
|
+
inputProps
|
|
23
26
|
} = themeProps,
|
|
24
27
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
25
28
|
const ownerState = themeProps;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const TextField = (_ref = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : components == null ? void 0 : components.TextField) != null ? _ref : MuiTextField;
|
|
30
|
+
const _useSlotProps = useSlotProps({
|
|
31
|
+
elementType: TextField,
|
|
32
|
+
externalSlotProps: (_slotProps$textField = slotProps == null ? void 0 : slotProps.textField) != null ? _slotProps$textField : componentsProps == null ? void 0 : componentsProps.textField,
|
|
33
|
+
externalForwardedProps: other,
|
|
34
|
+
ownerState
|
|
35
|
+
}),
|
|
36
|
+
{
|
|
37
|
+
inputRef: externalInputRef
|
|
38
|
+
} = _useSlotProps,
|
|
39
|
+
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
|
+
|
|
41
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
33
44
|
const _useSingleInputDateTi = useSingleInputDateTimeRangeField({
|
|
34
|
-
props:
|
|
35
|
-
inputRef:
|
|
45
|
+
props: textFieldProps,
|
|
46
|
+
inputRef: externalInputRef
|
|
36
47
|
}),
|
|
37
48
|
{
|
|
38
49
|
ref: inputRef,
|
|
@@ -40,8 +51,8 @@ const SingleInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Sin
|
|
|
40
51
|
inputMode,
|
|
41
52
|
readOnly
|
|
42
53
|
} = _useSingleInputDateTi,
|
|
43
|
-
fieldProps = _objectWithoutPropertiesLoose(_useSingleInputDateTi,
|
|
44
|
-
return /*#__PURE__*/_jsx(
|
|
54
|
+
fieldProps = _objectWithoutPropertiesLoose(_useSingleInputDateTi, _excluded3);
|
|
55
|
+
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
45
56
|
ref: ref
|
|
46
57
|
}, fieldProps, {
|
|
47
58
|
inputProps: _extends({}, fieldProps.inputProps, {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "components", "componentsProps"],
|
|
4
|
-
_excluded2 = ["
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
|
|
4
|
+
_excluded2 = ["inputRef"],
|
|
5
|
+
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
|
-
import
|
|
8
|
+
import MuiTextField from '@mui/material/TextField';
|
|
8
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
9
10
|
import { useSlotProps } from '@mui/base/utils';
|
|
10
11
|
import { useSingleInputTimeRangeField } from './useSingleInputTimeRangeField';
|
|
@@ -19,20 +20,30 @@ const SingleInputTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
19
20
|
slots,
|
|
20
21
|
slotProps,
|
|
21
22
|
components,
|
|
22
|
-
componentsProps
|
|
23
|
+
componentsProps,
|
|
24
|
+
InputProps,
|
|
25
|
+
inputProps
|
|
23
26
|
} = themeProps,
|
|
24
27
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
25
28
|
const ownerState = themeProps;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const TextField = (_ref = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : components == null ? void 0 : components.TextField) != null ? _ref : MuiTextField;
|
|
30
|
+
const _useSlotProps = useSlotProps({
|
|
31
|
+
elementType: TextField,
|
|
32
|
+
externalSlotProps: (_slotProps$textField = slotProps == null ? void 0 : slotProps.textField) != null ? _slotProps$textField : componentsProps == null ? void 0 : componentsProps.textField,
|
|
33
|
+
externalForwardedProps: other,
|
|
34
|
+
ownerState
|
|
35
|
+
}),
|
|
36
|
+
{
|
|
37
|
+
inputRef: externalInputRef
|
|
38
|
+
} = _useSlotProps,
|
|
39
|
+
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
|
+
|
|
41
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
33
44
|
const _useSingleInputTimeRa = useSingleInputTimeRangeField({
|
|
34
|
-
props:
|
|
35
|
-
inputRef:
|
|
45
|
+
props: textFieldProps,
|
|
46
|
+
inputRef: externalInputRef
|
|
36
47
|
}),
|
|
37
48
|
{
|
|
38
49
|
ref: inputRef,
|
|
@@ -40,8 +51,8 @@ const SingleInputTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
40
51
|
inputMode,
|
|
41
52
|
readOnly
|
|
42
53
|
} = _useSingleInputTimeRa,
|
|
43
|
-
fieldProps = _objectWithoutPropertiesLoose(_useSingleInputTimeRa,
|
|
44
|
-
return /*#__PURE__*/_jsx(
|
|
54
|
+
fieldProps = _objectWithoutPropertiesLoose(_useSingleInputTimeRa, _excluded3);
|
|
55
|
+
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
45
56
|
ref: ref
|
|
46
57
|
}, fieldProps, {
|
|
47
58
|
inputProps: _extends({}, fieldProps.inputProps, {
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MuiPickersAdapter } from '@mui/x-date-pickers/
|
|
1
|
+
import { MuiPickersAdapter } from '@mui/x-date-pickers/models';
|
|
2
2
|
import { DateRange, RangePosition } from '../models/range';
|
|
3
3
|
interface CalculateRangeChangeOptions<TDate> {
|
|
4
4
|
utils: MuiPickersAdapter<TDate>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MuiPickersAdapter } from '@mui/x-date-pickers/
|
|
1
|
+
import { MuiPickersAdapter } from '@mui/x-date-pickers/models';
|
|
2
2
|
import { DateRange, NonEmptyDateRange } from '../models/range';
|
|
3
3
|
export declare const isRangeValid: <TDate>(utils: MuiPickersAdapter<TDate>, range: DateRange<TDate> | null) => range is NonEmptyDateRange<TDate>;
|
|
4
4
|
export declare const isWithinRange: <TDate>(utils: MuiPickersAdapter<TDate>, day: TDate, range: DateRange<TDate> | null) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY4MTA3NDAwMDAwMA==";
|
|
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
|
|
@@ -6,4 +6,4 @@ import type { DateTimeRangeValidationError } from '../hooks/validation/useDateTi
|
|
|
6
6
|
import { RangeFieldSection } from '../models/fields';
|
|
7
7
|
export type RangePickerValueManager<TValue = [any, any], TDate = any, TError extends DateRangeValidationError | TimeRangeValidationError | DateTimeRangeValidationError = any> = PickerValueManager<TValue, TDate, TError>;
|
|
8
8
|
export declare const rangeValueManager: RangePickerValueManager;
|
|
9
|
-
export declare const rangeFieldValueManager: FieldValueManager<DateRange<any>, any, RangeFieldSection
|
|
9
|
+
export declare const rangeFieldValueManager: FieldValueManager<DateRange<any>, any, RangeFieldSection>;
|
|
@@ -7,6 +7,7 @@ export const rangeValueManager = {
|
|
|
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],
|
|
10
|
+
hasError: error => error[0] != null || error[1] != null,
|
|
10
11
|
defaultErrorState: [null, null]
|
|
11
12
|
};
|
|
12
13
|
export const rangeFieldValueManager = {
|
|
@@ -81,6 +82,5 @@ export const rangeFieldValueManager = {
|
|
|
81
82
|
referenceValue: newActiveDate == null || !utils.isValid(newActiveDate) ? state.referenceValue : updateDateInRange(newActiveDate, state.referenceValue)
|
|
82
83
|
})
|
|
83
84
|
};
|
|
84
|
-
}
|
|
85
|
-
hasError: error => error[0] != null || error[1] != null
|
|
85
|
+
}
|
|
86
86
|
};
|
|
@@ -289,6 +289,16 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
289
289
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
290
290
|
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
291
291
|
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
292
|
+
/**
|
|
293
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
294
|
+
*
|
|
295
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
|
|
296
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
297
|
+
*
|
|
298
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
299
|
+
* @default false
|
|
300
|
+
*/
|
|
301
|
+
useFlexGap: PropTypes.bool,
|
|
292
302
|
/**
|
|
293
303
|
* The selected value.
|
|
294
304
|
* Used when the component is controlled.
|
|
@@ -355,6 +355,16 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
355
355
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
356
356
|
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
357
357
|
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
358
|
+
/**
|
|
359
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
360
|
+
*
|
|
361
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
|
|
362
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
363
|
+
*
|
|
364
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
365
|
+
* @default false
|
|
366
|
+
*/
|
|
367
|
+
useFlexGap: PropTypes.bool,
|
|
358
368
|
/**
|
|
359
369
|
* The selected value.
|
|
360
370
|
* Used when the component is controlled.
|
|
@@ -321,6 +321,16 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
321
321
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
322
322
|
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
323
323
|
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
324
|
+
/**
|
|
325
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
326
|
+
*
|
|
327
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
|
|
328
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
329
|
+
*
|
|
330
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
331
|
+
* @default false
|
|
332
|
+
*/
|
|
333
|
+
useFlexGap: PropTypes.bool,
|
|
324
334
|
/**
|
|
325
335
|
* The selected value.
|
|
326
336
|
* Used when the component is controlled.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["slots", "slotProps", "components", "componentsProps"],
|
|
4
|
-
_excluded2 = ["
|
|
3
|
+
var _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
|
|
4
|
+
_excluded2 = ["inputRef"],
|
|
5
|
+
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import MuiTextField from '@mui/material/TextField';
|
|
@@ -19,24 +20,32 @@ var SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleInp
|
|
|
19
20
|
slotProps = themeProps.slotProps,
|
|
20
21
|
components = themeProps.components,
|
|
21
22
|
componentsProps = themeProps.componentsProps,
|
|
23
|
+
InputProps = themeProps.InputProps,
|
|
24
|
+
inputProps = themeProps.inputProps,
|
|
22
25
|
other = _objectWithoutProperties(themeProps, _excluded);
|
|
23
26
|
var ownerState = themeProps;
|
|
24
27
|
var TextField = (_ref = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : components == null ? void 0 : components.TextField) != null ? _ref : MuiTextField;
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
var _useSlotProps = useSlotProps({
|
|
29
|
+
elementType: TextField,
|
|
30
|
+
externalSlotProps: (_slotProps$textField = slotProps == null ? void 0 : slotProps.textField) != null ? _slotProps$textField : componentsProps == null ? void 0 : componentsProps.textField,
|
|
31
|
+
externalForwardedProps: other,
|
|
32
|
+
ownerState: ownerState
|
|
33
|
+
}),
|
|
34
|
+
externalInputRef = _useSlotProps.inputRef,
|
|
35
|
+
textFieldProps = _objectWithoutProperties(_useSlotProps, _excluded2);
|
|
36
|
+
|
|
37
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
38
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
39
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
31
40
|
var _useSingleInputDateRa = useSingleInputDateRangeField({
|
|
32
41
|
props: textFieldProps,
|
|
33
|
-
inputRef:
|
|
42
|
+
inputRef: externalInputRef
|
|
34
43
|
}),
|
|
35
44
|
inputRef = _useSingleInputDateRa.ref,
|
|
36
45
|
onPaste = _useSingleInputDateRa.onPaste,
|
|
37
46
|
inputMode = _useSingleInputDateRa.inputMode,
|
|
38
47
|
readOnly = _useSingleInputDateRa.readOnly,
|
|
39
|
-
fieldProps = _objectWithoutProperties(_useSingleInputDateRa,
|
|
48
|
+
fieldProps = _objectWithoutProperties(_useSingleInputDateRa, _excluded3);
|
|
40
49
|
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
41
50
|
ref: ref
|
|
42
51
|
}, fieldProps, {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["slots", "slotProps", "components", "componentsProps"],
|
|
4
|
-
_excluded2 = ["
|
|
3
|
+
var _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
|
|
4
|
+
_excluded2 = ["inputRef"],
|
|
5
|
+
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
|
-
import
|
|
8
|
+
import MuiTextField from '@mui/material/TextField';
|
|
8
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
9
10
|
import { useSlotProps } from '@mui/base/utils';
|
|
10
11
|
import { useSingleInputDateTimeRangeField } from './useSingleInputDateTimeRangeField';
|
|
@@ -19,25 +20,33 @@ var SingleInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Singl
|
|
|
19
20
|
slotProps = themeProps.slotProps,
|
|
20
21
|
components = themeProps.components,
|
|
21
22
|
componentsProps = themeProps.componentsProps,
|
|
23
|
+
InputProps = themeProps.InputProps,
|
|
24
|
+
inputProps = themeProps.inputProps,
|
|
22
25
|
other = _objectWithoutProperties(themeProps, _excluded);
|
|
23
26
|
var ownerState = themeProps;
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
var TextField = (_ref = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : components == null ? void 0 : components.TextField) != null ? _ref : MuiTextField;
|
|
28
|
+
var _useSlotProps = useSlotProps({
|
|
29
|
+
elementType: TextField,
|
|
30
|
+
externalSlotProps: (_slotProps$textField = slotProps == null ? void 0 : slotProps.textField) != null ? _slotProps$textField : componentsProps == null ? void 0 : componentsProps.textField,
|
|
31
|
+
externalForwardedProps: other,
|
|
32
|
+
ownerState: ownerState
|
|
33
|
+
}),
|
|
34
|
+
externalInputRef = _useSlotProps.inputRef,
|
|
35
|
+
textFieldProps = _objectWithoutProperties(_useSlotProps, _excluded2);
|
|
36
|
+
|
|
37
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
38
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
39
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
31
40
|
var _useSingleInputDateTi = useSingleInputDateTimeRangeField({
|
|
32
|
-
props:
|
|
33
|
-
inputRef:
|
|
41
|
+
props: textFieldProps,
|
|
42
|
+
inputRef: externalInputRef
|
|
34
43
|
}),
|
|
35
44
|
inputRef = _useSingleInputDateTi.ref,
|
|
36
45
|
onPaste = _useSingleInputDateTi.onPaste,
|
|
37
46
|
inputMode = _useSingleInputDateTi.inputMode,
|
|
38
47
|
readOnly = _useSingleInputDateTi.readOnly,
|
|
39
|
-
fieldProps = _objectWithoutProperties(_useSingleInputDateTi,
|
|
40
|
-
return /*#__PURE__*/_jsx(
|
|
48
|
+
fieldProps = _objectWithoutProperties(_useSingleInputDateTi, _excluded3);
|
|
49
|
+
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
41
50
|
ref: ref
|
|
42
51
|
}, fieldProps, {
|
|
43
52
|
inputProps: _extends({}, fieldProps.inputProps, {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["slots", "slotProps", "components", "componentsProps"],
|
|
4
|
-
_excluded2 = ["
|
|
3
|
+
var _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
|
|
4
|
+
_excluded2 = ["inputRef"],
|
|
5
|
+
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
|
-
import
|
|
8
|
+
import MuiTextField from '@mui/material/TextField';
|
|
8
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
9
10
|
import { useSlotProps } from '@mui/base/utils';
|
|
10
11
|
import { useSingleInputTimeRangeField } from './useSingleInputTimeRangeField';
|
|
@@ -19,25 +20,33 @@ var SingleInputTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleInp
|
|
|
19
20
|
slotProps = themeProps.slotProps,
|
|
20
21
|
components = themeProps.components,
|
|
21
22
|
componentsProps = themeProps.componentsProps,
|
|
23
|
+
InputProps = themeProps.InputProps,
|
|
24
|
+
inputProps = themeProps.inputProps,
|
|
22
25
|
other = _objectWithoutProperties(themeProps, _excluded);
|
|
23
26
|
var ownerState = themeProps;
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
var TextField = (_ref = (_slots$textField = slots == null ? void 0 : slots.textField) != null ? _slots$textField : components == null ? void 0 : components.TextField) != null ? _ref : MuiTextField;
|
|
28
|
+
var _useSlotProps = useSlotProps({
|
|
29
|
+
elementType: TextField,
|
|
30
|
+
externalSlotProps: (_slotProps$textField = slotProps == null ? void 0 : slotProps.textField) != null ? _slotProps$textField : componentsProps == null ? void 0 : componentsProps.textField,
|
|
31
|
+
externalForwardedProps: other,
|
|
32
|
+
ownerState: ownerState
|
|
33
|
+
}),
|
|
34
|
+
externalInputRef = _useSlotProps.inputRef,
|
|
35
|
+
textFieldProps = _objectWithoutProperties(_useSlotProps, _excluded2);
|
|
36
|
+
|
|
37
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
38
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
39
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
31
40
|
var _useSingleInputTimeRa = useSingleInputTimeRangeField({
|
|
32
|
-
props:
|
|
33
|
-
inputRef:
|
|
41
|
+
props: textFieldProps,
|
|
42
|
+
inputRef: externalInputRef
|
|
34
43
|
}),
|
|
35
44
|
inputRef = _useSingleInputTimeRa.ref,
|
|
36
45
|
onPaste = _useSingleInputTimeRa.onPaste,
|
|
37
46
|
inputMode = _useSingleInputTimeRa.inputMode,
|
|
38
47
|
readOnly = _useSingleInputTimeRa.readOnly,
|
|
39
|
-
fieldProps = _objectWithoutProperties(_useSingleInputTimeRa,
|
|
40
|
-
return /*#__PURE__*/_jsx(
|
|
48
|
+
fieldProps = _objectWithoutProperties(_useSingleInputTimeRa, _excluded3);
|
|
49
|
+
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
41
50
|
ref: ref
|
|
42
51
|
}, fieldProps, {
|
|
43
52
|
inputProps: _extends({}, fieldProps.inputProps, {
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY4MTA3NDAwMDAwMA==";
|
|
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
|