@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
83 lines • 2.54 kB
TypeScript
import { Injector, TemplateRef, Type } from '@angular/core';
import { ExtensionFactory } from '../common/extension-hooks';
import { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons';
/**
* A crumb of the breadcrumb.
*/
export type BreadcrumbItem = BreadcrumbItemWithComponent | BreadcrumbItemWithLabel;
interface BreadcrumbItemBase {
/**
* The icon to show on this BreadCrumb item.
* The icon will only be displayed if it is the first crumb. (optional)
*/
icon?: SupportedIconsSuggestions;
/**
* Should it be translated or not.
* @todo verify if needed.
* @deprecated Only needed in upgrade case.
*/
translate?: boolean;
}
export interface BreadcrumbItemWithLabel extends BreadcrumbItemBase {
/**
* The label to show for that crumb.
*/
label: string;
/**
* The angular route path to navigate to on click.
*/
path: string;
template?: never;
component?: never;
}
export interface BreadcrumbItemWithTemplate extends BreadcrumbItemBase {
/**
* Angular template used for Content Projection (optional)
*/
template: TemplateRef<any>;
label?: never;
path?: never;
component?: never;
}
export interface BreadcrumbItemWithComponent extends BreadcrumbItemBase {
/**
* A component to use as a BreadcrumbItem.
* Note: As a BreadcrumbItem is rendered in a <li> it is good practice
* to remove the wrapper node to not run into CSS issues. You
* can do so by defining the selector as a li: `li[customExtension]`
* (see: https://stackoverflow.com/a/56887630/923270 or
* https://stackoverflow.com/a/38716164/923270)
*/
component: Type<any>;
/**
* The injector to use. If not set, the default root injector will be used.
*/
injector?: Injector;
label?: never;
path?: never;
template?: never;
}
/**
* One Page can have multiple Breadcrumb paths components.
* E.g. A device which is in multiple folders.
*/
export interface Breadcrumb {
/**
* The crumbs.
*/
items: BreadcrumbItem[];
/**
* The injector to use. If not set, the default root injector will be used.
*/
injector?: Injector;
/**
* The breadcrumbs with the highest priority will be shown first.
*/
priority?: number;
}
/**
* Factory to implement if used in a hook for Multi Provider extension.
*/
export type BreadcrumbFactory = ExtensionFactory<Breadcrumb>;
export {};
//# sourceMappingURL=breadcrumb.model.d.ts.map