import { type Placement } from '@floating-ui/vue'; import type { FieldProps } from './_internal/components/Field/Field.types'; type Option = any; type SelectedOptions = Option | Option[]; export interface SelectProps extends FieldProps { /** * If there is only 1 option selected, it prevents that option from being de-selected */ preventEmpty?: boolean; /** * @deprecated The `allowEmpty` prop is no longer supported; use `preventEmpty` instead. */ allowEmpty?: string | boolean | null; /** * If `options` are an object, this is what prop to use for display. */ displayBy?: string; /** * List of one or more fields to search on. When empty, displayBy will be used */ searchBy?: string[]; /** * Default field to track selected options by. */ trackBy?: string; /** * Placeholder text. */ placeholder?: string; /** * @deprecated Use the `error-text` prop instead */ error?: string; /** * @deprecated Use the `hint-text` prop instead */ hint?: string; /** * Sets a custom icon. */ icon?: string | boolean; /** * Sets a name attribute on the native (hidden) select element * * Setting the default value to `undefined` so the attribute isn't rendered if not explicitly provided to ensure backwards compatibility with MP django forms */ name?: string; /** * The list of all options to select from. */ options?: Option[] | readonly Option[]; /** * Lazily evaluate and set component `options`. Will execute upon user mouseover. */ lazy?: () => Option[]; /** * Sets the currently-selected value(s) for the component. * Accepts an array of Objects, or a single Object (if `single` is true), or a string */ modelValue?: SelectedOptions; /** * @deprecated Use :model-value or v-model instead of :value. */ value?: SelectedOptions | null; /** * Hides the search input */ hideSearch?: boolean; /** * @deprecated The `searchable` prop is no longer supported; Use `hideSearch` instead. */ searchable?: string | boolean | null; /** * If true, prevents the search term from being cleared when the drawer is dismissed. */ preserveSearchTerm?: boolean; /** * Prevents the options from being filtered when the search term changes. * Allows the parent to filter the options. */ disableFiltering?: boolean; /** * Functions as a single select, if true */ single?: boolean; /** * Prevents the Selected Option from being truncated, if true */ noTruncate?: boolean; /** * On an ajaxed request when the dropdown is open, we may be experiencing slower load times. * This flag will drop a loader into the dropdown. Note: This has never been design reviewed. */ loading?: boolean; /** * @deprecated Instead, use the `@search` event (the onSearch prop) and ensure its event handler returns a Promise that resolves after the search is complete. */ searchLoading?: boolean; /** * In the selection text we use this to give more visual distinction to what type of item(s) are selected * E.g. 2 customers selected. An empty string will result in `2 selected`. */ selectItemType?: string; /** * Hides the "check" icon if truthy */ hideCheck?: boolean; searchPlaceholder?: string; /** * Equivalent to emitting a "search" event, except this prop can be used to populate the list of `options` using an HTTP request because a prop's return value can be received and awaited, unlike an event. * * **Tip:** to show a loading indicator while searching, return a Promise that resolves after the search is complete. * * **Warning:** the search input is debounced so there is no need to debounce this function. */ onSearch?: (searchTerm: string) => Promise | void; /** * Uses the "fuzzy search" algorithm when searching, if true */ useFuzzySearch?: boolean; /** * Sets the placement of the dropdown * @default 'bottom-start' */ menuPlacement?: Placement; /** * Enables teleporting the dropdown * @default false */ enableTeleport?: boolean; /** * The selector or element to which the dropdown should be teleported * @default `'#stash-menus-mount-node'` */ teleportTo?: string | HTMLElement; } declare const _default: typeof __VLS_export; export default _default; declare const __VLS_export: __VLS_WithSlots any; add: (optionAdded: any) => any; remove: (optionRemoved: any, index: number) => any; "update:model-value": (selectedOptions: any) => any; opened: () => any; closed: (selectedOptions: any) => any; }, string, import("vue").PublicProps, Readonly & Readonly<{ onClear?: (() => any) | undefined; onAdd?: ((optionAdded: any) => any) | undefined; onRemove?: ((optionRemoved: any, index: number) => any) | undefined; "onUpdate:model-value"?: ((selectedOptions: any) => any) | undefined; onOpened?: (() => any) | undefined; onClosed?: ((selectedOptions: any) => any) | undefined; }>, { name: string; error: string; icon: string | boolean; value: SelectedOptions | null; options: Option[] | readonly Option[]; modelValue: SelectedOptions; hint: string; placeholder: string; trackBy: string; preventEmpty: boolean; allowEmpty: string | boolean | null; displayBy: string; searchBy: string[]; lazy: () => Option[]; hideSearch: boolean; searchable: string | boolean | null; preserveSearchTerm: boolean; disableFiltering: boolean; single: boolean; noTruncate: boolean; loading: boolean; searchLoading: boolean; selectItemType: string; hideCheck: boolean; searchPlaceholder: string; onSearch: (searchTerm: string) => Promise | void; useFuzzySearch: boolean; menuPlacement: Placement; enableTeleport: boolean; teleportTo: string | HTMLElement; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, { /** * Selected value(s) custom text. Exposes the option object and remove function. */ selected(props: { /** * The selected option object. */ option: Option; /** * Function to remove the selected option from the selection. */ onRemove: () => void; /** * Class to apply to the selected chip. */ chipSelectedClass: string; }): unknown; /** * Select custom option text. Exposes the option object */ option(props: { /** * Option The option instance for this list item. */ option: Option; }): unknown; /** * Slot for when there are no options available. */ 'no-options'(): unknown; /** * Slot to display a helpful hint message below the select field. */ hint(): unknown; }>; type __VLS_WithSlots = T & { new (): { $slots: S; }; };