import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core'; import { FormBuilder, FormGroup, FormArray } from '@angular/forms'; import { DynamicSelectFieldConfig, SelectOption } from '../../dynamic-select/dynamic-select-field.component'; import * as i0 from "@angular/core"; export declare type TemplateSourceType = 'existing' | 'upload' | 'createNew'; export interface DocumentMappingValueEntry { valueType: string; value: string; } export interface DocumentMappingRow { key: string; values: DocumentMappingValueEntry[]; enabled?: boolean; } export interface DocumentFormData { documentType: string; outputVariable: string; fileName?: string; seprator?: string; delimeter?: string; fileFormatHeader?: string; /** Description for the document generation step */ description?: string; templateSource: TemplateSourceType; templateId?: string; /** Uploaded template file when templateSource is 'upload' */ uploadedFile?: File; /** Template name when templateSource is 'createNew' */ templateName?: string; /** Template description when templateSource is 'createNew' */ templateDescription?: string; mappings: DocumentMappingRow[]; advancedSettingsVariables?: any[]; } export declare class StepBuilderDocumentComponent implements OnInit, OnChanges { private fb; /** Options for document type dropdown */ documentTypeOptions: SelectOption[]; /** Options for template dropdown (when "Use Existing Template" is selected) */ templateOptions: SelectOption[]; /** Options for value type dropdown in document mapper */ valueTypeOptions: SelectOption[]; /** Options for delimeter type dropdown (shown when documentType is 'csv') */ delimeterTypeOptions: SelectOption[]; /** Function to handle advanced settings variables. Can be passed from parent component. */ setAdvancedSettingsVariables: (template?: any, testStep?: any) => any[]; /** Template for advanced settings (optional) */ template?: any; /** Test step for advanced settings (optional) */ testStep?: any; /** Optional URL for "Need help?" link in Document Mapper section */ mapperHelpUrl: string; /** Tooltip text when hovering over "Need help?" (same as custom-edit-step) */ mapperHelpTooltipText: string; /** Initial document type for edit mode */ initialDocumentType?: string; /** Initial output variable for edit mode */ initialOutputVariable?: string; /** Initial template source for edit mode */ initialTemplateSource?: TemplateSourceType; /** Initial template ID for edit mode */ initialTemplateId?: string; /** Initial template name for edit mode (when templateSource is 'createNew') */ initialTemplateName?: string; /** Initial template description for edit mode (when templateSource is 'createNew') */ initialTemplateDescription?: string; /** Initial mappings for edit mode */ initialMappings?: DocumentMappingRow[]; /** Initial file name for edit mode */ initialFileName?: string; /** Initial seprator for edit mode */ initialSeprator?: string; /** Initial delimeter for edit mode */ initialDelimeter?: string; /** Initial file format header for edit mode */ initialFileFormatHeader?: string; /** Initial description for edit mode */ initialDescription?: string; /** Whether in edit mode */ editMode?: boolean; /** True while parent is creating the step (API in progress); show loader on Create/Update Step button */ isCreatingStep: boolean; /** Whether the help tooltip is visible */ showHelpTooltip: boolean; /** Emit when step is created */ createStep: EventEmitter; /** Emit when cancelled */ cancelled: EventEmitter; /** Emit when "Create Template" is clicked (Create New flow). Host can create template via API. */ createTemplate: EventEmitter<{ templateName: string; templateDescription: string; }>; documentForm: FormGroup; selectedTemplateSource: TemplateSourceType; /** Uploaded file when Template Source is "Upload Template" */ uploadedFile: File | null; /** Visual state for drag-and-drop zone */ isDragOver: boolean; advancedSettingsVariables: any[]; advancedVariablesForm: FormArray; advancedExpanded: boolean; constructor(fb: FormBuilder); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; private initializeFormWithInitialValues; get mappingsFormArray(): FormArray; getDocumentTypeConfig(): DynamicSelectFieldConfig; getTemplateSelectConfig(): DynamicSelectFieldConfig; getValueTypeConfig(rowIndex: number, valueIndex: number): DynamicSelectFieldConfig; getDelimeterConfig(): DynamicSelectFieldConfig; get isTxtSelected(): boolean; get isCsvSelected(): boolean; onTemplateSourceChange(value: string): void; onCreateTemplate(): void; onFileSelected(event: Event): void; onDragOver(event: DragEvent): void; onDragLeave(event: DragEvent): void; onDrop(event: DragEvent): void; private isAcceptedTemplateFile; addMapping(): void; removeMapping(index: number): void; getMappingFormGroup(index: number): FormGroup; private buildValueEntry; getValuesFormArray(rowIndex: number): FormArray; getValueFormGroup(rowIndex: number, valueIndex: number): FormGroup; addValueEntry(rowIndex: number): void; removeValueEntry(rowIndex: number, valueIndex: number): void; /** True when every mapping row has enabled === true */ get allMappingsSelected(): boolean; /** True when at least one mapping row has enabled === true (for header indeterminate) */ get someMappingsSelected(): boolean; onSelectAllMappings(checked: boolean): void; onCancel(): void; isFormValid(): boolean; private buildAdvancedVariablesForm; onAdvancedVariableBooleanChange(variableName: string, value: boolean): void; onAdvancedVariableValueChange(variableName: string, value: any): void; toggleAdvanced(): void; onCreateStep(): void; onMapperHelpClick(event: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }