@mui/x-date-pickers-pro 7.0.0-alpha.8 → 7.0.0-beta.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 (187) hide show
  1. package/CHANGELOG.md +508 -30
  2. package/DateRangeCalendar/DateRangeCalendar.js +79 -13
  3. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +15 -14
  4. package/DateRangePicker/DateRangePicker.js +0 -3
  5. package/DateRangePicker/DateRangePickerToolbar.js +0 -3
  6. package/DateTimeRangePicker/DateTimeRangePicker.d.ts +7 -0
  7. package/DateTimeRangePicker/DateTimeRangePicker.js +414 -0
  8. package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +24 -0
  9. package/DateTimeRangePicker/DateTimeRangePicker.types.js +1 -0
  10. package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +32 -0
  11. package/DateTimeRangePicker/DateTimeRangePickerTabs.js +183 -0
  12. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +20 -0
  13. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +59 -0
  14. package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +15 -0
  15. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +176 -0
  16. package/DateTimeRangePicker/dateTimeRangePickerTabsClasses.d.ts +13 -0
  17. package/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +6 -0
  18. package/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.d.ts +11 -0
  19. package/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +5 -0
  20. package/DateTimeRangePicker/index.d.ts +10 -0
  21. package/DateTimeRangePicker/index.js +5 -0
  22. package/DateTimeRangePicker/package.json +6 -0
  23. package/DateTimeRangePicker/shared.d.ts +60 -0
  24. package/DateTimeRangePicker/shared.js +56 -0
  25. package/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
  26. package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +1 -1
  27. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +7 -0
  28. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +491 -0
  29. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +25 -0
  30. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +1 -0
  31. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.d.ts +8 -0
  32. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +52 -0
  33. package/DesktopDateTimeRangePicker/index.d.ts +2 -0
  34. package/DesktopDateTimeRangePicker/index.js +1 -0
  35. package/DesktopDateTimeRangePicker/package.json +6 -0
  36. package/MobileDateRangePicker/MobileDateRangePicker.js +1 -8
  37. package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +1 -6
  38. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +7 -0
  39. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +490 -0
  40. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +20 -0
  41. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +1 -0
  42. package/MobileDateTimeRangePicker/index.d.ts +2 -0
  43. package/MobileDateTimeRangePicker/index.js +1 -0
  44. package/MobileDateTimeRangePicker/package.json +6 -0
  45. package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +2 -5
  46. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +2 -5
  47. package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +2 -5
  48. package/README.md +3 -3
  49. package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +2 -1
  50. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +2 -1
  51. package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +2 -1
  52. package/StaticDateRangePicker/StaticDateRangePicker.js +1 -4
  53. package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +5 -0
  54. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -4
  55. package/dateRangeViewRenderers/dateRangeViewRenderers.js +10 -2
  56. package/index.d.ts +3 -0
  57. package/index.js +4 -1
  58. package/internals/constants/dimensions.d.ts +3 -0
  59. package/internals/constants/dimensions.js +5 -0
  60. package/internals/hooks/models/index.d.ts +1 -0
  61. package/internals/hooks/models/index.js +1 -0
  62. package/internals/hooks/models/useRangePicker.d.ts +21 -0
  63. package/internals/hooks/models/useRangePicker.js +1 -0
  64. package/internals/hooks/useDesktopRangePicker/index.d.ts +1 -1
  65. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +17 -3
  66. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +8 -14
  67. package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +5 -2
  68. package/internals/hooks/useEnrichedRangePickerFieldProps.js +41 -11
  69. package/internals/hooks/useMobileRangePicker/index.d.ts +1 -1
  70. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -0
  71. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +8 -14
  72. package/internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types.d.ts +2 -6
  73. package/internals/models/dateTimeRange.d.ts +3 -1
  74. package/internals/models/fields.d.ts +7 -2
  75. package/internals/utils/date-range-manager.d.ts +2 -1
  76. package/internals/utils/date-range-manager.js +12 -1
  77. package/internals/utils/releaseInfo.js +1 -1
  78. package/internals/utils/valueManagers.js +4 -4
  79. package/legacy/DateRangeCalendar/DateRangeCalendar.js +77 -12
  80. package/legacy/DateRangePicker/DateRangePicker.js +0 -3
  81. package/legacy/DateRangePicker/DateRangePickerToolbar.js +0 -3
  82. package/legacy/DateTimeRangePicker/DateTimeRangePicker.js +413 -0
  83. package/legacy/DateTimeRangePicker/DateTimeRangePicker.types.js +1 -0
  84. package/legacy/DateTimeRangePicker/DateTimeRangePickerTabs.js +191 -0
  85. package/legacy/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +57 -0
  86. package/legacy/DateTimeRangePicker/DateTimeRangePickerToolbar.js +184 -0
  87. package/legacy/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +6 -0
  88. package/legacy/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +5 -0
  89. package/legacy/DateTimeRangePicker/index.js +5 -0
  90. package/legacy/DateTimeRangePicker/shared.js +54 -0
  91. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
  92. package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +491 -0
  93. package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +1 -0
  94. package/legacy/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +48 -0
  95. package/legacy/DesktopDateTimeRangePicker/index.js +1 -0
  96. package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +1 -8
  97. package/legacy/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +484 -0
  98. package/legacy/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +1 -0
  99. package/legacy/MobileDateTimeRangePicker/index.js +1 -0
  100. package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +1 -4
  101. package/legacy/dateRangeViewRenderers/dateRangeViewRenderers.js +10 -2
  102. package/legacy/index.js +4 -1
  103. package/legacy/internals/constants/dimensions.js +5 -0
  104. package/legacy/internals/hooks/models/index.js +1 -0
  105. package/legacy/internals/hooks/models/useRangePicker.js +1 -0
  106. package/legacy/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +17 -3
  107. package/legacy/internals/hooks/useEnrichedRangePickerFieldProps.js +43 -11
  108. package/legacy/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -0
  109. package/legacy/internals/utils/date-range-manager.js +13 -1
  110. package/legacy/internals/utils/releaseInfo.js +1 -1
  111. package/legacy/internals/utils/valueManagers.js +4 -4
  112. package/legacy/locales/index.js +1 -0
  113. package/locales/index.d.ts +1 -0
  114. package/locales/index.js +1 -0
  115. package/locales/package.json +6 -0
  116. package/modern/DateRangeCalendar/DateRangeCalendar.js +78 -12
  117. package/modern/DateRangePicker/DateRangePicker.js +0 -3
  118. package/modern/DateRangePicker/DateRangePickerToolbar.js +0 -3
  119. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +414 -0
  120. package/modern/DateTimeRangePicker/DateTimeRangePicker.types.js +1 -0
  121. package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +183 -0
  122. package/modern/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +58 -0
  123. package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +176 -0
  124. package/modern/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +6 -0
  125. package/modern/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +5 -0
  126. package/modern/DateTimeRangePicker/index.js +5 -0
  127. package/modern/DateTimeRangePicker/shared.js +55 -0
  128. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
  129. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +483 -0
  130. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +1 -0
  131. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +51 -0
  132. package/modern/DesktopDateTimeRangePicker/index.js +1 -0
  133. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +1 -8
  134. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +486 -0
  135. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +1 -0
  136. package/modern/MobileDateTimeRangePicker/index.js +1 -0
  137. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +1 -4
  138. package/modern/dateRangeViewRenderers/dateRangeViewRenderers.js +10 -2
  139. package/modern/index.js +4 -1
  140. package/modern/internals/constants/dimensions.js +5 -0
  141. package/modern/internals/hooks/models/index.js +1 -0
  142. package/modern/internals/hooks/models/useRangePicker.js +1 -0
  143. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +16 -2
  144. package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +40 -9
  145. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -0
  146. package/modern/internals/utils/date-range-manager.js +12 -1
  147. package/modern/internals/utils/releaseInfo.js +1 -1
  148. package/modern/internals/utils/valueManagers.js +4 -4
  149. package/modern/locales/index.js +1 -0
  150. package/node/DateRangeCalendar/DateRangeCalendar.js +78 -12
  151. package/node/DateRangePicker/DateRangePicker.js +0 -3
  152. package/node/DateRangePicker/DateRangePickerToolbar.js +0 -3
  153. package/node/DateTimeRangePicker/DateTimeRangePicker.js +422 -0
  154. package/node/DateTimeRangePicker/DateTimeRangePicker.types.js +5 -0
  155. package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +190 -0
  156. package/node/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.js +64 -0
  157. package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +183 -0
  158. package/node/DateTimeRangePicker/dateTimeRangePickerTabsClasses.js +14 -0
  159. package/node/DateTimeRangePicker/dateTimeRangePickerToolbarClasses.js +12 -0
  160. package/node/DateTimeRangePicker/index.js +52 -0
  161. package/node/DateTimeRangePicker/shared.js +62 -0
  162. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +0 -3
  163. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +490 -0
  164. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.js +5 -0
  165. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePickerLayout.js +59 -0
  166. package/node/DesktopDateTimeRangePicker/index.js +12 -0
  167. package/node/MobileDateRangePicker/MobileDateRangePicker.js +1 -8
  168. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +494 -0
  169. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.js +5 -0
  170. package/node/MobileDateTimeRangePicker/index.js +12 -0
  171. package/node/StaticDateRangePicker/StaticDateRangePicker.js +1 -4
  172. package/node/dateRangeViewRenderers/dateRangeViewRenderers.js +10 -2
  173. package/node/index.js +37 -1
  174. package/node/internals/constants/dimensions.js +16 -0
  175. package/node/internals/hooks/models/index.js +5 -0
  176. package/node/internals/hooks/models/useRangePicker.js +5 -0
  177. package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +16 -2
  178. package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +40 -9
  179. package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +4 -0
  180. package/node/internals/utils/date-range-manager.js +12 -1
  181. package/node/internals/utils/releaseInfo.js +1 -1
  182. package/node/internals/utils/valueManagers.js +4 -4
  183. package/node/locales/index.js +16 -0
  184. package/package.json +9 -9
  185. package/themeAugmentation/components.d.ts +22 -3
  186. package/themeAugmentation/overrides.d.ts +7 -0
  187. package/themeAugmentation/props.d.ts +12 -0
