import { r as IDataProvider } from "./data-provider-Cq_ylpET.js"; type TreeItem = { /** Unique identifier within the tree. */ key: string; /** Visible label text. */ label: string; /** When true the node cannot have children and will not show an expand affordance. */ isLeaf?: boolean; /** Arbitrary application data associated with this node. */ data?: unknown; /** Icon name passed to an icon component, if icons are enabled. */ icon?: string; /** * CSS colour applied to the node's icon, overriding the inherited text * colour. Only meaningful when `icon` is set. Components that render the * icon from `icon` honour this; the rest ignore it. */ iconColor?: string; /** * CSS colour applied to the node's label. Inline, so it wins over the * selected/tickled text colours — keep it legible against both, or leave * it unset and let the component's theming handle selection contrast. */ textColor?: string; /** * Finder-style badge rendered alongside the label — e.g. a colour-tag chip * or a stack of them. Anything Lit can render (usually a `TemplateResult`), * or a DOM `Node` for the components that build their rows imperatively. * Placement is per-component: thumbnails-style lists put it before the * name, list-style views right-justify it on the same line. */ badge?: unknown; /** * Whether the label may be renamed in place. Only `ixfx-flat-list` * (`beginEdit`) uses it; other components ignore it. */ editable?: boolean; /** * Set to `false` to make this node unselectable, regardless of * `selectionFilter`. In `ixfx-tree-list`'s `checked` mode no checkbox is * drawn for it (see `alignCheckboxes`). Unselectable branches can still be * expanded, and their selectable descendants can still be selected. * Default: selectable. */ selectable?: boolean; /** Tooltip text shown on hover. */ tooltip?: string; /** Optional string value, e.g. for use as a command/route. */ value?: string; /** * Optional relative importance/magnitude of this node. Unitless — consumers * normalize it against whatever population of nodes is currently relevant * to them (e.g. `ixfx-hyperbolictree-list` normalizes across the currently * visible node set). Components that don't support weighting ignore it. */ weight?: number; }; /** A node in the tree, potentially containing lazily-loaded children. */ type TreeNode = { item: TreeItem; /** * Child nodes. * - `undefined` = children not yet loaded (component will call loadChildren if set) * - `[]` = confirmed leaf / empty branch * - non-empty array = loaded children */ children?: TreeNode[]; }; /** * Callback invoked when a node's children need to be loaded. * The AbortSignal is cancelled if the request is superseded (e.g. node collapsed before load completes). * May return children synchronously, as a promise, or as a streaming async iterable of batches. */ type LoadChildrenCallback = IDataProvider<{ node: TreeNode; depth: number; }, TreeNode>; /** * Predicate used by search/filter controllers to determine whether a node should be visible. * Receives depth so column-scoped filtering (e.g. in ixfx-miller-list) is possible. * Tree implementations that do not need depth can simply ignore the parameter. */ type TreeFilterPredicate = (node: TreeNode, depth: number) => boolean; /** * Controls how expanding a node affects its siblings. * - `'none'` — no constraint; any number of nodes may be expanded simultaneously * - `'depth'` — only one sibling at the same depth may be expanded at a time (accordion) * - `'global'` — only one node anywhere in the tree may be expanded at a time */ type TreeExclusivity = `none` | `depth` | `global`; /** * Restricts which kinds of nodes may enter the selection. * Applied as a guard in all interaction modes. * - `'none'` — no node can be selected (read-only / display-only) * - `'leaf'` — only leaf nodes are selectable * - `'branch'` — only branch nodes (nodes with children) are selectable * - `'all'` — both leaf and branch nodes are selectable */ type TreeSelectionFilter = `none` | `leaf` | `branch` | `all`; /** * Controls how pointer and keyboard gestures map to selection changes. * - `'implicit'` — single selection that follows the click; clicking always selects + toggles expand * - `'standard'` — single click selects+toggles; Ctrl/Cmd+click toggles item; Shift+click range-selects * - `'manual'` — component never auto-selects; use `select()`/`deselect()`/`clearSelection()` to drive state * - `'checked'` — checkboxes on every item; checkbox click toggles selection recursively; row click only expands/collapses * - `'vscode'` — like `standard` for clicks; Shift+arrow uses snapshot-based toggle-range */ type TreeInteractionMode = `implicit` | `standard` | `manual` | `checked` | `vscode`; export { TreeItem as a, TreeInteractionMode as i, TreeExclusivity as n, TreeNode as o, TreeFilterPredicate as r, TreeSelectionFilter as s, LoadChildrenCallback as t };