# Class TreeComponent<Data>

#### Type Parameters

- Data extends WithIdentifier & WithChildren = any

#### Implements

- OnInit
- AfterContentInit

- Defined in tree/src/lib/tree.component.ts:90

#####
Index

### Constructors

constructor

### Properties

content?
contentEditableMethod?
dataSource
details
dividerOffset
getIcon?
getStyle?
getType?
hasDetails?
hideLeafIcon
id?
multiple
portal
searchForm
showTreeNavigation
toDisplay?
treeContainer
treeControl

### Accessors

cacheId
nodeDisplayEditable

### Methods

getLevel
hasChild
isExpandable
ngAfterContentInit
ngOnInit
onContentEditableChange
onMousedown
onMousemove
onMouseup
openDetails
toggleTreeNavigation

##
Constructors

### constructor

- new TreeComponent<Data extends unknown = any>(
  viewContainerRef: ViewContainerRef,
  cdr: ChangeDetectorRef,
  contentEditableMethod: null | Method<any, null | string>,
  renderer: Renderer2,
  elementRef: ElementRef<HTMLElement>,
  searchForm: null | SearchForm<unknown>,
  ): TreeComponent<Data>

  #### Type Parameters

  - Data extends unknown = any

  #### Parameters

  - viewContainerRef: ViewContainerRef
  - cdr: ChangeDetectorRef
  - contentEditableMethod: null | Method<any, null | string>
  - renderer: Renderer2
  - elementRef: ElementRef<HTMLElement>
  - searchForm: null | SearchForm<unknown>

  #### Returns TreeComponent<Data>

  - Defined in tree/src/lib/tree.component.ts:138

##
Properties

### `Optional` content

content?: TreeContentDirective

- Defined in tree/src/lib/tree.component.ts:110

### `Optional` contentEditableMethod

contentEditableMethod?: null | Method<any, null | string>

- Defined in tree/src/lib/tree.component.ts:96

### dataSource

dataSource: TreeDataSource<Data>

- Defined in tree/src/lib/tree.component.ts:94

### details

details: EventEmitter<any> = ...

- Defined in tree/src/lib/tree.component.ts:116

### dividerOffset

dividerOffset: string = '256px'

- Defined in tree/src/lib/tree.component.ts:118

### `Optional` getIcon

getIcon?: NodeGetIconFunction<any>

- Defined in tree/src/lib/tree.component.ts:100

### `Optional` getStyle

getStyle?: NodeGetStyleFunction<any>

- Defined in tree/src/lib/tree.component.ts:104

### `Optional` getType

getType?: NodeGetTypeFunction<any>

- Defined in tree/src/lib/tree.component.ts:102

### `Optional` hasDetails

hasDetails?: NodeHasDetailsFunction<any>

- Defined in tree/src/lib/tree.component.ts:108

### hideLeafIcon

hideLeafIcon: boolean = false

- Defined in tree/src/lib/tree.component.ts:112

### `Optional` id

id?: string

- Defined in tree/src/lib/tree.component.ts:114

### multiple

multiple: boolean = false

- Defined in tree/src/lib/tree.component.ts:106

### portal

portal: null | TemplatePortal<any> = null

- Defined in tree/src/lib/tree.component.ts:119

### `Readonly` searchForm

searchForm: null | SearchForm<unknown>

- Defined in tree/src/lib/tree.component.ts:150

### `Readonly` showTreeNavigation

showTreeNavigation: WritableSignal<boolean> = ...

- Defined in tree/src/lib/tree.component.ts:123

### `Optional` toDisplay

toDisplay?: NodeToDisplayFunction<any>

- Defined in tree/src/lib/tree.component.ts:98

### treeContainer

treeContainer: ElementRef

- Defined in tree/src/lib/tree.component.ts:121

### treeControl

treeControl: FlatTreeControl<Node<Data, any>>

- Defined in tree/src/lib/tree.component.ts:92

##
Accessors

### cacheId

- get cacheId(): string

  #### Returns string

  - Defined in tree/src/lib/tree.component.ts:160

### nodeDisplayEditable

- get nodeDisplayEditable(): boolean

  #### Returns boolean

  - Defined in tree/src/lib/tree.component.ts:156

##
Methods

### getLevel

- getLevel(node: Node<Data>): number

  #### Parameters

  - node: Node<Data>

  #### Returns number

  - Defined in tree/src/lib/tree.component.ts:164

### hasChild

- hasChild(_: number, nodeData: Node<Data>): boolean

  #### Parameters

  - _: number
  - nodeData: Node<Data>

  #### Returns boolean

  - Defined in tree/src/lib/tree.component.ts:168

### isExpandable

- isExpandable(node: Node<Data>): boolean

  #### Parameters

  - node: Node<Data>

  #### Returns boolean

  - Defined in tree/src/lib/tree.component.ts:166

### ngAfterContentInit

- ngAfterContentInit(): void

  A callback method that is invoked immediately after Angular has completed initialization of all of the directive's content. It is invoked only once when the directive is instantiated.

  #### Returns void

  Implementation of AfterContentInit.ngAfterContentInit

  - Defined in tree/src/lib/tree.component.ts:194

### ngOnInit

- ngOnInit(): void

  A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

  #### Returns void

  Implementation of OnInit.ngOnInit

  - Defined in tree/src/lib/tree.component.ts:170

### onContentEditableChange

- onContentEditableChange(value: null | string, node: Node<Data>): any

  #### Parameters

  - value: null | string
  - node: Node<Data>

  #### Returns any

  - Defined in tree/src/lib/tree.component.ts:220

### onMousedown

- onMousedown(): void

  #### Returns void

  - Defined in tree/src/lib/tree.component.ts:225

### onMousemove

- onMousemove($event: MouseEvent): void

  #### Parameters

  - $event: MouseEvent

  #### Returns void

  - Defined in tree/src/lib/tree.component.ts:235

### onMouseup

- onMouseup(): void

  #### Returns void

  - Defined in tree/src/lib/tree.component.ts:230

### openDetails

- openDetails(node: Node<Data>): void

  #### Parameters

  - node: Node<Data>

  #### Returns void

  - Defined in tree/src/lib/tree.component.ts:205

### toggleTreeNavigation

- toggleTreeNavigation(): void

  #### Returns void

  - Defined in tree/src/lib/tree.component.ts:249