valtech-components 4.0.995 → 4.0.996

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.
@@ -90,7 +90,9 @@ export declare class ArticleComponent implements OnInit, AfterViewInit {
90
90
  actionType?: import("valtech-components").ActionType;
91
91
  expand?: "full" | "block";
92
92
  link?: string;
93
- href?: string;
93
+ href?: string; /**
94
+ * Obtiene los estilos de padding para el contenedor article
95
+ */
94
96
  routerLink?: string | any[];
95
97
  target?: "_blank" | "_self" | "_parent" | "_top";
96
98
  download?: string;
@@ -1,5 +1,6 @@
1
1
  import { DoCheck, ElementRef, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
+ import { EmojiRatingMetadata } from '../../atoms/emoji-rating/types';
3
4
  import { DatePickerMetadata } from '../../molecules/date-picker/types';
4
5
  import { TextareaInputMetadata } from '../../molecules/textarea-input/types';
5
6
  import { UsernameInputMetadata } from '../../molecules/username-input/types';
@@ -45,6 +46,7 @@ export declare class FormComponent implements OnInit, OnChanges, DoCheck {
45
46
  private selectPropMemo;
46
47
  private textInputPropMemo;
47
48
  private datePickerPropMemo;
49
+ private emojiRatingPropMemo;
48
50
  private fieldIdMemo;
49
51
  private fieldUid;
50
52
  private previousState;
@@ -129,6 +131,13 @@ export declare class FormComponent implements OnInit, OnChanges, DoCheck {
129
131
  * label/hint se omiten — val-form los renderiza vía .field-name/.field-description.
130
132
  */
131
133
  getDatePickerProp(field: InputMetadata): DatePickerMetadata;
134
+ getEmojiRatingProp(field: InputMetadata): EmojiRatingMetadata;
135
+ setBooleanValue(fieldName: string, value: boolean): void;
136
+ orderedOptions(field: InputMetadata): import("../../types").InputOption[];
137
+ isSimpleMultiSelected(fieldName: string, optionId: string): boolean;
138
+ setSimpleMultiSelected(fieldName: string, optionId: string, selected: boolean): void;
139
+ booleanYesLabel(): string;
140
+ booleanNoLabel(): string;
132
141
  /**
133
142
  * Adapter — convierte un `InputMetadata` (con type=TEXTAREA) a `TextareaInputMetadata`.
134
143
  * Defaults sensatos: autoGrow + counter habilitado, 4-12 rows.
@@ -1,9 +1,10 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { FormControl } from '@angular/forms';
3
- import { FieldSchemaDef, RequestTypeConfig } from '../../../services/requests/types';
4
- import { InputMetadata, InputOption, InputType } from '../../types';
3
+ import { RequestTypeConfig } from '../../../services/requests/types';
4
+ import { InputOption, InputType } from '../../types';
5
5
  import { EmptyStateMetadata } from '../../molecules/empty-state/types';
6
6
  import { SurveyResponseMetadata, SurveyResponseSubmitEvent } from './types';
7
+ import { FormMetadata, FormSubmit } from '../../types';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  * val-survey-response
@@ -29,10 +30,12 @@ import * as i0 from "@angular/core";
29
30
  export declare class SurveyResponseComponent implements OnInit {
30
31
  props: SurveyResponseMetadata;
31
32
  readonly submitted: EventEmitter<SurveyResponseSubmitEvent>;
33
+ private formComponent?;
32
34
  private readonly i18n;
33
35
  private readonly auth;
34
36
  private readonly requests;
35
37
  private readonly errors;
38
+ private readonly formSchemas;
36
39
  readonly emojiType = "EMOJI_RATING";
37
40
  readonly selectType = InputType.SELECT;
38
41
  readonly loading: import("@angular/core").WritableSignal<boolean>;
@@ -40,26 +43,18 @@ export declare class SurveyResponseComponent implements OnInit {
40
43
  readonly sent: import("@angular/core").WritableSignal<boolean>;
41
44
  readonly sending: import("@angular/core").WritableSignal<boolean>;
42
45
  readonly typeConfig: import("@angular/core").WritableSignal<RequestTypeConfig>;
43
- readonly multiSelectError: import("@angular/core").WritableSignal<boolean>;
44
46
  readonly alreadyAnswered: import("@angular/core").WritableSignal<boolean>;
45
47
  readonly nameControl: FormControl<string>;
46
48
  readonly emailControl: FormControl<string>;
47
49
  private form;
48
- /**
49
- * Una casilla por opción de cada pregunta MULTI_SELECT, indexada
50
- * `"<pregunta>::<opcion>"`. Viven fuera del `form` porque el valor que viaja
51
- * al backend es UNA lista por pregunta, no N booleanos: se arma al enviar.
52
- */
53
- private readonly multiControls;
54
50
  constructor();
55
51
  ngOnInit(): Promise<void>;
56
- private buildForm;
57
- /** Preguntas ordenadas — el template las recorre en este orden. */
52
+ private configureIdentity;
53
+ private buildCompatibilityForm;
54
+ readonly formProps: import("@angular/core").Signal<FormMetadata>;
55
+ /** Preguntas ordenadas, expuestas para tests/hosts que inspeccionan el schema resuelto. */
58
56
  readonly questions: import("@angular/core").Signal<import("valtech-components").FieldSchemaDef[]>;
59
57
  questionControl(name: string): FormControl;
60
- booleanControl(name: string): FormControl<boolean>;
61
- optionControl(name: string, optionId: string): FormControl<boolean>;
62
- /** Opciones tal como las escribió quien creó la encuesta — no se traducen. */
63
58
  optionsOf(q: {
64
59
  options?: {
65
60
  id: string;
@@ -67,33 +62,8 @@ export declare class SurveyResponseComponent implements OnInit {
67
62
  order?: number;
68
63
  }[];
69
64
  }): InputOption[];
70
- /**
71
- * `val-radio-input` pide un `InputMetadata` completo (no `Partial`), así que
72
- * se arma acá en vez de en el template.
73
- */
74
- radioProps(q: FieldSchemaDef): InputMetadata;
75
- placeholderOf(q: {
76
- placeholderText?: string;
77
- placeholder?: string;
78
- }): string;
79
- hintOf(q: {
80
- hintText?: string;
81
- hint?: string;
82
- }): string;
83
- /**
84
- * Tipo del `<input>` para las preguntas que se responden escribiendo. Nada de
85
- * `parseInputType` de `FormSchemaBuilderService`: ese mapea al enum de
86
- * `val-form`, y acá no hay `val-form` de por medio (ver el comentario de
87
- * clase). Un tipo desconocido cae a texto, que siempre se puede responder.
88
- */
89
65
  inputTypeOf(type: string): 'text' | 'email' | 'number' | 'tel';
90
- /** Las opciones marcadas de una pregunta MULTI_SELECT, en el orden del schema. */
91
- private selectedOptions;
92
- questionLabel(q: {
93
- label?: string;
94
- labelKey?: string;
95
- name: string;
96
- }): string;
66
+ private surveySchemaForForm;
97
67
  /** Puede responder sin sesión si el tipo lo permite; si no, hace falta login. */
98
68
  readonly canRespond: import("@angular/core").Signal<boolean>;
99
69
  /**
@@ -105,8 +75,14 @@ export declare class SurveyResponseComponent implements OnInit {
105
75
  * encuesta; el formulario no cobra peaje por su cuenta.
106
76
  */
107
77
  needsIdentity(): boolean;
78
+ private needsIdentityFor;
108
79
  readonly submitState: import("@angular/core").Signal<"ENABLED" | "WORKING">;
109
- submit(): Promise<void>;
80
+ readonly multiSelectError: import("@angular/core").WritableSignal<boolean>;
81
+ private readonly optionControlMemo;
82
+ optionControl(name: string, optionId: string): FormControl<boolean>;
83
+ markInvalid(): void;
84
+ submit(event?: FormSubmit): Promise<void>;
85
+ private hasMissingRequiredMultiSelect;
110
86
  readonly alreadyAnsweredState: import("@angular/core").Signal<EmptyStateMetadata>;
111
87
  readonly sentState: import("@angular/core").Signal<EmptyStateMetadata>;
112
88
  readonly loadErrorState: import("@angular/core").Signal<EmptyStateMetadata>;
@@ -65,12 +65,14 @@ export declare enum InputType {
65
65
  HANDLE = 23,
66
66
  ATTACHMENT = 24,
67
67
  DATE_PICKER = 25,
68
+ /** Escala corta de satisfacción con emojis. Usada por encuestas públicas. */
69
+ EMOJI_RATING = 26,
68
70
  /**
69
71
  * Opción única en chips (`val-chip-select`). Preferilo sobre CHECKBOX_RADIO
70
72
  * cuando las etiquetas son cortas y la pantalla es un teléfono: los radios se
71
73
  * apilan en vertical y su objetivo táctil es el círculo, no la etiqueta.
72
74
  */
73
- CHIP_SELECT = 26
75
+ CHIP_SELECT = 27
74
76
  }
75
77
  /**
76
78
  * Option for select, radio, etc. inputs.
@@ -144,7 +146,7 @@ export type InputMetadata = {
144
146
  [key: string]: string;
145
147
  };
146
148
  /** Initial value for the field */
147
- value?: string;
149
+ value?: any;
148
150
  /** Default value configuration - string for custom defaults, true for auto defaults */
149
151
  withDefault?: string | boolean;
150
152
  /** Field state */
@@ -39,7 +39,7 @@ export interface FieldSchemaDef {
39
39
  options?: FieldOption[];
40
40
  order: number;
41
41
  /** Initial value injected by consumers when rendering a configured form. */
42
- value?: string;
42
+ value?: any;
43
43
  }
44
44
  export interface FormSchemaConfig {
45
45
  schemaId: string;
package/lib/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "4.0.995";
5
+ export declare const VERSION = "4.0.996";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.995",
3
+ "version": "4.0.996",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"