import * as React from 'react'; import { Column } from './Column'; interface IDropdownProps { /** @ignore */ className?: string; /** @ignore */ children?: React.ReactNode; /** Dropdown name, for use in forms. */ name?: string; /** Data to show in Dropdown. */ data: any[]; /** * Dropdown's value can be cleared. * @default false */ clearable?: boolean; /** Label function */ label: (item: any) => React.ReactNode; /** Placeholder text. */ placeholder?: string; /** Dropdown value. * The value is an object, not an ID! */ value?: any; /** * Marks dropdown as disabled. * @default false */ disabled?: boolean; /** * A fluid Dropdown occupies all horizontal space available to it. * @default false */ fluid?: boolean; /** * An inline Dropdown has no border. Useful for menu items. * @default false */ inline?: boolean; /** * Gap between columns inside Dropdown body, in pixels. * @default 16 */ gap?: number; /** * If set, Dropdown is in an error state. * @default false */ error?: boolean; /** * If set, allow multiple selection. * @default false */ multiple?: boolean; /** * If true, the search query is reset when dropdown is opened * (This only applies to dropdowns with an `onSearch` callback.) * @default false */ resetOnOpen?: boolean; /** * Max items to display before a scrollbar is added. Defaults to 6. * @default 6 */ maxItems?: number; /** * The Dropdown opening direction can be either fixed * (`up` or `down`), or depend on the nearest scrolling parent: if the Dropdown * is in the top half of the visible section of the parent, then it opens * downward, and vice-versa. If this property is not set, then the opening * direction is determined from the Dropdown position in the viewport. */ direction?: 'up' | 'down' | 'parent'; /** Listeners are notified whenever the user interacts with the input. */ onChange?: (value: any) => void; /** If a search callback is provided, then the Dropdown will have a search box. */ onSearch?: (q: string) => void; /** If a callback is provided, then listeners are notified when the dropdown is closed. */ onClose?: () => void; } /** * A `Dropdown` is a replacement for `