-
Notifications
You must be signed in to change notification settings - Fork 210
Expand file tree
/
Copy pathmodel.ts
More file actions
73 lines (71 loc) · 2.13 KB
/
model.ts
File metadata and controls
73 lines (71 loc) · 2.13 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import type {
StyleProp,
TextStyle,
ViewStyle,
TextProps,
ImageStyle,
FlatListProps,
} from 'react-native';
export type IDropdownRef = {
open: () => void;
close: () => void;
};
export interface DropdownProps<T> {
ref?:
| React.RefObject<IDropdownRef>
| React.MutableRefObject<IDropdownRef>
| null
| undefined;
testID?: string;
itemTestIDField?: string;
style?: StyleProp<ViewStyle>;
containerStyle?: StyleProp<ViewStyle>;
placeholderStyle?: StyleProp<TextStyle>;
selectedTextStyle?: StyleProp<TextStyle>;
selectedTextProps?: TextProps;
itemContainerStyle?: StyleProp<ViewStyle>;
itemTextStyle?: StyleProp<TextStyle>;
inputSearchStyle?: StyleProp<TextStyle>;
iconStyle?: StyleProp<ImageStyle>;
maxHeight?: number;
minHeight?: number;
fontFamily?: string;
iconColor?: string;
activeColor?: string;
data: T[];
value?: T | string | null | undefined;
placeholder?: string;
labelField: keyof T;
valueField: keyof T;
searchField?: keyof T;
search?: boolean;
searchPlaceholder?: string;
disable?: boolean;
autoScroll?: boolean;
showsVerticalScrollIndicator?: boolean;
dropdownPosition?: 'auto' | 'top' | 'bottom';
flatListProps?: Omit<FlatListProps<any>, 'renderItem' | 'data'>;
keyboardAvoiding?: boolean;
backgroundColor?: string;
confirmSelectItem?: boolean;
accessibilityLabel?: string;
itemAccessibilityLabelField?: string;
inverted?: boolean;
mode?: 'default' | 'modal' | 'auto';
closeModalWhenSelectedItem?: boolean;
excludeItems?: T[];
excludeSearchItems?: T[];
selectedVal?: JSX.Element | null | undefined;
onChange: (item: T) => void;
renderLeftIcon?: (visible?: boolean) => JSX.Element | null | undefined;
renderRightIcon?: (visible?: boolean) => JSX.Element | null | undefined;
renderItem?: (item: T, selected?: boolean) => JSX.Element | null | undefined;
renderInputSearch?: (
onSearch: (text: string) => void
) => JSX.Element | null | undefined;
onFocus?: () => void;
onBlur?: () => void;
searchQuery?: (keyword: string, labelValue: string) => boolean;
onChangeText?: (search: string) => void;
onConfirmSelectItem?: (item: T) => void;
}