import React from 'react'; import { IDropdownOption } from '../types'; import { IDropdownItem } from '../item'; export interface IDropdownMenuItemProps { index: number; option: any; onMouseMove: (e: React.MouseEvent, index: number | undefined) => void; isFocused: boolean; } export interface IDropdownMenuDynamic extends Pick { /** Optional single active value. Use this instead of activeOptions if there is only one active option */ activeValue?: string; /** Styles for scroll inner */ scrollInnerStyle?: object; /** If there are no values, we will add click action */ onAddClick?: (searchValue: string) => void | Promise; /** On close action */ onClose: () => void; /** On click event. It will pass the option event which at least needs the value. */ onClick: (option: IDropdownOption) => void; /** On search event */ onSearchText?: (value: string) => void; /** Optional keydown event */ onHandleKeydown?: (e: KeyboardEvent) => void | boolean; /** Optional keyup event */ onHandleKeyup?: (e: KeyboardEvent) => void; /** Clear search input on select if true */ clearOnSelect?: boolean; /** Clear search input on add if true */ clearOnAdd?: boolean; /** Needed items, it MUST include value. */ options: any[]; /** Include search to filter results */ includeSearch?: boolean; /** Is view only, can open dropdown but not select */ viewOnly?: boolean; /** Allows for multi selecting options, in which case the modal will not close automatically after selecting an option */ isMultiClick?: boolean; /** Search placeholder */ searchPlaceholder?: string; /** If true, will highlight selected item instead of adding checked icon */ highlightActive?: boolean; /** If true, will show add item always without search value*/ alwaysShowAddItem?: boolean; /** Mandatory render add item method when we allow for adding a new button */ renderAddItem?: (value: string) => React.ReactNode; /** Render diver at between item and item */ renderDiver?: (index: number, options: any[]) => React.ReactNode | void; /** Render title for item group */ renderGroupTitle?: (index: number, options: any[]) => React.ReactNode | void; renderItemTrailing?: (option: any, isActive: boolean, filterOptions: any[]) => React.ReactNode | void; /** Suppress close dropdown when click option */ suppressCloseByClick?: boolean; /** Relate values, help focus on option */ relateValues?: string[]; /** increment input style FlattenSimpleInterpolation */ inputStyle?: object; /** is show input right dom */ isInputTrailing?: boolean; /** view dom function */ renderInputTrailing?: () => React.ReactNode | void; /** custom text shown when no searched options available */ emptyMessageWhenNoSearchOption?: string; /** custom text shown when no options available */ emptyMessageWhenNoOption?: string; /** Enable chinese Pinyin character search */ usePinyinSearch?: boolean; /** Optional confirm button. Always fixed outside of scroll at bottom.*/ renderConfirmButton?: () => React.ReactNode; /** Position add button outside scroll at the bottom */ fixBottomButton?: boolean; } /** In order to have an add button, you must have the `onAddClick` and `renderAddItem` */ export declare const DropdownMenuDynamic: React.FC;