Adding missing inputIconPosition to interface DateRangePickerShape --adjust code styling

This commit is contained in:
h.naoufal
2018-11-30 13:16:38 +01:00
parent 8324b632a3
commit fe68a448fb
+30 -80
View File
@@ -7,8 +7,8 @@
// Required fields are made according to 'minimum REQUIRED setup' in https://github.com/airbnb/react-dates/blob/master/README.md
import * as React from "react";
import * as moment from "moment";
import * as React from 'react';
import * as moment from 'moment';
export = ReactDates;
@@ -22,10 +22,10 @@ declare namespace ReactDates {
// SHAPES
//
// shapes/AnchorDirectionShape.js
type AnchorDirectionShape = "left" | "right";
type AnchorDirectionShape = 'left' | 'right';
// shapes/CalendarInfoPositionShape.js
type CalendarInfoPositionShape = "top" | "bottom" | "before" | "after";
type CalendarInfoPositionShape = 'top' | 'bottom' | 'before' | 'after';
// shapes/DateRangePickerShape.js
interface DateRangePickerShape {
@@ -71,20 +71,12 @@ declare namespace ReactDates {
keepFocusOnInput?: boolean;
// calendar presentation and interaction related props
renderMonthText?: (
day: momentPropTypes.momentObj
) => string | JSX.Element;
renderMonthText?: (day: momentPropTypes.momentObj) => string | JSX.Element;
renderMonthElement?: (
props: {
month: momentPropTypes.momentObj;
onMonthSelect: (
currentMonth: momentPropTypes.momentObj,
newMonthVal: string
) => void;
onYearSelect: (
currentMonth: momentPropTypes.momentObj,
newYearVal: string
) => void;
onMonthSelect: (currentMonth: momentPropTypes.momentObj, newMonthVal: string) => void;
onYearSelect: (currentMonth: momentPropTypes.momentObj, newYearVal: string) => void;
}
) => string | JSX.Element;
orientation?: OrientationShape;
@@ -116,12 +108,8 @@ declare namespace ReactDates {
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void;
// day presentation and interaction related props
renderCalendarDay?: (
day: momentPropTypes.momentObj
) => string | JSX.Element;
renderDayContents?: (
day: momentPropTypes.momentObj
) => string | JSX.Element;
renderCalendarDay?: (day: momentPropTypes.momentObj) => string | JSX.Element;
renderDayContents?: (day: momentPropTypes.momentObj) => string | JSX.Element;
minimumNights?: number;
enableOutsideDays?: boolean;
isDayBlocked?: (day: any) => boolean;
@@ -140,25 +128,22 @@ declare namespace ReactDates {
type DayOfWeekShape = 0 | 1 | 2 | 3 | 4 | 5 | 6;
// shapes/DisabledShape.js
type DisabledShape = boolean | "startDate" | "endDate";
type DisabledShape = boolean | 'startDate' | 'endDate';
// shapes/FocusedInputShape.js
type FocusedInputShape = "startDate" | "endDate";
type FocusedInputShape = 'startDate' | 'endDate';
// shape/IconPositionShape.js
type IconPositionShape = "before" | "after";
type IconPositionShape = 'before' | 'after';
// type/OpenDirectionShape.js
type OpenDirectionShape = "down" | "up";
type OpenDirectionShape = 'down' | 'up';
// shpae/OrientationShape.js
type OrientationShape = "horizontal" | "vertical";
type OrientationShape = 'horizontal' | 'vertical';
// shape/ScrollableOrientationShape.js
type ScrollableOrientationShape =
| "horizontal"
| "vertical"
| "verticalScrollable";
type ScrollableOrientationShape = 'horizontal' | 'vertical' | 'verticalScrollable';
// shapes/SingleDatePickerShape.js
interface SingleDatePickerShape {
@@ -190,20 +175,12 @@ declare namespace ReactDates {
keepFocusOnInput?: boolean;
// calendar presentation and interaction related props
renderMonthText?: (
day: momentPropTypes.momentObj
) => string | JSX.Element;
renderMonthText?: (day: momentPropTypes.momentObj) => string | JSX.Element;
renderMonthElement?: (
props: {
month: momentPropTypes.momentObj;
onMonthSelect: (
currentMonth: momentPropTypes.momentObj,
newMonthVal: string
) => void;
onYearSelect: (
currentMonth: momentPropTypes.momentObj,
newYearVal: string
) => void;
onMonthSelect: (currentMonth: momentPropTypes.momentObj, newMonthVal: string) => void;
onYearSelect: (currentMonth: momentPropTypes.momentObj, newYearVal: string) => void;
}
) => string | JSX.Element;
orientation?: OrientationShape;
@@ -240,12 +217,8 @@ declare namespace ReactDates {
) => void;
// day presentation and interaction related props
renderCalendarDay?: (
day: momentPropTypes.momentObj
) => string | JSX.Element;
renderDayContents?: (
day: momentPropTypes.momentObj
) => string | JSX.Element;
renderCalendarDay?: (day: momentPropTypes.momentObj) => string | JSX.Element;
renderDayContents?: (day: momentPropTypes.momentObj) => string | JSX.Element;
enableOutsideDays?: boolean;
isDayBlocked?: (day: any) => boolean;
isOutsideRange?: (day: any) => boolean;
@@ -438,29 +411,17 @@ declare namespace ReactDates {
isDayHighlighted?: (day: any) => boolean;
}
type DayPickerRangeController = React.ClassicComponentClass<
DayPickerRangeControllerShape
>;
var DayPickerRangeController: React.ClassicComponentClass<
DayPickerRangeControllerShape
>;
type DayPickerRangeController = React.ClassicComponentClass<DayPickerRangeControllerShape>;
var DayPickerRangeController: React.ClassicComponentClass<DayPickerRangeControllerShape>;
// components/DayPickerShape.jsx
interface DayPickerShape {
renderMonthText?: (
day: momentPropTypes.momentObj
) => string | JSX.Element;
renderMonthText?: (day: momentPropTypes.momentObj) => string | JSX.Element;
renderMonthElement?: (
props: {
month: momentPropTypes.momentObj;
onMonthSelect: (
currentMonth: momentPropTypes.momentObj,
newMonthVal: string
) => void;
onYearSelect: (
currentMonth: momentPropTypes.momentObj,
newYearVal: string
) => void;
onMonthSelect: (currentMonth: momentPropTypes.momentObj, newMonthVal: string) => void;
onYearSelect: (currentMonth: momentPropTypes.momentObj, newYearVal: string) => void;
}
) => string | JSX.Element;
enableOutsideDays?: boolean;
@@ -481,12 +442,8 @@ declare namespace ReactDates {
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void;
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void;
onOutsideClick?: (e: any) => void;
renderCalendarDay?: (
day: momentPropTypes.momentObj
) => string | JSX.Element;
renderDayContents?: (
day: momentPropTypes.momentObj
) => string | JSX.Element;
renderCalendarDay?: (day: momentPropTypes.momentObj) => string | JSX.Element;
renderDayContents?: (day: momentPropTypes.momentObj) => string | JSX.Element;
renderCalendarInfo?: () => string | JSX.Element;
calendarInfoPosition?: CalendarInfoPositionShape;
@@ -519,12 +476,8 @@ declare namespace ReactDates {
isDayHighlighted?: (day: any) => boolean;
}
type DayPickerSingleDateController = React.ClassicComponentClass<
DayPickerSingleDateControllerShape
>;
var DayPickerSingleDateController: React.ClassicComponentClass<
DayPickerSingleDateControllerShape
>;
type DayPickerSingleDateController = React.ClassicComponentClass<DayPickerSingleDateControllerShape>;
var DayPickerSingleDateController: React.ClassicComponentClass<DayPickerSingleDateControllerShape>;
// components/SingleDatePicker.js
type SingleDatePicker = React.ClassicComponentClass<SingleDatePickerShape>;
@@ -541,10 +494,7 @@ declare namespace ReactDates {
// utils/isSameDay.js
var isSameDay: (a: moment.Moment, b: moment.Moment) => boolean;
// utils/toISODateString.js
var toISODateString: (
date: moment.MomentInput,
currentFormat: moment.MomentFormatSpecification
) => string | null;
var toISODateString: (date: moment.MomentInput, currentFormat: moment.MomentFormatSpecification) => string | null;
// utils/toLocalizedDateString.js
var toLocalizedDateString: (
date: moment.MomentInput,