import { StylesConfig } from 'react-select'; import { TextStyle } from '../../../designSystem/zeniConstants'; import { DisableMode } from '../../formElements/common/common'; export interface Props { pickerValues: T[]; backgroundColor?: string; borderRadius?: string; classNamePrefix?: string; containerStyles?: React.CSSProperties; ControlComponent?: React.FunctionComponent; DropDownIndicatorComponent?: React.FunctionComponent; hasError?: boolean; hoverBackgroundColor?: string; isDisabled?: DisableMode; isOptionRemovable?: boolean; isSearchable?: boolean; maxMenuHeight?: number; menuIsOpen?: boolean; MenuListComponent?: React.FunctionComponent; menuPlacement?: "auto" | "top" | "bottom"; /** When set, the menu is rendered in a portal (e.g. document.body) for correct stacking. */ menuPortalTarget?: HTMLElement | null; menuPosition?: "left" | "right"; optionBackgroundColor?: string; OptionComponent?: React.FunctionComponent; optionTextStyle?: TextStyle; outlined?: boolean; placeholder?: string; PlaceholderComponent?: React.FunctionComponent; selectedOptionBackgroundColor?: string; selectedOptionColor?: string; selectedValue?: T; SingleValueComponent?: React.FunctionComponent; /** Merged on top of Zeni defaults (patch wins on key conflicts). */ stylesConfigPatch?: Partial>; title?: string; titleColor?: string; titleTextAlignment?: "flex-start" | "flex-end" | "center"; titleTextStyle?: TextStyle; ValueContainerComponent?: React.FunctionComponent; zIndex?: number; onPickerSelectionChanged: (selectedValue?: T) => void; valueToLabel: (value: T) => string; filterOption?: (option: OptionType, searchText: string) => boolean; isOptionDisabled?: (value: string) => boolean; valueToData?: (value: T) => any; } interface OptionTypeBase { [key: string]: any; } export interface OptionType extends OptionTypeBase { label: string; value: string; } export default function ZeniSingleSelect({ OptionComponent, PlaceholderComponent, SingleValueComponent, MenuListComponent, pickerValues, placeholder, valueToLabel, selectedValue, onPickerSelectionChanged, optionBackgroundColor, maxMenuHeight, menuPortalTarget, selectedOptionBackgroundColor, selectedOptionColor, optionTextStyle, title, titleTextStyle, titleTextAlignment, titleColor, backgroundColor, hoverBackgroundColor, borderRadius, outlined, isDisabled, isSearchable, hasError, menuPlacement, menuPosition, filterOption, isOptionDisabled, classNamePrefix, zIndex, menuIsOpen, isOptionRemovable, containerStyles, DropDownIndicatorComponent, ValueContainerComponent, ControlComponent, valueToData, stylesConfigPatch, }: Props): import("react/jsx-runtime").JSX.Element; export { ZeniSingleSelect as ZeniPicker };