/** * Copyright Aquera Inc 2023 * * This source code is licensed under the BSD-3-Clause license found in the * LICENSE file in the root directory of this source tree. */ import { TemplateResult } from 'lit'; import NileElement from '../internal/nile-element'; import NileTreeItem from '../nile-tree-item/nile-tree-item'; import type { CSSResultGroup } from 'lit'; /** * @summary Trees allow you to display a hierarchical list of selectable [tree items](/components/tree-item). Items with children can be expanded and collapsed as desired by the user. * * @event {{ selection: NileTreeItem[] }} nile-selection-change - Emitted when a tree item is selected or deselected. * * @slot - The default slot. * @slot expand-icon - The icon to show when the tree item is expanded. Works best with ``. * @slot collapse-icon - The icon to show when the tree item is collapsed. Works best with ``. * * @csspart base - The component's base wrapper. * * @cssproperty [--indent-size=var(--nile-spacing-medium)] - The size of the indentation for nested items. * @cssproperty [--indent-guide-color=var(--nile-color-neutral-200)] - The color of the indentation line. * @cssproperty [--indent-guide-offset=0] - The amount of vertical spacing to leave between the top and bottom of the * indentation line's starting position. * @cssproperty [--indent-guide-style=solid] - The style of the indentation line, e.g. solid, dotted, dashed. * @cssproperty [--indent-guide-width=0] - The width of the indentation line. */ export declare class NileTree extends NileElement { static styles: CSSResultGroup; defaultSlot: HTMLSlotElement; expandedIconSlot: HTMLSlotElement; collapsedIconSlot: HTMLSlotElement; /** * The selection behavior of the tree. Single selection allows only one node to be selected at a time. Multiple * displays checkboxes and allows more than one node to be selected. Leaf allows only leaf nodes to be selected. */ selection: 'single' | 'multiple' | 'leaf'; private lastFocusedItem; private mutationObserver; private clickTarget; connectedCallback(): Promise; disconnectedCallback(): void; private getExpandButtonIcon; private initTreeItem; private handleTreeChanged; private syncTreeItems; private selectItem; private getAllTreeItems; private focusItem; private handleKeyDown; private handleClick; handleMouseDown(event: MouseEvent): void; private handleFocusOut; private handleFocusIn; private handleSlotChange; handleSelectionChange(): Promise; /** @internal Returns the list of tree items that are selected in the tree. */ get selectedItems(): NileTreeItem[]; /** @internal Gets focusable tree items in the tree. */ getFocusableItems(): NileTreeItem[]; render(): TemplateResult<1>; } export default NileTree; declare global { interface HTMLElementTagNameMap { 'nile-tree': NileTree; } }