import { default as React } from 'react'; import { RegisterOptions } from 'react-hook-form'; import { StylesConfig } from 'react-select'; import { ID } from '@zeniai/client-epic-state'; import { DisableMode } from '../common/common'; /** * Component & its Props */ interface OptionTypeBase { [key: string]: any; } export interface OptionType extends OptionTypeBase { value: string; additionalNote?: string; isDisabled?: boolean; isOptionRecommended?: boolean; label?: string; zeniId?: string; } export interface CreatableAutoCompleteSingleSelectFieldValue { defaultOptions: OptionType[]; selectedOption?: string; } interface TooltipProp { sticky: boolean; text: string; } export interface CreatableAutoCompleteSingleSelectFieldProps { defaultValue: CreatableAutoCompleteSingleSelectFieldValue; isOptionsLoading: boolean; name: string; addIconInCreateLabel?: boolean; allowEmpty?: boolean; autoFocus?: boolean; customStyleConfig?: StylesConfig; entity?: string; highlightMatchingText?: boolean; isDisabled?: DisableMode; makeCreateOptionSticky?: boolean; menuIsOpen?: boolean; menuPortal?: HTMLElement | null; /** * When true, clicking the control opens the menu (showing all options) * instead of the default type-to-search behavior. Defaults to false to * preserve existing consumers. */ openMenuOnClick?: boolean; placeholder?: string; registerOptions?: RegisterOptions; screenType?: "create" | "edit"; showAfterElement?: boolean; showDownChevronWithValue?: boolean; showEmptyState?: boolean; style?: React.CSSProperties; tooltip?: TooltipProp; /** Overrides the "create option" row label (default: "Create new vendor as …"). */ createOptionLabel?: (inputValue: string) => string; disableCurrentOption?: (option: string) => boolean; loadOptions?: (inputValue: string, callback: (defaultOptions: OptionType[]) => void) => void; onCreateOptionClick?: (value: string) => void; onMenuClose?: () => void; /** Fired when an existing option is picked (not when one is created). */ onOptionSelect?: (value: string) => void; valueToElement?: (value: string) => JSX.Element | null; valueToId?: (value: string) => ID | undefined; valueToInfo?: (value: string) => string; } export declare const CreatableAutoCompleteSingleSelectField: ({ name, isOptionsLoading, registerOptions, defaultValue, isDisabled, style, placeholder, customStyleConfig, addIconInCreateLabel, showDownChevronWithValue, menuPortal, menuIsOpen, autoFocus, highlightMatchingText, makeCreateOptionSticky, openMenuOnClick, createOptionLabel, entity, valueToInfo, valueToId, valueToElement, disableCurrentOption, loadOptions, onCreateOptionClick, onMenuClose, onOptionSelect, screenType, showAfterElement, }: CreatableAutoCompleteSingleSelectFieldProps) => import("react/jsx-runtime").JSX.Element; export declare const CustomTooltip: ({ children, title, }: { children: string; title: string; }) => import("react/jsx-runtime").JSX.Element; export {};