valtech-components 2.0.858 → 2.0.860

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 (29) hide show
  1. package/esm2022/lib/components/molecules/feedback-form/feedback-form.component.mjs +153 -268
  2. package/esm2022/lib/components/molecules/feedback-form/types.mjs +1 -1
  3. package/esm2022/lib/components/molecules/textarea-input/textarea-input.component.mjs +3 -3
  4. package/esm2022/lib/components/organisms/attachment-uploader/attachment-uploader.component.mjs +77 -0
  5. package/esm2022/lib/components/organisms/attachment-uploader/types.mjs +2 -0
  6. package/esm2022/lib/components/organisms/mfa-modal/mfa-modal.component.mjs +21 -3
  7. package/esm2022/lib/components/organisms/toolbar/toolbar.component.mjs +5 -5
  8. package/esm2022/lib/components/organisms/wizard/types.mjs +1 -1
  9. package/esm2022/lib/components/organisms/wizard/wizard.component.mjs +13 -37
  10. package/esm2022/lib/components/types.mjs +1 -1
  11. package/esm2022/lib/services/auth/auth.service.mjs +6 -1
  12. package/esm2022/lib/services/i18n/default-content.mjs +19 -1
  13. package/esm2022/lib/services/icons.service.mjs +3 -2
  14. package/esm2022/lib/version.mjs +2 -2
  15. package/esm2022/public-api.mjs +3 -1
  16. package/fesm2022/valtech-components.mjs +911 -933
  17. package/fesm2022/valtech-components.mjs.map +1 -1
  18. package/lib/components/molecules/feedback-form/feedback-form.component.d.ts +8 -39
  19. package/lib/components/molecules/feedback-form/types.d.ts +1 -0
  20. package/lib/components/organisms/attachment-uploader/attachment-uploader.component.d.ts +23 -0
  21. package/lib/components/organisms/attachment-uploader/types.d.ts +12 -0
  22. package/lib/components/organisms/mfa-modal/mfa-modal.component.d.ts +2 -0
  23. package/lib/components/organisms/wizard/types.d.ts +3 -3
  24. package/lib/components/organisms/wizard/wizard.component.d.ts +2 -1
  25. package/lib/components/types.d.ts +2 -0
  26. package/lib/services/auth/auth.service.d.ts +3 -0
  27. package/lib/version.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/public-api.d.ts +2 -0
@@ -1,57 +1,26 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { I18nService } from '../../../services/i18n';
3
- import { FormGroup } from '@angular/forms';
3
+ import { FormMetadata, FormSubmit } from '../../types';
4
+ import { AttachmentItem } from '../../organisms/attachment-uploader/types';
4
5
  import { FeedbackFormMetadata, FeedbackSubmitEvent } from './types';
5
6
  import * as i0 from "@angular/core";
