1 line
56 KiB
Plaintext
1 line
56 KiB
Plaintext
|
{"version":3,"file":"primeng-password.mjs","sources":["../../src/app/components/password/password.ts","../../src/app/components/password/primeng-password.ts"],"sourcesContent":["import { AnimationEvent, animate, style, transition, trigger } from '@angular/animations';\nimport { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n DoCheck,\n ElementRef,\n EventEmitter,\n HostListener,\n Inject,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n PLATFORM_ID,\n Pipe,\n PipeTransform,\n QueryList,\n Renderer2,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n booleanAttribute,\n forwardRef,\n numberAttribute\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys } from 'primeng/api';\nimport { ConnectedOverlayScrollHandler, DomHandler } from 'primeng/dom';\nimport { EyeIcon } from 'primeng/icons/eye';\nimport { EyeSlashIcon } from 'primeng/icons/eyeslash';\nimport { TimesIcon } from 'primeng/icons/times';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { Nullable, VoidListener } from 'primeng/ts-helpers';\nimport { ZIndexUtils } from 'primeng/utils';\nimport { AutoFocusModule } from 'primeng/autofocus';\nimport { Subscription } from 'rxjs';\n\ntype Meter = {\n strength: string;\n width: string;\n};\n/**\n * Password directive.\n * @group Components\n */\n@Directive({\n selector: '[pPassword]',\n host: {\n class: 'p-inputtext p-component p-element',\n '[class.p-filled]': 'filled',\n '[class.p-variant-filled]': 'variant === \"filled\" || config.inputStyle() === \"filled\"'\n }\n})\nexport class PasswordDirective implements OnDestroy, DoCheck {\n /**\n * Text to prompt password entry. Defaults to PrimeNG I18N API configuration.\n * @group Props\n */\n @Input() promptLabel: string = 'Enter a password';\n /**\n * Text for a weak password. Defaults to PrimeNG I18N API configuration.\n * @group Props\n */\n @Input() weakLabel: string = 'Weak';\n /**\n * Text for a medium password. Defaults to PrimeNG I18N API configuration.\n * @group Props\n */\n @Input() mediumLabel: string = 'Medium';\n /**\n * Text for a strong password. Defaults to PrimeNG I18N API configuration.\n * @group Props\n */\n @Input() strongLabel: string = 'Strong';\n /**\n * Whether to show the strength indicator or not.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) feedback: boolean = true;\n /**\n * Sets the visibility of the password field.\n * @group Props\n */\n @Input() set showPassword(show: boolean) {\n this.el.nativeElement.type = show ? 'text' : 'password';\n }\n /**\n * Specifies the input variant of the component.\n * @group Props\n */\n @Input() variant: 'filled' | 'outlined' = 'outlined';\n\n panel: Nullable<HTMLDivElement>;\n\n meter: Nullable<Meter>;\n\n info: Nullable<HTMLDivElement>;\n\n filled: Nullable<boolean>;\n\n scrollHandler: Nullable<ConnectedOverlayScrollHandler>;\n\n documentResizeListener: VoidListener;\n\n constructor(@Inject(DOCUMENT) private document: Document, @Inject(PLATFORM_ID) private platformId: any, private renderer: Renderer2, public el: ElementRef, public zone: NgZone) {}\n\n ngDoCheck() {\n this.updateFilledState();\n }\n\n @HostListener('input', ['$event'])\n onInput(e: Event) {\n this.updateFilledState();\n }\n\n updateFilledState() {\n this.filled = this.el.nativeElement.value && this.el.nativeElement.value.length;\n }\n\n createPanel() {\n if (isPlatformBrowser(this.platformId)) {\n this.panel = this.renderer.createElement('div');\n this.renderer.addClass(this.panel, 'p-password-pane
|