import { Component, Input, } from '@angular/core'; import { FormControl } from '@angular/forms'; import { Mask } from './models/mask'; import { CircleAlert } from 'lucide-angular'; @Component({ selector: 'kit-textarea', templateUrl: './input-text-area.component.html', }) export class TextAreaComponent { @Input() placeholderText: string = ''; @Input() type: string = ''; @Input() label: string = ''; @Input() minlength?: number; @Input() maxlength?: number; @Input() rows?: number = 3; @Input() cols?: number; @Input() autosize: boolean = false; @Input() resize: 'none' | 'both' | 'horizontal' | 'vertical' | 'auto' = 'vertical'; @Input() control: FormControl | any; @Input() mask?: Mask | any; @Input() messageErrorCustom: string = ''; @Input() descriptionTooltip: string = ''; readonly infoCircle = CircleAlert; isControlRequired(): boolean { if(this.control && this.control.validator) { const validator = this.control.validator({} as any); return !!(validator && validator.required); } return false } }