|
1 | 1 | import { useEffect, useMemo, useRef, useState } from 'react'; |
2 | 2 | import { TextInput } from '../TextInput'; |
3 | 3 | import { Button } from '../Button'; |
4 | | -import { Select, SelectList, SelectOption } from '../Select'; |
| 4 | +import { Select, SelectList, SelectOption, SelectProps } from '../Select'; |
5 | 5 | import { MenuToggle, MenuToggleElement } from '../MenuToggle'; |
6 | 6 | import { InputGroup, InputGroupItem } from '../InputGroup'; |
7 | 7 | import RhMicronsCaretLeftIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-left-icon'; |
@@ -81,6 +81,8 @@ export interface CalendarProps extends CalendarFormat, Omit<React.HTMLProps<HTML |
81 | 81 | onSelectToggle?: (open: boolean) => void; |
82 | 82 | /** Functions that returns if a date is valid and selectable. */ |
83 | 83 | validators?: ((date: Date) => boolean)[]; |
| 84 | + /** Additional props passed to the month select component. */ |
| 85 | + monthSelectProps?: SelectProps; |
84 | 86 | } |
85 | 87 |
|
86 | 88 | const buildCalendar = (year: number, month: number, weekStart: number, validators: ((date: Date) => boolean)[]) => { |
@@ -143,6 +145,7 @@ export const CalendarMonth = ({ |
143 | 145 | cellAriaLabel, |
144 | 146 | isDateFocused = false, |
145 | 147 | inlineProps, |
| 148 | + monthSelectProps, |
146 | 149 | ...props |
147 | 150 | }: CalendarProps) => { |
148 | 151 | const longMonths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] |
@@ -328,6 +331,7 @@ export const CalendarMonth = ({ |
328 | 331 | }} |
329 | 332 | selected={monthFormatted} |
330 | 333 | popperProps={{ appendTo: 'inline' }} |
| 334 | + {...monthSelectProps} |
331 | 335 | > |
332 | 336 | <SelectList> |
333 | 337 | {longMonths.map((longMonth, index) => ( |
|
0 commit comments