@mui/x-date-pickers-pro 6.0.4 → 6.2.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 +110 -0
- package/DateRangeCalendar/useDragRange.d.ts +1 -1
- package/DateRangePicker/DateRangePicker.js +6 -0
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -0
- package/MobileDateRangePicker/MobileDateRangePicker.js +6 -0
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +19 -1
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +19 -1
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +19 -1
- package/README.md +3 -2
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +28 -11
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +32 -15
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +32 -15
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
- package/index.js +1 -1
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +2 -0
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -1
- package/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
- 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/DateRangePicker/DateRangePicker.js +6 -0
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -0
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +6 -0
- package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +19 -1
- package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +19 -1
- package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +19 -1
- package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +25 -10
- package/legacy/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
- package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +29 -14
- package/legacy/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
- package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +29 -14
- package/legacy/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
- package/legacy/index.js +1 -1
- package/legacy/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +2 -0
- package/legacy/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -1
- package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
- package/legacy/internal/utils/releaseInfo.js +1 -1
- package/legacy/internal/utils/valueManagers.js +3 -3
- package/modern/DateRangePicker/DateRangePicker.js +6 -0
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -0
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +6 -0
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +19 -1
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +19 -1
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +19 -1
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +28 -11
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +32 -15
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +32 -15
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
- package/modern/index.js +1 -1
- package/modern/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +2 -0
- package/modern/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -1
- package/modern/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
- package/modern/internal/utils/releaseInfo.js +1 -1
- package/modern/internal/utils/valueManagers.js +2 -2
- package/node/DateRangePicker/DateRangePicker.js +6 -0
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -0
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +6 -0
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +19 -1
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +19 -1
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +19 -1
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +28 -11
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +31 -14
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +31 -14
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
- package/node/index.js +1 -1
- package/node/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +2 -0
- package/node/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +3 -1
- package/node/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
- package/node/internal/utils/releaseInfo.js +1 -1
- package/node/internal/utils/valueManagers.js +2 -2
- package/package.json +26 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,116 @@
|
|
|
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.0
|
|
7
|
+
|
|
8
|
+
_Apr 13, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- Add `@mui/base` as a `peerDependency` of `@mui/x-date-pickers` and `@mui/x-date-pickers-pro` (#8590) @LukasTy
|
|
13
|
+
|
|
14
|
+
Both libraries were not working correctly if used without `@mui/base`.
|
|
15
|
+
Most package manager should automatically use the `@mui/base` version installed for `@mui/material`.
|
|
16
|
+
|
|
17
|
+
- The value rendered in the picker or field input no longer has spaces around the `/` characters (#8425) @flaviendelangle
|
|
18
|
+
|
|
19
|
+
You can use the `formatDensity='spacious'` prop to add it back.
|
|
20
|
+
More information on [the dedicated doc section](https://mui.com/x/react-date-pickers/custom-field/#change-the-format-density)
|
|
21
|
+
|
|
22
|
+
- 🌍 Improve French (fr-FR) and Urdu (ur-PK) and locales.
|
|
23
|
+
- 🐞 Bugfixes
|
|
24
|
+
- 📚 Documentation improvements
|
|
25
|
+
|
|
26
|
+
### `@mui/x-data-grid@v6.2.0` / `@mui/x-data-grid-pro@v6.2.0` / `@mui/x-data-grid-premium@v6.2.0`
|
|
27
|
+
|
|
28
|
+
#### Changes
|
|
29
|
+
|
|
30
|
+
- [DataGrid] Reset selection state on `checkboxSelection` toggle (#8522) @MBilalShafi
|
|
31
|
+
- [DataGrid] Use `baseSelect` slot instead of `baseTextField` with `select={true}` (#8110) @cherniavskii
|
|
32
|
+
- [l10n] Improve French (fr-FR) locale (#8537) @vallereaugabriel
|
|
33
|
+
- [l10n] Improve Urdu (ur-PK) locale (#8513) @SFARPak
|
|
34
|
+
|
|
35
|
+
### `@mui/x-date-pickers@v6.2.0` / `@mui/x-date-pickers-pro@v6.2.0`
|
|
36
|
+
|
|
37
|
+
#### Changes
|
|
38
|
+
|
|
39
|
+
- [DateTimePicker] Fix `TimeClock` validation ignoring date by default (#8570) @LukasTy
|
|
40
|
+
- [fields] Fix reliance on section order (#8545) @LukasTy
|
|
41
|
+
- [fields] Make the space between format separators controllable (#8425) @flaviendelangle
|
|
42
|
+
- [pickers] Add `@mui/base` to `peerDependencies` (#8590) @LukasTy
|
|
43
|
+
- [pickers] Fix JSDoc for `formatDensity` prop (#8601) @flaviendelangle
|
|
44
|
+
- [pickers] Improve value lifecycle on non-controlled pickers (#8312) @flaviendelangle
|
|
45
|
+
- [pickers] Migrate `AdapterDayjs` to our repository (#8487) @flaviendelangle
|
|
46
|
+
|
|
47
|
+
### Docs
|
|
48
|
+
|
|
49
|
+
- [docs] Fix "Custom day rendering" demo alignment (#8541) @LukasTy
|
|
50
|
+
- [docs] Fix **below** typo (#8576) @alexfauquette
|
|
51
|
+
|
|
52
|
+
### Core
|
|
53
|
+
|
|
54
|
+
- [core] Optimize `renovate` rules (#8575) @LukasTy
|
|
55
|
+
- [core] Upgrade monorepo (#8578) @cherniavskii
|
|
56
|
+
- [core] Update last release date (#8569) @DanailH
|
|
57
|
+
|
|
58
|
+
## 6.1.0
|
|
59
|
+
|
|
60
|
+
_Apr 10, 2023_
|
|
61
|
+
|
|
62
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
63
|
+
|
|
64
|
+
- 🌍 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
|
|
65
|
+
- ✨ Allow to control visibility of columns shown in the columns panel (#8401) @MBilalShafi
|
|
66
|
+
- 🐞 Bugfixes
|
|
67
|
+
- 📚 Documentation improvements
|
|
68
|
+
|
|
69
|
+
### `@mui/x-data-grid@v6.1.0` / `@mui/x-data-grid-pro@v6.1.0` / `@mui/x-data-grid-premium@v6.1.0`
|
|
70
|
+
|
|
71
|
+
#### Changes
|
|
72
|
+
|
|
73
|
+
- [DataGrid] Allow to control visibility of columns shown in the `ColumnsPanel` component (#8401) @MBilalShafi
|
|
74
|
+
- [DataGrid] Fix filters with empty array value not being removed from the filter model (#8501) @cherniavskii
|
|
75
|
+
- [DataGrid] Fix memory leaks in development (#8301) @cherniavskii
|
|
76
|
+
- [DataGrid] Sync `date` column value when entering edit mode by pressing a digit (#8364) @m4theushw
|
|
77
|
+
- [DataGrid] Wrap column menu button with a tooltip (#7890) @cherniavskii
|
|
78
|
+
- [l10n] Improve Dutch (nl-NL) locale (#8491) @thedutchruben
|
|
79
|
+
- [l10n] Improve Hungarian (hu-HU) locale (#8486) @PetakCC
|
|
80
|
+
- [l10n] Improve Japanese (ja-JP) locale (#8462) @megos
|
|
81
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#8480) @pwnedev
|
|
82
|
+
- [l10n] Improve Russian (ru-RU) locale (#8510) @alexrapro
|
|
83
|
+
|
|
84
|
+
### `@mui/x-date-pickers@v6.1.0` / `@mui/x-date-pickers-pro@v6.1.0`
|
|
85
|
+
|
|
86
|
+
#### Changes
|
|
87
|
+
|
|
88
|
+
- [fields] Fix RTL navigation (#8490) @alexfauquette
|
|
89
|
+
- [fields] Fix usage of `slotProps.textField.InputProps` (#8428) @flaviendelangle
|
|
90
|
+
- [pickers] Fix `componentsProps.dialog` propagation (#8509) @LukasTy
|
|
91
|
+
- [pickers] Move `hasError` from `fieldValueManager` to `valueManager` (#8453) @flaviendelangle
|
|
92
|
+
- [pickers] Move the adapters interfaces to the X repository (#8412) @flaviendelangle
|
|
93
|
+
- [pickers] Update peer dependency versions (#8531) @LukasTy
|
|
94
|
+
- [pickers] Fix `isValid` regression (#8543) @LukasTy
|
|
95
|
+
- [l10n] Add Catalan (Spain) (ca-ES) and improve Spanish (es-ES) locales (#8498) @makenshikuro
|
|
96
|
+
- [l10n] Add Kazakh (kz-KZ) locale (#8451) @zhunus
|
|
97
|
+
- [l10n] Improve Dutch (nl-NL) locale (#8491) @thedutchruben
|
|
98
|
+
- [l10n] Improve Hebrew (he-IL) locale (#8464) @soris1989
|
|
99
|
+
- [l10n] Improve Japanese (ja-JP) locale (#8462) @megos
|
|
100
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#8480) @pwnedev
|
|
101
|
+
|
|
102
|
+
### Docs
|
|
103
|
+
|
|
104
|
+
- [docs] Fix 301 redirect (#8524) @alexfauquette
|
|
105
|
+
- [docs] Fix 404 links (#8454) @alexfauquette
|
|
106
|
+
- [docs] Fix broken API reference link (#8460) @oliviertassinari
|
|
107
|
+
|
|
108
|
+
### Core
|
|
109
|
+
|
|
110
|
+
- [core] Avoid 301 links (#8383) @oliviertassinari
|
|
111
|
+
- [core] Fix the l10n helper by using danger instead of actions (#8512) @alexfauquette
|
|
112
|
+
- [core] Help contributors for l10n PRs (#8503) @alexfauquette
|
|
113
|
+
- [core] Remove legacy token (#8457) @oliviertassinari
|
|
114
|
+
- [charts] Add a styling system (#8445) @alexfauquette
|
|
115
|
+
|
|
6
116
|
## 6.0.4
|
|
7
117
|
|
|
8
118
|
_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> {
|
|
@@ -147,6 +147,12 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
147
147
|
* Defaults to localized format based on the used `views`.
|
|
148
148
|
*/
|
|
149
149
|
format: PropTypes.string,
|
|
150
|
+
/**
|
|
151
|
+
* Density of the format when rendered in the input.
|
|
152
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
153
|
+
* @default "dense"
|
|
154
|
+
*/
|
|
155
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
150
156
|
/**
|
|
151
157
|
* Pass a ref to the `input` element.
|
|
152
158
|
* Ignored if the field has several inputs.
|
|
@@ -155,6 +155,12 @@ DesktopDateRangePicker.propTypes = {
|
|
|
155
155
|
* Defaults to localized format based on the used `views`.
|
|
156
156
|
*/
|
|
157
157
|
format: PropTypes.string,
|
|
158
|
+
/**
|
|
159
|
+
* Density of the format when rendered in the input.
|
|
160
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
161
|
+
* @default "dense"
|
|
162
|
+
*/
|
|
163
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
158
164
|
/**
|
|
159
165
|
* Pass a ref to the `input` element.
|
|
160
166
|
* Ignored if the field has several inputs.
|
|
@@ -158,6 +158,12 @@ MobileDateRangePicker.propTypes = {
|
|
|
158
158
|
* Defaults to localized format based on the used `views`.
|
|
159
159
|
*/
|
|
160
160
|
format: PropTypes.string,
|
|
161
|
+
/**
|
|
162
|
+
* Density of the format when rendered in the input.
|
|
163
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
164
|
+
* @default "dense"
|
|
165
|
+
*/
|
|
166
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
161
167
|
/**
|
|
162
168
|
* Pass a ref to the `input` element.
|
|
163
169
|
* Ignored if the field has several inputs.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "components", "componentsProps", "value", "defaultValue", "format", "onChange", "readOnly", "disabled", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "autoFocus"],
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "value", "defaultValue", "format", "formatDensity", "onChange", "readOnly", "disabled", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "autoFocus"],
|
|
4
4
|
_excluded2 = ["onKeyDown", "ref", "readOnly", "inputMode"],
|
|
5
5
|
_excluded3 = ["onKeyDown", "ref", "readOnly", "inputMode"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -48,6 +48,7 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
48
48
|
value,
|
|
49
49
|
defaultValue,
|
|
50
50
|
format,
|
|
51
|
+
formatDensity,
|
|
51
52
|
onChange,
|
|
52
53
|
readOnly,
|
|
53
54
|
disabled,
|
|
@@ -104,6 +105,7 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
104
105
|
value,
|
|
105
106
|
defaultValue,
|
|
106
107
|
format,
|
|
108
|
+
formatDensity,
|
|
107
109
|
onChange,
|
|
108
110
|
readOnly,
|
|
109
111
|
disabled,
|
|
@@ -211,6 +213,12 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
211
213
|
* Format of the date when rendered in the input(s).
|
|
212
214
|
*/
|
|
213
215
|
format: PropTypes.string,
|
|
216
|
+
/**
|
|
217
|
+
* Density of the format when rendered in the input.
|
|
218
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
219
|
+
* @default "dense"
|
|
220
|
+
*/
|
|
221
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
214
222
|
/**
|
|
215
223
|
* Maximal selectable date.
|
|
216
224
|
*/
|
|
@@ -289,6 +297,16 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
289
297
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
290
298
|
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
291
299
|
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
300
|
+
/**
|
|
301
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
302
|
+
*
|
|
303
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
|
|
304
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
305
|
+
*
|
|
306
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
307
|
+
* @default false
|
|
308
|
+
*/
|
|
309
|
+
useFlexGap: PropTypes.bool,
|
|
292
310
|
/**
|
|
293
311
|
* The selected value.
|
|
294
312
|
* Used when the component is controlled.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "components", "componentsProps", "value", "defaultValue", "format", "onChange", "readOnly", "disabled", "onError", "shouldDisableDate", "minDate", "maxDate", "minTime", "maxTime", "minDateTime", "maxDateTime", "minutesStep", "shouldDisableClock", "shouldDisableTime", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableStartFieldRef", "unstableEndFieldRef", "autoFocus"],
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "value", "defaultValue", "format", "formatDensity", "onChange", "readOnly", "disabled", "onError", "shouldDisableDate", "minDate", "maxDate", "minTime", "maxTime", "minDateTime", "maxDateTime", "minutesStep", "shouldDisableClock", "shouldDisableTime", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableStartFieldRef", "unstableEndFieldRef", "autoFocus"],
|
|
4
4
|
_excluded2 = ["onKeyDown", "ref", "readOnly", "inputMode"],
|
|
5
5
|
_excluded3 = ["onKeyDown", "ref", "readOnly", "inputMode"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -48,6 +48,7 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
|
|
|
48
48
|
value,
|
|
49
49
|
defaultValue,
|
|
50
50
|
format,
|
|
51
|
+
formatDensity,
|
|
51
52
|
onChange,
|
|
52
53
|
readOnly,
|
|
53
54
|
disabled,
|
|
@@ -113,6 +114,7 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
|
|
|
113
114
|
value,
|
|
114
115
|
defaultValue,
|
|
115
116
|
format,
|
|
117
|
+
formatDensity,
|
|
116
118
|
onChange,
|
|
117
119
|
readOnly,
|
|
118
120
|
disabled,
|
|
@@ -239,6 +241,12 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
239
241
|
* Format of the date when rendered in the input(s).
|
|
240
242
|
*/
|
|
241
243
|
format: PropTypes.string,
|
|
244
|
+
/**
|
|
245
|
+
* Density of the format when rendered in the input.
|
|
246
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
247
|
+
* @default "dense"
|
|
248
|
+
*/
|
|
249
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
242
250
|
/**
|
|
243
251
|
* Maximal selectable date.
|
|
244
252
|
*/
|
|
@@ -355,6 +363,16 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
355
363
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
356
364
|
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
357
365
|
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
366
|
+
/**
|
|
367
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
368
|
+
*
|
|
369
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
|
|
370
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
371
|
+
*
|
|
372
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
373
|
+
* @default false
|
|
374
|
+
*/
|
|
375
|
+
useFlexGap: PropTypes.bool,
|
|
358
376
|
/**
|
|
359
377
|
* The selected value.
|
|
360
378
|
* Used when the component is controlled.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "components", "componentsProps", "value", "defaultValue", "format", "onChange", "readOnly", "disabled", "onError", "minTime", "maxTime", "minutesStep", "shouldDisableClock", "shouldDisableTime", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableStartFieldRef", "unstableEndFieldRef", "autoFocus"],
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "value", "defaultValue", "format", "formatDensity", "onChange", "readOnly", "disabled", "onError", "minTime", "maxTime", "minutesStep", "shouldDisableClock", "shouldDisableTime", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableStartFieldRef", "unstableEndFieldRef", "autoFocus"],
|
|
4
4
|
_excluded2 = ["onKeyDown", "ref", "readOnly", "inputMode"],
|
|
5
5
|
_excluded3 = ["onKeyDown", "ref", "readOnly", "inputMode"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -48,6 +48,7 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
48
48
|
value,
|
|
49
49
|
defaultValue,
|
|
50
50
|
format,
|
|
51
|
+
formatDensity,
|
|
51
52
|
onChange,
|
|
52
53
|
readOnly,
|
|
53
54
|
disabled,
|
|
@@ -108,6 +109,7 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
108
109
|
value,
|
|
109
110
|
defaultValue,
|
|
110
111
|
format,
|
|
112
|
+
formatDensity,
|
|
111
113
|
onChange,
|
|
112
114
|
readOnly,
|
|
113
115
|
disabled,
|
|
@@ -229,6 +231,12 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
229
231
|
* Format of the date when rendered in the input(s).
|
|
230
232
|
*/
|
|
231
233
|
format: PropTypes.string,
|
|
234
|
+
/**
|
|
235
|
+
* Density of the format when rendered in the input.
|
|
236
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
237
|
+
* @default "dense"
|
|
238
|
+
*/
|
|
239
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
232
240
|
/**
|
|
233
241
|
* Maximal selectable time.
|
|
234
242
|
* The date part of the object will be ignored unless `props.disableIgnoringDatePartForTimeValidation === true`.
|
|
@@ -321,6 +329,16 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
321
329
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
322
330
|
unstableEndFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
323
331
|
unstableStartFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
332
|
+
/**
|
|
333
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
334
|
+
*
|
|
335
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
|
|
336
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
337
|
+
*
|
|
338
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
339
|
+
* @default false
|
|
340
|
+
*/
|
|
341
|
+
useFlexGap: PropTypes.bool,
|
|
324
342
|
/**
|
|
325
343
|
* The selected value.
|
|
326
344
|
* Used when the component is controlled.
|
package/README.md
CHANGED
|
@@ -34,8 +34,9 @@ This component has the following peer dependencies that you will need to install
|
|
|
34
34
|
|
|
35
35
|
```json
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@mui/
|
|
38
|
-
"@mui/
|
|
37
|
+
"@mui/base": "^5.0.0-alpha.87",
|
|
38
|
+
"@mui/material": "^5.8.6",
|
|
39
|
+
"@mui/system": "^5.8.0",
|
|
39
40
|
"react": "^17.0.2 || ^18.0.0",
|
|
40
41
|
"react-dom": "^17.0.2 || ^18.0.0"
|
|
41
42
|
},
|
|
@@ -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, {
|
|
@@ -110,6 +121,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
110
121
|
* Format of the date when rendered in the input(s).
|
|
111
122
|
*/
|
|
112
123
|
format: PropTypes.string,
|
|
124
|
+
/**
|
|
125
|
+
* Density of the format when rendered in the input.
|
|
126
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
127
|
+
* @default "dense"
|
|
128
|
+
*/
|
|
129
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
113
130
|
/**
|
|
114
131
|
* Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
|
|
115
132
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
3
|
+
const _excluded = ["value", "defaultValue", "format", "formatDensity", "onChange", "readOnly", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
4
4
|
import { useUtils, useDefaultDates, applyDefaultDate, useField } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { rangeValueManager, rangeFieldValueManager } from '../internal/utils/valueManagers';
|
|
6
6
|
import { validateDateRange } from '../internal/hooks/validation/useDateRangeValidation';
|
|
@@ -25,6 +25,7 @@ export const useSingleInputDateRangeField = ({
|
|
|
25
25
|
value,
|
|
26
26
|
defaultValue,
|
|
27
27
|
format,
|
|
28
|
+
formatDensity,
|
|
28
29
|
onChange,
|
|
29
30
|
readOnly,
|
|
30
31
|
onError,
|
|
@@ -45,6 +46,7 @@ export const useSingleInputDateRangeField = ({
|
|
|
45
46
|
value,
|
|
46
47
|
defaultValue,
|
|
47
48
|
format,
|
|
49
|
+
formatDensity,
|
|
48
50
|
onChange,
|
|
49
51
|
readOnly,
|
|
50
52
|
onError,
|
|
@@ -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, {
|
|
@@ -120,6 +131,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
120
131
|
* Format of the date when rendered in the input(s).
|
|
121
132
|
*/
|
|
122
133
|
format: PropTypes.string,
|
|
134
|
+
/**
|
|
135
|
+
* Density of the format when rendered in the input.
|
|
136
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
137
|
+
* @default "dense"
|
|
138
|
+
*/
|
|
139
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
123
140
|
/**
|
|
124
141
|
* Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
|
|
125
142
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "minTime", "maxTime", "minDateTime", "maxDateTime", "minutesStep", "shouldDisableTime", "disableIgnoringDatePartForTimeValidation", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
3
|
+
const _excluded = ["value", "defaultValue", "format", "formatDensity", "onChange", "readOnly", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "minTime", "maxTime", "minDateTime", "maxDateTime", "minutesStep", "shouldDisableTime", "disableIgnoringDatePartForTimeValidation", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
4
4
|
import { useUtils, useField, applyDefaultDate, useDefaultDates } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { rangeValueManager, rangeFieldValueManager } from '../internal/utils/valueManagers';
|
|
6
6
|
import { validateDateTimeRange } from '../internal/hooks/validation/useDateTimeRangeValidation';
|
|
@@ -30,6 +30,7 @@ export const useSingleInputDateTimeRangeField = ({
|
|
|
30
30
|
value,
|
|
31
31
|
defaultValue,
|
|
32
32
|
format,
|
|
33
|
+
formatDensity,
|
|
33
34
|
onChange,
|
|
34
35
|
readOnly,
|
|
35
36
|
onError,
|
|
@@ -55,6 +56,7 @@ export const useSingleInputDateTimeRangeField = ({
|
|
|
55
56
|
value,
|
|
56
57
|
defaultValue,
|
|
57
58
|
format,
|
|
59
|
+
formatDensity,
|
|
58
60
|
onChange,
|
|
59
61
|
readOnly,
|
|
60
62
|
onError,
|
|
@@ -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, {
|
|
@@ -120,6 +131,12 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
120
131
|
* Format of the date when rendered in the input(s).
|
|
121
132
|
*/
|
|
122
133
|
format: PropTypes.string,
|
|
134
|
+
/**
|
|
135
|
+
* Density of the format when rendered in the input.
|
|
136
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
137
|
+
* @default "dense"
|
|
138
|
+
*/
|
|
139
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
123
140
|
/**
|
|
124
141
|
* Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
|
|
125
142
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "minTime", "maxTime", "minutesStep", "shouldDisableTime", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
3
|
+
const _excluded = ["value", "defaultValue", "format", "formatDensity", "onChange", "readOnly", "onError", "minTime", "maxTime", "minutesStep", "shouldDisableTime", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
4
4
|
import { useUtils, useField } from '@mui/x-date-pickers/internals';
|
|
5
5
|
import { rangeValueManager, rangeFieldValueManager } from '../internal/utils/valueManagers';
|
|
6
6
|
import { validateTimeRange } from '../internal/hooks/validation/useTimeRangeValidation';
|
|
@@ -24,6 +24,7 @@ export const useSingleInputTimeRangeField = ({
|
|
|
24
24
|
value,
|
|
25
25
|
defaultValue,
|
|
26
26
|
format,
|
|
27
|
+
formatDensity,
|
|
27
28
|
onChange,
|
|
28
29
|
readOnly,
|
|
29
30
|
onError,
|
|
@@ -45,6 +46,7 @@ export const useSingleInputTimeRangeField = ({
|
|
|
45
46
|
value,
|
|
46
47
|
defaultValue,
|
|
47
48
|
format,
|
|
49
|
+
formatDensity,
|
|
48
50
|
onChange,
|
|
49
51
|
readOnly,
|
|
50
52
|
onError,
|