6
- /**
7
- * val-feedback-form
8
- *
9
- * Formulario reutilizable para enviar feedback desde cualquier parte de la aplicación.
10
- *
11
- * @example
12
- * ```html
13
- * <!-- Feedback general -->
14
- * <val-feedback-form
15
- * [props]="{ defaultType: 'feedback', showTypeSelector: true }"
16
- * (onSubmit)="handleSuccess($event)"
17
- * (onCancel)="closeModal()"
18
- * />
19
- *
20
- * <!-- Reportar contenido incorrecto -->
21
- * <val-feedback-form
22
- * [props]="{
23
- * defaultType: 'poor-content',
24
- * showTypeSelector: false,
25
- * contentRef: { contentId: article.id, contentType: 'article' },
26
- * submitButtonText: 'Reportar contenido'
27
- * }"
28
- * />
29
- * ```
30
- */
31
7
  export declare class FeedbackFormComponent implements OnInit {
32
- /**
33
- * Configuración del formulario.
34
- */
35
8
  props: FeedbackFormMetadata;
36
- /**
37
- * Evento emitido cuando el feedback se envía exitosamente.
38
- */
39
9
  onSubmit: EventEmitter<FeedbackSubmitEvent>;
40
- /**
41
- * Evento emitido cuando el usuario cancela.
42
- */
43
10
  onCancel: EventEmitter<void>;
44
- private fb;
45
- private feedbackService;
46
11
  protected i18n: I18nService;
47
- form: FormGroup;
12
+ private feedbackService;
13
+ formProps: FormMetadata;
48
14
  typeOptions: import("../../../services/feedback").FeedbackTypeOption[];
49
15
  isSubmitting: import("@angular/core").WritableSignal<boolean>;
50
16
  isSuccess: import("@angular/core").WritableSignal<boolean>;
51
17
  error: import("@angular/core").WritableSignal<string>;
18
+ private currentAttachments;
52
19
  constructor();
53
20
  ngOnInit(): void;
54
- handleSubmit(): Promise<void>;
21
+ private buildFormProps;
22
+ handleFormSubmit(submitted: FormSubmit): Promise<void>;
23
+ onAttachmentsChange(items: AttachmentItem[]): void;
55
24
  onCancelClick(): void;
56
25
  static ɵfac: i0.ɵɵFactoryDeclaration<FeedbackFormComponent, never>;
57
26
  static ɵcmp: i0.ɵɵComponentDeclaration<FeedbackFormComponent, "val-feedback-form", never, { "props": { "alias": "props"; "required": false; }; }, { "onSubmit": "onSubmit"; "onCancel": "onCancel"; }, never, never, true, never>;
@@ -43,6 +43,7 @@ export interface FeedbackSubmitEvent {
43
43
  response: CreateFeedbackResponse;
44
44
  type: FeedbackType;
45
45
  title: string;
46
+ attachmentUrls?: string[];
46
47
  }
47
48
  /**
48
49
  * Estado del formulario.
@@ -0,0 +1,23 @@
1
+ import { I18nService } from '../../../services/i18n';
2
+ import { AttachmentItem, AttachmentUploaderMetadata } from './types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class AttachmentUploaderComponent {
5
+ props: import("@angular/core").InputSignal<AttachmentUploaderMetadata>;
6
+ attachmentsChange: import("@angular/core").OutputEmitterRef<AttachmentItem[]>;
7
+ protected i18n: I18nService;
8
+ private feedbackService;
9
+ attachments: import("@angular/core").WritableSignal<AttachmentItem[]>;
10
+ maxFiles: import("@angular/core").Signal<number>;
11
+ accept: import("@angular/core").Signal<string>;
12
+ maxReached: import("@angular/core").Signal<boolean>;
13
+ isDisabled: import("@angular/core").Signal<boolean>;
14
+ isUploading: import("@angular/core").Signal<boolean>;
15
+ get readyUrls(): string[];
16
+ constructor();
17
+ onFilesSelected(event: Event): Promise<void>;
18
+ private uploadFile;
19
+ remove(id: string): void;
20
+ formatSize(bytes: number): string;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentUploaderComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<AttachmentUploaderComponent, "val-attachment-uploader", never, { "props": { "alias": "props"; "required": false; "isSignal": true; }; }, { "attachmentsChange": "attachmentsChange"; }, never, never, true, never>;
23
+ }
@@ -0,0 +1,12 @@
1
+ export interface AttachmentItem {
2
+ id: string;
3
+ file: File;
4
+ status: 'uploading' | 'ready' | 'error';
5
+ url?: string;
6
+ error?: string;
7
+ }
8
+ export interface AttachmentUploaderMetadata {
9
+ maxFiles?: number;
10
+ accept?: string;
11
+ disabled?: boolean;
12
+ }
@@ -80,6 +80,7 @@ export declare class MfaModalComponent implements OnDestroy {
80
80
  /** Marca momentánea cuando el secreto TOTP se acaba de copiar (feedback visual). */
81
81
  readonly copiedSecret: import("@angular/core").WritableSignal<boolean>;
82
82
  readonly resendCooldown: import("@angular/core").WritableSignal<number>;
83
+ readonly disableCodeSent: import("@angular/core").WritableSignal<boolean>;
83
84
  readonly pinControl: FormControl<string>;
84
85
  readonly phoneControl: FormControl<string>;
85
86
  readonly pinInputProps: {
@@ -125,6 +126,7 @@ export declare class MfaModalComponent implements OnDestroy {
125
126
  onDisableSubmit(event: FormSubmit): void;
126
127
  /** Deshabilita MFA usando un código TOTP — para cuentas OAuth-only sin contraseña. */
127
128
  disableWithMfaCode(): void;
129
+ sendDisableCode(): void;
128
130
  private disable;
129
131
  /** Copia una lista de códigos de respaldo al portapapeles. */
130
132
  copyCodes(codes: string[]): Promise<void>;
@@ -3,7 +3,7 @@
3
3
  * Permiten definir los pasos, botones, estado y navegación del wizard.
4
4
  */
5
5
  import { ButtonMetadata, ComponentState } from '../../types';
6
- import { NoContentMetadata } from '../no-content/types';
6
+ import { EmptyStateMetadata } from '../../molecules/empty-state/types';
7
7
  /**
8
8
  * Metadatos del wizard.
9
9
  * @property state Estado global del wizard.
@@ -19,11 +19,11 @@ export type WizardMetadata = {
19
19
  };
20
20
  /**
21
21
  * Representa un paso del wizard.
22
- * @property titles Metadatos de "no contenido" para el paso.
22
+ * @property titles Metadatos del empty-state para el encabezado del paso.
23
23
  * @property buttons Botones disponibles en el paso.
24
24
  */
25
25
  export type Step = {
26
- titles: NoContentMetadata;
26
+ titles: EmptyStateMetadata;
27
27
  buttons: ButtonMetadata[];
28
28
  };
29
29
  /**
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
+ import { EmptyStateMetadata } from '../../molecules/empty-state/types';
2
3
  import { MOTION, Step, WizardMetadata } from './types';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class WizardComponent implements OnInit, OnChanges {
@@ -9,7 +10,7 @@ export declare class WizardComponent implements OnInit, OnChanges {
9
10
  }>;
10
11
  wrapperId: string;
11
12
  currentStep: Step | null;
12
- currentStepTitles: any;
13
+ currentStepTitles: EmptyStateMetadata;
13
14
  loadingText: string;
14
15
  private cdr;
15
16
  ngOnInit(): void;
@@ -226,6 +226,8 @@ export type ToolbarAction = {
226
226
  avatarUrl?: string;
227
227
  handle?: string;
228
228
  } | null;
229
+ /** Controls avatar size when type is AVATAR. Defaults to 'small'. */
230
+ avatarSize?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
229
231
  };
230
232
  /**
231
233
  * Metadata for an icon.
@@ -217,6 +217,9 @@ export declare class AuthService implements OnDestroy {
217
217
  * `mfaCode` es para usuarios OAuth-only con TOTP que no tienen contraseña.
218
218
  */
219
219
  disableMFA(input: MFADisableRequest): Observable<MFADisableResponse>;
220
+ sendMFADisableCode(): Observable<{
221
+ operationId: string;
222
+ }>;
220
223
  /**
221
224
  * Inicia configuración de TOTP MFA.
222
225
  * Retorna el secreto, URL para QR code y códigos de respaldo.
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 = "2.0.858";
5
+ export declare const VERSION = "2.0.860";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.858",
3
+ "version": "2.0.860",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
package/public-api.d.ts CHANGED
@@ -179,6 +179,8 @@ export * from './lib/components/molecules/empty-state/factory';
179
179
  export * from './lib/components/molecules/empty-state/types';
180
180
  export * from './lib/components/molecules/image-crop/image-crop.component';
181
181
  export * from './lib/components/molecules/modal-shell/modal-shell.component';
182
+ export * from './lib/components/organisms/attachment-uploader/attachment-uploader.component';
183
+ export * from './lib/components/organisms/attachment-uploader/types';
182
184
  export * from './lib/components/organisms/article/article.component';
183
185
  export * from './lib/components/organisms/article/types';
184
186
  export * from './lib/components/organisms/banner/banner.component';