UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

48 lines 1.84 kB
import { Renderer2, ElementRef } from '@angular/core'; import type { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons'; import * as i0 from "@angular/core"; /** * Allows to set a icon. Switches between c8y default icons * and font awesome icons. * ```html * <i [c8yIcon]="'clock'"> * ``` */ export declare class IconDirective { private el; private renderer; /** * Sets the icon to be displayed. This directive handles the correct CSS classes * for Cumulocity IoT's dual-color icon sets. * * There are two main icon sets: * 1. **Cumulocity Icons**: These are specific to the platform. To use them, provide the icon name prefixed with **c8y-**. * 2. **Delight Icons**: This is the default icon set. To use them, provide just the icon name without any prefix. * * ```html * <!-- To display a Cumulocity IoT icon (e.g., cockpit) --> * <i [c8yIcon]="'c8y-cockpit'"></i> * * <!-- To display a default Delight icon (e.g., download) --> * <i [c8yIcon]="'download'"></i> * * <!-- You can also use it without property binding for static icons --> * <i c8yIcon="building"></i> * ``` */ set c8yIcon(icon: SupportedIconsSuggestions | { class: string; }); private c8yMatch; private dltC8yMatch; private currentClasses; constructor(el: ElementRef, renderer: Renderer2); private isC8y; private isDltC8y; private getClasses; private updateIcon; private mapFontAwesomeToDelightIcons; static ɵfac: i0.ɵɵFactoryDeclaration<IconDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<IconDirective, "[c8yIcon]", never, { "c8yIcon": { "alias": "c8yIcon"; "required": false; }; }, {}, never, never, true, never>; } //# sourceMappingURL=icon.directive.d.ts.map