1 | import { Component } from 'react';
|
2 | import { TouchableOpacityProps, ViewStyle, StyleProp, TextStyle, TextInput } from 'react-native';
|
3 | import { InputProps } from '../input/Input';
|
4 | import { SearchBarBaseProps } from './SearchBar';
|
5 | import { ThemeProps } from '../config';
|
6 | export declare type SearchBarIosProps = InputProps & SearchBarBaseProps & typeof SearchBar.defaultProps & {
|
7 | cancelButtonProps?: Partial<TouchableOpacityProps> & {
|
8 | buttonStyle?: StyleProp<ViewStyle>;
|
9 | buttonTextStyle?: StyleProp<TextStyle>;
|
10 | color?: string;
|
11 | buttonDisabledStyle?: StyleProp<ViewStyle>;
|
12 | buttonDisabledTextStyle?: StyleProp<ViewStyle>;
|
13 | };
|
14 | cancelButtonTitle?: string;
|
15 | showCancel?: boolean;
|
16 | };
|
17 | declare type SearchBarState = {
|
18 | hasFocus: boolean;
|
19 | isEmpty: boolean;
|
20 | cancelButtonWidth: number | null;
|
21 | };
|
22 | declare class SearchBar extends Component<SearchBarIosProps & Partial<ThemeProps<SearchBarIosProps>>, SearchBarState> {
|
23 | input: TextInput;
|
24 | static defaultProps: {
|
25 | value: string;
|
26 | cancelButtonTitle: string;
|
27 | loadingProps: {};
|
28 | cancelButtonProps: {};
|
29 | showLoading: boolean;
|
30 | onClear: () => any;
|
31 | onCancel: () => any;
|
32 | onFocus: () => any;
|
33 | onBlur: () => any;
|
34 | onChangeText: () => any;
|
35 | searchIcon: {
|
36 | name: string;
|
37 | };
|
38 | clearIcon: {
|
39 | name: string;
|
40 | };
|
41 | showCancel: boolean;
|
42 | };
|
43 | constructor(props: SearchBarIosProps);
|
44 | focus: () => void;
|
45 | blur: () => void;
|
46 | clear: () => void;
|
47 | cancel: () => void;
|
48 | onFocus: InputProps['onFocus'];
|
49 | onBlur: InputProps['onBlur'];
|
50 | onChangeText: (text: string) => void;
|
51 | render(): JSX.Element;
|
52 | }
|
53 | export default SearchBar;
|