/** * Import react libraries. */ import React from 'react'; import '../styles/react-datepicker.css'; import { Testable } from '../types'; /** * Add custom types. */ export type DatepickerFieldProps = Testable & Omit, 'onChange' | 'value' | 'size' | 'onBlur'> & { /** Optional. Selected date. Defaults to current date */ value?: Date; /** Optional. Handler to be called when selected date was changed. */ onChange?: (date: Date) => void; /** Optional. Handler to be called when control is losing focus. */ onBlur?: (event: React.FocusEvent) => void; /** Optional. Quarter picker mode. If set, then user can not select a particular date, but quarter of the year. * 1st day of the quarter will be set as value. */ showQuarterYearPicker?: boolean; /** Optional. If set, then input field will be shown in 'invalid' state */ invalid?: boolean; /** Optional. Format in which date will be shown in the input field. Defaults to 'MMMM Do, yyyy'. * For quarter picker will be shown in 'YYYY, qqq' format. */ dateFormat?: string; /** Optional. Validation message to be shown under the input field */ validationMessage?: string; /** Optional. Value for 'autocomplete' attribute of input field tag. */ autoComplete?: string; /** Optional. Placeholder text to be shown when no value is selected. */ placeholder?: string; /** Optional. If set, then user will be able to open year selector by clicking on the month in the dropdown. */ yearPicker?: boolean; /** Optional. How many years before current year will be available in the year selector mode. */ yearsBeforeCurrentDate?: number; /** Optional. How many years after current year will be available in the year selector mode. */ yearsAfterCurrentDate?: number; /** Optional. Margin value to be set to the dropdown container. */ margin?: string; /** Optional. Position where to show tooltip in case of closed datepicker and value overflowing the input field. */ overflowTooltipPosition?: 'top' | 'bottom'; }; declare const DatepickerField: React.ForwardRefExoticComponent, "onBlur" | "onChange" | "size" | "value"> & { /** Optional. Selected date. Defaults to current date */ value?: Date; /** Optional. Handler to be called when selected date was changed. */ onChange?: (date: Date) => void; /** Optional. Handler to be called when control is losing focus. */ onBlur?: (event: React.FocusEvent) => void; /** Optional. Quarter picker mode. If set, then user can not select a particular date, but quarter of the year. * 1st day of the quarter will be set as value. */ showQuarterYearPicker?: boolean; /** Optional. If set, then input field will be shown in 'invalid' state */ invalid?: boolean; /** Optional. Format in which date will be shown in the input field. Defaults to 'MMMM Do, yyyy'. * For quarter picker will be shown in 'YYYY, qqq' format. */ dateFormat?: string; /** Optional. Validation message to be shown under the input field */ validationMessage?: string; /** Optional. Value for 'autocomplete' attribute of input field tag. */ autoComplete?: string; /** Optional. Placeholder text to be shown when no value is selected. */ placeholder?: string; /** Optional. If set, then user will be able to open year selector by clicking on the month in the dropdown. */ yearPicker?: boolean; /** Optional. How many years before current year will be available in the year selector mode. */ yearsBeforeCurrentDate?: number; /** Optional. How many years after current year will be available in the year selector mode. */ yearsAfterCurrentDate?: number; /** Optional. Margin value to be set to the dropdown container. */ margin?: string; /** Optional. Position where to show tooltip in case of closed datepicker and value overflowing the input field. */ overflowTooltipPosition?: "top" | "bottom"; } & React.RefAttributes>; export default DatepickerField;