/** Core */ import { CoreComponent } from "cmf.core/src/core"; /** Angular2 */ import * as ng from "@angular/core"; /** DataModel */ import * as cvs from "../columnView/columnViewStructure"; /** Service */ import { TreeViewNodeService, TreeViewModelNode } from "./treeViewNodeService"; export declare const TREE_VIEW_PATH_SEPARATOR: string; export declare const TREE_VIEW_ALT_PATH_SEPARATOR: string; export declare const TREE_VIEW_PATH_ITEM_INDEX_SEPARATOR: string; /** * TreeView data model that is based on ColumnView data model */ export declare type TreeViewModel = cvs.ColumnViewModel; export interface TreeViewModelItem extends cvs.ColumnViewItem { subName?: string; index?: number; } export { TreeViewModelNode }; export interface TreeViewModelLeaf extends cvs.ColumnViewLeaf { path?: string; index?: number; alternativePath?: string; } /** * Node Tag to use as a base model for the tag that is carried by the Tree nodes */ export interface NodeTag { loadTag: any; } /** * TreeViewNode Component to be used only by TreeView Component */ export declare class TreeViewNode extends CoreComponent { private _elementRef; private _service; /** * Path for selected leaf */ private _pathForSelectedLeaf; /** * Load tag */ private _loadTag; /** * Path */ private _parentPath; /** * Alt Path */ private _alternativeParentPath; /** * Index in parent */ private _indexInParent; /** * Data page (In case 'Load more' is enabled) */ private _dataPage; /** * Path for selected leaf for children */ _pathForSelectedLeafForChildren: string; /** * Path */ _path: string; /** * Alternative Path */ _alternativePath: string; /** * Data model */ _data: TreeViewModelNode; /** * If node is loading */ _loading: boolean; /** * If node is loading more chidren */ _loadMoreLoading: boolean; /** * Node icon class */ _nodeIconClass: string; /** * Title that appears on node before it was loaded */ titleBeforeLoading: string; /** * Selected value */ value: TreeViewModelLeaf; /** * If 'Load more' is enabled */ loadMoreEnabled: boolean; /** * If all data is loaded */ allDataLoaded: boolean; /** * Index in parent node */ index: number; /** * Parent path */ path: string; /** * Data load tag to provide to the service */ loadTag: any; /** * Node icon class */ nodeIconClass: string; /** * TreeViewNode data */ data: TreeViewModelNode; /** * Path for selected leaf */ pathForSelectedLeaf: string; /** * When selected leaf(value) change */ valueChange: ng.EventEmitter; /** * When node collapses change */ nodeCollapse: ng.EventEmitter; /** * When node data was loaded */ dataLoaded: ng.EventEmitter; /** * Constructor */ constructor(_elementRef: ng.ElementRef, _service: TreeViewNodeService); private setPath; /** * When this node selected a leaf * Bubble event up until it reaches to the root (TreeView component) */ onSelectLeaf(leaf: TreeViewModelLeaf, index: number): void; /** * When a child node selected a leaf * Bubble event up until it reaches to the root (TreeView component) */ onSelectedLeafFromChild(leaf: TreeViewModelLeaf): void; /** * When a child node collapses * Bubble event up until it reaches to the root (TreeView component) */ onChildNodeCollapse(): void; /** * When a child node was loaded */ onChildNodeLoaded(childIndex: number, data: TreeViewModelNode): void; /** * Try select leaf */ private trySelectLeaf; /** * Load data until next child in path is available */ private loadDataUntilNextChildInPathIsAvailable; /** * Open nodes by path */ private openNodeByPath; /** * Set data */ private setData; /** * Loads data for the node */ private loadDataOnDemand; /** * When this node opens or closes * Bubble event up until it reaches to the root (TreeView component) */ open(open: boolean, forceLoad?: boolean): Promise; }