import { EventEmitter, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; import { ButtonMetadata } from '../../types'; import type { Color } from '@ionic/core'; import { EditableFieldDef, FieldSchemaEditorMetadata } from '../field-schema-editor/types'; import { SurveyBuilderMetadata, SurveyBuilderSaveEvent, SurveyDraftEvent } from './types'; import * as i0 from "@angular/core"; interface SurveyQuestionSection { id: string; label: string; subtitle: string; rows: EditableFieldDef[]; } interface WizardStep { id: string; label: string; } /** * val-survey-builder * * Autoría de una encuesta: título, subtítulo, preguntas — arma o actualiza un * `RequestTypeConfig` con `Type: ":"` (ADR-092), `skipReview: * true` (cada respuesta se agrega, no se revisa una por una) y el `EntityRef` * que le pasa el consumer (ej. el evento de bingo dueño de la encuesta). * * Cada pregunta se edita con `val-field-schema-editor`, el mismo editor que usa * el checkout de bingo — de ahí que una pregunta tenga tipo, placeholder, nota * y opciones, no solo texto. La v1 de este componente tenía su propio editor * pobre (dos tipos, sin opciones); la Fase 5 del ADR-092 lo reemplazó por el * organism compartido en vez de mejorarlo por duplicado. * * El catálogo que ofrece sale de `SURVEY_QUESTION_TYPES` — acotado a lo que * `val-survey-response` sabe renderizar, no a lo que el editor sabe editar. */ export declare class SurveyBuilderComponent implements OnInit { props: SurveyBuilderMetadata; readonly saved: EventEmitter; /** * Emite lo escrito, ya validado, SIN guardarlo. Solo con `props.persist: * false` — ver el comentario de ese campo: cuando la app tiene endpoint * propio, guardar desde acá se salta la validación de la entidad dueña y el * permiso de la vertical. */ readonly draft: EventEmitter; private readonly i18n; private readonly requests; private readonly formBuilder; private readonly errors; private readonly modals; readonly surveyNameControl: FormControl; readonly titleControl: FormControl; readonly subtitleControl: FormControl; readonly headerImageControl: FormControl; readonly successTitleControl: FormControl; readonly successMessageControl: FormControl; readonly successImageControl: FormControl; readonly questions: import("@angular/core").WritableSignal; readonly editingId: import("@angular/core").WritableSignal; readonly wizardStep: import("@angular/core").WritableSignal; readonly validationError: import("@angular/core").WritableSignal; readonly saving: import("@angular/core").WritableSignal; readonly uploadingImage: import("@angular/core").WritableSignal<"" | "success" | "header">; readonly sectionIds: import("@angular/core").WritableSignal; readonly sectionNames: import("@angular/core").WritableSignal>; readonly sectionSubtitles: import("@angular/core").WritableSignal>; readonly activeSectionId: import("@angular/core").WritableSignal; private readonly sectionNameControls; private readonly sectionSubtitleControls; readonly questionGroups: import("@angular/core").Signal; readonly wizardSteps: import("@angular/core").Signal; private groupQuestions; private normalizeSectionId; private questionGroupById; sectionNameControl(sectionId: string): FormControl; sectionSubtitleControl(sectionId: string): FormControl; private readonly allowedImageTypes; private readonly maxImageBytes; constructor(); ngOnInit(): Promise; t(key: string): string; typeLabel(type: string): string; questionTypes(): string[]; isWizard(): boolean; showWizardSection(step: number): boolean; goToStep(step: number): void; nextStep(): void; previousStep(): void; wizardBackProps(): ButtonMetadata; wizardNextProps(): ButtonMetadata; saveProps(): ButtonMetadata; closeStep(): number; reviewStep(): number; currentSectionId(): string | undefined; selectSection(sectionId: string): void; interpolate(template: string, values: Record): string; editorProps(row: EditableFieldDef): FieldSchemaEditorMetadata; iconAction(token: string, icon: string, label: string, disabled?: boolean, color?: Color): ButtonMetadata; addQuestionAriaLabel(sectionLabel?: string): string; addQuestion(sectionId?: string): void; addSection(): void; rowGlobalIndex(sectionId: string, groupRowIndex: number): number; nextQuestionIndexForSection(rows: EditableFieldDef[], sectionId: string): number; toggleEdit(row: EditableFieldDef): void; removeQuestion(row: EditableFieldDef): void; duplicate(row: EditableFieldDef): void; move(index: number, delta: number): void; /** * Guarda lo que se está escribiendo, sin cerrar el editor ni validar. * * Sin esto, lo tipeado solo existía dentro del editor hasta que alguien * tocaba "Listo": la fila seguía diciendo "Pregunta sin texto" y, peor, * "Guardar encuesta" fallaba con "todas las preguntas necesitan texto" sobre * una pregunta que en pantalla claramente tenía texto. Tocar "Listo" era un * paso obligatorio que no se veía por ningún lado. */ draftQuestion(field: EditableFieldDef): void; applyQuestion(field: EditableFieldDef): void; private withResolvedSection; onPresentationFileSelected(slot: 'header' | 'success', event: Event): Promise; clearPresentationImage(slot: 'header' | 'success'): void; save(): Promise; private hydrate; private presentationPayload; private defaultSuccessTitle; private defaultSuccessMessage; private validateWizardStep; private validateBeforeSave; private validateRows; private rowFromField; reviewQuestionsCount(): string; sectionQuestionCountText(count: number): string; previewProps(): ButtonMetadata; openPreview(): Promise; private sectionOrderFor; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};