1 | import React from 'react';
|
2 | import IOSSearchBar, { SearchBarIosProps } from './SearchBar-ios';
|
3 | import { SearchBarAndroidProps } from './SearchBar-android';
|
4 | import { SearchBarDefaultProps } from './SearchBar-default';
|
5 | import { ActivityIndicatorProps, StyleProp, TextStyle, ViewStyle, TextInput } from 'react-native';
|
6 | import { IconNode } from '../icons/Icon';
|
7 | import { ThemeProps } from '../config';
|
8 | export declare type SearchBarBaseProps = React.ComponentPropsWithRef<typeof TextInput> & {
|
9 | platform: 'default' | 'ios' | 'android';
|
10 | containerStyle?: StyleProp<ViewStyle>;
|
11 | inputContainerStyle?: StyleProp<ViewStyle>;
|
12 | clearIcon?: IconNode;
|
13 | searchIcon?: IconNode;
|
14 | inputStyle?: StyleProp<TextStyle>;
|
15 | loadingProps?: ActivityIndicatorProps;
|
16 | showLoading?: boolean;
|
17 | leftIconContainerStyle?: StyleProp<ViewStyle>;
|
18 | rightIconContainerStyle?: StyleProp<ViewStyle>;
|
19 | onClear?(): void;
|
20 | onFocus?(): void;
|
21 | onBlur?(): void;
|
22 | onChangeText?(text: string): void;
|
23 | onCancel?(): void;
|
24 | };
|
25 | export declare type SearchBarProps = SearchBarBaseProps & SearchBarDefaultProps & SearchBarAndroidProps & SearchBarIosProps;
|
26 | declare class SearchBar extends React.Component<SearchBarProps & Partial<ThemeProps<SearchBarProps>>> {
|
27 | searchbar: IOSSearchBar;
|
28 | static defaultProps: {
|
29 | platform: "default";
|
30 | };
|
31 | focus: () => void;
|
32 | blur: () => void;
|
33 | clear: () => void;
|
34 | cancel: () => void;
|
35 | render(): JSX.Element;
|
36 | }
|
37 | export { SearchBar };
|
38 | declare const _default: React.FunctionComponent<Omit<import("react-native").TextInputProps & React.RefAttributes<TextInput> & {
|
39 | platform: "ios" | "android" | "default";
|
40 | containerStyle?: StyleProp<ViewStyle>;
|
41 | inputContainerStyle?: StyleProp<ViewStyle>;
|
42 | clearIcon?: IconNode;
|
43 | searchIcon?: IconNode;
|
44 | inputStyle?: StyleProp<TextStyle>;
|
45 | loadingProps?: ActivityIndicatorProps;
|
46 | showLoading?: boolean;
|
47 | leftIconContainerStyle?: StyleProp<ViewStyle>;
|
48 | rightIconContainerStyle?: StyleProp<ViewStyle>;
|
49 | onClear?(): void;
|
50 | onFocus?(): void;
|
51 | onBlur?(): void;
|
52 | onChangeText?(text: string): void;
|
53 | onCancel?(): void;
|
54 | } & {
|
55 | value: string;
|
56 | loadingProps: {};
|
57 | showLoading: boolean;
|
58 | lightTheme: boolean;
|
59 | round: boolean;
|
60 | onClear: () => any;
|
61 | onFocus: () => any;
|
62 | onBlur: () => any;
|
63 | onChangeText: () => any;
|
64 | } & {
|
65 | containerStyle?: StyleProp<ViewStyle>;
|
66 | disabled?: boolean;
|
67 | disabledInputStyle?: StyleProp<TextStyle>;
|
68 | inputContainerStyle?: StyleProp<ViewStyle>;
|
69 | leftIcon?: IconNode;
|
70 | leftIconContainerStyle?: StyleProp<ViewStyle>;
|
71 | rightIcon?: IconNode;
|
72 | rightIconContainerStyle?: StyleProp<ViewStyle>;
|
73 | inputStyle?: StyleProp<TextStyle>;
|
74 | InputComponent?: typeof React.Component;
|
75 | errorProps?: object;
|
76 | errorStyle?: StyleProp<TextStyle>;
|
77 | errorMessage?: string;
|
78 | label?: React.ReactNode;
|
79 | labelStyle?: StyleProp<TextStyle>;
|
80 | labelProps?: object;
|
81 | renderErrorMessage?: boolean;
|
82 | } & {
|
83 | onClear: () => any;
|
84 | onCancel: () => any;
|
85 | onFocus: () => any;
|
86 | onBlur: () => any;
|
87 | onChangeText: () => any;
|
88 | } & {
|
89 | cancelIcon?: IconNode;
|
90 | } & {
|
91 | value: string;
|
92 | cancelButtonTitle: string;
|
93 | loadingProps: {};
|
94 | cancelButtonProps: {};
|
95 | showLoading: boolean;
|
96 | onClear: () => any;
|
97 | onCancel: () => any;
|
98 | onFocus: () => any;
|
99 | onBlur: () => any;
|
100 | onChangeText: () => any;
|
101 | searchIcon: {
|
102 | name: string;
|
103 | };
|
104 | clearIcon: {
|
105 | name: string;
|
106 | };
|
107 | showCancel: boolean;
|
108 | } & {
|
109 | cancelButtonProps?: Partial<import("react-native").TouchableOpacityProps> & {
|
110 | buttonStyle?: StyleProp<ViewStyle>;
|
111 | buttonTextStyle?: StyleProp<TextStyle>;
|
112 | color?: string;
|
113 | buttonDisabledStyle?: StyleProp<ViewStyle>;
|
114 | buttonDisabledTextStyle?: StyleProp<ViewStyle>;
|
115 | };
|
116 | cancelButtonTitle?: string;
|
117 | showCancel?: boolean;
|
118 | } & Partial<ThemeProps<SearchBarProps>>, keyof ThemeProps<T>>> | React.ForwardRefExoticComponent<import("react-native").TextInputProps & React.RefAttributes<TextInput> & {
|
119 | platform: "ios" | "android" | "default";
|
120 | containerStyle?: StyleProp<ViewStyle>;
|
121 | inputContainerStyle?: StyleProp<ViewStyle>;
|
122 | clearIcon?: IconNode;
|
123 | searchIcon?: IconNode;
|
124 | inputStyle?: StyleProp<TextStyle>;
|
125 | loadingProps?: ActivityIndicatorProps;
|
126 | showLoading?: boolean;
|
127 | leftIconContainerStyle?: StyleProp<ViewStyle>;
|
128 | rightIconContainerStyle?: StyleProp<ViewStyle>;
|
129 | onClear?(): void;
|
130 | onFocus?(): void;
|
131 | onBlur?(): void;
|
132 | onChangeText?(text: string): void;
|
133 | onCancel?(): void;
|
134 | } & {
|
135 | value: string;
|
136 | loadingProps: {};
|
137 | showLoading: boolean;
|
138 | lightTheme: boolean;
|
139 | round: boolean;
|
140 | onClear: () => any;
|
141 | onFocus: () => any;
|
142 | onBlur: () => any;
|
143 | onChangeText: () => any;
|
144 | } & {
|
145 | containerStyle?: StyleProp<ViewStyle>;
|
146 | disabled?: boolean;
|
147 | disabledInputStyle?: StyleProp<TextStyle>;
|
148 | inputContainerStyle?: StyleProp<ViewStyle>;
|
149 | leftIcon?: IconNode;
|
150 | leftIconContainerStyle?: StyleProp<ViewStyle>;
|
151 | rightIcon?: IconNode;
|
152 | rightIconContainerStyle?: StyleProp<ViewStyle>;
|
153 | inputStyle?: StyleProp<TextStyle>;
|
154 | InputComponent?: typeof React.Component;
|
155 | errorProps?: object;
|
156 | errorStyle?: StyleProp<TextStyle>;
|
157 | errorMessage?: string;
|
158 | label?: React.ReactNode;
|
159 | labelStyle?: StyleProp<TextStyle>;
|
160 | labelProps?: object;
|
161 | renderErrorMessage?: boolean;
|
162 | } & {
|
163 | onClear: () => any;
|
164 | onCancel: () => any;
|
165 | onFocus: () => any;
|
166 | onBlur: () => any;
|
167 | onChangeText: () => any;
|
168 | } & {
|
169 | cancelIcon?: IconNode;
|
170 | } & {
|
171 | value: string;
|
172 | cancelButtonTitle: string;
|
173 | loadingProps: {};
|
174 | cancelButtonProps: {};
|
175 | showLoading: boolean;
|
176 | onClear: () => any;
|
177 | onCancel: () => any;
|
178 | onFocus: () => any;
|
179 | onBlur: () => any;
|
180 | onChangeText: () => any;
|
181 | searchIcon: {
|
182 | name: string;
|
183 | };
|
184 | clearIcon: {
|
185 | name: string;
|
186 | };
|
187 | showCancel: boolean;
|
188 | } & {
|
189 | cancelButtonProps?: Partial<import("react-native").TouchableOpacityProps> & {
|
190 | buttonStyle?: StyleProp<ViewStyle>;
|
191 | buttonTextStyle?: StyleProp<TextStyle>;
|
192 | color?: string;
|
193 | buttonDisabledStyle?: StyleProp<ViewStyle>;
|
194 | buttonDisabledTextStyle?: StyleProp<ViewStyle>;
|
195 | };
|
196 | cancelButtonTitle?: string;
|
197 | showCancel?: boolean;
|
198 | } & Partial<ThemeProps<SearchBarProps>>>;
|
199 | export default _default;
|