import { UiElement } from '../shared/element.js'; import type { UiTreeNode } from './tree-node.js'; import type { TreeNodeToggleDetail, TreeLazyLoadDetail } from './tree-view-shared.js'; export * from './tree-node.js'; export type { TreeNodeToggleDetail, TreeLazyLoadDetail } from './tree-view-shared.js'; export type TreeViewSize = 'xs' | 'sm'; /** * Carbon `TreeView`: a `role=tree` of nested ``s with a Carbon label. Click or * Space selects (and makes the node `active`); `multiselect` toggles with Ctrl / ⌘ + click or Space and * selects all with Ctrl + A. Up / Down move through the visible nodes, Home / End jump, Left / * Right collapse / expand (or move to the parent / first child). Sizes sm 32px (default) / xs 24px. * * @slot - Top-level ``s * @fires ui-select - detail: { selected: string[], value } after a selection change * @fires ui-activate - detail: { active } when a node becomes the active one * @csspart label - The tree label * @csspart tree - The `role=tree` container * @cssprop --ui-tree-selected / --ui-tree-mark - The selected row's fill and mark (on ``, with the other --ui-tree-* settings) */ export declare class UiTreeView extends UiElement { static readonly styles: import("lit").CSSResult[]; label: string; hideLabel: boolean; size: TreeViewSize; multiselect: boolean; /** Selected node values. */ selected: string[]; /** The node that was last activated (4px marker). */ active: string; private readonly ids; connectedCallback(): void; disconnectedCallback(): void; /** Every node, document order. */ get nodes(): UiTreeNode[]; /** Nodes whose every ancestor is expanded (what the user can see / arrow through). */ private visibleNodes; protected updated(): void; private sync; private nodeOf; /** Replace the selection with `node`, or with `toggle` add / remove it (Ctrl / ⌘ + click, Space in a multiselect tree). */ private select; private activate; private focusNode; private readonly onFocusIn; private readonly onClick; private readonly onKeydown; private readonly typeahead; /** APG: typing a character moves to the next visible node whose label (not its end content) starts with it. */ private typeaheadTo; private moveFocus; /** Right / Left: expand or go to the first child (a lazy branch still loading has none yet); collapse or go to the parent. */ private sideStep; private enter; private selectAll; render(): import("lit-html").TemplateResult<1>; } export interface TreeSelectDetail { selected: string[]; value: string; } export interface TreeActivateDetail { active: string; } export interface UiTreeViewEventMap extends HTMLElementEventMap { 'ui-select': CustomEvent; 'ui-activate': CustomEvent; 'ui-toggle': CustomEvent; 'ui-lazy-load': CustomEvent; } /** Typed listeners for UiTreeView's events (declaration merging with the class). */ export interface UiTreeView { addEventListener(type: K, listener: (this: UiTreeView, event: UiTreeViewEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: UiTreeView, event: UiTreeViewEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare global { interface HTMLElementTagNameMap { 'ui-tree-view': UiTreeView; } }