@cbinsights/fds
Version:
Form: A design system by CB Insights
46 lines (45 loc) • 1.75 kB
TypeScript
import React from 'react';
import { Props, GroupBase, SelectInstance, PropsValue } from 'react-select';
declare module 'react-select/dist/declarations/src/Select' {
interface Props<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
cursorPosition?: number;
hideSelectedItems?: boolean;
isFocused?: boolean;
onSetSearchItems?: (items: PropsValue<Option>) => void;
setCursorPosition?: (position: number) => void;
}
}
export interface OptionProps {
id: number | string;
text: string;
value?: string;
type: string;
label: string;
category: string;
defaultType?: string;
uid: string;
targetTab?: string;
compoundId?: string;
extraInfo?: string;
idCollection?: number;
idCompany?: number;
idInvestor?: number;
idOrg?: number;
idUser?: number[];
idTeam?: number;
url?: string;
isExpert?: boolean;
boolean?: string;
alias?: string;
}
export interface SmartInputProps extends Props<OptionProps> {
onChange?: (newValue: PropsValue<OptionProps>) => void;
onClear?: () => void;
onMenuClose?: () => void;
onOptionClick?: () => void;
inputValue?: string;
searchItems?: PropsValue<OptionProps>;
selectRef?: React.RefObject<SelectInstance<OptionProps, boolean>>;
}
declare const Search: ({ autoFocus, backspaceRemovesValue, cursorPosition, formatOptionLabel, inputId, inputValue, isClearable, menuShouldScrollIntoView, onBlur, onChange, onClear, onFocus, onInputChange, onKeyDown, onMenuClose, onOptionClick, onSetSearchItems, openMenuOnClick, options, placeholder, searchItems, selectRef, setCursorPosition, styles, ...rest }: SmartInputProps) => JSX.Element;
export default Search;