From 51a4747a28d6518ca5f6d92d3547e1d77a5354e6 Mon Sep 17 00:00:00 2001 From: Jan Karres Date: Fri, 7 Jul 2017 17:17:52 +0200 Subject: [PATCH 1/4] Update react-tag-input for v4.7.2 --- types/react-tag-input/index.d.ts | 29 +++++++++++++++---- .../react-tag-input/react-tag-input-tests.tsx | 26 +++++++++++++++-- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/types/react-tag-input/index.d.ts b/types/react-tag-input/index.d.ts index 626b44acac..415a2ef2aa 100644 --- a/types/react-tag-input/index.d.ts +++ b/types/react-tag-input/index.d.ts @@ -1,18 +1,35 @@ -// Type definitions for React-Tags (react-tag-input) 4.7 +// Type definitions for React-Tags (react-tag-input) 4.7.2 // Project: https://github.com/prakhar1989/react-tags -// Definitions by: Ogglas +// Definitions by: Ogglas , Jan Karres // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as React from "react"; export interface ReactTagsProps { - tags?: Array<{id: number, text: string }>; + tags?: Array<{ id: number, text: string }>; suggestions?: string[]; - handleDelete: ((i: number) => void); - handleAddition: ((tag: string) => void); - handleDrag?: ((tag: { id: number; text: string; }, currPos: number, newPos: number) => void); + delimiters?: number[]; placeholder?: string; + labelField?: string; + + handleAddition: (tag: string) => void; + handleDelete: (i: number) => void; + handleDrag?: (tag: { id: number; text: string; }, currPos: number, newPos: number) => void; + handleInputChange?: (value: string) => void; + handleFilterSuggestions?: (textInputValue: string, possibleSuggestionsArray: string[]) => boolean; + handleInputBlur?: () => void; + + autofocus?: boolean; + allowDeleteFromEmptyInput?: boolean; + minQueryLength?: number; + removeComponent?: React.Component; + autocomplete?: boolean | 1; + readOnly?: boolean; + maxLength?: number; + + name?: string; + id?: string; } export class WithContext extends React.Component { } diff --git a/types/react-tag-input/react-tag-input-tests.tsx b/types/react-tag-input/react-tag-input-tests.tsx index a78bced3b9..42a9f6df97 100644 --- a/types/react-tag-input/react-tag-input-tests.tsx +++ b/types/react-tag-input/react-tag-input-tests.tsx @@ -7,10 +7,30 @@ let tags = Array({ id: 0, text: "test" }, { id: 1, text: "testing" }); let suggestions = Array("test1", "test2"); ReactDOM.render( - console.log("Delete: " + i)} + delimiters={[13, 8, 188]} // Enter, Tab and Comma + placeholder="Some placeholder text" + labelField="Some label" + handleAddition={(tag: string) => console.log("Add: " + tag)} - handleDrag={(tag: { id: number; text: string; }, currPos: number, newPos: number) => console.log("Drag: " + tag.text)} />, + handleDelete={(i: number) => console.log("Delete: " + i)} + handleDrag={(tag: { id: number; text: string; }, currPos: number, newPos: number) => console.log("Drag: " + tag.text)} + handleInputChange={(value) => console.log("Changed to: ", value)} + handleFilterSuggestions={(textInputValue, possibleSuggestionsArray) => true} + handleInputBlur={() => console.log("Blured")} + + autofocus={false} + allowDeleteFromEmptyInput={false} + minQueryLength={0} + removeComponent={null} + autocomplete={true} + readOnly={false} + maxLength={64} + + name="react-tags-field" + id="react-tags-field" + />, document.getElementById("app") ); From f0e31c622a5b407ae4ac7322b4d354eaca8cf872 Mon Sep 17 00:00:00 2001 From: Jan Karres Date: Fri, 7 Jul 2017 17:27:00 +0200 Subject: [PATCH 2/4] Update react-tag-input for v4.7.2 bugfix --- types/react-tag-input/index.d.ts | 14 +++++++------- types/react-tag-input/react-tag-input-tests.tsx | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/types/react-tag-input/index.d.ts b/types/react-tag-input/index.d.ts index 415a2ef2aa..64e24188a5 100644 --- a/types/react-tag-input/index.d.ts +++ b/types/react-tag-input/index.d.ts @@ -13,17 +13,17 @@ export interface ReactTagsProps { placeholder?: string; labelField?: string; - handleAddition: (tag: string) => void; - handleDelete: (i: number) => void; - handleDrag?: (tag: { id: number; text: string; }, currPos: number, newPos: number) => void; - handleInputChange?: (value: string) => void; - handleFilterSuggestions?: (textInputValue: string, possibleSuggestionsArray: string[]) => boolean; - handleInputBlur?: () => void; + handleAddition: ((tag: string) => void); + handleDelete: ((i: number) => void); + handleDrag?: ((tag: { id: number; text: string; }, currPos: number, newPos: number) => void); + handleInputChange?: ((value: string) => void); + handleFilterSuggestions?: ((textInputValue: string, possibleSuggestionsArray: string[]) => boolean); + handleInputBlur?: (() => void); autofocus?: boolean; allowDeleteFromEmptyInput?: boolean; minQueryLength?: number; - removeComponent?: React.Component; + removeComponent?: React.Component; autocomplete?: boolean | 1; readOnly?: boolean; maxLength?: number; diff --git a/types/react-tag-input/react-tag-input-tests.tsx b/types/react-tag-input/react-tag-input-tests.tsx index 42a9f6df97..d7029288d8 100644 --- a/types/react-tag-input/react-tag-input-tests.tsx +++ b/types/react-tag-input/react-tag-input-tests.tsx @@ -17,8 +17,8 @@ ReactDOM.render( handleAddition={(tag: string) => console.log("Add: " + tag)} handleDelete={(i: number) => console.log("Delete: " + i)} handleDrag={(tag: { id: number; text: string; }, currPos: number, newPos: number) => console.log("Drag: " + tag.text)} - handleInputChange={(value) => console.log("Changed to: ", value)} - handleFilterSuggestions={(textInputValue, possibleSuggestionsArray) => true} + handleInputChange={(value: string) => console.log("Changed to: ", value)} + handleFilterSuggestions={(textInputValue: string, possibleSuggestionsArray: string[]) => true} handleInputBlur={() => console.log("Blured")} autofocus={false} From ae024825f1ede860eff9514201b9fe07a831244d Mon Sep 17 00:00:00 2001 From: Jan Karres Date: Fri, 7 Jul 2017 17:40:03 +0200 Subject: [PATCH 3/4] Bugfix --- types/react-tag-input/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-tag-input/index.d.ts b/types/react-tag-input/index.d.ts index 64e24188a5..2720520766 100644 --- a/types/react-tag-input/index.d.ts +++ b/types/react-tag-input/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for React-Tags (react-tag-input) 4.7.2 // Project: https://github.com/prakhar1989/react-tags -// Definitions by: Ogglas , Jan Karres +// Definitions by: Ogglas +// Jan Karres // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From d8e69d70f2ffa4d5cd9b343c954b9cee904cb649 Mon Sep 17 00:00:00 2001 From: Jan Karres Date: Sat, 8 Jul 2017 15:20:41 +0200 Subject: [PATCH 4/4] Bugfix --- types/react-tag-input/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/react-tag-input/index.d.ts b/types/react-tag-input/index.d.ts index 2720520766..1ab94f7f89 100644 --- a/types/react-tag-input/index.d.ts +++ b/types/react-tag-input/index.d.ts @@ -1,9 +1,8 @@ -// Type definitions for React-Tags (react-tag-input) 4.7.2 +// Type definitions for React-Tags (react-tag-input) 4.7 // Project: https://github.com/prakhar1989/react-tags // Definitions by: Ogglas // Jan Karres // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 import * as React from "react";