@trellixio/roaster-coffee
Version:
Beans' product component library
24 lines • 1.29 kB
TypeScript
import * as React from 'react';
import { CalendarProps } from './components';
import { TextFieldProps } from '../TextField';
import { DateSeparator, DateFormat, DatePickerInputError } from './utils/types';
export interface DatePickerProps extends Omit<CalendarProps, 'handleDateSelection' | 'year' | 'month'>, Omit<TextFieldProps, 'onChange' | 'defaultValue' | 'value' | 'onAbort' | 'ref'> {
/** The separator used for the date input fields. Defaults to '-' */
separator?: DateSeparator;
/** The format used as input mask. Defaults to 'YYYY MM DD' */
dateFormat?: DateFormat;
/** Callback function that will be called when an error occurs when parsing the date */
onInputError?(type: DatePickerInputError): string;
/** Callback function that will be called when the date is changed */
onChange?(date: Date): void;
/** Default value for uncontrolled input */
defaultValue?: Date | null;
/** Selected date, required with controlled input */
value?: Date | null;
/** The month to show, from 0 to 11. 0 is January, 1 is February ... 11 is December */
month?: number;
/** The year to show */
year?: number;
}
export declare function DatePicker(props: DatePickerProps): React.JSX.Element;
//# sourceMappingURL=DatePicker.d.ts.map