@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.
- package/CHANGELOG.md +101 -1
- package/DateRangePicker/DateRangePicker.js +6 -0
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +7 -0
- package/MobileDateRangePicker/MobileDateRangePicker.js +7 -0
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +9 -1
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +9 -1
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +9 -1
- package/README.md +1 -0
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -0
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -0
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -0
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
- package/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
- package/index.js +1 -1
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -1
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +11 -9
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +1 -1
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -1
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +12 -10
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +1 -1
- package/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -1
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -10
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +1 -1
- package/internal/utils/releaseInfo.js +1 -1
- package/internal/utils/valueManagers.js +1 -1
- package/legacy/DateRangePicker/DateRangePicker.js +6 -0
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +7 -0
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +7 -0
- package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +9 -1
- package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +9 -1
- package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +9 -1
- package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -0
- package/legacy/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
- package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -0
- package/legacy/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
- package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -0
- package/legacy/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
- package/legacy/index.js +1 -1
- package/legacy/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +7 -6
- package/legacy/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +8 -7
- package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
- package/legacy/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +6 -7
- package/legacy/internal/utils/releaseInfo.js +1 -1
- package/legacy/internal/utils/valueManagers.js +2 -2
- package/modern/DateRangePicker/DateRangePicker.js +6 -0
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +7 -0
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +7 -0
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +9 -1
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +9 -1
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +9 -1
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -0
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -0
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -0
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
- package/modern/index.js +1 -1
- package/modern/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +11 -9
- package/modern/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +12 -10
- package/modern/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
- package/modern/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -10
- package/modern/internal/utils/releaseInfo.js +1 -1
- package/modern/internal/utils/valueManagers.js +1 -1
- package/node/DateRangePicker/DateRangePicker.js +6 -0
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +7 -0
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +7 -0
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +9 -1
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +9 -1
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +9 -1
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -0
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +3 -1
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -0
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +3 -1
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -0
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +3 -1
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -0
- package/node/index.js +1 -1
- package/node/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.js +11 -9
- package/node/internal/hooks/useMobileRangePicker/useMobileRangePicker.js +12 -10
- package/node/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +3 -0
- package/node/internal/hooks/useStaticRangePicker/useStaticRangePicker.js +10 -10
- package/node/internal/utils/releaseInfo.js +1 -1
- package/node/internal/utils/valueManagers.js +1 -1
- package/package.json +23 -3
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["props", "ref"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import clsx from 'clsx';
|
|
4
6
|
import { styled } from '@mui/material/styles';
|
|
@@ -19,13 +21,13 @@ const PickerStaticLayout = styled(PickersLayout)(({
|
|
|
19
21
|
* Hook managing all the range static pickers:
|
|
20
22
|
* - StaticDateRangePicker
|
|
21
23
|
*/
|
|
22
|
-
export const useStaticRangePicker =
|
|
23
|
-
props,
|
|
24
|
-
valueManager,
|
|
25
|
-
validator,
|
|
26
|
-
ref
|
|
27
|
-
}) => {
|
|
24
|
+
export const useStaticRangePicker = _ref => {
|
|
28
25
|
var _slots$layout;
|
|
26
|
+
let {
|
|
27
|
+
props,
|
|
28
|
+
ref
|
|
29
|
+
} = _ref,
|
|
30
|
+
pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
29
31
|
const {
|
|
30
32
|
localeText,
|
|
31
33
|
slots,
|
|
@@ -42,17 +44,15 @@ export const useStaticRangePicker = ({
|
|
|
42
44
|
const {
|
|
43
45
|
layoutProps,
|
|
44
46
|
renderCurrentView
|
|
45
|
-
} = usePicker({
|
|
47
|
+
} = usePicker(_extends({}, pickerParams, {
|
|
46
48
|
props,
|
|
47
|
-
valueManager,
|
|
48
|
-
validator,
|
|
49
49
|
autoFocusView: autoFocus != null ? autoFocus : false,
|
|
50
50
|
additionalViewProps: {
|
|
51
51
|
rangePosition,
|
|
52
52
|
onRangePositionChange
|
|
53
53
|
},
|
|
54
54
|
wrapperVariant: displayStaticWrapperAs
|
|
55
|
-
});
|
|
55
|
+
}));
|
|
56
56
|
const Layout = (_slots$layout = slots == null ? void 0 : slots.layout) != null ? _slots$layout : PickerStaticLayout;
|
|
57
57
|
const slotPropsForLayout = _extends({}, slotProps, {
|
|
58
58
|
toolbar: _extends({}, slotProps == null ? void 0 : slotProps.toolbar, {
|
|
@@ -24,7 +24,7 @@ export interface UseStaticRangePickerProps<TDate, TView extends DateOrTimeView,
|
|
|
24
24
|
*/
|
|
25
25
|
slotProps?: UseStaticRangePickerSlotsComponentsProps<TDate, TView>;
|
|
26
26
|
}
|
|
27
|
-
export interface UseStaticRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, RangeFieldSection, TExternalProps, {}>, 'valueManager' | 'validator'> {
|
|
27
|
+
export interface UseStaticRangePickerParams<TDate, TView extends DateOrTimeView, TExternalProps extends UseStaticRangePickerProps<TDate, TView, any, TExternalProps>> extends Pick<UsePickerParams<DateRange<TDate>, TDate, TView, RangeFieldSection, TExternalProps, {}>, 'valueManager' | 'valueType' | 'validator'> {
|
|
28
28
|
props: TExternalProps;
|
|
29
29
|
/**
|
|
30
30
|
* Ref to pass to the root element
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY4MTkzMDgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -3,7 +3,7 @@ import { replaceInvalidDateByNull, addPositionPropertiesToSections, createDateSt
|
|
|
3
3
|
import { splitDateRangeSections, removeLastSeparator } from './date-fields-utils';
|
|
4
4
|
export const rangeValueManager = {
|
|
5
5
|
emptyValue: [null, null],
|
|
6
|
-
getTodayValue: utils => [utils.date(), utils.date()],
|
|
6
|
+
getTodayValue: (utils, valueType) => valueType === 'date' ? [utils.startOfDay(utils.date()), utils.startOfDay(utils.date())] : [utils.date(), utils.date()],
|
|
7
7
|
cleanValue: (utils, value) => value.map(date => replaceInvalidDateByNull(utils, date)),
|
|
8
8
|
areValuesEqual: (utils, a, b) => areDatesEqual(utils, a[0], b[0]) && areDatesEqual(utils, a[1], b[1]),
|
|
9
9
|
isSameError: (a, b) => b !== null && a[1] === b[1] && a[0] === b[0],
|
|
@@ -146,6 +146,12 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
|
|
|
146
146
|
* Defaults to localized format based on the used `views`.
|
|
147
147
|
*/
|
|
148
148
|
format: PropTypes.string,
|
|
149
|
+
/**
|
|
150
|
+
* Density of the format when rendered in the input.
|
|
151
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
152
|
+
* @default "dense"
|
|
153
|
+
*/
|
|
154
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
149
155
|
/**
|
|
150
156
|
* Pass a ref to the `input` element.
|
|
151
157
|
* Ignored if the field has several inputs.
|
|
@@ -39,6 +39,7 @@ var DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDateR
|
|
|
39
39
|
var _useDesktopRangePicke = useDesktopRangePicker({
|
|
40
40
|
props: props,
|
|
41
41
|
valueManager: rangeValueManager,
|
|
42
|
+
valueType: 'date',
|
|
42
43
|
validator: validateDateRange
|
|
43
44
|
}),
|
|
44
45
|
renderPicker = _useDesktopRangePicke.renderPicker;
|
|
@@ -154,6 +155,12 @@ DesktopDateRangePicker.propTypes = {
|
|
|
154
155
|
* Defaults to localized format based on the used `views`.
|
|
155
156
|
*/
|
|
156
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']),
|
|
157
164
|
/**
|
|
158
165
|
* Pass a ref to the `input` element.
|
|
159
166
|
* Ignored if the field has several inputs.
|
|
@@ -44,6 +44,7 @@ var MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateRan
|
|
|
44
44
|
var _useMobileRangePicker = useMobileRangePicker({
|
|
45
45
|
props: props,
|
|
46
46
|
valueManager: rangeValueManager,
|
|
47
|
+
valueType: 'date',
|
|
47
48
|
validator: validateDateRange
|
|
48
49
|
}),
|
|
49
50
|
renderPicker = _useMobileRangePicker.renderPicker;
|
|
@@ -159,6 +160,12 @@ MobileDateRangePicker.propTypes = {
|
|
|
159
160
|
* Defaults to localized format based on the used `views`.
|
|
160
161
|
*/
|
|
161
162
|
format: PropTypes.string,
|
|
163
|
+
/**
|
|
164
|
+
* Density of the format when rendered in the input.
|
|
165
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
166
|
+
* @default "dense"
|
|
167
|
+
*/
|
|
168
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
162
169
|
/**
|
|
163
170
|
* Pass a ref to the `input` element.
|
|
164
171
|
* Ignored if the field has several inputs.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _excluded = ["slots", "slotProps", "components", "componentsProps", "value", "defaultValue", "format", "onChange", "readOnly", "disabled", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "autoFocus"],
|
|
3
|
+
var _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';
|
|
@@ -53,6 +53,7 @@ var MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInput
|
|
|
53
53
|
value = themeProps.value,
|
|
54
54
|
defaultValue = themeProps.defaultValue,
|
|
55
55
|
format = themeProps.format,
|
|
56
|
+
formatDensity = themeProps.formatDensity,
|
|
56
57
|
onChange = themeProps.onChange,
|
|
57
58
|
readOnly = themeProps.readOnly,
|
|
58
59
|
disabled = themeProps.disabled,
|
|
@@ -108,6 +109,7 @@ var MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInput
|
|
|
108
109
|
value: value,
|
|
109
110
|
defaultValue: defaultValue,
|
|
110
111
|
format: format,
|
|
112
|
+
formatDensity: formatDensity,
|
|
111
113
|
onChange: onChange,
|
|
112
114
|
readOnly: readOnly,
|
|
113
115
|
disabled: 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 _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _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
|
+
var _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';
|
|
@@ -53,6 +53,7 @@ var MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiI
|
|
|
53
53
|
value = themeProps.value,
|
|
54
54
|
defaultValue = themeProps.defaultValue,
|
|
55
55
|
format = themeProps.format,
|
|
56
|
+
formatDensity = themeProps.formatDensity,
|
|
56
57
|
onChange = themeProps.onChange,
|
|
57
58
|
readOnly = themeProps.readOnly,
|
|
58
59
|
disabled = themeProps.disabled,
|
|
@@ -117,6 +118,7 @@ var MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiI
|
|
|
117
118
|
value: value,
|
|
118
119
|
defaultValue: defaultValue,
|
|
119
120
|
format: format,
|
|
121
|
+
formatDensity: formatDensity,
|
|
120
122
|
onChange: onChange,
|
|
121
123
|
readOnly: readOnly,
|
|
122
124
|
disabled: 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 _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _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
|
+
var _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';
|
|
@@ -53,6 +53,7 @@ var MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInput
|
|
|
53
53
|
value = themeProps.value,
|
|
54
54
|
defaultValue = themeProps.defaultValue,
|
|
55
55
|
format = themeProps.format,
|
|
56
|
+
formatDensity = themeProps.formatDensity,
|
|
56
57
|
onChange = themeProps.onChange,
|
|
57
58
|
readOnly = themeProps.readOnly,
|
|
58
59
|
disabled = themeProps.disabled,
|
|
@@ -112,6 +113,7 @@ var MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInput
|
|
|
112
113
|
value: value,
|
|
113
114
|
defaultValue: defaultValue,
|
|
114
115
|
format: format,
|
|
116
|
+
formatDensity: formatDensity,
|
|
115
117
|
onChange: onChange,
|
|
116
118
|
readOnly: readOnly,
|
|
117
119
|
disabled: 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`.
|
|
@@ -115,6 +115,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
115
115
|
* Format of the date when rendered in the input(s).
|
|
116
116
|
*/
|
|
117
117
|
format: PropTypes.string,
|
|
118
|
+
/**
|
|
119
|
+
* Density of the format when rendered in the input.
|
|
120
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
121
|
+
* @default "dense"
|
|
122
|
+
*/
|
|
123
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
118
124
|
/**
|
|
119
125
|
* Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
|
|
120
126
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
3
|
+
var _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';
|
|
@@ -23,6 +23,7 @@ export var useSingleInputDateRangeField = function useSingleInputDateRangeField(
|
|
|
23
23
|
value = _useDefaultizedDateRa.value,
|
|
24
24
|
defaultValue = _useDefaultizedDateRa.defaultValue,
|
|
25
25
|
format = _useDefaultizedDateRa.format,
|
|
26
|
+
formatDensity = _useDefaultizedDateRa.formatDensity,
|
|
26
27
|
onChange = _useDefaultizedDateRa.onChange,
|
|
27
28
|
readOnly = _useDefaultizedDateRa.readOnly,
|
|
28
29
|
onError = _useDefaultizedDateRa.onError,
|
|
@@ -42,6 +43,7 @@ export var useSingleInputDateRangeField = function useSingleInputDateRangeField(
|
|
|
42
43
|
value: value,
|
|
43
44
|
defaultValue: defaultValue,
|
|
44
45
|
format: format,
|
|
46
|
+
formatDensity: formatDensity,
|
|
45
47
|
onChange: onChange,
|
|
46
48
|
readOnly: readOnly,
|
|
47
49
|
onError: onError,
|
|
@@ -125,6 +125,12 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
125
125
|
* Format of the date when rendered in the input(s).
|
|
126
126
|
*/
|
|
127
127
|
format: PropTypes.string,
|
|
128
|
+
/**
|
|
129
|
+
* Density of the format when rendered in the input.
|
|
130
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
131
|
+
* @default "dense"
|
|
132
|
+
*/
|
|
133
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
128
134
|
/**
|
|
129
135
|
* Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
|
|
130
136
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "minTime", "maxTime", "minDateTime", "maxDateTime", "minutesStep", "shouldDisableTime", "disableIgnoringDatePartForTimeValidation", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
3
|
+
var _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';
|
|
@@ -28,6 +28,7 @@ export var useSingleInputDateTimeRangeField = function useSingleInputDateTimeRan
|
|
|
28
28
|
value = _useDefaultizedTimeRa.value,
|
|
29
29
|
defaultValue = _useDefaultizedTimeRa.defaultValue,
|
|
30
30
|
format = _useDefaultizedTimeRa.format,
|
|
31
|
+
formatDensity = _useDefaultizedTimeRa.formatDensity,
|
|
31
32
|
onChange = _useDefaultizedTimeRa.onChange,
|
|
32
33
|
readOnly = _useDefaultizedTimeRa.readOnly,
|
|
33
34
|
onError = _useDefaultizedTimeRa.onError,
|
|
@@ -54,6 +55,7 @@ export var useSingleInputDateTimeRangeField = function useSingleInputDateTimeRan
|
|
|
54
55
|
value: value,
|
|
55
56
|
defaultValue: defaultValue,
|
|
56
57
|
format: format,
|
|
58
|
+
formatDensity: formatDensity,
|
|
57
59
|
onChange: onChange,
|
|
58
60
|
readOnly: readOnly,
|
|
59
61
|
onError: onError,
|
|
@@ -125,6 +125,12 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
125
125
|
* Format of the date when rendered in the input(s).
|
|
126
126
|
*/
|
|
127
127
|
format: PropTypes.string,
|
|
128
|
+
/**
|
|
129
|
+
* Density of the format when rendered in the input.
|
|
130
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
131
|
+
* @default "dense"
|
|
132
|
+
*/
|
|
133
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
128
134
|
/**
|
|
129
135
|
* Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
|
|
130
136
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
var _excluded = ["value", "defaultValue", "format", "onChange", "readOnly", "onError", "minTime", "maxTime", "minutesStep", "shouldDisableTime", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
3
|
+
var _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';
|
|
@@ -22,6 +22,7 @@ export var useSingleInputTimeRangeField = function useSingleInputTimeRangeField(
|
|
|
22
22
|
value = _useDefaultizedTimeRa.value,
|
|
23
23
|
defaultValue = _useDefaultizedTimeRa.defaultValue,
|
|
24
24
|
format = _useDefaultizedTimeRa.format,
|
|
25
|
+
formatDensity = _useDefaultizedTimeRa.formatDensity,
|
|
25
26
|
onChange = _useDefaultizedTimeRa.onChange,
|
|
26
27
|
readOnly = _useDefaultizedTimeRa.readOnly,
|
|
27
28
|
onError = _useDefaultizedTimeRa.onError,
|
|
@@ -42,6 +43,7 @@ export var useSingleInputTimeRangeField = function useSingleInputTimeRangeField(
|
|
|
42
43
|
value: value,
|
|
43
44
|
defaultValue: defaultValue,
|
|
44
45
|
format: format,
|
|
46
|
+
formatDensity: formatDensity,
|
|
45
47
|
onChange: onChange,
|
|
46
48
|
readOnly: readOnly,
|
|
47
49
|
onError: onError,
|
package/legacy/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["props"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
6
|
import { useLicenseVerifier } from '@mui/x-license-pro';
|
|
@@ -14,14 +16,14 @@ var releaseInfo = getReleaseInfo();
|
|
|
14
16
|
export var useDesktopRangePicker = function useDesktopRangePicker(_ref) {
|
|
15
17
|
var _fieldType, _slots$layout;
|
|
16
18
|
var props = _ref.props,
|
|
17
|
-
|
|
18
|
-
validator = _ref.validator;
|
|
19
|
+
pickerParams = _objectWithoutProperties(_ref, _excluded);
|
|
19
20
|
useLicenseVerifier('x-date-pickers-pro', releaseInfo);
|
|
20
21
|
var slots = props.slots,
|
|
21
22
|
slotProps = props.slotProps,
|
|
22
23
|
className = props.className,
|
|
23
24
|
sx = props.sx,
|
|
24
25
|
format = props.format,
|
|
26
|
+
formatDensity = props.formatDensity,
|
|
25
27
|
label = props.label,
|
|
26
28
|
inputRef = props.inputRef,
|
|
27
29
|
readOnly = props.readOnly,
|
|
@@ -35,17 +37,15 @@ export var useDesktopRangePicker = function useDesktopRangePicker(_ref) {
|
|
|
35
37
|
rangePosition = _useRangePosition.rangePosition,
|
|
36
38
|
onRangePositionChange = _useRangePosition.onRangePositionChange,
|
|
37
39
|
singleInputFieldRef = _useRangePosition.singleInputFieldRef;
|
|
38
|
-
var _usePicker = usePicker({
|
|
40
|
+
var _usePicker = usePicker(_extends({}, pickerParams, {
|
|
39
41
|
props: props,
|
|
40
|
-
valueManager: valueManager,
|
|
41
42
|
wrapperVariant: 'desktop',
|
|
42
|
-
validator: validator,
|
|
43
43
|
autoFocusView: true,
|
|
44
44
|
additionalViewProps: {
|
|
45
45
|
rangePosition: rangePosition,
|
|
46
46
|
onRangePositionChange: onRangePositionChange
|
|
47
47
|
}
|
|
48
|
-
}),
|
|
48
|
+
})),
|
|
49
49
|
open = _usePicker.open,
|
|
50
50
|
actions = _usePicker.actions,
|
|
51
51
|
layoutProps = _usePicker.layoutProps,
|
|
@@ -72,6 +72,7 @@ export var useDesktopRangePicker = function useDesktopRangePicker(_ref) {
|
|
|
72
72
|
className: className,
|
|
73
73
|
sx: sx,
|
|
74
74
|
format: format,
|
|
75
|
+
formatDensity: formatDensity,
|
|
75
76
|
autoFocus: autoFocus && !props.open,
|
|
76
77
|
ref: fieldContainerRef
|
|
77
78
|
}, fieldType === 'single-input' && {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["props"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
6
|
import { useLicenseVerifier } from '@mui/x-license-pro';
|
|
@@ -15,14 +17,14 @@ var releaseInfo = getReleaseInfo();
|
|
|
15
17
|
export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
16
18
|
var _fieldType, _innerSlotProps$toolb, _innerSlotProps$toolb2, _slots$layout;
|
|
17
19
|
var props = _ref.props,
|
|
18
|
-
|
|
19
|
-
validator = _ref.validator;
|
|
20
|
+
pickerParams = _objectWithoutProperties(_ref, _excluded);
|
|
20
21
|
useLicenseVerifier('x-date-pickers-pro', releaseInfo);
|
|
21
22
|
var slots = props.slots,
|
|
22
23
|
innerSlotProps = props.slotProps,
|
|
23
24
|
className = props.className,
|
|
24
25
|
sx = props.sx,
|
|
25
26
|
format = props.format,
|
|
27
|
+
formatDensity = props.formatDensity,
|
|
26
28
|
label = props.label,
|
|
27
29
|
inputRef = props.inputRef,
|
|
28
30
|
readOnly = props.readOnly,
|
|
@@ -35,17 +37,15 @@ export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
|
35
37
|
singleInputFieldRef = _useRangePosition.singleInputFieldRef;
|
|
36
38
|
var labelId = useId();
|
|
37
39
|
var contextLocaleText = useLocaleText();
|
|
38
|
-
var _usePicker = usePicker({
|
|
40
|
+
var _usePicker = usePicker(_extends({}, pickerParams, {
|
|
39
41
|
props: props,
|
|
40
|
-
valueManager: valueManager,
|
|
41
42
|
wrapperVariant: 'mobile',
|
|
42
|
-
validator: validator,
|
|
43
43
|
autoFocusView: true,
|
|
44
44
|
additionalViewProps: {
|
|
45
45
|
rangePosition: rangePosition,
|
|
46
46
|
onRangePositionChange: onRangePositionChange
|
|
47
47
|
}
|
|
48
|
-
}),
|
|
48
|
+
})),
|
|
49
49
|
open = _usePicker.open,
|
|
50
50
|
actions = _usePicker.actions,
|
|
51
51
|
layoutProps = _usePicker.layoutProps,
|
|
@@ -61,7 +61,8 @@ export var useMobileRangePicker = function useMobileRangePicker(_ref) {
|
|
|
61
61
|
disabled: disabled,
|
|
62
62
|
className: className,
|
|
63
63
|
sx: sx,
|
|
64
|
-
format: format
|
|
64
|
+
format: format,
|
|
65
|
+
formatDensity: formatDensity
|
|
65
66
|
}, fieldType === 'single-input' && {
|
|
66
67
|
inputRef: inputRef
|
|
67
68
|
}),
|
|
@@ -22,6 +22,7 @@ export var useMultiInputDateRangeField = function useMultiInputDateRangeField(_r
|
|
|
22
22
|
var valueProp = sharedProps.value,
|
|
23
23
|
defaultValue = sharedProps.defaultValue,
|
|
24
24
|
format = sharedProps.format,
|
|
25
|
+
formatDensity = sharedProps.formatDensity,
|
|
25
26
|
onChange = sharedProps.onChange,
|
|
26
27
|
disabled = sharedProps.disabled,
|
|
27
28
|
readOnly = sharedProps.readOnly,
|
|
@@ -64,6 +65,7 @@ export var useMultiInputDateRangeField = function useMultiInputDateRangeField(_r
|
|
|
64
65
|
disabled: disabled,
|
|
65
66
|
readOnly: readOnly,
|
|
66
67
|
format: format,
|
|
68
|
+
formatDensity: formatDensity,
|
|
67
69
|
unstableFieldRef: unstableStartFieldRef,
|
|
68
70
|
value: valueProp === undefined ? undefined : valueProp[0],
|
|
69
71
|
defaultValue: defaultValue === undefined ? undefined : defaultValue[0],
|
|
@@ -75,6 +77,7 @@ export var useMultiInputDateRangeField = function useMultiInputDateRangeField(_r
|
|
|
75
77
|
error: !!validationError[1]
|
|
76
78
|
}, endTextFieldProps, {
|
|
77
79
|
format: format,
|
|
80
|
+
formatDensity: formatDensity,
|
|
78
81
|
disabled: disabled,
|
|
79
82
|
readOnly: readOnly,
|
|
80
83
|
unstableFieldRef: unstableEndFieldRef,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["props", "ref"];
|
|
3
5
|
import * as React from 'react';
|
|
4
6
|
import clsx from 'clsx';
|
|
5
7
|
import { styled } from '@mui/material/styles';
|
|
@@ -24,9 +26,8 @@ var PickerStaticLayout = styled(PickersLayout)(function (_ref) {
|
|
|
24
26
|
export var useStaticRangePicker = function useStaticRangePicker(_ref2) {
|
|
25
27
|
var _slots$layout;
|
|
26
28
|
var props = _ref2.props,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
ref = _ref2.ref;
|
|
29
|
+
ref = _ref2.ref,
|
|
30
|
+
pickerParams = _objectWithoutProperties(_ref2, _excluded);
|
|
30
31
|
var localeText = props.localeText,
|
|
31
32
|
slots = props.slots,
|
|
32
33
|
slotProps = props.slotProps,
|
|
@@ -37,17 +38,15 @@ export var useStaticRangePicker = function useStaticRangePicker(_ref2) {
|
|
|
37
38
|
var _useRangePosition = useRangePosition(props),
|
|
38
39
|
rangePosition = _useRangePosition.rangePosition,
|
|
39
40
|
onRangePositionChange = _useRangePosition.onRangePositionChange;
|
|
40
|
-
var _usePicker = usePicker({
|
|
41
|
+
var _usePicker = usePicker(_extends({}, pickerParams, {
|
|
41
42
|
props: props,
|
|
42
|
-
valueManager: valueManager,
|
|
43
|
-
validator: validator,
|
|
44
43
|
autoFocusView: autoFocus != null ? autoFocus : false,
|
|
45
44
|
additionalViewProps: {
|
|
46
45
|
rangePosition: rangePosition,
|
|
47
46
|
onRangePositionChange: onRangePositionChange
|
|
48
47
|
},
|
|
49
48
|
wrapperVariant: displayStaticWrapperAs
|
|
50
|
-
}),
|
|
49
|
+
})),
|
|
51
50
|
layoutProps = _usePicker.layoutProps,
|
|
52
51
|
renderCurrentView = _usePicker.renderCurrentView;
|
|
53
52
|
var Layout = (_slots$layout = slots == null ? void 0 : slots.layout) != null ? _slots$layout : PickerStaticLayout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY4MTkzMDgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -5,8 +5,8 @@ import { replaceInvalidDateByNull, addPositionPropertiesToSections, createDateSt
|
|
|
5
5
|
import { splitDateRangeSections, removeLastSeparator } from './date-fields-utils';
|
|
6
6
|
export var rangeValueManager = {
|
|
7
7
|
emptyValue: [null, null],
|
|
8
|
-
getTodayValue: function getTodayValue(utils) {
|
|
9
|
-
return [utils.date(), utils.date()];
|
|
8
|
+
getTodayValue: function getTodayValue(utils, valueType) {
|
|
9
|
+
return valueType === 'date' ? [utils.startOfDay(utils.date()), utils.startOfDay(utils.date())] : [utils.date(), utils.date()];
|
|
10
10
|
},
|
|
11
11
|
cleanValue: function cleanValue(utils, value) {
|
|
12
12
|
return value.map(function (date) {
|
|
@@ -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.
|
|
@@ -37,6 +37,7 @@ const DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDat
|
|
|
37
37
|
} = useDesktopRangePicker({
|
|
38
38
|
props,
|
|
39
39
|
valueManager: rangeValueManager,
|
|
40
|
+
valueType: 'date',
|
|
40
41
|
validator: validateDateRange
|
|
41
42
|
});
|
|
42
43
|
return renderPicker();
|
|
@@ -151,6 +152,12 @@ DesktopDateRangePicker.propTypes = {
|
|
|
151
152
|
* Defaults to localized format based on the used `views`.
|
|
152
153
|
*/
|
|
153
154
|
format: PropTypes.string,
|
|
155
|
+
/**
|
|
156
|
+
* Density of the format when rendered in the input.
|
|
157
|
+
* Setting `formatDensity` to `"spacious"` will add a space before and after each `/`, `-` and `.` character.
|
|
158
|
+
* @default "dense"
|
|
159
|
+
*/
|
|
160
|
+
formatDensity: PropTypes.oneOf(['dense', 'spacious']),
|
|
154
161
|
/**
|
|
155
162
|
* Pass a ref to the `input` element.
|
|
156
163
|
* Ignored if the field has several inputs.
|
|
@@ -40,6 +40,7 @@ const MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateR
|
|
|
40
40
|
} = useMobileRangePicker({
|
|
41
41
|
props,
|
|
42
42
|
valueManager: rangeValueManager,
|
|
43
|
+
valueType: 'date',
|
|
43
44
|
validator: validateDateRange
|
|
44
45
|
});
|
|
45
46
|
return renderPicker();
|
|
@@ -154,6 +155,12 @@ MobileDateRangePicker.propTypes = {
|
|
|
154
155
|
* Defaults to localized format based on the used `views`.
|
|
155
156
|
*/
|
|
156
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']),
|
|
157
164
|
/**
|
|
158
165
|
* Pass a ref to the `input` element.
|
|
159
166
|
* Ignored if the field has several inputs.
|