Skip to content

Commit 29c11c1

Browse files
authored
Merge pull request #7 from rvikunwar/new_version
New version
2 parents ac3bb11 + c23dc6a commit 29c11c1

File tree

6 files changed

+39
-40
lines changed

6 files changed

+39
-40
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-tags-js",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A flexible and customizable React component for tag selection.",
55
"source": "src/index.ts",
66
"main": "dist/index.cjs",

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)