@logo-software/tree
Version:
A tree view represents a hierarchical view of information, where each item can have a number of subitems.
114 lines (113 loc) • 4.33 kB
TypeScript
/**
* @license
* Copyright LOGO YAZILIM SANAYİ VE TİCARET A.Ş. All Rights Reserved.
*
* Save to the extent permitted by law, you may not use, copy, modify,
* distribute or create derivative works of this material or any part
* of it without the prior written consent of LOGO YAZILIM SANAYİ VE TİCARET A.Ş. Limited.
* Any reproduction of this material must contain this notice.
*/
import { ElementRef, EventEmitter, OnInit } from '@angular/core';
import { HttpClient, HttpRequest, HttpResponse } from '@angular/common/http';
import { RouterLinkActive } from '@angular/router';
import { Tree } from './tree';
/**
* Almost anything can be represented in a tree structure. Examples include directories, organization hierarchies, biological classifications, countries, etc. The Tree component is a way of representing the hierarchical relationship between these things. You can also expand, collapse, and select a treeNode within a Tree.
*
* Add the below code to your code stack and give initializer parameters.
*
* <sub>app.component.html</sub>
*
* ```html
* <logo-tree [items]="items" [start]="0" [iconClasses]=""></logo-tree>
* ```
*/
export declare class TreeComponent implements OnInit {
private elem;
private http?;
/**
* group
*/
group: boolean;
/**
* Specifies one or more CSS classes to be used by the element. When set, this class will also be used by all child elements that don't have their own class.
*/
classes: string;
/**
* Specifies one or more CSS classes to be used by the element's icons. When set, this class will also be used by all child elements icons that don't have their own class.
*/
iconClasses?: string;
/**
* Menu items to show
*/
items: Tree[];
/**
* It indicates the starting level of the items to be displayed
*/
start: number;
/**
* Specifies the amount of indentation, in pixels, used to offset successive menu leaf levels in a hierarchy. The default value is 10 pixels.
*/
paddingLeft: number;
/**
* http request will be get items from server for each category opened
*/
request?: HttpRequest<any>;
/**
* Role information about which authorized people can view this menu item. Example: roles: ['ROLE_ADMIN', 'ROLE_DEVELOPER']
*/
roles: string[];
/**
* Item click event trigger. When clicked on any item this event will be called and pushes the item information to the given method.
*/
itemClick: EventEmitter<Tree>;
/**
* Category click event trigger. When clicked on any category item, this event will be called and pushes the item information to the given method.
*/
categoryClick: EventEmitter<Tree>;
/**
* The Matched router is activated this method will be triggered. It will push the tree item to the given method.
*/
routeItemActivated: EventEmitter<Tree>;
/**
* Item checkbox status change trigger. When clicked, clicked item will be emited
*/
itemCheckChange: EventEmitter<any>;
elementId: any;
/**
* Give HttpClient to the component. First import HttpClientModule to main Module of the app. For example.
* ```typescript
* @NgModule({ imports: [
* BrowserModule,
* HttpClientModule, // Add HttpClientModule
* ]
* })
* export class AppModule {
* }
* ```
* @param http
*/
constructor(elem: ElementRef, http?: HttpClient);
private _level;
get level(): any;
set level(level: any);
ngOnInit(): void;
generateElementId(): string;
open(routerLinkActive: RouterLinkActive): void;
recursiveParent(element: any): void;
getMenuList(): void;
onSuccessHandler(response: HttpResponse<Tree>): void;
htmlItemOnClick(item: Tree, $event?: MouseEvent): void;
$onItemClick(item: Tree): void;
$onItemCheckChange(item: any): void;
htmlCategoryOnClick(item: Tree, $event?: MouseEvent): void;
$onCategoryClick(item: Tree): void;
htmlSetPadding(level: any, start: any): string | 0;
componentSetPadding(level: any, start: any): string;
onRouteItemActivated(item: any): void;
/**
* set left padding size programmatically for collapsed menus.
* @param value
*/
setPadding(value?: number): void;
}