import type { VirtualListProps } from '../_components/virtual-list/interface'; import type { FitWidthProps } from '../_hooks/use-fit-width'; import type { Size } from '../_utils/constant'; import type { ScrollbarProps } from '../scrollbar'; import type { TriggerProps } from '../trigger'; export type SelectOptionValue = string | number | boolean | Record; export type SelectModelValue = SelectOptionValue | SelectOptionValue[] | null | undefined; export interface SelectTriggerSlotProps { value: SelectModelValue; displayValue: string | string[]; inputValue: string; selectedOptions: SelectOptionData[]; popupVisible: boolean; disabled: boolean; loading: boolean; multiple: boolean; } export interface OptionValueWithKey { value: SelectOptionValue; key: string; } export interface SelectFieldNames { value?: string; label?: string; children?: string; disabled?: string; tagProps?: string; } export interface SelectOptionData { value?: SelectOptionValue; label?: string; disabled?: boolean; tagProps?: Record; [other: string]: unknown; } export interface SelectOptionGroup { isGroup: true; label: string; options: SelectOption[]; [other: string]: unknown; } export type SelectOption = string | number | boolean | SelectOptionData | SelectOptionGroup; export interface SelectOptionInfo extends SelectOptionData { raw: SelectOptionData; key: string; index?: number; origin: 'options' | 'extraOptions'; value: SelectOptionValue; label: string; } export interface SelectOptionGroupInfo extends SelectOptionGroup { key: string; options: (SelectOptionInfo | SelectOptionGroupInfo)[]; } export type FilterOption = boolean | ((inputValue: string, option: SelectOptionData) => boolean); export type SelectFallbackOption = (value: SelectOptionValue) => SelectOptionData; export interface SelectProps extends FitWidthProps { options?: SelectOption[]; ellipsis?: boolean | 'performant-ellipsis'; multiple?: boolean; value?: SelectModelValue; modelValue?: SelectModelValue; defaultValue?: SelectModelValue; inputValue?: string; defaultInputValue?: string; size?: Size; placeholder?: string; loading?: boolean; disabled?: boolean; error?: boolean; allowClear?: boolean; allowSearch?: boolean | { retainInputValue?: boolean; }; allowCreate?: boolean; showArrow?: boolean; maxTagCount?: number | 'responsive'; popupContainer?: string | HTMLElement; bordered?: boolean; popupVisible?: boolean; defaultPopupVisible?: boolean; show?: boolean; defaultShow?: boolean; defaultActiveFirstOption?: boolean; unmountOnClose?: boolean; filterOption?: FilterOption; virtualListProps?: VirtualListProps; triggerProps?: TriggerProps; fallbackOption?: boolean | SelectFallbackOption; showExtraOptions?: boolean; valueKey?: string; searchDelay?: number; limit?: number; fieldNames?: SelectFieldNames; scrollbar?: boolean | ScrollbarProps; showHeaderOnEmpty?: boolean; showFooterOnEmpty?: boolean; tagNowrap?: boolean; }