import type { VNodeChild } from "vue"; import type { XyControlStatus, XyControlVariant, XyOptionValue, XyOverlayPlacement, XySemanticClassNames, XySemanticStyles, XySize } from "../core"; export interface XyCascaderOption { [key: string]: unknown; children?: XyCascaderOption[]; disableCheckbox?: boolean; disabled?: boolean; isLeaf?: boolean; label: string; loading?: boolean; value: XyOptionValue; } export type XyCascaderPath = XyOptionValue[]; export type XyCascaderValue = XyCascaderPath | XyCascaderPath[]; export type XyCascaderExpandTrigger = "click" | "hover"; export type XyCascaderFilterOption = (search: string, path: XyCascaderOption[]) => boolean; export type XyCascaderDisplayRender = (labels: string[], selectedOptions: XyCascaderOption[]) => string; export type XyCascaderLoadData = (option: XyCascaderOption, path: XyCascaderOption[]) => Promise | void; export type XyCascaderSemanticDom = "arrow" | "clear" | "column" | "columns" | "dropdown" | "empty" | "loading" | "option" | "optionLabel" | "root" | "search" | "selection" | "tag" | "trigger" | "value"; export interface XyCascaderProps { allowClear?: boolean; ariaLabel?: string; autoClearSearchValue?: boolean; autofocus?: boolean; changeOnSelect?: boolean; classNames?: XyCascaderClassNames; defaultOpen?: boolean; disabled?: boolean; displayRender?: XyCascaderDisplayRender; error?: string; expandTrigger?: XyCascaderExpandTrigger; filterOption?: boolean | XyCascaderFilterOption; id?: string; label?: string; loadData?: XyCascaderLoadData; loading?: boolean; maxCount?: number; maxTagCount?: number; maxTagTextLength?: number; modelValue?: XyCascaderValue; multiple?: boolean; notFoundContent?: string; open?: boolean; options?: XyCascaderOption[]; placeholder?: string; placement?: XyOverlayPlacement; popupMatchSelectWidth?: boolean | number; readonly?: boolean; searchable?: boolean; searchLimit?: false | number; searchPlaceholder?: string; separator?: string; showSearch?: boolean; size?: XySize; status?: XyControlStatus; styles?: XyCascaderStyles; variant?: XyControlVariant; } export type XyCascaderClassNames = XySemanticClassNames; export type XyCascaderStyles = XySemanticStyles; export interface XyCascaderOptionSlotProps { active: boolean; loading: boolean; option: XyCascaderOption; path: XyCascaderPath; selected: boolean; selectedOptions: XyCascaderOption[]; } export interface XyCascaderSelectionSlotProps { label: string; multiple: boolean; path: XyCascaderPath; remove?: () => void; selectedOptions: XyCascaderOption[]; } export interface XyCascaderSlots { empty?: () => VNodeChild; loading?: () => VNodeChild; option?: (props: XyCascaderOptionSlotProps) => VNodeChild; selection?: (props: XyCascaderSelectionSlotProps) => VNodeChild; suffix?: () => VNodeChild; } export interface XyCascaderExpose { blur: () => void; focus: (options?: FocusOptions) => void; nativeElement: HTMLElement | undefined; }