import { EventEmitter, OnInit, OnChanges, SimpleChanges, ChangeDetectorRef } from '@angular/core'; import { FormArray, FormBuilder, FormGroup } from '@angular/forms'; import { DynamicSelectFieldConfig, SelectOption } from '../../dynamic-select/dynamic-select-field.component'; import { ActionTemplate } from '../step-builder-action/step-builder-action.component'; import * as i0 from "@angular/core"; interface Element { id?: number; name: string; locatorValue?: string; otherLocator?: string[]; [key: string]: any; } export interface ConditionRow { field: string; operator: string; value: ActionTemplate; templateVariables?: any[]; advancedSettingsVariables?: any[]; description?: string; metadata?: string; } export interface ConditionFormData { conditions: ConditionRow[]; includeElse: boolean; } export declare class StepBuilderConditionComponent implements OnInit, OnChanges { private fb; private cdr; /** Options for operator dropdown */ operatorOptions: SelectOption[]; /** List of action templates to display in value dropdown */ conditionTemplates: ActionTemplate[]; /** Function to handle variable processing or custom logic. Can be passed from parent component. */ setConditionTemplateVariables: (variables: ActionTemplate) => any; /** Function to handle advanced settings variables. Can be passed from parent component. */ setAdvancedSettingsVariables: (template: ActionTemplate, testStep?: any) => any[]; /** Centralised HTML grammar computation function. Pass StepBuilderService.computeHtmlGrammar from the host app. */ computeHtmlGrammarFn?: (template: any, variables: any[]) => string; elementOptions: Element[]; hasMoreElements: boolean; isLoadingElements: boolean; /** Screen name options for element form autocomplete (from API) */ screenNameOptions: { id?: number; name: string; }[]; /** Whether more screen names are available for infinite scroll */ hasMoreScreenNames: boolean; /** True while parent is loading screen names (search or load more) */ isLoadingScreenNames: boolean; /** Parameter fetching properties */ parameterOptions: any[]; hasMoreParameters: boolean; isLoadingParameters: boolean; /** Environment fetching properties */ environmentOptions: { id: string; name: string; value: string; environment: string; }[]; hasMoreEnvironments: boolean; isLoadingEnvironments: boolean; /** Default test data profile properties */ defaultTestDataProfileId?: number; defaultTestDataStartIndex?: number; defaultTestDataEndIndex?: number; isInsideForLoopStep: boolean; hasTestDataProfile: boolean; /** True while parent is creating the step (API in progress); show loader on Create Step button */ isCreatingStep: boolean; /** Emit when step is created */ createStep: EventEmitter; /** Emit when cancelled */ cancelled: EventEmitter; loadMoreElements: EventEmitter; searchElements: EventEmitter; searchElementsByScreenName: EventEmitter<{ screenNameId: number; searchTerm?: string; }>; createElement: EventEmitter; searchScreenName: EventEmitter; loadMoreScreenNames: EventEmitter; createScreenNameRequest: EventEmitter; searchParameters: EventEmitter; loadMoreParameters: EventEmitter; searchEnvironments: EventEmitter; loadMoreEnvironments: EventEmitter; redirectToParameter: EventEmitter; redirectToEnvironment: EventEmitter; conditionForm: FormGroup; includeElse: boolean; private valueConfigCache; private operatorConfigCache; private valueConfigsWithHandlers; private selectedTemplates; private conditionTemplateVariables; private conditionVariablesForms; private conditionUpdatedHtmlGrammar; private conditionAdvancedSettingsVariables; private conditionAdvancedVariablesForms; private conditionAdvancedExpanded; private conditionFormGroupCache; constructor(fb: FormBuilder, cdr: ChangeDetectorRef); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; private updateOperatorConfigCache; get conditionsFormArray(): FormArray; addCondition(conditionType: string): void; removeCondition(index: number): void; private reindexConditionData; getOperatorConfig(index: number): DynamicSelectFieldConfig; private updateValueConfigCache; getValueConfig(index: number): DynamicSelectFieldConfig; onTemplateValueChange(index: number, templateId: any): void; private buildConditionVariablesForm; getConditionTemplateVariables(index: number): any[]; getConditionVariablesForm(index: number): FormArray; getConditionFormGroupAt(index: number, variableIndex: number): FormGroup; getConditionUpdatedHtmlGrammar(index: number): string; getSelectedTemplate(index: number): ActionTemplate | null; getSelectConfigForVariable(index: number, variable: any): DynamicSelectFieldConfig; onConditionVariableValueChange(conditionIndex: number, variableName: string, value: any): void; onConditionVariableInputChange(conditionIndex: number, variableName: string, value: any): void; onConditionVariableBooleanChange(conditionIndex: number, variableName: string, value: boolean): void; /** * Strip HTML tags from a string for search functionality */ private stripHtmlTags; /** * Update HTML grammar for a specific condition with actual variable values. * Delegates to computeHtmlGrammarFn when provided by the host app (centralised logic in StepBuilderService). */ private updateConditionHtmlGrammar; private buildConditionAdvancedVariablesForm; getConditionAdvancedSettingsVariables(index: number): any[]; getConditionAdvancedVariablesForm(index: number): FormArray; getConditionAdvancedExpanded(index: number): boolean; toggleConditionAdvanced(index: number): void; onConditionAdvancedVariableBooleanChange(conditionIndex: number, variableName: string, value: boolean): void; onConditionAdvancedVariableValueChange(conditionIndex: number, variableName: string, value: any): void; getConditionFormGroup(index: number): FormGroup; getConditionFieldValue(index: number): string; isConditionIf(index: number): boolean; isConditionElseIf(index: number): boolean; getConditionLabel(index: number): string; trackByConditionIndex(index: number): number; onIncludeElseChange(checked: boolean): void; onCancel(): void; /** * Overall form validity for condition step. * In addition to Angular form validity, we must ensure that for any template variable * with dataKey 'test_data' | 'source_value' | 'target_value' and dataType 'plain-text' * or 'runtime', the value is non-empty. */ isFormValid(): boolean; onCreateStep(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};