valtech-components 4.0.1006 → 4.0.1008

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 (21) hide show
  1. package/esm2022/lib/components/organisms/field-schema-editor/field-schema-editor.component.mjs +14 -1
  2. package/esm2022/lib/components/organisms/field-schema-editor/field-schema-editor.i18n.mjs +5 -1
  3. package/esm2022/lib/components/organisms/field-schema-editor/types.mjs +1 -1
  4. package/esm2022/lib/components/organisms/survey-builder/survey-builder.component.mjs +72 -9
  5. package/esm2022/lib/components/organisms/survey-builder/survey-builder.i18n.mjs +9 -1
  6. package/esm2022/lib/components/organisms/survey-builder/survey-preview-modal.component.mjs +129 -0
  7. package/esm2022/lib/components/organisms/survey-response/survey-response.component.mjs +150 -12
  8. package/esm2022/lib/components/organisms/survey-response/survey-response.i18n.mjs +7 -1
  9. package/esm2022/lib/services/forms/form-schema-builder.service.mjs +18 -4
  10. package/esm2022/lib/services/forms/types.mjs +1 -1
  11. package/esm2022/lib/version.mjs +2 -2
  12. package/fesm2022/valtech-components.mjs +389 -22
  13. package/fesm2022/valtech-components.mjs.map +1 -1
  14. package/lib/components/organisms/field-schema-editor/field-schema-editor.component.d.ts +1 -0
  15. package/lib/components/organisms/field-schema-editor/types.d.ts +2 -0
  16. package/lib/components/organisms/survey-builder/survey-builder.component.d.ts +5 -0
  17. package/lib/components/organisms/survey-builder/survey-preview-modal.component.d.ts +28 -0
  18. package/lib/components/organisms/survey-response/survey-response.component.d.ts +11 -1
  19. package/lib/services/forms/types.d.ts +6 -0
  20. package/lib/version.d.ts +1 -1
  21. package/package.json +1 -1
