@mui/x-date-pickers 5.0.0-alpha.3 → 5.0.0-alpha.4
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 +101 -16
- package/CalendarPicker/CalendarPicker.js +2 -0
- package/CalendarPicker/PickersCalendarHeader.js +13 -4
- package/CalendarPicker/index.d.ts +1 -1
- package/ClockPicker/ClockPicker.d.ts +2 -0
- package/ClockPicker/ClockPicker.js +20 -22
- package/DatePicker/DatePicker.d.ts +9 -3
- package/DatePicker/DatePicker.js +4 -57
- package/DatePicker/DatePickerToolbar.d.ts +1 -0
- package/DatePicker/DatePickerToolbar.js +16 -7
- package/DateTimePicker/DateTimePicker.js +4 -48
- package/DateTimePicker/DateTimePickerToolbar.d.ts +1 -0
- package/DateTimePicker/DateTimePickerToolbar.js +37 -11
- package/DesktopDatePicker/DesktopDatePicker.d.ts +9 -2
- package/DesktopDatePicker/DesktopDatePicker.js +12 -20
- package/DesktopDatePicker/index.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +9 -2
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +12 -20
- package/DesktopDateTimePicker/index.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.d.ts +8 -1
- package/DesktopTimePicker/DesktopTimePicker.js +11 -18
- package/DesktopTimePicker/index.d.ts +1 -1
- package/LocalizationProvider/LocalizationProvider.d.ts +13 -2
- package/LocalizationProvider/LocalizationProvider.js +38 -7
- package/MobileDatePicker/MobileDatePicker.d.ts +8 -1
- package/MobileDatePicker/MobileDatePicker.js +13 -41
- package/MobileDatePicker/index.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +8 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +13 -41
- package/MobileDateTimePicker/index.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.d.ts +8 -1
- package/MobileTimePicker/MobileTimePicker.js +12 -39
- package/MobileTimePicker/index.d.ts +1 -1
- package/PickersActionBar/PickersActionBar.d.ts +16 -0
- package/PickersActionBar/PickersActionBar.js +56 -0
- package/PickersActionBar/index.d.ts +2 -0
- package/PickersActionBar/index.js +1 -0
- package/PickersActionBar/package.json +6 -0
- package/README.md +42 -2
- package/StaticDatePicker/StaticDatePicker.js +2 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +2 -0
- package/TimePicker/TimePicker.d.ts +9 -3
- package/TimePicker/TimePicker.js +3 -51
- package/TimePicker/TimePickerToolbar.js +24 -9
- package/TimePicker/timePickerToolbarClasses.d.ts +0 -1
- package/TimePicker/timePickerToolbarClasses.js +2 -2
- package/YearPicker/YearPicker.js +26 -3
- package/index.d.ts +1 -0
- package/index.js +3 -2
- package/internals/components/CalendarOrClockPicker/index.d.ts +1 -0
- package/internals/components/PickersArrowSwitcher.d.ts +2 -0
- package/internals/components/PickersArrowSwitcher.js +8 -8
- package/internals/components/PickersModalDialog.d.ts +9 -30
- package/internals/components/PickersModalDialog.js +13 -35
- package/internals/components/PickersPopper.d.ts +13 -12
- package/internals/components/PickersPopper.js +27 -23
- package/internals/components/PickersToolbar.d.ts +1 -1
- package/internals/components/PickersToolbar.js +23 -9
- package/internals/components/wrappers/DesktopTooltipWrapper.js +11 -5
- package/internals/components/wrappers/DesktopWrapper.d.ts +8 -1
- package/internals/components/wrappers/DesktopWrapper.js +9 -5
- package/internals/components/wrappers/MobileWrapper.d.ts +8 -1
- package/internals/components/wrappers/MobileWrapper.js +8 -14
- package/internals/hooks/useUtils.d.ts +1 -0
- package/internals/hooks/useUtils.js +1 -0
- package/internals/index.d.ts +5 -4
- package/internals/index.js +3 -2
- package/internals/utils/warning.d.ts +3 -0
- package/internals/utils/warning.js +17 -0
- package/legacy/CalendarPicker/CalendarPicker.js +2 -0
- package/legacy/CalendarPicker/PickersCalendarHeader.js +13 -6
- package/legacy/ClockPicker/ClockPicker.js +22 -24
- package/legacy/DatePicker/DatePicker.js +5 -58
- package/legacy/DatePicker/DatePickerToolbar.js +19 -6
- package/legacy/DateTimePicker/DateTimePicker.js +5 -49
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +45 -11
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +12 -20
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +12 -20
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +11 -18
- package/legacy/LocalizationProvider/LocalizationProvider.js +38 -7
- package/legacy/MobileDatePicker/MobileDatePicker.js +12 -40
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +12 -40
- package/legacy/MobileTimePicker/MobileTimePicker.js +11 -38
- package/legacy/PickersActionBar/PickersActionBar.js +54 -0
- package/legacy/PickersActionBar/index.js +1 -0
- package/legacy/StaticDatePicker/StaticDatePicker.js +2 -0
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +2 -0
- package/legacy/TimePicker/TimePicker.js +4 -52
- package/legacy/TimePicker/TimePickerToolbar.js +31 -8
- package/legacy/TimePicker/timePickerToolbarClasses.js +2 -2
- package/legacy/YearPicker/YearPicker.js +27 -3
- package/legacy/index.js +3 -2
- package/legacy/internals/components/PickersArrowSwitcher.js +8 -10
- package/legacy/internals/components/PickersModalDialog.js +14 -43
- package/legacy/internals/components/PickersPopper.js +30 -29
- package/legacy/internals/components/PickersToolbar.js +29 -9
- package/legacy/internals/components/wrappers/DesktopTooltipWrapper.js +11 -5
- package/legacy/internals/components/wrappers/DesktopWrapper.js +9 -5
- package/legacy/internals/components/wrappers/MobileWrapper.js +9 -15
- package/legacy/internals/hooks/useUtils.js +3 -0
- package/legacy/internals/index.js +3 -2
- package/legacy/internals/utils/warning.js +29 -0
- package/legacy/locales/enUS.js +16 -0
- package/legacy/locales/frFR.js +14 -0
- package/legacy/locales/index.js +3 -0
- package/legacy/locales/utils/getPickersLocalization.js +12 -0
- package/legacy/locales/utils/pickersLocaleTextApi.js +1 -0
- package/locales/enUS.d.ts +22 -0
- package/locales/enUS.js +16 -0
- package/locales/frFR.d.ts +20 -0
- package/locales/frFR.js +14 -0
- package/locales/index.d.ts +3 -0
- package/locales/index.js +3 -0
- package/locales/package.json +6 -0
- package/locales/utils/getPickersLocalization.d.ts +21 -0
- package/locales/utils/getPickersLocalization.js +12 -0
- package/locales/utils/pickersLocaleTextApi.d.ts +16 -0
- package/locales/utils/pickersLocaleTextApi.js +1 -0
- package/modern/CalendarPicker/CalendarPicker.js +2 -0
- package/modern/CalendarPicker/PickersCalendarHeader.js +13 -4
- package/modern/ClockPicker/ClockPicker.js +20 -22
- package/modern/DatePicker/DatePicker.js +4 -57
- package/modern/DatePicker/DatePickerToolbar.js +16 -7
- package/modern/DateTimePicker/DateTimePicker.js +4 -48
- package/modern/DateTimePicker/DateTimePickerToolbar.js +37 -11
- package/modern/DesktopDatePicker/DesktopDatePicker.js +12 -20
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +12 -20
- package/modern/DesktopTimePicker/DesktopTimePicker.js +11 -18
- package/modern/LocalizationProvider/LocalizationProvider.js +38 -7
- package/modern/MobileDatePicker/MobileDatePicker.js +13 -41
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +13 -41
- package/modern/MobileTimePicker/MobileTimePicker.js +12 -39
- package/modern/PickersActionBar/PickersActionBar.js +56 -0
- package/modern/PickersActionBar/index.js +1 -0
- package/modern/StaticDatePicker/StaticDatePicker.js +2 -0
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +2 -0
- package/modern/TimePicker/TimePicker.js +3 -51
- package/modern/TimePicker/TimePickerToolbar.js +24 -9
- package/modern/TimePicker/timePickerToolbarClasses.js +2 -2
- package/modern/YearPicker/YearPicker.js +26 -3
- package/modern/index.js +3 -2
- package/modern/internals/components/PickersArrowSwitcher.js +8 -8
- package/modern/internals/components/PickersModalDialog.js +11 -35
- package/modern/internals/components/PickersPopper.js +25 -23
- package/modern/internals/components/PickersToolbar.js +23 -9
- package/modern/internals/components/wrappers/DesktopTooltipWrapper.js +11 -5
- package/modern/internals/components/wrappers/DesktopWrapper.js +9 -5
- package/modern/internals/components/wrappers/MobileWrapper.js +8 -14
- package/modern/internals/hooks/useUtils.js +1 -0
- package/modern/internals/index.js +3 -2
- package/modern/internals/utils/warning.js +17 -0
- package/modern/locales/enUS.js +16 -0
- package/modern/locales/frFR.js +14 -0
- package/modern/locales/index.js +3 -0
- package/modern/locales/utils/getPickersLocalization.js +12 -0
- package/modern/locales/utils/pickersLocaleTextApi.js +1 -0
- package/node/CalendarPicker/CalendarPicker.js +2 -0
- package/node/CalendarPicker/PickersCalendarHeader.js +13 -3
- package/node/ClockPicker/ClockPicker.js +20 -21
- package/node/DatePicker/DatePicker.js +4 -57
- package/node/DatePicker/DatePickerToolbar.js +17 -7
- package/node/DateTimePicker/DateTimePicker.js +4 -48
- package/node/DateTimePicker/DateTimePickerToolbar.js +38 -11
- package/node/DesktopDatePicker/DesktopDatePicker.js +12 -20
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +12 -20
- package/node/DesktopTimePicker/DesktopTimePicker.js +11 -18
- package/node/LocalizationProvider/LocalizationProvider.js +41 -7
- package/node/MobileDatePicker/MobileDatePicker.js +13 -41
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +13 -41
- package/node/MobileTimePicker/MobileTimePicker.js +12 -39
- package/node/PickersActionBar/PickersActionBar.js +77 -0
- package/node/PickersActionBar/index.js +13 -0
- package/node/StaticDatePicker/StaticDatePicker.js +2 -0
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +2 -0
- package/node/TimePicker/TimePicker.js +3 -51
- package/node/TimePicker/TimePickerToolbar.js +23 -9
- package/node/TimePicker/timePickerToolbarClasses.js +2 -2
- package/node/YearPicker/YearPicker.js +26 -3
- package/node/index.js +14 -1
- package/node/internals/components/PickersArrowSwitcher.js +8 -8
- package/node/internals/components/PickersModalDialog.js +14 -37
- package/node/internals/components/PickersPopper.js +28 -24
- package/node/internals/components/PickersToolbar.js +25 -10
- package/node/internals/components/wrappers/DesktopTooltipWrapper.js +11 -5
- package/node/internals/components/wrappers/DesktopWrapper.js +9 -5
- package/node/internals/components/wrappers/MobileWrapper.js +8 -14
- package/node/internals/hooks/useUtils.js +5 -1
- package/node/internals/index.js +20 -0
- package/node/internals/utils/warning.js +26 -0
- package/node/locales/enUS.js +26 -0
- package/node/locales/frFR.js +23 -0
- package/node/locales/index.js +44 -0
- package/node/locales/utils/getPickersLocalization.js +24 -0
- package/node/locales/utils/pickersLocaleTextApi.js +5 -0
- package/package.json +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,21 +3,111 @@
|
|
|
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
|
+
## v5.11.1
|
|
7
|
+
|
|
8
|
+
_May 20, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Support localization on the date and time picker components (#4517) @alexfauquette
|
|
13
|
+
|
|
14
|
+
Texts can be translated in the pickers components, similar to what can be done in the data grid component. Check the [documentation](https://mui.com/x/react-date-pickers/localization/) for more information.
|
|
15
|
+
|
|
16
|
+
- 📃 Add support for column spanning when exporting to Excel (#4830) @cherniavskii
|
|
17
|
+
|
|
18
|
+
<img src="https://user-images.githubusercontent.com/13808724/167691417-bf6baeb9-d409-4134-acb6-aadaf6434de9.png" width="800">
|
|
19
|
+
|
|
20
|
+
- 🐞 Bugs fixes
|
|
21
|
+
|
|
22
|
+
### `@mui/x-data-grid@v5.11.1` / `@mui/x-data-grid-pro@v5.11.1` / `@mui/x-data-grid-premium@v5.11.1`
|
|
23
|
+
|
|
24
|
+
#### Changes
|
|
25
|
+
|
|
26
|
+
- [DataGrid] Add a CSS class corresponding to current density (#4858) @m4theushw
|
|
27
|
+
- [DataGrid] Execute the pipe-processors in their initialization order (#4913) @flaviendelangle
|
|
28
|
+
- [DataGrid] Fix rendering of the no rows overlay when the `loading` prop is changed (#4910) @m4theushw
|
|
29
|
+
- [DataGridPremium] Add `exceljs` to the dependencies (#4939) @alexfauquette
|
|
30
|
+
- [DataGridPremium] Support column spanning in the Excel export (#4830) @cherniavskii
|
|
31
|
+
- [l10n] Improve Russian (ru-RU) locale (#4864) @arvkonstantin
|
|
32
|
+
|
|
33
|
+
### `@mui/x-date-pickers@5.0.0-alpha.4` / `@mui/x-date-pickers-pro@5.0.0-alpha.4`
|
|
34
|
+
|
|
35
|
+
#### Breaking changes
|
|
36
|
+
|
|
37
|
+
- The props related to the action bar buttons have been removed (`clearable`, `showTodayButton`, `cancelText`, `okText`)
|
|
38
|
+
|
|
39
|
+
To decide which button must be displayed and in which order, you can now use the `actions` prop of the `actionBar` component slot props.
|
|
40
|
+
|
|
41
|
+
```jsx
|
|
42
|
+
<DatePicker
|
|
43
|
+
componentsProps={{
|
|
44
|
+
actionBar: {
|
|
45
|
+
// The actions will be the same between desktop and mobile
|
|
46
|
+
actions: ['clear'],
|
|
47
|
+
|
|
48
|
+
// The actions will be different between desktop and mobile
|
|
49
|
+
actions: (variant) => variant === 'desktop' ? [] : ['clear'],
|
|
50
|
+
}
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The build-in `ActionBar` component supports 4 different actions: `'clear'`, `'cancel'`, `'accept'`, and `'today'`.
|
|
56
|
+
By default, the pickers will render the cancel and accept button on mobile and no action on desktop.
|
|
57
|
+
|
|
58
|
+
If you need other actions, you can provide your own component to the `ActionBar` component slot
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
<DatePicker
|
|
62
|
+
components={{ ActionBar: CustomActionBar }}
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Changes
|
|
67
|
+
|
|
68
|
+
- [DatePicker] Fix keyboard accessibility for first and last year (#4807) @alexfauquette
|
|
69
|
+
- [pickers] Add component slot for action bar (#4778) @alexfauquette
|
|
70
|
+
- [pickers] Add l10n support (#4517) @alexfauquette
|
|
71
|
+
- [pickers] Close Popper when pressing <kbd>Esc</kbd> inside a modal (#4499) @alexfauquette
|
|
72
|
+
- [pickers] Support class slots on toolbar components (#4855) @flaviendelangle
|
|
73
|
+
- [TimePicker] Fix time validation when current date is `null` (#4867) @flaviendelangle
|
|
74
|
+
|
|
75
|
+
### Docs
|
|
76
|
+
|
|
77
|
+
- [docs] Add 301 redirect for columns page (#4940) @alexfauquette
|
|
78
|
+
- [docs] Avoid confusion with license key installation (#4891) @oliviertassinari
|
|
79
|
+
- [docs] Complete the instructions for pickers installation in readme (#4852) @alexfauquette
|
|
80
|
+
- [docs] Disable ads on paid-only pages (#4842) @flaviendelangle
|
|
81
|
+
- [docs] Don't redirect to localized doc on deploy preview (#4818) @m4theushw
|
|
82
|
+
- [docs] Limit `LICENSE` file to 80 char per line (#4873) @oliviertassinari
|
|
83
|
+
- [docs] Typo on OrderId @oliviertassinari
|
|
84
|
+
- [docs] Update feature comparison table (#4918) @cherniavskii
|
|
85
|
+
|
|
86
|
+
### Core
|
|
87
|
+
|
|
88
|
+
- [core] Add new script to generate tree data rows from file tree (#4902) @flaviendelangle
|
|
89
|
+
- [core] Fix code style (#4874) @oliviertassinari
|
|
90
|
+
- [core] Fix React 18 peer dependency (#4908) @oliviertassinari
|
|
91
|
+
- [core] Fix link to the LICENSE file (#4875) @oliviertassinari
|
|
92
|
+
- [core] Fix transitive babel dependency (#4793) @oliviertassinari
|
|
93
|
+
- [core] New pipe processing `rowHydration` (#4896) @flaviendelangle
|
|
94
|
+
- [core] Remove dead code for the docs (#4791) @oliviertassinari
|
|
95
|
+
- [core] Run `yarn prettier` @oliviertassinari
|
|
96
|
+
- [core] Polishes on `CHANGELOG.md` (#4876) @oliviertassinari
|
|
97
|
+
- [core] Simplify rows cache management (#4933) @flaviendelangle
|
|
98
|
+
- [core] Use internal icons for quick filter (#4912) @alexfauquette
|
|
99
|
+
|
|
6
100
|
## v5.11.0
|
|
7
101
|
|
|
8
102
|
_May 13, 2022_
|
|
9
103
|
|
|
10
104
|
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
11
105
|
|
|
12
|
-
- 🚀 Premium plan release
|
|
13
|
-
|
|
14
|
-
We’re happy to announce that the Premium plan is [finally out](https://mui.com/blog/premium-plan-release/)!
|
|
15
|
-
With it, MUI X officially steps up to the next level, supporting the most advanced use cases for UI components.
|
|
106
|
+
- 🚀 **Premium plan release**. We're happy to announce that the Premium plan is [finally out](https://mui.com/blog/premium-plan-release/)! With it, MUI X officially steps up to the next level, supporting the most advanced use cases for UI components.
|
|
16
107
|
|
|
17
108
|
This plan is available through the new `@mui/x-data-grid-premium` package, which contains the row grouping and the Excel export features.
|
|
18
109
|
|
|
19
|
-
If you were already using the row grouping feature, you can upgrade by [installing](https://mui.com/x/react-data-grid/getting-started/#installation) `@mui/x-data-grid-premium` and replace `DataGridPro` with `DataGridPremium`, as follows.
|
|
20
|
-
Note that the experimental flag is not required anymore to use the row grouping.
|
|
110
|
+
If you were already using the row grouping feature, you can upgrade by [installing](https://mui.com/x/react-data-grid/getting-started/#installation) `@mui/x-data-grid-premium` and replace `DataGridPro` with `DataGridPremium`, as follows. Note that the experimental flag is not required anymore to use the row grouping.
|
|
21
111
|
|
|
22
112
|
```diff
|
|
23
113
|
-import { DataGridPro } from '@mui/x-data-grid-pro';
|
|
@@ -29,16 +119,11 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
29
119
|
|
|
30
120
|
For more information about the revised pricing model please have a look at the [blog post](https://mui.com/blog/premium-plan-release/#the-new-licensing-model).
|
|
31
121
|
|
|
32
|
-
- 👔
|
|
33
|
-
|
|
34
|
-
- 🔎 Quick filtering
|
|
35
|
-
|
|
36
|
-
You can now add a quick filtering search bar to your grid.
|
|
37
|
-
To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar.
|
|
122
|
+
- 👔 **Excel export**. You can find this new Premium feature at: https://mui.com/x/react-data-grid/export/#excel-export.
|
|
38
123
|
|
|
39
|
-
|
|
124
|
+
- 🔎 **Quick filtering**. You can now add a quick filtering search bar to your grid. To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar. More information about how to customize the filtering logic is in the [documentation]( https://mui.com/x/react-data-grid/filtering/#quick-filter).
|
|
40
125
|
|
|
41
|
-
|
|
126
|
+
<img src="https://user-images.githubusercontent.com/13808724/167700105-5a5acc7c-5463-4871-8514-3d09e2f365ae.png" width="724">
|
|
42
127
|
|
|
43
128
|
- 🐞 Bugs fixes
|
|
44
129
|
|
|
@@ -46,7 +131,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
46
131
|
|
|
47
132
|
#### Breaking changes
|
|
48
133
|
|
|
49
|
-
-
|
|
134
|
+
- Move row grouping to the premium package (#4223) @flaviendelangle
|
|
50
135
|
|
|
51
136
|
The use of `rowGrouping` in the `@mui/x-data-grid-pro` package is deprecated. The experimental flag will be removed in an upcoming release.
|
|
52
137
|
|
|
@@ -76,7 +161,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
76
161
|
|
|
77
162
|
#### Breaking changes
|
|
78
163
|
|
|
79
|
-
- Rework the auto-closing behavior of the pickers
|
|
164
|
+
- Rework the auto-closing behavior of the pickers (#4408) @flaviendelangle
|
|
80
165
|
|
|
81
166
|
The `disableCloseOnSelect` prop has been replaced by a new `closeOnSelect` prop which has the opposite behavior.
|
|
82
167
|
The default behavior remains the same (close after the last step on desktop but not on mobile).
|
|
@@ -287,6 +287,7 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
|
|
|
287
287
|
|
|
288
288
|
/**
|
|
289
289
|
* Left arrow icon aria-label text.
|
|
290
|
+
* @deprecated
|
|
290
291
|
*/
|
|
291
292
|
leftArrowButtonText: PropTypes.string,
|
|
292
293
|
|
|
@@ -370,6 +371,7 @@ process.env.NODE_ENV !== "production" ? CalendarPicker.propTypes = {
|
|
|
370
371
|
|
|
371
372
|
/**
|
|
372
373
|
* Right arrow icon aria-label text.
|
|
374
|
+
* @deprecated
|
|
373
375
|
*/
|
|
374
376
|
rightArrowButtonText: PropTypes.string,
|
|
375
377
|
|
|
@@ -3,11 +3,12 @@ import * as React from 'react';
|
|
|
3
3
|
import Fade from '@mui/material/Fade';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import IconButton from '@mui/material/IconButton';
|
|
6
|
-
import { useUtils } from '../internals/hooks/useUtils';
|
|
6
|
+
import { useLocaleText, useUtils } from '../internals/hooks/useUtils';
|
|
7
7
|
import { PickersFadeTransitionGroup } from './PickersFadeTransitionGroup';
|
|
8
8
|
import { ArrowDropDown } from '../internals/components/icons';
|
|
9
9
|
import { PickersArrowSwitcher } from '../internals/components/PickersArrowSwitcher';
|
|
10
10
|
import { usePreviousMonthDisabled, useNextMonthDisabled } from '../internals/hooks/date-helpers-hooks';
|
|
11
|
+
import { buildDeprecatedPropsWarning } from '../internals/utils/warning';
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
const PickersCalendarHeaderRoot = styled('div')({
|
|
@@ -53,11 +54,12 @@ const PickersCalendarHeaderSwitchView = styled(ArrowDropDown)(({
|
|
|
53
54
|
function getSwitchingViewAriaText(view) {
|
|
54
55
|
return view === 'year' ? 'year view is open, switch to calendar view' : 'calendar view is open, switch to year view';
|
|
55
56
|
}
|
|
57
|
+
|
|
58
|
+
const deprecatedPropsWarning = buildDeprecatedPropsWarning('Props for translation are deprecated. See https://mui.com/x/react-date-pickers/localization for more information.');
|
|
56
59
|
/**
|
|
57
60
|
* @ignore - do not document.
|
|
58
61
|
*/
|
|
59
62
|
|
|
60
|
-
|
|
61
63
|
export function PickersCalendarHeader(props) {
|
|
62
64
|
const {
|
|
63
65
|
components = {},
|
|
@@ -67,16 +69,23 @@ export function PickersCalendarHeader(props) {
|
|
|
67
69
|
disableFuture,
|
|
68
70
|
disablePast,
|
|
69
71
|
getViewSwitchingButtonText = getSwitchingViewAriaText,
|
|
70
|
-
leftArrowButtonText
|
|
72
|
+
leftArrowButtonText: leftArrowButtonTextProp,
|
|
71
73
|
maxDate,
|
|
72
74
|
minDate,
|
|
73
75
|
onMonthChange,
|
|
74
76
|
onViewChange,
|
|
75
77
|
openView: currentView,
|
|
76
78
|
reduceAnimations,
|
|
77
|
-
rightArrowButtonText
|
|
79
|
+
rightArrowButtonText: rightArrowButtonTextProp,
|
|
78
80
|
views
|
|
79
81
|
} = props;
|
|
82
|
+
deprecatedPropsWarning({
|
|
83
|
+
leftArrowButtonText: leftArrowButtonTextProp,
|
|
84
|
+
rightArrowButtonText: rightArrowButtonTextProp
|
|
85
|
+
});
|
|
86
|
+
const localeText = useLocaleText();
|
|
87
|
+
const leftArrowButtonText = leftArrowButtonTextProp != null ? leftArrowButtonTextProp : localeText.previousMonth;
|
|
88
|
+
const rightArrowButtonText = rightArrowButtonTextProp != null ? rightArrowButtonTextProp : localeText.nextMonth;
|
|
80
89
|
const utils = useUtils();
|
|
81
90
|
const switchViewButtonProps = componentsProps.switchViewButton || {};
|
|
82
91
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CalendarPicker } from './CalendarPicker';
|
|
2
|
-
export type { CalendarPickerProps } from './CalendarPicker';
|
|
2
|
+
export type { CalendarPickerProps, CalendarPickerSlotsComponent, CalendarPickerSlotsComponentsProps, } from './CalendarPicker';
|
|
3
3
|
export { getCalendarPickerUtilityClass, calendarPickerClasses } from './calendarPickerClasses';
|
|
4
4
|
export type { CalendarPickerClassKey, CalendarPickerClasses } from './calendarPickerClasses';
|
|
5
5
|
export type { CalendarPickerView } from '../internals/models';
|
|
@@ -91,6 +91,7 @@ export interface ClockPickerProps<TDate> extends ExportedClockPickerProps<TDate>
|
|
|
91
91
|
/**
|
|
92
92
|
* Left arrow icon aria-label text.
|
|
93
93
|
* @default 'open previous view'
|
|
94
|
+
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
94
95
|
*/
|
|
95
96
|
leftArrowButtonText?: string;
|
|
96
97
|
/**
|
|
@@ -100,6 +101,7 @@ export interface ClockPickerProps<TDate> extends ExportedClockPickerProps<TDate>
|
|
|
100
101
|
/**
|
|
101
102
|
* Right arrow icon aria-label text.
|
|
102
103
|
* @default 'open next view'
|
|
104
|
+
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
103
105
|
*/
|
|
104
106
|
rightArrowButtonText?: string;
|
|
105
107
|
showViewSwitcher?: boolean;
|
|
@@ -6,7 +6,8 @@ import { unstable_useId as useId } from '@mui/utils';
|
|
|
6
6
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
8
8
|
import { Clock } from './Clock';
|
|
9
|
-
import { useUtils, useNow } from '../internals/hooks/useUtils';
|
|
9
|
+
import { useUtils, useNow, useLocaleText } from '../internals/hooks/useUtils';
|
|
10
|
+
import { buildDeprecatedPropsWarning } from '../internals/utils/warning';
|
|
10
11
|
import { getHourNumbers, getMinutesNumbers } from './ClockNumbers';
|
|
11
12
|
import { PickersArrowSwitcher } from '../internals/components/PickersArrowSwitcher';
|
|
12
13
|
import { convertValueToMeridiem, createIsAfterIgnoreDatePart } from '../internals/utils/time-utils';
|
|
@@ -54,12 +55,14 @@ const defaultGetHoursClockNumberText = hours => `${hours} hours`;
|
|
|
54
55
|
|
|
55
56
|
const defaultGetSecondsClockNumberText = seconds => `${seconds} seconds`;
|
|
56
57
|
|
|
58
|
+
const deprecatedPropsWarning = buildDeprecatedPropsWarning('Props for translation are deprecated. See https://mui.com/x/react-date-pickers/localization for more information.');
|
|
57
59
|
/**
|
|
58
60
|
*
|
|
59
61
|
* API:
|
|
60
62
|
*
|
|
61
63
|
* - [ClockPicker API](https://mui.com/x/api/date-pickers/clock-picker/)
|
|
62
64
|
*/
|
|
65
|
+
|
|
63
66
|
export const ClockPicker = /*#__PURE__*/React.forwardRef(function ClockPicker(inProps, ref) {
|
|
64
67
|
const props = useThemeProps({
|
|
65
68
|
props: inProps,
|
|
@@ -77,11 +80,11 @@ export const ClockPicker = /*#__PURE__*/React.forwardRef(function ClockPicker(in
|
|
|
77
80
|
getHoursClockNumberText = defaultGetHoursClockNumberText,
|
|
78
81
|
getMinutesClockNumberText = defaultGetMinutesClockNumberText,
|
|
79
82
|
getSecondsClockNumberText = defaultGetSecondsClockNumberText,
|
|
80
|
-
leftArrowButtonText
|
|
83
|
+
leftArrowButtonText: leftArrowButtonTextProp,
|
|
81
84
|
maxTime,
|
|
82
85
|
minTime,
|
|
83
86
|
minutesStep = 1,
|
|
84
|
-
rightArrowButtonText
|
|
87
|
+
rightArrowButtonText: rightArrowButtonTextProp,
|
|
85
88
|
shouldDisableTime,
|
|
86
89
|
showViewSwitcher,
|
|
87
90
|
onChange,
|
|
@@ -93,6 +96,13 @@ export const ClockPicker = /*#__PURE__*/React.forwardRef(function ClockPicker(in
|
|
|
93
96
|
disabled,
|
|
94
97
|
readOnly
|
|
95
98
|
} = props;
|
|
99
|
+
deprecatedPropsWarning({
|
|
100
|
+
leftArrowButtonText: leftArrowButtonTextProp,
|
|
101
|
+
rightArrowButtonText: rightArrowButtonTextProp
|
|
102
|
+
});
|
|
103
|
+
const localeText = useLocaleText();
|
|
104
|
+
const leftArrowButtonText = leftArrowButtonTextProp != null ? leftArrowButtonTextProp : localeText.openPreviousView;
|
|
105
|
+
const rightArrowButtonText = rightArrowButtonTextProp != null ? rightArrowButtonTextProp : localeText.openNextView;
|
|
96
106
|
const {
|
|
97
107
|
openView,
|
|
98
108
|
setOpenView,
|
|
@@ -108,8 +118,7 @@ export const ClockPicker = /*#__PURE__*/React.forwardRef(function ClockPicker(in
|
|
|
108
118
|
});
|
|
109
119
|
const now = useNow();
|
|
110
120
|
const utils = useUtils();
|
|
111
|
-
const
|
|
112
|
-
const dateOrMidnight = date || midnight;
|
|
121
|
+
const dateOrMidnight = React.useMemo(() => date || utils.setSeconds(utils.setMinutes(utils.setHours(now, 0), 0), 0), [date, now, utils]);
|
|
113
122
|
const {
|
|
114
123
|
meridiemMode,
|
|
115
124
|
handleMeridiemChange
|
|
@@ -148,12 +157,7 @@ export const ClockPicker = /*#__PURE__*/React.forwardRef(function ClockPicker(in
|
|
|
148
157
|
case 'hours':
|
|
149
158
|
{
|
|
150
159
|
const value = convertValueToMeridiem(rawValue, meridiemMode, ampm);
|
|
151
|
-
|
|
152
|
-
if (date == null) {
|
|
153
|
-
return !isValidValue(value);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const dateWithNewHours = utils.setHours(date, value);
|
|
160
|
+
const dateWithNewHours = utils.setHours(dateOrMidnight, value);
|
|
157
161
|
const start = utils.setSeconds(utils.setMinutes(dateWithNewHours, 0), 0);
|
|
158
162
|
const end = utils.setSeconds(utils.setMinutes(dateWithNewHours, 59), 59);
|
|
159
163
|
return !containsValidTime({
|
|
@@ -164,11 +168,7 @@ export const ClockPicker = /*#__PURE__*/React.forwardRef(function ClockPicker(in
|
|
|
164
168
|
|
|
165
169
|
case 'minutes':
|
|
166
170
|
{
|
|
167
|
-
|
|
168
|
-
return !isValidValue(rawValue, minutesStep);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const dateWithNewMinutes = utils.setMinutes(date, rawValue);
|
|
171
|
+
const dateWithNewMinutes = utils.setMinutes(dateOrMidnight, rawValue);
|
|
172
172
|
const start = utils.setSeconds(dateWithNewMinutes, 0);
|
|
173
173
|
const end = utils.setSeconds(dateWithNewMinutes, 59);
|
|
174
174
|
return !containsValidTime({
|
|
@@ -179,11 +179,7 @@ export const ClockPicker = /*#__PURE__*/React.forwardRef(function ClockPicker(in
|
|
|
179
179
|
|
|
180
180
|
case 'seconds':
|
|
181
181
|
{
|
|
182
|
-
|
|
183
|
-
return !isValidValue(rawValue);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const dateWithNewSeconds = utils.setSeconds(date, rawValue);
|
|
182
|
+
const dateWithNewSeconds = utils.setSeconds(dateOrMidnight, rawValue);
|
|
187
183
|
const start = dateWithNewSeconds;
|
|
188
184
|
const end = dateWithNewSeconds;
|
|
189
185
|
return !containsValidTime({
|
|
@@ -195,7 +191,7 @@ export const ClockPicker = /*#__PURE__*/React.forwardRef(function ClockPicker(in
|
|
|
195
191
|
default:
|
|
196
192
|
throw new Error('not supported');
|
|
197
193
|
}
|
|
198
|
-
}, [ampm,
|
|
194
|
+
}, [ampm, dateOrMidnight, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableTime, utils]);
|
|
199
195
|
const selectedId = useId();
|
|
200
196
|
const viewProps = React.useMemo(() => {
|
|
201
197
|
switch (openView) {
|
|
@@ -405,6 +401,7 @@ process.env.NODE_ENV !== "production" ? ClockPicker.propTypes = {
|
|
|
405
401
|
/**
|
|
406
402
|
* Left arrow icon aria-label text.
|
|
407
403
|
* @default 'open previous view'
|
|
404
|
+
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
408
405
|
*/
|
|
409
406
|
leftArrowButtonText: PropTypes.string,
|
|
410
407
|
|
|
@@ -452,6 +449,7 @@ process.env.NODE_ENV !== "production" ? ClockPicker.propTypes = {
|
|
|
452
449
|
/**
|
|
453
450
|
* Right arrow icon aria-label text.
|
|
454
451
|
* @default 'open next view'
|
|
452
|
+
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
455
453
|
*/
|
|
456
454
|
rightArrowButtonText: PropTypes.string,
|
|
457
455
|
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DesktopDatePickerProps } from '../DesktopDatePicker';
|
|
3
|
-
import { MobileDatePickerProps } from '../MobileDatePicker';
|
|
4
|
-
export interface
|
|
2
|
+
import { DesktopDatePickerProps, DesktopDatePickerSlotsComponent, DesktopDatePickerSlotsComponentsProps } from '../DesktopDatePicker';
|
|
3
|
+
import { MobileDatePickerProps, MobileDatePickerSlotsComponent, MobileDatePickerSlotsComponentsProps } from '../MobileDatePicker';
|
|
4
|
+
export interface DatePickerSlotsComponent extends MobileDatePickerSlotsComponent, DesktopDatePickerSlotsComponent {
|
|
5
|
+
}
|
|
6
|
+
export interface DatePickerSlotsComponentsProps extends MobileDatePickerSlotsComponentsProps, DesktopDatePickerSlotsComponentsProps {
|
|
7
|
+
}
|
|
8
|
+
export interface DatePickerProps<TInputDate, TDate> extends Omit<DesktopDatePickerProps<TInputDate, TDate>, 'components' | 'componentsProps'>, Omit<MobileDatePickerProps<TInputDate, TDate>, 'components' | 'componentsProps'> {
|
|
5
9
|
/**
|
|
6
10
|
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
7
11
|
* @default '@media (pointer: fine)'
|
|
8
12
|
* @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
|
|
9
13
|
*/
|
|
10
14
|
desktopModeMediaQuery?: string;
|
|
15
|
+
components?: Partial<DatePickerSlotsComponent>;
|
|
16
|
+
componentsProps?: Partial<DatePickerSlotsComponentsProps>;
|
|
11
17
|
}
|
|
12
18
|
declare type DatePickerComponent = (<TInputDate, TDate = TInputDate>(props: DatePickerProps<TInputDate, TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
13
19
|
propTypes?: any;
|
package/DatePicker/DatePicker.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 = ["
|
|
3
|
+
const _excluded = ["desktopModeMediaQuery", "DialogProps", "PopperProps", "TransitionComponent"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useThemeProps } from '@mui/material/styles';
|
|
6
6
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
@@ -27,13 +27,9 @@ export const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker(inPr
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const {
|
|
30
|
-
cancelText,
|
|
31
30
|
desktopModeMediaQuery = '@media (pointer: fine)',
|
|
32
31
|
DialogProps,
|
|
33
|
-
okText,
|
|
34
32
|
PopperProps,
|
|
35
|
-
showTodayButton,
|
|
36
|
-
todayText,
|
|
37
33
|
TransitionComponent
|
|
38
34
|
} = props,
|
|
39
35
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -50,11 +46,7 @@ export const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker(inPr
|
|
|
50
46
|
|
|
51
47
|
return /*#__PURE__*/_jsx(MobileDatePicker, _extends({
|
|
52
48
|
ref: ref,
|
|
53
|
-
|
|
54
|
-
DialogProps: DialogProps,
|
|
55
|
-
okText: okText,
|
|
56
|
-
showTodayButton: showTodayButton,
|
|
57
|
-
todayText: todayText
|
|
49
|
+
DialogProps: DialogProps
|
|
58
50
|
}, other));
|
|
59
51
|
});
|
|
60
52
|
process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
@@ -69,12 +61,6 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
69
61
|
*/
|
|
70
62
|
acceptRegex: PropTypes.instanceOf(RegExp),
|
|
71
63
|
autoFocus: PropTypes.bool,
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Cancel text message.
|
|
75
|
-
* @default 'Cancel'
|
|
76
|
-
*/
|
|
77
|
-
cancelText: PropTypes.node,
|
|
78
64
|
children: PropTypes.node,
|
|
79
65
|
|
|
80
66
|
/**
|
|
@@ -82,35 +68,12 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
82
68
|
*/
|
|
83
69
|
className: PropTypes.string,
|
|
84
70
|
|
|
85
|
-
/**
|
|
86
|
-
* If `true`, it shows the clear action in the picker dialog.
|
|
87
|
-
* @default false
|
|
88
|
-
*/
|
|
89
|
-
clearable: PropTypes.bool,
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Clear text message.
|
|
93
|
-
* @default 'Clear'
|
|
94
|
-
*/
|
|
95
|
-
clearText: PropTypes.node,
|
|
96
|
-
|
|
97
71
|
/**
|
|
98
72
|
* If `true` the popup or dialog will immediately close after submitting full date.
|
|
99
73
|
* @default `true` for Desktop, `false` for Mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
|
|
100
74
|
*/
|
|
101
75
|
closeOnSelect: PropTypes.bool,
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* The components used for each slot.
|
|
105
|
-
* Either a string to use an HTML element or a component.
|
|
106
|
-
* @default {}
|
|
107
|
-
*/
|
|
108
76
|
components: PropTypes.object,
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* The props used for each slot inside.
|
|
112
|
-
* @default {}
|
|
113
|
-
*/
|
|
114
77
|
componentsProps: PropTypes.object,
|
|
115
78
|
|
|
116
79
|
/**
|
|
@@ -203,6 +166,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
203
166
|
|
|
204
167
|
/**
|
|
205
168
|
* Left arrow icon aria-label text.
|
|
169
|
+
* @deprecated
|
|
206
170
|
*/
|
|
207
171
|
leftArrowButtonText: PropTypes.string,
|
|
208
172
|
|
|
@@ -228,12 +192,6 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
228
192
|
*/
|
|
229
193
|
minDate: PropTypes.any,
|
|
230
194
|
|
|
231
|
-
/**
|
|
232
|
-
* Ok button text.
|
|
233
|
-
* @default 'OK'
|
|
234
|
-
*/
|
|
235
|
-
okText: PropTypes.node,
|
|
236
|
-
|
|
237
195
|
/**
|
|
238
196
|
* Callback fired when date is accepted @DateIOType.
|
|
239
197
|
* @template TValue
|
|
@@ -376,6 +334,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
376
334
|
|
|
377
335
|
/**
|
|
378
336
|
* Right arrow icon aria-label text.
|
|
337
|
+
* @deprecated
|
|
379
338
|
*/
|
|
380
339
|
rightArrowButtonText: PropTypes.string,
|
|
381
340
|
|
|
@@ -411,23 +370,11 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
411
370
|
*/
|
|
412
371
|
showDaysOutsideCurrentMonth: PropTypes.bool,
|
|
413
372
|
|
|
414
|
-
/**
|
|
415
|
-
* If `true`, the today button is displayed. **Note** that `showClearButton` has a higher priority.
|
|
416
|
-
* @default false
|
|
417
|
-
*/
|
|
418
|
-
showTodayButton: PropTypes.bool,
|
|
419
|
-
|
|
420
373
|
/**
|
|
421
374
|
* If `true`, show the toolbar even in desktop mode.
|
|
422
375
|
*/
|
|
423
376
|
showToolbar: PropTypes.bool,
|
|
424
377
|
|
|
425
|
-
/**
|
|
426
|
-
* Today text message.
|
|
427
|
-
* @default 'Today'
|
|
428
|
-
*/
|
|
429
|
-
todayText: PropTypes.node,
|
|
430
|
-
|
|
431
378
|
/**
|
|
432
379
|
* Component that will replace default toolbar renderer.
|
|
433
380
|
* @default DatePickerToolbar
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseToolbarProps } from '../internals/models/props/baseToolbarProps';
|
|
3
|
+
export declare const datePickerToolbarClasses: Record<"root" | "title", string>;
|
|
3
4
|
declare type DatePickerToolbarComponent = (<TDate>(props: BaseToolbarProps<TDate, TDate | null> & React.RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
4
5
|
propTypes?: any;
|
|
5
6
|
};
|
|
@@ -5,18 +5,26 @@ import * as React from 'react';
|
|
|
5
5
|
import Typography from '@mui/material/Typography';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
7
|
import { generateUtilityClasses } from '@mui/material';
|
|
8
|
-
import { PickersToolbar } from '../internals/components/PickersToolbar';
|
|
8
|
+
import { PickersToolbar, pickersToolbarClasses } from '../internals/components/PickersToolbar';
|
|
9
9
|
import { useUtils } from '../internals/hooks/useUtils';
|
|
10
10
|
import { isYearAndMonthViews, isYearOnlyView } from './shared';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
const
|
|
13
|
-
const DatePickerToolbarRoot = styled(PickersToolbar
|
|
14
|
-
|
|
12
|
+
export const datePickerToolbarClasses = generateUtilityClasses('MuiDatePickerToolbar', ['root', 'title']);
|
|
13
|
+
const DatePickerToolbarRoot = styled(PickersToolbar, {
|
|
14
|
+
name: 'MuiDatePickerToolbar',
|
|
15
|
+
slot: 'Root',
|
|
16
|
+
overridesResolver: (props, styles) => styles.root
|
|
17
|
+
})({
|
|
18
|
+
[`& .${pickersToolbarClasses.penIconButton}`]: {
|
|
15
19
|
position: 'relative',
|
|
16
20
|
top: 4
|
|
17
21
|
}
|
|
18
22
|
});
|
|
19
|
-
const DatePickerToolbarTitle = styled(Typography
|
|
23
|
+
const DatePickerToolbarTitle = styled(Typography, {
|
|
24
|
+
name: 'MuiDatePickerToolbar',
|
|
25
|
+
slot: 'Title',
|
|
26
|
+
overridesResolver: (props, styles) => styles.title
|
|
27
|
+
})(({
|
|
20
28
|
ownerState
|
|
21
29
|
}) => _extends({}, ownerState.isLandscape && {
|
|
22
30
|
margin: 'auto 16px auto auto'
|
|
@@ -68,13 +76,14 @@ export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePick
|
|
|
68
76
|
isMobileKeyboardViewOpen: isMobileKeyboardViewOpen,
|
|
69
77
|
toggleMobileKeyboardView: toggleMobileKeyboardView,
|
|
70
78
|
isLandscape: isLandscape,
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
ownerState: ownerState,
|
|
80
|
+
className: datePickerToolbarClasses.root
|
|
73
81
|
}, other, {
|
|
74
82
|
children: /*#__PURE__*/_jsx(DatePickerToolbarTitle, {
|
|
75
83
|
variant: "h4",
|
|
76
84
|
align: isLandscape ? 'left' : 'center',
|
|
77
85
|
ownerState: ownerState,
|
|
86
|
+
className: datePickerToolbarClasses.title,
|
|
78
87
|
children: dateText
|
|
79
88
|
})
|
|
80
89
|
}));
|