import { ElementRef, OnInit, DoCheck, EventEmitter, IterableDiffers } from '@angular/core'; import { CfCoreComponent } from '../core/core.component'; import { TreeComponent } from 'angular-tree-component'; import { TreeviewModel } from '../../models/treeview/treeview.model'; import { TreeviewStylingModel } from '../../models/treeview/treeview-styling.model'; import { TemplateService } from '../../services/template-service/template.service'; /** *

CF TreeView Component

*
 * 
 * import {{'{'}} TreeviewModel {{'}'}} from 'cedrus-fusion'
 * import {{'{'}} TreeviewStylingModel {{'}'}} from 'cedrus-fusion'
 * <cf-treeview></cf-treeview>
 * 
 * 
*/ export declare class CfTreeviewComponent extends CfCoreComponent implements OnInit, DoCheck { /**@hidden */ elementRef: ElementRef; /** @hidden * An array for selected items IDs. Each item ID must be string. */ selectedItems: any[]; /**@hidden * Identifier for template for each item. */ itemTemplate: any; /** *
{{'{'}}
     *  display: boolean,            // Default: true.
     *  disable: boolean,            // Default: false.
     *  items: [],                   // Array of items to display.
     *  options:{{'{'}}
     *   idField: string,            // Key in the items array to refer to as the id of the item. Default: id.
     *   displayField: string,       // Key in the items array to refer to as the display of the item. Default: name.
     *   childrenField: string,      // Key in the items array to refer to as the id of the item. Default: children.
     *   isExpandedField: string,    // Key in the items array to refer to as the id of the item. Default: expanded.
     *   selectable: boolean,        // Whether the items are selectable or not. Default: true.
     *   allowDrag: boolean          // Whether the items are draggable or not. Default: true.
     *   animateExpand: boolean      // Enable or disable animation. Default: false.
     * {{'}'}}
     * 
* *

Example

*
{{'{'}}
       *  display: true,
     *  items: [
     *   {{'{'}}
     *    itemID: '1',
     *    displayName: 'Microsoft',
     *    isExpanded: false
     *   {{'}'}},
     *   {{'{'}}
     *    itemID: '2',
     *    isExpanded: true,
     *    displayName: 'Apple',
     *    childrenItems: [
     *     {{'{'}}
     *       itemID: '2',
     *       isExpanded: false,
     *       displayName: 'iPhone'
     *      {{'}'}}
     *    ]
     *   {{'}'}}
     *   ],
     *  options:{{'{'}}
     *   idField: 'itemID',
     *   displayField: 'displayName',
     *   childrenField: 'childrenItems',
     *   isExpandedField: 'isExpanded',
     *   selectable: true,
     *   allowDrag: false,
     *   animateExpand: false
     *  {{'}'}}
       *{{'}'}}
       * 
*/ properties: TreeviewModel; /** *

dynamicClass: function() -> string, // Function that returns name of the class

*

class: string // Name of the css class selector

*

themeColor: string // primary/accent/warn

*
     *{{'{'}}
     *	// Container surrounding the TreeView
     *	container:{{'{'}}
     *		dynamicClass,
     *		class
     *	{{'}'}},
     *	// styling of the item
     *	item:{{'{'}}
     *		dynamicClass,
     *		class,
     *		themeColor
     *	{{'}'}}
     *{{'}'}}
     * 
*/ styling: TreeviewStylingModel; /** *

Emitting event with array of selected items

*/ cfSelected: EventEmitter; /** *

Emitting event on move

*/ onMoveNode: EventEmitter; /**@hidden * Identifier to register TreeComponent component. */ tree: TreeComponent; /**@hidden * Object to register element state and compute differences. */ differ: any; /**@hidden */ constructor(/**@hidden */ elementRef: ElementRef, /**@hidden */ templateService: TemplateService, differs: IterableDiffers); /**@hidden */ ngOnInit(): void; /**@hidden */ ngDoCheck(): void; /**@hidden * Function called when TreeComponent emmit his events after user iteraction with it. */ onEvent($event: any): void; /**@hidden * It is function for selecting tree items * @param node it is json item object * @param $event it is angular original event for angular material md-checkbox */ check(node: any, $event: any): void; /** @hidden * Function to find all checked tree items. * @param items array of tree items */ findCheckedItems(items: any): void; /** @hidden * Function to update array with selected items IDs. */ updateSelectedItems(): void; /**@hidden * Function to select/unselect item by it checked property and same for it childrens. * @param node tree item object * @param checked item checked state */ updateChildNodesCheckBox(node: any, checked: any): void; /**@hidden * Function to update item parents checked states * @param node tree item object */ updateParentNodesCheckBox(node: any): void; }