{"version":3,"file":"cisstech-nge-ui-tree.mjs","sources":["../../../projects/nge/ui/tree/src/tree-node.directive.ts","../../../projects/nge/ui/tree/src/flat-tree-control.ts","../../../projects/nge/ui/tree/src/internal.ts","../../../projects/nge/ui/tree/src/tree.model.ts","../../../projects/nge/ui/tree/src/autofocus.directive.ts","../../../projects/nge/ui/tree/src/tree.component.ts","../../../projects/nge/ui/tree/src/tree.component.html","../../../projects/nge/ui/tree/src/tree.module.ts","../../../projects/nge/ui/tree/src/tree.service.ts","../../../projects/nge/ui/tree/cisstech-nge-ui-tree.ts"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core'\nimport { ITreeNodeHolder } from './tree.model'\n\nexport declare type Context<T> = {\n  $implicit: ITreeNodeHolder<T>\n}\n\n/** Element that can be used as a template for a `TreeComponent`  */\n@Directive({\n  // tslint:disable-next-line: directive-selector\n  selector: '[treeNode], ui-tree-node',\n})\nexport class TreeNodeDirective<T> {\n  readonly templateRef = inject<TemplateRef<Context<T>>>(TemplateRef)\n\n  // https://medium.com/angular-in-depth/type-checking-templates-in-angular-viewengine-and-ivy-77f8536359f5\n  static ngTemplateContextGuard<T>(_: TreeNodeDirective<T>, ctx: any): ctx is Context<T> {\n    return true\n  }\n}\n","import { SelectionModel } from '@angular/cdk/collections'\n\n/**\n * Minimal flat-tree expansion control, replacing the deprecated `FlatTreeControl`\n * from `@angular/cdk/tree` (removed in a future Angular). The component owns and\n * renders the flat `dataNodes` list; expansion is tracked by node identity in a\n * `SelectionModel` (selected = expanded).\n */\nexport class FlatTreeControl<T> {\n  /** The flattened tree nodes, in display order. */\n  dataNodes: T[] = []\n\n  /** Selected entries are the expanded nodes. */\n  readonly expansionModel = new SelectionModel<T>(true)\n\n  isExpanded(node: T): boolean {\n    return this.expansionModel.isSelected(node)\n  }\n\n  expand(node: T): void {\n    this.expansionModel.select(node)\n  }\n\n  collapse(node: T): void {\n    this.expansionModel.deselect(node)\n  }\n\n  expandAll(): void {\n    this.expansionModel.select(...this.dataNodes)\n  }\n\n  collapseAll(): void {\n    this.expansionModel.clear()\n  }\n}\n","import { ITree } from './tree.model'\n\n/**\n * Stores the actual visible trees of the page.\n *\n * This variable is private to the library and should not be added to the entry file of the api.\n */\nexport const CURRENT_VISIBLE_TREES = new Map<string, ITree<any>>()\n","/**\n * Representation of a node\n * T => data\n * string => id of a node\n * Element => dom element of a node\n * ITreeNodeHolder<T> internal representation\n */\nexport declare type INode<T> = T | string | Element | ITreeNodeHolder<T>\n\nexport interface ITreeState {\n  active: string\n  filter: ITreeFilter\n  expandedNodes: string[]\n}\n\nexport interface ITreeFilter {\n  term: string\n}\n\nexport interface ITreeEdition<T> {\n  node: T\n  text: string\n  creation?: boolean\n}\n\n/**\n * Keyboard event handlers\n */\nexport interface ITreeKeyAction<T> {\n  /**\n   * Original dom event (MouseEvent|KeyboardEvent).\n   * If `event.preventDefault()` is not called, the typed character will be added/removed\n   * to the current filter of the tree.\n   */\n  event: KeyboardEvent\n  /** The node on which the action is called. (`null` for contextmenu on the tree itself ) */\n  node?: T\n}\n\n/** Mouse event handlers */\nexport interface ITreeMouseAction<T> {\n  /** original dom event (MouseEvent|KeyboardEvent) */\n  event: MouseEvent\n  /** The node on which the action is called. (`null` for contextmenu on the tree itself ) */\n  node?: T\n}\n\n/** Maps mouse events, and key codes, to callbacks. */\nexport interface ITreeActionMapping<T> {\n  keys?: { [k: string]: (e: ITreeKeyAction<T>) => void }\n  mouse?: {\n    click?: (e: ITreeMouseAction<T>) => void\n    rightClick?: (e: ITreeMouseAction<T>) => void\n  }\n}\n\n/**\n * Tree api.\n */\nexport interface ITree<T> {\n  /**\n   * Gets the selected nodes.\n   */\n  selections(): T[]\n\n  /**\n   * Gets the current focused node.\n   */\n  focusedNode(): T | undefined\n\n  /**\n   * Gets a value indicating whether `node` is selected.\n   * @param node A reference to a node.\n   * @throws {ReferenceError} if node is null.\n   */\n  isSelected(node: INode<T>): boolean\n\n  /**\n   * Gets a value indicating whether `node` is the current focused node.\n   * @param node A reference to a node.\n   * @throws {ReferenceError} if node is null.\n   */\n  isFocused(node: INode<T>): boolean\n\n  /**\n   * Gets a value indicating whether `node` is expanded.\n   * @param node A reference to a node.\n   * @throws {ReferenceError} if node is null.\n   */\n  isExpanded(node: INode<T>): boolean\n\n  /**\n   * Sets `node` as the new focused node.\n   *\n   * Note:\n   * The ancestors the of node will be expanded and the tree will scroll into the node.\n   * @param node A reference to a node.\n   */\n  focus(node: INode<T>): void\n\n  /** Unfocus the current focused node */\n  unfocus(): void\n\n  /**\n   * Expands the passed `node` with all its parents.\n   *\n   * Note:\n   * This method will not select/focus the node.\n   *\n   * @param node A reference to a node.\n   * @throws {ReferenceError} if node is null.\n   */\n  expand(node: INode<T>): void\n\n  /**\n   * Expand the entire tree.\n   */\n  expandAll(): void\n\n  /**\n   * Collapses the given `node`.\n   *\n   * Note:\n   * This method will not select/focus the node.\n   *\n   * @param node A reference to a node.\n   * @throws {ReferenceError} if node is null.\n   */\n  collapse(node: INode<T>): void\n\n  /**\n   * Collapse the entire tree\n   */\n  collapseAll(): void\n\n  /**\n   * Toggles the expanded/collapse state of the given node.\n   *\n   * Note:\n   * This method will not select/focus the node.\n   *\n   * @param node A reference to a node.\n   * @throws {ReferenceError} if node is null.\n   */\n  toggle(node: INode<T>): void\n\n  /**\n   * Starts editing the given node.\n   * @param node A reference to a node.\n   * @param creation If true, an input will be displayed after the node to create a new child node.\n   * @throws {ReferenceError} if `node` is null.\n   */\n  startEdition(node: INode<T>, creation?: boolean): void\n\n  /**\n   * End the editing of the current node in a editing state.\n   */\n  endEdition(): void\n\n  /**\n   * Filter the tree using the given filter.\n   * @param filter The filter to apply.\n   */\n  search(filter: ITreeFilter): void\n\n  /**\n   * Saves the tree as an object to be restored later\n   * by calling `tree.restoreState()`.\n   */\n  saveState(): ITreeState\n\n  /**\n   * Restores the state of the tree from `state`.\n   * @param state the state.\n   */\n  restoreState(state: ITreeState): void\n}\n\n/**\n * Adapter class to map a generic type T to an ITreeHolder<T>\n * and attach event listeners to the tree instance.\n */\nexport interface ITreeAdapter<T> {\n  /**\n   * Unique identifier of the tree.\n   *\n   * This identifier is used to get a reference to the tree anywhere\n   * by using `TreeService` class.\n   */\n  id: string\n\n  /** Tree height (default 100%) */\n  treeHeight?: string\n\n  /** Item height (default 32) */\n  itemHeight?: number\n\n  /**\n   * Function called to get the id of a node.\n   */\n  idProvider: (node: T) => string\n\n  /**\n   * Function called to get test whether a node is expandable.\n   */\n  isExpandable: (node: T) => boolean\n\n  /**\n   * Function called to get the display name of a node.\n   */\n  nameProvider: (node: T) => string\n\n  /**\n   * Function called to get the children of a node.\n   */\n  childrenProvider: (node: T) => T[]\n\n  /**\n   * Function called to get the display tooltip of a node.\n   */\n  tooltipProvider?: (node: T) => string\n\n  /**\n   * If enabled, this option will filter the tree\n   * each time a keyboard key is pressed while the tree is focused.\n   *\n   * Note:\n   *\n   * The filter will be updated only if `preventDefault()` is not called\n   * on the original KeyboardEvent by any of the event handlers.\n   *\n   */\n  enableKeyboardFiltering?: boolean\n\n  /**\n   * Event called after a node is expanded in the tree.\n   * @param e informations about the event.\n   */\n  onDidExpand?: (e: T) => void\n\n  /**\n   * Event called after a node is expanded in the tree.\n   * @param e informations about the event.\n   */\n  onDidCollapse?: (e: T) => void\n\n  /**\n   * Event called after a node is edited in the tree.\n   * @param e informations about the event.\n   */\n  onDidEditName?: (e: ITreeEdition<T>) => void\n\n  /**\n   * Maps mouse events, and key codes, to callbacks.\n   */\n  actions?: ITreeActionMapping<T>\n\n  /** Should the tree keep the expands state when the nodes change? (default to `true`)*/\n  keepStateOnChangeNodes?: boolean\n}\n\n/** Internal representation of a node */\nexport interface ITreeNodeHolder<T> {\n  /** A unique key of this node. */\n  id: string\n\n  /** Reference to the original data. */\n  data: T\n\n  /** display name of the node */\n  name: string\n\n  /** Level in the tree (starts from 0). */\n  level: number\n\n  /** A value indicating whether the node is expandable */\n  expandable: boolean\n\n  /** Optional tooltip to show when the node is hovered */\n  tooltip?: string\n\n  padding: string\n\n  // TODO precalculate the following properties instead of calling functions inside template.\n\n  /** A value indicating whether the node is focused */\n  focused?: boolean\n\n  /** A value indicating whether the node is expanded */\n  expanded?: boolean\n\n  /** A value indicating whether the node is selected */\n  selected?: boolean\n\n  /** A value indicating whether the node is in creating state.  */\n  creating?: boolean\n\n  /** A value indicating whether the node is in renaming state.  */\n  renaming?: boolean\n}\n\nexport class TreeFilter implements ITreeFilter {\n  constructor(public term = '') {}\n}\n\nexport class TreeState implements ITreeState {\n  constructor(\n    public active = '',\n    public expandedNodes: string[] = [],\n    public filter: ITreeFilter = new TreeFilter()\n  ) {}\n}\n","import { AfterContentInit, Directive, ElementRef, inject } from '@angular/core'\n\n@Directive({\n  // tslint:disable-next-line: directive-selector\n  selector: 'input[autofocus]',\n})\nexport class AutofocusDirective implements AfterContentInit {\n  private readonly el = inject(ElementRef)\n\n  ngAfterContentInit() {\n    setTimeout(() => {\n      this.el.nativeElement.focus()\n    }, 500)\n  }\n}\n","import { FlatTreeControl } from './flat-tree-control'\nimport {\n  ChangeDetectionStrategy,\n  ChangeDetectorRef,\n  Component,\n  ElementRef,\n  HostListener,\n  OnDestroy,\n  OnInit,\n  effect,\n  inject,\n  contentChild,\n  input,\n} from '@angular/core'\nimport { BehaviorSubject } from 'rxjs'\nimport { CURRENT_VISIBLE_TREES } from './internal'\nimport { TreeNodeDirective } from './tree-node.directive'\nimport {\n  INode,\n  ITree,\n  ITreeAdapter,\n  ITreeEdition,\n  ITreeFilter,\n  ITreeNodeHolder,\n  ITreeState,\n  TreeFilter,\n} from './tree.model'\nimport { NgTemplateOutlet, NgClass, AsyncPipe } from '@angular/common'\nimport { AutofocusDirective } from './autofocus.directive'\nimport { FormsModule } from '@angular/forms'\n\n@Component({\n  selector: 'ui-tree',\n  templateUrl: 'tree.component.html',\n  styleUrls: ['tree.component.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [NgTemplateOutlet, NgClass, AutofocusDirective, FormsModule, AsyncPipe],\n})\nexport class TreeComponent<T> implements ITree<T>, OnInit, OnDestroy {\n  private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef)\n  private readonly changeDetectorRef = inject(ChangeDetectorRef)\n\n  readonly nodes = input<T[]>([])\n  readonly adapter = input.required<ITreeAdapter<T>>()\n\n  protected readonly nodeDirective = contentChild.required(TreeNodeDirective)\n\n  private readonly DATA_TREE_NODE_ID = 'data-tree-node-id'\n\n  private readonly nodesIndex = new Map<string, ITreeNodeHolder<T>>()\n  private readonly parentsIndex = new Map<string, string>()\n  private readonly hiddenNodes = new Map<string, ITreeNodeHolder<T>>()\n  private readonly selectedNodes = new Map<string, ITreeNodeHolder<T>>()\n\n  private isEmpty = false\n  private isShiftKeyPressed = false\n  private activeNode?: ITreeNodeHolder<T>\n  private stateBeforeSearching: ITreeState | undefined\n\n  protected editing: Partial<ITreeEdition<T>> = { text: '', node: undefined }\n  protected readonly visibleNodes = new BehaviorSubject<ITreeNodeHolder<T>[]>([])\n\n  readonly filter: ITreeFilter = new TreeFilter()\n  readonly controler: FlatTreeControl<ITreeNodeHolder<T>>\n\n  protected get treeHeight(): string {\n    return this.adapter()?.itemHeight?.toString() || '100%'\n  }\n\n  constructor() {\n    this.controler = new FlatTreeControl<ITreeNodeHolder<T>>()\n\n    // Rebuild the tree whenever the adapter or nodes input changes.\n    effect(() => {\n      this.syncFromInputs()\n    })\n  }\n\n  ngOnInit(): void {\n    const adapter = this.adapter()\n    if (!adapter.id?.trim()) {\n      throw new Error('@Input() adapter.id is required !')\n    }\n    CURRENT_VISIBLE_TREES.set(adapter.id, this)\n  }\n\n  private syncFromInputs(): void {\n    const adapter = this.adapter()\n    if (!adapter) {\n      throw new Error('adapter is required !')\n    }\n    this.nodes()\n\n    const requires: (keyof ITreeAdapter<T>)[] = ['id', 'idProvider', 'nameProvider', 'isExpandable', 'childrenProvider']\n    for (const key of requires) {\n      const value = adapter[key]\n      if (!value || (typeof value === 'string' && value.trim() === '')) {\n        throw new Error(`@Input() adapter.${key} is required !`)\n      }\n    }\n\n    adapter.itemHeight = adapter.itemHeight || 32\n    adapter.treeHeight = adapter.treeHeight || '100%'\n    adapter.keepStateOnChangeNodes = adapter.keepStateOnChangeNodes ?? true\n\n    let state: ITreeState | undefined\n    if (adapter.keepStateOnChangeNodes) {\n      state = this.saveState()\n    }\n\n    this.buildIndexes()\n\n    if (state) {\n      this.restoreState(state)\n    } else {\n      this.unselectAll(false)\n      this.render()\n    }\n  }\n\n  ngOnDestroy(): void {\n    const adapter = this.adapter()\n    if (adapter?.id) {\n      CURRENT_VISIBLE_TREES.delete(adapter.id)\n    }\n  }\n\n  //#region API\n\n  selections(): T[] {\n    return Array.from(this.selectedNodes.values()).map((e) => e.data)\n  }\n\n  focusedNode(): T | undefined {\n    return this.activeNode?.data\n  }\n\n  isFocused(node: INode<T>): boolean {\n    if (node == null) {\n      throw new ReferenceError('Argument \"node\" is required.')\n    }\n\n    if (!this.activeNode) {\n      return false\n    }\n\n    return this.findHolder(node)?.id === this.activeNode.id\n  }\n\n  isExpanded(node: INode<T>): boolean {\n    if (node == null) {\n      throw new ReferenceError('Argument \"node\" is required.')\n    }\n\n    const holder = this.findHolder(node)\n    if (!holder?.expandable) {\n      return false\n    }\n\n    return this.controler.isExpanded(holder)\n  }\n\n  isSelected(node: INode<T>): boolean {\n    if (node == null) {\n      throw new ReferenceError('Argument \"node\" is required.')\n    }\n\n    const holder = this.findHolder(node)\n    if (!holder) {\n      return false\n    }\n\n    return this.selectedNodes.has(holder.id)\n  }\n\n  focus(node: INode<T>, render = true): void {\n    const holder = this.findHolder(node)\n    if (holder) {\n      if (this.activeNode) {\n        this.unselect(this.activeNode, false)\n      }\n      this.activeNode = holder\n      this.select(node, false)\n      this.expandAncestors(holder)\n      if (render) {\n        this.render()\n      }\n      this.scrollInto(holder)\n    }\n  }\n\n  unfocus(): void {\n    this.activeNode = undefined\n    this.changeDetectorRef.detectChanges()\n  }\n\n  expand(node: INode<T>, render = true): void {\n    if (!node) {\n      return\n    }\n\n    const holder = this.findHolder(node)\n    if (!holder) {\n      return\n    }\n\n    if (holder.expandable && !this.controler.isExpanded(holder)) {\n      this.controler.expand(holder)\n      this.expandAncestors(holder)\n      if (render) {\n        this.render()\n      }\n    }\n  }\n\n  expandAll(render = true): void {\n    this.controler.dataNodes?.forEach((node) => {\n      this.controler.expand(node)\n    })\n    // this.controler.expandAll(); // https://github.com/vmware/clarity/issues/4850\n    if (render) {\n      this.render()\n    }\n  }\n\n  collapse(node: INode<T>, render = true): void {\n    if (!node) {\n      return\n    }\n\n    const holder = this.findHolder(node)\n    if (!holder) {\n      return\n    }\n\n    if (holder.expandable && this.controler.isExpanded(holder)) {\n      this.controler.collapse(holder)\n      const adapter = this.adapter()\n      if (adapter.onDidCollapse) {\n        adapter.onDidCollapse(holder.data)\n      }\n      if (render) {\n        this.render()\n      }\n    }\n  }\n\n  collapseAll(render = true): void {\n    this.controler.collapseAll()\n    if (render) {\n      this.render()\n    }\n  }\n\n  toggle(node: INode<T>, render = true): void {\n    if (!node) {\n      return\n    }\n\n    const holder = this.findHolder(node)\n    if (holder?.expandable) {\n      if (this.controler.isExpanded(holder)) {\n        this.collapse(node, render)\n      } else {\n        this.expand(node, render)\n      }\n    }\n  }\n\n  startEdition(node: INode<T>, creation?: boolean): void {\n    if (!this.adapter().onDidEditName) return\n\n    if (!node) {\n      throw new ReferenceError('Argument \"node\" is required.')\n    }\n\n    const holder = this.findHolder(node)\n    if (holder) {\n      this.unselectAll(false)\n      this.editing.node = holder.data\n      this.editing.text = creation ? '' : holder.name\n      this.editing.creation = creation\n      holder.renaming = !creation\n      holder.creating = creation\n      if (holder.expandable && !this.isExpanded(holder)) {\n        this.expand(node)\n      }\n    }\n\n    this.changeDetectorRef.detectChanges()\n  }\n\n  endEdition(): void {\n    const holder = this.findHolder(this.editing.node!)\n    if (holder) {\n      holder.renaming = false\n      holder.creating = false\n    }\n    this.editing = { text: '' }\n    this.changeDetectorRef.detectChanges()\n  }\n\n  search(filter: ITreeFilter) {\n    if (!this.filter.term) {\n      this.stateBeforeSearching = this.saveState()\n    }\n\n    this.filter.term = (filter.term || '').trim()\n\n    if (!this.filter.term) {\n      if (this.stateBeforeSearching) {\n        this.restoreState(this.stateBeforeSearching)\n        this.stateBeforeSearching = undefined\n      } else {\n        this.hiddenNodes.clear()\n        this.render()\n      }\n      return\n    }\n\n    const pattern = this.buildSearchPattern()\n    if (pattern) {\n      this.activeNode = undefined\n      this.hiddenNodes.clear()\n      this.selectedNodes.clear()\n      this.collapseAll(false)\n\n      const p = pattern\n      const matches = new Set<string>()\n      const nodes = this.controler.dataNodes || []\n      const n = nodes.length - 1\n      for (let i = n; i >= 0; i--) {\n        const node = nodes[i]\n        if (matches.has(node.id)) continue\n\n        if (node.name.toLowerCase().match(p)) {\n          matches.add(node.id)\n          this.iterateAncestors(node, (e) => {\n            this.controler.expand(e)\n            matches.add(e.id)\n          })\n        } else {\n          this.hiddenNodes.set(node.id, node)\n        }\n      }\n      this.render()\n    } else {\n      this.changeDetectorRef.detectChanges()\n    }\n  }\n\n  saveState(): ITreeState {\n    const { term } = this.filter\n    const dataNodes = this.controler.dataNodes || []\n    const state: ITreeState = {\n      filter: { term },\n      active: this.activeNode ? this.activeNode.id : '',\n      expandedNodes: dataNodes\n        .filter((e) => {\n          return this.controler.isExpanded(e)\n        })\n        .map((e) => e.id),\n    }\n    return state\n  }\n\n  restoreState(state: ITreeState): void {\n    state = state || {\n      active: '',\n      filter: new TreeFilter(),\n      expandedNodes: [],\n    }\n\n    state.active = state.active || ''\n    state.filter = state.filter || new TreeFilter()\n    state.expandedNodes = state.expandedNodes || []\n\n    this.hiddenNodes.clear()\n    this.selectedNodes.clear()\n\n    this.collapseAll(false)\n\n    const { active, filter, expandedNodes } = state\n\n    if (filter.term) {\n      this.search(filter)\n    } else {\n      expandedNodes.forEach((node) => this.expand(node, false))\n      this.render()\n    }\n\n    if (active) {\n      const activeNode = this.findHolder(active)\n      if (activeNode) {\n        this.focus(activeNode)\n      }\n    }\n  }\n\n  //#endregion\n\n  //#region CALLED FROM TEMPLATE\n  protected _onEdit(event: Event): void {\n    const adapter = this.adapter()\n    if (adapter.onDidEditName) {\n      event.stopPropagation()\n\n      const { node, text, creation } = this.editing\n      if (!node) {\n        throw new Error('There is no focused node.')\n      }\n\n      const isBlur = event instanceof FocusEvent && event.type === 'blur'\n      const isEnter = event instanceof KeyboardEvent && event.key === 'Enter'\n      const isEscape = event instanceof KeyboardEvent && event.key === 'Escape'\n\n      if (isEscape) {\n        event.preventDefault()\n        this.endEdition()\n      } else if (isBlur || isEnter) {\n        event.preventDefault()\n        const name = text?.trim() || ''\n        try {\n          if (name) {\n            adapter.onDidEditName({\n              node: node,\n              text: name,\n              creation,\n            })\n          }\n        } finally {\n          this.focus(node)\n          this.endEdition()\n        }\n      }\n    }\n  }\n\n  protected _clearFilter(): void {\n    this.search({ term: '' })\n  }\n\n  protected _isRenaming(node: INode<T>): boolean {\n    if (node == null) {\n      throw new ReferenceError('Argument \"node\" is required.')\n    }\n\n    if (!this.editing?.node) {\n      return false\n    }\n\n    return !this.editing.creation && this.findHolder(node)?.id === this.adapter().idProvider(this.editing.node)\n  }\n\n  protected _isCreating(node: INode<T>): boolean {\n    if (node == null) {\n      throw new ReferenceError('Argument \"node\" is required.')\n    }\n\n    if (!this.editing?.node) {\n      return false\n    }\n\n    return !!this.editing.creation && this.findHolder(node)?.id === this.adapter().idProvider(this.editing.node)\n  }\n\n  //#endregion\n\n  //#region EVENTS\n\n  @HostListener('document:keyup')\n  keyup() {\n    this.isShiftKeyPressed = false\n  }\n\n  @HostListener('document:keydown', ['$event'])\n  keydown($event: KeyboardEvent) {\n    this.isShiftKeyPressed = $event.shiftKey\n    if (this.isTreeContainsEvent($event)) {\n      this.onKeyDown($event)\n    }\n  }\n\n  @HostListener('document:click', ['$event'])\n  mousedown($event: MouseEvent) {\n    this.changeDetectorRef.detach()\n    if (this.isTreeContainsEvent($event)) {\n      this.changeDetectorRef.reattach()\n      this.onMouseDown($event)\n    }\n  }\n\n  @HostListener('document:contextmenu', ['$event'])\n  contextmenu($event: MouseEvent) {\n    this.changeDetectorRef.detach()\n    if (this.isTreeContainsEvent($event)) {\n      this.changeDetectorRef.reattach()\n      this.onContextMenu($event)\n    }\n  }\n\n  private onKeyDown(event: KeyboardEvent): void {\n    if (!this.activeNode && !this.isEmpty && !this.selectedNodes.size) {\n      this.focus(this.controler.dataNodes[0])\n    }\n\n    const element = this.activeNode ? this.domNode(this.activeNode) : undefined\n\n    if (element && this.activeNode) {\n      switch (event.key) {\n        case 'ArrowUp':\n          event.preventDefault()\n          event.stopPropagation()\n          this.navigate(element, 'up')\n          break\n        case 'ArrowDown':\n          event.preventDefault()\n          event.stopPropagation()\n          this.navigate(element, 'down')\n          break\n        case 'ArrowLeft':\n          if (!this.isShiftKeyPressed) {\n            event.preventDefault()\n            event.stopPropagation()\n            this.collapse(this.activeNode, true)\n          }\n          break\n        case 'ArrowRight':\n          if (!this.isShiftKeyPressed) {\n            event.preventDefault()\n            event.stopPropagation()\n            this.expand(this.activeNode, true)\n          }\n          break\n        default:\n          this.triggerKeyboardEvent(event)\n          this.triggerFilterEvent(event)\n          break\n      }\n    } else {\n      this.triggerFilterEvent(event)\n    }\n\n    if (event.key === 'Backspace') {\n      // prevent browser to navigate back if Backspace is pressed\n      event.preventDefault()\n    }\n  }\n\n  private onMouseDown(event: MouseEvent): void {\n    const node = this.findHolderFromEvent(event)\n    if (!node) {\n      return\n    }\n\n    if (this.isShiftKeyPressed && this.activeNode) {\n      const domStart = this.domNode(this.activeNode)\n      if (!domStart) {\n        this.select(node)\n        return\n      }\n\n      const domEnd = this.domNode(node)\n      if (!domEnd) {\n        return\n      }\n\n      // select all nodes between the focused and the target node.\n\n      this.unselectAll(false)\n\n      let cursor = domStart\n      const y2 = domEnd.getClientRects().item(0)!.top\n      const y1 = domStart.getClientRects().item(0)!.top\n      if (y1 < y2) {\n        // traverse down\n        do {\n          this.select(cursor, false)\n          cursor = cursor.nextElementSibling as HTMLElement\n        } while (cursor && !cursor.isEqualNode(domEnd))\n      } else if (y1 > y2) {\n        // traverse up\n        do {\n          this.select(cursor, false)\n          cursor = cursor.previousElementSibling as HTMLElement\n        } while (cursor && !cursor.isEqualNode(domEnd))\n      }\n\n      this.select(domEnd, false)\n      this.focus(node, true)\n    } else {\n      this.unselectAll(false)\n      this.toggle(node, false)\n      this.focus(node, true)\n\n      const { actions } = this.adapter()\n      if (actions?.mouse?.click) {\n        actions.mouse.click({\n          node: node.data,\n          event: event,\n        })\n      }\n    }\n  }\n\n  private onContextMenu(e: MouseEvent) {\n    e.preventDefault()\n    e.stopPropagation()\n\n    const node = this.findHolderFromEvent(e)\n    if (node) {\n      if (!this.isSelected(node)) {\n        this.unselectAll(false)\n      }\n      this.focus(node, true)\n    }\n\n    const { actions } = this.adapter()\n    if (actions?.mouse?.rightClick) {\n      actions.mouse.rightClick({\n        node: node?.data,\n        event: e,\n      })\n    }\n  }\n\n  private isTreeContainsEvent(event: Event): boolean {\n    return this.elementRef.nativeElement.contains(event.target as any)\n  }\n\n  private triggerFilterEvent(e: KeyboardEvent) {\n    if (e.defaultPrevented || !this.adapter().enableKeyboardFiltering) {\n      return\n    }\n\n    // prevent browser to navigate back if Backspace is pressed\n    e.preventDefault()\n    e.stopPropagation()\n\n    const { term } = this.filter\n    switch (e.key) {\n      case 'Backspace':\n        if (term) {\n          this.search({ term: term.slice(0, -1) })\n        }\n        break\n      case ' ':\n      case 'Tab':\n        break\n      default:\n        if (e.key.length === 1) {\n          this.search({ term: term + e.key })\n        }\n        break\n    }\n  }\n\n  private triggerKeyboardEvent(event: KeyboardEvent): void {\n    if (!this.activeNode) {\n      return\n    }\n\n    const { actions } = this.adapter()\n    if (actions) {\n      const { keys } = actions\n      if (keys) {\n        const action = keys[event.key]\n        if (action) {\n          action({\n            event: event,\n            node: this.activeNode.data,\n          })\n        }\n      }\n    }\n  }\n\n  //#endregion\n\n  //#region PRIVATE\n  private render(): void {\n    const nodes: ITreeNodeHolder<T>[] = []\n    const dataNodes = this.controler.dataNodes || []\n    const expandedNodes = new Set(this.controler.expansionModel.selected.map((node) => node.id))\n\n    this.isEmpty = true\n    dataNodes.forEach((node) => {\n      this.isEmpty = false\n      if (this.hiddenNodes.has(node.id)) {\n        return\n      }\n\n      node.focused = this.isFocused(node)\n      node.expanded = this.isExpanded(node)\n      node.renaming = this._isRenaming(node)\n      node.creating = this._isCreating(node)\n      node.selected = this.isSelected(node)\n\n      // root nodes are always visible\n      if (node.level === 0) {\n        nodes.push(node)\n        return\n      }\n\n      let parent = this.findParent(node)\n      while (parent != null) {\n        // hide a node if any of its ancestors is not expanded\n        if (!expandedNodes.has(parent.id)) {\n          return\n        }\n\n        if (parent.level === 0) {\n          break\n        }\n\n        parent = this.findParent(parent)\n      }\n      nodes.push(node)\n    })\n\n    this.visibleNodes.next(nodes)\n\n    this.changeDetectorRef.detectChanges()\n  }\n\n  private buildIndexes(): void {\n    this.nodesIndex.clear()\n    this.parentsIndex.clear()\n    this.controler.dataNodes = this.flattenNodes(this.nodes())\n    this.controler.dataNodes?.forEach((node) => {\n      this.nodesIndex.set(node.id, node)\n    })\n  }\n\n  private buildSearchPattern(): RegExp | undefined {\n    let pattern: RegExp | undefined\n    try {\n      if (this.filter.term) {\n        const escape = (text: string) => {\n          return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n        }\n        pattern = new RegExp(`(${escape(this.filter.term)})`, 'g')\n      }\n    } catch (error) {\n      console.error(error)\n    }\n    return pattern\n  }\n\n  /**\n   * Gets the dom element associated to the given node.\n   * @param e A node.\n   */\n  private domNode(e: INode<T>): HTMLElement | null {\n    const node = this.findHolder(e)\n    if (!node) {\n      throw new Error(e + ' is not a registered node')\n    }\n    return document.querySelector(`[${this.DATA_TREE_NODE_ID}=\"${node.id}\"]`)\n  }\n\n  /**\n   * Adds the given node to the selected nodes.\n   * @param node The node to select.\n   */\n  private select(node: INode<T>, detectChanges: boolean = true): void {\n    const holder = this.findHolder(node)\n    if (!holder) {\n      return\n    }\n\n    this.selectedNodes.set(holder.id, holder)\n\n    if (detectChanges) {\n      this.changeDetectorRef.detectChanges()\n    }\n  }\n\n  /**\n   * Removes the given node to the selected nodes.\n   * @param node The node to unselect.\n   */\n  private unselect(node: INode<T>, detectChanges: boolean = true): void {\n    const holder = this.findHolder(node)\n    if (!holder) {\n      return\n    }\n\n    this.selectedNodes.delete(holder.id)\n\n    if (holder.id === this.activeNode?.id) {\n      this.activeNode = undefined\n    }\n\n    if (detectChanges) {\n      this.changeDetectorRef.detectChanges()\n    }\n  }\n\n  /**\n   * Clears the selected nodes.\n   */\n  private unselectAll(detectChanges: boolean = true): void {\n    this.activeNode = undefined\n    this.selectedNodes.clear()\n\n    if (detectChanges) {\n      this.changeDetectorRef.detectChanges()\n    }\n  }\n\n  /**\n   * Expands the ancestors of the given node.\n   * @param node A node reference.\n   */\n  private expandAncestors(node: ITreeNodeHolder<T>) {\n    this.iterateAncestors(node, (e) => {\n      if (e.expandable && !this.controler.isExpanded(e)) {\n        this.controler.expand(e)\n        const adapter = this.adapter()\n        if (adapter.onDidExpand) {\n          adapter.onDidExpand(e.data)\n        }\n      }\n    })\n  }\n\n  /**\n   * Call the given `action` for the ancestors of the given node.\n   * @param node A node reference.\n   * @param action A function to call for each ancestor.\n   */\n  private iterateAncestors(node: ITreeNodeHolder<T>, action: (e: ITreeNodeHolder<T>) => void) {\n    const recursive = (e: ITreeNodeHolder<T>) => {\n      action(e)\n      const p = this.findParent(e)\n      if (p && p.level >= 0) {\n        recursive(p)\n      }\n    }\n\n    const parent = this.findParent(node)\n    if (parent) {\n      recursive(parent)\n    }\n  }\n\n  /**\n   * Moves the scrollbar to the given node.\n   * @param node The node to show.\n   */\n  private scrollInto(node: INode<T>) {\n    const holder = this.findHolder(node)\n    if (holder) {\n      const index = this.visibleNodes.value.indexOf(holder)\n      if (index == -1) {\n        return\n      }\n      this.domNode(node)?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })\n    }\n  }\n\n  /**\n   * Focus the node before of after `currEl` depending on the given `direction`.\n   * @param currEl Current element\n   * @param direction Navigation direction.\n   */\n  private navigate(currEl: Element, direction: 'up' | 'down'): void {\n    this.unselectAll()\n\n    const currNode = this.findHolderFromElement(currEl)\n    if (!currNode) {\n      return\n    }\n\n    const prevEl = currEl.previousElementSibling\n    const nextEl = currEl.nextElementSibling\n    const targEl = direction === 'up' ? prevEl : nextEl\n    if (!targEl) {\n      return\n    }\n\n    const targNode = this.findHolderFromElement(targEl)\n    if (!targNode) {\n      this.focus(currNode)\n      return\n    }\n\n    const prevNode: ITreeNodeHolder<T> | undefined = prevEl ? this.findHolderFromElement(prevEl) : undefined\n\n    if (prevNode && this.isSelected(prevNode) && targEl.isEqualNode(prevEl)) {\n      this.unselect(currNode)\n    }\n\n    const nextNode: ITreeNodeHolder<T> | undefined = nextEl ? this.findHolderFromElement(nextEl) : undefined\n\n    if (nextNode && this.isSelected(nextNode) && targEl.isEqualNode(nextEl)) {\n      this.unselect(currNode)\n    }\n\n    this.focus(targNode)\n  }\n\n  private findParent(node: INode<T>): ITreeNodeHolder<T> | undefined {\n    const holder = this.findHolder(node)\n    if (!holder) {\n      return\n    }\n    const parentId = this.parentsIndex.get(holder.id)\n    if (parentId) {\n      return this.nodesIndex.get(parentId)\n    }\n    return undefined\n  }\n\n  private findHolderFromId(id: string): ITreeNodeHolder<T> | undefined {\n    const { dataNodes } = this.controler\n    if (!dataNodes) {\n      return undefined\n    }\n    return dataNodes.find((n) => n.id === id)\n  }\n\n  private findHolderFromData(data: T): ITreeNodeHolder<T> | undefined {\n    const { dataNodes } = this.controler\n    if (!dataNodes) {\n      return undefined\n    }\n\n    return this.nodesIndex.get(this.adapter().idProvider(data))\n  }\n\n  private findHolderFromEvent(event: Event): ITreeNodeHolder<T> | undefined {\n    const { dataNodes } = this.controler\n    if (!dataNodes) {\n      return undefined\n    }\n\n    const dataId = this.DATA_TREE_NODE_ID\n    const fn = (target?: HTMLElement | null): ITreeNodeHolder<T> | undefined => {\n      if (!target) {\n        return undefined\n      }\n\n      const targetId = target.getAttribute(dataId)\n      return targetId ? this.nodesIndex.get(targetId) : fn(target.parentElement)\n    }\n\n    return fn(event.target as any)\n  }\n\n  private findHolderFromElement(element: Element): ITreeNodeHolder<T> | undefined {\n    const { dataNodes } = this.controler\n    if (!dataNodes) {\n      return undefined\n    }\n\n    const id = element.getAttribute(this.DATA_TREE_NODE_ID)\n    if (!id) {\n      return undefined\n    }\n\n    return this.nodesIndex.get(id)\n  }\n\n  private findHolder(node: INode<T>): ITreeNodeHolder<T> | undefined {\n    if (!node) {\n      return undefined\n    }\n\n    if (!this.controler.dataNodes) {\n      return undefined\n    }\n\n    if (typeof node === 'string') {\n      return this.findHolderFromId(node)\n    }\n\n    if (node instanceof Element) {\n      return this.findHolderFromElement(node)\n    }\n\n    // instanceof ITreeNodeHolder<T>\n    if ('data' in (node as unknown as any)) {\n      return node as ITreeNodeHolder<T>\n    }\n\n    // instance of T\n    return this.findHolderFromData(node as T)\n  }\n\n  /**\n   * Flattens the nested `nodes` into a depth-first list of holders, recursing into\n   * the children of expandable nodes (mirrors the former MatTreeFlattener). The flat\n   * list is what `FlatTreeControl` and the rest of the component operate on.\n   */\n  private flattenNodes(nodes: T[], level = 0, accumulator: ITreeNodeHolder<T>[] = []): ITreeNodeHolder<T>[] {\n    for (const node of nodes) {\n      const holder = this.transformer(node, level)\n      accumulator.push(holder)\n      if (holder.expandable) {\n        this.flattenNodes(this.children(node), level + 1, accumulator)\n      }\n    }\n    return accumulator\n  }\n\n  private children(node: T): T[] {\n    const children = this.adapter().childrenProvider(node) || []\n    const parentId = this.adapter().idProvider(node)\n    children.forEach((child) => {\n      this.parentsIndex.set(this.adapter().idProvider(child), parentId)\n    })\n    return children\n  }\n\n  private transformer(node: T, level: number): ITreeNodeHolder<T> {\n    const expandable = this.adapter().isExpandable(node)\n    return {\n      id: this.adapter().idProvider(node),\n      data: node,\n      name: this.adapter().nameProvider(node),\n      level: level,\n      padding: level * 12 + 'px',\n      tooltip: this.adapter().tooltipProvider?.(node),\n      expandable,\n    }\n  }\n  //#endregion\n}\n","@if (filter.term) {\n  <div class=\"tree-filter\" title=\"Filter\">\n    <span class=\"tree-filter__label\">{{ filter.term }}</span>\n    <div class=\"tree-filter__commands\">\n      <span class=\"command-clear\" role=\"button\" title=\"Clear\" (click)=\"_clearFilter()\">&times;</span>\n    </div>\n  </div>\n}\n\n<div tabindex=\"0\" class=\"tree-component\" [class.editing]=\"editing.node != null\" [style.height]=\"treeHeight\">\n  @for (node of visibleNodes | async; track node.id) {\n    <!-- RENAMING -->\n    @if (node.renaming) {\n      <div\n        class=\"tree-node opaque focused selected tree-node--level-{{ node.level + 1 }}\"\n        [attr.data-tree-node-id]=\"node.id\"\n        [style.padding-left]=\"node.padding\"\n        [style.height.px]=\"adapter().itemHeight\"\n      >\n        <div class=\"tree-node__content\" [style.height.px]=\"adapter().itemHeight\">\n          <ng-container *ngTemplateOutlet=\"inputTemplate\" />\n        </div>\n      </div>\n    } @else {\n      <div\n        class=\"tree-node tree-node--level-{{ node.level }}\"\n        [attr.data-tree-node-id]=\"node.id\"\n        [style.padding-left]=\"node.padding\"\n        [style.height.px]=\"adapter().itemHeight\"\n        [ngClass]=\"{\n          focused: node.focused,\n          selected: node.selected,\n          expanded: node.expanded,\n        }\"\n      >\n        <div class=\"tree-node__content\" [style.height.px]=\"adapter().itemHeight\">\n          <ng-container *ngTemplateOutlet=\"nodeDirective().templateRef; context: { $implicit: node }\" />\n        </div>\n      </div>\n    }\n    <!-- NODE -->\n    <!-- CREATING -->\n    @if (node.creating) {\n      <div\n        class=\"tree-node opaque focused selected tree-node--level-{{ node.level + 1 }}\"\n        [style.padding-left]=\"node.padding\"\n        [style.height.px]=\"adapter().itemHeight\"\n      >\n        <div class=\"tree-node__content\" [style.height.px]=\"adapter().itemHeight\">\n          <ng-container *ngTemplateOutlet=\"inputTemplate\" />\n        </div>\n      </div>\n    }\n  }\n</div>\n\n<ng-template #inputTemplate>\n  <span class=\"tree-input\">\n    <input\n      autofocus\n      type=\"text\"\n      placeholder=\"Press Enter to create ESC to cancel...\"\n      (click)=\"$event.preventDefault(); $event.stopPropagation()\"\n      [(ngModel)]=\"editing.text\"\n      (keydown)=\"_onEdit($event)\"\n      (blur)=\"_onEdit($event)\"\n    />\n  </span>\n</ng-template>\n","import { NgModule } from '@angular/core'\nimport { FormsModule } from '@angular/forms'\nimport { CommonModule } from '@angular/common'\n\nimport { ScrollingModule } from '@angular/cdk/scrolling'\n\nimport { TreeComponent } from './tree.component'\nimport { TreeNodeDirective } from './tree-node.directive'\n\nimport { AutofocusDirective } from './autofocus.directive'\n\n@NgModule({\n  imports: [CommonModule, FormsModule, ScrollingModule, TreeComponent, TreeNodeDirective, AutofocusDirective],\n  exports: [TreeComponent, TreeNodeDirective],\n})\nexport class NgeUiTreeModule {}\n","import { Injectable } from '@angular/core'\nimport { CURRENT_VISIBLE_TREES } from './internal'\nimport { ITree } from './tree.model'\n\n@Injectable({ providedIn: 'root' })\nexport class TreeService {\n  /**\n   * Gets the tree identified by `id` if the tree is visible.\n   * @param id Identifier of a tree.\n   */\n  get<T>(id: string): ITree<T> | undefined {\n    return CURRENT_VISIBLE_TREES.get(id) as ITree<T>\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAOA;MAKa,iBAAiB,CAAA;AAJ9B,IAAA,WAAA,GAAA;AAKW,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAA0B,WAAW,CAAC;AAMpE,IAAA;;AAHC,IAAA,OAAO,sBAAsB,CAAI,CAAuB,EAAE,GAAQ,EAAA;AAChE,QAAA,OAAO,IAAI;IACb;8GANW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,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