@mui/x-date-pickers 6.19.0 → 6.19.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/AdapterDateFns/AdapterDateFns.d.ts +1 -0
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -0
- package/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -0
- package/AdapterLuxon/AdapterLuxon.js +0 -1
- package/CHANGELOG.md +113 -0
- package/DateCalendar/useCalendarState.js +0 -1
- package/DatePicker/DatePickerToolbar.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.js +2 -7
- package/DateTimePicker/DateTimePickerTabs.js +6 -3
- package/DigitalClock/DigitalClock.js +1 -0
- package/DigitalClock/DigitalClock.types.d.ts +5 -0
- package/MonthCalendar/MonthCalendar.js +0 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +5 -0
- package/PickersLayout/pickersLayoutClasses.js +3 -2
- package/PickersLayout/usePickerLayout.js +2 -1
- package/TimeClock/Clock.js +0 -1
- package/TimeClock/ClockPointer.js +0 -1
- package/TimeClock/TimeClock.js +1 -0
- package/TimeClock/TimeClock.types.d.ts +5 -0
- package/TimePicker/timePickerToolbarClasses.d.ts +8 -0
- package/YearCalendar/YearCalendar.js +0 -1
- package/index.js +1 -1
- package/internals/hooks/useClockReferenceDate.js +0 -1
- package/internals/hooks/useField/useField.utils.js +0 -2
- package/internals/hooks/useViews.js +0 -1
- package/internals/models/props/tabs.d.ts +1 -0
- package/legacy/AdapterDateFns/AdapterDateFns.js +5 -6
- package/legacy/AdapterDateFnsV3/AdapterDateFnsV3.js +6 -6
- package/legacy/AdapterLuxon/AdapterLuxon.js +0 -1
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -6
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -6
- package/legacy/DateCalendar/PickersSlideTransition.js +8 -9
- package/legacy/DateCalendar/useCalendarState.js +0 -1
- package/legacy/DatePicker/DatePickerToolbar.js +2 -7
- package/legacy/DateTimePicker/DateTimePickerTabs.js +6 -3
- package/legacy/DigitalClock/DigitalClock.js +1 -0
- package/legacy/MonthCalendar/MonthCalendar.js +0 -1
- package/legacy/MonthCalendar/PickersMonth.js +4 -5
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/legacy/PickersDay/PickersDay.js +5 -6
- package/legacy/PickersLayout/PickersLayout.js +5 -6
- package/legacy/PickersLayout/pickersLayoutClasses.js +3 -2
- package/legacy/PickersLayout/usePickerLayout.js +2 -1
- package/legacy/TimeClock/Clock.js +0 -1
- package/legacy/TimeClock/ClockNumber.js +4 -5
- package/legacy/TimeClock/ClockPointer.js +0 -1
- package/legacy/TimeClock/TimeClock.js +1 -0
- package/legacy/TimePicker/TimePickerToolbar.js +1 -2
- package/legacy/YearCalendar/PickersYear.js +4 -5
- package/legacy/YearCalendar/YearCalendar.js +0 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersModalDialog.js +3 -4
- package/legacy/internals/hooks/useClockReferenceDate.js +0 -1
- package/legacy/internals/hooks/useField/useField.utils.js +0 -2
- package/legacy/internals/hooks/useViews.js +0 -1
- package/legacy/locales/plPL.js +0 -1
- package/legacy/locales/svSE.js +0 -1
- package/legacy/locales/urPK.js +0 -1
- package/locales/plPL.js +0 -1
- package/locales/svSE.js +0 -1
- package/locales/urPK.js +0 -1
- package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -0
- package/modern/AdapterLuxon/AdapterLuxon.js +0 -1
- package/modern/DateCalendar/useCalendarState.js +0 -1
- package/modern/DatePicker/DatePickerToolbar.js +2 -7
- package/modern/DateTimePicker/DateTimePickerTabs.js +6 -3
- package/modern/DigitalClock/DigitalClock.js +1 -0
- package/modern/MonthCalendar/MonthCalendar.js +0 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/modern/PickersLayout/pickersLayoutClasses.js +3 -2
- package/modern/PickersLayout/usePickerLayout.js +2 -1
- package/modern/TimeClock/Clock.js +0 -1
- package/modern/TimeClock/ClockPointer.js +0 -1
- package/modern/TimeClock/TimeClock.js +1 -0
- package/modern/YearCalendar/YearCalendar.js +0 -1
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useClockReferenceDate.js +0 -1
- package/modern/internals/hooks/useField/useField.utils.js +0 -2
- package/modern/internals/hooks/useViews.js +0 -1
- package/modern/locales/plPL.js +0 -1
- package/modern/locales/svSE.js +0 -1
- package/modern/locales/urPK.js +0 -1
- package/node/AdapterLuxon/AdapterLuxon.js +0 -1
- package/node/DateCalendar/useCalendarState.js +0 -1
- package/node/DatePicker/DatePickerToolbar.js +0 -4
- package/node/DateTimePicker/DateTimePickerTabs.js +7 -4
- package/node/DigitalClock/DigitalClock.js +1 -0
- package/node/MonthCalendar/MonthCalendar.js +0 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/node/PickersLayout/pickersLayoutClasses.js +5 -3
- package/node/PickersLayout/usePickerLayout.js +2 -1
- package/node/TimeClock/Clock.js +0 -1
- package/node/TimeClock/ClockPointer.js +0 -1
- package/node/TimeClock/TimeClock.js +1 -0
- package/node/YearCalendar/YearCalendar.js +0 -1
- package/node/index.js +1 -1
- package/node/internals/hooks/useClockReferenceDate.js +0 -1
- package/node/internals/hooks/useField/useField.utils.js +0 -2
- package/node/internals/hooks/useViews.js +0 -1
- package/node/locales/plPL.js +0 -1
- package/node/locales/svSE.js +0 -1
- package/node/locales/urPK.js +0 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
2
3
|
export function getPickersLayoutUtilityClass(slot) {
|
|
3
4
|
return generateUtilityClass('MuiPickersLayout', slot);
|
|
4
5
|
}
|
|
5
|
-
export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'shortcuts']);
|
|
6
|
+
export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'tabs', 'shortcuts']);
|
|
@@ -109,7 +109,8 @@ const usePickerLayout = props => {
|
|
|
109
109
|
const Tabs = slots?.tabs;
|
|
110
110
|
const tabs = view && Tabs ? /*#__PURE__*/_jsx(Tabs, _extends({
|
|
111
111
|
view: view,
|
|
112
|
-
onViewChange: onViewChange
|
|
112
|
+
onViewChange: onViewChange,
|
|
113
|
+
className: classes.tabs
|
|
113
114
|
}, slotProps?.tabs)) : null;
|
|
114
115
|
|
|
115
116
|
// Shortcuts
|
|
@@ -492,6 +492,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
492
492
|
view: PropTypes.oneOf(['hours', 'minutes', 'seconds']),
|
|
493
493
|
/**
|
|
494
494
|
* Available views.
|
|
495
|
+
* @default ['hours', 'minutes']
|
|
495
496
|
*/
|
|
496
497
|
views: PropTypes.arrayOf(PropTypes.oneOf(['hours', 'minutes', 'seconds']).isRequired)
|
|
497
498
|
} : void 0;
|
|
@@ -116,7 +116,6 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
116
116
|
granularity: SECTION_TYPE_GRANULARITY.year
|
|
117
117
|
}), [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
118
118
|
);
|
|
119
|
-
|
|
120
119
|
const ownerState = props;
|
|
121
120
|
const classes = useUtilityClasses(ownerState);
|
|
122
121
|
const todayYear = React.useMemo(() => utils.getYear(now), [utils, now]);
|
package/modern/index.js
CHANGED
|
@@ -125,7 +125,6 @@ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsVa
|
|
|
125
125
|
if (delta < 0 || isStart) {
|
|
126
126
|
newSectionValueNumber += step - (step + newSectionValueNumber) % step; // for JS -3 % 5 = -3 (should be 2)
|
|
127
127
|
}
|
|
128
|
-
|
|
129
128
|
if (delta > 0 || isEnd) {
|
|
130
129
|
newSectionValueNumber -= newSectionValueNumber % step;
|
|
131
130
|
}
|
|
@@ -401,7 +400,6 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
|
|
|
401
400
|
const isTokenStartRegExp = new RegExp(`^(${Object.keys(utils.formatTokenMap).sort((a, b) => b.length - a.length) // Sort to put longest word first
|
|
402
401
|
.join('|')})`, 'g') // used to get access to lastIndex state
|
|
403
402
|
;
|
|
404
|
-
|
|
405
403
|
let currentTokenValue = '';
|
|
406
404
|
for (let i = 0; i < expandedFormat.length; i += 1) {
|
|
407
405
|
const escapedPartOfCurrentChar = escapedParts.find(escapeIndex => escapeIndex.start <= i && escapeIndex.end >= i);
|
|
@@ -60,7 +60,6 @@ export function useViews({
|
|
|
60
60
|
setFocusedView(prevFocusedView => viewToFocus === prevFocusedView ? null : prevFocusedView // If false the blur is due to view switching
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
-
|
|
64
63
|
onFocusedViewChange?.(viewToFocus, hasFocus);
|
|
65
64
|
});
|
|
66
65
|
const handleChangeView = useEventCallback(newView => {
|
package/modern/locales/plPL.js
CHANGED
package/modern/locales/svSE.js
CHANGED
package/modern/locales/urPK.js
CHANGED
|
@@ -273,7 +273,6 @@ class AdapterLuxon {
|
|
|
273
273
|
if (typeof Intl === 'undefined' || typeof Intl.DateTimeFormat === 'undefined') {
|
|
274
274
|
return true; // Luxon defaults to en-US if Intl not found
|
|
275
275
|
}
|
|
276
|
-
|
|
277
276
|
return Boolean(new Intl.DateTimeFormat(this.locale, {
|
|
278
277
|
hour: 'numeric'
|
|
279
278
|
})?.resolvedOptions()?.hour12);
|
|
@@ -80,7 +80,6 @@ const useCalendarState = params => {
|
|
|
80
80
|
});
|
|
81
81
|
}, [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
82
82
|
);
|
|
83
|
-
|
|
84
83
|
const [calendarState, dispatch] = React.useReducer(reducerFn, {
|
|
85
84
|
isMonthSwitchingAnimating: false,
|
|
86
85
|
focusedDay: utils.isValid(value) ? value : now,
|
|
@@ -35,10 +35,6 @@ const DatePickerToolbarRoot = (0, _styles.styled)(_PickersToolbar.PickersToolbar
|
|
|
35
35
|
slot: 'Root',
|
|
36
36
|
overridesResolver: (_, styles) => styles.root
|
|
37
37
|
})({});
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @ignore - do not document.
|
|
41
|
-
*/
|
|
42
38
|
const DatePickerToolbarTitle = (0, _styles.styled)(_Typography.default, {
|
|
43
39
|
name: 'MuiDatePickerToolbar',
|
|
44
40
|
slot: 'Title',
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.DateTimePickerTabs = void 0;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
11
|
var _Tab = _interopRequireDefault(require("@mui/material/Tab"));
|
|
11
12
|
var _Tabs = _interopRequireWildcard(require("@mui/material/Tabs"));
|
|
12
13
|
var _styles = require("@mui/material/styles");
|
|
13
|
-
var
|
|
14
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
14
15
|
var _icons = require("../icons");
|
|
15
16
|
var _useUtils = require("../internals/hooks/useUtils");
|
|
16
17
|
var _dateTimePickerTabsClasses = require("./dateTimePickerTabsClasses");
|
|
@@ -37,7 +38,7 @@ const useUtilityClasses = ownerState => {
|
|
|
37
38
|
const slots = {
|
|
38
39
|
root: ['root']
|
|
39
40
|
};
|
|
40
|
-
return (0,
|
|
41
|
+
return (0, _composeClasses.default)(slots, _dateTimePickerTabsClasses.getDateTimePickerTabsUtilityClass, classes);
|
|
41
42
|
};
|
|
42
43
|
const DateTimePickerTabsRoot = (0, _styles.styled)(_Tabs.default, {
|
|
43
44
|
name: 'MuiDateTimePickerTabs',
|
|
@@ -76,7 +77,8 @@ const DateTimePickerTabs = exports.DateTimePickerTabs = function DateTimePickerT
|
|
|
76
77
|
onViewChange,
|
|
77
78
|
timeIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.TimeIcon, {}),
|
|
78
79
|
view,
|
|
79
|
-
hidden = typeof window === 'undefined' || window.innerHeight < 667
|
|
80
|
+
hidden = typeof window === 'undefined' || window.innerHeight < 667,
|
|
81
|
+
className
|
|
80
82
|
} = props;
|
|
81
83
|
const localeText = (0, _useUtils.useLocaleText)();
|
|
82
84
|
const classes = useUtilityClasses(props);
|
|
@@ -91,7 +93,7 @@ const DateTimePickerTabs = exports.DateTimePickerTabs = function DateTimePickerT
|
|
|
91
93
|
variant: "fullWidth",
|
|
92
94
|
value: viewToTab(view),
|
|
93
95
|
onChange: handleChange,
|
|
94
|
-
className: classes.root,
|
|
96
|
+
className: (0, _clsx.default)(className, classes.root),
|
|
95
97
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
96
98
|
value: "date",
|
|
97
99
|
"aria-label": localeText.dateTableLabel,
|
|
@@ -116,6 +118,7 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
116
118
|
* Override or extend the styles applied to the component.
|
|
117
119
|
*/
|
|
118
120
|
classes: _propTypes.default.object,
|
|
121
|
+
className: _propTypes.default.string,
|
|
119
122
|
/**
|
|
120
123
|
* Date tab icon.
|
|
121
124
|
* @default DateRange
|
|
@@ -446,6 +446,7 @@ process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
|
|
|
446
446
|
view: _propTypes.default.oneOf(['hours']),
|
|
447
447
|
/**
|
|
448
448
|
* Available views.
|
|
449
|
+
* @default ['hours']
|
|
449
450
|
*/
|
|
450
451
|
views: _propTypes.default.arrayOf(_propTypes.default.oneOf(['hours']))
|
|
451
452
|
} : void 0;
|
|
@@ -121,7 +121,6 @@ const MonthCalendar = exports.MonthCalendar = /*#__PURE__*/React.forwardRef(func
|
|
|
121
121
|
granularity: _getDefaultReferenceDate.SECTION_TYPE_GRANULARITY.month
|
|
122
122
|
}), [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
123
123
|
);
|
|
124
|
-
|
|
125
124
|
const ownerState = props;
|
|
126
125
|
const classes = useUtilityClasses(ownerState);
|
|
127
126
|
const todayMonth = React.useMemo(() => utils.getMonth(now), [utils, now]);
|
|
@@ -518,6 +518,7 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
518
518
|
view: _propTypes.default.oneOf(['hours', 'meridiem', 'minutes', 'seconds']),
|
|
519
519
|
/**
|
|
520
520
|
* Available views.
|
|
521
|
+
* @default ['hours', 'minutes']
|
|
521
522
|
*/
|
|
522
523
|
views: _propTypes.default.arrayOf(_propTypes.default.oneOf(['hours', 'meridiem', 'minutes', 'seconds']).isRequired)
|
|
523
524
|
} : void 0;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.getPickersLayoutUtilityClass = getPickersLayoutUtilityClass;
|
|
7
8
|
exports.pickersLayoutClasses = void 0;
|
|
8
|
-
var
|
|
9
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
10
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
9
11
|
function getPickersLayoutUtilityClass(slot) {
|
|
10
|
-
return (0,
|
|
12
|
+
return (0, _generateUtilityClass.default)('MuiPickersLayout', slot);
|
|
11
13
|
}
|
|
12
|
-
const pickersLayoutClasses = exports.pickersLayoutClasses = (0,
|
|
14
|
+
const pickersLayoutClasses = exports.pickersLayoutClasses = (0, _generateUtilityClasses.default)('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'tabs', 'shortcuts']);
|
|
@@ -118,7 +118,8 @@ const usePickerLayout = props => {
|
|
|
118
118
|
const Tabs = slots?.tabs;
|
|
119
119
|
const tabs = view && Tabs ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs, (0, _extends2.default)({
|
|
120
120
|
view: view,
|
|
121
|
-
onViewChange: onViewChange
|
|
121
|
+
onViewChange: onViewChange,
|
|
122
|
+
className: classes.tabs
|
|
122
123
|
}, slotProps?.tabs)) : null;
|
|
123
124
|
|
|
124
125
|
// Shortcuts
|
package/node/TimeClock/Clock.js
CHANGED
|
@@ -500,6 +500,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
500
500
|
view: _propTypes.default.oneOf(['hours', 'minutes', 'seconds']),
|
|
501
501
|
/**
|
|
502
502
|
* Available views.
|
|
503
|
+
* @default ['hours', 'minutes']
|
|
503
504
|
*/
|
|
504
505
|
views: _propTypes.default.arrayOf(_propTypes.default.oneOf(['hours', 'minutes', 'seconds']).isRequired)
|
|
505
506
|
} : void 0;
|
|
@@ -125,7 +125,6 @@ const YearCalendar = exports.YearCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
125
125
|
granularity: _getDefaultReferenceDate.SECTION_TYPE_GRANULARITY.year
|
|
126
126
|
}), [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
127
127
|
);
|
|
128
|
-
|
|
129
128
|
const ownerState = props;
|
|
130
129
|
const classes = useUtilityClasses(ownerState);
|
|
131
130
|
const todayYear = React.useMemo(() => utils.getYear(now), [utils, now]);
|
package/node/index.js
CHANGED
|
@@ -137,7 +137,6 @@ const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoun
|
|
|
137
137
|
if (delta < 0 || isStart) {
|
|
138
138
|
newSectionValueNumber += step - (step + newSectionValueNumber) % step; // for JS -3 % 5 = -3 (should be 2)
|
|
139
139
|
}
|
|
140
|
-
|
|
141
140
|
if (delta > 0 || isEnd) {
|
|
142
141
|
newSectionValueNumber -= newSectionValueNumber % step;
|
|
143
142
|
}
|
|
@@ -419,7 +418,6 @@ const splitFormatIntoSections = (utils, timezone, localeText, format, date, form
|
|
|
419
418
|
const isTokenStartRegExp = new RegExp(`^(${Object.keys(utils.formatTokenMap).sort((a, b) => b.length - a.length) // Sort to put longest word first
|
|
420
419
|
.join('|')})`, 'g') // used to get access to lastIndex state
|
|
421
420
|
;
|
|
422
|
-
|
|
423
421
|
let currentTokenValue = '';
|
|
424
422
|
for (let i = 0; i < expandedFormat.length; i += 1) {
|
|
425
423
|
const escapedPartOfCurrentChar = escapedParts.find(escapeIndex => escapeIndex.start <= i && escapeIndex.end >= i);
|
|
@@ -69,7 +69,6 @@ function useViews({
|
|
|
69
69
|
setFocusedView(prevFocusedView => viewToFocus === prevFocusedView ? null : prevFocusedView // If false the blur is due to view switching
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
-
|
|
73
72
|
onFocusedViewChange?.(viewToFocus, hasFocus);
|
|
74
73
|
});
|
|
75
74
|
const handleChangeView = (0, _useEventCallback.default)(newView => {
|
package/node/locales/plPL.js
CHANGED
package/node/locales/svSE.js
CHANGED
package/node/locales/urPK.js
CHANGED