From d040016b4b5ac9a1f46a88b737e641237fbb52ff Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Tue, 13 Oct 2015 20:24:27 +0300 Subject: [PATCH 1/6] react input calendar definitions --- .../react-input-calendar.d.ts | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 react-input-calendar/react-input-calendar.d.ts diff --git a/react-input-calendar/react-input-calendar.d.ts b/react-input-calendar/react-input-calendar.d.ts new file mode 100644 index 000000000..ac829c215 --- /dev/null +++ b/react-input-calendar/react-input-calendar.d.ts @@ -0,0 +1,53 @@ +declare module 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 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 an 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?:(selectedDate: string)=>any; + /** + * 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 + } + interface ReactInputCalendarState { } + export class ReactInputCalendar extends __React.Component{ + render(): __React.DOMElement + } +} +declare var ReactInputCalendar: typeof reactInputCalendar.ReactInputCalendar +declare module "react-input-calendar" { + export = ReactInputCalendar +} From 834544350ce56c30de51750ca3f5a824b017217e Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Tue, 13 Oct 2015 20:28:09 +0300 Subject: [PATCH 2/6] Create react-input-calendar-tests.ts --- react-input-calendar/react-input-calendar-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 react-input-calendar/react-input-calendar-tests.ts diff --git a/react-input-calendar/react-input-calendar-tests.ts b/react-input-calendar/react-input-calendar-tests.ts new file mode 100644 index 000000000..599c8533c --- /dev/null +++ b/react-input-calendar/react-input-calendar-tests.ts @@ -0,0 +1,4 @@ +/// +/// + +var reactInp = new ReactInputCalendar(); From 16d56c547cd34ba987c4b46b043ee4c07573ee22 Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Tue, 13 Oct 2015 20:30:07 +0300 Subject: [PATCH 3/6] Update react-input-calendar.d.ts --- react-input-calendar/react-input-calendar.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/react-input-calendar/react-input-calendar.d.ts b/react-input-calendar/react-input-calendar.d.ts index ac829c215..d8c518b83 100644 --- a/react-input-calendar/react-input-calendar.d.ts +++ b/react-input-calendar/react-input-calendar.d.ts @@ -1,3 +1,9 @@ +// Type definitions for react-input-calendar +// Project: https://github.com/Rudeg/react-input-calendar +// Definitions by: Stepan Mikhaylyuk +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// declare module reactInputCalendar { export interface ReactInputCalendarProps { /** From 67db10d0fed736652de0ddf8014031680b0ab737 Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Tue, 13 Oct 2015 20:34:10 +0300 Subject: [PATCH 4/6] Rename react-input-calendar-tests.ts to react-input-calendar-tests.tsx --- ...act-input-calendar-tests.ts => react-input-calendar-tests.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename react-input-calendar/{react-input-calendar-tests.ts => react-input-calendar-tests.tsx} (100%) diff --git a/react-input-calendar/react-input-calendar-tests.ts b/react-input-calendar/react-input-calendar-tests.tsx similarity index 100% rename from react-input-calendar/react-input-calendar-tests.ts rename to react-input-calendar/react-input-calendar-tests.tsx From 77957b603121f6ce6f11b26754dcaf9dbadfa56b Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Tue, 13 Oct 2015 20:35:03 +0300 Subject: [PATCH 5/6] Create react-input-calendar-tests.tsx.tscparams --- react-input-calendar/react-input-calendar-tests.tsx.tscparams | 1 + 1 file changed, 1 insertion(+) create mode 100644 react-input-calendar/react-input-calendar-tests.tsx.tscparams diff --git a/react-input-calendar/react-input-calendar-tests.tsx.tscparams b/react-input-calendar/react-input-calendar-tests.tsx.tscparams new file mode 100644 index 000000000..c90abf04f --- /dev/null +++ b/react-input-calendar/react-input-calendar-tests.tsx.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny --experimentalDecorators --jsx react From 4961cbc4415fda43d32a946881bad4f106ec880d Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Tue, 13 Oct 2015 20:37:15 +0300 Subject: [PATCH 6/6] Update react-input-calendar-tests.tsx --- react-input-calendar/react-input-calendar-tests.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react-input-calendar/react-input-calendar-tests.tsx b/react-input-calendar/react-input-calendar-tests.tsx index 599c8533c..127106424 100644 --- a/react-input-calendar/react-input-calendar-tests.tsx +++ b/react-input-calendar/react-input-calendar-tests.tsx @@ -1,4 +1,6 @@ /// /// -var reactInp = new ReactInputCalendar(); +import * as ReactInputCalendar from 'react-input-calendar'; +import * as React from 'react'; +React.render(, document.body);