gentics-ui-core
Version:
This is the common core framework for the Gentics CMS and Mesh UI, and other Angular applications.
94 lines (93 loc) • 3.28 kB
TypeScript
import { ElementRef, EventEmitter, OnChanges, OnDestroy, QueryList, SimpleChanges, ChangeDetectorRef, AfterViewInit } from '@angular/core';
import { RouterLinkWithHref } from '@angular/router';
import { UserAgentRef } from '../modal/user-agent-ref';
import * as i0 from "@angular/core";
export interface IBreadcrumbLink {
href?: string;
route?: any;
text: string;
tooltip?: string;
[key: string]: any;
}
export interface IBreadcrumbRouterLink {
route: any[];
text: string;
tooltip?: string;
[key: string]: any;
}
/**
* A Breadcrumbs navigation component.
*
* ```html
* <gtx-breadcrumbs></gtx-breadcrumbs>
* ```
*/
export declare class Breadcrumbs implements OnChanges, OnDestroy, AfterViewInit {
private changeDetector;
private elementRef;
private userAgent;
/**
* A list of links to display
*/
links: IBreadcrumbLink[];
/**
* A list of RouterLinks to display
*/
routerLinks: IBreadcrumbRouterLink[];
/**
* A color that is used for collapsed state background.
*/
collapsedColor: string;
/**
* If true the first folder and all the folder names from the end of the breadcrumbs, which fit into one line are shown
* and an ellipsis in between.
*/
get multiline(): boolean;
set multiline(val: boolean);
/**
* If true the breadcrumbs are always expanded
*/
get multilineExpanded(): boolean;
set multilineExpanded(val: boolean);
/**
* Controls whether the navigation is disabled.
*/
get disabled(): boolean;
set disabled(val: boolean);
/**
* Fires when a link is clicked
*/
linkClick: EventEmitter<IBreadcrumbLink | IBreadcrumbRouterLink>;
/**
* Fires when the expand button is clicked
*/
multilineExpandedChange: EventEmitter<boolean>;
isMultiline: boolean;
isMultilineExpanded: boolean;
isDisabled: boolean;
isOverflowing: boolean;
showArrow: boolean;
backLink: IBreadcrumbLink | IBreadcrumbRouterLink;
routerLinkChildren: QueryList<RouterLinkWithHref>;
navWrapper: ElementRef;
lastPart: ElementRef;
private subscriptions;
private resizeEvents;
constructor(changeDetector: ChangeDetectorRef, elementRef: ElementRef, userAgent: UserAgentRef);
ngAfterViewInit(): void;
ngOnChanges(changes: SimpleChanges): void;
ngOnDestroy(): void;
onLinkClicked(link: IBreadcrumbLink | IBreadcrumbRouterLink, event: Event): void;
toggleMultilineExpanded(): void;
private setUpResizeSub;
private shortenTexts;
private getCuttableBreadcrumbsTexts;
onResize(event: any): void;
private preventClicksWhenDisabled;
/**
* Workaround/Hack for the native angular "RouterLink" having no way to disable navigation on click.
*/
private preventDisabledRouterLinks;
static ɵfac: i0.ɵɵFactoryDeclaration<Breadcrumbs, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<Breadcrumbs, "gtx-breadcrumbs", never, { "links": "links"; "routerLinks": "routerLinks"; "collapsedColor": "collapsedColor"; "multiline": "multiline"; "multilineExpanded": "multilineExpanded"; "disabled": "disabled"; }, { "linkClick": "linkClick"; "multilineExpandedChange": "multilineExpandedChange"; }, never, ["*"]>;
}