ui-core-abv 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,21 +3,20 @@ import { Injector, Type } from '@angular/core';
3
3
  import { OverlayRef } from '@angular/cdk/overlay';
4
4
  import { SideModalConfig } from './sideModalConfig.model';
5
5
  import { UiModalRef } from '../../../services/modaRef';
6
- import { UicModalService } from '../../../services/modal.service';
7
6
  import * as i0 from "@angular/core";
8
7
  export declare class UicSideModalComponent {
9
8
  private readonly modalRef;
10
9
  private readonly component;
11
10
  private readonly congif;
12
11
  private readonly injector;
13
- private readonly modal;
14
12
  overlayRef: OverlayRef;
15
13
  state: 'visible' | 'hidden';
16
14
  show: boolean;
17
15
  myConfig: SideModalConfig;
18
16
  ready: boolean;
19
17
  portalOutlet: CdkPortalOutlet;
20
- constructor(modalRef: UiModalRef, component: Type<any>, congif: SideModalConfig, injector: Injector, modal: UicModalService);
18
+ private readonly modal;
19
+ constructor(modalRef: UiModalRef, component: Type<any>, congif: SideModalConfig, injector: Injector);
21
20
  ngOnInit(): void;
22
21
  ngAfterViewInit(): void;
23
22
  closeOuside(): void;
@@ -49,7 +49,11 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
49
49
  * Se aplica al montar y cada vez que cambia el valor. Úsalo junto con initialValues.
50
50
  */
51
51
  readonly startAt: import("@angular/core").InputSignal<SurveyStartAt | null>;
52
- /** En modo 'field', avanza solo al responder una pregunta de selección única (radio/select). */
52
+ /**
53
+ * @deprecated Sin efecto. El avance automático se retiró porque solo aplicaba a algunos tipos
54
+ * de campo y resultaba inconsistente: ahora siempre se avanza con "Siguiente".
55
+ * Se mantiene la entrada para no romper plantillas existentes.
56
+ */
53
57
  readonly autoAdvance: import("@angular/core").InputSignal<boolean>;
54
58
  /** Enfoca el primer campo de cada página al navegar. */
55
59
  readonly autoFocus: import("@angular/core").InputSignal<boolean>;
@@ -112,8 +116,6 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
112
116
  private pendingSaves;
113
117
  private formValueSub;
114
118
  private readonly subscriptions;
115
- private readonly autoAdvanceSnapshot;
116
- private autoAdvanceTimer;
117
119
  private appliedThemeKeys;
118
120
  constructor();
119
121
  ngOnInit(): void;
@@ -153,8 +155,6 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
153
155
  private saveField;
154
156
  private onSaveSucceeded;
155
157
  private onSaveFailed;
156
- private maybeAutoAdvance;
157
- private cancelAutoAdvance;
158
158
  private applyTheme;
159
159
  private toObservable;
160
160
  private isEmptyValue;
@@ -1,8 +1,22 @@
1
1
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
2
- import { EditableBlock, EditableField } from '../user-formbuilder.component';
2
+ import { EditableBlock, EditableField, FormBuilderRemovedItem } from '../user-formbuilder.component';
3
3
  import { FieldConfig, FieldType } from '../../dynamic-form/form.models';
4
4
  import * as i0 from "@angular/core";
5
+ export interface VisibilityRuleSummary {
6
+ text: string;
7
+ extraRules: number;
8
+ }
9
+ /** Movimiento de un campo raíz entre bloques (drag & drop entre listas conectadas). */
10
+ export interface FieldMoveRequest {
11
+ fromBlockCode: string;
12
+ toBlockCode: string;
13
+ previousIndex: number;
14
+ currentIndex: number;
15
+ }
16
+ export declare const blockFieldListId: (blockCode: string) => string;
5
17
  export declare class BlockEditorComponent {
18
+ private readonly translateService;
19
+ private readonly host;
6
20
  block: import("@angular/core").InputSignal<EditableBlock>;
7
21
  blockChange: import("@angular/core").OutputEmitterRef<EditableBlock>;
8
22
  addFieldRequest: import("@angular/core").OutputEmitterRef<FieldConfig>;
@@ -20,6 +34,20 @@ export declare class BlockEditorComponent {
20
34
  selectedSubFieldCode: import("@angular/core").InputSignal<string | null>;
21
35
  selectedSubFieldParentCode: import("@angular/core").InputSignal<string | null>;
22
36
  visibilityParentFieldCodes: Set<string>;
37
+ /** Campos raíz de todo el formulario (por code), para describir reglas que apuntan a otros bloques. */
38
+ fieldLookup: Map<string, EditableField>;
39
+ /** Muestra el identificador (name) en la tarjeta; útil solo cuando el usuario puede editarlo. */
40
+ showIdentifier: import("@angular/core").InputSignal<boolean>;
41
+ itemRemoved: import("@angular/core").OutputEmitterRef<FormBuilderRemovedItem>;
42
+ duplicateFieldRequest: import("@angular/core").OutputEmitterRef<string>;
43
+ moveFieldRequest: import("@angular/core").OutputEmitterRef<FieldMoveRequest>;
44
+ /** Ids de las listas de campos de todos los bloques, para poder arrastrar campos entre ellos. */
45
+ connectedFieldListIds: import("@angular/core").InputSignal<string[]>;
46
+ /** Solo lectura: se puede navegar y seleccionar, pero no editar, mover, agregar ni eliminar. */
47
+ readOnly: import("@angular/core").InputSignal<boolean>;
48
+ fieldListId: import("@angular/core").Signal<string>;
49
+ /** Estado solo visual: plegar el bloque no altera el formulario. */
50
+ collapsed: import("@angular/core").WritableSignal<boolean>;
23
51
  excludeSubFieldTypes: FieldType[];
24
52
  private expandedRepeaters;
25
53
  constructor();
@@ -30,6 +58,9 @@ export declare class BlockEditorComponent {
30
58
  onSelectSubField(parentCode: string, subField: EditableField, event: Event): void;
31
59
  addSubField(parentCode: string, type: FieldConfig): void;
32
60
  deleteSubField(parentCode: string, sfCode: string, event: Event): void;
61
+ /** Copia el subcampo justo debajo del original, con un code nuevo dentro del mismo repetidor. */
62
+ duplicateSubField(parentCode: string, sfCode: string, event: Event): void;
63
+ private copyLabel;
33
64
  reorderSubFields(parentCode: string, event: CdkDragDrop<EditableField[]>): void;
34
65
  private updateSubFields;
35
66
  private generateSubFieldCode;
@@ -42,7 +73,14 @@ export declare class BlockEditorComponent {
42
73
  isVisibilityParent(fieldCode: string): boolean;
43
74
  isSubFieldVisibilityParent(parentField: EditableField, sfCode: string): boolean;
44
75
  isBlockVisibilityParent(): boolean;
45
- reorderFields(event: CdkDragDrop<EditableField[]>): void;
76
+ /** Resumen legible de las reglas de visibilidad: "Visible si País es igual a Perú" (+N reglas). */
77
+ visibilitySummary(field: EditableField, siblings?: EditableField[]): VisibilityRuleSummary | null;
78
+ private formatRuleValue;
79
+ private lowerFirst;
80
+ toggleCollapsed(): void;
81
+ requestDuplicateField(fieldCode: string, e: Event): void;
82
+ /** cdkDropListData es el code del bloque: así se identifica el origen al soltar desde otro bloque. */
83
+ reorderFields(event: CdkDragDrop<string>): void;
46
84
  static ɵfac: i0.ɵɵFactoryDeclaration<BlockEditorComponent, never>;
47
- static ɵcmp: i0.ɵɵComponentDeclaration<BlockEditorComponent, "lib-block-editor", never, { "block": { "alias": "block"; "required": false; "isSignal": true; }; "selectedFieldId": { "alias": "selectedFieldId"; "required": false; "isSignal": true; }; "selectedSubFieldCode": { "alias": "selectedSubFieldCode"; "required": false; "isSignal": true; }; "selectedSubFieldParentCode": { "alias": "selectedSubFieldParentCode"; "required": false; "isSignal": true; }; "visibilityParentFieldCodes": { "alias": "visibilityParentFieldCodes"; "required": false; }; }, { "blockChange": "blockChange"; "addFieldRequest": "addFieldRequest"; "deleteBlock": "deleteBlock"; "notifySelectedField": "notifySelectedField"; "notifySelectedSubField": "notifySelectedSubField"; "notifyNewSubField": "notifyNewSubField"; }, never, never, true, never>;
85
+ static ɵcmp: i0.ɵɵComponentDeclaration<BlockEditorComponent, "lib-block-editor", never, { "block": { "alias": "block"; "required": false; "isSignal": true; }; "selectedFieldId": { "alias": "selectedFieldId"; "required": false; "isSignal": true; }; "selectedSubFieldCode": { "alias": "selectedSubFieldCode"; "required": false; "isSignal": true; }; "selectedSubFieldParentCode": { "alias": "selectedSubFieldParentCode"; "required": false; "isSignal": true; }; "visibilityParentFieldCodes": { "alias": "visibilityParentFieldCodes"; "required": false; }; "fieldLookup": { "alias": "fieldLookup"; "required": false; }; "showIdentifier": { "alias": "showIdentifier"; "required": false; "isSignal": true; }; "connectedFieldListIds": { "alias": "connectedFieldListIds"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; }, { "blockChange": "blockChange"; "addFieldRequest": "addFieldRequest"; "deleteBlock": "deleteBlock"; "notifySelectedField": "notifySelectedField"; "notifySelectedSubField": "notifySelectedSubField"; "notifyNewSubField": "notifyNewSubField"; "itemRemoved": "itemRemoved"; "duplicateFieldRequest": "duplicateFieldRequest"; "moveFieldRequest": "moveFieldRequest"; }, never, never, true, never>;
48
86
  }
@@ -1,4 +1,4 @@
1
- import { FormField, uicFormValuesRecord } from '../../../dynamic-form/form.models';
1
+ import { FieldVisibilityRule, FormField, uicFormValuesRecord } from '../../../dynamic-form/form.models';
2
2
  import { AppSelectOption } from '../../../inputs/select/select.component';
3
3
  import { EditableField } from '../../user-formbuilder.component';
4
4
  import * as i0 from "@angular/core";
@@ -17,6 +17,8 @@ export declare class FieldEditorComponent {
17
17
  focusRequiredField: import("@angular/core").InputSignal<boolean>;
18
18
  isSubField: import("@angular/core").InputSignal<boolean>;
19
19
  enableNameModify: import("@angular/core").InputSignal<boolean>;
20
+ /** Solo lectura: muestra las propiedades deshabilitadas y oculta las acciones sobre reglas. */
21
+ readOnly: import("@angular/core").InputSignal<boolean>;
20
22
  options: import("@angular/core").InputSignal<Record<string, AppSelectOption[]>>;
21
23
  hiddenSections: import("@angular/core").WritableSignal<string[]>;
22
24
  editingRuleIndex: import("@angular/core").WritableSignal<number>;
@@ -48,6 +50,14 @@ export declare class FieldEditorComponent {
48
50
  updateScaleLabels(labels: AppSelectOption[]): void;
49
51
  updateOptions(options: AppSelectOption[]): void;
50
52
  private getDependencyFieldLabel;
53
+ isSectionHidden(section: string): boolean;
54
+ /** Cantidad de propiedades con valor en una sección (se muestra en su cabecera). */
55
+ sectionCounts: import("@angular/core").Signal<Record<string, number>>;
56
+ /** Texto legible del valor de una regla: texto de la opción, Sí/No, o el valor tal cual. */
57
+ ruleValueText(rule: FieldVisibilityRule): string;
58
+ private getDependencyValueOptions;
59
+ private readPath;
60
+ private hasConfiguredValue;
51
61
  toggleSection(section: string): void;
52
62
  private buildDesignBlocks;
53
63
  private buildAdvancedBlocks;
@@ -63,5 +73,5 @@ export declare class FieldEditorComponent {
63
73
  private buildComputedSourceFields;
64
74
  private buildExternalValidationFields;
65
75
  static ɵfac: i0.ɵɵFactoryDeclaration<FieldEditorComponent, never>;
66
- static ɵcmp: i0.ɵɵComponentDeclaration<FieldEditorComponent, "lib-field-editor", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "focusRequiredField": { "alias": "focusRequiredField"; "required": false; "isSignal": true; }; "isSubField": { "alias": "isSubField"; "required": false; "isSignal": true; }; "enableNameModify": { "alias": "enableNameModify"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "fieldChange": "fieldChange"; }, never, never, true, never>;
76
+ static ɵcmp: i0.ɵɵComponentDeclaration<FieldEditorComponent, "lib-field-editor", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "focusRequiredField": { "alias": "focusRequiredField"; "required": false; "isSignal": true; }; "isSubField": { "alias": "isSubField"; "required": false; "isSignal": true; }; "enableNameModify": { "alias": "enableNameModify"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "fieldChange": "fieldChange"; }, never, never, true, never>;
67
77
  }
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter } from '@angular/core';
2
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
2
3
  import { AppSelectOption } from '../../../../inputs/select/select.component';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class UicFieldOptionsEditorComponent {
@@ -14,13 +15,24 @@ export declare class UicFieldOptionsEditorComponent {
14
15
  showAdvanced: boolean;
15
16
  /** Si el código está vacío, lo completa con la etiqueta al salir del campo. */
16
17
  autoCode: boolean;
18
+ /** Solo lectura: muestra las opciones sin permitir editarlas, reordenarlas, agregarlas ni eliminarlas. */
19
+ disabled: boolean;
17
20
  options: AppSelectOption[];
21
+ private nameInputs?;
18
22
  addOption(): void;
23
+ /** Emite en cada tecla (no solo al salir del input) para no perder lo escrito si se cambia de campo. */
24
+ emitChange(): void;
25
+ /** Enter en la etiqueta: pasa a la siguiente opción, o crea una nueva si es la última. */
26
+ onEnter(event: Event, index: number): void;
27
+ /** Pegar varias líneas crea una opción por línea (la primera ocupa la fila actual si está vacía). */
28
+ onPaste(event: ClipboardEvent, index: number): void;
29
+ reorder(event: CdkDragDrop<unknown>): void;
30
+ private focusName;
19
31
  dropOption(index: number): void;
20
32
  updateCode(name: string, idx: number): void;
21
33
  get hasStyledOptions(): boolean;
22
34
  /** Abre el modal de ícono y color de las opciones. Cancelar no cambia nada. */
23
35
  openAdvanced(): void;
24
36
  static ɵfac: i0.ɵɵFactoryDeclaration<UicFieldOptionsEditorComponent, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<UicFieldOptionsEditorComponent, "ui-field-options-editor", never, { "title": { "alias": "title"; "required": false; }; "codeLabel": { "alias": "codeLabel"; "required": false; }; "nameLabel": { "alias": "nameLabel"; "required": false; }; "codePlaceholder": { "alias": "codePlaceholder"; "required": false; }; "namePlaceholder": { "alias": "namePlaceholder"; "required": false; }; "showAdvanced": { "alias": "showAdvanced"; "required": false; }; "autoCode": { "alias": "autoCode"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "optionsChange": "optionsChange"; }, never, never, true, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<UicFieldOptionsEditorComponent, "ui-field-options-editor", never, { "title": { "alias": "title"; "required": false; }; "codeLabel": { "alias": "codeLabel"; "required": false; }; "nameLabel": { "alias": "nameLabel"; "required": false; }; "codePlaceholder": { "alias": "codePlaceholder"; "required": false; }; "namePlaceholder": { "alias": "namePlaceholder"; "required": false; }; "showAdvanced": { "alias": "showAdvanced"; "required": false; }; "autoCode": { "alias": "autoCode"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "optionsChange": "optionsChange"; }, never, never, true, never>;
26
38
  }
@@ -1,10 +1,31 @@
1
1
  import { FieldConfig, FieldType } from '../../../dynamic-form/form.models';
2
+ import { UicDropdownContainerComponent } from '../../../dropdown-container/dropdown-container.component';
3
+ import { ButtonSize } from '../../../button/button.component';
2
4
  import * as i0 from "@angular/core";
5
+ type FieldTypeGroupKey = 'text' | 'choice' | 'datetime' | 'advanced' | 'other';
6
+ interface FieldTypeGroup {
7
+ key: FieldTypeGroupKey;
8
+ types: FieldConfig[];
9
+ }
3
10
  export declare class FieldTypeSelectorComponent {
11
+ private readonly translateService;
4
12
  excludeTypes: import("@angular/core").InputSignal<FieldType[]>;
5
- types: import("@angular/core").Signal<FieldConfig[]>;
13
+ /** Texto del botón disparador (clave de traducción o texto literal). */
14
+ label: import("@angular/core").InputSignal<string>;
15
+ size: import("@angular/core").InputSignal<ButtonSize>;
6
16
  selectType: import("@angular/core").OutputEmitterRef<FieldConfig>;
7
- addField(type: FieldConfig): void;
17
+ private searchInput?;
18
+ search: import("@angular/core").WritableSignal<string>;
19
+ types: import("@angular/core").Signal<FieldConfig[]>;
20
+ filteredTypes: import("@angular/core").Signal<FieldConfig[]>;
21
+ groups: import("@angular/core").Signal<FieldTypeGroup[]>;
22
+ onOpen(): void;
23
+ onClosed(): void;
24
+ pick(type: FieldConfig): void;
25
+ /** Enter en el buscador agrega el primer resultado. */
26
+ pickFirst(dropdown: UicDropdownContainerComponent): void;
27
+ private normalize;
8
28
  static ɵfac: i0.ɵɵFactoryDeclaration<FieldTypeSelectorComponent, never>;
9
- static ɵcmp: i0.ɵɵComponentDeclaration<FieldTypeSelectorComponent, "lib-field-type-selector", never, { "excludeTypes": { "alias": "excludeTypes"; "required": false; "isSignal": true; }; }, { "selectType": "selectType"; }, never, never, true, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<FieldTypeSelectorComponent, "lib-field-type-selector", never, { "excludeTypes": { "alias": "excludeTypes"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "selectType": "selectType"; }, never, never, true, never>;
10
30
  }
31
+ export {};
@@ -7,6 +7,7 @@ export type FormBuilderPreviewMode = 'form' | 'survey';
7
7
  export interface FormBuilderSurveyPreviewOptions {
8
8
  pageMode?: SurveyPageMode;
9
9
  theme?: SurveyTheme | null;
10
+ /** @deprecated Sin efecto: la encuesta ya no avanza sola. */
10
11
  autoAdvance?: boolean;
11
12
  animation?: SurveyAnimation;
12
13
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Clon profundo de objetos/arrays planos. Funciones, fechas y otras instancias se conservan
3
+ * por referencia (a diferencia de structuredClone, que falla con funciones).
4
+ */
5
+ export declare function deepCloneValue<T>(value: T): T;
6
+ /** Devuelve `base` si no está usado; si no, `base_2`, `base_3`, ... */
7
+ export declare function uniqueName(base: string, used: Set<string>): string;
8
+ /** Preferencia por navegador; el almacenamiento puede no estar disponible (modo privado, SSR). */
9
+ export declare function readStoredPropertiesWidth(): number | null;
10
+ export declare function storePropertiesWidth(width: number): void;
@@ -1,6 +1,9 @@
1
- import { FieldConfig, FormField, FormSchema, SelectOptionsResolver, ComputedFieldResolver, ExternalValidatorResolver } from '../dynamic-form/form.models';
1
+ import { FieldConfig, FormField, SelectOptionsResolver, ComputedFieldResolver, ExternalValidatorResolver } from '../dynamic-form/form.models';
2
2
  import { FormBuilderPreviewMode, FormBuilderSurveyPreviewOptions } from './form-preview/form-preview.component';
3
+ import { FieldMoveRequest } from './block-editor/block-editor.component';
4
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
3
5
  import { AppSelectOption } from '../inputs/select/select.component';
6
+ import { ConnectedPosition } from '@angular/cdk/overlay';
4
7
  import * as i0 from "@angular/core";
5
8
  export type { FormBuilderPreviewMode, FormBuilderSurveyPreviewOptions } from './form-preview/form-preview.component';
6
9
  export type EditableField = {
@@ -30,12 +33,30 @@ export type EditableForm = {
30
33
  titleMargin?: number;
31
34
  subtitleMargin?: number;
32
35
  };
36
+ /** Elemento eliminado en el canvas, con lo necesario para reinsertarlo en su posición ("Deshacer"). */
37
+ export type FormBuilderRemovedItem = {
38
+ kind: 'field';
39
+ blockCode: string;
40
+ index: number;
41
+ item: EditableField;
42
+ } | {
43
+ kind: 'subfield';
44
+ blockCode: string;
45
+ parentCode: string;
46
+ index: number;
47
+ item: EditableField;
48
+ } | {
49
+ kind: 'block';
50
+ index: number;
51
+ item: EditableBlock;
52
+ };
33
53
  export type BuilderSchemaFile = {
34
54
  schemaVersion: 1;
35
55
  form: EditableForm;
36
56
  };
37
57
  export declare class UicUserFormbuilderComponent {
38
58
  private readonly modalService;
59
+ private readonly host;
39
60
  private readonly tinyAlertService;
40
61
  private readonly translateService;
41
62
  disabled: boolean;
@@ -61,7 +82,12 @@ export declare class UicUserFormbuilderComponent {
61
82
  editableSubtitleFontSize: import("@angular/core").WritableSignal<number | null>;
62
83
  editableTitleMargin: import("@angular/core").WritableSignal<number | null>;
63
84
  editableSubtitleMargin: import("@angular/core").WritableSignal<number | null>;
64
- headerRowExpanded: import("@angular/core").WritableSignal<boolean>;
85
+ readonly columnOptions: number[];
86
+ /** El menú "⋯" se abre hacia abajo alineado a la derecha del botón. */
87
+ readonly menuPositions: ConnectedPosition[];
88
+ /** Confirmación breve tras copiar el JSON (se muestra en el propio ítem del menú). */
89
+ schemaCopied: import("@angular/core").WritableSignal<boolean>;
90
+ private copiedTimer;
65
91
  editableBlocks: import("@angular/core").WritableSignal<EditableBlock[]>;
66
92
  editingSnapshot: import("@angular/core").WritableSignal<EditableForm | null>;
67
93
  isReadOnly: import("@angular/core").WritableSignal<boolean>;
@@ -73,16 +99,30 @@ export declare class UicUserFormbuilderComponent {
73
99
  focusNewFieldCode: import("@angular/core").WritableSignal<string | null>;
74
100
  focusNewSubFieldCode: import("@angular/core").WritableSignal<string | null>;
75
101
  propertiesWidth: import("@angular/core").WritableSignal<number>;
76
- previewSchema: import("@angular/core").Signal<FormSchema>;
102
+ isResizing: import("@angular/core").WritableSignal<boolean>;
103
+ /** Ids de las listas de campos de cada bloque (para arrastrar campos entre bloques). */
104
+ fieldListIds: import("@angular/core").Signal<string[]>;
77
105
  visibilityParentFieldCodes: import("@angular/core").Signal<Set<string>>;
78
- private isResizingProperties;
106
+ /** Campos raíz indexados por code (para describir reglas de visibilidad entre bloques). */
107
+ fieldLookup: import("@angular/core").Signal<Map<string, EditableField>>;
108
+ /** Huella del último estado guardado/cargado; se compara contra el estado actual. */
109
+ private readonly baselineFingerprint;
110
+ private readonly currentFingerprint;
111
+ /** true si hay cambios sin guardar en modo edición. Público para que el consumidor lo use en un CanDeactivate. */
112
+ readonly hasUnsavedChanges: import("@angular/core").Signal<boolean>;
113
+ /** Último elemento eliminado que aún se puede restaurar. */
114
+ pendingUndo: import("@angular/core").WritableSignal<{
115
+ removed: FormBuilderRemovedItem;
116
+ message: string;
117
+ } | null>;
118
+ private undoTimer;
79
119
  private resizeStartX;
80
120
  private resizeStartWidth;
81
121
  dependencyOptions: import("@angular/core").Signal<Record<string, AppSelectOption[]>>;
82
122
  subFieldDependencyOptions: import("@angular/core").Signal<Record<string, AppSelectOption[]>>;
83
123
  constructor();
84
124
  addBlock(): void;
85
- deleteBlock(code: string): void;
125
+ deleteBlock(code: string): Promise<void>;
86
126
  addField(blockCode: string, newFieldType: FieldConfig): void;
87
127
  selectField(field: EditableField | null): void;
88
128
  onSelectSubField(event: {
@@ -93,10 +133,40 @@ export declare class UicUserFormbuilderComponent {
93
133
  parentCode: string;
94
134
  subField: EditableField;
95
135
  }): void;
136
+ registerRemoval(removed: FormBuilderRemovedItem): void;
137
+ undoRemoval(): void;
138
+ /**
139
+ * Se descarta el "Deshacer" al crear elementos nuevos: los códigos (field_N, sf_N, block_N)
140
+ * se recalculan desde el máximo actual, así que restaurar después podría duplicar un código.
141
+ */
142
+ dismissUndo(): void;
143
+ private clearUndoTimer;
144
+ private blockDisplayName;
145
+ onBeforeUnload(event: BeforeUnloadEvent): void;
146
+ private markAsSaved;
147
+ /**
148
+ * Representación canónica para comparar estados: ignora la config hidratada (`field`),
149
+ * el orden de claves y los valores "vacíos" (null, undefined, '', false, []) que el editor
150
+ * de propiedades puede agregar al seleccionar un campo sin que el usuario cambie nada.
151
+ */
152
+ private fingerprint;
96
153
  onSubFieldChange(updatedFieldData: FormField): void;
97
154
  startPropertiesResize(event: MouseEvent): void;
98
155
  onPropertiesResize(event: MouseEvent): void;
99
156
  stopPropertiesResize(): void;
157
+ /** Doble clic en el borde: vuelve al ancho por defecto. */
158
+ resetPropertiesWidth(): void;
159
+ /** Cierra el panel de propiedades: deselecciona el campo y quita el foco del input activo. */
160
+ closeProperties(): void;
161
+ /** Esc dentro del panel lo cierra, salvo que otro control (p. ej. un select abierto) ya lo haya usado. */
162
+ onPropertiesEscape(event: Event): void;
163
+ /** Clic en el fondo del canvas (fuera de bloques y campos) cierra las propiedades. */
164
+ onCanvasBackgroundClick(event: MouseEvent): void;
165
+ backToRepeater(parentCode: string): void;
166
+ reorderBlocks(event: CdkDragDrop<unknown>): void;
167
+ moveField(move: FieldMoveRequest): void;
168
+ /** Copia el campo justo debajo del original y lo selecciona. */
169
+ duplicateField(fieldCode: string): void;
100
170
  printForm(): void;
101
171
  copySchemaToClipboard(): void;
102
172
  importSchemaFromFile(event: Event): Promise<void>;
@@ -108,7 +178,7 @@ export declare class UicUserFormbuilderComponent {
108
178
  private deduplicateFieldNames;
109
179
  private getDuplicatedFieldName;
110
180
  enableEditMode(): void;
111
- discardChanges(): void;
181
+ discardChanges(): Promise<void>;
112
182
  onBlockChange(index: number, updated: EditableBlock): void;
113
183
  onFieldChange(updatedField: FormField): void;
114
184
  private prepareBlocksForLocalState;
@@ -11,6 +11,11 @@ export declare class UicToolTipDirective {
11
11
  private canShowTooltipOnHover;
12
12
  private setTooltipComponentProperties;
13
13
  onMouseLeave(): void;
14
+ /**
15
+ * Al presionar se oculta: si el elemento inicia un arrastre (CDK drag) o se mueve/destruye,
16
+ * el navegador puede no disparar mouseleave y el tooltip quedaría fijo en pantalla.
17
+ */
18
+ onPointerDown(): void;
14
19
  ngOnDestroy(): void;
15
20
  destroy(): void;
16
21
  static ɵfac: i0.ɵɵFactoryDeclaration<UicToolTipDirective, never>;
@@ -17,3 +17,11 @@ export declare function findThemeScope(element: Element | null | undefined): HTM
17
17
  * Sin alcance no hace nada, así que es seguro llamarlo siempre.
18
18
  */
19
19
  export declare function applyThemeScope(origin: Element | null | undefined, target: HTMLElement): void;
20
+ /** Atributo con el que la app elige el tema claro u oscuro (ver styles/_dark.scss). */
21
+ export declare const UIC_COLOR_SCHEME_ATTR = "data-theme";
22
+ /**
23
+ * Si `origin` está dentro de una zona con un data-theme distinto del de <html> (p. ej. una zona
24
+ * clara dentro de una app en oscuro), se lo pone también a `target`. Los paneles se dibujan en
25
+ * <body>: sin esto heredarían el tema de la página y no el de la zona.
26
+ */
27
+ export declare function applyColorScheme(origin: Element | null | undefined, target: HTMLElement): void;
@@ -190,6 +190,68 @@ export declare const DICTIONARY_EN: {
190
190
  readonly preview_survey_restart: "Restart";
191
191
  readonly select_field_to_edit: "Select a field to edit its properties";
192
192
  readonly no_fields: "Add fields to your form";
193
+ readonly no_fields_drop: "Add a field or drag one from another block";
194
+ readonly copy_label: "{{label}} (copy)";
195
+ readonly block: {
196
+ readonly drag: "Drag to reorder the block";
197
+ readonly collapse: "Collapse block";
198
+ readonly expand: "Expand block";
199
+ readonly field_count: "{{count}} field(s)";
200
+ readonly empty_read_only: "This block has no fields";
201
+ };
202
+ readonly properties: {
203
+ readonly title: "Properties";
204
+ readonly resize: "Drag to resize (double-click to reset)";
205
+ readonly back_to_repeater: "Back to repeater";
206
+ readonly close: "Close properties (Esc)";
207
+ };
208
+ readonly untitled_block: "Block {{index}}";
209
+ readonly unsaved_changes: "Unsaved changes";
210
+ readonly read_only: "Read only";
211
+ readonly edit: "Edit";
212
+ readonly no_blocks: "This form has no blocks yet";
213
+ readonly select_field_to_view: "Select a field to view its properties";
214
+ readonly menu: {
215
+ readonly more: "More options";
216
+ readonly copy_json: "Copy JSON";
217
+ readonly copied: "JSON copied";
218
+ readonly load_json: "Load JSON";
219
+ readonly layout_title: "Form layout";
220
+ readonly columns: "Columns";
221
+ readonly size: "Size";
222
+ readonly margin: "Margin";
223
+ readonly title: "Title";
224
+ readonly subtitle: "Subtitle";
225
+ readonly layout_hint: "Sizes and margins in pixels. Leave empty to use the default.";
226
+ };
227
+ readonly no_changes: "There are no changes to save";
228
+ readonly discard_changes: "Discard changes";
229
+ readonly discard_confirm: "All unsaved changes will be lost. Do you want to continue?";
230
+ readonly discard_confirm_title: "Discard changes";
231
+ readonly discard_confirm_ok: "Discard";
232
+ readonly delete_block_confirm: "The block \"{{label}}\" contains {{count}} field(s), which will also be deleted.";
233
+ readonly delete_block_confirm_title: "Delete block";
234
+ readonly delete_block_confirm_ok: "Delete block";
235
+ readonly visibility_summary: "Visible if {{field}} {{operator}} {{value}}";
236
+ readonly yes: "Yes";
237
+ readonly no: "No";
238
+ readonly undo: {
239
+ readonly field_removed: "Field \"{{label}}\" deleted";
240
+ readonly subfield_removed: "Sub-field \"{{label}}\" deleted";
241
+ readonly block_removed: "Block \"{{label}}\" deleted";
242
+ readonly action: "Undo";
243
+ };
244
+ readonly field_picker: {
245
+ readonly search: "Search field type...";
246
+ readonly empty: "No field type matches your search";
247
+ readonly groups: {
248
+ readonly text: "Text";
249
+ readonly choice: "Choice";
250
+ readonly datetime: "Date & time";
251
+ readonly advanced: "Advanced";
252
+ readonly other: "Other";
253
+ };
254
+ };
193
255
  readonly base: {
194
256
  readonly name: "Key";
195
257
  readonly required: "Required";
@@ -322,6 +384,9 @@ export declare const DICTIONARY_EN: {
322
384
  readonly externalValidationKey_tip: "Key of the external validator to run on field blur";
323
385
  };
324
386
  readonly options_editor: {
387
+ readonly remove_option: "Remove option";
388
+ readonly no_options_read_only: "No options.";
389
+ readonly keyboard_hint: "Enter moves to the next option. You can paste a list (one option per line).";
325
390
  readonly title: "Options";
326
391
  readonly code_label: "Code";
327
392
  readonly name_label: "Label";
@@ -344,6 +409,11 @@ export declare const DICTIONARY_EN: {
344
409
  };
345
410
  readonly field_editor: {
346
411
  readonly dependency_title: "Dependency";
412
+ readonly dependency_empty: "Always visible. Add a relation to show it only when another field meets a condition.";
413
+ readonly and: "and";
414
+ readonly dependency_empty_read_only: "Always visible.";
415
+ readonly edit_rule: "Edit relation";
416
+ readonly configured_count: "{{count}} configured propert(ies)";
347
417
  readonly dependency_description: "This field is shown only if all rules are met:";
348
418
  readonly add_relation: "Add relation";
349
419
  readonly remove_relation: "Remove relation";
@@ -387,6 +457,8 @@ export declare const DICTIONARY_EN: {
387
457
  readonly repeater: {
388
458
  readonly no_subfields: "No sub-fields yet. Add one below.";
389
459
  readonly add_subfield: "Add sub-field";
460
+ readonly show_subfields: "Show sub-fields";
461
+ readonly hide_subfields: "Hide sub-fields";
390
462
  };
391
463
  readonly schema: {
392
464
  readonly title_font_size: "Title size";
@@ -190,6 +190,68 @@ export declare const DICTIONARY_ES: {
190
190
  readonly submit_form: "Guardar";
191
191
  readonly select_field_to_edit: "Selecciona un campo para editar sus propiedades";
192
192
  readonly no_fields: "Añade campos a tu formulario";
193
+ readonly no_fields_drop: "Agrega un campo o arrastra uno desde otro bloque";
194
+ readonly copy_label: "{{label}} (copia)";
195
+ readonly block: {
196
+ readonly drag: "Arrastra para reordenar el bloque";
197
+ readonly collapse: "Contraer bloque";
198
+ readonly expand: "Expandir bloque";
199
+ readonly field_count: "{{count}} campo(s)";
200
+ readonly empty_read_only: "Este bloque no tiene campos";
201
+ };
202
+ readonly properties: {
203
+ readonly title: "Propiedades";
204
+ readonly resize: "Arrastra para cambiar el ancho (doble clic para restablecer)";
205
+ readonly back_to_repeater: "Volver al repetidor";
206
+ readonly close: "Cerrar propiedades (Esc)";
207
+ };
208
+ readonly untitled_block: "Bloque {{index}}";
209
+ readonly unsaved_changes: "Cambios sin guardar";
210
+ readonly read_only: "Solo lectura";
211
+ readonly edit: "Editar";
212
+ readonly no_blocks: "Este formulario aún no tiene bloques";
213
+ readonly select_field_to_view: "Selecciona un campo para ver sus propiedades";
214
+ readonly menu: {
215
+ readonly more: "Más opciones";
216
+ readonly copy_json: "Copiar JSON";
217
+ readonly copied: "JSON copiado";
218
+ readonly load_json: "Cargar JSON";
219
+ readonly layout_title: "Diseño del formulario";
220
+ readonly columns: "Columnas";
221
+ readonly size: "Tamaño";
222
+ readonly margin: "Margen";
223
+ readonly title: "Título";
224
+ readonly subtitle: "Subtítulo";
225
+ readonly layout_hint: "Tamaños y márgenes en píxeles. Vacío usa el valor por defecto.";
226
+ };
227
+ readonly no_changes: "No hay cambios para guardar";
228
+ readonly discard_changes: "Descartar cambios";
229
+ readonly discard_confirm: "Se perderán todos los cambios que no has guardado. ¿Deseas continuar?";
230
+ readonly discard_confirm_title: "Descartar cambios";
231
+ readonly discard_confirm_ok: "Descartar";
232
+ readonly delete_block_confirm: "El bloque \"{{label}}\" contiene {{count}} campo(s), que también se eliminarán.";
233
+ readonly delete_block_confirm_title: "Eliminar bloque";
234
+ readonly delete_block_confirm_ok: "Eliminar bloque";
235
+ readonly visibility_summary: "Visible si {{field}} {{operator}} {{value}}";
236
+ readonly yes: "Sí";
237
+ readonly no: "No";
238
+ readonly undo: {
239
+ readonly field_removed: "Campo \"{{label}}\" eliminado";
240
+ readonly subfield_removed: "Sub-campo \"{{label}}\" eliminado";
241
+ readonly block_removed: "Bloque \"{{label}}\" eliminado";
242
+ readonly action: "Deshacer";
243
+ };
244
+ readonly field_picker: {
245
+ readonly search: "Buscar tipo de campo...";
246
+ readonly empty: "Ningún tipo coincide con la búsqueda";
247
+ readonly groups: {
248
+ readonly text: "Texto";
249
+ readonly choice: "Selección";
250
+ readonly datetime: "Fecha y hora";
251
+ readonly advanced: "Avanzados";
252
+ readonly other: "Otros";
253
+ };
254
+ };
193
255
  readonly base: {
194
256
  readonly name: "Identificador";
195
257
  readonly required: "Obligatorio";
@@ -322,6 +384,9 @@ export declare const DICTIONARY_ES: {
322
384
  readonly externalValidationKey_tip: "Clave del validador externo a ejecutar al salir del campo";
323
385
  };
324
386
  readonly options_editor: {
387
+ readonly remove_option: "Eliminar opción";
388
+ readonly no_options_read_only: "Sin opciones.";
389
+ readonly keyboard_hint: "Enter pasa a la siguiente opción. Puedes pegar una lista (una opción por línea).";
325
390
  readonly title: "Opciones";
326
391
  readonly code_label: "Código";
327
392
  readonly name_label: "Etiqueta";
@@ -344,6 +409,11 @@ export declare const DICTIONARY_ES: {
344
409
  };
345
410
  readonly field_editor: {
346
411
  readonly dependency_title: "Dependencia";
412
+ readonly dependency_empty: "Siempre visible. Agrega una relación para mostrarlo solo cuando otro campo cumpla una condición.";
413
+ readonly and: "y";
414
+ readonly dependency_empty_read_only: "Siempre visible.";
415
+ readonly edit_rule: "Editar relación";
416
+ readonly configured_count: "{{count}} propiedad(es) configurada(s)";
347
417
  readonly dependency_description: "Este campo solo se muestra si se cumplen todas las reglas:";
348
418
  readonly add_relation: "Agregar relación";
349
419
  readonly remove_relation: "Eliminar relación";
@@ -387,6 +457,8 @@ export declare const DICTIONARY_ES: {
387
457
  readonly repeater: {
388
458
  readonly no_subfields: "Sin sub-campos. Añade uno abajo.";
389
459
  readonly add_subfield: "Agregar sub-campo";
460
+ readonly show_subfields: "Mostrar sub-campos";
461
+ readonly hide_subfields: "Ocultar sub-campos";
390
462
  };
391
463
  readonly schema: {
392
464
  readonly title_font_size: "Tamaño título";