feat: add user input type with icon support in input component

This commit is contained in:
2026-06-26 10:09:06 -03:00
parent d58445e199
commit f1a4f51695
5 changed files with 29 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ import { NgClass } from '@angular/common';
export type AppInputType =
| 'search'
| 'user'
| 'text'
| 'number'
| 'email'
@@ -29,6 +30,7 @@ export type AppInputType =
const DEFAULT_TYPE: AppInputType = 'text';
const INPUT_TYPES = new Set<AppInputType>([
'search',
'user',
'text',
'number',
'email',
@@ -92,7 +94,13 @@ export class InputComponent {
return this.isPasswordVisible() ? 'text' : 'password';
}
if (type === 'search' || type === 'currency' || type === 'percent' || type === 'editable') {
if (
type === 'search' ||
type === 'user' ||
type === 'currency' ||
type === 'percent' ||
type === 'editable'
) {
return 'text';
}
@@ -107,10 +115,10 @@ export class InputComponent {
'form-control': true,
'is-invalid': this.invalid(),
'input-with-search-icon': this.type() === 'search',
'input-with-action-icon': this.type() === 'user' || this.type() === 'password-toggle',
'input-with-prefix': this.type() === 'currency',
'input-with-suffix': this.type() === 'percent',
'input-with-icon': this.type() === 'editable',
'input-with-action-icon': this.type() === 'password-toggle'
'input-with-icon': this.type() === 'editable'
}));
protected readonly isInputDisabled = computed(() =>