@mui/x-date-pickers-pro 6.1.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +101 -1
  2. package/DateRangePicker/DateRangePicker.js +6 -0
  3. package/DesktopDateRangePicker/DesktopDateRangePicker.js +7 -0
  4. package/MobileDateRangePicker/MobileDateRangePicker.js +7 -0
  5. package/MultiInputDateRangeField/MultiInputDateRangeField.js +9 -1
  6. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +9 -1
  7. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +9 -1
  8. package/README.md +1 -0
  9. package/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -0
  10. package/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
  11. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -0
  12. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
  13. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -0
  14. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
  15. package/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
  16. package/index.js +1 -1
  17. package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -1
  18. package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +11 -9
  19. package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +1 -1
  20. package/internal/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -1
  21. package/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +12 -10
  22. package/internal/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +1 -1
  23. package/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
  24. package/internal/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -1
  25. package/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -10
  26. package/internal/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +1 -1
  27. package/internal/utils/releaseInfo.js +1 -1
  28. package/internal/utils/valueManagers.js +1 -1
  29. package/legacy/DateRangePicker/DateRangePicker.js +6 -0
  30. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +7 -0
  31. package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +7 -0
  32. package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +9 -1
  33. package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +9 -1
  34. package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +9 -1
  35. package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -0
  36. package/legacy/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
  37. package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -0
  38. package/legacy/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
  39. package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -0
  40. package/legacy/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
  41. package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
  42. package/legacy/index.js +1 -1
  43. package/legacy/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +7 -6
  44. package/legacy/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +8 -7
  45. package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
  46. package/legacy/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +6 -7
  47. package/legacy/internal/utils/releaseInfo.js +1 -1
  48. package/legacy/internal/utils/valueManagers.js +2 -2
  49. package/modern/DateRangePicker/DateRangePicker.js +6 -0
  50. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +7 -0
  51. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +7 -0
  52. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +9 -1
  53. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +9 -1
  54. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +9 -1
  55. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -0
  56. package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
  57. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -0
  58. package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
  59. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -0
  60. package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
  61. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
  62. package/modern/index.js +1 -1
  63. package/modern/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +11 -9
  64. package/modern/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +12 -10
  65. package/modern/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
  66. package/modern/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -10
  67. package/modern/internal/utils/releaseInfo.js +1 -1
  68. package/modern/internal/utils/valueManagers.js +1 -1
  69. package/node/DateRangePicker/DateRangePicker.js +6 -0
  70. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +7 -0
  71. package/node/MobileDateRangePicker/MobileDateRangePicker.js +7 -0
  72. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +9 -1
  73. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +9 -1
  74. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +9 -1
  75. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -0
  76. package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
  77. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -0
  78. package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
  79. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -0
  80. package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
  81. package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
  82. package/node/index.js +1 -1
  83. package/node/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +11 -9
  84. package/node/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +12 -10
  85. package/node/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
  86. package/node/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -10
  87. package/node/internal/utils/releaseInfo.js +1 -1
  88. package/node/internal/utils/valueManagers.js +1 -1
  89. package/package.json +23 -3
