UNPKG

9.2 kBTypeScriptView Raw
1import React from 'react';
2import IOSSearchBar, { SearchBarIosProps } from './SearchBar-ios';
3import { SearchBarAndroidProps } from './SearchBar-android';
4import { SearchBarDefaultProps } from './SearchBar-default';
5import { ActivityIndicatorProps, StyleProp, TextStyle, ViewStyle, TextInput } from 'react-native';
6import { IconNode } from '../icons/Icon';
7import { ThemeProps } from '../config';
8export 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};
25export declare type SearchBarProps = SearchBarBaseProps & SearchBarDefaultProps & SearchBarAndroidProps & SearchBarIosProps;
26declare 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}
37export { SearchBar };
38declare const _default: React.FunctionComponent<Pick<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>>, "style" | "onLayout" | "testID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "disabled" | "allowFontScaling" | "numberOfLines" | "nativeID" | "maxFontSizeMultiplier" | "selectionColor" | "textBreakStrategy" | "hitSlop" | "onBlur" | "onFocus" | "hasTVPreferredFocus" | "tvParallaxProperties" | "containerStyle" | "pointerEvents" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "platform" | "ref" | "label" | "onClear" | "placeholder" | "key" | "value" | "onContentSizeChange" | "onScroll" | "scrollEnabled" | "loadingProps" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "keyboardType" | "maxLength" | "multiline" | "onChange" | "onChangeText" | "onEndEditing" | "onSelectionChange" | "onSubmitEditing" | "onTextInput" | "onKeyPress" | "placeholderTextColor" | "returnKeyType" | "secureTextEntry" | "selectTextOnFocus" | "selection" | "textAlign" | "inputAccessoryViewID" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "selectionState" | "spellCheck" | "textContentType" | "autoCompleteType" | "importantForAutofill" | "disableFullscreenUI" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "underlineColorAndroid" | "textAlignVertical" | "showSoftInputOnFocus" | "disabledInputStyle" | "inputContainerStyle" | "leftIcon" | "leftIconContainerStyle" | "rightIcon" | "rightIconContainerStyle" | "inputStyle" | "InputComponent" | "errorProps" | "errorStyle" | "errorMessage" | "labelStyle" | "labelProps" | "renderErrorMessage" | "clearIcon" | "searchIcon" | "showLoading" | "onCancel" | "cancelButtonTitle" | "cancelButtonProps" | "showCancel" | "cancelIcon" | "lightTheme" | "round">> | 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>>>;
199export default _default;