@ux-aspects/ux-aspects
Version:
Open source user interface framework for building modern, responsive, mobile big data applications
69 lines (68 loc) • 2.77 kB
TypeScript
import { TemplateRef } from '@angular/core';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { OverlayTrigger } from '../tooltip/index';
import { HierarchyBarNodeChildren } from './interfaces/hierarchy-bar-node-children.interface';
import { HierarchyBarIconContext } from './interfaces/hierarchy-bar-node-icon-context.interface';
import { HierarchyBarNode } from './interfaces/hierarchy-bar-node.interface';
import * as i0 from "@angular/core";
export declare class HierarchyBarService {
/** Define the list of selected nodes */
nodes$: BehaviorSubject<HierarchyBarNode[]>;
/** Define a custom loading indicator */
loadingIndicator: TemplateRef<void>;
/** Define a custom overflow template */
overflowTemplate: TemplateRef<void>;
/** Define the events that show the popover when interacting with the arrows */
popoverShowTriggers: OverlayTrigger[];
/** Define the events that hide the popover when interacting with the arrows */
popoverHideTriggers: OverlayTrigger[];
/** Emit the selected node when it changes */
selection$: Subject<HierarchyBarNode>;
/** Define the aria label for the show siblings popover button */
showSiblingsAriaLabel: string;
/** Allow a custom icon template to be specified */
icon: TemplateRef<HierarchyBarIconContext>;
/** Store the root node */
private _root;
/** Store nodes as a flattened list */
private _nodes;
/**
* Store the root node of the hierarchy tree
*/
setRootNode(root: HierarchyBarNode): void;
/**
* Select a node. This causes all nodes to be
* deselected and the path to the selected node
* to be selected
*/
selectNode(node: HierarchyBarNode): void;
/**
* Handles getting children with support for both arrays and observables
*/
getChildren(node: HierarchyBarNode): Observable<HierarchyBarNodeChildren>;
/**
* Utility function to get the sibling nodes, taking into account that
* a node may be a root node and may not have a parent.
*/
getSiblings(node: HierarchyBarNode): Observable<HierarchyBarNodeChildren>;
/**
* Traverses all the parents to ensure they are selected
*/
private select;
/**
* Deselects all nodes
*/
private deselectAll;
/**
* Gets all the nodes in the tree as a flat array.
* It also stores the parent node in a parent property
* on the node for easy traversal in both directions
*/
private getNodeList;
/**
* Gets all selected nodes from the parent node.
*/
private getSelectedChildren;
static ɵfac: i0.ɵɵFactoryDeclaration<HierarchyBarService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<HierarchyBarService>;
}