import type { TreeRootProps, TreeRootEmits } from 'reka-ui'; import type { AppConfig } from '@nuxt/schema'; import theme from '#build/ui/tree'; import type { DynamicSlots, GetItemKeys, GetModelValue, GetModelValueEmits, NestedItem, ComponentConfig } from '../types/utils'; type Tree = ComponentConfig; export type TreeItem = { /** * @IconifyIcon */ icon?: string; label?: string; /** * @IconifyIcon */ trailingIcon?: string; defaultExpanded?: boolean; disabled?: boolean; value?: string; slot?: string; children?: TreeItem[]; onToggle?(e: Event): void; onSelect?(e?: Event): void; class?: any; ui?: Pick; [key: string]: any; }; export interface TreeProps = 'value', M extends boolean = false> extends Pick, 'expanded' | 'defaultExpanded' | 'selectionBehavior' | 'propagateSelect' | 'disabled'> { /** * The element or component this component should render as. * @defaultValue 'ul' */ as?: any; /** * @defaultValue 'primary' */ color?: Tree['variants']['color']; /** * @defaultValue 'md' */ size?: Tree['variants']['size']; /** * The key used to get the value from the item. * @defaultValue 'value' */ valueKey?: VK; /** * The key used to get the label from the item. * @defaultValue 'label' */ labelKey?: keyof NestedItem; /** * The icon displayed on the right side of a parent node. * @defaultValue appConfig.ui.icons.chevronDown * @IconifyIcon */ trailingIcon?: string; /** * The icon displayed when a parent node is expanded. * @defaultValue appConfig.ui.icons.folderOpen * @IconifyIcon */ expandedIcon?: string; /** * The icon displayed when a parent node is collapsed. * @defaultValue appConfig.ui.icons.folder * @IconifyIcon */ collapsedIcon?: string; items?: T; /** The controlled value of the Tree. Can be bind as `v-model`. */ modelValue?: GetModelValue; /** The value of the Tree when initially rendered. Use when you do not need to control the state of the Tree. */ defaultValue?: GetModelValue; /** Whether multiple options can be selected or not. */ multiple?: M & boolean; class?: any; ui?: Tree['slots']; } export type TreeEmits | undefined, M extends boolean> = Omit & GetModelValueEmits; type SlotProps = (props: { item: T; index: number; level: number; expanded: boolean; selected: boolean; }) => any; export type TreeSlots = NestedItem> = { 'item': SlotProps; 'item-leading': SlotProps; 'item-label': SlotProps; 'item-trailing': SlotProps; } & DynamicSlots; declare const _default: = "value", M extends boolean = false>(__VLS_props: NonNullable>["props"], __VLS_ctx?: __VLS_PrettifyLocal>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable>["expose"], __VLS_setup?: Promise<{ props: __VLS_PrettifyLocal & Omit<{ readonly "onUpdate:modelValue"?: ((payload: GetModelValue) => any) | undefined; readonly "onUpdate:expanded"?: ((val: string[]) => any) | undefined; } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:expanded"> & TreeProps & Partial<{}>> & import("vue").PublicProps; expose(exposed: import("vue").ShallowUnwrapRef<{}>): void; attrs: any; slots: TreeSlots>; emit: ((evt: "update:modelValue", payload: GetModelValue) => void) & ((evt: "update:expanded", val: string[]) => void); }>) => import("vue").VNode & { __ctx?: Awaited; }; export default _default; type __VLS_PrettifyLocal = { [K in keyof T]: T[K]; } & {};