Options
All
  • Public
  • Public/Protected
  • All
Menu

Core implementation of tree view component providing the basic functionality.

abstract

Hierarchy

Index

Constructors

constructor

  • Initializes a new tree view.

    Parameters

    • container: HTMLElement

      HTML element that will host the tree view.

    • options: ITreeViewOptions

      Additional options.

    Returns TreeView

Properties

Protected container

container: HTMLElement

Protected Optional onSelectionChanged

onSelectionChanged: (nodes: INode[]) => void

Type declaration

    • Parameters

      Returns void

Protected provider

provider: IDataProvider

Protected root

root: HTMLElement

Methods

Private _collapseNode

  • _collapseNode(el: HTMLElement): void

Private _expandNode

  • _expandNode(el: HTMLElement): void

Private _getMetadata

  • _getMetadata(el: HTMLElement): INode

Private _hasMetadata

  • _hasMetadata(el: HTMLElement): boolean

Private _onRootClick

  • _onRootClick(ev: MouseEvent): boolean

Private _render

  • _render(id: undefined | string, level: number, insertAfterEl?: HTMLElement): Promise<void>
  • Parameters

    • id: undefined | string
    • level: number
    • Optional insertAfterEl: HTMLElement

    Returns Promise<void>

Private _setMetadata

  • _setMetadata(el: HTMLElement, metadata: INode): void

Protected attach

  • attach(): void
  • Attaches the tree view to the DOM.

    Returns void

Protected detach

  • detach(): void
  • Detaches the tree view from the DOM.

    Returns void

Protected Abstract onNodeClicked

  • onNodeClicked(node: INode, el: HTMLElement): void
  • Reacts to the event of a tree node being clicked.

    Parameters

    • node: INode

      Tree node metadata.

    • el: HTMLElement

      Tree node HTML element.

    Returns void

Protected Abstract onNodeCollapsed

  • onNodeCollapsed(node: INode, el: HTMLElement): void
  • Reacts to the event of a tree node being collapsed.

    Parameters

    • node: INode

      Tree node metadata.

    • el: HTMLElement

      Tree node HTML element.

    Returns void

Protected Abstract onNodeExpanded

  • onNodeExpanded(node: INode, el: HTMLElement): void
  • Reacts to the event of a tree node being expanded.

    Parameters

    • node: INode

      Tree node metadata.

    • el: HTMLElement

      Tree node HTML element.

    Returns void

Protected Abstract onNodeLoading

  • onNodeLoading(node: INode, el: HTMLElement): void
  • Reacts to the event of a tree node loading its children.

    Parameters

    • node: INode

      Tree node metadata.

    • el: HTMLElement

      Tree node HTML element.

    Returns void

Protected Abstract renderNode

  • renderNode(node: INode): HTMLElement
  • Creates new HTML representation of a tree node.

    abstract

    Parameters

    • node: INode

      Tree node metadata.

    Returns HTMLElement

    New block-based HTML element.

Generated using TypeDoc