ng2-tree
- Version 3.0.0
- Published
- 571 kB
- 2 dependencies
- MIT license
Install
npm i ng2-tree
yarn add ng2-tree
pnpm add ng2-tree
Overview
angular2 component for visualizing data that can be naturally represented as a tree
Index
Functions
Classes
Tree
- addChild()
- addSibling()
- checked
- checkedChildren
- checkedChildrenAmount()
- children
- childrenAreBeingLoaded()
- childrenAsync
- childrenShouldBeLoaded()
- childrenWereLoaded()
- createNode()
- disableCollapseOnInit()
- foldingCssClass
- foldingType
- hasChild()
- hasChildren()
- hasCustomMenu()
- hasDeferredChildren()
- hasLeftMenu()
- hasLoadedChildern()
- hasRightMenu()
- hasSibling()
- id
- isBeingRenamed()
- isBranch()
- isCollapsedOnInit()
- isLeaf()
- isModified()
- isNew()
- isNodeCollapsed()
- isNodeExpanded()
- isRenamable()
- isRoot()
- isStatic()
- isValueEmpty()
- keepNodesInDOM()
- leftMenuTemplate
- loadedChildrenAmount()
- loadingChildrenRequested()
- markAsBeingRenamed()
- markAsModified()
- markAsNew()
- menuItems
- node
- nodeTemplate
- parent
- positionInParent
- reloadChildren()
- removeChild()
- removeItselfFromParent()
- selectionAllowed
- setChildren()
- swapWithSibling()
- switchFoldingType()
- toTreeModel()
- value
TreeInternalComponent
- applyNewValue()
- checkboxElementRef
- controller
- hasCustomMenu()
- isLeftMenuVisible
- isReadOnly
- isRightMenuVisible
- isRootHidden()
- isSelected
- ngAfterViewInit()
- ngOnChanges()
- ngOnDestroy()
- ngOnInit()
- nodeElementRef
- onMenuItemSelected()
- onNodeChecked()
- onNodeSelected()
- onNodeUnchecked()
- onNodeUnselected()
- onSwitchFoldingType()
- ɵcmp
- ɵfac
- settings
- shouldShowInputForTreeValue()
- showLeftMenu()
- showRightMenu()
- switchNodeCheckStatus()
- template
- tree
- treeService
- updateCheckboxState()
TreeService
- deleteController()
- draggedStream()
- fireMenuItemSelected()
- fireNodeChecked()
- fireNodeCreated()
- fireNodeIndetermined()
- fireNodeMoved()
- fireNodeRemoved()
- fireNodeRenamed()
- fireNodeSelected()
- fireNodeSwitchFoldingType()
- fireNodeUnchecked()
- fireNodeUnselected()
- getController()
- hasController()
- loadNextLevel$
- menuItemSelected$
- nodeChecked$
- nodeCollapsed$
- nodeCreated$
- nodeExpanded$
- nodeIndetermined$
- nodeMoved$
- nodeRemoved$
- nodeRenamed$
- nodeSelected$
- nodeUnchecked$
- nodeUnselected$
- ɵfac
- ɵprov
- setController()
- unselectStream()
Interfaces
Enums
Type Aliases
Functions
function defaultsDeep
defaultsDeep: (target: any, ...sources: any[]) => any;
function get
get: (value: any, path: string, defaultValue?: any) => any;
function has
has: (value: any, prop: string) => boolean;
function includes
includes: (target: string | any[], value: any) => boolean;
function isEmpty
isEmpty: (value: any[] | string) => boolean;
function isEscapePressed
isEscapePressed: (e: KeyboardEvent) => boolean;
function isFunction
isFunction: (value: any) => boolean;
function isLeftButtonClicked
isLeftButtonClicked: (e: MouseEvent) => boolean;
function isNil
isNil: (value: any) => boolean;
function isRightButtonClicked
isRightButtonClicked: (e: MouseEvent) => boolean;
function omit
omit: (value: any, propsToSkip: string | string[]) => any;
function once
once: (fn: Once) => Once;
function size
size: (value: any[]) => number;
function trim
trim: (value: string) => string;
Classes
class CapturedNode
class CapturedNode {}
constructor
constructor(anElement: ElementRef, aTree: Tree);
property element
readonly element: ElementRef;
property tree
readonly tree: Tree;
method canBeDroppedAt
canBeDroppedAt: (element: ElementRef) => boolean;
method contains
contains: (other: ElementRef) => boolean;
method sameAs
sameAs: (other: ElementRef) => boolean;
class FoldingType
class FoldingType {}
class LoadNextLevelEvent
class LoadNextLevelEvent extends NodeEvent {}
constructor
constructor(node: Tree);
class MenuItemSelectedEvent
class MenuItemSelectedEvent extends NodeEvent {}
constructor
constructor(node: Tree, selectedItem: string);
property selectedItem
selectedItem: string;
class Ng2TreeSettings
class Ng2TreeSettings {}
property enableCheckboxes
enableCheckboxes?: boolean;
property rootIsVisible
rootIsVisible?: boolean;
Indicates root visibility in the tree. When true - root is invisible. Ng2TreeSettings#rootIsVisible boolean
property showCheckboxes
showCheckboxes?: boolean;
class NodeCheckedEvent
class NodeCheckedEvent extends NodeEvent {}
constructor
constructor(node: Tree);
class NodeCollapsedEvent
class NodeCollapsedEvent extends NodeEvent {}
constructor
constructor(node: Tree);
class NodeCreatedEvent
class NodeCreatedEvent extends NodeDestructiveEvent {}
constructor
constructor(node: Tree);
class NodeDestructiveEvent
class NodeDestructiveEvent extends NodeEvent {}
constructor
constructor(node: Tree);
class NodeDraggableDirective
class NodeDraggableDirective implements OnDestroy, OnInit {}
constructor
constructor( element: ElementRef, nodeDraggableService: NodeDraggableService, renderer: Renderer2);
property DATA_TRANSFER_STUB_DATA
static DATA_TRANSFER_STUB_DATA: string;
property element
element: ElementRef;
property nodeDraggable
nodeDraggable: ElementRef;
property ɵdir
static ɵdir: i0.ɵɵDirectiveDeclaration< NodeDraggableDirective, '[nodeDraggable]', never, { nodeDraggable: { alias: 'nodeDraggable'; required: false }; tree: { alias: 'tree'; required: false }; }, {}, never, never, false, never>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<NodeDraggableDirective, never>;
property tree
tree: Tree;
method ngOnDestroy
ngOnDestroy: () => void;
method ngOnInit
ngOnInit: () => void;
class NodeDraggableEvent
class NodeDraggableEvent {}
constructor
constructor(captured: CapturedNode, target: ElementRef);
property captured
captured: CapturedNode;
property target
target: ElementRef;
class NodeDraggableService
class NodeDraggableService {}
property draggableNodeEvents$
draggableNodeEvents$: Subject<NodeDraggableEvent>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<NodeDraggableService, never>;
property ɵprov
static ɵprov: i0.ɵɵInjectableDeclaration<NodeDraggableService>;
method captureNode
captureNode: (node: CapturedNode) => void;
method fireNodeDragged
fireNodeDragged: (captured: CapturedNode, target: ElementRef) => void;
method getCapturedNode
getCapturedNode: () => CapturedNode;
method releaseCapturedNode
releaseCapturedNode: () => void;
class NodeEditableDirective
class NodeEditableDirective implements OnInit {}
constructor
constructor(renderer: Renderer2, elementRef: ElementRef);
property nodeValue
nodeValue: string;
property ɵdir
static ɵdir: i0.ɵɵDirectiveDeclaration< NodeEditableDirective, '[nodeEditable]', never, { nodeValue: { alias: 'nodeEditable'; required: false } }, { valueChanged: 'valueChanged' }, never, never, false, never>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<NodeEditableDirective, never>;
property valueChanged
valueChanged: EventEmitter<NodeEditableEvent>;
method applyNewValue
applyNewValue: (newNodeValue: string) => void;
method applyNewValueByLoosingFocus
applyNewValueByLoosingFocus: (newNodeValue: string) => void;
method cancelEditing
cancelEditing: () => void;
method ngOnInit
ngOnInit: () => void;
class NodeEvent
class NodeEvent {}
constructor
constructor(node: Tree);
property node
node: Tree;
class NodeExpandedEvent
class NodeExpandedEvent extends NodeEvent {}
constructor
constructor(node: Tree);
class NodeIndeterminedEvent
class NodeIndeterminedEvent extends NodeEvent {}
constructor
constructor(node: Tree);
class NodeMenuComponent
class NodeMenuComponent implements OnInit, OnDestroy {}
constructor
constructor(renderer: Renderer2, nodeMenuService: NodeMenuService);
property availableMenuItems
availableMenuItems: NodeMenuItem[];
property menuContainer
menuContainer: any;
property menuItems
menuItems: NodeMenuItem[];
property menuItemSelected
menuItemSelected: EventEmitter<NodeMenuItemSelectedEvent>;
property ɵcmp
static ɵcmp: i0.ɵɵComponentDeclaration< NodeMenuComponent, 'node-menu', never, { menuItems: { alias: 'menuItems'; required: false } }, { menuItemSelected: 'menuItemSelected' }, never, never, false, never>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<NodeMenuComponent, never>;
method ngOnDestroy
ngOnDestroy: () => void;
method ngOnInit
ngOnInit: () => void;
method onMenuItemSelected
onMenuItemSelected: (e: MouseEvent, selectedMenuItem: NodeMenuItem) => void;
class NodeMenuService
class NodeMenuService {}
property nodeMenuEvents$
nodeMenuEvents$: Subject<NodeMenuEvent>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<NodeMenuService, never>;
property ɵprov
static ɵprov: i0.ɵɵInjectableDeclaration<NodeMenuService>;
method fireMenuEvent
fireMenuEvent: (sender: HTMLElement, action: NodeMenuAction) => void;
method hideMenuForAllNodesExcept
hideMenuForAllNodesExcept: (treeElementRef: ElementRef) => void;
method hideMenuStream
hideMenuStream: (treeElementRef: ElementRef) => Observable<any>;
class NodeMovedEvent
class NodeMovedEvent extends NodeDestructiveEvent {}
constructor
constructor(node: Tree, previousParent: Tree);
property previousParent
previousParent: Tree;
class NodeRemovedEvent
class NodeRemovedEvent extends NodeDestructiveEvent {}
constructor
constructor(node: Tree, lastIndex: number);
property lastIndex
lastIndex: number;
class NodeRenamedEvent
class NodeRenamedEvent extends NodeDestructiveEvent {}
constructor
constructor( node: Tree, oldValue: string | RenamableNode, newValue: string | RenamableNode);
property newValue
newValue: string | RenamableNode;
property oldValue
oldValue: string | RenamableNode;
class NodeSelectedEvent
class NodeSelectedEvent extends NodeEvent {}
constructor
constructor(node: Tree);
class NodeUncheckedEvent
class NodeUncheckedEvent extends NodeEvent {}
constructor
constructor(node: Tree);
class NodeUnselectedEvent
class NodeUnselectedEvent extends NodeEvent {}
constructor
constructor(node: Tree);
class SafeHtmlPipe
class SafeHtmlPipe implements PipeTransform {}
constructor
constructor(sanitizer: DomSanitizer);
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<SafeHtmlPipe, never>;
property ɵpipe
static ɵpipe: i0.ɵɵPipeDeclaration<SafeHtmlPipe, 'safeHtml', false>;
method transform
transform: (value: string) => SafeHtml;
class Tree
class Tree {}
constructor
constructor(node: TreeModel, parent?: Tree, isBranch?: boolean);
Build an instance of Tree from an object implementing TreeModel interface.
Parameter model
A model that is used to build a tree.
Parameter parent
An optional parent if you want to build a tree from the model that should be a child of an existing Tree instance.
Parameter isBranch
An option that makes a branch from created tree. Branch can have children.
property checked
checked: boolean;
property checkedChildren
readonly checkedChildren: Tree[];
property children
readonly children: Tree[];
Get children of the current tree.
Returns
{Tree[]} The children of the current tree.
property childrenAsync
readonly childrenAsync: Observable<Tree[]>;
By getting value from this property you start process of loading node's children using
loadChildren
function. Once children are loadedloadChildren
function won't be called anymore and loaded for the first time children are emitted in case of subsequent calls.Returns
{Observable<Tree[]>} An observable which emits children once they are loaded.
property foldingCssClass
readonly foldingCssClass: string;
Get a css class for element which displayes folding state - expanded, collapsed or leaf
Returns
{string} A string icontaining css class (classes)
property foldingType
readonly foldingType: FoldingType;
Get a current folding type: expanded, collapsed or leaf.
Returns
{FoldingType} A folding type of the current tree.
property id
id: string | number;
property leftMenuTemplate
readonly leftMenuTemplate: string;
Get a html template to render for an element activatin left menu of a node.
Returns
{string} A string representing a html template.
property menuItems
readonly menuItems: NodeMenuItem[];
Get menu items of the current tree.
Returns
{NodeMenuItem[]} The menu items of the current tree.
property node
node: TreeModel;
property nodeTemplate
readonly nodeTemplate: string;
Get a html template to render before every node's name.
Returns
{string} A string representing a html template.
property parent
parent: Tree;
property positionInParent
readonly positionInParent: number;
Get a node's position in its parent.
Returns
{number} The position inside a parent.
property selectionAllowed
selectionAllowed: boolean;
property value
value: any;
Get the value of the current node
Returns
{(string|RenamableNode)} The value of the node.
method addChild
addChild: (child: Tree, position?: number) => Tree;
Add a child node for the current node.
Parameter child
A node that should become a child.
Parameter number
position - Position in which child will be inserted. By default it will be inserted at the last position in a parent.
Returns
{Tree} A newly inserted child.
method addSibling
addSibling: (sibling: Tree, position?: number) => Tree;
Add a sibling node for the current node. This won't work if the current node is a root.
Parameter sibling
A node that should become a sibling.
Parameter number
position - Position in which sibling will be inserted. By default it will be inserted at the last position in a parent.
Returns
{Tree} A newly inserted sibling, or null if you are trying to make a sibling for the root.
method checkedChildrenAmount
checkedChildrenAmount: () => number;
method childrenAreBeingLoaded
childrenAreBeingLoaded: () => boolean;
Check whether children of the node are being loaded. Makes sense only for nodes that define
loadChildren
function.Returns
{boolean} A flag indicating that children are being loaded.
method childrenShouldBeLoaded
childrenShouldBeLoaded: () => boolean;
Check whether children of the node should be loaded and not loaded yet. Makes sense only for nodes that define
loadChildren
function.Returns
{boolean} A flag indicating that children should be loaded for the current node.
method childrenWereLoaded
childrenWereLoaded: () => boolean;
Check whether children of the node were loaded. Makes sense only for nodes that define
loadChildren
function.Returns
{boolean} A flag indicating that children were loaded.
method createNode
createNode: (isBranch: boolean, model?: TreeModel) => Tree;
Create a new node in the current tree.
Parameter isBranch
A flag that indicates whether a new node should be a "Branch". "Leaf" node will be created by default
Parameter model
Tree model of the new node which will be inserted. Empty node will be created by default and it will fire edit mode of this node
Returns
{Tree} A newly created child node.
method disableCollapseOnInit
disableCollapseOnInit: () => void;
method hasChild
hasChild: (tree: Tree) => boolean;
Check whether provided tree is a child of the current tree. This method tests that provided tree is a direct child of the current tree.
Parameter tree
A tree that should be tested (child candidate).
Returns
{boolean} A flag indicating whether provided tree is a child or not.
method hasChildren
hasChildren: () => boolean;
Check whether this tree has children.
Returns
{boolean} A flag indicating whether or not this tree has children.
method hasCustomMenu
hasCustomMenu: () => boolean;
Check whether or not this tree has a custom menu.
Returns
{boolean} A flag indicating whether or not this tree has a custom menu.
method hasDeferredChildren
hasDeferredChildren: () => boolean;
method hasLeftMenu
hasLeftMenu: () => boolean;
Check whether or not this tree has a left menu.
Returns
{boolean} A flag indicating whether or not this tree has a left menu.
method hasLoadedChildern
hasLoadedChildern: () => boolean;
method hasRightMenu
hasRightMenu: () => boolean;
Check whether or not this tree has a right menu.
Returns
{boolean} A flag indicating whether or not this tree has a right menu.
method hasSibling
hasSibling: (tree: Tree) => boolean;
Check whether provided tree is a sibling of the current tree. Sibling trees (nodes) are the trees that have the same parent.
Parameter tree
A tree that should be tested on a siblingness.
Returns
{boolean} A flag indicating whether or not provided tree is the sibling of the current one.
method isBeingRenamed
isBeingRenamed: () => boolean;
Check that current tree is being renamed (it is in the process of its value renaming initiated by a user).
Returns
{boolean} A flag whether the tree is being renamed.
method isBranch
isBranch: () => boolean;
Check whether this tree is "Branch" or not. "Branch" is a node that has children.
Returns
{boolean} A flag indicating whether or not this tree is a "Branch".
method isCollapsedOnInit
isCollapsedOnInit: () => boolean;
method isLeaf
isLeaf: () => boolean;
Check whether this tree is "Leaf" or not.
Returns
{boolean} A flag indicating whether or not this tree is a "Leaf".
method isModified
isModified: () => boolean;
Check that current tree is modified (for example it was renamed).
Returns
{boolean} A flag whether the tree is modified.
method isNew
isNew: () => boolean;
Check that current tree is newly created (added by user via menu for example). Tree that was built from the TreeModel is not marked as new.
Returns
{boolean} A flag whether the tree is new.
method isNodeCollapsed
isNodeCollapsed: () => boolean;
Check that tree is collapsed.
Returns
{boolean} A flag indicating whether current tree is collapsed. Always returns false for the "Leaf" tree and for an empty tree.
method isNodeExpanded
isNodeExpanded: () => boolean;
Check that tree is expanded.
Returns
{boolean} A flag indicating whether current tree is expanded. Always returns false for the "Leaf" tree and for an empty tree.
method isRenamable
static isRenamable: (value: any) => value is RenamableNode;
Check whether a given value can be considered RenamableNode.
Parameter value
A value to check.
Returns
{boolean} - A flag indicating whether given value is Renamable node or not.
method isRoot
isRoot: () => boolean;
Check whether this tree is a root or not. The root is the tree (node) that doesn't have parent (or technically its parent is null).
Returns
{boolean} A flag indicating whether or not this tree is the root.
method isStatic
isStatic: () => boolean;
Check whether or not this tree is static.
Returns
{boolean} A flag indicating whether or not this tree is static.
method isValueEmpty
static isValueEmpty: (value: string) => boolean;
Check that value passed is not empty (it doesn't consist of only whitespace symbols).
Parameter value
A value that should be checked.
Returns
{boolean} - A flag indicating that value is empty or not.
method keepNodesInDOM
keepNodesInDOM: () => any;
method loadedChildrenAmount
loadedChildrenAmount: () => number;
method loadingChildrenRequested
loadingChildrenRequested: () => void;
method markAsBeingRenamed
markAsBeingRenamed: () => void;
Mark current tree as being renamed (@see isBeingRenamed).
method markAsModified
markAsModified: () => void;
Mark current tree as modified (@see isModified).
method markAsNew
markAsNew: () => void;
Mark current tree as new (@see isNew).
method reloadChildren
reloadChildren: () => void;
By calling this method you start process of loading node's children using
loadChildren
function.
method removeChild
removeChild: (tree: Tree) => void;
Remove given tree from the current tree. The given tree will be removed only in case it is a direct child of the current tree (@see hasChild).
Parameter tree
A tree that should be removed.
method removeItselfFromParent
removeItselfFromParent: () => void;
Remove current tree from its parent.
method setChildren
setChildren: (children: Array<TreeModel>) => void;
By calling this method you will remove all current children of a treee and create new.
method swapWithSibling
swapWithSibling: (sibling: Tree) => void;
Swap position of the current node with the given sibling. If node passed as a parameter is not a sibling - nothing happens.
Parameter sibling
A sibling with which current node shold be swapped.
method switchFoldingType
switchFoldingType: () => void;
Switch folding type of the current tree. "Leaf" node cannot switch its folding type cause it doesn't have children, hence nothing to fold. If node is a "Branch" and it is expanded, then by invoking current method state of the tree should be switched to "collapsed" and vice versa.
method toTreeModel
toTreeModel: () => TreeModel;
Makes a clone of an underlying TreeModel instance
Returns
{TreeModel} a clone of an underlying TreeModel instance
class TreeComponent
class TreeComponent implements OnInit, OnChanges, OnDestroy {}
constructor
constructor(treeService: TreeService);
property loadNextLevel
loadNextLevel: EventEmitter<any>;
property menuItemSelected
menuItemSelected: EventEmitter<any>;
property nodeChecked
nodeChecked: EventEmitter<NodeCheckedEvent>;
property nodeCollapsed
nodeCollapsed: EventEmitter<any>;
property nodeCreated
nodeCreated: EventEmitter<any>;
property nodeExpanded
nodeExpanded: EventEmitter<any>;
property nodeMoved
nodeMoved: EventEmitter<any>;
property nodeRemoved
nodeRemoved: EventEmitter<any>;
property nodeRenamed
nodeRenamed: EventEmitter<any>;
property nodeSelected
nodeSelected: EventEmitter<any>;
property nodeUnchecked
nodeUnchecked: EventEmitter<NodeUncheckedEvent>;
property nodeUnselected
nodeUnselected: EventEmitter<any>;
property ɵcmp
static ɵcmp: i0.ɵɵComponentDeclaration< TreeComponent, 'tree', never, { treeModel: { alias: 'tree'; required: false }; settings: { alias: 'settings'; required: false }; }, { nodeCreated: 'nodeCreated'; nodeRemoved: 'nodeRemoved'; nodeRenamed: 'nodeRenamed'; nodeSelected: 'nodeSelected'; nodeUnselected: 'nodeUnselected'; nodeMoved: 'nodeMoved'; nodeExpanded: 'nodeExpanded'; nodeCollapsed: 'nodeCollapsed'; loadNextLevel: 'loadNextLevel'; nodeChecked: 'nodeChecked'; nodeUnchecked: 'nodeUnchecked'; menuItemSelected: 'menuItemSelected'; }, ['template'], never, false, never>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<TreeComponent, never>;
property rootComponent
rootComponent: any;
property settings
settings: TreeTypes.Ng2TreeSettings;
property template
template: any;
property tree
tree: Tree;
property treeModel
treeModel: TreeTypes.TreeModel;
method getController
getController: () => TreeController;
method getControllerByNodeId
getControllerByNodeId: (id: number | string) => TreeController;
method ngOnChanges
ngOnChanges: (changes: SimpleChanges) => void;
method ngOnDestroy
ngOnDestroy: () => void;
method ngOnInit
ngOnInit: () => void;
class TreeController
class TreeController {}
constructor
constructor(component: TreeInternalComponent);
method addChild
addChild: (newNode: TreeModel) => void;
method addChildAsync
addChildAsync: (newNode: TreeModel) => Promise<Tree>;
method allowSelection
allowSelection: () => void;
method changeNodeId
changeNodeId: (id: string | number) => void;
method check
check: () => void;
method collapse
collapse: () => void;
method expand
expand: () => void;
method expandToParent
expandToParent: (tree?: any) => void;
method forbidSelection
forbidSelection: () => void;
method isChecked
isChecked: () => boolean;
method isCollapsed
isCollapsed: () => boolean;
method isExpanded
isExpanded: () => boolean;
method isIndetermined
isIndetermined: () => boolean;
method isSelected
isSelected: () => boolean;
method isSelectionAllowed
isSelectionAllowed: () => boolean;
method reloadChildren
reloadChildren: () => void;
method remove
remove: () => void;
method rename
rename: (newValue: string) => void;
method select
select: () => void;
method setChildren
setChildren: (children: TreeModel[]) => void;
method startRenaming
startRenaming: () => void;
method toTreeModel
toTreeModel: () => TreeModel;
method uncheck
uncheck: () => void;
method unselect
unselect: () => void;
class TreeInternalComponent
class TreeInternalComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit {}
constructor
constructor( nodeMenuService: NodeMenuService, treeService: TreeService, nodeElementRef: ElementRef);
property checkboxElementRef
checkboxElementRef: ElementRef;
property controller
controller: TreeController;
property isLeftMenuVisible
isLeftMenuVisible: boolean;
property isReadOnly
isReadOnly: boolean;
property isRightMenuVisible
isRightMenuVisible: boolean;
property isSelected
isSelected: boolean;
property nodeElementRef
nodeElementRef: ElementRef;
property ɵcmp
static ɵcmp: i0.ɵɵComponentDeclaration< TreeInternalComponent, 'tree-internal', never, { tree: { alias: 'tree'; required: false }; settings: { alias: 'settings'; required: false }; template: { alias: 'template'; required: false }; }, {}, never, never, false, never>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<TreeInternalComponent, never>;
property settings
settings: TreeTypes.Ng2TreeSettings;
property template
template: TemplateRef<any>;
property tree
tree: Tree;
property treeService
treeService: TreeService;
method applyNewValue
applyNewValue: (e: NodeEditableEvent) => void;
method hasCustomMenu
hasCustomMenu: () => boolean;
method isRootHidden
isRootHidden: () => boolean;
method ngAfterViewInit
ngAfterViewInit: () => void;
method ngOnChanges
ngOnChanges: (changes: SimpleChanges) => void;
method ngOnDestroy
ngOnDestroy: () => void;
method ngOnInit
ngOnInit: () => void;
method onMenuItemSelected
onMenuItemSelected: (e: NodeMenuItemSelectedEvent) => void;
method onNodeChecked
onNodeChecked: () => void;
method onNodeSelected
onNodeSelected: (e: { button: number }) => void;
method onNodeUnchecked
onNodeUnchecked: () => void;
method onNodeUnselected
onNodeUnselected: (e: { button: number }) => void;
method onSwitchFoldingType
onSwitchFoldingType: () => void;
method shouldShowInputForTreeValue
shouldShowInputForTreeValue: () => boolean;
method showLeftMenu
showLeftMenu: (e: MouseEvent) => void;
method showRightMenu
showRightMenu: (e: MouseEvent) => void;
method switchNodeCheckStatus
switchNodeCheckStatus: () => void;
method updateCheckboxState
updateCheckboxState: () => void;
class TreeModelSettings
class TreeModelSettings {}
property checked
checked?: boolean;
property cssClasses
cssClasses?: CssClasses;
property isCollapsedOnInit
isCollapsedOnInit?: boolean;
property keepNodesInDOM
keepNodesInDOM?: boolean;
property leftMenu
leftMenu?: boolean;
"leftMenu" property when set to true makes left menu available. TreeModelSettings#leftMenu boolean false
property menuItems
menuItems?: NodeMenuItem[];
"menu" property when set will be available as custom context menu. TreeModelSettings#MenuItems NodeMenuItem
property NOT_CASCADING_SETTINGS
static readonly NOT_CASCADING_SETTINGS: string[];
property rightMenu
rightMenu?: boolean;
"rightMenu" property when set to true makes right menu available. TreeModelSettings#rightMenu boolean true
property selectionAllowed
selectionAllowed?: boolean;
property static
static?: boolean;
"static" property when set to true makes it impossible to drag'n'drop tree or call a menu on it. TreeModelSettings#static boolean false
property templates
templates?: Templates;
method merge
static merge: (child: TreeModel, parent: TreeModel) => TreeModelSettings;
class TreeModule
class TreeModule {}
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<TreeModule, never>;
property ɵinj
static ɵinj: i0.ɵɵInjectorDeclaration<TreeModule>;
property ɵmod
static ɵmod: i0.ɵɵNgModuleDeclaration< TreeModule, [ typeof i1.NodeDraggableDirective, typeof i2.TreeComponent, typeof i3.NodeEditableDirective, typeof i4.NodeMenuComponent, typeof i5.TreeInternalComponent, typeof i6.SafeHtmlPipe ], [any], [typeof i2.TreeComponent]>;
class TreeService
class TreeService {}
constructor
constructor(nodeDraggableService: NodeDraggableService);
property loadNextLevel$
loadNextLevel$: Subject<LoadNextLevelEvent>;
property menuItemSelected$
menuItemSelected$: Subject<MenuItemSelectedEvent>;
property nodeChecked$
nodeChecked$: Subject<NodeCheckedEvent>;
property nodeCollapsed$
nodeCollapsed$: Subject<NodeCollapsedEvent>;
property nodeCreated$
nodeCreated$: Subject<NodeCreatedEvent>;
property nodeExpanded$
nodeExpanded$: Subject<NodeExpandedEvent>;
property nodeIndetermined$
nodeIndetermined$: Subject<NodeIndeterminedEvent>;
property nodeMoved$
nodeMoved$: Subject<NodeMovedEvent>;
property nodeRemoved$
nodeRemoved$: Subject<NodeRemovedEvent>;
property nodeRenamed$
nodeRenamed$: Subject<NodeRenamedEvent>;
property nodeSelected$
nodeSelected$: Subject<NodeSelectedEvent>;
property nodeUnchecked$
nodeUnchecked$: Subject<NodeUncheckedEvent>;
property nodeUnselected$
nodeUnselected$: Subject<NodeUnselectedEvent>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<TreeService, never>;
property ɵprov
static ɵprov: i0.ɵɵInjectableDeclaration<TreeService>;
method deleteController
deleteController: (id: string | number) => void;
method draggedStream
draggedStream: ( tree: Tree, element: ElementRef) => Observable<NodeDraggableEvent>;
method fireMenuItemSelected
fireMenuItemSelected: (tree: Tree, selectedItem: string) => void;
method fireNodeChecked
fireNodeChecked: (tree: Tree) => void;
method fireNodeCreated
fireNodeCreated: (tree: Tree) => void;
method fireNodeIndetermined
fireNodeIndetermined: (tree: Tree) => void;
method fireNodeMoved
fireNodeMoved: (tree: Tree, parent: Tree) => void;
method fireNodeRemoved
fireNodeRemoved: (tree: Tree) => void;
method fireNodeRenamed
fireNodeRenamed: (oldValue: RenamableNode | string, tree: Tree) => void;
method fireNodeSelected
fireNodeSelected: (tree: Tree) => void;
method fireNodeSwitchFoldingType
fireNodeSwitchFoldingType: (tree: Tree) => void;
method fireNodeUnchecked
fireNodeUnchecked: (tree: Tree) => void;
method fireNodeUnselected
fireNodeUnselected: (tree: Tree) => void;
method getController
getController: (id: string | number) => TreeController;
method hasController
hasController: (id: string | number) => boolean;
method setController
setController: (id: string | number, controller: TreeController) => void;
method unselectStream
unselectStream: (tree: Tree) => Observable<NodeSelectedEvent>;
Interfaces
interface CssClasses
interface CssClasses {}
interface NodeEditableEvent
interface NodeEditableEvent {}
interface NodeMenuEvent
interface NodeMenuEvent {}
interface NodeMenuItem
interface NodeMenuItem {}
interface NodeMenuItemSelectedEvent
interface NodeMenuItemSelectedEvent {}
property nodeMenuItemAction
nodeMenuItemAction: NodeMenuItemAction;
property nodeMenuItemSelected
nodeMenuItemSelected?: string;
interface RenamableNode
interface RenamableNode {}
method setName
setName: (name: string) => void;
Set new value of the renamable node. Implementation of this method is up to user.
Parameter name
A new value of the node.
method toString
toString: () => string;
Get string representation of the node. Implementation of this method is up to user.
Returns
{string} - A node string representation.
interface Templates
interface Templates {}
interface TreeModel
interface TreeModel {}
property children
children?: TreeModel[];
property emitLoadNextLevel
emitLoadNextLevel?: boolean;
property id
id?: string | number;
property loadChildren
loadChildren?: ChildrenLoadingFunction;
property settings
settings?: TreeModelSettings;
property value
value: string | RenamableNode;
index signature
[additionalData: string]: any;
Enums
enum MouseButtons
enum MouseButtons { Left = 0, Right = 2,}
enum NodeEditableEventAction
enum NodeEditableEventAction { Cancel = 0,}
member Cancel
Cancel = 0
enum NodeMenuAction
enum NodeMenuAction { Close = 0,}
member Close
Close = 0
enum NodeMenuItemAction
enum NodeMenuItemAction { NewFolder = 0, NewTag = 1, Rename = 2, Remove = 3, Custom = 4,}
enum TreeStatus
enum TreeStatus { New = 0, Modified = 1, IsBeingRenamed = 2,}
Type Aliases
type ChildrenLoadingFunction
type ChildrenLoadingFunction = (callback: (children: TreeModel[]) => void) => void;
type NodeEditableEventType
type NodeEditableEventType = 'blur' | 'keyup';
type Once
type Once = (...args: any[]) => any;
Package Files (21)
- draggable/captured-node.d.ts
- draggable/draggable.events.d.ts
- draggable/node-draggable.directive.d.ts
- draggable/node-draggable.service.d.ts
- editable/editable.events.d.ts
- editable/node-editable.directive.d.ts
- index.d.ts
- menu/menu.events.d.ts
- menu/node-menu.component.d.ts
- menu/node-menu.service.d.ts
- tree-controller.d.ts
- tree-internal.component.d.ts
- tree.component.d.ts
- tree.d.ts
- tree.events.d.ts
- tree.module.d.ts
- tree.service.d.ts
- tree.types.d.ts
- utils/event.utils.d.ts
- utils/fn.utils.d.ts
- utils/safe-html.pipe.d.ts
Dependencies (2)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ng2-tree
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ng2-tree)
- HTML<a href="https://www.jsdocs.io/package/ng2-tree"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 6730 ms. - Missing or incorrect documentation? Open an issue for this package.