carbon-components-angular
Version:
Next generation components
99 lines (95 loc) • 3.19 kB
TypeScript
/**
*
* carbon-angular v0.0.0 | treeview.component.d.ts
*
* Copyright 2014, 2025 IBM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { TemplateRef, EventEmitter, AfterViewInit, ElementRef, OnInit, OnDestroy } from "@angular/core";
import { EventOnNode, Node } from "./tree-node.types";
import { TreeViewService } from "./treeview.service";
import * as i0 from "@angular/core";
/**
* Get started with importing the module:
*
* ```typescript
* import { TreeviewModule } from 'carbon-components-angular';
* ```
*
* [See demo](../../?path=/story/components-tree-view--basic)
*/
export declare class TreeViewComponent implements AfterViewInit, OnInit, OnDestroy {
private document;
treeViewService: TreeViewService;
private elementRef;
/**
* Pass `Node[]` array to have tree view render the nodes
* Passing value will disregard projected content
*/
set tree(treeNodes: Node[]);
get tree(): Node[];
static treeViewCount: number;
id: string;
/**
* Tree view label
*/
label: string | TemplateRef<any>;
/**
* Optional context for label if it's a template
*/
labelContext: any;
/**
* Specify the size of the list items in the tree
*/
size: "xs" | "sm";
/**
* **Experimental** - Enable to select multiple nodes
*/
set isMultiSelect(isMulti: boolean);
select: EventEmitter<Node | Node[]>;
toggle: EventEmitter<Node>;
root: ElementRef;
private treeWalker;
private _tree;
private subscription;
constructor(document: Document, treeViewService: TreeViewService, elementRef: ElementRef);
/**
* Subscribe for node selection
*/
ngOnInit(): void;
ngOnDestroy(): void;
/**
* Initialize tree walker to support keyboard navigation
*/
ngAfterViewInit(): void;
/**
* Navigate tree using tree walker
* @param event - KeyboardEvent
*/
navigateTree(event: KeyboardEvent): void;
/**
* Propagate node toggle event
* @param eventOnNode - EventOnNode
*/
onNodeToggle(eventOnNode: EventOnNode): void;
/**
* Node focus change
* @param node - Node
*/
onNodeFocusChange(node: Node): void;
isTemplate(value: any): boolean;
isProjected(): boolean;
private copyNode;
static ɵfac: i0.ɵɵFactoryDeclaration<TreeViewComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<TreeViewComponent, "cds-tree-view", never, { "tree": "tree"; "id": "id"; "label": "label"; "labelContext": "labelContext"; "size": "size"; "isMultiSelect": "isMultiSelect"; }, { "select": "select"; "toggle": "toggle"; }, never, ["*"], false>;
}