|
1 |
| -import React, { FC } from 'react'; |
2 |
| -import { StyleProp, TextInputProps, TextStyle, ViewStyle, FlatListProps } from 'react-native'; |
| 1 | +import React, { FC } from "react"; |
| 2 | +import { |
| 3 | + StyleProp, |
| 4 | + TextInputProps, |
| 5 | + TextStyle, |
| 6 | + ViewStyle, |
| 7 | + FlatListProps, |
| 8 | +} from "react-native"; |
3 | 9 |
|
4 | 10 | export type TAutocompleteDropdownItem = {
|
5 | 11 | id: string;
|
@@ -35,35 +41,36 @@ interface AutocompleteDropdownProps {
|
35 | 41 | closeOnSubmit?: boolean;
|
36 | 42 | clearOnFocus?: boolean;
|
37 | 43 | debounce?: number;
|
38 |
| - direction?: 'down' | 'up'; |
39 |
| - position?: 'absolute' | 'relative'; |
| 44 | + direction?: "down" | "up"; |
| 45 | + position?: "absolute" | "relative"; |
40 | 46 | bottomOffset?: number;
|
41 | 47 | textInputProps?: TextInputProps;
|
42 | 48 | onChangeText?: (text: string) => void;
|
43 | 49 | onSelectItem?: (item: TAutocompleteDropdownItem) => void;
|
44 | 50 | renderItem?: (
|
45 | 51 | item: TAutocompleteDropdownItem,
|
46 |
| - searchText: string, |
| 52 | + searchText: string |
47 | 53 | ) => JSX.Element;
|
48 | 54 | onOpenSuggestionsList?: (isOpened: boolean) => void;
|
49 | 55 | onClear?: () => void;
|
50 | 56 | onChevronPress?: () => void;
|
51 |
| - onSubmit?: TextInputProps['onSubmitEditing']; |
52 |
| - onBlur?: TextInputProps['onBlur']; |
53 |
| - onFocus?: TextInputProps['onFocus']; |
| 57 | + onSubmit?: TextInputProps["onSubmitEditing"]; |
| 58 | + onBlur?: TextInputProps["onBlur"]; |
| 59 | + onFocus?: TextInputProps["onFocus"]; |
54 | 60 | controller?: (controller: AutocompleteDropdownRef) => void;
|
55 | 61 | containerStyle?: StyleProp<ViewStyle>;
|
56 | 62 | inputContainerStyle?: StyleProp<ViewStyle>;
|
57 | 63 | rightButtonsContainerStyle?: StyleProp<ViewStyle>;
|
58 | 64 | suggestionsListContainerStyle?: StyleProp<ViewStyle>;
|
59 | 65 | suggestionsListTextStyle?: StyleProp<TextStyle>;
|
60 | 66 | ChevronIconComponent?: JSX.Element;
|
| 67 | + RightIconComponent?: JSX.Element; |
61 | 68 | ClearIconComponent?: JSX.Element;
|
62 | 69 | InputComponent?: React.ComponentType;
|
63 | 70 | ItemSeparatorComponent?: JSX.Element;
|
64 | 71 | EmptyResultComponent?: JSX.Element;
|
65 | 72 | emptyResultText?: string;
|
66 |
| - flatListProps?: FlatListProps<any> |
| 73 | + flatListProps?: FlatListProps<any>; |
67 | 74 | }
|
68 | 75 |
|
69 | 76 | export const AutocompleteDropdown: FC<AutocompleteDropdownProps>;
|
0 commit comments