Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Commit

Permalink
Merge 64c8c56 into af34a67
Browse files Browse the repository at this point in the history
  • Loading branch information
pantharshit00 committed Oct 7, 2018
2 parents af34a67 + 64c8c56 commit 54eaa0a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "material-ui-chip-input",
"version": "1.0.0-beta.7",
"typings": "typings/index.d.ts",
"description": "A chip input field using Material-UI.",
"main": "lib/ChipInput.js",
"files": [
"lib/**/*.js",
"typings/*.d.ts",
"README.md",
"LICENSE",
"demo.gif"
Expand Down
52 changes: 52 additions & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import * as React from 'react';
import { FormHelperTextProps } from '@material-ui/core/FormHelperText'

export interface ChipRendererArgs {
value: string;
text: string;
chip: string;
isFocused: boolean;
isDisabled: boolean;
handleClick: React.EventHandler<any>;
handleDelete: React.EventHandler<any>;
className: string;
}

export type ChipRenderer = (
args: ChipRendererArgs,
key: number
) => React.ReactNode;

export interface Props {
allowDuplicates?: boolean;
blurBehavior?: 'clear' | 'add' | 'ignore';
chipRenderer?: ChipRenderer;
clearInputValueOnChange?: boolean;
dataSource?: any[];
dataSourceConfig?: {
text: string;
value: string;
};
defaultValue?: any[];
disabled?: boolean;
FormHelperTextProps?: FormHelperTextProps;
fullWidth?: boolean;
fullWidthInput?: boolean;
helperText?: React.ReactNode;
InputLabelProps?: object;
InputProps?: object;
inputRef?: (ref: React.Ref<HTMLInputElement>) => any;
label?: React.ReactNode;
newChipKeyCodes?: number[];
onAdd?: (chip: string) => any;
onBeforeAdd?: (chip: string) => boolean;
onChange?: (chips: string[]) => any;
onDelete?: (chip:string, index: number) => any;
onUpdateInput?: React.EventHandler<any>
placeholder?: string;
value?: any[];
error?: boolean;
}

declare const ChipInput: React.ComponentType<Props>;
export default ChipInput;

0 comments on commit 54eaa0a

Please sign in to comment.