@mui/x-date-pickers 8.2.0 → 8.3.1
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 +2 -1
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +2 -1
- package/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js +79 -75
- package/AdapterDateFnsV2/AdapterDateFnsV2.js +79 -75
- package/AdapterDayjs/AdapterDayjs.js +12 -9
- package/AdapterLuxon/AdapterLuxon.js +3 -2
- package/AdapterMoment/AdapterMoment.js +2 -2
- package/AdapterMomentHijri/AdapterMomentHijri.js +3 -0
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -0
- package/CHANGELOG.md +199 -6
- package/DateCalendar/PickersFadeTransitionGroup.js +1 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -0
- package/DigitalClock/DigitalClock.d.ts +1 -1
- package/DigitalClock/DigitalClock.js +2 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -1
- package/PickersLayout/PickersLayout.d.ts +2 -2
- package/PickersSectionList/PickersSectionList.d.ts +1 -1
- package/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +6 -6
- package/PickersTextField/PickersInput/pickersInputClasses.d.ts +6 -6
- package/PickersTextField/PickersInputBase/PickersInputBase.d.ts +2 -2
- package/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.ts +5 -5
- package/PickersTextField/PickersTextField.js +8 -1
- package/YearCalendar/yearCalendarClasses.d.ts +1 -1
- package/esm/AdapterDateFns/AdapterDateFns.js +2 -1
- package/esm/AdapterDateFnsJalali/AdapterDateFnsJalali.js +2 -1
- package/esm/AdapterDateFnsJalaliV2/AdapterDateFnsJalaliV2.js +5 -1
- package/esm/AdapterDateFnsV2/AdapterDateFnsV2.js +5 -1
- package/esm/AdapterDayjs/AdapterDayjs.js +12 -9
- package/esm/AdapterLuxon/AdapterLuxon.js +3 -2
- package/esm/AdapterMoment/AdapterMoment.js +2 -2
- package/esm/AdapterMomentHijri/AdapterMomentHijri.js +3 -0
- package/esm/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -0
- package/esm/DateCalendar/PickersFadeTransitionGroup.js +1 -3
- package/esm/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -0
- package/esm/DigitalClock/DigitalClock.d.ts +1 -1
- package/esm/DigitalClock/DigitalClock.js +2 -1
- package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -1
- package/esm/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -1
- package/esm/PickersLayout/PickersLayout.d.ts +2 -2
- package/esm/PickersSectionList/PickersSectionList.d.ts +1 -1
- package/esm/PickersTextField/PickersFilledInput/pickersFilledInputClasses.d.ts +6 -6
- package/esm/PickersTextField/PickersInput/pickersInputClasses.d.ts +6 -6
- package/esm/PickersTextField/PickersInputBase/PickersInputBase.d.ts +2 -2
- package/esm/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.d.ts +5 -5
- package/esm/PickersTextField/PickersTextField.js +8 -1
- package/esm/YearCalendar/yearCalendarClasses.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/components/PickersArrowSwitcher/pickersArrowSwitcherClasses.d.ts +1 -1
- package/esm/internals/components/PickersModalDialog.js +6 -2
- package/esm/internals/components/pickersToolbarClasses.d.ts +1 -1
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/pickersArrowSwitcherClasses.d.ts +1 -1
- package/internals/components/PickersModalDialog.js +6 -2
- package/internals/components/pickersToolbarClasses.d.ts +1 -1
- package/package.json +4 -4
|
@@ -73,7 +73,7 @@ export class AdapterDateFns extends AdapterDateFnsBase {
|
|
|
73
73
|
locale,
|
|
74
74
|
formats
|
|
75
75
|
} = {}) {
|
|
76
|
-
/*
|
|
76
|
+
/* v8 ignore start */
|
|
77
77
|
if (process.env.NODE_ENV !== 'production') {
|
|
78
78
|
if (typeof addDays !== 'function') {
|
|
79
79
|
throw new Error(['MUI: The `date-fns` package v2.x is not compatible with this adapter.', 'Please, install v3.x or v4.x of the package or use the `AdapterDateFnsV2` instead.'].join('\n'));
|
|
@@ -82,6 +82,7 @@ export class AdapterDateFns extends AdapterDateFnsBase {
|
|
|
82
82
|
throw new Error('MUI: The minimum supported `date-fns` package version compatible with this adapter is `3.2.x`.');
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
/* v8 ignore stop */
|
|
85
86
|
super({
|
|
86
87
|
locale: locale ?? enUS,
|
|
87
88
|
formats,
|
|
@@ -109,7 +109,7 @@ export class AdapterDateFnsJalali extends AdapterDateFnsBase {
|
|
|
109
109
|
locale,
|
|
110
110
|
formats
|
|
111
111
|
} = {}) {
|
|
112
|
-
/*
|
|
112
|
+
/* v8 ignore start */
|
|
113
113
|
if (process.env.NODE_ENV !== 'production') {
|
|
114
114
|
if (typeof addDays !== 'function') {
|
|
115
115
|
throw new Error(['MUI: The `date-fns-jalali` package v2.x is not compatible with this adapter.', 'Please, install v3.x or v4.x of the package or use the `AdapterDateFnsJalaliV2` instead.'].join('\n'));
|
|
@@ -118,6 +118,7 @@ export class AdapterDateFnsJalali extends AdapterDateFnsBase {
|
|
|
118
118
|
throw new Error('MUI: The minimum supported `date-fns-jalali` package version compatible with this adapter is `3.2.x`.');
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
/* v8 ignore stop */
|
|
121
122
|
super({
|
|
122
123
|
locale: locale ?? defaultLocale,
|
|
123
124
|
// some formats are different in jalali adapter,
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
// date-fns-jalali@<3 has no exports field defined
|
|
3
3
|
// See https://github.com/date-fns/date-fns/issues/1781
|
|
4
4
|
/* eslint-disable import/extensions, class-methods-use-this */
|
|
5
|
+
/* v8 ignore start */
|
|
5
6
|
// @ts-nocheck
|
|
6
7
|
import addSeconds from 'date-fns-jalali/addSeconds/index.js';
|
|
7
8
|
import addMinutes from 'date-fns-jalali/addMinutes/index.js';
|
|
@@ -47,6 +48,8 @@ import startOfYear from 'date-fns-jalali/startOfYear/index.js';
|
|
|
47
48
|
import isWithinInterval from 'date-fns-jalali/isWithinInterval/index.js';
|
|
48
49
|
import defaultLocale from 'date-fns-jalali/locale/fa-IR/index.js';
|
|
49
50
|
import longFormatters from 'date-fns-jalali/_lib/format/longFormatters/index.js';
|
|
51
|
+
/* v8 ignore end */
|
|
52
|
+
|
|
50
53
|
import { AdapterDateFnsBase } from "../AdapterDateFnsBase/index.js";
|
|
51
54
|
const defaultFormats = {
|
|
52
55
|
year: 'yyyy',
|
|
@@ -113,12 +116,13 @@ export class AdapterDateFnsJalali extends AdapterDateFnsBase {
|
|
|
113
116
|
locale,
|
|
114
117
|
formats
|
|
115
118
|
} = {}) {
|
|
116
|
-
/*
|
|
119
|
+
/* v8 ignore start */
|
|
117
120
|
if (process.env.NODE_ENV !== 'production') {
|
|
118
121
|
if (typeof addDays !== 'function') {
|
|
119
122
|
throw new Error(['MUI: This adapter is only compatible with `date-fns-jalali` v2.x package versions.', 'Please, install v2.x of the package or use the `AdapterDateFnsJalali` instead.'].join('\n'));
|
|
120
123
|
}
|
|
121
124
|
}
|
|
125
|
+
/* v8 ignore stop */
|
|
122
126
|
super({
|
|
123
127
|
locale: locale ?? defaultLocale,
|
|
124
128
|
// some formats are different in jalali adapter,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// date-fns@<3 has no exports field defined
|
|
2
2
|
// See https://github.com/date-fns/date-fns/issues/1781
|
|
3
3
|
/* eslint-disable import/extensions, class-methods-use-this */
|
|
4
|
+
/* v8 ignore start */
|
|
4
5
|
// @ts-nocheck
|
|
5
6
|
import addDays from 'date-fns/addDays/index.js';
|
|
6
7
|
import addSeconds from 'date-fns/addSeconds/index.js';
|
|
@@ -46,6 +47,8 @@ import startOfYear from 'date-fns/startOfYear/index.js';
|
|
|
46
47
|
import isWithinInterval from 'date-fns/isWithinInterval/index.js';
|
|
47
48
|
import defaultLocale from 'date-fns/locale/en-US/index.js';
|
|
48
49
|
import longFormatters from 'date-fns/_lib/format/longFormatters/index.js';
|
|
50
|
+
/* v8 ignore end */
|
|
51
|
+
|
|
49
52
|
import { AdapterDateFnsBase } from "../AdapterDateFnsBase/index.js";
|
|
50
53
|
/**
|
|
51
54
|
* Based on `@date-io/date-fns`
|
|
@@ -77,12 +80,13 @@ export class AdapterDateFns extends AdapterDateFnsBase {
|
|
|
77
80
|
locale,
|
|
78
81
|
formats
|
|
79
82
|
} = {}) {
|
|
80
|
-
/*
|
|
83
|
+
/* v8 ignore start */
|
|
81
84
|
if (process.env.NODE_ENV !== 'production') {
|
|
82
85
|
if (typeof addDays !== 'function') {
|
|
83
86
|
throw new Error(['MUI: This adapter is only compatible with `date-fns` v2.x package versions.', 'Please, install v2.x of the package or use the `AdapterDateFns` instead.'].join('\n'));
|
|
84
87
|
}
|
|
85
88
|
}
|
|
89
|
+
/* v8 ignore stop */
|
|
86
90
|
super({
|
|
87
91
|
locale: locale ?? defaultLocale,
|
|
88
92
|
formats,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
/* eslint-disable class-methods-use-this */
|
|
3
|
+
/* v8 ignore start */
|
|
3
4
|
import defaultDayjs from 'dayjs';
|
|
4
5
|
// dayjs has no exports field defined
|
|
5
6
|
// See https://github.com/iamkun/dayjs/issues/2562
|
|
@@ -9,6 +10,7 @@ import customParseFormatPlugin from 'dayjs/plugin/customParseFormat.js';
|
|
|
9
10
|
import localizedFormatPlugin from 'dayjs/plugin/localizedFormat.js';
|
|
10
11
|
import isBetweenPlugin from 'dayjs/plugin/isBetween.js';
|
|
11
12
|
import advancedFormatPlugin from 'dayjs/plugin/advancedFormat.js';
|
|
13
|
+
/* v8 ignore stop */
|
|
12
14
|
/* eslint-enable import/extensions */
|
|
13
15
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
14
16
|
defaultDayjs.extend(localizedFormatPlugin);
|
|
@@ -202,7 +204,7 @@ export class AdapterDayjs {
|
|
|
202
204
|
const timezone = defaultDayjs.tz.guess();
|
|
203
205
|
|
|
204
206
|
// We can't change the system timezone in the tests
|
|
205
|
-
/*
|
|
207
|
+
/* v8 ignore next 3 */
|
|
206
208
|
if (timezone !== 'UTC') {
|
|
207
209
|
return defaultDayjs.tz(value, timezone);
|
|
208
210
|
}
|
|
@@ -211,19 +213,19 @@ export class AdapterDayjs {
|
|
|
211
213
|
return defaultDayjs(value);
|
|
212
214
|
};
|
|
213
215
|
this.createUTCDate = value => {
|
|
214
|
-
/*
|
|
216
|
+
/* v8 ignore next 3 */
|
|
215
217
|
if (!this.hasUTCPlugin()) {
|
|
216
218
|
throw new Error(MISSING_UTC_PLUGIN);
|
|
217
219
|
}
|
|
218
220
|
return defaultDayjs.utc(value);
|
|
219
221
|
};
|
|
220
222
|
this.createTZDate = (value, timezone) => {
|
|
221
|
-
/*
|
|
223
|
+
/* v8 ignore next 3 */
|
|
222
224
|
if (!this.hasUTCPlugin()) {
|
|
223
225
|
throw new Error(MISSING_UTC_PLUGIN);
|
|
224
226
|
}
|
|
225
227
|
|
|
226
|
-
/*
|
|
228
|
+
/* v8 ignore next 3 */
|
|
227
229
|
if (!this.hasTimezonePlugin()) {
|
|
228
230
|
throw new Error(MISSING_TIMEZONE_PLUGIN);
|
|
229
231
|
}
|
|
@@ -235,10 +237,11 @@ export class AdapterDayjs {
|
|
|
235
237
|
const locale = this.locale || 'en';
|
|
236
238
|
let localeObject = locales[locale];
|
|
237
239
|
if (localeObject === undefined) {
|
|
238
|
-
/*
|
|
240
|
+
/* v8 ignore start */
|
|
239
241
|
if (process.env.NODE_ENV !== 'production') {
|
|
240
242
|
warnOnce(['MUI X: Your locale has not been found.', 'Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale.', "Or you forget to import the locale from 'dayjs/locale/{localeUsed}'", 'fallback on English locale.']);
|
|
241
243
|
}
|
|
244
|
+
/* v8 ignore stop */
|
|
242
245
|
localeObject = locales.en;
|
|
243
246
|
}
|
|
244
247
|
return localeObject.formats;
|
|
@@ -257,7 +260,7 @@ export class AdapterDayjs {
|
|
|
257
260
|
if (timezone !== 'UTC') {
|
|
258
261
|
const fixedValue = value.tz(this.cleanTimezone(timezone), true);
|
|
259
262
|
// TODO: Simplify the case when we raise the `dayjs` peer dep to 1.11.12 (https://github.com/iamkun/dayjs/releases/tag/v1.11.12)
|
|
260
|
-
/*
|
|
263
|
+
/* v8 ignore next 3 */
|
|
261
264
|
// @ts-ignore
|
|
262
265
|
if (fixedValue.$offset === (value.$offset ?? 0)) {
|
|
263
266
|
return value;
|
|
@@ -306,7 +309,7 @@ export class AdapterDayjs {
|
|
|
306
309
|
return value;
|
|
307
310
|
}
|
|
308
311
|
if (timezone === 'UTC') {
|
|
309
|
-
/*
|
|
312
|
+
/* v8 ignore next 3 */
|
|
310
313
|
if (!this.hasUTCPlugin()) {
|
|
311
314
|
throw new Error(MISSING_UTC_PLUGIN);
|
|
312
315
|
}
|
|
@@ -324,7 +327,7 @@ export class AdapterDayjs {
|
|
|
324
327
|
return value;
|
|
325
328
|
}
|
|
326
329
|
|
|
327
|
-
/*
|
|
330
|
+
/* v8 ignore next */
|
|
328
331
|
throw new Error(MISSING_TIMEZONE_PLUGIN);
|
|
329
332
|
}
|
|
330
333
|
return defaultDayjs.tz(value, this.cleanTimezone(timezone));
|
|
@@ -342,7 +345,7 @@ export class AdapterDayjs {
|
|
|
342
345
|
return this.locale || 'en';
|
|
343
346
|
};
|
|
344
347
|
this.is12HourCycleInCurrentLocale = () => {
|
|
345
|
-
/*
|
|
348
|
+
/* v8 ignore next */
|
|
346
349
|
return /A|a/.test(this.getLocaleFormats().LT || '');
|
|
347
350
|
};
|
|
348
351
|
this.expandFormat = format => {
|
|
@@ -225,7 +225,7 @@ export class AdapterLuxon {
|
|
|
225
225
|
this.getCurrentLocaleCode = () => {
|
|
226
226
|
return this.locale;
|
|
227
227
|
};
|
|
228
|
-
/*
|
|
228
|
+
/* v8 ignore start */
|
|
229
229
|
this.is12HourCycleInCurrentLocale = () => {
|
|
230
230
|
if (typeof Intl === 'undefined' || typeof Intl.DateTimeFormat === 'undefined') {
|
|
231
231
|
return true; // Luxon defaults to en-US if Intl not found
|
|
@@ -234,6 +234,7 @@ export class AdapterLuxon {
|
|
|
234
234
|
hour: 'numeric'
|
|
235
235
|
})?.resolvedOptions()?.hour12);
|
|
236
236
|
};
|
|
237
|
+
/* v8 ignore stop */
|
|
237
238
|
this.expandFormat = format => {
|
|
238
239
|
// Extract escaped section to avoid extending them
|
|
239
240
|
const catchEscapedSectionsRegexp = /''|'(''|[^'])+('|$)|[^']*/g;
|
|
@@ -477,7 +478,7 @@ export class AdapterLuxon {
|
|
|
477
478
|
return weeks;
|
|
478
479
|
};
|
|
479
480
|
this.getWeekNumber = value => {
|
|
480
|
-
/*
|
|
481
|
+
/* v8 ignore next */
|
|
481
482
|
return value.localWeekNumber ?? value.weekNumber;
|
|
482
483
|
};
|
|
483
484
|
this.getDayOfWeek = value => {
|
|
@@ -186,7 +186,7 @@ export class AdapterMoment {
|
|
|
186
186
|
return parsedValue.locale(this.locale);
|
|
187
187
|
};
|
|
188
188
|
this.createTZDate = (value, timezone) => {
|
|
189
|
-
/*
|
|
189
|
+
/* v8 ignore next 3 */
|
|
190
190
|
if (!this.hasTimezonePlugin()) {
|
|
191
191
|
throw new Error(MISSING_TIMEZONE_PLUGIN);
|
|
192
192
|
}
|
|
@@ -229,7 +229,7 @@ export class AdapterMoment {
|
|
|
229
229
|
return value.clone().local();
|
|
230
230
|
}
|
|
231
231
|
if (!this.hasTimezonePlugin()) {
|
|
232
|
-
/*
|
|
232
|
+
/* v8 ignore next 3 */
|
|
233
233
|
if (timezone !== 'default') {
|
|
234
234
|
throw new Error(MISSING_TIMEZONE_PLUGIN);
|
|
235
235
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
/* eslint-disable class-methods-use-this */
|
|
3
|
+
/* v8 ignore next */
|
|
3
4
|
import defaultHMoment from 'moment-hijri';
|
|
4
5
|
import { AdapterMoment } from "../AdapterMoment/index.js";
|
|
5
6
|
// From https://momentjs.com/docs/#/displaying/format/
|
|
@@ -147,9 +148,11 @@ export class AdapterMomentHijri extends AdapterMoment {
|
|
|
147
148
|
}
|
|
148
149
|
return this.moment(value).locale('ar-SA');
|
|
149
150
|
};
|
|
151
|
+
/* v8 ignore next 3 */
|
|
150
152
|
this.getTimezone = () => {
|
|
151
153
|
return 'default';
|
|
152
154
|
};
|
|
155
|
+
/* v8 ignore next 3 */
|
|
153
156
|
this.setTimezone = value => {
|
|
154
157
|
return value;
|
|
155
158
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
/* eslint-disable class-methods-use-this */
|
|
3
|
+
/* v8 ignore next */
|
|
3
4
|
import defaultJMoment from 'moment-jalaali';
|
|
4
5
|
import { AdapterMoment } from "../AdapterMoment/index.js";
|
|
5
6
|
// From https://momentjs.com/docs/#/displaying/format/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
2
|
const _excluded = ["children"];
|
|
4
3
|
import * as React from 'react';
|
|
@@ -46,10 +45,9 @@ export function PickersFadeTransitionGroup(inProps) {
|
|
|
46
45
|
if (reduceAnimations) {
|
|
47
46
|
return children;
|
|
48
47
|
}
|
|
49
|
-
const ownerState = _extends({}, other);
|
|
50
48
|
return /*#__PURE__*/_jsx(PickersFadeTransitionGroupRoot, {
|
|
51
49
|
className: clsx(classes.root, className),
|
|
52
|
-
ownerState:
|
|
50
|
+
ownerState: other,
|
|
53
51
|
children: /*#__PURE__*/_jsx(Fade, {
|
|
54
52
|
appear: false,
|
|
55
53
|
mountOnEnter: true,
|
|
@@ -37,6 +37,8 @@ const rendererInterceptor = function RendererInterceptor(props) {
|
|
|
37
37
|
} = rendererProps,
|
|
38
38
|
otherProps = _objectWithoutPropertiesLoose(rendererProps, _excluded);
|
|
39
39
|
const finalProps = _extends({}, otherProps, {
|
|
40
|
+
// we control the focused view manually
|
|
41
|
+
autoFocus: false,
|
|
40
42
|
focusedView: null,
|
|
41
43
|
sx: [{
|
|
42
44
|
[`&.${multiSectionDigitalClockClasses.root}`]: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DigitalClockProps } from "./DigitalClock.types.js";
|
|
3
|
-
export declare const DigitalClockItem: import("@emotion/styled").StyledComponent<import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "
|
|
3
|
+
export declare const DigitalClockItem: import("@emotion/styled").StyledComponent<import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "disabled" | "autoFocus" | "dense" | "tabIndex" | "classes" | "className" | "style" | "children" | "sx" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableGutters" | "divider" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
4
4
|
type DigitalClockComponent = ((props: DigitalClockProps & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
5
5
|
propTypes?: any;
|
|
6
6
|
};
|
|
@@ -13,6 +13,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
13
13
|
import MenuItem from '@mui/material/MenuItem';
|
|
14
14
|
import MenuList from '@mui/material/MenuList';
|
|
15
15
|
import useForkRef from '@mui/utils/useForkRef';
|
|
16
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
16
17
|
import { usePickerTranslations } from "../hooks/usePickerTranslations.js";
|
|
17
18
|
import { useUtils, useNow } from "../internals/hooks/useUtils.js";
|
|
18
19
|
import { createIsAfterIgnoreDatePart } from "../internals/utils/time-utils.js";
|
|
@@ -189,7 +190,7 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
189
190
|
const handleItemSelect = useEventCallback(newValue => {
|
|
190
191
|
setValueAndGoToNextView(newValue, 'finish');
|
|
191
192
|
});
|
|
192
|
-
|
|
193
|
+
useEnhancedEffect(() => {
|
|
193
194
|
if (containerRef.current === null) {
|
|
194
195
|
return;
|
|
195
196
|
}
|
|
@@ -333,7 +333,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
333
333
|
items: viewTimeOptions[timeView].items,
|
|
334
334
|
onChange: viewTimeOptions[timeView].onChange,
|
|
335
335
|
active: view === timeView,
|
|
336
|
-
autoFocus: autoFocus
|
|
336
|
+
autoFocus: autoFocus || focusedView === timeView,
|
|
337
337
|
disabled: disabled,
|
|
338
338
|
readOnly: readOnly,
|
|
339
339
|
slots: slots,
|
|
@@ -10,6 +10,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
10
10
|
import MenuList from '@mui/material/MenuList';
|
|
11
11
|
import MenuItem from '@mui/material/MenuItem';
|
|
12
12
|
import useForkRef from '@mui/utils/useForkRef';
|
|
13
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
13
14
|
import { getMultiSectionDigitalClockSectionUtilityClass } from "./multiSectionDigitalClockSectionClasses.js";
|
|
14
15
|
import { DIGITAL_CLOCK_VIEW_HEIGHT, MULTI_SECTION_CLOCK_SECTION_WIDTH } from "../internals/constants/dimensions.js";
|
|
15
16
|
import { getFocusedListItemIndex } from "../internals/utils/utils.js";
|
|
@@ -124,7 +125,7 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
124
125
|
});
|
|
125
126
|
const classes = useUtilityClasses(classesProp);
|
|
126
127
|
const DigitalClockSectionItem = slots?.digitalClockSectionItem ?? MultiSectionDigitalClockSectionItem;
|
|
127
|
-
|
|
128
|
+
useEnhancedEffect(() => {
|
|
128
129
|
if (containerRef.current === null) {
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
@@ -3,10 +3,10 @@ import { PickerLayoutOwnerState, PickersLayoutProps } from "./PickersLayout.type
|
|
|
3
3
|
import { PickerValidValue } from "../internals/models/index.js";
|
|
4
4
|
export declare const PickersLayoutRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
5
|
ownerState: PickerLayoutOwnerState;
|
|
6
|
-
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.
|
|
6
|
+
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | keyof React.ClassAttributes<HTMLDivElement>>, {}>;
|
|
7
7
|
export declare const PickersLayoutContentWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
8
|
ownerState: PickerLayoutOwnerState;
|
|
9
|
-
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.
|
|
9
|
+
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | keyof React.ClassAttributes<HTMLDivElement>>, {}>;
|
|
10
10
|
type PickersLayoutComponent = (<TValue extends PickerValidValue>(props: PickersLayoutProps<TValue> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
11
11
|
propTypes?: any;
|
|
12
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PickersSectionListProps } from "./PickersSectionList.types.js";
|
|
3
|
-
export declare const PickersSectionListRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.
|
|
3
|
+
export declare const PickersSectionListRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | keyof React.ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
4
|
export declare const PickersSectionListSection: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof React.ClassAttributes<HTMLSpanElement> | keyof React.HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
5
5
|
export declare const PickersSectionListSectionSeparator: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof React.ClassAttributes<HTMLSpanElement> | keyof React.HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
6
6
|
export declare const PickersSectionListSectionContent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof React.ClassAttributes<HTMLSpanElement> | keyof React.HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
@@ -6,19 +6,19 @@ export interface PickersFilledInputClasses extends PickersInputBaseClasses {
|
|
|
6
6
|
export type PickersFilledInputClassKey = keyof PickersFilledInputClasses;
|
|
7
7
|
export declare function getPickersFilledInputUtilityClass(slot: string): string;
|
|
8
8
|
export declare const pickersFilledInputClasses: {
|
|
9
|
-
underline: string;
|
|
10
|
-
input: string;
|
|
11
9
|
root: string;
|
|
10
|
+
input: string;
|
|
11
|
+
underline: string;
|
|
12
|
+
sectionContent: string;
|
|
12
13
|
disabled: string;
|
|
13
14
|
readOnly: string;
|
|
14
|
-
error: string;
|
|
15
15
|
focused: string;
|
|
16
|
-
|
|
17
|
-
adornedEnd: string;
|
|
16
|
+
error: string;
|
|
18
17
|
notchedOutline: string;
|
|
19
18
|
sectionsContainer: string;
|
|
20
|
-
sectionContent: string;
|
|
21
19
|
sectionBefore: string;
|
|
22
20
|
sectionAfter: string;
|
|
21
|
+
adornedStart: string;
|
|
22
|
+
adornedEnd: string;
|
|
23
23
|
activeBar: string;
|
|
24
24
|
};
|
|
@@ -6,19 +6,19 @@ export interface PickersInputClasses extends PickersInputBaseClasses {
|
|
|
6
6
|
export type PickersInputClassKey = keyof PickersInputClasses;
|
|
7
7
|
export declare function getPickersInputUtilityClass(slot: string): string;
|
|
8
8
|
export declare const pickersInputClasses: {
|
|
9
|
-
underline: string;
|
|
10
|
-
input: string;
|
|
11
9
|
root: string;
|
|
10
|
+
input: string;
|
|
11
|
+
underline: string;
|
|
12
|
+
sectionContent: string;
|
|
12
13
|
disabled: string;
|
|
13
14
|
readOnly: string;
|
|
14
|
-
error: string;
|
|
15
15
|
focused: string;
|
|
16
|
-
|
|
17
|
-
adornedEnd: string;
|
|
16
|
+
error: string;
|
|
18
17
|
notchedOutline: string;
|
|
19
18
|
sectionsContainer: string;
|
|
20
|
-
sectionContent: string;
|
|
21
19
|
sectionBefore: string;
|
|
22
20
|
sectionAfter: string;
|
|
21
|
+
adornedStart: string;
|
|
22
|
+
adornedEnd: string;
|
|
23
23
|
activeBar: string;
|
|
24
24
|
};
|
|
@@ -3,8 +3,8 @@ import { PickersInputBaseProps } from "./PickersInputBase.types.js";
|
|
|
3
3
|
import { PickerTextFieldOwnerState } from "../../models/fields.js";
|
|
4
4
|
export declare const PickersInputBaseRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
5
|
ownerState: PickerTextFieldOwnerState;
|
|
6
|
-
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.
|
|
7
|
-
export declare const PickersInputBaseSectionsContainer: import("@emotion/styled").StyledComponent<Pick<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.
|
|
6
|
+
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | keyof React.ClassAttributes<HTMLDivElement>>, {}>;
|
|
7
|
+
export declare const PickersInputBaseSectionsContainer: import("@emotion/styled").StyledComponent<Pick<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | keyof React.ClassAttributes<HTMLDivElement>>, keyof React.HTMLAttributes<HTMLDivElement> | keyof React.ClassAttributes<HTMLDivElement> | keyof import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
8
|
ownerState: PickerTextFieldOwnerState;
|
|
9
9
|
}, {}, {}>;
|
|
10
10
|
/**
|
|
@@ -6,18 +6,18 @@ export interface PickersOutlinedInputClasses extends PickersInputBaseClasses {
|
|
|
6
6
|
export type PickersOutlinedInputClassKey = keyof PickersOutlinedInputClasses;
|
|
7
7
|
export declare function getPickersOutlinedInputUtilityClass(slot: string): string;
|
|
8
8
|
export declare const pickersOutlinedInputClasses: {
|
|
9
|
-
input: string;
|
|
10
9
|
root: string;
|
|
10
|
+
input: string;
|
|
11
11
|
notchedOutline: string;
|
|
12
|
+
sectionContent: string;
|
|
12
13
|
disabled: string;
|
|
13
14
|
readOnly: string;
|
|
14
|
-
error: string;
|
|
15
15
|
focused: string;
|
|
16
|
-
|
|
17
|
-
adornedEnd: string;
|
|
16
|
+
error: string;
|
|
18
17
|
sectionsContainer: string;
|
|
19
|
-
sectionContent: string;
|
|
20
18
|
sectionBefore: string;
|
|
21
19
|
sectionAfter: string;
|
|
20
|
+
adornedStart: string;
|
|
21
|
+
adornedEnd: string;
|
|
22
22
|
activeBar: string;
|
|
23
23
|
};
|
|
@@ -112,6 +112,13 @@ const PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField
|
|
|
112
112
|
}), [fieldOwnerState, areAllSectionsEmpty, focused, error, props.size, color, fullWidth, startAdornment, endAdornment, InputProps?.startAdornment, InputProps?.endAdornment, label]);
|
|
113
113
|
const classes = useUtilityClasses(classesProp, ownerState);
|
|
114
114
|
const PickersInputComponent = VARIANT_COMPONENT[variant];
|
|
115
|
+
const inputAdditionalProps = {};
|
|
116
|
+
if (variant === 'outlined') {
|
|
117
|
+
if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {
|
|
118
|
+
inputAdditionalProps.notched = InputLabelProps.shrink;
|
|
119
|
+
}
|
|
120
|
+
inputAdditionalProps.label = label;
|
|
121
|
+
}
|
|
115
122
|
return /*#__PURE__*/_jsx(PickerTextFieldOwnerStateContext.Provider, {
|
|
116
123
|
value: ownerState,
|
|
117
124
|
children: /*#__PURE__*/_jsxs(PickersTextFieldRoot, _extends({
|
|
@@ -159,7 +166,7 @@ const PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField
|
|
|
159
166
|
"aria-describedby": helperTextId,
|
|
160
167
|
"aria-live": helperTextId ? 'polite' : undefined,
|
|
161
168
|
"data-active-range-position": dataActiveRangePosition
|
|
162
|
-
}, InputProps)), helperText && /*#__PURE__*/_jsx(FormHelperText, _extends({
|
|
169
|
+
}, inputAdditionalProps, InputProps)), helperText && /*#__PURE__*/_jsx(FormHelperText, _extends({
|
|
163
170
|
id: helperTextId
|
|
164
171
|
}, FormHelperTextProps, {
|
|
165
172
|
children: helperText
|
|
@@ -10,4 +10,4 @@ export interface YearCalendarClasses {
|
|
|
10
10
|
}
|
|
11
11
|
export type YearCalendarClassKey = keyof YearCalendarClasses;
|
|
12
12
|
export declare function getYearCalendarUtilityClass(slot: string): string;
|
|
13
|
-
export declare const yearCalendarClasses: Record<"
|
|
13
|
+
export declare const yearCalendarClasses: Record<"root" | "disabled" | "button" | "selected", string>;
|
package/esm/index.js
CHANGED
|
@@ -16,4 +16,4 @@ export interface PickersArrowSwitcherClasses {
|
|
|
16
16
|
}
|
|
17
17
|
export type PickersArrowSwitcherClassKey = keyof PickersArrowSwitcherClasses;
|
|
18
18
|
export declare function getPickersArrowSwitcherUtilityClass(slot: string): string;
|
|
19
|
-
export declare const pickersArrowSwitcherClasses: Record<"
|
|
19
|
+
export declare const pickersArrowSwitcherClasses: Record<"root" | "button" | "spacer" | "previousIconButton" | "nextIconButton" | "leftArrowIcon" | "rightArrowIcon", string>;
|
|
@@ -32,13 +32,17 @@ export function PickersModalDialog(props) {
|
|
|
32
32
|
open
|
|
33
33
|
} = usePickerContext();
|
|
34
34
|
const {
|
|
35
|
-
dismissViews
|
|
35
|
+
dismissViews,
|
|
36
|
+
onPopperExited
|
|
36
37
|
} = usePickerPrivateContext();
|
|
37
38
|
const Dialog = slots?.dialog ?? PickersModalDialogRoot;
|
|
38
39
|
const Transition = slots?.mobileTransition ?? Fade;
|
|
39
40
|
return /*#__PURE__*/_jsx(Dialog, _extends({
|
|
40
41
|
open: open,
|
|
41
|
-
onClose:
|
|
42
|
+
onClose: () => {
|
|
43
|
+
dismissViews();
|
|
44
|
+
onPopperExited?.();
|
|
45
|
+
}
|
|
42
46
|
}, slotProps?.dialog, {
|
|
43
47
|
TransitionComponent: Transition,
|
|
44
48
|
TransitionProps: slotProps?.mobileTransition,
|
|
@@ -8,4 +8,4 @@ export interface PickersToolbarClasses {
|
|
|
8
8
|
}
|
|
9
9
|
export type PickersToolbarClassKey = keyof PickersToolbarClasses;
|
|
10
10
|
export declare function getPickersToolbarUtilityClass(slot: string): string;
|
|
11
|
-
export declare const pickersToolbarClasses: Record<"
|
|
11
|
+
export declare const pickersToolbarClasses: Record<"root" | "content" | "title", string>;
|
package/index.js
CHANGED
|
@@ -16,4 +16,4 @@ export interface PickersArrowSwitcherClasses {
|
|
|
16
16
|
}
|
|
17
17
|
export type PickersArrowSwitcherClassKey = keyof PickersArrowSwitcherClasses;
|
|
18
18
|
export declare function getPickersArrowSwitcherUtilityClass(slot: string): string;
|
|
19
|
-
export declare const pickersArrowSwitcherClasses: Record<"
|
|
19
|
+
export declare const pickersArrowSwitcherClasses: Record<"root" | "button" | "spacer" | "previousIconButton" | "nextIconButton" | "leftArrowIcon" | "rightArrowIcon", string>;
|
|
@@ -40,13 +40,17 @@ function PickersModalDialog(props) {
|
|
|
40
40
|
open
|
|
41
41
|
} = (0, _hooks.usePickerContext)();
|
|
42
42
|
const {
|
|
43
|
-
dismissViews
|
|
43
|
+
dismissViews,
|
|
44
|
+
onPopperExited
|
|
44
45
|
} = (0, _usePickerPrivateContext.usePickerPrivateContext)();
|
|
45
46
|
const Dialog = slots?.dialog ?? PickersModalDialogRoot;
|
|
46
47
|
const Transition = slots?.mobileTransition ?? _Fade.default;
|
|
47
48
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Dialog, (0, _extends2.default)({
|
|
48
49
|
open: open,
|
|
49
|
-
onClose:
|
|
50
|
+
onClose: () => {
|
|
51
|
+
dismissViews();
|
|
52
|
+
onPopperExited?.();
|
|
53
|
+
}
|
|
50
54
|
}, slotProps?.dialog, {
|
|
51
55
|
TransitionComponent: Transition,
|
|
52
56
|
TransitionProps: slotProps?.mobileTransition,
|
|
@@ -8,4 +8,4 @@ export interface PickersToolbarClasses {
|
|
|
8
8
|
}
|
|
9
9
|
export type PickersToolbarClassKey = keyof PickersToolbarClasses;
|
|
10
10
|
export declare function getPickersToolbarUtilityClass(slot: string): string;
|
|
11
|
-
export declare const pickersToolbarClasses: Record<"
|
|
11
|
+
export declare const pickersToolbarClasses: Record<"root" | "content" | "title", string>;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "8.
|
|
4
|
-
"description": "The community edition of the Date and Time Picker components (MUI X).",
|
|
3
|
+
"version": "8.3.1",
|
|
5
4
|
"author": "MUI Team",
|
|
5
|
+
"description": "The community edition of the MUI X Date and Time Picker components.",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"bugs": {
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"directory": "packages/x-date-pickers"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@babel/runtime": "^7.27.
|
|
38
|
+
"@babel/runtime": "^7.27.1",
|
|
39
39
|
"@mui/utils": "^7.0.2",
|
|
40
40
|
"@types/react-transition-group": "^4.4.12",
|
|
41
41
|
"clsx": "^2.1.1",
|
|
42
42
|
"prop-types": "^15.8.1",
|
|
43
43
|
"react-transition-group": "^4.4.5",
|
|
44
|
-
"@mui/x-internals": "8.
|
|
44
|
+
"@mui/x-internals": "8.3.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@emotion/react": "^11.9.0",
|