ui-core-abv 0.11.4 → 0.11.6

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.
Files changed (30) hide show
  1. package/fesm2022/ui-core-abv.mjs +1622 -548
  2. package/fesm2022/ui-core-abv.mjs.map +1 -1
  3. package/lib/components/button/button.component.d.ts +14 -4
  4. package/lib/components/dynamic-form/form/dynamic-form.component.d.ts +5 -0
  5. package/lib/components/dynamic-form/form.models.d.ts +14 -2
  6. package/lib/components/inputs/multy-select/multy-select.component.d.ts +12 -1
  7. package/lib/components/inputs/select/select.component.d.ts +3 -1
  8. package/lib/components/inputs/ui-chips-input/ui-chips-input.component.d.ts +55 -0
  9. package/lib/components/inputs/ui-distribution/ui-distribution.component.d.ts +7 -0
  10. package/lib/components/inputs/ui-scale/ui-scale.component.d.ts +12 -2
  11. package/lib/components/pool-options/pool-options.component.d.ts +6 -2
  12. package/lib/components/rule-builder/condition-value.d.ts +40 -0
  13. package/lib/components/rule-builder/rule-builder.component.d.ts +10 -2
  14. package/lib/components/rule-builder/rule-definirion/rule-definirion.component.d.ts +37 -18
  15. package/lib/components/survey/survey.component.d.ts +59 -8
  16. package/lib/components/survey/survey.config.d.ts +52 -0
  17. package/lib/components/survey/survey.models.d.ts +6 -1
  18. package/lib/components/uic-action-button/uic-action-button.component.d.ts +13 -2
  19. package/lib/components/user-formbuilder/block-editor/block-editor.component.d.ts +8 -1
  20. package/lib/components/user-formbuilder/block-editor/field-editor/field-editor.component.d.ts +6 -1
  21. package/lib/components/user-formbuilder/form-preview/form-preview.component.d.ts +3 -0
  22. package/lib/components/user-formbuilder/formbuilder.config.d.ts +20 -1
  23. package/lib/components/user-formbuilder/user-formbuilder.component.d.ts +6 -0
  24. package/lib/components/user-formbuilder/visibility-rule-pruning.d.ts +34 -0
  25. package/lib/translate/dictionary.en.d.ts +42 -0
  26. package/lib/translate/dictionary.es.d.ts +42 -0
  27. package/lib/utils/search-text.d.ts +12 -0
  28. package/package.json +1 -1
  29. package/public-api.d.ts +4 -0
  30. package/src/lib/styles/_variables.scss +3 -2
@@ -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
- /** Identificador estable de la página ('b0', 'f:nombreCampo'). */
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,23 @@
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;
17
+ /** Nombre accesible del disparador. Sin `text` ni `ariaLabel` se usa «Más acciones». */
18
+ ariaLabel: string;
19
+ /** Tooltip opcional del disparador. */
20
+ tooltip: string;
10
21
  optionSelected: EventEmitter<ActionMenuOption>;
11
22
  optionsApplied: EventEmitter<ActionMenuOption[]>;
12
23
  menuTemplate: TemplateRef<any>;
@@ -27,7 +38,7 @@ export declare class UicActionButtonComponent {
27
38
  updateAllSelected(): void;
28
39
  closeMenu(): void;
29
40
  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>;
41
+ 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; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; }, { "optionSelected": "optionSelected"; "optionsApplied": "optionsApplied"; }, never, never, true, never>;
31
42
  }
