src/ui/breadcrumbs/smart-breadcrumb-navigation.component.ts
A component used for displaying a breadcrumb trail of the current smart route.
OnInit
OnDestroy
IBreadCrumbComponent
AfterViewInit
| changeDetection | ChangeDetectionStrategy.Eager |
| encapsulation | ViewEncapsulation.None |
| selector | smart-breadcrumb-navigation |
| styleUrls | ./smart-breadcrumb-navigation.component.css |
| templateUrl | ./smart-breadcrumb-navigation.component.html |
Properties |
Methods |
Inputs |
Outputs |
Accessors |
constructor(router: Router, viewManager: SmartViewManagerService, smartConfig: SmartConfig, breadcrumbRegistry: SmartBreadcrumbRegistryService, serviceAdapter: SmartServiceAdapter, elementRef: ElementRef, breadcrumbHelper: SmartBreadcrumbHelperService, navHelper: SmartBreadCrumbNavigationHelperService)
|
|||||||||||||||||||||||||||
|
Parameters :
|
| disabled |
Type : boolean
|
Default value : false
|
| routerOutlet |
Type : string
|
| showBackButton |
Type : boolean
|
Default value : false
|
| breadcrumbsRefreshed |
Type : EventEmitter<IBreadCrumb[]>
|
| onReady |
Type : EventEmitter<SmartBreadCrumbNavigationComponent>
|
| getBreadcrumbByFormId | ||||||||
getBreadcrumbByFormId(formId: string)
|
||||||||
|
Given a form ID, returns a breadcrumb component instance
Parameters :
Returns :
SmartBreadcrumbComponent
{SmartBreadcrumbComponent} |
| getBreadcrumbByUrlSegment | ||||||||
getBreadcrumbByUrlSegment(urlSegment: string)
|
||||||||
|
Given a URL segment, returns a breadcrumb component instance
Parameters :
Returns :
SmartBreadcrumbComponent
{SmartBreadcrumbComponent} |
| getCrumbQueryParamsKey | ||||||||
getCrumbQueryParamsKey(crumb: IBreadCrumb)
|
||||||||
|
Returns the query params key for a breadcrumb, used by template for tracking.
Parameters :
Returns :
string
|
| goBack |
goBack()
|
|
Navigate back
Returns :
void
|
| navigate | ||||||
navigate(breadcrumb: IBreadCrumb)
|
||||||
|
Navigates to the view associated with the given breadcrumb. When navigating back via breadcrumb, truncates the navigation stack to that point.
Parameters :
Returns :
void
|
| breadcrumbComponentInstances |
Type : QueryList<SmartBreadcrumbComponent>
|
Decorators :
@ViewChildren(SmartBreadcrumbComponent)
|
| Public elementRef |
Type : ElementRef
|
| homeBreadcrumb |
Type : IBreadCrumb
|
| Public smartConfig |
Type : SmartConfig
|
| breadcrumbs |
getbreadcrumbs()
|
|
The breadcrumbs that are currently displayed
Returns :
IBreadCrumb[]
|
<!--
**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") - *
* www.consultingwerk.com and other contributors as listed *
* below. All Rights Reserved. *
* *
* Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY *
* KIND, either express or implied. *
* *
* Contributors: *
* *
**************************************************************************
--------------------------------------------------------------------------
File : smart-breadcrumb-navigation.component.html
Purpose : Template for Smart Breadcrumb Navigation.
Author(s) : Radu Nicoara
Created : Dec 07, 2017
--------------------------------------------------------------------------
-->
@if (smartConfig.showSingleBreadcrumb !== false || (!routerOutlet && breadcrumbs.length > 0) || breadcrumbs.length > 1) {
<nav
class="d-flex align-items-center smart-breadcrumb-navigation my-1"
[ngClass]="{ disabled: disabled }">
@if (showBackButton) {
<button type="button" class="breadcrumb-back-button me-2" (click)="goBack()" [disabled]="disabled">
<i class="fa-solid fa-chevron-left"></i>
</button>
}
<ol class="breadcrumb m-0 p-0 bg-transparent">
@for (item of breadcrumbs; track trackCrumb(i, item); let i = $index; let last = $last) {
<li class="breadcrumb-item">
<smart-breadcrumb
[model]="item"
[disabled]="disabled || last"
[routerOutlet]="routerOutlet || 'view'"
[queryParamsKey]="getCrumbQueryParamsKey(item)"
[isLast]="last"
(onClick)="navigate(item)">
</smart-breadcrumb>
</li>
}
</ol>
</nav>
}
./smart-breadcrumb-navigation.component.css
/**********************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") - *
* www.consultingwerk.com and other contributors as listed *
* below. All Rights Reserved. *
* *
* Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY *
* KIND, either express or implied. *
* *
* Contributors: *
* *
**********************************************************************/
/*------------------------------------------------------------------------
File : smart-breadcrumb-navigation.component.css
Purpose : Styles for Smart Breadcrumb Navigation.
Author(s) : Radu Nicoara
Created : Dec 07, 2017
----------------------------------------------------------------------*/
/* Kendo-styled breadcrumb navigation using Bootstrap utilities + Kendo variables */
.smart-breadcrumb-navigation {
font-family: var(--kendo-font-family, inherit);
font-size: var(--kendo-font-size, 0.875rem);
line-height: var(--kendo-line-height, 1.5);
}
.smart-breadcrumb-navigation .breadcrumb {
background: transparent;
margin: 0;
padding: 0;
list-style: none;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--kendo-spacing-1, 0.25rem);
}
.smart-breadcrumb-navigation .breadcrumb-item {
display: flex;
align-items: center;
gap: var(--kendo-spacing-1, 0.25rem);
}
.smart-breadcrumb-navigation .smart-breadcrumb-label {
color: var(--kendo-color-primary, #0d6efd);
text-decoration: none;
cursor: pointer;
padding: var(--kendo-spacing-1, 0.25rem) var(--kendo-spacing-2, 0.5rem);
border-radius: var(--kendo-border-radius-md, 0.375rem);
transition: all 0.2s ease;
border: 1px solid transparent;
}
.smart-breadcrumb-navigation .smart-breadcrumb-label:hover {
color: var(--kendo-color-primary-hover, #0c64e4);
text-decoration: none;
}
.smart-breadcrumb-navigation .smart-breadcrumb-label:focus {
outline: 2px solid var(--kendo-color-primary-emphasis, rgba(13, 110, 253, 0.4));
outline-offset: 2px;
}
.smart-breadcrumb-navigation .smart-breadcrumb-label.disabled {
color: var(--kendo-color-subtle, #596169);
cursor: default;
pointer-events: none;
}
.smart-breadcrumb-navigation .smart-breadcrumb-label.is-last {
color: var(--kendo-color-on-app-surface, #212529);
cursor: default;
font-weight: var(--kendo-font-weight-semibold, 600);
}
.smart-breadcrumb-navigation .breadcrumb-separator {
color: var(--kendo-color-subtle, #596169);
font-size: var(--kendo-font-size-sm, 0.75rem);
user-select: none;
}
.smart-breadcrumb-navigation.disabled {
opacity: 0.6;
pointer-events: none;
}
/* Breadcrumb back button styling */
.smart-breadcrumb-navigation .breadcrumb-back-button {
width: 1.8rem;
height: 1.8rem;
border-radius: 50%;
background-color: #f0f0f0;
border: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
margin-right: 0.7rem;
&:disabled {
background-color: #f8f8f8;
cursor: not-allowed;
opacity: 0.6;
i {
color: #999;
}
}
i {
font-size: 0.8rem;
color: #666;
}
}