import { ChangeDetectorRef, ElementRef, OnChanges, OnInit, Renderer2, SimpleChanges } from "@angular/core"; import { Observable } from "rxjs"; import { StarkLoggingService } from "@nationalbankbelgium/stark-core"; import { StarkMessagePaneService } from "../services/message-pane.service.intf"; import { StarkMessage, StarkMessageCollection } from "@nationalbankbelgium/stark-ui/src/common"; import { AbstractStarkUiComponent } from "@nationalbankbelgium/stark-ui/src/internal-common"; import * as i0 from "@angular/core"; /** * Type of messages that can be displayed in the message pane */ export type StarkMessagePaneNavItem = "" | "errors" | "warnings" | "infos"; /** * Type of alignment that can be set */ export type AlignTypes = "left" | "center" | "right"; /** * Component to display messages in a single pane grouped by level: info, errors and warnings. */ export declare class StarkMessagePaneComponent extends AbstractStarkUiComponent implements OnInit, OnChanges { logger: StarkLoggingService; messagePaneService: StarkMessagePaneService; protected cdRef: ChangeDetectorRef; /** * Whether the messages should be cleared on every navigation to another view/page. * * Default: `false`. */ clearOnNavigation?: boolean; /** * Alignment to be used: `"left"`, `"center"` or `"right"`. * * Default: `"right"`. */ set align(value: AlignTypes); get align(): AlignTypes; /** * @ignore */ private _align; /** * Collection of messages currently shown. */ messageCollection: StarkMessageCollection; /** * Messages tab currently selected */ currentNavItem: StarkMessagePaneNavItem; /** * Total number of messages currently shown */ totalMessages: number; /** * Maximum level of the messages currently shown (error, warning or info). */ maxLevel: StarkMessagePaneNavItem; /** * Whether the message pane is currently visible */ isVisible: boolean; /** * Delay of the animation when the messages are shown */ showAnimationDelay: number; /** * Delay of the animation when the messages are hidden */ hideAnimationDelay: number; /** * @ignore */ errorMessages$: Observable; /** * @ignore */ infoMessages$: Observable; /** * @ignore */ warningMessages$: Observable; /** * Class constructor * @param logger - The `StarkLoggingService` instance of the application. * @param messagePaneService - The service to display/hide messages in the pane. * @param renderer - Angular `Renderer2` wrapper for DOM manipulations. * @param elementRef - Reference to the DOM element where this component is attached to. * @param cdRef - Reference to the change detector attached to this component. */ constructor(logger: StarkLoggingService, messagePaneService: StarkMessagePaneService, renderer: Renderer2, elementRef: ElementRef, cdRef: ChangeDetectorRef); /** * Component lifecycle hook */ ngOnInit(): void; /** * Component lifecycle hook * @param changesObj - Contains the changed properties */ ngOnChanges(changesObj: SimpleChanges): void; /** * Count the number of messages by type in the collection * @param messageCollection - The collection to count */ private countMessages; /** * Retrieve the level of the message pane * @param messageCollection - The collection to analyse */ private getMaxLevel; /** * Remove one of the message * @param message - The message to remove */ removeMessage(message: StarkMessage): void; /** * Clear all messages */ clearAllMessages(): void; /** * Display the message pane */ showPane(): void; /** * Hide the message pane */ hidePane(): void; /** * Toggle from one item to another * @param navItem - The item to navigate to */ toggleActive(navItem: StarkMessagePaneNavItem): void; /** * collapse the message pane */ collapseMessages(): void; /** * expand the message pane */ expandMessages(): void; /** * @ignore */ trackItemFn(index: number, _item: StarkMessage): number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }