{"version":3,"file":"daffodil-design-tree.mjs","names":[],"sources":["../../../libs/design/tree/src/tree/tree-notifier.service.ts","../../../libs/design/tree/src/utils/flatten-tree.ts","../../../libs/design/tree/src/utils/traverse-tree.ts","../../../libs/design/tree/src/utils/hydrate-tree.ts","../../../libs/design/tree/src/tree/tree.component.ts","../../../libs/design/tree/src/tree/tree.component.html","../../../libs/design/tree/src/utils/walk-up.ts","../../../libs/design/tree/src/utils/open-ancestors.ts","../../../libs/design/tree/src/tree-item/tree-item.directive.ts","../../../libs/design/tree/src/tree.module.ts","../../../libs/design/tree/src/utils/transform.ts","../../../libs/design/tree/src/tree.ts"],"sourcesContent":["import {\n  Inject,\n  OnDestroy,\n} from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\n/**\n * This service is used by tree items to notify their parent\n * that the tree has to be recomputed.\n *\n * This service is a multiton associated with each tree instance.\n * It follows the same lifecycle as the tree it is associated with.\n */\n@Inject({})\nexport class DaffTreeNotifierService implements OnDestroy {\n\n  /**\n   * @docs-private\n   */\n  private _notice: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);\n\n  /**\n   * An observable that emits when the tree needs to be re-computed.\n   */\n  notice$ = this._notice.asObservable();\n\n  /**\n   * `notify` can be called to trigger a re-computation of the tree\n   * if data has changed unexpectedly and a re-render did not occur.\n   *\n   * This should be used sparingly. Instead, prefer updating `data` on the tree\n   * itself for performance reasons.\n   */\n  notify() {\n    this._notice.next(true);\n  }\n\n  /**\n   * Cleanup when the tree is destroyed.\n   *\n   * @docs-private\n   */\n  ngOnDestroy(): void {\n    this._notice.complete();\n  }\n}\n","import { collect } from '@daffodil/core';\n\nimport { DaffTreeUi } from '../interfaces/tree-ui';\n\n/**\n * A flattened node of a tree. This is used when translating the tree data\n * structure into an array.\n */\nexport interface DaffTreeFlatNode {\n  id: number | string;\n  title: string;\n  url: string;\n  level: number;\n  hasChildren: boolean;\n  data: unknown;\n  visible: boolean;\n  _treeRef: DaffTreeUi<unknown>;\n}\n\n/**\n * Flatten a DaffTreeUi<unknown> into an array, removing elements from the array\n * below nodes in the tree that are not open.\n */\nexport const flattenTree = (daffUiTree: DaffTreeUi<unknown>, removeNodes: boolean = false): DaffTreeFlatNode[] =>  {\n  const tree: DaffTreeFlatNode[] = [];\n  if(!daffUiTree) {\n    return [];\n  }\n\n  let items = [\n    {\n      ...daffUiTree,\n      level: 0,\n      data: undefined,\n      open: true,\n      _treeRef: daffUiTree,\n    },\n  ];\n\n\n  while(items) {\n    const el = items.pop();\n    if(!el) {\n      break;\n    }\n\n    items = [\n      ...items,\n      ...el.items.map((i) => ({\n        ...i,\n        level:\n        el.level + 1,\n        _treeRef: i,\n      })).reverse(),\n    ];\n\n    const hasClosedAncestor = el._treeRef.parent\n      ? collect(el._treeRef.parent, (node) => node.parent ? [node.parent] : [], el.level).reduce(\n        (acc, parent) => acc || !parent.open,\n        false,\n      )\n      : false;\n\n    if(!removeNodes && el._treeRef.parent) {\n      tree.push({\n        id: el.id,\n        title: el.title,\n        level: el.level,\n        url : el.url,\n        visible: !hasClosedAncestor,\n        hasChildren: el.items.length > 0,\n        data: el.data,\n        _treeRef: el._treeRef,\n      });\n    } else if(removeNodes && el._treeRef.parent?.open) {\n      tree.push({\n        id: el.id,\n        title: el.title,\n        level: el.level,\n        url : el.url,\n        visible: !hasClosedAncestor,\n        hasChildren: el.items.length > 0,\n        data: el.data,\n        _treeRef: el._treeRef,\n      });\n    }\n  }\n\n  return tree;\n};\n","import { RecursiveTreeKeyOfType } from '../interfaces/recursive-key';\n\n/**\n * Traverse the tree, pre-order, right-to-left\n */\nexport const traverse = <T extends Record<any, any>, V extends Record<any, any> = T>(\n  tree: T,\n  visit: (tree: T) => V,\n  key: RecursiveTreeKeyOfType<T>,\n): V => {\n  let stack = [\n    tree,\n  ];\n\n  while(stack) {\n    const el = stack.pop();\n    if(!el) {\n      break;\n    }\n\n    visit(el);\n\n    stack = [\n      ...stack,\n      ...<T[]><unknown>el[key],\n    ];\n  }\n\n  return tree;\n};\n","import { traverse } from './traverse-tree';\nimport { DaffTreeData } from '../interfaces/tree-data';\nimport { DaffTreeUi } from '../interfaces/tree-ui';\n\nexport const daffDataTreeToUiTree = <T>(data: DaffTreeData<T>, parent: DaffTreeUi<T>, open: boolean = false): DaffTreeUi<T> => ({\n  id: parent ? `${parent.id}.${data.id ?? data.title}` : (data.id ?? data.title),\n  title: data.title,\n  url: data.url,\n  data: data.data,\n  open,\n  parent,\n  items: [],\n});\n\n/**\n * This function translates the original data given to us by the client\n * to the internal representation of the tree used by the {@link DaffTreeComponent}\n */\nexport const hydrateTree = <T>(data: DaffTreeData<T>, treeId?: string): DaffTreeUi<T> => {\n  const root: DaffTreeUi<T> = {\n    id: treeId ?? (data.id ?? data.title),\n    title: data.title,\n    url: data.url,\n    data: data.data,\n    open: true,\n    parent: undefined,\n    items: [],\n  };\n\n  let treeStack = [\n    root,\n  ];\n\n  traverse(data, (el) => {\n    const treeEl = treeStack.pop();\n    treeEl.items = el.items.map((i) =>  daffDataTreeToUiTree(i, treeEl, false));\n    treeStack = [\n      ...treeStack,\n      ...treeEl.items,\n    ];\n    return el;\n  }, 'items');\n\n  return root;\n};\n","/* eslint-disable quote-props */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n  ChangeDetectionStrategy,\n  Component,\n  computed,\n  contentChild,\n  inject,\n  input,\n  signal,\n  TemplateRef,\n  ViewEncapsulation,\n} from '@angular/core';\n\nimport { DaffArticleEncapsulatedDirective } from '@daffodil/design';\n\nimport { DaffTreeNotifierService } from './tree-notifier.service';\nimport { DaffTreeData } from '../interfaces/tree-data';\nimport { DaffTreeRenderMode } from '../interfaces/tree-render-mode';\nimport { flattenTree } from '../utils/flatten-tree';\nimport { hydrateTree } from '../utils/hydrate-tree';\n\nlet daffTreeId = 0;\n\n/**\n * The `DaffTreeComponent` allows you to render tree structures as interactable UI.\n *\n * @example Basic use of the tree component\n * ```html\n * <ul daff-tree [tree]=\"tree\">\n *   <ng-template #daffTreeItemWithChildrenTpl let-node>\n *       <button daffTreeItem [node]=\"node\">{{ node.title }} </button>\n *   </ng-template>\n *\n *   <ng-template #daffTreeItemTpl let-node>\n *       <a daffTreeItem [node]=\"node\" [routerLink]=\"node.url\">{{ node.title }}</a>\n *   </ng-template>\n * </ul>\n * ```\n *\n * where `tree` is a {@link DaffTreeData}.\n *\n */\n@Component({\n  // eslint-disable-next-line @angular-eslint/component-selector\n  selector: 'ul[daff-tree]',\n  templateUrl: './tree.component.html',\n  styleUrls: ['./tree.component.scss'],\n  encapsulation: ViewEncapsulation.None,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  providers: [\n    DaffTreeNotifierService,\n  ],\n  hostDirectives: [{\n    directive: DaffArticleEncapsulatedDirective,\n  }],\n  host: {\n    'class': 'daff-tree',\n  },\n  imports: [\n    NgTemplateOutlet,\n  ],\n})\nexport class DaffTreeComponent {\n  private notifier = inject(DaffTreeNotifierService);\n\n  /**\n   * The rendering mode for nodes in the tree.\n   *\n   * Default value is `in-dom`, which means nodes are present in the DOM.\n   *\n   * Generally, `not-in-dom` is faster as there are less DOM elements to render,\n   * but there may be use-cases (like SEO) where having the tree in the DOM\n   * is relevant.\n   */\n  readonly renderMode = input<DaffTreeRenderMode>('in-dom');\n\n  /**\n   * A unique identifier for the tree instance.\n   * Used as a prefix for all node IDs in the tree.\n   * If not provided, an auto-incrementing number is used.\n   */\n  readonly id = input<string>(`${daffTreeId++}`);\n\n  /**\n   * The tree data you would like to render.\n   */\n  readonly tree = input<DaffTreeData<unknown>>();\n\n  /**\n   * The internal tree element.\n   */\n  private _tree = computed(() => {\n    const tree = this.tree();\n    return tree ? hydrateTree(tree, this.id()) : undefined;\n  });\n\n  /**\n   * A revision counter incremented by notifications from tree items.\n   * Used to trigger re-flattening when tree item state changes.\n   */\n  readonly _revision = signal(0);\n\n  /**\n   * @docs-private\n   *\n   * The flattened tree data. For debugging purposes, you can iterate through this if you want to inspect\n   * the resulting array structure we computed to render the tree.\n   */\n  readonly flatTree = computed(() => {\n    this._revision();\n    const tree = this._tree();\n    return tree ? flattenTree(tree, this.renderMode() === 'not-in-dom') : [];\n  });\n\n  /**\n   * The template used to render tree-nodes that themselves have children.\n   *\n   * @docs-private\n   */\n  readonly withChildrenTemplate = contentChild<TemplateRef<any>>('daffTreeItemWithChildrenTpl');\n\n  /**\n   * The template used to render tree-nodes that have no children.\n   *\n   * @docs-private\n   */\n  readonly treeItemTemplate = contentChild<TemplateRef<any>>('daffTreeItemTpl');\n\n  constructor() {\n    this.notifier.notice$.subscribe(() => {\n      this._revision.update((r) => r + 1);\n    });\n  }\n}\n","@for (node of flatTree(); track node.id) {\n\t<li [attr.aria-level]=\"node.level\" [class.hidden]=\"!node.visible\">\n\t\t<ng-container\n\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate() : treeItemTemplate(); context: { $implicit: node }\">\n\t\t</ng-container>\n\t</li>\n}","import { DaffTreeUi } from '../interfaces/tree-ui';\n\n/**\n * Walk up the tree from a leaf to the root applying the\n * visit function at each node along the way.\n */\nexport const walkUp = <T>(\n  tree: DaffTreeUi<T>,\n  visit: (tree: DaffTreeUi<T>) => DaffTreeUi<T>,\n): DaffTreeUi<T> => {\n  while(tree.parent) {\n    visit(tree);\n    tree = tree.parent;\n  }\n\n  return tree;\n};\n","import { walkUp } from './walk-up';\nimport { DaffTreeUi } from '../interfaces/tree-ui';\n\n/**\n * Open all ancestor nodes of the given node so that it becomes visible in the tree.\n */\nexport const daffTreeOpenAncestors = <T>(node: DaffTreeUi<T>): void => {\n  walkUp(node, (ancestor) => {\n    ancestor.open = true;\n    return ancestor;\n  });\n};\n","/* eslint-disable quote-props */\n\nimport { DOCUMENT } from '@angular/common';\nimport {\n  computed,\n  Directive,\n  effect,\n  inject,\n  input,\n  untracked,\n} from '@angular/core';\n\nimport { DaffTreeNotifierService } from '../tree/tree-notifier.service';\nimport { DaffTreeFlatNode } from '../utils/flatten-tree';\nimport { daffTreeOpenAncestors } from '../utils/open-ancestors';\n\n/**\n * The `DaffTreeItemDirective` marks elements as tree child nodes that interact with the parent tree structure.\n *\n * @example Using a `[daffTreeItem]`\n *\n * `[tree]` is a {@link DaffTreeData} and `[daff-tree]` is a {@link DaffTreeComponent}.\n *\n * ```html\n * <ul daff-tree [tree]=\"tree\">\n *   <ng-template #daffTreeItemWithChildrenTpl let-node>\n *       <button daffTreeItem [node]=\"node\">{{ node.title }} </button>\n *   </ng-template>\n *\n *   <ng-template #daffTreeItemTpl let-node>\n *       <a daffTreeItem [node]=\"node\" [routerLink]=\"node.url\">{{ node.title }}</a>\n *   </ng-template>\n * </ul>\n * ```\n *\n */\n@Directive({\n  selector: '[daffTreeItem]',\n  host: {\n    'class': 'daff-tree-item',\n    '[class.selected]': 'selected()',\n    '[class.parent]': 'isParent()',\n    '[class.open]': 'open()',\n    '[attr.id]': 'id()',\n    '[attr.aria-expanded]': 'ariaExpanded()',\n    '[style.--depth]': 'depth()',\n    '(keydown.escape)': 'onEscape()',\n    '(click)': 'onClick()',\n  },\n})\nexport class DaffTreeItemDirective {\n  private document = inject(DOCUMENT);\n  private treeNotifier = inject(DaffTreeNotifierService);\n\n  /**\n   * The {@link DaffTreeFlatNode} associated with this specific tree item.\n   */\n  readonly node = input.required<DaffTreeFlatNode>();\n\n  /**\n   * Whether or not the tree item is the currently active item.\n   * Note that there is no requirement that there only be one active item at a time.\n   *\n   * When a tree item becomes selected, all of its ancestor nodes\n   * will be automatically opened so that the selected item is visible.\n   */\n  readonly selected = input(false);\n\n  /**\n   * The html `id` of the tree item. This is derived from the {@link DaffTreeData}.\n   */\n  protected readonly id = computed(() => 'tree-' + this.node().id);\n\n  /**\n   * A property indicating the depth of the tree.\n   */\n  protected readonly depth = computed(() => this.node().level);\n\n  /**\n   * Whether or not this node has children.\n   */\n  protected readonly isParent = computed(() => this.node().hasChildren);\n\n  /**\n   * Indicates whether or not the tree is `open`.\n   */\n  protected readonly open = computed(() => this.node()._treeRef.open);\n\n  /**\n   * Accessibility property, notifying users about whether\n   * or not the tree item is open.\n   *\n   * @docs-private\n   */\n  protected readonly ariaExpanded = computed(() => {\n    const node = this.node();\n    return node.hasChildren ? (node._treeRef.open ? 'true' : 'false') : undefined;\n  });\n\n  constructor() {\n    effect(() => {\n      if(this.selected()) {\n        const node = untracked(this.node);\n        daffTreeOpenAncestors(node._treeRef);\n        this.treeNotifier.notify();\n      }\n    });\n  }\n\n  /**\n   * @docs-private\n   */\n  onEscape() {\n    this.toggleParent(this.node());\n  }\n\n  /**\n   * @docs-private\n   */\n  onClick() {\n    if(this.node().hasChildren) {\n      this.toggleTree(this.node());\n    }\n    this.treeNotifier.notify();\n  }\n\n  /**\n   * Toggle the open state of the tree's parent.\n   */\n  toggleParent(node: DaffTreeFlatNode) {\n    if(node._treeRef?.parent.parent === undefined) {\n      return;\n    }\n    node._treeRef.parent.open = !node._treeRef.parent.open;\n    (<Document>this.document).getElementById('tree-' + node._treeRef.parent.id).focus();\n  }\n\n  /**\n   * Toggle the open state of this specific subtree tree.\n   */\n  toggleTree(node: DaffTreeFlatNode) {\n    if(node._treeRef.open === false) {\n      node._treeRef.open = true;\n    } else {\n      node._treeRef.open = false;\n    }\n  }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffTreeComponent } from './tree/tree.component';\nimport { DaffTreeItemDirective } from './tree-item/tree-item.directive';\n\n/**\n * @deprecated in favor of {@link DAFF_TREE_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n  imports: [\n    CommonModule,\n    DaffTreeComponent,\n    DaffTreeItemDirective,\n  ],\n  exports: [\n    DaffTreeComponent,\n    DaffTreeItemDirective,\n  ],\n})\nexport class DaffTreeModule { }\n","import { RecursiveTreeKeyOfType } from '../interfaces/recursive-key';\nimport { DaffTreeData } from '../interfaces/tree-data';\n\n/**\n * Transform a tree-like structure into a {@link DaffTreeData}.\n *\n * @param tree - The data structure representing tree-like data.\n * @param transformFn - A user-supplied function that will transform the user\n *  type into a {@link DaffTreeData}\n * @param key - The property of the your tree that indicates which\n *  key contains the \"children\" of your tree structure.\n *\n */\nexport const daffTransformTree = <\n\n  T extends Record<any,any>,\n  V\n>(\n  tree: T,\n  transformFn: (type: T) => DaffTreeData<V>,\n  key: RecursiveTreeKeyOfType<T>,\n): DaffTreeData<V> => {\n\n  const transformedTree: DaffTreeData<V> = transformFn(tree);\n\n  const queue: { node: T; parent: DaffTreeData<V> }[] = [{ node: tree, parent: transformedTree }];\n\n  while (queue.length > 0) {\n    const { node, parent } = queue.shift();\n\n    const childItems = node[key];\n    for (const child of <T[]>childItems) {\n      const transformedChild: DaffTreeData<V> = transformFn(child);\n      parent.items.push(transformedChild);\n      queue.push({ node: child, parent: transformedChild });\n    }\n  }\n\n  return transformedTree;\n};\n","import { DaffTreeComponent } from './tree/tree.component';\nimport { DaffTreeItemDirective } from './tree-item/tree-item.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_TREE_COMPONENTS = <const> [\n  DaffTreeComponent,\n  DaffTreeItemDirective,\n];\n"],"mappings":";;;;;;;;AAcO,IAAM,0BAAN,MAAM,wBAAuB;CAA7B,cAAA;EAKG,KAAA,UAAoC,IAAI,gBAAyB,IAAI;EAK7E,KAAA,UAAU,KAAK,QAAQ,aAAY;CAqBrC;CAZE,SAAM;EACJ,KAAK,QAAQ,KAAK,IAAI;CACxB;CAOA,cAAW;EACT,KAAK,QAAQ,SAAQ;CACvB;AACD;AA/BY,0BAAuB,WAAA,CADnC,OAAO,CAAA,CAAE,CACG,GAAA,uBAAuB;ACSpC,MAAa,eAAe,YAAiC,cAAuB,UAA6B;CAC/G,MAAM,OAA2B,CAAA;CACjC,IAAG,CAAC,YACF,OAAO,CAAA;CAGT,IAAI,QAAQ,CACV;EACE,GAAG;EACH,OAAO;EACP,MAAM;EACN,MAAM;EACN,UAAU;CACX,CACF;CAGD,OAAM,OAAO;EACX,MAAM,KAAK,MAAM,IAAG;EACpB,IAAG,CAAC,IACF;EAGF,QAAQ,CACN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