UNPKG

primeng

Version:

[![npm version](https://badge.fury.io/js/primeng.svg)](https://badge.fury.io/js/primeng) [![npm downloads](https://img.shields.io/npm/dm/primeng.svg)](https://www.npmjs.com/package/primeng) [![Actions CI](https://github.com/primefaces/primeng/workflows/No

343 lines (342 loc) 13.4 kB
import { AnimationEvent } from '@angular/animations'; import { AfterContentInit, ChangeDetectorRef, DoCheck, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit, PipeTransform, QueryList, Renderer2, TemplateRef } from '@angular/core'; import { OverlayService, PrimeNGConfig, PrimeTemplate } from 'primeng/api'; import { ConnectedOverlayScrollHandler } from 'primeng/dom'; import { Nullable, VoidListener } from 'primeng/ts-helpers'; import { Subscription } from 'rxjs'; import * as i0 from "@angular/core"; import * as i1 from "@angular/common"; import * as i2 from "primeng/inputtext"; import * as i3 from "primeng/autofocus"; import * as i4 from "primeng/icons/times"; import * as i5 from "primeng/icons/eyeslash"; import * as i6 from "primeng/icons/eye"; import * as i7 from "primeng/api"; type Meter = { strength: string; width: string; }; /** * Password directive. * @group Components */ export declare class PasswordDirective implements OnDestroy, DoCheck { private document; private platformId; private renderer; el: ElementRef; zone: NgZone; config: PrimeNGConfig; /** * Text to prompt password entry. Defaults to PrimeNG I18N API configuration. * @group Props */ promptLabel: string; /** * Text for a weak password. Defaults to PrimeNG I18N API configuration. * @group Props */ weakLabel: string; /** * Text for a medium password. Defaults to PrimeNG I18N API configuration. * @group Props */ mediumLabel: string; /** * Text for a strong password. Defaults to PrimeNG I18N API configuration. * @group Props */ strongLabel: string; /** * Whether to show the strength indicator or not. * @group Props */ feedback: boolean; /** * Sets the visibility of the password field. * @group Props */ set showPassword(show: boolean); /** * Specifies the input variant of the component. * @group Props */ variant: 'filled' | 'outlined'; panel: Nullable<HTMLDivElement>; meter: Nullable<Meter>; info: Nullable<HTMLDivElement>; filled: Nullable<boolean>; scrollHandler: Nullable<ConnectedOverlayScrollHandler>; documentResizeListener: VoidListener; constructor(document: Document, platformId: any, renderer: Renderer2, el: ElementRef, zone: NgZone, config: PrimeNGConfig); ngDoCheck(): void; onInput(e: Event): void; updateFilledState(): void; createPanel(): void; showOverlay(): void; hideOverlay(): void; onFocus(): void; onBlur(): void; onKeyup(e: Event): void; testStrength(str: string): number; normalize(x: number, y: number): number; get disabled(): boolean; bindScrollListener(): void; unbindScrollListener(): void; bindDocumentResizeListener(): void; unbindDocumentResizeListener(): void; onWindowResize(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<PasswordDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<PasswordDirective, "[pPassword]", never, { "promptLabel": { "alias": "promptLabel"; "required": false; }; "weakLabel": { "alias": "weakLabel"; "required": false; }; "mediumLabel": { "alias": "mediumLabel"; "required": false; }; "strongLabel": { "alias": "strongLabel"; "required": false; }; "feedback": { "alias": "feedback"; "required": false; }; "showPassword": { "alias": "showPassword"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, {}, never, never, false, never>; static ngAcceptInputType_feedback: unknown; } type Mapper<T, G> = (item: T, ...args: any[]) => G; export declare class MapperPipe implements PipeTransform { transform<T, G>(value: T, mapper: Mapper<T, G>, ...args: unknown[]): G; static ɵfac: i0.ɵɵFactoryDeclaration<MapperPipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<MapperPipe, "mapper", false>; } export declare const Password_VALUE_ACCESSOR: any; /** * Password displays strength indicator for password fields. * @group Components */ export declare class Password implements AfterContentInit, OnInit { private document; private platformId; private renderer; private cd; private config; el: ElementRef; overlayService: OverlayService; /** * Defines a string that labels the input for accessibility. * @group Props */ ariaLabel: string | undefined; /** * Specifies one or more IDs in the DOM that labels the input field. * @group Props */ ariaLabelledBy: string | undefined; /** * Label of the input for accessibility. * @group Props */ label: string | undefined; /** * Indicates whether the component is disabled or not. * @group Props */ disabled: boolean | undefined; /** * Text to prompt password entry. Defaults to PrimeNG I18N API configuration. * @group Props */ promptLabel: string | undefined; /** * Regex value for medium regex. * @group Props */ mediumRegex: string; /** * Regex value for strong regex. * @group Props */ strongRegex: string; /** * Text for a weak password. Defaults to PrimeNG I18N API configuration. * @group Props */ weakLabel: string | undefined; /** * Text for a medium password. Defaults to PrimeNG I18N API configuration. * @group Props */ mediumLabel: string | undefined; /** * specifies the maximum number of characters allowed in the input element. * @group Props */ maxLength: number | undefined; /** * Text for a strong password. Defaults to PrimeNG I18N API configuration. * @group Props */ strongLabel: string | undefined; /** * Identifier of the accessible input element. * @group Props */ inputId: string | undefined; /** * Whether to show the strength indicator or not. * @group Props */ feedback: boolean; /** * Id of the element or "body" for document where the overlay should be appended to. * @group Props */ appendTo: HTMLElement | ElementRef | TemplateRef<any> | string | null | undefined | any; /** * Whether to show an icon to display the password as plain text. * @group Props */ toggleMask: boolean | undefined; /** * Style class of the input field. * @group Props */ inputStyleClass: string | undefined; /** * Style class of the element. * @group Props */ styleClass: string | undefined; /** * Inline style of the component. * @group Props */ style: { [klass: string]: any; } | null | undefined; /** * Inline style of the input field. * @group Props */ inputStyle: { [klass: string]: any; } | null | undefined; /** * Transition options of the show animation. * @group Props */ showTransitionOptions: string; /** * Transition options of the hide animation. * @group Props */ hideTransitionOptions: string; /** * Specify automated assistance in filling out password by browser. * @group Props */ autocomplete: string | undefined; /** * Advisory information to display on input. * @group Props */ placeholder: string | undefined; /** * When enabled, a clear icon is displayed to clear the value. * @group Props */ showClear: boolean; /** * When present, it specifies that the component should automatically get focus on load. * @group Props */ autofocus: boolean | undefined; /** * Specifies the input variant of the component. * @group Props */ variant: 'filled' | 'outlined'; /** * Callback to invoke when the component receives focus. * @param {Event} event - Browser event. * @group Emits */ onFocus: EventEmitter<Event>; /** * Callback to invoke when the component loses focus. * @param {Event} event - Browser event. * @group Emits */ onBlur: EventEmitter<Event>; /** * Callback to invoke when clear button is clicked. * @group Emits */ onClear: EventEmitter<any>; input: ElementRef; contentTemplate: Nullable<TemplateRef<any>>; footerTemplate: Nullable<TemplateRef<any>>; headerTemplate: Nullable<TemplateRef<any>>; clearIconTemplate: Nullable<TemplateRef<any>>; hideIconTemplate: Nullable<TemplateRef<any>>; showIconTemplate: Nullable<TemplateRef<any>>; templates: QueryList<PrimeTemplate>; overlayVisible: boolean; meter: Nullable<Meter>; infoText: Nullable<string>; focused: boolean; unmasked: boolean; mediumCheckRegExp: RegExp; strongCheckRegExp: RegExp; resizeListener: VoidListener; scrollHandler: Nullable<ConnectedOverlayScrollHandler>; overlay: HTMLElement | ElementRef | null | undefined; value: Nullable<string>; onModelChange: Function; onModelTouched: Function; translationSubscription: Nullable<Subscription>; constructor(document: Document, platformId: any, renderer: Renderer2, cd: ChangeDetectorRef, config: PrimeNGConfig, el: ElementRef, overlayService: OverlayService); ngAfterContentInit(): void; ngOnInit(): void; onAnimationStart(event: AnimationEvent): void; onAnimationEnd(event: AnimationEvent): void; appendContainer(): void; alignOverlay(): void; onInput(event: Event): void; onInputFocus(event: Event): void; onInputBlur(event: Event): void; onKeyUp(event: KeyboardEvent): void; updateUI(value: string): void; onMaskToggle(): void; onOverlayClick(event: Event): void; testStrength(str: string): number; writeValue(value: any): void; registerOnChange(fn: Function): void; registerOnTouched(fn: Function): void; setDisabledState(val: boolean): void; bindScrollListener(): void; bindResizeListener(): void; unbindScrollListener(): void; unbindResizeListener(): void; containerClass(toggleMask: boolean): { 'p-password p-component p-inputwrapper': boolean; 'p-input-icon-right': boolean; }; inputFieldClass(disabled: boolean): { 'p-password-input': boolean; 'p-disabled': boolean; }; strengthClass(meter: any): string; filled(): boolean; promptText(): any; weakText(): any; mediumText(): any; strongText(): any; restoreAppend(): void; inputType(unmasked: boolean): "text" | "password"; getTranslation(option: string): any; clear(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<Password, never>; static ɵcmp: i0.ɵɵComponentDeclaration<Password, "p-password", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "promptLabel": { "alias": "promptLabel"; "required": false; }; "mediumRegex": { "alias": "mediumRegex"; "required": false; }; "strongRegex": { "alias": "strongRegex"; "required": false; }; "weakLabel": { "alias": "weakLabel"; "required": false; }; "mediumLabel": { "alias": "mediumLabel"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "strongLabel": { "alias": "strongLabel"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "feedback": { "alias": "feedback"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "toggleMask": { "alias": "toggleMask"; "required": false; }; "inputStyleClass": { "alias": "inputStyleClass"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "style": { "alias": "style"; "required": false; }; "inputStyle": { "alias": "inputStyle"; "required": false; }; "showTransitionOptions": { "alias": "showTransitionOptions"; "required": false; }; "hideTransitionOptions": { "alias": "hideTransitionOptions"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "showClear": { "alias": "showClear"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, { "onFocus": "onFocus"; "onBlur": "onBlur"; "onClear": "onClear"; }, ["templates"], never, false, never>; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_maxLength: unknown; static ngAcceptInputType_feedback: unknown; static ngAcceptInputType_toggleMask: unknown; static ngAcceptInputType_showClear: unknown; static ngAcceptInputType_autofocus: unknown; } export declare class PasswordModule { static ɵfac: i0.ɵɵFactoryDeclaration<PasswordModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<PasswordModule, [typeof PasswordDirective, typeof Password, typeof MapperPipe], [typeof i1.CommonModule, typeof i2.InputTextModule, typeof i3.AutoFocusModule, typeof i4.TimesIcon, typeof i5.EyeSlashIcon, typeof i6.EyeIcon], [typeof PasswordDirective, typeof Password, typeof i7.SharedModule]>; static ɵinj: i0.ɵɵInjectorDeclaration<PasswordModule>; } export {};