import type { ClassValue } from 'svelte/elements'; import { type FloatingStrategy } from '../floating'; import { type InputState } from '../input'; import { type DetailedOption, type SortOption } from './search'; interface $$__sveltets_2_IsomorphicComponent = any, Events extends Record = any, Slots extends Record = any, Exports = {}, Bindings = string> { new (options: import('svelte').ComponentConstructorOptions): import('svelte').SvelteComponent & { $$bindings?: Bindings; } & Exports; (internal: unknown, props: Props & { $$events?: Events; $$slots?: Slots; }): Exports & { $set?: any; $on?: any; }; z_$$bindings?: Bindings; } type $$__sveltets_2_PropsWithChildren = Props & (Slots extends { default: any; } ? Props extends Record ? any : { children?: any; } : {}); /** * Select an option from a list, with search * * Guided by https://www.w3.org/WAI/ARIA/apg/patterns/combobox/ * * ```svelte * * ``` */ declare const SearchableSelect: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{ /** The options the user should be allowed to search and select from. */ options: (string | DetailedOption)[]; /** The value of the search input or the currently selected option, if any. */ value?: string; /** All selected values, if `multiple` is `true`. */ values?: string[]; /** The placeholder of the input. */ placeholder?: string; /** Optional id used in parent label `for` attribute */ id?: string | undefined; /** * Whether value must be constrained to `options` on change. * - `false` (Default) - any value may be selected * - `true` - value must be in `options` * - `Function` - value must be in `options` or pass the test function */ exclusive?: boolean | ((value: string) => boolean); /** Controls whether or not we select the typed option when blurring */ selectOnBlur?: boolean; /** Multiple selections allowed. */ multiple?: boolean | undefined; /** Input is disabled. */ disabled?: boolean; /** Clearing the field resets to the last selected value rather than emitting an empty string. */ resetOnClear?: boolean; /** Clear the value on select rather than displaying the selected option. */ clearValueOnSelect?: boolean; /** The state of the select (info, warn, error, success), if any. */ state?: InputState; /** Option sorting behavior. */ sort?: SortOption; /** * When true, focusing the input shows the full option list until the user * types. The selected value is preserved; options only narrow once a search * term is entered. Pairs well with `sort="reduce"` so a populated field still * reveals every option on click rather than pre-filtering to the current value. */ showAllOnFocus?: boolean; /** Prefix to display with the arbitrary text option, if non-exclusive. */ otherOptionPrefix?: string; /** Error message ID, if any. */ errorID?: string; /** ID of the element that describes the SearchableSelect. */ describedBy?: string | undefined; /** Whether the data to populate the options is still loading. * If true, a loading indicator will be displayed instead of the options. */ isLoading?: boolean; /** * Notify the parent of a value change, after Enter key or blur. * * Only used if `multiple` is `false` (default) */ onChange?: ((value: string) => unknown) | undefined; /** Notify the parent of a value change, if `multiple` is `true` */ onMultiChange?: ((values: string[]) => unknown) | undefined; /** Notify the parent of focus. */ onFocus?: ((event: FocusEvent) => unknown) | undefined; /** Notify the parent of blur. */ onBlur?: ((event: FocusEvent) => unknown) | undefined; /** * The strategy for positioning the popup. * * Use `fixed` to break the menu out of the parent container * in the case where the parent container is also floating. */ floatingStrategy?: FloatingStrategy | undefined; /** Additional CSS classes to pass to the input container. */ cx?: ClassValue; /** Additional CSS classes to pass to the dropdown menu container. */ menuCx?: ClassValue; }, { default: {}; }>, { pointerdown: PointerEvent; mousedown: MouseEvent; } & { [evt: string]: CustomEvent; }, { default: {}; }, {}, string>; type SearchableSelect = InstanceType; export default SearchableSelect;