import { ChangeDetectorRef, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core'; import { FolderNode, ModularLabels } from '../../templates/modular-table-template/modular-table-template.models'; import { TestSuiteLabels } from '../test-suite.models'; import * as i0 from "@angular/core"; interface FlatFolderRow { id: number; name: string; depth: number; disabled: boolean; hasChildren: boolean; expanded: boolean; childrenLoading: boolean; showLoadingPlaceholder: boolean; } /** * Body of the "Move Test Suite" dialog. * * Reuses `` as the tree picker (same embedding pattern * as `NewFolderDialogComponent`) so consumers get the same folder-tree UX, while * adding two read-only rows above it: the suite's **current folder** (source) * and the **destination folder** the user has picked (live-updates). * * Two integration paths: * * 1. **From within this library** via `DialogService.open(...)`. The outer * `cqa-dialog` supplies title/description/Cancel/Move buttons; the Move * button reads `pickedFolderId` via `dialogRef.getComponentInstance()` and * checks `isValid` before closing. * * 2. **Host-driven** — host renders `` inside its * own modal and listens to `(submitted)` / `(cancelled)` / `(pickedFolderIdChange)`. */ export declare class MoveTestSuiteDialogComponent implements OnInit, OnChanges { private cdr; private _folders; set folders(value: FolderNode[]); get folders(): FolderNode[]; private _labels; set labels(value: ModularLabels); get labels(): ModularLabels; /** Test-suite-section labels (title, description, button text, field labels, * placeholder). Kept separate from `labels` (ModularLabels) so the embedded * picker can keep its modular-table-template label model. Same setter * pattern as `labels` for DialogService property-assignment compatibility. */ private _testSuiteLabels; set testSuiteLabels(value: TestSuiteLabels); get testSuiteLabels(): TestSuiteLabels; /** Folder the suite currently lives in. Used both to gray out the row in the * embedded picker and to render the "Current folder" readout. */ currentFolderId: number | null; /** Optional override for the current-folder display name. When not provided, * the component resolves the name from `folders` by walking to `currentFolderId`, * falling back to `labels.moveDialogRoot` ("Unorganized") when null. */ currentFolderName: string | null; /** Name of the test suite being moved. Rendered as a disabled input at the * top of the dialog body so the user can confirm which suite the move * applies to. Defaults to empty string. */ suiteName: string; /** Destination folder id picked by the user. Two-way-bind friendly. */ pickedFolderId: number | null; /** Height of the embedded picker. Defaults to 240px (matches the parent-folder * picker height in `NewFolderDialogComponent`) so the modal stays compact. */ pickerHeight: string; /** When true (default), both the Current folder and Destination folder inputs * render as disabled (read-only via the cqa-custom-input `[disabled]` flag). * Set to false if a host needs to re-enable interaction on those fields. */ fieldsDisabled: boolean; pickedFolderIdChange: EventEmitter; submitted: EventEmitter<{ targetFolderId: number | null; }>; cancelled: EventEmitter; /** Fires when a folder needs its children fetched. Emitted by `pick` (row * click) and `toggleExpanded` (chevron click) when the target node has * `hasChildren = true` but `loadedPages == null` and is not already fetching. * Hosts subscribe and call their paginated fetch, mutating the FolderNode * in place (set `children`, `loadedPages`, `childrenLoading`). */ folderChildrenRequested: EventEmitter; /** Bubble cqa-custom-input focus/blur events up to hosts. Useful when * `fieldsDisabled = false` and the host wants to react to interaction. */ currentFieldFocus: EventEmitter; currentFieldBlur: EventEmitter; destinationFieldFocus: EventEmitter; destinationFieldBlur: EventEmitter; /** Set to true the first time the user picks anything. Lets `isValid` treat * the initial pre-touch state as "nothing selected" — important when the * suite starts in Unorganized (`currentFolderId = null`) so a fresh dialog * doesn't appear valid just because `pickedFolderId` also defaults to null. */ private pickedTouched; /** Folder ids currently expanded in the inlined picker. Managed entirely * inside this component (no external Input) so it survives the host pushing * a new `folders` reference after each lazy-fetch resolves. */ private expandedIds; constructor(cdr: ChangeDetectorRef); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; /** Folder-row click handler. Selects the folder as the destination and, when * the folder has unloaded children, auto-expands it and asks the host to * fetch its children. */ pick(id: number | null): void; /** Chevron click handler. Toggles expansion locally; on expand path, asks * the host to fetch children when not already loaded. */ toggleExpanded(id: number, event: Event): void; isPicked(id: number | null): boolean; /** "Unorganized" row is disabled when the suite is already in Unorganized. */ get isUnorganizedDisabled(): boolean; /** Flattened, depth-indented row descriptors fed into the template `*ngFor`. * Walks `_folders`, derives chevron / loading / expanded state per node. */ get flatRows(): FlatFolderRow[]; trackById: (_: number, row: FlatFolderRow) => number; /** True once the user has picked a destination via the embedded tree. Drives * the destination-readout styling (indigo when picked, muted when not). */ get hasPick(): boolean; get resolvedCurrentName(): string; /** Value shown inside the Destination input. Empty until the user picks; once * picked, the resolved folder name (or `labels.moveDialogRoot` for Unorganized). * Empty state lets the input's `[placeholder]` show through. */ get destinationFieldValue(): string; /** Placeholder shown in the Destination input before the user picks. */ get destinationFieldPlaceholder(): string; /** Move is valid when the user has picked a destination different from the * current folder. Picking the same folder as the source is a no-op, and we * also require an explicit interaction (`pickedTouched`). */ get isValid(): boolean; submit(): void; cancel(): void; /** Hooks for the Current folder cqa-custom-input. Field is disabled by * default, so these mostly no-op; they're wired so the component still * behaves correctly when `fieldsDisabled = false`. */ onCurrentFieldValueChange(_value: string): void; onCurrentFieldFocused(event: FocusEvent): void; onCurrentFieldBlurred(event: FocusEvent): void; /** Hooks for the Destination folder cqa-custom-input. Value is driven by the * tree picker below, so the input itself is informational. */ onDestinationFieldValueChange(_value: string): void; onDestinationFieldFocused(event: FocusEvent): void; onDestinationFieldBlurred(event: FocusEvent): void; private requestChildrenIfMissing; private seedExpandedIds; private collectAncestors; private findNode; private findFolderName; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};