UNPKG

@massds/mayflower-react

Version:

React versions of Mayflower design system UI components

38 lines (37 loc) 1.53 kB
/** * InputDate module. * @module @massds/mayflower-react/InputDate * @requires module:pikaday/scss/pikaday * @requires module:@massds/mayflower-assets/scss/00-base/pikaday * @requires module:@massds/mayflower-assets/scss/01-atoms/input-date */ import React from 'react'; export interface InputDateProps { /** The label text above the input field */ labelText: string; /** Whether an input date is required or not */ required?: boolean; /** The id on the input date element */ id: string; /** The name of the input date element */ name: string; /** The placeholder text in the input box, prompting users for a value */ placeholder?: string; /** Controls whether the user can pick any date (''), today and prior ('max') or today and future ('min') */ restrict?: "" | "max" | "min"; /** Controls the date format of input date . The current option are: 'M/DD/YYYY’, 'MM/DD/YYYY’', 'MMM D YYYY', or 'dddd, MMMM Do YYYY' */ format?: "M/DD/YYYY" | "MM/DD/YYYY" | "MM-DD-YYYY" | "YYYYMMDD"; /** Custom onChange function that receives the selected date input */ onChangeCallback?(...args: unknown[]): unknown; /** The date to set by default */ defaultDate?: Date; } declare class InputDate extends React.Component<InputDateProps> { constructor(props: any); componentDidMount(): void; UNSAFE_componentWillReceiveProps(nextProps: any): void; handleChange(date: any): void; startPikaday(): void; render(): any; } export default InputDate;