UNPKG

juvo-rafa-library

Version:

A comprehensive Angular component library featuring real-world components and validators extracted from the Juvo Rafa backoffice application. Now with improved select components and bug fixes.

110 lines (109 loc) 3.79 kB
import { EventEmitter } from '@angular/core'; import * as i0 from "@angular/core"; /** * Notification types * @type NotificationType * @since 2.1.0 */ export type NotificationType = 'success' | 'error' | 'warning' | 'info'; /** * Notification position options * @type NotificationPosition * @since 2.1.0 */ export type NotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center'; /** * Notification interface * @interface Notification * @since 2.1.0 */ export interface Notification { id?: string; type: NotificationType; title: string; message?: string; duration?: number; persistent?: boolean; } /** * Notification Component * * @description * A flexible notification system for displaying messages to users. * Supports different types (success, error, warning, info) and positions. * Originally designed for backoffice applications to provide user feedback. * * @example * ```html * <!-- Basic notification --> * <juvo-notification * type="success" * title="Operation successful" * message="The item was saved successfully." * [duration]="5000" * (onClose)="onNotificationClose()"> * </juvo-notification> * * <!-- Multiple notifications container --> * <juvo-notification * *ngFor="let notification of notifications" * [type]="notification.type" * [title]="notification.title" * [message]="notification.message" * [duration]="notification.duration" * position="top-right" * (onClose)="removeNotification(notification.id)"> * </juvo-notification> * ``` * * @selector juvo-notification * @since 2.1.0 * @author Juvo Rafa Team */ export declare class JuvoNotificationComponent { /** Notification type @default "info" */ type: NotificationType; /** Notification title */ title: string; /** Notification message content */ message?: string; /** Auto-dismiss duration in milliseconds. 0 means no auto-dismiss @default 5000 */ duration: number; /** Whether the notification persists until manually closed @default false */ persistent: boolean; /** Position of the notification @default "top-right" */ position: NotificationPosition; /** Whether to show close button @default true */ closable: boolean; /** Whether the notification is visible @default true */ visible: boolean; /** Emitted when notification is closed */ onClose: EventEmitter<void>; /** Emitted when notification is clicked */ onClick: EventEmitter<void>; private timeoutId?; ngOnInit(): void; ngOnDestroy(): void; /** * Gets the icon for the notification type * @returns Icon string for the notification type */ get icon(): string; /** * Gets CSS classes for the notification * @returns Combined CSS classes */ get notificationClasses(): string; /** * Closes the notification * @emits onClose */ close(): void; /** * Handles notification click * @emits onClick */ handleClick(): void; static ɵfac: i0.ɵɵFactoryDeclaration<JuvoNotificationComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<JuvoNotificationComponent, "juvo-notification", never, { "type": { "alias": "type"; "required": false; }; "title": { "alias": "title"; "required": false; }; "message": { "alias": "message"; "required": false; }; "duration": { "alias": "duration"; "required": false; }; "persistent": { "alias": "persistent"; "required": false; }; "position": { "alias": "position"; "required": false; }; "closable": { "alias": "closable"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; }, { "onClose": "onClose"; "onClick": "onClick"; }, never, never, true, never>; }