-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathtype.ts
More file actions
56 lines (50 loc) · 1.55 KB
/
type.ts
File metadata and controls
56 lines (50 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from "react";
export interface Option {
value: string;
label: string;
disabled?: boolean;
isSelected?: boolean;
}
export interface GroupOption {
label: string;
options: Option[];
}
export type Options = Array<Option | GroupOption>;
export interface ClassNames {
menuButton?: (value?: { isDisabled?: boolean }) => string;
menu?: string;
tagItem?: (value?: { item?: Option; isDisabled?: boolean }) => string;
tagItemText?: string;
tagItemIconContainer?: string;
tagItemIcon?: string;
list?: string;
listGroupLabel?: string;
listItem?: (value?: { isSelected?: boolean }) => string;
listDisabledItem?: string;
ChevronIcon?: (value?: { open?: boolean }) => string;
searchContainer?: string;
searchBox?: string;
searchIcon?: string;
closeIcon?: string;
}
export type SelectValue = Option | Option[] | null;
export interface SelectProps {
options: Options;
value: SelectValue;
onChange: (value: SelectValue) => void;
onSearchInputChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
placeholder?: string;
isMultiple?: boolean;
isClearable?: boolean;
isSearchable?: boolean;
isDisabled?: boolean;
loading?: boolean;
menuIsOpen?: boolean;
searchInputPlaceholder?: string;
noOptionsMessage?: string;
primaryColor: string;
formatGroupLabel?: ((data: GroupOption) => JSX.Element) | null;
formatOptionLabel?: ((data: Option) => JSX.Element) | null;
classNames?: ClassNames;
scrollableContainer?: HTMLElement | null;
}