Skip to content

Commit 7c5118c

Browse files
committed
ts fix
1 parent 1cba2d1 commit 7c5118c

File tree

5 files changed

+38
-39
lines changed

5 files changed

+38
-39
lines changed

src/Close.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { tagValue } from './interface';
2+
import { tagValue } from './';
33

44
type onClear = (value: tagValue) => void;
55

src/ReactInputTags.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { ChangeEvent, FC, KeyboardEvent, useEffect, useRef, useState } from "react";
22
import Tag from "./Tag";
3-
import { ReactInputTagsProps, TagOptions, tagValue } from "./interface";
3+
import { ReactInputTagsProps, TagOptions, tagValue } from "./index";
44

55
export const ReactInputTags: FC<ReactInputTagsProps> = ({
66
tags,

src/Tag.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { TagInterface, tagValue } from "./interface";
2+
import { TagInterface, tagValue } from "./";
33
import Close from "./Close";
44

55
interface TagProps extends TagInterface {

src/index.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11
import { ReactInputTags } from './ReactInputTags';
22
import './style/index.css'
33

4+
export type tagValue = string | number;
5+
export type onChange = (tags: TagInterface[], tag?: TagInterface) => void;
6+
7+
export interface TagOptions {
8+
value: tagValue
9+
label: tagValue
10+
}
11+
12+
export interface TagInterface {
13+
value: tagValue
14+
label: tagValue
15+
tagColor?: string;
16+
textColor?: string;
17+
readOnly?: boolean;
18+
}
19+
20+
export interface StyleInterface {
21+
mainContainer?: string;
22+
tag?: string;
23+
input?: string;
24+
optionContainer?: string;
25+
option?: string;
26+
selectedOption?: string;
27+
}
28+
29+
export interface ReactInputTagsProps {
30+
tags: TagInterface[];
31+
onChange: onChange;
32+
options?: TagOptions[];
33+
creatable?: boolean;
34+
style?: StyleInterface;
35+
renderInput?: boolean;
36+
clearOnBackSpace? : boolean
37+
}
38+
439
export default ReactInputTags;

src/interface.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)