valtech-components 2.0.435 → 2.0.437
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/form/form.component.mjs +3 -3
- package/esm2022/lib/services/auth/auth.service.mjs +35 -25
- package/esm2022/lib/services/auth/types.mjs +1 -1
- package/fesm2022/valtech-components.mjs +41 -31
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/services/auth/auth.service.d.ts +7 -1
- package/lib/services/auth/types.d.ts +17 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, Input, Output, Injectable, inject, HostListener, Pipe, ChangeDetectionStrategy, ViewChild, ChangeDetectorRef, ElementRef, signal, computed, InjectionToken, makeEnvironmentProviders, PLATFORM_ID, NgZone, APP_INITIALIZER } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, Input, Output, Injectable, inject, HostListener, Pipe, ChangeDetectionStrategy, ViewChild, ChangeDetectorRef, ElementRef, signal, computed, InjectionToken, makeEnvironmentProviders, PLATFORM_ID, NgZone, Injector, APP_INITIALIZER } from '@angular/core';
|
|
3
3
|
import * as i2$1 from '@ionic/angular/standalone';
|
|
4
4
|
import { IonAvatar, IonCard, IonIcon, IonButton, IonSpinner, IonText, IonModal, IonHeader, IonToolbar, IonContent, IonButtons, IonTitle, IonProgressBar, IonSkeletonText, IonFab, IonFabButton, IonFabList, IonLabel, IonCardContent, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCheckbox, IonTextarea, IonDatetime, IonDatetimeButton, IonInput, IonSelect, IonSelectOption, IonRadioGroup, IonRadio, IonRange, IonSearchbar, IonSegment, IonSegmentButton, IonToggle, IonAccordion, IonAccordionGroup, IonItem, IonTabBar, IonTabButton, IonBadge, IonBreadcrumb, IonBreadcrumbs, IonChip, IonPopover, IonList, IonNote, ToastController as ToastController$1, IonCol, IonRow, IonMenuButton, IonFooter, IonListHeader, IonInfiniteScroll, IonInfiniteScrollContent, IonGrid, MenuController, IonMenu, IonMenuToggle, AlertController, ModalController } from '@ionic/angular/standalone';
|
|
5
5
|
import * as i1 from '@angular/common';
|
|
@@ -16591,7 +16591,7 @@ class FormComponent {
|
|
|
16591
16591
|
[props]="{
|
|
16592
16592
|
content: props.name,
|
|
16593
16593
|
color: 'dark',
|
|
16594
|
-
size: '
|
|
16594
|
+
size: 'medium',
|
|
16595
16595
|
}"
|
|
16596
16596
|
></val-display>
|
|
16597
16597
|
<div class="section" *ngFor="let s of props.sections">
|
|
@@ -16689,7 +16689,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
16689
16689
|
[props]="{
|
|
16690
16690
|
content: props.name,
|
|
16691
16691
|
color: 'dark',
|
|
16692
|
-
size: '
|
|
16692
|
+
size: 'medium',
|
|
16693
16693
|
}"
|
|
16694
16694
|
></val-display>
|
|
16695
16695
|
<div class="section" *ngFor="let s of props.sections">
|
|
@@ -21273,7 +21273,7 @@ function isEmulatorMode(config) {
|
|
|
21273
21273
|
* }
|
|
21274
21274
|
* ```
|
|
21275
21275
|
*/
|
|
21276
|
-
|
|
21276
|
+
class FirebaseService {
|
|
21277
21277
|
constructor() {
|
|
21278
21278
|
this.auth = inject(Auth);
|
|
21279
21279
|
this.config = inject(VALTECH_FIREBASE_CONFIG);
|
|
@@ -21507,8 +21507,8 @@ let FirebaseService$1 = class FirebaseService {
|
|
|
21507
21507
|
}
|
|
21508
21508
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FirebaseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
21509
21509
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FirebaseService, providedIn: 'root' }); }
|
|
21510
|
-
}
|
|
21511
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FirebaseService
|
|
21510
|
+
}
|
|
21511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FirebaseService, decorators: [{
|
|
21512
21512
|
type: Injectable,
|
|
21513
21513
|
args: [{ providedIn: 'root' }]
|
|
21514
21514
|
}], ctorParameters: () => [] });
|
|
@@ -23726,7 +23726,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
23726
23726
|
__proto__: null,
|
|
23727
23727
|
APP_IDS: APP_IDS,
|
|
23728
23728
|
FIREBASE_PROJECTS: FIREBASE_PROJECTS,
|
|
23729
|
-
FirebaseService: FirebaseService
|
|
23729
|
+
FirebaseService: FirebaseService,
|
|
23730
23730
|
FirestoreCollection: FirestoreCollection,
|
|
23731
23731
|
FirestoreService: FirestoreService,
|
|
23732
23732
|
MessagingService: MessagingService,
|
|
@@ -24338,17 +24338,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
24338
24338
|
args: [{ providedIn: 'root' }]
|
|
24339
24339
|
}], ctorParameters: () => [] });
|
|
24340
24340
|
|
|
24341
|
-
// Importación opcional de FirebaseService
|
|
24342
|
-
let FirebaseService = null;
|
|
24343
|
-
try {
|
|
24344
|
-
// Intenta importar FirebaseService si está disponible
|
|
24345
|
-
Promise.resolve().then(function () { return index; }).then((m) => {
|
|
24346
|
-
FirebaseService = m.FirebaseService;
|
|
24347
|
-
});
|
|
24348
|
-
}
|
|
24349
|
-
catch {
|
|
24350
|
-
// FirebaseService no disponible
|
|
24351
|
-
}
|
|
24352
24341
|
/**
|
|
24353
24342
|
* Servicio principal de autenticación.
|
|
24354
24343
|
*
|
|
@@ -24376,6 +24365,7 @@ class AuthService {
|
|
|
24376
24365
|
this.config = inject(VALTECH_AUTH_CONFIG);
|
|
24377
24366
|
this.http = inject(HttpClient);
|
|
24378
24367
|
this.router = inject(Router);
|
|
24368
|
+
this.injector = inject(Injector);
|
|
24379
24369
|
this.stateService = inject(AuthStateService);
|
|
24380
24370
|
this.tokenService = inject(TokenService);
|
|
24381
24371
|
this.storageService = inject(AuthStorageService);
|
|
@@ -24478,6 +24468,16 @@ class AuthService {
|
|
|
24478
24468
|
}
|
|
24479
24469
|
}), catchError((error) => this.handleAuthError(error)));
|
|
24480
24470
|
}
|
|
24471
|
+
/**
|
|
24472
|
+
* Registra un nuevo usuario.
|
|
24473
|
+
* El usuario queda en estado PENDING hasta verificar su email.
|
|
24474
|
+
*/
|
|
24475
|
+
signup(request) {
|
|
24476
|
+
this.stateService.clearError();
|
|
24477
|
+
return this.http
|
|
24478
|
+
.post(`${this.baseUrl}/signup`, request)
|
|
24479
|
+
.pipe(catchError((error) => this.handleAuthError(error)));
|
|
24480
|
+
}
|
|
24481
24481
|
/**
|
|
24482
24482
|
* Verifica código MFA.
|
|
24483
24483
|
*/
|
|
@@ -24729,26 +24729,36 @@ class AuthService {
|
|
|
24729
24729
|
async signInWithFirebase(firebaseToken) {
|
|
24730
24730
|
try {
|
|
24731
24731
|
// Importar FirebaseService dinámicamente
|
|
24732
|
-
const
|
|
24733
|
-
|
|
24734
|
-
|
|
24735
|
-
|
|
24736
|
-
|
|
24737
|
-
|
|
24732
|
+
const { FirebaseService } = await Promise.resolve().then(function () { return index; });
|
|
24733
|
+
// Obtener instancia del servicio desde el injector
|
|
24734
|
+
const firebaseService = this.injector.get(FirebaseService, null);
|
|
24735
|
+
if (firebaseService) {
|
|
24736
|
+
await firebaseService.signInWithCustomToken(firebaseToken);
|
|
24737
|
+
console.log('[ValtechAuth] Firebase signin successful');
|
|
24738
|
+
}
|
|
24739
|
+
else {
|
|
24740
|
+
console.warn('[ValtechAuth] FirebaseService not provided. Add provideValtechFirebase() to your providers.');
|
|
24741
|
+
}
|
|
24738
24742
|
}
|
|
24739
|
-
catch {
|
|
24740
|
-
|
|
24743
|
+
catch (error) {
|
|
24744
|
+
// No bloquear el login principal si Firebase falla
|
|
24745
|
+
console.error('[ValtechAuth] Firebase signin failed:', error);
|
|
24741
24746
|
}
|
|
24742
24747
|
}
|
|
24743
24748
|
async signOutFirebase() {
|
|
24744
24749
|
if (!this.config.enableFirebaseIntegration)
|
|
24745
24750
|
return;
|
|
24746
24751
|
try {
|
|
24747
|
-
|
|
24748
|
-
|
|
24752
|
+
const { FirebaseService } = await Promise.resolve().then(function () { return index; });
|
|
24753
|
+
const firebaseService = this.injector.get(FirebaseService, null);
|
|
24754
|
+
if (firebaseService) {
|
|
24755
|
+
await firebaseService.signOut();
|
|
24756
|
+
console.log('[ValtechAuth] Firebase signout successful');
|
|
24757
|
+
}
|
|
24749
24758
|
}
|
|
24750
|
-
catch {
|
|
24751
|
-
// Ignorar errores de Firebase
|
|
24759
|
+
catch (error) {
|
|
24760
|
+
// Ignorar errores de Firebase signout
|
|
24761
|
+
console.warn('[ValtechAuth] Firebase signout failed:', error);
|
|
24752
24762
|
}
|
|
24753
24763
|
}
|
|
24754
24764
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -26967,5 +26977,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
26967
26977
|
* Generated bundle index. Do not edit.
|
|
26968
26978
|
*/
|
|
26969
26979
|
|
|
26970
|
-
export { APP_IDS, ARTICLE_SPACING, AccordionComponent, ActionHeaderComponent, ActionType, AlertBoxComponent, ArticleBuilder, ArticleComponent, AuthService, AuthStateService, AuthStorageService, AuthSyncService, AvatarComponent, BannerComponent, BaseDefault, BlogPostBuilder, BoxComponent, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, COMMON_COUNTRY_CODES, COMMON_CURRENCIES, CURRENCY_INFO, CardComponent, CardSection, CardType, CardsCarouselComponent, CheckInputComponent, ChipGroupComponent, ClearDefault, ClearDefaultBlock, ClearDefaultFull, ClearDefaultRound, ClearDefaultRoundBlock, ClearDefaultRoundFull, CodeDisplayComponent, CommandDisplayComponent, CommentComponent, CommentInputComponent, CommentSectionComponent, CompanyFooterComponent, ComponentStates, ConfirmationDialogService, ContentLoaderComponent, ContentTransformer, CountdownComponent, CurrencyInputComponent, DEFAULT_AUTH_CONFIG, DEFAULT_CANCEL_BUTTON, DEFAULT_CONFIRM_BUTTON, DEFAULT_COUNTDOWN_LABELS, DEFAULT_COUNTDOWN_LABELS_EN, DEFAULT_EMPTY_STATE, DEFAULT_FEEDBACK_CONFIG, DEFAULT_FEEDBACK_TYPE_OPTIONS, DEFAULT_LEGEND_LABELS, DEFAULT_MODAL_CANCEL_BUTTON, DEFAULT_MODAL_CONFIRM_BUTTON, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PAYMENT_STATUS_COLORS, DEFAULT_PAYMENT_STATUS_LABELS, DEFAULT_PLATFORMS, DEFAULT_STATUS_COLORS, DEFAULT_STATUS_LABELS, DEFAULT_WINNER_LABELS, DataTableComponent, DateInputComponent, DateRangeInputComponent, DisplayComponent, DividerComponent, DocsBuilder, DownloadService, EmailInputComponent, ExpandableTextComponent, FIREBASE_PROJECTS, FabComponent, FeedbackFormComponent, FeedbackService, FileInputComponent, FirebaseService
|
|
26980
|
+
export { APP_IDS, ARTICLE_SPACING, AccordionComponent, ActionHeaderComponent, ActionType, AlertBoxComponent, ArticleBuilder, ArticleComponent, AuthService, AuthStateService, AuthStorageService, AuthSyncService, AvatarComponent, BannerComponent, BaseDefault, BlogPostBuilder, BoxComponent, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, COMMON_COUNTRY_CODES, COMMON_CURRENCIES, CURRENCY_INFO, CardComponent, CardSection, CardType, CardsCarouselComponent, CheckInputComponent, ChipGroupComponent, ClearDefault, ClearDefaultBlock, ClearDefaultFull, ClearDefaultRound, ClearDefaultRoundBlock, ClearDefaultRoundFull, CodeDisplayComponent, CommandDisplayComponent, CommentComponent, CommentInputComponent, CommentSectionComponent, CompanyFooterComponent, ComponentStates, ConfirmationDialogService, ContentLoaderComponent, ContentTransformer, CountdownComponent, CurrencyInputComponent, DEFAULT_AUTH_CONFIG, DEFAULT_CANCEL_BUTTON, DEFAULT_CONFIRM_BUTTON, DEFAULT_COUNTDOWN_LABELS, DEFAULT_COUNTDOWN_LABELS_EN, DEFAULT_EMPTY_STATE, DEFAULT_FEEDBACK_CONFIG, DEFAULT_FEEDBACK_TYPE_OPTIONS, DEFAULT_LEGEND_LABELS, DEFAULT_MODAL_CANCEL_BUTTON, DEFAULT_MODAL_CONFIRM_BUTTON, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PAYMENT_STATUS_COLORS, DEFAULT_PAYMENT_STATUS_LABELS, DEFAULT_PLATFORMS, DEFAULT_STATUS_COLORS, DEFAULT_STATUS_LABELS, DEFAULT_WINNER_LABELS, DataTableComponent, DateInputComponent, DateRangeInputComponent, DisplayComponent, DividerComponent, DocsBuilder, DownloadService, EmailInputComponent, ExpandableTextComponent, FIREBASE_PROJECTS, FabComponent, FeedbackFormComponent, FeedbackService, FileInputComponent, FirebaseService, FirestoreCollection, FirestoreService, FooterComponent, FooterLinksComponent, FormComponent, FormFooterComponent, FunHeaderComponent, GlowCardComponent, HeaderComponent, HintComponent, HorizontalScrollComponent, HourInputComponent, HrefComponent, INITIAL_AUTH_STATE, INITIAL_MFA_STATE, Icon, IconComponent, IconService, ImageComponent, InAppBrowserService, InfoComponent, InputType, ItemListComponent, LanguageSelectorComponent, LayeredCardComponent, LayoutComponent, LinkComponent, LinkProcessorService, LinksAccordionComponent, LinksCakeComponent, LocalStorageService, LocaleService, MODAL_SIZES, MOTION, MenuComponent, MessagingService, ModalService, MultiSelectSearchComponent, NavigationService, NewsBuilder, NoContentComponent, NotesBoxComponent, NumberFromToComponent, NumberInputComponent, NumberStepperComponent, OutlineDefault, OutlineDefaultBlock, OutlineDefaultFull, OutlineDefaultRound, OutlineDefaultRoundBlock, OutlineDefaultRoundFull, PLATFORM_CONFIGS, PageContentComponent, PageTemplateComponent, PageWrapperComponent, PaginationComponent, ParticipantCardComponent, PasswordInputComponent, PhoneInputComponent, PillComponent, PinInputComponent, PlainCodeBoxComponent, PopoverSelectorComponent, PriceTagComponent, PrimarySolidBlockButton, PrimarySolidBlockHrefButton, PrimarySolidBlockIconButton, PrimarySolidBlockIconHrefButton, PrimarySolidDefaultRoundButton, PrimarySolidDefaultRoundHrefButton, PrimarySolidDefaultRoundIconButton, PrimarySolidDefaultRoundIconHrefButton, PrimarySolidFullButton, PrimarySolidFullHrefButton, PrimarySolidFullIconButton, PrimarySolidFullIconHrefButton, PrimarySolidLargeRoundButton, PrimarySolidLargeRoundHrefButton, PrimarySolidLargeRoundIconButton, PrimarySolidLargeRoundIconHrefButton, PrimarySolidSmallRoundButton, PrimarySolidSmallRoundHrefButton, PrimarySolidSmallRoundIconButton, PrimarySolidSmallRoundIconHrefButton, ProcessLinksPipe, ProgressBarComponent, ProgressRingComponent, ProgressStatusComponent, PrompterComponent, QR_PRESETS, QrCodeComponent, QrGeneratorService, QueryBuilder, QuoteBoxComponent, RadioInputComponent, RaffleStatusCardComponent, RangeInputComponent, RatingComponent, RecapCardComponent, RightsFooterComponent, SHARED_EMULATOR_CONFIG, SKELETON_PRESETS, SearchSelectorComponent, SearchbarComponent, SecondarySolidBlockButton, SecondarySolidBlockHrefButton, SecondarySolidBlockIconButton, SecondarySolidBlockIconHrefButton, SecondarySolidDefaultRoundButton, SecondarySolidDefaultRoundHrefButton, SecondarySolidDefaultRoundIconButton, SecondarySolidDefaultRoundIconHrefButton, SecondarySolidFullButton, SecondarySolidFullHrefButton, SecondarySolidFullIconButton, SecondarySolidFullIconHrefButton, SecondarySolidLargeRoundButton, SecondarySolidLargeRoundHrefButton, SecondarySolidLargeRoundIconButton, SecondarySolidLargeRoundIconHrefButton, SecondarySolidSmallRoundButton, SecondarySolidSmallRoundHrefButton, SecondarySolidSmallRoundIconButton, SecondarySolidSmallRoundIconHrefButton, SegmentControlComponent, SelectSearchComponent, ShareButtonsComponent, SimpleComponent, SkeletonComponent, SolidBlockButton, SolidDefault, SolidDefaultBlock, SolidDefaultButton, SolidDefaultFull, SolidDefaultRound, SolidDefaultRoundBlock, SolidDefaultRoundButton, SolidDefaultRoundFull, SolidFullButton, SolidLargeButton, SolidLargeRoundButton, SolidSmallButton, SolidSmallRoundButton, StatsCardComponent, StepperComponent, StorageService, SwipeCarouselComponent, TabbedContentComponent, TabsComponent, TestimonialCardComponent, TestimonialCarouselComponent, TextComponent, TextInputComponent, TextareaInputComponent, ThemeOption, ThemeService, TicketGridComponent, TimelineComponent, TitleBlockComponent, TitleComponent, ToastService, ToggleInputComponent, TokenService, ToolbarActionType, ToolbarComponent, VALTECH_AUTH_CONFIG, VALTECH_FEEDBACK_CONFIG, VALTECH_FIREBASE_CONFIG, WinnerDisplayComponent, WizardComponent, WizardFooterComponent, applyDefaultValueToControl, authGuard, authInterceptor, blogPost, buildPath, collections, createFirebaseConfig, createGlowCardProps, createNumberFromToField, createTitleProps, docs, extractPathParams, getCollectionPath, getDocumentId, goToTop, guestGuard, hasEmulators, isAtEnd, isCollectionPath, isDocumentPath, isEmulatorMode, isValidPath, joinPath, maxLength, news, permissionGuard, permissionGuardFromRoute, provideValtechAuth, provideValtechAuthInterceptor, provideValtechFeedback, provideValtechFirebase, query, replaceSpecialChars, resolveColor, resolveInputDefaultValue, roleGuard, storagePaths, superAdminGuard, toArticle };
|
|
26971
26981
|
//# sourceMappingURL=valtech-components.mjs.map
|