@dereekb/dbx-firebase 2.1.0 → 3.0.0
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/_index.scss +18 -0
- package/esm2020/lib/auth/auth.mjs +10 -0
- package/esm2020/lib/auth/error.mjs +28 -0
- package/esm2020/lib/auth/firebase.auth.module.mjs +34 -0
- package/esm2020/lib/auth/index.mjs +6 -0
- package/esm2020/lib/auth/login/firebase.login.module.mjs +274 -0
- package/esm2020/lib/auth/login/index.mjs +26 -0
- package/esm2020/lib/auth/login/login.anonymous.component.mjs +22 -0
- package/esm2020/lib/auth/login/login.apple.component.mjs +22 -0
- package/esm2020/lib/auth/login/login.button.component.mjs +139 -0
- package/esm2020/lib/auth/login/login.component.mjs +43 -0
- package/esm2020/lib/auth/login/login.context.back.component.mjs +27 -0
- package/esm2020/lib/auth/login/login.context.directive.mjs +25 -0
- package/esm2020/lib/auth/login/login.context.mjs +7 -0
- package/esm2020/lib/auth/login/login.email.component.mjs +23 -0
- package/esm2020/lib/auth/login/login.email.content.component.mjs +105 -0
- package/esm2020/lib/auth/login/login.email.form.component.mjs +35 -0
- package/esm2020/lib/auth/login/login.email.recovery.form.component.mjs +21 -0
- package/esm2020/lib/auth/login/login.facebook.component.mjs +22 -0
- package/esm2020/lib/auth/login/login.github.component.mjs +22 -0
- package/esm2020/lib/auth/login/login.google.component.mjs +22 -0
- package/esm2020/lib/auth/login/login.list.component.mjs +87 -0
- package/esm2020/lib/auth/login/login.microsoft.component.mjs +22 -0
- package/esm2020/lib/auth/login/login.mjs +3 -0
- package/esm2020/lib/auth/login/login.password.mjs +4 -0
- package/esm2020/lib/auth/login/login.service.mjs +134 -0
- package/esm2020/lib/auth/login/login.terms.component.mjs +26 -0
- package/esm2020/lib/auth/login/login.terms.mjs +3 -0
- package/esm2020/lib/auth/login/login.terms.simple.component.mjs +39 -0
- package/esm2020/lib/auth/login/login.twitter.component.mjs +22 -0
- package/esm2020/lib/auth/login/register.component.mjs +24 -0
- package/esm2020/lib/auth/login/register.email.component.mjs +21 -0
- package/esm2020/lib/auth/service/firebase.auth.rxjs.mjs +39 -0
- package/esm2020/lib/auth/service/firebase.auth.service.mjs +99 -0
- package/esm2020/lib/auth/service/index.mjs +3 -0
- package/esm2020/lib/firebase/emulators.mjs +3 -0
- package/esm2020/lib/firebase/firebase.emulator.module.mjs +36 -0
- package/esm2020/lib/firebase/firebase.module.mjs +188 -0
- package/esm2020/lib/firebase/index.mjs +5 -0
- package/esm2020/lib/firebase/options.mjs +2 -0
- package/esm2020/lib/firestore/firebase.firestore.context.service.mjs +23 -0
- package/esm2020/lib/firestore/firebase.firestore.mjs +6 -0
- package/esm2020/lib/firestore/firebase.firestore.module.mjs +31 -0
- package/esm2020/lib/firestore/index.mjs +4 -0
- package/esm2020/lib/function/firebase.function.module.mjs +47 -0
- package/esm2020/lib/function/index.mjs +2 -0
- package/esm2020/lib/index.mjs +7 -2
- package/esm2020/lib/model/error.mjs +6 -0
- package/esm2020/lib/model/index.mjs +5 -0
- package/esm2020/lib/model/loader/collection.loader.instance.mjs +101 -0
- package/esm2020/lib/model/loader/collection.loader.mjs +2 -0
- package/esm2020/lib/model/loader/index.mjs +3 -0
- package/esm2020/lib/model/model.module.mjs +17 -0
- package/esm2020/lib/model/store/index.mjs +14 -0
- package/esm2020/lib/model/store/model.store.module.mjs +41 -0
- package/esm2020/lib/model/store/store.collection.change.directive.mjs +54 -0
- package/esm2020/lib/model/store/store.collection.change.if.directive.mjs +57 -0
- package/esm2020/lib/model/store/store.collection.directive.mjs +52 -0
- package/esm2020/lib/model/store/store.collection.list.directive.mjs +27 -0
- package/esm2020/lib/model/store/store.collection.mjs +50 -0
- package/esm2020/lib/model/store/store.document.auth.directive.mjs +33 -0
- package/esm2020/lib/model/store/store.document.directive.mjs +46 -0
- package/esm2020/lib/model/store/store.document.mjs +81 -0
- package/esm2020/lib/model/store/store.document.router.directive.mjs +53 -0
- package/esm2020/lib/model/store/store.subcollection.document.mjs +37 -0
- package/esm2020/lib/model/store/store.subcollection.mjs +37 -0
- package/esm2020/lib/model/store/store.subcollection.rxjs.mjs +42 -0
- package/esm2020/lib/module.mjs +17 -0
- package/fesm2015/dereekb-dbx-firebase.mjs +2266 -2
- package/fesm2015/dereekb-dbx-firebase.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-firebase.mjs +2247 -2
- package/fesm2020/dereekb-dbx-firebase.mjs.map +1 -1
- package/lib/auth/auth.d.ts +4 -0
- package/lib/auth/error.d.ts +9 -0
- package/lib/auth/firebase.auth.module.d.ts +12 -0
- package/lib/auth/index.d.ts +5 -0
- package/lib/auth/login/_login.scss +72 -0
- package/lib/auth/login/firebase.login.module.d.ts +48 -0
- package/lib/auth/login/index.d.ts +25 -0
- package/lib/auth/login/login.anonymous.component.d.ts +8 -0
- package/lib/auth/login/login.apple.component.d.ts +8 -0
- package/lib/auth/login/login.button.component.d.ts +51 -0
- package/lib/auth/login/login.component.d.ts +14 -0
- package/lib/auth/login/login.context.back.component.d.ts +9 -0
- package/lib/auth/login/login.context.d.ts +6 -0
- package/lib/auth/login/login.context.directive.d.ts +10 -0
- package/lib/auth/login/login.d.ts +7 -0
- package/lib/auth/login/login.email.component.d.ts +8 -0
- package/lib/auth/login/login.email.content.component.d.ts +39 -0
- package/lib/auth/login/login.email.form.component.d.ts +21 -0
- package/lib/auth/login/login.email.recovery.form.component.d.ts +11 -0
- package/lib/auth/login/login.facebook.component.d.ts +8 -0
- package/lib/auth/login/login.github.component.d.ts +8 -0
- package/lib/auth/login/login.google.component.d.ts +8 -0
- package/lib/auth/login/login.list.component.d.ts +28 -0
- package/lib/auth/login/login.microsoft.component.d.ts +8 -0
- package/lib/auth/login/login.password.d.ts +4 -0
- package/lib/auth/login/login.service.d.ts +115 -0
- package/lib/auth/login/login.terms.component.d.ts +10 -0
- package/lib/auth/login/login.terms.d.ts +4 -0
- package/lib/auth/login/login.terms.simple.component.d.ts +11 -0
- package/lib/auth/login/login.twitter.component.d.ts +8 -0
- package/lib/auth/login/register.component.d.ts +13 -0
- package/lib/auth/login/register.email.component.d.ts +8 -0
- package/lib/auth/service/firebase.auth.rxjs.d.ts +21 -0
- package/lib/auth/service/firebase.auth.service.d.ts +49 -0
- package/lib/auth/service/index.d.ts +2 -0
- package/lib/firebase/emulators.d.ts +52 -0
- package/lib/firebase/firebase.emulator.module.d.ts +12 -0
- package/lib/firebase/firebase.module.d.ts +50 -0
- package/lib/firebase/index.d.ts +4 -0
- package/lib/firebase/options.d.ts +6 -0
- package/lib/firestore/firebase.firestore.context.service.d.ts +11 -0
- package/lib/firestore/firebase.firestore.d.ts +5 -0
- package/lib/firestore/firebase.firestore.module.d.ts +17 -0
- package/lib/firestore/index.d.ts +3 -0
- package/lib/function/firebase.function.module.d.ts +24 -0
- package/lib/function/index.d.ts +1 -0
- package/lib/index.d.ts +6 -1
- package/lib/model/error.d.ts +5 -0
- package/lib/model/index.d.ts +4 -0
- package/lib/model/loader/collection.loader.d.ts +38 -0
- package/lib/model/loader/collection.loader.instance.d.ts +52 -0
- package/lib/model/loader/index.d.ts +2 -0
- package/lib/model/model.module.d.ts +7 -0
- package/lib/model/store/index.d.ts +13 -0
- package/lib/model/store/model.store.module.d.ts +11 -0
- package/lib/model/store/store.collection.change.directive.d.ts +30 -0
- package/lib/model/store/store.collection.change.if.directive.d.ts +24 -0
- package/lib/model/store/store.collection.d.ts +47 -0
- package/lib/model/store/store.collection.directive.d.ts +30 -0
- package/lib/model/store/store.collection.list.directive.d.ts +13 -0
- package/lib/model/store/store.document.auth.directive.d.ts +19 -0
- package/lib/model/store/store.document.d.ts +69 -0
- package/lib/model/store/store.document.directive.d.ts +34 -0
- package/lib/model/store/store.document.router.directive.d.ts +25 -0
- package/lib/model/store/store.subcollection.d.ts +31 -0
- package/lib/model/store/store.subcollection.document.d.ts +31 -0
- package/lib/model/store/store.subcollection.rxjs.d.ts +23 -0
- package/lib/module.d.ts +7 -0
- package/lib/style/_all-core.scss +6 -0
- package/lib/style/_all-theme.scss +6 -0
- package/lib/style/_all-typography.scss +6 -0
- package/lib/style/_config.scss +20 -0
- package/lib/style/_core.scss +9 -0
- package/lib/style/_mixin.scss +3 -0
- package/lib/style/_theming.scss +19 -0
- package/lib/style/_variables.scss +1 -0
- package/package.json +21 -12
|
@@ -1,8 +1,2272 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i4 from '@angular/material/button';
|
|
2
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
3
|
+
import * as i2 from '@angular/material/icon';
|
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
+
import * as i6 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i0 from '@angular/core';
|
|
8
|
+
import { Injectable, Optional, Component, InjectionToken, Inject, Input, Directive, EventEmitter, Output, NgModule, Injector, forwardRef, Host } from '@angular/core';
|
|
9
|
+
import { of, switchMap, shareReplay, map, timeout, startWith, distinctUntilChanged, from, BehaviorSubject, combineLatest, tap, firstValueFrom, Subject, throttleTime, NEVER, filter, take, exhaustMap, first } from 'rxjs';
|
|
10
|
+
import * as i3 from '@dereekb/dbx-web';
|
|
11
|
+
import { DbxRouterAnchorModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';
|
|
12
|
+
import * as i3$1 from '@dereekb/dbx-core';
|
|
13
|
+
import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, AbstractForwardDbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponentModule, DbxAuthService, AbstractSubscriptionDirective, AbstractIfDirective, LockSetComponentStore } from '@dereekb/dbx-core';
|
|
14
|
+
import { filterMaybe, isNot, SubscriptionObject, cleanupDestroyable, accumulatorFlattenPageListLoadingState, useFirst, successResult, beginLoading, loadingStateFromObs, errorResult, cleanup } from '@dereekb/rxjs';
|
|
15
|
+
import * as i1 from '@angular/fire/auth';
|
|
16
|
+
import { authState, GoogleAuthProvider, FacebookAuthProvider, TwitterAuthProvider, GithubAuthProvider, signInWithPopup, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInAnonymously, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';
|
|
17
|
+
import { sendPasswordResetEmail } from 'firebase/auth';
|
|
18
|
+
import { addToSet, removeFromSet, filterMaybeValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, forEachKeyValue, readableError, isMaybeSo } from '@dereekb/util';
|
|
19
|
+
import * as i1$1 from '@dereekb/dbx-form';
|
|
20
|
+
import { AbstractAsyncFormlyFormDirective, usernamePasswordLoginFields, ProvideFormlyContext, AbstractSyncFormlyFormDirective, emailField, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule } from '@dereekb/dbx-form';
|
|
21
|
+
import { initializeApp } from 'firebase/app';
|
|
22
|
+
import * as i5 from '@angular/fire/app';
|
|
23
|
+
import { provideFirebaseApp } from '@angular/fire/app';
|
|
24
|
+
import * as i3$2 from '@angular/fire/storage';
|
|
25
|
+
import { provideStorage, getStorage, connectStorageEmulator } from '@angular/fire/storage';
|
|
26
|
+
import * as i4$1 from '@angular/fire/functions';
|
|
27
|
+
import { provideFunctions, getFunctions, connectFunctionsEmulator, Functions } from '@angular/fire/functions';
|
|
28
|
+
import * as i1$2 from '@angular/fire/firestore';
|
|
29
|
+
import { provideFirestore, getFirestore, connectFirestoreEmulator, enableIndexedDbPersistence, Firestore } from '@angular/fire/firestore';
|
|
30
|
+
import { firebaseFirestoreContextFactory, iterationQueryDocChangeWatcher, firebaseQueryItemAccumulator, documentDataWithId } from '@dereekb/firebase';
|
|
31
|
+
import { shareReplay as shareReplay$1 } from 'rxjs/operators';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Derives a user state from the input firebase auth service.
|
|
35
|
+
*
|
|
36
|
+
* @param dbxFirebaseAuthService
|
|
37
|
+
* @param stateForLoggedInUser Optional function that returns an observable for the user's state if they are logged in and not an anonymous user.
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
function authUserStateFromFirebaseAuthService(dbxFirebaseAuthService, stateForLoggedInUser = () => of('user')) {
|
|
41
|
+
return dbxFirebaseAuthService.hasAuthUser$.pipe(switchMap((hasUser) => {
|
|
42
|
+
let obs;
|
|
43
|
+
if (hasUser) {
|
|
44
|
+
obs = dbxFirebaseAuthService.isAnonymousUser$.pipe(switchMap((isAnon) => isAnon ? of('anon') : stateForLoggedInUser(dbxFirebaseAuthService)));
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
obs = of('none');
|
|
48
|
+
}
|
|
49
|
+
return obs;
|
|
50
|
+
}), shareReplay(1));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Convenience function to read a value from an IdTokenResult off of the current user.
|
|
54
|
+
*
|
|
55
|
+
* @param dbxFirebaseAuthService
|
|
56
|
+
* @param readBooleanFromIdToken
|
|
57
|
+
* @param defaultValue
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
function readValueFromIdToken(dbxFirebaseAuthService, readBooleanFromIdToken, defaultValue) {
|
|
61
|
+
return dbxFirebaseAuthService.currentAuthUserInfo$.pipe(switchMap((x) => {
|
|
62
|
+
if (x) {
|
|
63
|
+
return dbxFirebaseAuthService.idTokenResult$.pipe(switchMap(x => readBooleanFromIdToken(x)));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
return of(defaultValue);
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function authUserInfoFromAuthUser(user) {
|
|
72
|
+
return {
|
|
73
|
+
displayName: user === null || user === void 0 ? void 0 : user.displayName,
|
|
74
|
+
email: user.email,
|
|
75
|
+
phoneNumber: user.phoneNumber,
|
|
76
|
+
photoURL: user.photoURL,
|
|
77
|
+
uid: user.uid
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
class DbxFirebaseAuthServiceDelegate {
|
|
82
|
+
}
|
|
83
|
+
const DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE = {
|
|
84
|
+
authUserStateObs(dbxFirebaseAuthService) {
|
|
85
|
+
return authUserStateFromFirebaseAuthService(dbxFirebaseAuthService);
|
|
86
|
+
},
|
|
87
|
+
authRolesObs(dbxFirebaseAuthService) {
|
|
88
|
+
return dbxFirebaseAuthService.authUserState$.pipe(map(x => x === 'user' ? new Set(['user']) : new Set()));
|
|
89
|
+
},
|
|
90
|
+
isOnboarded(dbxFirebaseAuthService) {
|
|
91
|
+
return dbxFirebaseAuthService.authUserState$.pipe(map(x => x === 'user'));
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
class DbxFirebaseAuthService {
|
|
95
|
+
constructor(firebaseAuth, delegate) {
|
|
96
|
+
this.firebaseAuth = firebaseAuth;
|
|
97
|
+
this._authState$ = authState(this.firebaseAuth);
|
|
98
|
+
this.currentAuthUser$ = this._authState$.pipe(timeout({
|
|
99
|
+
first: 1000,
|
|
100
|
+
with: () => this._authState$.pipe(startWith(null))
|
|
101
|
+
}), distinctUntilChanged(), shareReplay(1));
|
|
102
|
+
this.currentAuthUserInfo$ = this.currentAuthUser$.pipe(map((x) => (x) ? authUserInfoFromAuthUser(x) : undefined));
|
|
103
|
+
this.authUser$ = this.currentAuthUser$.pipe(filterMaybe());
|
|
104
|
+
this.authUserInfo$ = this.authUser$.pipe(map(authUserInfoFromAuthUser));
|
|
105
|
+
this.hasAuthUser$ = this.currentAuthUser$.pipe(map(x => Boolean(x)), distinctUntilChanged(), shareReplay(1));
|
|
106
|
+
this.isAnonymousUser$ = this.authUser$.pipe(map(x => x.isAnonymous), distinctUntilChanged(), shareReplay(1));
|
|
107
|
+
this.isNotAnonymousUser$ = this.isAnonymousUser$.pipe(isNot());
|
|
108
|
+
this.isLoggedIn$ = this.hasAuthUser$;
|
|
109
|
+
this.isNotLoggedIn$ = this.isLoggedIn$.pipe(isNot());
|
|
110
|
+
this.onLogIn$ = loggedInObsFromIsLoggedIn(this.isLoggedIn$);
|
|
111
|
+
this.onLogOut$ = loggedOutObsFromIsLoggedIn(this.isLoggedIn$);
|
|
112
|
+
this.userIdentifier$ = this.currentAuthUser$.pipe(map(x => authUserIdentifier(x === null || x === void 0 ? void 0 : x.uid)));
|
|
113
|
+
this.idTokenResult$ = this.authUser$.pipe(switchMap(x => x.getIdTokenResult()));
|
|
114
|
+
this.claims$ = this.idTokenResult$.pipe(map(x => x.claims));
|
|
115
|
+
delegate = delegate !== null && delegate !== void 0 ? delegate : DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE;
|
|
116
|
+
this.authUserState$ = delegate.authUserStateObs(this).pipe(distinctUntilChanged(), shareReplay(1));
|
|
117
|
+
this.authRoles$ = delegate.authRolesObs(this);
|
|
118
|
+
this.isOnboarded$ = delegate.isOnboarded(this);
|
|
119
|
+
}
|
|
120
|
+
logInWithGoogle() {
|
|
121
|
+
return this.logInWithPopup(new GoogleAuthProvider());
|
|
122
|
+
}
|
|
123
|
+
logInWithFacebook() {
|
|
124
|
+
return this.logInWithPopup(new FacebookAuthProvider());
|
|
125
|
+
}
|
|
126
|
+
logInWithTwitter() {
|
|
127
|
+
return this.logInWithPopup(new TwitterAuthProvider());
|
|
128
|
+
}
|
|
129
|
+
logInWithGithub() {
|
|
130
|
+
return this.logInWithPopup(new GithubAuthProvider());
|
|
131
|
+
}
|
|
132
|
+
logInWithApple() {
|
|
133
|
+
throw new Error('todo');
|
|
134
|
+
}
|
|
135
|
+
logInWithMicrosoft() {
|
|
136
|
+
// return this.logInWithPopup(new MicrosoftAuthProvider());
|
|
137
|
+
throw new Error('todo');
|
|
138
|
+
}
|
|
139
|
+
logInWithPhone() {
|
|
140
|
+
throw new Error('todo');
|
|
141
|
+
// return signInWithPhoneNumber(this.firebaseAuth, )
|
|
142
|
+
}
|
|
143
|
+
logInWithPopup(provider, resolver) {
|
|
144
|
+
return signInWithPopup(this.firebaseAuth, provider, resolver);
|
|
145
|
+
}
|
|
146
|
+
registerWithEmailAndPassword(email, password) {
|
|
147
|
+
return createUserWithEmailAndPassword(this.firebaseAuth, email, password);
|
|
148
|
+
}
|
|
149
|
+
sendPasswordResetEmail(email) {
|
|
150
|
+
return sendPasswordResetEmail(this.firebaseAuth, email);
|
|
151
|
+
}
|
|
152
|
+
logInWithEmailAndPassword(email, password) {
|
|
153
|
+
return signInWithEmailAndPassword(this.firebaseAuth, email, password);
|
|
154
|
+
}
|
|
155
|
+
logInAsAnonymous() {
|
|
156
|
+
return signInAnonymously(this.firebaseAuth);
|
|
157
|
+
}
|
|
158
|
+
logOut() {
|
|
159
|
+
return this.firebaseAuth.signOut();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
DbxFirebaseAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService, deps: [{ token: i1.Auth }, { token: DbxFirebaseAuthServiceDelegate, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
163
|
+
DbxFirebaseAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService });
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService, decorators: [{
|
|
165
|
+
type: Injectable
|
|
166
|
+
}], ctorParameters: function () {
|
|
167
|
+
return [{ type: i1.Auth }, { type: DbxFirebaseAuthServiceDelegate, decorators: [{
|
|
168
|
+
type: Optional
|
|
169
|
+
}] }];
|
|
170
|
+
} });
|
|
171
|
+
|
|
172
|
+
class DbxFirebaseLoginTermsConfig {
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
class DbxFirebaseLoginTermsSimpleComponent {
|
|
176
|
+
constructor(dbxFirebaseLoginTermsConfig) {
|
|
177
|
+
this.dbxFirebaseLoginTermsConfig = dbxFirebaseLoginTermsConfig;
|
|
178
|
+
this.tosAnchor = {
|
|
179
|
+
url: this.dbxFirebaseLoginTermsConfig.tosUrl,
|
|
180
|
+
target: '_blank'
|
|
181
|
+
};
|
|
182
|
+
this.privacyAnchor = {
|
|
183
|
+
url: this.dbxFirebaseLoginTermsConfig.privacyUrl,
|
|
184
|
+
target: '_blank'
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
DbxFirebaseLoginTermsSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, deps: [{ token: DbxFirebaseLoginTermsConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
189
|
+
DbxFirebaseLoginTermsSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsSimpleComponent, selector: "ng-component", ngImport: i0, template: `
|
|
190
|
+
<div class="dbx-firebase-login-terms-view">
|
|
191
|
+
<dbx-link [anchor]="tosAnchor">Terms</dbx-link>
|
|
192
|
+
<span class="dbx-link-spacer"></span>
|
|
193
|
+
<dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
|
|
194
|
+
</div>
|
|
195
|
+
`, isInline: true, components: [{ type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }] });
|
|
196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, decorators: [{
|
|
197
|
+
type: Component,
|
|
198
|
+
args: [{
|
|
199
|
+
template: `
|
|
200
|
+
<div class="dbx-firebase-login-terms-view">
|
|
201
|
+
<dbx-link [anchor]="tosAnchor">Terms</dbx-link>
|
|
202
|
+
<span class="dbx-link-spacer"></span>
|
|
203
|
+
<dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
|
|
204
|
+
</div>
|
|
205
|
+
`
|
|
206
|
+
}]
|
|
207
|
+
}], ctorParameters: function () { return [{ type: DbxFirebaseLoginTermsConfig }]; } });
|
|
208
|
+
|
|
209
|
+
const DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG = {
|
|
210
|
+
minLength: 6
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Default providers to inject.
|
|
215
|
+
*/
|
|
216
|
+
const DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN = new InjectionToken('DefaultDbxFirebaseAuthLoginProviders');
|
|
217
|
+
const DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN = new InjectionToken('DefaultDbxFirebaseAuthLoginTermsComponentClass');
|
|
218
|
+
const DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN = new InjectionToken('DefaultDbxFirebaseAuthLoginPasswordConfig');
|
|
219
|
+
/**
|
|
220
|
+
* Service used for registering components used for logging in.
|
|
221
|
+
*
|
|
222
|
+
* Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.
|
|
223
|
+
*/
|
|
224
|
+
class DbxFirebaseAuthLoginService {
|
|
225
|
+
constructor(defaultProviders, passwordConfig, termsComponentClass = DbxFirebaseLoginTermsSimpleComponent) {
|
|
226
|
+
this.termsComponentClass = termsComponentClass;
|
|
227
|
+
this._enableAll = false;
|
|
228
|
+
this._providers = new Map();
|
|
229
|
+
this._assets = new Map();
|
|
230
|
+
this._enabled = new Set();
|
|
231
|
+
if (defaultProviders) {
|
|
232
|
+
defaultProviders.forEach((x) => this.register(x, false));
|
|
233
|
+
}
|
|
234
|
+
this._passwordConfig = passwordConfig !== null && passwordConfig !== void 0 ? passwordConfig : DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Used to register a provider. If a provider is already registered, this will override it by default.
|
|
238
|
+
*
|
|
239
|
+
* @param provider
|
|
240
|
+
* @param override
|
|
241
|
+
*/
|
|
242
|
+
register(provider, override = true) {
|
|
243
|
+
if (override || !this._providers.has(provider.loginMethodType)) {
|
|
244
|
+
this._providers.set(provider.loginMethodType, provider);
|
|
245
|
+
if (provider.assets) {
|
|
246
|
+
this.updateAssetsForProvider(provider.loginMethodType, provider.assets);
|
|
247
|
+
}
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Updates the assets for a provider type.
|
|
256
|
+
*
|
|
257
|
+
* @param type
|
|
258
|
+
* @param assets
|
|
259
|
+
*/
|
|
260
|
+
updateAssetsForProvider(type, assets) {
|
|
261
|
+
const current = this._assets.get(type);
|
|
262
|
+
const update = Object.assign(Object.assign({}, current), assets);
|
|
263
|
+
this._assets.set(type, update);
|
|
264
|
+
}
|
|
265
|
+
// MARK: Enable/Disable
|
|
266
|
+
/**
|
|
267
|
+
* Enables all providers and any providers that will be registered.
|
|
268
|
+
*/
|
|
269
|
+
setEnableAll(enableAll = true) {
|
|
270
|
+
this._enableAll = enableAll;
|
|
271
|
+
}
|
|
272
|
+
clearEnabled() {
|
|
273
|
+
this._enabled = new Set();
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Enables all of the specified types.
|
|
277
|
+
*
|
|
278
|
+
* @param types
|
|
279
|
+
*/
|
|
280
|
+
enable(types) {
|
|
281
|
+
addToSet(this._enabled, types);
|
|
282
|
+
}
|
|
283
|
+
disable(types) {
|
|
284
|
+
removeFromSet(this._enabled, types);
|
|
285
|
+
}
|
|
286
|
+
// MARK: Get
|
|
287
|
+
getRegisteredTypes() {
|
|
288
|
+
return Array.from(this._providers.keys());
|
|
289
|
+
}
|
|
290
|
+
getEnabledTypes() {
|
|
291
|
+
return (this._enableAll) ? this.getRegisteredTypes() : Array.from(this._enabled);
|
|
292
|
+
}
|
|
293
|
+
getLoginProvider(type) {
|
|
294
|
+
return this._providers.get(type);
|
|
295
|
+
}
|
|
296
|
+
getLoginProviders(types) {
|
|
297
|
+
return filterMaybeValues(mapIterable(types !== null && types !== void 0 ? types : [], (x) => this._providers.get(x)));
|
|
298
|
+
}
|
|
299
|
+
getRegisterProvider(type) {
|
|
300
|
+
return this._providers.get(type);
|
|
301
|
+
}
|
|
302
|
+
getRegisterProviders(types) {
|
|
303
|
+
return filterMaybeValues(mapIterable(types !== null && types !== void 0 ? types : [], (x) => this._providers.get(x))).filter(x => x.registrationComponentClass !== false);
|
|
304
|
+
}
|
|
305
|
+
getProviderAssets(type) {
|
|
306
|
+
return this._assets.get(type);
|
|
307
|
+
}
|
|
308
|
+
getPasswordConfig() {
|
|
309
|
+
return this._passwordConfig;
|
|
310
|
+
}
|
|
311
|
+
setPasswordConfig(passwordConfig) {
|
|
312
|
+
this._passwordConfig = passwordConfig;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
DbxFirebaseAuthLoginService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthLoginService, deps: [{ token: DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, optional: true }, { token: DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, optional: true }, { token: DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
316
|
+
DbxFirebaseAuthLoginService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthLoginService, providedIn: 'root' });
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthLoginService, decorators: [{
|
|
318
|
+
type: Injectable,
|
|
319
|
+
args: [{
|
|
320
|
+
providedIn: 'root',
|
|
321
|
+
}]
|
|
322
|
+
}], ctorParameters: function () {
|
|
323
|
+
return [{ type: undefined, decorators: [{
|
|
324
|
+
type: Optional
|
|
325
|
+
}, {
|
|
326
|
+
type: Inject,
|
|
327
|
+
args: [DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN]
|
|
328
|
+
}] }, { type: undefined, decorators: [{
|
|
329
|
+
type: Optional
|
|
330
|
+
}, {
|
|
331
|
+
type: Inject,
|
|
332
|
+
args: [DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN]
|
|
333
|
+
}] }, { type: i0.Type, decorators: [{
|
|
334
|
+
type: Optional
|
|
335
|
+
}, {
|
|
336
|
+
type: Inject,
|
|
337
|
+
args: [DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN]
|
|
338
|
+
}] }];
|
|
339
|
+
} });
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Injection token for a DbxInjectionContext for DbxFirebaseLoginContext.
|
|
343
|
+
*/
|
|
344
|
+
class DbxFirebaseLoginContext extends DbxInjectionContext {
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Login button and action.
|
|
349
|
+
*/
|
|
350
|
+
class DbxFirebaseLoginButtonComponent {
|
|
351
|
+
constructor() {
|
|
352
|
+
this.handleAction = (value) => {
|
|
353
|
+
const loginPromise = this.config.handleLogin();
|
|
354
|
+
return from(loginPromise);
|
|
355
|
+
};
|
|
356
|
+
this.onActionSuccess = (value) => {
|
|
357
|
+
// todo: show checkmark on success?
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
get iconUrl() {
|
|
361
|
+
var _a;
|
|
362
|
+
return (_a = this.config) === null || _a === void 0 ? void 0 : _a.iconUrl;
|
|
363
|
+
}
|
|
364
|
+
get icon() {
|
|
365
|
+
var _a;
|
|
366
|
+
return (_a = this.config) === null || _a === void 0 ? void 0 : _a.icon;
|
|
367
|
+
}
|
|
368
|
+
get text() {
|
|
369
|
+
var _a;
|
|
370
|
+
return (_a = this.config) === null || _a === void 0 ? void 0 : _a.text;
|
|
371
|
+
}
|
|
372
|
+
get buttonColor() {
|
|
373
|
+
var _a, _b;
|
|
374
|
+
return (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.buttonColor) !== null && _b !== void 0 ? _b : 'transparent';
|
|
375
|
+
}
|
|
376
|
+
get buttonTextColor() {
|
|
377
|
+
var _a;
|
|
378
|
+
return (_a = this.config) === null || _a === void 0 ? void 0 : _a.buttonTextColor;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
DbxFirebaseLoginButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
382
|
+
DbxFirebaseLoginButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: { config: "config" }, host: { classAttribute: "dbx-firebase-login-button" }, ngImport: i0, template: `
|
|
383
|
+
<ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue
|
|
384
|
+
[dbxActionSuccessHandler]="onActionSuccess">
|
|
385
|
+
<dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
|
|
386
|
+
<div class="dbx-firebase-login-button-content">
|
|
387
|
+
<span class="dbx-firebase-login-button-icon dbx-icon-spacer">
|
|
388
|
+
<img *ngIf="iconUrl" [src]="iconUrl"/>
|
|
389
|
+
<mat-icon *ngIf="icon">{{icon}}</mat-icon>
|
|
390
|
+
</span>
|
|
391
|
+
<span class="dbx-firebase-login-button-text">{{ text }}</span>
|
|
392
|
+
</div>
|
|
393
|
+
</dbx-button>
|
|
394
|
+
</ng-container>
|
|
395
|
+
`, isInline: true, components: [{ type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionValueDirective, selector: "[dbxActionValue]", inputs: ["dbxActionValue"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i3$1.DbxActionSuccessHandlerDirective, selector: "[dbxActionSuccessHandler]", inputs: ["dbxActionSuccessHandler"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonComponent, decorators: [{
|
|
397
|
+
type: Component,
|
|
398
|
+
args: [{
|
|
399
|
+
selector: 'dbx-firebase-login-button',
|
|
400
|
+
template: `
|
|
401
|
+
<ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue
|
|
402
|
+
[dbxActionSuccessHandler]="onActionSuccess">
|
|
403
|
+
<dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
|
|
404
|
+
<div class="dbx-firebase-login-button-content">
|
|
405
|
+
<span class="dbx-firebase-login-button-icon dbx-icon-spacer">
|
|
406
|
+
<img *ngIf="iconUrl" [src]="iconUrl"/>
|
|
407
|
+
<mat-icon *ngIf="icon">{{icon}}</mat-icon>
|
|
408
|
+
</span>
|
|
409
|
+
<span class="dbx-firebase-login-button-text">{{ text }}</span>
|
|
410
|
+
</div>
|
|
411
|
+
</dbx-button>
|
|
412
|
+
</ng-container>
|
|
413
|
+
`,
|
|
414
|
+
host: {
|
|
415
|
+
'class': 'dbx-firebase-login-button'
|
|
416
|
+
}
|
|
417
|
+
}]
|
|
418
|
+
}], propDecorators: { config: [{
|
|
419
|
+
type: Input
|
|
420
|
+
}] } });
|
|
421
|
+
class DbxFirebaseLoginButtonContainerComponent {
|
|
422
|
+
}
|
|
423
|
+
DbxFirebaseLoginButtonContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
424
|
+
DbxFirebaseLoginButtonContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container", ngImport: i0, template: `
|
|
425
|
+
<div class="dbx-firebase-login-button-container">
|
|
426
|
+
<ng-content></ng-content>
|
|
427
|
+
</div>
|
|
428
|
+
`, isInline: true });
|
|
429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, decorators: [{
|
|
430
|
+
type: Component,
|
|
431
|
+
args: [{
|
|
432
|
+
selector: 'dbx-firebase-login-button-container',
|
|
433
|
+
template: `
|
|
434
|
+
<div class="dbx-firebase-login-button-container">
|
|
435
|
+
<ng-content></ng-content>
|
|
436
|
+
</div>
|
|
437
|
+
`
|
|
438
|
+
}]
|
|
439
|
+
}] });
|
|
440
|
+
const DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE = `
|
|
441
|
+
<dbx-firebase-login-button-container>
|
|
442
|
+
<dbx-firebase-login-button [config]="config"></dbx-firebase-login-button>
|
|
443
|
+
</dbx-firebase-login-button-container>
|
|
444
|
+
`;
|
|
445
|
+
class AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
446
|
+
constructor(dbxFirebaseAuthService, dbxFirebaseAuthLoginService, dbxFirebaseLoginContext) {
|
|
447
|
+
this.dbxFirebaseAuthService = dbxFirebaseAuthService;
|
|
448
|
+
this.dbxFirebaseAuthLoginService = dbxFirebaseAuthLoginService;
|
|
449
|
+
this.dbxFirebaseLoginContext = dbxFirebaseLoginContext;
|
|
450
|
+
}
|
|
451
|
+
ngOnInit() {
|
|
452
|
+
var _a;
|
|
453
|
+
const assets = this.assetConfig;
|
|
454
|
+
this._config = {
|
|
455
|
+
text: (_a = assets.loginText) !== null && _a !== void 0 ? _a : `<loginText not configured>`,
|
|
456
|
+
icon: assets.loginIcon,
|
|
457
|
+
iconUrl: assets.logoUrl,
|
|
458
|
+
buttonColor: assets.backgroundColor,
|
|
459
|
+
buttonTextColor: assets.textColor,
|
|
460
|
+
handleLogin: () => this.handleLogin()
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
get providerConfig() {
|
|
464
|
+
return this.dbxFirebaseAuthLoginService.getLoginProvider(this.loginProvider);
|
|
465
|
+
}
|
|
466
|
+
get assetConfig() {
|
|
467
|
+
var _a;
|
|
468
|
+
return (_a = this.dbxFirebaseAuthLoginService.getProviderAssets(this.loginProvider)) !== null && _a !== void 0 ? _a : {};
|
|
469
|
+
}
|
|
470
|
+
get config() {
|
|
471
|
+
return this._config;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
AbstractConfiguredDbxFirebaseLoginButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractConfiguredDbxFirebaseLoginButtonDirective, deps: [{ token: DbxFirebaseAuthService }, { token: DbxFirebaseAuthLoginService }, { token: DbxFirebaseLoginContext }], target: i0.ɵɵFactoryTarget.Directive });
|
|
475
|
+
AbstractConfiguredDbxFirebaseLoginButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractConfiguredDbxFirebaseLoginButtonDirective, ngImport: i0 });
|
|
476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractConfiguredDbxFirebaseLoginButtonDirective, decorators: [{
|
|
477
|
+
type: Directive
|
|
478
|
+
}], ctorParameters: function () { return [{ type: DbxFirebaseAuthService }, { type: DbxFirebaseAuthLoginService }, { type: DbxFirebaseLoginContext }]; } });
|
|
479
|
+
|
|
480
|
+
class DbxFirebaseLoginAppleComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
481
|
+
constructor() {
|
|
482
|
+
super(...arguments);
|
|
483
|
+
this.loginProvider = 'apple';
|
|
484
|
+
}
|
|
485
|
+
handleLogin() {
|
|
486
|
+
return this.dbxFirebaseAuthService.logInWithApple();
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
DbxFirebaseLoginAppleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginAppleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
490
|
+
DbxFirebaseLoginAppleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginAppleComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n", isInline: true, components: [{ type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }, { type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }] });
|
|
491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginAppleComponent, decorators: [{
|
|
492
|
+
type: Component,
|
|
493
|
+
args: [{
|
|
494
|
+
template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE
|
|
495
|
+
}]
|
|
496
|
+
}] });
|
|
497
|
+
|
|
498
|
+
const DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY = 'default';
|
|
499
|
+
const OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY = 'oauth';
|
|
500
|
+
|
|
501
|
+
class DbxFirebaseLoginAnonymousComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
502
|
+
constructor() {
|
|
503
|
+
super(...arguments);
|
|
504
|
+
this.loginProvider = 'anonymous';
|
|
505
|
+
}
|
|
506
|
+
handleLogin() {
|
|
507
|
+
return this.dbxFirebaseAuthService.logInAsAnonymous();
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
DbxFirebaseLoginAnonymousComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginAnonymousComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
511
|
+
DbxFirebaseLoginAnonymousComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginAnonymousComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n", isInline: true, components: [{ type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }, { type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }] });
|
|
512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginAnonymousComponent, decorators: [{
|
|
513
|
+
type: Component,
|
|
514
|
+
args: [{
|
|
515
|
+
template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE
|
|
516
|
+
}]
|
|
517
|
+
}] });
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Pre-configured login component that displays all configured login types.
|
|
521
|
+
*/
|
|
522
|
+
class DbxFirebaseLoginListComponent {
|
|
523
|
+
constructor(dbxFirebaseAuthLoginService) {
|
|
524
|
+
this.dbxFirebaseAuthLoginService = dbxFirebaseAuthLoginService;
|
|
525
|
+
this._loginMode = new BehaviorSubject('login');
|
|
526
|
+
this._inputProviderCategories = new BehaviorSubject(undefined);
|
|
527
|
+
this._omitProviderTypes = new BehaviorSubject(undefined);
|
|
528
|
+
this._inputProviderTypes = new BehaviorSubject(undefined);
|
|
529
|
+
this.providerTypes$ = combineLatest([this._inputProviderTypes, this._omitProviderTypes]).pipe(map(([providerTypes, omitProviderTypes]) => {
|
|
530
|
+
const baseTypes = (providerTypes) ? asArray(providerTypes) : this.dbxFirebaseAuthLoginService.getEnabledTypes();
|
|
531
|
+
const types = (omitProviderTypes) ? excludeValuesFromArray(baseTypes, asArray(omitProviderTypes)) : baseTypes;
|
|
532
|
+
return types;
|
|
533
|
+
}), shareReplay(1));
|
|
534
|
+
this.providers$ = combineLatest([this.providerTypes$, this._inputProviderCategories]).pipe(map(([x, inputProviderCategories]) => {
|
|
535
|
+
const providerCategories = asArray(inputProviderCategories);
|
|
536
|
+
let providers = this.dbxFirebaseAuthLoginService.getLoginProviders(x);
|
|
537
|
+
if (providerCategories.length) {
|
|
538
|
+
const categories = new Set(providerCategories);
|
|
539
|
+
providers = providers.filter(x => { var _a; return containsStringAnyCase(categories, (_a = x.category) !== null && _a !== void 0 ? _a : ''); });
|
|
540
|
+
}
|
|
541
|
+
return providers;
|
|
542
|
+
}));
|
|
543
|
+
this.providerInjectionConfigs$ = combineLatest([this._loginMode, this.providers$]).pipe(map(([mode, providers]) => {
|
|
544
|
+
const mapFn = (mode === 'register') ?
|
|
545
|
+
((x) => { var _a; return ({ componentClass: (_a = x.registrationComponentClass) !== null && _a !== void 0 ? _a : x.componentClass }); }) :
|
|
546
|
+
((x) => ({ componentClass: x.componentClass }));
|
|
547
|
+
return providers.map(mapFn);
|
|
548
|
+
}));
|
|
549
|
+
}
|
|
550
|
+
ngOnDestroy() {
|
|
551
|
+
this._loginMode.complete();
|
|
552
|
+
this._inputProviderCategories.complete();
|
|
553
|
+
this._omitProviderTypes.complete();
|
|
554
|
+
this._inputProviderTypes.complete();
|
|
555
|
+
}
|
|
556
|
+
set loginMode(loginMode) {
|
|
557
|
+
this._loginMode.next(loginMode);
|
|
558
|
+
}
|
|
559
|
+
set providerTypes(providerTypes) {
|
|
560
|
+
this._inputProviderTypes.next(providerTypes);
|
|
561
|
+
}
|
|
562
|
+
set omitProviderTypes(providerTypes) {
|
|
563
|
+
this._omitProviderTypes.next(providerTypes);
|
|
564
|
+
}
|
|
565
|
+
set providerCategories(providerCategories) {
|
|
566
|
+
this._inputProviderCategories.next(providerCategories);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
DbxFirebaseLoginListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginListComponent, deps: [{ token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.Component });
|
|
570
|
+
DbxFirebaseLoginListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginListComponent, selector: "dbx-firebase-login-list", inputs: { loginMode: "loginMode", providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, host: { classAttribute: "dbx-firebase-login-list" }, ngImport: i0, template: `
|
|
571
|
+
<div class="dbx-firebase-login-item" *ngFor="let config of (providerInjectionConfigs$ | async)">
|
|
572
|
+
<dbx-injection [config]="config"></dbx-injection>
|
|
573
|
+
</div>
|
|
574
|
+
`, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6.AsyncPipe } });
|
|
575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginListComponent, decorators: [{
|
|
576
|
+
type: Component,
|
|
577
|
+
args: [{
|
|
578
|
+
selector: 'dbx-firebase-login-list',
|
|
579
|
+
template: `
|
|
580
|
+
<div class="dbx-firebase-login-item" *ngFor="let config of (providerInjectionConfigs$ | async)">
|
|
581
|
+
<dbx-injection [config]="config"></dbx-injection>
|
|
582
|
+
</div>
|
|
583
|
+
`,
|
|
584
|
+
host: {
|
|
585
|
+
'class': 'dbx-firebase-login-list'
|
|
586
|
+
}
|
|
587
|
+
}]
|
|
588
|
+
}], ctorParameters: function () { return [{ type: DbxFirebaseAuthLoginService }]; }, propDecorators: { loginMode: [{
|
|
589
|
+
type: Input
|
|
590
|
+
}], providerTypes: [{
|
|
591
|
+
type: Input
|
|
592
|
+
}], omitProviderTypes: [{
|
|
593
|
+
type: Input
|
|
594
|
+
}], providerCategories: [{
|
|
595
|
+
type: Input
|
|
596
|
+
}] } });
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* DbxFirebaseLoginContext implementation.
|
|
600
|
+
*/
|
|
601
|
+
class DbxFirebaseLoginContextDirective extends AbstractForwardDbxInjectionContextDirective {
|
|
602
|
+
}
|
|
603
|
+
DbxFirebaseLoginContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
604
|
+
DbxFirebaseLoginContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]", providers: [{
|
|
605
|
+
provide: DbxFirebaseLoginContext,
|
|
606
|
+
useExisting: DbxFirebaseLoginContextDirective
|
|
607
|
+
}], usesInheritance: true, ngImport: i0 });
|
|
608
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextDirective, decorators: [{
|
|
609
|
+
type: Directive,
|
|
610
|
+
args: [{
|
|
611
|
+
'selector': '[dbxFirebaseLoginContext]',
|
|
612
|
+
providers: [{
|
|
613
|
+
provide: DbxFirebaseLoginContext,
|
|
614
|
+
useExisting: DbxFirebaseLoginContextDirective
|
|
615
|
+
}]
|
|
616
|
+
}]
|
|
617
|
+
}] });
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Pre-configured login component that displays all configured login types.
|
|
621
|
+
*/
|
|
622
|
+
class DbxFirebaseLoginComponent {
|
|
623
|
+
constructor() {
|
|
624
|
+
this.loginMode = 'login';
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
DbxFirebaseLoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
628
|
+
DbxFirebaseLoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginComponent, selector: "dbx-firebase-login", inputs: { loginMode: "loginMode", providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, host: { properties: { "class": "{ \"dbx-firebase-register\": loginMode === \"register\" }" }, classAttribute: "d-block dbx-firebase-login" }, ngImport: i0, template: `
|
|
629
|
+
<ng-container *dbxInjectionContext dbxFirebaseLoginContext>
|
|
630
|
+
<dbx-firebase-login-list [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories" [loginMode]="loginMode"></dbx-firebase-login-list>
|
|
631
|
+
</ng-container>
|
|
632
|
+
`, isInline: true, components: [{ type: DbxFirebaseLoginListComponent, selector: "dbx-firebase-login-list", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }], directives: [{ type: i3$1.DbxInjectionContextDirective, selector: "[dbxInjectionContext]", inputs: ["config"] }, { type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]" }] });
|
|
633
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginComponent, decorators: [{
|
|
634
|
+
type: Component,
|
|
635
|
+
args: [{
|
|
636
|
+
selector: 'dbx-firebase-login',
|
|
637
|
+
template: `
|
|
638
|
+
<ng-container *dbxInjectionContext dbxFirebaseLoginContext>
|
|
639
|
+
<dbx-firebase-login-list [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories" [loginMode]="loginMode"></dbx-firebase-login-list>
|
|
640
|
+
</ng-container>
|
|
641
|
+
`,
|
|
642
|
+
host: {
|
|
643
|
+
'class': 'd-block dbx-firebase-login',
|
|
644
|
+
'[class]': '{ "dbx-firebase-register": loginMode === "register" }'
|
|
645
|
+
}
|
|
646
|
+
}]
|
|
647
|
+
}], propDecorators: { loginMode: [{
|
|
648
|
+
type: Input
|
|
649
|
+
}], providerTypes: [{
|
|
650
|
+
type: Input
|
|
651
|
+
}], omitProviderTypes: [{
|
|
652
|
+
type: Input
|
|
653
|
+
}], providerCategories: [{
|
|
654
|
+
type: Input
|
|
655
|
+
}] } });
|
|
656
|
+
|
|
657
|
+
const FIREBASE_AUTH_USER_NOT_FOUND_ERROR = 'auth/user-not-found';
|
|
658
|
+
const FIREBASE_AUTH_NETWORK_REQUEST_ERROR = 'auth/network-request-error';
|
|
659
|
+
function firebaseAuthErrorToReadableError(inputError) {
|
|
660
|
+
const code = inputError.code;
|
|
661
|
+
let error;
|
|
662
|
+
switch (code) {
|
|
663
|
+
case FIREBASE_AUTH_USER_NOT_FOUND_ERROR:
|
|
664
|
+
error = {
|
|
665
|
+
code,
|
|
666
|
+
message: 'A user with this email address was not found.'
|
|
667
|
+
};
|
|
668
|
+
break;
|
|
669
|
+
case FIREBASE_AUTH_NETWORK_REQUEST_ERROR:
|
|
670
|
+
error = {
|
|
671
|
+
code,
|
|
672
|
+
message: 'Could not reach the server.'
|
|
673
|
+
};
|
|
674
|
+
break;
|
|
675
|
+
default:
|
|
676
|
+
error = {
|
|
677
|
+
code,
|
|
678
|
+
message: 'An error occured.'
|
|
679
|
+
};
|
|
680
|
+
break;
|
|
681
|
+
}
|
|
682
|
+
return error;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
class DbxFirebaseEmailFormComponent extends AbstractAsyncFormlyFormDirective {
|
|
686
|
+
constructor() {
|
|
687
|
+
super(...arguments);
|
|
688
|
+
this._config = new BehaviorSubject({ loginMode: 'login' });
|
|
689
|
+
this.fields$ = this._config.pipe(map(({ loginMode = 'login', passwordConfig }) => {
|
|
690
|
+
const fields = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword: (loginMode === 'register') });
|
|
691
|
+
return fields;
|
|
692
|
+
}));
|
|
693
|
+
}
|
|
694
|
+
set config(config) {
|
|
695
|
+
this._config.next(config);
|
|
696
|
+
}
|
|
697
|
+
ngOnDestroy() {
|
|
698
|
+
super.ngOnDestroy();
|
|
699
|
+
this._config.complete();
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
DbxFirebaseEmailFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
703
|
+
DbxFirebaseEmailFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: { config: "config" }, providers: [ProvideFormlyContext()], usesInheritance: true, ngImport: i0, template: `<dbx-formly></dbx-formly>`, isInline: true, components: [{ type: i1$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailFormComponent, decorators: [{
|
|
705
|
+
type: Component,
|
|
706
|
+
args: [{
|
|
707
|
+
template: `<dbx-formly></dbx-formly>`,
|
|
708
|
+
selector: 'dbx-firebase-email-form',
|
|
709
|
+
providers: [ProvideFormlyContext()]
|
|
710
|
+
}]
|
|
711
|
+
}], propDecorators: { config: [{
|
|
712
|
+
type: Input
|
|
713
|
+
}] } });
|
|
714
|
+
|
|
715
|
+
class DbxFirebaseEmailRecoveryFormComponent extends AbstractSyncFormlyFormDirective {
|
|
716
|
+
constructor() {
|
|
717
|
+
super(...arguments);
|
|
718
|
+
this.fields = [emailField({ required: true })];
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
DbxFirebaseEmailRecoveryFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
722
|
+
DbxFirebaseEmailRecoveryFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form", providers: [ProvideFormlyContext()], usesInheritance: true, ngImport: i0, template: `<dbx-formly></dbx-formly>`, isInline: true, components: [{ type: i1$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
723
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, decorators: [{
|
|
724
|
+
type: Component,
|
|
725
|
+
args: [{
|
|
726
|
+
template: `<dbx-formly></dbx-formly>`,
|
|
727
|
+
selector: 'dbx-firebase-email-recovery-form',
|
|
728
|
+
providers: [ProvideFormlyContext()]
|
|
729
|
+
}]
|
|
730
|
+
}] });
|
|
731
|
+
|
|
732
|
+
class DbxFirebaseLoginEmailContentComponent {
|
|
733
|
+
constructor(dbxFirebaseAuthService, config) {
|
|
734
|
+
this.dbxFirebaseAuthService = dbxFirebaseAuthService;
|
|
735
|
+
this.config = config;
|
|
736
|
+
this.formConfig = {
|
|
737
|
+
loginMode: this.config.loginMode,
|
|
738
|
+
passwordConfig: this.config.passwordConfig
|
|
739
|
+
};
|
|
740
|
+
this._emailMode = new BehaviorSubject('login');
|
|
741
|
+
this.emailMode$ = this._emailMode.asObservable();
|
|
742
|
+
this.forgotAnchor = {
|
|
743
|
+
onClick: () => {
|
|
744
|
+
this.openRecovery();
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
this.doneOrCancelled = new EventEmitter();
|
|
748
|
+
this.handleLoginAction = (value) => {
|
|
749
|
+
this.emailFormValue = value;
|
|
750
|
+
this.recoveryFormValue = { email: value.username }; // cache value for recovery
|
|
751
|
+
let result;
|
|
752
|
+
if (this.loginMode === 'register') {
|
|
753
|
+
result = this.dbxFirebaseAuthService.registerWithEmailAndPassword(value.username, value.password);
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
result = this.dbxFirebaseAuthService.logInWithEmailAndPassword(value.username, value.password).catch((error) => {
|
|
757
|
+
throw firebaseAuthErrorToReadableError(error);
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
return from(result).pipe(tap(() => {
|
|
761
|
+
this.doneOrCancelled.next(true);
|
|
762
|
+
}));
|
|
763
|
+
};
|
|
764
|
+
this.handleRecoveryAction = (value) => {
|
|
765
|
+
this.recoveryFormValue = value;
|
|
766
|
+
this.emailFormValue = { username: value.email, password: '' };
|
|
767
|
+
let result = this.dbxFirebaseAuthService.sendPasswordResetEmail(value.email);
|
|
768
|
+
return from(result).pipe(tap(() => {
|
|
769
|
+
this.onRecoveringSuccess();
|
|
770
|
+
}));
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
ngOnDestroy() {
|
|
774
|
+
this._emailMode.complete();
|
|
775
|
+
}
|
|
776
|
+
static openEmailLoginContext(dbxFirebaseLoginContext, config) {
|
|
777
|
+
return dbxFirebaseLoginContext.showContext({
|
|
778
|
+
config: {
|
|
779
|
+
componentClass: DbxFirebaseLoginEmailContentComponent,
|
|
780
|
+
data: config
|
|
781
|
+
},
|
|
782
|
+
use: (instance) => firstValueFrom(instance.doneOrCancelled)
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
get loginMode() {
|
|
786
|
+
return this.config.loginMode;
|
|
787
|
+
}
|
|
788
|
+
get isLoginMode() {
|
|
789
|
+
return this.loginMode === 'login';
|
|
790
|
+
}
|
|
791
|
+
get isRegisterMode() {
|
|
792
|
+
return this.loginMode === 'register';
|
|
793
|
+
}
|
|
794
|
+
get buttonText() {
|
|
795
|
+
return this.config.loginMode === 'register' ? 'Register' : 'Log In';
|
|
796
|
+
}
|
|
797
|
+
// MARK: Recovery
|
|
798
|
+
openRecovery() {
|
|
799
|
+
this._emailMode.next('recover');
|
|
800
|
+
}
|
|
801
|
+
// MARK: Recovering
|
|
802
|
+
onRecoveringSuccess() {
|
|
803
|
+
}
|
|
804
|
+
// MARK: Cancel
|
|
805
|
+
onCancel() {
|
|
806
|
+
this.doneOrCancelled.next(false);
|
|
807
|
+
}
|
|
808
|
+
onCancelReset() {
|
|
809
|
+
this.doneOrCancelled.next(false);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
DbxFirebaseLoginEmailContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, deps: [{ token: DbxFirebaseAuthService }, { token: DBX_INJECTION_COMPONENT_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
813
|
+
DbxFirebaseLoginEmailContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginEmailContentComponent, selector: "ng-component", ngImport: i0, template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\">\n </dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\">\n </dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n", components: [{ type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: ["config"] }, { type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }, { type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.DbxReadableErrorComponent, selector: "dbx-error", inputs: ["error"] }, { type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form" }], directives: [{ type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i1$1.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "formDisabledOnWorking"] }, { type: i1$1.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i3.DbxButtonSpacerDirective, selector: "dbx-button-spacer,dbxButtonSpacer" }, { type: i3.DbxActionErrorDirective, selector: "[dbxActionError]" }], pipes: { "async": i6.AsyncPipe } });
|
|
814
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, decorators: [{
|
|
815
|
+
type: Component,
|
|
816
|
+
args: [{ template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\">\n </dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\">\n </dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n" }]
|
|
817
|
+
}], ctorParameters: function () {
|
|
818
|
+
return [{ type: DbxFirebaseAuthService }, { type: undefined, decorators: [{
|
|
819
|
+
type: Inject,
|
|
820
|
+
args: [DBX_INJECTION_COMPONENT_DATA]
|
|
821
|
+
}] }];
|
|
822
|
+
} });
|
|
823
|
+
|
|
824
|
+
class DbxFirebaseLoginEmailComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
825
|
+
constructor() {
|
|
826
|
+
super(...arguments);
|
|
827
|
+
this.loginProvider = 'email';
|
|
828
|
+
}
|
|
829
|
+
handleLogin() {
|
|
830
|
+
return DbxFirebaseLoginEmailContentComponent.openEmailLoginContext(this.dbxFirebaseLoginContext, { loginMode: 'login', passwordConfig: this.dbxFirebaseAuthLoginService.getPasswordConfig() });
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
DbxFirebaseLoginEmailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
834
|
+
DbxFirebaseLoginEmailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginEmailComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n", isInline: true, components: [{ type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }, { type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }] });
|
|
835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailComponent, decorators: [{
|
|
836
|
+
type: Component,
|
|
837
|
+
args: [{
|
|
838
|
+
template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE
|
|
839
|
+
}]
|
|
840
|
+
}] });
|
|
841
|
+
|
|
842
|
+
class DbxFirebaseLoginFacebookComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
843
|
+
constructor() {
|
|
844
|
+
super(...arguments);
|
|
845
|
+
this.loginProvider = 'facebook';
|
|
846
|
+
}
|
|
847
|
+
handleLogin() {
|
|
848
|
+
return this.dbxFirebaseAuthService.logInWithFacebook();
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
DbxFirebaseLoginFacebookComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginFacebookComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
852
|
+
DbxFirebaseLoginFacebookComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginFacebookComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n", isInline: true, components: [{ type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }, { type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }] });
|
|
853
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginFacebookComponent, decorators: [{
|
|
854
|
+
type: Component,
|
|
855
|
+
args: [{
|
|
856
|
+
template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE
|
|
857
|
+
}]
|
|
858
|
+
}] });
|
|
859
|
+
|
|
860
|
+
class DbxFirebaseLoginGoogleComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
861
|
+
constructor() {
|
|
862
|
+
super(...arguments);
|
|
863
|
+
this.loginProvider = 'google';
|
|
864
|
+
}
|
|
865
|
+
handleLogin() {
|
|
866
|
+
return this.dbxFirebaseAuthService.logInWithGoogle();
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
DbxFirebaseLoginGoogleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginGoogleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
870
|
+
DbxFirebaseLoginGoogleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginGoogleComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n", isInline: true, components: [{ type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }, { type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }] });
|
|
871
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginGoogleComponent, decorators: [{
|
|
872
|
+
type: Component,
|
|
873
|
+
args: [{
|
|
874
|
+
template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE
|
|
875
|
+
}]
|
|
876
|
+
}] });
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* Pre-configured register component that displays all configured login types and their registration components.
|
|
880
|
+
*/
|
|
881
|
+
class DbxFirebaseRegisterComponent {
|
|
882
|
+
}
|
|
883
|
+
DbxFirebaseRegisterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
884
|
+
DbxFirebaseRegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseRegisterComponent, selector: "dbx-firebase-register", inputs: { providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, ngImport: i0, template: `<dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>`, isInline: true, components: [{ type: DbxFirebaseLoginComponent, selector: "dbx-firebase-login", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }] });
|
|
885
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterComponent, decorators: [{
|
|
886
|
+
type: Component,
|
|
887
|
+
args: [{
|
|
888
|
+
selector: 'dbx-firebase-register',
|
|
889
|
+
template: `<dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>`
|
|
890
|
+
}]
|
|
891
|
+
}], propDecorators: { providerTypes: [{
|
|
892
|
+
type: Input
|
|
893
|
+
}], omitProviderTypes: [{
|
|
894
|
+
type: Input
|
|
895
|
+
}], providerCategories: [{
|
|
896
|
+
type: Input
|
|
897
|
+
}] } });
|
|
898
|
+
|
|
899
|
+
class DbxFirebaseLoginGitHubComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
900
|
+
constructor() {
|
|
901
|
+
super(...arguments);
|
|
902
|
+
this.loginProvider = 'github';
|
|
903
|
+
}
|
|
904
|
+
handleLogin() {
|
|
905
|
+
return this.dbxFirebaseAuthService.logInWithGithub();
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
DbxFirebaseLoginGitHubComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginGitHubComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
909
|
+
DbxFirebaseLoginGitHubComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginGitHubComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n", isInline: true, components: [{ type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }, { type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }] });
|
|
910
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginGitHubComponent, decorators: [{
|
|
911
|
+
type: Component,
|
|
912
|
+
args: [{
|
|
913
|
+
template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE
|
|
914
|
+
}]
|
|
915
|
+
}] });
|
|
916
|
+
|
|
917
|
+
class DbxFirebaseLoginTwitterComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
918
|
+
constructor() {
|
|
919
|
+
super(...arguments);
|
|
920
|
+
this.loginProvider = 'twitter';
|
|
921
|
+
}
|
|
922
|
+
handleLogin() {
|
|
923
|
+
return this.dbxFirebaseAuthService.logInWithTwitter();
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
DbxFirebaseLoginTwitterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTwitterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
927
|
+
DbxFirebaseLoginTwitterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTwitterComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n", isInline: true, components: [{ type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }, { type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }] });
|
|
928
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTwitterComponent, decorators: [{
|
|
929
|
+
type: Component,
|
|
930
|
+
args: [{
|
|
931
|
+
template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE
|
|
932
|
+
}]
|
|
933
|
+
}] });
|
|
934
|
+
|
|
935
|
+
class DbxFirebaseLoginMicrosoftComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
936
|
+
constructor() {
|
|
937
|
+
super(...arguments);
|
|
938
|
+
this.loginProvider = 'microsoft';
|
|
939
|
+
}
|
|
940
|
+
handleLogin() {
|
|
941
|
+
return this.dbxFirebaseAuthService.logInWithMicrosoft();
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
DbxFirebaseLoginMicrosoftComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginMicrosoftComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
945
|
+
DbxFirebaseLoginMicrosoftComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginMicrosoftComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n", isInline: true, components: [{ type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }, { type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }] });
|
|
946
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginMicrosoftComponent, decorators: [{
|
|
947
|
+
type: Component,
|
|
948
|
+
args: [{
|
|
949
|
+
template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE
|
|
950
|
+
}]
|
|
951
|
+
}] });
|
|
952
|
+
|
|
953
|
+
class DbxFirebaseRegisterEmailComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
954
|
+
constructor() {
|
|
955
|
+
super(...arguments);
|
|
956
|
+
this.loginProvider = 'email';
|
|
957
|
+
}
|
|
958
|
+
handleLogin() {
|
|
959
|
+
return DbxFirebaseLoginEmailContentComponent.openEmailLoginContext(this.dbxFirebaseLoginContext, { loginMode: 'register', passwordConfig: this.dbxFirebaseAuthLoginService.getPasswordConfig() });
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
DbxFirebaseRegisterEmailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterEmailComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
963
|
+
DbxFirebaseRegisterEmailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseRegisterEmailComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n</dbx-firebase-login-button-container>\n", components: [{ type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }, { type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }] });
|
|
964
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterEmailComponent, decorators: [{
|
|
965
|
+
type: Component,
|
|
966
|
+
args: [{ template: "<dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"config\"></dbx-firebase-login-button>\n</dbx-firebase-login-button-container>\n" }]
|
|
967
|
+
}] });
|
|
968
|
+
|
|
969
|
+
class DbxFirebaseLoginTermsComponent {
|
|
970
|
+
constructor(dbxFirebaseAuthLoginService) {
|
|
971
|
+
this.dbxFirebaseAuthLoginService = dbxFirebaseAuthLoginService;
|
|
972
|
+
this.config = {
|
|
973
|
+
componentClass: this.dbxFirebaseAuthLoginService.termsComponentClass
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
DbxFirebaseLoginTermsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsComponent, deps: [{ token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.Component });
|
|
978
|
+
DbxFirebaseLoginTermsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsComponent, selector: "dbx-firebase-login-terms", host: { classAttribute: "dbx-firebase-login-terms d-block" }, ngImport: i0, template: `<dbx-injection [config]="config"></dbx-injection>`, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }] });
|
|
979
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsComponent, decorators: [{
|
|
980
|
+
type: Component,
|
|
981
|
+
args: [{
|
|
982
|
+
selector: 'dbx-firebase-login-terms',
|
|
983
|
+
template: `<dbx-injection [config]="config"></dbx-injection>`,
|
|
984
|
+
host: {
|
|
985
|
+
'class': 'dbx-firebase-login-terms d-block',
|
|
986
|
+
}
|
|
987
|
+
}]
|
|
988
|
+
}], ctorParameters: function () { return [{ type: DbxFirebaseAuthLoginService }]; } });
|
|
989
|
+
|
|
990
|
+
class DbxFirebaseLoginContextBackButtonComponent {
|
|
991
|
+
constructor() {
|
|
992
|
+
this.onCancel = new EventEmitter();
|
|
993
|
+
this.anchor = {
|
|
994
|
+
onClick: () => this.onCancel.emit()
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
DbxFirebaseLoginContextBackButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextBackButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
999
|
+
DbxFirebaseLoginContextBackButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextBackButtonComponent, selector: "dbx-firebase-login-context-back-button", outputs: { onCancel: "onCancel" }, ngImport: i0, template: `
|
|
1000
|
+
<dbx-link [anchor]="anchor">Choose other login method.</dbx-link>
|
|
1001
|
+
`, isInline: true, components: [{ type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }] });
|
|
1002
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextBackButtonComponent, decorators: [{
|
|
1003
|
+
type: Component,
|
|
1004
|
+
args: [{
|
|
1005
|
+
'selector': 'dbx-firebase-login-context-back-button',
|
|
1006
|
+
'template': `
|
|
1007
|
+
<dbx-link [anchor]="anchor">Choose other login method.</dbx-link>
|
|
1008
|
+
`
|
|
1009
|
+
}]
|
|
1010
|
+
}], propDecorators: { onCancel: [{
|
|
1011
|
+
type: Output
|
|
1012
|
+
}] } });
|
|
1013
|
+
|
|
1014
|
+
class DbxFirebaseLoginModuleRootConfig extends DbxFirebaseLoginTermsConfig {
|
|
1015
|
+
}
|
|
1016
|
+
function defaultFirebaseAuthLoginProvidersFactory() {
|
|
1017
|
+
// NOTE: Asset URLS are from Firebase.
|
|
1018
|
+
// https://firebase.google.com/docs/auth/web/firebaseui
|
|
1019
|
+
const baseFirebaseJSUrl = `https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth`;
|
|
1020
|
+
// NOTE: Colors are from https://brandcolors.net/
|
|
1021
|
+
return [{
|
|
1022
|
+
category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1023
|
+
loginMethodType: 'email',
|
|
1024
|
+
componentClass: DbxFirebaseLoginEmailComponent,
|
|
1025
|
+
registrationComponentClass: DbxFirebaseRegisterEmailComponent,
|
|
1026
|
+
assets: {
|
|
1027
|
+
logoUrl: `${baseFirebaseJSUrl}/mail.svg`,
|
|
1028
|
+
loginText: 'Continue with Email',
|
|
1029
|
+
backgroundColor: '#ea4335',
|
|
1030
|
+
textColor: '#FFF'
|
|
1031
|
+
}
|
|
1032
|
+
}, {
|
|
1033
|
+
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1034
|
+
loginMethodType: 'google',
|
|
1035
|
+
componentClass: DbxFirebaseLoginGoogleComponent,
|
|
1036
|
+
assets: {
|
|
1037
|
+
logoUrl: `${baseFirebaseJSUrl}/google.svg`,
|
|
1038
|
+
loginText: 'Continue with Google',
|
|
1039
|
+
backgroundColor: '#FFF',
|
|
1040
|
+
textColor: '#757575'
|
|
1041
|
+
}
|
|
1042
|
+
}, {
|
|
1043
|
+
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1044
|
+
loginMethodType: 'facebook',
|
|
1045
|
+
componentClass: DbxFirebaseLoginFacebookComponent,
|
|
1046
|
+
assets: {
|
|
1047
|
+
logoUrl: `${baseFirebaseJSUrl}/facebook.svg`,
|
|
1048
|
+
loginText: 'Continue with Facebook',
|
|
1049
|
+
backgroundColor: '#4267B2',
|
|
1050
|
+
textColor: '#FFF'
|
|
1051
|
+
}
|
|
1052
|
+
}, {
|
|
1053
|
+
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1054
|
+
loginMethodType: 'twitter',
|
|
1055
|
+
componentClass: DbxFirebaseLoginTwitterComponent,
|
|
1056
|
+
assets: {
|
|
1057
|
+
logoUrl: `${baseFirebaseJSUrl}/twitter.svg`,
|
|
1058
|
+
loginText: 'Continue with Twitter',
|
|
1059
|
+
backgroundColor: '#1da1f2',
|
|
1060
|
+
textColor: '#FFF'
|
|
1061
|
+
}
|
|
1062
|
+
}, {
|
|
1063
|
+
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1064
|
+
loginMethodType: 'github',
|
|
1065
|
+
componentClass: DbxFirebaseLoginGitHubComponent,
|
|
1066
|
+
assets: {
|
|
1067
|
+
logoUrl: `${baseFirebaseJSUrl}/github.svg`,
|
|
1068
|
+
loginText: 'Continue with Github',
|
|
1069
|
+
backgroundColor: '#333',
|
|
1070
|
+
textColor: '#FFF'
|
|
1071
|
+
}
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1075
|
+
loginMethodType: 'anonymous',
|
|
1076
|
+
componentClass: DbxFirebaseLoginAnonymousComponent,
|
|
1077
|
+
assets: {
|
|
1078
|
+
loginIcon: 'account_circle',
|
|
1079
|
+
loginText: 'Continue as Guest',
|
|
1080
|
+
backgroundColor: '#000',
|
|
1081
|
+
textColor: '#FFF'
|
|
1082
|
+
}
|
|
1083
|
+
}];
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Contains components related to logging in.
|
|
1087
|
+
*/
|
|
1088
|
+
class DbxFirebaseLoginModule {
|
|
1089
|
+
constructor(config, dbxFirebaseAuthLoginService) {
|
|
1090
|
+
if (config.enabledLoginMethods === true) {
|
|
1091
|
+
dbxFirebaseAuthLoginService.setEnableAll();
|
|
1092
|
+
}
|
|
1093
|
+
else {
|
|
1094
|
+
dbxFirebaseAuthLoginService.enable(config.enabledLoginMethods); // enable the types in the service.
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
static forRoot(config) {
|
|
1098
|
+
return {
|
|
1099
|
+
ngModule: DbxFirebaseLoginModule,
|
|
1100
|
+
providers: [{
|
|
1101
|
+
provide: DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN,
|
|
1102
|
+
useFactory: defaultFirebaseAuthLoginProvidersFactory
|
|
1103
|
+
}, {
|
|
1104
|
+
provide: DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN,
|
|
1105
|
+
useValue: config.termsComponentClass
|
|
1106
|
+
}, {
|
|
1107
|
+
provide: DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN,
|
|
1108
|
+
useValue: config.passwordConfig
|
|
1109
|
+
}, {
|
|
1110
|
+
provide: DbxFirebaseLoginModuleRootConfig,
|
|
1111
|
+
useValue: config
|
|
1112
|
+
}, {
|
|
1113
|
+
provide: DbxFirebaseLoginTermsConfig,
|
|
1114
|
+
useValue: config
|
|
1115
|
+
}]
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
DbxFirebaseLoginModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, deps: [{ token: DbxFirebaseLoginModuleRootConfig }, { token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1120
|
+
DbxFirebaseLoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, declarations: [DbxFirebaseLoginComponent,
|
|
1121
|
+
DbxFirebaseLoginContextDirective,
|
|
1122
|
+
DbxFirebaseLoginContextBackButtonComponent,
|
|
1123
|
+
DbxFirebaseRegisterComponent,
|
|
1124
|
+
DbxFirebaseLoginListComponent,
|
|
1125
|
+
DbxFirebaseLoginButtonComponent,
|
|
1126
|
+
DbxFirebaseLoginButtonContainerComponent,
|
|
1127
|
+
DbxFirebaseLoginEmailComponent,
|
|
1128
|
+
DbxFirebaseLoginEmailContentComponent,
|
|
1129
|
+
DbxFirebaseEmailFormComponent,
|
|
1130
|
+
DbxFirebaseEmailRecoveryFormComponent,
|
|
1131
|
+
DbxFirebaseRegisterEmailComponent,
|
|
1132
|
+
DbxFirebaseLoginGoogleComponent,
|
|
1133
|
+
DbxFirebaseLoginGitHubComponent,
|
|
1134
|
+
DbxFirebaseLoginTwitterComponent,
|
|
1135
|
+
DbxFirebaseLoginAppleComponent,
|
|
1136
|
+
DbxFirebaseLoginMicrosoftComponent,
|
|
1137
|
+
DbxFirebaseLoginFacebookComponent,
|
|
1138
|
+
DbxFirebaseLoginAnonymousComponent,
|
|
1139
|
+
DbxFirebaseLoginTermsComponent,
|
|
1140
|
+
DbxFirebaseLoginTermsSimpleComponent], imports: [CommonModule,
|
|
1141
|
+
MatIconModule,
|
|
1142
|
+
MatButtonModule,
|
|
1143
|
+
DbxRouterAnchorModule,
|
|
1144
|
+
DbxFormIoModule,
|
|
1145
|
+
DbxFormModule,
|
|
1146
|
+
DbxFormlyModule,
|
|
1147
|
+
DbxFormActionModule,
|
|
1148
|
+
DbxFormFormlyTextFieldModule,
|
|
1149
|
+
DbxReadableErrorModule,
|
|
1150
|
+
DbxActionModule,
|
|
1151
|
+
DbxButtonModule,
|
|
1152
|
+
DbxInjectionComponentModule], exports: [DbxFirebaseLoginComponent,
|
|
1153
|
+
DbxFirebaseLoginContextDirective,
|
|
1154
|
+
DbxFirebaseLoginContextBackButtonComponent,
|
|
1155
|
+
DbxFirebaseRegisterComponent,
|
|
1156
|
+
DbxFirebaseLoginListComponent,
|
|
1157
|
+
DbxFirebaseLoginButtonComponent,
|
|
1158
|
+
DbxFirebaseLoginButtonContainerComponent,
|
|
1159
|
+
DbxFirebaseLoginEmailComponent,
|
|
1160
|
+
DbxFirebaseLoginEmailContentComponent,
|
|
1161
|
+
DbxFirebaseEmailFormComponent,
|
|
1162
|
+
DbxFirebaseEmailRecoveryFormComponent,
|
|
1163
|
+
DbxFirebaseRegisterEmailComponent,
|
|
1164
|
+
DbxFirebaseLoginGoogleComponent,
|
|
1165
|
+
DbxFirebaseLoginGitHubComponent,
|
|
1166
|
+
DbxFirebaseLoginTwitterComponent,
|
|
1167
|
+
DbxFirebaseLoginAppleComponent,
|
|
1168
|
+
DbxFirebaseLoginMicrosoftComponent,
|
|
1169
|
+
DbxFirebaseLoginFacebookComponent,
|
|
1170
|
+
DbxFirebaseLoginAnonymousComponent,
|
|
1171
|
+
DbxFirebaseLoginTermsComponent,
|
|
1172
|
+
DbxFirebaseLoginTermsSimpleComponent] });
|
|
1173
|
+
DbxFirebaseLoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, providers: [], imports: [[
|
|
1174
|
+
CommonModule,
|
|
1175
|
+
MatIconModule,
|
|
1176
|
+
MatButtonModule,
|
|
1177
|
+
DbxRouterAnchorModule,
|
|
1178
|
+
DbxFormIoModule,
|
|
1179
|
+
DbxFormModule,
|
|
1180
|
+
DbxFormlyModule,
|
|
1181
|
+
DbxFormActionModule,
|
|
1182
|
+
DbxFormFormlyTextFieldModule,
|
|
1183
|
+
DbxReadableErrorModule,
|
|
1184
|
+
DbxActionModule,
|
|
1185
|
+
DbxButtonModule,
|
|
1186
|
+
DbxInjectionComponentModule
|
|
1187
|
+
]] });
|
|
1188
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, decorators: [{
|
|
1189
|
+
type: NgModule,
|
|
1190
|
+
args: [{
|
|
1191
|
+
imports: [
|
|
1192
|
+
CommonModule,
|
|
1193
|
+
MatIconModule,
|
|
1194
|
+
MatButtonModule,
|
|
1195
|
+
DbxRouterAnchorModule,
|
|
1196
|
+
DbxFormIoModule,
|
|
1197
|
+
DbxFormModule,
|
|
1198
|
+
DbxFormlyModule,
|
|
1199
|
+
DbxFormActionModule,
|
|
1200
|
+
DbxFormFormlyTextFieldModule,
|
|
1201
|
+
DbxReadableErrorModule,
|
|
1202
|
+
DbxActionModule,
|
|
1203
|
+
DbxButtonModule,
|
|
1204
|
+
DbxInjectionComponentModule
|
|
1205
|
+
],
|
|
1206
|
+
declarations: [
|
|
1207
|
+
DbxFirebaseLoginComponent,
|
|
1208
|
+
DbxFirebaseLoginContextDirective,
|
|
1209
|
+
DbxFirebaseLoginContextBackButtonComponent,
|
|
1210
|
+
DbxFirebaseRegisterComponent,
|
|
1211
|
+
DbxFirebaseLoginListComponent,
|
|
1212
|
+
DbxFirebaseLoginButtonComponent,
|
|
1213
|
+
DbxFirebaseLoginButtonContainerComponent,
|
|
1214
|
+
DbxFirebaseLoginEmailComponent,
|
|
1215
|
+
DbxFirebaseLoginEmailContentComponent,
|
|
1216
|
+
DbxFirebaseEmailFormComponent,
|
|
1217
|
+
DbxFirebaseEmailRecoveryFormComponent,
|
|
1218
|
+
DbxFirebaseRegisterEmailComponent,
|
|
1219
|
+
DbxFirebaseLoginGoogleComponent,
|
|
1220
|
+
DbxFirebaseLoginGitHubComponent,
|
|
1221
|
+
DbxFirebaseLoginTwitterComponent,
|
|
1222
|
+
DbxFirebaseLoginAppleComponent,
|
|
1223
|
+
DbxFirebaseLoginMicrosoftComponent,
|
|
1224
|
+
DbxFirebaseLoginFacebookComponent,
|
|
1225
|
+
DbxFirebaseLoginAnonymousComponent,
|
|
1226
|
+
DbxFirebaseLoginTermsComponent,
|
|
1227
|
+
DbxFirebaseLoginTermsSimpleComponent
|
|
1228
|
+
],
|
|
1229
|
+
exports: [
|
|
1230
|
+
DbxFirebaseLoginComponent,
|
|
1231
|
+
DbxFirebaseLoginContextDirective,
|
|
1232
|
+
DbxFirebaseLoginContextBackButtonComponent,
|
|
1233
|
+
DbxFirebaseRegisterComponent,
|
|
1234
|
+
DbxFirebaseLoginListComponent,
|
|
1235
|
+
DbxFirebaseLoginButtonComponent,
|
|
1236
|
+
DbxFirebaseLoginButtonContainerComponent,
|
|
1237
|
+
DbxFirebaseLoginEmailComponent,
|
|
1238
|
+
DbxFirebaseLoginEmailContentComponent,
|
|
1239
|
+
DbxFirebaseEmailFormComponent,
|
|
1240
|
+
DbxFirebaseEmailRecoveryFormComponent,
|
|
1241
|
+
DbxFirebaseRegisterEmailComponent,
|
|
1242
|
+
DbxFirebaseLoginGoogleComponent,
|
|
1243
|
+
DbxFirebaseLoginGitHubComponent,
|
|
1244
|
+
DbxFirebaseLoginTwitterComponent,
|
|
1245
|
+
DbxFirebaseLoginAppleComponent,
|
|
1246
|
+
DbxFirebaseLoginMicrosoftComponent,
|
|
1247
|
+
DbxFirebaseLoginFacebookComponent,
|
|
1248
|
+
DbxFirebaseLoginAnonymousComponent,
|
|
1249
|
+
DbxFirebaseLoginTermsComponent,
|
|
1250
|
+
DbxFirebaseLoginTermsSimpleComponent
|
|
1251
|
+
],
|
|
1252
|
+
providers: []
|
|
1253
|
+
}]
|
|
1254
|
+
}], ctorParameters: function () { return [{ type: DbxFirebaseLoginModuleRootConfig }, { type: DbxFirebaseAuthLoginService }]; } });
|
|
1255
|
+
|
|
1256
|
+
class DbxFirebaseAuthModule {
|
|
1257
|
+
static forRoot(config) {
|
|
1258
|
+
const providers = [
|
|
1259
|
+
DbxFirebaseAuthService,
|
|
1260
|
+
{
|
|
1261
|
+
provide: DbxAuthService,
|
|
1262
|
+
useExisting: DbxFirebaseAuthService
|
|
1263
|
+
}
|
|
1264
|
+
];
|
|
1265
|
+
if (config.delegateFactory) {
|
|
1266
|
+
providers.push({
|
|
1267
|
+
provide: DbxFirebaseAuthServiceDelegate,
|
|
1268
|
+
useFactory: config.delegateFactory,
|
|
1269
|
+
deps: [Injector]
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
return {
|
|
1273
|
+
ngModule: DbxFirebaseAuthModule,
|
|
1274
|
+
providers
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
DbxFirebaseAuthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1279
|
+
DbxFirebaseAuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthModule });
|
|
1280
|
+
DbxFirebaseAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthModule });
|
|
1281
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthModule, decorators: [{
|
|
1282
|
+
type: NgModule,
|
|
1283
|
+
args: [{}]
|
|
1284
|
+
}] });
|
|
1285
|
+
|
|
1286
|
+
class DbxFirebaseParsedEmulatorsConfig {
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
// TODO: remove "as any" typescript casting - https://github.com/angular/angularfire/issues/3086
|
|
1290
|
+
/**
|
|
1291
|
+
* Default firebase firestore provider module.
|
|
1292
|
+
*/
|
|
1293
|
+
class DbxFirebaseDefaultFirestoreProviderModule {
|
|
1294
|
+
}
|
|
1295
|
+
DbxFirebaseDefaultFirestoreProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1296
|
+
DbxFirebaseDefaultFirestoreProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [i1$2.FirestoreModule] });
|
|
1297
|
+
DbxFirebaseDefaultFirestoreProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [[
|
|
1298
|
+
provideFirestore(((injector) => {
|
|
1299
|
+
const firestore = getFirestore();
|
|
1300
|
+
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
1301
|
+
if ((emulators === null || emulators === void 0 ? void 0 : emulators.useEmulators) && (emulators === null || emulators === void 0 ? void 0 : emulators.firestore)) {
|
|
1302
|
+
connectFirestoreEmulator(firestore, emulators.firestore.host, emulators.firestore.port, {});
|
|
1303
|
+
}
|
|
1304
|
+
enableIndexedDbPersistence(firestore);
|
|
1305
|
+
return firestore;
|
|
1306
|
+
}))
|
|
1307
|
+
]] });
|
|
1308
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, decorators: [{
|
|
1309
|
+
type: NgModule,
|
|
1310
|
+
args: [{
|
|
1311
|
+
imports: [
|
|
1312
|
+
provideFirestore(((injector) => {
|
|
1313
|
+
const firestore = getFirestore();
|
|
1314
|
+
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
1315
|
+
if ((emulators === null || emulators === void 0 ? void 0 : emulators.useEmulators) && (emulators === null || emulators === void 0 ? void 0 : emulators.firestore)) {
|
|
1316
|
+
connectFirestoreEmulator(firestore, emulators.firestore.host, emulators.firestore.port, {});
|
|
1317
|
+
}
|
|
1318
|
+
enableIndexedDbPersistence(firestore);
|
|
1319
|
+
return firestore;
|
|
1320
|
+
}))
|
|
1321
|
+
]
|
|
1322
|
+
}]
|
|
1323
|
+
}] });
|
|
1324
|
+
/**
|
|
1325
|
+
* Default firebase auth provider module.
|
|
1326
|
+
*/
|
|
1327
|
+
class DbxFirebaseDefaultAuthProviderModule {
|
|
1328
|
+
}
|
|
1329
|
+
DbxFirebaseDefaultAuthProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1330
|
+
DbxFirebaseDefaultAuthProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [i1.AuthModule] });
|
|
1331
|
+
DbxFirebaseDefaultAuthProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [[
|
|
1332
|
+
provideAuth(((injector) => {
|
|
1333
|
+
const auth = getAuth();
|
|
1334
|
+
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
1335
|
+
if ((emulators === null || emulators === void 0 ? void 0 : emulators.useEmulators) && (emulators === null || emulators === void 0 ? void 0 : emulators.auth)) {
|
|
1336
|
+
connectAuthEmulator(auth, `http://${emulators.auth.host}:${emulators.auth.port}`);
|
|
1337
|
+
}
|
|
1338
|
+
return auth;
|
|
1339
|
+
}))
|
|
1340
|
+
]] });
|
|
1341
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, decorators: [{
|
|
1342
|
+
type: NgModule,
|
|
1343
|
+
args: [{
|
|
1344
|
+
imports: [
|
|
1345
|
+
provideAuth(((injector) => {
|
|
1346
|
+
const auth = getAuth();
|
|
1347
|
+
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
1348
|
+
if ((emulators === null || emulators === void 0 ? void 0 : emulators.useEmulators) && (emulators === null || emulators === void 0 ? void 0 : emulators.auth)) {
|
|
1349
|
+
connectAuthEmulator(auth, `http://${emulators.auth.host}:${emulators.auth.port}`);
|
|
1350
|
+
}
|
|
1351
|
+
return auth;
|
|
1352
|
+
}))
|
|
1353
|
+
]
|
|
1354
|
+
}]
|
|
1355
|
+
}] });
|
|
1356
|
+
/**
|
|
1357
|
+
* Default firebase storage provider module.
|
|
1358
|
+
*/
|
|
1359
|
+
class DbxFirebaseDefaultStorageProviderModule {
|
|
1360
|
+
}
|
|
1361
|
+
DbxFirebaseDefaultStorageProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1362
|
+
DbxFirebaseDefaultStorageProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [i3$2.StorageModule] });
|
|
1363
|
+
DbxFirebaseDefaultStorageProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [[
|
|
1364
|
+
provideStorage(((injector) => {
|
|
1365
|
+
const storage = getStorage();
|
|
1366
|
+
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
1367
|
+
if ((emulators === null || emulators === void 0 ? void 0 : emulators.useEmulators) && (emulators === null || emulators === void 0 ? void 0 : emulators.storage)) {
|
|
1368
|
+
connectStorageEmulator(storage, emulators.storage.host, emulators.storage.port, {});
|
|
1369
|
+
}
|
|
1370
|
+
return storage;
|
|
1371
|
+
}))
|
|
1372
|
+
]] });
|
|
1373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, decorators: [{
|
|
1374
|
+
type: NgModule,
|
|
1375
|
+
args: [{
|
|
1376
|
+
imports: [
|
|
1377
|
+
provideStorage(((injector) => {
|
|
1378
|
+
const storage = getStorage();
|
|
1379
|
+
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
1380
|
+
if ((emulators === null || emulators === void 0 ? void 0 : emulators.useEmulators) && (emulators === null || emulators === void 0 ? void 0 : emulators.storage)) {
|
|
1381
|
+
connectStorageEmulator(storage, emulators.storage.host, emulators.storage.port, {});
|
|
1382
|
+
}
|
|
1383
|
+
return storage;
|
|
1384
|
+
}))
|
|
1385
|
+
]
|
|
1386
|
+
}]
|
|
1387
|
+
}] });
|
|
1388
|
+
/**
|
|
1389
|
+
* Default firebase functions provider module.
|
|
1390
|
+
*/
|
|
1391
|
+
class DbxFirebaseDefaultFunctionsProviderModule {
|
|
1392
|
+
}
|
|
1393
|
+
DbxFirebaseDefaultFunctionsProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1394
|
+
DbxFirebaseDefaultFunctionsProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [i4$1.FunctionsModule] });
|
|
1395
|
+
DbxFirebaseDefaultFunctionsProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [[
|
|
1396
|
+
provideFunctions(((injector) => {
|
|
1397
|
+
const functions = getFunctions();
|
|
1398
|
+
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
1399
|
+
if ((emulators === null || emulators === void 0 ? void 0 : emulators.useEmulators) && (emulators === null || emulators === void 0 ? void 0 : emulators.functions)) {
|
|
1400
|
+
connectFunctionsEmulator(functions, emulators.functions.host, emulators.functions.port);
|
|
1401
|
+
}
|
|
1402
|
+
return functions;
|
|
1403
|
+
}))
|
|
1404
|
+
]] });
|
|
1405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, decorators: [{
|
|
1406
|
+
type: NgModule,
|
|
1407
|
+
args: [{
|
|
1408
|
+
imports: [
|
|
1409
|
+
provideFunctions(((injector) => {
|
|
1410
|
+
const functions = getFunctions();
|
|
1411
|
+
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
1412
|
+
if ((emulators === null || emulators === void 0 ? void 0 : emulators.useEmulators) && (emulators === null || emulators === void 0 ? void 0 : emulators.functions)) {
|
|
1413
|
+
connectFunctionsEmulator(functions, emulators.functions.host, emulators.functions.port);
|
|
1414
|
+
}
|
|
1415
|
+
return functions;
|
|
1416
|
+
}))
|
|
1417
|
+
]
|
|
1418
|
+
}]
|
|
1419
|
+
}] });
|
|
1420
|
+
const DBX_FIREBASE_OPTIONS_TOKEN = new InjectionToken('DbxFirebaseOptions');
|
|
1421
|
+
/**
|
|
1422
|
+
* Default provider module.
|
|
1423
|
+
*/
|
|
1424
|
+
class DbxFirebaseDefaultFirebaseProvidersModule {
|
|
1425
|
+
static forRoot(firebaseOptions) {
|
|
1426
|
+
return {
|
|
1427
|
+
ngModule: DbxFirebaseDefaultFirebaseProvidersModule,
|
|
1428
|
+
providers: [{
|
|
1429
|
+
provide: DBX_FIREBASE_OPTIONS_TOKEN,
|
|
1430
|
+
useValue: firebaseOptions
|
|
1431
|
+
}]
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
DbxFirebaseDefaultFirebaseProvidersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1436
|
+
DbxFirebaseDefaultFirebaseProvidersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDefaultFunctionsProviderModule, i5.FirebaseAppModule] });
|
|
1437
|
+
DbxFirebaseDefaultFirebaseProvidersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [[
|
|
1438
|
+
DbxFirebaseDefaultFirestoreProviderModule,
|
|
1439
|
+
DbxFirebaseDefaultAuthProviderModule,
|
|
1440
|
+
DbxFirebaseDefaultStorageProviderModule,
|
|
1441
|
+
DbxFirebaseDefaultFunctionsProviderModule,
|
|
1442
|
+
provideFirebaseApp(((injector) => {
|
|
1443
|
+
const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
|
|
1444
|
+
return initializeApp(firebaseOptions);
|
|
1445
|
+
}))
|
|
1446
|
+
]] });
|
|
1447
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, decorators: [{
|
|
1448
|
+
type: NgModule,
|
|
1449
|
+
args: [{
|
|
1450
|
+
imports: [
|
|
1451
|
+
DbxFirebaseDefaultFirestoreProviderModule,
|
|
1452
|
+
DbxFirebaseDefaultAuthProviderModule,
|
|
1453
|
+
DbxFirebaseDefaultStorageProviderModule,
|
|
1454
|
+
DbxFirebaseDefaultFunctionsProviderModule,
|
|
1455
|
+
provideFirebaseApp(((injector) => {
|
|
1456
|
+
const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
|
|
1457
|
+
return initializeApp(firebaseOptions);
|
|
1458
|
+
}))
|
|
1459
|
+
]
|
|
1460
|
+
}]
|
|
1461
|
+
}] });
|
|
1462
|
+
|
|
1463
|
+
/**
|
|
1464
|
+
* Used to configure the DbxFirebaseEmulatorsConfig provider.
|
|
1465
|
+
*/
|
|
1466
|
+
class DbxFirebaseEmulatorModule {
|
|
1467
|
+
static forRoot(config) {
|
|
1468
|
+
var _a;
|
|
1469
|
+
const defaultHost = (_a = config.host) !== null && _a !== void 0 ? _a : 'localhost';
|
|
1470
|
+
function emulatorConfig(emulator) {
|
|
1471
|
+
var _a;
|
|
1472
|
+
return (emulator) ? { host: (_a = emulator.host) !== null && _a !== void 0 ? _a : defaultHost, port: emulator.port } : undefined;
|
|
1473
|
+
}
|
|
1474
|
+
const finalConfig = {
|
|
1475
|
+
useEmulators: config.useEmulators !== false,
|
|
1476
|
+
auth: emulatorConfig(config.auth),
|
|
1477
|
+
firestore: emulatorConfig(config.firestore),
|
|
1478
|
+
storage: emulatorConfig(config.storage),
|
|
1479
|
+
functions: emulatorConfig(config.functions),
|
|
1480
|
+
database: emulatorConfig(config.database)
|
|
1481
|
+
};
|
|
1482
|
+
return {
|
|
1483
|
+
ngModule: DbxFirebaseEmulatorModule,
|
|
1484
|
+
providers: [{
|
|
1485
|
+
provide: DbxFirebaseParsedEmulatorsConfig,
|
|
1486
|
+
useValue: finalConfig
|
|
1487
|
+
}]
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
DbxFirebaseEmulatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmulatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1492
|
+
DbxFirebaseEmulatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmulatorModule });
|
|
1493
|
+
DbxFirebaseEmulatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmulatorModule });
|
|
1494
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmulatorModule, decorators: [{
|
|
1495
|
+
type: NgModule
|
|
1496
|
+
}] });
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* Token to access the FirestoreContext value.
|
|
1500
|
+
*/
|
|
1501
|
+
const DBX_FIRESTORE_CONTEXT_TOKEN = new InjectionToken('DBX_FIRESTORE_CONTEXT_TOKEN');
|
|
1502
|
+
|
|
1503
|
+
/**
|
|
1504
|
+
* Used to initialize the FirestoreCollection for a DbxFirebase app.
|
|
1505
|
+
*/
|
|
1506
|
+
class DbxFirebaseFirestoreCollectionModule {
|
|
1507
|
+
static forRoot(config) {
|
|
1508
|
+
return {
|
|
1509
|
+
ngModule: DbxFirebaseFirestoreCollectionModule,
|
|
1510
|
+
providers: [{
|
|
1511
|
+
provide: DBX_FIRESTORE_CONTEXT_TOKEN,
|
|
1512
|
+
useFactory: firebaseFirestoreContextFactory,
|
|
1513
|
+
deps: [Firestore]
|
|
1514
|
+
}, {
|
|
1515
|
+
provide: config.appCollectionClass,
|
|
1516
|
+
useFactory: config.collectionFactory,
|
|
1517
|
+
deps: [DBX_FIRESTORE_CONTEXT_TOKEN]
|
|
1518
|
+
}]
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
DbxFirebaseFirestoreCollectionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseFirestoreCollectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1523
|
+
DbxFirebaseFirestoreCollectionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseFirestoreCollectionModule });
|
|
1524
|
+
DbxFirebaseFirestoreCollectionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseFirestoreCollectionModule });
|
|
1525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseFirestoreCollectionModule, decorators: [{
|
|
1526
|
+
type: NgModule
|
|
1527
|
+
}] });
|
|
1528
|
+
|
|
1529
|
+
/**
|
|
1530
|
+
* Service that provides access to the app's FirestoreContext.
|
|
1531
|
+
*/
|
|
1532
|
+
class DbxFirestoreContextService {
|
|
1533
|
+
constructor(firestoreContext) {
|
|
1534
|
+
this.firestoreContext = firestoreContext;
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
DbxFirestoreContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirestoreContextService, deps: [{ token: DBX_FIRESTORE_CONTEXT_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1538
|
+
DbxFirestoreContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirestoreContextService, providedIn: 'root' });
|
|
1539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirestoreContextService, decorators: [{
|
|
1540
|
+
type: Injectable,
|
|
1541
|
+
args: [{
|
|
1542
|
+
providedIn: 'root'
|
|
1543
|
+
}]
|
|
1544
|
+
}], ctorParameters: function () {
|
|
1545
|
+
return [{ type: undefined, decorators: [{
|
|
1546
|
+
type: Inject,
|
|
1547
|
+
args: [DBX_FIRESTORE_CONTEXT_TOKEN]
|
|
1548
|
+
}] }];
|
|
1549
|
+
} });
|
|
1550
|
+
|
|
1551
|
+
/**
|
|
1552
|
+
* Used to initialize the LazyFirebaseFunctions type for a DbxFirebase app.
|
|
1553
|
+
*/
|
|
1554
|
+
class DbxFirebaseFunctionsModule {
|
|
1555
|
+
static forRoot(config) {
|
|
1556
|
+
const providers = [{
|
|
1557
|
+
provide: config.functionsGetterToken,
|
|
1558
|
+
useFactory: config.functionsGetterFactory,
|
|
1559
|
+
deps: [Functions]
|
|
1560
|
+
}];
|
|
1561
|
+
if (config.functionsConfigMap) {
|
|
1562
|
+
forEachKeyValue(config.functionsConfigMap, {
|
|
1563
|
+
forEach: ([key, entry]) => {
|
|
1564
|
+
const provide = entry[0];
|
|
1565
|
+
providers.push({
|
|
1566
|
+
provide,
|
|
1567
|
+
useFactory: (lazyFunctions) => {
|
|
1568
|
+
const getter = lazyFunctions[key];
|
|
1569
|
+
if (!getter) {
|
|
1570
|
+
throw new Error(`Could not create provider for firebase function getter "${provide}" as the getter was unavailable.`);
|
|
1571
|
+
}
|
|
1572
|
+
else {
|
|
1573
|
+
return getter();
|
|
1574
|
+
}
|
|
1575
|
+
},
|
|
1576
|
+
deps: [config.functionsGetterToken]
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
return {
|
|
1582
|
+
ngModule: DbxFirebaseFunctionsModule,
|
|
1583
|
+
providers
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
DbxFirebaseFunctionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseFunctionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1588
|
+
DbxFirebaseFunctionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseFunctionsModule });
|
|
1589
|
+
DbxFirebaseFunctionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseFunctionsModule });
|
|
1590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseFunctionsModule, decorators: [{
|
|
1591
|
+
type: NgModule
|
|
1592
|
+
}] });
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* DbxFirebaseModelLoader implementation within an instance.
|
|
1596
|
+
*/
|
|
1597
|
+
class DbxFirebaseCollectionLoaderInstance {
|
|
1598
|
+
constructor(_initConfig) {
|
|
1599
|
+
var _a, _b, _c, _d;
|
|
1600
|
+
this._initConfig = _initConfig;
|
|
1601
|
+
this._collection = new BehaviorSubject((_a = this._initConfig) === null || _a === void 0 ? void 0 : _a.collection);
|
|
1602
|
+
this._maxPages = new BehaviorSubject((_b = this._initConfig) === null || _b === void 0 ? void 0 : _b.maxPages);
|
|
1603
|
+
this._itemsPerPage = new BehaviorSubject((_c = this._initConfig) === null || _c === void 0 ? void 0 : _c.itemsPerPage);
|
|
1604
|
+
this._constraints = new BehaviorSubject((_d = this._initConfig) === null || _d === void 0 ? void 0 : _d.constraints);
|
|
1605
|
+
this._restart = new Subject();
|
|
1606
|
+
this._maxPagesSub = new SubscriptionObject();
|
|
1607
|
+
this.collection$ = this._collection.pipe(distinctUntilChanged());
|
|
1608
|
+
this.constraints$ = this._constraints.pipe(distinctUntilChanged());
|
|
1609
|
+
this.iteratorFilter$ = combineLatest([
|
|
1610
|
+
this._itemsPerPage.pipe(distinctUntilChanged()),
|
|
1611
|
+
this.constraints$
|
|
1612
|
+
]).pipe(map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages })), shareReplay(1));
|
|
1613
|
+
this.firestoreIteration$ = this.collection$.pipe(switchMap((collection) => {
|
|
1614
|
+
if (collection) {
|
|
1615
|
+
return combineLatest([this.iteratorFilter$, this._restart.pipe(startWith(undefined))]).pipe(throttleTime(100, undefined, { trailing: true }), // prevent rapid changes and executing filters too quickly.
|
|
1616
|
+
map(([iteratorFilter]) => collection.firestoreIteration(iteratorFilter)), cleanupDestroyable(), // cleanup the iteration
|
|
1617
|
+
shareReplay(1));
|
|
1618
|
+
}
|
|
1619
|
+
else {
|
|
1620
|
+
return NEVER; // don't emit anything until collection is provided.
|
|
1621
|
+
}
|
|
1622
|
+
}), cleanupDestroyable(), // cleanup the iteration
|
|
1623
|
+
shareReplay(1));
|
|
1624
|
+
this.queryChangeWatcher$ = this.firestoreIteration$.pipe(map(instance => iterationQueryDocChangeWatcher({ instance })), shareReplay(1));
|
|
1625
|
+
this.accumulator$ = this.firestoreIteration$.pipe(map(x => firebaseQueryItemAccumulator(x)), cleanupDestroyable(), shareReplay(1));
|
|
1626
|
+
this.pageLoadingState$ = this.accumulator$.pipe(switchMap(x => accumulatorFlattenPageListLoadingState(x)), shareReplay(1));
|
|
1627
|
+
}
|
|
1628
|
+
init() {
|
|
1629
|
+
// When max pages changes, update the iteration's max page limit.
|
|
1630
|
+
this._maxPagesSub.subscription = this._maxPages.pipe(distinctUntilChanged(), filterMaybe(), // do not pass null/undefined values
|
|
1631
|
+
switchMap((maxPageLoadLimit) => this.firestoreIteration$.pipe(tap((iteration) => {
|
|
1632
|
+
iteration.maxPageLoadLimit = maxPageLoadLimit;
|
|
1633
|
+
})))).subscribe();
|
|
1634
|
+
}
|
|
1635
|
+
destroy() {
|
|
1636
|
+
this._maxPages.complete();
|
|
1637
|
+
this._collection.complete();
|
|
1638
|
+
this._constraints.complete();
|
|
1639
|
+
this._itemsPerPage.complete();
|
|
1640
|
+
this._restart.complete();
|
|
1641
|
+
this._maxPagesSub.destroy();
|
|
1642
|
+
}
|
|
1643
|
+
// MARK: Inputs
|
|
1644
|
+
get maxPages() {
|
|
1645
|
+
return this._maxPages.value;
|
|
1646
|
+
}
|
|
1647
|
+
set maxPages(maxPages) {
|
|
1648
|
+
if (this.maxPages != maxPages) {
|
|
1649
|
+
this._maxPages.next(maxPages);
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
get itemsPerPage() {
|
|
1653
|
+
return this._itemsPerPage.value;
|
|
1654
|
+
}
|
|
1655
|
+
set itemsPerPage(itemsPerPage) {
|
|
1656
|
+
if (this.itemsPerPage != itemsPerPage) {
|
|
1657
|
+
this._itemsPerPage.next(itemsPerPage);
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
get constraints() {
|
|
1661
|
+
return this._constraints.value;
|
|
1662
|
+
}
|
|
1663
|
+
set constraints(constraints) {
|
|
1664
|
+
this._constraints.next(constraints);
|
|
1665
|
+
}
|
|
1666
|
+
get collection() {
|
|
1667
|
+
return this._collection.value;
|
|
1668
|
+
}
|
|
1669
|
+
set collection(collection) {
|
|
1670
|
+
this._collection.next(collection);
|
|
1671
|
+
}
|
|
1672
|
+
// MARK: DbxFirebaseModelList
|
|
1673
|
+
next() {
|
|
1674
|
+
useFirst(this.firestoreIteration$, (x) => x.next());
|
|
1675
|
+
}
|
|
1676
|
+
restart() {
|
|
1677
|
+
this._restart.next();
|
|
1678
|
+
}
|
|
1679
|
+
setConstraints(constraints) {
|
|
1680
|
+
this.constraints = constraints;
|
|
1681
|
+
}
|
|
1682
|
+
setCollection(firestoreCollection) {
|
|
1683
|
+
this.collection = firestoreCollection;
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
function dbxFirebaseCollectionLoaderInstance(config) {
|
|
1687
|
+
return new DbxFirebaseCollectionLoaderInstance(config);
|
|
1688
|
+
}
|
|
1689
|
+
function dbxFirebaseCollectionLoaderInstanceWithCollection(collection) {
|
|
1690
|
+
return new DbxFirebaseCollectionLoaderInstance({ collection });
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* Abstract directive that contains a DbxFirebaseCollectionStore and provides an interface for communicating with other directives.
|
|
1695
|
+
*/
|
|
1696
|
+
class DbxFirebaseCollectionStoreDirective {
|
|
1697
|
+
constructor(store) {
|
|
1698
|
+
this.store = store;
|
|
1699
|
+
this.pageLoadingState$ = this.store.pageLoadingState$;
|
|
1700
|
+
}
|
|
1701
|
+
// MARK: Inputs
|
|
1702
|
+
set maxPages(maxPages) {
|
|
1703
|
+
this.store.setMaxPages(maxPages);
|
|
1704
|
+
}
|
|
1705
|
+
set itemsPerPage(itemsPerPage) {
|
|
1706
|
+
this.store.setItemsPerPage(itemsPerPage);
|
|
1707
|
+
}
|
|
1708
|
+
set constraints(constraints) {
|
|
1709
|
+
this.store.setConstraints(constraints);
|
|
1710
|
+
}
|
|
1711
|
+
next() {
|
|
1712
|
+
this.store.next();
|
|
1713
|
+
}
|
|
1714
|
+
restart() {
|
|
1715
|
+
this.store.restart();
|
|
1716
|
+
}
|
|
1717
|
+
setConstraints(constraints) {
|
|
1718
|
+
this.store.setConstraints(constraints);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
DbxFirebaseCollectionStoreDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionStoreDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
1722
|
+
DbxFirebaseCollectionStoreDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseCollectionStoreDirective, inputs: { maxPages: "maxPages", itemsPerPage: "itemsPerPage", constraints: "constraints" }, ngImport: i0 });
|
|
1723
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionStoreDirective, decorators: [{
|
|
1724
|
+
type: Directive
|
|
1725
|
+
}], ctorParameters: function () { return [{ type: undefined }]; }, propDecorators: { maxPages: [{
|
|
1726
|
+
type: Input
|
|
1727
|
+
}], itemsPerPage: [{
|
|
1728
|
+
type: Input
|
|
1729
|
+
}], constraints: [{
|
|
1730
|
+
type: Input
|
|
1731
|
+
}] } });
|
|
1732
|
+
function provideDbxFirebaseCollectionStoreDirective(sourceType, storeType) {
|
|
1733
|
+
const providers = [{
|
|
1734
|
+
provide: DbxFirebaseCollectionStoreDirective,
|
|
1735
|
+
useExisting: forwardRef(() => sourceType)
|
|
1736
|
+
}];
|
|
1737
|
+
if (storeType) {
|
|
1738
|
+
providers.push(storeType);
|
|
1739
|
+
}
|
|
1740
|
+
return providers;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* Used to watch query doc changes and respond to them accordingly.
|
|
1745
|
+
*/
|
|
1746
|
+
class DbxFirebaseCollectionChangeDirective extends AbstractSubscriptionDirective {
|
|
1747
|
+
constructor(dbxFirebaseCollectionStoreDirective) {
|
|
1748
|
+
super();
|
|
1749
|
+
this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
|
|
1750
|
+
this._mode = new BehaviorSubject('manual');
|
|
1751
|
+
this.mode$ = this._mode.pipe(distinctUntilChanged());
|
|
1752
|
+
this.event$ = this.dbxFirebaseCollectionStoreDirective.store.queryChangeWatcher$.pipe(switchMap((x) => x.event$.pipe(filter(x => x.type !== 'none'), // do not share 'none' events.
|
|
1753
|
+
take(1), // only need one event to mark as change is available.
|
|
1754
|
+
startWith({
|
|
1755
|
+
time: new Date(),
|
|
1756
|
+
type: 'none'
|
|
1757
|
+
}))), shareReplay(1));
|
|
1758
|
+
this.hasChangeAvailable$ = this.event$.pipe(map(x => x.type !== 'none'), shareReplay(1));
|
|
1759
|
+
}
|
|
1760
|
+
ngOnInit() {
|
|
1761
|
+
this.sub = combineLatest([this.mode$, this.hasChangeAvailable$]).pipe(filter(([mode, hasChange]) => mode === 'auto' && hasChange)).subscribe(() => {
|
|
1762
|
+
this.restart();
|
|
1763
|
+
});
|
|
1764
|
+
}
|
|
1765
|
+
ngOnDestroy() {
|
|
1766
|
+
super.ngOnDestroy();
|
|
1767
|
+
this._mode.complete();
|
|
1768
|
+
}
|
|
1769
|
+
get mode() {
|
|
1770
|
+
return this._mode.value;
|
|
1771
|
+
}
|
|
1772
|
+
set mode(mode) {
|
|
1773
|
+
this._mode.next(mode || 'manual');
|
|
1774
|
+
}
|
|
1775
|
+
restart() {
|
|
1776
|
+
this.dbxFirebaseCollectionStoreDirective.store.restart();
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
DbxFirebaseCollectionChangeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionChangeDirective, deps: [{ token: DbxFirebaseCollectionStoreDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1780
|
+
DbxFirebaseCollectionChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseCollectionChangeDirective, selector: "[dbxFirebaseCollectionChange]", inputs: { mode: ["dbxFirebaseCollectionChange", "mode"] }, usesInheritance: true, ngImport: i0 });
|
|
1781
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionChangeDirective, decorators: [{
|
|
1782
|
+
type: Directive,
|
|
1783
|
+
args: [{
|
|
1784
|
+
selector: '[dbxFirebaseCollectionChange]'
|
|
1785
|
+
}]
|
|
1786
|
+
}], ctorParameters: function () { return [{ type: DbxFirebaseCollectionStoreDirective }]; }, propDecorators: { mode: [{
|
|
1787
|
+
type: Input,
|
|
1788
|
+
args: ['dbxFirebaseCollectionChange']
|
|
1789
|
+
}] } });
|
|
1790
|
+
|
|
1791
|
+
/**
|
|
1792
|
+
* Structural directive that displays the content when the target change is detected.
|
|
1793
|
+
*
|
|
1794
|
+
* Can specify which changes to appear on.
|
|
1795
|
+
*/
|
|
1796
|
+
class DbxFirebaseCollectionHasChangeDirective extends AbstractIfDirective {
|
|
1797
|
+
constructor(templateRef, viewContainer, directive) {
|
|
1798
|
+
super(templateRef, viewContainer);
|
|
1799
|
+
this.directive = directive;
|
|
1800
|
+
this._mode = new BehaviorSubject('addedAndRemoved');
|
|
1801
|
+
this.show$ = combineLatest([this._mode, this.directive.event$]).pipe(map(([mode, event]) => {
|
|
1802
|
+
let show = false;
|
|
1803
|
+
if (event.type !== 'none') {
|
|
1804
|
+
switch (mode) {
|
|
1805
|
+
case 'all':
|
|
1806
|
+
show = true;
|
|
1807
|
+
break;
|
|
1808
|
+
case 'addedAndRemoved':
|
|
1809
|
+
show = event.type === 'addedAndRemoved' || event.type === 'added' || event.type === 'removed';
|
|
1810
|
+
break;
|
|
1811
|
+
default:
|
|
1812
|
+
show = event.type === mode;
|
|
1813
|
+
break;
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
return show;
|
|
1817
|
+
}), shareReplay(1));
|
|
1818
|
+
}
|
|
1819
|
+
get mode() {
|
|
1820
|
+
return this._mode.value;
|
|
1821
|
+
}
|
|
1822
|
+
set mode(mode) {
|
|
1823
|
+
this._mode.next(mode || 'addedAndRemoved');
|
|
1824
|
+
}
|
|
1825
|
+
ngOnDestroy() {
|
|
1826
|
+
super.ngOnDestroy();
|
|
1827
|
+
this._mode.complete();
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
DbxFirebaseCollectionHasChangeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionHasChangeDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DbxFirebaseCollectionChangeDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1831
|
+
DbxFirebaseCollectionHasChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseCollectionHasChangeDirective, selector: "[dbxFirebaseCollectionHasChange]", inputs: { mode: ["dbxFirebaseCollectionHasChange", "mode"] }, usesInheritance: true, ngImport: i0 });
|
|
1832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionHasChangeDirective, decorators: [{
|
|
1833
|
+
type: Directive,
|
|
1834
|
+
args: [{
|
|
1835
|
+
selector: '[dbxFirebaseCollectionHasChange]'
|
|
1836
|
+
}]
|
|
1837
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: DbxFirebaseCollectionChangeDirective }]; }, propDecorators: { mode: [{
|
|
1838
|
+
type: Input,
|
|
1839
|
+
args: ['dbxFirebaseCollectionHasChange']
|
|
1840
|
+
}] } });
|
|
1841
|
+
|
|
1842
|
+
/**
|
|
1843
|
+
* Directive that connects a host DbxListView to a DbxFirebaseCollectionStoreDirective to pass data for rendering items from a collection and query parameters.
|
|
1844
|
+
*/
|
|
1845
|
+
class DbxFirebaseCollectionListDirective {
|
|
1846
|
+
constructor(dbxFirebaseCollectionStoreDirective, dbxListViewWrapper) {
|
|
1847
|
+
this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
|
|
1848
|
+
this.dbxListViewWrapper = dbxListViewWrapper;
|
|
1849
|
+
this.dbxListViewWrapper.state$ = this.dbxFirebaseCollectionStoreDirective.pageLoadingState$;
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
DbxFirebaseCollectionListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionListDirective, deps: [{ token: DbxFirebaseCollectionStoreDirective }, { token: i3.DbxListViewWrapper, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1853
|
+
DbxFirebaseCollectionListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseCollectionListDirective, selector: "[dbxFirebaseCollectionList]", ngImport: i0 });
|
|
1854
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionListDirective, decorators: [{
|
|
1855
|
+
type: Directive,
|
|
1856
|
+
args: [{
|
|
1857
|
+
selector: '[dbxFirebaseCollectionList]'
|
|
1858
|
+
}]
|
|
1859
|
+
}], ctorParameters: function () {
|
|
1860
|
+
return [{ type: DbxFirebaseCollectionStoreDirective }, { type: i3.DbxListViewWrapper, decorators: [{
|
|
1861
|
+
type: Host
|
|
1862
|
+
}] }];
|
|
1863
|
+
} });
|
|
1864
|
+
|
|
1865
|
+
/**
|
|
1866
|
+
* Abstract directive that contains a DbxFirebaseDocumentStore and provides an interface for communicating with other directives.
|
|
1867
|
+
*/
|
|
1868
|
+
class DbxFirebaseDocumentStoreDirective {
|
|
1869
|
+
constructor(store) {
|
|
1870
|
+
this.store = store;
|
|
1871
|
+
this.exists$ = this.store.exists$;
|
|
1872
|
+
this.document$ = this.store.document$;
|
|
1873
|
+
this.documentLoadingState$ = this.store.documentLoadingState$;
|
|
1874
|
+
this.id$ = this.store.id$;
|
|
1875
|
+
this.ref$ = this.store.ref$;
|
|
1876
|
+
this.snapshot$ = this.store.snapshot$;
|
|
1877
|
+
this.snapshotLoadingState$ = this.store.snapshotLoadingState$;
|
|
1878
|
+
this.data$ = this.store.data$;
|
|
1879
|
+
this.loadingState$ = this.store.dataLoadingState$;
|
|
1880
|
+
}
|
|
1881
|
+
// MARK: Inputs
|
|
1882
|
+
set id(id) {
|
|
1883
|
+
this.store.setId(id);
|
|
1884
|
+
}
|
|
1885
|
+
set ref(ref) {
|
|
1886
|
+
this.store.setRef(ref);
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
DbxFirebaseDocumentStoreDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDocumentStoreDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
1890
|
+
DbxFirebaseDocumentStoreDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseDocumentStoreDirective, inputs: { id: "id", ref: "ref" }, ngImport: i0 });
|
|
1891
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDocumentStoreDirective, decorators: [{
|
|
1892
|
+
type: Directive
|
|
1893
|
+
}], ctorParameters: function () { return [{ type: undefined }]; }, propDecorators: { id: [{
|
|
1894
|
+
type: Input
|
|
1895
|
+
}], ref: [{
|
|
1896
|
+
type: Input
|
|
1897
|
+
}] } });
|
|
1898
|
+
function provideDbxFirebaseDocumentStoreDirective(sourceType, storeType) {
|
|
1899
|
+
const providers = [{
|
|
1900
|
+
provide: DbxFirebaseDocumentStoreDirective,
|
|
1901
|
+
useExisting: forwardRef(() => sourceType)
|
|
1902
|
+
}];
|
|
1903
|
+
if (storeType) {
|
|
1904
|
+
providers.push(storeType);
|
|
1905
|
+
}
|
|
1906
|
+
return providers;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
/**
|
|
1910
|
+
* Utility directive for a host DbxFirebaseDocumentStoreDirective that sets the document's ID to match the ID of the current user.
|
|
1911
|
+
*
|
|
1912
|
+
* This is useful for cases where each document is keyed by the user (I.E. implements UserRelatedById).
|
|
1913
|
+
*/
|
|
1914
|
+
class DbxFirebaseDocumentAuthIdDirective extends AbstractSubscriptionDirective {
|
|
1915
|
+
constructor(dbxFirebaseAuthService, dbxFirebaseDocumentStoreDirective) {
|
|
1916
|
+
super();
|
|
1917
|
+
this.dbxFirebaseAuthService = dbxFirebaseAuthService;
|
|
1918
|
+
this.dbxFirebaseDocumentStoreDirective = dbxFirebaseDocumentStoreDirective;
|
|
1919
|
+
}
|
|
1920
|
+
ngOnInit() {
|
|
1921
|
+
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.dbxFirebaseAuthService.userIdentifier$);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
DbxFirebaseDocumentAuthIdDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDocumentAuthIdDirective, deps: [{ token: DbxFirebaseAuthService }, { token: DbxFirebaseDocumentStoreDirective, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1925
|
+
DbxFirebaseDocumentAuthIdDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseDocumentAuthIdDirective, selector: "[dbxFirebaseDocumentAuthId]", usesInheritance: true, ngImport: i0 });
|
|
1926
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDocumentAuthIdDirective, decorators: [{
|
|
1927
|
+
type: Directive,
|
|
1928
|
+
args: [{
|
|
1929
|
+
selector: '[dbxFirebaseDocumentAuthId]'
|
|
1930
|
+
}]
|
|
1931
|
+
}], ctorParameters: function () {
|
|
1932
|
+
return [{ type: DbxFirebaseAuthService }, { type: DbxFirebaseDocumentStoreDirective, decorators: [{
|
|
1933
|
+
type: Host
|
|
1934
|
+
}] }];
|
|
1935
|
+
} });
|
|
1936
|
+
|
|
1937
|
+
const DBX_FIREBASE_ROUTER_SYNC_DEFAULT_ID_PARAM_KEY = 'id';
|
|
1938
|
+
/**
|
|
1939
|
+
* Used for synchronizing the document store id to the param of the route.
|
|
1940
|
+
*/
|
|
1941
|
+
class DbxFirebaseDocumentStoreRouteIdDirective extends AbstractSubscriptionDirective {
|
|
1942
|
+
constructor(dbxFirebaseDocumentStoreDirective, dbxRouterService) {
|
|
1943
|
+
super();
|
|
1944
|
+
this.dbxFirebaseDocumentStoreDirective = dbxFirebaseDocumentStoreDirective;
|
|
1945
|
+
this.dbxRouterService = dbxRouterService;
|
|
1946
|
+
this._idParamKey = new BehaviorSubject(DBX_FIREBASE_ROUTER_SYNC_DEFAULT_ID_PARAM_KEY);
|
|
1947
|
+
this.idParamKey$ = this._idParamKey.asObservable();
|
|
1948
|
+
this.idFromParams$ = combineLatest([this.idParamKey$, this.dbxRouterService.params$]).pipe(map(([key, params]) => {
|
|
1949
|
+
var _a;
|
|
1950
|
+
return (_a = params[key]) !== null && _a !== void 0 ? _a : undefined;
|
|
1951
|
+
}), distinctUntilChanged(), shareReplay$1(1));
|
|
1952
|
+
}
|
|
1953
|
+
ngOnInit() {
|
|
1954
|
+
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.idFromParams$);
|
|
1955
|
+
}
|
|
1956
|
+
ngOnDestroy() {
|
|
1957
|
+
super.ngOnDestroy();
|
|
1958
|
+
this._idParamKey.complete();
|
|
1959
|
+
}
|
|
1960
|
+
// MARK: Input
|
|
1961
|
+
get idParam() {
|
|
1962
|
+
return this._idParamKey.value;
|
|
1963
|
+
}
|
|
1964
|
+
set idParam(idParam) {
|
|
1965
|
+
this._idParamKey.next(idParam || DBX_FIREBASE_ROUTER_SYNC_DEFAULT_ID_PARAM_KEY);
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
DbxFirebaseDocumentStoreRouteIdDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDocumentStoreRouteIdDirective, deps: [{ token: DbxFirebaseDocumentStoreDirective, host: true }, { token: i3$1.DbxRouterService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1969
|
+
DbxFirebaseDocumentStoreRouteIdDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseDocumentStoreRouteIdDirective, selector: "[dbxFirebaseDocumentStoreRouteId]", inputs: { idParam: ["dbxFirebaseDocumentStoreRouteId", "idParam"] }, usesInheritance: true, ngImport: i0 });
|
|
1970
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDocumentStoreRouteIdDirective, decorators: [{
|
|
1971
|
+
type: Directive,
|
|
1972
|
+
args: [{
|
|
1973
|
+
selector: '[dbxFirebaseDocumentStoreRouteId]'
|
|
1974
|
+
}]
|
|
1975
|
+
}], ctorParameters: function () {
|
|
1976
|
+
return [{ type: DbxFirebaseDocumentStoreDirective, decorators: [{
|
|
1977
|
+
type: Host
|
|
1978
|
+
}] }, { type: i3$1.DbxRouterService }];
|
|
1979
|
+
}, propDecorators: { idParam: [{
|
|
1980
|
+
type: Input,
|
|
1981
|
+
args: ['dbxFirebaseDocumentStoreRouteId']
|
|
1982
|
+
}] } });
|
|
1983
|
+
|
|
1984
|
+
class DbxFirebaseModelStoreModule {
|
|
1985
|
+
}
|
|
1986
|
+
DbxFirebaseModelStoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1987
|
+
DbxFirebaseModelStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, declarations: [DbxFirebaseCollectionListDirective,
|
|
1988
|
+
DbxFirebaseCollectionChangeDirective,
|
|
1989
|
+
DbxFirebaseCollectionHasChangeDirective,
|
|
1990
|
+
DbxFirebaseDocumentStoreRouteIdDirective,
|
|
1991
|
+
DbxFirebaseDocumentAuthIdDirective], exports: [DbxFirebaseCollectionListDirective,
|
|
1992
|
+
DbxFirebaseCollectionChangeDirective,
|
|
1993
|
+
DbxFirebaseCollectionHasChangeDirective,
|
|
1994
|
+
DbxFirebaseDocumentStoreRouteIdDirective,
|
|
1995
|
+
DbxFirebaseDocumentAuthIdDirective] });
|
|
1996
|
+
DbxFirebaseModelStoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, imports: [[]] });
|
|
1997
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, decorators: [{
|
|
1998
|
+
type: NgModule,
|
|
1999
|
+
args: [{
|
|
2000
|
+
imports: [],
|
|
2001
|
+
declarations: [
|
|
2002
|
+
DbxFirebaseCollectionListDirective,
|
|
2003
|
+
DbxFirebaseCollectionChangeDirective,
|
|
2004
|
+
DbxFirebaseCollectionHasChangeDirective,
|
|
2005
|
+
DbxFirebaseDocumentStoreRouteIdDirective,
|
|
2006
|
+
DbxFirebaseDocumentAuthIdDirective
|
|
2007
|
+
],
|
|
2008
|
+
exports: [
|
|
2009
|
+
DbxFirebaseCollectionListDirective,
|
|
2010
|
+
DbxFirebaseCollectionChangeDirective,
|
|
2011
|
+
DbxFirebaseCollectionHasChangeDirective,
|
|
2012
|
+
DbxFirebaseDocumentStoreRouteIdDirective,
|
|
2013
|
+
DbxFirebaseDocumentAuthIdDirective
|
|
2014
|
+
]
|
|
2015
|
+
}]
|
|
2016
|
+
}] });
|
|
2017
|
+
|
|
2018
|
+
/**
|
|
2019
|
+
* Used for storing the state of a Person and related email threads.
|
|
2020
|
+
*/
|
|
2021
|
+
class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
|
|
2022
|
+
constructor() {
|
|
2023
|
+
super(...arguments);
|
|
2024
|
+
// MARK: Effects
|
|
2025
|
+
this.setMaxPages = this.effect((input) => {
|
|
2026
|
+
return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => x.maxPages = maxPages))));
|
|
2027
|
+
});
|
|
2028
|
+
this.setItemsPerPage = this.effect((input) => {
|
|
2029
|
+
return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => x.itemsPerPage = itemsPerPage))));
|
|
2030
|
+
});
|
|
2031
|
+
this.setConstraints = this.effect((input) => {
|
|
2032
|
+
return input.pipe(switchMap((constraints) => this.loader$.pipe(tap((x) => x.setConstraints(constraints)))));
|
|
2033
|
+
});
|
|
2034
|
+
this.next = this.effect((input) => {
|
|
2035
|
+
return input.pipe(exhaustMap(() => this.loader$.pipe(first(), tap((x) => x.next()))));
|
|
2036
|
+
});
|
|
2037
|
+
this.restart = this.effect((input) => {
|
|
2038
|
+
return input.pipe(exhaustMap(() => this.loader$.pipe(first(), tap((x) => x.restart()))));
|
|
2039
|
+
});
|
|
2040
|
+
// MARK: Accessors
|
|
2041
|
+
this.currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
|
|
2042
|
+
this.firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
|
|
2043
|
+
this.loader$ = this.currentFirestoreCollection$.pipe(switchMap((collection) => this.state$.pipe(first(), map(x => dbxFirebaseCollectionLoaderInstance({
|
|
2044
|
+
collection,
|
|
2045
|
+
maxPages: x.maxPages,
|
|
2046
|
+
itemsPerPage: x.itemsPerPage,
|
|
2047
|
+
constraints: x.constraints
|
|
2048
|
+
})))), cleanupDestroyable(), distinctUntilChanged(), shareReplay(1));
|
|
2049
|
+
this.firestoreIteration$ = this.loader$.pipe(switchMap(x => x.firestoreIteration$));
|
|
2050
|
+
this.queryChangeWatcher$ = this.loader$.pipe(switchMap(x => x.queryChangeWatcher$));
|
|
2051
|
+
this.accumulator$ = this.loader$.pipe(switchMap(x => x.accumulator$));
|
|
2052
|
+
this.pageLoadingState$ = this.loader$.pipe(switchMap(x => x.pageLoadingState$));
|
|
2053
|
+
this.setFirestoreCollection = this.updater((state, firestoreCollection) => (Object.assign(Object.assign({}, state), { firestoreCollection })));
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
AbstractDbxFirebaseCollectionStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2057
|
+
AbstractDbxFirebaseCollectionStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionStore });
|
|
2058
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionStore, decorators: [{
|
|
2059
|
+
type: Injectable
|
|
2060
|
+
}] });
|
|
2061
|
+
|
|
2062
|
+
const DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR = 'DOES_NOT_EXIST';
|
|
2063
|
+
function modelDoesNotExistError() {
|
|
2064
|
+
return readableError(DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, 'The document does not exist.');
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* Used for storing the state of a Person and related email threads.
|
|
2069
|
+
*/
|
|
2070
|
+
class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
|
|
2071
|
+
constructor() {
|
|
2072
|
+
super(...arguments);
|
|
2073
|
+
// MARK: Effects
|
|
2074
|
+
// MARK: Accessors
|
|
2075
|
+
this.currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
|
|
2076
|
+
this.firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
|
|
2077
|
+
this.currentInputId$ = this.state$.pipe(map(x => x.id), distinctUntilChanged(), shareReplay(1));
|
|
2078
|
+
this.inputId$ = this.currentInputId$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
2079
|
+
this.currentInputRef$ = this.state$.pipe(map(x => x.ref), distinctUntilChanged(), shareReplay(1));
|
|
2080
|
+
this.inputRef$ = this.currentInputRef$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
2081
|
+
this.currentDocument$ = combineLatest([this.currentFirestoreCollection$, this.currentInputId$, this.currentInputRef$]).pipe(map(([collection, id, ref]) => {
|
|
2082
|
+
let document;
|
|
2083
|
+
if (collection) {
|
|
2084
|
+
if (ref) {
|
|
2085
|
+
document = collection.documentAccessor().loadDocument(ref);
|
|
2086
|
+
}
|
|
2087
|
+
else if (id) {
|
|
2088
|
+
document = collection.documentAccessor().loadDocumentForPath(id);
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
return document;
|
|
2092
|
+
}), distinctUntilChanged(), shareReplay(1));
|
|
2093
|
+
this.document$ = this.currentDocument$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
2094
|
+
this.documentLoadingState$ = this.currentDocument$.pipe(map(x => (x) ? successResult(x) : beginLoading()), shareReplay(1));
|
|
2095
|
+
this.id$ = this.document$.pipe(map(x => x.id), shareReplay());
|
|
2096
|
+
this.ref$ = this.document$.pipe(map(x => x.documentRef), shareReplay());
|
|
2097
|
+
this.snapshot$ = this.document$.pipe(switchMap(x => x.accessor.stream()), shareReplay(1));
|
|
2098
|
+
this.snapshotLoadingState$ = this.currentDocument$.pipe(switchMap(_ => loadingStateFromObs(this.snapshot$)), shareReplay(1));
|
|
2099
|
+
this.currentData$ = this.document$.pipe(switchMap(x => x.accessor.stream().pipe(map(y => documentDataWithId(y)))), shareReplay(1));
|
|
2100
|
+
this.data$ = this.currentDocument$.pipe(switchMap(() => this.currentData$.pipe(filterMaybe())), shareReplay(1));
|
|
2101
|
+
this.dataLoadingState$ = this.snapshotLoadingState$.pipe(map((x) => {
|
|
2102
|
+
let result;
|
|
2103
|
+
if (x.value) {
|
|
2104
|
+
const data = documentDataWithId(x.value);
|
|
2105
|
+
if (data) {
|
|
2106
|
+
result = successResult(data);
|
|
2107
|
+
}
|
|
2108
|
+
else {
|
|
2109
|
+
result = errorResult(modelDoesNotExistError());
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
else {
|
|
2113
|
+
result = Object.assign(Object.assign({}, x), { value: undefined });
|
|
2114
|
+
}
|
|
2115
|
+
return result;
|
|
2116
|
+
}), shareReplay(1));
|
|
2117
|
+
this.exists$ = this.currentData$.pipe(map(x => isMaybeSo(x)), shareReplay(1));
|
|
2118
|
+
this.doesNotExist$ = this.exists$.pipe(map(x => !x), shareReplay(1));
|
|
2119
|
+
// MARK: State Changes
|
|
2120
|
+
/**
|
|
2121
|
+
* Sets the id of the document to load.
|
|
2122
|
+
*/
|
|
2123
|
+
this.setId = this.updater((state, id) => (id) ? (Object.assign(Object.assign({}, state), { id, ref: undefined })) : (Object.assign(Object.assign({}, state), { id })));
|
|
2124
|
+
/**
|
|
2125
|
+
* Sets the ref of the document to load.
|
|
2126
|
+
*/
|
|
2127
|
+
this.setRef = this.updater((state, ref) => (ref) ? (Object.assign(Object.assign({}, state), { id: undefined, ref })) : (Object.assign(Object.assign({}, state), { ref })));
|
|
2128
|
+
this.setFirestoreCollection = this.updater((state, firestoreCollection) => (Object.assign(Object.assign({}, state), { firestoreCollection })));
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
AbstractDbxFirebaseDocumentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseDocumentStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2132
|
+
AbstractDbxFirebaseDocumentStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseDocumentStore });
|
|
2133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseDocumentStore, decorators: [{
|
|
2134
|
+
type: Injectable
|
|
2135
|
+
}] });
|
|
2136
|
+
|
|
2137
|
+
function setParentStoreEffect(store) {
|
|
2138
|
+
return store.effect((input) => {
|
|
2139
|
+
return input.pipe(map((parentStore) => {
|
|
2140
|
+
let result;
|
|
2141
|
+
if (parentStore) {
|
|
2142
|
+
result = store.setParent(parentStore.currentDocument$);
|
|
2143
|
+
}
|
|
2144
|
+
else {
|
|
2145
|
+
result = undefined;
|
|
2146
|
+
}
|
|
2147
|
+
// set as the parent lock set too
|
|
2148
|
+
store.setParentLockSet(parentStore);
|
|
2149
|
+
return result;
|
|
2150
|
+
}), cleanup((sub) => {
|
|
2151
|
+
if (sub) {
|
|
2152
|
+
sub.unsubscribe();
|
|
2153
|
+
}
|
|
2154
|
+
}));
|
|
2155
|
+
});
|
|
2156
|
+
}
|
|
2157
|
+
function setParentEffect(store) {
|
|
2158
|
+
return store.effect((input) => {
|
|
2159
|
+
return input.pipe(switchMap((parent) => {
|
|
2160
|
+
store._setParentDocument(parent);
|
|
2161
|
+
if (parent) {
|
|
2162
|
+
return store.collectionFactory$.pipe(tap((collectionFactory) => {
|
|
2163
|
+
const collection = collectionFactory(parent);
|
|
2164
|
+
store.setFirestoreCollection(collection);
|
|
2165
|
+
}));
|
|
2166
|
+
}
|
|
2167
|
+
else {
|
|
2168
|
+
// clear the current collection
|
|
2169
|
+
store.setFirestoreCollection(undefined);
|
|
2170
|
+
// do nothing until a parent is returned.
|
|
2171
|
+
return NEVER;
|
|
2172
|
+
}
|
|
2173
|
+
}));
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
/**
|
|
2178
|
+
* Abstract DbxFirebaseCollectionStore that has a parent document from which is derives it's FiresbaseCollection from.
|
|
2179
|
+
*/
|
|
2180
|
+
class AbstractDbxFirebaseCollectionWithParentStore extends AbstractDbxFirebaseCollectionStore {
|
|
2181
|
+
constructor() {
|
|
2182
|
+
super(...arguments);
|
|
2183
|
+
// MARK: Effects
|
|
2184
|
+
this.setParent = setParentEffect(this);
|
|
2185
|
+
this.setParentStore = setParentStoreEffect(this);
|
|
2186
|
+
// MARK: Accessors
|
|
2187
|
+
this.currentParent$ = this.state$.pipe(map(x => x.parent), distinctUntilChanged(), shareReplay(1));
|
|
2188
|
+
this.parent$ = this.currentParent$.pipe(filterMaybe());
|
|
2189
|
+
this.currentCollectionFactory$ = this.state$.pipe(map(x => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
|
|
2190
|
+
this.collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
|
|
2191
|
+
// MARK: State Changes
|
|
2192
|
+
/**
|
|
2193
|
+
* Sets the collection factory function to use.
|
|
2194
|
+
*/
|
|
2195
|
+
this.setCollectionFactory = this.updater((state, collectionFactory) => (Object.assign(Object.assign({}, state), { collectionFactory })));
|
|
2196
|
+
/**
|
|
2197
|
+
* Sets the parent on the current state.
|
|
2198
|
+
*/
|
|
2199
|
+
this._setParentDocument = this.updater((state, parent) => (Object.assign(Object.assign({}, state), { parent })));
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
AbstractDbxFirebaseCollectionWithParentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2203
|
+
AbstractDbxFirebaseCollectionWithParentStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore });
|
|
2204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, decorators: [{
|
|
2205
|
+
type: Injectable
|
|
2206
|
+
}] });
|
|
2207
|
+
|
|
2208
|
+
/**
|
|
2209
|
+
* Abstract DbxFirebaseDocumentStore that has a parent document from which is derives it's FiresbaseCollection from.
|
|
2210
|
+
*/
|
|
2211
|
+
class AbstractDbxFirebaseDocumentWithParentStore extends AbstractDbxFirebaseDocumentStore {
|
|
2212
|
+
constructor() {
|
|
2213
|
+
super(...arguments);
|
|
2214
|
+
// MARK: Effects
|
|
2215
|
+
this.setParent = setParentEffect(this);
|
|
2216
|
+
this.setParentStore = setParentStoreEffect(this);
|
|
2217
|
+
// MARK: Accessors
|
|
2218
|
+
this.currentParent$ = this.state$.pipe(map(x => x.parent), distinctUntilChanged(), shareReplay(1));
|
|
2219
|
+
this.parent$ = this.currentParent$.pipe(filterMaybe());
|
|
2220
|
+
this.currentCollectionFactory$ = this.state$.pipe(map(x => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
|
|
2221
|
+
this.collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
|
|
2222
|
+
// MARK: State Changes
|
|
2223
|
+
/**
|
|
2224
|
+
* Sets the collection factory function to use.
|
|
2225
|
+
*/
|
|
2226
|
+
this.setCollectionFactory = this.updater((state, collectionFactory) => (Object.assign(Object.assign({}, state), { collectionFactory })));
|
|
2227
|
+
/**
|
|
2228
|
+
* Sets the parent on the current state.
|
|
2229
|
+
*/
|
|
2230
|
+
this._setParentDocument = this.updater((state, parent) => (Object.assign(Object.assign({}, state), { parent })));
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
AbstractDbxFirebaseDocumentWithParentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseDocumentWithParentStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2234
|
+
AbstractDbxFirebaseDocumentWithParentStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseDocumentWithParentStore });
|
|
2235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseDocumentWithParentStore, decorators: [{
|
|
2236
|
+
type: Injectable
|
|
2237
|
+
}] });
|
|
2238
|
+
|
|
2239
|
+
class DbxFirebaseModelModule {
|
|
2240
|
+
}
|
|
2241
|
+
DbxFirebaseModelModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2242
|
+
DbxFirebaseModelModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelModule, exports: [DbxFirebaseModelStoreModule] });
|
|
2243
|
+
DbxFirebaseModelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelModule, imports: [DbxFirebaseModelStoreModule] });
|
|
2244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelModule, decorators: [{
|
|
2245
|
+
type: NgModule,
|
|
2246
|
+
args: [{
|
|
2247
|
+
exports: [
|
|
2248
|
+
DbxFirebaseModelStoreModule
|
|
2249
|
+
]
|
|
2250
|
+
}]
|
|
2251
|
+
}] });
|
|
2252
|
+
|
|
2253
|
+
class DbxFirebaseModule {
|
|
2254
|
+
}
|
|
2255
|
+
DbxFirebaseModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2256
|
+
DbxFirebaseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModule, exports: [DbxFirebaseModelModule] });
|
|
2257
|
+
DbxFirebaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModule, imports: [DbxFirebaseModelModule] });
|
|
2258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModule, decorators: [{
|
|
2259
|
+
type: NgModule,
|
|
2260
|
+
args: [{
|
|
2261
|
+
exports: [
|
|
2262
|
+
DbxFirebaseModelModule
|
|
2263
|
+
]
|
|
2264
|
+
}]
|
|
2265
|
+
}] });
|
|
2
2266
|
|
|
3
2267
|
/**
|
|
4
2268
|
* Generated bundle index. Do not edit.
|
|
5
2269
|
*/
|
|
6
2270
|
|
|
7
|
-
export {
|
|
2271
|
+
export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_OPTIONS_TOKEN, DBX_FIREBASE_ROUTER_SYNC_DEFAULT_ID_PARAM_KEY, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DbxFirebaseAuthLoginService, DbxFirebaseAuthModule, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionStoreDirective, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultFirebaseProvidersModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultFunctionsProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDocumentAuthIdDirective, DbxFirebaseDocumentStoreDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseEmailFormComponent, DbxFirebaseEmailRecoveryFormComponent, DbxFirebaseEmulatorModule, DbxFirebaseFirestoreCollectionModule, DbxFirebaseFunctionsModule, DbxFirebaseLoginAnonymousComponent, DbxFirebaseLoginAppleComponent, DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent, DbxFirebaseLoginComponent, DbxFirebaseLoginContext, DbxFirebaseLoginContextBackButtonComponent, DbxFirebaseLoginContextDirective, DbxFirebaseLoginEmailComponent, DbxFirebaseLoginEmailContentComponent, DbxFirebaseLoginFacebookComponent, DbxFirebaseLoginGitHubComponent, DbxFirebaseLoginGoogleComponent, DbxFirebaseLoginListComponent, DbxFirebaseLoginMicrosoftComponent, DbxFirebaseLoginModule, DbxFirebaseLoginModuleRootConfig, DbxFirebaseLoginTermsComponent, DbxFirebaseLoginTermsSimpleComponent, DbxFirebaseLoginTwitterComponent, DbxFirebaseModelModule, DbxFirebaseModelStoreModule, DbxFirebaseModule, DbxFirebaseParsedEmulatorsConfig, DbxFirebaseRegisterComponent, DbxFirebaseRegisterEmailComponent, DbxFirestoreContextService, FIREBASE_AUTH_NETWORK_REQUEST_ERROR, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY, authUserInfoFromAuthUser, authUserStateFromFirebaseAuthService, dbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstanceWithCollection, defaultFirebaseAuthLoginProvidersFactory, firebaseAuthErrorToReadableError, modelDoesNotExistError, provideDbxFirebaseCollectionStoreDirective, provideDbxFirebaseDocumentStoreDirective, readValueFromIdToken, setParentEffect, setParentStoreEffect };
|
|
8
2272
|
//# sourceMappingURL=dereekb-dbx-firebase.mjs.map
|