@mui/x-date-pickers-pro 6.2.1 → 6.3.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 +70 -1
- package/DateRangePicker/shared.d.ts +1 -1
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +26 -4
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +27 -4
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +27 -4
- package/README.md +0 -9
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +20 -3
- package/SingleInputDateRangeField/useSingleInputDateRangeField.js +4 -2
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +21 -3
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +4 -2
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +21 -3
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +4 -2
- package/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -2
- package/index.d.ts +1 -3
- package/index.js +3 -2
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +2 -2
- package/internal/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +5 -5
- package/internal/hooks/useEnrichedRangePickerFieldProps.d.ts +4 -3
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +2 -2
- package/internal/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +5 -5
- package/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +4 -1
- package/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +4 -1
- package/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +4 -1
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +2 -2
- package/internal/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +5 -5
- package/internal/models/dateRange.d.ts +1 -1
- package/internal/models/dateTimeRange.d.ts +1 -1
- package/internal/models/timeRange.d.ts +1 -1
- package/internal/utils/date-fields-utils.d.ts +4 -1
- package/internal/utils/releaseInfo.js +1 -1
- package/internal/{hooks/validation/useDateRangeValidation.d.ts → utils/validation/validateDateRange.d.ts} +1 -7
- package/internal/{hooks/validation/useDateRangeValidation.js → utils/validation/validateDateRange.js} +1 -1
- package/internal/utils/validation/validateDateTimeRange.d.ts +7 -0
- package/internal/{hooks/validation/useDateTimeRangeValidation.js → utils/validation/validateDateTimeRange.js} +2 -6
- package/internal/utils/validation/validateTimeRange.d.ts +6 -0
- package/internal/{hooks/validation/useTimeRangeValidation.js → utils/validation/validateTimeRange.js} +2 -6
- package/internal/utils/valueManagers.d.ts +1 -3
- package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +26 -4
- package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +27 -4
- package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +27 -4
- package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +20 -3
- package/legacy/SingleInputDateRangeField/useSingleInputDateRangeField.js +4 -2
- package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +21 -3
- package/legacy/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +4 -2
- package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +21 -3
- package/legacy/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +4 -2
- package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/legacy/index.js +3 -2
- package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +4 -1
- package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +4 -1
- package/legacy/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +4 -1
- package/legacy/internal/utils/releaseInfo.js +1 -1
- package/legacy/internal/{hooks/validation/useDateRangeValidation.js → utils/validation/validateDateRange.js} +1 -1
- package/legacy/internal/{hooks/validation/useDateTimeRangeValidation.js → utils/validation/validateDateTimeRange.js} +2 -6
- package/legacy/internal/{hooks/validation/useTimeRangeValidation.js → utils/validation/validateTimeRange.js} +2 -6
- package/legacy/models/index.js +1 -0
- package/legacy/models/validation.js +1 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +1 -0
- package/models/package.json +6 -0
- package/models/validation.d.ts +9 -0
- package/models/validation.js +1 -0
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +1 -1
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -1
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +26 -4
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +27 -4
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +27 -4
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +20 -3
- package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +4 -2
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +21 -3
- package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +4 -2
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +21 -3
- package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +4 -2
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -1
- package/modern/index.js +3 -2
- package/modern/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +4 -1
- package/modern/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +4 -1
- package/modern/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +4 -1
- package/modern/internal/utils/releaseInfo.js +1 -1
- package/modern/internal/{hooks/validation/useDateRangeValidation.js → utils/validation/validateDateRange.js} +1 -1
- package/modern/internal/{hooks/validation/useDateTimeRangeValidation.js → utils/validation/validateDateTimeRange.js} +2 -6
- package/modern/internal/{hooks/validation/useTimeRangeValidation.js → utils/validation/validateTimeRange.js} +2 -6
- package/modern/models/index.js +1 -0
- package/modern/models/validation.js +1 -0
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +2 -2
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +2 -2
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +26 -4
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +27 -4
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +27 -4
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +20 -3
- package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +5 -3
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +21 -3
- package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +5 -3
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +21 -3
- package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +5 -3
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +2 -2
- package/node/index.js +13 -1
- package/node/internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +6 -3
- package/node/internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +6 -3
- package/node/internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +6 -3
- package/node/internal/utils/releaseInfo.js +1 -1
- package/node/internal/{hooks/validation/useDateRangeValidation.js → utils/validation/validateDateRange.js} +1 -1
- package/node/internal/{hooks/validation/useDateTimeRangeValidation.js → utils/validation/validateDateTimeRange.js} +3 -8
- package/node/internal/{hooks/validation/useTimeRangeValidation.js → utils/validation/validateTimeRange.js} +3 -8
- package/node/models/index.js +16 -0
- package/node/models/validation.js +5 -0
- package/package.json +4 -7
- package/internal/hooks/validation/useDateTimeRangeValidation.d.ts +0 -14
- package/internal/hooks/validation/useTimeRangeValidation.d.ts +0 -13
|
@@ -10,7 +10,7 @@ import { useDateRangePickerDefaultizedProps } from '../DateRangePicker/shared';
|
|
|
10
10
|
import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
|
|
11
11
|
import { MultiInputDateRangeField } from '../MultiInputDateRangeField';
|
|
12
12
|
import { useMobileRangePicker } from '../internal/hooks/useMobileRangePicker';
|
|
13
|
-
import { validateDateRange } from '../internal/
|
|
13
|
+
import { validateDateRange } from '../internal/utils/validation/validateDateRange';
|
|
14
14
|
const MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateRangePicker(inProps, ref) {
|
|
15
15
|
// Props with the default values common to all date time pickers
|
|
16
16
|
const _useDateRangePickerDe = useDateRangePickerDefaultizedProps(inProps, 'MuiMobileDateRangePicker'),
|
|
@@ -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", "formatDensity", "onChange", "readOnly", "disabled", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "autoFocus"],
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "value", "defaultValue", "format", "formatDensity", "shouldRespectLeadingZeros", "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';
|
|
@@ -25,7 +25,7 @@ const MultiInputDateRangeFieldRoot = styled( /*#__PURE__*/React.forwardRef((prop
|
|
|
25
25
|
overridesResolver: (props, styles) => styles.root
|
|
26
26
|
})({});
|
|
27
27
|
const MultiInputDateRangeFieldSeparator = styled(props => /*#__PURE__*/_jsx(Typography, _extends({}, props, {
|
|
28
|
-
children: props.children ?? '
|
|
28
|
+
children: props.children ?? ' – '
|
|
29
29
|
})), {
|
|
30
30
|
name: 'MuiMultiInputDateRangeField',
|
|
31
31
|
slot: 'Separator',
|
|
@@ -45,6 +45,7 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
45
45
|
defaultValue,
|
|
46
46
|
format,
|
|
47
47
|
formatDensity,
|
|
48
|
+
shouldRespectLeadingZeros,
|
|
48
49
|
onChange,
|
|
49
50
|
readOnly,
|
|
50
51
|
disabled,
|
|
@@ -102,6 +103,7 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
102
103
|
defaultValue,
|
|
103
104
|
format,
|
|
104
105
|
formatDensity,
|
|
106
|
+
shouldRespectLeadingZeros,
|
|
105
107
|
onChange,
|
|
106
108
|
readOnly,
|
|
107
109
|
disabled,
|
|
@@ -139,15 +141,20 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
139
141
|
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
140
142
|
fullWidth: true
|
|
141
143
|
}, startDateProps, {
|
|
144
|
+
InputProps: _extends({}, startDateProps.InputProps, {
|
|
145
|
+
readOnly: startReadOnly
|
|
146
|
+
}),
|
|
142
147
|
inputProps: _extends({}, startDateProps.inputProps, {
|
|
143
148
|
ref: startInputRef,
|
|
144
|
-
readOnly: startReadOnly,
|
|
145
149
|
inputMode: startInputMode,
|
|
146
150
|
onKeyDown: onStartInputKeyDown
|
|
147
151
|
})
|
|
148
152
|
})), /*#__PURE__*/_jsx(Separator, _extends({}, separatorProps)), /*#__PURE__*/_jsx(TextField, _extends({
|
|
149
153
|
fullWidth: true
|
|
150
154
|
}, endDateProps, {
|
|
155
|
+
InputProps: _extends({}, endDateProps.InputProps, {
|
|
156
|
+
readOnly: endReadOnly
|
|
157
|
+
}),
|
|
151
158
|
inputProps: _extends({}, endDateProps.inputProps, {
|
|
152
159
|
ref: endInputRef,
|
|
153
160
|
readOnly: endReadOnly,
|
|
@@ -271,6 +278,21 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
271
278
|
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
272
279
|
*/
|
|
273
280
|
shouldDisableDate: PropTypes.func,
|
|
281
|
+
/**
|
|
282
|
+
* If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
283
|
+
* If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
284
|
+
*
|
|
285
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
286
|
+
*
|
|
287
|
+
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
288
|
+
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
289
|
+
*
|
|
290
|
+
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
291
|
+
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
292
|
+
*
|
|
293
|
+
* @default `false`
|
|
294
|
+
*/
|
|
295
|
+
shouldRespectLeadingZeros: PropTypes.bool,
|
|
274
296
|
/**
|
|
275
297
|
* The props used for each component slot.
|
|
276
298
|
* @default {}
|
|
@@ -296,7 +318,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
296
318
|
/**
|
|
297
319
|
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
298
320
|
*
|
|
299
|
-
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack
|
|
321
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
|
|
300
322
|
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
301
323
|
*
|
|
302
324
|
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
@@ -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", "formatDensity", "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", "shouldRespectLeadingZeros", "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';
|
|
@@ -25,7 +25,7 @@ const MultiInputDateTimeRangeFieldRoot = styled( /*#__PURE__*/React.forwardRef((
|
|
|
25
25
|
overridesResolver: (props, styles) => styles.root
|
|
26
26
|
})({});
|
|
27
27
|
const MultiInputDateTimeRangeFieldSeparator = styled(props => /*#__PURE__*/_jsx(Typography, _extends({}, props, {
|
|
28
|
-
children: props.children ?? '
|
|
28
|
+
children: props.children ?? ' – '
|
|
29
29
|
})), {
|
|
30
30
|
name: 'MuiMultiInputDateTimeRangeField',
|
|
31
31
|
slot: 'Separator',
|
|
@@ -45,6 +45,7 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
|
|
|
45
45
|
defaultValue,
|
|
46
46
|
format,
|
|
47
47
|
formatDensity,
|
|
48
|
+
shouldRespectLeadingZeros,
|
|
48
49
|
onChange,
|
|
49
50
|
readOnly,
|
|
50
51
|
disabled,
|
|
@@ -111,6 +112,7 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
|
|
|
111
112
|
defaultValue,
|
|
112
113
|
format,
|
|
113
114
|
formatDensity,
|
|
115
|
+
shouldRespectLeadingZeros,
|
|
114
116
|
onChange,
|
|
115
117
|
readOnly,
|
|
116
118
|
disabled,
|
|
@@ -157,15 +159,20 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
|
|
|
157
159
|
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
158
160
|
fullWidth: true
|
|
159
161
|
}, startDateProps, {
|
|
162
|
+
InputProps: _extends({}, startDateProps.InputProps, {
|
|
163
|
+
readOnly: startReadOnly
|
|
164
|
+
}),
|
|
160
165
|
inputProps: _extends({}, startDateProps.inputProps, {
|
|
161
166
|
ref: startInputRef,
|
|
162
|
-
readOnly: startReadOnly,
|
|
163
167
|
inputMode: startInputMode,
|
|
164
168
|
onKeyDown: onStartInputKeyDown
|
|
165
169
|
})
|
|
166
170
|
})), /*#__PURE__*/_jsx(Separator, _extends({}, separatorProps)), /*#__PURE__*/_jsx(TextField, _extends({
|
|
167
171
|
fullWidth: true
|
|
168
172
|
}, endDateProps, {
|
|
173
|
+
InputProps: _extends({}, endDateProps.InputProps, {
|
|
174
|
+
readOnly: endReadOnly
|
|
175
|
+
}),
|
|
169
176
|
inputProps: _extends({}, endDateProps.inputProps, {
|
|
170
177
|
ref: endInputRef,
|
|
171
178
|
readOnly: endReadOnly,
|
|
@@ -332,11 +339,27 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
332
339
|
shouldDisableDate: PropTypes.func,
|
|
333
340
|
/**
|
|
334
341
|
* Disable specific time.
|
|
342
|
+
* @template TDate
|
|
335
343
|
* @param {TDate} value The value to check.
|
|
336
344
|
* @param {TimeView} view The clock type of the timeValue.
|
|
337
345
|
* @returns {boolean} If `true` the time will be disabled.
|
|
338
346
|
*/
|
|
339
347
|
shouldDisableTime: PropTypes.func,
|
|
348
|
+
/**
|
|
349
|
+
* If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
350
|
+
* If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
351
|
+
*
|
|
352
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
353
|
+
*
|
|
354
|
+
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
355
|
+
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
356
|
+
*
|
|
357
|
+
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
358
|
+
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
359
|
+
*
|
|
360
|
+
* @default `false`
|
|
361
|
+
*/
|
|
362
|
+
shouldRespectLeadingZeros: PropTypes.bool,
|
|
340
363
|
/**
|
|
341
364
|
* The props used for each component slot.
|
|
342
365
|
* @default {}
|
|
@@ -362,7 +385,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
362
385
|
/**
|
|
363
386
|
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
364
387
|
*
|
|
365
|
-
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack
|
|
388
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
|
|
366
389
|
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
367
390
|
*
|
|
368
391
|
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
@@ -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", "formatDensity", "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", "shouldRespectLeadingZeros", "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';
|
|
@@ -25,7 +25,7 @@ const MultiInputTimeRangeFieldRoot = styled( /*#__PURE__*/React.forwardRef((prop
|
|
|
25
25
|
overridesResolver: (props, styles) => styles.root
|
|
26
26
|
})({});
|
|
27
27
|
const MultiInputTimeRangeFieldSeparator = styled(props => /*#__PURE__*/_jsx(Typography, _extends({}, props, {
|
|
28
|
-
children: props.children ?? '
|
|
28
|
+
children: props.children ?? ' – '
|
|
29
29
|
})), {
|
|
30
30
|
name: 'MuiMultiInputTimeRangeField',
|
|
31
31
|
slot: 'Separator',
|
|
@@ -45,6 +45,7 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
45
45
|
defaultValue,
|
|
46
46
|
format,
|
|
47
47
|
formatDensity,
|
|
48
|
+
shouldRespectLeadingZeros,
|
|
48
49
|
onChange,
|
|
49
50
|
readOnly,
|
|
50
51
|
disabled,
|
|
@@ -106,6 +107,7 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
106
107
|
defaultValue,
|
|
107
108
|
format,
|
|
108
109
|
formatDensity,
|
|
110
|
+
shouldRespectLeadingZeros,
|
|
109
111
|
onChange,
|
|
110
112
|
readOnly,
|
|
111
113
|
disabled,
|
|
@@ -147,15 +149,20 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
147
149
|
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
148
150
|
fullWidth: true
|
|
149
151
|
}, startDateProps, {
|
|
152
|
+
InputProps: _extends({}, startDateProps.InputProps, {
|
|
153
|
+
readOnly: startReadOnly
|
|
154
|
+
}),
|
|
150
155
|
inputProps: _extends({}, startDateProps.inputProps, {
|
|
151
156
|
ref: startInputRef,
|
|
152
|
-
readOnly: startReadOnly,
|
|
153
157
|
inputMode: startInputMode,
|
|
154
158
|
onKeyDown: onStartInputKeyDown
|
|
155
159
|
})
|
|
156
160
|
})), /*#__PURE__*/_jsx(Separator, _extends({}, separatorProps)), /*#__PURE__*/_jsx(TextField, _extends({
|
|
157
161
|
fullWidth: true
|
|
158
162
|
}, endDateProps, {
|
|
163
|
+
InputProps: _extends({}, endDateProps.InputProps, {
|
|
164
|
+
readOnly: endReadOnly
|
|
165
|
+
}),
|
|
159
166
|
inputProps: _extends({}, endDateProps.inputProps, {
|
|
160
167
|
ref: endInputRef,
|
|
161
168
|
readOnly: endReadOnly,
|
|
@@ -298,11 +305,27 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
298
305
|
shouldDisableClock: PropTypes.func,
|
|
299
306
|
/**
|
|
300
307
|
* Disable specific time.
|
|
308
|
+
* @template TDate
|
|
301
309
|
* @param {TDate} value The value to check.
|
|
302
310
|
* @param {TimeView} view The clock type of the timeValue.
|
|
303
311
|
* @returns {boolean} If `true` the time will be disabled.
|
|
304
312
|
*/
|
|
305
313
|
shouldDisableTime: PropTypes.func,
|
|
314
|
+
/**
|
|
315
|
+
* If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
316
|
+
* If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
317
|
+
*
|
|
318
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
319
|
+
*
|
|
320
|
+
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
321
|
+
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
322
|
+
*
|
|
323
|
+
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
324
|
+
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
325
|
+
*
|
|
326
|
+
* @default `false`
|
|
327
|
+
*/
|
|
328
|
+
shouldRespectLeadingZeros: PropTypes.bool,
|
|
306
329
|
/**
|
|
307
330
|
* The props used for each component slot.
|
|
308
331
|
* @default {}
|
|
@@ -328,7 +351,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
328
351
|
/**
|
|
329
352
|
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
330
353
|
*
|
|
331
|
-
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack
|
|
354
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
|
|
332
355
|
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
333
356
|
*
|
|
334
357
|
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
@@ -54,11 +54,13 @@ const SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
54
54
|
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
55
55
|
ref: ref
|
|
56
56
|
}, fieldProps, {
|
|
57
|
+
InputProps: _extends({}, fieldProps.InputProps, {
|
|
58
|
+
readOnly
|
|
59
|
+
}),
|
|
57
60
|
inputProps: _extends({}, fieldProps.inputProps, {
|
|
58
|
-
ref: inputRef,
|
|
59
|
-
onPaste,
|
|
60
61
|
inputMode,
|
|
61
|
-
|
|
62
|
+
onPaste,
|
|
63
|
+
ref: inputRef
|
|
62
64
|
})
|
|
63
65
|
}));
|
|
64
66
|
});
|
|
@@ -249,6 +251,21 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
249
251
|
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
250
252
|
*/
|
|
251
253
|
shouldDisableDate: PropTypes.func,
|
|
254
|
+
/**
|
|
255
|
+
* If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
256
|
+
* If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
257
|
+
*
|
|
258
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
259
|
+
*
|
|
260
|
+
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
261
|
+
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
262
|
+
*
|
|
263
|
+
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
264
|
+
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
265
|
+
*
|
|
266
|
+
* @default `false`
|
|
267
|
+
*/
|
|
268
|
+
shouldRespectLeadingZeros: PropTypes.bool,
|
|
252
269
|
/**
|
|
253
270
|
* The size of the component.
|
|
254
271
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
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", "formatDensity", "onChange", "readOnly", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
3
|
+
const _excluded = ["value", "defaultValue", "format", "formatDensity", "shouldRespectLeadingZeros", "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
|
-
import { validateDateRange } from '../internal/
|
|
6
|
+
import { validateDateRange } from '../internal/utils/validation/validateDateRange';
|
|
7
7
|
export const useDefaultizedDateRangeFieldProps = props => {
|
|
8
8
|
const utils = useUtils();
|
|
9
9
|
const defaultDates = useDefaultDates();
|
|
@@ -25,6 +25,7 @@ export const useSingleInputDateRangeField = ({
|
|
|
25
25
|
defaultValue,
|
|
26
26
|
format,
|
|
27
27
|
formatDensity,
|
|
28
|
+
shouldRespectLeadingZeros,
|
|
28
29
|
onChange,
|
|
29
30
|
readOnly,
|
|
30
31
|
onError,
|
|
@@ -46,6 +47,7 @@ export const useSingleInputDateRangeField = ({
|
|
|
46
47
|
defaultValue,
|
|
47
48
|
format,
|
|
48
49
|
formatDensity,
|
|
50
|
+
shouldRespectLeadingZeros,
|
|
49
51
|
onChange,
|
|
50
52
|
readOnly,
|
|
51
53
|
onError,
|
|
@@ -54,11 +54,13 @@ const SingleInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Sin
|
|
|
54
54
|
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
55
55
|
ref: ref
|
|
56
56
|
}, fieldProps, {
|
|
57
|
+
InputProps: _extends({}, fieldProps.InputProps, {
|
|
58
|
+
readOnly
|
|
59
|
+
}),
|
|
57
60
|
inputProps: _extends({}, fieldProps.inputProps, {
|
|
58
|
-
ref: inputRef,
|
|
59
|
-
onPaste,
|
|
60
61
|
inputMode,
|
|
61
|
-
|
|
62
|
+
onPaste,
|
|
63
|
+
ref: inputRef
|
|
62
64
|
})
|
|
63
65
|
}));
|
|
64
66
|
});
|
|
@@ -292,11 +294,27 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
292
294
|
shouldDisableDate: PropTypes.func,
|
|
293
295
|
/**
|
|
294
296
|
* Disable specific time.
|
|
297
|
+
* @template TDate
|
|
295
298
|
* @param {TDate} value The value to check.
|
|
296
299
|
* @param {TimeView} view The clock type of the timeValue.
|
|
297
300
|
* @returns {boolean} If `true` the time will be disabled.
|
|
298
301
|
*/
|
|
299
302
|
shouldDisableTime: PropTypes.func,
|
|
303
|
+
/**
|
|
304
|
+
* If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
305
|
+
* If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
306
|
+
*
|
|
307
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
308
|
+
*
|
|
309
|
+
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
310
|
+
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
311
|
+
*
|
|
312
|
+
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
313
|
+
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
314
|
+
*
|
|
315
|
+
* @default `false`
|
|
316
|
+
*/
|
|
317
|
+
shouldRespectLeadingZeros: PropTypes.bool,
|
|
300
318
|
/**
|
|
301
319
|
* The size of the component.
|
|
302
320
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
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", "formatDensity", "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", "shouldRespectLeadingZeros", "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
|
-
import { validateDateTimeRange } from '../internal/
|
|
6
|
+
import { validateDateTimeRange } from '../internal/utils/validation/validateDateTimeRange';
|
|
7
7
|
export const useDefaultizedTimeRangeFieldProps = props => {
|
|
8
8
|
const utils = useUtils();
|
|
9
9
|
const defaultDates = useDefaultDates();
|
|
@@ -30,6 +30,7 @@ export const useSingleInputDateTimeRangeField = ({
|
|
|
30
30
|
defaultValue,
|
|
31
31
|
format,
|
|
32
32
|
formatDensity,
|
|
33
|
+
shouldRespectLeadingZeros,
|
|
33
34
|
onChange,
|
|
34
35
|
readOnly,
|
|
35
36
|
onError,
|
|
@@ -56,6 +57,7 @@ export const useSingleInputDateTimeRangeField = ({
|
|
|
56
57
|
defaultValue,
|
|
57
58
|
format,
|
|
58
59
|
formatDensity,
|
|
60
|
+
shouldRespectLeadingZeros,
|
|
59
61
|
onChange,
|
|
60
62
|
readOnly,
|
|
61
63
|
onError,
|
|
@@ -54,11 +54,13 @@ const SingleInputTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
54
54
|
return /*#__PURE__*/_jsx(TextField, _extends({
|
|
55
55
|
ref: ref
|
|
56
56
|
}, fieldProps, {
|
|
57
|
+
InputProps: _extends({}, fieldProps.InputProps, {
|
|
58
|
+
readOnly
|
|
59
|
+
}),
|
|
57
60
|
inputProps: _extends({}, fieldProps.inputProps, {
|
|
58
|
-
ref: inputRef,
|
|
59
|
-
onPaste,
|
|
60
61
|
inputMode,
|
|
61
|
-
|
|
62
|
+
onPaste,
|
|
63
|
+
ref: inputRef
|
|
62
64
|
})
|
|
63
65
|
}));
|
|
64
66
|
});
|
|
@@ -268,11 +270,27 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
268
270
|
shouldDisableClock: PropTypes.func,
|
|
269
271
|
/**
|
|
270
272
|
* Disable specific time.
|
|
273
|
+
* @template TDate
|
|
271
274
|
* @param {TDate} value The value to check.
|
|
272
275
|
* @param {TimeView} view The clock type of the timeValue.
|
|
273
276
|
* @returns {boolean} If `true` the time will be disabled.
|
|
274
277
|
*/
|
|
275
278
|
shouldDisableTime: PropTypes.func,
|
|
279
|
+
/**
|
|
280
|
+
* If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)
|
|
281
|
+
* If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)
|
|
282
|
+
*
|
|
283
|
+
* Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: "DD"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.
|
|
284
|
+
*
|
|
285
|
+
* Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.
|
|
286
|
+
* If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\u200e/g, '')`.
|
|
287
|
+
*
|
|
288
|
+
* Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.
|
|
289
|
+
* This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.
|
|
290
|
+
*
|
|
291
|
+
* @default `false`
|
|
292
|
+
*/
|
|
293
|
+
shouldRespectLeadingZeros: PropTypes.bool,
|
|
276
294
|
/**
|
|
277
295
|
* The size of the component.
|
|
278
296
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
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", "formatDensity", "onChange", "readOnly", "onError", "minTime", "maxTime", "minutesStep", "shouldDisableTime", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
|
|
3
|
+
const _excluded = ["value", "defaultValue", "format", "formatDensity", "shouldRespectLeadingZeros", "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
|
-
import { validateTimeRange } from '../internal/
|
|
6
|
+
import { validateTimeRange } from '../internal/utils/validation/validateTimeRange';
|
|
7
7
|
export const useDefaultizedTimeRangeFieldProps = props => {
|
|
8
8
|
const utils = useUtils();
|
|
9
9
|
const ampm = props.ampm ?? utils.is12HourCycleInCurrentLocale();
|
|
@@ -24,6 +24,7 @@ export const useSingleInputTimeRangeField = ({
|
|
|
24
24
|
defaultValue,
|
|
25
25
|
format,
|
|
26
26
|
formatDensity,
|
|
27
|
+
shouldRespectLeadingZeros,
|
|
27
28
|
onChange,
|
|
28
29
|
readOnly,
|
|
29
30
|
onError,
|
|
@@ -46,6 +47,7 @@ export const useSingleInputTimeRangeField = ({
|
|
|
46
47
|
defaultValue,
|
|
47
48
|
format,
|
|
48
49
|
formatDensity,
|
|
50
|
+
shouldRespectLeadingZeros,
|
|
49
51
|
onChange,
|
|
50
52
|
readOnly,
|
|
51
53
|
onError,
|
|
@@ -5,7 +5,7 @@ import { useStaticRangePicker } from '../internal/hooks/useStaticRangePicker';
|
|
|
5
5
|
import { useDateRangePickerDefaultizedProps } from '../DateRangePicker/shared';
|
|
6
6
|
import { renderDateRangeViewCalendar } from '../dateRangeViewRenderers';
|
|
7
7
|
import { rangeValueManager } from '../internal/utils/valueManagers';
|
|
8
|
-
import { validateDateRange } from '../internal/
|
|
8
|
+
import { validateDateRange } from '../internal/utils/validation/validateDateRange';
|
|
9
9
|
const StaticDateRangePicker = /*#__PURE__*/React.forwardRef(function StaticDateRangePicker(inProps, ref) {
|
|
10
10
|
const defaultizedProps = useDateRangePickerDefaultizedProps(inProps, 'MuiStaticDateRangePicker');
|
|
11
11
|
const displayStaticWrapperAs = defaultizedProps.displayStaticWrapperAs ?? 'mobile';
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers-pro v6.
|
|
2
|
+
* @mui/x-date-pickers-pro v6.3.0
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
@@ -26,4 +26,5 @@ export * from './MobileDateRangePicker';
|
|
|
26
26
|
export * from './StaticDateRangePicker';
|
|
27
27
|
|
|
28
28
|
// View renderers
|
|
29
|
-
export * from './dateRangeViewRenderers';
|
|
29
|
+
export * from './dateRangeViewRenderers';
|
|
30
|
+
export * from './models';
|
|
@@ -5,7 +5,7 @@ import { unstable_useDateField as useDateField } from '@mui/x-date-pickers/DateF
|
|
|
5
5
|
import { useLocalizationContext, useValidation } from '@mui/x-date-pickers/internals';
|
|
6
6
|
import useControlled from '@mui/utils/useControlled';
|
|
7
7
|
import { useDefaultizedDateRangeFieldProps } from '../../../SingleInputDateRangeField/useSingleInputDateRangeField';
|
|
8
|
-
import { validateDateRange } from '
|
|
8
|
+
import { validateDateRange } from '../../utils/validation/validateDateRange';
|
|
9
9
|
import { rangeValueManager } from '../../utils/valueManagers';
|
|
10
10
|
export const useMultiInputDateRangeField = ({
|
|
11
11
|
sharedProps: inSharedProps,
|
|
@@ -23,6 +23,7 @@ export const useMultiInputDateRangeField = ({
|
|
|
23
23
|
defaultValue,
|
|
24
24
|
format,
|
|
25
25
|
formatDensity,
|
|
26
|
+
shouldRespectLeadingZeros,
|
|
26
27
|
onChange,
|
|
27
28
|
disabled,
|
|
28
29
|
readOnly,
|
|
@@ -64,6 +65,7 @@ export const useMultiInputDateRangeField = ({
|
|
|
64
65
|
readOnly,
|
|
65
66
|
format,
|
|
66
67
|
formatDensity,
|
|
68
|
+
shouldRespectLeadingZeros,
|
|
67
69
|
unstableFieldRef: unstableStartFieldRef,
|
|
68
70
|
value: valueProp === undefined ? undefined : valueProp[0],
|
|
69
71
|
defaultValue: defaultValue === undefined ? undefined : defaultValue[0],
|
|
@@ -76,6 +78,7 @@ export const useMultiInputDateRangeField = ({
|
|
|
76
78
|
}, endTextFieldProps, {
|
|
77
79
|
format,
|
|
78
80
|
formatDensity,
|
|
81
|
+
shouldRespectLeadingZeros,
|
|
79
82
|
disabled,
|
|
80
83
|
readOnly,
|
|
81
84
|
unstableFieldRef: unstableEndFieldRef,
|
|
@@ -4,7 +4,7 @@ import useEventCallback from '@mui/utils/useEventCallback';
|
|
|
4
4
|
import { unstable_useDateTimeField as useDateTimeField } from '@mui/x-date-pickers/DateTimeField';
|
|
5
5
|
import { applyDefaultDate, useDefaultDates, useLocalizationContext, useUtils, useValidation } from '@mui/x-date-pickers/internals';
|
|
6
6
|
import useControlled from '@mui/utils/useControlled';
|
|
7
|
-
import { validateDateTimeRange } from '
|
|
7
|
+
import { validateDateTimeRange } from '../../utils/validation/validateDateTimeRange';
|
|
8
8
|
import { rangeValueManager } from '../../utils/valueManagers';
|
|
9
9
|
export const useDefaultizedDateTimeRangeFieldProps = props => {
|
|
10
10
|
const utils = useUtils();
|
|
@@ -37,6 +37,7 @@ export const useMultiInputDateTimeRangeField = ({
|
|
|
37
37
|
value: valueProp,
|
|
38
38
|
defaultValue,
|
|
39
39
|
format,
|
|
40
|
+
shouldRespectLeadingZeros,
|
|
40
41
|
onChange,
|
|
41
42
|
disabled,
|
|
42
43
|
readOnly
|
|
@@ -73,6 +74,7 @@ export const useMultiInputDateTimeRangeField = ({
|
|
|
73
74
|
error: !!validationError[0]
|
|
74
75
|
}, startTextFieldProps, {
|
|
75
76
|
format,
|
|
77
|
+
shouldRespectLeadingZeros,
|
|
76
78
|
disabled,
|
|
77
79
|
readOnly,
|
|
78
80
|
unstableFieldRef: unstableStartFieldRef,
|
|
@@ -84,6 +86,7 @@ export const useMultiInputDateTimeRangeField = ({
|
|
|
84
86
|
error: !!validationError[1]
|
|
85
87
|
}, endTextFieldProps, {
|
|
86
88
|
format,
|
|
89
|
+
shouldRespectLeadingZeros,
|
|
87
90
|
disabled,
|
|
88
91
|
readOnly,
|
|
89
92
|
unstableFieldRef: unstableEndFieldRef,
|
|
@@ -4,7 +4,7 @@ import useEventCallback from '@mui/utils/useEventCallback';
|
|
|
4
4
|
import { unstable_useTimeField as useTimeField } from '@mui/x-date-pickers/TimeField';
|
|
5
5
|
import { useLocalizationContext, useUtils, useValidation } from '@mui/x-date-pickers/internals';
|
|
6
6
|
import useControlled from '@mui/utils/useControlled';
|
|
7
|
-
import { validateTimeRange } from '
|
|
7
|
+
import { validateTimeRange } from '../../utils/validation/validateTimeRange';
|
|
8
8
|
import { rangeValueManager } from '../../utils/valueManagers';
|
|
9
9
|
export const useDefaultizedTimeRangeFieldProps = props => {
|
|
10
10
|
const utils = useUtils();
|
|
@@ -31,6 +31,7 @@ export const useMultiInputTimeRangeField = ({
|
|
|
31
31
|
value: valueProp,
|
|
32
32
|
defaultValue,
|
|
33
33
|
format,
|
|
34
|
+
shouldRespectLeadingZeros,
|
|
34
35
|
onChange,
|
|
35
36
|
disabled,
|
|
36
37
|
readOnly
|
|
@@ -67,6 +68,7 @@ export const useMultiInputTimeRangeField = ({
|
|
|
67
68
|
error: !!validationError[0]
|
|
68
69
|
}, startTextFieldProps, {
|
|
69
70
|
format,
|
|
71
|
+
shouldRespectLeadingZeros,
|
|
70
72
|
disabled,
|
|
71
73
|
readOnly,
|
|
72
74
|
unstableFieldRef: unstableStartFieldRef,
|
|
@@ -78,6 +80,7 @@ export const useMultiInputTimeRangeField = ({
|
|
|
78
80
|
error: !!validationError[1]
|
|
79
81
|
}, endTextFieldProps, {
|
|
80
82
|
format,
|
|
83
|
+
shouldRespectLeadingZeros,
|
|
81
84
|
disabled,
|
|
82
85
|
readOnly,
|
|
83
86
|
unstableFieldRef: unstableEndFieldRef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY4MjYyOTIwMDAwMA==";
|
|
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
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["shouldDisableDate"];
|
|
4
4
|
import { validateDate } from '@mui/x-date-pickers/internals';
|
|
5
|
-
import { isRangeValid } from '
|
|
5
|
+
import { isRangeValid } from '../date-utils';
|
|
6
6
|
export const validateDateRange = ({
|
|
7
7
|
props,
|
|
8
8
|
value,
|