react-native-paper-select
Version:
Material Design Select Dropdown Component using React Native Paper
59 lines (58 loc) • 2.25 kB
TypeScript
import type { ReactNode, MutableRefObject } from 'react';
import type { ViewStyle, TextStyle } from 'react-native';
import type { SearchbarProps, TextInputProps } from 'react-native-paper';
import type { ThemeProp } from 'react-native-paper/lib/typescript/types';
import type { PaperSelectCheckboxProps } from './checkbox.interface';
export interface ListItem {
_id: string;
value: string;
disabled?: boolean;
}
export interface SelectedItem {
text: string;
selectedList: Array<ListItem>;
}
export declare type SelectionCallback = (item: SelectedItem) => void;
export declare type PaperSelectTextInputProps = Pick<TextInputProps, 'underlineColor' | 'activeUnderlineColor' | 'outlineColor' | 'activeOutlineColor' | 'left' | 'right'>;
export declare type PaperSelectSearchbarProps = Pick<SearchbarProps, 'icon' | 'iconColor'>;
export interface PaperSelectProps {
label: string;
arrayList: ListItem[];
selectedArrayList: ListItem[];
multiEnable: boolean;
value: string;
onSelection: SelectionCallback;
disabled?: boolean;
hideSearchBox?: boolean;
selectAllEnable?: boolean;
textInputMode?: TextInputProps['mode'];
theme?: ThemeProp;
inputRef?: MutableRefObject<any>;
limit?: number | null;
limitError?: string;
limitErrorStyle?: TextStyle;
dialogTitle?: ReactNode;
selectAllText?: string;
searchText?: string;
dialogCloseButtonText?: string;
dialogDoneButtonText?: string;
errorText?: string;
containerStyle?: ViewStyle;
textInputStyle?: TextStyle;
textInputOutlineStyle?: ViewStyle;
dialogStyle?: ViewStyle;
dialogTitleStyle?: TextStyle;
searchStyle?: SearchbarProps['style'];
dialogCloseButtonStyle?: TextStyle;
dialogDoneButtonStyle?: TextStyle;
errorStyle?: TextStyle;
textColor?: string;
textInputProps?: PaperSelectTextInputProps;
checkboxProps?: PaperSelectCheckboxProps;
searchbarProps?: PaperSelectSearchbarProps;
testID?: string | undefined;
dialogTestID?: string | undefined;
searchbarTestID?: string | undefined;
selectAllCheckboxTestID?: string | undefined;
itemCheckboxTestIDPrefix?: string | undefined;
}