@@ -10,7 +10,7 @@ import { useUtils } from '../internal/pickers/hooks/useUtils';
10
10
import FadeTransitionGroup from './PickersFadeTransitionGroup' ;
11
11
import { DateValidationProps } from '../internal/pickers/date-utils' ;
12
12
// tslint:disable-next-line no-relative-import-in-test
13
- import ArrowDropDownIcon from '../internal/svg-icons/ArrowDropDown ' ;
13
+ import ArrowDropDownIcon from '../internal/svg-icons/ArrowLeft ' ;
14
14
import ArrowSwitcher , {
15
15
ExportedArrowSwitcherProps ,
16
16
} from '../internal/pickers/PickersArrowSwitcher' ;
@@ -20,6 +20,10 @@ import {
20
20
} from '../internal/pickers/hooks/date-helpers-hooks' ;
21
21
import { DatePickerView } from '../internal/pickers/typings/Views' ;
22
22
23
+ export interface ComponentsProps {
24
+ headerDropdownIcon ?: React . ReactNode ;
25
+ }
26
+
23
27
export type ExportedCalendarHeaderProps < TDate > = Pick <
24
28
PickersCalendarHeaderProps < TDate > ,
25
29
| 'leftArrowIcon'
@@ -37,6 +41,7 @@ export interface PickersCalendarHeaderProps<TDate>
37
41
openView : DatePickerView ;
38
42
views : DatePickerView [ ] ;
39
43
currentMonth : TDate ;
44
+ components ?: ComponentsProps ;
40
45
/**
41
46
* Get aria-label text for switching between views button.
42
47
*/
@@ -103,6 +108,7 @@ function PickersCalendarHeader<TDate>(
103
108
onViewChange,
104
109
classes,
105
110
currentMonth : month ,
111
+ components = { } ,
106
112
disableFuture,
107
113
disablePast,
108
114
getViewSwitchingButtonText = getSwitchingViewAriaText ,
@@ -142,6 +148,8 @@ function PickersCalendarHeader<TDate>(
142
148
}
143
149
} ;
144
150
151
+ const { headerDropdownIcon } = components ;
152
+
145
153
return (
146
154
< React . Fragment >
147
155
< div className = { classes . root } >
@@ -181,11 +189,13 @@ function PickersCalendarHeader<TDate>(
181
189
className = { classes . yearSelectionSwitcher }
182
190
aria-label = { getViewSwitchingButtonText ( currentView ) }
183
191
>
184
- < ArrowDropDownIcon
185
- className = { clsx ( classes . switchViewDropdown , {
186
- [ classes . switchViewDropdownDown ] : currentView === 'year' ,
187
- } ) }
188
- />
192
+ { headerDropdownIcon || (
193
+ < ArrowDropDownIcon
194
+ className = { clsx ( classes . switchViewDropdown , {
195
+ [ classes . switchViewDropdownDown ] : currentView === 'year' ,
196
+ } ) }
197
+ />
198
+ ) }
189
199
</ IconButton >
190
200
) }
191
201
</ div >
0 commit comments