@mui/x-date-pickers 6.0.4 → 6.1.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/index.d.ts +1 -1
- package/AdapterDateFnsJalali/index.d.ts +1 -1
- package/AdapterDayjs/index.d.ts +2 -3
- package/AdapterLuxon/index.d.ts +2 -2
- package/AdapterLuxon/index.js +1 -1
- package/AdapterMoment/index.d.ts +1 -1
- package/AdapterMomentHijri/index.d.ts +1 -1
- package/AdapterMomentJalaali/index.d.ts +1 -1
- package/CHANGELOG.md +58 -0
- package/DateCalendar/DateCalendar.js +0 -2
- package/DateCalendar/PickersCalendarHeader.d.ts +0 -12
- package/DateCalendar/PickersCalendarHeader.js +7 -9
- package/DateCalendar/PickersSlideTransition.js +1 -0
- package/DateCalendar/useCalendarState.d.ts +1 -1
- package/DateField/DateField.js +8 -2
- package/DatePicker/shared.d.ts +2 -2
- package/DateTimeField/DateTimeField.js +8 -2
- package/LocalizationProvider/LocalizationProvider.d.ts +2 -3
- package/MonthCalendar/PickersMonth.js +1 -0
- package/README.md +2 -2
- package/TimeClock/ClockNumbers.d.ts +1 -1
- package/TimeClock/TimeClock.js +5 -4
- package/TimeField/TimeField.js +8 -2
- package/YearCalendar/PickersYear.js +1 -0
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -12
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +0 -12
- package/internals/components/PickersModalDialog.d.ts +0 -12
- package/internals/components/PickersModalDialog.js +7 -9
- package/internals/components/PickersPopper.d.ts +0 -2
- package/internals/components/PickersPopper.js +2 -7
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +1 -2
- package/internals/hooks/useField/useField.js +2 -2
- package/internals/hooks/useField/useField.types.d.ts +3 -11
- package/internals/hooks/useField/useField.utils.d.ts +2 -3
- package/internals/hooks/useField/useField.utils.js +3 -1
- package/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +1 -2
- package/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
- package/internals/hooks/usePicker/usePickerValue.d.ts +8 -2
- package/internals/hooks/usePicker/usePickerValue.js +23 -2
- package/internals/hooks/usePicker/usePickerViews.js +13 -0
- package/internals/hooks/useUtils.d.ts +1 -1
- package/internals/index.d.ts +0 -1
- package/internals/models/index.d.ts +0 -1
- package/internals/models/index.js +1 -2
- package/internals/utils/date-utils.d.ts +1 -1
- package/internals/utils/time-utils.d.ts +1 -2
- package/internals/utils/valueManagers.d.ts +1 -1
- package/internals/utils/valueManagers.js +2 -2
- package/legacy/AdapterLuxon/index.js +1 -1
- package/legacy/DateCalendar/DateCalendar.js +0 -2
- package/legacy/DateCalendar/PickersCalendarHeader.js +8 -10
- package/legacy/DateField/DateField.js +7 -1
- package/legacy/DateTimeField/DateTimeField.js +7 -1
- package/legacy/TimeClock/TimeClock.js +5 -4
- package/legacy/TimeField/TimeField.js +7 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -12
- package/legacy/internals/components/PickersModalDialog.js +7 -9
- package/legacy/internals/components/PickersPopper.js +2 -7
- package/legacy/internals/hooks/useField/useField.js +2 -2
- package/legacy/internals/hooks/useField/useField.utils.js +3 -1
- package/legacy/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
- package/legacy/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
- package/legacy/internals/hooks/usePicker/usePickerValue.js +23 -4
- package/legacy/internals/hooks/usePicker/usePickerViews.js +13 -0
- package/legacy/internals/models/index.js +1 -2
- package/legacy/internals/utils/valueManagers.js +3 -3
- package/legacy/locales/caES.js +88 -0
- package/legacy/locales/esES.js +34 -17
- package/legacy/locales/heIL.js +33 -16
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/jaJP.js +3 -1
- package/legacy/locales/kzKZ.js +88 -0
- package/legacy/locales/nlNL.js +25 -11
- package/legacy/locales/ptBR.js +33 -16
- package/legacy/models/adapters.js +1 -0
- package/legacy/models/index.js +2 -1
- package/locales/beBY.d.ts +3 -3
- package/locales/caES.d.ts +51 -0
- package/locales/caES.js +54 -0
- package/locales/csCZ.d.ts +3 -3
- package/locales/daDK.d.ts +3 -3
- package/locales/deDE.d.ts +3 -3
- package/locales/enUS.d.ts +3 -3
- package/locales/esES.d.ts +3 -3
- package/locales/esES.js +14 -17
- package/locales/faIR.d.ts +3 -3
- package/locales/fiFI.d.ts +3 -3
- package/locales/frFR.d.ts +3 -3
- package/locales/heIL.d.ts +3 -3
- package/locales/heIL.js +13 -16
- package/locales/huHU.d.ts +3 -3
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/isIS.d.ts +3 -3
- package/locales/itIT.d.ts +3 -3
- package/locales/jaJP.d.ts +3 -3
- package/locales/jaJP.js +1 -1
- package/locales/koKR.d.ts +3 -3
- package/locales/kzKZ.d.ts +51 -0
- package/locales/kzKZ.js +56 -0
- package/locales/nbNO.d.ts +3 -3
- package/locales/nlNL.d.ts +3 -3
- package/locales/nlNL.js +9 -11
- package/locales/plPL.d.ts +3 -3
- package/locales/ptBR.d.ts +3 -3
- package/locales/ptBR.js +13 -16
- package/locales/ruRU.d.ts +3 -3
- package/locales/svSE.d.ts +3 -3
- package/locales/trTR.d.ts +3 -3
- package/locales/ukUA.d.ts +3 -3
- package/locales/urPK.d.ts +3 -3
- package/locales/utils/getPickersLocalization.d.ts +3 -3
- package/locales/utils/pickersLocaleTextApi.d.ts +1 -2
- package/locales/zhCN.d.ts +3 -3
- package/models/adapters.d.ts +567 -0
- package/models/adapters.js +1 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/modern/AdapterLuxon/index.js +1 -1
- package/modern/DateCalendar/DateCalendar.js +0 -2
- package/modern/DateCalendar/PickersCalendarHeader.js +6 -8
- package/modern/DateCalendar/PickersSlideTransition.js +1 -0
- package/modern/DateField/DateField.js +8 -2
- package/modern/DateTimeField/DateTimeField.js +8 -2
- package/modern/MonthCalendar/PickersMonth.js +1 -0
- package/modern/TimeClock/TimeClock.js +5 -4
- package/modern/TimeField/TimeField.js +8 -2
- package/modern/YearCalendar/PickersYear.js +1 -0
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +9 -11
- package/modern/internals/components/PickersModalDialog.js +6 -8
- package/modern/internals/components/PickersPopper.js +2 -7
- package/modern/internals/hooks/useField/useField.js +2 -2
- package/modern/internals/hooks/useField/useField.utils.js +3 -1
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +23 -0
- package/modern/internals/hooks/usePicker/usePickerLayoutProps.js +6 -0
- package/modern/internals/hooks/usePicker/usePickerValue.js +23 -2
- package/modern/internals/hooks/usePicker/usePickerViews.js +13 -0
- package/modern/internals/models/index.js +1 -2
- package/modern/internals/utils/valueManagers.js +2 -2
- package/modern/locales/caES.js +54 -0
- package/modern/locales/esES.js +14 -17
- package/modern/locales/heIL.js +13 -16
- package/modern/locales/index.js +1 -0
- package/modern/locales/jaJP.js +1 -1
- package/modern/locales/kzKZ.js +56 -0
- package/modern/locales/nlNL.js +9 -11
- package/modern/locales/ptBR.js +13 -16
- package/modern/models/adapters.js +1 -0
- package/modern/models/index.js +2 -1
- package/node/AdapterLuxon/index.js +1 -1
- package/node/AdapterMomentHijri/index.js +2 -0
- package/node/DateCalendar/DateCalendar.js +0 -2
- package/node/DateCalendar/PickersCalendarHeader.js +5 -9
- package/node/DateCalendar/PickersSlideTransition.js +1 -0
- package/node/DateField/DateField.js +8 -2
- package/node/DateTimeField/DateTimeField.js +8 -2
- package/node/MonthCalendar/PickersMonth.js +1 -0
- package/node/TimeClock/TimeClock.js +5 -4
- package/node/TimeField/TimeField.js +8 -2
- package/node/YearCalendar/PickersYear.js +1 -0
- package/node/index.js +1 -1
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +9 -11
- package/node/internals/components/PickersModalDialog.js +6 -8
- package/node/internals/components/PickersPopper.js +2 -7
- package/node/internals/hooks/useField/useField.js +2 -2
- package/node/internals/hooks/useField/useField.utils.js +3 -1
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +22 -0
- package/node/internals/hooks/usePicker/usePickerLayoutProps.js +5 -0
- package/node/internals/hooks/usePicker/usePickerValue.js +22 -2
- package/node/internals/hooks/usePicker/usePickerViews.js +12 -0
- package/node/internals/models/index.js +0 -11
- package/node/internals/utils/valueManagers.js +2 -2
- package/node/locales/caES.js +61 -0
- package/node/locales/csCZ.js +0 -1
- package/node/locales/esES.js +14 -17
- package/node/locales/heIL.js +13 -16
- package/node/locales/index.js +11 -0
- package/node/locales/jaJP.js +1 -1
- package/node/locales/kzKZ.js +62 -0
- package/node/locales/nlNL.js +9 -11
- package/node/locales/ptBR.js +13 -16
- package/node/models/adapters.js +5 -0
- package/node/models/index.js +11 -0
- package/package.json +3 -3
- package/internals/models/muiPickersAdapter.d.ts +0 -26
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseAdapterDateFns from '@date-io/date-fns';
|
|
2
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
2
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
3
3
|
export declare class AdapterDateFns extends BaseAdapterDateFns implements MuiPickersAdapter<Date> {
|
|
4
4
|
isMUIAdapter: boolean;
|
|
5
5
|
formatTokenMap: FieldFormatTokenMap;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseAdapterDateFnsJalali from '@date-io/date-fns-jalali';
|
|
2
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
2
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
3
3
|
export declare class AdapterDateFnsJalali extends BaseAdapterDateFnsJalali implements MuiPickersAdapter<Date> {
|
|
4
4
|
isMUIAdapter: boolean;
|
|
5
5
|
formatTokenMap: FieldFormatTokenMap;
|
package/AdapterDayjs/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import defaultDayjs, { Dayjs } from 'dayjs';
|
|
2
2
|
import BaseAdapterDayjs from '@date-io/dayjs';
|
|
3
|
-
import {
|
|
4
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../internals/models';
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter, AdapterFormats } from '../models';
|
|
5
4
|
interface Opts {
|
|
6
5
|
locale?: string;
|
|
7
6
|
/** Make sure that your dayjs instance extends customParseFormat and advancedFormat */
|
|
8
7
|
instance?: typeof defaultDayjs;
|
|
9
|
-
formats?: Partial<
|
|
8
|
+
formats?: Partial<AdapterFormats>;
|
|
10
9
|
}
|
|
11
10
|
export declare class AdapterDayjs extends BaseAdapterDayjs implements MuiPickersAdapter<Dayjs> {
|
|
12
11
|
isMUIAdapter: boolean;
|
package/AdapterLuxon/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DateTime } from 'luxon';
|
|
2
2
|
import BaseAdapterLuxon from '@date-io/luxon';
|
|
3
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
4
4
|
export declare class AdapterLuxon extends BaseAdapterLuxon implements MuiPickersAdapter<DateTime> {
|
|
5
5
|
isMUIAdapter: boolean;
|
|
6
6
|
formatTokenMap: FieldFormatTokenMap;
|
|
@@ -10,5 +10,5 @@ export declare class AdapterLuxon extends BaseAdapterLuxon implements MuiPickers
|
|
|
10
10
|
};
|
|
11
11
|
expandFormat: (format: string) => string;
|
|
12
12
|
getFormatHelperText: (format: string) => string;
|
|
13
|
-
getWeekNumber: (date: DateTime) =>
|
|
13
|
+
getWeekNumber: (date: DateTime) => number;
|
|
14
14
|
}
|
package/AdapterLuxon/index.js
CHANGED
|
@@ -84,7 +84,7 @@ export class AdapterLuxon extends BaseAdapterLuxon {
|
|
|
84
84
|
if (!DateTime.expandFormat) {
|
|
85
85
|
throw Error('Your luxon version does not support `expandFormat`. Consider upgrading it to v3.0.2');
|
|
86
86
|
}
|
|
87
|
-
// Extract escaped section to avoid
|
|
87
|
+
// Extract escaped section to avoid extending them
|
|
88
88
|
const longFormatRegexp = /''|'(''|[^'])+('|$)|[^']*/g;
|
|
89
89
|
return format.match(longFormatRegexp).map(token => {
|
|
90
90
|
const firstCharacter = token[0];
|
package/AdapterMoment/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defaultMoment from 'moment';
|
|
2
2
|
import BaseAdapterMoment from '@date-io/moment';
|
|
3
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
4
4
|
export declare class AdapterMoment extends BaseAdapterMoment implements MuiPickersAdapter<defaultMoment.Moment> {
|
|
5
5
|
isMUIAdapter: boolean;
|
|
6
6
|
formatTokenMap: FieldFormatTokenMap;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseAdapterMomentHijri from '@date-io/hijri';
|
|
2
2
|
import defaultMoment from 'moment-hijri';
|
|
3
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
4
4
|
export declare class AdapterMomentHijri extends BaseAdapterMomentHijri implements MuiPickersAdapter<defaultMoment.Moment> {
|
|
5
5
|
isMUIAdapter: boolean;
|
|
6
6
|
formatTokenMap: FieldFormatTokenMap;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseAdapterMomentJalaali from '@date-io/jalaali';
|
|
2
2
|
import defaultMoment from 'moment-jalaali';
|
|
3
|
-
import { FieldFormatTokenMap, MuiPickersAdapter } from '../
|
|
3
|
+
import { FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
4
4
|
export declare class AdapterMomentJalaali extends BaseAdapterMomentJalaali implements MuiPickersAdapter<defaultMoment.Moment> {
|
|
5
5
|
isMUIAdapter: boolean;
|
|
6
6
|
formatTokenMap: FieldFormatTokenMap;
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,64 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.1.0
|
|
7
|
+
|
|
8
|
+
_Apr 7, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Add Catalan (ca-ES), Kazakh (kz-KZ) and improve Spanish (es-ES), Dutch (nl-NL), Hebrew (he-IL), Hungarian (hu-HU), Japanese (ja-JP), Portuguese (pt-BR), and Russian (ru-RU) locales
|
|
13
|
+
- ✨ Allow to control visibility of columns shown in the columns panel (#8401) @MBilalShafi
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### `@mui/x-data-grid@v6.1.0` / `@mui/x-data-grid-pro@v6.1.0` / `@mui/x-data-grid-premium@v6.1.0`
|
|
18
|
+
|
|
19
|
+
#### Changes
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Allow to control visibility of columns shown in the `ColumnsPanel` component (#8401) @MBilalShafi
|
|
22
|
+
- [DataGrid] Fix filters with empty array value not being removed from the filter model (#8501) @cherniavskii
|
|
23
|
+
- [DataGrid] Fix memory leaks in development (#8301) @cherniavskii
|
|
24
|
+
- [DataGrid] Sync `date` column value when entering edit mode by pressing a digit (#8364) @m4theushw
|
|
25
|
+
- [DataGrid] Wrap column menu button with a tooltip (#7890) @cherniavskii
|
|
26
|
+
- [l10n] Improve Dutch (nl-NL) locale (#8491) @thedutchruben
|
|
27
|
+
- [l10n] Improve Hungarian (hu-HU) locale (#8486) @PetakCC
|
|
28
|
+
- [l10n] Improve Japanese (ja-JP) locale (#8462) @megos
|
|
29
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#8480) @pwnedev
|
|
30
|
+
- [l10n] Improve Russian (ru-RU) locale (#8510) @alexrapro
|
|
31
|
+
|
|
32
|
+
### `@mui/x-date-pickers@v6.1.0` / `@mui/x-date-pickers-pro@v6.1.0`
|
|
33
|
+
|
|
34
|
+
#### Changes
|
|
35
|
+
|
|
36
|
+
- [fields] Fix RTL navigation (#8490) @alexfauquette
|
|
37
|
+
- [fields] Fix usage of `slotProps.textField.InputProps` (#8428) @flaviendelangle
|
|
38
|
+
- [pickers] Fix `componentsProps.dialog` propagation (#8509) @LukasTy
|
|
39
|
+
- [pickers] Move `hasError` from `fieldValueManager` to `valueManager` (#8453) @flaviendelangle
|
|
40
|
+
- [pickers] Move the adapters interfaces to the X repository (#8412) @flaviendelangle
|
|
41
|
+
- [pickers] Update peer dependency versions (#8531) @LukasTy
|
|
42
|
+
- [pickers] Fix `isValid` regression (#8543) @LukasTy
|
|
43
|
+
- [l10n] Add Catalan (Spain) (ca-ES) and improve Spanish (es-ES) locales (#8498) @makenshikuro
|
|
44
|
+
- [l10n] Add Kazakh (kz-KZ) locale (#8451) @zhunus
|
|
45
|
+
- [l10n] Improve Dutch (nl-NL) locale (#8491) @thedutchruben
|
|
46
|
+
- [l10n] Improve Hebrew (he-IL) locale (#8464) @soris1989
|
|
47
|
+
- [l10n] Improve Japanese (ja-JP) locale (#8462) @megos
|
|
48
|
+
- [l10n] Improve Portuguese (pt-BR) locale (#8480) @pwnedev
|
|
49
|
+
|
|
50
|
+
### Docs
|
|
51
|
+
|
|
52
|
+
- [docs] Fix 301 redirect (#8524) @alexfauquette
|
|
53
|
+
- [docs] Fix 404 links (#8454) @alexfauquette
|
|
54
|
+
- [docs] Fix broken API reference link (#8460) @oliviertassinari
|
|
55
|
+
|
|
56
|
+
### Core
|
|
57
|
+
|
|
58
|
+
- [core] Avoid 301 links (#8383) @oliviertassinari
|
|
59
|
+
- [core] Fix the l10n helper by using danger instead of actions (#8512) @alexfauquette
|
|
60
|
+
- [core] Help contributors for l10n PRs (#8503) @alexfauquette
|
|
61
|
+
- [core] Remove legacy token (#8457) @oliviertassinari
|
|
62
|
+
- [charts] Add a styling system (#8445) @alexfauquette
|
|
63
|
+
|
|
6
64
|
## 6.0.4
|
|
7
65
|
|
|
8
66
|
_Mar 30, 2023_
|
|
@@ -272,8 +272,6 @@ export const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(
|
|
|
272
272
|
disableFuture: disableFuture,
|
|
273
273
|
reduceAnimations: reduceAnimations,
|
|
274
274
|
labelId: gridLabelId,
|
|
275
|
-
components: components,
|
|
276
|
-
componentsProps: componentsProps,
|
|
277
275
|
slots: slots,
|
|
278
276
|
slotProps: slotProps
|
|
279
277
|
}), /*#__PURE__*/_jsx(DateCalendarViewTransitionContainer, {
|
|
@@ -29,18 +29,6 @@ export interface PickersCalendarHeaderSlotsComponentsProps<TDate> extends Picker
|
|
|
29
29
|
switchViewIcon?: SlotComponentProps<typeof SvgIcon, PickersCalendarHeaderComponentsPropsOverrides, undefined>;
|
|
30
30
|
}
|
|
31
31
|
export interface PickersCalendarHeaderProps<TDate> extends ExportedPickersArrowSwitcherProps, DateComponentValidationProps<TDate> {
|
|
32
|
-
/**
|
|
33
|
-
* Overridable components.
|
|
34
|
-
* @default {}
|
|
35
|
-
* @deprecated Please use `slots`.
|
|
36
|
-
*/
|
|
37
|
-
components?: PickersCalendarHeaderSlotsComponent;
|
|
38
|
-
/**
|
|
39
|
-
* The props used for each component slot.
|
|
40
|
-
* @default {}
|
|
41
|
-
* @deprecated Please use `slotProps`.
|
|
42
|
-
*/
|
|
43
|
-
componentsProps?: PickersCalendarHeaderSlotsComponentsProps<TDate>;
|
|
44
32
|
/**
|
|
45
33
|
* Overridable component slots.
|
|
46
34
|
* @default {}
|
|
@@ -13,6 +13,8 @@ import { ArrowDropDown } from '../internals/components/icons';
|
|
|
13
13
|
import { PickersArrowSwitcher } from '../internals/components/PickersArrowSwitcher';
|
|
14
14
|
import { usePreviousMonthDisabled, useNextMonthDisabled } from '../internals/hooks/date-helpers-hooks';
|
|
15
15
|
import { getPickersCalendarHeaderUtilityClass, pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';
|
|
16
|
+
|
|
17
|
+
// We keep the interface to allow module augmentation
|
|
16
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
20
|
const useUtilityClasses = ownerState => {
|
|
@@ -94,7 +96,7 @@ const PickersCalendarHeaderSwitchViewIcon = styled(ArrowDropDown, {
|
|
|
94
96
|
* @ignore - do not document.
|
|
95
97
|
*/
|
|
96
98
|
export function PickersCalendarHeader(inProps) {
|
|
97
|
-
var
|
|
99
|
+
var _slots$switchViewButt, _slots$switchViewIcon;
|
|
98
100
|
const localeText = useLocaleText();
|
|
99
101
|
const utils = useUtils();
|
|
100
102
|
const props = useThemeProps({
|
|
@@ -102,8 +104,6 @@ export function PickersCalendarHeader(inProps) {
|
|
|
102
104
|
name: 'MuiPickersCalendarHeader'
|
|
103
105
|
});
|
|
104
106
|
const {
|
|
105
|
-
components,
|
|
106
|
-
componentsProps,
|
|
107
107
|
slots,
|
|
108
108
|
slotProps,
|
|
109
109
|
currentMonth: month,
|
|
@@ -121,10 +121,10 @@ export function PickersCalendarHeader(inProps) {
|
|
|
121
121
|
} = props;
|
|
122
122
|
const ownerState = props;
|
|
123
123
|
const classes = useUtilityClasses(props);
|
|
124
|
-
const SwitchViewButton = (
|
|
124
|
+
const SwitchViewButton = (_slots$switchViewButt = slots == null ? void 0 : slots.switchViewButton) != null ? _slots$switchViewButt : PickersCalendarHeaderSwitchViewButton;
|
|
125
125
|
const switchViewButtonProps = useSlotProps({
|
|
126
126
|
elementType: SwitchViewButton,
|
|
127
|
-
externalSlotProps:
|
|
127
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewButton,
|
|
128
128
|
additionalProps: {
|
|
129
129
|
size: 'small',
|
|
130
130
|
'aria-label': localeText.calendarViewSwitchingButtonAriaLabel(view)
|
|
@@ -132,11 +132,11 @@ export function PickersCalendarHeader(inProps) {
|
|
|
132
132
|
ownerState,
|
|
133
133
|
className: classes.switchViewButton
|
|
134
134
|
});
|
|
135
|
-
const SwitchViewIcon = (
|
|
135
|
+
const SwitchViewIcon = (_slots$switchViewIcon = slots == null ? void 0 : slots.switchViewIcon) != null ? _slots$switchViewIcon : PickersCalendarHeaderSwitchViewIcon;
|
|
136
136
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
137
137
|
const _useSlotProps = useSlotProps({
|
|
138
138
|
elementType: SwitchViewIcon,
|
|
139
|
-
externalSlotProps:
|
|
139
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewIcon,
|
|
140
140
|
ownerState: undefined,
|
|
141
141
|
className: classes.switchViewIcon
|
|
142
142
|
}),
|
|
@@ -194,8 +194,6 @@ export function PickersCalendarHeader(inProps) {
|
|
|
194
194
|
}), /*#__PURE__*/_jsx(Fade, {
|
|
195
195
|
in: view === 'day',
|
|
196
196
|
children: /*#__PURE__*/_jsx(PickersArrowSwitcher, {
|
|
197
|
-
components: components,
|
|
198
|
-
componentsProps: componentsProps,
|
|
199
197
|
slots: slots,
|
|
200
198
|
slotProps: slotProps,
|
|
201
199
|
onGoToPrevious: selectPreviousMonth,
|
|
@@ -101,6 +101,7 @@ export function PickersSlideTransition(inProps) {
|
|
|
101
101
|
className,
|
|
102
102
|
reduceAnimations,
|
|
103
103
|
transKey
|
|
104
|
+
// extracting `classes` from `other`
|
|
104
105
|
} = props,
|
|
105
106
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
106
107
|
const classes = useUtilityClasses(props);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SlideDirection } from './PickersSlideTransition';
|
|
2
|
-
import { MuiPickersAdapter } from '../
|
|
2
|
+
import { MuiPickersAdapter } from '../models';
|
|
3
3
|
import { DateCalendarDefaultizedProps } from './DateCalendar.types';
|
|
4
4
|
interface CalendarState<TDate> {
|
|
5
5
|
currentMonth: TDate;
|
package/DateField/DateField.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["components", "componentsProps", "slots", "slotProps"],
|
|
3
|
+
const _excluded = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"],
|
|
4
4
|
_excluded2 = ["inputRef"],
|
|
5
5
|
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -20,7 +20,9 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
|
|
|
20
20
|
components,
|
|
21
21
|
componentsProps,
|
|
22
22
|
slots,
|
|
23
|
-
slotProps
|
|
23
|
+
slotProps,
|
|
24
|
+
InputProps,
|
|
25
|
+
inputProps
|
|
24
26
|
} = themeProps,
|
|
25
27
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
26
28
|
const ownerState = themeProps;
|
|
@@ -35,6 +37,10 @@ const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref)
|
|
|
35
37
|
inputRef: externalInputRef
|
|
36
38
|
} = _useSlotProps,
|
|
37
39
|
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
|
+
|
|
41
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
38
44
|
const _useDateField = useDateField({
|
|
39
45
|
props: textFieldProps,
|
|
40
46
|
inputRef: externalInputRef
|
package/DatePicker/shared.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DefaultizedProps } from '../internals/models/helpers';
|
|
3
3
|
import { DateCalendarSlotsComponent, DateCalendarSlotsComponentsProps, ExportedDateCalendarProps } from '../DateCalendar/DateCalendar.types';
|
|
4
|
-
import { DateValidationError, DateView } from '../models';
|
|
4
|
+
import { DateValidationError, DateView, MuiPickersAdapter } from '../models';
|
|
5
5
|
import { BasePickerInputProps } from '../internals/models/props/basePickerProps';
|
|
6
|
-
import { BaseDateValidationProps,
|
|
6
|
+
import { BaseDateValidationProps, UncapitalizeObjectKeys } from '../internals';
|
|
7
7
|
import { LocalizedComponent } from '../locales/utils/pickersLocaleTextApi';
|
|
8
8
|
import { DatePickerToolbarProps, ExportedDatePickerToolbarProps } from './DatePickerToolbar';
|
|
9
9
|
import { PickerViewRendererLookup } from '../internals/hooks/usePicker/usePickerViews';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["components", "componentsProps", "slots", "slotProps"],
|
|
3
|
+
const _excluded = ["components", "componentsProps", "slots", "slotProps", "InputProps", "inputProps"],
|
|
4
4
|
_excluded2 = ["inputRef"],
|
|
5
5
|
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -20,7 +20,9 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
|
|
|
20
20
|
components,
|
|
21
21
|
componentsProps,
|
|
22
22
|
slots,
|
|
23
|
-
slotProps
|
|
23
|
+
slotProps,
|
|
24
|
+
InputProps,
|
|
25
|
+
inputProps
|
|
24
26
|
} = themeProps,
|
|
25
27
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
26
28
|
const ownerState = themeProps;
|
|
@@ -35,6 +37,10 @@ const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inPro
|
|
|
35
37
|
inputRef: externalInputRef
|
|
36
38
|
} = _useSlotProps,
|
|
37
39
|
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
|
+
|
|
41
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
38
44
|
const _useDateTimeField = useDateTimeField({
|
|
39
45
|
props: textFieldProps,
|
|
40
46
|
inputRef: externalInputRef
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { MuiPickersAdapter } from '../internals/models';
|
|
2
|
+
import { AdapterFormats, MuiPickersAdapter } from '../models';
|
|
4
3
|
import { PickersInputLocaleText } from '../locales';
|
|
5
4
|
export interface MuiPickersAdapterContextValue<TDate> {
|
|
6
5
|
defaultDates: {
|
|
@@ -22,7 +21,7 @@ export interface LocalizationProviderProps<TDate> {
|
|
|
22
21
|
*/
|
|
23
22
|
dateAdapter?: new (...args: any) => MuiPickersAdapter<TDate>;
|
|
24
23
|
/** Formats that are used for any child pickers */
|
|
25
|
-
dateFormats?: Partial<
|
|
24
|
+
dateFormats?: Partial<AdapterFormats>;
|
|
26
25
|
/**
|
|
27
26
|
* Date library instance you are using, if it has some global overrides
|
|
28
27
|
* ```jsx
|
|
@@ -92,6 +92,7 @@ export const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProp
|
|
|
92
92
|
onFocus,
|
|
93
93
|
onBlur,
|
|
94
94
|
'aria-current': ariaCurrent
|
|
95
|
+
// We don't want to forward this prop to the root element
|
|
95
96
|
} = props,
|
|
96
97
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
97
98
|
const ref = React.useRef(null);
|
package/README.md
CHANGED
|
@@ -34,8 +34,8 @@ This component has the following peer dependencies that you will need to install
|
|
|
34
34
|
|
|
35
35
|
```json
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@mui/material": "^5.
|
|
38
|
-
"@mui/system": "^5.
|
|
37
|
+
"@mui/material": "^5.8.6",
|
|
38
|
+
"@mui/system": "^5.8.0",
|
|
39
39
|
"react": "^17.0.2 || ^18.0.0",
|
|
40
40
|
"react-dom": "^17.0.2 || ^18.0.0"
|
|
41
41
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MuiPickersAdapter } from '../
|
|
2
|
+
import { MuiPickersAdapter } from '../models';
|
|
3
3
|
import type { PickerSelectionState } from '../internals/hooks/usePicker';
|
|
4
4
|
interface GetHourNumbersOptions<TDate> {
|
|
5
5
|
ampm: boolean;
|
package/TimeClock/TimeClock.js
CHANGED
|
@@ -16,6 +16,7 @@ import { PickerViewRoot } from '../internals/components/PickerViewRoot';
|
|
|
16
16
|
import { getTimeClockUtilityClass } from './timeClockClasses';
|
|
17
17
|
import { Clock } from './Clock';
|
|
18
18
|
import { getHourNumbers, getMinutesNumbers } from './ClockNumbers';
|
|
19
|
+
import { uncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
19
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
22
|
const useUtilityClasses = ownerState => {
|
|
@@ -66,8 +67,8 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
66
67
|
autoFocus,
|
|
67
68
|
components,
|
|
68
69
|
componentsProps,
|
|
69
|
-
slots,
|
|
70
|
-
slotProps,
|
|
70
|
+
slots: innerSlots,
|
|
71
|
+
slotProps: innerSlotProps,
|
|
71
72
|
value: valueProp,
|
|
72
73
|
disableIgnoringDatePartForTimeValidation = false,
|
|
73
74
|
maxTime,
|
|
@@ -89,6 +90,8 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
89
90
|
readOnly
|
|
90
91
|
} = props,
|
|
91
92
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
93
|
+
const slots = innerSlots != null ? innerSlots : uncapitalizeObjectKeys(components);
|
|
94
|
+
const slotProps = innerSlotProps != null ? innerSlotProps : componentsProps;
|
|
92
95
|
const [value, setValue] = useControlled({
|
|
93
96
|
name: 'DateCalendar',
|
|
94
97
|
state: 'value',
|
|
@@ -282,8 +285,6 @@ export const TimeClock = /*#__PURE__*/React.forwardRef(function TimeClock(inProp
|
|
|
282
285
|
readOnly: readOnly
|
|
283
286
|
}, viewProps)), showViewSwitcher && /*#__PURE__*/_jsx(TimeClockArrowSwitcher, {
|
|
284
287
|
className: classes.arrowSwitcher,
|
|
285
|
-
components: components,
|
|
286
|
-
componentsProps: componentsProps,
|
|
287
288
|
slots: slots,
|
|
288
289
|
slotProps: slotProps,
|
|
289
290
|
onGoToPrevious: () => setView(previousView),
|
package/TimeField/TimeField.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["slots", "slotProps", "components", "componentsProps"],
|
|
3
|
+
const _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
|
|
4
4
|
_excluded2 = ["inputRef"],
|
|
5
5
|
_excluded3 = ["ref", "onPaste", "inputMode", "readOnly"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -20,7 +20,9 @@ const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, ref)
|
|
|
20
20
|
slots,
|
|
21
21
|
slotProps,
|
|
22
22
|
components,
|
|
23
|
-
componentsProps
|
|
23
|
+
componentsProps,
|
|
24
|
+
InputProps,
|
|
25
|
+
inputProps
|
|
24
26
|
} = themeProps,
|
|
25
27
|
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
26
28
|
const ownerState = themeProps;
|
|
@@ -35,6 +37,10 @@ const TimeField = /*#__PURE__*/React.forwardRef(function TimeField(inProps, ref)
|
|
|
35
37
|
inputRef: externalInputRef
|
|
36
38
|
} = _useSlotProps,
|
|
37
39
|
textFieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
40
|
+
|
|
41
|
+
// TODO: Remove when mui/material-ui#35088 will be merged
|
|
42
|
+
textFieldProps.inputProps = _extends({}, textFieldProps.inputProps, inputProps);
|
|
43
|
+
textFieldProps.InputProps = _extends({}, textFieldProps.InputProps, InputProps);
|
|
38
44
|
const _useTimeField = useTimeField({
|
|
39
45
|
props: textFieldProps,
|
|
40
46
|
inputRef: externalInputRef
|
|
@@ -94,6 +94,7 @@ export const PickersYear = /*#__PURE__*/React.memo(function PickersYear(inProps)
|
|
|
94
94
|
onFocus,
|
|
95
95
|
onBlur,
|
|
96
96
|
'aria-current': ariaCurrent
|
|
97
|
+
// We don't want to forward this prop to the root element
|
|
97
98
|
} = props,
|
|
98
99
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
99
100
|
const ref = React.useRef(null);
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "className", "
|
|
3
|
+
const _excluded = ["children", "className", "slots", "slotProps", "isNextDisabled", "isNextHidden", "onGoToNext", "nextLabel", "isPreviousDisabled", "isPreviousHidden", "onGoToPrevious", "previousLabel"],
|
|
4
4
|
_excluded2 = ["ownerState"],
|
|
5
5
|
_excluded3 = ["ownerState"];
|
|
6
6
|
import * as React from 'react';
|
|
@@ -51,7 +51,7 @@ const useUtilityClasses = ownerState => {
|
|
|
51
51
|
return composeClasses(slots, getPickersArrowSwitcherUtilityClass, classes);
|
|
52
52
|
};
|
|
53
53
|
export const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function PickersArrowSwitcher(inProps, ref) {
|
|
54
|
-
var
|
|
54
|
+
var _slots$previousIconBu, _slots$nextIconButton, _slots$leftArrowIcon, _slots$rightArrowIcon;
|
|
55
55
|
const theme = useTheme();
|
|
56
56
|
const isRTL = theme.direction === 'rtl';
|
|
57
57
|
const props = useThemeProps({
|
|
@@ -61,8 +61,6 @@ export const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function Picke
|
|
|
61
61
|
const {
|
|
62
62
|
children,
|
|
63
63
|
className,
|
|
64
|
-
components,
|
|
65
|
-
componentsProps,
|
|
66
64
|
slots,
|
|
67
65
|
slotProps,
|
|
68
66
|
isNextDisabled,
|
|
@@ -90,10 +88,10 @@ export const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function Picke
|
|
|
90
88
|
label: previousLabel
|
|
91
89
|
};
|
|
92
90
|
const [leftProps, rightProps] = isRTL ? [nextProps, previousProps] : [previousProps, nextProps];
|
|
93
|
-
const PreviousIconButton = (
|
|
91
|
+
const PreviousIconButton = (_slots$previousIconBu = slots == null ? void 0 : slots.previousIconButton) != null ? _slots$previousIconBu : PickersArrowSwitcherButton;
|
|
94
92
|
const previousIconButtonProps = useSlotProps({
|
|
95
93
|
elementType: PreviousIconButton,
|
|
96
|
-
externalSlotProps:
|
|
94
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.previousIconButton,
|
|
97
95
|
additionalProps: {
|
|
98
96
|
size: 'medium',
|
|
99
97
|
title: leftProps.label,
|
|
@@ -107,10 +105,10 @@ export const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function Picke
|
|
|
107
105
|
}),
|
|
108
106
|
className: classes.button
|
|
109
107
|
});
|
|
110
|
-
const NextIconButton = (
|
|
108
|
+
const NextIconButton = (_slots$nextIconButton = slots == null ? void 0 : slots.nextIconButton) != null ? _slots$nextIconButton : PickersArrowSwitcherButton;
|
|
111
109
|
const nextIconButtonProps = useSlotProps({
|
|
112
110
|
elementType: NextIconButton,
|
|
113
|
-
externalSlotProps:
|
|
111
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.nextIconButton,
|
|
114
112
|
additionalProps: {
|
|
115
113
|
size: 'medium',
|
|
116
114
|
title: rightProps.label,
|
|
@@ -124,22 +122,22 @@ export const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function Picke
|
|
|
124
122
|
}),
|
|
125
123
|
className: classes.button
|
|
126
124
|
});
|
|
127
|
-
const LeftArrowIcon = (
|
|
125
|
+
const LeftArrowIcon = (_slots$leftArrowIcon = slots == null ? void 0 : slots.leftArrowIcon) != null ? _slots$leftArrowIcon : ArrowLeft;
|
|
128
126
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
129
127
|
const _useSlotProps = useSlotProps({
|
|
130
128
|
elementType: LeftArrowIcon,
|
|
131
|
-
externalSlotProps:
|
|
129
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.leftArrowIcon,
|
|
132
130
|
additionalProps: {
|
|
133
131
|
fontSize: 'inherit'
|
|
134
132
|
},
|
|
135
133
|
ownerState: undefined
|
|
136
134
|
}),
|
|
137
135
|
leftArrowIconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
138
|
-
const RightArrowIcon = (
|
|
136
|
+
const RightArrowIcon = (_slots$rightArrowIcon = slots == null ? void 0 : slots.rightArrowIcon) != null ? _slots$rightArrowIcon : ArrowRight;
|
|
139
137
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
140
138
|
const _useSlotProps2 = useSlotProps({
|
|
141
139
|
elementType: RightArrowIcon,
|
|
142
|
-
externalSlotProps:
|
|
140
|
+
externalSlotProps: slotProps == null ? void 0 : slotProps.rightArrowIcon,
|
|
143
141
|
additionalProps: {
|
|
144
142
|
fontSize: 'inherit'
|
|
145
143
|
},
|
|
@@ -5,18 +5,6 @@ import SvgIcon from '@mui/material/SvgIcon';
|
|
|
5
5
|
import { PickersArrowSwitcherClasses } from './pickersArrowSwitcherClasses';
|
|
6
6
|
import { UncapitalizeObjectKeys } from '../../utils/slots-migration';
|
|
7
7
|
export interface ExportedPickersArrowSwitcherProps {
|
|
8
|
-
/**
|
|
9
|
-
* Overridable components.
|
|
10
|
-
* @default {}
|
|
11
|
-
* @deprecated Please use `slots`.
|
|
12
|
-
*/
|
|
13
|
-
components?: PickersArrowSwitcherSlotsComponent;
|
|
14
|
-
/**
|
|
15
|
-
* The props used for each component slot.
|
|
16
|
-
* @default {}
|
|
17
|
-
* @deprecated Please use `slotProps`.
|
|
18
|
-
*/
|
|
19
|
-
componentsProps?: PickersArrowSwitcherSlotsComponentsProps;
|
|
20
8
|
/**
|
|
21
9
|
* Overridable component slots.
|
|
22
10
|
* @default {}
|
|
@@ -36,18 +36,6 @@ export interface PickersModalDialogSlotsComponentsProps {
|
|
|
36
36
|
mobileTransition?: Partial<MuiTransitionProps>;
|
|
37
37
|
}
|
|
38
38
|
export interface PickersModalDialogProps extends UsePickerValueActions {
|
|
39
|
-
/**
|
|
40
|
-
* Overridable components.
|
|
41
|
-
* @default {}
|
|
42
|
-
* @deprecated Please use `slots`.
|
|
43
|
-
*/
|
|
44
|
-
components?: PickersModalDialogSlotsComponent;
|
|
45
|
-
/**
|
|
46
|
-
* The props used for each component slot.
|
|
47
|
-
* @default {}
|
|
48
|
-
* @deprecated Please use `slotProps`.
|
|
49
|
-
*/
|
|
50
|
-
componentsProps?: PickersModalDialogSlotsComponentsProps;
|
|
51
39
|
/**
|
|
52
40
|
* Overridable component slots.
|
|
53
41
|
* @default {}
|
|
@@ -21,26 +21,24 @@ const PickersModalDialogContent = styled(DialogContent)({
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
export function PickersModalDialog(props) {
|
|
24
|
-
var
|
|
24
|
+
var _slots$dialog, _slots$mobileTransiti;
|
|
25
25
|
const {
|
|
26
26
|
children,
|
|
27
27
|
onDismiss,
|
|
28
28
|
open,
|
|
29
|
-
components,
|
|
30
|
-
componentsProps,
|
|
31
29
|
slots,
|
|
32
30
|
slotProps
|
|
33
31
|
} = props;
|
|
34
|
-
const Dialog = (
|
|
35
|
-
const Transition = (
|
|
32
|
+
const Dialog = (_slots$dialog = slots == null ? void 0 : slots.dialog) != null ? _slots$dialog : PickersModalDialogRoot;
|
|
33
|
+
const Transition = (_slots$mobileTransiti = slots == null ? void 0 : slots.mobileTransition) != null ? _slots$mobileTransiti : Fade;
|
|
36
34
|
return /*#__PURE__*/_jsx(Dialog, _extends({
|
|
37
35
|
open: open,
|
|
38
36
|
onClose: onDismiss
|
|
39
|
-
},
|
|
37
|
+
}, slotProps == null ? void 0 : slotProps.dialog, {
|
|
40
38
|
TransitionComponent: Transition,
|
|
41
|
-
TransitionProps:
|
|
42
|
-
PaperComponent:
|
|
43
|
-
PaperProps:
|
|
39
|
+
TransitionProps: slotProps == null ? void 0 : slotProps.mobileTransition,
|
|
40
|
+
PaperComponent: slots == null ? void 0 : slots.mobilePaper,
|
|
41
|
+
PaperProps: slotProps == null ? void 0 : slotProps.mobilePaper,
|
|
44
42
|
children: /*#__PURE__*/_jsx(PickersModalDialogContent, {
|
|
45
43
|
children: children
|
|
46
44
|
})
|
|
@@ -57,8 +57,6 @@ export interface PickerPopperProps extends UsePickerValueActions {
|
|
|
57
57
|
containerRef?: React.Ref<HTMLDivElement>;
|
|
58
58
|
children?: React.ReactNode;
|
|
59
59
|
onBlur?: () => void;
|
|
60
|
-
components?: PickersPopperSlotsComponent;
|
|
61
|
-
componentsProps?: PickersPopperSlotsComponentsProps;
|
|
62
60
|
slots?: UncapitalizeObjectKeys<PickersPopperSlotsComponent>;
|
|
63
61
|
slotProps?: PickersPopperSlotsComponentsProps;
|
|
64
62
|
classes?: Partial<PickersPopperClasses>;
|