ui-core-abv 0.11.3 → 0.11.5
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.
- package/fesm2022/ui-core-abv.mjs +1155 -177
- package/fesm2022/ui-core-abv.mjs.map +1 -1
- package/lib/components/dynamic-form/form/dynamic-form.component.d.ts +14 -0
- package/lib/components/dynamic-form/form-engine.service.d.ts +6 -0
- package/lib/components/dynamic-form/form-validators.d.ts +12 -0
- package/lib/components/dynamic-form/form.models.d.ts +32 -2
- package/lib/components/dynamic-form/other-option.d.ts +34 -0
- package/lib/components/inputs/ui-chips-input/ui-chips-input.component.d.ts +55 -0
- package/lib/components/inputs/ui-distribution/ui-distribution.component.d.ts +62 -0
- package/lib/components/survey/survey.component.d.ts +59 -7
- package/lib/components/survey/survey.config.d.ts +52 -0
- package/lib/components/survey/survey.models.d.ts +6 -1
- package/lib/components/uic-action-button/uic-action-button.component.d.ts +9 -2
- package/lib/components/user-formbuilder/block-editor/field-editor/field-editor.component.d.ts +13 -2
- package/lib/components/user-formbuilder/form-preview/form-preview.component.d.ts +3 -0
- package/lib/components/user-formbuilder/formbuilder.config.d.ts +4 -1
- package/lib/components/user-formbuilder/user-formbuilder.component.d.ts +6 -0
- package/lib/components/user-formbuilder/visibility-rule-pruning.d.ts +34 -0
- package/lib/translate/dictionary.en.d.ts +32 -0
- package/lib/translate/dictionary.es.d.ts +32 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
- package/src/lib/styles/_dark.scss +113 -113
- package/src/lib/styles/_default_colors.scss +228 -228
- package/src/lib/styles/_variables.scss +140 -140
|
@@ -2,6 +2,7 @@ import { NgZone, OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { AbstractControl, FormArray, FormGroup } from '@angular/forms';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { ButtonColor } from '../../button/button.component';
|
|
5
|
+
import { AppSelectOption } from '../../inputs/select/select.component';
|
|
5
6
|
import { FormField, FormIconMode, SelectOptionsResolver } from '../form.models';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
interface DynamicFieldState {
|
|
@@ -50,6 +51,14 @@ export declare class UicDynamicFormComponent implements OnDestroy {
|
|
|
50
51
|
listeningField: string | null;
|
|
51
52
|
readonly fieldStates: import("@angular/core").Signal<DynamicFieldState[]>;
|
|
52
53
|
readonly visibleFieldStates: import("@angular/core").Signal<DynamicFieldState[]>;
|
|
54
|
+
readonly otherTextMaxLength = 500;
|
|
55
|
+
private readonly otherOptionsCache;
|
|
56
|
+
/** Texto "especifica" visible de cada pregunta (por nombre de la pregunta). */
|
|
57
|
+
private readonly visibleOtherStates;
|
|
58
|
+
/** Opciones de la pregunta, con "Otros" al final si la tiene. Cacheado para no recrear el array en cada ciclo. */
|
|
59
|
+
optionsFor(field: FormField): AppSelectOption[];
|
|
60
|
+
/** Estado del texto "especifica" de una pregunta, si está visible (eligió "Otros"). */
|
|
61
|
+
otherStateFor(field: FormField): DynamicFieldState | null;
|
|
53
62
|
private readonly formSyncEffect;
|
|
54
63
|
private readonly fieldStateSyncEffect;
|
|
55
64
|
readonly colorToIcon: Record<string, string>;
|
|
@@ -61,6 +70,11 @@ export declare class UicDynamicFormComponent implements OnDestroy {
|
|
|
61
70
|
onFieldContainerFocusout(field: FormField, event: FocusEvent): void;
|
|
62
71
|
private getValueByFieldName;
|
|
63
72
|
private syncFieldEnabledState;
|
|
73
|
+
/**
|
|
74
|
+
* 'in' / 'notIn': el valor actual (opción única) es alguno de la lista. Comparación flexible como
|
|
75
|
+
* 'equals' (1 y '1' coinciden). Sin respuesta o con la lista vacía no coincide.
|
|
76
|
+
*/
|
|
77
|
+
private isOneOfVisibilityValues;
|
|
64
78
|
private getClearValue;
|
|
65
79
|
private matchesVisibilityRule;
|
|
66
80
|
private findFieldByName;
|
|
@@ -24,6 +24,7 @@ export interface UicOptionsSourceError {
|
|
|
24
24
|
export declare class UicFormEngine implements OnDestroy {
|
|
25
25
|
private readonly fb;
|
|
26
26
|
private readonly formState;
|
|
27
|
+
private readonly i18n;
|
|
27
28
|
schema?: FormSchema;
|
|
28
29
|
fields: FormField[];
|
|
29
30
|
cols: number;
|
|
@@ -161,6 +162,11 @@ export declare class UicFormEngine implements OnDestroy {
|
|
|
161
162
|
private toNestedValues;
|
|
162
163
|
private setNestedValue;
|
|
163
164
|
syncEffectiveSchema(): void;
|
|
165
|
+
/**
|
|
166
|
+
* Agrega el campo de texto de cada pregunta con "Otros" (ver other-option.ts).
|
|
167
|
+
* Sin preguntas con "Otros" devuelve el mismo esquema, sin copiarlo.
|
|
168
|
+
*/
|
|
169
|
+
private expandOtherOptionFields;
|
|
164
170
|
static ɵfac: i0.ɵɵFactoryDeclaration<UicFormEngine, never>;
|
|
165
171
|
static ɵprov: i0.ɵɵInjectableDeclaration<UicFormEngine>;
|
|
166
172
|
}
|
|
@@ -8,3 +8,15 @@ import { FormField } from './form.models';
|
|
|
8
8
|
export declare function uicSelectionCountValidator(min?: number | null, max?: number | null): ValidatorFn;
|
|
9
9
|
/** Validadores de selección que corresponden al campo (vacío si no aplica). */
|
|
10
10
|
export declare function uicSelectionValidatorsFor(field: FormField): ValidatorFn[];
|
|
11
|
+
/** Total que debe sumar una pregunta de distribución porcentual. */
|
|
12
|
+
export declare const UIC_DISTRIBUTION_TOTAL = 100;
|
|
13
|
+
/** Suma de los porcentajes de un valor de distribución (ignora ítems inválidos). */
|
|
14
|
+
export declare function uicDistributionSum(value: unknown): number;
|
|
15
|
+
/**
|
|
16
|
+
* Distribución porcentual: si hay respuesta, debe sumar exactamente 100.
|
|
17
|
+
* Un valor vacío (null o todo en 0) no falla: para exigir respuesta se usa `required`.
|
|
18
|
+
* Error: { distributionTotal: { total, expected } }.
|
|
19
|
+
*/
|
|
20
|
+
export declare function uicDistributionTotalValidator(expected?: number): ValidatorFn;
|
|
21
|
+
/** Validadores de distribución que corresponden al campo (vacío si no aplica). */
|
|
22
|
+
export declare function uicDistributionValidatorsFor(field: FormField): ValidatorFn[];
|
|
@@ -77,6 +77,7 @@ export interface FormField {
|
|
|
77
77
|
tip?: string;
|
|
78
78
|
newLine?: boolean;
|
|
79
79
|
colSpan?: number;
|
|
80
|
+
samePage?: boolean;
|
|
80
81
|
iconColor?: ButtonColor;
|
|
81
82
|
tooltip?: string;
|
|
82
83
|
disabled?: boolean;
|
|
@@ -132,6 +133,13 @@ export interface FormField {
|
|
|
132
133
|
searchIsEnabledFn?: (item: any) => boolean;
|
|
133
134
|
pattern?: RegExp;
|
|
134
135
|
visibilityRules?: FieldVisibilityRule[] | null;
|
|
136
|
+
/**
|
|
137
|
+
* Opción "Otros (especifica)" (radio, select, multyselect): agrega la opción "Otros" y un texto que se
|
|
138
|
+
* guarda en `<name>__other`. El valor de la pregunta no cambia (sigue siendo el id o la lista de ids).
|
|
139
|
+
*/
|
|
140
|
+
otherOption?: UicOtherOptionConfig | null;
|
|
141
|
+
/** Interno: este campo es el texto "especifica" de la opción Otros de la pregunta `otherFor`. */
|
|
142
|
+
otherFor?: string;
|
|
135
143
|
/**
|
|
136
144
|
* Opción A (declarativa/serializable): define la clave y dependencias del campo calculado.
|
|
137
145
|
* El wrapper llama a `computedFieldResolver` cuando algún campo de `dependsOn` cambia.
|
|
@@ -152,13 +160,23 @@ export interface FormField {
|
|
|
152
160
|
repeaterRemoveLabel?: string;
|
|
153
161
|
repeaterItemTitle?: string;
|
|
154
162
|
}
|
|
163
|
+
/** Configuración de la opción "Otros". */
|
|
164
|
+
export interface UicOtherOptionConfig {
|
|
165
|
+
/** Texto de la opción. Por defecto: "Otros". */
|
|
166
|
+
label?: string;
|
|
167
|
+
/** Placeholder del texto. Por defecto: "Especifica...". */
|
|
168
|
+
placeholder?: string;
|
|
169
|
+
/** Si al elegir "Otros" el texto es obligatorio. Por defecto: true. */
|
|
170
|
+
required?: boolean;
|
|
171
|
+
}
|
|
155
172
|
export interface FieldVisibilityRule {
|
|
156
173
|
fieldName: string;
|
|
157
174
|
fieldLabel?: string;
|
|
158
175
|
operator: VisibilityOperators;
|
|
159
176
|
value: any;
|
|
160
177
|
}
|
|
161
|
-
export type VisibilityOperators = 'equals' | 'notEquals' | 'greaterThan' | 'lessThan' | 'includes' | 'notIncludes' | 'isEmpty' | 'isNotEmpty';
|
|
178
|
+
export type VisibilityOperators = 'equals' | 'notEquals' | 'greaterThan' | 'lessThan' | 'includes' | 'notIncludes' | 'isEmpty' | 'isNotEmpty' | 'in' | // value: arreglo de ids; el valor actual es alguno de ellos (selects de opción única)
|
|
179
|
+
'notIn';
|
|
162
180
|
export interface FieldVisibilityConfig {
|
|
163
181
|
outputType: string;
|
|
164
182
|
operators: VisibilityOperators[];
|
|
@@ -175,8 +193,18 @@ export declare const VISIBILITY_OPERATOR_OPTIONS: {
|
|
|
175
193
|
id: VisibilityOperators;
|
|
176
194
|
text: string;
|
|
177
195
|
}[];
|
|
196
|
+
/** Operadores cuyo valor es una lista de valores (FieldVisibilityRule.value es un arreglo). */
|
|
197
|
+
export declare const LIST_VISIBILITY_OPERATORS: VisibilityOperators[];
|
|
178
198
|
export declare const FIELDS_CONFIG: FieldConfig[];
|
|
179
|
-
export type FieldType = 'text' | 'number' | 'phone' | 'date' | 'time' | 'select' | 'radio' | 'checkbox' | 'switch' | 'textarea' | 'pool' | 'file' | 'multyselect' | 'searcher' | 'multisearcher' | 'slider' | 'repeater' | 'computed' | 'scale';
|
|
199
|
+
export type FieldType = 'text' | 'number' | 'phone' | 'date' | 'time' | 'select' | 'radio' | 'checkbox' | 'switch' | 'textarea' | 'pool' | 'file' | 'multyselect' | 'searcher' | 'multisearcher' | 'slider' | 'repeater' | 'computed' | 'scale' | 'distribution' | 'chips';
|
|
200
|
+
/**
|
|
201
|
+
* Valor de una pregunta de distribución porcentual: un ítem por opción, en el orden de las opciones,
|
|
202
|
+
* con el porcentaje asignado (enteros 0–100 que suman 100). Sin respuesta, el valor es null.
|
|
203
|
+
*/
|
|
204
|
+
export type UicDistributionValue = {
|
|
205
|
+
id: string | number;
|
|
206
|
+
value: number;
|
|
207
|
+
}[];
|
|
180
208
|
export interface FormResult {
|
|
181
209
|
result: boolean;
|
|
182
210
|
form: uicFormValuesRecord | null;
|
|
@@ -186,5 +214,7 @@ export declare const EXTERNAL_VALIDATION_FORM_FIELDS: FormField[];
|
|
|
186
214
|
export declare const COMPUTED_FORM_FIELDS: FormField[];
|
|
187
215
|
export declare const BASE_FORM_FIELDS: FormField[];
|
|
188
216
|
export declare const LAYOUT_FORM_FIELDS: FormField[];
|
|
217
|
+
/** Propiedades que solo aplican cuando el formulario se muestra como encuesta (ui-survey). */
|
|
218
|
+
export declare const SURVEY_FORM_FIELDS: FormField[];
|
|
189
219
|
export declare const EXTRA_FORM_FIELDS: FormField[];
|
|
190
220
|
export declare const BRANCH_FORM_FIELDS: FormField[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AppSelectOption } from '../inputs/select/select.component';
|
|
2
|
+
import { FieldType, FormField } from './form.models';
|
|
3
|
+
/**
|
|
4
|
+
* Opción "Otros (especifica)".
|
|
5
|
+
*
|
|
6
|
+
* Una pregunta con `otherOption` suma la opción "Otros" (id UIC_OTHER_OPTION_ID) y un texto
|
|
7
|
+
* acompañante que se guarda en `<name>__other`. El valor de la pregunta no cambia (sigue siendo
|
|
8
|
+
* el id elegido, o la lista de ids), así que reglas, reportes y consumidores existentes no se afectan.
|
|
9
|
+
*
|
|
10
|
+
* El texto es un campo más del formulario, generado a partir del esquema: se muestra solo cuando
|
|
11
|
+
* se elige "Otros" (regla de visibilidad automática), se limpia al dejar de elegirlo y se valida,
|
|
12
|
+
* guarda y reanuda como cualquier otro campo.
|
|
13
|
+
*/
|
|
14
|
+
export declare const UIC_OTHER_OPTION_ID = "__other__";
|
|
15
|
+
export declare const UIC_OTHER_FIELD_SUFFIX = "__other";
|
|
16
|
+
/** Tipos que admiten "Otros": su valor es un id o una lista de ids. */
|
|
17
|
+
export declare const UIC_OTHER_OPTION_TYPES: readonly FieldType[];
|
|
18
|
+
export declare const UIC_OTHER_TEXT_MAX_LENGTH = 500;
|
|
19
|
+
/** Nombre del campo que guarda el texto de "Otros" de una pregunta. */
|
|
20
|
+
export declare function uicOtherFieldName(name: string): string;
|
|
21
|
+
export declare function uicSupportsOtherOption(field: Pick<FormField, 'type'>): boolean;
|
|
22
|
+
/** true si la pregunta muestra la opción "Otros". */
|
|
23
|
+
export declare function uicHasOtherOption(field: FormField): boolean;
|
|
24
|
+
/** Opciones de la pregunta con "Otros" al final (si corresponde y no está ya). */
|
|
25
|
+
export declare function uicOptionsWithOther(options: AppSelectOption[] | undefined, field: FormField, label: string): AppSelectOption[];
|
|
26
|
+
/** Campo de texto acompañante de una pregunta con "Otros". */
|
|
27
|
+
export declare function uicBuildOtherField(field: FormField, otherLabel: string, placeholder: string): FormField;
|
|
28
|
+
/** true si algún campo (o sub-campo de repetidor) usa "Otros". */
|
|
29
|
+
export declare function uicContainsOtherOption(fields: FormField[] | undefined): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Inserta, después de cada pregunta con "Otros", su campo de texto acompañante.
|
|
32
|
+
* Si ningún campo usa "Otros" devuelve el mismo array (no copia el esquema).
|
|
33
|
+
*/
|
|
34
|
+
export declare function uicExpandOtherFields(fields: FormField[], otherLabel: string, placeholder: string): FormField[];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ButtonColor } from '../../button/button.component';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
declare const base: abstract new () => {
|
|
4
|
+
value: string[] | null;
|
|
5
|
+
valueChange: import("@angular/core").EventEmitter<string[] | null>;
|
|
6
|
+
onChange: (value: string[] | null) => void;
|
|
7
|
+
onTouched: () => void;
|
|
8
|
+
writeValue(obj: string[] | null): void;
|
|
9
|
+
registerOnChange(fn: any): void;
|
|
10
|
+
registerOnTouched(fn: any): void;
|
|
11
|
+
setDisabledState?(isDisabled: boolean): void;
|
|
12
|
+
notifyChange(value: string[] | null): void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Lista de textos libres como chips (hobbies, etiquetas, palabras clave...).
|
|
16
|
+
* Enter o coma agregan el texto escrito; Retroceso con el campo vacío quita el último; al pegar
|
|
17
|
+
* texto con comas, punto y coma o saltos de línea se agrega un chip por parte. Al salir del campo
|
|
18
|
+
* se agrega lo que quedó escrito.
|
|
19
|
+
* Valor: string[] (sin repetidos, sin distinguir mayúsculas), o null si no hay ninguno.
|
|
20
|
+
*/
|
|
21
|
+
export declare class UicChipsInputComponent extends base {
|
|
22
|
+
icon: string;
|
|
23
|
+
iconColor: ButtonColor;
|
|
24
|
+
label: string;
|
|
25
|
+
error: string;
|
|
26
|
+
tip: string;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
placeholder: string;
|
|
29
|
+
/** Máximo de chips (null = sin límite). Al alcanzarlo se oculta el campo de texto. */
|
|
30
|
+
maxItems: number | null;
|
|
31
|
+
/** Largo máximo de cada chip. */
|
|
32
|
+
maxLength: number | null;
|
|
33
|
+
private textInput?;
|
|
34
|
+
/** Texto que se está escribiendo (aún no es chip). */
|
|
35
|
+
draft: string;
|
|
36
|
+
/** Chip ya existente que se intentó repetir (se resalta un momento). */
|
|
37
|
+
duplicated: string | null;
|
|
38
|
+
private duplicatedTimer;
|
|
39
|
+
get items(): string[];
|
|
40
|
+
get isFull(): boolean;
|
|
41
|
+
focusInput(): void;
|
|
42
|
+
onDraftInput(event: Event): void;
|
|
43
|
+
onKeydown(event: KeyboardEvent): void;
|
|
44
|
+
onPaste(event: ClipboardEvent): void;
|
|
45
|
+
onBlur(): void;
|
|
46
|
+
remove(index: number): void;
|
|
47
|
+
private commitDraft;
|
|
48
|
+
/** Agrega los textos válidos (recortados, sin repetidos y hasta el máximo). Devuelve cuántos agregó. */
|
|
49
|
+
private addMany;
|
|
50
|
+
private setDraft;
|
|
51
|
+
private flagDuplicate;
|
|
52
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UicChipsInputComponent, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UicChipsInputComponent, "ui-chips-input", never, { "icon": { "alias": "icon"; "required": false; }; "iconColor": { "alias": "iconColor"; "required": false; }; "label": { "alias": "label"; "required": false; }; "error": { "alias": "error"; "required": false; }; "tip": { "alias": "tip"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "maxItems": { "alias": "maxItems"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; }, {}, never, never, true, never>;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ButtonColor } from '../../button/button.component';
|
|
2
|
+
import { AppSelectOption } from '../select/select.component';
|
|
3
|
+
import { UicDistributionValue } from '../../dynamic-form/form.models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
declare const base: abstract new () => {
|
|
6
|
+
value: UicDistributionValue | null;
|
|
7
|
+
valueChange: import("@angular/core").EventEmitter<UicDistributionValue | null>;
|
|
8
|
+
onChange: (value: UicDistributionValue | null) => void;
|
|
9
|
+
onTouched: () => void;
|
|
10
|
+
writeValue(obj: UicDistributionValue | null): void;
|
|
11
|
+
registerOnChange(fn: any): void;
|
|
12
|
+
registerOnTouched(fn: any): void;
|
|
13
|
+
setDisabledState?(isDisabled: boolean): void;
|
|
14
|
+
notifyChange(value: UicDistributionValue | null): void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Distribución porcentual: el usuario reparte el 100% entre las opciones.
|
|
18
|
+
* Valor: [{ id, value }] con un ítem por opción (en su orden), o null si no asignó nada.
|
|
19
|
+
* Los porcentajes son enteros entre 0 y 100; la validación de que sumen 100 está en el formulario
|
|
20
|
+
* (uicDistributionTotalValidator), este componente solo muestra el total y cuánto falta o sobra.
|
|
21
|
+
*/
|
|
22
|
+
export declare class UicDistributionComponent extends base {
|
|
23
|
+
private readonly host;
|
|
24
|
+
readonly uid: string;
|
|
25
|
+
readonly expected = 100;
|
|
26
|
+
icon: string;
|
|
27
|
+
iconColor: ButtonColor;
|
|
28
|
+
label: string;
|
|
29
|
+
error: string;
|
|
30
|
+
tip: string;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
options: AppSelectOption[];
|
|
33
|
+
/** Opciones con id utilizable (una opción sin id no se puede guardar en el valor). */
|
|
34
|
+
get validOptions(): (AppSelectOption & {
|
|
35
|
+
id: string | number;
|
|
36
|
+
})[];
|
|
37
|
+
get total(): number;
|
|
38
|
+
/** Lo que falta para llegar a 100 (negativo si se pasó). */
|
|
39
|
+
get remaining(): number;
|
|
40
|
+
amountOf(option: AppSelectOption): number;
|
|
41
|
+
onInput(option: AppSelectOption, event: Event): void;
|
|
42
|
+
/** Máximo al que puede llegar la opción sin pasar de 100 (su valor + lo que falta). */
|
|
43
|
+
capOf(option: AppSelectOption): number;
|
|
44
|
+
/**
|
|
45
|
+
* Slider: el valor se detiene en lo disponible para no pasar de 100. Si ya se pasó (por el
|
|
46
|
+
* input numérico o un valor inicial), solo se puede bajar.
|
|
47
|
+
*/
|
|
48
|
+
onSlide(option: AppSelectOption, event: Event): void;
|
|
49
|
+
/** Asigna a esta opción todo lo que falta para llegar a 100. */
|
|
50
|
+
fillRemaining(option: AppSelectOption): void;
|
|
51
|
+
clear(): void;
|
|
52
|
+
/** Foco dentro del grupo: mientras se reparte, el total ya indica cuánto falta y no se muestra el error. */
|
|
53
|
+
hasFocus: boolean;
|
|
54
|
+
get displayedError(): string;
|
|
55
|
+
onFocusIn(): void;
|
|
56
|
+
onFocusOut(event: FocusEvent): void;
|
|
57
|
+
inputId(index: number): string;
|
|
58
|
+
private setAmount;
|
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UicDistributionComponent, never>;
|
|
60
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UicDistributionComponent, "ui-distribution", never, { "icon": { "alias": "icon"; "required": false; }; "iconColor": { "alias": "iconColor"; "required": false; }; "label": { "alias": "label"; "required": false; }; "error": { "alias": "error"; "required": false; }; "tip": { "alias": "tip"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, true, never>;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -5,6 +5,7 @@ import { UicOptionsSourceError } from '../dynamic-form/form-engine.service';
|
|
|
5
5
|
import { ComputedFieldResolver, ExternalValidatorResolver, FormField, FormResult, FormSchema, SelectOptionsResolver, uicFormValuesRecord } from '../dynamic-form/form.models';
|
|
6
6
|
import { UicSurveyFooterDirective, UicSurveyHeaderDirective } from './survey-templates.directive';
|
|
7
7
|
import { SurveyAnimation, SurveyStartAt, SurveyFieldSaveEvent, SurveyNavigationDirection, SurveyPage, SurveyPageChangeEvent, SurveyPageMode, SurveySaveFn, SurveySaveState, SurveyTheme } from './survey.models';
|
|
8
|
+
import { ResolvedSurveyConfig, UicSurveyConfig } from './survey.config';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* Encuesta paginada sobre un FormSchema: una pregunta o un bloque por pantalla, con progreso,
|
|
@@ -18,6 +19,7 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
|
|
|
18
19
|
private readonly engine;
|
|
19
20
|
private readonly host;
|
|
20
21
|
private readonly cdr;
|
|
22
|
+
private readonly injector;
|
|
21
23
|
set schema(value: FormSchema);
|
|
22
24
|
get schema(): FormSchema;
|
|
23
25
|
set initialValues(value: uicFormValuesRecord);
|
|
@@ -39,8 +41,17 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
|
|
|
39
41
|
* hasta revisarlas; 'slide' y 'fade' siguen disponibles de forma experimental (solo entrada).
|
|
40
42
|
*/
|
|
41
43
|
readonly animation: import("@angular/core").InputSignal<SurveyAnimation>;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Configuración inicial (textos y opciones de navegación). Se combina con la global
|
|
46
|
+
* (provideUicSurveyConfig); los inputs sueltos de abajo tienen prioridad sobre ambas.
|
|
47
|
+
*/
|
|
48
|
+
readonly config: import("@angular/core").InputSignal<UicSurveyConfig | null>;
|
|
49
|
+
/** Sobrescribe config.showProgress. */
|
|
50
|
+
readonly showProgress: import("@angular/core").InputSignal<boolean | undefined>;
|
|
51
|
+
/** Sobrescribe config.showBack. */
|
|
52
|
+
readonly showBack: import("@angular/core").InputSignal<boolean | undefined>;
|
|
53
|
+
/** Sobrescribe config.showBackOnFirstPage (ver UicSurveyConfig). */
|
|
54
|
+
readonly showBackOnFirstPage: import("@angular/core").InputSignal<boolean | undefined>;
|
|
44
55
|
/**
|
|
45
56
|
* Página en la que empieza (o se reanuda) la encuesta:
|
|
46
57
|
* - 'first-unanswered': la primera página visible con alguna pregunta sin responder.
|
|
@@ -57,14 +68,24 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
|
|
|
57
68
|
readonly autoAdvance: import("@angular/core").InputSignal<boolean>;
|
|
58
69
|
/** Enfoca el primer campo de cada página al navegar. */
|
|
59
70
|
readonly autoFocus: import("@angular/core").InputSignal<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Sobrescribe config.disableNextWhenInvalid: deshabilita "Siguiente"/"Enviar" mientras la página
|
|
73
|
+
* tenga respuestas inválidas (por ejemplo, obligatorias vacías). Enter sigue intentando avanzar y
|
|
74
|
+
* marca los errores.
|
|
75
|
+
*/
|
|
76
|
+
readonly disableNextWhenInvalid: import("@angular/core").InputSignal<boolean | undefined>;
|
|
60
77
|
readonly loading: import("@angular/core").InputSignal<boolean>;
|
|
61
78
|
/** Variables CSS aplicadas al host. Solo claves que empiecen con "--". */
|
|
62
79
|
readonly theme: import("@angular/core").InputSignal<SurveyTheme | null>;
|
|
63
80
|
readonly iconMode: import("@angular/core").InputSignal<"checklist" | undefined>;
|
|
64
81
|
readonly fileUidResolverFn: import("@angular/core").InputSignal<((fileUid: string, fileName: string, fieldLabel: string) => void) | undefined>;
|
|
65
|
-
|
|
66
|
-
readonly
|
|
67
|
-
readonly
|
|
82
|
+
/** Sobrescriben config.texts. */
|
|
83
|
+
readonly nextText: import("@angular/core").InputSignal<string | undefined>;
|
|
84
|
+
readonly backText: import("@angular/core").InputSignal<string | undefined>;
|
|
85
|
+
readonly submitText: import("@angular/core").InputSignal<string | undefined>;
|
|
86
|
+
private readonly globalConfig;
|
|
87
|
+
/** Configuración efectiva: inputs sueltos > config > global > valores por defecto. */
|
|
88
|
+
readonly settings: import("@angular/core").Signal<ResolvedSurveyConfig>;
|
|
68
89
|
/**
|
|
69
90
|
* Emite fieldSave por cada respuesta que cambia: al salir del campo (texto, número, teléfono,
|
|
70
91
|
* repeater) o al cambiar el valor (selecciones, fechas, archivos, slider; con debounce).
|
|
@@ -76,6 +97,8 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
|
|
|
76
97
|
readonly autoSaveDebounceMs: import("@angular/core").InputSignal<number>;
|
|
77
98
|
surveySubmit: EventEmitter<FormResult>;
|
|
78
99
|
pageChange: EventEmitter<SurveyPageChangeEvent>;
|
|
100
|
+
/** "Anterior" en la primera página (con showBackOnFirstPage): el consumidor decide a dónde volver. */
|
|
101
|
+
backFromStart: EventEmitter<void>;
|
|
79
102
|
fieldSave: EventEmitter<SurveyFieldSaveEvent>;
|
|
80
103
|
formChange: EventEmitter<uicFormValuesRecord>;
|
|
81
104
|
optionsSourceError: EventEmitter<UicOptionsSourceError>;
|
|
@@ -99,6 +122,8 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
|
|
|
99
122
|
}>;
|
|
100
123
|
get form(): FormGroup;
|
|
101
124
|
private readonly fieldPageFieldsCache;
|
|
125
|
+
/** Páginas con varias preguntas (samePage), por su primera pregunta. */
|
|
126
|
+
private readonly fieldGroupCache;
|
|
102
127
|
readonly pages: import("@angular/core").Signal<SurveyPage[]>;
|
|
103
128
|
/** En modo 'field', los campos ocultos (hidden) se montan aparte para conservar su estado. */
|
|
104
129
|
readonly hiddenFields: import("@angular/core").Signal<FormField[]>;
|
|
@@ -109,8 +134,16 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
|
|
|
109
134
|
readonly position: import("@angular/core").Signal<number>;
|
|
110
135
|
readonly total: import("@angular/core").Signal<number>;
|
|
111
136
|
readonly progress: import("@angular/core").Signal<number>;
|
|
137
|
+
/** true si "Anterior" hace algo: hay una página previa o, en la primera, showBackOnFirstPage. */
|
|
112
138
|
readonly canGoBack: import("@angular/core").Signal<boolean>;
|
|
113
139
|
readonly isLast: import("@angular/core").Signal<boolean>;
|
|
140
|
+
/**
|
|
141
|
+
* true si las preguntas visibles de la página actual son válidas. Se recalcula con cada cambio
|
|
142
|
+
* de valor: si una respuesta muestra una pregunta obligatoria en la misma página (samePage +
|
|
143
|
+
* visibilityRules), vuelve a false hasta que se conteste.
|
|
144
|
+
*/
|
|
145
|
+
readonly canAdvance: import("@angular/core").Signal<boolean>;
|
|
146
|
+
readonly nextDisabled: import("@angular/core").Signal<boolean>;
|
|
114
147
|
private readonly lastSavedValue;
|
|
115
148
|
private readonly saveTimers;
|
|
116
149
|
private pendingSaves;
|
|
@@ -123,6 +156,7 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
|
|
|
123
156
|
ngOnDestroy(): void;
|
|
124
157
|
/** Valida la página actual y avanza a la siguiente visible; en la última, envía. */
|
|
125
158
|
next(): void;
|
|
159
|
+
/** Vuelve a la página anterior visible; en la primera, con showBackOnFirstPage, emite backFromStart. */
|
|
126
160
|
back(): void;
|
|
127
161
|
/** Va a una página por su posición en `pages()` (sin validar la actual). */
|
|
128
162
|
goToPage(index: number): void;
|
|
@@ -142,10 +176,28 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
|
|
|
142
176
|
private applyStartAt;
|
|
143
177
|
private resolveStartPage;
|
|
144
178
|
private findAdjacentPage;
|
|
179
|
+
/** Primera pregunta visible de la página (en una página samePage la primera puede estar oculta por reglas). */
|
|
180
|
+
private firstVisibleQuestion;
|
|
181
|
+
/**
|
|
182
|
+
* Validez de un control para canAdvance. Una pregunta que se acaba de mostrar puede seguir
|
|
183
|
+
* deshabilitada un instante (ui-dynamic-form la habilita en un effect sin emitir eventos), así
|
|
184
|
+
* que en ese caso se evalúan sus validadores directamente.
|
|
185
|
+
*/
|
|
186
|
+
private isPendingInvalid;
|
|
187
|
+
/** Preguntas visibles de la página activa en el último cálculo (para detectar las que aparecen). */
|
|
188
|
+
private revealTracking;
|
|
189
|
+
/** Anima las preguntas que aparecen en la página activa al contestar otra (samePage + visibilityRules). */
|
|
190
|
+
private trackRevealedQuestions;
|
|
191
|
+
private revealQuestions;
|
|
145
192
|
private validatePage;
|
|
146
193
|
private findFirstInvalidPage;
|
|
147
194
|
private focusActivePage;
|
|
148
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Campos de una página en modo 'field': cada pregunta del grupo y, si tiene "Otros", su texto
|
|
197
|
+
* acompañante. Se cachea por pregunta para que el array no cambie de referencia entre cálculos
|
|
198
|
+
* (si cambiara, ui-dynamic-form recrearía los campos).
|
|
199
|
+
*/
|
|
200
|
+
private fieldsForFieldPage;
|
|
149
201
|
private onFormBuilt;
|
|
150
202
|
private scheduleImmediateSaves;
|
|
151
203
|
/** Guarda de inmediato todo lo pendiente (al avanzar y antes de enviar). */
|
|
@@ -160,5 +212,5 @@ export declare class UicSurveyComponent implements OnInit, OnChanges, OnDestroy
|
|
|
160
212
|
private isEmptyValue;
|
|
161
213
|
private stringify;
|
|
162
214
|
static ɵfac: i0.ɵɵFactoryDeclaration<UicSurveyComponent, never>;
|
|
163
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UicSurveyComponent, "ui-survey", never, { "schema": { "alias": "schema"; "required": true; }; "initialValues": { "alias": "initialValues"; "required": false; }; "externalData": { "alias": "externalData"; "required": false; }; "selectOptionsResolver": { "alias": "selectOptionsResolver"; "required": false; }; "computedFieldResolver": { "alias": "computedFieldResolver"; "required": false; }; "externalValidatorResolver": { "alias": "externalValidatorResolver"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "pageMode": { "alias": "pageMode"; "required": false; "isSignal": true; }; "animation": { "alias": "animation"; "required": false; "isSignal": true; }; "showProgress": { "alias": "showProgress"; "required": false; "isSignal": true; }; "showBack": { "alias": "showBack"; "required": false; "isSignal": true; }; "startAt": { "alias": "startAt"; "required": false; "isSignal": true; }; "autoAdvance": { "alias": "autoAdvance"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "iconMode": { "alias": "iconMode"; "required": false; "isSignal": true; }; "fileUidResolverFn": { "alias": "fileUidResolverFn"; "required": false; "isSignal": true; }; "nextText": { "alias": "nextText"; "required": false; "isSignal": true; }; "backText": { "alias": "backText"; "required": false; "isSignal": true; }; "submitText": { "alias": "submitText"; "required": false; "isSignal": true; }; "autoSave": { "alias": "autoSave"; "required": false; "isSignal": true; }; "saveFn": { "alias": "saveFn"; "required": false; "isSignal": true; }; "autoSaveDebounceMs": { "alias": "autoSaveDebounceMs"; "required": false; "isSignal": true; }; }, { "surveySubmit": "surveySubmit"; "pageChange": "pageChange"; "fieldSave": "fieldSave"; "formChange": "formChange"; "optionsSourceError": "optionsSourceError"; }, ["headerTpl", "footerTpl"], never, true, never>;
|
|
215
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UicSurveyComponent, "ui-survey", never, { "schema": { "alias": "schema"; "required": true; }; "initialValues": { "alias": "initialValues"; "required": false; }; "externalData": { "alias": "externalData"; "required": false; }; "selectOptionsResolver": { "alias": "selectOptionsResolver"; "required": false; }; "computedFieldResolver": { "alias": "computedFieldResolver"; "required": false; }; "externalValidatorResolver": { "alias": "externalValidatorResolver"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "pageMode": { "alias": "pageMode"; "required": false; "isSignal": true; }; "animation": { "alias": "animation"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "showProgress": { "alias": "showProgress"; "required": false; "isSignal": true; }; "showBack": { "alias": "showBack"; "required": false; "isSignal": true; }; "showBackOnFirstPage": { "alias": "showBackOnFirstPage"; "required": false; "isSignal": true; }; "startAt": { "alias": "startAt"; "required": false; "isSignal": true; }; "autoAdvance": { "alias": "autoAdvance"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; "disableNextWhenInvalid": { "alias": "disableNextWhenInvalid"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "iconMode": { "alias": "iconMode"; "required": false; "isSignal": true; }; "fileUidResolverFn": { "alias": "fileUidResolverFn"; "required": false; "isSignal": true; }; "nextText": { "alias": "nextText"; "required": false; "isSignal": true; }; "backText": { "alias": "backText"; "required": false; "isSignal": true; }; "submitText": { "alias": "submitText"; "required": false; "isSignal": true; }; "autoSave": { "alias": "autoSave"; "required": false; "isSignal": true; }; "saveFn": { "alias": "saveFn"; "required": false; "isSignal": true; }; "autoSaveDebounceMs": { "alias": "autoSaveDebounceMs"; "required": false; "isSignal": true; }; }, { "surveySubmit": "surveySubmit"; "pageChange": "pageChange"; "backFromStart": "backFromStart"; "fieldSave": "fieldSave"; "formChange": "formChange"; "optionsSourceError": "optionsSourceError"; }, ["headerTpl", "footerTpl"], never, true, never>;
|
|
164
216
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Configuración inicial de ui-survey (serializable a JSON).
|
|
4
|
+
*
|
|
5
|
+
* Orden de prioridad: input suelto del componente (`nextText`, `showBack`, ...) > input `config` >
|
|
6
|
+
* configuración global (provideUicSurveyConfig) > valores por defecto.
|
|
7
|
+
* Los textos pueden ser claves de traducción o texto literal.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* {
|
|
11
|
+
* "texts": { "next": "Continuar", "back": "Volver", "submit": "Terminar" },
|
|
12
|
+
* "showBackOnFirstPage": true
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
export interface UicSurveyConfig {
|
|
16
|
+
texts?: {
|
|
17
|
+
/** Botón para avanzar. Por defecto: 'survey.next'. */
|
|
18
|
+
next?: string;
|
|
19
|
+
/** Botón para volver. Por defecto: 'survey.back'. */
|
|
20
|
+
back?: string;
|
|
21
|
+
/** Botón de la última página. Por defecto: 'survey.submit'. */
|
|
22
|
+
submit?: string;
|
|
23
|
+
};
|
|
24
|
+
/** Barra de progreso. Por defecto: true. */
|
|
25
|
+
showProgress?: boolean;
|
|
26
|
+
/** Botón para volver. Por defecto: true. */
|
|
27
|
+
showBack?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Muestra "Anterior" también en la primera página. Al pulsarlo se emite `backFromStart`, para que
|
|
30
|
+
* el consumidor vuelva a lo que mostró antes (por ejemplo, una página de instrucciones).
|
|
31
|
+
* Por defecto: false.
|
|
32
|
+
*/
|
|
33
|
+
showBackOnFirstPage?: boolean;
|
|
34
|
+
/** Deshabilita "Siguiente"/"Enviar" mientras la página tenga respuestas inválidas. Por defecto: true. */
|
|
35
|
+
disableNextWhenInvalid?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface ResolvedSurveyConfig {
|
|
38
|
+
texts: {
|
|
39
|
+
next: string;
|
|
40
|
+
back: string;
|
|
41
|
+
submit: string;
|
|
42
|
+
};
|
|
43
|
+
showProgress: boolean;
|
|
44
|
+
showBack: boolean;
|
|
45
|
+
showBackOnFirstPage: boolean;
|
|
46
|
+
disableNextWhenInvalid: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Configuración global (p. ej. por cliente). La entrada `config` del componente la sobrescribe por clave. */
|
|
49
|
+
export declare const UIC_SURVEY_CONFIG: InjectionToken<UicSurveyConfig>;
|
|
50
|
+
export declare function provideUicSurveyConfig(config: UicSurveyConfig): Provider;
|
|
51
|
+
/** Combina configuraciones (las últimas ganan, por clave; `texts` se combina por texto). */
|
|
52
|
+
export declare function resolveSurveyConfig(...configs: (UicSurveyConfig | null | undefined)[]): ResolvedSurveyConfig;
|
|
@@ -7,7 +7,10 @@ export type SurveyStartAt = 'first-unanswered' | number | string;
|
|
|
7
7
|
export type SurveyAnimation = 'slide' | 'fade' | 'none';
|
|
8
8
|
export type SurveyNavigationDirection = 'forward' | 'back';
|
|
9
9
|
export interface SurveyPage {
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Identificador estable de la página ('b0', 'f:nombreCampo'). En modo 'field', una página con
|
|
12
|
+
* varias preguntas (samePage) usa el nombre de la primera.
|
|
13
|
+
*/
|
|
11
14
|
key: string;
|
|
12
15
|
/** Posición en la lista completa de páginas (incluye las ocultas por reglas). */
|
|
13
16
|
index: number;
|
|
@@ -52,5 +55,7 @@ export interface SurveyFooterContext {
|
|
|
52
55
|
back: () => void;
|
|
53
56
|
canGoBack: boolean;
|
|
54
57
|
isLast: boolean;
|
|
58
|
+
/** true si las preguntas visibles de la página son válidas (para deshabilitar "Siguiente"). */
|
|
59
|
+
canAdvance: boolean;
|
|
55
60
|
saveState: SurveySaveState;
|
|
56
61
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
2
2
|
import { EventEmitter, TemplateRef } from '@angular/core';
|
|
3
|
-
import { ButtonSize } from '../button/button.component';
|
|
3
|
+
import { ButtonColor, ButtonSize, ButtonType } from '../button/button.component';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class UicActionButtonComponent {
|
|
6
6
|
icon: string;
|
|
7
7
|
options: ActionMenuOption[];
|
|
8
8
|
multiselect: boolean;
|
|
9
9
|
size: ButtonSize;
|
|
10
|
+
/** Texto del disparador. Si se indica, el botón deja de ser solo icono. */
|
|
11
|
+
text: string;
|
|
12
|
+
/** Icono a la derecha del texto (solo se muestra con `text`). */
|
|
13
|
+
rightIcon: string;
|
|
14
|
+
color: ButtonColor;
|
|
15
|
+
type: ButtonType;
|
|
16
|
+
disabled: boolean;
|
|
10
17
|
optionSelected: EventEmitter<ActionMenuOption>;
|
|
11
18
|
optionsApplied: EventEmitter<ActionMenuOption[]>;
|
|
12
19
|
menuTemplate: TemplateRef<any>;
|
|
@@ -27,7 +34,7 @@ export declare class UicActionButtonComponent {
|
|
|
27
34
|
updateAllSelected(): void;
|
|
28
35
|
closeMenu(): void;
|
|
29
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<UicActionButtonComponent, never>;
|
|
30
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UicActionButtonComponent, "ui-action-button", never, { "icon": { "alias": "icon"; "required": false; }; "options": { "alias": "options"; "required": false; }; "multiselect": { "alias": "multiselect"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "optionSelected": "optionSelected"; "optionsApplied": "optionsApplied"; }, never, never, true, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UicActionButtonComponent, "ui-action-button", never, { "icon": { "alias": "icon"; "required": false; }; "options": { "alias": "options"; "required": false; }; "multiselect": { "alias": "multiselect"; "required": false; }; "size": { "alias": "size"; "required": false; }; "text": { "alias": "text"; "required": false; }; "rightIcon": { "alias": "rightIcon"; "required": false; }; "color": { "alias": "color"; "required": false; }; "type": { "alias": "type"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "optionSelected": "optionSelected"; "optionsApplied": "optionsApplied"; }, never, never, true, never>;
|
|
31
38
|
}
|
|
32
39
|
export interface ActionMenuOption {
|
|
33
40
|
id: string;
|
package/lib/components/user-formbuilder/block-editor/field-editor/field-editor.component.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldVisibilityRule, FormField, uicFormValuesRecord } from '../../../dynamic-form/form.models';
|
|
1
|
+
import { FieldVisibilityRule, FormField, UicOtherOptionConfig, 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";
|
|
@@ -33,7 +33,11 @@ export declare class FieldEditorComponent {
|
|
|
33
33
|
visibilityRulesEnabled: import("@angular/core").InputSignal<boolean>;
|
|
34
34
|
/** Sección "Estilo". */
|
|
35
35
|
styleEnabled: import("@angular/core").InputSignal<boolean>;
|
|
36
|
+
/** El formulario se muestra como encuesta con una pregunta por página: agrega "samePage" a la sección de estilo. */
|
|
37
|
+
surveyFieldMode: import("@angular/core").InputSignal<boolean>;
|
|
36
38
|
showDependencySection: import("@angular/core").Signal<boolean>;
|
|
39
|
+
/** Tipos con opciones que no admiten origen externo (el motor solo lo resuelve para selectores, pool y radio). */
|
|
40
|
+
private readonly manualOptionsOnly;
|
|
37
41
|
showOptionsSourceConfig: import("@angular/core").Signal<boolean>;
|
|
38
42
|
showExternalValidation: import("@angular/core").Signal<boolean>;
|
|
39
43
|
options: import("@angular/core").InputSignal<Record<string, AppSelectOption[]>>;
|
|
@@ -65,6 +69,10 @@ export declare class FieldEditorComponent {
|
|
|
65
69
|
updateFieldValues(fr: uicFormValuesRecord): void;
|
|
66
70
|
/** Leyendas de la escala: el código es el valor numérico. */
|
|
67
71
|
updateScaleLabels(labels: AppSelectOption[]): void;
|
|
72
|
+
supportsOtherOption: import("@angular/core").Signal<boolean>;
|
|
73
|
+
toggleOtherOption(enabled: boolean): void;
|
|
74
|
+
updateOtherOption(patch: Partial<UicOtherOptionConfig>): void;
|
|
75
|
+
private patchField;
|
|
68
76
|
updateOptions(options: AppSelectOption[]): void;
|
|
69
77
|
private getDependencyFieldLabel;
|
|
70
78
|
isSectionHidden(section: string): boolean;
|
|
@@ -82,6 +90,9 @@ export declare class FieldEditorComponent {
|
|
|
82
90
|
private prepareOptionsSourceField;
|
|
83
91
|
private buildBranchFields;
|
|
84
92
|
private prepareBranchField;
|
|
93
|
+
private isListVisibilityOperator;
|
|
94
|
+
/** Arreglo de valores sin vacíos ni repetidos; null si queda vacío. */
|
|
95
|
+
private normalizeListValue;
|
|
85
96
|
private getAllowedVisibilityOperators;
|
|
86
97
|
private getDependencyFieldType;
|
|
87
98
|
private getBranchValueFieldType;
|
|
@@ -90,5 +101,5 @@ export declare class FieldEditorComponent {
|
|
|
90
101
|
private buildComputedSourceFields;
|
|
91
102
|
private buildExternalValidationFields;
|
|
92
103
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldEditorComponent, never>;
|
|
93
|
-
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; }; "externalSources": { "alias": "externalSources"; "required": false; "isSignal": true; }; "visibilityRulesEnabled": { "alias": "visibilityRulesEnabled"; "required": false; "isSignal": true; }; "styleEnabled": { "alias": "styleEnabled"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "fieldChange": "fieldChange"; }, never, never, true, never>;
|
|
104
|
+
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; }; "externalSources": { "alias": "externalSources"; "required": false; "isSignal": true; }; "visibilityRulesEnabled": { "alias": "visibilityRulesEnabled"; "required": false; "isSignal": true; }; "styleEnabled": { "alias": "styleEnabled"; "required": false; "isSignal": true; }; "surveyFieldMode": { "alias": "surveyFieldMode"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "fieldChange": "fieldChange"; }, never, never, true, never>;
|
|
94
105
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComputedFieldResolver, ExternalValidatorResolver, FormResult, FormSchema, SelectOptionsResolver } from '../../dynamic-form/form.models';
|
|
2
2
|
import { SurveyAnimation, SurveyPageMode, SurveyTheme } from '../../survey/survey.models';
|
|
3
|
+
import { UicSurveyConfig } from '../../survey/survey.config';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
/** Cómo se muestra la vista previa del builder. */
|
|
5
6
|
export type FormBuilderPreviewMode = 'form' | 'survey';
|
|
@@ -10,6 +11,8 @@ export interface FormBuilderSurveyPreviewOptions {
|
|
|
10
11
|
/** @deprecated Sin efecto: la encuesta ya no avanza sola. */
|
|
11
12
|
autoAdvance?: boolean;
|
|
12
13
|
animation?: SurveyAnimation;
|
|
14
|
+
/** Textos y opciones de navegación (se combina con la configuración global de ui-survey). */
|
|
15
|
+
config?: UicSurveyConfig | null;
|
|
13
16
|
}
|
|
14
17
|
export interface FormPreviewData {
|
|
15
18
|
schema: FormSchema;
|