UNPKG

primeng

Version:

PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB

373 lines (372 loc) 14.4 kB
import { AnimationEvent } from '@angular/animations'; import { AfterContentInit, DoCheck, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit, PipeTransform, QueryList, TemplateRef } from '@angular/core'; import { OverlayService, PrimeTemplate } from 'primeng/api'; import { BaseComponent } from 'primeng/basecomponent'; import { ConnectedOverlayScrollHandler } from 'primeng/dom'; import { Nullable, VoidListener } from 'primeng/ts-helpers'; import { Subscription } from 'rxjs'; import { PasswordStyle } from './style/passwordstyle'; import * as i0 from "@angular/core"; import * as i1 from "primeng/api"; type Meter = { strength: string; width: string; }; /** * Password directive. * @group Components */ export declare class PasswordDirective extends BaseComponent implements OnDestroy, DoCheck { zone: NgZone; /** * 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'; /** * Spans 100% width of the container when enabled. * @group Props */ fluid: boolean; panel: Nullable<HTMLDivElement>; meter: Nullable<HTMLDivElement>; info: Nullable<HTMLDivElement>; filled: Nullable<boolean>; content: Nullable<HTMLDivElement>; label: Nullable<HTMLLabelElement>; scrollHandler: Nullable<ConnectedOverlayScrollHandler>; documentResizeListener: VoidListener; _componentStyle: PasswordStyle; get hasFluid(): boolean; constructor(zone: NgZone); ngDoCheck(): void; onInput(e: Event): void; updateFilledState(): void; createPanel(): void; showOverlay(): void; hideOverlay(): void; onFocus(): void; onBlur(): void; labelSignal: import("@angular/core").WritableSignal<string>; onKeyup(e: Event): void; updateMeter(): void; getWidth(label: string): "" | "33.33%" | "66.66%" | "100%"; strengthClass(label: any): string; 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; }; "fluid": { "alias": "fluid"; "required": false; }; }, {}, never, never, true, never>; static ngAcceptInputType_feedback: unknown; static ngAcceptInputType_fluid: 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", true>; } export declare const Password_VALUE_ACCESSOR: any; /** * Password displays strength indicator for password fields. * @group Components */ export declare class Password extends BaseComponent implements OnInit, AfterContentInit { /** * Defines a string that labels the input for accessibility. * @group Props */ ariaLabel: string | undefined; /** * Whether the component should span the full width of its parent. * @group Props */ fluid: boolean | 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; /** * Defines the size of the component. * @group Props */ size: 'large' | 'small'; /** * 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'; /** * Index of the element in tabbing order. * @group Props */ tabindex?: number; /** * 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>; _contentTemplate: TemplateRef<any> | undefined; _footerTemplate: TemplateRef<any> | undefined; _headerTemplate: TemplateRef<any> | undefined; _clearIconTemplate: TemplateRef<any> | undefined; _hideIconTemplate: TemplateRef<any> | undefined; _showIconTemplate: TemplateRef<any> | undefined; 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>; _componentStyle: PasswordStyle; get hasFluid(): boolean; overlayService: OverlayService; ngOnInit(): void; ngAfterContentInit(): 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; }; get rootClass(): { 'p-password p-component p-inputwrapper': boolean; 'p-inputwrapper-filled': any; 'p-variant-filled': string; 'p-inputwrapper-focus': any; 'p-password-fluid': any; }; 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): "password" | "text"; 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; }; "fluid": { "alias": "fluid"; "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; }; "size": { "alias": "size"; "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; }; "tabindex": { "alias": "tabindex"; "required": false; }; }, { "onFocus": "onFocus"; "onBlur": "onBlur"; "onClear": "onClear"; }, ["contentTemplate", "footerTemplate", "headerTemplate", "clearIconTemplate", "hideIconTemplate", "showIconTemplate", "templates"], never, true, never>; static ngAcceptInputType_fluid: unknown; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_maxLength: unknown; static ngAcceptInputType_feedback: unknown; static ngAcceptInputType_toggleMask: unknown; static ngAcceptInputType_showClear: unknown; static ngAcceptInputType_autofocus: unknown; static ngAcceptInputType_tabindex: unknown; } export declare class PasswordModule { static ɵfac: i0.ɵɵFactoryDeclaration<PasswordModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<PasswordModule, never, [typeof Password, typeof PasswordDirective, typeof i1.SharedModule], [typeof PasswordDirective, typeof Password, typeof i1.SharedModule]>; static ɵinj: i0.ɵɵInjectorDeclaration<PasswordModule>; } export {};