valtech-components 2.0.586 → 2.0.587
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/esm2022/lib/components/organisms/toolbar/toolbar.component.mjs +20 -2
- package/esm2022/lib/components/organisms/toolbar/types.mjs +1 -1
- package/esm2022/lib/components/templates/page-content/page-content.component.mjs +15 -2
- package/esm2022/lib/components/templates/page-content/types.mjs +1 -1
- package/esm2022/lib/services/auth/auth.service.mjs +40 -1
- package/esm2022/lib/services/auth/types.mjs +1 -1
- package/fesm2022/valtech-components.mjs +71 -2
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/toolbar/toolbar.component.d.ts +26 -0
- package/lib/components/organisms/toolbar/types.d.ts +4 -0
- package/lib/components/templates/page-content/page-content.component.d.ts +14 -2
- package/lib/components/templates/page-content/types.d.ts +7 -0
- package/lib/services/auth/auth.service.d.ts +23 -1
- package/lib/services/auth/types.d.ts +14 -0
- package/package.json +1 -1
|
@@ -54,6 +54,32 @@ export declare class ToolbarComponent implements OnInit {
|
|
|
54
54
|
* Devuelve las acciones de la izquierda.
|
|
55
55
|
*/
|
|
56
56
|
leftActions(): ToolbarAction[];
|
|
57
|
+
/**
|
|
58
|
+
* Language selector props with 'icon' mode as default for toolbar display.
|
|
59
|
+
*/
|
|
60
|
+
get languageSelectorProps(): {
|
|
61
|
+
mode: import("valtech-components").LanguageSelectorMode;
|
|
62
|
+
icon?: string;
|
|
63
|
+
currentLanguage?: string;
|
|
64
|
+
availableLanguages?: string[];
|
|
65
|
+
showLabel?: boolean;
|
|
66
|
+
label?: string;
|
|
67
|
+
labelConfig?: {
|
|
68
|
+
className?: string;
|
|
69
|
+
key: string;
|
|
70
|
+
fallback?: string;
|
|
71
|
+
interpolation?: Record<string, any>;
|
|
72
|
+
};
|
|
73
|
+
showFlags?: boolean;
|
|
74
|
+
color: import("@ionic/core").Color;
|
|
75
|
+
size?: "small" | "large" | "default";
|
|
76
|
+
fill?: "default" | "clear" | "outline" | "solid";
|
|
77
|
+
shape?: "round";
|
|
78
|
+
expand?: "full" | "block";
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
customLanguageNames?: Record<string, string>;
|
|
81
|
+
forceReload?: boolean;
|
|
82
|
+
};
|
|
57
83
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarComponent, never>;
|
|
58
84
|
static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarComponent, "val-toolbar", never, { "props": { "alias": "props"; "required": false; }; }, { "onClick": "onClick"; }, never, ["[toolbar-bottom]"], true, never>;
|
|
59
85
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Color } from '@ionic/core';
|
|
6
6
|
import { ToolbarAction } from '../../types';
|
|
7
|
+
import { LanguageSelectorMetadata } from '../../molecules/language-selector/types';
|
|
7
8
|
/**
|
|
8
9
|
* Metadatos para la barra de herramientas.
|
|
9
10
|
* @property withBack Si muestra botón de retroceso.
|
|
@@ -14,6 +15,7 @@ import { ToolbarAction } from '../../types';
|
|
|
14
15
|
* @property textColor (opcional) Color del texto.
|
|
15
16
|
* @property title Título de la barra.
|
|
16
17
|
* @property actions Acciones disponibles en la barra.
|
|
18
|
+
* @property languageSelector (opcional) Configuración del selector de idioma.
|
|
17
19
|
*/
|
|
18
20
|
export type ToolbarMetadata = {
|
|
19
21
|
withBack: boolean;
|
|
@@ -24,4 +26,6 @@ export type ToolbarMetadata = {
|
|
|
24
26
|
textColor?: Color;
|
|
25
27
|
title: string;
|
|
26
28
|
actions: ToolbarAction[];
|
|
29
|
+
/** Language selector configuration. Displays to the left of menu button when provided. */
|
|
30
|
+
languageSelector?: LanguageSelectorMetadata;
|
|
27
31
|
};
|
|
@@ -47,11 +47,21 @@ export declare class PageContentComponent {
|
|
|
47
47
|
private readonly defaultHeader;
|
|
48
48
|
/**
|
|
49
49
|
* Gets header props, using cached default if not provided.
|
|
50
|
+
* Injects languageSelector into toolbar when provided at page level.
|
|
50
51
|
*/
|
|
51
52
|
get headerProps(): import("valtech-components").HeaderMetadata | {
|
|
52
|
-
bordered: boolean;
|
|
53
|
-
translucent: boolean;
|
|
54
53
|
toolbar: {
|
|
54
|
+
languageSelector: import("valtech-components").LanguageSelectorMetadata;
|
|
55
|
+
withBack: boolean;
|
|
56
|
+
withMenu?: boolean;
|
|
57
|
+
backText?: string;
|
|
58
|
+
withActions: boolean;
|
|
59
|
+
color?: import("@ionic/core").Color;
|
|
60
|
+
textColor?: import("@ionic/core").Color;
|
|
61
|
+
title: string;
|
|
62
|
+
actions: import("valtech-components").ToolbarAction[];
|
|
63
|
+
} | {
|
|
64
|
+
languageSelector: import("valtech-components").LanguageSelectorMetadata;
|
|
55
65
|
withBack: boolean;
|
|
56
66
|
withActions: boolean;
|
|
57
67
|
textColor: "dark";
|
|
@@ -75,6 +85,8 @@ export declare class PageContentComponent {
|
|
|
75
85
|
};
|
|
76
86
|
}[];
|
|
77
87
|
};
|
|
88
|
+
translucent?: boolean;
|
|
89
|
+
bordered?: boolean;
|
|
78
90
|
};
|
|
79
91
|
/**
|
|
80
92
|
* Gets the background color based on theme.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HeaderMetadata } from '../../organisms/header/types';
|
|
2
|
+
import { LanguageSelectorMetadata } from '../../molecules/language-selector/types';
|
|
2
3
|
/**
|
|
3
4
|
* Configuration for the page content component.
|
|
4
5
|
*/
|
|
@@ -11,4 +12,10 @@ export interface PageContentMetadata {
|
|
|
11
12
|
backgroundDark?: string;
|
|
12
13
|
/** Route to navigate to when header logo is clicked */
|
|
13
14
|
homeRoute?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Language selector configuration.
|
|
17
|
+
* When provided, displays a language selector icon in the header (left of menu button).
|
|
18
|
+
* Uses 'icon' mode by default for compact display.
|
|
19
|
+
*/
|
|
20
|
+
languageSelector?: LanguageSelectorMetadata;
|
|
14
21
|
}
|
|
@@ -6,7 +6,7 @@ import { AuthStateService } from './auth-state.service';
|
|
|
6
6
|
import { TokenService } from './token.service';
|
|
7
7
|
import { AuthStorageService } from './storage.service';
|
|
8
8
|
import { AuthSyncService } from './sync.service';
|
|
9
|
-
import { SigninRequest, SigninResponse, SignupRequest, SignupResponse, VerifyEmailRequest, VerifyEmailResponse, ResendCodeRequest, ResendCodeResponse, MFAVerifyResponse, RefreshResponse, GetPermissionsResponse, GetProfileResponse, UpdateProfileRequest, UpdateProfileResponse, MFASetupResponse, MFAConfirmResponse, MFADisableResponse, ForgotPasswordRequest, ForgotPasswordResponse, ResetPasswordRequest, ResetPasswordResponse, ChangePasswordResponse, SwitchOrgResponse, MFAMethod, AuthError, ValtechAuthConfig, EnableNotificationsResult, NotificationPermissionState, RegisterDeviceResult, TOTPSetupResponse, TOTPVerifySetupResponse, TOTPDisableResponse, RegenerateBackupCodesResponse, BackupCodesCountResponse, OAuthProvider, LinkedProvider, HasPasswordResponse } from './types';
|
|
9
|
+
import { SigninRequest, SigninResponse, SignupRequest, SignupResponse, VerifyEmailRequest, VerifyEmailResponse, ResendCodeRequest, ResendCodeResponse, MFAVerifyResponse, RefreshResponse, GetPermissionsResponse, GetProfileResponse, UpdateProfileRequest, UpdateProfileResponse, MFASetupResponse, MFAConfirmResponse, MFADisableResponse, ForgotPasswordRequest, ForgotPasswordResponse, ResetPasswordRequest, ResetPasswordResponse, ChangePasswordResponse, DeleteAccountResponse, SwitchOrgResponse, MFAMethod, AuthError, ValtechAuthConfig, EnableNotificationsResult, NotificationPermissionState, RegisterDeviceResult, TOTPSetupResponse, TOTPVerifySetupResponse, TOTPDisableResponse, RegenerateBackupCodesResponse, BackupCodesCountResponse, OAuthProvider, LinkedProvider, HasPasswordResponse } from './types';
|
|
10
10
|
import { OAuthService } from './oauth.service';
|
|
11
11
|
import { FirebaseService, MessagingService } from '../firebase';
|
|
12
12
|
import { I18nService } from '../i18n';
|
|
@@ -255,6 +255,28 @@ export declare class AuthService implements OnDestroy {
|
|
|
255
255
|
* Requiere la contraseña actual para verificación.
|
|
256
256
|
*/
|
|
257
257
|
changePassword(currentPassword: string, newPassword: string): Observable<ChangePasswordResponse>;
|
|
258
|
+
/**
|
|
259
|
+
* Elimina la cuenta del usuario (soft delete).
|
|
260
|
+
* Requiere confirmación de contraseña por seguridad.
|
|
261
|
+
* Después de eliminar, cierra sesión automáticamente.
|
|
262
|
+
*
|
|
263
|
+
* @param password - Contraseña actual para confirmar
|
|
264
|
+
* @returns Observable con resultado de la eliminación
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```typescript
|
|
268
|
+
* async confirmDeleteAccount(password: string) {
|
|
269
|
+
* try {
|
|
270
|
+
* const result = await firstValueFrom(this.auth.deleteAccount(password));
|
|
271
|
+
* console.log(result.message); // "Tu cuenta ha sido eliminada..."
|
|
272
|
+
* // Usuario es redirigido automáticamente al login
|
|
273
|
+
* } catch (error) {
|
|
274
|
+
* // Manejar error (contraseña incorrecta, etc)
|
|
275
|
+
* }
|
|
276
|
+
* }
|
|
277
|
+
* ```
|
|
278
|
+
*/
|
|
279
|
+
deleteAccount(password: string): Observable<DeleteAccountResponse>;
|
|
258
280
|
/**
|
|
259
281
|
* Obtiene los permisos actualizados del backend.
|
|
260
282
|
*/
|
|
@@ -401,6 +401,20 @@ export interface ChangePasswordResponse {
|
|
|
401
401
|
operationId: string;
|
|
402
402
|
success: boolean;
|
|
403
403
|
}
|
|
404
|
+
/**
|
|
405
|
+
* Request para eliminar cuenta (requiere confirmación de contraseña).
|
|
406
|
+
*/
|
|
407
|
+
export interface DeleteAccountRequest {
|
|
408
|
+
password: string;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Response de eliminar cuenta.
|
|
412
|
+
*/
|
|
413
|
+
export interface DeleteAccountResponse {
|
|
414
|
+
operationId: string;
|
|
415
|
+
deleted: boolean;
|
|
416
|
+
message: string;
|
|
417
|
+
}
|
|
404
418
|
/**
|
|
405
419
|
* Response de obtener perfil del usuario.
|
|
406
420
|
*/
|