mirror of https://github.com/abpframework/abp.git
committed by
GitHub
11 changed files with 81 additions and 4 deletions
@ -0,0 +1,3 @@ |
|||
export const enum eThemeSharedComponents { |
|||
PasswordComponent = 'ThemeShared.Extensions.PasswordComponent', |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
<div class="input-group" validationTarget> |
|||
<input |
|||
[type]="fieldTextType ? 'text' : 'password'" |
|||
class="form-control" |
|||
[id]="inputId" |
|||
[(ngModel)]="value" |
|||
/> |
|||
|
|||
<button class="btn btn-secondary" type="button"> |
|||
<i |
|||
class="fa" |
|||
[ngClass]="{ |
|||
'fa-eye-slash': !fieldTextType, |
|||
'fa-eye': fieldTextType |
|||
}" |
|||
(click)="toggleFieldTextType()" |
|||
></i> |
|||
</button> |
|||
</div> |
|||
@ -0,0 +1,28 @@ |
|||
import { Component, forwardRef, Injector, Input } from '@angular/core'; |
|||
import { AbstractNgModelComponent } from '@abp/ng.core'; |
|||
import { NG_VALUE_ACCESSOR } from '@angular/forms'; |
|||
|
|||
@Component({ |
|||
selector: 'abp-password', |
|||
templateUrl: `password.component.html`, |
|||
providers: [ |
|||
{ |
|||
provide: NG_VALUE_ACCESSOR, |
|||
useExisting: forwardRef(() => PasswordComponent), |
|||
multi: true, |
|||
}, |
|||
], |
|||
}) |
|||
export class PasswordComponent extends AbstractNgModelComponent { |
|||
@Input() inputId!: string; |
|||
@Input() formControlName!: string; |
|||
fieldTextType: boolean; |
|||
|
|||
constructor(injector: Injector) { |
|||
super(injector); |
|||
} |
|||
|
|||
toggleFieldTextType() { |
|||
this.fieldTextType = !this.fieldTextType; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue