import React, { Component, cloneElement } from "react"; import Calendar from "./calendar"; import CalendarIcon from "./calendar_icon"; import { registerLocale, setDefaultLocale, getDefaultLocale, type HighlightDate, type HolidayItem } from "./date_utils"; import PopperComponent from "./popper_component"; import Portal from "./portal"; import type { ClickOutsideHandler } from "./click_outside_wrapper"; export { default as CalendarContainer } from "./calendar_container"; export { registerLocale, setDefaultLocale, getDefaultLocale }; export { ReactDatePickerCustomHeaderProps } from "./calendar"; interface Holiday { date: string; holidayName: string; } type CalendarProps = React.ComponentPropsWithoutRef; interface CalendarIconProps extends React.ComponentPropsWithoutRef { } interface PortalProps extends React.ComponentPropsWithoutRef { } interface PopperComponentProps extends React.ComponentPropsWithoutRef { } type OmitUnion = T extends any ? Omit : never; export type DatePickerProps = OmitUnion & Pick & OmitUnion & OmitUnion & { dateFormatCalendar?: CalendarProps["dateFormat"]; calendarClassName?: CalendarProps["className"]; calendarContainer?: CalendarProps["container"]; dropdownMode?: CalendarProps["dropdownMode"]; onKeyDown?: (event: React.KeyboardEvent) => void; popperClassName?: PopperComponentProps["className"]; showPopperArrow?: PopperComponentProps["showArrow"]; open?: boolean; disabled?: boolean; readOnly?: boolean; startOpen?: boolean; onFocus?: React.FocusEventHandler; onBlur?: React.FocusEventHandler; onClickOutside?: ClickOutsideHandler; onInputClick?: VoidFunction; preventOpenOnFocus?: boolean; closeOnScroll?: boolean | ((event: Event) => boolean); isClearable?: boolean; clearButtonTitle?: string; clearButtonClassName?: string; ariaLabelClose?: string; className?: string; customInput?: Parameters[0]; dateFormat?: string | string[]; showDateSelect?: boolean; highlightDates?: (Date | HighlightDate)[]; onCalendarOpen?: VoidFunction; onCalendarClose?: VoidFunction; strictParsing?: boolean; swapRange?: boolean; onInputError?: (error: { code: 1; msg: string; }) => void; allowSameDay?: boolean; withPortal?: boolean; focusSelectedMonth?: boolean; showIcon?: boolean; calendarIconClassname?: never; calendarIconClassName?: string; toggleCalendarOnIconClick?: boolean; holidays?: Holiday[]; startDate?: Date; selected?: Date | null; value?: string; customInputRef?: string; id?: string; name?: string; form?: string; autoFocus?: boolean; placeholderText?: string; autoComplete?: string; title?: string; required?: boolean; tabIndex?: number; ariaDescribedBy?: string; ariaInvalid?: string; ariaLabelledBy?: string; ariaRequired?: string; onChangeRaw?: (event?: React.MouseEvent | React.KeyboardEvent) => void; onSelect?: (date: Date | null, event?: React.MouseEvent | React.KeyboardEvent) => void; } & ({ selectsRange?: never; selectsMultiple?: never; onChange?: (date: Date | null, event?: React.MouseEvent | React.KeyboardEvent) => void; } | { selectsRange: true; selectsMultiple?: never; onChange?: (date: [Date | null, Date | null], event?: React.MouseEvent | React.KeyboardEvent) => void; } | { selectsRange?: never; selectsMultiple: true; onChange?: (date: Date[] | null, event?: React.MouseEvent | React.KeyboardEvent) => void; }); interface DatePickerState { open: boolean; wasHidden: boolean; lastPreSelectChange?: typeof PRESELECT_CHANGE_VIA_INPUT | typeof PRESELECT_CHANGE_VIA_NAVIGATE; inputValue: string | null; preventFocus: boolean; preSelection?: CalendarProps["preSelection"]; shouldFocusDayInline?: CalendarProps["shouldFocusDayInline"]; monthSelectedIn?: CalendarProps["monthSelectedIn"]; focused?: CalendarProps["isInputFocused"]; highlightDates: Required["highlightDates"]; isRenderAriaLiveMessage?: boolean; } export default class DatePicker extends Component { static get defaultProps(): { allowSameDay: boolean; dateFormat: string; dateFormatCalendar: string; disabled: boolean; disabledKeyboardNavigation: boolean; dropdownMode: "scroll"; preventOpenOnFocus: boolean; monthsShown: number; readOnly: boolean; withPortal: boolean; selectsDisabledDaysInRange: boolean; shouldCloseOnSelect: boolean; showTimeSelect: boolean; showTimeInput: boolean; showPreviousMonths: boolean; showMonthYearPicker: boolean; showFullMonthYearPicker: boolean; showTwoColumnMonthYearPicker: boolean; showFourColumnMonthYearPicker: boolean; showYearPicker: boolean; showQuarterYearPicker: boolean; showWeekPicker: boolean; strictParsing: boolean; swapRange: boolean; timeIntervals: number; timeCaption: string; previousMonthAriaLabel: string; previousMonthButtonLabel: string; nextMonthAriaLabel: string; nextMonthButtonLabel: string; previousYearAriaLabel: string; previousYearButtonLabel: string; nextYearAriaLabel: string; nextYearButtonLabel: string; timeInputLabel: string; enableTabLoop: boolean; yearItemNumber: number; focusSelectedMonth: boolean; showPopperArrow: boolean; excludeScrollbar: boolean; customTimeInput: null; calendarStartDay: undefined; toggleCalendarOnIconClick: boolean; usePointerEvent: boolean; }; constructor(props: DatePickerProps); componentDidMount(): void; componentDidUpdate(prevProps: DatePickerProps, prevState: DatePickerState): void; componentWillUnmount(): void; preventFocusTimeout: ReturnType | undefined; inputFocusTimeout: ReturnType | undefined; calendar: Calendar | null; input: HTMLElement | null; getPreSelection: () => Date; modifyHolidays: () => HolidayItem[] | undefined; calcInitialState: () => DatePickerState; resetHiddenStatus: () => void; setHiddenStatus: () => void; setHiddenStateOnVisibilityHidden: () => void; clearPreventFocusTimeout: () => void; setFocus: () => void; setBlur: () => void; setOpen: (open: boolean, skipSetBlur?: boolean) => void; inputOk: () => boolean; isCalendarOpen: () => boolean; handleFocus: (event: React.FocusEvent) => void; sendFocusBackToInput: () => void; cancelFocusInput: () => void; deferFocusInput: () => void; handleDropdownFocus: () => void; handleBlur: (event: React.FocusEvent) => void; handleCalendarClickOutside: (event: MouseEvent) => void; handleChange: (event?: React.MouseEvent | React.KeyboardEvent | undefined) => void; handleSelect: (date: Date, event?: React.MouseEvent | React.KeyboardEvent, monthSelectedIn?: number) => void; setSelected: (date: Date | null, event?: React.MouseEvent | React.KeyboardEvent, keepInput?: boolean, monthSelectedIn?: number) => void; setPreSelection: (date?: Date | null) => void; toggleCalendar: () => void; handleTimeChange: (time: Date) => void; onInputClick: () => void; onInputKeyDown: (event: React.KeyboardEvent) => void; onPortalKeyDown: (event: React.KeyboardEvent) => void; onDayKeyDown: (event: React.KeyboardEvent) => void; onPopperKeyDown: (event: React.KeyboardEvent) => void; onClearClick: (event?: React.MouseEvent) => void; clear: () => void; onScroll: (event: Event) => void; renderCalendar: () => React.JSX.Element | null; renderAriaLiveRegion: () => React.JSX.Element; renderDateInput: () => React.FunctionComponentElement; renderClearButton: () => JSX.Element | null; renderInputContainer(): JSX.Element; render(): JSX.Element | null; } declare const PRESELECT_CHANGE_VIA_INPUT = "input"; declare const PRESELECT_CHANGE_VIA_NAVIGATE = "navigate";