package/CHANGELOG.md CHANGED
@@ -3,9 +3,109 @@
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
+
54
+ ## 6.2.0
55
+
56
+ _Apr 14, 2023_
57
+
58
+ We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
59
+
60
+ - Add `@mui/base` as a `peerDependency` of `@mui/x-date-pickers` and `@mui/x-date-pickers-pro` (#8590) @LukasTy
61
+
62
+ Both libraries were not working correctly if used without `@mui/base`.
63
+ Most package manager should automatically use the `@mui/base` version installed for `@mui/material`.
64
+
65
+ - The value rendered in the picker or field input no longer has spaces around the `/` characters (#8425) @flaviendelangle
66
+
67
+ You can use the `formatDensity='spacious'` prop to add it back.
68
+ More information on [the dedicated doc section](https://mui.com/x/react-date-pickers/custom-field/#change-the-format-density)
69
+
70
+ - 🌍 Improve French (fr-FR) and Urdu (ur-PK) and locales.
71
+ - 🐞 Bugfixes
72
+ - 📚 Documentation improvements
73
+
74
+ ### `@mui/x-data-grid@v6.2.0` / `@mui/x-data-grid-pro@v6.2.0` / `@mui/x-data-grid-premium@v6.2.0`
75
+
76
+ #### Changes
77
+
78
+ - [DataGrid] Reset selection state on `checkboxSelection` toggle (#8522) @MBilalShafi
79
+ - [DataGrid] Use `baseSelect` slot instead of `baseTextField` with `select={true}` (#8110) @cherniavskii
80
+ - [l10n] Improve French (fr-FR) locale (#8537) @vallereaugabriel
81
+ - [l10n] Improve Urdu (ur-PK) locale (#8513) @SFARPak
82
+
83
+ ### `@mui/x-date-pickers@v6.2.0` / `@mui/x-date-pickers-pro@v6.2.0`
84
+
85
+ #### Changes
86
+
87
+ - [DateTimePicker] Fix `TimeClock` validation ignoring date by default (#8570) @LukasTy
88
+ - [fields] Fix reliance on section order (#8545) @LukasTy
89
+ - [fields] Make the space between format separators controllable (#8425) @flaviendelangle
90
+ - [pickers] Add `@mui/base` to `peerDependencies` (#8590) @LukasTy
91
+ - [pickers] Fix JSDoc for `formatDensity` prop (#8601) @flaviendelangle
92
+ - [pickers] Improve value lifecycle on non-controlled pickers (#8312) @flaviendelangle
93
+ - [pickers] Migrate `AdapterDayjs` to our repository (#8487) @flaviendelangle
94
+
95
+ ### Docs
96
+
97
+ - [docs] Fix "Custom day rendering" demo alignment (#8541) @LukasTy
98
+ - [docs] Fix **below** typo (#8576) @alexfauquette
99
+
100
+ ### Core
101
+
102
+ - [core] Optimize `renovate` rules (#8575) @LukasTy
103
+ - [core] Upgrade monorepo (#8578) @cherniavskii
104
+ - [core] Update last release date (#8569) @DanailH
105
+
6
106
  ## 6.1.0
7
107
 
8
- _Apr 7, 2023_
108
+ _Apr 10, 2023_
9
109
 
10
110
  We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
11
111
 
@@ -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.
@@ -41,6 +41,7 @@ const DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDat
41
41
  } = useDesktopRangePicker({
42
42
  props,
43
43
  valueManager: rangeValueManager,
44
+ valueType: 'date',
44
45
  validator: validateDateRange
45
46
  });
46
47
  return renderPicker();
@@ -155,6 +156,12 @@ DesktopDateRangePicker.propTypes = {
155
156
  * Defaults to localized format based on the used `views`.
156
157
  */
157
158
  format: PropTypes.string,
159
+ /**
160
+ * Density of the format when rendered in the input.
161
+ * Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
162
+ * @default "dense"
163
+ */
164
+ formatDensity: PropTypes.oneOf(['dense', 'spacious']),
158
165
  /**
159
166
  * Pass a ref to the `input` element.
160
167
  * Ignored if the field has several inputs.
@@ -44,6 +44,7 @@ const MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateR
44
44
  } = useMobileRangePicker({
45
45
  props,
46
46
  valueManager: rangeValueManager,
47
+ valueType: 'date',
47
48
  validator: validateDateRange
48
49
  });
49
50
  return renderPicker();
@@ -158,6 +159,12 @@ MobileDateRangePicker.propTypes = {
158
159
  * Defaults to localized format based on the used `views`.
159
160
  */
160
161
  format: PropTypes.string,
162
+ /**
163
+ * Density of the format when rendered in the input.
164
+ * Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
165
+ * @default "dense"
166
+ */
167
+ formatDensity: PropTypes.oneOf(['dense', 'spacious']),
161
168
  /**
162
169
  * Pass a ref to the `input` element.
163
170
  * 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
  */
@@ -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
  */
@@ -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`.
package/README.md CHANGED
@@ -34,6 +34,7 @@ This component has the following peer dependencies that you will need to install
34
34
 
35
35
  ```json
36
36
  "peerDependencies": {
37
+ "@mui/base": "^5.0.0-alpha.87",
37
38
  "@mui/material": "^5.8.6",
38
39
  "@mui/system": "^5.8.0",
39
40
  "react": "^17.0.2 || ^18.0.0",
@@ -121,6 +121,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
121
121
  * Format of the date when rendered in the input(s).
122
122
  */
123
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']),
124
130
  /**
125
131
  * Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
126
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,
@@ -131,6 +131,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
131
131
  * Format of the date when rendered in the input(s).
132
132
  */
133
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']),
134
140
  /**
135
141
  * Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
136
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,
@@ -131,6 +131,12 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
131
131
  * Format of the date when rendered in the input(s).
132
132
  */
133
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']),
134
140
  /**
135
141
  * Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
136
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,
@@ -32,6 +32,7 @@ const StaticDateRangePicker = /*#__PURE__*/React.forwardRef(function StaticDateR
32
32
  } = useStaticRangePicker({
33
33
  props,
34
34
  valueManager: rangeValueManager,
35
+ valueType: 'date',
35
36
  validator: validateDateRange,
36
37
  ref
37
38
  });
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v6.1.0
2
+ * @mui/x-date-pickers-pro v6.2.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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, valueManager, validator, }: UseDesktopRangePickerParams<TDate, TView, TExternalProps>) => {
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,
@@ -24,6 +26,7 @@ export const useDesktopRangePicker = ({
24
26
  className,
25
27
  sx,
26
28
  format,
29
+ formatDensity,
27
30
  label,
28
31
  inputRef,
29
32
  readOnly,
@@ -46,17 +49,15 @@ export const useDesktopRangePicker = ({
46
49
  renderCurrentView,
47
50
  shouldRestoreFocus,
48
51
  fieldProps: pickerFieldProps
49
- } = usePicker({
52
+ } = usePicker(_extends({}, pickerParams, {
50
53
  props,
51
- valueManager,
52
54
  wrapperVariant: 'desktop',
53
- validator,
54
55
  autoFocusView: true,
55
56
  additionalViewProps: {
56
57
  rangePosition,
57
58
  onRangePositionChange
58
59
  }
59
- });
60
+ }));
60
61
  const handleBlur = () => {
61
62
  executeInTheNextEventLoopTick(() => {
62
63
  var _fieldContainerRef$cu, _popperRef$current;
@@ -77,6 +78,7 @@ export const useDesktopRangePicker = ({
77
78
  className,
78
79
  sx,
79
80
  format,
81
+ formatDensity,
80
82
  autoFocus: autoFocus && !props.open,
81
83
  ref: fieldContainerRef
82
84
  }, fieldType === 'single-input' && {
@@ -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, valueManager, validator, }: UseMobileRangePickerParams<TDate, TView, TExternalProps>) => {
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,
@@ -25,6 +27,7 @@ export const useMobileRangePicker = ({
25
27
  className,
26
28
  sx,
27
29
  format,
30
+ formatDensity,
28
31
  label,
29
32
  inputRef,
30
33
  readOnly,
@@ -45,17 +48,15 @@ export const useMobileRangePicker = ({
45
48
  layoutProps,
46
49
  renderCurrentView,
47
50
  fieldProps: pickerFieldProps
48
- } = usePicker({
51
+ } = usePicker(_extends({}, pickerParams, {
49
52
  props,
50
- valueManager,
51
53
  wrapperVariant: 'mobile',
52
- validator,
53
54
  autoFocusView: true,
54
55
  additionalViewProps: {
55
56
  rangePosition,
56
57
  onRangePositionChange
57
58
  }
58
- });
59
+ }));
59
60
  const Field = slots.field;
60
61
  const fieldType = (_fieldType = Field.fieldType) != null ? _fieldType : 'multi-input';
61
62
  const fieldProps = useSlotProps({
@@ -66,7 +67,8 @@ export const useMobileRangePicker = ({
66
67
  disabled,
67
68
  className,
68
69
  sx,
69
- format
70
+ format,
71
+ formatDensity
70
72
  }, fieldType === 'single-input' && {
71
73
  inputRef
72
74
  }),
@@ -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
  }
@@ -23,6 +23,7 @@ export const useMultiInputDateRangeField = ({
23
23
  value: valueProp,
24
24
  defaultValue,
25
25
  format,
26
+ formatDensity,
26
27
  onChange,
27
28
  disabled,
28
29
  readOnly,
@@ -63,6 +64,7 @@ export const useMultiInputDateRangeField = ({
63
64
  disabled,
64
65
  readOnly,
65
66
  format,
67
+ formatDensity,
66
68
  unstableFieldRef: unstableStartFieldRef,
67
69
  value: valueProp === undefined ? undefined : valueProp[0],
68
70
  defaultValue: defaultValue === undefined ? undefined : defaultValue[0],
@@ -74,6 +76,7 @@ export const useMultiInputDateRangeField = ({
74
76
  error: !!validationError[1]
75
77
  }, endTextFieldProps, {
76
78
  format,
79
+ formatDensity,
77
80
  disabled,
78
81
  readOnly,
79
82
  unstableFieldRef: unstableEndFieldRef,
@@ -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, valueManager, validator, ref, }: UseStaticRangePickerParams<TDate, TView, TExternalProps>) => {
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
  };