UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

51 lines (50 loc) 1.96 kB
import * as React from 'react'; import { AccessLevel, AdaptableSystemIconName } from '../../types'; export type SelectOption<SelectValue extends unknown> = { label: React.ReactNode; icon?: AdaptableSystemIconName; value: SelectValue; isDisabled?: boolean; }; export type SelectProps<SelectValue extends unknown, IsMulti extends boolean = false> = { options: readonly SelectOption<SelectValue>[] | SelectOption<SelectValue>[]; disabled?: boolean; menuPosition?: 'fixed' | 'absolute'; menuPlacement?: 'auto' | 'bottom' | 'top'; menuStyle?: React.CSSProperties; menuMinWidth?: string | number; searchable?: boolean; isClearable?: boolean; closeMenuOnSelect?: boolean; hideSelectedOptions?: boolean; showHeaderSelectionCheckbox?: boolean; isMulti?: IsMulti; onChange: (value: IsMulti extends true ? SelectValue[] : SelectValue) => void; value: IsMulti extends true ? SelectValue[] : SelectValue; placeholder?: string; 'data-name'?: string; 'data-id'?: string; renderSingleValue?: (option: SelectOption<SelectValue>) => React.ReactNode; renderMultipleValues?: (values: SelectValue[], options: { focused: boolean; placeholder?: string; }) => React.ReactNode; className?: string; isLoading?: boolean; onFocus?: () => void; onBlur?: () => void; accessLevel?: AccessLevel; style?: React.CSSProperties; styles?: { valueContainer?: React.CSSProperties; control?: React.CSSProperties; container?: React.CSSProperties; dropdownIndicator?: React.CSSProperties; }; onInputChange?: (value: string) => void; onMenuOpen?: VoidFunction; size?: 'small' | 'normal'; isCreatable?: boolean; menuPortalTarget?: HTMLElement; }; export declare const Select: <SelectValue extends unknown, IsMulti extends boolean = false>(props: SelectProps<SelectValue, IsMulti>) => React.JSX.Element;