@mui/x-date-pickers-pro 7.22.2 → 8.0.0-alpha.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 +142 -155
- package/DateRangeCalendar/DateRangeCalendar.d.ts +1 -2
- package/DateRangeCalendar/DateRangeCalendar.js +23 -22
- package/DateRangeCalendar/DateRangeCalendar.types.d.ts +24 -36
- package/DateRangeCalendar/useDragRange.d.ts +10 -9
- package/DateRangeCalendar/useDragRange.js +3 -3
- package/DateRangePicker/DateRangePicker.d.ts +1 -2
- package/DateRangePicker/DateRangePicker.js +12 -8
- package/DateRangePicker/DateRangePicker.types.d.ts +12 -6
- package/DateRangePicker/DateRangePickerToolbar.d.ts +3 -5
- package/DateRangePicker/DateRangePickerToolbar.js +12 -2
- package/DateRangePicker/index.d.ts +1 -1
- package/DateRangePicker/shared.d.ts +12 -12
- package/DateRangePickerDay/DateRangePickerDay.d.ts +2 -3
- package/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -2
- package/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
- package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +12 -6
- package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +1 -2
- package/DateTimeRangePicker/DateTimeRangePickerTabs.js +2 -2
- package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +8 -9
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +3 -5
- package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +12 -2
- package/DateTimeRangePicker/index.d.ts +1 -1
- package/DateTimeRangePicker/shared.d.ts +13 -13
- package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +1 -2
- package/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
- package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +6 -7
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +1 -2
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +6 -7
- package/MobileDateRangePicker/MobileDateRangePicker.d.ts +1 -2
- package/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
- package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +6 -7
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +1 -2
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +6 -7
- package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +1 -2
- package/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
- package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +9 -10
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +1 -2
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
- package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +9 -10
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +1 -2
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
- package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +9 -10
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.d.ts +1 -2
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
- package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.d.ts +3 -3
- package/README.md +2 -2
- package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +1 -2
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
- package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +8 -8
- package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -2
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +1 -2
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +8 -8
- package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -2
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +1 -2
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +8 -8
- package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -2
- package/StaticDateRangePicker/StaticDateRangePicker.d.ts +1 -2
- package/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
- package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +6 -7
- package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -3
- package/index.d.ts +0 -7
- package/index.js +1 -7
- package/internals/hooks/models/useRangePicker.d.ts +6 -7
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -2
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +20 -14
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +6 -7
- package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +15 -13
- package/internals/hooks/useEnrichedRangePickerFieldProps.js +4 -4
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -2
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -15
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +6 -7
- package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +1 -1
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +1 -2
- package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +1 -2
- package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +1 -2
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -2
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +5 -5
- package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +8 -9
- package/internals/models/dateRange.d.ts +3 -4
- package/internals/models/dateTimeRange.d.ts +5 -10
- package/internals/models/fields.d.ts +26 -0
- package/internals/models/fields.js +1 -0
- package/internals/models/timeRange.d.ts +5 -9
- package/internals/utils/date-range-manager.d.ts +10 -9
- package/internals/utils/date-utils.d.ts +5 -5
- package/internals/utils/releaseInfo.js +1 -1
- package/internals/utils/valueManagers.d.ts +5 -6
- package/models/dateRange.d.ts +4 -5
- package/models/fields.d.ts +5 -32
- package/models/range.d.ts +1 -1
- package/modern/DateRangeCalendar/DateRangeCalendar.js +23 -22
- package/modern/DateRangeCalendar/useDragRange.js +3 -3
- package/modern/DateRangePicker/DateRangePicker.js +12 -8
- package/modern/DateRangePicker/DateRangePickerToolbar.js +12 -2
- package/modern/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
- package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +2 -2
- package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +12 -2
- package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
- package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
- package/modern/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
- package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
- package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
- package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
- package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
- package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
- package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
- package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
- package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
- package/modern/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
- package/modern/index.js +1 -7
- package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +20 -14
- package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +4 -4
- package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -15
- package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +5 -5
- package/modern/internals/models/fields.js +1 -0
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/validation/validateDateRange.js +5 -0
- package/modern/validation/validateDateTimeRange.js +5 -0
- package/modern/validation/validateTimeRange.js +5 -0
- package/node/DateRangeCalendar/DateRangeCalendar.js +22 -21
- package/node/DateRangeCalendar/useDragRange.js +3 -3
- package/node/DateRangePicker/DateRangePicker.js +12 -8
- package/node/DateRangePicker/DateRangePickerToolbar.js +11 -1
- package/node/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
- package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +1 -1
- package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +11 -1
- package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
- package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
- package/node/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
- package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
- package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
- package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
- package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
- package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +1 -1
- package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
- package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
- package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
- package/node/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
- package/node/index.js +2 -41
- package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +19 -13
- package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +3 -3
- package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +19 -13
- package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +4 -4
- package/node/internals/models/fields.js +5 -0
- package/node/internals/utils/releaseInfo.js +1 -1
- package/node/validation/validateDateRange.js +4 -0
- package/node/validation/validateDateTimeRange.js +4 -0
- package/node/validation/validateTimeRange.js +4 -0
- package/package.json +5 -5
- package/themeAugmentation/props.d.ts +16 -17
- package/validation/validateDateRange.d.ts +9 -5
- package/validation/validateDateRange.js +5 -0
- package/validation/validateDateTimeRange.d.ts +11 -6
- package/validation/validateDateTimeRange.js +5 -0
- package/validation/validateTimeRange.d.ts +9 -4
- package/validation/validateTimeRange.js +5 -0
|
@@ -160,9 +160,9 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
160
160
|
currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
|
|
161
161
|
/**
|
|
162
162
|
* Formats the day of week displayed in the calendar header.
|
|
163
|
-
* @param {
|
|
163
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
164
164
|
* @returns {string} The name to display.
|
|
165
|
-
* @default (date:
|
|
165
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
166
166
|
*/
|
|
167
167
|
dayOfWeekFormatter: PropTypes.func,
|
|
168
168
|
/**
|
|
@@ -182,7 +182,8 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
182
182
|
*/
|
|
183
183
|
disableAutoMonthSwitching: PropTypes.bool,
|
|
184
184
|
/**
|
|
185
|
-
* If `true`, the
|
|
185
|
+
* If `true`, the component is disabled.
|
|
186
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
186
187
|
* @default false
|
|
187
188
|
*/
|
|
188
189
|
disabled: PropTypes.bool,
|
|
@@ -221,7 +222,7 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
221
222
|
*/
|
|
222
223
|
displayWeekNumber: PropTypes.bool,
|
|
223
224
|
/**
|
|
224
|
-
* @default
|
|
225
|
+
* @default true
|
|
225
226
|
*/
|
|
226
227
|
enableAccessibleFieldDOMStructure: PropTypes.any,
|
|
227
228
|
/**
|
|
@@ -332,8 +333,7 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
332
333
|
onError: PropTypes.func,
|
|
333
334
|
/**
|
|
334
335
|
* Callback fired on month change.
|
|
335
|
-
* @
|
|
336
|
-
* @param {TDate} month The new month.
|
|
336
|
+
* @param {PickerValidDate} month The new month.
|
|
337
337
|
*/
|
|
338
338
|
onMonthChange: PropTypes.func,
|
|
339
339
|
/**
|
|
@@ -373,6 +373,11 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
373
373
|
* Used when the component position is controlled.
|
|
374
374
|
*/
|
|
375
375
|
rangePosition: PropTypes.oneOf(['end', 'start']),
|
|
376
|
+
/**
|
|
377
|
+
* If `true`, the component is read-only.
|
|
378
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
379
|
+
* @default false
|
|
380
|
+
*/
|
|
376
381
|
readOnly: PropTypes.bool,
|
|
377
382
|
/**
|
|
378
383
|
* If `true`, disable heavy animations.
|
|
@@ -405,16 +410,14 @@ MobileDateTimeRangePicker.propTypes = {
|
|
|
405
410
|
*
|
|
406
411
|
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
407
412
|
*
|
|
408
|
-
* @
|
|
409
|
-
* @param {TDate} day The date to test.
|
|
413
|
+
* @param {PickerValidDate} day The date to test.
|
|
410
414
|
* @param {string} position The date to test, 'start' or 'end'.
|
|
411
415
|
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
412
416
|
*/
|
|
413
417
|
shouldDisableDate: PropTypes.func,
|
|
414
418
|
/**
|
|
415
419
|
* Disable specific time.
|
|
416
|
-
* @
|
|
417
|
-
* @param {TDate} value The value to check.
|
|
420
|
+
* @param {PickerValidDate} value The value to check.
|
|
418
421
|
* @param {TimeView} view The clock type of the timeValue.
|
|
419
422
|
* @returns {boolean} If `true` the time will be disabled.
|
|
420
423
|
*/
|
|
@@ -86,7 +86,7 @@ const MultiInputDateRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
86
86
|
ownerState,
|
|
87
87
|
className: clsx(className, classes.root)
|
|
88
88
|
});
|
|
89
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ?
|
|
89
|
+
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
90
90
|
const startTextFieldProps = useSlotProps({
|
|
91
91
|
elementType: TextField,
|
|
92
92
|
externalSlotProps: slotProps?.textField,
|
|
@@ -160,6 +160,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
160
160
|
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
161
161
|
/**
|
|
162
162
|
* If `true`, the component is disabled.
|
|
163
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
163
164
|
* @default false
|
|
164
165
|
*/
|
|
165
166
|
disabled: PropTypes.bool,
|
|
@@ -178,7 +179,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
178
179
|
*/
|
|
179
180
|
divider: PropTypes.node,
|
|
180
181
|
/**
|
|
181
|
-
* @default
|
|
182
|
+
* @default true
|
|
182
183
|
*/
|
|
183
184
|
enableAccessibleFieldDOMStructure: PropTypes.bool,
|
|
184
185
|
/**
|
|
@@ -225,8 +226,8 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
225
226
|
*/
|
|
226
227
|
onSelectedSectionsChange: PropTypes.func,
|
|
227
228
|
/**
|
|
228
|
-
*
|
|
229
|
-
*
|
|
229
|
+
* If `true`, the component is read-only.
|
|
230
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
230
231
|
* @default false
|
|
231
232
|
*/
|
|
232
233
|
readOnly: PropTypes.bool,
|
|
@@ -251,8 +252,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
|
|
|
251
252
|
*
|
|
252
253
|
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
253
254
|
*
|
|
254
|
-
* @
|
|
255
|
-
* @param {TDate} day The date to test.
|
|
255
|
+
* @param {PickerValidDate} day The date to test.
|
|
256
256
|
* @param {string} position The date to test, 'start' or 'end'.
|
|
257
257
|
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
258
258
|
*/
|
|
@@ -86,7 +86,7 @@ const MultiInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Mult
|
|
|
86
86
|
ownerState,
|
|
87
87
|
className: clsx(className, classes.root)
|
|
88
88
|
});
|
|
89
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ?
|
|
89
|
+
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
90
90
|
const startTextFieldProps = useSlotProps({
|
|
91
91
|
elementType: TextField,
|
|
92
92
|
externalSlotProps: slotProps?.textField,
|
|
@@ -165,6 +165,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
165
165
|
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
166
166
|
/**
|
|
167
167
|
* If `true`, the component is disabled.
|
|
168
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
168
169
|
* @default false
|
|
169
170
|
*/
|
|
170
171
|
disabled: PropTypes.bool,
|
|
@@ -188,7 +189,7 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
188
189
|
*/
|
|
189
190
|
divider: PropTypes.node,
|
|
190
191
|
/**
|
|
191
|
-
* @default
|
|
192
|
+
* @default true
|
|
192
193
|
*/
|
|
193
194
|
enableAccessibleFieldDOMStructure: PropTypes.bool,
|
|
194
195
|
/**
|
|
@@ -258,8 +259,8 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
258
259
|
*/
|
|
259
260
|
onSelectedSectionsChange: PropTypes.func,
|
|
260
261
|
/**
|
|
261
|
-
*
|
|
262
|
-
*
|
|
262
|
+
* If `true`, the component is read-only.
|
|
263
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
263
264
|
* @default false
|
|
264
265
|
*/
|
|
265
266
|
readOnly: PropTypes.bool,
|
|
@@ -284,16 +285,14 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
|
|
|
284
285
|
*
|
|
285
286
|
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
286
287
|
*
|
|
287
|
-
* @
|
|
288
|
-
* @param {TDate} day The date to test.
|
|
288
|
+
* @param {PickerValidDate} day The date to test.
|
|
289
289
|
* @param {string} position The date to test, 'start' or 'end'.
|
|
290
290
|
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
291
291
|
*/
|
|
292
292
|
shouldDisableDate: PropTypes.func,
|
|
293
293
|
/**
|
|
294
294
|
* Disable specific time.
|
|
295
|
-
* @
|
|
296
|
-
* @param {TDate} value The value to check.
|
|
295
|
+
* @param {PickerValidDate} value The value to check.
|
|
297
296
|
* @param {TimeView} view The clock type of the timeValue.
|
|
298
297
|
* @returns {boolean} If `true` the time will be disabled.
|
|
299
298
|
*/
|
|
@@ -86,7 +86,7 @@ const MultiInputTimeRangeField = /*#__PURE__*/React.forwardRef(function MultiInp
|
|
|
86
86
|
ownerState,
|
|
87
87
|
className: clsx(className, classes.root)
|
|
88
88
|
});
|
|
89
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ?
|
|
89
|
+
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
90
90
|
const startTextFieldProps = useSlotProps({
|
|
91
91
|
elementType: TextField,
|
|
92
92
|
externalSlotProps: slotProps?.textField,
|
|
@@ -165,6 +165,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
165
165
|
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
166
166
|
/**
|
|
167
167
|
* If `true`, the component is disabled.
|
|
168
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
168
169
|
* @default false
|
|
169
170
|
*/
|
|
170
171
|
disabled: PropTypes.bool,
|
|
@@ -188,7 +189,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
188
189
|
*/
|
|
189
190
|
divider: PropTypes.node,
|
|
190
191
|
/**
|
|
191
|
-
* @default
|
|
192
|
+
* @default true
|
|
192
193
|
*/
|
|
193
194
|
enableAccessibleFieldDOMStructure: PropTypes.bool,
|
|
194
195
|
/**
|
|
@@ -240,8 +241,8 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
240
241
|
*/
|
|
241
242
|
onSelectedSectionsChange: PropTypes.func,
|
|
242
243
|
/**
|
|
243
|
-
*
|
|
244
|
-
*
|
|
244
|
+
* If `true`, the component is read-only.
|
|
245
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
245
246
|
* @default false
|
|
246
247
|
*/
|
|
247
248
|
readOnly: PropTypes.bool,
|
|
@@ -263,8 +264,7 @@ process.env.NODE_ENV !== "production" ? MultiInputTimeRangeField.propTypes = {
|
|
|
263
264
|
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
|
|
264
265
|
/**
|
|
265
266
|
* Disable specific time.
|
|
266
|
-
* @
|
|
267
|
-
* @param {TDate} value The value to check.
|
|
267
|
+
* @param {PickerValidDate} value The value to check.
|
|
268
268
|
* @param {TimeView} view The clock type of the timeValue.
|
|
269
269
|
* @returns {boolean} If `true` the time will be disabled.
|
|
270
270
|
*/
|
|
@@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import { styled } from '@mui/material/styles';
|
|
10
10
|
import { PickersCalendarHeader } from '@mui/x-date-pickers/PickersCalendarHeader';
|
|
11
11
|
import { PickersArrowSwitcher, useNextMonthDisabled, usePreviousMonthDisabled, useUtils } from '@mui/x-date-pickers/internals';
|
|
12
|
-
import {
|
|
12
|
+
import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
const PickersRangeCalendarHeaderContentMultipleCalendars = styled(PickersArrowSwitcher)({
|
|
15
15
|
padding: '12px 16px 4px 16px',
|
|
@@ -19,7 +19,7 @@ const PickersRangeCalendarHeaderContentMultipleCalendars = styled(PickersArrowSw
|
|
|
19
19
|
});
|
|
20
20
|
const PickersRangeCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersRangeCalendarHeader(props, ref) {
|
|
21
21
|
const utils = useUtils();
|
|
22
|
-
const translations =
|
|
22
|
+
const translations = usePickerTranslations();
|
|
23
23
|
const {
|
|
24
24
|
calendars,
|
|
25
25
|
month,
|
|
@@ -37,7 +37,7 @@ const SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
37
37
|
} = themeProps,
|
|
38
38
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
39
39
|
const ownerState = themeProps;
|
|
40
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ?
|
|
40
|
+
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
41
41
|
const textFieldProps = useSlotProps({
|
|
42
42
|
elementType: TextField,
|
|
43
43
|
externalSlotProps: slotProps?.textField,
|
|
@@ -95,6 +95,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
95
95
|
defaultValue: PropTypes.arrayOf(PropTypes.object),
|
|
96
96
|
/**
|
|
97
97
|
* If `true`, the component is disabled.
|
|
98
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
98
99
|
* @default false
|
|
99
100
|
*/
|
|
100
101
|
disabled: PropTypes.bool,
|
|
@@ -109,7 +110,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
109
110
|
*/
|
|
110
111
|
disablePast: PropTypes.bool,
|
|
111
112
|
/**
|
|
112
|
-
* @default
|
|
113
|
+
* @default true
|
|
113
114
|
*/
|
|
114
115
|
enableAccessibleFieldDOMStructure: PropTypes.bool,
|
|
115
116
|
/**
|
|
@@ -224,8 +225,8 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
224
225
|
*/
|
|
225
226
|
onSelectedSectionsChange: PropTypes.func,
|
|
226
227
|
/**
|
|
227
|
-
*
|
|
228
|
-
*
|
|
228
|
+
* If `true`, the component is read-only.
|
|
229
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
229
230
|
* @default false
|
|
230
231
|
*/
|
|
231
232
|
readOnly: PropTypes.bool,
|
|
@@ -255,8 +256,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
|
|
|
255
256
|
*
|
|
256
257
|
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
257
258
|
*
|
|
258
|
-
* @
|
|
259
|
-
* @param {TDate} day The date to test.
|
|
259
|
+
* @param {PickerValidDate} day The date to test.
|
|
260
260
|
* @param {string} position The date to test, 'start' or 'end'.
|
|
261
261
|
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
262
262
|
*/
|
|
@@ -37,7 +37,7 @@ const SingleInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Sin
|
|
|
37
37
|
} = themeProps,
|
|
38
38
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
39
39
|
const ownerState = themeProps;
|
|
40
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ?
|
|
40
|
+
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
41
41
|
const textFieldProps = useSlotProps({
|
|
42
42
|
elementType: TextField,
|
|
43
43
|
externalSlotProps: slotProps?.textField,
|
|
@@ -100,6 +100,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
100
100
|
defaultValue: PropTypes.arrayOf(PropTypes.object),
|
|
101
101
|
/**
|
|
102
102
|
* If `true`, the component is disabled.
|
|
103
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
103
104
|
* @default false
|
|
104
105
|
*/
|
|
105
106
|
disabled: PropTypes.bool,
|
|
@@ -119,7 +120,7 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
119
120
|
*/
|
|
120
121
|
disablePast: PropTypes.bool,
|
|
121
122
|
/**
|
|
122
|
-
* @default
|
|
123
|
+
* @default true
|
|
123
124
|
*/
|
|
124
125
|
enableAccessibleFieldDOMStructure: PropTypes.bool,
|
|
125
126
|
/**
|
|
@@ -257,8 +258,8 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
257
258
|
*/
|
|
258
259
|
onSelectedSectionsChange: PropTypes.func,
|
|
259
260
|
/**
|
|
260
|
-
*
|
|
261
|
-
*
|
|
261
|
+
* If `true`, the component is read-only.
|
|
262
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
262
263
|
* @default false
|
|
263
264
|
*/
|
|
264
265
|
readOnly: PropTypes.bool,
|
|
@@ -288,16 +289,14 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
|
|
|
288
289
|
*
|
|
289
290
|
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
290
291
|
*
|
|
291
|
-
* @
|
|
292
|
-
* @param {TDate} day The date to test.
|
|
292
|
+
* @param {PickerValidDate} day The date to test.
|
|
293
293
|
* @param {string} position The date to test, 'start' or 'end'.
|
|
294
294
|
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
295
295
|
*/
|
|
296
296
|
shouldDisableDate: PropTypes.func,
|
|
297
297
|
/**
|
|
298
298
|
* Disable specific time.
|
|
299
|
-
* @
|
|
300
|
-
* @param {TDate} value The value to check.
|
|
299
|
+
* @param {PickerValidDate} value The value to check.
|
|
301
300
|
* @param {TimeView} view The clock type of the timeValue.
|
|
302
301
|
* @returns {boolean} If `true` the time will be disabled.
|
|
303
302
|
*/
|
|
@@ -37,7 +37,7 @@ const SingleInputTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
37
37
|
} = themeProps,
|
|
38
38
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
39
39
|
const ownerState = themeProps;
|
|
40
|
-
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ?
|
|
40
|
+
const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure === false ? MuiTextField : PickersTextField);
|
|
41
41
|
const textFieldProps = useSlotProps({
|
|
42
42
|
elementType: TextField,
|
|
43
43
|
externalSlotProps: slotProps?.textField,
|
|
@@ -100,6 +100,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
100
100
|
defaultValue: PropTypes.arrayOf(PropTypes.object),
|
|
101
101
|
/**
|
|
102
102
|
* If `true`, the component is disabled.
|
|
103
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
103
104
|
* @default false
|
|
104
105
|
*/
|
|
105
106
|
disabled: PropTypes.bool,
|
|
@@ -119,7 +120,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
119
120
|
*/
|
|
120
121
|
disablePast: PropTypes.bool,
|
|
121
122
|
/**
|
|
122
|
-
* @default
|
|
123
|
+
* @default true
|
|
123
124
|
*/
|
|
124
125
|
enableAccessibleFieldDOMStructure: PropTypes.bool,
|
|
125
126
|
/**
|
|
@@ -239,8 +240,8 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
239
240
|
*/
|
|
240
241
|
onSelectedSectionsChange: PropTypes.func,
|
|
241
242
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
243
|
+
* If `true`, the component is read-only.
|
|
244
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
244
245
|
* @default false
|
|
245
246
|
*/
|
|
246
247
|
readOnly: PropTypes.bool,
|
|
@@ -267,8 +268,7 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
|
|
|
267
268
|
selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),
|
|
268
269
|
/**
|
|
269
270
|
* Disable specific time.
|
|
270
|
-
* @
|
|
271
|
-
* @param {TDate} value The value to check.
|
|
271
|
+
* @param {PickerValidDate} value The value to check.
|
|
272
272
|
* @param {TimeView} view The clock type of the timeValue.
|
|
273
273
|
* @returns {boolean} If `true` the time will be disabled.
|
|
274
274
|
*/
|
|
@@ -74,9 +74,9 @@ StaticDateRangePicker.propTypes = {
|
|
|
74
74
|
currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
|
|
75
75
|
/**
|
|
76
76
|
* Formats the day of week displayed in the calendar header.
|
|
77
|
-
* @param {
|
|
77
|
+
* @param {PickerValidDate} date The date of the day of week provided by the adapter.
|
|
78
78
|
* @returns {string} The name to display.
|
|
79
|
-
* @default (date:
|
|
79
|
+
* @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
80
80
|
*/
|
|
81
81
|
dayOfWeekFormatter: PropTypes.func,
|
|
82
82
|
/**
|
|
@@ -96,7 +96,8 @@ StaticDateRangePicker.propTypes = {
|
|
|
96
96
|
*/
|
|
97
97
|
disableAutoMonthSwitching: PropTypes.bool,
|
|
98
98
|
/**
|
|
99
|
-
* If `true`, the
|
|
99
|
+
* If `true`, the component is disabled.
|
|
100
|
+
* When disabled, the value cannot be changed and no interaction is possible.
|
|
100
101
|
* @default false
|
|
101
102
|
*/
|
|
102
103
|
disabled: PropTypes.bool,
|
|
@@ -189,8 +190,7 @@ StaticDateRangePicker.propTypes = {
|
|
|
189
190
|
onError: PropTypes.func,
|
|
190
191
|
/**
|
|
191
192
|
* Callback fired on month change.
|
|
192
|
-
* @
|
|
193
|
-
* @param {TDate} month The new month.
|
|
193
|
+
* @param {PickerValidDate} month The new month.
|
|
194
194
|
*/
|
|
195
195
|
onMonthChange: PropTypes.func,
|
|
196
196
|
/**
|
|
@@ -203,6 +203,11 @@ StaticDateRangePicker.propTypes = {
|
|
|
203
203
|
* Used when the component position is controlled.
|
|
204
204
|
*/
|
|
205
205
|
rangePosition: PropTypes.oneOf(['end', 'start']),
|
|
206
|
+
/**
|
|
207
|
+
* If `true`, the component is read-only.
|
|
208
|
+
* When read-only, the value cannot be changed but the user can interact with the interface.
|
|
209
|
+
* @default false
|
|
210
|
+
*/
|
|
206
211
|
readOnly: PropTypes.bool,
|
|
207
212
|
/**
|
|
208
213
|
* If `true`, disable heavy animations.
|
|
@@ -225,8 +230,7 @@ StaticDateRangePicker.propTypes = {
|
|
|
225
230
|
*
|
|
226
231
|
* Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
|
|
227
232
|
*
|
|
228
|
-
* @
|
|
229
|
-
* @param {TDate} day The date to test.
|
|
233
|
+
* @param {PickerValidDate} day The date to test.
|
|
230
234
|
* @param {string} position The date to test, 'start' or 'end'.
|
|
231
235
|
* @returns {boolean} Returns `true` if the date should be disabled.
|
|
232
236
|
*/
|
package/modern/index.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers-pro
|
|
2
|
+
* @mui/x-date-pickers-pro v8.0.0-alpha.0
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import { LicenseInfo as LicenseInfoExport } from '@mui/x-license';
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Use `@mui/x-license` package instead:
|
|
11
|
-
* @example import { LicenseInfo } from '@mui/x-license';
|
|
12
|
-
*/
|
|
13
|
-
export class LicenseInfo extends LicenseInfoExport {}
|
|
14
8
|
export * from '@mui/x-date-pickers';
|
|
15
9
|
export * from "./DateRangePickerDay/index.js";
|
|
16
10
|
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
6
6
|
import { useLicenseVerifier } from '@mui/x-license';
|
|
7
7
|
import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
|
|
8
|
-
import { executeInTheNextEventLoopTick, getActiveElement, usePicker, PickersPopper,
|
|
8
|
+
import { executeInTheNextEventLoopTick, getActiveElement, usePicker, PickersPopper, PickerProvider } from '@mui/x-date-pickers/internals';
|
|
9
9
|
import { useEnrichedRangePickerFieldProps } from "../useEnrichedRangePickerFieldProps.js";
|
|
10
10
|
import { getReleaseInfo } from "../../utils/releaseInfo.js";
|
|
11
11
|
import { useRangePosition } from "../useRangePosition.js";
|
|
@@ -53,15 +53,17 @@ export const useDesktopRangePicker = _ref => {
|
|
|
53
53
|
open,
|
|
54
54
|
actions,
|
|
55
55
|
layoutProps,
|
|
56
|
+
providerProps,
|
|
56
57
|
renderCurrentView,
|
|
57
58
|
shouldRestoreFocus,
|
|
58
59
|
fieldProps: pickerFieldProps,
|
|
59
|
-
|
|
60
|
+
ownerState
|
|
60
61
|
} = usePicker(_extends({}, pickerParams, {
|
|
61
62
|
props,
|
|
62
63
|
wrapperVariant: 'desktop',
|
|
63
64
|
autoFocusView: false,
|
|
64
65
|
fieldRef: rangePosition === 'start' ? startFieldRef : endFieldRef,
|
|
66
|
+
localeText,
|
|
65
67
|
additionalViewProps: {
|
|
66
68
|
rangePosition,
|
|
67
69
|
onRangePositionChange
|
|
@@ -85,24 +87,30 @@ export const useDesktopRangePicker = _ref => {
|
|
|
85
87
|
const fieldProps = useSlotProps({
|
|
86
88
|
elementType: Field,
|
|
87
89
|
externalSlotProps: slotProps?.field,
|
|
88
|
-
additionalProps: _extends({
|
|
90
|
+
additionalProps: _extends({
|
|
91
|
+
// Internal props
|
|
89
92
|
readOnly,
|
|
90
93
|
disabled,
|
|
91
|
-
className,
|
|
92
|
-
sx,
|
|
93
94
|
format,
|
|
94
95
|
formatDensity,
|
|
95
96
|
enableAccessibleFieldDOMStructure,
|
|
96
97
|
selectedSections,
|
|
97
98
|
onSelectedSectionsChange,
|
|
98
99
|
timezone,
|
|
99
|
-
autoFocus: autoFocus && !props.open
|
|
100
|
+
autoFocus: autoFocus && !props.open
|
|
101
|
+
}, pickerFieldProps, {
|
|
102
|
+
// onChange and value
|
|
103
|
+
|
|
104
|
+
// Forwarded props
|
|
105
|
+
className,
|
|
106
|
+
sx,
|
|
100
107
|
ref: fieldContainerRef
|
|
101
|
-
}, fieldType === 'single-input'
|
|
102
|
-
inputRef
|
|
108
|
+
}, fieldType === 'single-input' && !!inputRef && {
|
|
109
|
+
inputRef
|
|
110
|
+
}, fieldType === 'single-input' && {
|
|
103
111
|
name
|
|
104
|
-
}
|
|
105
|
-
ownerState
|
|
112
|
+
}),
|
|
113
|
+
ownerState
|
|
106
114
|
});
|
|
107
115
|
const enrichedFieldProps = useEnrichedRangePickerFieldProps({
|
|
108
116
|
wrapperVariant: 'desktop',
|
|
@@ -137,9 +145,7 @@ export const useDesktopRangePicker = _ref => {
|
|
|
137
145
|
})
|
|
138
146
|
});
|
|
139
147
|
const Layout = slots?.layout ?? PickersLayout;
|
|
140
|
-
const renderPicker = () => /*#__PURE__*/_jsxs(
|
|
141
|
-
contextValue: contextValue,
|
|
142
|
-
localeText: localeText,
|
|
148
|
+
const renderPicker = () => /*#__PURE__*/_jsxs(PickerProvider, _extends({}, providerProps, {
|
|
143
149
|
children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldProps)), /*#__PURE__*/_jsx(PickersPopper, _extends({
|
|
144
150
|
role: "tooltip",
|
|
145
151
|
placement: "bottom-start",
|
|
@@ -158,7 +164,7 @@ export const useDesktopRangePicker = _ref => {
|
|
|
158
164
|
children: renderCurrentView()
|
|
159
165
|
}))
|
|
160
166
|
}))]
|
|
161
|
-
});
|
|
167
|
+
}));
|
|
162
168
|
return {
|
|
163
169
|
renderPicker
|
|
164
170
|
};
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import resolveComponentProps from '@mui/utils/resolveComponentProps';
|
|
6
6
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
7
7
|
import useForkRef from '@mui/utils/useForkRef';
|
|
8
|
-
import {
|
|
8
|
+
import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
|
|
9
9
|
import { onSpaceOrEnter } from '@mui/x-date-pickers/internals';
|
|
10
10
|
const useMultiInputFieldSlotProps = ({
|
|
11
11
|
wrapperVariant,
|
|
@@ -28,7 +28,7 @@ const useMultiInputFieldSlotProps = ({
|
|
|
28
28
|
startFieldRef,
|
|
29
29
|
endFieldRef
|
|
30
30
|
}) => {
|
|
31
|
-
const translations =
|
|
31
|
+
const translations = usePickerTranslations();
|
|
32
32
|
const handleStartFieldRef = useForkRef(fieldProps.unstableStartFieldRef, startFieldRef);
|
|
33
33
|
const handleEndFieldRef = useForkRef(fieldProps.unstableEndFieldRef, endFieldRef);
|
|
34
34
|
const previousRangePosition = React.useRef(rangePosition);
|
|
@@ -208,8 +208,8 @@ const useSingleInputFieldSlotProps = ({
|
|
|
208
208
|
});
|
|
209
209
|
const slotProps = _extends({}, fieldProps.slotProps, {
|
|
210
210
|
textField: pickerSlotProps?.textField,
|
|
211
|
-
clearButton:
|
|
212
|
-
clearIcon:
|
|
211
|
+
clearButton: pickerSlotProps?.clearButton,
|
|
212
|
+
clearIcon: pickerSlotProps?.clearIcon
|
|
213
213
|
});
|
|
214
214
|
const enrichedFieldProps = _extends({}, fieldProps, {
|
|
215
215
|
slots,
|
|
@@ -5,8 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
6
6
|
import { useLicenseVerifier } from '@mui/x-license';
|
|
7
7
|
import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
|
|
8
|
-
import { usePicker, PickersModalDialog,
|
|
9
|
-
import {
|
|
8
|
+
import { usePicker, PickersModalDialog, PickerProvider } from '@mui/x-date-pickers/internals';
|
|
9
|
+
import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
|
|
10
10
|
import useId from '@mui/utils/useId';
|
|
11
11
|
import { useEnrichedRangePickerFieldProps } from "../useEnrichedRangePickerFieldProps.js";
|
|
12
12
|
import { getReleaseInfo } from "../../utils/releaseInfo.js";
|
|
@@ -46,19 +46,21 @@ export const useMobileRangePicker = _ref => {
|
|
|
46
46
|
onRangePositionChange
|
|
47
47
|
} = useRangePosition(props, fieldType === 'single-input' ? startFieldRef : undefined);
|
|
48
48
|
const labelId = useId();
|
|
49
|
-
const contextTranslations =
|
|
49
|
+
const contextTranslations = usePickerTranslations();
|
|
50
50
|
const {
|
|
51
51
|
open,
|
|
52
52
|
actions,
|
|
53
53
|
layoutProps,
|
|
54
|
+
providerProps,
|
|
54
55
|
renderCurrentView,
|
|
55
56
|
fieldProps: pickerFieldProps,
|
|
56
|
-
|
|
57
|
+
ownerState
|
|
57
58
|
} = usePicker(_extends({}, pickerParams, {
|
|
58
59
|
props,
|
|
59
60
|
wrapperVariant: 'mobile',
|
|
60
61
|
autoFocusView: true,
|
|
61
62
|
fieldRef: rangePosition === 'start' ? startFieldRef : endFieldRef,
|
|
63
|
+
localeText,
|
|
62
64
|
additionalViewProps: {
|
|
63
65
|
rangePosition,
|
|
64
66
|
onRangePositionChange
|
|
@@ -68,22 +70,28 @@ export const useMobileRangePicker = _ref => {
|
|
|
68
70
|
const fieldProps = useSlotProps({
|
|
69
71
|
elementType: Field,
|
|
70
72
|
externalSlotProps: innerSlotProps?.field,
|
|
71
|
-
additionalProps: _extends({
|
|
73
|
+
additionalProps: _extends({
|
|
74
|
+
// Internal props
|
|
72
75
|
readOnly: readOnly ?? true,
|
|
73
76
|
disabled,
|
|
74
|
-
className,
|
|
75
|
-
sx,
|
|
76
77
|
format,
|
|
77
78
|
formatDensity,
|
|
78
79
|
enableAccessibleFieldDOMStructure,
|
|
79
80
|
selectedSections,
|
|
80
81
|
onSelectedSectionsChange,
|
|
81
82
|
timezone
|
|
82
|
-
},
|
|
83
|
-
|
|
83
|
+
}, pickerFieldProps, {
|
|
84
|
+
// onChange and value
|
|
85
|
+
|
|
86
|
+
// Forwarded props
|
|
87
|
+
className,
|
|
88
|
+
sx
|
|
89
|
+
}, fieldType === 'single-input' && !!inputRef && {
|
|
90
|
+
inputRef
|
|
91
|
+
}, fieldType === 'single-input' && {
|
|
84
92
|
name
|
|
85
|
-
}
|
|
86
|
-
ownerState
|
|
93
|
+
}),
|
|
94
|
+
ownerState
|
|
87
95
|
});
|
|
88
96
|
const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;
|
|
89
97
|
const enrichedFieldProps = useEnrichedRangePickerFieldProps({
|
|
@@ -137,9 +145,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
137
145
|
'aria-labelledby': labelledById
|
|
138
146
|
}, innerSlotProps?.mobilePaper)
|
|
139
147
|
});
|
|
140
|
-
const renderPicker = () => /*#__PURE__*/_jsxs(
|
|
141
|
-
contextValue: contextValue,
|
|
142
|
-
localeText: localeText,
|
|
148
|
+
const renderPicker = () => /*#__PURE__*/_jsxs(PickerProvider, _extends({}, providerProps, {
|
|
143
149
|
children: [/*#__PURE__*/_jsx(Field, _extends({}, enrichedFieldProps)), /*#__PURE__*/_jsx(PickersModalDialog, _extends({}, actions, {
|
|
144
150
|
open: open,
|
|
145
151
|
slots: slots,
|
|
@@ -150,7 +156,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
150
156
|
children: renderCurrentView()
|
|
151
157
|
}))
|
|
152
158
|
}))]
|
|
153
|
-
});
|
|
159
|
+
}));
|
|
154
160
|
return {
|
|
155
161
|
renderPicker
|
|
156
162
|
};
|