import { EventEmitter, TemplateRef, ChangeDetectorRef } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { DndDropEvent } from 'ngx-drag-drop'; import { DynamicSelectFieldConfig, SelectOption } from '../dynamic-select/dynamic-select-field.component'; import * as i0 from "@angular/core"; export interface PrerequisiteRow { key: string; } /** Emitted when any prerequisite select changes - contains all current selections */ export interface PrerequisiteSelection { key: string; value: unknown; } export declare class AddPrerequisiteCasesSectionComponent { private cdr; /** Whether the section is expanded (showing the form) */ expanded: boolean; /** Form group containing controls for each row (keyed by row.key) */ form: FormGroup; /** Array of row descriptors, each with a unique key */ rows: PrerequisiteRow[]; /** * Prerequisite options from API (e.g. test cases to choose from). * Passed to getSelectConfig when building the config for each row. */ options: SelectOption[]; /** * Function to get the dynamic select config for a given row index. * Receives optional options (from this.options when provided). * Each row can have different options. To avoid duplicates, exclude options * already selected in other rows (keep current row's selection so it displays). */ getSelectConfig: (index: number, options?: SelectOption[]) => DynamicSelectFieldConfig; /** Section label (e.g. "Prerequisite Cases") */ label: string; /** Tooltip for the info icon */ infoTooltip: string; /** Text for the "Add Another" button */ addAnotherText: string; /** Text for the Update button */ updateText: string; /** Text for the Cancel button */ cancelText: string; /** Text for the collapsed "Add" trigger */ addTriggerText: string; /** When true, hide Add Prerequisite button even if rows are empty (e.g. when collapsing after update with existing prerequisites) */ hideAddPrerequisite: boolean; /** When provided, controls Update button disabled state. Use for dirty-state validation (enable when form changed). When undefined, falls back to !allRowsHaveValues(). */ updateDisabled: boolean | undefined; /** When true, Update button is disabled and shows a loader (API in progress) */ isUpdating: boolean; /** When true, prerequisite dropdown uses server-side search and load more (emit searchOptions / loadMoreOptions). */ enableServerSearch: boolean; /** Per-row: whether more options are available for load more. Key = row index. */ hasMoreOptions: Record; /** Per-row: true while options are loading for that dropdown. Key = row index. */ isLoadingOptions: Record; /** Validation message shown when Add Another/Update are disabled (not all rows have values) */ selectFirstValidationMessage: string; /** Optional custom template for the select slot. Use ng-template #selectBody with let-row, let-index, let-form, let-config. */ selectBodyTpl?: TemplateRef<{ $implicit: PrerequisiteRow; index: number; form: FormGroup; config: DynamicSelectFieldConfig; }>; expandedChange: EventEmitter; addRow: EventEmitter; removeRow: EventEmitter; rowsReordered: EventEmitter; /** Emitted when Update button is clicked */ update: EventEmitter; /** Emitted when Cancel button is clicked */ cancel: EventEmitter; /** Emitted when a single row's selection changes */ selectionChange: EventEmitter<{ key: string; value: unknown; index: number; }>; /** Emitted when user searches in prerequisite dropdown (server search). Parent should fetch options and update options input. */ searchOptions: EventEmitter<{ index: number; query: string; }>; /** Emitted when user scrolls to load more options. Parent should append to options and set hasMoreOptions. */ loadMoreOptions: EventEmitter<{ index: number; query: string; }>; /** Emitted when any select changes - returns all current prerequisite selections in order */ prerequisitesChange: EventEmitter; /** Set to true when user clicks Add Another while invalid - shows validation message */ showAddAnotherValidation: boolean; constructor(cdr: ChangeDetectorRef); toggleExpanded(show: boolean): void; /** Called when user clicks "Add Prerequisite" with no rows - expands and adds first row */ onAddPrerequisiteClick(): void; onAddRow(): void; onRemoveRow(index: number): void; onDndDrop(event: DndDropEvent): void; trackByKey(_i: number, row: PrerequisiteRow): string; onUpdate(): void; onCancel(): void; onSelectionChange(event: { key: string; value: unknown; }, index: number): void; /** True when the row at the given index has a selected value */ rowHasValue(index: number): boolean; /** True when every row has a non-empty value (no placeholders) */ allRowsHaveValues(): boolean; /** Computed disabled state for Update button. When isUpdating we do not disable (show loader only); use updateDisabled for other cases. */ isUpdateDisabled(): boolean; /** Emits all current prerequisite selections (key + value) in row order */ private emitAllPrerequisites; getConfig(index: number): DynamicSelectFieldConfig; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }