forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
react-input-calendar.d.ts
88 lines (87 loc) · 3.15 KB
/
react-input-calendar.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Type definitions for react-input-calendar
// Project: https://github.com/Rudeg/react-input-calendar
// Definitions by: Stepan Mikhaylyuk <https://github.com/stepancar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts"/>
declare namespace reactInputCalendar {
export interface ReactInputCalendarProps {
/**
* Format of date, which display in input and set in date property.
* Allowed Keys: All formats supported by moment.js
* @default 'MM-DD-YYYY'
*/
format?: string;
/**
* Set initial date value
* @default current date
*/
date?: string | Date;
/**
* Set the selectable minimum date
* @default null
*/
minDate?: string | Date;
/**
* Set the selectable maximum date
* @default null
*/
maxDate?: string | Date;
/**
* Set minimal view. Values:
* 0 - days
* 1 - months
* 2 - years.
* @default 0 (DaysView)
*/
minView?: number;
/**
* Format of date for the onChange event. Default on the date format (ISO 8601) to ease the save of data.
* Allowed Keys: All formats supported by moment.js
* @default 'MM-DD-YYYY'
*/
computableFormat?: string;
/**
* Set a function that will be triggered whenever there is a change in the selected date. It will return the date in the props.computableFormat format.
*/
onChange?: (computableDate: string) => void;
/**
* Set a function that will be triggered the when input field is blurred. It will return the event and the date in the props.computableFormat format.
*/
onBlur?: (event: __React.SyntheticEvent, computableDate: string) => void;
/**
* Set a function that will be triggered when the input field is focused.
*/
onFocus?: (event: __React.SyntheticEvent) => void;
/**
* Define state when date picker would close once the user has clicked on a date.
*/
closeOnSelect?: boolean;
/**
* Setting this value to true makes the calendar widget open when the iput field is focused.
*/
openOnInputFocus?: boolean;
/**
* Value to show in the input text box if no date is set.
*/
placeholder?: string;
/**
* Id that should be applied to the input field. Useful when using it with a label element.
*/
inputFieldId?: string;
/**
* Define the class name of the input field where the date picker represents its value.
*/
inputFieldClass?: string;
/**
* If true, the input field gets disabled and the icon next to it disappears.
*/
disabled?: boolean;
}
interface ReactInputCalendarState { }
export class ReactInputCalendar extends __React.Component<ReactInputCalendarProps, ReactInputCalendarState> {
}
}
declare var ReactInputCalendar: typeof reactInputCalendar.ReactInputCalendar
declare module "react-input-calendar" {
export = ReactInputCalendar;
}