import { ID } from "../../types/index.mjs"; import { AtomProps } from "../Atom/Atom.vue.mjs"; import "../Atom/index.mjs"; import { NestedActiveMode, NestedOpenMode, NestedSelectionMode } from "../../composables/createNested/types.mjs"; import "../../composables/createNested/index.mjs"; import { MaybeRefOrGetter } from "vue"; //#region src/components/Treeview/types.d.ts interface TreeviewActivatorProps extends AtomProps { /** Namespace for dependency injection */ namespace?: string; } interface TreeviewActivatorSlotProps { /** Whether the parent item is expanded */ isOpen: boolean; /** Whether the parent item is a leaf node (no children) */ isLeaf: boolean; /** Whether the parent item is disabled */ isDisabled: boolean; /** Toggle the parent item's open/closed state */ flip: () => void; /** Attributes to bind to the activator element */ attrs: { 'role': 'button' | undefined; 'tabindex': -1; 'aria-disabled': boolean; 'data-disabled': true | undefined; 'data-open': true | undefined; 'disabled': boolean | undefined; 'type': 'button' | undefined; 'onClick': () => void; }; } interface TreeviewCheckboxProps extends AtomProps { /** Namespace for dependency injection */ namespace?: string; } interface TreeviewCheckboxSlotProps { /** Whether the item is selected */ isSelected: boolean; /** Whether the item is in a mixed/indeterminate state (some descendants selected) */ isMixed: boolean; /** Whether the item is disabled */ isDisabled: boolean; /** Toggle selection state */ toggle: () => void; /** Select this item */ select: () => void; /** Unselect this item */ unselect: () => void; /** Attributes to bind to the checkbox element */ attrs: { 'role': 'checkbox'; 'aria-checked': boolean | 'mixed'; 'aria-disabled': boolean; 'tabindex': -1; 'data-selected': true | undefined; 'data-disabled': true | undefined; 'data-mixed': true | undefined; 'onClick': () => void; }; } interface TreeviewCueProps extends AtomProps { /** Namespace for dependency injection */ namespace?: string; } interface TreeviewCueSlotProps { /** Whether the parent item is expanded */ isOpen: boolean; /** Whether the parent item is a leaf node (no children) */ isLeaf: boolean; /** Attributes to bind to the cue element */ attrs: { 'aria-hidden': true; 'data-state': 'open' | 'closed'; 'style': { visibility: 'visible' | 'hidden'; }; }; } interface TreeviewContentProps { /** Namespace for dependency injection */ namespace?: string; } interface TreeviewContentSlotProps { /** Whether the parent item is expanded */ isOpen: boolean; } interface TreeviewGroupProps extends AtomProps {} interface TreeviewGroupSlotProps { /** Attributes to bind to the group element */ attrs: { role: 'group'; }; } interface TreeviewIndicatorProps extends AtomProps { /** Namespace for dependency injection */ namespace?: string; } interface TreeviewIndicatorSlotProps { /** Whether the item is selected */ isSelected: boolean; /** Whether the item is in a mixed/indeterminate state */ isMixed: boolean; /** Attributes to bind to the indicator element */ attrs: { 'aria-hidden': true; 'data-state': 'checked' | 'unchecked' | 'indeterminate'; 'style': { visibility: 'visible' | 'hidden'; }; }; } interface TreeviewItemProps extends AtomProps { /** Unique identifier (auto-generated if not provided) */ id?: ID; /** * Value associated with this item * * @example * ```vue * * ``` */ value?: V; /** * Disables this item * * @example * ```vue * * ``` */ disabled?: boolean | MaybeRefOrGetter; /** Namespace for dependency injection */ namespace?: string; } interface TreeviewItemSlotProps { /** Unique identifier of this item */ id: ID; /** Value associated with this item */ value: V | undefined; /** Whether this item is selected */ isSelected: boolean; /** Whether this item is in a mixed/indeterminate state */ isMixed: boolean; /** Whether this item is disabled */ isDisabled: boolean; /** Whether this item is expanded */ isOpen: boolean; /** Whether this item is active/highlighted */ isActive: boolean; /** Whether this item is a leaf node (no children) */ isLeaf: boolean; /** Depth level in the tree (0 = root) */ depth: number; /** Select this item */ select: () => void; /** Unselect this item */ unselect: () => void; /** Toggle selection state */ toggle: () => void; /** Toggle open/closed state */ flip: () => void; /** Expand this item */ open: () => void; /** Collapse this item */ close: () => void; /** Activate/highlight this item */ activate: () => void; /** Deactivate/unhighlight this item */ deactivate: () => void; /** Attributes to bind to the item element */ attrs: { 'role': 'treeitem'; 'aria-disabled': boolean; 'aria-expanded': boolean | undefined; 'aria-level': number; 'aria-posinset': number; 'aria-current': 'true' | undefined; 'aria-selected': boolean; 'aria-setsize': number; 'data-active': true | undefined; 'data-disabled': true | undefined; 'data-open': true | undefined; 'data-selected': true | undefined; 'tabindex': 0 | -1 | undefined; 'style': { '--v0-treeview-depth': number; }; }; } interface TreeviewListProps extends AtomProps { /** Namespace for dependency injection */ namespace?: string; /** Whether multiple items can be selected (sets aria-multiselectable) */ multiselectable?: boolean; /** Accessible label for the tree */ label?: string; } interface TreeviewListSlotProps { /** Attributes to bind to the list element */ attrs: { 'role': 'tree'; 'aria-multiselectable': boolean; 'aria-label': string | undefined; 'onKeydown': (e: KeyboardEvent) => void; 'onFocusin': (e: FocusEvent) => void; }; } interface TreeviewSelectAllProps extends AtomProps { /** * Optional display label (passed through to slot and aria-label) * * @example * ```vue * * ``` */ label?: string; /** Disables this checkbox */ disabled?: boolean; /** Namespace for dependency injection */ namespace?: string; } interface TreeviewSelectAllSlotProps { /** Optional display label */ label?: string; /** Whether all items are selected */ isAllSelected: boolean; /** Whether some but not all items are selected */ isMixed: boolean; /** Whether this checkbox is disabled */ isDisabled: boolean; /** Select all items */ selectAll: () => void; /** Unselect all items */ unselectAll: () => void; /** Toggle between all selected and none selected */ toggleAll: () => void; /** Attributes to bind to the select-all element */ attrs: { 'role': 'checkbox'; 'aria-checked': boolean | 'mixed'; 'aria-disabled': boolean; 'aria-label': string | undefined; 'tabindex': 0 | undefined; 'data-state': 'checked' | 'unchecked' | 'indeterminate'; 'data-disabled': true | undefined; 'onClick': () => void; 'onKeydown': (e: KeyboardEvent) => void; }; } interface TreeviewRootProps { /** Namespace for dependency injection */ namespace?: string; /** * Disables the entire tree * * @example * ```vue * * ``` */ disabled?: boolean; /** * Auto-select non-disabled items on registration * * @example * ```vue * * ``` */ enroll?: boolean; /** * Prevents deselecting the last selected item * * @example * ```vue * * ``` */ mandatory?: boolean | 'force'; /** * Allows selecting multiple items * * @example * ```vue * * ``` */ multiple?: boolean; /** * Controls how nodes expand: 'multiple' (default) or 'single' (accordion) * * @example * ```vue * * ``` */ open?: NestedOpenMode; /** * Auto-expand all nodes on registration * * @example * ```vue * * ``` */ openAll?: boolean; /** * Opening a node also opens all its ancestors * * @example * ```vue * * ``` */ reveal?: boolean; /** * Controls how selection cascades: 'cascade' (default), 'independent', or 'leaf' * * @example * ```vue * * ``` */ selection?: NestedSelectionMode; /** * Controls active/highlight mode: 'single' (default) or 'multiple' * * @example * ```vue * * ``` */ active?: NestedActiveMode; } interface TreeviewRootSlotProps { /** Whether the tree is disabled */ isDisabled: boolean; /** Whether no items are selected */ isNoneSelected: boolean; /** Whether all items are selected */ isAllSelected: boolean; /** Whether some but not all items are selected */ isMixed: boolean; /** Select one or more items by ID */ select: (id: ID | ID[]) => void; /** Unselect one or more items by ID */ unselect: (id: ID | ID[]) => void; /** Toggle selection of one or more items by ID */ toggle: (id: ID | ID[]) => void; /** Select all items */ selectAll: () => void; /** Unselect all items */ unselectAll: () => void; /** Expand all non-leaf nodes */ expandAll: () => void; /** Collapse all nodes */ collapseAll: () => void; } //#endregion export { TreeviewActivatorProps, TreeviewActivatorSlotProps, TreeviewCheckboxProps, TreeviewCheckboxSlotProps, TreeviewContentProps, TreeviewContentSlotProps, TreeviewCueProps, TreeviewCueSlotProps, TreeviewGroupProps, TreeviewGroupSlotProps, TreeviewIndicatorProps, TreeviewIndicatorSlotProps, TreeviewItemProps, TreeviewItemSlotProps, TreeviewListProps, TreeviewListSlotProps, TreeviewRootProps, TreeviewRootSlotProps, TreeviewSelectAllProps, TreeviewSelectAllSlotProps };