From 27282999829ff17020ab8458fdd099e8ead52c7a Mon Sep 17 00:00:00 2001 From: Vincent D'amour Date: Mon, 23 Jul 2018 14:02:59 -0400 Subject: [PATCH] Add renderMonthElement to react-dates (#27345) --- types/react-dates/index.d.ts | 29 +++++++++++++++++++++++++---- types/react-dates/tslint.json | 5 +++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/types/react-dates/index.d.ts b/types/react-dates/index.d.ts index f69a3f0869..ac441c43cf 100644 --- a/types/react-dates/index.d.ts +++ b/types/react-dates/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-dates v16.7.0 +// Type definitions for react-dates v17.1.0 // Project: https://github.com/airbnb/react-dates // Definitions by: Artur Ampilogov // Nathan Holland @@ -65,7 +65,14 @@ declare namespace ReactDates { keepFocusOnInput?: boolean, // calendar presentation and interaction related props - renderMonth?: (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; + } + ) => string | JSX.Element, orientation?: OrientationShape, anchorDirection?: AnchorDirectionShape, openDirection?: OpenDirectionShape, @@ -164,7 +171,14 @@ declare namespace ReactDates { keepFocusOnInput?: boolean, // calendar presentation and interaction related props - renderMonth?: (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; + } + ) => string | JSX.Element, orientation?: OrientationShape, anchorDirection?: AnchorDirectionShape, horizontalMargin?: number, @@ -386,7 +400,14 @@ declare namespace ReactDates { // components/DayPickerShape.jsx interface DayPickerShape { - renderMonth?: (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; + } + ) => string | JSX.Element, enableOutsideDays?: boolean, numberOfMonths?: number, orientation?: ScrollableOrientationShape, diff --git a/types/react-dates/tslint.json b/types/react-dates/tslint.json index a41bf5d19a..01adabd8ca 100644 --- a/types/react-dates/tslint.json +++ b/types/react-dates/tslint.json @@ -10,6 +10,7 @@ "dt-header": false, "eofline": false, "export-just-namespace": false, + "file-name-casing": false, "import-spacing": false, "interface-name": false, "interface-over-type-literal": false, @@ -35,14 +36,15 @@ "no-namespace": false, "no-object-literal-type-assertion": false, "no-padding": false, - "no-redundant-jsdoc": false, "no-redundant-jsdoc-2": false, + "no-redundant-jsdoc": false, "no-redundant-undefined": false, "no-reference-import": false, "no-relative-import-in-test": false, "no-self-import": false, "no-single-declare-module": false, "no-string-throw": false, + "no-trailing-whitespace": false, "no-unnecessary-callback-wrapper": false, "no-unnecessary-class": false, "no-unnecessary-generics": false, @@ -52,7 +54,6 @@ "no-var-keyword": false, "no-var-requires": false, "no-void-expression": false, - "no-trailing-whitespace": false, "object-literal-key-quotes": false, "object-literal-shorthand": false, "one-line": false,