{"version":3,"file":"alfresco-adf-core-breadcrumbs.mjs","sources":["../../../../lib/core/breadcrumbs/src/directives/breadcrumb-focus.directive.ts","../../../../lib/core/breadcrumbs/src/components/breadcrumb-item/breadcrumb-item.component.ts","../../../../lib/core/breadcrumbs/src/components/breadcrumb/breadcrumb.component.ts","../../../../lib/core/breadcrumbs/src/components/breadcrumb/breadcrumb.component.html","../../../../lib/core/breadcrumbs/src/index.ts","../../../../lib/core/breadcrumbs/src/alfresco-adf-core-breadcrumbs.ts"],"sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Directive, ElementRef, inject } from '@angular/core';\n\n/** @internal */\n@Directive({\n    standalone: true,\n    selector: '[adf-breadcrumb-focus]',\n    host: {\n        class: 'adf-breadcrumb-focus'\n    }\n})\nexport class BreadcrumbFocusDirective {\n    private readonly elementRef = inject(ElementRef);\n\n    focusOnFirstFocusableElement() {\n        this.getFocusableElements(this.elementRef.nativeElement)[0].focus();\n    }\n\n    private getFocusableElements(root: HTMLElement): HTMLElement[] {\n        const allFocusableElements = `button, a, input, select, textarea, [tabindex]:not([tabindex=\"-1\"])`;\n        return Array.from(root.querySelectorAll(allFocusableElements) as NodeListOf<HTMLElement>).filter(\n            (element) => !element.hasAttribute('disabled') && element.tabIndex >= 0\n        );\n    }\n}\n","/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, TemplateRef, ViewChild } from '@angular/core';\n\n@Component({\n    standalone: true,\n    selector: 'adf-breadcrumb-item',\n    template: `\n        <ng-template #breadcrumbItemTemplate>\n            <ng-content />\n        </ng-template>\n    `\n})\nexport class BreadcrumbItemComponent {\n    @ViewChild('breadcrumbItemTemplate', { static: true })\n    templateRef!: TemplateRef<any>;\n}\n","/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n    AfterContentInit,\n    ChangeDetectionStrategy,\n    ChangeDetectorRef,\n    Component,\n    ContentChildren,\n    EventEmitter,\n    Input,\n    OnChanges,\n    Output,\n    QueryList,\n    SimpleChanges,\n    TemplateRef,\n    ViewChildren,\n    inject\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonModule } from '@angular/material/button';\nimport { map, startWith } from 'rxjs/operators';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { BreadcrumbFocusDirective } from '../../directives/breadcrumb-focus.directive';\nimport { BreadcrumbItemComponent } from '../breadcrumb-item/breadcrumb-item.component';\nimport { IconModule } from '@alfresco/adf-core';\n\n@Component({\n    selector: 'adf-breadcrumb',\n    templateUrl: './breadcrumb.component.html',\n    styleUrls: ['./breadcrumb.component.scss'],\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    imports: [CommonModule, IconModule, TranslatePipe, MatButtonModule, BreadcrumbFocusDirective]\n})\nexport class BreadcrumbComponent implements AfterContentInit, OnChanges {\n    private readonly cdr = inject(ChangeDetectorRef);\n\n    private _breadcrumbTemplateRefs: Array<TemplateRef<unknown>> = [];\n\n    @Input()\n    compact = false;\n\n    @Output()\n    compactChange: EventEmitter<boolean> = new EventEmitter();\n\n    @ViewChildren(BreadcrumbFocusDirective)\n    breadcrumbFocusItems!: QueryList<BreadcrumbFocusDirective>;\n\n    @ContentChildren(BreadcrumbItemComponent)\n    breadcrumbItems!: QueryList<BreadcrumbItemComponent>;\n\n    selectedBreadcrumbs: Array<TemplateRef<unknown>> = [];\n\n    ngAfterContentInit() {\n        this.breadcrumbItems.changes\n            .pipe(\n                startWith(this.breadcrumbItems),\n                map((breadcrumbItems: QueryList<BreadcrumbItemComponent>) => this.mapToTemplateRefs(breadcrumbItems))\n            )\n            .subscribe((templateRefs) => {\n                this._breadcrumbTemplateRefs = templateRefs;\n                this.setBreadcrumbs(templateRefs);\n            });\n    }\n\n    ngOnChanges(changes: SimpleChanges): void {\n        if (changes.compact) {\n            this.setBreadcrumbs(this._breadcrumbTemplateRefs);\n        }\n    }\n\n    toggleCompact(compact = false) {\n        this.compact = compact;\n        this.setBreadcrumbs(this._breadcrumbTemplateRefs);\n        this.compactChange.emit(this.compact);\n        if (!compact) {\n            this.breadcrumbFocusItems.get(1)?.focusOnFirstFocusableElement();\n        }\n    }\n\n    private setBreadcrumbs(breadcrumbs: Array<TemplateRef<unknown>>) {\n        this.selectedBreadcrumbs = this.compact && breadcrumbs.length > 2 ? [breadcrumbs[0], breadcrumbs[breadcrumbs.length - 1]] : [...breadcrumbs];\n        this.cdr.detectChanges();\n    }\n\n    private mapToTemplateRefs(breadcrumbItems: QueryList<BreadcrumbItemComponent>) {\n        return breadcrumbItems.toArray().map((breadcrumbItem) => breadcrumbItem.templateRef);\n    }\n}\n","<ng-container>\n  <nav class=\"adf-breadcrumb\" [class.adf-breadcrumb--compact]=\"compact\" [attr.aria-label]=\"'CORE.BREADCRUMBS.TITLE' | translate\" >\n    <ol>\n      <ng-container *ngFor=\"let breadcrumbTemplate of selectedBreadcrumbs; last as last\">\n        <li adf-breadcrumb-focus class=\"adf-breadcrumb__item-wrapper\">\n          <ng-container *ngTemplateOutlet=\"breadcrumbTemplate\" />\n          <div *ngIf=\"!last\" class=\"adf-breadcrumb__chevron\" [class.adf-breadcrumb__chevron-before--compact]=\"compact\" ></div>\n        </li>\n\n        <li *ngIf=\"!last && compact === true\" class=\"adf-breadcrumb__show-all-button-wrapper\">\n          <button\n            mat-icon-button\n            (click)=\"toggleCompact()\"\n            color=\"primary\"\n            [title]=\"'CORE.BREADCRUMBS.SHOWALL' | translate\"\n            [attr.aria-label]=\"'CORE.BREADCRUMBS.SHOWALL' | translate\"\n          >\n            <mat-icon class=\"adf-breadcrumb__show-all-button-icon--rotate\" adf-icon=\"more_vert\" />\n          </button>\n          <div class=\"adf-breadcrumb__chevron\" [class.adf-breadcrumb__chevron-after--compact]=\"compact\" ></div>\n        </li>\n      </ng-container>\n    </ol>\n  </nav>\n</ng-container>\n","/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.component';\nexport { BreadcrumbItemComponent } from './components/breadcrumb-item/breadcrumb-item.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;A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