/** Core */
import { CoreComponent } from "cmf.core/src/core";
/** Nested modules */
import { DropdownItem } from "../dropdownMenu/dropdownMenu";
import { ElementQuery } from "../../directives/elementQuery/elementQuery";
/** Angular */
import * as ng from "@angular/core";
/**
* Defines a breadcrumb item
*/
export interface BreadcrumbItem {
/**
* the item unique identifier
*/
id: string;
/**
* the item title
*/
title: string;
/**
* The icon class to be used in the dropdown menu
*/
iconClass?: string;
}
/**
* Defines a breadcrumb item that was selected
*/
export interface BreadcrumbItemSelectArgs {
/**
* its index
*/
index: number;
/**
* the item itself
*/
item: BreadcrumbItem;
}
/**
* @whatItDoes
*
* This component presents a breadcrumb that is responsive enough to know when items overflow and automatically move them to a dropdown anchored on an '...'.
* Offers clicking on all items but the last. Clicking on an item will output it.
*
* NOTE: the breadcrumb does not delete the items that appear after the clicked item in order to leave that choice for the programmer by change the input items.
*
* @howToUse
*
* This component is used with the inputs and outputs mentioned below.
*
* ### Inputs
* `BreadcrumbItem[]` : **items** - Array of the order breadcrumb items to be presented
* `string` : **itemSeparatorIconClass** - The icon to be rendered as the items separator. If not specified, the default arrow right is used.
*
* ### Outputs
* `BreadcrumbItemSelectArgs` : **itemSelect** - The breadcrumb item that was clicked and its index
*
* ### Example
* To use the component, assume this HTML Template as an example:
*
* ```HTML
*
*
* ```
*
* @description
*
* ## Breadcrumb Component
*
* ### Dependencies
*
* #### Components
* * DropdownMenu : `cmf.core.controls`
*
* #### Services
* _This component does not depend on any service_
*
* #### Directives
* * ElementQuery : `cmf.core.controls`
*
*/
export declare class Breadcrumb extends CoreComponent implements ng.AfterViewInit, ng.OnDestroy, ng.OnChanges {
private _viewContainerRef;
private _ngZone;
/**
* The breadcrumb container resize subscription from the element query.
* Used to store the subscription reference in order to unsubscribe from it when the component is destroyed.
*/
private _breadcrumbContainerSizeChangeEventSubscription;
/**
* Reference to the element query instance.
*/
_elementQuery: ElementQuery;
/**
* The items that will end up in the dropdown menu
*/
_dropdownItems: DropdownItem[];
/**
* The items to be included in the breadcrumb
*/
items: BreadcrumbItem[];
/**
* The breadcrumb item separator. Defualts to the arrow right icon.
*/
itemSeparatorIconClass: string;
/**
* Emits data related to the item clicked on.
*/
itemSelect: ng.EventEmitter;
/**
* Constructor
*
* @param _viewContainerRef the reference to the component view container
* @param _ngZone the angular zone injected
*/
constructor(_viewContainerRef: ng.ViewContainerRef, _ngZone: ng.NgZone);
/**
* Callback used when the container changes or there are new items to be included in the breadcrumb.
* Responsible to check what fits in the container and what should be transfered to a dropdown menu.
*/
private onBreadcrumbContainerSizeChange;
/**
* Handles clicked on a breadcrumb item.
* Emits the item and its index, but not the last item because its already selected.
* @param event The click event
* @param item The item that was clicked on
* @param index The index of the item clicked on
* @param isLast if it is the last item in the breadcrumb
*/
onBreadcrumbItemClick(event: MouseEvent, item: BreadcrumbItem, index: number, isLast: boolean): void;
/**
* Handles selecting an item in the dropdown menu.
* Emits the item selected and its index.
* @param event dropdown item clicked on
*/
onItemSelect(event: DropdownItem): void;
/**
* AfterViewInit angular component lifecycle.
* Subscribes to element query size change event.
*/
ngAfterViewInit(): void;
/**
* OnChanges angular component lifecycle.
* Runs @see onBreadcrumbContainerSizeChange method.
* @param changes changes made to this component's inputs
*/
ngOnChanges(changes: ng.SimpleChanges): void;
/**
* OnDestroy angular component lifecycle.
* Unsubscribes from the container size change event.
*/
ngOnDestroy(): void;
}
export declare class BreadcrumbModule {
}