UNPKG

nzrm-ng

Version:

<p align="center"> <img src="docs/angular.gif" alt="Angular" width="100" height="100"/> </p>

519 lines (492 loc) 24.7 kB
import * as i0 from '@angular/core'; import { OnInit, OnDestroy, ElementRef, Renderer2, ApplicationRef, ComponentFactoryResolver, Injector, RendererFactory2, ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core'; import * as i1 from '@angular/common'; import * as rxjs from 'rxjs'; import { Observable } from 'rxjs'; import { AnimationEvent } from '@angular/animations'; import { ControlValueAccessor } from '@angular/forms'; type TooltipSeverity = 'info' | 'success' | 'error' | 'warn' | 'normal'; type TooltipPosition = 'top' | 'right' | 'bottom' | 'left'; declare class TooltipDirective implements OnInit, OnDestroy { private el; private renderer; tooltipText: string; showOnlyIf: boolean; sticky: boolean; severity: TooltipSeverity; position: TooltipPosition; showDelay: number; hideDelay: number; maxWidth: string; private tooltipElement; private isVisible; private showTimeoutId; private hideTimeoutId; constructor(el: ElementRef, renderer: Renderer2); ngOnInit(): void; private initializeTooltip; onMouseEnter(): void; onFocus(): void; onMouseLeave(): void; onBlur(): void; onClick(): void; onScroll(): void; onResize(): void; private clearTimeouts; private showTooltip; private hideTooltip; private updateTooltipPosition; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[nTooltip]", never, { "tooltipText": { "alias": "tooltipText"; "required": false; }; "showOnlyIf": { "alias": "showOnlyIf"; "required": false; }; "sticky": { "alias": "sticky"; "required": false; }; "severity": { "alias": "severity"; "required": false; }; "position": { "alias": "position"; "required": false; }; "showDelay": { "alias": "showDelay"; "required": false; }; "hideDelay": { "alias": "hideDelay"; "required": false; }; "maxWidth": { "alias": "maxWidth"; "required": false; }; }, {}, never, never, true, never>; } declare class TooltipModule { static ɵfac: i0.ɵɵFactoryDeclaration<TooltipModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<TooltipModule, never, [typeof i1.CommonModule, typeof TooltipDirective], [typeof TooltipDirective]>; static ɵinj: i0.ɵɵInjectorDeclaration<TooltipModule>; } interface NotificationMessage { severity: 'success' | 'info' | 'warn' | 'error'; summary: string; detail: string; timeout?: number; } declare class NotificationComponent { message: NotificationMessage | null; visible: boolean; animationState: string; progressWidth: number; showProgressBar: boolean; private timeout; private progressInterval; ngOnInit(): void; show(): void; hide(): void; getIconClass(): string; private startProgressBar; private clearTimers; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<NotificationComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NotificationComponent, "app-notification", never, { "message": { "alias": "message"; "required": false; }; }, {}, never, never, true, never>; } declare class NotificationService { private appRef; private componentFactoryResolver; private injector; private notificationRefs; constructor(appRef: ApplicationRef, componentFactoryResolver: ComponentFactoryResolver, injector: Injector); show(message: NotificationMessage): void; success(summary: string, detail: string, timeout?: number): void; info(summary: string, detail: string, timeout?: number): void; warn(summary: string, detail: string, timeout?: number): void; error(summary: string, detail: string, timeout?: number): void; private removeNotification; clear(): void; static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>; } declare class ThemeService { private renderer; private _isDarkTheme; isDarkTheme$: rxjs.Observable<boolean>; constructor(rendererFactory: RendererFactory2); get isDarkTheme(): boolean; setTheme(isDark: boolean): void; toggleTheme(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>; } declare class ThemeToggleComponent { private themeService; size: 'small' | 'medium' | 'large'; constructor(themeService: ThemeService); get isDarkTheme(): boolean; toggleTheme(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ThemeToggleComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ThemeToggleComponent, "app-theme-toggle", never, { "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>; } declare class ThemeModule { static ɵfac: i0.ɵɵFactoryDeclaration<ThemeModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<ThemeModule, never, [typeof i1.CommonModule, typeof ThemeToggleComponent], [typeof ThemeToggleComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<ThemeModule>; } type DialogSeverity = 'success' | 'info' | 'warn' | 'error'; interface ConfirmationDialogConfig { title: string; message: string; confirmText?: string; cancelText?: string; severity?: DialogSeverity; showCancel?: boolean; } interface ConfirmationDialogResult { confirmed: boolean; } declare class ConfirmationDialogService { private dialogSubject; private resultSubject; private currentDialog; dialog$: Observable<ConfirmationDialogConfig | null>; confirm(config: ConfirmationDialogConfig): Observable<ConfirmationDialogResult>; success(title: string, message: string, options?: Partial<ConfirmationDialogConfig>): Observable<ConfirmationDialogResult>; info(title: string, message: string, options?: Partial<ConfirmationDialogConfig>): Observable<ConfirmationDialogResult>; warn(title: string, message: string, options?: Partial<ConfirmationDialogConfig>): Observable<ConfirmationDialogResult>; error(title: string, message: string, options?: Partial<ConfirmationDialogConfig>): Observable<ConfirmationDialogResult>; close(result: ConfirmationDialogResult): void; static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationDialogService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ConfirmationDialogService>; } declare class ConfirmationDialogComponent implements OnInit, OnDestroy { private dialogService; private cdr; private document; visible: boolean; config: ConfirmationDialogConfig | null; private subscription; private animationInProgress; constructor(dialogService: ConfirmationDialogService, cdr: ChangeDetectorRef, document: Document); ngOnInit(): void; ngOnDestroy(): void; confirm(): void; cancel(): void; onEscapeKey(): void; getIconClass(severity?: DialogSeverity): string; stopPropagation(event: MouseEvent): void; onAnimationStart(event: AnimationEvent): void; onAnimationDone(event: AnimationEvent): void; private disableBodyScroll; private enableBodyScroll; static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationDialogComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmationDialogComponent, "n-confirmation-dialog", never, {}, {}, never, never, true, never>; } declare class ConfirmationDirective { private dialogService; confirmTitle: string; confirmMessage: string; confirmText: string; cancelText: string; confirmSeverity: DialogSeverity; showCancel: boolean; disabled: boolean; confirmed: EventEmitter<void>; cancelled: EventEmitter<void>; dialogOpened: EventEmitter<void>; constructor(dialogService: ConfirmationDialogService); onClick(event: Event): Promise<void>; static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ConfirmationDirective, "[nConfirmation]", never, { "confirmTitle": { "alias": "confirmTitle"; "required": false; }; "confirmMessage": { "alias": "confirmMessage"; "required": false; }; "confirmText": { "alias": "confirmText"; "required": false; }; "cancelText": { "alias": "cancelText"; "required": false; }; "confirmSeverity": { "alias": "confirmSeverity"; "required": false; }; "showCancel": { "alias": "showCancel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "confirmed": "confirmed"; "cancelled": "cancelled"; "dialogOpened": "dialogOpened"; }, never, never, true, never>; } type MessageSeverity = "success" | "info" | "warn" | "error"; interface MessageDialogConfig { title: string; message: string; severity?: MessageSeverity; duration?: number; showCloseButton?: boolean; closeOnEscape?: boolean; closeOnBackdropClick?: boolean; closable?: boolean; } declare class MessageDialogService { private document; private dialogSubject; private closeSubject; dialog$: Observable<MessageDialogConfig | null>; close$: Observable<void>; private activeTimeoutId; constructor(document: Document); show(config: MessageDialogConfig): Observable<void>; success(title: string, message: string, options?: Partial<MessageDialogConfig>): Observable<void>; info(title: string, message: string, options?: Partial<MessageDialogConfig>): Observable<void>; warn(title: string, message: string, options?: Partial<MessageDialogConfig>): Observable<void>; error(title: string, message: string, options?: Partial<MessageDialogConfig>): Observable<void>; close(): void; static ɵfac: i0.ɵɵFactoryDeclaration<MessageDialogService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<MessageDialogService>; } declare class MessageDialogComponent implements OnInit, OnDestroy { private dialogService; private cdr; private document; visible: boolean; config: MessageDialogConfig | null; private subscription; private animationInProgress; constructor(dialogService: MessageDialogService, cdr: ChangeDetectorRef, document: Document); ngOnInit(): void; ngOnDestroy(): void; close(): void; onEscapeKey(): void; onBackdropClick(): void; getIconClass(severity?: MessageSeverity): string; stopPropagation(event: MouseEvent): void; onAnimationStart(event: AnimationEvent): void; onAnimationDone(event: AnimationEvent): void; private disableBodyScroll; private enableBodyScroll; static ɵfac: i0.ɵɵFactoryDeclaration<MessageDialogComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<MessageDialogComponent, "n-message-dialog", never, {}, {}, never, never, true, never>; } type ButtonSeverity = 'primary' | 'secondary' | 'success' | 'info' | 'warn' | 'error'; type ButtonSize = 'sm' | 'md' | 'lg'; declare class ButtonDirective implements OnInit, OnChanges { private el; private renderer; private isBrowser; severity: ButtonSeverity; size: ButtonSize; label: string; outlined: boolean; rounded: boolean; get disabled(): boolean; set disabled(value: boolean); private _disabled; icon: string; iconPos: 'left' | 'right'; set loading(value: boolean); get loading(): boolean; private _loading; ripple: boolean; private loadingSpinner; private initialMinWidth; private originalLabel; onClick(event: MouseEvent): void; constructor(platformId: Object, el: ElementRef, renderer: Renderer2); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; private createRippleEffect; private addRippleStyles; private applyBaseStyles; private getMinWidth; private applySeverityStyles; private applySizeStyles; private applyOutlinedStyles; private applyRoundedStyles; private updateDisabledState; private applyDisabledStyles; private removeDisabledStyles; private applyIconOnlyStyles; private getIconOnlySize; private addButtonContent; private createIconElement; private createLabelElement; private removeLoadingState; private applyLoadingState; static ɵfac: i0.ɵɵFactoryDeclaration<ButtonDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonDirective, "[nButton]", never, { "severity": { "alias": "severity"; "required": false; }; "size": { "alias": "size"; "required": false; }; "label": { "alias": "label"; "required": false; }; "outlined": { "alias": "outlined"; "required": false; }; "rounded": { "alias": "rounded"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconPos": { "alias": "iconPos"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "ripple": { "alias": "ripple"; "required": false; }; }, {}, never, never, true, never>; } declare class ButtonModule { static ɵfac: i0.ɵɵFactoryDeclaration<ButtonModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<ButtonModule, never, [typeof ButtonDirective, typeof i1.CommonModule], [typeof ButtonDirective]>; static ɵinj: i0.ɵɵInjectorDeclaration<ButtonModule>; } type InputSize = 'sm' | 'md' | 'lg'; type KeyFilterType = 'int' | 'num' | 'alpha' | 'alphanum' | 'money' | 'blockSpace' | 'hex' | 'email' | 'custom'; declare class InputTextDirective implements OnInit { private el; private renderer; size: InputSize; placeholder: string; disabled: boolean; readonly: boolean; maxLength?: number; minLength?: number; keyFilter?: KeyFilterType; blockChars?: string; customRegex?: string; icon?: string; iconPos: 'left' | 'right'; floatLabel: boolean; invalid: boolean; helpText?: string; errorText?: string; iconClickable: boolean; valueChange: EventEmitter<string>; focusEvent: EventEmitter<FocusEvent>; blurEvent: EventEmitter<FocusEvent>; keydown: EventEmitter<KeyboardEvent>; keyup: EventEmitter<KeyboardEvent>; iconClick: EventEmitter<void>; private inputElement; private wrapperElement; private labelElement?; private iconElement?; private helpTextElement?; private errorTextElement?; private isFocused; private initialValue; private readonly REGEX; constructor(el: ElementRef, renderer: Renderer2); ngOnInit(): void; private setupElements; private applyStyles; private applyBaseStyles; private addIconStyles; private setLabelFloating; private setupEventListeners; onKeyPress(event: KeyboardEvent): boolean; private validateKeyFilter; focus(): void; blur(): void; clear(): void; setValue(value: string): void; getValue(): string; setInvalid(invalid: boolean, errorText?: string): void; static ɵfac: i0.ɵɵFactoryDeclaration<InputTextDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<InputTextDirective, "[nInputText]", ["nInputText"], { "size": { "alias": "size"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "minLength": { "alias": "minLength"; "required": false; }; "keyFilter": { "alias": "keyFilter"; "required": false; }; "blockChars": { "alias": "blockChars"; "required": false; }; "customRegex": { "alias": "customRegex"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconPos": { "alias": "iconPos"; "required": false; }; "floatLabel": { "alias": "floatLabel"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "helpText": { "alias": "helpText"; "required": false; }; "errorText": { "alias": "errorText"; "required": false; }; "iconClickable": { "alias": "iconClickable"; "required": false; }; }, { "valueChange": "valueChange"; "focusEvent": "focusEvent"; "blurEvent": "blurEvent"; "keydown": "keydown"; "keyup": "keyup"; "iconClick": "iconClick"; }, never, never, true, never>; } declare class InputTextModule { static ɵfac: i0.ɵɵFactoryDeclaration<InputTextModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<InputTextModule, never, [typeof i1.CommonModule, typeof InputTextDirective], [typeof InputTextDirective]>; static ɵinj: i0.ɵɵInjectorDeclaration<InputTextModule>; } declare class DropdownComponent implements OnInit, OnDestroy, OnChanges, ControlValueAccessor { private el; private renderer; private cd; options: any[]; optionLabel: string; optionValue: string; optionDisabled: string; placeholder: string; disabled: boolean; readonly: boolean; size: 'sm' | 'md' | 'lg'; icon?: string; iconPos: 'left' | 'right'; multiSelect: boolean; floatLabel: boolean; invalid: boolean; helpText?: string; errorText?: string; filterable: boolean; filterPlaceholder: string; emptyMessage: string; appendTo: 'body' | 'self'; maxSelectedLabels: number; showClear: boolean; showToggleAll: boolean; autoClose: boolean; animationDuration: number; onChange: EventEmitter<any>; onFocus: EventEmitter<any>; onBlur: EventEmitter<any>; onShow: EventEmitter<any>; onHide: EventEmitter<any>; onFilter: EventEmitter<string>; onClear: EventEmitter<any>; dropdownTrigger: ElementRef; dropdownPanel: ElementRef; filterInput: ElementRef; itemTemplate: TemplateRef<any>; chipTemplate: TemplateRef<any>; selectedItemTemplate: TemplateRef<any>; headerTemplate: TemplateRef<any>; footerTemplate: TemplateRef<any>; emptyTemplate: TemplateRef<any>; isOpen: boolean; selectedItems: any[]; filteredItems: any[]; filterValue: string; focused: boolean; uniqueId: string; hasValue: boolean; isAnimating: boolean; private dropdownManager; private destroy$; private subscription; private onChangeCallback; private onTouched; constructor(el: ElementRef, renderer: Renderer2, cd: ChangeDetectorRef); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; writeValue(value: any): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; toggleDropdown(event: MouseEvent): void; showDropdown(): void; private documentClickListener; hideDropdown(): void; onDocumentClick: (event: MouseEvent) => void; positionPanel(): void; onItemClick(event: MouseEvent, item: any): void; toggleItemSelection(item: any): void; selectSingleItem(item: any): void; removeItem(event: MouseEvent, item: any): void; findSelectedItemIndex(item: any): number; isSelected(item: any): boolean; isItemDisabled(item: any): boolean; getItemLabel(item: any): string; onFilterChange(event: Event): void; clear(event: MouseEvent): void; toggleAll(): void; allSelected(): boolean; emitChangeEvent(): void; onKeyDown(event: KeyboardEvent): void; initStyles(): void; addRippleEffect(event: MouseEvent, element: HTMLElement | null): void; onAnimationStart(event: AnimationEvent): void; onAnimationDone(event: AnimationEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration<DropdownComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<DropdownComponent, "n-dropdown", never, { "options": { "alias": "options"; "required": false; }; "optionLabel": { "alias": "optionLabel"; "required": false; }; "optionValue": { "alias": "optionValue"; "required": false; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "size": { "alias": "size"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconPos": { "alias": "iconPos"; "required": false; }; "multiSelect": { "alias": "multiSelect"; "required": false; }; "floatLabel": { "alias": "floatLabel"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "helpText": { "alias": "helpText"; "required": false; }; "errorText": { "alias": "errorText"; "required": false; }; "filterable": { "alias": "filterable"; "required": false; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "maxSelectedLabels": { "alias": "maxSelectedLabels"; "required": false; }; "showClear": { "alias": "showClear"; "required": false; }; "showToggleAll": { "alias": "showToggleAll"; "required": false; }; "autoClose": { "alias": "autoClose"; "required": false; }; "animationDuration": { "alias": "animationDuration"; "required": false; }; }, { "onChange": "onChange"; "onFocus": "onFocus"; "onBlur": "onBlur"; "onShow": "onShow"; "onHide": "onHide"; "onFilter": "onFilter"; "onClear": "onClear"; }, ["itemTemplate", "chipTemplate", "selectedItemTemplate", "headerTemplate", "footerTemplate", "emptyTemplate"], never, true, never>; } declare class DropdownDirective implements OnInit { private el; private renderer; appendTo: 'body' | 'self'; autoClose: boolean; private isOpen; private dropdownMenu; private clickListener; constructor(el: ElementRef, renderer: Renderer2); ngOnInit(): void; onClick(event: MouseEvent): void; toggle(): void; open(): void; close(): void; private updatePosition; static ɵfac: i0.ɵɵFactoryDeclaration<DropdownDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownDirective, "[nDropdown]", ["nDropdown"], { "appendTo": { "alias": "appendTo"; "required": false; }; "autoClose": { "alias": "autoClose"; "required": false; }; }, {}, never, never, true, never>; } declare class DropdownModule { static ɵfac: i0.ɵɵFactoryDeclaration<DropdownModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<DropdownModule, never, [typeof i1.CommonModule, typeof DropdownComponent, typeof DropdownDirective], [typeof DropdownDirective, typeof DropdownComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<DropdownModule>; } declare class DropdownManagerService { private openDropdownId; private dropdownCloseSubject; dropdownClose$: rxjs.Observable<string>; registerOpenDropdown(id: string): void; closeDropdown(id: string): void; closeAll(): void; static ɵfac: i0.ɵɵFactoryDeclaration<DropdownManagerService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<DropdownManagerService>; } declare class SkeletonDirective implements OnInit { private el; private renderer; width: string; height: string; borderRadius: string; animation: boolean; constructor(el: ElementRef, renderer: Renderer2); ngOnInit(): void; private initializeStyles; static ɵfac: i0.ɵɵFactoryDeclaration<SkeletonDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<SkeletonDirective, "[nSkeleton]", never, { "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "borderRadius": { "alias": "borderRadius"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; }, {}, never, never, true, never>; } declare class SkeletonModule { static ɵfac: i0.ɵɵFactoryDeclaration<SkeletonModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<SkeletonModule, never, [typeof i1.CommonModule, typeof SkeletonDirective], [typeof SkeletonDirective]>; static ɵinj: i0.ɵɵInjectorDeclaration<SkeletonModule>; } declare class StylesModule { static ɵfac: i0.ɵɵFactoryDeclaration<StylesModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<StylesModule, never, [typeof i1.CommonModule], never>; static ɵinj: i0.ɵɵInjectorDeclaration<StylesModule>; } export { ButtonDirective, ButtonModule, ConfirmationDialogComponent, ConfirmationDialogService, ConfirmationDirective, DropdownComponent, DropdownDirective, DropdownManagerService, DropdownModule, InputTextDirective, InputTextModule, MessageDialogComponent, MessageDialogService, NotificationComponent, NotificationService, SkeletonDirective, SkeletonModule, StylesModule, ThemeModule, ThemeService, ThemeToggleComponent, TooltipDirective, TooltipModule }; export type { ConfirmationDialogConfig, ConfirmationDialogResult, DialogSeverity, MessageDialogConfig, MessageSeverity, NotificationMessage, TooltipPosition, TooltipSeverity };