@mui/x-date-pickers 7.0.0-beta.6 → 7.0.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/AdapterDateFns/AdapterDateFns.js +1 -1
- package/AdapterDateFnsBase/AdapterDateFnsBase.js +1 -2
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +2 -4
- package/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -1
- package/AdapterDayjs/AdapterDayjs.js +2 -4
- package/AdapterLuxon/AdapterLuxon.js +12 -9
- package/AdapterMoment/AdapterMoment.js +5 -6
- package/CHANGELOG.md +311 -12
- package/DateCalendar/DateCalendar.js +14 -16
- package/DateCalendar/DayCalendar.js +7 -7
- package/DateField/DateField.js +3 -4
- package/DatePicker/DatePicker.js +1 -1
- package/DatePicker/shared.d.ts +2 -1
- package/DatePicker/shared.js +3 -5
- package/DateTimeField/DateTimeField.js +3 -4
- package/DateTimePicker/DateTimePicker.js +1 -1
- package/DateTimePicker/DateTimePickerToolbar.js +1 -1
- package/DateTimePicker/shared.d.ts +2 -1
- package/DateTimePicker/shared.js +11 -13
- package/DesktopDatePicker/DesktopDatePicker.js +7 -11
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +72 -37
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.d.ts +12 -0
- package/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +101 -0
- package/DesktopDateTimePicker/index.d.ts +1 -0
- package/DesktopDateTimePicker/index.js +2 -1
- package/DesktopTimePicker/DesktopTimePicker.js +8 -12
- package/DigitalClock/DigitalClock.js +2 -3
- package/LocalizationProvider/LocalizationProvider.js +1 -2
- package/MobileDatePicker/MobileDatePicker.js +6 -10
- package/MobileDateTimePicker/MobileDateTimePicker.js +8 -12
- package/MobileTimePicker/MobileTimePicker.js +6 -10
- package/MonthCalendar/MonthCalendar.js +4 -4
- package/MonthCalendar/PickersMonth.js +1 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +3 -5
- package/PickersActionBar/PickersActionBar.js +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.d.ts +1 -1
- package/PickersCalendarHeader/PickersCalendarHeader.js +4 -5
- package/PickersLayout/usePickerLayout.js +8 -9
- package/PickersSectionList/PickersSectionList.js +9 -11
- package/PickersTextField/PickersFilledInput/PickersFilledInput.js +2 -3
- package/PickersTextField/PickersInput/PickersInput.js +1 -1
- package/PickersTextField/PickersInputBase/PickersInputBase.js +4 -5
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +2 -2
- package/README.md +1 -1
- package/StaticDatePicker/StaticDatePicker.js +4 -5
- package/StaticDateTimePicker/StaticDateTimePicker.js +6 -7
- package/StaticTimePicker/StaticTimePicker.js +3 -4
- package/TimeClock/TimeClock.js +1 -1
- package/TimeField/TimeField.js +2 -3
- package/TimePicker/shared.d.ts +2 -1
- package/TimePicker/shared.js +5 -7
- package/YearCalendar/YearCalendar.js +5 -6
- package/hooks/useClearableField.js +6 -7
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +8 -9
- package/internals/components/PickersModalDialog.js +6 -7
- package/internals/components/PickersPopper.js +13 -16
- package/internals/components/PickersToolbar.js +9 -12
- package/internals/hooks/date-helpers-hooks.js +1 -1
- package/internals/hooks/defaultizedFieldProps.js +15 -18
- package/internals/hooks/useClockReferenceDate.js +1 -1
- package/internals/hooks/useDesktopPicker/index.d.ts +1 -1
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +11 -12
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +2 -2
- package/internals/hooks/useField/buildSectionsFromFormat.js +35 -31
- package/internals/hooks/useField/useField.js +2 -2
- package/internals/hooks/useField/useField.utils.js +4 -7
- package/internals/hooks/useField/useFieldCharacterEditing.js +1 -2
- package/internals/hooks/useField/useFieldState.js +1 -1
- package/internals/hooks/useField/useFieldV6TextField.js +9 -15
- package/internals/hooks/useField/useFieldV7TextField.js +11 -13
- package/internals/hooks/useMobilePicker/useMobilePicker.js +7 -8
- package/internals/hooks/useOpenState.js +1 -1
- package/internals/hooks/usePicker/index.d.ts +1 -0
- package/internals/hooks/usePicker/usePickerViews.d.ts +4 -2
- package/internals/hooks/usePicker/usePickerViews.js +1 -2
- package/internals/hooks/useStaticPicker/useStaticPicker.js +13 -17
- package/internals/hooks/useValueWithTimezone.js +5 -6
- package/internals/hooks/useViews.js +3 -4
- package/internals/index.d.ts +1 -1
- package/internals/models/validation.d.ts +1 -1
- package/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js +3 -3
- package/internals/utils/date-time-utils.js +2 -5
- package/internals/utils/date-utils.d.ts +1 -1
- package/internals/utils/date-utils.js +8 -8
- package/internals/utils/fields.js +1 -1
- package/internals/utils/getDefaultReferenceDate.js +2 -6
- package/internals/utils/views.js +1 -1
- package/locales/csCZ.js +1 -4
- package/locales/daDK.js +1 -4
- package/locales/deDE.js +1 -4
- package/locales/huHU.js +1 -4
- package/locales/jaJP.js +16 -23
- package/locales/roRO.js +1 -4
- package/locales/skSK.js +1 -4
- package/modern/AdapterLuxon/AdapterLuxon.js +9 -4
- package/modern/DateCalendar/DateCalendar.js +1 -1
- package/modern/DateCalendar/DayCalendar.js +2 -1
- package/modern/DateField/DateField.js +1 -1
- package/modern/DatePicker/DatePicker.js +1 -1
- package/modern/DateTimeField/DateTimeField.js +1 -1
- package/modern/DateTimePicker/DateTimePicker.js +1 -1
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +64 -25
- package/modern/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +101 -0
- package/modern/DesktopDateTimePicker/index.js +2 -1
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersPopper.js +1 -1
- package/modern/internals/hooks/useField/buildSectionsFromFormat.js +34 -30
- package/modern/internals/hooks/useField/useFieldV7TextField.js +3 -3
- package/modern/internals/hooks/useOpenState.js +1 -1
- package/modern/internals/utils/date-utils.js +8 -8
- package/modern/internals/utils/fields.js +1 -1
- package/modern/locales/jaJP.js +15 -19
- package/node/AdapterLuxon/AdapterLuxon.js +9 -4
- package/node/DateCalendar/DateCalendar.js +1 -1
- package/node/DateCalendar/DayCalendar.js +2 -1
- package/node/DateField/DateField.js +1 -1
- package/node/DatePicker/DatePicker.js +1 -1
- package/node/DateTimeField/DateTimeField.js +1 -1
- package/node/DateTimePicker/DateTimePicker.js +1 -1
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +63 -25
- package/node/DesktopDateTimePicker/DesktopDateTimePickerLayout.js +108 -0
- package/node/DesktopDateTimePicker/index.js +8 -1
- package/node/MobileDatePicker/MobileDatePicker.js +1 -1
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/node/StaticDatePicker/StaticDatePicker.js +1 -1
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/components/PickersPopper.js +1 -1
- package/node/internals/hooks/useField/buildSectionsFromFormat.js +34 -30
- package/node/internals/hooks/useField/useFieldV7TextField.js +3 -3
- package/node/internals/hooks/useOpenState.js +1 -1
- package/node/internals/utils/date-utils.js +9 -9
- package/node/internals/utils/fields.js +1 -1
- package/node/locales/jaJP.js +15 -19
- package/package.json +5 -5
- package/timeViewRenderers/timeViewRenderers.js +1 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +0 -15
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -163
- package/dateTimeViewRenderers/index.d.ts +0 -2
- package/dateTimeViewRenderers/index.js +0 -1
- package/dateTimeViewRenderers/package.json +0 -6
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -162
- package/modern/dateTimeViewRenderers/index.js +0 -1
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -171
- package/node/dateTimeViewRenderers/index.js +0 -12
|
@@ -1,19 +1,64 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["openTo", "focusedView", "timeViewsCount"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
6
|
import { resolveComponentProps } from '@mui/base/utils';
|
|
5
7
|
import { refType } from '@mui/utils';
|
|
8
|
+
import Divider from '@mui/material/Divider';
|
|
6
9
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
7
10
|
import { DateTimeField } from '../DateTimeField';
|
|
8
11
|
import { useDateTimePickerDefaultizedProps } from '../DateTimePicker/shared';
|
|
9
12
|
import { renderDateViewCalendar } from '../dateViewRenderers/dateViewRenderers';
|
|
10
|
-
import { renderDesktopDateTimeView } from '../dateTimeViewRenderers';
|
|
11
13
|
import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
|
|
12
14
|
import { validateDateTime } from '../internals/utils/validation/validateDateTime';
|
|
13
15
|
import { CalendarIcon } from '../icons';
|
|
14
16
|
import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
15
17
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
16
18
|
import { resolveDateTimeFormat, resolveTimeViewsResponse } from '../internals/utils/date-time-utils';
|
|
19
|
+
import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from '../timeViewRenderers';
|
|
20
|
+
import { VIEW_HEIGHT, isDatePickerView, isInternalTimeView } from '../internals';
|
|
21
|
+
import { multiSectionDigitalClockClasses, multiSectionDigitalClockSectionClasses } from '../MultiSectionDigitalClock';
|
|
22
|
+
import { digitalClockClasses } from '../DigitalClock';
|
|
23
|
+
import { DesktopDateTimePickerLayout } from './DesktopDateTimePickerLayout';
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
const rendererInterceptor = function rendererInterceptor(inViewRenderers, popperView, rendererProps) {
|
|
27
|
+
const {
|
|
28
|
+
openTo,
|
|
29
|
+
focusedView,
|
|
30
|
+
timeViewsCount
|
|
31
|
+
} = rendererProps,
|
|
32
|
+
otherProps = _objectWithoutPropertiesLoose(rendererProps, _excluded);
|
|
33
|
+
const finalProps = _extends({}, otherProps, {
|
|
34
|
+
focusedView: null,
|
|
35
|
+
sx: [{
|
|
36
|
+
[`&.${multiSectionDigitalClockClasses.root}`]: {
|
|
37
|
+
borderBottom: 0
|
|
38
|
+
},
|
|
39
|
+
[`&.${multiSectionDigitalClockClasses.root}, .${multiSectionDigitalClockSectionClasses.root}, &.${digitalClockClasses.root}`]: {
|
|
40
|
+
maxHeight: VIEW_HEIGHT
|
|
41
|
+
}
|
|
42
|
+
}]
|
|
43
|
+
});
|
|
44
|
+
const isTimeViewActive = isInternalTimeView(popperView);
|
|
45
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
46
|
+
children: [inViewRenderers[!isTimeViewActive ? popperView : 'day']?.(_extends({}, rendererProps, {
|
|
47
|
+
view: !isTimeViewActive ? popperView : 'day',
|
|
48
|
+
focusedView: focusedView && isDatePickerView(focusedView) ? focusedView : null,
|
|
49
|
+
views: rendererProps.views.filter(isDatePickerView)
|
|
50
|
+
})), timeViewsCount > 0 && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
51
|
+
children: [/*#__PURE__*/_jsx(Divider, {
|
|
52
|
+
orientation: "vertical"
|
|
53
|
+
}), inViewRenderers[isTimeViewActive ? popperView : 'hours']?.(_extends({}, finalProps, {
|
|
54
|
+
view: isTimeViewActive ? popperView : 'hours',
|
|
55
|
+
focusedView: focusedView && isInternalTimeView(focusedView) ? focusedView : null,
|
|
56
|
+
openTo: isInternalTimeView(openTo) ? openTo : 'hours',
|
|
57
|
+
views: rendererProps.views.filter(isInternalTimeView)
|
|
58
|
+
}))]
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
};
|
|
17
62
|
/**
|
|
18
63
|
* Demos:
|
|
19
64
|
*
|
|
@@ -33,32 +78,24 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
33
78
|
const {
|
|
34
79
|
shouldRenderTimeInASingleColumn,
|
|
35
80
|
thresholdToRenderTimeInASingleColumn,
|
|
36
|
-
views,
|
|
81
|
+
views: resolvedViews,
|
|
37
82
|
timeSteps
|
|
38
83
|
} = resolveTimeViewsResponse(defaultizedProps);
|
|
39
|
-
const
|
|
40
|
-
const viewRenderers =
|
|
41
|
-
// we can only ensure the expected two-column layout if none of the renderers are overridden
|
|
42
|
-
shouldUseNewRenderer ? {
|
|
43
|
-
day: renderDesktopDateTimeView,
|
|
44
|
-
month: renderDesktopDateTimeView,
|
|
45
|
-
year: renderDesktopDateTimeView,
|
|
46
|
-
hours: renderDesktopDateTimeView,
|
|
47
|
-
minutes: renderDesktopDateTimeView,
|
|
48
|
-
seconds: renderDesktopDateTimeView,
|
|
49
|
-
meridiem: renderDesktopDateTimeView
|
|
50
|
-
} : _extends({
|
|
84
|
+
const renderTimeView = shouldRenderTimeInASingleColumn ? renderDigitalClockTimeView : renderMultiSectionDigitalClockTimeView;
|
|
85
|
+
const viewRenderers = _extends({
|
|
51
86
|
day: renderDateViewCalendar,
|
|
52
87
|
month: renderDateViewCalendar,
|
|
53
88
|
year: renderDateViewCalendar,
|
|
54
|
-
hours:
|
|
55
|
-
minutes:
|
|
56
|
-
seconds:
|
|
57
|
-
meridiem:
|
|
89
|
+
hours: renderTimeView,
|
|
90
|
+
minutes: renderTimeView,
|
|
91
|
+
seconds: renderTimeView,
|
|
92
|
+
meridiem: renderTimeView
|
|
58
93
|
}, defaultizedProps.viewRenderers);
|
|
59
94
|
const ampmInClock = defaultizedProps.ampmInClock ?? true;
|
|
60
|
-
//
|
|
61
|
-
const
|
|
95
|
+
// Need to avoid adding the `meridiem` view when unexpected renderer is specified
|
|
96
|
+
const shouldHoursRendererContainMeridiemView = viewRenderers.hours?.name === renderMultiSectionDigitalClockTimeView.name;
|
|
97
|
+
const views = !shouldHoursRendererContainMeridiemView ? resolvedViews.filter(view => view !== 'meridiem') : resolvedViews;
|
|
98
|
+
const actionBarActions = shouldRenderTimeInASingleColumn ? [] : ['accept'];
|
|
62
99
|
|
|
63
100
|
// Props with the default values specific to the desktop variant
|
|
64
101
|
const props = _extends({}, defaultizedProps, {
|
|
@@ -72,6 +109,7 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
72
109
|
shouldRenderTimeInASingleColumn,
|
|
73
110
|
slots: _extends({
|
|
74
111
|
field: DateTimeField,
|
|
112
|
+
layout: DesktopDateTimePickerLayout,
|
|
75
113
|
openPickerIcon: CalendarIcon
|
|
76
114
|
}, defaultizedProps.slots),
|
|
77
115
|
slotProps: _extends({}, defaultizedProps.slotProps, {
|
|
@@ -81,14 +119,14 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
81
119
|
toolbar: _extends({
|
|
82
120
|
hidden: true,
|
|
83
121
|
ampmInClock,
|
|
84
|
-
toolbarVariant:
|
|
122
|
+
toolbarVariant: 'desktop'
|
|
85
123
|
}, defaultizedProps.slotProps?.toolbar),
|
|
86
124
|
tabs: _extends({
|
|
87
125
|
hidden: true
|
|
88
126
|
}, defaultizedProps.slotProps?.tabs),
|
|
89
|
-
actionBar: _extends({
|
|
127
|
+
actionBar: ownerState => _extends({
|
|
90
128
|
actions: actionBarActions
|
|
91
|
-
}, defaultizedProps.slotProps?.actionBar)
|
|
129
|
+
}, resolveComponentProps(defaultizedProps.slotProps?.actionBar, ownerState))
|
|
92
130
|
})
|
|
93
131
|
});
|
|
94
132
|
const {
|
|
@@ -98,7 +136,8 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
98
136
|
valueManager: singleItemValueManager,
|
|
99
137
|
valueType: 'date-time',
|
|
100
138
|
getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? localeText.openDatePickerDialogue,
|
|
101
|
-
validator: validateDateTime
|
|
139
|
+
validator: validateDateTime,
|
|
140
|
+
rendererInterceptor
|
|
102
141
|
});
|
|
103
142
|
return renderPicker();
|
|
104
143
|
});
|
|
@@ -357,7 +396,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
357
396
|
/**
|
|
358
397
|
* Disable specific date.
|
|
359
398
|
*
|
|
360
|
-
* Warning: This function can be called multiple times (
|
|
399
|
+
* 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.
|
|
361
400
|
*
|
|
362
401
|
* @template TDate
|
|
363
402
|
* @param {TDate} day The date to test.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import Divider from '@mui/material/Divider';
|
|
5
|
+
import { PickersLayoutContentWrapper, PickersLayoutRoot, pickersLayoutClasses, usePickerLayout } from '../PickersLayout';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* @ignore - internal component.
|
|
10
|
+
*/
|
|
11
|
+
function DesktopDateTimePickerLayout(props) {
|
|
12
|
+
const {
|
|
13
|
+
toolbar,
|
|
14
|
+
tabs,
|
|
15
|
+
content,
|
|
16
|
+
actionBar,
|
|
17
|
+
shortcuts
|
|
18
|
+
} = usePickerLayout(props);
|
|
19
|
+
const {
|
|
20
|
+
sx,
|
|
21
|
+
className,
|
|
22
|
+
isLandscape,
|
|
23
|
+
ref
|
|
24
|
+
} = props;
|
|
25
|
+
const isActionBarVisible = actionBar && (actionBar.props.actions?.length ?? 0) > 0;
|
|
26
|
+
return /*#__PURE__*/_jsxs(PickersLayoutRoot, {
|
|
27
|
+
ref: ref,
|
|
28
|
+
className: clsx(className, pickersLayoutClasses.root),
|
|
29
|
+
sx: [{
|
|
30
|
+
[`& .${pickersLayoutClasses.tabs}`]: {
|
|
31
|
+
gridRow: 4,
|
|
32
|
+
gridColumn: '1 / 4'
|
|
33
|
+
},
|
|
34
|
+
[`& .${pickersLayoutClasses.actionBar}`]: {
|
|
35
|
+
gridRow: 5
|
|
36
|
+
}
|
|
37
|
+
}, ...(Array.isArray(sx) ? sx : [sx])],
|
|
38
|
+
ownerState: props,
|
|
39
|
+
children: [isLandscape ? shortcuts : toolbar, isLandscape ? toolbar : shortcuts, /*#__PURE__*/_jsxs(PickersLayoutContentWrapper, {
|
|
40
|
+
className: pickersLayoutClasses.contentWrapper,
|
|
41
|
+
sx: {
|
|
42
|
+
display: 'grid'
|
|
43
|
+
},
|
|
44
|
+
children: [content, tabs, isActionBarVisible && /*#__PURE__*/_jsx(Divider, {
|
|
45
|
+
sx: {
|
|
46
|
+
gridRow: 3,
|
|
47
|
+
gridColumn: '1 / 4'
|
|
48
|
+
}
|
|
49
|
+
})]
|
|
50
|
+
}), actionBar]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
process.env.NODE_ENV !== "production" ? DesktopDateTimePickerLayout.propTypes = {
|
|
54
|
+
// ----------------------------- Warning --------------------------------
|
|
55
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
56
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
57
|
+
// ----------------------------------------------------------------------
|
|
58
|
+
children: PropTypes.node,
|
|
59
|
+
/**
|
|
60
|
+
* Override or extend the styles applied to the component.
|
|
61
|
+
*/
|
|
62
|
+
classes: PropTypes.object,
|
|
63
|
+
className: PropTypes.string,
|
|
64
|
+
disabled: PropTypes.bool,
|
|
65
|
+
isLandscape: PropTypes.bool.isRequired,
|
|
66
|
+
isValid: PropTypes.func.isRequired,
|
|
67
|
+
onAccept: PropTypes.func.isRequired,
|
|
68
|
+
onCancel: PropTypes.func.isRequired,
|
|
69
|
+
onChange: PropTypes.func.isRequired,
|
|
70
|
+
onClear: PropTypes.func.isRequired,
|
|
71
|
+
onClose: PropTypes.func.isRequired,
|
|
72
|
+
onDismiss: PropTypes.func.isRequired,
|
|
73
|
+
onOpen: PropTypes.func.isRequired,
|
|
74
|
+
onSelectShortcut: PropTypes.func.isRequired,
|
|
75
|
+
onSetToday: PropTypes.func.isRequired,
|
|
76
|
+
onViewChange: PropTypes.func.isRequired,
|
|
77
|
+
/**
|
|
78
|
+
* Force rendering in particular orientation.
|
|
79
|
+
*/
|
|
80
|
+
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
81
|
+
readOnly: PropTypes.bool,
|
|
82
|
+
/**
|
|
83
|
+
* The props used for each component slot.
|
|
84
|
+
* @default {}
|
|
85
|
+
*/
|
|
86
|
+
slotProps: PropTypes.object,
|
|
87
|
+
/**
|
|
88
|
+
* Overridable component slots.
|
|
89
|
+
* @default {}
|
|
90
|
+
*/
|
|
91
|
+
slots: PropTypes.object,
|
|
92
|
+
/**
|
|
93
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
94
|
+
*/
|
|
95
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
96
|
+
value: PropTypes.any,
|
|
97
|
+
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
98
|
+
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired).isRequired,
|
|
99
|
+
wrapperVariant: PropTypes.oneOf(['desktop', 'mobile'])
|
|
100
|
+
} : void 0;
|
|
101
|
+
export { DesktopDateTimePickerLayout };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { DesktopDateTimePicker } from './DesktopDateTimePicker';
|
|
1
|
+
export { DesktopDateTimePicker } from './DesktopDateTimePicker';
|
|
2
|
+
export { DesktopDateTimePickerLayout } from './DesktopDateTimePickerLayout';
|
|
@@ -278,7 +278,7 @@ MobileDatePicker.propTypes = {
|
|
|
278
278
|
/**
|
|
279
279
|
* Disable specific date.
|
|
280
280
|
*
|
|
281
|
-
* Warning: This function can be called multiple times (
|
|
281
|
+
* 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.
|
|
282
282
|
*
|
|
283
283
|
* @template TDate
|
|
284
284
|
* @param {TDate} day The date to test.
|
|
@@ -326,7 +326,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
326
326
|
/**
|
|
327
327
|
* Disable specific date.
|
|
328
328
|
*
|
|
329
|
-
* Warning: This function can be called multiple times (
|
|
329
|
+
* 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.
|
|
330
330
|
*
|
|
331
331
|
* @template TDate
|
|
332
332
|
* @param {TDate} day The date to test.
|
|
@@ -208,7 +208,7 @@ StaticDatePicker.propTypes = {
|
|
|
208
208
|
/**
|
|
209
209
|
* Disable specific date.
|
|
210
210
|
*
|
|
211
|
-
* Warning: This function can be called multiple times (
|
|
211
|
+
* 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.
|
|
212
212
|
*
|
|
213
213
|
* @template TDate
|
|
214
214
|
* @param {TDate} day The date to test.
|
|
@@ -256,7 +256,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
256
256
|
/**
|
|
257
257
|
* Disable specific date.
|
|
258
258
|
*
|
|
259
|
-
* Warning: This function can be called multiple times (
|
|
259
|
+
* 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.
|
|
260
260
|
*
|
|
261
261
|
* @template TDate
|
|
262
262
|
* @param {TDate} day The date to test.
|
package/modern/index.js
CHANGED
|
@@ -146,7 +146,7 @@ function useClickAwayListener(active, onClickAway) {
|
|
|
146
146
|
// TODO This behavior is not tested automatically
|
|
147
147
|
// It's unclear whether this is due to different update semantics in test (batched in act() vs discrete on click).
|
|
148
148
|
// Or if this is a timing related issues due to different Transition components
|
|
149
|
-
// Once we get rid of all the manual scheduling (
|
|
149
|
+
// Once we get rid of all the manual scheduling (for example setTimeout(update, 0)) we can revisit this code+test.
|
|
150
150
|
if (active) {
|
|
151
151
|
const doc = ownerDocument(nodeRef.current);
|
|
152
152
|
doc.addEventListener('click', handleClickAway);
|
|
@@ -152,49 +152,53 @@ const buildSections = params => {
|
|
|
152
152
|
const sections = [];
|
|
153
153
|
let startSeparator = '';
|
|
154
154
|
|
|
155
|
-
// This RegExp
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
155
|
+
// This RegExp tests if the beginning of a string corresponds to a supported token
|
|
156
|
+
const validTokens = Object.keys(utils.formatTokenMap).sort((a, b) => b.length - a.length); // Sort to put longest word first
|
|
157
|
+
|
|
158
|
+
const regExpFirstWordInFormat = /^([a-zA-Z]+)/;
|
|
159
|
+
const regExpWordOnlyComposedOfTokens = new RegExp(`^(${validTokens.join('|')})*$`);
|
|
160
|
+
const regExpFirstTokenInWord = new RegExp(`^(${validTokens.join('|')})`);
|
|
161
|
+
const getEscapedPartOfCurrentChar = i => escapedParts.find(escapeIndex => escapeIndex.start <= i && escapeIndex.end >= i);
|
|
162
|
+
let i = 0;
|
|
163
|
+
while (i < expandedFormat.length) {
|
|
164
|
+
const escapedPartOfCurrentChar = getEscapedPartOfCurrentChar(i);
|
|
163
165
|
const isEscapedChar = escapedPartOfCurrentChar != null;
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
const firstWordInFormat = regExpFirstWordInFormat.exec(expandedFormat.slice(i))?.[1];
|
|
167
|
+
|
|
168
|
+
// The first word in the format is only composed of tokens.
|
|
169
|
+
// We extract those tokens to create a new sections.
|
|
170
|
+
if (!isEscapedChar && firstWordInFormat != null && regExpWordOnlyComposedOfTokens.test(firstWordInFormat)) {
|
|
171
|
+
let word = firstWordInFormat;
|
|
172
|
+
while (word.length > 0) {
|
|
173
|
+
const firstWord = regExpFirstTokenInWord.exec(word)[1];
|
|
174
|
+
word = word.slice(firstWord.length);
|
|
175
|
+
sections.push(createSection(_extends({}, params, {
|
|
176
|
+
now,
|
|
177
|
+
token: firstWord,
|
|
178
|
+
startSeparator
|
|
179
|
+
})));
|
|
180
|
+
startSeparator = '';
|
|
181
|
+
}
|
|
182
|
+
i += firstWordInFormat.length;
|
|
183
|
+
}
|
|
184
|
+
// The remaining format does not start with a token,
|
|
185
|
+
// We take the first character and add it to the current section's end separator.
|
|
186
|
+
else {
|
|
187
|
+
const char = expandedFormat[i];
|
|
188
|
+
|
|
170
189
|
// If we are on the opening or closing character of an escaped part of the format,
|
|
171
190
|
// Then we ignore this character.
|
|
172
191
|
const isEscapeBoundary = isEscapedChar && escapedPartOfCurrentChar?.start === i || escapedPartOfCurrentChar?.end === i;
|
|
173
192
|
if (!isEscapeBoundary) {
|
|
174
|
-
if (currentTokenValue !== '') {
|
|
175
|
-
sections.push(createSection(_extends({}, params, {
|
|
176
|
-
now,
|
|
177
|
-
token: currentTokenValue,
|
|
178
|
-
startSeparator
|
|
179
|
-
})));
|
|
180
|
-
currentTokenValue = '';
|
|
181
|
-
}
|
|
182
193
|
if (sections.length === 0) {
|
|
183
194
|
startSeparator += char;
|
|
184
195
|
} else {
|
|
185
|
-
startSeparator = '';
|
|
186
196
|
sections[sections.length - 1].endSeparator += char;
|
|
187
197
|
}
|
|
188
198
|
}
|
|
199
|
+
i += 1;
|
|
189
200
|
}
|
|
190
201
|
}
|
|
191
|
-
if (currentTokenValue !== '') {
|
|
192
|
-
sections.push(createSection(_extends({}, params, {
|
|
193
|
-
now,
|
|
194
|
-
token: currentTokenValue,
|
|
195
|
-
startSeparator
|
|
196
|
-
})));
|
|
197
|
-
}
|
|
198
202
|
if (sections.length === 0 && startSeparator.length > 0) {
|
|
199
203
|
sections.push({
|
|
200
204
|
type: 'empty',
|
|
@@ -327,7 +327,7 @@ export const useFieldV7TextField = params => {
|
|
|
327
327
|
onClick: getInputContainerClickHandler(index)
|
|
328
328
|
},
|
|
329
329
|
content: {
|
|
330
|
-
tabIndex: isContainerEditable ?
|
|
330
|
+
tabIndex: isContainerEditable || index > 0 ? -1 : 0,
|
|
331
331
|
contentEditable: !isContainerEditable && !disabled && !readOnly,
|
|
332
332
|
role: 'spinbutton',
|
|
333
333
|
id: `${id}-${section.type}`,
|
|
@@ -366,7 +366,7 @@ export const useFieldV7TextField = params => {
|
|
|
366
366
|
const valueStr = React.useMemo(() => areAllSectionsEmpty ? '' : fieldValueManager.getV7HiddenInputValueFromSections(state.sections), [areAllSectionsEmpty, state.sections, fieldValueManager]);
|
|
367
367
|
React.useEffect(() => {
|
|
368
368
|
if (sectionListRef.current == null) {
|
|
369
|
-
throw new Error(['MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`', 'You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.', '', 'If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:', '', '<DatePicker slots={{ textField: MyCustomTextField }} />', '', 'Learn more about the field accessible DOM structure on the MUI documentation: https://
|
|
369
|
+
throw new Error(['MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`', 'You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.', '', 'If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:', '', '<DatePicker slots={{ textField: MyCustomTextField }} />', '', 'Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element'].join('\n'));
|
|
370
370
|
}
|
|
371
371
|
if (autoFocus && sectionListRef.current) {
|
|
372
372
|
sectionListRef.current.getSectionContent(sectionOrder.startIndex).focus();
|
|
@@ -390,7 +390,7 @@ export const useFieldV7TextField = params => {
|
|
|
390
390
|
enableAccessibleFieldDOMStructure: true,
|
|
391
391
|
elements,
|
|
392
392
|
// TODO v7: Try to set to undefined when there is a section selected.
|
|
393
|
-
tabIndex: 0,
|
|
393
|
+
tabIndex: parsedSelectedSections === 0 ? -1 : 0,
|
|
394
394
|
contentEditable: isContainerEditable,
|
|
395
395
|
value: valueStr,
|
|
396
396
|
onChange: handleValueStrChange,
|
|
@@ -8,7 +8,7 @@ export const useOpenState = ({
|
|
|
8
8
|
const [openState, setIsOpenState] = React.useState(false);
|
|
9
9
|
|
|
10
10
|
// It is required to update inner state in useEffect in order to avoid situation when
|
|
11
|
-
// Our component is not mounted yet, but `open` state is set to `true` (
|
|
11
|
+
// Our component is not mounted yet, but `open` state is set to `true` (for example initially opened)
|
|
12
12
|
React.useEffect(() => {
|
|
13
13
|
if (isControllingOpenProp) {
|
|
14
14
|
if (typeof open !== 'boolean') {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { areViewsEqual } from './views';
|
|
2
|
+
export const mergeDateAndTime = (utils, dateParam, timeParam) => {
|
|
3
|
+
let mergedDate = dateParam;
|
|
4
|
+
mergedDate = utils.setHours(mergedDate, utils.getHours(timeParam));
|
|
5
|
+
mergedDate = utils.setMinutes(mergedDate, utils.getMinutes(timeParam));
|
|
6
|
+
mergedDate = utils.setSeconds(mergedDate, utils.getSeconds(timeParam));
|
|
7
|
+
return mergedDate;
|
|
8
|
+
};
|
|
2
9
|
export const findClosestEnabledDate = ({
|
|
3
10
|
date,
|
|
4
11
|
disableFuture,
|
|
@@ -9,7 +16,7 @@ export const findClosestEnabledDate = ({
|
|
|
9
16
|
utils,
|
|
10
17
|
timezone
|
|
11
18
|
}) => {
|
|
12
|
-
const today =
|
|
19
|
+
const today = mergeDateAndTime(utils, utils.date(undefined, timezone), date);
|
|
13
20
|
if (disablePast && utils.isBefore(minDate, today)) {
|
|
14
21
|
minDate = today;
|
|
15
22
|
}
|
|
@@ -72,13 +79,6 @@ export const getMonthsInYear = (utils, year) => {
|
|
|
72
79
|
}
|
|
73
80
|
return months;
|
|
74
81
|
};
|
|
75
|
-
export const mergeDateAndTime = (utils, dateParam, timeParam) => {
|
|
76
|
-
let mergedDate = dateParam;
|
|
77
|
-
mergedDate = utils.setHours(mergedDate, utils.getHours(timeParam));
|
|
78
|
-
mergedDate = utils.setMinutes(mergedDate, utils.getMinutes(timeParam));
|
|
79
|
-
mergedDate = utils.setSeconds(mergedDate, utils.getSeconds(timeParam));
|
|
80
|
-
return mergedDate;
|
|
81
|
-
};
|
|
82
82
|
export const getTodayDate = (utils, timezone, valueType) => valueType === 'date' ? utils.startOfDay(utils.date(undefined, timezone)) : utils.date(undefined, timezone);
|
|
83
83
|
export const formatMeridiem = (utils, meridiem) => {
|
|
84
84
|
const date = utils.setHours(utils.date(), meridiem === 'am' ? 2 : 14);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { DATE_TIME_VALIDATION_PROP_NAMES, DATE_VALIDATION_PROP_NAMES, TIME_VALIDATION_PROP_NAMES } from './validation/extractValidationProps';
|
|
3
|
-
const SHARED_FIELD_INTERNAL_PROP_NAMES = ['value', 'defaultValue', 'referenceDate', 'format', 'formatDensity', 'onChange', 'timezone', 'onError', 'shouldRespectLeadingZeros', 'selectedSections', 'onSelectedSectionsChange', 'unstableFieldRef', 'enableAccessibleFieldDOMStructure', 'disabled', 'readOnly'];
|
|
3
|
+
const SHARED_FIELD_INTERNAL_PROP_NAMES = ['value', 'defaultValue', 'referenceDate', 'format', 'formatDensity', 'onChange', 'timezone', 'onError', 'shouldRespectLeadingZeros', 'selectedSections', 'onSelectedSectionsChange', 'unstableFieldRef', 'enableAccessibleFieldDOMStructure', 'disabled', 'readOnly', 'dateSeparator'];
|
|
4
4
|
export const splitFieldInternalAndForwardedProps = (props, valueType) => {
|
|
5
5
|
const forwardedProps = _extends({}, props);
|
|
6
6
|
const internalProps = {};
|
package/modern/locales/jaJP.js
CHANGED
|
@@ -17,11 +17,10 @@ const jaJPPickers = {
|
|
|
17
17
|
// DateRange labels
|
|
18
18
|
start: '開始',
|
|
19
19
|
end: '終了',
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
startDate: '開始日',
|
|
21
|
+
startTime: '開始時間',
|
|
22
|
+
endDate: '終了日',
|
|
23
|
+
endTime: '終了時間',
|
|
25
24
|
// Action bar
|
|
26
25
|
cancelButtonLabel: 'キャンセル',
|
|
27
26
|
clearButtonLabel: 'クリア',
|
|
@@ -47,8 +46,7 @@ const jaJPPickers = {
|
|
|
47
46
|
// Open picker labels
|
|
48
47
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `日付を選択してください。選択した日付は ${utils.format(value, 'fullDate')} です` : '日付を選択してください',
|
|
49
48
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `時間を選択してください。選択した時間は ${utils.format(value, 'fullTime')} です` : '時間を選択してください',
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
fieldClearLabel: 'クリア',
|
|
52
50
|
// Table labels
|
|
53
51
|
timeTableLabel: '時間を選択',
|
|
54
52
|
dateTableLabel: '日付を選択',
|
|
@@ -60,19 +58,17 @@ const jaJPPickers = {
|
|
|
60
58
|
fieldHoursPlaceholder: () => 'hh',
|
|
61
59
|
fieldMinutesPlaceholder: () => 'mm',
|
|
62
60
|
fieldSecondsPlaceholder: () => 'ss',
|
|
63
|
-
fieldMeridiemPlaceholder: () => 'aa'
|
|
64
|
-
|
|
61
|
+
fieldMeridiemPlaceholder: () => 'aa',
|
|
65
62
|
// View names
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
year: '年',
|
|
64
|
+
month: '月',
|
|
65
|
+
day: '日',
|
|
66
|
+
weekDay: '平日',
|
|
67
|
+
hours: '時間',
|
|
68
|
+
minutes: '分',
|
|
69
|
+
seconds: '秒',
|
|
70
|
+
meridiem: 'メリディム',
|
|
75
71
|
// Common
|
|
76
|
-
|
|
72
|
+
empty: '空'
|
|
77
73
|
};
|
|
78
74
|
export const jaJP = getPickersLocalization(jaJPPickers);
|
|
@@ -248,6 +248,10 @@ class AdapterLuxon {
|
|
|
248
248
|
// Extract escaped section to avoid extending them
|
|
249
249
|
const catchEscapedSectionsRegexp = /''|'(''|[^'])+('|$)|[^']*/g;
|
|
250
250
|
|
|
251
|
+
// This RegExp tests if a string is only mad of supported tokens
|
|
252
|
+
const validTokens = [...Object.keys(this.formatTokenMap), 'yyyyy'];
|
|
253
|
+
const isWordComposedOfTokens = new RegExp(`^(${validTokens.join('|')})+$`);
|
|
254
|
+
|
|
251
255
|
// Extract words to test if they are a token or a word to escape.
|
|
252
256
|
const catchWordsRegexp = /(?:^|[^a-z])([a-z]+)(?:[^a-z]|$)|([a-z]+)/gi;
|
|
253
257
|
return format.match(catchEscapedSectionsRegexp).map(token => {
|
|
@@ -258,12 +262,13 @@ class AdapterLuxon {
|
|
|
258
262
|
const expandedToken = _luxon.DateTime.expandFormat(token, {
|
|
259
263
|
locale: this.locale
|
|
260
264
|
});
|
|
261
|
-
return expandedToken.replace(catchWordsRegexp, (
|
|
265
|
+
return expandedToken.replace(catchWordsRegexp, (substring, g1, g2) => {
|
|
262
266
|
const word = g1 || g2; // words are either in group 1 or group 2
|
|
263
|
-
|
|
264
|
-
|
|
267
|
+
|
|
268
|
+
if (isWordComposedOfTokens.test(word)) {
|
|
269
|
+
return substring;
|
|
265
270
|
}
|
|
266
|
-
return `'${
|
|
271
|
+
return `'${substring}'`;
|
|
267
272
|
});
|
|
268
273
|
}).join('')
|
|
269
274
|
// The returned format can contain `yyyyy` which means year between 4 and 6 digits.
|
|
@@ -495,7 +495,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
495
495
|
/**
|
|
496
496
|
* Disable specific date.
|
|
497
497
|
*
|
|
498
|
-
* Warning: This function can be called multiple times (
|
|
498
|
+
* 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.
|
|
499
499
|
*
|
|
500
500
|
* @template TDate
|
|
501
501
|
* @param {TDate} day The date to test.
|
|
@@ -361,10 +361,11 @@ function DayCalendar(inProps) {
|
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
const currentMonthNumber = utils.getMonth(currentMonth);
|
|
364
|
+
const currentYearNumber = utils.getYear(currentMonth);
|
|
364
365
|
const validSelectedDays = React.useMemo(() => selectedDays.filter(day => !!day).map(day => utils.startOfDay(day)), [utils, selectedDays]);
|
|
365
366
|
|
|
366
367
|
// need a new ref whenever the `key` of the transition changes: https://reactcommunity.org/react-transition-group/transition/#Transition-prop-nodeRef.
|
|
367
|
-
const transitionKey = currentMonthNumber
|
|
368
|
+
const transitionKey = `${currentYearNumber}-${currentMonthNumber}`;
|
|
368
369
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
369
370
|
const slideNodeRef = React.useMemo(() => /*#__PURE__*/React.createRef(), [transitionKey]);
|
|
370
371
|
const startOfCurrentWeek = utils.startOfWeek(now);
|
|
@@ -250,7 +250,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
250
250
|
/**
|
|
251
251
|
* Disable specific date.
|
|
252
252
|
*
|
|
253
|
-
* Warning: This function can be called multiple times (
|
|
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.
|
|
254
254
|
*
|
|
255
255
|
* @template TDate
|
|
256
256
|
* @param {TDate} day The date to test.
|
|
@@ -275,7 +275,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
275
275
|
/**
|
|
276
276
|
* Disable specific date.
|
|
277
277
|
*
|
|
278
|
-
* Warning: This function can be called multiple times (
|
|
278
|
+
* 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.
|
|
279
279
|
*
|
|
280
280
|
* @template TDate
|
|
281
281
|
* @param {TDate} day The date to test.
|
|
@@ -283,7 +283,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
283
283
|
/**
|
|
284
284
|
* Disable specific date.
|
|
285
285
|
*
|
|
286
|
-
* Warning: This function can be called multiple times (
|
|
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.
|
|
287
287
|
*
|
|
288
288
|
* @template TDate
|
|
289
289
|
* @param {TDate} day The date to test.
|
|
@@ -313,7 +313,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
313
313
|
/**
|
|
314
314
|
* Disable specific date.
|
|
315
315
|
*
|
|
316
|
-
* Warning: This function can be called multiple times (
|
|
316
|
+
* 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.
|
|
317
317
|
*
|
|
318
318
|
* @template TDate
|
|
319
319
|
* @param {TDate} day The date to test.
|