feat: implement password toggle functionality in input component
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
'input-control-percent': type() === 'percent',
|
||||
'input-control-file': type() === 'file',
|
||||
'input-control-editable': type() === 'editable',
|
||||
'input-control-password-toggle': type() === 'password-toggle',
|
||||
'input-control-disabled': isInputDisabled(),
|
||||
'input-control-editable-active': isEditableActive()
|
||||
}"
|
||||
@@ -38,6 +39,22 @@
|
||||
</span>
|
||||
}
|
||||
|
||||
@if (type() === 'password-toggle') {
|
||||
<button
|
||||
type="button"
|
||||
class="input-icon"
|
||||
[disabled]="disabled()"
|
||||
[attr.aria-label]="isPasswordVisible() ? 'Ocultar contrasena' : 'Mostrar contrasena'"
|
||||
(click)="togglePasswordVisibility()"
|
||||
>
|
||||
<i
|
||||
class="fa-solid"
|
||||
[ngClass]="isPasswordVisible() ? 'fa-eye' : 'fa-eye-slash'"
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
</button>
|
||||
}
|
||||
|
||||
@if (type() === 'file') {
|
||||
<span class="input-file-name" [class.input-file-name-empty]="!resolvedFileName()">
|
||||
{{ resolvedFileName() || 'Sin archivo...' }}
|
||||
|
||||
Reference in New Issue
Block a user