UNPKG

carbon-components-angular

Version:
96 lines (92 loc) 3.42 kB
/** * * carbon-angular v0.0.0 | tree-node.component.d.ts * * Copyright 2014, 2024 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 { EventEmitter, OnInit, OnDestroy, TemplateRef, AfterContentChecked } from "@angular/core"; import { TreeViewService } from "./treeview.service"; import { Node } from "./tree-node.types"; import * as i0 from "@angular/core"; export declare class TreeNodeComponent implements AfterContentChecked, OnInit, OnDestroy { private treeViewService; static treeNodeCount: number; id: string; active: boolean; disabled: boolean; expanded: boolean; label: string | TemplateRef<any>; labelContext: any; selected: boolean; value: any; icon: string | TemplateRef<any>; iconContext: any; children: Node[]; /** * Determines the depth of the node * Calculated by default when passing `Node` array to `TreeViewComponent`, manual entry required otherwise */ depth: number; /** * Simple way to set all attributes of Node component via node object * Would simplify setting component attributes when dynamically rendering node. */ set node(node: Node); get node(): Node; nodeFocus: EventEmitter<any>; nodeBlur: EventEmitter<any>; nodeSelect: EventEmitter<any>; nodetoggle: EventEmitter<any>; offset: any; private _node; private subscription; constructor(treeViewService: TreeViewService); /** * Caclulate offset for margin/padding */ ngAfterContentChecked(): void; /** * Highlight the node */ ngOnInit(): void; /** * Unsubscribe from subscriptions */ ngOnDestroy(): void; /** * Selects the node and emits the event from the tree view component * @param event */ nodeClick(event: any): void; /** * Calculate the node offset * @returns Number */ calculateOffset(): number; emitFocusEvent(event: any): void; emitBlurEvent(event: any): void; /** * Expand children if not disabled * @param event: Event */ toggleExpanded(event: any): void; /** * Manages the keyboard accessibility for children expansion & selection */ navigateTree(event: KeyboardEvent): void; isTemplate(value: any): boolean; isProjected(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<TreeNodeComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TreeNodeComponent, "cds-tree-node", never, { "id": "id"; "active": "active"; "disabled": "disabled"; "expanded": "expanded"; "label": "label"; "labelContext": "labelContext"; "selected": "selected"; "value": "value"; "icon": "icon"; "iconContext": "iconContext"; "children": "children"; "depth": "depth"; "node": "node"; }, { "nodeFocus": "nodeFocus"; "nodeBlur": "nodeBlur"; "nodeSelect": "nodeSelect"; "nodetoggle": "nodetoggle"; }, never, ["*"], false>; }