@mui/x-date-pickers-pro 6.4.0 → 6.5.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/DateRangeCalendar/DateRangeCalendar.js +20 -5
  3. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +5 -0
  4. package/DateRangePicker/DateRangePicker.js +5 -0
  5. package/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -0
  6. package/MobileDateRangePicker/MobileDateRangePicker.js +5 -0
  7. package/MultiInputDateRangeField/MultiInputDateRangeField.js +17 -39
  8. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -54
  9. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +14 -44
  10. package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -1
  11. package/SingleInputDateRangeField/useSingleInputDateRangeField.js +9 -43
  12. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -1
  13. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +9 -53
  14. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -1
  15. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +9 -45
  16. package/StaticDateRangePicker/StaticDateRangePicker.js +5 -0
  17. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +1 -1
  18. package/dateRangeViewRenderers/dateRangeViewRenderers.js +2 -0
  19. package/index.js +1 -1
  20. package/internal/utils/releaseInfo.js +1 -1
  21. package/legacy/DateRangeCalendar/DateRangeCalendar.js +18 -4
  22. package/legacy/DateRangePicker/DateRangePicker.js +5 -0
  23. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -0
  24. package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +5 -0
  25. package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +20 -43
  26. package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +18 -59
  27. package/legacy/MultiInputTimeRangeField/MultiInputTimeRangeField.js +18 -49
  28. package/legacy/SingleInputDateRangeField/useSingleInputDateRangeField.js +8 -41
  29. package/legacy/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +8 -53
  30. package/legacy/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +8 -43
  31. package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +5 -0
  32. package/legacy/dateRangeViewRenderers/dateRangeViewRenderers.js +2 -0
  33. package/legacy/index.js +1 -1
  34. package/legacy/internal/utils/releaseInfo.js +1 -1
  35. package/modern/DateRangeCalendar/DateRangeCalendar.js +20 -5
  36. package/modern/DateRangePicker/DateRangePicker.js +5 -0
  37. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -0
  38. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +5 -0
  39. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +17 -39
  40. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +14 -54
  41. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +14 -44
  42. package/modern/SingleInputDateRangeField/useSingleInputDateRangeField.js +9 -43
  43. package/modern/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +9 -53
  44. package/modern/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +9 -45
  45. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +5 -0
  46. package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +2 -0
  47. package/modern/index.js +1 -1
  48. package/modern/internal/utils/releaseInfo.js +1 -1
  49. package/node/DateRangeCalendar/DateRangeCalendar.js +19 -4
  50. package/node/DateRangePicker/DateRangePicker.js +5 -0
  51. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +5 -0
  52. package/node/MobileDateRangePicker/MobileDateRangePicker.js +5 -0
  53. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +16 -38
  54. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +13 -53
  55. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +13 -43
  56. package/node/SingleInputDateRangeField/useSingleInputDateRangeField.js +8 -42
  57. package/node/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.js +8 -52
  58. package/node/SingleInputTimeRangeField/useSingleInputTimeRangeField.js +8 -44
  59. package/node/StaticDateRangePicker/StaticDateRangePicker.js +5 -0
  60. package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +2 -0
  61. package/node/index.js +1 -1
  62. package/node/internal/utils/releaseInfo.js +1 -1
  63. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,62 @@
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
+ ## v6.5.0
7
+
8
+ _May 19, 2023_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 💫 Introduce filtering on column headers for `DataGridPro` and `DataGridPremium`:
13
+
14
+ https://github.com/mui/mui-x/assets/12609561/c4c2bfec-59cf-4cab-932d-dc1983081de9
15
+
16
+ See [the documentation](https://mui.com/x/react-data-grid/filtering/#header-filters) for more information
17
+
18
+ - 🌍 Improve Hebrew (he-IL) and Czech (cs-CZ) locales
19
+ - 📝 Support for editing on pinned rows
20
+ - 🚀 Performance improvements
21
+ - 🐞 Bugfixes
22
+ - 📚 Documentation improvements
23
+
24
+ ### `@mui/x-data-grid@6.5.0` / `@mui/x-data-grid-pro@6.5.0` / `@mui/x-data-grid-premium@6.5.0`
25
+
26
+ #### Changes
27
+
28
+ - [DataGrid] Fix grid size calculation when `.MuiDataGrid-main` has border (#8882) @cherniavskii
29
+ - [DataGridPro] Filtering on Column Header (#7760) @MBilalShafi
30
+ - [DataGridPro] Improve `treeData` and `rowGrouping` performance (#8990) @MBilalShafi
31
+ - [DataGridPro] Support pinned rows editing (#8921) @cherniavskii
32
+ - [l10n] Improve Hebrew (he-IL) locale (#8943) @Itzik-Tech
33
+ - [l10n] Improve Czech (cs-CZ) locale (#8829) @harastaivan
34
+ - [l10n] Improve Czech (cs-CZ) locale (#8956) @davidzemancz
35
+
36
+ ### `@mui/x-date-pickers@6.5.0` / `@mui/x-date-pickers-pro@6.5.0`
37
+
38
+ #### Changes
39
+
40
+ - [fields] Select the first section instead of last when clicking right of content (#9005) @noraleonte
41
+ - [fields] Refactor prop drilling in fields (#8660) @flaviendelangle
42
+ - [pickers] Allow to render the months before `currentMonth` instead of the one after (#8592) @flaviendelangle
43
+ - [pickers] Fix view management when `openTo` or `views` is modified (#8997) @alexfauquette
44
+ - [l10n] Improve Czech (cs-CZ) locale (#8829) @harastaivan
45
+
46
+ ### Docs
47
+
48
+ - [docs] Clarify what Controlled / Uncontrolled means (#8926) @flaviendelangle
49
+ - [docs] Fix docs using wrong service worker (#9030) @cherniavskii
50
+ - [docs] Remove prop-types from JS demos (#9008) @flaviendelangle
51
+
52
+ ### Core
53
+
54
+ - [core] Add assertion about checkbox rerenders (#8974) @oliviertassinari
55
+ - [core] Allow selecting a section by type in field tests (#9009) @flaviendelangle
56
+ - [core] Fix `yarn.lock` (#8988) @flaviendelangle
57
+ - [core] Fix flacky adapter test (#8995) @flaviendelangle
58
+ - [charts] Clean the axis rendering (#8948) @alexfauquette
59
+ - [DataGrid] Memoize root props for better performance (#8942) @romgrk
60
+ - [test] Skip flaky unit tests in JSDOM (#8994) @cherniavskii
61
+
6
62
  ## v6.4.0
7
63
 
8
64
  _May 12, 2023_
@@ -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", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "defaultCalendarMonth", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "components", "componentsProps", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber"],
3
+ const _excluded = ["value", "defaultValue", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "defaultCalendarMonth", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "components", "componentsProps", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber"],
4
4
  _excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
@@ -12,7 +12,7 @@ import { resolveComponentProps } from '@mui/base/utils';
12
12
  import { styled, useThemeProps } from '@mui/material/styles';
13
13
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
14
14
  import { Watermark } from '@mui/x-license-pro';
15
- import { applyDefaultDate, DAY_MARGIN, DayCalendar, defaultReduceAnimations, PickersArrowSwitcher, PickersCalendarHeader, useCalendarState, useDefaultDates, useLocaleText, useNextMonthDisabled, usePreviousMonthDisabled, useUtils, useNow, uncapitalizeObjectKeys, DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '@mui/x-date-pickers/internals';
15
+ import { applyDefaultDate, DAY_MARGIN, DayCalendar, defaultReduceAnimations, PickersArrowSwitcher, PickersCalendarHeader, useCalendarState, useDefaultDates, useLocaleText, useNextMonthDisabled, usePreviousMonthDisabled, useUtils, useNow, uncapitalizeObjectKeys, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, buildWarning } from '@mui/x-date-pickers/internals';
16
16
  import { getReleaseInfo } from '../internal/utils/releaseInfo';
17
17
  import { dateRangeCalendarClasses, getDateRangeCalendarUtilityClass } from './dateRangeCalendarClasses';
18
18
  import { isEndOfRange, isRangeValid, isStartOfRange, isWithinRange } from '../internal/utils/date-utils';
@@ -51,6 +51,7 @@ const DateRangeCalendarArrowSwitcher = styled(PickersArrowSwitcher)({
51
51
  });
52
52
  const DAY_RANGE_SIZE = 40;
53
53
  const weeksContainerHeight = (DAY_RANGE_SIZE + DAY_MARGIN * 2) * 6;
54
+ const warnInvalidCurrentMonthCalendarPosition = buildWarning(['The `currentMonthCalendarPosition` prop must be an integer between `1` and the amount of calendars rendered.', 'For example if you have 2 calendars rendered, it should be equal to either 1 or 2.']);
54
55
  const DayCalendarForRange = styled(DayCalendar)(({
55
56
  theme
56
57
  }) => ({
@@ -132,6 +133,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
132
133
  defaultRangePosition: inDefaultRangePosition,
133
134
  onRangePositionChange: inOnRangePositionChange,
134
135
  calendars,
136
+ currentMonthCalendarPosition = 1,
135
137
  components,
136
138
  componentsProps,
137
139
  slots: innerSlots,
@@ -361,9 +363,17 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
361
363
  const calendarMonths = React.useMemo(() => Array.from({
362
364
  length: calendars
363
365
  }).map((_, index) => index), [calendars]);
364
- const visibleMonths = React.useMemo(() => Array.from({
365
- length: calendars
366
- }).map((_, index) => utils.setMonth(calendarState.currentMonth, utils.getMonth(calendarState.currentMonth) + index)), [utils, calendarState.currentMonth, calendars]);
366
+ const visibleMonths = React.useMemo(() => {
367
+ if (process.env.NODE_ENV !== 'production') {
368
+ if (currentMonthCalendarPosition > calendars || currentMonthCalendarPosition < 1) {
369
+ warnInvalidCurrentMonthCalendarPosition();
370
+ }
371
+ }
372
+ const firstMonth = utils.addMonths(calendarState.currentMonth, 1 - currentMonthCalendarPosition);
373
+ return Array.from({
374
+ length: calendars
375
+ }).map((_, index) => utils.addMonths(firstMonth, index));
376
+ }, [utils, calendarState.currentMonth, calendars, currentMonthCalendarPosition]);
367
377
  const focusedMonth = React.useMemo(() => {
368
378
  var _visibleMonths$find;
369
379
  if (!autoFocus) {
@@ -477,6 +487,11 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
477
487
  * @deprecated Please use `slotProps`.
478
488
  */
479
489
  componentsProps: PropTypes.object,
490
+ /**
491
+ * Position the current month is rendered in.
492
+ * @default 1
493
+ */
494
+ currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
480
495
  /**
481
496
  * Formats the day of week displayed in the calendar header.
482
497
  * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
@@ -58,6 +58,11 @@ export interface ExportedDateRangeCalendarProps<TDate> extends ExportedDayCalend
58
58
  * @default 2
59
59
  */
60
60
  calendars?: 1 | 2 | 3;
61
+ /**
62
+ * Position the current month is rendered in.
63
+ * @default 1
64
+ */
65
+ currentMonthCalendarPosition?: 1 | 2 | 3;
61
66
  /**
62
67
  * If `true`, editing dates by dragging is disabled.
63
68
  * @default false
@@ -69,6 +69,11 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
69
69
  * @deprecated Please use `slotProps`.
70
70
  */
71
71
  componentsProps: PropTypes.object,
72
+ /**
73
+ * Position the current month is rendered in.
74
+ * @default 1
75
+ */
76
+ currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
72
77
  /**
73
78
  * Formats the day of week displayed in the calendar header.
74
79
  * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
@@ -84,6 +84,11 @@ DesktopDateRangePicker.propTypes = {
84
84
  * @deprecated Please use `slotProps`.
85
85
  */
86
86
  componentsProps: PropTypes.object,
87
+ /**
88
+ * Position the current month is rendered in.
89
+ * @default 1
90
+ */
91
+ currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
87
92
  /**
88
93
  * Formats the day of week displayed in the calendar header.
89
94
  * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
@@ -87,6 +87,11 @@ MobileDateRangePicker.propTypes = {
87
87
  * @deprecated Please use `slotProps`.
88
88
  */
89
89
  componentsProps: PropTypes.object,
90
+ /**
91
+ * Position the current month is rendered in.
92
+ * @default 1
93
+ */
94
+ currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
90
95
  /**
91
96
  * Formats the day of week displayed in the calendar header.
92
97
  * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
@@ -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", "shouldRespectLeadingZeros", "onChange", "readOnly", "disabled", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "autoFocus"],
3
+ const _excluded = ["slots", "slotProps", "components", "componentsProps", "disabled", "autoFocus", "unstableStartFieldRef", "unstableEndFieldRef"],
4
4
  _excluded2 = ["onKeyDown", "ref", "readOnly", "inputMode"],
5
5
  _excluded3 = ["onKeyDown", "ref", "readOnly", "inputMode"];
6
6
  import * as React from 'react';
@@ -10,7 +10,7 @@ import MuiTextField from '@mui/material/TextField';
10
10
  import Typography from '@mui/material/Typography';
11
11
  import { styled, useThemeProps } from '@mui/material/styles';
12
12
  import { useSlotProps } from '@mui/base/utils';
13
- import { uncapitalizeObjectKeys } from '@mui/x-date-pickers/internals';
13
+ import { splitFieldInternalAndForwardedProps, uncapitalizeObjectKeys } from '@mui/x-date-pickers/internals';
14
14
  import { useMultiInputDateRangeField } from '../internal/hooks/useMultiInputRangeField/useMultiInputDateRangeField';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -40,30 +40,21 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
40
40
  props: inProps,
41
41
  name: 'MuiMultiInputDateRangeField'
42
42
  });
43
+ const {
44
+ internalProps: dateFieldInternalProps,
45
+ forwardedProps
46
+ } = splitFieldInternalAndForwardedProps(themeProps, 'date');
43
47
  const {
44
48
  slots: innerSlots,
45
49
  slotProps: innerSlotProps,
46
50
  components,
47
51
  componentsProps,
48
- value,
49
- defaultValue,
50
- format,
51
- formatDensity,
52
- shouldRespectLeadingZeros,
53
- onChange,
54
- readOnly,
55
52
  disabled,
56
- onError,
57
- shouldDisableDate,
58
- minDate,
59
- maxDate,
60
- disableFuture,
61
- disablePast,
62
- selectedSections,
63
- onSelectedSectionsChange,
64
- autoFocus
65
- } = themeProps,
66
- other = _objectWithoutPropertiesLoose(themeProps, _excluded);
53
+ autoFocus,
54
+ unstableStartFieldRef,
55
+ unstableEndFieldRef
56
+ } = forwardedProps,
57
+ otherForwardedProps = _objectWithoutPropertiesLoose(forwardedProps, _excluded);
67
58
  const slots = innerSlots != null ? innerSlots : uncapitalizeObjectKeys(components);
68
59
  const slotProps = innerSlotProps != null ? innerSlotProps : componentsProps;
69
60
  const ownerState = themeProps;
@@ -71,7 +62,7 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
71
62
  const rootProps = useSlotProps({
72
63
  elementType: Root,
73
64
  externalSlotProps: slotProps == null ? void 0 : slotProps.root,
74
- externalForwardedProps: other,
65
+ externalForwardedProps: otherForwardedProps,
75
66
  additionalProps: {
76
67
  ref
77
68
  },
@@ -102,26 +93,13 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
102
93
  ownerState
103
94
  });
104
95
  const _useMultiInputDateRan = useMultiInputDateRangeField({
105
- sharedProps: {
106
- value,
107
- defaultValue,
108
- format,
109
- formatDensity,
110
- shouldRespectLeadingZeros,
111
- onChange,
112
- readOnly,
113
- disabled,
114
- onError,
115
- shouldDisableDate,
116
- minDate,
117
- maxDate,
118
- disableFuture,
119
- disablePast,
120
- selectedSections,
121
- onSelectedSectionsChange
122
- },
96
+ sharedProps: _extends({}, dateFieldInternalProps, {
97
+ disabled
98
+ }),
123
99
  startTextFieldProps,
124
100
  endTextFieldProps,
101
+ unstableStartFieldRef,
102
+ unstableEndFieldRef,
125
103
  startInputRef: startTextFieldProps.inputRef,
126
104
  endInputRef: endTextFieldProps.inputRef
127
105
  }),
@@ -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", "shouldRespectLeadingZeros", "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", "disabled", "autoFocus", "unstableStartFieldRef", "unstableEndFieldRef"],
4
4
  _excluded2 = ["onKeyDown", "ref", "readOnly", "inputMode"],
5
5
  _excluded3 = ["onKeyDown", "ref", "readOnly", "inputMode"];
6
6
  import * as React from 'react';
@@ -10,7 +10,7 @@ import MuiTextField from '@mui/material/TextField';
10
10
  import Typography from '@mui/material/Typography';
11
11
  import { styled, useThemeProps } from '@mui/material/styles';
12
12
  import { useSlotProps } from '@mui/base/utils';
13
- import { uncapitalizeObjectKeys } from '@mui/x-date-pickers/internals';
13
+ import { splitFieldInternalAndForwardedProps, uncapitalizeObjectKeys } from '@mui/x-date-pickers/internals';
14
14
  import { useMultiInputDateTimeRangeField } from '../internal/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -40,39 +40,21 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
40
40
  props: inProps,
41
41
  name: 'MuiMultiInputDateTimeRangeField'
42
42
  });
43
+ const {
44
+ internalProps: dateTimeFieldInternalProps,
45
+ forwardedProps
46
+ } = splitFieldInternalAndForwardedProps(themeProps, 'date-time');
43
47
  const {
44
48
  slots: innerSlots,
45
49
  slotProps: innerSlotProps,
46
50
  components,
47
51
  componentsProps,
48
- value,
49
- defaultValue,
50
- format,
51
- formatDensity,
52
- shouldRespectLeadingZeros,
53
- onChange,
54
- readOnly,
55
52
  disabled,
56
- onError,
57
- shouldDisableDate,
58
- minDate,
59
- maxDate,
60
- minTime,
61
- maxTime,
62
- minDateTime,
63
- maxDateTime,
64
- minutesStep,
65
- shouldDisableClock,
66
- shouldDisableTime,
67
- disableFuture,
68
- disablePast,
69
- selectedSections,
70
- onSelectedSectionsChange,
53
+ autoFocus,
71
54
  unstableStartFieldRef,
72
- unstableEndFieldRef,
73
- autoFocus
74
- } = themeProps,
75
- other = _objectWithoutPropertiesLoose(themeProps, _excluded);
55
+ unstableEndFieldRef
56
+ } = forwardedProps,
57
+ otherForwardedProps = _objectWithoutPropertiesLoose(forwardedProps, _excluded);
76
58
  const slots = innerSlots != null ? innerSlots : uncapitalizeObjectKeys(components);
77
59
  const slotProps = innerSlotProps != null ? innerSlotProps : componentsProps;
78
60
  const ownerState = themeProps;
@@ -80,7 +62,7 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
80
62
  const rootProps = useSlotProps({
81
63
  elementType: Root,
82
64
  externalSlotProps: slotProps == null ? void 0 : slotProps.root,
83
- externalForwardedProps: other,
65
+ externalForwardedProps: otherForwardedProps,
84
66
  additionalProps: {
85
67
  ref
86
68
  },
@@ -111,31 +93,9 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
111
93
  ownerState
112
94
  });
113
95
  const _useMultiInputDateTim = useMultiInputDateTimeRangeField({
114
- sharedProps: {
115
- value,
116
- defaultValue,
117
- format,
118
- formatDensity,
119
- shouldRespectLeadingZeros,
120
- onChange,
121
- readOnly,
122
- disabled,
123
- onError,
124
- shouldDisableDate,
125
- minDate,
126
- maxDate,
127
- minTime,
128
- maxTime,
129
- minDateTime,
130
- maxDateTime,
131
- minutesStep,
132
- shouldDisableClock,
133
- shouldDisableTime,
134
- disableFuture,
135
- disablePast,
136
- selectedSections,
137
- onSelectedSectionsChange
138
- },
96
+ sharedProps: _extends({}, dateTimeFieldInternalProps, {
97
+ disabled
98
+ }),
139
99
  startTextFieldProps,
140
100
  endTextFieldProps,
141
101
  startInputRef: startTextFieldProps.inputRef,
@@ -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", "shouldRespectLeadingZeros", "onChange", "readOnly", "disabled", "onError", "minTime", "maxTime", "minutesStep", "shouldDisableClock", "shouldDisableTime", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableStartFieldRef", "unstableEndFieldRef", "autoFocus"],
3
+ const _excluded = ["slots", "slotProps", "components", "componentsProps", "disabled", "autoFocus", "unstableStartFieldRef", "unstableEndFieldRef"],
4
4
  _excluded2 = ["onKeyDown", "ref", "readOnly", "inputMode"],
5
5
  _excluded3 = ["onKeyDown", "ref", "readOnly", "inputMode"];
6
6
  import * as React from 'react';
@@ -10,7 +10,7 @@ import MuiTextField from '@mui/material/TextField';
10
10
  import Typography from '@mui/material/Typography';
11
11
  import { styled, useThemeProps } from '@mui/material/styles';
12
12
  import { useSlotProps } from '@mui/base/utils';
13
- import { uncapitalizeObjectKeys } from '@mui/x-date-pickers/internals';
13
+ import { splitFieldInternalAndForwardedProps, uncapitalizeObjectKeys } from '@mui/x-date-pickers/internals';
14
14
  import { useMultiInputTimeRangeField } from '../internal/hooks/useMultiInputRangeField/useMultiInputTimeRangeField';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -40,34 +40,21 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
40
40
  props: inProps,
41
41
  name: 'MuiMultiInputTimeRangeField'
42
42
  });
43
+ const {
44
+ internalProps: timeFieldInternalProps,
45
+ forwardedProps
46
+ } = splitFieldInternalAndForwardedProps(themeProps, 'time');
43
47
  const {
44
48
  slots: innerSlots,
45
49
  slotProps: innerSlotProps,
46
50
  components,
47
51
  componentsProps,
48
- value,
49
- defaultValue,
50
- format,
51
- formatDensity,
52
- shouldRespectLeadingZeros,
53
- onChange,
54
- readOnly,
55
52
  disabled,
56
- onError,
57
- minTime,
58
- maxTime,
59
- minutesStep,
60
- shouldDisableClock,
61
- shouldDisableTime,
62
- disableFuture,
63
- disablePast,
64
- selectedSections,
65
- onSelectedSectionsChange,
53
+ autoFocus,
66
54
  unstableStartFieldRef,
67
- unstableEndFieldRef,
68
- autoFocus
69
- } = themeProps,
70
- other = _objectWithoutPropertiesLoose(themeProps, _excluded);
55
+ unstableEndFieldRef
56
+ } = forwardedProps,
57
+ otherForwardedProps = _objectWithoutPropertiesLoose(forwardedProps, _excluded);
71
58
  const slots = innerSlots != null ? innerSlots : uncapitalizeObjectKeys(components);
72
59
  const slotProps = innerSlotProps != null ? innerSlotProps : componentsProps;
73
60
  const ownerState = themeProps;
@@ -75,7 +62,7 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
75
62
  const rootProps = useSlotProps({
76
63
  elementType: Root,
77
64
  externalSlotProps: slotProps == null ? void 0 : slotProps.root,
78
- externalForwardedProps: other,
65
+ externalForwardedProps: otherForwardedProps,
79
66
  additionalProps: {
80
67
  ref
81
68
  },
@@ -106,26 +93,9 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
106
93
  ownerState
107
94
  });
108
95
  const _useMultiInputTimeRan = useMultiInputTimeRangeField({
109
- sharedProps: {
110
- value,
111
- defaultValue,
112
- format,
113
- formatDensity,
114
- shouldRespectLeadingZeros,
115
- onChange,
116
- readOnly,
117
- disabled,
118
- onError,
119
- minTime,
120
- maxTime,
121
- minutesStep,
122
- shouldDisableClock,
123
- shouldDisableTime,
124
- disableFuture,
125
- disablePast,
126
- selectedSections,
127
- onSelectedSectionsChange
128
- },
96
+ sharedProps: _extends({}, timeFieldInternalProps, {
97
+ disabled
98
+ }),
129
99
  startTextFieldProps,
130
100
  endTextFieldProps,
131
101
  startInputRef: startTextFieldProps.inputRef,
@@ -1,3 +1,3 @@
1
1
  import { UseSingleInputDateRangeFieldDefaultizedProps, UseSingleInputDateRangeFieldParams, UseSingleInputDateRangeFieldProps } from './SingleInputDateRangeField.types';
2
2
  export declare const useDefaultizedDateRangeFieldProps: <TDate, AdditionalProps extends {}>(props: UseSingleInputDateRangeFieldProps<TDate>) => UseSingleInputDateRangeFieldDefaultizedProps<TDate, AdditionalProps>;
3
- export declare const useSingleInputDateRangeField: <TDate, TChildProps extends {}>({ props, inputRef, }: UseSingleInputDateRangeFieldParams<TDate, TChildProps>) => import("@mui/x-date-pickers/internals").UseFieldResponse<Omit<TChildProps, keyof UseSingleInputDateRangeFieldProps<TDate>>>;
3
+ export declare const useSingleInputDateRangeField: <TDate, TChildProps extends {}>({ props: inProps, inputRef, }: UseSingleInputDateRangeFieldParams<TDate, TChildProps>) => import("@mui/x-date-pickers/internals").UseFieldResponse<Omit<UseSingleInputDateRangeFieldDefaultizedProps<TDate, TChildProps>, keyof UseSingleInputDateRangeFieldProps<any>>>;
@@ -1,7 +1,5 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
1
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["value", "defaultValue", "format", "formatDensity", "shouldRespectLeadingZeros", "onChange", "readOnly", "onError", "shouldDisableDate", "minDate", "maxDate", "disableFuture", "disablePast", "selectedSections", "onSelectedSectionsChange", "unstableFieldRef"];
4
- import { useUtils, useDefaultDates, applyDefaultDate, useField } from '@mui/x-date-pickers/internals';
2
+ import { useUtils, useDefaultDates, applyDefaultDate, useField, splitFieldInternalAndForwardedProps } from '@mui/x-date-pickers/internals';
5
3
  import { rangeValueManager, rangeFieldValueManager } from '../internal/utils/valueManagers';
6
4
  import { validateDateRange } from '../internal/utils/validation/validateDateRange';
7
5
  export const useDefaultizedDateRangeFieldProps = props => {
@@ -17,50 +15,18 @@ export const useDefaultizedDateRangeFieldProps = props => {
17
15
  });
18
16
  };
19
17
  export const useSingleInputDateRangeField = ({
20
- props,
18
+ props: inProps,
21
19
  inputRef
22
20
  }) => {
23
- const _useDefaultizedDateRa = useDefaultizedDateRangeFieldProps(props),
24
- {
25
- value,
26
- defaultValue,
27
- format,
28
- formatDensity,
29
- shouldRespectLeadingZeros,
30
- onChange,
31
- readOnly,
32
- onError,
33
- shouldDisableDate,
34
- minDate,
35
- maxDate,
36
- disableFuture,
37
- disablePast,
38
- selectedSections,
39
- onSelectedSectionsChange,
40
- unstableFieldRef
41
- } = _useDefaultizedDateRa,
42
- other = _objectWithoutPropertiesLoose(_useDefaultizedDateRa, _excluded);
21
+ const props = useDefaultizedDateRangeFieldProps(inProps);
22
+ const {
23
+ forwardedProps,
24
+ internalProps
25
+ } = splitFieldInternalAndForwardedProps(props, 'date');
43
26
  return useField({
44
27
  inputRef,
45
- forwardedProps: other,
46
- internalProps: {
47
- value,
48
- defaultValue,
49
- format,
50
- formatDensity,
51
- shouldRespectLeadingZeros,
52
- onChange,
53
- readOnly,
54
- onError,
55
- shouldDisableDate,
56
- minDate,
57
- maxDate,
58
- disableFuture,
59
- disablePast,
60
- selectedSections,
61
- onSelectedSectionsChange,
62
- unstableFieldRef
63
- },
28
+ forwardedProps,
29
+ internalProps,
64
30
  valueManager: rangeValueManager,
65
31
  fieldValueManager: rangeFieldValueManager,
66
32
  validator: validateDateRange,
@@ -1,3 +1,3 @@
1
1
  import { UseSingleInputDateTimeRangeFieldDefaultizedProps, UseSingleInputDateTimeRangeFieldParams, UseSingleInputDateTimeRangeFieldProps } from './SingleInputDateTimeRangeField.types';
2
2
  export declare const useDefaultizedTimeRangeFieldProps: <TDate, AdditionalProps extends {}>(props: UseSingleInputDateTimeRangeFieldProps<TDate>) => UseSingleInputDateTimeRangeFieldDefaultizedProps<TDate, AdditionalProps>;
3
- export declare const useSingleInputDateTimeRangeField: <TDate, TChildProps extends {}>({ props, inputRef, }: UseSingleInputDateTimeRangeFieldParams<TDate, TChildProps>) => import("@mui/x-date-pickers/internals").UseFieldResponse<Omit<TChildProps, keyof UseSingleInputDateTimeRangeFieldProps<TDate>>>;
3
+ export declare const useSingleInputDateTimeRangeField: <TDate, TChildProps extends {}>({ props: inProps, inputRef, }: UseSingleInputDateTimeRangeFieldParams<TDate, TChildProps>) => import("@mui/x-date-pickers/internals").UseFieldResponse<Omit<UseSingleInputDateTimeRangeFieldDefaultizedProps<TDate, TChildProps>, keyof UseSingleInputDateTimeRangeFieldProps<any>>>;
@@ -1,7 +1,5 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
1
  import _extends from "@babel/runtime/helpers/esm/extends";
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
- import { useUtils, useField, applyDefaultDate, useDefaultDates } from '@mui/x-date-pickers/internals';
2
+ import { useUtils, useField, applyDefaultDate, useDefaultDates, splitFieldInternalAndForwardedProps } from '@mui/x-date-pickers/internals';
5
3
  import { rangeValueManager, rangeFieldValueManager } from '../internal/utils/valueManagers';
6
4
  import { validateDateTimeRange } from '../internal/utils/validation/validateDateTimeRange';
7
5
  export const useDefaultizedTimeRangeFieldProps = props => {
@@ -22,60 +20,18 @@ export const useDefaultizedTimeRangeFieldProps = props => {
22
20
  });
23
21
  };
24
22
  export const useSingleInputDateTimeRangeField = ({
25
- props,
23
+ props: inProps,
26
24
  inputRef
27
25
  }) => {
28
- const _useDefaultizedTimeRa = useDefaultizedTimeRangeFieldProps(props),
29
- {
30
- value,
31
- defaultValue,
32
- format,
33
- formatDensity,
34
- shouldRespectLeadingZeros,
35
- onChange,
36
- readOnly,
37
- onError,
38
- shouldDisableDate,
39
- minDate,
40
- maxDate,
41
- disableFuture,
42
- disablePast,
43
- minTime,
44
- maxTime,
45
- minutesStep,
46
- shouldDisableTime,
47
- disableIgnoringDatePartForTimeValidation,
48
- selectedSections,
49
- onSelectedSectionsChange,
50
- unstableFieldRef
51
- } = _useDefaultizedTimeRa,
52
- other = _objectWithoutPropertiesLoose(_useDefaultizedTimeRa, _excluded);
26
+ const props = useDefaultizedTimeRangeFieldProps(inProps);
27
+ const {
28
+ forwardedProps,
29
+ internalProps
30
+ } = splitFieldInternalAndForwardedProps(props, 'date-time');
53
31
  return useField({
54
32
  inputRef,
55
- forwardedProps: other,
56
- internalProps: {
57
- value,
58
- defaultValue,
59
- format,
60
- formatDensity,
61
- shouldRespectLeadingZeros,
62
- onChange,
63
- readOnly,
64
- onError,
65
- shouldDisableDate,
66
- minDate,
67
- maxDate,
68
- disableFuture,
69
- disablePast,
70
- minTime,
71
- maxTime,
72
- minutesStep,
73
- shouldDisableTime,
74
- disableIgnoringDatePartForTimeValidation,
75
- selectedSections,
76
- onSelectedSectionsChange,
77
- unstableFieldRef
78
- },
33
+ forwardedProps,
34
+ internalProps,
79
35
  valueManager: rangeValueManager,
80
36
  fieldValueManager: rangeFieldValueManager,
81
37
  validator: validateDateTimeRange,
@@ -1,3 +1,3 @@
1
1
  import { UseSingleInputTimeRangeFieldDefaultizedProps, UseSingleInputTimeRangeFieldParams, UseSingleInputTimeRangeFieldProps } from './SingleInputTimeRangeField.types';
2
2
  export declare const useDefaultizedTimeRangeFieldProps: <TDate, AdditionalProps extends {}>(props: UseSingleInputTimeRangeFieldProps<TDate>) => UseSingleInputTimeRangeFieldDefaultizedProps<TDate, AdditionalProps>;
3
- export declare const useSingleInputTimeRangeField: <TDate, TChildProps extends {}>({ props, inputRef, }: UseSingleInputTimeRangeFieldParams<TDate, TChildProps>) => import("@mui/x-date-pickers/internals").UseFieldResponse<Omit<TChildProps, keyof UseSingleInputTimeRangeFieldProps<TDate>>>;
3
+ export declare const useSingleInputTimeRangeField: <TDate, TChildProps extends {}>({ props: inProps, inputRef, }: UseSingleInputTimeRangeFieldParams<TDate, TChildProps>) => import("@mui/x-date-pickers/internals").UseFieldResponse<Omit<UseSingleInputTimeRangeFieldDefaultizedProps<TDate, TChildProps>, keyof UseSingleInputTimeRangeFieldProps<any>>>;