import type { VNodeChild } from "vue"; import type { XyControlStatus, XyControlVariant, XyOverlayPlacement, XySemanticClassNames, XySemanticStyles, XySize } from "../core"; export type XySelectValue = number | string; export type XySelectModelValue = XySelectValue | XySelectValue[]; export type XySelectMode = "multiple" | "tags"; export interface XySelectOption { [key: string]: unknown; disabled?: boolean; group?: string; label: string; value: XySelectValue; } export type XySelectFilterOption = (search: string, option: XySelectOption) => boolean; export type XySelectSemanticDom = "arrow" | "clear" | "dropdown" | "empty" | "error" | "label" | "list" | "loading" | "option" | "root" | "search" | "tag" | "trigger" | "value"; export interface XySelectProps { allowClear?: boolean; ariaActiveDescendant?: string; ariaControls?: string; ariaHaspopup?: "dialog" | "grid" | "listbox" | "menu" | "tree"; ariaLabel?: string; autoClearSearchValue?: boolean; autofocus?: boolean; classNames?: XySelectClassNames; disabled?: boolean; error?: string; filterOption?: boolean | XySelectFilterOption; id?: string; label?: string; loading?: boolean; maxCount?: number; maxTagCount?: number; maxTagTextLength?: number; mode?: XySelectMode; modelValue?: XySelectModelValue; multiple?: boolean; open?: boolean; options?: XySelectOption[]; placeholder?: string; placement?: XyOverlayPlacement; popupMatchSelectWidth?: boolean | number; readonly?: boolean; remote?: boolean; searchable?: boolean; showSearch?: boolean; size?: XySize; status?: XyControlStatus; styles?: XySelectStyles; variant?: XyControlVariant; } export type XySelectClassNames = XySemanticClassNames; export type XySelectStyles = XySemanticStyles; export interface XySelectSlots { dropdown?: (props: { close: () => void; }) => VNodeChild; empty?: () => VNodeChild; loading?: () => VNodeChild; option?: (props: { active: boolean; disabled: boolean; option: XySelectOption; selected: boolean; }) => VNodeChild; selection?: (props: { multiple: boolean; option: XySelectOption; remove?: () => void; value: XySelectValue; }) => VNodeChild; suffix?: () => VNodeChild; tag?: (props: { option: XySelectOption; remove: () => void; value: XySelectValue; }) => VNodeChild; }