import { Pipe, PipeTransform } from '@angular/core'; import { ICaInput } from '../config/ca-input.config'; import { AbstractControl } from '@angular/forms'; import { InputCommandsType } from '../enums'; @Pipe({ name: 'showPlaceholderText', standalone: true, }) export class ShowPlaceholderTextPipe implements PipeTransform { transform( inputConfig: ICaInput, getSuperControl: AbstractControl | null, isVisibleCommands: boolean, value: string ): boolean { return ( (inputConfig.placeholderText && (getSuperControl?.value || getSuperControl?.value === 0) && !isVisibleCommands && inputConfig?.commands?.type === InputCommandsType.INCREMENT_DECREMENT) || (inputConfig.placeholderText && (getSuperControl?.value || getSuperControl?.value === 0) && inputConfig?.commands?.type !== InputCommandsType.INCREMENT_DECREMENT) ); } }