@uiw/react-native
Version:
UIW for React Native
39 lines (38 loc) • 1.41 kB
TypeScript
import React from 'react';
import { StyleProp, ViewStyle, TextInput, TextInputProps, TextStyle, TouchableWithoutFeedbackProps } from 'react-native';
import { IconsProps } from '../Icon';
export interface SearchInputBarProps extends TextInputProps {
/** 容器样式 */
containerStyle?: StyleProp<ViewStyle>;
/** 右侧按钮 */
touchProps?: TouchableWithoutFeedbackProps;
/** 右侧按钮文案 */
actionName?: string;
/** 是否一直显示右侧按钮 null = 永不显示 */
showActionButton?: boolean | null;
/** 搜索图标Icon参数 参考Icon组件 */
searchIcon?: IconsProps;
/** 点击搜索图标时触发事件 */
onSearch?: Function;
/** 清除图标Icon参数 参考Icon组件 */
closeIcon?: IconsProps;
/** 点击清除图标时触发事件 */
onClear?: Function;
/** 自定义搜索 */
searchRender?: JSX.Element;
/** 输入框TextInput样式 */
inputStyle?: TextStyle;
/** loading加载 */
loading?: any;
}
interface SearchInputBarState {
showIcon: boolean;
}
export default class SearchInputBar extends React.Component<SearchInputBarProps, SearchInputBarState> {
inputRef: React.RefObject<TextInput>;
constructor(props: SearchInputBarProps);
needFocus: (type: 'search' | 'close' | 'actived') => void;
renderSearch: () => JSX.Element | null;
render(): JSX.Element;
}
export {};