@mui/x-date-pickers 6.16.1 → 6.16.3
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/AdapterDayjs/AdapterDayjs.js +6 -4
- package/AdapterMoment/AdapterMoment.js +2 -5
- package/CHANGELOG.md +169 -0
- package/DateField/DateField.d.ts +10 -0
- package/DateField/DateField.js +11 -1
- package/DatePicker/DatePicker.d.ts +10 -0
- package/DatePicker/DatePicker.js +10 -0
- package/DatePicker/DatePickerToolbar.d.ts +10 -0
- package/DatePicker/DatePickerToolbar.js +10 -0
- package/DateTimeField/DateTimeField.d.ts +10 -0
- package/DateTimeField/DateTimeField.js +11 -1
- package/DateTimePicker/DateTimePicker.d.ts +10 -0
- package/DateTimePicker/DateTimePicker.js +15 -0
- package/DateTimePicker/DateTimePickerTabs.d.ts +10 -0
- package/DateTimePicker/DateTimePickerTabs.js +11 -0
- package/DateTimePicker/DateTimePickerToolbar.d.ts +10 -0
- package/DateTimePicker/DateTimePickerToolbar.js +11 -0
- package/DayCalendarSkeleton/DayCalendarSkeleton.d.ts +1 -2
- package/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -2
- package/DesktopDatePicker/DesktopDatePicker.d.ts +10 -0
- package/DesktopDatePicker/DesktopDatePicker.js +10 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +10 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -7
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +4 -3
- package/DesktopTimePicker/DesktopTimePicker.d.ts +10 -0
- package/DesktopTimePicker/DesktopTimePicker.js +18 -9
- package/DigitalClock/DigitalClock.d.ts +10 -0
- package/DigitalClock/DigitalClock.js +11 -1
- package/LocalizationProvider/LocalizationProvider.d.ts +12 -0
- package/LocalizationProvider/LocalizationProvider.js +12 -0
- package/MobileDatePicker/MobileDatePicker.d.ts +10 -0
- package/MobileDatePicker/MobileDatePicker.js +10 -0
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +10 -0
- package/MobileDateTimePicker/MobileDateTimePicker.js +10 -0
- package/MobileTimePicker/MobileTimePicker.d.ts +10 -0
- package/MobileTimePicker/MobileTimePicker.js +10 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.d.ts +10 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -0
- package/PickersActionBar/PickersActionBar.d.ts +10 -0
- package/PickersActionBar/PickersActionBar.js +10 -0
- package/PickersCalendarHeader/PickersCalendarHeader.d.ts +11 -0
- package/PickersCalendarHeader/PickersCalendarHeader.js +11 -0
- package/PickersDay/PickersDay.d.ts +1 -3
- package/PickersDay/PickersDay.js +1 -3
- package/PickersLayout/PickersLayout.d.ts +9 -0
- package/PickersLayout/PickersLayout.js +10 -0
- package/PickersShortcuts/PickersShortcuts.d.ts +9 -0
- package/PickersShortcuts/PickersShortcuts.js +9 -0
- package/StaticDatePicker/StaticDatePicker.d.ts +10 -0
- package/StaticDatePicker/StaticDatePicker.js +10 -0
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +10 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +10 -0
- package/StaticTimePicker/StaticTimePicker.d.ts +10 -0
- package/StaticTimePicker/StaticTimePicker.js +10 -0
- package/TimeClock/TimeClock.d.ts +4 -0
- package/TimeClock/TimeClock.js +4 -0
- package/TimeField/TimeField.d.ts +10 -0
- package/TimeField/TimeField.js +11 -1
- package/TimePicker/TimePicker.d.ts +10 -0
- package/TimePicker/TimePicker.js +10 -0
- package/TimePicker/TimePickerToolbar.d.ts +10 -0
- package/TimePicker/TimePickerToolbar.js +11 -0
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +52 -33
- package/index.js +1 -1
- package/internals/components/FakeTextField/FakeTextField.d.ts +10 -0
- package/internals/components/FakeTextField/FakeTextField.js +27 -0
- package/internals/components/FakeTextField/index.d.ts +1 -0
- package/internals/components/FakeTextField/index.js +1 -0
- package/internals/hooks/useField/useField.js +14 -4
- package/internals/hooks/useField/useField.utils.js +1 -1
- package/internals/hooks/useField/useFieldState.js +5 -8
- package/internals/utils/date-time-utils.d.ts +11 -0
- package/internals/utils/date-time-utils.js +32 -2
- package/legacy/AdapterDayjs/AdapterDayjs.js +6 -4
- package/legacy/AdapterMoment/AdapterMoment.js +2 -5
- package/legacy/DateField/DateField.js +11 -1
- package/legacy/DatePicker/DatePicker.js +10 -0
- package/legacy/DatePicker/DatePickerToolbar.js +10 -0
- package/legacy/DateTimeField/DateTimeField.js +11 -1
- package/legacy/DateTimePicker/DateTimePicker.js +15 -0
- package/legacy/DateTimePicker/DateTimePickerTabs.js +11 -0
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +11 -0
- package/legacy/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -2
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +10 -0
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +24 -8
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +19 -10
- package/legacy/DigitalClock/DigitalClock.js +11 -1
- package/legacy/LocalizationProvider/LocalizationProvider.js +12 -0
- package/legacy/MobileDatePicker/MobileDatePicker.js +10 -0
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +10 -0
- package/legacy/MobileTimePicker/MobileTimePicker.js +10 -0
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -0
- package/legacy/PickersActionBar/PickersActionBar.js +10 -0
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +11 -0
- package/legacy/PickersDay/PickersDay.js +1 -3
- package/legacy/PickersLayout/PickersLayout.js +10 -0
- package/legacy/PickersShortcuts/PickersShortcuts.js +9 -0
- package/legacy/StaticDatePicker/StaticDatePicker.js +10 -0
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +10 -0
- package/legacy/StaticTimePicker/StaticTimePicker.js +10 -0
- package/legacy/TimeClock/TimeClock.js +4 -0
- package/legacy/TimeField/TimeField.js +11 -1
- package/legacy/TimePicker/TimePicker.js +10 -0
- package/legacy/TimePicker/TimePickerToolbar.js +11 -0
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +51 -33
- package/legacy/index.js +1 -1
- package/legacy/internals/components/FakeTextField/FakeTextField.js +23 -0
- package/legacy/internals/components/FakeTextField/index.js +1 -0
- package/legacy/internals/hooks/useField/useField.js +14 -4
- package/legacy/internals/hooks/useField/useField.utils.js +1 -1
- package/legacy/internals/hooks/useField/useFieldState.js +5 -8
- package/legacy/internals/utils/date-time-utils.js +34 -2
- package/legacy/locales/esES.js +1 -1
- package/locales/esES.js +1 -1
- package/modern/AdapterDayjs/AdapterDayjs.js +6 -4
- package/modern/AdapterMoment/AdapterMoment.js +2 -5
- package/modern/DateField/DateField.js +11 -1
- package/modern/DatePicker/DatePicker.js +10 -0
- package/modern/DatePicker/DatePickerToolbar.js +10 -0
- package/modern/DateTimeField/DateTimeField.js +11 -1
- package/modern/DateTimePicker/DateTimePicker.js +15 -0
- package/modern/DateTimePicker/DateTimePickerTabs.js +11 -0
- package/modern/DateTimePicker/DateTimePickerToolbar.js +11 -0
- package/modern/DayCalendarSkeleton/DayCalendarSkeleton.js +1 -2
- package/modern/DesktopDatePicker/DesktopDatePicker.js +10 -0
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -7
- package/modern/DesktopTimePicker/DesktopTimePicker.js +17 -8
- package/modern/DigitalClock/DigitalClock.js +11 -1
- package/modern/LocalizationProvider/LocalizationProvider.js +12 -0
- package/modern/MobileDatePicker/MobileDatePicker.js +10 -0
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +10 -0
- package/modern/MobileTimePicker/MobileTimePicker.js +10 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +10 -0
- package/modern/PickersActionBar/PickersActionBar.js +10 -0
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +11 -0
- package/modern/PickersDay/PickersDay.js +1 -3
- package/modern/PickersLayout/PickersLayout.js +10 -0
- package/modern/PickersShortcuts/PickersShortcuts.js +9 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +10 -0
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +10 -0
- package/modern/StaticTimePicker/StaticTimePicker.js +10 -0
- package/modern/TimeClock/TimeClock.js +4 -0
- package/modern/TimeField/TimeField.js +11 -1
- package/modern/TimePicker/TimePicker.js +10 -0
- package/modern/TimePicker/TimePickerToolbar.js +11 -0
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +52 -33
- package/modern/index.js +1 -1
- package/modern/internals/components/FakeTextField/FakeTextField.js +27 -0
- package/modern/internals/components/FakeTextField/index.js +1 -0
- package/modern/internals/hooks/useField/useField.js +14 -4
- package/modern/internals/hooks/useField/useField.utils.js +1 -1
- package/modern/internals/hooks/useField/useFieldState.js +5 -8
- package/modern/internals/utils/date-time-utils.js +29 -2
- package/modern/locales/esES.js +1 -1
- package/node/AdapterDayjs/AdapterDayjs.js +6 -4
- package/node/AdapterMoment/AdapterMoment.js +2 -5
- package/node/DateCalendar/DateCalendar.js +2 -2
- package/node/DateCalendar/DayCalendar.js +2 -2
- package/node/DateCalendar/PickersFadeTransitionGroup.js +2 -2
- package/node/DateCalendar/PickersSlideTransition.js +2 -2
- package/node/DateCalendar/useCalendarState.js +2 -2
- package/node/DateCalendar/useIsDateDisabled.js +2 -2
- package/node/DateField/DateField.js +13 -3
- package/node/DatePicker/DatePicker.js +12 -2
- package/node/DatePicker/DatePickerToolbar.js +12 -2
- package/node/DatePicker/shared.js +2 -2
- package/node/DateTimeField/DateTimeField.js +13 -3
- package/node/DateTimePicker/DateTimePicker.js +17 -2
- package/node/DateTimePicker/DateTimePickerTabs.js +13 -2
- package/node/DateTimePicker/DateTimePickerToolbar.js +13 -2
- package/node/DateTimePicker/shared.js +2 -2
- package/node/DayCalendarSkeleton/DayCalendarSkeleton.js +3 -4
- package/node/DesktopDatePicker/DesktopDatePicker.js +12 -2
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +26 -8
- package/node/DesktopTimePicker/DesktopTimePicker.js +19 -10
- package/node/DigitalClock/DigitalClock.js +13 -3
- package/node/LocalizationProvider/LocalizationProvider.js +14 -2
- package/node/MobileDatePicker/MobileDatePicker.js +12 -2
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +12 -2
- package/node/MobileTimePicker/MobileTimePicker.js +12 -2
- package/node/MonthCalendar/MonthCalendar.js +2 -2
- package/node/MonthCalendar/PickersMonth.js +2 -2
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +12 -2
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -2
- package/node/PickersActionBar/PickersActionBar.js +12 -2
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +13 -2
- package/node/PickersDay/PickersDay.js +3 -5
- package/node/PickersLayout/PickersLayout.js +12 -2
- package/node/PickersLayout/usePickerLayout.js +2 -2
- package/node/PickersShortcuts/PickersShortcuts.js +11 -2
- package/node/StaticDatePicker/StaticDatePicker.js +12 -2
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +12 -2
- package/node/StaticTimePicker/StaticTimePicker.js +12 -2
- package/node/TimeClock/Clock.js +2 -2
- package/node/TimeClock/ClockNumber.js +2 -2
- package/node/TimeClock/ClockNumbers.js +2 -2
- package/node/TimeClock/ClockPointer.js +2 -2
- package/node/TimeClock/TimeClock.js +6 -2
- package/node/TimeField/TimeField.js +13 -3
- package/node/TimePicker/TimePicker.js +12 -2
- package/node/TimePicker/TimePickerToolbar.js +13 -2
- package/node/TimePicker/shared.js +2 -2
- package/node/YearCalendar/PickersYear.js +2 -2
- package/node/YearCalendar/YearCalendar.js +2 -2
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +53 -34
- package/node/dateViewRenderers/dateViewRenderers.js +2 -2
- package/node/hooks/useClearableField.js +2 -2
- package/node/icons/index.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/components/FakeTextField/FakeTextField.js +35 -0
- package/node/internals/components/FakeTextField/index.js +12 -0
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -2
- package/node/internals/components/PickersModalDialog.js +2 -2
- package/node/internals/components/PickersPopper.js +2 -2
- package/node/internals/components/PickersToolbar.js +2 -2
- package/node/internals/components/PickersToolbarButton.js +2 -2
- package/node/internals/components/PickersToolbarText.js +2 -2
- package/node/internals/demo/DemoContainer.js +2 -2
- package/node/internals/hooks/date-helpers-hooks.js +2 -2
- package/node/internals/hooks/useClockReferenceDate.js +2 -2
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +2 -2
- package/node/internals/hooks/useField/useField.js +16 -6
- package/node/internals/hooks/useField/useField.utils.js +1 -1
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +2 -2
- package/node/internals/hooks/useField/useFieldState.js +7 -10
- package/node/internals/hooks/useIsLandscape.js +2 -2
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +2 -2
- package/node/internals/hooks/useOpenState.js +2 -2
- package/node/internals/hooks/usePicker/usePickerValue.js +2 -2
- package/node/internals/hooks/usePicker/usePickerViews.js +2 -2
- package/node/internals/hooks/useStaticPicker/useStaticPicker.js +2 -2
- package/node/internals/hooks/useUtils.js +2 -2
- package/node/internals/hooks/useValidation.js +2 -2
- package/node/internals/hooks/useValueWithTimezone.js +2 -2
- package/node/internals/hooks/useViews.js +2 -2
- package/node/internals/utils/date-time-utils.js +29 -1
- package/node/locales/esES.js +1 -1
- package/node/timeViewRenderers/timeViewRenderers.js +2 -2
- package/package.json +4 -4
|
@@ -171,6 +171,11 @@ export var useField = function useField(params) {
|
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
var targetValue = event.target.value;
|
|
174
|
+
if (targetValue === '') {
|
|
175
|
+
resetCharacterQuery();
|
|
176
|
+
clearValue();
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
174
179
|
var eventData = event.nativeEvent.data;
|
|
175
180
|
// Calling `.fill(04/11/2022)` in playwright will trigger a change event with the requested content to insert in `event.nativeEvent.data`
|
|
176
181
|
// usual changes have only the currently typed character in the `event.nativeEvent.data`
|
|
@@ -210,8 +215,13 @@ export var useField = function useField(params) {
|
|
|
210
215
|
var activeSectionEndRelativeToNewValue = cleanValueStr.length - prevValueStr.length + activeSection.end - cleanString(activeSection.endSeparator || '').length;
|
|
211
216
|
keyPressed = cleanValueStr.slice(activeSection.start + cleanString(activeSection.startSeparator || '').length, activeSectionEndRelativeToNewValue);
|
|
212
217
|
}
|
|
213
|
-
if (
|
|
214
|
-
|
|
218
|
+
if (keyPressed.length === 0) {
|
|
219
|
+
if (isAndroid()) {
|
|
220
|
+
setTempAndroidValueStr(valueStr);
|
|
221
|
+
} else {
|
|
222
|
+
resetCharacterQuery();
|
|
223
|
+
clearActiveSection();
|
|
224
|
+
}
|
|
215
225
|
return;
|
|
216
226
|
}
|
|
217
227
|
applyCharacterEditing({
|
|
@@ -269,7 +279,7 @@ export var useField = function useField(params) {
|
|
|
269
279
|
}
|
|
270
280
|
|
|
271
281
|
// Reset the value of the selected section
|
|
272
|
-
case
|
|
282
|
+
case event.key === 'Delete':
|
|
273
283
|
{
|
|
274
284
|
event.preventDefault();
|
|
275
285
|
if (readOnly) {
|
|
@@ -330,7 +340,7 @@ export var useField = function useField(params) {
|
|
|
330
340
|
// Fix scroll jumping on iOS browser: https://github.com/mui/mui-x/issues/8321
|
|
331
341
|
var currentScrollTop = inputRef.current.scrollTop;
|
|
332
342
|
// On multi input range pickers we want to update selection range only for the active input
|
|
333
|
-
// This helps
|
|
343
|
+
// This helps to avoid the focus jumping on Safari https://github.com/mui/mui-x/issues/9003
|
|
334
344
|
// because WebKit implements the `setSelectionRange` based on the spec: https://bugs.webkit.org/show_bug.cgi?id=224425
|
|
335
345
|
if (inputRef.current === getActiveElement(document)) {
|
|
336
346
|
inputRef.current.setSelectionRange(selectionStart, selectionEnd);
|
|
@@ -312,7 +312,7 @@ export var doesSectionFormatHaveLeadingZeros = function doesSectionFormatHaveLea
|
|
|
312
312
|
}
|
|
313
313
|
case 'seconds':
|
|
314
314
|
{
|
|
315
|
-
return utils.formatByString(utils.
|
|
315
|
+
return utils.formatByString(utils.setSeconds(now, 1), format).length > 1;
|
|
316
316
|
}
|
|
317
317
|
default:
|
|
318
318
|
{
|
|
@@ -137,6 +137,9 @@ export var useFieldState = function useFieldState(params) {
|
|
|
137
137
|
tempValueStrAndroid: null
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
|
+
if (valueManager.areValuesEqual(utils, state.value, value)) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
140
143
|
var context = {
|
|
141
144
|
validationError: validator({
|
|
142
145
|
adapter: adapter,
|
|
@@ -158,9 +161,6 @@ export var useFieldState = function useFieldState(params) {
|
|
|
158
161
|
return addPositionPropertiesToSections(newSections, isRTL);
|
|
159
162
|
};
|
|
160
163
|
var clearValue = function clearValue() {
|
|
161
|
-
if (valueManager.areValuesEqual(utils, state.value, valueManager.emptyValue)) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
164
|
publishValue({
|
|
165
165
|
value: valueManager.emptyValue,
|
|
166
166
|
referenceValue: state.referenceValue,
|
|
@@ -172,16 +172,13 @@ export var useFieldState = function useFieldState(params) {
|
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
var activeSection = state.sections[selectedSectionIndexes.startIndex];
|
|
175
|
-
if (activeSection.value === '') {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
175
|
var activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);
|
|
179
176
|
var nonEmptySectionCountBefore = activeDateManager.getSections(state.sections).filter(function (section) {
|
|
180
177
|
return section.value !== '';
|
|
181
178
|
}).length;
|
|
182
|
-
var
|
|
179
|
+
var hasNoOtherNonEmptySections = nonEmptySectionCountBefore === (activeSection.value === '' ? 0 : 1);
|
|
183
180
|
var newSections = setSectionValue(selectedSectionIndexes.startIndex, '');
|
|
184
|
-
var newActiveDate =
|
|
181
|
+
var newActiveDate = hasNoOtherNonEmptySections ? null : utils.date(new Date(''));
|
|
185
182
|
var newValues = activeDateManager.getNewValuesFromNewActiveDate(newActiveDate);
|
|
186
183
|
if ((newActiveDate != null && !utils.isValid(newActiveDate)) !== (activeDateManager.date != null && !utils.isValid(activeDateManager.date))) {
|
|
187
184
|
publishValue(_extends({}, newValues, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
4
|
var _excluded = ["views", "format"];
|
|
4
|
-
import { resolveTimeFormat, isTimeView } from './time-utils';
|
|
5
|
+
import { resolveTimeFormat, isTimeView, isInternalTimeView } from './time-utils';
|
|
5
6
|
import { resolveDateFormat } from './date-utils';
|
|
6
7
|
export var resolveDateTimeFormat = function resolveDateTimeFormat(utils, _ref) {
|
|
7
8
|
var views = _ref.views,
|
|
@@ -36,4 +37,35 @@ export var resolveDateTimeFormat = function resolveDateTimeFormat(utils, _ref) {
|
|
|
36
37
|
views: dateViews
|
|
37
38
|
}, other), false);
|
|
38
39
|
return "".concat(dateFormat, " ").concat(timeFormat);
|
|
39
|
-
};
|
|
40
|
+
};
|
|
41
|
+
var resolveViews = function resolveViews(ampm, views, shouldUseSingleColumn) {
|
|
42
|
+
if (shouldUseSingleColumn) {
|
|
43
|
+
return views.filter(function (view) {
|
|
44
|
+
return !isInternalTimeView(view) || view === 'hours';
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return ampm ? [].concat(_toConsumableArray(views), ['meridiem']) : views;
|
|
48
|
+
};
|
|
49
|
+
var resolveShouldRenderTimeInASingleColumn = function resolveShouldRenderTimeInASingleColumn(timeSteps, threshold) {
|
|
50
|
+
var _timeSteps$hours, _timeSteps$minutes;
|
|
51
|
+
return 24 * 60 / (((_timeSteps$hours = timeSteps.hours) != null ? _timeSteps$hours : 1) * ((_timeSteps$minutes = timeSteps.minutes) != null ? _timeSteps$minutes : 5)) <= threshold;
|
|
52
|
+
};
|
|
53
|
+
export function resolveTimeViewsResponse(_ref2) {
|
|
54
|
+
var inThreshold = _ref2.thresholdToRenderTimeInASingleColumn,
|
|
55
|
+
ampm = _ref2.ampm,
|
|
56
|
+
inTimeSteps = _ref2.timeSteps,
|
|
57
|
+
views = _ref2.views;
|
|
58
|
+
var thresholdToRenderTimeInASingleColumn = inThreshold != null ? inThreshold : 24;
|
|
59
|
+
var timeSteps = _extends({
|
|
60
|
+
hours: 1,
|
|
61
|
+
minutes: 5,
|
|
62
|
+
seconds: 5
|
|
63
|
+
}, inTimeSteps);
|
|
64
|
+
var shouldRenderTimeInASingleColumn = resolveShouldRenderTimeInASingleColumn(timeSteps, thresholdToRenderTimeInASingleColumn);
|
|
65
|
+
return {
|
|
66
|
+
thresholdToRenderTimeInASingleColumn: thresholdToRenderTimeInASingleColumn,
|
|
67
|
+
timeSteps: timeSteps,
|
|
68
|
+
shouldRenderTimeInASingleColumn: shouldRenderTimeInASingleColumn,
|
|
69
|
+
views: resolveViews(ampm, views, shouldRenderTimeInASingleColumn)
|
|
70
|
+
};
|
|
71
|
+
}
|
package/legacy/locales/esES.js
CHANGED
|
@@ -68,7 +68,7 @@ var esESPickers = {
|
|
|
68
68
|
dateTableLabel: 'elige la hora',
|
|
69
69
|
// Field section placeholders
|
|
70
70
|
fieldYearPlaceholder: function fieldYearPlaceholder(params) {
|
|
71
|
-
return '
|
|
71
|
+
return 'A'.repeat(params.digitAmount);
|
|
72
72
|
},
|
|
73
73
|
fieldMonthPlaceholder: function fieldMonthPlaceholder(params) {
|
|
74
74
|
return params.contentType === 'letter' ? 'MMMM' : 'MM';
|
package/locales/esES.js
CHANGED
|
@@ -47,7 +47,7 @@ const esESPickers = {
|
|
|
47
47
|
timeTableLabel: 'elige la fecha',
|
|
48
48
|
dateTableLabel: 'elige la hora',
|
|
49
49
|
// Field section placeholders
|
|
50
|
-
fieldYearPlaceholder: params => '
|
|
50
|
+
fieldYearPlaceholder: params => 'A'.repeat(params.digitAmount),
|
|
51
51
|
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
52
52
|
fieldDayPlaceholder: () => 'DD',
|
|
53
53
|
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
@@ -295,13 +295,15 @@ export class AdapterDayjs {
|
|
|
295
295
|
return parsedValue.locale(this.locale);
|
|
296
296
|
};
|
|
297
297
|
this.getTimezone = value => {
|
|
298
|
-
if (this.hasUTCPlugin() && value.isUTC()) {
|
|
299
|
-
return 'UTC';
|
|
300
|
-
}
|
|
301
298
|
if (this.hasTimezonePlugin()) {
|
|
302
299
|
// @ts-ignore
|
|
303
300
|
const zone = value.$x?.$timezone;
|
|
304
|
-
|
|
301
|
+
if (zone) {
|
|
302
|
+
return zone;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (this.hasUTCPlugin() && value.isUTC()) {
|
|
306
|
+
return 'UTC';
|
|
305
307
|
}
|
|
306
308
|
return 'system';
|
|
307
309
|
};
|
|
@@ -239,16 +239,13 @@ export class AdapterMoment {
|
|
|
239
239
|
return this.createTZDate(value, timezone);
|
|
240
240
|
};
|
|
241
241
|
this.getTimezone = value => {
|
|
242
|
-
if (value.isUTC()) {
|
|
243
|
-
return 'UTC';
|
|
244
|
-
}
|
|
245
|
-
|
|
246
242
|
// @ts-ignore
|
|
247
243
|
// eslint-disable-next-line no-underscore-dangle
|
|
248
244
|
const zone = value._z?.name;
|
|
245
|
+
const defaultZone = value.isUTC() ? 'UTC' : 'system';
|
|
249
246
|
|
|
250
247
|
// @ts-ignore
|
|
251
|
-
return zone ?? this.moment.defaultZone?.name ??
|
|
248
|
+
return zone ?? this.moment.defaultZone?.name ?? defaultZone;
|
|
252
249
|
};
|
|
253
250
|
this.setTimezone = (value, timezone) => {
|
|
254
251
|
if (this.getTimezone(value) === timezone) {
|
|
@@ -12,6 +12,16 @@ import { refType } from '@mui/utils';
|
|
|
12
12
|
import { useDateField } from './useDateField';
|
|
13
13
|
import { useClearableField } from '../hooks';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [DateField](http://mui.com/x/react-date-pickers/date-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [DateField API](https://mui.com/x/api/date-pickers/date-field/)
|
|
24
|
+
*/
|
|
15
25
|
const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref) {
|
|
16
26
|
const themeProps = useThemeProps({
|
|
17
27
|
props: inProps,
|
|
@@ -102,7 +112,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
102
112
|
/**
|
|
103
113
|
* The color of the component.
|
|
104
114
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
105
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
115
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
106
116
|
* @default 'primary'
|
|
107
117
|
*/
|
|
108
118
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
@@ -10,6 +10,16 @@ import { DesktopDatePicker } from '../DesktopDatePicker';
|
|
|
10
10
|
import { MobileDatePicker } from '../MobileDatePicker';
|
|
11
11
|
import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
* Demos:
|
|
15
|
+
*
|
|
16
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
17
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [DatePicker API](https://mui.com/x/api/date-pickers/date-picker/)
|
|
22
|
+
*/
|
|
13
23
|
const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker(inProps, ref) {
|
|
14
24
|
const props = useThemeProps({
|
|
15
25
|
props: inProps,
|
|
@@ -39,6 +39,16 @@ const DatePickerToolbarTitle = styled(Typography, {
|
|
|
39
39
|
}) => _extends({}, ownerState.isLandscape && {
|
|
40
40
|
margin: 'auto 16px auto auto'
|
|
41
41
|
}));
|
|
42
|
+
/**
|
|
43
|
+
* Demos:
|
|
44
|
+
*
|
|
45
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
46
|
+
* - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)
|
|
47
|
+
*
|
|
48
|
+
* API:
|
|
49
|
+
*
|
|
50
|
+
* - [DatePickerToolbar API](https://mui.com/x/api/date-pickers/date-picker-toolbar/)
|
|
51
|
+
*/
|
|
42
52
|
const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePickerToolbar(inProps, ref) {
|
|
43
53
|
const props = useThemeProps({
|
|
44
54
|
props: inProps,
|
|
@@ -12,6 +12,16 @@ import { refType } from '@mui/utils';
|
|
|
12
12
|
import { useDateTimeField } from './useDateTimeField';
|
|
13
13
|
import { useClearableField } from '../hooks';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [DateTimeField](http://mui.com/x/react-date-pickers/date-time-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [DateTimeField API](https://mui.com/x/api/date-pickers/date-time-field/)
|
|
24
|
+
*/
|
|
15
25
|
const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inProps, ref) {
|
|
16
26
|
const themeProps = useThemeProps({
|
|
17
27
|
props: inProps,
|
|
@@ -107,7 +117,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
107
117
|
/**
|
|
108
118
|
* The color of the component.
|
|
109
119
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
110
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
120
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
111
121
|
* @default 'primary'
|
|
112
122
|
*/
|
|
113
123
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
@@ -10,6 +10,16 @@ import { DesktopDateTimePicker } from '../DesktopDateTimePicker';
|
|
|
10
10
|
import { MobileDateTimePicker } from '../MobileDateTimePicker';
|
|
11
11
|
import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
* Demos:
|
|
15
|
+
*
|
|
16
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
17
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [DateTimePicker API](https://mui.com/x/api/date-pickers/date-time-picker/)
|
|
22
|
+
*/
|
|
13
23
|
const DateTimePicker = /*#__PURE__*/React.forwardRef(function DateTimePicker(inProps, ref) {
|
|
14
24
|
const props = useThemeProps({
|
|
15
25
|
props: inProps,
|
|
@@ -377,6 +387,11 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
377
387
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
378
388
|
*/
|
|
379
389
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
390
|
+
/**
|
|
391
|
+
* Amount of time options below or at which the single column time renderer is used.
|
|
392
|
+
* @default 24
|
|
393
|
+
*/
|
|
394
|
+
thresholdToRenderTimeInASingleColumn: PropTypes.number,
|
|
380
395
|
/**
|
|
381
396
|
* The time steps between two time unit options.
|
|
382
397
|
* For example, if `timeStep.minutes = 8`, then the available minute options will be `[0, 8, 16, 24, 32, 40, 48, 56]`.
|
|
@@ -47,6 +47,17 @@ const DateTimePickerTabsRoot = styled(Tabs, {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}));
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Demos:
|
|
53
|
+
*
|
|
54
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
55
|
+
* - [Custom slots and subcomponents](https://mui.com/x/react-date-pickers/custom-components/)
|
|
56
|
+
*
|
|
57
|
+
* API:
|
|
58
|
+
*
|
|
59
|
+
* - [DateTimePickerTabs API](https://mui.com/x/api/date-pickers/date-time-picker-tabs/)
|
|
60
|
+
*/
|
|
50
61
|
const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
51
62
|
const props = useThemeProps({
|
|
52
63
|
props: inProps,
|
|
@@ -153,6 +153,17 @@ const DateTimePickerToolbarAmPmSelection = styled('div', {
|
|
|
153
153
|
fontSize: 17
|
|
154
154
|
}
|
|
155
155
|
}));
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Demos:
|
|
159
|
+
*
|
|
160
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
161
|
+
* - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)
|
|
162
|
+
*
|
|
163
|
+
* API:
|
|
164
|
+
*
|
|
165
|
+
* - [DateTimePickerToolbar API](https://mui.com/x/api/date-pickers/date-time-picker-toolbar/)
|
|
166
|
+
*/
|
|
156
167
|
function DateTimePickerToolbar(inProps) {
|
|
157
168
|
const props = useThemeProps({
|
|
158
169
|
props: inProps,
|
|
@@ -60,10 +60,9 @@ DayCalendarSkeletonDay.propTypes = {
|
|
|
60
60
|
const monthMap = [[0, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 0, 0, 0]];
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
64
63
|
* Demos:
|
|
65
64
|
*
|
|
66
|
-
* - [
|
|
65
|
+
* - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)
|
|
67
66
|
*
|
|
68
67
|
* API:
|
|
69
68
|
*
|
|
@@ -12,6 +12,16 @@ import { DateField } from '../DateField';
|
|
|
12
12
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
13
13
|
import { renderDateViewCalendar } from '../dateViewRenderers';
|
|
14
14
|
import { resolveDateFormat } from '../internals/utils/date-utils';
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
19
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [DesktopDatePicker API](https://mui.com/x/api/date-pickers/desktop-date-picker/)
|
|
24
|
+
*/
|
|
15
25
|
const DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePicker(inProps, ref) {
|
|
16
26
|
const localeText = useLocaleText();
|
|
17
27
|
const utils = useUtils();
|
|
@@ -13,18 +13,29 @@ import { validateDateTime } from '../internals/utils/validation/validateDateTime
|
|
|
13
13
|
import { CalendarIcon } from '../icons';
|
|
14
14
|
import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
15
15
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
16
|
-
import { resolveDateTimeFormat } from '../internals/utils/date-time-utils';
|
|
16
|
+
import { resolveDateTimeFormat, resolveTimeViewsResponse } from '../internals/utils/date-time-utils';
|
|
17
|
+
/**
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
21
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [DesktopDateTimePicker API](https://mui.com/x/api/date-pickers/desktop-date-time-picker/)
|
|
26
|
+
*/
|
|
17
27
|
const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTimePicker(inProps, ref) {
|
|
18
28
|
const localeText = useLocaleText();
|
|
19
29
|
const utils = useUtils();
|
|
20
30
|
|
|
21
31
|
// Props with the default values common to all date time pickers
|
|
22
32
|
const defaultizedProps = useDateTimePickerDefaultizedProps(inProps, 'MuiDesktopDateTimePicker');
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
const {
|
|
34
|
+
shouldRenderTimeInASingleColumn,
|
|
35
|
+
thresholdToRenderTimeInASingleColumn,
|
|
36
|
+
views,
|
|
37
|
+
timeSteps
|
|
38
|
+
} = resolveTimeViewsResponse(defaultizedProps);
|
|
28
39
|
const shouldUseNewRenderer = !defaultizedProps.viewRenderers || Object.keys(defaultizedProps.viewRenderers).length === 0;
|
|
29
40
|
const viewRenderers =
|
|
30
41
|
// we can only ensure the expected two-column layout if none of the renderers are overridden
|
|
@@ -53,10 +64,12 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
53
64
|
const props = _extends({}, defaultizedProps, {
|
|
54
65
|
viewRenderers,
|
|
55
66
|
format: resolveDateTimeFormat(utils, defaultizedProps),
|
|
56
|
-
views
|
|
67
|
+
views,
|
|
57
68
|
yearsPerRow: defaultizedProps.yearsPerRow ?? 4,
|
|
58
69
|
ampmInClock,
|
|
59
70
|
timeSteps,
|
|
71
|
+
thresholdToRenderTimeInASingleColumn,
|
|
72
|
+
shouldRenderTimeInASingleColumn,
|
|
60
73
|
slots: _extends({
|
|
61
74
|
field: DateTimeField,
|
|
62
75
|
openPickerIcon: CalendarIcon
|
|
@@ -427,6 +440,11 @@ DesktopDateTimePicker.propTypes = {
|
|
|
427
440
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
428
441
|
*/
|
|
429
442
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
443
|
+
/**
|
|
444
|
+
* Amount of time options below or at which the single column time renderer is used.
|
|
445
|
+
* @default 24
|
|
446
|
+
*/
|
|
447
|
+
thresholdToRenderTimeInASingleColumn: PropTypes.number,
|
|
430
448
|
/**
|
|
431
449
|
* The time steps between two time unit options.
|
|
432
450
|
* For example, if `timeStep.minutes = 8`, then the available minute options will be `[0, 8, 16, 24, 32, 40, 48, 56]`.
|
|
@@ -13,19 +13,28 @@ import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
|
13
13
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
14
14
|
import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from '../timeViewRenderers';
|
|
15
15
|
import { resolveTimeFormat } from '../internals/utils/time-utils';
|
|
16
|
+
import { resolveTimeViewsResponse } from '../internals/utils/date-time-utils';
|
|
17
|
+
/**
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
21
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [DesktopTimePicker API](https://mui.com/x/api/date-pickers/desktop-time-picker/)
|
|
26
|
+
*/
|
|
16
27
|
const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePicker(inProps, ref) {
|
|
17
28
|
const localeText = useLocaleText();
|
|
18
29
|
const utils = useUtils();
|
|
19
30
|
|
|
20
31
|
// Props with the default values common to all time pickers
|
|
21
32
|
const defaultizedProps = useTimePickerDefaultizedProps(inProps, 'MuiDesktopTimePicker');
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, defaultizedProps.timeSteps);
|
|
28
|
-
const shouldRenderTimeInASingleColumn = 24 * 60 / (timeSteps.hours * timeSteps.minutes) <= thresholdToRenderTimeInASingleColumn;
|
|
33
|
+
const {
|
|
34
|
+
shouldRenderTimeInASingleColumn,
|
|
35
|
+
views: resolvedViews,
|
|
36
|
+
timeSteps
|
|
37
|
+
} = resolveTimeViewsResponse(defaultizedProps);
|
|
29
38
|
const renderTimeView = shouldRenderTimeInASingleColumn ? renderDigitalClockTimeView : renderMultiSectionDigitalClockTimeView;
|
|
30
39
|
const viewRenderers = _extends({
|
|
31
40
|
hours: renderTimeView,
|
|
@@ -37,7 +46,7 @@ const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePick
|
|
|
37
46
|
const actionBarActions = shouldRenderTimeInASingleColumn ? [] : ['accept'];
|
|
38
47
|
// Need to avoid adding the `meridiem` view when unexpected renderer is specified
|
|
39
48
|
const shouldHoursRendererContainMeridiemView = viewRenderers.hours?.name === renderMultiSectionDigitalClockTimeView.name;
|
|
40
|
-
const views =
|
|
49
|
+
const views = !shouldHoursRendererContainMeridiemView ? resolvedViews.filter(view => view !== 'meridiem') : resolvedViews;
|
|
41
50
|
|
|
42
51
|
// Props with the default values specific to the desktop variant
|
|
43
52
|
const props = _extends({}, defaultizedProps, {
|
|
@@ -79,6 +79,16 @@ const DigitalClockItem = styled(MenuItem, {
|
|
|
79
79
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.focusOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.focusOpacity)
|
|
80
80
|
}
|
|
81
81
|
}));
|
|
82
|
+
/**
|
|
83
|
+
* Demos:
|
|
84
|
+
*
|
|
85
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
86
|
+
* - [DigitalClock](https://mui.com/x/react-date-pickers/digital-clock/)
|
|
87
|
+
*
|
|
88
|
+
* API:
|
|
89
|
+
*
|
|
90
|
+
* - [DigitalClock API](https://mui.com/x/api/date-pickers/digital-clock/)
|
|
91
|
+
*/
|
|
82
92
|
export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(inProps, ref) {
|
|
83
93
|
const utils = useUtils();
|
|
84
94
|
const containerRef = React.useRef(null);
|
|
@@ -152,7 +162,7 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
152
162
|
props,
|
|
153
163
|
timezone
|
|
154
164
|
});
|
|
155
|
-
const handleValueChange = useEventCallback(newValue => handleRawValueChange(newValue, 'finish'));
|
|
165
|
+
const handleValueChange = useEventCallback(newValue => handleRawValueChange(newValue, 'finish', 'hours'));
|
|
156
166
|
const {
|
|
157
167
|
setValueAndGoToNextView
|
|
158
168
|
} = useViews({
|
|
@@ -9,6 +9,18 @@ export const MuiPickersAdapterContext = /*#__PURE__*/React.createContext(null);
|
|
|
9
9
|
if (process.env.NODE_ENV !== 'production') {
|
|
10
10
|
MuiPickersAdapterContext.displayName = 'MuiPickersAdapterContext';
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Demos:
|
|
14
|
+
*
|
|
15
|
+
* - [Date format and localization](https://mui.com/x/react-date-pickers/adapters-locale/)
|
|
16
|
+
* - [Calendar systems](https://mui.com/x/react-date-pickers/calendar-systems/)
|
|
17
|
+
* - [Translated components](https://mui.com/x/react-date-pickers/localization/)
|
|
18
|
+
* - [UTC and timezones](https://mui.com/x/react-date-pickers/timezone/)
|
|
19
|
+
*
|
|
20
|
+
* API:
|
|
21
|
+
*
|
|
22
|
+
* - [LocalizationProvider API](https://mui.com/x/api/date-pickers/localization-provider/)
|
|
23
|
+
*/
|
|
12
24
|
export const LocalizationProvider = function LocalizationProvider(inProps) {
|
|
13
25
|
const {
|
|
14
26
|
localeText: inLocaleText
|
|
@@ -11,6 +11,16 @@ import { extractValidationProps } from '../internals/utils/validation/extractVal
|
|
|
11
11
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
12
12
|
import { renderDateViewCalendar } from '../dateViewRenderers';
|
|
13
13
|
import { resolveDateFormat } from '../internals/utils/date-utils';
|
|
14
|
+
/**
|
|
15
|
+
* Demos:
|
|
16
|
+
*
|
|
17
|
+
* - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)
|
|
18
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
19
|
+
*
|
|
20
|
+
* API:
|
|
21
|
+
*
|
|
22
|
+
* - [MobileDatePicker API](https://mui.com/x/api/date-pickers/mobile-date-picker/)
|
|
23
|
+
*/
|
|
14
24
|
const MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker(inProps, ref) {
|
|
15
25
|
const localeText = useLocaleText();
|
|
16
26
|
const utils = useUtils();
|
|
@@ -13,6 +13,16 @@ import { extractValidationProps } from '../internals/utils/validation/extractVal
|
|
|
13
13
|
import { renderDateViewCalendar } from '../dateViewRenderers';
|
|
14
14
|
import { renderTimeViewClock } from '../timeViewRenderers';
|
|
15
15
|
import { resolveDateTimeFormat } from '../internals/utils/date-time-utils';
|
|
16
|
+
/**
|
|
17
|
+
* Demos:
|
|
18
|
+
*
|
|
19
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
20
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
21
|
+
*
|
|
22
|
+
* API:
|
|
23
|
+
*
|
|
24
|
+
* - [MobileDateTimePicker API](https://mui.com/x/api/date-pickers/mobile-date-time-picker/)
|
|
25
|
+
*/
|
|
16
26
|
const MobileDateTimePicker = /*#__PURE__*/React.forwardRef(function MobileDateTimePicker(inProps, ref) {
|
|
17
27
|
const localeText = useLocaleText();
|
|
18
28
|
const utils = useUtils();
|
|
@@ -12,6 +12,16 @@ import { useMobilePicker } from '../internals/hooks/useMobilePicker';
|
|
|
12
12
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
13
13
|
import { renderTimeViewClock } from '../timeViewRenderers';
|
|
14
14
|
import { resolveTimeFormat } from '../internals/utils/time-utils';
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
19
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [MobileTimePicker API](https://mui.com/x/api/date-pickers/mobile-time-picker/)
|
|
24
|
+
*/
|
|
15
25
|
const MobileTimePicker = /*#__PURE__*/React.forwardRef(function MobileTimePicker(inProps, ref) {
|
|
16
26
|
const localeText = useLocaleText();
|
|
17
27
|
const utils = useUtils();
|
|
@@ -41,6 +41,16 @@ const MultiSectionDigitalClockRoot = styled(PickerViewRoot, {
|
|
|
41
41
|
width: '100%',
|
|
42
42
|
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
43
43
|
}));
|
|
44
|
+
/**
|
|
45
|
+
* Demos:
|
|
46
|
+
*
|
|
47
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
48
|
+
* - [DigitalClock](https://mui.com/x/react-date-pickers/digital-clock/)
|
|
49
|
+
*
|
|
50
|
+
* API:
|
|
51
|
+
*
|
|
52
|
+
* - [MultiSectionDigitalClock API](https://mui.com/x/api/date-pickers/multi-section-digital-clock/)
|
|
53
|
+
*/
|
|
44
54
|
export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function MultiSectionDigitalClock(inProps, ref) {
|
|
45
55
|
const utils = useUtils();
|
|
46
56
|
const props = useThemeProps({
|
|
@@ -7,6 +7,16 @@ import Button from '@mui/material/Button';
|
|
|
7
7
|
import DialogActions from '@mui/material/DialogActions';
|
|
8
8
|
import { useLocaleText } from '../internals/hooks/useUtils';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
/**
|
|
11
|
+
* Demos:
|
|
12
|
+
*
|
|
13
|
+
* - [Custom slots and subcomponents](https://mui.com/x/react-date-pickers/custom-components/)
|
|
14
|
+
* - [Custom layout](https://mui.com/x/react-date-pickers/custom-layout/)
|
|
15
|
+
*
|
|
16
|
+
* API:
|
|
17
|
+
*
|
|
18
|
+
* - [PickersActionBar API](https://mui.com/x/api/date-pickers/pickers-action-bar/)
|
|
19
|
+
*/
|
|
10
20
|
function PickersActionBar(props) {
|
|
11
21
|
const {
|
|
12
22
|
onAccept,
|