feat: add search input type with icon support and update styles

This commit is contained in:
2026-06-26 09:56:09 -03:00
parent a0c35c76a7
commit 455b7c8506
5 changed files with 27 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ import {
import { NgClass } from '@angular/common';
export type AppInputType =
| 'search'
| 'text'
| 'number'
| 'email'
@@ -26,6 +27,7 @@ export type AppInputType =
const DEFAULT_TYPE: AppInputType = 'text';
const INPUT_TYPES = new Set<AppInputType>([
'search',
'text',
'number',
'email',
@@ -81,7 +83,7 @@ export class InputComponent {
protected readonly inputType = computed(() => {
const type = this.type();
if (type === 'currency' || type === 'percent' || type === 'editable') {
if (type === 'search' || type === 'currency' || type === 'percent' || type === 'editable') {
return 'text';
}
@@ -95,6 +97,7 @@ export class InputComponent {
protected readonly inputClasses = computed(() => ({
'form-control': true,
'is-invalid': this.invalid(),
'input-with-search-icon': this.type() === 'search',
'input-with-prefix': this.type() === 'currency',
'input-with-suffix': this.type() === 'percent',
'input-with-icon': this.type() === 'editable'