@@ -29,21 +29,37 @@ const useMultiInputFieldSlotProps = ({
29
29
  pickerSlotProps,
30
30
  pickerSlots,
31
31
  fieldProps,
32
- anchorRef
32
+ anchorRef,
33
+ currentView,
34
+ initialView,
35
+ onViewChange
33
36
  }) => {
34
37
  const localeText = (0, _internals.useLocaleText)();
35
38
  const startRef = React.useRef(null);
36
39
  const endRef = React.useRef(null);
40
+ const startFieldRef = React.useRef(null);
41
+ const endFieldRef = React.useRef(null);
42
+ const handleStartFieldRef = (0, _useForkRef.default)(fieldProps.unstableStartFieldRef, startFieldRef);
43
+ const handleEndFieldRef = (0, _useForkRef.default)(fieldProps.unstableFieldRef, endFieldRef);
44
+ const previousRangePosition = React.useRef(rangePosition);
37
45
  React.useEffect(() => {
38
46
  if (!open) {
39
47
  return;
40
48
  }
41
- if (rangePosition === 'start') {
42
- startRef.current?.focus();
43
- } else if (rangePosition === 'end') {
44
- endRef.current?.focus();
49
+ const currentRef = rangePosition === 'start' ? startRef : endRef;
50
+ currentRef.current?.focus();
51
+ const currentFieldRef = rangePosition === 'start' ? startFieldRef : endFieldRef;
52
+ if (!currentFieldRef.current || !currentView) {
53
+ // could happen when the user is switching between the inputs
54
+ previousRangePosition.current = rangePosition;
55
+ return;
45
56
  }
46
- }, [rangePosition, open]);
57
+ // bring back focus to the field
58
+ currentFieldRef.current.setSelectedSections(
59
+ // use the current view or `0` when the range position has just been swapped
60
+ previousRangePosition.current === rangePosition ? currentView : 0);
61
+ previousRangePosition.current = rangePosition;
62
+ }, [rangePosition, open, currentView]);
47
63
  const openRangeStartSelection = event => {
48
64
  event.stopPropagation();
49
65
  onRangePositionChange('start');
@@ -61,11 +77,17 @@ const useMultiInputFieldSlotProps = ({
61
77
  const handleFocusStart = () => {
62
78
  if (open) {
63
79
  onRangePositionChange('start');
80
+ if (previousRangePosition.current !== 'start' && initialView) {
81
+ onViewChange?.(initialView);
82
+ }
64
83
  }
65
84
  };
66
85
  const handleFocusEnd = () => {
67
86
  if (open) {
68
87
  onRangePositionChange('end');
88
+ if (previousRangePosition.current !== 'end' && initialView) {
89
+ onViewChange?.(initialView);
90
+ }
69
91
  }
70
92
  };
71
93
  const slots = (0, _extends2.default)({
@@ -128,7 +150,9 @@ const useMultiInputFieldSlotProps = ({
128
150
  const restFieldProps = (0, _objectWithoutPropertiesLoose2.default)(fieldProps, _excluded);
129
151
  const enrichedFieldProps = (0, _extends2.default)({}, restFieldProps, {
130
152
  slots,
131
- slotProps
153
+ slotProps,
154
+ unstableStartFieldRef: handleStartFieldRef,
155
+ unstableEndFieldRef: handleEndFieldRef
132
156
  });
133
157
  return enrichedFieldProps;
134
158
  };
@@ -148,7 +172,8 @@ const useSingleInputFieldSlotProps = ({
148
172
  pickerSlots,
149
173
  pickerSlotProps,
150
174
  fieldProps,
151
- anchorRef
175
+ anchorRef,
176
+ currentView
152
177
  }) => {
153
178
  const inputRef = React.useRef(null);
154
179
  const handleInputRef = (0, _useForkRef.default)(inInputRef, inputRef);
@@ -158,7 +183,13 @@ const useSingleInputFieldSlotProps = ({
158
183
  return;
159
184
  }
160
185
  inputRef.current?.focus();
161
- }, [rangePosition, open]);
186
+ if (!singleInputFieldRef.current || !currentView) {
187
+ return;
188
+ }
189
+ const sections = singleInputFieldRef.current.getSections().map(section => section.type);
190
+ // bring back focus to the field with the current view section selected
191
+ singleInputFieldRef.current.setSelectedSections(rangePosition === 'start' ? sections.indexOf(currentView) : sections.lastIndexOf(currentView));
192
+ }, [rangePosition, open, currentView, singleInputFieldRef]);
162
193
  const updateRangePosition = () => {
163
194
  if (!singleInputFieldRef.current || inputRef.current !== (0, _internals.getActiveElement)(document)) {
164
195
  return;
@@ -104,6 +104,10 @@ const useMobileRangePicker = _ref => {
104
104
  fieldProps
105
105
  });
106
106
  const slotPropsForLayout = (0, _extends2.default)({}, innerSlotProps, {
107
+ tabs: (0, _extends2.default)({}, innerSlotProps?.tabs, {
108
+ rangePosition,
109
+ onRangePositionChange
110
+ }),
107
111
  toolbar: (0, _extends2.default)({}, innerSlotProps?.toolbar, {
108
112
  titleId: labelId,
109
113
  rangePosition,
@@ -5,14 +5,25 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.calculateRangeChange = calculateRangeChange;
7
7
  exports.calculateRangePreview = calculateRangePreview;
8
+ var _internals = require("@mui/x-date-pickers/internals");
8
9
  function calculateRangeChange({
9
10
  utils,
10
11
  range,
11
12
  newDate: selectedDate,
12
13
  rangePosition,
13
- allowRangeFlip = false
14
+ allowRangeFlip = false,
15
+ shouldMergeDateAndTime = false
14
16
  }) {
15
17
  const [start, end] = range;
18
+ if (shouldMergeDateAndTime && selectedDate) {
19
+ // If there is a date already selected, then we want to keep its time
20
+ if (start && rangePosition === 'start') {
21
+ selectedDate = (0, _internals.mergeDateAndTime)(utils, selectedDate, start);
22
+ }
23
+ if (end && rangePosition === 'end') {
24
+ selectedDate = (0, _internals.mergeDateAndTime)(utils, selectedDate, end);
25
+ }
26
+ }
16
27
  if (rangePosition === 'start') {
17
28
  const truthyResult = allowRangeFlip ? {
18
29
  nextSelection: 'start',
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getReleaseInfo = void 0;
7
7
  var _utils = require("@mui/utils");
8
8
  const getReleaseInfo = () => {
9
- const releaseInfo = "MTcwNDkyNzYwMDAwMA==";
9
+ const releaseInfo = "MTcwNjIyMDAwMDAwMA==";
10
10
  if (process.env.NODE_ENV !== 'production') {
11
11
  // A simple hack to set the value in the test environment (has no build step).
12
12
  // eslint-disable-next-line no-useless-concat
@@ -57,7 +57,7 @@ const rangeFieldValueManager = exports.rangeFieldValueManager = {
57
57
  }
58
58
  return [prevReferenceValue[1], value[1]];
59
59
  },
60
- getSectionsFromValue: (utils, [start, end], fallbackSections, isRTL, getSectionsFromDate) => {
60
+ getSectionsFromValue: (utils, [start, end], fallbackSections, localizedDigits, isRTL, getSectionsFromDate) => {
61
61
  const separatedFallbackSections = fallbackSections == null ? {
62
62
  startDate: null,
63
63
  endDate: null
@@ -80,11 +80,11 @@ const rangeFieldValueManager = exports.rangeFieldValueManager = {
80
80
  });
81
81
  });
82
82
  };
83
- return (0, _internals.addPositionPropertiesToSections)([...getSections(start, separatedFallbackSections.startDate, 'start'), ...getSections(end, separatedFallbackSections.endDate, 'end')], isRTL);
83
+ return (0, _internals.addPositionPropertiesToSections)([...getSections(start, separatedFallbackSections.startDate, 'start'), ...getSections(end, separatedFallbackSections.endDate, 'end')], localizedDigits, isRTL);
84
84
  },
85
- getValueStrFromSections: (sections, isRTL) => {
85
+ getValueStrFromSections: (sections, localizedDigits, isRTL) => {
86
86
  const dateRangeSections = (0, _dateFieldsUtils.splitDateRangeSections)(sections);
87
- return (0, _internals.createDateStrForInputFromSections)([...dateRangeSections.startDate, ...dateRangeSections.endDate], isRTL);
87
+ return (0, _internals.createDateStrForInputFromSections)([...dateRangeSections.startDate, ...dateRangeSections.endDate], localizedDigits, isRTL);
88
88
  },
89
89
  parseValueStr: (valueStr, referenceValue, parseDate) => {
90
90
  // TODO: Improve because it would not work if the date format has `–` as a separator.
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _locales = require("@mui/x-date-pickers/locales");
7
+ Object.keys(_locales).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _locales[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _locales[key];
14
+ }
15
+ });
16
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers-pro",
3
- "version": "7.0.0-alpha.8",
3
+ "version": "7.0.0-beta.0",
4
4
  "description": "The commercial edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -31,20 +31,20 @@
31
31
  "directory": "packages/x-date-pickers-pro"
32
32
  },
33
33
  "dependencies": {
34
- "@babel/runtime": "^7.23.7",
35
- "@mui/base": "^5.0.0-beta.29",
36
- "@mui/system": "^5.15.2",
37
- "@mui/utils": "^5.15.2",
38
- "@mui/x-date-pickers": "7.0.0-alpha.8",
39
- "@mui/x-license-pro": "7.0.0-alpha.8",
40
- "clsx": "^2.0.0",
34
+ "@babel/runtime": "^7.23.8",
35
+ "@mui/base": "^5.0.0-beta.33",
36
+ "@mui/system": "^5.15.6",
37
+ "@mui/utils": "^5.15.6",
38
+ "@mui/x-date-pickers": "7.0.0-beta.0",
39
+ "@mui/x-license-pro": "7.0.0-beta.0",
40
+ "clsx": "^2.1.0",
41
41
  "prop-types": "^15.8.1",
42
42
  "react-transition-group": "^4.4.5"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@emotion/react": "^11.9.0",
46
46
  "@emotion/styled": "^11.8.1",
47
- "@mui/material": "^5.8.6",
47
+ "@mui/material": "^5.15.0",
48
48
  "date-fns": "^2.25.0 || ^3.2.0",
49
49
  "date-fns-jalali": "^2.13.0-0",
50
50
  "dayjs": "^1.10.7",
@@ -9,23 +9,31 @@ export interface PickersProComponents<Theme = unknown> {
9
9
  defaultProps?: ComponentsProps['MuiDateRangePickerDay'];
10
10
  styleOverrides?: ComponentsOverrides<Theme>['MuiDateRangePickerDay'];
11
11
  };
12
+ MuiDateTimeRangePickerTabs?: {
13
+ defaultProps?: ComponentsProps['MuiDateTimeRangePickerTabs'];
14
+ styleOverrides?: ComponentsOverrides<Theme>['MuiDateTimeRangePickerTabs'];
15
+ };
12
16
  MuiDateRangePickerToolbar?: {
13
17
  defaultProps?: ComponentsProps['MuiDateRangePickerToolbar'];
14
18
  styleOverrides?: ComponentsOverrides<Theme>['MuiDateRangePickerToolbar'];
15
19
  };
20
+ MuiDateTimeRangePickerToolbar?: {
21
+ defaultProps?: ComponentsProps['MuiDateTimeRangePickerToolbar'];
22
+ styleOverrides?: ComponentsOverrides<Theme>['MuiDateTimeRangePickerToolbar'];
23
+ };
16
24
 
17
25
  // Multi input range fields
18
26
  MuiMultiInputDateRangeField?: {
19
27
  defaultProps?: ComponentsProps['MuiMultiInputDateRangeField'];
20
- styleOverrides?: ComponentsOverrides['MuiMultiInputDateRangeField'];
28
+ styleOverrides?: ComponentsOverrides<Theme>['MuiMultiInputDateRangeField'];
21
29
  };
22
30
  MuiMultiInputDateTimeRangeField?: {
23
31
  defaultProps?: ComponentsProps['MuiMultiInputDateTimeRangeField'];
24
- styleOverrides?: ComponentsOverrides['MuiMultiInputDateTimeRangeField'];
32
+ styleOverrides?: ComponentsOverrides<Theme>['MuiMultiInputDateTimeRangeField'];
25
33
  };
26
34
  MuiMultiInputTimeRangeField?: {
27
35
  defaultProps?: ComponentsProps['MuiMultiInputTimeRangeField'];
28
- styleOverrides?: ComponentsOverrides['MuiMultiInputTimeRangeField'];
36
+ styleOverrides?: ComponentsOverrides<Theme>['MuiMultiInputTimeRangeField'];
29
37
  };
30
38
 
31
39
  // Single input range fields
@@ -52,6 +60,17 @@ export interface PickersProComponents<Theme = unknown> {
52
60
  MuiStaticDateRangePicker?: {
53
61
  defaultProps?: ComponentsProps['MuiStaticDateRangePicker'];
54
62
  };
63
+
64
+ // Date Time Range Pickers
65
+ MuiDateTimeRangePicker?: {
66
+ defaultProps?: ComponentsProps['MuiDateTimeRangePicker'];
67
+ };
68
+ MuiDesktopDateTimeRangePicker?: {
69
+ defaultProps?: ComponentsProps['MuiDesktopDateTimeRangePicker'];
70
+ };
71
+ MuiMobileDateTimeRangePicker?: {
72
+ defaultProps?: ComponentsProps['MuiMobileDateTimeRangePicker'];
73
+ };
55
74
  }
56
75
 
57
76
  declare module '@mui/material/styles' {
@@ -2,6 +2,10 @@ import { DateRangePickerDayClassKey } from '../DateRangePickerDay';
2
2
  import { DateRangeCalendarClassKey } from '../DateRangeCalendar';
3
3
  import { DateRangePickerToolbarClassKey } from '../DateRangePicker';
4
4
  import { MultiInputRangeFieldClassKey } from '../models';
5
+ import {
6
+ DateTimeRangePickerTabsClassKey,
7
+ DateTimeRangePickerToolbarClassKey,
8
+ } from '../DateTimeRangePicker';
5
9
 
6
10
  // prettier-ignore
7
11
  export interface PickersProComponentNameToClassKey {
@@ -9,6 +13,9 @@ export interface PickersProComponentNameToClassKey {
9
13
  MuiDateRangePickerDay: DateRangePickerDayClassKey;
10
14
  MuiDateRangePickerToolbar: DateRangePickerToolbarClassKey;
11
15
 
16
+ MuiDateTimeRangePickerTabs: DateTimeRangePickerTabsClassKey;
17
+ MuiDateTimeRangePickerToolbar: DateTimeRangePickerToolbarClassKey;
18
+
12
19
  // Multi input range fields
13
20
  MuiMultiInputDateRangeField: MultiInputRangeFieldClassKey;
14
21
  MuiMultiInputDateTimeRangeField: MultiInputRangeFieldClassKey;
@@ -11,11 +11,18 @@ import { MultiInputDateTimeRangeFieldProps } from '../MultiInputDateTimeRangeFie
11
11
  import { MultiInputTimeRangeFieldProps } from '../MultiInputTimeRangeField';
12
12
  import { SingleInputDateTimeRangeFieldProps } from '../SingleInputDateTimeRangeField';
13
13
  import { SingleInputTimeRangeFieldProps } from '../SingleInputTimeRangeField';
14
+ import { DateTimeRangePickerProps } from '../DateTimeRangePicker';
15
+ import { DesktopDateTimeRangePickerProps } from '../DesktopDateTimeRangePicker';
16
+ import { MobileDateTimeRangePickerProps } from '../MobileDateTimeRangePicker';
17
+ import { ExportedDateTimeRangePickerTabsProps } from '../DateTimeRangePicker/DateTimeRangePickerTabs';
18
+ import { ExportedDateTimeRangePickerToolbarProps } from '../DateTimeRangePicker/DateTimeRangePickerToolbar';
14
19
 
15
20
  export interface PickersProComponentsPropsList {
16
21
  MuiDateRangeCalendar: DateRangeCalendarProps<unknown>;
17
22
  MuiDateRangePickerDay: DateRangePickerDayProps<unknown>;
23
+ MuiDateTimeRangePickerTabs: ExportedDateTimeRangePickerTabsProps;
18
24
  MuiDateRangePickerToolbar: DateRangePickerToolbarProps<unknown>;
25
+ MuiDateTimeRangePickerToolbar: ExportedDateTimeRangePickerToolbarProps;
19
26
 
20
27
  // Multi input range fields
21
28
  MuiMultiInputDateRangeField: MultiInputDateRangeFieldProps<unknown>;
@@ -32,6 +39,11 @@ export interface PickersProComponentsPropsList {
32
39
  MuiDesktopDateRangePicker: DesktopDateRangePickerProps<unknown>;
33
40
  MuiMobileDateRangePicker: MobileDateRangePickerProps<unknown>;
34
41
  MuiStaticDateRangePicker: StaticDateRangePickerProps<unknown>;
42
+
43
+ // Date Time Range Pickers
44
+ MuiDateTimeRangePicker: DateTimeRangePickerProps<unknown>;
45
+ MuiDesktopDateTimeRangePicker: DesktopDateTimeRangePickerProps<unknown>;
46
+ MuiMobileDateTimeRangePicker: MobileDateTimeRangePickerProps<unknown>;
35
47
  }
36
48
 
37
49
  declare module '@mui/material/styles' {