valtech-components 2.0.441 → 2.0.443
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/services/auth/auth.service.mjs +32 -46
- package/esm2022/lib/services/link-processor.service.mjs +54 -54
- package/esm2022/lib/services/modal/modal.service.mjs +2 -3
- package/fesm2022/valtech-components.mjs +210 -129
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/services/auth/auth.service.d.ts +4 -3
- package/package.json +1 -1
- package/fesm2022/valtech-components-simple-modal-content.component-DQhEgUmS.mjs +0 -136
- package/fesm2022/valtech-components-simple-modal-content.component-DQhEgUmS.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnDestroy
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
2
|
import { HttpClient } from '@angular/common/http';
|
|
3
3
|
import { Router } from '@angular/router';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
@@ -7,6 +7,7 @@ import { TokenService } from './token.service';
|
|
|
7
7
|
import { AuthStorageService } from './storage.service';
|
|
8
8
|
import { AuthSyncService } from './sync.service';
|
|
9
9
|
import { SigninRequest, SigninResponse, SignupRequest, SignupResponse, VerifyEmailRequest, VerifyEmailResponse, ResendCodeRequest, ResendCodeResponse, MFAVerifyResponse, RefreshResponse, GetPermissionsResponse, MFASetupResponse, MFAConfirmResponse, MFADisableResponse, MFAMethod, AuthError, ValtechAuthConfig } from './types';
|
|
10
|
+
import { FirebaseService } from '../firebase';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
12
|
/**
|
|
12
13
|
* Servicio principal de autenticación.
|
|
@@ -34,14 +35,14 @@ export declare class AuthService implements OnDestroy {
|
|
|
34
35
|
private config;
|
|
35
36
|
private http;
|
|
36
37
|
private router;
|
|
37
|
-
private injector;
|
|
38
38
|
private stateService;
|
|
39
39
|
private tokenService;
|
|
40
40
|
private storageService;
|
|
41
41
|
private syncService;
|
|
42
|
+
private firebaseService;
|
|
42
43
|
private refreshTimerId;
|
|
43
44
|
private syncSubscription;
|
|
44
|
-
constructor(config: ValtechAuthConfig, http: HttpClient, router: Router,
|
|
45
|
+
constructor(config: ValtechAuthConfig, http: HttpClient, router: Router, stateService: AuthStateService, tokenService: TokenService, storageService: AuthStorageService, syncService: AuthSyncService, firebaseService: FirebaseService);
|
|
45
46
|
/** Estado completo de autenticación */
|
|
46
47
|
readonly state: import("@angular/core").Signal<import("./types").AuthState>;
|
|
47
48
|
/** Usuario está autenticado */
|
package/package.json
CHANGED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { Component, Input } from '@angular/core';
|
|
4
|
-
import { IonHeader, IonToolbar, IonTitle, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonSpinner } from '@ionic/angular/standalone';
|
|
5
|
-
import { addIcons } from 'ionicons';
|
|
6
|
-
import { closeOutline } from 'ionicons/icons';
|
|
7
|
-
|
|
8
|
-
addIcons({ closeOutline });
|
|
9
|
-
/**
|
|
10
|
-
* Internal component for simple content modals.
|
|
11
|
-
* Used by ModalService.openSimple()
|
|
12
|
-
*/
|
|
13
|
-
class SimpleModalContentComponent {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.title = '';
|
|
16
|
-
this.content = '';
|
|
17
|
-
this.buttons = [];
|
|
18
|
-
this.showCloseButton = true;
|
|
19
|
-
}
|
|
20
|
-
async onButtonClick(button) {
|
|
21
|
-
if (button.handler) {
|
|
22
|
-
const result = await button.handler();
|
|
23
|
-
// If handler returns false, don't dismiss
|
|
24
|
-
if (result === false) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
this._modalRef?.dismiss(undefined, button.role || 'confirm');
|
|
29
|
-
}
|
|
30
|
-
onDismiss(role) {
|
|
31
|
-
this._modalRef?.dismiss(undefined, role);
|
|
32
|
-
}
|
|
33
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SimpleModalContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
34
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SimpleModalContentComponent, isStandalone: true, selector: "val-simple-modal-content", inputs: { title: "title", content: "content", buttons: "buttons", showCloseButton: "showCloseButton", _modalRef: "_modalRef" }, ngImport: i0, template: `
|
|
35
|
-
<ion-header>
|
|
36
|
-
<ion-toolbar>
|
|
37
|
-
<ion-title>{{ title }}</ion-title>
|
|
38
|
-
@if (showCloseButton) {
|
|
39
|
-
<ion-buttons slot="end">
|
|
40
|
-
<ion-button (click)="onDismiss('close')">
|
|
41
|
-
<ion-icon slot="icon-only" name="close-outline"></ion-icon>
|
|
42
|
-
</ion-button>
|
|
43
|
-
</ion-buttons>
|
|
44
|
-
}
|
|
45
|
-
</ion-toolbar>
|
|
46
|
-
</ion-header>
|
|
47
|
-
|
|
48
|
-
<ion-content class="ion-padding">
|
|
49
|
-
<div [innerHTML]="content"></div>
|
|
50
|
-
</ion-content>
|
|
51
|
-
|
|
52
|
-
@if (buttons && buttons.length > 0) {
|
|
53
|
-
<ion-footer>
|
|
54
|
-
<ion-toolbar>
|
|
55
|
-
<div class="button-container">
|
|
56
|
-
@for (button of buttons; track button.text) {
|
|
57
|
-
<ion-button
|
|
58
|
-
[color]="button.color || 'medium'"
|
|
59
|
-
[fill]="button.fill || 'solid'"
|
|
60
|
-
[size]="button.size || 'default'"
|
|
61
|
-
[disabled]="button.disabled || button.loading"
|
|
62
|
-
[class]="button.cssClass"
|
|
63
|
-
(click)="onButtonClick(button)"
|
|
64
|
-
>
|
|
65
|
-
@if (button.loading) {
|
|
66
|
-
<ion-spinner name="crescent"></ion-spinner>
|
|
67
|
-
} @else {
|
|
68
|
-
{{ button.text }}
|
|
69
|
-
}
|
|
70
|
-
</ion-button>
|
|
71
|
-
}
|
|
72
|
-
</div>
|
|
73
|
-
</ion-toolbar>
|
|
74
|
-
</ion-footer>
|
|
75
|
-
}
|
|
76
|
-
`, isInline: true, styles: [".button-container{display:flex;justify-content:flex-end;gap:8px;padding:8px 0}ion-content{--padding-top: 16px;--padding-bottom: 16px}ion-footer ion-toolbar{--padding-start: 16px;--padding-end: 16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }] }); }
|
|
77
|
-
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SimpleModalContentComponent, decorators: [{
|
|
79
|
-
type: Component,
|
|
80
|
-
args: [{ selector: 'val-simple-modal-content', standalone: true, imports: [CommonModule, IonHeader, IonToolbar, IonTitle, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonSpinner], template: `
|
|
81
|
-
<ion-header>
|
|
82
|
-
<ion-toolbar>
|
|
83
|
-
<ion-title>{{ title }}</ion-title>
|
|
84
|
-
@if (showCloseButton) {
|
|
85
|
-
<ion-buttons slot="end">
|
|
86
|
-
<ion-button (click)="onDismiss('close')">
|
|
87
|
-
<ion-icon slot="icon-only" name="close-outline"></ion-icon>
|
|
88
|
-
</ion-button>
|
|
89
|
-
</ion-buttons>
|
|
90
|
-
}
|
|
91
|
-
</ion-toolbar>
|
|
92
|
-
</ion-header>
|
|
93
|
-
|
|
94
|
-
<ion-content class="ion-padding">
|
|
95
|
-
<div [innerHTML]="content"></div>
|
|
96
|
-
</ion-content>
|
|
97
|
-
|
|
98
|
-
@if (buttons && buttons.length > 0) {
|
|
99
|
-
<ion-footer>
|
|
100
|
-
<ion-toolbar>
|
|
101
|
-
<div class="button-container">
|
|
102
|
-
@for (button of buttons; track button.text) {
|
|
103
|
-
<ion-button
|
|
104
|
-
[color]="button.color || 'medium'"
|
|
105
|
-
[fill]="button.fill || 'solid'"
|
|
106
|
-
[size]="button.size || 'default'"
|
|
107
|
-
[disabled]="button.disabled || button.loading"
|
|
108
|
-
[class]="button.cssClass"
|
|
109
|
-
(click)="onButtonClick(button)"
|
|
110
|
-
>
|
|
111
|
-
@if (button.loading) {
|
|
112
|
-
<ion-spinner name="crescent"></ion-spinner>
|
|
113
|
-
} @else {
|
|
114
|
-
{{ button.text }}
|
|
115
|
-
}
|
|
116
|
-
</ion-button>
|
|
117
|
-
}
|
|
118
|
-
</div>
|
|
119
|
-
</ion-toolbar>
|
|
120
|
-
</ion-footer>
|
|
121
|
-
}
|
|
122
|
-
`, styles: [".button-container{display:flex;justify-content:flex-end;gap:8px;padding:8px 0}ion-content{--padding-top: 16px;--padding-bottom: 16px}ion-footer ion-toolbar{--padding-start: 16px;--padding-end: 16px}\n"] }]
|
|
123
|
-
}], propDecorators: { title: [{
|
|
124
|
-
type: Input
|
|
125
|
-
}], content: [{
|
|
126
|
-
type: Input
|
|
127
|
-
}], buttons: [{
|
|
128
|
-
type: Input
|
|
129
|
-
}], showCloseButton: [{
|
|
130
|
-
type: Input
|
|
131
|
-
}], _modalRef: [{
|
|
132
|
-
type: Input
|
|
133
|
-
}] } });
|
|
134
|
-
|
|
135
|
-
export { SimpleModalContentComponent };
|
|
136
|
-
//# sourceMappingURL=valtech-components-simple-modal-content.component-DQhEgUmS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"valtech-components-simple-modal-content.component-DQhEgUmS.mjs","sources":["../../../src/lib/services/modal/simple-modal-content.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { IonHeader, IonToolbar, IonTitle, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonSpinner } from '@ionic/angular/standalone';\nimport { addIcons } from 'ionicons';\nimport { closeOutline } from 'ionicons/icons';\nimport { ModalButton } from './types';\n\naddIcons({ closeOutline });\n\n/**\n * Internal component for simple content modals.\n * Used by ModalService.openSimple()\n */\n@Component({\n selector: 'val-simple-modal-content',\n standalone: true,\n imports: [CommonModule, IonHeader, IonToolbar, IonTitle, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonSpinner],\n template: `\n <ion-header>\n <ion-toolbar>\n <ion-title>{{ title }}</ion-title>\n @if (showCloseButton) {\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"onDismiss('close')\">\n <ion-icon slot=\"icon-only\" name=\"close-outline\"></ion-icon>\n </ion-button>\n </ion-buttons>\n }\n </ion-toolbar>\n </ion-header>\n\n <ion-content class=\"ion-padding\">\n <div [innerHTML]=\"content\"></div>\n </ion-content>\n\n @if (buttons && buttons.length > 0) {\n <ion-footer>\n <ion-toolbar>\n <div class=\"button-container\">\n @for (button of buttons; track button.text) {\n <ion-button\n [color]=\"button.color || 'medium'\"\n [fill]=\"button.fill || 'solid'\"\n [size]=\"button.size || 'default'\"\n [disabled]=\"button.disabled || button.loading\"\n [class]=\"button.cssClass\"\n (click)=\"onButtonClick(button)\"\n >\n @if (button.loading) {\n <ion-spinner name=\"crescent\"></ion-spinner>\n } @else {\n {{ button.text }}\n }\n </ion-button>\n }\n </div>\n </ion-toolbar>\n </ion-footer>\n }\n `,\n styles: [`\n .button-container {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n padding: 8px 0;\n }\n\n ion-content {\n --padding-top: 16px;\n --padding-bottom: 16px;\n }\n\n ion-footer ion-toolbar {\n --padding-start: 16px;\n --padding-end: 16px;\n }\n `],\n})\nexport class SimpleModalContentComponent {\n @Input() title: string = '';\n @Input() content: string = '';\n @Input() buttons: ModalButton[] = [];\n @Input() showCloseButton: boolean = true;\n\n // Injected by ModalService\n @Input() _modalRef: { dismiss: (data?: any, role?: string) => Promise<boolean> };\n\n async onButtonClick(button: ModalButton): Promise<void> {\n if (button.handler) {\n const result = await button.handler();\n // If handler returns false, don't dismiss\n if (result === false) {\n return;\n }\n }\n\n this._modalRef?.dismiss(undefined, button.role || 'confirm');\n }\n\n onDismiss(role: string): void {\n this._modalRef?.dismiss(undefined, role);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAOA,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AAE3B;;;AAGG;MAmEU,2BAA2B,CAAA;AAlExC,IAAA,WAAA,GAAA;QAmEW,IAAK,CAAA,KAAA,GAAW,EAAE,CAAC;QACnB,IAAO,CAAA,OAAA,GAAW,EAAE,CAAC;QACrB,IAAO,CAAA,OAAA,GAAkB,EAAE,CAAC;QAC5B,IAAe,CAAA,eAAA,GAAY,IAAI,CAAC;AAoB1C,KAAA;IAfC,MAAM,aAAa,CAAC,MAAmB,EAAA;AACrC,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE;AAClB,YAAA,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;;AAEtC,YAAA,IAAI,MAAM,KAAK,KAAK,EAAE;gBACpB,OAAO;aACR;SACF;AAED,QAAA,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC;KAC9D;AAED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