import { ComputedRef, InjectionKey } from 'vue'; import { BaseAnchorAnimationOptions, BaseAnchorPanelCardProps } from '../../base-anchor/src/types'; export type TxSelectValue = string | number; export type TxSelectModelValue = TxSelectValue | TxSelectValue[]; export type TxSelectOptionId = symbol; export interface TxSelectOption { value: TxSelectValue; label: string; disabled?: boolean; /** Icon class rendered as a leading tile (e.g. an UnoCSS/iconify class); resolved by the host app's CSS. */ icon?: string; /** Secondary line rendered under the label. */ description?: string; } export interface TxSelectOptionGroup { label: string; disabled?: boolean; options: TxSelectOption[]; } export type TxSelectOptionLike = TxSelectOption | TxSelectOptionGroup; export type TxSelectStatus = 'default' | 'error' | 'warning'; export interface TxSelectProps { modelValue?: TxSelectModelValue; placeholder?: string; disabled?: boolean; multiple?: boolean; status?: TxSelectStatus; eager?: boolean; options?: TxSelectOptionLike[]; maxTagCount?: number; maxTagTextLength?: number; searchable?: boolean; /** * Automatically enables search when total option count meets or exceeds this threshold. * Set to `<= 0` or pass `searchable: false` to disable. * @default 8 */ searchThreshold?: number; searchPlaceholder?: string; editable?: boolean; remote?: boolean; allowCreate?: boolean; createText?: string; loading?: boolean; loadingText?: string; emptyText?: string; searchDebounce?: number; dropdownMaxHeight?: number; dropdownOffset?: number; contentPadding?: number; optionPadding?: number; animation?: BaseAnchorAnimationOptions; panelVariant?: 'solid' | 'dashed' | 'plain'; panelBackground?: 'pure' | 'mask' | 'blur' | 'glass' | 'refraction' | 'acrylic' | 'mica' | 'flat' | 'plain'; panelShadow?: 'none' | 'soft' | 'medium'; panelRadius?: number; panelPadding?: number; panelCard?: BaseAnchorPanelCardProps; } export interface TxSelectItemProps { value: TxSelectValue; label?: string; disabled?: boolean; /** Icon class rendered as a leading tile (e.g. an UnoCSS/iconify class); resolved by the host app's CSS. */ icon?: string; /** Secondary line rendered under the label. */ description?: string; } export interface TxSelectContext { currentValue: ComputedRef; handleSelect: (value: TxSelectValue, label: string) => void; registerOption: (id: TxSelectOptionId, value: TxSelectValue, label: string) => void; unregisterOption: (id: TxSelectOptionId) => void; isValueEqual: (optionValue: TxSelectValue, currentValue: unknown) => boolean; isValueSelected: (optionValue: TxSelectValue) => boolean; searchQuery: ComputedRef; } export declare const SELECT_KEY: InjectionKey;