@@ -45,6 +45,7 @@ export declare class FieldSchemaEditorComponent implements OnInit {
45
45
  readonly labelControl: FormControl<string>;
46
46
  readonly placeholderControl: FormControl<string>;
47
47
  readonly hintControl: FormControl<string>;
48
+ readonly sectionControl: FormControl<string>;
48
49
  readonly requiredControl: FormControl<boolean>;
49
50
  readonly typeControl: FormControl<string>;
50
51
  readonly options: import("@angular/core").WritableSignal<FieldOption[]>;
@@ -20,6 +20,8 @@ export interface EditableFieldDef {
20
20
  hintText: string;
21
21
  type: string;
22
22
  required: boolean;
23
+ sectionLabel?: string;
24
+ sectionOrder?: number;
23
25
  options?: FieldOption[];
24
26
  }
25
27
  /**
@@ -36,6 +36,7 @@ export declare class SurveyBuilderComponent implements OnInit {
36
36
  private readonly requests;
37
37
  private readonly formBuilder;
38
38
  private readonly errors;
39
+ private readonly modals;
39
40
  readonly titleControl: FormControl<string>;
40
41
  readonly subtitleControl: FormControl<string>;
41
42
  readonly headerImageControl: FormControl<string>;
@@ -95,6 +96,10 @@ export declare class SurveyBuilderComponent implements OnInit {
95
96
  private defaultSuccessMessage;
96
97
  private validateWizardStep;
97
98
  private rowFromField;
99
+ reviewQuestionsCount(): string;
100
+ previewProps(): ButtonMetadata;
101
+ openPreview(): Promise<void>;
102
+ private sectionOrderFor;
98
103
  static ɵfac: i0.ɵɵFactoryDeclaration<SurveyBuilderComponent, never>;
99
104
  static ɵcmp: i0.ɵɵComponentDeclaration<SurveyBuilderComponent, "val-survey-builder", never, { "props": { "alias": "props"; "required": false; }; }, { "saved": "saved"; "draft": "draft"; }, never, never, true, never>;
100
105
  }
@@ -0,0 +1,28 @@
1
+ import { RequestTypePresentation, FieldSchemaDef } from '../../../services/requests/types';
2
+ import * as i0 from "@angular/core";
3
+ export declare class SurveyPreviewModalComponent {
4
+ modalTitle: string;
5
+ closeLabel: string;
6
+ title: string;
7
+ subtitle: string;
8
+ presentation?: RequestTypePresentation;
9
+ questions: Array<FieldSchemaDef & {
10
+ typeLabel?: string;
11
+ }>;
12
+ successTitle: string;
13
+ successMessage: string;
14
+ requiredSuffix: string;
15
+ _modalRef?: {
16
+ dismiss: (data?: unknown, role?: string) => void;
17
+ };
18
+ sections(): Array<{
19
+ name: string;
20
+ order: number;
21
+ questions: Array<FieldSchemaDef & {
22
+ typeLabel?: string;
23
+ }>;
24
+ }>;
25
+ close(): void;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<SurveyPreviewModalComponent, never>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<SurveyPreviewModalComponent, "val-survey-preview-modal", never, { "modalTitle": { "alias": "modalTitle"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "presentation": { "alias": "presentation"; "required": false; }; "questions": { "alias": "questions"; "required": false; }; "successTitle": { "alias": "successTitle"; "required": false; }; "successMessage": { "alias": "successMessage"; "required": false; }; "requiredSuffix": { "alias": "requiredSuffix"; "required": false; }; "_modalRef": { "alias": "_modalRef"; "required": false; }; }, {}, never, never, true, never>;
28
+ }
@@ -1,7 +1,7 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { FormControl } from '@angular/forms';
3
3
  import { RequestTypeConfig } from '../../../services/requests/types';
4
- import { InputOption, InputType } from '../../types';
4
+ import { ButtonMetadata, InputOption, InputType } from '../../types';
5
5
  import { EmptyStateMetadata } from '../../molecules/empty-state/types';
6
6
  import { SurveyResponseMetadata, SurveyResponseSubmitEvent } from './types';
7
7
  import { FormMetadata, FormSubmit } from '../../types';
@@ -44,6 +44,8 @@ export declare class SurveyResponseComponent implements OnInit {
44
44
  readonly sending: import("@angular/core").WritableSignal<boolean>;
45
45
  readonly typeConfig: import("@angular/core").WritableSignal<RequestTypeConfig>;
46
46
  readonly alreadyAnswered: import("@angular/core").WritableSignal<boolean>;
47
+ readonly responseStep: import("@angular/core").WritableSignal<number>;
48
+ readonly responseValues: import("@angular/core").WritableSignal<Record<string, unknown>>;
47
49
  readonly nameControl: FormControl<string>;
48
50
  readonly emailControl: FormControl<string>;
49
51
  private form;
@@ -52,8 +54,11 @@ export declare class SurveyResponseComponent implements OnInit {
52
54
  private configureIdentity;
53
55
  private buildCompatibilityForm;
54
56
  readonly formProps: import("@angular/core").Signal<FormMetadata>;
57
+ readonly responseSections: import("@angular/core").Signal<import("../../types").FormSection[]>;
55
58
  /** Preguntas ordenadas, expuestas para tests/hosts que inspeccionan el schema resuelto. */
56
59
  readonly questions: import("@angular/core").Signal<import("valtech-components").FieldSchemaDef[]>;
60
+ hasResponseSteps(): boolean;
61
+ private sectionWithStoredValues;
57
62
  questionControl(name: string): FormControl;
58
63
  optionsOf(q: {
59
64
  options?: {
@@ -82,6 +87,11 @@ export declare class SurveyResponseComponent implements OnInit {
82
87
  optionControl(name: string, optionId: string): FormControl<boolean>;
83
88
  markInvalid(): void;
84
89
  submit(event?: FormSubmit): Promise<void>;
90
+ nextResponseStep(): void;
91
+ previousResponseStep(): void;
92
+ responseBackProps(): ButtonMetadata;
93
+ responseNextProps(): ButtonMetadata;
94
+ responseSubmitProps(): ButtonMetadata;
85
95
  private hasMissingRequiredMultiSelect;
86
96
  readonly alreadyAnsweredState: import("@angular/core").Signal<EmptyStateMetadata>;
87
97
  readonly sentState: import("@angular/core").Signal<EmptyStateMetadata>;
@@ -37,6 +37,12 @@ export interface FieldSchemaDef {
37
37
  /** e.g. 'required', 'email', 'maxLength:500', 'minLength:3' */
38
38
  validators?: string[];
39
39
  options?: FieldOption[];
40
+ /** Id estable de la sección/paso al que pertenece el campo. Opcional. */
41
+ sectionId?: string;
42
+ /** Nombre visible de la sección/paso. Lo escribe la organización, no se traduce. */
43
+ sectionLabel?: string;
44
+ /** Orden de la sección/paso. */
45
+ sectionOrder?: number;
40
46
  /** Incremento para campos NUMBER_PICKER. */
41
47
  step?: number;
42
48
  /** Unidad visible para campos NUMBER_PICKER. */
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.1006";
5
+ export declare const VERSION = "4.0.1008";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.1006",
3
+ "version": "4.0.1008",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"