{"version":3,"file":"yuuvis-client-framework-breadcrumb.mjs","sources":["../../../../../libs/yuuvis/client-framework/breadcrumb/src/lib/breadcrumb/breadcrumb.component.ts","../../../../../libs/yuuvis/client-framework/breadcrumb/src/lib/breadcrumb/breadcrumb.component.html","../../../../../libs/yuuvis/client-framework/breadcrumb/src/yuuvis-client-framework-breadcrumb.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { TranslatePipe } from '@yuuvis/client-core';\nimport { BreadcrumbItem } from '../models';\n\n/**\n * A generic, accessible breadcrumb navigation component.\n *\n * Renders a flat list of navigation items where the last item always represents\n * the current location (non-clickable) and all preceding items are interactive links.\n * Each link is individually focusable via standard Tab navigation.\n *\n * Key behaviors\n * - Items are rendered left-to-right, separated by a `/` divider\n * - The **last item** is always the current page — displayed as plain text (no link, no click handler)\n * - All **preceding items** are rendered as `<a>` links that emit the `navigate` output on click or Enter\n * - The component performs **no routing** — the parent handles all navigation logic via the emitted `BreadcrumbItem`\n * - Empty `items` array renders nothing (the host element stays in the DOM but is visually empty)\n *\n * Usage\n *\n * The parent builds the `BreadcrumbItem[]` and passes it as input. Typically this\n * array mirrors the object hierarchy the user navigated through (e.g. Case → Phase → Document).\n *\n * ```ts\n * // Parent component\n * breadcrumbItems: BreadcrumbItem[] = [\n *   { id: 'case-42',  name: 'Case #42' },      // ← clickable link\n *   { id: 'phase-3',  name: 'Review' },          // ← clickable link\n *   { id: 'doc-7',    name: 'Contract.pdf' }     // ← current location (non-clickable)\n * ];\n *\n * onBreadcrumbNavigate(item: BreadcrumbItem): void {\n *   // item.id is the domain-specific key — use it to navigate\n *   this.router.navigate(['/objects', item.id]);\n * }\n * ```\n *\n * ```html\n * <yuv-breadcrumb\n *   [items]=\"breadcrumbItems\"\n *   (navigate)=\"onBreadcrumbNavigate($event)\" />\n * ```\n *\n * Renders visually as:\n * ```\n * Case #42  /  Review  /  Contract.pdf\n * [link]       [link]      [current]\n * ```\n */\n@Component({\n  selector: 'yuv-breadcrumb',\n  imports: [TranslatePipe],\n  templateUrl: './breadcrumb.component.html',\n  styleUrl: './breadcrumb.component.scss',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  host: {\n    class: 'yuv-breadcrumb'\n  }\n})\nexport class YuuvisBreadcrumbComponent {\n  // #region Angular stuff (inputs, outputs)\n\n  /**\n   * Ordered list of breadcrumb items to display.\n   *\n   * Each `BreadcrumbItem` has `{ id: string; name: string }` — where `id` is a unique key\n   * (typically an object/route ID) and `name` is the display label rendered in the trail.\n   *\n   * Position determines rendering behavior:\n   * - All items except the last → clickable `<a>` links\n   * - Last item → non-clickable text (current location)\n   *\n   * Defaults to an empty array, which renders nothing.\n   *\n   * @example\n   * ```ts\n   * // Case → Document trail\n   * [items]=\"[\n   *   { id: 'case-42', name: 'Case #42' },\n   *   { id: 'doc-7',   name: 'Invoice.pdf' }\n   * ]\"\n   * ```\n   */\n  items = input<BreadcrumbItem[]>([]);\n\n  /**\n   * Emitted when the user activates a clickable breadcrumb item (click or Enter key).\n   *\n   * The emitted value is the full `BreadcrumbItem` object (`{ id, name }`) that was activated.\n   * Never emitted for the last item since it is non-clickable.\n   * The parent is responsible for performing the actual navigation using `item.id`.\n   *\n   * @example\n   * ```ts\n   * onBreadcrumbNavigate(item: BreadcrumbItem): void {\n   *   // item = { id: 'case-42', name: 'Case #42' }\n   *   this.router.navigate(['/objects', item.id]);\n   * }\n   * ```\n   */\n  navigate = output<BreadcrumbItem>();\n\n  // #endregion\n\n  // #region UI Responses\n\n  /**\n   * Handles click on a breadcrumb link and forwards the item to the parent via `navigate` output.\n   * Called only for non-last items (the template guards against calling this for the current location).\n   */\n  protected onItemClick(item: BreadcrumbItem): void {\n    this.navigate.emit(item);\n  }\n\n  // #endregion\n}\n","<nav [attr.aria-label]=\"'yuv.framework.breadcrumb.nav-label' | translate\">\n  <ol class=\"yuv-breadcrumb__list\">\n    @for (item of items(); track item.id) {\n      @if ($last) {\n        <li class=\"yuv-breadcrumb__item yuv-breadcrumb__item--current\" aria-current=\"page\">\n          {{ item.name }}\n        </li>\n      } @else {\n        <li class=\"yuv-breadcrumb__item\">\n          <a\n            class=\"yuv-breadcrumb__link\"\n            role=\"link\"\n            tabindex=\"0\"\n            (click)=\"onItemClick(item)\"\n            (keydown.enter)=\"onItemClick(item)\"\n          >\n            {{ item.name }}\n          </a>\n          <span class=\"yuv-breadcrumb__separator\" aria-hidden=\"true\">/</span>\n        </li>\n      }\n    }\n  </ol>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;MAWU,yBAAyB,CAAA;AAVtC,IAAA,WAAA,GAAA;;AAaE;;;;;;;;;;;;;;;;;;;;AAoBG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAmB,EAAE,4EAAC;AAEnC;;;;;;;;;;;;;;AAcG;QACH,IAAA,CAAA,QAAQ,GAAG,MAAM,EAAkB;AAepC,IAAA;;;AATC;;;AAGG;AACO,IAAA,WAAW,CAAC,IAAoB,EAAA;AACxC,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B;+GArDW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAzB,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,QAAA,EA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