32
43
  export interface ActionMenuOption {
33
44
  id: string;
@@ -55,6 +55,13 @@ export declare class BlockEditorComponent {
55
55
  maxRepeaterFields: import("@angular/core").InputSignal<number | null>;
56
56
  fieldLimitMessage: import("@angular/core").Signal<string>;
57
57
  repeaterLimitMessage: import("@angular/core").Signal<string>;
58
+ /** Accesos rápidos (config `quickAddTypes` / `quickAddSubFieldTypes`), ya filtrados por tipos disponibles. */
59
+ quickAddTypes: import("@angular/core").InputSignal<FieldType[]>;
60
+ quickAddSubFieldTypes: import("@angular/core").InputSignal<FieldType[]>;
61
+ quickAddConfigs: import("@angular/core").Signal<FieldConfig[]>;
62
+ quickAddSubFieldConfigs: import("@angular/core").Signal<FieldConfig[]>;
63
+ private toFieldConfigs;
64
+ quickAddLabel(config: FieldConfig): string;
58
65
  isRepeaterFull(field: EditableField): boolean;
59
66
  fieldListId: import("@angular/core").Signal<string>;
60
67
  /** Estado solo visual: plegar el bloque no altera el formulario. */
@@ -95,5 +102,5 @@ export declare class BlockEditorComponent {
95
102
  /** cdkDropListData es el code del bloque: así se identifica el origen al soltar desde otro bloque. */
96
103
  reorderFields(event: CdkDragDrop<string>): void;
97
104
  static ɵfac: i0.ɵɵFactoryDeclaration<BlockEditorComponent, never>;
98
- 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; }; "availableFieldTypes": { "alias": "availableFieldTypes"; "required": false; "isSignal": true; }; "canDelete": { "alias": "canDelete"; "required": false; "isSignal": true; }; "fieldLimitReached": { "alias": "fieldLimitReached"; "required": false; "isSignal": true; }; "maxFields": { "alias": "maxFields"; "required": false; "isSignal": true; }; "maxRepeaterFields": { "alias": "maxRepeaterFields"; "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>;
105
+ 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; }; "availableFieldTypes": { "alias": "availableFieldTypes"; "required": false; "isSignal": true; }; "canDelete": { "alias": "canDelete"; "required": false; "isSignal": true; }; "fieldLimitReached": { "alias": "fieldLimitReached"; "required": false; "isSignal": true; }; "maxFields": { "alias": "maxFields"; "required": false; "isSignal": true; }; "maxRepeaterFields": { "alias": "maxRepeaterFields"; "required": false; "isSignal": true; }; "quickAddTypes": { "alias": "quickAddTypes"; "required": false; "isSignal": true; }; "quickAddSubFieldTypes": { "alias": "quickAddSubFieldTypes"; "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>;
99
106
  }
@@ -33,6 +33,8 @@ 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>;
37
39
  /** Tipos con opciones que no admiten origen externo (el motor solo lo resuelve para selectores, pool y radio). */
38
40
  private readonly manualOptionsOnly;
@@ -88,6 +90,9 @@ export declare class FieldEditorComponent {
88
90
  private prepareOptionsSourceField;
89
91
  private buildBranchFields;
90
92
  private prepareBranchField;
93
+ private isListVisibilityOperator;
94
+ /** Arreglo de valores sin vacíos ni repetidos; null si queda vacío. */
95
+ private normalizeListValue;
91
96
  private getAllowedVisibilityOperators;
92
97
  private getDependencyFieldType;
93
98
  private getBranchValueFieldType;
@@ -96,5 +101,5 @@ export declare class FieldEditorComponent {
96
101
  private buildComputedSourceFields;
97
102
  private buildExternalValidationFields;
98
103
  static ɵfac: i0.ɵɵFactoryDeclaration<FieldEditorComponent, never>;
99
- 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>;
100
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;
@@ -19,7 +19,7 @@ import type { FormBuilderPreviewMode, FormBuilderSurveyPreviewOptions } from './
19
19
  * "visibilityRules": false,
20
20
  * "styleSection": false,
21
21
  * "limits": { "maxBlocks": 3, "maxFields": 20, "maxRepeaterFields": 5 },
22
- * "preview": { "mode": "survey", "survey": { "pageMode": "field" } }
22
+ * "preview": { "showButton": true, "mode": "survey", "survey": { "pageMode": "field" } }
23
23
  * }
24
24
  */
25
25
  export interface UicFormBuilderConfig {
@@ -57,6 +57,18 @@ export interface UicFormBuilderConfig {
57
57
  visibilityRules?: boolean;
58
58
  /** Sección "Estilo" (íconos, colores, sugerencia, ancho, salto de línea). Por defecto: true. */
59
59
  styleSection?: boolean;
60
+ /**
61
+ * "Diseño del formulario" en el menú ⋯ (columnas, tamaños y márgenes de títulos). Con `false` se oculta;
62
+ * los valores que ya traiga el esquema se conservan. Útil cuando el aspecto lo define el tema. Por defecto: true.
63
+ */
64
+ formStyle?: boolean;
65
+ /**
66
+ * Accesos rápidos: un botón de ícono por tipo junto a "Agregar campo", que agrega ese campo sin abrir
67
+ * el selector. Respeta `fieldTypes` / `excludeFieldTypes` y los máximos. Por defecto: ninguno.
68
+ */
69
+ quickAddTypes?: FieldType[];
70
+ /** Igual que `quickAddTypes`, para "Agregar sub-campo" del repetidor (el repetidor no se anida). Por defecto: ninguno. */
71
+ quickAddSubFieldTypes?: FieldType[];
60
72
  /**
61
73
  * Máximos (enteros positivos; omitido = sin límite). Al alcanzarlos se deshabilita "Agregar"/"Duplicar"
62
74
  * y no se puede cargar un JSON que los supere. Un formulario existente que ya los supere se respeta.
@@ -74,6 +86,8 @@ export interface UicFormBuilderConfig {
74
86
  * (útiles si el modo debe cambiar en tiempo de ejecución, porque la config se lee una sola vez).
75
87
  */
76
88
  preview?: {
89
+ /** Muestra el botón "Vista previa" en la cabecera. Por defecto: true. */
90
+ showButton?: boolean;
77
91
  mode?: FormBuilderPreviewMode;
78
92
  survey?: FormBuilderSurveyPreviewOptions;
79
93
  };
@@ -96,9 +110,14 @@ export interface ResolvedFormBuilderConfig {
96
110
  allowNameEdit: boolean | null;
97
111
  visibilityRules: boolean;
98
112
  styleSection: boolean;
113
+ formStyle: boolean;
114
+ /** Accesos rápidos ya filtrados por los tipos disponibles (sin repetidos, en el orden pedido). */
115
+ quickAddTypes: FieldType[];
116
+ quickAddSubFieldTypes: FieldType[];
99
117
  limits: FormBuilderLimits;
100
118
  /** null = no definido en la config (se usan las entradas `previewMode` / `surveyPreviewOptions`). */
101
119
  preview: {
120
+ showButton: boolean;
102
121
  mode: FormBuilderPreviewMode | null;
103
122
  survey: FormBuilderSurveyPreviewOptions | null;
104
123
  };
@@ -60,6 +60,7 @@ export declare class UicUserFormbuilderComponent implements OnInit {
60
60
  private readonly modalService;
61
61
  private readonly host;
62
62
  private readonly tinyAlertService;
63
+ private readonly pushAlertService;
63
64
  private readonly translateService;
64
65
  disabled: boolean;
65
66
  /**
@@ -84,6 +85,8 @@ export declare class UicUserFormbuilderComponent implements OnInit {
84
85
  previewMode: import("@angular/core").InputSignal<FormBuilderPreviewMode>;
85
86
  /** Ajustes de la vista previa en modo encuesta. `config.preview.survey` tiene prioridad (ver previewMode). */
86
87
  surveyPreviewOptions: import("@angular/core").InputSignal<FormBuilderSurveyPreviewOptions | null>;
88
+ /** Vista previa como encuesta de una pregunta por página: habilita "samePage" en los campos. */
89
+ readonly surveyFieldMode: import("@angular/core").Signal<boolean>;
87
90
  editableFormInput: import("@angular/core").InputSignal<EditableForm>;
88
91
  submitFormRequest: import("@angular/core").OutputEmitterRef<EditableForm>;
89
92
  nextBlockId: number;
@@ -173,6 +176,9 @@ export declare class UicUserFormbuilderComponent implements OnInit {
173
176
  */
174
177
  private fingerprint;
175
178
  onSubFieldChange(updatedFieldData: FormField): void;
179
+ /** Tras limpiar reglas, la selección apunta a los objetos actualizados (mismo code). */
180
+ private syncSelectionAfterPruning;
181
+ private warnPrunedRules;
176
182
  startPropertiesResize(event: MouseEvent): void;
177
183
  onPropertiesResize(event: MouseEvent): void;
178
184
  stopPropertiesResize(): void;
@@ -0,0 +1,34 @@
1
+ import { FormField } from '../dynamic-form/form.models';
2
+ import { AppSelectOption } from '../inputs/select/select.component';
3
+ import type { EditableBlock } from './user-formbuilder.component';
4
+ /**
5
+ * Opciones manuales de un campo del que se puede depender: el editor de reglas las usa para
6
+ * mostrar un selector de valor (y su texto) en vez de pedir el id a mano. Con origen externo no hay lista fija.
7
+ */
8
+ export declare const dependencyValueOptions: (fieldData: FormField) => AppSelectOption[] | undefined;
9
+ /** Ids de opciones que tenía `before` y ya no tiene `after`. Vacío si `after` no tiene opciones manuales. */
10
+ export declare function removedOptionIds(before: FormField, after: FormField): Set<string>;
11
+ /** Qué campo cambió: uno raíz (por code) o un subcampo de un repetidor (code del padre + code del subcampo). */
12
+ export type PrunedFieldRef = {
13
+ kind: 'field';
14
+ code: string;
15
+ } | {
16
+ kind: 'subfield';
17
+ parentCode: string;
18
+ code: string;
19
+ };
20
+ export interface RulePruningResult {
21
+ blocks: EditableBlock[];
22
+ /** Reglas modificadas o eliminadas. */
23
+ changed: number;
24
+ }
25
+ /**
26
+ * Quita de las reglas de visibilidad las referencias a opciones eliminadas de un campo.
27
+ * - in / notIn: se quitan los ids eliminados del arreglo; si queda vacío, se elimina la regla.
28
+ * - equals / notEquals (e includes / notIncludes si el campo es multyselect): se elimina la regla
29
+ * si su valor era una opción eliminada.
30
+ * Alcance: un campo raíz puede ser referenciado por campos raíz y subcampos; un subcampo, solo por
31
+ * sus hermanos del mismo repetidor (los codes de subcampo se repiten entre repetidores).
32
+ * Devuelve los mismos objetos para lo que no cambió.
33
+ */
34
+ export declare function pruneRulesForRemovedOptions(blocks: EditableBlock[], ref: PrunedFieldRef, removedIds: Set<string>, changedFieldType: string | undefined): RulePruningResult;
@@ -17,6 +17,7 @@ export declare const DICTIONARY_EN: {
17
17
  readonly select: "Select";
18
18
  readonly selected: "Selected";
19
19
  readonly detail: "Detail";
20
+ readonly more_actions: "More actions";
20
21
  };
21
22
  readonly table: {
22
23
  readonly search_label: "Search";
@@ -119,8 +120,24 @@ export declare const DICTIONARY_EN: {
119
120
  readonly field: "Field";
120
121
  readonly operator: "Operator";
121
122
  readonly value: "Value";
123
+ readonly amount: "Amount";
124
+ readonly unit: "Unit";
122
125
  };
123
126
  };
127
+ readonly relative_date: {
128
+ readonly unit_days: "Days";
129
+ readonly unit_weeks: "Weeks";
130
+ readonly unit_months: "Months";
131
+ readonly unit_years: "Years";
132
+ readonly days_one: "{{count}} day";
133
+ readonly days_other: "{{count}} days";
134
+ readonly weeks_one: "{{count}} week";
135
+ readonly weeks_other: "{{count}} weeks";
136
+ readonly months_one: "{{count}} month";
137
+ readonly months_other: "{{count}} months";
138
+ readonly years_one: "{{count}} year";
139
+ readonly years_other: "{{count}} years";
140
+ };
124
141
  };
125
142
  readonly step_form: {
126
143
  readonly back: "Back";
@@ -235,6 +252,8 @@ export declare const DICTIONARY_EN: {
235
252
  readonly visibility_summary: "Visible if {{field}} {{operator}} {{value}}";
236
253
  readonly yes: "Yes";
237
254
  readonly no: "No";
255
+ readonly quick_add: "Add {{type}}";
256
+ readonly quick_add_group: "Quick add";
238
257
  readonly other_option: {
239
258
  readonly enable: "Include an \"Other\" (please specify) option";
240
259
  readonly enable_tip: "Adds an Other option with a text to specify. The text is saved as <identifier>__other.";
@@ -279,6 +298,8 @@ export declare const DICTIONARY_EN: {
279
298
  readonly new_line: "New line";
280
299
  readonly col_span: "Column span";
281
300
  readonly col_span_tip: "How many columns the field occupies";
301
+ readonly same_page: "Same page as the previous one";
302
+ readonly same_page_tip: "Only in one-question-per-page surveys";
282
303
  };
283
304
  readonly extra: {
284
305
  readonly iconColor: "Icon color";
@@ -349,6 +370,18 @@ export declare const DICTIONARY_EN: {
349
370
  readonly scaleMax: "End value";
350
371
  readonly scaleMax_tip: "Default 5 (up to 20 points)";
351
372
  readonly poolDisplayMode_tip: "How options are arranged";
373
+ readonly poolIconPosition: "Icon position";
374
+ readonly poolIconPosition_tip: "Where each option icon goes";
375
+ readonly poolIconPosition_start: "Start";
376
+ readonly poolIconPosition_start_detail: "Left of the text";
377
+ readonly poolIconPosition_top: "Top";
378
+ readonly poolIconPosition_top_detail: "Above the text, card style";
379
+ readonly poolIconSize: "Icon size";
380
+ readonly poolIconSize_tip: "Size of each option icon";
381
+ readonly poolIconSize_s: "Small";
382
+ readonly poolIconSize_m: "Medium";
383
+ readonly poolIconSize_l: "Large";
384
+ readonly poolIconSize_xl: "Extra large";
352
385
  readonly poolGridColumns: "Columns";
353
386
  readonly poolGridColumns_tip: "Options per row in grid mode (1 to 6)";
354
387
  readonly poolTitle: "List title";
@@ -440,6 +473,7 @@ export declare const DICTIONARY_EN: {
440
473
  readonly operator: "Operator";
441
474
  readonly value: "Value";
442
475
  readonly expected_value: "Expected value";
476
+ readonly values: "Values";
443
477
  readonly style: "Style";
444
478
  readonly advanced: "Advanced";
445
479
  readonly duplicate: "Duplicate";
@@ -449,6 +483,7 @@ export declare const DICTIONARY_EN: {
449
483
  readonly subfields: "Sub-fields";
450
484
  readonly external_validation_title: "External validation";
451
485
  };
486
+ readonly rules_pruned: "{{count}} dependency rules were updated because they used removed options.";
452
487
  readonly visibility_operators: {
453
488
  readonly equals: "Equals";
454
489
  readonly notEquals: "Does not equal";
@@ -458,6 +493,8 @@ export declare const DICTIONARY_EN: {
458
493
  readonly notIncludes: "Does not include";
459
494
  readonly isEmpty: "Is empty";
460
495
  readonly isNotEmpty: "Is not empty";
496
+ readonly in: "Is any of";
497
+ readonly notIn: "Is none of";
461
498
  };
462
499
  readonly validation: {
463
500
  readonly duplicate_identifier: "The identifier \"{{identifier}}\" is used more than once.";
@@ -487,6 +524,11 @@ export declare const DICTIONARY_EN: {
487
524
  readonly label: "Other";
488
525
  readonly placeholder: "Please specify...";
489
526
  };
527
+ readonly chips_input: {
528
+ readonly placeholder: "Type and press Enter";
529
+ readonly remove: "Remove {{item}}";
530
+ readonly max_reached: "Maximum {{max}}";
531
+ };
490
532
  readonly distribution: {
491
533
  readonly total: "Total";
492
534
  readonly complete: "Complete";
@@ -17,6 +17,7 @@ export declare const DICTIONARY_ES: {
17
17
  readonly select: "Seleccionar";
18
18
  readonly selected: "Seleccionados";
19
19
  readonly detail: "Detalle";
20
+ readonly more_actions: "Más acciones";
20
21
  };
21
22
  readonly table: {
22
23
  readonly search_label: "Buscar";
@@ -119,8 +120,24 @@ export declare const DICTIONARY_ES: {
119
120
  readonly field: "Campo";
120
121
  readonly operator: "Operador";
121
122
  readonly value: "Valor";
123
+ readonly amount: "Cantidad";
124
+ readonly unit: "Unidad";
122
125
  };
123
126
  };
127
+ readonly relative_date: {
128
+ readonly unit_days: "Días";
129
+ readonly unit_weeks: "Semanas";
130
+ readonly unit_months: "Meses";
131
+ readonly unit_years: "Años";
132
+ readonly days_one: "{{count}} día";
133
+ readonly days_other: "{{count}} días";
134
+ readonly weeks_one: "{{count}} semana";
135
+ readonly weeks_other: "{{count}} semanas";
136
+ readonly months_one: "{{count}} mes";
137
+ readonly months_other: "{{count}} meses";
138
+ readonly years_one: "{{count}} año";
139
+ readonly years_other: "{{count}} años";
140
+ };
124
141
  };
125
142
  readonly step_form: {
126
143
  readonly back: "Volver";
@@ -235,6 +252,8 @@ export declare const DICTIONARY_ES: {
235
252
  readonly visibility_summary: "Visible si {{field}} {{operator}} {{value}}";
236
253
  readonly yes: "Sí";
237
254
  readonly no: "No";
255
+ readonly quick_add: "Agregar {{type}}";
256
+ readonly quick_add_group: "Agregar rápido";
238
257
  readonly other_option: {
239
258
  readonly enable: "Incluir opción «Otros» (especifica)";
240
259
  readonly enable_tip: "Agrega la opción Otros con un texto para especificar. El texto se guarda en <identificador>__other.";
@@ -279,6 +298,8 @@ export declare const DICTIONARY_ES: {
279
298
  readonly new_line: "Saltar línea";
280
299
  readonly col_span: "Ancho";
281
300
  readonly col_span_tip: "Cuantas columnas ocupa el campo";
301
+ readonly same_page: "Misma página que la anterior";
302
+ readonly same_page_tip: "Solo en encuestas de una pregunta por página";
282
303
  };
283
304
  readonly extra: {
284
305
  readonly iconColor: "Color de ícono externo";
@@ -349,6 +370,18 @@ export declare const DICTIONARY_ES: {
349
370
  readonly scaleMax: "Valor final";
350
371
  readonly scaleMax_tip: "Por defecto 5 (máximo 20 puntos)";
351
372
  readonly poolDisplayMode_tip: "Cómo se ordenan las opciones";
373
+ readonly poolIconPosition: "Posición del ícono";
374
+ readonly poolIconPosition_tip: "Dónde va el ícono de cada opción";
375
+ readonly poolIconPosition_start: "Al inicio";
376
+ readonly poolIconPosition_start_detail: "A la izquierda del texto";
377
+ readonly poolIconPosition_top: "Arriba";
378
+ readonly poolIconPosition_top_detail: "Encima del texto, tipo tarjeta";
379
+ readonly poolIconSize: "Tamaño del ícono";
380
+ readonly poolIconSize_tip: "Tamaño del ícono de cada opción";
381
+ readonly poolIconSize_s: "Pequeño";
382
+ readonly poolIconSize_m: "Mediano";
383
+ readonly poolIconSize_l: "Grande";
384
+ readonly poolIconSize_xl: "Muy grande";
352
385
  readonly poolGridColumns: "Columnas";
353
386
  readonly poolGridColumns_tip: "Opciones por fila en modo grid (1 a 6)";
354
387
  readonly poolTitle: "Título del listado";
@@ -440,6 +473,7 @@ export declare const DICTIONARY_ES: {
440
473
  readonly operator: "Operador";
441
474
  readonly value: "Valor";
442
475
  readonly expected_value: "Valor esperado";
476
+ readonly values: "Valores";
443
477
  readonly style: "Estilo";
444
478
  readonly advanced: "Avanzado";
445
479
  readonly duplicate: "Duplicar";
@@ -449,6 +483,7 @@ export declare const DICTIONARY_ES: {
449
483
  readonly subfields: "Sub-campos";
450
484
  readonly external_validation_title: "Validación externa";
451
485
  };
486
+ readonly rules_pruned: "Se actualizaron {{count}} reglas de dependencia porque usaban opciones eliminadas.";
452
487
  readonly visibility_operators: {
453
488
  readonly equals: "Es igual a";
454
489
  readonly notEquals: "No es igual a";
@@ -458,6 +493,8 @@ export declare const DICTIONARY_ES: {
458
493
  readonly notIncludes: "No incluye";
459
494
  readonly isEmpty: "Está vacío";
460
495
  readonly isNotEmpty: "No está vacío";
496
+ readonly in: "Es alguno de";
497
+ readonly notIn: "No es ninguno de";
461
498
  };
462
499
  readonly validation: {
463
500
  readonly duplicate_identifier: "El identificador \"{{identifier}}\" se está usando más de una vez.";
@@ -487,6 +524,11 @@ export declare const DICTIONARY_ES: {
487
524
  readonly label: "Otros";
488
525
  readonly placeholder: "Especifica...";
489
526
  };
527
+ readonly chips_input: {
528
+ readonly placeholder: "Escribe y presiona Enter";
529
+ readonly remove: "Quitar {{item}}";
530
+ readonly max_reached: "Máximo {{max}}";
531
+ };
490
532
  readonly distribution: {
491
533
  readonly total: "Total";
492
534
  readonly complete: "Completo";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Búsqueda de texto sin distinguir mayúsculas ni tildes («ge» encuentra «Género», «n» encuentra «ñ»).
3
+ * Compartida por los buscadores de la librería (select, teléfono, tags, árbol, builder...).
4
+ */
5
+ /** Texto normalizado para comparar: sin tildes ni diéresis, en minúsculas y sin espacios en los extremos. */
6
+ export declare function uicNormalizeSearch(value: string | null | undefined): string;
7
+ /** true si `text` contiene `query` (ambos normalizados). Una búsqueda vacía coincide siempre. */
8
+ export declare function uicSearchMatches(text: string | null | undefined, query: string | null | undefined): boolean;
9
+ /** Rangos [inicio, fin) del texto ORIGINAL donde aparece la búsqueda (sin distinguir tildes). */
10
+ export declare function uicFindMatchRanges(text: string, query: string): [number, number][];
11
+ /** HTML escapado del texto original con cada coincidencia envuelta en <mark>. */
12
+ export declare function uicHighlightMatchHtml(text: string | null | undefined, query: string | null | undefined): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-core-abv",
3
- "version": "0.11.4",
3
+ "version": "0.11.6",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=19.2.0 <22.0.0",
6
6
  "@angular/core": ">=19.2.0 <22.0.0",
package/public-api.d.ts CHANGED
@@ -25,6 +25,7 @@ export * from './lib/components/push-alerts/alert-container/alert-container.comp
25
25
  export * from './lib/components/inputs/ui-slider/ui-slider.component';
26
26
  export * from './lib/components/inputs/ui-scale/ui-scale.component';
27
27
  export * from './lib/components/inputs/ui-distribution/ui-distribution.component';
28
+ export * from './lib/components/inputs/ui-chips-input/ui-chips-input.component';
28
29
  export * from './lib/components/uic-action-button/uic-action-button.component';
29
30
  export * from './lib/components/signature-pad/signature-pad.component';
30
31
  export * from './lib/components/dropdown-container/dropdown-container.component';
@@ -47,6 +48,7 @@ export * from './lib/components/dynamic-form/repeater/repeater.component';
47
48
  export * from './lib/components/user-formbuilder/user-formbuilder.component';
48
49
  export * from './lib/components/user-formbuilder/formbuilder.config';
49
50
  export * from './lib/components/rule-builder/rule-builder.component';
51
+ export * from './lib/components/rule-builder/condition-value';
50
52
  export * from './lib/services/modal.service';
51
53
  export * from './lib/services/modaRef';
52
54
  export * from './lib/services/modal.constant';
@@ -65,9 +67,11 @@ export * from './lib/helpers';
65
67
  export * from './lib/components/survey/survey.component';
66
68
  export * from './lib/components/survey/survey.models';
67
69
  export * from './lib/components/survey/survey-templates.directive';
70
+ export * from './lib/components/survey/survey.config';
68
71
  export * from './lib/components/dynamic-form/form-engine.service';
69
72
  export * from './lib/components/dynamic-form/form-state.service';
70
73
  export * from './lib/components/dynamic-form/form-validators';
71
74
  export * from './lib/components/dynamic-form/other-option';
75
+ export * from './lib/utils/search-text';
72
76
  export * from './lib/theme/theme-scope';
73
77
  export * from './lib/theme/colors';
@@ -116,7 +116,8 @@ $uic-slider-track-color: var(--uic-slider-track-color, var(--uic-neutral-300, #c
116
116
  // Pool de opciones
117
117
  $uic-pool-gap: var(--uic-pool-gap, var(--design-size-ref));
118
118
  $uic-pool-option-bg: var(--uic-pool-option-bg, var(--uic-surface-raised, var(--secondary-50)));
119
- $uic-pool-option-color: var(--uic-pool-option-color, var(--secondary-400));
119
+ // Texto de la opción: --secondary-700 (antes 400, que sobre --secondary-50 no llegaba a 3:1).
120
+ $uic-pool-option-color: var(--uic-pool-option-color, var(--secondary-700));
120
121
  $uic-pool-option-border-width: var(--uic-pool-option-border-width, 1px);
121
122
  $uic-pool-option-border-color: var(--uic-pool-option-border-color, var(--uic-neutral-300, var(--grey-300)));
122
123
  $uic-pool-option-border-color-hover: var(--uic-pool-option-border-color-hover, var(--secondary-400));
@@ -125,7 +126,7 @@ $uic-pool-option-padding: var(--uic-pool-option-padding, #{$spacing-xs} #{$spaci
125
126
  $uic-pool-option-font-size: var(--uic-pool-option-font-size, #{$font-size-s});
126
127
  $uic-pool-option-font-weight: var(--uic-pool-option-font-weight, #{$font-weight-regular});
127
128
  $uic-pool-option-active-bg: var(--uic-pool-option-active-bg, var(--secondary-100));
128
- $uic-pool-option-active-color: var(--uic-pool-option-active-color, var(--uic-pool-option-color, var(--secondary-400)));
129
+ $uic-pool-option-active-color: var(--uic-pool-option-active-color, var(--uic-pool-option-color, var(--secondary-700)));
129
130
  $uic-pool-option-active-border-color: var(--uic-pool-option-active-border-color, var(--primary-400));
130
131
 
131
132
  // Carga (shimmer)