@mui/x-date-pickers 6.11.0 → 6.11.2
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/CHANGELOG.md +119 -1
- package/DateCalendar/DateCalendar.js +2 -2
- package/DateCalendar/DateCalendar.types.d.ts +2 -2
- package/DateField/DateField.js +1 -0
- package/DatePicker/DatePicker.js +2 -2
- package/DateTimeField/DateTimeField.js +1 -0
- package/DateTimePicker/DateTimePicker.js +2 -2
- package/DateTimePicker/DateTimePickerToolbar.js +4 -3
- package/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/DesktopTimePicker/DesktopTimePicker.js +5 -0
- package/DigitalClock/DigitalClock.js +3 -1
- package/MobileDatePicker/MobileDatePicker.js +2 -2
- package/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/MobileTimePicker/MobileTimePicker.js +5 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +3 -1
- package/PickersDay/PickersDay.js +1 -0
- package/PickersShortcuts/PickersShortcuts.d.ts +2 -1
- package/PickersShortcuts/PickersShortcuts.js +10 -4
- package/PickersShortcuts/index.d.ts +1 -1
- package/StaticDatePicker/StaticDatePicker.js +2 -2
- package/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/StaticTimePicker/StaticTimePicker.js +5 -0
- package/TimeField/TimeField.js +1 -0
- package/TimePicker/TimePicker.js +5 -0
- package/TimePicker/TimePickerToolbar.js +3 -2
- package/index.js +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -11
- package/internals/components/PickersPopper.d.ts +2 -1
- package/internals/components/PickersPopper.js +7 -2
- package/internals/components/PickersToolbar.js +13 -13
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +3 -1
- package/internals/hooks/useField/useField.js +1 -1
- package/internals/hooks/usePicker/usePickerValue.js +11 -3
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +3 -5
- package/internals/hooks/usePicker/usePickerViews.d.ts +5 -0
- package/internals/utils/date-utils.d.ts +1 -0
- package/internals/utils/date-utils.js +4 -0
- package/legacy/DateCalendar/DateCalendar.js +2 -2
- package/legacy/DateField/DateField.js +1 -0
- package/legacy/DatePicker/DatePicker.js +2 -2
- package/legacy/DateTimeField/DateTimeField.js +1 -0
- package/legacy/DateTimePicker/DateTimePicker.js +2 -2
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +4 -3
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +5 -0
- package/legacy/DigitalClock/DigitalClock.js +3 -1
- package/legacy/MobileDatePicker/MobileDatePicker.js +2 -2
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/legacy/MobileTimePicker/MobileTimePicker.js +5 -0
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -2
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +3 -1
- package/legacy/PickersDay/PickersDay.js +1 -0
- package/legacy/PickersShortcuts/PickersShortcuts.js +8 -4
- package/legacy/StaticDatePicker/StaticDatePicker.js +2 -2
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/legacy/StaticTimePicker/StaticTimePicker.js +5 -0
- package/legacy/TimeField/TimeField.js +1 -0
- package/legacy/TimePicker/TimePicker.js +5 -0
- package/legacy/TimePicker/TimePickerToolbar.js +3 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -15
- package/legacy/internals/components/PickersPopper.js +7 -2
- package/legacy/internals/components/PickersToolbar.js +11 -14
- package/legacy/internals/hooks/useDesktopPicker/useDesktopPicker.js +3 -1
- package/legacy/internals/hooks/useField/useField.js +1 -1
- package/legacy/internals/hooks/usePicker/usePickerValue.js +11 -3
- package/legacy/internals/utils/date-utils.js +4 -0
- package/legacy/locales/fiFI.js +8 -5
- package/legacy/locales/isIS.js +33 -16
- package/legacy/models/index.js +2 -1
- package/legacy/models/pickers.js +1 -0
- package/legacy/tests/describeAdapters/describeAdapters.js +1 -1
- package/legacy/tests/describeGregorianAdapter/testCalculations.js +1 -1
- package/legacy/tests/describeGregorianAdapter/testLocalization.js +1 -1
- package/legacy/tests/describeValidation/testDayViewValidation.js +1 -1
- package/legacy/tests/describeValidation/testMinutesViewValidation.js +2 -2
- package/legacy/tests/describeValidation/testMonthViewValidation.js +1 -1
- package/legacy/tests/describeValidation/testTextFieldValidation.js +1 -1
- package/legacy/tests/describeValidation/testYearViewValidation.js +1 -1
- package/legacy/tests/describeValue/describeValue.js +3 -2
- package/legacy/tests/describeValue/testControlledUnControlled.js +1 -1
- package/legacy/tests/describeValue/testPickerActionBar.js +12 -29
- package/legacy/tests/describeValue/testPickerOpenCloseLifeCycle.js +1 -1
- package/legacy/tests/describeValue/testShortcuts.js +119 -0
- package/locales/fiFI.js +4 -5
- package/locales/isIS.js +13 -16
- package/models/adapters.d.ts +1 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/models/pickers.d.ts +9 -0
- package/models/pickers.js +1 -0
- package/modern/DateCalendar/DateCalendar.js +2 -2
- package/modern/DateField/DateField.js +1 -0
- package/modern/DatePicker/DatePicker.js +2 -2
- package/modern/DateTimeField/DateTimeField.js +1 -0
- package/modern/DateTimePicker/DateTimePicker.js +2 -2
- package/modern/DateTimePicker/DateTimePickerToolbar.js +4 -3
- package/modern/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/modern/DesktopTimePicker/DesktopTimePicker.js +5 -0
- package/modern/DigitalClock/DigitalClock.js +3 -1
- package/modern/MobileDatePicker/MobileDatePicker.js +2 -2
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/modern/MobileTimePicker/MobileTimePicker.js +5 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -2
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +3 -1
- package/modern/PickersDay/PickersDay.js +1 -0
- package/modern/PickersShortcuts/PickersShortcuts.js +10 -4
- package/modern/StaticDatePicker/StaticDatePicker.js +2 -2
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/modern/StaticTimePicker/StaticTimePicker.js +5 -0
- package/modern/TimeField/TimeField.js +1 -0
- package/modern/TimePicker/TimePicker.js +5 -0
- package/modern/TimePicker/TimePickerToolbar.js +3 -2
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -11
- package/modern/internals/components/PickersPopper.js +7 -2
- package/modern/internals/components/PickersToolbar.js +9 -12
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +3 -1
- package/modern/internals/hooks/useField/useField.js +1 -1
- package/modern/internals/hooks/usePicker/usePickerValue.js +11 -3
- package/modern/internals/utils/date-utils.js +4 -0
- package/modern/locales/fiFI.js +4 -5
- package/modern/locales/isIS.js +13 -16
- package/modern/models/index.js +2 -1
- package/modern/models/pickers.js +1 -0
- package/modern/tests/describeAdapters/describeAdapters.js +1 -1
- package/modern/tests/describeGregorianAdapter/testCalculations.js +1 -1
- package/modern/tests/describeGregorianAdapter/testLocalization.js +1 -1
- package/modern/tests/describeValidation/testDayViewValidation.js +1 -1
- package/modern/tests/describeValidation/testMinutesViewValidation.js +2 -2
- package/modern/tests/describeValidation/testMonthViewValidation.js +1 -1
- package/modern/tests/describeValidation/testTextFieldValidation.js +1 -1
- package/modern/tests/describeValidation/testYearViewValidation.js +1 -1
- package/modern/tests/describeValue/describeValue.js +3 -2
- package/modern/tests/describeValue/testControlledUnControlled.js +1 -1
- package/modern/tests/describeValue/testPickerActionBar.js +12 -29
- package/modern/tests/describeValue/testPickerOpenCloseLifeCycle.js +1 -1
- package/modern/tests/describeValue/testShortcuts.js +112 -0
- package/node/DateCalendar/DateCalendar.js +2 -2
- package/node/DateField/DateField.js +1 -0
- package/node/DatePicker/DatePicker.js +2 -2
- package/node/DateTimeField/DateTimeField.js +1 -0
- package/node/DateTimePicker/DateTimePicker.js +2 -2
- package/node/DateTimePicker/DateTimePickerToolbar.js +4 -3
- package/node/DesktopDatePicker/DesktopDatePicker.js +2 -2
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +2 -2
- package/node/DesktopTimePicker/DesktopTimePicker.js +5 -0
- package/node/DigitalClock/DigitalClock.js +3 -1
- package/node/MobileDatePicker/MobileDatePicker.js +2 -2
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +2 -2
- package/node/MobileTimePicker/MobileTimePicker.js +5 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -2
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +3 -1
- package/node/PickersDay/PickersDay.js +1 -0
- package/node/PickersShortcuts/PickersShortcuts.js +10 -4
- package/node/StaticDatePicker/StaticDatePicker.js +2 -2
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -2
- package/node/StaticTimePicker/StaticTimePicker.js +5 -0
- package/node/TimeField/TimeField.js +1 -0
- package/node/TimePicker/TimePicker.js +5 -0
- package/node/TimePicker/TimePickerToolbar.js +3 -2
- package/node/index.js +1 -1
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +10 -11
- package/node/internals/components/PickersPopper.js +7 -2
- package/node/internals/components/PickersToolbar.js +9 -12
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +3 -1
- package/node/internals/hooks/useField/useField.js +1 -1
- package/node/internals/hooks/usePicker/usePickerValue.js +11 -3
- package/node/internals/utils/date-utils.js +6 -1
- package/node/locales/fiFI.js +4 -5
- package/node/locales/isIS.js +13 -16
- package/node/models/index.js +11 -0
- package/node/models/pickers.js +5 -0
- package/node/tests/describeAdapters/describeAdapters.js +3 -3
- package/node/tests/describeGregorianAdapter/testCalculations.js +2 -2
- package/node/tests/describeGregorianAdapter/testLocalization.js +4 -4
- package/node/tests/describeValidation/testDayViewValidation.js +33 -33
- package/node/tests/describeValidation/testMinutesViewValidation.js +14 -14
- package/node/tests/describeValidation/testMonthViewValidation.js +22 -22
- package/node/tests/describeValidation/testTextFieldValidation.js +54 -54
- package/node/tests/describeValidation/testYearViewValidation.js +18 -18
- package/node/tests/describeValue/describeValue.js +4 -3
- package/node/tests/describeValue/testControlledUnControlled.js +3 -3
- package/node/tests/describeValue/testPickerActionBar.js +14 -31
- package/node/tests/describeValue/testPickerOpenCloseLifeCycle.js +10 -10
- package/node/tests/describeValue/testShortcuts.js +122 -0
- package/package.json +3 -3
- package/tests/describeAdapters/describeAdapters.js +1 -1
- package/tests/describeGregorianAdapter/testCalculations.js +1 -1
- package/tests/describeGregorianAdapter/testLocalization.js +1 -1
- package/tests/describeValidation/testDayViewValidation.js +1 -1
- package/tests/describeValidation/testMinutesViewValidation.js +2 -2
- package/tests/describeValidation/testMonthViewValidation.js +1 -1
- package/tests/describeValidation/testTextFieldValidation.js +1 -1
- package/tests/describeValidation/testYearViewValidation.js +1 -1
- package/tests/describeValue/describeValue.js +3 -2
- package/tests/describeValue/testControlledUnControlled.js +1 -1
- package/tests/describeValue/testPickerActionBar.js +12 -29
- package/tests/describeValue/testPickerOpenCloseLifeCycle.js +1 -1
- package/tests/describeValue/testShortcuts.js +112 -0
- package/themeAugmentation/components.d.ts +6 -14
- package/themeAugmentation/overrides.d.ts +0 -20
- package/themeAugmentation/props.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,124 @@
|
|
|
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.11.2
|
|
7
|
+
|
|
8
|
+
_Aug 17, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🏎️ Lower the filtering delay in the grid
|
|
13
|
+
- 🌍 Improve Spanish (es-ES) locale on the data grid
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### Data Grid
|
|
18
|
+
|
|
19
|
+
#### `@mui/x-data-grid@v6.11.2`
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Fix `eval` blocked by CSP (#9863) @romgrk
|
|
22
|
+
- [DataGrid] Fix row id bug (#10051) @romgrk
|
|
23
|
+
- [DataGrid] Honor `disableExport` flag in Print Export (#10044) @MBilalShafi
|
|
24
|
+
- [DataGrid] Lower filter debounce delay (#9712) @romgrk
|
|
25
|
+
- [DataGrid] Unhide potential ref binding issue (#9965) @oliviertassinari
|
|
26
|
+
- [l10n] Improve Chinese (zh-CN) and Chinese(traditional) (zh-TW) locales (#9999) @MyNameIsTakenOMG
|
|
27
|
+
- [l10n] Improve Spanish (es-ES) locale (#10037) @Macampu420
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid-pro@v6.11.2` [](https://mui.com/r/x-pro-svg-link)
|
|
30
|
+
|
|
31
|
+
Same changes as in `@mui/x-data-grid@v6.11.2`.
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-premium@v6.11.2` [](https://mui.com/r/x-premium-svg-link)
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid-pro@v6.11.2`.
|
|
36
|
+
|
|
37
|
+
### Date Pickers
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-date-pickers@v6.11.2`
|
|
40
|
+
|
|
41
|
+
- [pickers] Fix month switcher RTL (#10003) @alexfauquette
|
|
42
|
+
- [pickers] Follow-up on using device motion reduction preference (#9858) @LukasTy
|
|
43
|
+
- [pickers] Pass the shortcut information in the `onChange` context (#9985) @flaviendelangle
|
|
44
|
+
- [pickers] Replace `Grid` toolbar component with a styled `div` (#10052) @LukasTy
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-date-pickers-pro@v6.11.2` [](https://mui.com/r/x-pro-svg-link)
|
|
47
|
+
|
|
48
|
+
Same changes as in `@mui/x-date-pickers@v6.11.2`.
|
|
49
|
+
|
|
50
|
+
### Docs
|
|
51
|
+
|
|
52
|
+
- [docs] Add migration guide for the Tree View (#9987) @flaviendelangle
|
|
53
|
+
- [docs] Fix en-US changelog @oliviertassinari
|
|
54
|
+
- [docs] Update column types (#10040) @romgrk
|
|
55
|
+
|
|
56
|
+
### Core
|
|
57
|
+
|
|
58
|
+
- [core] Remove unnecessary Box (#9831) @oliviertassinari
|
|
59
|
+
- [core] Set GitHub Action top level permission @oliviertassinari
|
|
60
|
+
- [core] Split the pickers test utils (#9976) @flaviendelangle
|
|
61
|
+
|
|
62
|
+
## 6.11.1
|
|
63
|
+
|
|
64
|
+
_Aug 11, 2023_
|
|
65
|
+
|
|
66
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
67
|
+
|
|
68
|
+
- 💫 Add theme augmentation to `@mui/x-tree-view`
|
|
69
|
+
- 📈 Enable charts customization using `slot` and `slotProps` props
|
|
70
|
+
- 🌍 Improve Finnish (fi-FI) and Icelandic (is-IS) locales on the pickers
|
|
71
|
+
- 🐞 Bugfixes
|
|
72
|
+
- 📚 Documentation improvements
|
|
73
|
+
|
|
74
|
+
### Data Grid
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-data-grid@6.11.1`
|
|
77
|
+
|
|
78
|
+
- [DataGrid] `getCellAggregationResult`: Handle `null` `rowNode` case (#9915) @romgrk
|
|
79
|
+
|
|
80
|
+
#### `@mui/x-data-grid-pro@6.11.1` [](https://mui.com/r/x-pro-svg-link)
|
|
81
|
+
|
|
82
|
+
Same changes as in `@mui/x-data-grid@6.11.1`.
|
|
83
|
+
|
|
84
|
+
#### `@mui/x-data-grid-premium@6.11.1` [](https://mui.com/r/x-premium-svg-link)
|
|
85
|
+
|
|
86
|
+
Same changes as in `@mui/x-data-grid-pro@6.11.1`.
|
|
87
|
+
|
|
88
|
+
### Date Pickers
|
|
89
|
+
|
|
90
|
+
#### `@mui/x-date-pickers@6.11.1`
|
|
91
|
+
|
|
92
|
+
- [fields] Use `numeric` `inputmode` instead of `tel` (#9918) @LukasTy
|
|
93
|
+
- [pickers] Always respect locale when formatting meridiem (#9979) @flaviendelangle
|
|
94
|
+
- [pickers] Call `onChange` when selecting a shortcut with `changeImportance="set"` (#9974) @flaviendelangle
|
|
95
|
+
- [pickers] Refactor `themeAugmentation` `styleOverrides` (#9978) @LukasTy
|
|
96
|
+
- [l10n] Improve Finnish (fi-FI) locale (#9795) @kurkle
|
|
97
|
+
- [l10n] Improve Icelandic (is-IS) locale (#9639) @magnimarels
|
|
98
|
+
|
|
99
|
+
#### `@mui/x-date-pickers-pro@6.11.1` [](https://mui.com/r/x-pro-svg-link)
|
|
100
|
+
|
|
101
|
+
Same changes as in `@mui/x-date-pickers@6.11.1`.
|
|
102
|
+
|
|
103
|
+
### Charts / `@mui/x-charts@v6.0.0-alpha.7`
|
|
104
|
+
|
|
105
|
+
- [charts] Fix label and tick alignment (#9952) @LukasTy
|
|
106
|
+
- [charts] Remove not functional component `styleOverrides` (#9996) @LukasTy
|
|
107
|
+
- [charts] Set custom ticks number (#9922) @alexfauquette
|
|
108
|
+
- [charts] Use `slot`/`slotProps` for customization (#9744) @alexfauquette
|
|
109
|
+
- [charts] Extend cheerful fiesta palette (#9980) @noraleonte
|
|
110
|
+
|
|
111
|
+
### Tree View / `@mui/x-tree-view@v6.0.0-alpha.1`
|
|
112
|
+
|
|
113
|
+
- [TreeView] Add theme augmentation (#9967) @flaviendelangle
|
|
114
|
+
|
|
115
|
+
### Docs
|
|
116
|
+
|
|
117
|
+
- [docs] Clarify the `shouldDisableClock` migration code options (#9920) @LukasTy
|
|
118
|
+
|
|
119
|
+
### Core
|
|
120
|
+
|
|
121
|
+
- [core] Port GitHub workflow for ensuring triage label is present (#9924) @DanailH
|
|
122
|
+
- [docs-infra] Fix the import samples in Api pages (#9898) @alexfauquette
|
|
123
|
+
|
|
6
124
|
## 6.11.0
|
|
7
125
|
|
|
8
126
|
_Aug 4, 2023_
|
|
@@ -2810,7 +2928,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
|
|
|
2810
2928
|
|
|
2811
2929
|
#### Changes
|
|
2812
2930
|
|
|
2813
|
-
- [DateRangePicker] Fix input focused style and mobile
|
|
2931
|
+
- [DateRangePicker] Fix input focused style and mobile behavior (#6645) @LukasTy
|
|
2814
2932
|
- [fields] Update sections when the locale changes (#6649) @flaviendelangle
|
|
2815
2933
|
- [pickers] Add Ukrainian (uk-UA) locale (#6661) @Dufran
|
|
2816
2934
|
- [pickers] Allow non-controlled usage of the calendar components (#6643) @flaviendelangle
|
|
@@ -486,8 +486,8 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
486
486
|
*/
|
|
487
487
|
readOnly: PropTypes.bool,
|
|
488
488
|
/**
|
|
489
|
-
*
|
|
490
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
489
|
+
* If `true`, disable heavy animations.
|
|
490
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
491
491
|
*/
|
|
492
492
|
reduceAnimations: PropTypes.bool,
|
|
493
493
|
/**
|
|
@@ -40,8 +40,8 @@ export interface ExportedDateCalendarProps<TDate> extends ExportedDayCalendarPro
|
|
|
40
40
|
*/
|
|
41
41
|
readOnly?: boolean;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
43
|
+
* If `true`, disable heavy animations.
|
|
44
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
45
45
|
*/
|
|
46
46
|
reduceAnimations?: boolean;
|
|
47
47
|
/**
|
package/DateField/DateField.js
CHANGED
|
@@ -85,6 +85,7 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
85
85
|
* @default 'primary'
|
|
86
86
|
*/
|
|
87
87
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
88
|
+
component: PropTypes.elementType,
|
|
88
89
|
/**
|
|
89
90
|
* Overridable components.
|
|
90
91
|
* @default {}
|
package/DatePicker/DatePicker.js
CHANGED
|
@@ -241,8 +241,8 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
241
241
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
242
242
|
readOnly: PropTypes.bool,
|
|
243
243
|
/**
|
|
244
|
-
*
|
|
245
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
244
|
+
* If `true`, disable heavy animations.
|
|
245
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
246
246
|
*/
|
|
247
247
|
reduceAnimations: PropTypes.bool,
|
|
248
248
|
/**
|
|
@@ -90,6 +90,7 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
90
90
|
* @default 'primary'
|
|
91
91
|
*/
|
|
92
92
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
93
|
+
component: PropTypes.elementType,
|
|
93
94
|
/**
|
|
94
95
|
* Overridable components.
|
|
95
96
|
* @default {}
|
|
@@ -279,8 +279,8 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
279
279
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
280
280
|
readOnly: PropTypes.bool,
|
|
281
281
|
/**
|
|
282
|
-
*
|
|
283
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
282
|
+
* If `true`, disable heavy animations.
|
|
283
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
284
284
|
*/
|
|
285
285
|
reduceAnimations: PropTypes.bool,
|
|
286
286
|
/**
|
|
@@ -12,6 +12,7 @@ import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
|
|
|
12
12
|
import { dateTimePickerToolbarClasses, getDateTimePickerToolbarUtilityClass } from './dateTimePickerToolbarClasses';
|
|
13
13
|
import { useMeridiemMode } from '../internals/hooks/date-helpers-hooks';
|
|
14
14
|
import { MULTI_SECTION_CLOCK_SECTION_WIDTH } from '../internals/constants/dimensions';
|
|
15
|
+
import { formatMeridiem } from '../internals/utils/date-utils';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
const useUtilityClasses = ownerState => {
|
|
@@ -264,14 +265,14 @@ function DateTimePickerToolbar(inProps) {
|
|
|
264
265
|
variant: "subtitle2",
|
|
265
266
|
selected: meridiemMode === 'am',
|
|
266
267
|
typographyClassName: classes.ampmLabel,
|
|
267
|
-
value: utils
|
|
268
|
+
value: formatMeridiem(utils, 'am'),
|
|
268
269
|
onClick: readOnly ? undefined : () => handleMeridiemChange('am'),
|
|
269
270
|
disabled: disabled
|
|
270
271
|
}), /*#__PURE__*/_jsx(PickersToolbarButton, {
|
|
271
272
|
variant: "subtitle2",
|
|
272
273
|
selected: meridiemMode === 'pm',
|
|
273
274
|
typographyClassName: classes.ampmLabel,
|
|
274
|
-
value: utils
|
|
275
|
+
value: formatMeridiem(utils, 'pm'),
|
|
275
276
|
onClick: readOnly ? undefined : () => handleMeridiemChange('pm'),
|
|
276
277
|
disabled: disabled
|
|
277
278
|
})]
|
|
@@ -279,7 +280,7 @@ function DateTimePickerToolbar(inProps) {
|
|
|
279
280
|
variant: "h5",
|
|
280
281
|
onClick: () => onViewChange('meridiem'),
|
|
281
282
|
selected: view === 'meridiem',
|
|
282
|
-
value: value && meridiemMode ? utils
|
|
283
|
+
value: value && meridiemMode ? formatMeridiem(utils, meridiemMode) : '--',
|
|
283
284
|
width: MULTI_SECTION_CLOCK_SECTION_WIDTH
|
|
284
285
|
})]
|
|
285
286
|
})]
|
|
@@ -259,8 +259,8 @@ DesktopDatePicker.propTypes = {
|
|
|
259
259
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
260
260
|
readOnly: PropTypes.bool,
|
|
261
261
|
/**
|
|
262
|
-
*
|
|
263
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
262
|
+
* If `true`, disable heavy animations.
|
|
263
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
264
264
|
*/
|
|
265
265
|
reduceAnimations: PropTypes.bool,
|
|
266
266
|
/**
|
|
@@ -333,8 +333,8 @@ DesktopDateTimePicker.propTypes = {
|
|
|
333
333
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
334
334
|
readOnly: PropTypes.bool,
|
|
335
335
|
/**
|
|
336
|
-
*
|
|
337
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
336
|
+
* If `true`, disable heavy animations.
|
|
337
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
338
338
|
*/
|
|
339
339
|
reduceAnimations: PropTypes.bool,
|
|
340
340
|
/**
|
|
@@ -254,6 +254,11 @@ DesktopTimePicker.propTypes = {
|
|
|
254
254
|
*/
|
|
255
255
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
256
256
|
readOnly: PropTypes.bool,
|
|
257
|
+
/**
|
|
258
|
+
* If `true`, disable heavy animations.
|
|
259
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
260
|
+
*/
|
|
261
|
+
reduceAnimations: PropTypes.bool,
|
|
257
262
|
/**
|
|
258
263
|
* The currently selected sections.
|
|
259
264
|
* This prop accept four formats:
|
|
@@ -41,7 +41,9 @@ const DigitalClockRoot = styled(PickerViewRoot, {
|
|
|
41
41
|
}) => ({
|
|
42
42
|
overflowY: 'auto',
|
|
43
43
|
width: '100%',
|
|
44
|
-
|
|
44
|
+
'@media (prefers-reduced-motion: no-preference)': {
|
|
45
|
+
scrollBehavior: ownerState.alreadyRendered ? 'smooth' : 'auto'
|
|
46
|
+
},
|
|
45
47
|
maxHeight: DIGITAL_CLOCK_VIEW_HEIGHT
|
|
46
48
|
}));
|
|
47
49
|
const DigitalClockList = styled(MenuList, {
|
|
@@ -256,8 +256,8 @@ MobileDatePicker.propTypes = {
|
|
|
256
256
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
257
257
|
readOnly: PropTypes.bool,
|
|
258
258
|
/**
|
|
259
|
-
*
|
|
260
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
259
|
+
* If `true`, disable heavy animations.
|
|
260
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
261
261
|
*/
|
|
262
262
|
reduceAnimations: PropTypes.bool,
|
|
263
263
|
/**
|
|
@@ -305,8 +305,8 @@ MobileDateTimePicker.propTypes = {
|
|
|
305
305
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
306
306
|
readOnly: PropTypes.bool,
|
|
307
307
|
/**
|
|
308
|
-
*
|
|
309
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
308
|
+
* If `true`, disable heavy animations.
|
|
309
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
310
310
|
*/
|
|
311
311
|
reduceAnimations: PropTypes.bool,
|
|
312
312
|
/**
|
|
@@ -232,6 +232,11 @@ MobileTimePicker.propTypes = {
|
|
|
232
232
|
*/
|
|
233
233
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
234
234
|
readOnly: PropTypes.bool,
|
|
235
|
+
/**
|
|
236
|
+
* If `true`, disable heavy animations.
|
|
237
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
238
|
+
*/
|
|
239
|
+
reduceAnimations: PropTypes.bool,
|
|
235
240
|
/**
|
|
236
241
|
* The currently selected sections.
|
|
237
242
|
* This prop accept four formats:
|
|
@@ -18,6 +18,7 @@ import { getHourSectionOptions, getTimeSectionOptions } from './MultiSectionDigi
|
|
|
18
18
|
import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
|
|
19
19
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
20
20
|
import { useClockReferenceDate } from '../internals/hooks/useClockReferenceDate';
|
|
21
|
+
import { formatMeridiem } from '../internals/utils/date-utils';
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
23
|
const useUtilityClasses = ownerState => {
|
|
23
24
|
const {
|
|
@@ -269,8 +270,8 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
269
270
|
}
|
|
270
271
|
case 'meridiem':
|
|
271
272
|
{
|
|
272
|
-
const amLabel = utils
|
|
273
|
-
const pmLabel = utils
|
|
273
|
+
const amLabel = formatMeridiem(utils, 'am');
|
|
274
|
+
const pmLabel = formatMeridiem(utils, 'pm');
|
|
274
275
|
return {
|
|
275
276
|
onChange: handleMeridiemChange,
|
|
276
277
|
items: [{
|
|
@@ -33,7 +33,9 @@ const MultiSectionDigitalClockSectionRoot = styled(MenuList, {
|
|
|
33
33
|
width: 56,
|
|
34
34
|
padding: 0,
|
|
35
35
|
overflow: 'hidden',
|
|
36
|
-
|
|
36
|
+
'@media (prefers-reduced-motion: no-preference)': {
|
|
37
|
+
scrollBehavior: ownerState.alreadyRendered ? 'smooth' : 'auto'
|
|
38
|
+
},
|
|
37
39
|
'&:hover': {
|
|
38
40
|
overflowY: 'auto'
|
|
39
41
|
},
|
package/PickersDay/PickersDay.js
CHANGED
|
@@ -7,6 +7,7 @@ export interface PickersShortcutsItem<TValue> {
|
|
|
7
7
|
label: string;
|
|
8
8
|
getValue: (params: PickersShortcutsItemGetValueParams<TValue>) => TValue;
|
|
9
9
|
}
|
|
10
|
+
export type PickersShortcutsItemContext = Omit<PickersShortcutsItem<unknown>, 'getValue'>;
|
|
10
11
|
export type PickerShortcutChangeImportance = 'set' | 'accept';
|
|
11
12
|
export interface ExportedPickersShortcutProps<TValue> extends Omit<ListProps, 'onChange'> {
|
|
12
13
|
/**
|
|
@@ -25,7 +26,7 @@ export interface ExportedPickersShortcutProps<TValue> extends Omit<ListProps, 'o
|
|
|
25
26
|
}
|
|
26
27
|
export interface PickersShortcutsProps<TValue> extends ExportedPickersShortcutProps<TValue> {
|
|
27
28
|
isLandscape: boolean;
|
|
28
|
-
onChange: (newValue: TValue, changeImportance?: PickerShortcutChangeImportance) => void;
|
|
29
|
+
onChange: (newValue: TValue, changeImportance?: PickerShortcutChangeImportance, shortcut?: PickersShortcutsItemContext) => void;
|
|
29
30
|
isValid: (value: TValue) => boolean;
|
|
30
31
|
}
|
|
31
32
|
declare function PickersShortcuts<TValue>(props: PickersShortcutsProps<TValue>): React.JSX.Element | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["items", "changeImportance", "isLandscape", "onChange", "isValid"]
|
|
3
|
+
const _excluded = ["items", "changeImportance", "isLandscape", "onChange", "isValid"],
|
|
4
|
+
_excluded2 = ["getValue"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import List from '@mui/material/List';
|
|
@@ -19,14 +20,18 @@ function PickersShortcuts(props) {
|
|
|
19
20
|
if (items == null || items.length === 0) {
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
|
-
const resolvedItems = items.map(
|
|
23
|
-
|
|
23
|
+
const resolvedItems = items.map(_ref => {
|
|
24
|
+
let {
|
|
25
|
+
getValue
|
|
26
|
+
} = _ref,
|
|
27
|
+
item = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
28
|
+
const newValue = getValue({
|
|
24
29
|
isValid
|
|
25
30
|
});
|
|
26
31
|
return {
|
|
27
32
|
label: item.label,
|
|
28
33
|
onClick: () => {
|
|
29
|
-
onChange(newValue, changeImportance);
|
|
34
|
+
onChange(newValue, changeImportance, item);
|
|
30
35
|
},
|
|
31
36
|
disabled: !isValid(newValue)
|
|
32
37
|
};
|
|
@@ -59,6 +64,7 @@ process.env.NODE_ENV !== "production" ? PickersShortcuts.propTypes = {
|
|
|
59
64
|
*/
|
|
60
65
|
changeImportance: PropTypes.oneOf(['accept', 'set']),
|
|
61
66
|
className: PropTypes.string,
|
|
67
|
+
component: PropTypes.elementType,
|
|
62
68
|
/**
|
|
63
69
|
* If `true`, compact vertical padding designed for keyboard and mouse input is used for
|
|
64
70
|
* the list and list items.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { PickersShortcuts } from './PickersShortcuts';
|
|
2
|
-
export type { PickersShortcutsProps, PickersShortcutsItem, PickerShortcutChangeImportance, } from './PickersShortcuts';
|
|
2
|
+
export type { PickersShortcutsProps, PickersShortcutsItem, PickersShortcutsItemContext, PickerShortcutChangeImportance, } from './PickersShortcuts';
|
|
@@ -201,8 +201,8 @@ StaticDatePicker.propTypes = {
|
|
|
201
201
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
202
202
|
readOnly: PropTypes.bool,
|
|
203
203
|
/**
|
|
204
|
-
*
|
|
205
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
204
|
+
* If `true`, disable heavy animations.
|
|
205
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
206
206
|
*/
|
|
207
207
|
reduceAnimations: PropTypes.bool,
|
|
208
208
|
/**
|
|
@@ -249,8 +249,8 @@ StaticDateTimePicker.propTypes = {
|
|
|
249
249
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
250
250
|
readOnly: PropTypes.bool,
|
|
251
251
|
/**
|
|
252
|
-
*
|
|
253
|
-
* @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
252
|
+
* If `true`, disable heavy animations.
|
|
253
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
254
254
|
*/
|
|
255
255
|
reduceAnimations: PropTypes.bool,
|
|
256
256
|
/**
|
|
@@ -175,6 +175,11 @@ StaticTimePicker.propTypes = {
|
|
|
175
175
|
*/
|
|
176
176
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
177
177
|
readOnly: PropTypes.bool,
|
|
178
|
+
/**
|
|
179
|
+
* If `true`, disable heavy animations.
|
|
180
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
181
|
+
*/
|
|
182
|
+
reduceAnimations: PropTypes.bool,
|
|
178
183
|
/**
|
|
179
184
|
* Disable specific clock time.
|
|
180
185
|
* @param {number} clockValue The value to check.
|
package/TimeField/TimeField.js
CHANGED
|
@@ -90,6 +90,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
90
90
|
* @default 'primary'
|
|
91
91
|
*/
|
|
92
92
|
color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),
|
|
93
|
+
component: PropTypes.elementType,
|
|
93
94
|
/**
|
|
94
95
|
* Overridable components.
|
|
95
96
|
* @default {}
|
package/TimePicker/TimePicker.js
CHANGED
|
@@ -213,6 +213,11 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
213
213
|
*/
|
|
214
214
|
orientation: PropTypes.oneOf(['landscape', 'portrait']),
|
|
215
215
|
readOnly: PropTypes.bool,
|
|
216
|
+
/**
|
|
217
|
+
* If `true`, disable heavy animations.
|
|
218
|
+
* @default `@media(prefers-reduced-motion: reduce)` || typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
|
|
219
|
+
*/
|
|
220
|
+
reduceAnimations: PropTypes.bool,
|
|
216
221
|
/**
|
|
217
222
|
* The currently selected sections.
|
|
218
223
|
* This prop accept four formats:
|
|
@@ -12,6 +12,7 @@ import { arrayIncludes } from '../internals/utils/utils';
|
|
|
12
12
|
import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
|
|
13
13
|
import { useMeridiemMode } from '../internals/hooks/date-helpers-hooks';
|
|
14
14
|
import { getTimePickerToolbarUtilityClass, timePickerToolbarClasses } from './timePickerToolbarClasses';
|
|
15
|
+
import { formatMeridiem } from '../internals/utils/date-utils';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
const useUtilityClasses = ownerState => {
|
|
@@ -179,7 +180,7 @@ function TimePickerToolbar(inProps) {
|
|
|
179
180
|
variant: "subtitle2",
|
|
180
181
|
selected: meridiemMode === 'am',
|
|
181
182
|
typographyClassName: classes.ampmLabel,
|
|
182
|
-
value: utils
|
|
183
|
+
value: formatMeridiem(utils, 'am'),
|
|
183
184
|
onClick: readOnly ? undefined : () => handleMeridiemChange('am'),
|
|
184
185
|
disabled: disabled
|
|
185
186
|
}), /*#__PURE__*/_jsx(PickersToolbarButton, {
|
|
@@ -187,7 +188,7 @@ function TimePickerToolbar(inProps) {
|
|
|
187
188
|
variant: "subtitle2",
|
|
188
189
|
selected: meridiemMode === 'pm',
|
|
189
190
|
typographyClassName: classes.ampmLabel,
|
|
190
|
-
value: utils
|
|
191
|
+
value: formatMeridiem(utils, 'pm'),
|
|
191
192
|
onClick: readOnly ? undefined : () => handleMeridiemChange('pm'),
|
|
192
193
|
disabled: disabled
|
|
193
194
|
})]
|
package/index.js
CHANGED
|
@@ -87,21 +87,20 @@ export const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function Picke
|
|
|
87
87
|
goTo: onGoToPrevious,
|
|
88
88
|
label: previousLabel
|
|
89
89
|
};
|
|
90
|
-
const [leftProps, rightProps] = isRTL ? [nextProps, previousProps] : [previousProps, nextProps];
|
|
91
90
|
const PreviousIconButton = (_slots$previousIconBu = slots == null ? void 0 : slots.previousIconButton) != null ? _slots$previousIconBu : PickersArrowSwitcherButton;
|
|
92
91
|
const previousIconButtonProps = useSlotProps({
|
|
93
92
|
elementType: PreviousIconButton,
|
|
94
93
|
externalSlotProps: slotProps == null ? void 0 : slotProps.previousIconButton,
|
|
95
94
|
additionalProps: {
|
|
96
95
|
size: 'medium',
|
|
97
|
-
title:
|
|
98
|
-
'aria-label':
|
|
99
|
-
disabled:
|
|
96
|
+
title: previousProps.label,
|
|
97
|
+
'aria-label': previousProps.label,
|
|
98
|
+
disabled: previousProps.isDisabled,
|
|
100
99
|
edge: 'end',
|
|
101
|
-
onClick:
|
|
100
|
+
onClick: previousProps.goTo
|
|
102
101
|
},
|
|
103
102
|
ownerState: _extends({}, ownerState, {
|
|
104
|
-
hidden:
|
|
103
|
+
hidden: previousProps.isHidden
|
|
105
104
|
}),
|
|
106
105
|
className: classes.button
|
|
107
106
|
});
|
|
@@ -111,14 +110,14 @@ export const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function Picke
|
|
|
111
110
|
externalSlotProps: slotProps == null ? void 0 : slotProps.nextIconButton,
|
|
112
111
|
additionalProps: {
|
|
113
112
|
size: 'medium',
|
|
114
|
-
title:
|
|
115
|
-
'aria-label':
|
|
116
|
-
disabled:
|
|
113
|
+
title: nextProps.label,
|
|
114
|
+
'aria-label': nextProps.label,
|
|
115
|
+
disabled: nextProps.isDisabled,
|
|
117
116
|
edge: 'start',
|
|
118
|
-
onClick:
|
|
117
|
+
onClick: nextProps.goTo
|
|
119
118
|
},
|
|
120
119
|
ownerState: _extends({}, ownerState, {
|
|
121
|
-
hidden:
|
|
120
|
+
hidden: nextProps.isHidden
|
|
122
121
|
}),
|
|
123
122
|
className: classes.button
|
|
124
123
|
});
|
|
@@ -15,7 +15,7 @@ export interface PickersPopperSlotsComponent {
|
|
|
15
15
|
DesktopPaper?: React.JSXElementConstructor<MuiPaperProps>;
|
|
16
16
|
/**
|
|
17
17
|
* Custom component for the desktop popper [Transition](https://mui.com/material-ui/transitions/).
|
|
18
|
-
* @default Grow from '@mui/material'
|
|
18
|
+
* @default Grow or Fade from '@mui/material' when `reduceAnimations` is `true`.
|
|
19
19
|
*/
|
|
20
20
|
DesktopTransition?: React.JSXElementConstructor<MuiTransitionProps>;
|
|
21
21
|
/**
|
|
@@ -61,5 +61,6 @@ export interface PickerPopperProps extends UsePickerValueActions {
|
|
|
61
61
|
slotProps?: PickersPopperSlotsComponentsProps;
|
|
62
62
|
classes?: Partial<PickersPopperClasses>;
|
|
63
63
|
shouldRestoreFocus?: () => boolean;
|
|
64
|
+
reduceAnimations?: boolean;
|
|
64
65
|
}
|
|
65
66
|
export declare function PickersPopper(inProps: PickerPopperProps): React.JSX.Element;
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
4
|
import Grow from '@mui/material/Grow';
|
|
5
|
+
import Fade from '@mui/material/Fade';
|
|
5
6
|
import MuiPaper from '@mui/material/Paper';
|
|
6
7
|
import MuiPopper from '@mui/material/Popper';
|
|
7
8
|
import MuiTrapFocus from '@mui/material/Unstable_TrapFocus';
|
|
@@ -9,6 +10,7 @@ import { unstable_useForkRef as useForkRef, unstable_useEventCallback as useEven
|
|
|
9
10
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
10
11
|
import { getPickersPopperUtilityClass } from './pickersPopperClasses';
|
|
11
12
|
import { getActiveElement } from '../utils/utils';
|
|
13
|
+
import { useDefaultReduceAnimations } from '../hooks/useDefaultReduceAnimations';
|
|
12
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
15
|
const useUtilityClasses = ownerState => {
|
|
14
16
|
const {
|
|
@@ -173,7 +175,8 @@ export function PickersPopper(inProps) {
|
|
|
173
175
|
role,
|
|
174
176
|
placement,
|
|
175
177
|
slots,
|
|
176
|
-
slotProps
|
|
178
|
+
slotProps,
|
|
179
|
+
reduceAnimations: inReduceAnimations
|
|
177
180
|
} = props;
|
|
178
181
|
React.useEffect(() => {
|
|
179
182
|
function handleKeyDown(nativeEvent) {
|
|
@@ -210,6 +213,8 @@ export function PickersPopper(inProps) {
|
|
|
210
213
|
const handlePaperRef = useForkRef(handleRef, clickAwayRef);
|
|
211
214
|
const ownerState = props;
|
|
212
215
|
const classes = useUtilityClasses(ownerState);
|
|
216
|
+
const defaultReduceAnimations = useDefaultReduceAnimations();
|
|
217
|
+
const reduceAnimations = inReduceAnimations != null ? inReduceAnimations : defaultReduceAnimations;
|
|
213
218
|
const handleKeyDown = event => {
|
|
214
219
|
if (event.key === 'Escape') {
|
|
215
220
|
// stop the propagation to avoid closing parent modal
|
|
@@ -217,7 +222,7 @@ export function PickersPopper(inProps) {
|
|
|
217
222
|
onDismiss();
|
|
218
223
|
}
|
|
219
224
|
};
|
|
220
|
-
const Transition = (_slots$desktopTransit = slots == null ? void 0 : slots.desktopTransition) != null ? _slots$desktopTransit : Grow;
|
|
225
|
+
const Transition = ((_slots$desktopTransit = slots == null ? void 0 : slots.desktopTransition) != null ? _slots$desktopTransit : reduceAnimations) ? Fade : Grow;
|
|
221
226
|
const TrapFocus = (_slots$desktopTrapFoc = slots == null ? void 0 : slots.desktopTrapFocus) != null ? _slots$desktopTrapFoc : MuiTrapFocus;
|
|
222
227
|
const Paper = (_slots$desktopPaper = slots == null ? void 0 : slots.desktopPaper) != null ? _slots$desktopPaper : PickersPopperPaper;
|
|
223
228
|
const paperProps = useSlotProps({
|