@dereekb/dbx-firebase 10.2.0 → 11.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/analytics/analytics.user.events.mjs +10 -15
- package/esm2022/lib/analytics/analytics.user.source.mjs +20 -23
- package/esm2022/lib/auth/appcheck/appcheck.interceptor.mjs +13 -17
- package/esm2022/lib/auth/firebase.auth.module.mjs +4 -4
- package/esm2022/lib/auth/login/firebase.login.module.mjs +14 -11
- package/esm2022/lib/auth/login/login.anonymous.component.mjs +4 -7
- package/esm2022/lib/auth/login/login.apple.component.mjs +4 -7
- package/esm2022/lib/auth/login/login.button.component.mjs +23 -28
- package/esm2022/lib/auth/login/login.component.mjs +8 -7
- package/esm2022/lib/auth/login/login.context.back.component.mjs +8 -10
- package/esm2022/lib/auth/login/login.context.directive.mjs +4 -4
- package/esm2022/lib/auth/login/login.email.component.mjs +4 -7
- package/esm2022/lib/auth/login/login.email.content.component.mjs +53 -57
- package/esm2022/lib/auth/login/login.email.form.component.mjs +9 -12
- package/esm2022/lib/auth/login/login.email.recovery.form.component.mjs +5 -8
- package/esm2022/lib/auth/login/login.facebook.component.mjs +4 -7
- package/esm2022/lib/auth/login/login.github.component.mjs +4 -7
- package/esm2022/lib/auth/login/login.google.component.mjs +4 -7
- package/esm2022/lib/auth/login/login.list.component.mjs +31 -34
- package/esm2022/lib/auth/login/login.microsoft.component.mjs +4 -7
- package/esm2022/lib/auth/login/login.service.mjs +11 -15
- package/esm2022/lib/auth/login/login.terms.component.mjs +11 -14
- package/esm2022/lib/auth/login/login.terms.simple.component.mjs +16 -19
- package/esm2022/lib/auth/login/login.twitter.component.mjs +4 -7
- package/esm2022/lib/auth/login/register.component.mjs +7 -4
- package/esm2022/lib/auth/login/register.email.component.mjs +4 -7
- package/esm2022/lib/auth/service/firebase.auth.service.mjs +52 -52
- package/esm2022/lib/development/development.module.mjs +10 -11
- package/esm2022/lib/development/development.popup.component.mjs +13 -15
- package/esm2022/lib/development/development.popup.content.component.mjs +41 -46
- package/esm2022/lib/development/development.popup.content.form.component.mjs +17 -20
- package/esm2022/lib/development/development.popup.directive.mjs +9 -13
- package/esm2022/lib/development/development.scheduler.list.component.mjs +22 -32
- package/esm2022/lib/development/development.scheduler.service.mjs +26 -36
- package/esm2022/lib/development/development.scheduler.widget.component.mjs +10 -13
- package/esm2022/lib/development/development.service.mjs +4 -3
- package/esm2022/lib/development/development.widget.service.mjs +8 -9
- package/esm2022/lib/firebase/emulators.mjs +12 -1
- package/esm2022/lib/firebase/firebase.emulator.module.mjs +4 -4
- package/esm2022/lib/firebase/firebase.emulator.service.mjs +6 -9
- package/esm2022/lib/firebase/firebase.module.mjs +25 -25
- package/esm2022/lib/firestore/firebase.firestore.context.service.mjs +6 -11
- package/esm2022/lib/firestore/firebase.firestore.module.mjs +4 -4
- package/esm2022/lib/function/firebase.function.module.mjs +4 -4
- package/esm2022/lib/model/loader/collection.change.trigger.mjs +5 -3
- package/esm2022/lib/model/loader/collection.change.watcher.mjs +30 -32
- package/esm2022/lib/model/loader/collection.loader.instance.mjs +48 -43
- package/esm2022/lib/model/loader/document.loader.instance.mjs +22 -20
- package/esm2022/lib/model/model.module.mjs +4 -4
- package/esm2022/lib/model/modules/model/model.history.component.mjs +14 -16
- package/esm2022/lib/model/modules/model/model.history.module.mjs +4 -4
- package/esm2022/lib/model/modules/model/model.history.popover.button.component.mjs +10 -11
- package/esm2022/lib/model/modules/model/model.history.popover.component.mjs +5 -8
- package/esm2022/lib/model/modules/model/model.tracker.service.mjs +11 -15
- package/esm2022/lib/model/modules/model/model.types.list.component.mjs +12 -15
- package/esm2022/lib/model/modules/model/model.types.module.mjs +4 -4
- package/esm2022/lib/model/modules/model/model.types.service.mjs +48 -40
- package/esm2022/lib/model/modules/model/model.types.view.directive.mjs +10 -15
- package/esm2022/lib/model/modules/store/model.store.module.mjs +4 -4
- package/esm2022/lib/model/modules/store/store.collection.change.directive.mjs +14 -20
- package/esm2022/lib/model/modules/store/store.collection.change.if.directive.mjs +23 -27
- package/esm2022/lib/model/modules/store/store.collection.directive.mjs +5 -4
- package/esm2022/lib/model/modules/store/store.collection.list.directive.mjs +8 -12
- package/esm2022/lib/model/modules/store/store.collection.mjs +39 -42
- package/esm2022/lib/model/modules/store/store.document.auth.directive.mjs +7 -14
- package/esm2022/lib/model/modules/store/store.document.directive.mjs +35 -19
- package/esm2022/lib/model/modules/store/store.document.mjs +125 -128
- package/esm2022/lib/model/modules/store/store.document.router.directive.mjs +12 -19
- package/esm2022/lib/model/modules/store/store.document.router.key.directive.mjs +13 -20
- package/esm2022/lib/model/modules/store/store.subcollection.directive.mjs +3 -3
- package/esm2022/lib/model/modules/store/store.subcollection.document.mjs +76 -82
- package/esm2022/lib/model/modules/store/store.subcollection.mjs +51 -51
- package/esm2022/lib/model/service/model.context.instance.mjs +11 -10
- package/esm2022/lib/model/system/systemstate.collection.store.directive.mjs +3 -3
- package/esm2022/lib/model/system/systemstate.collection.store.mjs +4 -3
- package/esm2022/lib/model/system/systemstate.document.store.accessor.mjs +18 -9
- package/esm2022/lib/model/system/systemstate.document.store.directive.mjs +7 -8
- package/esm2022/lib/model/system/systemstate.document.store.mjs +4 -3
- package/esm2022/lib/module.mjs +4 -4
- package/esm2022/lib/pipe/key.pipe.mjs +5 -5
- package/esm2022/lib/pipe/pipe.module.mjs +4 -4
- package/esm2022/lib/router/id.param.redirect.mjs +58 -62
- package/esm2022/lib/storage/firebase.storage.module.mjs +4 -4
- package/esm2022/lib/storage/firebase.storage.service.mjs +6 -11
- package/fesm2022/dereekb-dbx-firebase.mjs +1210 -1297
- package/fesm2022/dereekb-dbx-firebase.mjs.map +1 -1
- package/lib/analytics/analytics.user.events.d.ts +0 -1
- package/lib/analytics/analytics.user.source.d.ts +0 -1
- package/lib/auth/appcheck/appcheck.interceptor.d.ts +1 -5
- package/lib/auth/login/firebase.login.module.d.ts +2 -1
- package/lib/auth/login/login.button.component.d.ts +0 -1
- package/lib/auth/login/login.email.content.component.d.ts +0 -1
- package/lib/auth/login/login.list.component.d.ts +0 -1
- package/lib/auth/login/login.service.d.ts +2 -2
- package/lib/auth/login/login.terms.component.d.ts +0 -1
- package/lib/auth/login/login.terms.simple.component.d.ts +0 -1
- package/lib/auth/service/firebase.auth.service.d.ts +2 -2
- package/lib/development/development.module.d.ts +1 -1
- package/lib/development/development.popup.component.d.ts +1 -2
- package/lib/development/development.popup.content.component.d.ts +0 -1
- package/lib/development/development.popup.directive.d.ts +0 -1
- package/lib/development/development.scheduler.list.component.d.ts +1 -2
- package/lib/development/development.scheduler.service.d.ts +1 -3
- package/lib/development/development.scheduler.widget.component.d.ts +0 -1
- package/lib/development/development.widget.service.d.ts +2 -2
- package/lib/firebase/firebase.emulator.service.d.ts +0 -1
- package/lib/firestore/firebase.firestore.context.service.d.ts +1 -2
- package/lib/model/loader/collection.change.trigger.d.ts +1 -1
- package/lib/model/loader/collection.change.watcher.d.ts +8 -18
- package/lib/model/modules/model/model.history.component.d.ts +0 -1
- package/lib/model/modules/model/model.history.popover.button.component.d.ts +2 -3
- package/lib/model/modules/model/model.history.popover.component.d.ts +1 -2
- package/lib/model/modules/model/model.tracker.service.d.ts +0 -1
- package/lib/model/modules/model/model.types.service.d.ts +8 -10
- package/lib/model/modules/model/model.types.view.directive.d.ts +1 -2
- package/lib/model/modules/store/store.collection.change.directive.d.ts +2 -4
- package/lib/model/modules/store/store.collection.change.if.directive.d.ts +2 -3
- package/lib/model/modules/store/store.collection.list.directive.d.ts +4 -4
- package/lib/model/modules/store/store.document.auth.directive.d.ts +2 -3
- package/lib/model/modules/store/store.document.directive.d.ts +14 -7
- package/lib/model/modules/store/store.document.router.directive.d.ts +3 -4
- package/lib/model/modules/store/store.document.router.key.directive.d.ts +4 -5
- package/lib/model/system/systemstate.document.store.accessor.d.ts +5 -2
- package/lib/model/system/systemstate.document.store.directive.d.ts +1 -1
- package/lib/router/id.param.redirect.d.ts +3 -13
- package/lib/storage/firebase.storage.service.d.ts +1 -2
- package/package.json +1 -1
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { asObservable, timeoutStartWith, filterMaybe, isNot, SubscriptionObject, lazyFrom, switchMapWhileTrue, loadingStateFromObs, cleanupDestroyable, pageItemAccumulatorCurrentPage, accumulatorFlattenPageListLoadingState, useFirst, itemAccumulatorNextPageUntilResultsCount, iteratorNextPageUntilPage, iteratorNextPageUntilMaxPageLoadLimit, pageLoadingStateFromObs, useAsObservable, invertObservableDecision, filterItemsWithObservableDecision,
|
|
2
|
+
import { inject, Injectable, InjectionToken, Component, Optional, Inject, Input, Directive, EventEmitter, Output, NgModule, Injector, ViewChild, HostListener, ElementRef, ChangeDetectionStrategy, forwardRef, NgZone, Pipe } from '@angular/core';
|
|
3
|
+
import { DbxAnalyticsService } from '@dereekb/dbx-analytics';
|
|
4
|
+
import { asObservable, timeoutStartWith, filterMaybe, isNot, SubscriptionObject, lazyFrom, switchMapWhileTrue, loadingStateFromObs, cleanupDestroyable, pageItemAccumulatorCurrentPage, accumulatorFlattenPageListLoadingState, useFirst, itemAccumulatorNextPageUntilResultsCount, iteratorNextPageUntilPage, iteratorNextPageUntilMaxPageLoadLimit, pageLoadingStateFromObs, useAsObservable, mapEachAsync, invertObservableDecision, filterItemsWithObservableDecision, distinctUntilModelKeyChange, successResult, beginLoading, errorResult, isLoadingStateLoading, cleanup, mapLoadingState } from '@dereekb/rxjs';
|
|
5
5
|
import { switchMap, of, shareReplay, map, distinctUntilChanged, EMPTY, catchError, firstValueFrom, BehaviorSubject, combineLatest, first, from, tap, interval, exhaustMap, filter, take, startWith, Subject, throttleTime, NEVER, combineLatestWith } from 'rxjs';
|
|
6
|
-
import * as
|
|
7
|
-
import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, AbstractForwardDbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponentModule, DbxAuthService, AbstractSubscriptionDirective, AbstractIfDirective,
|
|
8
|
-
import * as
|
|
9
|
-
import { authState, idToken, GoogleAuthProvider, FacebookAuthProvider, TwitterAuthProvider, GithubAuthProvider, signInWithPopup, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInAnonymously, reauthenticateWithPopup, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';
|
|
6
|
+
import * as i3 from '@dereekb/dbx-core';
|
|
7
|
+
import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, AbstractForwardDbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponentModule, DbxAuthService, AbstractSubscriptionDirective, AbstractIfDirective, dbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance, DbxRouterService, LockSetComponentStore } from '@dereekb/dbx-core';
|
|
8
|
+
import * as i3$1 from '@angular/fire/auth';
|
|
9
|
+
import { Auth, authState, idToken, GoogleAuthProvider, FacebookAuthProvider, TwitterAuthProvider, GithubAuthProvider, signInWithPopup, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInAnonymously, reauthenticateWithPopup, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';
|
|
10
10
|
import { AUTH_ADMIN_ROLE, cachedGetter, urlWithoutParameters, addToSet, removeFromSet, filterMaybeValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, addToSetCopy, iterableToArray, runAsyncTasksForValues, forEachKeyValue, countAllInNestedArray, invertDecision, readableError, isMaybeSo, firstValue } from '@dereekb/util';
|
|
11
11
|
import { safeFormatToISO8601DateString, msToSeconds } from '@dereekb/date';
|
|
12
12
|
import { sendPasswordResetEmail } from 'firebase/auth';
|
|
13
13
|
import { getToken, initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check';
|
|
14
|
-
import * as
|
|
15
|
-
import { provideAppCheck } from '@angular/fire/app-check';
|
|
16
|
-
import * as
|
|
14
|
+
import * as i2$2 from '@angular/fire/app-check';
|
|
15
|
+
import { AppCheck, provideAppCheck } from '@angular/fire/app-check';
|
|
16
|
+
import * as i2$1 from '@angular/material/button';
|
|
17
17
|
import { MatButtonModule } from '@angular/material/button';
|
|
18
|
-
import * as i2
|
|
18
|
+
import * as i2 from '@angular/material/icon';
|
|
19
19
|
import { MatIconModule } from '@angular/material/icon';
|
|
20
|
-
import * as
|
|
20
|
+
import * as i1$1 from '@angular/common';
|
|
21
21
|
import { CommonModule } from '@angular/common';
|
|
22
|
-
import * as i1
|
|
23
|
-
import { DbxRouterAnchorModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, AbstractDbxSelectionListWrapperDirective, provideDbxListViewWrapper, DEFAULT_LIST_WRAPPER_DIRECTIVE_TEMPLATE, AbstractDbxSelectionListViewDirective, provideDbxListView, DEFAULT_DBX_SELECTION_VALUE_LIST_DIRECTIVE_TEMPLATE, AbstractDbxValueListViewItemComponent,
|
|
24
|
-
import * as i1$
|
|
25
|
-
import { firebaseAuthErrorToReadableError, ScheduledFunctionDevelopmentFunctionTypeEnum, clientFirebaseFirestoreContextFactory, SystemStateFirestoreCollections, FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY,
|
|
26
|
-
import * as
|
|
22
|
+
import * as i1 from '@dereekb/dbx-web';
|
|
23
|
+
import { DbxRouterAnchorModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxWidgetService, AbstractDbxSelectionListWrapperDirective, provideDbxListViewWrapper, DEFAULT_LIST_WRAPPER_DIRECTIVE_TEMPLATE, AbstractDbxSelectionListViewDirective, provideDbxListView, DEFAULT_DBX_SELECTION_VALUE_LIST_DIRECTIVE_TEMPLATE, AbstractDbxValueListViewItemComponent, TwoColumnsContextStore, AbstractPopupDirective, DbxPopupService, DbxWidgetModule, DbxTextModule, DbxBlockLayoutModule, DbxTwoColumnLayoutModule, DbxPopupInteractionModule, DbxListLayoutModule, DbxModelTypesService, DbxModelTrackerService, allDbxModelViewTrackerEventModelKeys, AbstractPopoverDirective, AbstractPopoverRefDirective, DbxPopoverService, DbxModelObjectStateService, DbxModelInfoModule, DbxRouterListModule, DbxPopoverInteractionModule, DbxListViewWrapper } from '@dereekb/dbx-web';
|
|
24
|
+
import * as i1$3 from '@dereekb/firebase';
|
|
25
|
+
import { firebaseAuthErrorToReadableError, FirebaseDevelopmentFunctions, ScheduledFunctionDevelopmentFunctionTypeEnum, clientFirebaseFirestoreContextFactory, SystemStateFirestoreCollections, FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY, iterationQueryDocChangeWatcher, firebaseQuerySnapshotAccumulator, firebaseQueryItemAccumulator, firestoreModelKeysFromDocuments, firestoreModelIdsFromDocuments, documentReferencesFromDocuments, getDocumentSnapshots, getDataFromDocumentSnapshots, latestSnapshotsFromDocuments, dataFromDocumentSnapshots, loadDocumentsForKeys, loadDocumentsForDocumentReferences, loadDocumentsForIds, firestoreModelKeyCollectionTypePair, buildFirebaseCollectionTypeModelTypeMap, FirestoreAccessorStreamMode, firestoreModelIdsFromKey, firestoreModelKeyPartPairs, firestoreModelKeyPairObject, flatFirestoreModelKey, twoWayFlatFirestoreModelKey, documentDataWithIdAndKey, inferKeyFromTwoWayFlatFirestoreModelKey, firestoreModelKeyParentKey, clientFirebaseStorageContextFactory } from '@dereekb/firebase';
|
|
26
|
+
import * as i4 from '@dereekb/dbx-form';
|
|
27
27
|
import { AbstractAsyncFormlyFormDirective, usernamePasswordLoginFields, provideFormlyContext, AbstractSyncFormlyFormDirective, emailField, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, AbstractConfigAsyncFormlyFormDirective, pickableItemChipField, filterPickableItemFieldValuesByLabel } from '@dereekb/dbx-form';
|
|
28
28
|
import { initializeApp } from 'firebase/app';
|
|
29
29
|
import * as i6 from '@angular/fire/app';
|
|
30
30
|
import { FirebaseApp, provideFirebaseApp } from '@angular/fire/app';
|
|
31
|
-
import * as i4 from '@angular/fire/storage';
|
|
31
|
+
import * as i4$1 from '@angular/fire/storage';
|
|
32
32
|
import { provideStorage, getStorage, connectStorageEmulator, Storage } from '@angular/fire/storage';
|
|
33
33
|
import * as i5 from '@angular/fire/functions';
|
|
34
34
|
import { provideFunctions, getFunctions, connectFunctionsEmulator, Functions } from '@angular/fire/functions';
|
|
35
|
-
import * as i1$
|
|
35
|
+
import * as i1$2 from '@angular/fire/firestore';
|
|
36
36
|
import { provideFirestore, persistentMultipleTabManager, persistentSingleTabManager, persistentLocalCache, initializeFirestore, connectFirestoreEmulator, Firestore } from '@angular/fire/firestore';
|
|
37
37
|
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
38
|
-
import
|
|
38
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
39
39
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
40
40
|
|
|
41
41
|
function authUserInfoFromAuthUser(user) {
|
|
@@ -105,9 +105,7 @@ function readValueFromIdToken(dbxFirebaseAuthService, readValueFromIdToken, defa
|
|
|
105
105
|
|
|
106
106
|
// MARK: Delegate
|
|
107
107
|
class DbxFirebaseAuthServiceDelegate {
|
|
108
|
-
|
|
109
|
-
this.fullControlOfAuthUserState = false;
|
|
110
|
-
}
|
|
108
|
+
fullControlOfAuthUserState = false;
|
|
111
109
|
}
|
|
112
110
|
const DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE = {
|
|
113
111
|
authUserStateObs: authUserStateFromFirebaseAuthServiceFunction(),
|
|
@@ -123,41 +121,42 @@ const DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE = {
|
|
|
123
121
|
};
|
|
124
122
|
// MARK: Service
|
|
125
123
|
class DbxFirebaseAuthService {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const delegateAuthUserStateObs = delegate.authUserStateObs(this).pipe(catchError(() => of('error')), distinctUntilChanged(), shareReplay(1));
|
|
156
|
-
|
|
157
|
-
|
|
124
|
+
firebaseAuth = inject(Auth);
|
|
125
|
+
delegate = inject(DbxFirebaseAuthServiceDelegate, { optional: true }) ?? DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE;
|
|
126
|
+
_authState$ = authState(this.firebaseAuth);
|
|
127
|
+
currentAuthUser$ = this._authState$.pipe(timeoutStartWith(null, 1000), distinctUntilChanged(), shareReplay(1));
|
|
128
|
+
currentAuthUserInfo$ = this.currentAuthUser$.pipe(map((x) => (x ? authUserInfoFromAuthUser(x) : undefined)));
|
|
129
|
+
authUser$ = this.currentAuthUser$.pipe(filterMaybe());
|
|
130
|
+
authUserInfo$ = this.authUser$.pipe(map(authUserInfoFromAuthUser));
|
|
131
|
+
hasAuthUser$ = this.currentAuthUser$.pipe(map((x) => Boolean(x)), distinctUntilChanged(), shareReplay(1));
|
|
132
|
+
isAnonymousUser$ = this.authUser$.pipe(map((x) => x.isAnonymous), distinctUntilChanged(), shareReplay(1));
|
|
133
|
+
isNotAnonymousUser$ = this.isAnonymousUser$.pipe(isNot(), distinctUntilChanged(), shareReplay(1));
|
|
134
|
+
isLoggedIn$ = this.hasAuthUser$;
|
|
135
|
+
isNotLoggedIn$ = this.isLoggedIn$.pipe(isNot());
|
|
136
|
+
onLogIn$ = loggedInObsFromIsLoggedIn(this.isLoggedIn$);
|
|
137
|
+
onLogOut$ = loggedOutObsFromIsLoggedIn(this.isLoggedIn$);
|
|
138
|
+
currentUid$ = this.currentAuthUser$.pipe(map((x) => x?.uid), distinctUntilChanged(), shareReplay(1));
|
|
139
|
+
uid$ = this.currentUid$.pipe(map(authUserIdentifier), distinctUntilChanged(), shareReplay(1));
|
|
140
|
+
/**
|
|
141
|
+
* Alias for uid$
|
|
142
|
+
*/
|
|
143
|
+
userIdentifier$ = this.uid$;
|
|
144
|
+
currentIdTokenString$ = idToken(this.firebaseAuth).pipe(distinctUntilChanged(), shareReplay(1));
|
|
145
|
+
idTokenString$ = this.currentUid$.pipe(switchMap((x) => (x ? this.currentIdTokenString$.pipe(filterMaybe()) : EMPTY)));
|
|
146
|
+
currentIdTokenResult$ = this.currentAuthUser$.pipe(switchMap((x) => (x ? this.currentIdTokenString$.pipe(switchMap((y) => (y ? x.getIdTokenResult() : of(null)))) : of(null))), distinctUntilChanged(), shareReplay(1));
|
|
147
|
+
idTokenResult$ = this.currentIdTokenResult$.pipe(filterMaybe());
|
|
148
|
+
currentClaims$ = this.currentIdTokenResult$.pipe(map((x) => (x ? x.claims : null)), distinctUntilChanged(), shareReplay(1));
|
|
149
|
+
claims$ = this.currentClaims$.pipe(filterMaybe());
|
|
150
|
+
currentAuthContextInfo$ = this.currentAuthUser$.pipe(switchMap((x) => this.loadAuthContextInfoForUser(x)), shareReplay(1));
|
|
151
|
+
authContextInfo$ = this.currentAuthContextInfo$.pipe(filterMaybe());
|
|
152
|
+
authUserState$ = (() => {
|
|
153
|
+
const delegateAuthUserStateObs = this.delegate.authUserStateObs(this).pipe(catchError(() => of('error')), distinctUntilChanged(), shareReplay(1));
|
|
154
|
+
let obs;
|
|
155
|
+
if (this.delegate.fullControlOfAuthUserState) {
|
|
156
|
+
obs = delegateAuthUserStateObs;
|
|
158
157
|
}
|
|
159
158
|
else {
|
|
160
|
-
|
|
159
|
+
obs = this._authState$.pipe(distinctUntilChanged(), switchMap((x) => {
|
|
161
160
|
if (x != null) {
|
|
162
161
|
return delegateAuthUserStateObs;
|
|
163
162
|
}
|
|
@@ -166,11 +165,12 @@ class DbxFirebaseAuthService {
|
|
|
166
165
|
}
|
|
167
166
|
}));
|
|
168
167
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
168
|
+
return obs;
|
|
169
|
+
})();
|
|
170
|
+
authRoles$ = this.delegate.authRolesObs(this);
|
|
171
|
+
isOnboarded$ = this.delegate.isOnboarded(this);
|
|
172
|
+
_authRoleClaimsService = this.delegate.authRoleClaimsService;
|
|
173
|
+
isAdminInAuthRoleSet = this.delegate.isAdminInAuthRoleSet;
|
|
174
174
|
async refreshToken() {
|
|
175
175
|
const user = this.firebaseAuth.currentUser;
|
|
176
176
|
if (!user) {
|
|
@@ -251,25 +251,26 @@ class DbxFirebaseAuthService {
|
|
|
251
251
|
}
|
|
252
252
|
})));
|
|
253
253
|
}
|
|
254
|
-
static
|
|
255
|
-
static
|
|
254
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
255
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthService });
|
|
256
256
|
}
|
|
257
257
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthService, decorators: [{
|
|
258
258
|
type: Injectable
|
|
259
|
-
}]
|
|
260
|
-
type: Optional
|
|
261
|
-
}] }]; } });
|
|
259
|
+
}] });
|
|
262
260
|
/**
|
|
263
261
|
* FirebaseAuthContextInfo implementation from DbxFirebaseAuthService.
|
|
264
262
|
*/
|
|
265
263
|
class DbxFirebaseAuthContextInfo {
|
|
264
|
+
service;
|
|
265
|
+
user;
|
|
266
|
+
jwtToken;
|
|
267
|
+
_token = cachedGetter(() => firebaseAuthTokenFromUser(this.user));
|
|
268
|
+
_roles = cachedGetter(() => this.service.rolesForClaims(this.getClaims()));
|
|
269
|
+
_isAdmin = cachedGetter(() => this.service.isAdminInAuthRoleSet(this._roles()));
|
|
266
270
|
constructor(service, user, jwtToken) {
|
|
267
271
|
this.service = service;
|
|
268
272
|
this.user = user;
|
|
269
273
|
this.jwtToken = jwtToken;
|
|
270
|
-
this._token = cachedGetter(() => firebaseAuthTokenFromUser(this.user));
|
|
271
|
-
this._roles = cachedGetter(() => this.service.rolesForClaims(this.getClaims()));
|
|
272
|
-
this._isAdmin = cachedGetter(() => this.service.isAdminInAuthRoleSet(this._roles()));
|
|
273
274
|
}
|
|
274
275
|
get uid() {
|
|
275
276
|
return this.user.uid;
|
|
@@ -301,50 +302,46 @@ const DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY = (authUserInfo) =>
|
|
|
301
302
|
* DbxAnalyticsUserSource implementation that uses the DbxFirebaseAuthService.
|
|
302
303
|
*/
|
|
303
304
|
class DbxFirebaseAnalyticsUserSource {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}), shareReplay(1));
|
|
320
|
-
}
|
|
305
|
+
dbxFirebaseAuthService = inject(DbxFirebaseAuthService);
|
|
306
|
+
_userPropertiesFactory = new BehaviorSubject(DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY);
|
|
307
|
+
analyticsUser$ = combineLatest([this._userPropertiesFactory, this.dbxFirebaseAuthService.currentAuthUserInfo$]).pipe(switchMap(([userPropertiesFactory, x]) => {
|
|
308
|
+
let analyticsUser;
|
|
309
|
+
if (x != null) {
|
|
310
|
+
analyticsUser = userPropertiesFactory(x).pipe(map((properties) => ({
|
|
311
|
+
user: x.uid,
|
|
312
|
+
properties
|
|
313
|
+
})));
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
analyticsUser = of(null);
|
|
317
|
+
}
|
|
318
|
+
return analyticsUser;
|
|
319
|
+
}), shareReplay(1));
|
|
321
320
|
get userPropertiesFactory() {
|
|
322
321
|
return this._userPropertiesFactory.value;
|
|
323
322
|
}
|
|
324
323
|
set userPropertiesFactory(userPropertiesFactory) {
|
|
325
324
|
this._userPropertiesFactory.next(userPropertiesFactory);
|
|
326
325
|
}
|
|
327
|
-
static
|
|
328
|
-
static
|
|
326
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAnalyticsUserSource, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
327
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAnalyticsUserSource, providedIn: 'root' });
|
|
329
328
|
}
|
|
330
329
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAnalyticsUserSource, decorators: [{
|
|
331
330
|
type: Injectable,
|
|
332
331
|
args: [{
|
|
333
332
|
providedIn: 'root'
|
|
334
333
|
}]
|
|
335
|
-
}]
|
|
334
|
+
}] });
|
|
336
335
|
|
|
337
336
|
/**
|
|
338
337
|
* Service that listens for DbxFirebaseAuthService changes and emits them a user events.
|
|
339
338
|
*/
|
|
340
339
|
class DbxFirebaseAnalyticsUserEventsListener {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
this._logoutSub = new SubscriptionObject();
|
|
347
|
-
}
|
|
340
|
+
dbxFirebaseAuthService = inject(DbxFirebaseAuthService);
|
|
341
|
+
dbxFirebaseAnalyticsUserSource = inject(DbxFirebaseAnalyticsUserSource);
|
|
342
|
+
dbxAnalyticsService = inject(DbxAnalyticsService);
|
|
343
|
+
_loginSub = new SubscriptionObject();
|
|
344
|
+
_logoutSub = new SubscriptionObject();
|
|
348
345
|
init() {
|
|
349
346
|
this._loginSub.subscription = this.dbxFirebaseAuthService.onLogIn$.subscribe(() => {
|
|
350
347
|
this.dbxFirebaseAnalyticsUserSource.analyticsUser$.pipe(filterMaybe(), first()).subscribe((analyticsUser) => {
|
|
@@ -359,15 +356,15 @@ class DbxFirebaseAnalyticsUserEventsListener {
|
|
|
359
356
|
this._loginSub.destroy();
|
|
360
357
|
this._logoutSub.destroy();
|
|
361
358
|
}
|
|
362
|
-
static
|
|
363
|
-
static
|
|
359
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAnalyticsUserEventsListener, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
360
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAnalyticsUserEventsListener, providedIn: 'root' });
|
|
364
361
|
}
|
|
365
362
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAnalyticsUserEventsListener, decorators: [{
|
|
366
363
|
type: Injectable,
|
|
367
364
|
args: [{
|
|
368
365
|
providedIn: 'root'
|
|
369
366
|
}]
|
|
370
|
-
}]
|
|
367
|
+
}] });
|
|
371
368
|
|
|
372
369
|
/**
|
|
373
370
|
* Enables debug token generation for AppCheck by setting FIREBASE_APPCHECK_DEBUG_TOKEN in the browser's self/window.
|
|
@@ -386,12 +383,12 @@ const DBX_FIREBASE_OPTIONS_TOKEN = new InjectionToken('DbxFirebaseOptions');
|
|
|
386
383
|
* HTTP Interceptor that sets the X-Firebase-AppCheck for any requests to the routes configured in DbxFirebaseOptions.
|
|
387
384
|
*/
|
|
388
385
|
class DbxFirebaseAppCheckHttpInterceptor {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
386
|
+
appCheck = inject(AppCheck);
|
|
387
|
+
_appCheckRoutes = ((dbxFirebaseOptions) => {
|
|
388
|
+
const { appCheck } = dbxFirebaseOptions;
|
|
392
389
|
let routes = [];
|
|
393
|
-
if (appCheck
|
|
394
|
-
routes = (
|
|
390
|
+
if (appCheck?.disabled !== false) {
|
|
391
|
+
routes = (appCheck?.appCheckRoutes ?? ['/api/*']).map((route) => {
|
|
395
392
|
const wildcardIndex = route.indexOf('*');
|
|
396
393
|
const isWildcard = wildcardIndex === route.length - 1;
|
|
397
394
|
const match = isWildcard ? route.substring(0, wildcardIndex) : route;
|
|
@@ -401,9 +398,9 @@ class DbxFirebaseAppCheckHttpInterceptor {
|
|
|
401
398
|
};
|
|
402
399
|
});
|
|
403
400
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
401
|
+
return routes;
|
|
402
|
+
})(inject(DBX_FIREBASE_OPTIONS_TOKEN));
|
|
403
|
+
_isEnabled = this._appCheckRoutes.length > 0;
|
|
407
404
|
intercept(req, next) {
|
|
408
405
|
let obs;
|
|
409
406
|
if (this._isEnabled) {
|
|
@@ -444,39 +441,34 @@ class DbxFirebaseAppCheckHttpInterceptor {
|
|
|
444
441
|
}
|
|
445
442
|
return from(this._appCheckRoutes).pipe(first((route) => isEnabledRouteMatch(route), false), map((x) => Boolean(x)));
|
|
446
443
|
}
|
|
447
|
-
static
|
|
448
|
-
static
|
|
444
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAppCheckHttpInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
445
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAppCheckHttpInterceptor });
|
|
449
446
|
}
|
|
450
447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAppCheckHttpInterceptor, decorators: [{
|
|
451
448
|
type: Injectable
|
|
452
|
-
}]
|
|
453
|
-
type: Inject,
|
|
454
|
-
args: [DBX_FIREBASE_OPTIONS_TOKEN]
|
|
455
|
-
}] }, { type: i1$1.AppCheck }]; } });
|
|
449
|
+
}] });
|
|
456
450
|
|
|
457
451
|
class DbxFirebaseLoginTermsConfig {
|
|
458
452
|
}
|
|
459
453
|
|
|
460
454
|
class DbxFirebaseLoginTermsSimpleComponent {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
this.
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
this.
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, deps: [{ token: DbxFirebaseLoginTermsConfig }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
473
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginTermsSimpleComponent, selector: "ng-component", ngImport: i0, template: `
|
|
455
|
+
dbxFirebaseLoginTermsConfig = inject(DbxFirebaseLoginTermsConfig);
|
|
456
|
+
tosAnchor = {
|
|
457
|
+
url: this.dbxFirebaseLoginTermsConfig.tosUrl,
|
|
458
|
+
target: '_blank'
|
|
459
|
+
};
|
|
460
|
+
privacyAnchor = {
|
|
461
|
+
url: this.dbxFirebaseLoginTermsConfig.privacyUrl,
|
|
462
|
+
target: '_blank'
|
|
463
|
+
};
|
|
464
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
465
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginTermsSimpleComponent, selector: "ng-component", ngImport: i0, template: `
|
|
474
466
|
<div class="dbx-firebase-login-terms-view">
|
|
475
467
|
<dbx-link [anchor]="tosAnchor">Terms</dbx-link>
|
|
476
468
|
<span class="dbx-link-spacer"></span>
|
|
477
469
|
<dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
|
|
478
470
|
</div>
|
|
479
|
-
`, isInline: true, dependencies: [{ kind: "component", type: i1
|
|
471
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }] });
|
|
480
472
|
}
|
|
481
473
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, decorators: [{
|
|
482
474
|
type: Component,
|
|
@@ -489,7 +481,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
489
481
|
</div>
|
|
490
482
|
`
|
|
491
483
|
}]
|
|
492
|
-
}]
|
|
484
|
+
}] });
|
|
493
485
|
|
|
494
486
|
const DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG = {
|
|
495
487
|
minLength: 6
|
|
@@ -507,12 +499,13 @@ const DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN = new InjectionToken('De
|
|
|
507
499
|
* Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.
|
|
508
500
|
*/
|
|
509
501
|
class DbxFirebaseAuthLoginService {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
502
|
+
termsComponentClass = inject(DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN) ?? DbxFirebaseLoginTermsSimpleComponent;
|
|
503
|
+
_enableAll = false;
|
|
504
|
+
_passwordConfig;
|
|
505
|
+
_providers = new Map();
|
|
506
|
+
_assets = new Map();
|
|
507
|
+
_enabled = new Set();
|
|
508
|
+
constructor(defaultProviders, passwordConfig) {
|
|
516
509
|
if (defaultProviders) {
|
|
517
510
|
defaultProviders.forEach((x) => this.register(x, false));
|
|
518
511
|
}
|
|
@@ -599,8 +592,8 @@ class DbxFirebaseAuthLoginService {
|
|
|
599
592
|
setPasswordConfig(passwordConfig) {
|
|
600
593
|
this._passwordConfig = passwordConfig;
|
|
601
594
|
}
|
|
602
|
-
static
|
|
603
|
-
static
|
|
595
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthLoginService, deps: [{ token: DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, optional: true }, { token: DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
596
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthLoginService, providedIn: 'root' });
|
|
604
597
|
}
|
|
605
598
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthLoginService, decorators: [{
|
|
606
599
|
type: Injectable,
|
|
@@ -617,11 +610,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
617
610
|
}, {
|
|
618
611
|
type: Inject,
|
|
619
612
|
args: [DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN]
|
|
620
|
-
}] }, { type: i0.Type, decorators: [{
|
|
621
|
-
type: Optional
|
|
622
|
-
}, {
|
|
623
|
-
type: Inject,
|
|
624
|
-
args: [DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN]
|
|
625
613
|
}] }]; } });
|
|
626
614
|
|
|
627
615
|
/**
|
|
@@ -634,15 +622,7 @@ class DbxFirebaseLoginContext extends DbxInjectionContext {
|
|
|
634
622
|
* Login button and action.
|
|
635
623
|
*/
|
|
636
624
|
class DbxFirebaseLoginButtonComponent {
|
|
637
|
-
|
|
638
|
-
this.handleAction = () => {
|
|
639
|
-
const loginPromise = this.config.handleLogin();
|
|
640
|
-
return from(loginPromise);
|
|
641
|
-
};
|
|
642
|
-
this.onActionSuccess = () => {
|
|
643
|
-
// todo: show checkmark on success?
|
|
644
|
-
};
|
|
645
|
-
}
|
|
625
|
+
config;
|
|
646
626
|
get iconUrl() {
|
|
647
627
|
return this.config?.iconUrl;
|
|
648
628
|
}
|
|
@@ -658,8 +638,15 @@ class DbxFirebaseLoginButtonComponent {
|
|
|
658
638
|
get buttonTextColor() {
|
|
659
639
|
return this.config?.buttonTextColor;
|
|
660
640
|
}
|
|
661
|
-
|
|
662
|
-
|
|
641
|
+
handleAction = () => {
|
|
642
|
+
const loginPromise = this.config.handleLogin();
|
|
643
|
+
return from(loginPromise);
|
|
644
|
+
};
|
|
645
|
+
onActionSuccess = () => {
|
|
646
|
+
// todo: show checkmark on success?
|
|
647
|
+
};
|
|
648
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
649
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: { config: "config" }, host: { classAttribute: "dbx-firebase-login-button" }, ngImport: i0, template: `
|
|
663
650
|
<ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue [dbxActionSuccessHandler]="onActionSuccess">
|
|
664
651
|
<dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
|
|
665
652
|
<div class="dbx-firebase-login-button-content">
|
|
@@ -671,7 +658,7 @@ class DbxFirebaseLoginButtonComponent {
|
|
|
671
658
|
</div>
|
|
672
659
|
</dbx-button>
|
|
673
660
|
</ng-container>
|
|
674
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
661
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: i3.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "directive", type: i3.DbxActionValueDirective, selector: "[dbxActionValue]", inputs: ["dbxActionValue"] }, { kind: "directive", type: i3.DbxActionSuccessHandlerDirective, selector: "[dbxActionSuccessHandler]", inputs: ["dbxActionSuccessHandler"] }, { kind: "directive", type: i3.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { kind: "component", type: i1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "basic", "raised", "stroked", "flat", "iconOnly", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor"] }] });
|
|
675
662
|
}
|
|
676
663
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginButtonComponent, decorators: [{
|
|
677
664
|
type: Component,
|
|
@@ -698,12 +685,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
698
685
|
type: Input
|
|
699
686
|
}] } });
|
|
700
687
|
class DbxFirebaseLoginButtonContainerComponent {
|
|
701
|
-
static
|
|
702
|
-
static
|
|
688
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
689
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container", ngImport: i0, template: `
|
|
703
690
|
<div class="dbx-firebase-login-button-container">
|
|
704
691
|
<ng-content></ng-content>
|
|
705
692
|
</div>
|
|
706
|
-
`, isInline: true });
|
|
693
|
+
`, isInline: true });
|
|
707
694
|
}
|
|
708
695
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, decorators: [{
|
|
709
696
|
type: Component,
|
|
@@ -722,11 +709,10 @@ const DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE = `
|
|
|
722
709
|
</dbx-firebase-login-button-container>
|
|
723
710
|
`;
|
|
724
711
|
class AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
}
|
|
712
|
+
dbxFirebaseAuthService = inject(DbxFirebaseAuthService);
|
|
713
|
+
dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);
|
|
714
|
+
dbxFirebaseLoginContext = inject(DbxFirebaseLoginContext);
|
|
715
|
+
_config;
|
|
730
716
|
ngOnInit() {
|
|
731
717
|
const assets = this.assetConfig;
|
|
732
718
|
this._config = {
|
|
@@ -747,23 +733,20 @@ class AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
|
747
733
|
get config() {
|
|
748
734
|
return this._config;
|
|
749
735
|
}
|
|
750
|
-
static
|
|
751
|
-
static
|
|
736
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractConfiguredDbxFirebaseLoginButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
737
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AbstractConfiguredDbxFirebaseLoginButtonDirective, ngImport: i0 });
|
|
752
738
|
}
|
|
753
739
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractConfiguredDbxFirebaseLoginButtonDirective, decorators: [{
|
|
754
740
|
type: Directive
|
|
755
|
-
}]
|
|
741
|
+
}] });
|
|
756
742
|
|
|
757
743
|
class DbxFirebaseLoginAppleComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
758
|
-
|
|
759
|
-
super(...arguments);
|
|
760
|
-
this.loginProvider = 'apple';
|
|
761
|
-
}
|
|
744
|
+
loginProvider = 'apple';
|
|
762
745
|
handleLogin() {
|
|
763
746
|
return this.dbxFirebaseAuthService.logInWithApple();
|
|
764
747
|
}
|
|
765
|
-
static
|
|
766
|
-
static
|
|
748
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginAppleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
749
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginAppleComponent, selector: "dbx-firebase-login-apple", 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, dependencies: [{ kind: "component", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }, { kind: "component", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }] });
|
|
767
750
|
}
|
|
768
751
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginAppleComponent, decorators: [{
|
|
769
752
|
type: Component,
|
|
@@ -777,15 +760,12 @@ const DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY = 'default';
|
|
|
777
760
|
const OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY = 'oauth';
|
|
778
761
|
|
|
779
762
|
class DbxFirebaseLoginAnonymousComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
780
|
-
|
|
781
|
-
super(...arguments);
|
|
782
|
-
this.loginProvider = 'anonymous';
|
|
783
|
-
}
|
|
763
|
+
loginProvider = 'anonymous';
|
|
784
764
|
handleLogin() {
|
|
785
765
|
return this.dbxFirebaseAuthService.logInAsAnonymous();
|
|
786
766
|
}
|
|
787
|
-
static
|
|
788
|
-
static
|
|
767
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginAnonymousComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
768
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginAnonymousComponent, selector: "dbx-firebase-login-anonymous", 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, dependencies: [{ kind: "component", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }, { kind: "component", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }] });
|
|
789
769
|
}
|
|
790
770
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginAnonymousComponent, decorators: [{
|
|
791
771
|
type: Component,
|
|
@@ -799,13 +779,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
799
779
|
* DbxFirebaseLoginContext implementation.
|
|
800
780
|
*/
|
|
801
781
|
class DbxFirebaseLoginContextDirective extends AbstractForwardDbxInjectionContextDirective {
|
|
802
|
-
static
|
|
803
|
-
static
|
|
782
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginContextDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
783
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]", providers: [
|
|
804
784
|
{
|
|
805
785
|
provide: DbxFirebaseLoginContext,
|
|
806
786
|
useExisting: DbxFirebaseLoginContextDirective
|
|
807
787
|
}
|
|
808
|
-
], usesInheritance: true, ngImport: i0 });
|
|
788
|
+
], usesInheritance: true, ngImport: i0 });
|
|
809
789
|
}
|
|
810
790
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginContextDirective, decorators: [{
|
|
811
791
|
type: Directive,
|
|
@@ -824,31 +804,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
824
804
|
* Pre-configured login component that displays all configured login types.
|
|
825
805
|
*/
|
|
826
806
|
class DbxFirebaseLoginListComponent {
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}));
|
|
851
|
-
}
|
|
807
|
+
dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);
|
|
808
|
+
_loginMode = new BehaviorSubject('login');
|
|
809
|
+
_inputProviderCategories = new BehaviorSubject(undefined);
|
|
810
|
+
_omitProviderTypes = new BehaviorSubject(undefined);
|
|
811
|
+
_inputProviderTypes = new BehaviorSubject(undefined);
|
|
812
|
+
providerTypes$ = combineLatest([this._inputProviderTypes, this._omitProviderTypes]).pipe(map(([providerTypes, omitProviderTypes]) => {
|
|
813
|
+
const baseTypes = providerTypes ? asArray(providerTypes) : this.dbxFirebaseAuthLoginService.getEnabledTypes();
|
|
814
|
+
const types = omitProviderTypes ? excludeValuesFromArray(baseTypes, asArray(omitProviderTypes)) : baseTypes;
|
|
815
|
+
return types;
|
|
816
|
+
}), shareReplay(1));
|
|
817
|
+
providers$ = combineLatest([this.providerTypes$, this._inputProviderCategories]).pipe(map(([x, inputProviderCategories]) => {
|
|
818
|
+
const providerCategories = asArray(inputProviderCategories);
|
|
819
|
+
let providers = this.dbxFirebaseAuthLoginService.getLoginProviders(x);
|
|
820
|
+
if (providerCategories.length) {
|
|
821
|
+
const categories = new Set(providerCategories);
|
|
822
|
+
providers = providers.filter((x) => containsStringAnyCase(categories, x.category ?? ''));
|
|
823
|
+
}
|
|
824
|
+
return providers;
|
|
825
|
+
}));
|
|
826
|
+
providerInjectionConfigs$ = combineLatest([this._loginMode, this.providers$]).pipe(map(([mode, providers]) => {
|
|
827
|
+
const mapFn = mode === 'register' ? (x) => ({ componentClass: x.registrationComponentClass ?? x.componentClass }) : (x) => ({ componentClass: x.componentClass });
|
|
828
|
+
return providers.map(mapFn);
|
|
829
|
+
}));
|
|
852
830
|
ngOnDestroy() {
|
|
853
831
|
this._loginMode.complete();
|
|
854
832
|
this._inputProviderCategories.complete();
|
|
@@ -867,12 +845,12 @@ class DbxFirebaseLoginListComponent {
|
|
|
867
845
|
set providerCategories(providerCategories) {
|
|
868
846
|
this._inputProviderCategories.next(providerCategories);
|
|
869
847
|
}
|
|
870
|
-
static
|
|
871
|
-
static
|
|
848
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
849
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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: `
|
|
872
850
|
<div class="dbx-firebase-login-item" *ngFor="let config of providerInjectionConfigs$ | async">
|
|
873
851
|
<dbx-injection [config]="config"></dbx-injection>
|
|
874
852
|
</div>
|
|
875
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
853
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] });
|
|
876
854
|
}
|
|
877
855
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginListComponent, decorators: [{
|
|
878
856
|
type: Component,
|
|
@@ -887,7 +865,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
887
865
|
class: 'dbx-firebase-login-list'
|
|
888
866
|
}
|
|
889
867
|
}]
|
|
890
|
-
}],
|
|
868
|
+
}], propDecorators: { loginMode: [{
|
|
891
869
|
type: Input
|
|
892
870
|
}], providerTypes: [{
|
|
893
871
|
type: Input
|
|
@@ -901,15 +879,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
901
879
|
* Pre-configured login component that displays all configured login types.
|
|
902
880
|
*/
|
|
903
881
|
class DbxFirebaseLoginComponent {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
static
|
|
882
|
+
loginMode = 'login';
|
|
883
|
+
providerTypes;
|
|
884
|
+
omitProviderTypes;
|
|
885
|
+
providerCategories;
|
|
886
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
887
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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: `
|
|
909
888
|
<ng-container *dbxInjectionContext dbxFirebaseLoginContext>
|
|
910
889
|
<dbx-firebase-login-list [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories" [loginMode]="loginMode"></dbx-firebase-login-list>
|
|
911
890
|
</ng-container>
|
|
912
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
891
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i3.DbxInjectionContextDirective, selector: "[dbxInjectionContext]", inputs: ["config"] }, { kind: "directive", type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]" }, { kind: "component", type: DbxFirebaseLoginListComponent, selector: "dbx-firebase-login-list", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }] });
|
|
913
892
|
}
|
|
914
893
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginComponent, decorators: [{
|
|
915
894
|
type: Component,
|
|
@@ -936,14 +915,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
936
915
|
}] } });
|
|
937
916
|
|
|
938
917
|
class DbxFirebaseEmailFormComponent extends AbstractAsyncFormlyFormDirective {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
return fields;
|
|
945
|
-
}));
|
|
946
|
-
}
|
|
918
|
+
_config = new BehaviorSubject({ loginMode: 'login' });
|
|
919
|
+
fields$ = this._config.pipe(map(({ loginMode = 'login', passwordConfig }) => {
|
|
920
|
+
const fields = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword: loginMode === 'register' });
|
|
921
|
+
return fields;
|
|
922
|
+
}));
|
|
947
923
|
set config(config) {
|
|
948
924
|
this._config.next(config);
|
|
949
925
|
}
|
|
@@ -951,10 +927,10 @@ class DbxFirebaseEmailFormComponent extends AbstractAsyncFormlyFormDirective {
|
|
|
951
927
|
super.ngOnDestroy();
|
|
952
928
|
this._config.complete();
|
|
953
929
|
}
|
|
954
|
-
static
|
|
955
|
-
static
|
|
930
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmailFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
931
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: { config: "config" }, providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
|
|
956
932
|
<dbx-formly></dbx-formly>
|
|
957
|
-
`, isInline: true, dependencies: [{ kind: "component", type:
|
|
933
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i4.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
958
934
|
}
|
|
959
935
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmailFormComponent, decorators: [{
|
|
960
936
|
type: Component,
|
|
@@ -970,14 +946,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
970
946
|
}] } });
|
|
971
947
|
|
|
972
948
|
class DbxFirebaseEmailRecoveryFormComponent extends AbstractSyncFormlyFormDirective {
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}
|
|
977
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
978
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
|
|
949
|
+
fields = [emailField({ required: true })];
|
|
950
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
951
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
|
|
979
952
|
<dbx-formly></dbx-formly>
|
|
980
|
-
`, isInline: true, dependencies: [{ kind: "component", type:
|
|
953
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i4.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
981
954
|
}
|
|
982
955
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, decorators: [{
|
|
983
956
|
type: Component,
|
|
@@ -991,47 +964,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
991
964
|
}] });
|
|
992
965
|
|
|
993
966
|
class DbxFirebaseLoginEmailContentComponent {
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
this.
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
this.emailFormValue = value;
|
|
1011
|
-
this.recoveryFormValue = { email: value.username }; // cache value for recovery
|
|
1012
|
-
let result;
|
|
1013
|
-
if (this.loginMode === 'register') {
|
|
1014
|
-
result = this.dbxFirebaseAuthService.registerWithEmailAndPassword(value.username, value.password);
|
|
1015
|
-
}
|
|
1016
|
-
else {
|
|
1017
|
-
result = this.dbxFirebaseAuthService.logInWithEmailAndPassword(value.username, value.password).catch((error) => {
|
|
1018
|
-
throw firebaseAuthErrorToReadableError(error);
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
|
-
return from(result).pipe(tap(() => {
|
|
1022
|
-
this.doneOrCancelled.next(true);
|
|
1023
|
-
}));
|
|
1024
|
-
};
|
|
1025
|
-
this.handleRecoveryAction = (value, context) => {
|
|
1026
|
-
this.recoveryFormValue = value;
|
|
1027
|
-
this.emailFormValue = { username: value.email, password: '' };
|
|
1028
|
-
context.startWorkingWithPromise(this.dbxFirebaseAuthService.sendPasswordResetEmail(value.email));
|
|
1029
|
-
};
|
|
1030
|
-
// MARK: Recovering
|
|
1031
|
-
this.handleRecoverySuccess = (x) => {
|
|
1032
|
-
this._emailMode.next('recoversent');
|
|
1033
|
-
};
|
|
1034
|
-
}
|
|
967
|
+
dbxFirebaseAuthService = inject(DbxFirebaseAuthService);
|
|
968
|
+
config = inject(DBX_INJECTION_COMPONENT_DATA);
|
|
969
|
+
formConfig = {
|
|
970
|
+
loginMode: this.config.loginMode,
|
|
971
|
+
passwordConfig: this.config.passwordConfig
|
|
972
|
+
};
|
|
973
|
+
emailFormValue;
|
|
974
|
+
recoveryFormValue;
|
|
975
|
+
_emailMode = new BehaviorSubject('login');
|
|
976
|
+
emailMode$ = this._emailMode.asObservable();
|
|
977
|
+
forgotAnchor = {
|
|
978
|
+
onClick: () => {
|
|
979
|
+
this.openRecovery();
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
doneOrCancelled = new EventEmitter();
|
|
1035
983
|
static openEmailLoginContext(dbxFirebaseLoginContext, config) {
|
|
1036
984
|
return dbxFirebaseLoginContext.showContext({
|
|
1037
985
|
config: {
|
|
@@ -1056,10 +1004,35 @@ class DbxFirebaseLoginEmailContentComponent {
|
|
|
1056
1004
|
get buttonText() {
|
|
1057
1005
|
return this.config.loginMode === 'register' ? 'Register' : 'Log In';
|
|
1058
1006
|
}
|
|
1007
|
+
handleLoginAction = (value) => {
|
|
1008
|
+
this.emailFormValue = value;
|
|
1009
|
+
this.recoveryFormValue = { email: value.username }; // cache value for recovery
|
|
1010
|
+
let result;
|
|
1011
|
+
if (this.loginMode === 'register') {
|
|
1012
|
+
result = this.dbxFirebaseAuthService.registerWithEmailAndPassword(value.username, value.password);
|
|
1013
|
+
}
|
|
1014
|
+
else {
|
|
1015
|
+
result = this.dbxFirebaseAuthService.logInWithEmailAndPassword(value.username, value.password).catch((error) => {
|
|
1016
|
+
throw firebaseAuthErrorToReadableError(error);
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
return from(result).pipe(tap(() => {
|
|
1020
|
+
this.doneOrCancelled.next(true);
|
|
1021
|
+
}));
|
|
1022
|
+
};
|
|
1059
1023
|
// MARK: Recovery
|
|
1060
1024
|
openRecovery() {
|
|
1061
1025
|
this._emailMode.next('recover');
|
|
1062
1026
|
}
|
|
1027
|
+
handleRecoveryAction = (value, context) => {
|
|
1028
|
+
this.recoveryFormValue = value;
|
|
1029
|
+
this.emailFormValue = { username: value.email, password: '' };
|
|
1030
|
+
context.startWorkingWithPromise(this.dbxFirebaseAuthService.sendPasswordResetEmail(value.email));
|
|
1031
|
+
};
|
|
1032
|
+
// MARK: Recovering
|
|
1033
|
+
handleRecoverySuccess = (x) => {
|
|
1034
|
+
this._emailMode.next('recoversent');
|
|
1035
|
+
};
|
|
1063
1036
|
clickedRecoveryAcknowledged() {
|
|
1064
1037
|
this._emailMode.next('login');
|
|
1065
1038
|
}
|
|
@@ -1070,27 +1043,21 @@ class DbxFirebaseLoginEmailContentComponent {
|
|
|
1070
1043
|
onCancelReset() {
|
|
1071
1044
|
this.doneOrCancelled.next(false);
|
|
1072
1045
|
}
|
|
1073
|
-
static
|
|
1074
|
-
static
|
|
1046
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1047
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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 *ngSwitchCase=\"'recoversent'\">\n <ng-container *ngTemplateOutlet=\"resetPasswordSent\"></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\"></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-button-wide\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton></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 <div class=\"dbx-firebase-login-email-content-recovery\" dbxAction [dbxActionHandler]=\"handleRecoveryAction\" [dbxActionSuccessHandler]=\"handleRecoverySuccess\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\"></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-button-wide\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton></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 </div>\n</ng-template>\n\n<!-- Reset Password Sent -->\n<ng-template #resetPasswordSent>\n <div class=\"dbx-firebase-login-email-content-recovery-sent\">\n <p class=\"dbx-hint\">A recovery email was sent to the specified address. Please check your email for next steps.</p>\n <button mat-raised-button (click)=\"clickedRecoveryAcknowledged()\">Ok</button>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }, { kind: "directive", type: i4.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { kind: "directive", type: i4.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "dbxActionFormMapValue", "formDisabledOnWorking"] }, { kind: "component", type: i1.DbxReadableErrorComponent, selector: "dbx-error", inputs: ["error", "iconOnly"], outputs: ["popoverOpen"] }, { kind: "directive", type: i1.DbxActionErrorDirective, selector: "[dbxActionError]" }, { kind: "directive", type: i3.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: i3.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "directive", type: i3.DbxActionSuccessHandlerDirective, selector: "[dbxActionSuccessHandler]", inputs: ["dbxActionSuccessHandler"] }, { kind: "directive", type: i3.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { kind: "component", type: i1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "basic", "raised", "stroked", "flat", "iconOnly", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { kind: "directive", type: i1.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "component", type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: ["config"] }, { kind: "component", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] });
|
|
1075
1048
|
}
|
|
1076
1049
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, decorators: [{
|
|
1077
1050
|
type: Component,
|
|
1078
1051
|
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 *ngSwitchCase=\"'recoversent'\">\n <ng-container *ngTemplateOutlet=\"resetPasswordSent\"></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\"></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-button-wide\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton></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 <div class=\"dbx-firebase-login-email-content-recovery\" dbxAction [dbxActionHandler]=\"handleRecoveryAction\" [dbxActionSuccessHandler]=\"handleRecoverySuccess\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\"></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-button-wide\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton></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 </div>\n</ng-template>\n\n<!-- Reset Password Sent -->\n<ng-template #resetPasswordSent>\n <div class=\"dbx-firebase-login-email-content-recovery-sent\">\n <p class=\"dbx-hint\">A recovery email was sent to the specified address. Please check your email for next steps.</p>\n <button mat-raised-button (click)=\"clickedRecoveryAcknowledged()\">Ok</button>\n </div>\n</ng-template>\n" }]
|
|
1079
|
-
}]
|
|
1080
|
-
type: Inject,
|
|
1081
|
-
args: [DBX_INJECTION_COMPONENT_DATA]
|
|
1082
|
-
}] }]; } });
|
|
1052
|
+
}] });
|
|
1083
1053
|
|
|
1084
1054
|
class DbxFirebaseLoginEmailComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
1085
|
-
|
|
1086
|
-
super(...arguments);
|
|
1087
|
-
this.loginProvider = 'email';
|
|
1088
|
-
}
|
|
1055
|
+
loginProvider = 'email';
|
|
1089
1056
|
handleLogin() {
|
|
1090
1057
|
return DbxFirebaseLoginEmailContentComponent.openEmailLoginContext(this.dbxFirebaseLoginContext, { loginMode: 'login', passwordConfig: this.dbxFirebaseAuthLoginService.getPasswordConfig() });
|
|
1091
1058
|
}
|
|
1092
|
-
static
|
|
1093
|
-
static
|
|
1059
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginEmailComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1060
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginEmailComponent, selector: "dbx-firebase-login-email", 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, dependencies: [{ kind: "component", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }, { kind: "component", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }] });
|
|
1094
1061
|
}
|
|
1095
1062
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginEmailComponent, decorators: [{
|
|
1096
1063
|
type: Component,
|
|
@@ -1101,15 +1068,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1101
1068
|
}] });
|
|
1102
1069
|
|
|
1103
1070
|
class DbxFirebaseLoginFacebookComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
1104
|
-
|
|
1105
|
-
super(...arguments);
|
|
1106
|
-
this.loginProvider = 'facebook';
|
|
1107
|
-
}
|
|
1071
|
+
loginProvider = 'facebook';
|
|
1108
1072
|
handleLogin() {
|
|
1109
1073
|
return this.dbxFirebaseAuthService.logInWithFacebook();
|
|
1110
1074
|
}
|
|
1111
|
-
static
|
|
1112
|
-
static
|
|
1075
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginFacebookComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1076
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginFacebookComponent, selector: "dbx-firebase-login-facebook", 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, dependencies: [{ kind: "component", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }, { kind: "component", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }] });
|
|
1113
1077
|
}
|
|
1114
1078
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginFacebookComponent, decorators: [{
|
|
1115
1079
|
type: Component,
|
|
@@ -1120,15 +1084,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1120
1084
|
}] });
|
|
1121
1085
|
|
|
1122
1086
|
class DbxFirebaseLoginGoogleComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
1123
|
-
|
|
1124
|
-
super(...arguments);
|
|
1125
|
-
this.loginProvider = 'google';
|
|
1126
|
-
}
|
|
1087
|
+
loginProvider = 'google';
|
|
1127
1088
|
handleLogin() {
|
|
1128
1089
|
return this.dbxFirebaseAuthService.logInWithGoogle();
|
|
1129
1090
|
}
|
|
1130
|
-
static
|
|
1131
|
-
static
|
|
1091
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginGoogleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1092
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginGoogleComponent, selector: "dbx-firebase-login-google", 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, dependencies: [{ kind: "component", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }, { kind: "component", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }] });
|
|
1132
1093
|
}
|
|
1133
1094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginGoogleComponent, decorators: [{
|
|
1134
1095
|
type: Component,
|
|
@@ -1142,10 +1103,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1142
1103
|
* Pre-configured register component that displays all configured login types and their registration components.
|
|
1143
1104
|
*/
|
|
1144
1105
|
class DbxFirebaseRegisterComponent {
|
|
1145
|
-
|
|
1146
|
-
|
|
1106
|
+
providerTypes;
|
|
1107
|
+
omitProviderTypes;
|
|
1108
|
+
providerCategories;
|
|
1109
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseRegisterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1110
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseRegisterComponent, selector: "dbx-firebase-register", inputs: { providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, ngImport: i0, template: `
|
|
1147
1111
|
<dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>
|
|
1148
|
-
`, isInline: true, dependencies: [{ kind: "component", type: DbxFirebaseLoginComponent, selector: "dbx-firebase-login", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }] });
|
|
1112
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DbxFirebaseLoginComponent, selector: "dbx-firebase-login", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }] });
|
|
1149
1113
|
}
|
|
1150
1114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseRegisterComponent, decorators: [{
|
|
1151
1115
|
type: Component,
|
|
@@ -1164,15 +1128,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1164
1128
|
}] } });
|
|
1165
1129
|
|
|
1166
1130
|
class DbxFirebaseLoginGitHubComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
1167
|
-
|
|
1168
|
-
super(...arguments);
|
|
1169
|
-
this.loginProvider = 'github';
|
|
1170
|
-
}
|
|
1131
|
+
loginProvider = 'github';
|
|
1171
1132
|
handleLogin() {
|
|
1172
1133
|
return this.dbxFirebaseAuthService.logInWithGithub();
|
|
1173
1134
|
}
|
|
1174
|
-
static
|
|
1175
|
-
static
|
|
1135
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginGitHubComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1136
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginGitHubComponent, selector: "dbx-firebase-login-github", 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, dependencies: [{ kind: "component", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }, { kind: "component", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }] });
|
|
1176
1137
|
}
|
|
1177
1138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginGitHubComponent, decorators: [{
|
|
1178
1139
|
type: Component,
|
|
@@ -1183,15 +1144,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1183
1144
|
}] });
|
|
1184
1145
|
|
|
1185
1146
|
class DbxFirebaseLoginTwitterComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
1186
|
-
|
|
1187
|
-
super(...arguments);
|
|
1188
|
-
this.loginProvider = 'twitter';
|
|
1189
|
-
}
|
|
1147
|
+
loginProvider = 'twitter';
|
|
1190
1148
|
handleLogin() {
|
|
1191
1149
|
return this.dbxFirebaseAuthService.logInWithTwitter();
|
|
1192
1150
|
}
|
|
1193
|
-
static
|
|
1194
|
-
static
|
|
1151
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginTwitterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1152
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginTwitterComponent, selector: "dbx-firebase-login-twitter", 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, dependencies: [{ kind: "component", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }, { kind: "component", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }] });
|
|
1195
1153
|
}
|
|
1196
1154
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginTwitterComponent, decorators: [{
|
|
1197
1155
|
type: Component,
|
|
@@ -1202,15 +1160,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1202
1160
|
}] });
|
|
1203
1161
|
|
|
1204
1162
|
class DbxFirebaseLoginMicrosoftComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
1205
|
-
|
|
1206
|
-
super(...arguments);
|
|
1207
|
-
this.loginProvider = 'microsoft';
|
|
1208
|
-
}
|
|
1163
|
+
loginProvider = 'microsoft';
|
|
1209
1164
|
handleLogin() {
|
|
1210
1165
|
return this.dbxFirebaseAuthService.logInWithMicrosoft();
|
|
1211
1166
|
}
|
|
1212
|
-
static
|
|
1213
|
-
static
|
|
1167
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginMicrosoftComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1168
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginMicrosoftComponent, selector: "dbx-firebase-login-microsoft", 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, dependencies: [{ kind: "component", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }, { kind: "component", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }] });
|
|
1214
1169
|
}
|
|
1215
1170
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginMicrosoftComponent, decorators: [{
|
|
1216
1171
|
type: Component,
|
|
@@ -1221,15 +1176,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1221
1176
|
}] });
|
|
1222
1177
|
|
|
1223
1178
|
class DbxFirebaseRegisterEmailComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {
|
|
1224
|
-
|
|
1225
|
-
super(...arguments);
|
|
1226
|
-
this.loginProvider = 'email';
|
|
1227
|
-
}
|
|
1179
|
+
loginProvider = 'email';
|
|
1228
1180
|
handleLogin() {
|
|
1229
1181
|
return DbxFirebaseLoginEmailContentComponent.openEmailLoginContext(this.dbxFirebaseLoginContext, { loginMode: 'register', passwordConfig: this.dbxFirebaseAuthLoginService.getPasswordConfig() });
|
|
1230
1182
|
}
|
|
1231
|
-
static
|
|
1232
|
-
static
|
|
1183
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseRegisterEmailComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1184
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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", dependencies: [{ kind: "component", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: ["config"] }, { kind: "component", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container" }] });
|
|
1233
1185
|
}
|
|
1234
1186
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseRegisterEmailComponent, decorators: [{
|
|
1235
1187
|
type: Component,
|
|
@@ -1237,16 +1189,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1237
1189
|
}] });
|
|
1238
1190
|
|
|
1239
1191
|
class DbxFirebaseLoginTermsComponent {
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
this.
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
}
|
|
1246
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginTermsComponent, deps: [{ token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1247
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginTermsComponent, selector: "dbx-firebase-login-terms", host: { classAttribute: "dbx-firebase-login-terms d-block" }, ngImport: i0, template: `
|
|
1192
|
+
dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);
|
|
1193
|
+
config = {
|
|
1194
|
+
componentClass: this.dbxFirebaseAuthLoginService.termsComponentClass
|
|
1195
|
+
};
|
|
1196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginTermsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1197
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginTermsComponent, selector: "dbx-firebase-login-terms", host: { classAttribute: "dbx-firebase-login-terms d-block" }, ngImport: i0, template: `
|
|
1248
1198
|
<dbx-injection [config]="config"></dbx-injection>
|
|
1249
|
-
`, isInline: true, dependencies: [{ kind: "component", type:
|
|
1199
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i3.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }] });
|
|
1250
1200
|
}
|
|
1251
1201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginTermsComponent, decorators: [{
|
|
1252
1202
|
type: Component,
|
|
@@ -1259,19 +1209,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1259
1209
|
class: 'dbx-firebase-login-terms d-block'
|
|
1260
1210
|
}
|
|
1261
1211
|
}]
|
|
1262
|
-
}]
|
|
1212
|
+
}] });
|
|
1263
1213
|
|
|
1264
1214
|
class DbxFirebaseLoginContextBackButtonComponent {
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
this.
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
}
|
|
1271
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginContextBackButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1272
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginContextBackButtonComponent, selector: "dbx-firebase-login-context-back-button", outputs: { cancelLogin: "cancelLogin" }, ngImport: i0, template: `
|
|
1215
|
+
cancelLogin = new EventEmitter();
|
|
1216
|
+
anchor = {
|
|
1217
|
+
onClick: () => this.cancelLogin.emit()
|
|
1218
|
+
};
|
|
1219
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginContextBackButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1220
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseLoginContextBackButtonComponent, selector: "dbx-firebase-login-context-back-button", outputs: { cancelLogin: "cancelLogin" }, ngImport: i0, template: `
|
|
1273
1221
|
<dbx-link [anchor]="anchor">Choose other login method.</dbx-link>
|
|
1274
|
-
`, isInline: true, dependencies: [{ kind: "component", type: i1
|
|
1222
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }] });
|
|
1275
1223
|
}
|
|
1276
1224
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginContextBackButtonComponent, decorators: [{
|
|
1277
1225
|
type: Component,
|
|
@@ -1386,12 +1334,13 @@ function defaultFirebaseAuthLoginProvidersFactory() {
|
|
|
1386
1334
|
* Contains components related to logging in.
|
|
1387
1335
|
*/
|
|
1388
1336
|
class DbxFirebaseLoginModule {
|
|
1389
|
-
|
|
1337
|
+
dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);
|
|
1338
|
+
constructor(config) {
|
|
1390
1339
|
if (config.enabledLoginMethods === true) {
|
|
1391
|
-
dbxFirebaseAuthLoginService.setEnableAll();
|
|
1340
|
+
this.dbxFirebaseAuthLoginService.setEnableAll();
|
|
1392
1341
|
}
|
|
1393
1342
|
else {
|
|
1394
|
-
dbxFirebaseAuthLoginService.enable(config.enabledLoginMethods); // enable the types in the service.
|
|
1343
|
+
this.dbxFirebaseAuthLoginService.enable(config.enabledLoginMethods); // enable the types in the service.
|
|
1395
1344
|
}
|
|
1396
1345
|
}
|
|
1397
1346
|
static forRoot(config) {
|
|
@@ -1421,8 +1370,8 @@ class DbxFirebaseLoginModule {
|
|
|
1421
1370
|
]
|
|
1422
1371
|
};
|
|
1423
1372
|
}
|
|
1424
|
-
static
|
|
1425
|
-
static
|
|
1373
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginModule, deps: [{ token: DbxFirebaseLoginModuleRootConfig }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1374
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginModule, declarations: [DbxFirebaseLoginComponent,
|
|
1426
1375
|
DbxFirebaseLoginContextDirective,
|
|
1427
1376
|
DbxFirebaseLoginContextBackButtonComponent,
|
|
1428
1377
|
DbxFirebaseRegisterComponent,
|
|
@@ -1462,8 +1411,8 @@ class DbxFirebaseLoginModule {
|
|
|
1462
1411
|
DbxFirebaseLoginFacebookComponent,
|
|
1463
1412
|
DbxFirebaseLoginAnonymousComponent,
|
|
1464
1413
|
DbxFirebaseLoginTermsComponent,
|
|
1465
|
-
DbxFirebaseLoginTermsSimpleComponent] });
|
|
1466
|
-
static
|
|
1414
|
+
DbxFirebaseLoginTermsSimpleComponent] });
|
|
1415
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginModule, imports: [CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule] });
|
|
1467
1416
|
}
|
|
1468
1417
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseLoginModule, decorators: [{
|
|
1469
1418
|
type: NgModule,
|
|
@@ -1517,7 +1466,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1517
1466
|
],
|
|
1518
1467
|
providers: []
|
|
1519
1468
|
}]
|
|
1520
|
-
}], ctorParameters: function () { return [{ type: DbxFirebaseLoginModuleRootConfig
|
|
1469
|
+
}], ctorParameters: function () { return [{ type: DbxFirebaseLoginModuleRootConfig, decorators: [{
|
|
1470
|
+
type: Inject,
|
|
1471
|
+
args: [DbxFirebaseLoginModuleRootConfig]
|
|
1472
|
+
}] }]; } });
|
|
1521
1473
|
|
|
1522
1474
|
function authRolesObsWithClaimsService(config) {
|
|
1523
1475
|
const { addAuthUserStateToRoles: addAuthUserState, claimsService } = config;
|
|
@@ -1564,9 +1516,9 @@ class DbxFirebaseAuthModule {
|
|
|
1564
1516
|
providers
|
|
1565
1517
|
};
|
|
1566
1518
|
}
|
|
1567
|
-
static
|
|
1568
|
-
static
|
|
1569
|
-
static
|
|
1519
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1520
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthModule });
|
|
1521
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthModule });
|
|
1570
1522
|
}
|
|
1571
1523
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseAuthModule, decorators: [{
|
|
1572
1524
|
type: NgModule,
|
|
@@ -1583,9 +1535,9 @@ const DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN = new InjectionToken('
|
|
|
1583
1535
|
* Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.
|
|
1584
1536
|
*/
|
|
1585
1537
|
class DbxFirebaseDevelopmentWidgetService {
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1538
|
+
dbxWidgetService = inject(DbxWidgetService);
|
|
1539
|
+
_entries = new Map();
|
|
1540
|
+
constructor(defaultEntries) {
|
|
1589
1541
|
if (defaultEntries) {
|
|
1590
1542
|
defaultEntries.forEach((x) => this.register(x, false));
|
|
1591
1543
|
}
|
|
@@ -1613,8 +1565,8 @@ class DbxFirebaseDevelopmentWidgetService {
|
|
|
1613
1565
|
getEntries() {
|
|
1614
1566
|
return iterableToArray(this._entries.values());
|
|
1615
1567
|
}
|
|
1616
|
-
static
|
|
1617
|
-
static
|
|
1568
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentWidgetService, deps: [{ token: DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1569
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentWidgetService, providedIn: 'root' });
|
|
1618
1570
|
}
|
|
1619
1571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentWidgetService, decorators: [{
|
|
1620
1572
|
type: Injectable,
|
|
@@ -1626,7 +1578,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1626
1578
|
}, {
|
|
1627
1579
|
type: Inject,
|
|
1628
1580
|
args: [DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN]
|
|
1629
|
-
}] }
|
|
1581
|
+
}] }]; } });
|
|
1630
1582
|
|
|
1631
1583
|
/**
|
|
1632
1584
|
* Whether or not the scheduler should be enabled.
|
|
@@ -1636,31 +1588,28 @@ const DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN = new InjectionToken(
|
|
|
1636
1588
|
* Service used for hitting the scheduler in the development environment using the
|
|
1637
1589
|
*/
|
|
1638
1590
|
class DbxFirebaseDevelopmentSchedulerService {
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
console.error('Failed to retrieve development schedule list from server.', e);
|
|
1660
|
-
throw e;
|
|
1661
|
-
});
|
|
1591
|
+
dbxAuthService = inject(DbxAuthService);
|
|
1592
|
+
firebaseDevelopmentFunctions = inject(FirebaseDevelopmentFunctions);
|
|
1593
|
+
_sub = new SubscriptionObject();
|
|
1594
|
+
_enabled = new BehaviorSubject(inject(DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN, { optional: true }) !== false);
|
|
1595
|
+
_timerInterval = new BehaviorSubject(60 * 1000);
|
|
1596
|
+
_error = new BehaviorSubject(false);
|
|
1597
|
+
enabled$ = this._enabled.asObservable();
|
|
1598
|
+
running$ = combineLatest([this._enabled, this.dbxAuthService.authUserState$.pipe(map((x) => x === 'user'))]).pipe(map(([enabled, userReady]) => enabled && userReady), distinctUntilChanged(), shareReplay(1));
|
|
1599
|
+
timerInterval$ = this._timerInterval.asObservable();
|
|
1600
|
+
error$ = this._error.pipe(distinctUntilChanged());
|
|
1601
|
+
schedulerList$ = lazyFrom(() => {
|
|
1602
|
+
return this.firebaseDevelopmentFunctions
|
|
1603
|
+
.scheduledFunction({ type: ScheduledFunctionDevelopmentFunctionTypeEnum.LIST })
|
|
1604
|
+
.then((result) => {
|
|
1605
|
+
const list = result;
|
|
1606
|
+
return list.list;
|
|
1607
|
+
})
|
|
1608
|
+
.catch((e) => {
|
|
1609
|
+
console.error('Failed to retrieve development schedule list from server.', e);
|
|
1610
|
+
throw e;
|
|
1662
1611
|
});
|
|
1663
|
-
}
|
|
1612
|
+
});
|
|
1664
1613
|
init() {
|
|
1665
1614
|
this._sub.subscription = this.running$
|
|
1666
1615
|
.pipe(switchMapWhileTrue(() => {
|
|
@@ -1695,20 +1644,15 @@ class DbxFirebaseDevelopmentSchedulerService {
|
|
|
1695
1644
|
setTimer(timerInterval) {
|
|
1696
1645
|
this._timerInterval.next(timerInterval);
|
|
1697
1646
|
}
|
|
1698
|
-
static
|
|
1699
|
-
static
|
|
1647
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1648
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerService, providedIn: 'root' });
|
|
1700
1649
|
}
|
|
1701
1650
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerService, decorators: [{
|
|
1702
1651
|
type: Injectable,
|
|
1703
1652
|
args: [{
|
|
1704
1653
|
providedIn: 'root'
|
|
1705
1654
|
}]
|
|
1706
|
-
}]
|
|
1707
|
-
type: Optional
|
|
1708
|
-
}, {
|
|
1709
|
-
type: Inject,
|
|
1710
|
-
args: [DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN]
|
|
1711
|
-
}] }, { type: i2$2.DbxAuthService }, { type: i1$4.FirebaseDevelopmentFunctions }]; } });
|
|
1655
|
+
}] });
|
|
1712
1656
|
|
|
1713
1657
|
class DbxFirebaseDevelopmentSchedulerListComponent extends AbstractDbxSelectionListWrapperDirective {
|
|
1714
1658
|
constructor() {
|
|
@@ -1717,8 +1661,8 @@ class DbxFirebaseDevelopmentSchedulerListComponent extends AbstractDbxSelectionL
|
|
|
1717
1661
|
defaultSelectionMode: 'view'
|
|
1718
1662
|
});
|
|
1719
1663
|
}
|
|
1720
|
-
static
|
|
1721
|
-
static
|
|
1664
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1665
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentSchedulerListComponent, selector: "dbx-firebase-development-scheduler-list", providers: provideDbxListViewWrapper(DbxFirebaseDevelopmentSchedulerListComponent), usesInheritance: true, ngImport: i0, template: "\n<dbx-list [state$]=\"state$\" [config]=\"config$ | async\" [disabled]=\"disabled\" [selectionMode]=\"selectionMode\">\n <ng-content top select=\"[top]\"></ng-content>\n <ng-content bottom select=\"[bottom]\"></ng-content>\n <ng-content empty select=\"[empty]\"></ng-content>\n <ng-content emptyLoading select=\"[emptyLoading]\"></ng-content>\n</dbx-list>\n", isInline: true, dependencies: [{ kind: "component", type: i1.DbxListComponent, selector: "dbx-list", inputs: ["padded", "state$", "config", "disabled", "selectionMode"], outputs: ["contentScrolled"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] });
|
|
1722
1666
|
}
|
|
1723
1667
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerListComponent, decorators: [{
|
|
1724
1668
|
type: Component,
|
|
@@ -1729,15 +1673,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1729
1673
|
}]
|
|
1730
1674
|
}], ctorParameters: function () { return []; } });
|
|
1731
1675
|
class DbxFirebaseDevelopmentSchedulerListViewComponent extends AbstractDbxSelectionListViewDirective {
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
}
|
|
1739
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerListViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1740
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentSchedulerListViewComponent, selector: "dbx-firebase-development-scheduler-list-view", providers: provideDbxListView(DbxFirebaseDevelopmentSchedulerListViewComponent), usesInheritance: true, ngImport: i0, template: "<dbx-selection-list-view [config]=\"config\"></dbx-selection-list-view>", isInline: true, dependencies: [{ kind: "component", type: i1$2.DbxSelectionValueListViewComponent, selector: "dbx-selection-list-view" }] }); }
|
|
1676
|
+
config = {
|
|
1677
|
+
componentClass: DbxFirebaseDevelopmentSchedulerListViewItemComponent,
|
|
1678
|
+
mapValuesToItemValues: (x) => of(x.map((y) => ({ ...y, icon: y.icon, itemValue: y })))
|
|
1679
|
+
};
|
|
1680
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerListViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1681
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentSchedulerListViewComponent, selector: "dbx-firebase-development-scheduler-list-view", providers: provideDbxListView(DbxFirebaseDevelopmentSchedulerListViewComponent), usesInheritance: true, ngImport: i0, template: "<dbx-selection-list-view [config]=\"config\"></dbx-selection-list-view>", isInline: true, dependencies: [{ kind: "component", type: i1.DbxSelectionValueListViewComponent, selector: "dbx-selection-list-view" }] });
|
|
1741
1682
|
}
|
|
1742
1683
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerListViewComponent, decorators: [{
|
|
1743
1684
|
type: Component,
|
|
@@ -1748,23 +1689,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1748
1689
|
}]
|
|
1749
1690
|
}] });
|
|
1750
1691
|
class DbxFirebaseDevelopmentSchedulerListViewItemComponent extends AbstractDbxValueListViewItemComponent {
|
|
1692
|
+
dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);
|
|
1751
1693
|
get name() {
|
|
1752
1694
|
return this.itemValue.name;
|
|
1753
1695
|
}
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
};
|
|
1760
|
-
}
|
|
1761
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerListViewItemComponent, deps: [{ token: DBX_VALUE_LIST_VIEW_ITEM }, { token: DbxFirebaseDevelopmentSchedulerService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1762
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentSchedulerListViewItemComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
1696
|
+
handleRun = (value, context) => {
|
|
1697
|
+
context.startWorkingWithObservable(from(this.dbxFirebaseDevelopmentSchedulerService.runScheduledFunction(this.name)));
|
|
1698
|
+
};
|
|
1699
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerListViewItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1700
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentSchedulerListViewItemComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
1763
1701
|
<div dbxAction dbxActionValue fastTrigger [dbxActionHandler]="handleRun">
|
|
1764
1702
|
<dbx-button dbxActionButton [text]="'Run ' + name"></dbx-button>
|
|
1765
|
-
<
|
|
1703
|
+
<div *dbxActionHasSuccess="3000" class="dbx-success" dbxActionSuccess>Success</div>
|
|
1766
1704
|
</div>
|
|
1767
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
1705
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i3.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: i3.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "directive", type: i3.DbxActionValueDirective, selector: "[dbxActionValue]", inputs: ["dbxActionValue"] }, { kind: "directive", type: i3.DbxActionHasSuccessDirective, selector: "[dbxActionHasSuccess]", inputs: ["dbxActionHasSuccess"] }, { kind: "directive", type: i3.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { kind: "component", type: i1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "basic", "raised", "stroked", "flat", "iconOnly", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor"] }] });
|
|
1768
1706
|
}
|
|
1769
1707
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerListViewItemComponent, decorators: [{
|
|
1770
1708
|
type: Component,
|
|
@@ -1772,14 +1710,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1772
1710
|
template: `
|
|
1773
1711
|
<div dbxAction dbxActionValue fastTrigger [dbxActionHandler]="handleRun">
|
|
1774
1712
|
<dbx-button dbxActionButton [text]="'Run ' + name"></dbx-button>
|
|
1775
|
-
<
|
|
1713
|
+
<div *dbxActionHasSuccess="3000" class="dbx-success" dbxActionSuccess>Success</div>
|
|
1776
1714
|
</div>
|
|
1777
1715
|
`
|
|
1778
1716
|
}]
|
|
1779
|
-
}]
|
|
1780
|
-
type: Inject,
|
|
1781
|
-
args: [DBX_VALUE_LIST_VIEW_ITEM]
|
|
1782
|
-
}] }, { type: DbxFirebaseDevelopmentSchedulerService }]; } });
|
|
1717
|
+
}] });
|
|
1783
1718
|
|
|
1784
1719
|
const DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY = 'DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET';
|
|
1785
1720
|
function developmentFirebaseServerSchedulerWidgetEntry() {
|
|
@@ -1792,17 +1727,15 @@ function developmentFirebaseServerSchedulerWidgetEntry() {
|
|
|
1792
1727
|
};
|
|
1793
1728
|
}
|
|
1794
1729
|
class DbxFirebaseDevelopmentSchedulerWidgetComponent {
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerWidgetComponent, deps: [{ token: DbxFirebaseDevelopmentSchedulerService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1801
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentSchedulerWidgetComponent, selector: "ng-component", ngImport: i0, template: `
|
|
1730
|
+
dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);
|
|
1731
|
+
entries$ = this.dbxFirebaseDevelopmentSchedulerService.schedulerList$;
|
|
1732
|
+
state$ = loadingStateFromObs(this.entries$);
|
|
1733
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1734
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentSchedulerWidgetComponent, selector: "ng-component", ngImport: i0, template: `
|
|
1802
1735
|
<div>
|
|
1803
1736
|
<dbx-firebase-development-scheduler-list [state$]="state$"></dbx-firebase-development-scheduler-list>
|
|
1804
1737
|
</div>
|
|
1805
|
-
`, isInline: true, dependencies: [{ kind: "component", type: DbxFirebaseDevelopmentSchedulerListComponent, selector: "dbx-firebase-development-scheduler-list" }] });
|
|
1738
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DbxFirebaseDevelopmentSchedulerListComponent, selector: "dbx-firebase-development-scheduler-list" }] });
|
|
1806
1739
|
}
|
|
1807
1740
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentSchedulerWidgetComponent, decorators: [{
|
|
1808
1741
|
type: Component,
|
|
@@ -1813,18 +1746,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1813
1746
|
</div>
|
|
1814
1747
|
`
|
|
1815
1748
|
}]
|
|
1816
|
-
}]
|
|
1749
|
+
}] });
|
|
1817
1750
|
|
|
1818
1751
|
class DbxFirebaseParsedEmulatorsConfig {
|
|
1752
|
+
host;
|
|
1753
|
+
/**
|
|
1754
|
+
* Fix used by some components to allow changing 0.0.0.0 to localhost. Defaults to true.
|
|
1755
|
+
*/
|
|
1756
|
+
allow0000ToLocalhost;
|
|
1757
|
+
ui;
|
|
1758
|
+
auth;
|
|
1759
|
+
firestore;
|
|
1760
|
+
storage;
|
|
1761
|
+
functions;
|
|
1762
|
+
database;
|
|
1819
1763
|
}
|
|
1820
1764
|
|
|
1821
1765
|
/**
|
|
1822
1766
|
* Default firebase firestore provider module.
|
|
1823
1767
|
*/
|
|
1824
1768
|
class DbxFirebaseDefaultFirestoreProviderModule {
|
|
1825
|
-
static
|
|
1826
|
-
static
|
|
1827
|
-
static
|
|
1769
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1770
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [i1$2.FirestoreModule] });
|
|
1771
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [provideFirestore((injector) => {
|
|
1828
1772
|
const firebaseApp = injector.get(FirebaseApp);
|
|
1829
1773
|
const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
|
|
1830
1774
|
const firestoreSettings = {};
|
|
@@ -1849,7 +1793,7 @@ class DbxFirebaseDefaultFirestoreProviderModule {
|
|
|
1849
1793
|
connectFirestoreEmulator(firestore, emulators.firestore.host, emulators.firestore.port, {});
|
|
1850
1794
|
}
|
|
1851
1795
|
return firestore;
|
|
1852
|
-
})] });
|
|
1796
|
+
})] });
|
|
1853
1797
|
}
|
|
1854
1798
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, decorators: [{
|
|
1855
1799
|
type: NgModule,
|
|
@@ -1890,9 +1834,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1890
1834
|
* Also configures the DbxFirebaseAppCheckHttpInterceptor with HTTP_INTERCEPTORS in order for appCheck to be appended to requests to the api.
|
|
1891
1835
|
*/
|
|
1892
1836
|
class DbxFirebaseDefaultAppCheckProviderModule {
|
|
1893
|
-
static
|
|
1894
|
-
static
|
|
1895
|
-
static
|
|
1837
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1838
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, imports: [i2$2.AppCheckModule] });
|
|
1839
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, providers: [
|
|
1896
1840
|
{
|
|
1897
1841
|
provide: HTTP_INTERCEPTORS,
|
|
1898
1842
|
useClass: DbxFirebaseAppCheckHttpInterceptor,
|
|
@@ -1923,7 +1867,7 @@ class DbxFirebaseDefaultAppCheckProviderModule {
|
|
|
1923
1867
|
}
|
|
1924
1868
|
}
|
|
1925
1869
|
return appCheck;
|
|
1926
|
-
})] });
|
|
1870
|
+
})] });
|
|
1927
1871
|
}
|
|
1928
1872
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, decorators: [{
|
|
1929
1873
|
type: NgModule,
|
|
@@ -1969,9 +1913,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1969
1913
|
* Default firebase auth provider module.
|
|
1970
1914
|
*/
|
|
1971
1915
|
class DbxFirebaseDefaultAuthProviderModule {
|
|
1972
|
-
static
|
|
1973
|
-
static
|
|
1974
|
-
static
|
|
1916
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1917
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [i3$1.AuthModule] });
|
|
1918
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [provideAuth((injector) => {
|
|
1975
1919
|
const firebaseApp = injector.get(FirebaseApp);
|
|
1976
1920
|
const auth = getAuth(firebaseApp);
|
|
1977
1921
|
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
@@ -1979,7 +1923,7 @@ class DbxFirebaseDefaultAuthProviderModule {
|
|
|
1979
1923
|
connectAuthEmulator(auth, `http://${emulators.auth.host}:${emulators.auth.port}`);
|
|
1980
1924
|
}
|
|
1981
1925
|
return auth;
|
|
1982
|
-
})] });
|
|
1926
|
+
})] });
|
|
1983
1927
|
}
|
|
1984
1928
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, decorators: [{
|
|
1985
1929
|
type: NgModule,
|
|
@@ -2001,9 +1945,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2001
1945
|
* Default firebase storage provider module.
|
|
2002
1946
|
*/
|
|
2003
1947
|
class DbxFirebaseDefaultStorageProviderModule {
|
|
2004
|
-
static
|
|
2005
|
-
static
|
|
2006
|
-
static
|
|
1948
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1949
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [i4$1.StorageModule] });
|
|
1950
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [provideStorage((injector) => {
|
|
2007
1951
|
const firebaseApp = injector.get(FirebaseApp);
|
|
2008
1952
|
const storage = getStorage(firebaseApp);
|
|
2009
1953
|
const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
|
|
@@ -2011,7 +1955,7 @@ class DbxFirebaseDefaultStorageProviderModule {
|
|
|
2011
1955
|
connectStorageEmulator(storage, emulators.storage.host, emulators.storage.port, {});
|
|
2012
1956
|
}
|
|
2013
1957
|
return storage;
|
|
2014
|
-
})] });
|
|
1958
|
+
})] });
|
|
2015
1959
|
}
|
|
2016
1960
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, decorators: [{
|
|
2017
1961
|
type: NgModule,
|
|
@@ -2033,9 +1977,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2033
1977
|
* Default firebase functions provider module.
|
|
2034
1978
|
*/
|
|
2035
1979
|
class DbxFirebaseDefaultFunctionsProviderModule {
|
|
2036
|
-
static
|
|
2037
|
-
static
|
|
2038
|
-
static
|
|
1980
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1981
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [i5.FunctionsModule] });
|
|
1982
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [provideFunctions((injector) => {
|
|
2039
1983
|
const firebaseApp = injector.get(FirebaseApp);
|
|
2040
1984
|
const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
|
|
2041
1985
|
const { functionsRegionOrCustomDomain } = firebaseOptions;
|
|
@@ -2045,7 +1989,7 @@ class DbxFirebaseDefaultFunctionsProviderModule {
|
|
|
2045
1989
|
connectFunctionsEmulator(functions, emulators.functions.host, emulators.functions.port);
|
|
2046
1990
|
}
|
|
2047
1991
|
return functions;
|
|
2048
|
-
})] });
|
|
1992
|
+
})] });
|
|
2049
1993
|
}
|
|
2050
1994
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, decorators: [{
|
|
2051
1995
|
type: NgModule,
|
|
@@ -2080,9 +2024,9 @@ class DbxFirebaseDefaultFirebaseProvidersModule {
|
|
|
2080
2024
|
]
|
|
2081
2025
|
};
|
|
2082
2026
|
}
|
|
2083
|
-
static
|
|
2084
|
-
static
|
|
2085
|
-
static
|
|
2027
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2028
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [i6.FirebaseAppModule, DbxFirebaseDefaultAppCheckProviderModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDefaultFunctionsProviderModule] });
|
|
2029
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [provideFirebaseApp((injector) => {
|
|
2086
2030
|
const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
|
|
2087
2031
|
return initializeApp(firebaseOptions);
|
|
2088
2032
|
}),
|
|
@@ -2090,7 +2034,7 @@ class DbxFirebaseDefaultFirebaseProvidersModule {
|
|
|
2090
2034
|
DbxFirebaseDefaultFirestoreProviderModule,
|
|
2091
2035
|
DbxFirebaseDefaultAuthProviderModule,
|
|
2092
2036
|
DbxFirebaseDefaultStorageProviderModule,
|
|
2093
|
-
DbxFirebaseDefaultFunctionsProviderModule] });
|
|
2037
|
+
DbxFirebaseDefaultFunctionsProviderModule] });
|
|
2094
2038
|
}
|
|
2095
2039
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, decorators: [{
|
|
2096
2040
|
type: NgModule,
|
|
@@ -2137,15 +2081,16 @@ class DbxFirebaseEmulatorModule {
|
|
|
2137
2081
|
]
|
|
2138
2082
|
};
|
|
2139
2083
|
}
|
|
2140
|
-
static
|
|
2141
|
-
static
|
|
2142
|
-
static
|
|
2084
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmulatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2085
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmulatorModule });
|
|
2086
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmulatorModule });
|
|
2143
2087
|
}
|
|
2144
2088
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmulatorModule, decorators: [{
|
|
2145
2089
|
type: NgModule
|
|
2146
2090
|
}] });
|
|
2147
2091
|
|
|
2148
2092
|
class DbxFirebaseEmulatorService {
|
|
2093
|
+
emulatorsConfig = inject(DbxFirebaseParsedEmulatorsConfig);
|
|
2149
2094
|
get useEmulators() {
|
|
2150
2095
|
return this.emulatorsConfig.useEmulators || false;
|
|
2151
2096
|
}
|
|
@@ -2163,18 +2108,15 @@ class DbxFirebaseEmulatorService {
|
|
|
2163
2108
|
}
|
|
2164
2109
|
: undefined;
|
|
2165
2110
|
}
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
}
|
|
2169
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmulatorService, deps: [{ token: DbxFirebaseParsedEmulatorsConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2170
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmulatorService, providedIn: 'root' }); }
|
|
2111
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmulatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2112
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmulatorService, providedIn: 'root' });
|
|
2171
2113
|
}
|
|
2172
2114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseEmulatorService, decorators: [{
|
|
2173
2115
|
type: Injectable,
|
|
2174
2116
|
args: [{
|
|
2175
2117
|
providedIn: 'root'
|
|
2176
2118
|
}]
|
|
2177
|
-
}]
|
|
2119
|
+
}] });
|
|
2178
2120
|
|
|
2179
2121
|
const DISPLAY_FOR_DEVELOPMENT_POPUP_STRING_VALUE = (values) => {
|
|
2180
2122
|
const displayValues = values.map((x) => ({ ...x, label: x.meta?.label || x.value }));
|
|
@@ -2182,26 +2124,23 @@ const DISPLAY_FOR_DEVELOPMENT_POPUP_STRING_VALUE = (values) => {
|
|
|
2182
2124
|
return obs;
|
|
2183
2125
|
};
|
|
2184
2126
|
class DbxFirebaseDevelopmentPopupContentFormComponent extends AbstractConfigAsyncFormlyFormDirective {
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
}
|
|
2201
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentPopupContentFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2202
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentPopupContentFormComponent, selector: "dbx-firebase-development-popup-content-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
|
|
2127
|
+
fields$ = this.config$.pipe(map((config) => {
|
|
2128
|
+
return [
|
|
2129
|
+
pickableItemChipField({
|
|
2130
|
+
key: 'specifier',
|
|
2131
|
+
filterLabel: 'Tools',
|
|
2132
|
+
description: 'Pick a tool to get started.',
|
|
2133
|
+
filterValues: filterPickableItemFieldValuesByLabel,
|
|
2134
|
+
loadValues: () => of(config.entries.map((y) => ({ value: y.widget.type, meta: y }))),
|
|
2135
|
+
displayForValue: DISPLAY_FOR_DEVELOPMENT_POPUP_STRING_VALUE,
|
|
2136
|
+
asArrayValue: false
|
|
2137
|
+
})
|
|
2138
|
+
];
|
|
2139
|
+
}));
|
|
2140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentPopupContentFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2141
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentPopupContentFormComponent, selector: "dbx-firebase-development-popup-content-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
|
|
2203
2142
|
<dbx-formly></dbx-formly>
|
|
2204
|
-
`, isInline: true, dependencies: [{ kind: "component", type:
|
|
2143
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i4.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
2205
2144
|
}
|
|
2206
2145
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentPopupContentFormComponent, decorators: [{
|
|
2207
2146
|
type: Component,
|
|
@@ -2215,38 +2154,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2215
2154
|
}] });
|
|
2216
2155
|
|
|
2217
2156
|
class DbxFirebaseDevelopmentPopupContentComponent {
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
this.formData$ = this._activeEntrySelector.pipe(distinctUntilChanged(), map((specifier) => ({ specifier })));
|
|
2242
|
-
this.handleFormUpdate = (value, context) => {
|
|
2243
|
-
this._activeEntrySelector.next(value.specifier);
|
|
2244
|
-
context.success();
|
|
2245
|
-
};
|
|
2246
|
-
this.isFormModified = (value) => {
|
|
2247
|
-
return this._activeEntrySelector.pipe(map((currentSelector) => value.specifier !== currentSelector), first());
|
|
2248
|
-
};
|
|
2249
|
-
}
|
|
2157
|
+
twoColumnsContextStore = inject(TwoColumnsContextStore);
|
|
2158
|
+
dbxAuthService = inject(DbxAuthService);
|
|
2159
|
+
dbxFirebaseDevelopmentWidgetService = inject(DbxFirebaseDevelopmentWidgetService);
|
|
2160
|
+
dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);
|
|
2161
|
+
dbxFirebaseEmulatorService = inject(DbxFirebaseEmulatorService);
|
|
2162
|
+
_backSub = new SubscriptionObject();
|
|
2163
|
+
showEmulatorButton = this.dbxFirebaseEmulatorService.useEmulators === true;
|
|
2164
|
+
emulatorUIAnchor = this.dbxFirebaseEmulatorService.emulatorUIAnchor ?? {};
|
|
2165
|
+
entries = this.dbxFirebaseDevelopmentWidgetService.getEntries();
|
|
2166
|
+
_activeEntrySelector = new BehaviorSubject(DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY);
|
|
2167
|
+
isLoggedIn$ = this.dbxAuthService.isLoggedIn$;
|
|
2168
|
+
entries$ = this.isLoggedIn$.pipe(distinctUntilChanged(), map((isLoggedIn) => this.entries), shareReplay(1));
|
|
2169
|
+
formConfig$ = this.entries$.pipe(map((entries) => ({ entries })));
|
|
2170
|
+
activeEntrySelector$ = this._activeEntrySelector.pipe(distinctUntilChanged());
|
|
2171
|
+
currentActiveEntry$ = combineLatest([this.entries$, this.activeEntrySelector$]).pipe(map(([entries, selector]) => (selector ? entries.find((e) => e.widget.type === selector) : undefined)), shareReplay(1));
|
|
2172
|
+
showRight$ = this.currentActiveEntry$.pipe(map((x) => x != null));
|
|
2173
|
+
activeEntry$ = this.currentActiveEntry$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
2174
|
+
rightTitle$ = this.activeEntry$.pipe(map((x) => x.label));
|
|
2175
|
+
widgetConfig$ = this.activeEntry$.pipe(map((x) => ({ data: undefined, type: x.widget.type })), shareReplay(1));
|
|
2176
|
+
schedulerRunning$ = this.dbxFirebaseDevelopmentSchedulerService.running$;
|
|
2177
|
+
schedulerInterval$ = this.dbxFirebaseDevelopmentSchedulerService.timerInterval$.pipe(map((x) => msToSeconds(x)), shareReplay(1));
|
|
2178
|
+
schedulerError$ = this.dbxFirebaseDevelopmentSchedulerService.error$.pipe(map((x) => (x ? 'Error Occured' : 'Ok')), shareReplay(1));
|
|
2179
|
+
formData$ = this._activeEntrySelector.pipe(distinctUntilChanged(), map((specifier) => ({ specifier })));
|
|
2250
2180
|
ngOnInit() {
|
|
2251
2181
|
this.twoColumnsContextStore.setShowRight(this.showRight$);
|
|
2252
2182
|
this._backSub.subscription = this.twoColumnsContextStore.back$.subscribe(() => {
|
|
@@ -2256,27 +2186,29 @@ class DbxFirebaseDevelopmentPopupContentComponent {
|
|
|
2256
2186
|
ngOnDestroy() {
|
|
2257
2187
|
this._activeEntrySelector.complete();
|
|
2258
2188
|
}
|
|
2189
|
+
handleFormUpdate = (value, context) => {
|
|
2190
|
+
this._activeEntrySelector.next(value.specifier);
|
|
2191
|
+
context.success();
|
|
2192
|
+
};
|
|
2193
|
+
isFormModified = (value) => {
|
|
2194
|
+
return this._activeEntrySelector.pipe(map((currentSelector) => value.specifier !== currentSelector), first());
|
|
2195
|
+
};
|
|
2259
2196
|
clearSelection() {
|
|
2260
2197
|
this._activeEntrySelector.next(undefined);
|
|
2261
2198
|
}
|
|
2262
|
-
static
|
|
2263
|
-
static
|
|
2199
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentPopupContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2200
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentPopupContentComponent, selector: "dbx-firebase-development-popup-content", providers: [TwoColumnsContextStore], ngImport: i0, template: "<dbx-two-column class=\"dbx-firebase-development-popup-content\" [dbxTwoColumnFullLeft]=\"true\">\n <dbx-two-block left>\n <div>\n <h4>Info</h4>\n <p>Scheduler (Running): {{ schedulerRunning$ | async }} : {{ schedulerInterval$ | async }}s : {{ schedulerError$ | async }}</p>\n <div>\n <dbx-anchor [anchor]=\"emulatorUIAnchor\" *ngIf=\"showEmulatorButton\">\n <button mat-flat-button color=\"accent\">Emulator Enabled</button>\n </dbx-anchor>\n </div>\n </div>\n <div>\n <h4>Tools</h4>\n <div dbxAction dbxActionEnforceModified dbxActionAutoTrigger instantTrigger [dbxActionHandler]=\"handleFormUpdate\">\n <dbx-firebase-development-popup-content-form dbxActionForm [dbxFormSource]=\"formData$\" dbxFormSourceMode=\"always\" [dbxActionFormModified]=\"isFormModified\" [config]=\"formConfig$ | async\"></dbx-firebase-development-popup-content-form>\n </div>\n </div>\n </dbx-two-block>\n <dbx-two-column-right right [header]=\"(rightTitle$ | async) || ''\">\n <dbx-widget-view [config]=\"widgetConfig$ | async\"></dbx-widget-view>\n </dbx-two-column-right>\n</dbx-two-column>\n", styles: [".dbx-firebase-development-popup-content{height:400px;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.DbxWidgetViewComponent, selector: "dbx-widget-view", inputs: ["config"] }, { kind: "component", type: i1.DbxTwoBlocksComponent, selector: "dbx-two-block", inputs: ["fixedTop"] }, { kind: "component", type: i1.DbxTwoColumnComponent, selector: "dbx-two-column", inputs: ["reverseSizing", "inSectionPage"], exportAs: ["columns"] }, { kind: "component", type: i1.DbxTwoColumnRightComponent, selector: "dbx-two-column-right", inputs: ["full", "header", "block", "showBack", "minRightWidth"] }, { kind: "directive", type: i1.DbxTwoColumnFullLeftDirective, selector: "[dbxTwoColumnFullLeft]", inputs: ["dbxTwoColumnFullLeft"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1.DbxAnchorComponent, selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }, { kind: "directive", type: i4.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { kind: "directive", type: i4.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "dbxActionFormMapValue", "formDisabledOnWorking"] }, { kind: "directive", type: i3.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: i3.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "directive", type: i3.DbxActionEnforceModifiedDirective, selector: "[dbxActionEnforceModified]", inputs: ["dbxActionEnforceModified"] }, { kind: "directive", type: i3.DbxActionAutoTriggerDirective, selector: "dbxActionAutoTrigger, [dbxActionAutoTrigger]", inputs: ["dbxActionAutoTrigger", "triggerDebounce", "triggerThrottle", "triggerErrorThrottle", "fastTrigger", "instantTrigger", "triggerLimit"] }, { kind: "component", type: DbxFirebaseDevelopmentPopupContentFormComponent, selector: "dbx-firebase-development-popup-content-form" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] });
|
|
2264
2201
|
}
|
|
2265
2202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentPopupContentComponent, decorators: [{
|
|
2266
2203
|
type: Component,
|
|
2267
2204
|
args: [{ selector: 'dbx-firebase-development-popup-content', providers: [TwoColumnsContextStore], template: "<dbx-two-column class=\"dbx-firebase-development-popup-content\" [dbxTwoColumnFullLeft]=\"true\">\n <dbx-two-block left>\n <div>\n <h4>Info</h4>\n <p>Scheduler (Running): {{ schedulerRunning$ | async }} : {{ schedulerInterval$ | async }}s : {{ schedulerError$ | async }}</p>\n <div>\n <dbx-anchor [anchor]=\"emulatorUIAnchor\" *ngIf=\"showEmulatorButton\">\n <button mat-flat-button color=\"accent\">Emulator Enabled</button>\n </dbx-anchor>\n </div>\n </div>\n <div>\n <h4>Tools</h4>\n <div dbxAction dbxActionEnforceModified dbxActionAutoTrigger instantTrigger [dbxActionHandler]=\"handleFormUpdate\">\n <dbx-firebase-development-popup-content-form dbxActionForm [dbxFormSource]=\"formData$\" dbxFormSourceMode=\"always\" [dbxActionFormModified]=\"isFormModified\" [config]=\"formConfig$ | async\"></dbx-firebase-development-popup-content-form>\n </div>\n </div>\n </dbx-two-block>\n <dbx-two-column-right right [header]=\"(rightTitle$ | async) || ''\">\n <dbx-widget-view [config]=\"widgetConfig$ | async\"></dbx-widget-view>\n </dbx-two-column-right>\n</dbx-two-column>\n", styles: [".dbx-firebase-development-popup-content{height:400px;overflow:hidden}\n"] }]
|
|
2268
|
-
}]
|
|
2205
|
+
}] });
|
|
2269
2206
|
|
|
2270
2207
|
const DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY = 'devpopup';
|
|
2271
2208
|
class DbxFirebaseDevelopmentPopupComponent extends AbstractPopupDirective {
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
this.header = 'Development Tools';
|
|
2276
|
-
this.reopen = () => {
|
|
2277
|
-
DbxFirebaseDevelopmentPopupComponent.openPopup(this.popupService, this.popup.key);
|
|
2278
|
-
};
|
|
2279
|
-
}
|
|
2209
|
+
popupService = inject(DbxPopupService);
|
|
2210
|
+
content;
|
|
2211
|
+
header = 'Development Tools';
|
|
2280
2212
|
static openPopup(popupService, popupKey) {
|
|
2281
2213
|
return popupService.open({
|
|
2282
2214
|
key: popupKey ?? DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY,
|
|
@@ -2286,13 +2218,16 @@ class DbxFirebaseDevelopmentPopupComponent extends AbstractPopupDirective {
|
|
|
2286
2218
|
position: 'center'
|
|
2287
2219
|
});
|
|
2288
2220
|
}
|
|
2289
|
-
|
|
2290
|
-
|
|
2221
|
+
reopen = () => {
|
|
2222
|
+
DbxFirebaseDevelopmentPopupComponent.openPopup(this.popupService, this.popup.key);
|
|
2223
|
+
};
|
|
2224
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2225
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentPopupComponent, selector: "ng-component", viewQueries: [{ propertyName: "content", first: true, predicate: DbxFirebaseDevelopmentPopupContentComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
2291
2226
|
<dbx-popup-content>
|
|
2292
2227
|
<dbx-popup-controls [header]="header" controls></dbx-popup-controls>
|
|
2293
2228
|
<dbx-firebase-development-popup-content (shouldClose)="closePopup()"></dbx-firebase-development-popup-content>
|
|
2294
2229
|
</dbx-popup-content>
|
|
2295
|
-
`, isInline: true, dependencies: [{ kind: "component", type: i1
|
|
2230
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1.DbxPopupContentComponent, selector: "dbx-popup-content" }, { kind: "component", type: i1.DbxPopupControlsComponent, selector: "dbx-popup-controls", inputs: ["header"] }, { kind: "component", type: DbxFirebaseDevelopmentPopupContentComponent, selector: "dbx-firebase-development-popup-content" }] });
|
|
2296
2231
|
}
|
|
2297
2232
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentPopupComponent, decorators: [{
|
|
2298
2233
|
type: Component,
|
|
@@ -2304,7 +2239,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2304
2239
|
</dbx-popup-content>
|
|
2305
2240
|
`
|
|
2306
2241
|
}]
|
|
2307
|
-
}],
|
|
2242
|
+
}], propDecorators: { content: [{
|
|
2308
2243
|
type: ViewChild,
|
|
2309
2244
|
args: [DbxFirebaseDevelopmentPopupContentComponent, { static: true }]
|
|
2310
2245
|
}] } });
|
|
@@ -2319,11 +2254,12 @@ const DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN = new InjectionToken('DefaultDb
|
|
|
2319
2254
|
* Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.
|
|
2320
2255
|
*/
|
|
2321
2256
|
class DbxFirebaseDevelopmentService {
|
|
2257
|
+
enabled;
|
|
2322
2258
|
constructor(enabled) {
|
|
2323
2259
|
this.enabled = enabled;
|
|
2324
2260
|
}
|
|
2325
|
-
static
|
|
2326
|
-
static
|
|
2261
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentService, deps: [{ token: DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2262
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentService, providedIn: 'root' });
|
|
2327
2263
|
}
|
|
2328
2264
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentService, decorators: [{
|
|
2329
2265
|
type: Injectable,
|
|
@@ -2341,11 +2277,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2341
2277
|
* Directive for controlling and displaying
|
|
2342
2278
|
*/
|
|
2343
2279
|
class DbxFirebaseDevelopmentDirective {
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
}
|
|
2280
|
+
popupService = inject(DbxPopupService);
|
|
2281
|
+
matSnackBar = inject(MatSnackBar);
|
|
2282
|
+
dbxFirebaseDevelopmentService = inject(DbxFirebaseDevelopmentService);
|
|
2283
|
+
ref;
|
|
2349
2284
|
get enabled() {
|
|
2350
2285
|
return this.dbxFirebaseDevelopmentService.enabled;
|
|
2351
2286
|
}
|
|
@@ -2396,15 +2331,15 @@ class DbxFirebaseDevelopmentDirective {
|
|
|
2396
2331
|
ngOnDestroy() {
|
|
2397
2332
|
this.closePopup();
|
|
2398
2333
|
}
|
|
2399
|
-
static
|
|
2400
|
-
static
|
|
2334
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2335
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDevelopmentDirective, selector: "[dbxFirebaseDevelopment]", host: { listeners: { "window:keydown": "handleKeyboardEvent($event)" } }, ngImport: i0 });
|
|
2401
2336
|
}
|
|
2402
2337
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentDirective, decorators: [{
|
|
2403
2338
|
type: Directive,
|
|
2404
2339
|
args: [{
|
|
2405
2340
|
selector: '[dbxFirebaseDevelopment]'
|
|
2406
2341
|
}]
|
|
2407
|
-
}],
|
|
2342
|
+
}], propDecorators: { handleKeyboardEvent: [{
|
|
2408
2343
|
type: HostListener,
|
|
2409
2344
|
args: ['window:keydown', ['$event']]
|
|
2410
2345
|
}] } });
|
|
@@ -2415,9 +2350,9 @@ class DbxFirebaseDevelopmentModuleRootConfig {
|
|
|
2415
2350
|
* Contains components related to logging in.
|
|
2416
2351
|
*/
|
|
2417
2352
|
class DbxFirebaseDevelopmentModule {
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
dbxFirebaseDevelopmentSchedulerService.init();
|
|
2353
|
+
dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);
|
|
2354
|
+
constructor() {
|
|
2355
|
+
this.dbxFirebaseDevelopmentSchedulerService.init();
|
|
2421
2356
|
}
|
|
2422
2357
|
static forRoot(config) {
|
|
2423
2358
|
let entries = config.entries;
|
|
@@ -2442,8 +2377,8 @@ class DbxFirebaseDevelopmentModule {
|
|
|
2442
2377
|
]
|
|
2443
2378
|
};
|
|
2444
2379
|
}
|
|
2445
|
-
static
|
|
2446
|
-
static
|
|
2380
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2381
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentModule, declarations: [
|
|
2447
2382
|
//
|
|
2448
2383
|
DbxFirebaseDevelopmentPopupContentFormComponent,
|
|
2449
2384
|
DbxFirebaseDevelopmentDirective,
|
|
@@ -2460,8 +2395,8 @@ class DbxFirebaseDevelopmentModule {
|
|
|
2460
2395
|
DbxFirebaseDevelopmentSchedulerWidgetComponent,
|
|
2461
2396
|
DbxFirebaseDevelopmentSchedulerListComponent,
|
|
2462
2397
|
DbxFirebaseDevelopmentSchedulerListViewComponent,
|
|
2463
|
-
DbxFirebaseDevelopmentSchedulerListViewItemComponent] });
|
|
2464
|
-
static
|
|
2398
|
+
DbxFirebaseDevelopmentSchedulerListViewItemComponent] });
|
|
2399
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentModule, imports: [CommonModule, MatIconModule, DbxWidgetModule, DbxTextModule, DbxBlockLayoutModule, DbxTwoColumnLayoutModule, MatButtonModule, DbxRouterAnchorModule, DbxPopupInteractionModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule, DbxListLayoutModule] });
|
|
2465
2400
|
}
|
|
2466
2401
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDevelopmentModule, decorators: [{
|
|
2467
2402
|
type: NgModule,
|
|
@@ -2489,7 +2424,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2489
2424
|
DbxFirebaseDevelopmentSchedulerListViewItemComponent
|
|
2490
2425
|
]
|
|
2491
2426
|
}]
|
|
2492
|
-
}], ctorParameters: function () { return [
|
|
2427
|
+
}], ctorParameters: function () { return []; } });
|
|
2493
2428
|
|
|
2494
2429
|
/**
|
|
2495
2430
|
* Token to access the FirestoreContext value.
|
|
@@ -2534,9 +2469,9 @@ class DbxFirebaseFirestoreCollectionModule {
|
|
|
2534
2469
|
providers
|
|
2535
2470
|
};
|
|
2536
2471
|
}
|
|
2537
|
-
static
|
|
2538
|
-
static
|
|
2539
|
-
static
|
|
2472
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseFirestoreCollectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2473
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseFirestoreCollectionModule });
|
|
2474
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseFirestoreCollectionModule });
|
|
2540
2475
|
}
|
|
2541
2476
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseFirestoreCollectionModule, decorators: [{
|
|
2542
2477
|
type: NgModule
|
|
@@ -2546,21 +2481,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2546
2481
|
* Service that provides access to the app's FirestoreContext.
|
|
2547
2482
|
*/
|
|
2548
2483
|
class DbxFirestoreContextService {
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
}
|
|
2552
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirestoreContextService, deps: [{ token: DBX_FIRESTORE_CONTEXT_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2553
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirestoreContextService, providedIn: 'root' }); }
|
|
2484
|
+
firestoreContext = inject(DBX_FIRESTORE_CONTEXT_TOKEN);
|
|
2485
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirestoreContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2486
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirestoreContextService, providedIn: 'root' });
|
|
2554
2487
|
}
|
|
2555
2488
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirestoreContextService, decorators: [{
|
|
2556
2489
|
type: Injectable,
|
|
2557
2490
|
args: [{
|
|
2558
2491
|
providedIn: 'root'
|
|
2559
2492
|
}]
|
|
2560
|
-
}]
|
|
2561
|
-
type: Inject,
|
|
2562
|
-
args: [DBX_FIRESTORE_CONTEXT_TOKEN]
|
|
2563
|
-
}] }]; } });
|
|
2493
|
+
}] });
|
|
2564
2494
|
|
|
2565
2495
|
/**
|
|
2566
2496
|
* Used to initialize the LazyFirebaseFunctions type for a DbxFirebase app.
|
|
@@ -2612,47 +2542,45 @@ class DbxFirebaseFunctionsModule {
|
|
|
2612
2542
|
providers
|
|
2613
2543
|
};
|
|
2614
2544
|
}
|
|
2615
|
-
static
|
|
2616
|
-
static
|
|
2617
|
-
static
|
|
2545
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseFunctionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2546
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseFunctionsModule });
|
|
2547
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseFunctionsModule });
|
|
2618
2548
|
}
|
|
2619
2549
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseFunctionsModule, decorators: [{
|
|
2620
2550
|
type: NgModule
|
|
2621
2551
|
}] });
|
|
2622
2552
|
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
}
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
}
|
|
2653
|
-
|
|
2654
|
-
function dbxFirebaseCollectionChangeWatcher(store, mode) {
|
|
2655
|
-
return new DbxFirebaseCollectionChangeWatcherInstance(store, mode);
|
|
2553
|
+
function dbxFirebaseCollectionChangeWatcher(store, initialMode) {
|
|
2554
|
+
const _mode = new BehaviorSubject(initialMode ?? 'off');
|
|
2555
|
+
const _sub = new SubscriptionObject();
|
|
2556
|
+
const mode$ = _mode.pipe(distinctUntilChanged());
|
|
2557
|
+
const event$ = store.queryChangeWatcher$.pipe(switchMap((x) => x.event$.pipe(filter((x) => x.type !== 'none'), // do not share 'none' events.
|
|
2558
|
+
take(1), // only need one event to mark as change is available.
|
|
2559
|
+
startWith({
|
|
2560
|
+
time: new Date(),
|
|
2561
|
+
type: 'none'
|
|
2562
|
+
}))), shareReplay(1));
|
|
2563
|
+
const hasChangeAvailable$ = event$.pipe(map((x) => x.type !== 'none'), shareReplay(1));
|
|
2564
|
+
const triggered$ = combineLatest([mode$, hasChangeAvailable$]).pipe(map(([mode, hasChange]) => mode === 'auto' && hasChange));
|
|
2565
|
+
const trigger$ = triggered$.pipe(filter((triggered) => triggered), map(() => undefined));
|
|
2566
|
+
function destroy() {
|
|
2567
|
+
_sub.destroy();
|
|
2568
|
+
_mode.complete();
|
|
2569
|
+
}
|
|
2570
|
+
function setMode(mode) {
|
|
2571
|
+
_mode.next(mode);
|
|
2572
|
+
}
|
|
2573
|
+
const instance = {
|
|
2574
|
+
store,
|
|
2575
|
+
mode$,
|
|
2576
|
+
event$,
|
|
2577
|
+
hasChangeAvailable$,
|
|
2578
|
+
triggered$,
|
|
2579
|
+
trigger$,
|
|
2580
|
+
destroy,
|
|
2581
|
+
setMode
|
|
2582
|
+
};
|
|
2583
|
+
return instance;
|
|
2656
2584
|
}
|
|
2657
2585
|
|
|
2658
2586
|
/**
|
|
@@ -2663,10 +2591,12 @@ function dbxFirebaseCollectionChangeWatcher(store, mode) {
|
|
|
2663
2591
|
*/
|
|
2664
2592
|
const DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION = (instance) => instance.watcher.store.restart();
|
|
2665
2593
|
class DbxFirebaseCollectionChangeTriggerInstance {
|
|
2594
|
+
config;
|
|
2595
|
+
watcher;
|
|
2596
|
+
_triggerFunction = new BehaviorSubject(undefined);
|
|
2597
|
+
_sub = new SubscriptionObject();
|
|
2666
2598
|
constructor(config) {
|
|
2667
2599
|
this.config = config;
|
|
2668
|
-
this._triggerFunction = new BehaviorSubject(undefined);
|
|
2669
|
-
this._sub = new SubscriptionObject();
|
|
2670
2600
|
this.watcher = config.watcher;
|
|
2671
2601
|
this.triggerFunction = config.triggerFunction ?? DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION;
|
|
2672
2602
|
}
|
|
@@ -2731,50 +2661,55 @@ function dbxFirebaseCollectionChangeTrigger(config) {
|
|
|
2731
2661
|
* DbxFirebaseModelLoader implementation within an instance.
|
|
2732
2662
|
*/
|
|
2733
2663
|
class DbxFirebaseCollectionLoaderInstance {
|
|
2664
|
+
_initConfig;
|
|
2665
|
+
_collection = new BehaviorSubject(undefined);
|
|
2666
|
+
_maxPages = new BehaviorSubject(undefined);
|
|
2667
|
+
_itemsPerPage = new BehaviorSubject(undefined);
|
|
2668
|
+
_constraints = new BehaviorSubject(undefined);
|
|
2669
|
+
_restart = new Subject();
|
|
2670
|
+
_maxPagesSub = new SubscriptionObject();
|
|
2671
|
+
collection$ = this._collection.pipe(distinctUntilChanged());
|
|
2672
|
+
constraints$ = this._constraints.pipe(distinctUntilChanged());
|
|
2673
|
+
iteratorFilter$ = combineLatest([this._itemsPerPage.pipe(distinctUntilChanged()), this.constraints$]).pipe(map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages })), shareReplay(1));
|
|
2674
|
+
firestoreIteration$ = this.collection$.pipe(switchMap((collection) => {
|
|
2675
|
+
if (collection) {
|
|
2676
|
+
return combineLatest([this.iteratorFilter$, this._restart.pipe(startWith(undefined))]).pipe(throttleTime(100, undefined, { trailing: true }), // prevent rapid changes and executing filters too quickly.
|
|
2677
|
+
map(([iteratorFilter]) => collection.firestoreIteration(iteratorFilter)), cleanupDestroyable(), // cleanup the iteration
|
|
2678
|
+
shareReplay(1));
|
|
2679
|
+
}
|
|
2680
|
+
else {
|
|
2681
|
+
return NEVER; // don't emit anything until collection is provided.
|
|
2682
|
+
}
|
|
2683
|
+
}), cleanupDestroyable(), // cleanup the iteration
|
|
2684
|
+
shareReplay(1));
|
|
2685
|
+
queryChangeWatcher$ = this.firestoreIteration$.pipe(map((instance) => iterationQueryDocChangeWatcher({ instance })), shareReplay(1));
|
|
2686
|
+
snapshotAccumulator$ = this.firestoreIteration$.pipe(map((x) => firebaseQuerySnapshotAccumulator(x)), cleanupDestroyable(), shareReplay(1));
|
|
2687
|
+
snapshotAccumulatorDocumentRefs$ = this.snapshotAccumulator$.pipe(switchMap((x) => x.allItems$.pipe(map((y) => y.map((z) => z.map((zz) => zz.ref))))), shareReplay(1));
|
|
2688
|
+
snapshotAccumulatorDocuments$ = combineLatest([this.collection$.pipe(filterMaybe()), this.snapshotAccumulatorDocumentRefs$]).pipe(map(([collection, documentRefs]) => {
|
|
2689
|
+
const accessor = collection.documentAccessor();
|
|
2690
|
+
return documentRefs.map((y) => y.map((z) => accessor.loadDocument(z)));
|
|
2691
|
+
}), shareReplay(1));
|
|
2692
|
+
accumulator$ = this.firestoreIteration$.pipe(map((x) => firebaseQueryItemAccumulator(x)), cleanupDestroyable(), shareReplay(1));
|
|
2693
|
+
accumulatorPage$ = this.accumulator$.pipe(switchMap((x) => pageItemAccumulatorCurrentPage(x)), shareReplay(1));
|
|
2694
|
+
/**
|
|
2695
|
+
* Passthrough for currentAllItems$ from the accumulator.
|
|
2696
|
+
*/
|
|
2697
|
+
currentAccumulatorItems$ = this.accumulator$.pipe(switchMap((x) => x.currentAllItems$), shareReplay(1));
|
|
2698
|
+
/**
|
|
2699
|
+
* Passthrough for allItems$ from the accumulator.
|
|
2700
|
+
*/
|
|
2701
|
+
accumulatorItems$ = this.accumulator$.pipe(switchMap((x) => x.allItems$), shareReplay(1));
|
|
2702
|
+
hasDocuments$ = this.firestoreIteration$.pipe(switchMap((x) => x.firstState$.pipe(map((x) => Boolean(x.value?.length)))), shareReplay(1));
|
|
2703
|
+
allDocumentRefs$ = this.snapshotAccumulatorDocumentRefs$.pipe(map((x) => x.flat()), shareReplay(1));
|
|
2704
|
+
allDocuments$ = this.snapshotAccumulatorDocuments$.pipe(map((x) => x.flat()), shareReplay(1));
|
|
2705
|
+
allDocumentData$ = this.accumulatorItems$.pipe(map((x) => x.flat()), shareReplay(1));
|
|
2706
|
+
pageLoadingState$ = this.accumulator$.pipe(switchMap((x) => accumulatorFlattenPageListLoadingState(x)), shareReplay(1));
|
|
2734
2707
|
constructor(_initConfig) {
|
|
2735
2708
|
this._initConfig = _initConfig;
|
|
2736
|
-
this._collection
|
|
2737
|
-
this._maxPages
|
|
2738
|
-
this._itemsPerPage
|
|
2739
|
-
this._constraints
|
|
2740
|
-
this._restart = new Subject();
|
|
2741
|
-
this._maxPagesSub = new SubscriptionObject();
|
|
2742
|
-
this.collection$ = this._collection.pipe(distinctUntilChanged());
|
|
2743
|
-
this.constraints$ = this._constraints.pipe(distinctUntilChanged());
|
|
2744
|
-
this.iteratorFilter$ = combineLatest([this._itemsPerPage.pipe(distinctUntilChanged()), this.constraints$]).pipe(map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages })), shareReplay(1));
|
|
2745
|
-
this.firestoreIteration$ = this.collection$.pipe(switchMap((collection) => {
|
|
2746
|
-
if (collection) {
|
|
2747
|
-
return combineLatest([this.iteratorFilter$, this._restart.pipe(startWith(undefined))]).pipe(throttleTime(100, undefined, { trailing: true }), // prevent rapid changes and executing filters too quickly.
|
|
2748
|
-
map(([iteratorFilter]) => collection.firestoreIteration(iteratorFilter)), cleanupDestroyable(), // cleanup the iteration
|
|
2749
|
-
shareReplay(1));
|
|
2750
|
-
}
|
|
2751
|
-
else {
|
|
2752
|
-
return NEVER; // don't emit anything until collection is provided.
|
|
2753
|
-
}
|
|
2754
|
-
}), cleanupDestroyable(), // cleanup the iteration
|
|
2755
|
-
shareReplay(1));
|
|
2756
|
-
this.queryChangeWatcher$ = this.firestoreIteration$.pipe(map((instance) => iterationQueryDocChangeWatcher({ instance })), shareReplay(1));
|
|
2757
|
-
this.snapshotAccumulator$ = this.firestoreIteration$.pipe(map((x) => firebaseQuerySnapshotAccumulator(x)), cleanupDestroyable(), shareReplay(1));
|
|
2758
|
-
this.snapshotAccumulatorDocumentRefs$ = this.snapshotAccumulator$.pipe(switchMap((x) => x.allItems$.pipe(map((y) => y.map((z) => z.map((zz) => zz.ref))))), shareReplay(1));
|
|
2759
|
-
this.snapshotAccumulatorDocuments$ = combineLatest([this.collection$.pipe(filterMaybe()), this.snapshotAccumulatorDocumentRefs$]).pipe(map(([collection, documentRefs]) => {
|
|
2760
|
-
const accessor = collection.documentAccessor();
|
|
2761
|
-
return documentRefs.map((y) => y.map((z) => accessor.loadDocument(z)));
|
|
2762
|
-
}), shareReplay(1));
|
|
2763
|
-
this.accumulator$ = this.firestoreIteration$.pipe(map((x) => firebaseQueryItemAccumulator(x)), cleanupDestroyable(), shareReplay(1));
|
|
2764
|
-
this.accumulatorPage$ = this.accumulator$.pipe(switchMap((x) => pageItemAccumulatorCurrentPage(x)), shareReplay(1));
|
|
2765
|
-
/**
|
|
2766
|
-
* Passthrough for currentAllItems$ from the accumulator.
|
|
2767
|
-
*/
|
|
2768
|
-
this.currentAccumulatorItems$ = this.accumulator$.pipe(switchMap((x) => x.currentAllItems$), shareReplay(1));
|
|
2769
|
-
/**
|
|
2770
|
-
* Passthrough for allItems$ from the accumulator.
|
|
2771
|
-
*/
|
|
2772
|
-
this.accumulatorItems$ = this.accumulator$.pipe(switchMap((x) => x.allItems$), shareReplay(1));
|
|
2773
|
-
this.hasDocuments$ = this.firestoreIteration$.pipe(switchMap((x) => x.firstState$.pipe(map((x) => Boolean(x.value?.length)))), shareReplay(1));
|
|
2774
|
-
this.allDocumentRefs$ = this.snapshotAccumulatorDocumentRefs$.pipe(map((x) => x.flat()), shareReplay(1));
|
|
2775
|
-
this.allDocuments$ = this.snapshotAccumulatorDocuments$.pipe(map((x) => x.flat()), shareReplay(1));
|
|
2776
|
-
this.allDocumentData$ = this.accumulatorItems$.pipe(map((x) => x.flat()), shareReplay(1));
|
|
2777
|
-
this.pageLoadingState$ = this.accumulator$.pipe(switchMap((x) => accumulatorFlattenPageListLoadingState(x)), shareReplay(1));
|
|
2709
|
+
this._collection.next(this._initConfig?.collection);
|
|
2710
|
+
this._maxPages.next(this._initConfig?.maxPages);
|
|
2711
|
+
this._itemsPerPage.next(this._initConfig?.itemsPerPage);
|
|
2712
|
+
this._constraints.next(this._initConfig?.constraints);
|
|
2778
2713
|
}
|
|
2779
2714
|
init() {
|
|
2780
2715
|
// When max pages changes, update the iteration's max page limit.
|
|
@@ -2861,28 +2796,30 @@ function dbxFirebaseCollectionLoaderInstanceWithCollection(collection) {
|
|
|
2861
2796
|
* DbxLimitedFirebaseDocumentLoader implementation within an instance.
|
|
2862
2797
|
*/
|
|
2863
2798
|
class DbxLimitedFirebaseDocumentLoaderInstance {
|
|
2799
|
+
_initConfig;
|
|
2800
|
+
accessor;
|
|
2801
|
+
_documents = new BehaviorSubject(undefined);
|
|
2802
|
+
_restart = new Subject();
|
|
2803
|
+
_sub = new SubscriptionObject();
|
|
2804
|
+
documents$ = this._documents.pipe(filterMaybe(), distinctUntilChanged());
|
|
2805
|
+
keys$ = this.documents$.pipe(map(firestoreModelKeysFromDocuments));
|
|
2806
|
+
ids$ = this.documents$.pipe(map(firestoreModelIdsFromDocuments));
|
|
2807
|
+
refs$ = this.documents$.pipe(map(documentReferencesFromDocuments));
|
|
2808
|
+
snapshots$ = this.documents$.pipe(switchMap((docs) => this._restart.pipe(startWith(null), exhaustMap(() => getDocumentSnapshots(docs)))), shareReplay(1));
|
|
2809
|
+
data$ = this.snapshots$.pipe(map((snapshots) => getDataFromDocumentSnapshots(snapshots, true)), shareReplay(1));
|
|
2810
|
+
/**
|
|
2811
|
+
* Snapshot stream of the documents
|
|
2812
|
+
*/
|
|
2813
|
+
snapshotsStream$ = this.documents$.pipe(switchMap((docs) => latestSnapshotsFromDocuments(docs)), shareReplay(1));
|
|
2814
|
+
/**
|
|
2815
|
+
* Data streamd of the documents.
|
|
2816
|
+
*/
|
|
2817
|
+
dataStream$ = this.snapshotsStream$.pipe(dataFromDocumentSnapshots(), shareReplay(1));
|
|
2818
|
+
pageLoadingState$ = pageLoadingStateFromObs(this.data$, false);
|
|
2819
|
+
pageLoadingStateStream$ = pageLoadingStateFromObs(this.dataStream$, false);
|
|
2864
2820
|
constructor(_initConfig) {
|
|
2865
2821
|
this._initConfig = _initConfig;
|
|
2866
2822
|
this.accessor = this._initConfig.accessor;
|
|
2867
|
-
this._documents = new BehaviorSubject(undefined);
|
|
2868
|
-
this._restart = new Subject();
|
|
2869
|
-
this._sub = new SubscriptionObject();
|
|
2870
|
-
this.documents$ = this._documents.pipe(filterMaybe(), distinctUntilChanged());
|
|
2871
|
-
this.keys$ = this.documents$.pipe(map(firestoreModelKeysFromDocuments));
|
|
2872
|
-
this.ids$ = this.documents$.pipe(map(firestoreModelIdsFromDocuments));
|
|
2873
|
-
this.refs$ = this.documents$.pipe(map(documentReferencesFromDocuments));
|
|
2874
|
-
this.snapshots$ = this.documents$.pipe(switchMap((docs) => this._restart.pipe(startWith(null), exhaustMap(() => getDocumentSnapshots(docs)))), shareReplay(1));
|
|
2875
|
-
this.data$ = this.snapshots$.pipe(map((snapshots) => getDataFromDocumentSnapshots(snapshots, true)), shareReplay(1));
|
|
2876
|
-
/**
|
|
2877
|
-
* Snapshot stream of the documents
|
|
2878
|
-
*/
|
|
2879
|
-
this.snapshotsStream$ = this.documents$.pipe(switchMap((docs) => latestSnapshotsFromDocuments(docs)), shareReplay(1));
|
|
2880
|
-
/**
|
|
2881
|
-
* Data streamd of the documents.
|
|
2882
|
-
*/
|
|
2883
|
-
this.dataStream$ = this.snapshotsStream$.pipe(dataFromDocumentSnapshots(), shareReplay(1));
|
|
2884
|
-
this.pageLoadingState$ = pageLoadingStateFromObs(this.data$, false);
|
|
2885
|
-
this.pageLoadingStateStream$ = pageLoadingStateFromObs(this.dataStream$, false);
|
|
2886
2823
|
}
|
|
2887
2824
|
destroy() {
|
|
2888
2825
|
this._documents.complete();
|
|
@@ -2932,24 +2869,25 @@ function dbxFirebaseInContextFirebaseModelServiceInstanceFactory(context$) {
|
|
|
2932
2869
|
* Wraps an InModelContextFirebaseModelService observable and provides different piped observables.
|
|
2933
2870
|
*/
|
|
2934
2871
|
class DbxFirebaseInContextFirebaseModelServiceInstance {
|
|
2872
|
+
modelService$;
|
|
2935
2873
|
constructor(modelService$) {
|
|
2936
2874
|
this.modelService$ = modelService$;
|
|
2937
|
-
this.key$ = this.modelService$.pipe(map((x) => x.model.key));
|
|
2938
|
-
// MARK: Model
|
|
2939
|
-
this.modelType$ = this.modelService$.pipe(map((x) => x.model.modelType), distinctUntilChanged());
|
|
2940
|
-
this.model$ = this.modelService$.pipe(map((x) => x.model), distinctUntilChanged((a, b) => a.key === b.key), shareReplay(1));
|
|
2941
|
-
this.snapshotData$ = this.model$.pipe(switchMap((x) => x.snapshotData()), shareReplay(1));
|
|
2942
|
-
// MARK: Roles
|
|
2943
|
-
this.roleReader$ = this.modelService$.pipe(switchMap((x) => x.roleReader()), shareReplay(1));
|
|
2944
|
-
this.roleMap$ = this.roleReader$.pipe(map((x) => x.roleMap), shareReplay(1));
|
|
2945
|
-
this.hasNoAccess$ = this.roleReader$.pipe(map((x) => x.hasNoAccess()), shareReplay(1));
|
|
2946
2875
|
}
|
|
2876
|
+
key$ = this.modelService$.pipe(map((x) => x.model.key));
|
|
2877
|
+
// MARK: Model
|
|
2878
|
+
modelType$ = this.modelService$.pipe(map((x) => x.model.modelType), distinctUntilChanged());
|
|
2879
|
+
model$ = this.modelService$.pipe(map((x) => x.model), distinctUntilChanged((a, b) => a.key === b.key), shareReplay(1));
|
|
2880
|
+
snapshotData$ = this.model$.pipe(switchMap((x) => x.snapshotData()), shareReplay(1));
|
|
2947
2881
|
snapshotStream(mode) {
|
|
2948
2882
|
return this.model$.pipe(switchMap((x) => x.snapshotStream(mode)), shareReplay(1));
|
|
2949
2883
|
}
|
|
2950
2884
|
snapshotDataStream(mode, options) {
|
|
2951
2885
|
return this.model$.pipe(switchMap((x) => x.snapshotDataStream(mode)), shareReplay(1));
|
|
2952
2886
|
}
|
|
2887
|
+
// MARK: Roles
|
|
2888
|
+
roleReader$ = this.modelService$.pipe(switchMap((x) => x.roleReader()), shareReplay(1));
|
|
2889
|
+
roleMap$ = this.roleReader$.pipe(map((x) => x.roleMap), shareReplay(1));
|
|
2890
|
+
hasNoAccess$ = this.roleReader$.pipe(map((x) => x.hasNoAccess()), shareReplay(1));
|
|
2953
2891
|
truthMap(input) {
|
|
2954
2892
|
return this.roleReader$.pipe(map((x) => x.truthMap(input)), shareReplay(1));
|
|
2955
2893
|
}
|
|
@@ -3019,11 +2957,11 @@ class DbxFirebaseModelTypesServiceConfig {
|
|
|
3019
2957
|
* Automatically configures the DbxModelTypesService.
|
|
3020
2958
|
*/
|
|
3021
2959
|
class DbxFirebaseModelTypesService {
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
if (
|
|
3026
|
-
this.register(
|
|
2960
|
+
dbxFirebaseModelContextService = inject(DbxFirebaseModelContextService);
|
|
2961
|
+
dbxModelTypesService = inject((DbxModelTypesService));
|
|
2962
|
+
constructor(initialConfig) {
|
|
2963
|
+
if (initialConfig) {
|
|
2964
|
+
this.register(initialConfig.entries);
|
|
3027
2965
|
}
|
|
3028
2966
|
}
|
|
3029
2967
|
getDisplayInfo(typeInfo, data) {
|
|
@@ -3063,21 +3001,24 @@ class DbxFirebaseModelTypesService {
|
|
|
3063
3001
|
}));
|
|
3064
3002
|
}
|
|
3065
3003
|
instanceForKey(key$) {
|
|
3066
|
-
return
|
|
3004
|
+
return dbxFirebaseModelTypesServiceInstance(this.dbxFirebaseModelContextService.modelInfoInstance(key$), this);
|
|
3067
3005
|
}
|
|
3068
3006
|
instancePairsForKeys(keys) {
|
|
3069
3007
|
return dbxFirebaseModelTypesServiceInstancePairForKeysFactory(this)(keys);
|
|
3070
3008
|
}
|
|
3071
|
-
static
|
|
3072
|
-
static
|
|
3009
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypesService, deps: [{ token: DbxFirebaseModelTypesServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3010
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypesService, providedIn: 'root' });
|
|
3073
3011
|
}
|
|
3074
3012
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypesService, decorators: [{
|
|
3075
3013
|
type: Injectable,
|
|
3076
3014
|
args: [{
|
|
3077
3015
|
providedIn: 'root'
|
|
3078
3016
|
}]
|
|
3079
|
-
}], ctorParameters: function () { return [{ type:
|
|
3017
|
+
}], ctorParameters: function () { return [{ type: DbxFirebaseModelTypesServiceConfig, decorators: [{
|
|
3080
3018
|
type: Optional
|
|
3019
|
+
}, {
|
|
3020
|
+
type: Inject,
|
|
3021
|
+
args: [DbxFirebaseModelTypesServiceConfig]
|
|
3081
3022
|
}] }]; } });
|
|
3082
3023
|
function dbxFirebaseModelTypesServiceInstancePairForKeysFactory(service) {
|
|
3083
3024
|
return (keys) => {
|
|
@@ -3085,36 +3026,49 @@ function dbxFirebaseModelTypesServiceInstancePairForKeysFactory(service) {
|
|
|
3085
3026
|
return instances.length ? combineLatest(instances) : of([]);
|
|
3086
3027
|
};
|
|
3087
3028
|
}
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3029
|
+
function dbxFirebaseModelTypesServiceInstance(modelInfoInstance$, dbxFirebaseModelTypesService) {
|
|
3030
|
+
const key$ = modelInfoInstance$.pipe(switchMap((x) => x.key$));
|
|
3031
|
+
const modelType$ = modelInfoInstance$.pipe(switchMap((x) => x.modelType$));
|
|
3032
|
+
const snapshotData$ = modelInfoInstance$.pipe(switchMap((x) => x.snapshotData$));
|
|
3033
|
+
const typeInfo$ = modelType$.pipe(switchMap((x) => dbxFirebaseModelTypesService.infoForType(x)), distinctUntilChanged(), shareReplay(1));
|
|
3034
|
+
const identity$ = typeInfo$.pipe(map((x) => x.identity), distinctUntilChanged());
|
|
3035
|
+
const segueRef$ = combineLatest([key$, typeInfo$]).pipe(map(([key, info]) => (info.sref ? info.sref(key) : undefined)), shareReplay(1));
|
|
3036
|
+
const displayInfo$ = combineLatest([typeInfo$, snapshotData$]).pipe(map(([typeInfo, data]) => dbxFirebaseModelTypesService.getDisplayInfo(typeInfo, data)), shareReplay(1));
|
|
3037
|
+
const clickableSegueRef$ = combineLatest([segueRef$, displayInfo$]).pipe(map(([segueRef, displayInfo]) => {
|
|
3038
|
+
let ref = undefined;
|
|
3039
|
+
if (segueRef) {
|
|
3040
|
+
ref = {
|
|
3041
|
+
...segueRef,
|
|
3042
|
+
title: displayInfo.title,
|
|
3043
|
+
icon: displayInfo.icon
|
|
3044
|
+
};
|
|
3045
|
+
}
|
|
3046
|
+
return ref;
|
|
3047
|
+
}), shareReplay(1));
|
|
3048
|
+
const instancePair$ = combineLatest([clickableSegueRef$, displayInfo$, key$]).pipe(map(([segueRef, displayInfo, key]) => ({ segueRef, displayInfo, key, instance })), shareReplay(1));
|
|
3049
|
+
const instance = {
|
|
3050
|
+
modelInfoInstance$,
|
|
3051
|
+
dbxFirebaseModelTypesService,
|
|
3052
|
+
key$,
|
|
3053
|
+
modelType$,
|
|
3054
|
+
snapshotData$,
|
|
3055
|
+
typeInfo$,
|
|
3056
|
+
identity$,
|
|
3057
|
+
segueRef$,
|
|
3058
|
+
displayInfo$,
|
|
3059
|
+
clickableSegueRef$,
|
|
3060
|
+
instancePair$
|
|
3061
|
+
};
|
|
3062
|
+
return instance;
|
|
3115
3063
|
}
|
|
3116
3064
|
|
|
3117
3065
|
class DbxFirebaseModelTrackerService {
|
|
3066
|
+
dbxModelTrackerService = inject(DbxModelTrackerService);
|
|
3067
|
+
dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);
|
|
3068
|
+
historyKeys$ = this.dbxModelTrackerService.newEvent$.pipe(startWith(null), switchMap(() => this.loadHistoryKeys()), shareReplay(1));
|
|
3069
|
+
historyPairs$ = this.dbxModelTrackerService.newEvent$.pipe(startWith(null), switchMap(() => this.loadHistoryPairs()), // TODO: Improve efficiency of this to only load/remove items for new keys
|
|
3070
|
+
shareReplay(1));
|
|
3071
|
+
filterItemHistoryPairs$ = this.historyPairs$.pipe(mapEachAsync((instancePair) => instancePair.instance.identity$.pipe(map((identity) => ({ instancePair, identity }))), { onlyFirst: true }), shareReplay(1));
|
|
3118
3072
|
/**
|
|
3119
3073
|
* Filters from historyPairs$ using the input filter configuration, if it is provided.
|
|
3120
3074
|
*
|
|
@@ -3149,23 +3103,15 @@ class DbxFirebaseModelTrackerService {
|
|
|
3149
3103
|
const historyKeys$ = this.loadHistoryKeys();
|
|
3150
3104
|
return historyKeys$.pipe(switchMap((x) => this.dbxFirebaseModelTypesService.instancePairsForKeys(x)));
|
|
3151
3105
|
}
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
this.dbxFirebaseModelTypesService = dbxFirebaseModelTypesService;
|
|
3155
|
-
this.historyKeys$ = this.dbxModelTrackerService.newEvent$.pipe(startWith(null), switchMap(() => this.loadHistoryKeys()), shareReplay(1));
|
|
3156
|
-
this.historyPairs$ = this.dbxModelTrackerService.newEvent$.pipe(startWith(null), switchMap(() => this.loadHistoryPairs()), // TODO: Improve efficiency of this to only load/remove items for new keys
|
|
3157
|
-
shareReplay(1));
|
|
3158
|
-
this.filterItemHistoryPairs$ = this.historyPairs$.pipe(mapEachAsync((instancePair) => instancePair.instance.identity$.pipe(map((identity) => ({ instancePair, identity }))), { onlyFirst: true }), shareReplay(1));
|
|
3159
|
-
}
|
|
3160
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTrackerService, deps: [{ token: i1$2.DbxModelTrackerService }, { token: DbxFirebaseModelTypesService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3161
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTrackerService, providedIn: 'root' }); }
|
|
3106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTrackerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3107
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTrackerService, providedIn: 'root' });
|
|
3162
3108
|
}
|
|
3163
3109
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTrackerService, decorators: [{
|
|
3164
3110
|
type: Injectable,
|
|
3165
3111
|
args: [{
|
|
3166
3112
|
providedIn: 'root'
|
|
3167
3113
|
}]
|
|
3168
|
-
}]
|
|
3114
|
+
}] });
|
|
3169
3115
|
|
|
3170
3116
|
/**
|
|
3171
3117
|
* Renders an item as configured from the DbxFirebaseModelTypesServiceInstancePair.
|
|
@@ -3177,8 +3123,8 @@ class DbxFirebaseModelTypeInstanceComponent extends AbstractDbxSelectionListWrap
|
|
|
3177
3123
|
defaultSelectionMode: 'view'
|
|
3178
3124
|
});
|
|
3179
3125
|
}
|
|
3180
|
-
static
|
|
3181
|
-
static
|
|
3126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypeInstanceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3127
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseModelTypeInstanceComponent, selector: "dbx-firebase-model-type-instance-list", providers: provideDbxListViewWrapper(DbxFirebaseModelTypeInstanceComponent), usesInheritance: true, ngImport: i0, template: "\n<dbx-list [state$]=\"state$\" [config]=\"config$ | async\" [disabled]=\"disabled\" [selectionMode]=\"selectionMode\">\n <ng-content top select=\"[top]\"></ng-content>\n <ng-content bottom select=\"[bottom]\"></ng-content>\n <ng-content empty select=\"[empty]\"></ng-content>\n <ng-content emptyLoading select=\"[emptyLoading]\"></ng-content>\n</dbx-list>\n", isInline: true, dependencies: [{ kind: "component", type: i1.DbxListComponent, selector: "dbx-list", inputs: ["padded", "state$", "config", "disabled", "selectionMode"], outputs: ["contentScrolled"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] });
|
|
3182
3128
|
}
|
|
3183
3129
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypeInstanceComponent, decorators: [{
|
|
3184
3130
|
type: Component,
|
|
@@ -3189,15 +3135,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3189
3135
|
}]
|
|
3190
3136
|
}], ctorParameters: function () { return []; } });
|
|
3191
3137
|
class DbxFirebaseModelTypeInstanceViewComponent extends AbstractDbxSelectionListViewDirective {
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
}
|
|
3199
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypeInstanceViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3200
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseModelTypeInstanceViewComponent, selector: "dbx-firebase-model-type-instance-list-view", providers: provideDbxListView(DbxFirebaseModelTypeInstanceViewComponent), usesInheritance: true, ngImport: i0, template: "<dbx-selection-list-view [config]=\"config\"></dbx-selection-list-view>", isInline: true, dependencies: [{ kind: "component", type: i1$2.DbxSelectionValueListViewComponent, selector: "dbx-selection-list-view" }] }); }
|
|
3138
|
+
config = {
|
|
3139
|
+
componentClass: DbxFirebaseModelTypeInstanceViewItemComponent,
|
|
3140
|
+
mapValuesToItemValues: (x) => of(x.map((y) => ({ itemValue: y, icon: y.displayInfo.icon ?? y.icon, anchor: y.segueRef })))
|
|
3141
|
+
};
|
|
3142
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypeInstanceViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3143
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseModelTypeInstanceViewComponent, selector: "dbx-firebase-model-type-instance-list-view", providers: provideDbxListView(DbxFirebaseModelTypeInstanceViewComponent), usesInheritance: true, ngImport: i0, template: "<dbx-selection-list-view [config]=\"config\"></dbx-selection-list-view>", isInline: true, dependencies: [{ kind: "component", type: i1.DbxSelectionValueListViewComponent, selector: "dbx-selection-list-view" }] });
|
|
3201
3144
|
}
|
|
3202
3145
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypeInstanceViewComponent, decorators: [{
|
|
3203
3146
|
type: Component,
|
|
@@ -3211,10 +3154,10 @@ class DbxFirebaseModelTypeInstanceViewItemComponent extends AbstractDbxValueList
|
|
|
3211
3154
|
get title() {
|
|
3212
3155
|
return this.itemValue.displayInfo.title;
|
|
3213
3156
|
}
|
|
3214
|
-
static
|
|
3215
|
-
static
|
|
3157
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypeInstanceViewItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3158
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseModelTypeInstanceViewItemComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
3216
3159
|
<span>{{ title }}</span>
|
|
3217
|
-
`, isInline: true });
|
|
3160
|
+
`, isInline: true });
|
|
3218
3161
|
}
|
|
3219
3162
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypeInstanceViewItemComponent, decorators: [{
|
|
3220
3163
|
type: Component,
|
|
@@ -3226,28 +3169,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3226
3169
|
}] });
|
|
3227
3170
|
|
|
3228
3171
|
class DbxFirebaseModelHistoryComponent {
|
|
3172
|
+
dbxFirebaseModelTrackerService = inject(DbxFirebaseModelTrackerService);
|
|
3173
|
+
_historyFilter = new BehaviorSubject(undefined);
|
|
3174
|
+
anchorForItem;
|
|
3229
3175
|
get historyFilter() {
|
|
3230
3176
|
return this._historyFilter.value;
|
|
3231
3177
|
}
|
|
3232
3178
|
set historyFilter(historyFilter) {
|
|
3233
3179
|
this._historyFilter.next(historyFilter);
|
|
3234
3180
|
}
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
this.historyFilter$ = this._historyFilter.asObservable();
|
|
3239
|
-
this.historyPairs$ = this.historyFilter$.pipe(switchMap((x) => this.dbxFirebaseModelTrackerService.filterHistoryPairs(x)), shareReplay(1));
|
|
3240
|
-
this.state$ = loadingStateFromObs(this.historyPairs$);
|
|
3241
|
-
}
|
|
3181
|
+
historyFilter$ = this._historyFilter.asObservable();
|
|
3182
|
+
historyPairs$ = this.historyFilter$.pipe(switchMap((x) => this.dbxFirebaseModelTrackerService.filterHistoryPairs(x)), shareReplay(1));
|
|
3183
|
+
state$ = loadingStateFromObs(this.historyPairs$);
|
|
3242
3184
|
ngOnDestroy() {
|
|
3243
3185
|
this._historyFilter.complete();
|
|
3244
3186
|
}
|
|
3245
|
-
static
|
|
3246
|
-
static
|
|
3187
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3188
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseModelHistoryComponent, selector: "dbx-firebase-model-history", inputs: { anchorForItem: "anchorForItem", historyFilter: "historyFilter" }, ngImport: i0, template: `
|
|
3247
3189
|
<dbx-firebase-model-type-instance-list [state$]="state$" [dbxListItemModifier] [dbxListItemAnchorModifier]="anchorForItem">
|
|
3248
3190
|
<ng-content empty select="[empty]"></ng-content>
|
|
3249
3191
|
</dbx-firebase-model-type-instance-list>
|
|
3250
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1
|
|
3192
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DbxListItemAnchorModifierDirective, selector: "[dbxListItemAnchorModifier]", inputs: ["dbxListItemAnchorModifier"] }, { kind: "directive", type: i1.DbxValueListItemModifierDirective, selector: "[dbxListItemModifier]", inputs: ["dbxListItemModifier"] }, { kind: "component", type: DbxFirebaseModelTypeInstanceComponent, selector: "dbx-firebase-model-type-instance-list" }] });
|
|
3251
3193
|
}
|
|
3252
3194
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryComponent, decorators: [{
|
|
3253
3195
|
type: Component,
|
|
@@ -3259,7 +3201,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3259
3201
|
</dbx-firebase-model-type-instance-list>
|
|
3260
3202
|
`
|
|
3261
3203
|
}]
|
|
3262
|
-
}],
|
|
3204
|
+
}], propDecorators: { anchorForItem: [{
|
|
3263
3205
|
type: Input
|
|
3264
3206
|
}], historyFilter: [{
|
|
3265
3207
|
type: Input
|
|
@@ -3281,9 +3223,6 @@ class DbxFirebaseModelHistoryPopoverComponent extends AbstractPopoverDirective {
|
|
|
3281
3223
|
}
|
|
3282
3224
|
});
|
|
3283
3225
|
}
|
|
3284
|
-
constructor(popover) {
|
|
3285
|
-
super(popover);
|
|
3286
|
-
}
|
|
3287
3226
|
get params() {
|
|
3288
3227
|
return this.popover.data;
|
|
3289
3228
|
}
|
|
@@ -3302,25 +3241,24 @@ class DbxFirebaseModelHistoryPopoverComponent extends AbstractPopoverDirective {
|
|
|
3302
3241
|
get anchorForItem() {
|
|
3303
3242
|
return this.params.anchorForItem;
|
|
3304
3243
|
}
|
|
3305
|
-
static
|
|
3306
|
-
static
|
|
3244
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryPopoverComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3245
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseModelHistoryPopoverComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\"></dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-firebase-model-history [historyFilter]=\"historyFilter\" [anchorForItem]=\"anchorForItem\">\n <dbx-list-empty-content empty>\n <p>{{ emptyText }}</p>\n </dbx-list-empty-content>\n </dbx-firebase-model-history>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n", dependencies: [{ kind: "component", type: i1.DbxPopoverContentComponent, selector: "dbx-popover-content" }, { kind: "component", type: i1.DbxPopoverHeaderComponent, selector: "dbx-popover-header", inputs: ["header", "icon"] }, { kind: "component", type: i1.DbxPopoverScrollContentComponent, selector: "dbx-popover-scroll-content" }, { kind: "component", type: i1.DbxListEmptyContentComponent, selector: "dbx-list-empty-content" }, { kind: "component", type: DbxFirebaseModelHistoryComponent, selector: "dbx-firebase-model-history", inputs: ["anchorForItem", "historyFilter"] }] });
|
|
3307
3246
|
}
|
|
3308
3247
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryPopoverComponent, decorators: [{
|
|
3309
3248
|
type: Component,
|
|
3310
3249
|
args: [{ template: "<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\"></dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-firebase-model-history [historyFilter]=\"historyFilter\" [anchorForItem]=\"anchorForItem\">\n <dbx-list-empty-content empty>\n <p>{{ emptyText }}</p>\n </dbx-list-empty-content>\n </dbx-firebase-model-history>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n" }]
|
|
3311
|
-
}]
|
|
3250
|
+
}] });
|
|
3312
3251
|
|
|
3313
3252
|
class DbxFirebaseModelHistoryPopoverButtonComponent extends AbstractPopoverRefDirective {
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
}
|
|
3253
|
+
_dbxPopoverService = inject(DbxPopoverService);
|
|
3254
|
+
buttonElement;
|
|
3255
|
+
config;
|
|
3318
3256
|
_makePopoverRef(origin) {
|
|
3319
3257
|
const config = this.config;
|
|
3320
3258
|
if (!origin) {
|
|
3321
3259
|
throw new Error('Missing origin.');
|
|
3322
3260
|
}
|
|
3323
|
-
return DbxFirebaseModelHistoryPopoverComponent.openPopover(this.
|
|
3261
|
+
return DbxFirebaseModelHistoryPopoverComponent.openPopover(this._dbxPopoverService, {
|
|
3324
3262
|
origin,
|
|
3325
3263
|
...config
|
|
3326
3264
|
});
|
|
@@ -3329,10 +3267,10 @@ class DbxFirebaseModelHistoryPopoverButtonComponent extends AbstractPopoverRefDi
|
|
|
3329
3267
|
const origin = this.buttonElement.nativeElement;
|
|
3330
3268
|
this.showPopover(origin);
|
|
3331
3269
|
}
|
|
3332
|
-
static
|
|
3333
|
-
static
|
|
3270
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryPopoverButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3271
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseModelHistoryPopoverButtonComponent, selector: "dbx-firebase-model-history-popover-button", inputs: { config: "config" }, viewQueries: [{ propertyName: "buttonElement", first: true, predicate: ["button"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: `
|
|
3334
3272
|
<dbx-icon-button #button (buttonClick)="showHistoryPopover()" icon="history"></dbx-icon-button>
|
|
3335
|
-
`, isInline: true, dependencies: [{ kind: "component", type: i1
|
|
3273
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1.DbxIconButtonComponent, selector: "dbx-icon-button" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3336
3274
|
}
|
|
3337
3275
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryPopoverButtonComponent, decorators: [{
|
|
3338
3276
|
type: Component,
|
|
@@ -3343,7 +3281,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3343
3281
|
`,
|
|
3344
3282
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
3345
3283
|
}]
|
|
3346
|
-
}],
|
|
3284
|
+
}], propDecorators: { buttonElement: [{
|
|
3347
3285
|
type: ViewChild,
|
|
3348
3286
|
args: ['button', { read: ElementRef, static: false }]
|
|
3349
3287
|
}], config: [{
|
|
@@ -3354,35 +3292,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3354
3292
|
* Abstract directive that contains a DbxFirebaseDocumentStore and provides an interface for communicating with other directives.
|
|
3355
3293
|
*/
|
|
3356
3294
|
class DbxFirebaseDocumentStoreDirective {
|
|
3295
|
+
_store = new BehaviorSubject(undefined);
|
|
3296
|
+
store$ = this._store.pipe(filterMaybe(), shareReplay(1));
|
|
3297
|
+
exists$ = this.store$.pipe(switchMap((x) => x.exists$));
|
|
3298
|
+
document$ = this.store$.pipe(switchMap((x) => x.document$));
|
|
3299
|
+
documentLoadingState$ = this.store$.pipe(switchMap((x) => x.documentLoadingState$));
|
|
3300
|
+
id$ = this.store$.pipe(switchMap((x) => x.id$));
|
|
3301
|
+
key$ = this.store$.pipe(switchMap((x) => x.key$));
|
|
3302
|
+
ref$ = this.store$.pipe(switchMap((x) => x.ref$));
|
|
3303
|
+
snapshot$ = this.store$.pipe(switchMap((x) => x.snapshot$));
|
|
3304
|
+
snapshotLoadingState$ = this.store$.pipe(switchMap((x) => x.snapshotLoadingState$));
|
|
3305
|
+
modelIdentity$ = this.store$.pipe(switchMap((x) => x.modelIdentity$));
|
|
3306
|
+
data$ = this.store$.pipe(switchMap((x) => x.data$));
|
|
3307
|
+
loadingState$ = this.store$.pipe(switchMap((x) => x.dataLoadingState$));
|
|
3357
3308
|
constructor(store) {
|
|
3358
|
-
this.store
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
this.
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
this.
|
|
3368
|
-
this.data$ = this.store.data$;
|
|
3369
|
-
this.loadingState$ = this.store.dataLoadingState$;
|
|
3309
|
+
this.replaceStore(store);
|
|
3310
|
+
}
|
|
3311
|
+
ngOnDestroy() {
|
|
3312
|
+
this._store.complete();
|
|
3313
|
+
}
|
|
3314
|
+
/**
|
|
3315
|
+
* Replaces the internal store.
|
|
3316
|
+
*/
|
|
3317
|
+
replaceStore(store) {
|
|
3318
|
+
this._store.next(store);
|
|
3370
3319
|
}
|
|
3371
3320
|
// MARK: Inputs
|
|
3321
|
+
get store() {
|
|
3322
|
+
return this._store.value;
|
|
3323
|
+
}
|
|
3372
3324
|
set documentId(documentId) {
|
|
3373
|
-
this.store.setId(documentId);
|
|
3325
|
+
useFirst(this.store$, (x) => x.setId(documentId));
|
|
3374
3326
|
}
|
|
3375
3327
|
set key(key) {
|
|
3376
|
-
this.store.setKey(key);
|
|
3328
|
+
useFirst(this.store$, (x) => x.setKey(key));
|
|
3377
3329
|
}
|
|
3378
3330
|
set ref(ref) {
|
|
3379
|
-
this.store.setRef(ref);
|
|
3331
|
+
useFirst(this.store$, (x) => x.setRef(ref));
|
|
3380
3332
|
}
|
|
3381
3333
|
set streamMode(streamMode) {
|
|
3382
|
-
this.store.setStreamMode(streamMode);
|
|
3334
|
+
useFirst(this.store$, (x) => x.setStreamMode(streamMode));
|
|
3383
3335
|
}
|
|
3384
|
-
static
|
|
3385
|
-
static
|
|
3336
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDocumentStoreDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
3337
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDocumentStoreDirective, inputs: { documentId: "documentId", key: "key", ref: "ref", streamMode: "streamMode" }, ngImport: i0 });
|
|
3386
3338
|
}
|
|
3387
3339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDocumentStoreDirective, decorators: [{
|
|
3388
3340
|
type: Directive
|
|
@@ -3412,13 +3364,11 @@ function provideDbxFirebaseDocumentStoreDirective(sourceType, storeType) {
|
|
|
3412
3364
|
* Used with a DbxFirebaseDocumentStoreDirective to emit model viewed events.
|
|
3413
3365
|
*/
|
|
3414
3366
|
class DbxfirebaseModelViewedEventDirective extends AbstractSubscriptionDirective {
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
this.ngZone = ngZone;
|
|
3421
|
-
}
|
|
3367
|
+
dbxFirebaseDocumentStoreDirective = inject(DbxFirebaseDocumentStoreDirective);
|
|
3368
|
+
dbxModelObjectStateService = inject(DbxModelObjectStateService);
|
|
3369
|
+
dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);
|
|
3370
|
+
ngZone = inject(NgZone);
|
|
3371
|
+
context;
|
|
3422
3372
|
ngOnInit() {
|
|
3423
3373
|
this.sub = this.dbxFirebaseDocumentStoreDirective.data$
|
|
3424
3374
|
.pipe(
|
|
@@ -3436,24 +3386,24 @@ class DbxfirebaseModelViewedEventDirective extends AbstractSubscriptionDirective
|
|
|
3436
3386
|
this.ngZone.run(() => this.dbxModelObjectStateService.emitModelViewEvent({ modelKeyTypeNamePair, context: this.context || undefined }));
|
|
3437
3387
|
});
|
|
3438
3388
|
}
|
|
3439
|
-
static
|
|
3440
|
-
static
|
|
3389
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxfirebaseModelViewedEventDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3390
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxfirebaseModelViewedEventDirective, selector: "[dbxFirebaseModelViewedEvent]", inputs: { context: ["dbxFirebaseModelViewedEvent", "context"] }, usesInheritance: true, ngImport: i0 });
|
|
3441
3391
|
}
|
|
3442
3392
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxfirebaseModelViewedEventDirective, decorators: [{
|
|
3443
3393
|
type: Directive,
|
|
3444
3394
|
args: [{
|
|
3445
3395
|
selector: '[dbxFirebaseModelViewedEvent]'
|
|
3446
3396
|
}]
|
|
3447
|
-
}],
|
|
3397
|
+
}], propDecorators: { context: [{
|
|
3448
3398
|
type: Input,
|
|
3449
3399
|
args: ['dbxFirebaseModelViewedEvent']
|
|
3450
3400
|
}] } });
|
|
3451
3401
|
|
|
3452
3402
|
const declarations$3 = [DbxfirebaseModelViewedEventDirective, DbxFirebaseModelTypeInstanceComponent, DbxFirebaseModelTypeInstanceViewComponent, DbxFirebaseModelTypeInstanceViewItemComponent];
|
|
3453
3403
|
class DbxFirebaseModelTypesModule {
|
|
3454
|
-
static
|
|
3455
|
-
static
|
|
3456
|
-
static
|
|
3404
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3405
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypesModule, declarations: [DbxfirebaseModelViewedEventDirective, DbxFirebaseModelTypeInstanceComponent, DbxFirebaseModelTypeInstanceViewComponent, DbxFirebaseModelTypeInstanceViewItemComponent], imports: [CommonModule, DbxModelInfoModule, DbxListLayoutModule], exports: [DbxfirebaseModelViewedEventDirective, DbxFirebaseModelTypeInstanceComponent, DbxFirebaseModelTypeInstanceViewComponent, DbxFirebaseModelTypeInstanceViewItemComponent] });
|
|
3406
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypesModule, imports: [CommonModule, DbxModelInfoModule, DbxListLayoutModule] });
|
|
3457
3407
|
}
|
|
3458
3408
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelTypesModule, decorators: [{
|
|
3459
3409
|
type: NgModule,
|
|
@@ -3466,9 +3416,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3466
3416
|
|
|
3467
3417
|
const declarations$2 = [DbxFirebaseModelHistoryComponent, DbxFirebaseModelHistoryPopoverButtonComponent, DbxFirebaseModelHistoryPopoverComponent];
|
|
3468
3418
|
class DbxFirebaseModelHistoryModule {
|
|
3469
|
-
static
|
|
3470
|
-
static
|
|
3471
|
-
static
|
|
3419
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3420
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryModule, declarations: [DbxFirebaseModelHistoryComponent, DbxFirebaseModelHistoryPopoverButtonComponent, DbxFirebaseModelHistoryPopoverComponent], imports: [CommonModule, DbxButtonModule, DbxRouterListModule, DbxPopoverInteractionModule, DbxModelInfoModule, DbxListLayoutModule, DbxFirebaseModelTypesModule], exports: [DbxFirebaseModelHistoryComponent, DbxFirebaseModelHistoryPopoverButtonComponent, DbxFirebaseModelHistoryPopoverComponent] });
|
|
3421
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryModule, imports: [CommonModule, DbxButtonModule, DbxRouterListModule, DbxPopoverInteractionModule, DbxModelInfoModule, DbxListLayoutModule, DbxFirebaseModelTypesModule] });
|
|
3472
3422
|
}
|
|
3473
3423
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelHistoryModule, decorators: [{
|
|
3474
3424
|
type: NgModule,
|
|
@@ -3500,10 +3450,11 @@ function dbxFirebaseSourceSelectLoadSource(config) {
|
|
|
3500
3450
|
* Abstract directive that contains a DbxFirebaseCollectionStore and provides an interface for communicating with other directives.
|
|
3501
3451
|
*/
|
|
3502
3452
|
class DbxFirebaseCollectionStoreDirective {
|
|
3453
|
+
store;
|
|
3503
3454
|
constructor(store) {
|
|
3504
3455
|
this.store = store;
|
|
3505
|
-
this.pageLoadingState$ = this.store.pageLoadingState$;
|
|
3506
3456
|
}
|
|
3457
|
+
pageLoadingState$ = this.store.pageLoadingState$;
|
|
3507
3458
|
// MARK: Inputs
|
|
3508
3459
|
set maxPages(maxPages) {
|
|
3509
3460
|
this.store.setMaxPages(maxPages);
|
|
@@ -3523,8 +3474,8 @@ class DbxFirebaseCollectionStoreDirective {
|
|
|
3523
3474
|
setConstraints(constraints) {
|
|
3524
3475
|
this.store.setConstraints(constraints);
|
|
3525
3476
|
}
|
|
3526
|
-
static
|
|
3527
|
-
static
|
|
3477
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionStoreDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
3478
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseCollectionStoreDirective, inputs: { maxPages: "maxPages", itemsPerPage: "itemsPerPage", constraints: "constraints" }, ngImport: i0 });
|
|
3528
3479
|
}
|
|
3529
3480
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionStoreDirective, decorators: [{
|
|
3530
3481
|
type: Directive
|
|
@@ -3552,19 +3503,17 @@ function provideDbxFirebaseCollectionStoreDirective(sourceType, storeType) {
|
|
|
3552
3503
|
* Used to watch query doc changes and respond to them accordingly.
|
|
3553
3504
|
*/
|
|
3554
3505
|
class DbxFirebaseCollectionChangeDirective {
|
|
3506
|
+
dbxFirebaseCollectionStoreDirective = inject((DbxFirebaseCollectionStoreDirective));
|
|
3507
|
+
_watcher = dbxFirebaseCollectionChangeWatcher(this.dbxFirebaseCollectionStoreDirective.store);
|
|
3508
|
+
_trigger = dbxFirebaseCollectionChangeTriggerForWatcher(this._watcher, () => this.restart());
|
|
3509
|
+
mode$ = this._watcher.mode$;
|
|
3510
|
+
event$ = this._watcher.event$;
|
|
3511
|
+
hasChangeAvailable$ = this._watcher.hasChangeAvailable$;
|
|
3512
|
+
triggered$ = this._watcher.triggered$;
|
|
3513
|
+
trigger$ = this._watcher.trigger$;
|
|
3555
3514
|
get store() {
|
|
3556
3515
|
return this._watcher.store;
|
|
3557
3516
|
}
|
|
3558
|
-
constructor(dbxFirebaseCollectionStoreDirective) {
|
|
3559
|
-
this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
|
|
3560
|
-
this._watcher = dbxFirebaseCollectionChangeWatcher(this.dbxFirebaseCollectionStoreDirective.store);
|
|
3561
|
-
this._trigger = dbxFirebaseCollectionChangeTriggerForWatcher(this._watcher, () => this.restart());
|
|
3562
|
-
this.mode$ = this._watcher.mode$;
|
|
3563
|
-
this.event$ = this._watcher.event$;
|
|
3564
|
-
this.hasChangeAvailable$ = this._watcher.hasChangeAvailable$;
|
|
3565
|
-
this.triggered$ = this._watcher.triggered$;
|
|
3566
|
-
this.trigger$ = this._watcher.trigger$;
|
|
3567
|
-
}
|
|
3568
3517
|
ngOnInit() {
|
|
3569
3518
|
this._trigger.init();
|
|
3570
3519
|
}
|
|
@@ -3572,24 +3521,21 @@ class DbxFirebaseCollectionChangeDirective {
|
|
|
3572
3521
|
this._watcher.destroy();
|
|
3573
3522
|
this._trigger.destroy();
|
|
3574
3523
|
}
|
|
3575
|
-
get mode() {
|
|
3576
|
-
return this._watcher.mode;
|
|
3577
|
-
}
|
|
3578
3524
|
set mode(mode) {
|
|
3579
|
-
this._watcher.mode
|
|
3525
|
+
this._watcher.setMode(mode || 'off');
|
|
3580
3526
|
}
|
|
3581
3527
|
restart() {
|
|
3582
3528
|
this.dbxFirebaseCollectionStoreDirective.store.restart();
|
|
3583
3529
|
}
|
|
3584
|
-
static
|
|
3585
|
-
static
|
|
3530
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionChangeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3531
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseCollectionChangeDirective, selector: "[dbxFirebaseCollectionChange]", inputs: { mode: ["dbxFirebaseCollectionChange", "mode"] }, ngImport: i0 });
|
|
3586
3532
|
}
|
|
3587
3533
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionChangeDirective, decorators: [{
|
|
3588
3534
|
type: Directive,
|
|
3589
3535
|
args: [{
|
|
3590
3536
|
selector: '[dbxFirebaseCollectionChange]'
|
|
3591
3537
|
}]
|
|
3592
|
-
}],
|
|
3538
|
+
}], propDecorators: { mode: [{
|
|
3593
3539
|
type: Input,
|
|
3594
3540
|
args: ['dbxFirebaseCollectionChange']
|
|
3595
3541
|
}] } });
|
|
@@ -3600,28 +3546,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3600
3546
|
* Can specify which changes to appear on.
|
|
3601
3547
|
*/
|
|
3602
3548
|
class DbxFirebaseCollectionHasChangeDirective extends AbstractIfDirective {
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
show = event.type === mode;
|
|
3619
|
-
break;
|
|
3620
|
-
}
|
|
3549
|
+
_mode = new BehaviorSubject('addedAndRemoved');
|
|
3550
|
+
directive = inject(DbxFirebaseCollectionChangeDirective);
|
|
3551
|
+
show$ = combineLatest([this._mode, this.directive.event$]).pipe(map(([mode, event]) => {
|
|
3552
|
+
let show = false;
|
|
3553
|
+
if (event.type !== 'none') {
|
|
3554
|
+
switch (mode) {
|
|
3555
|
+
case 'all':
|
|
3556
|
+
show = true;
|
|
3557
|
+
break;
|
|
3558
|
+
case 'addedAndRemoved':
|
|
3559
|
+
show = event.type === 'addedAndRemoved' || event.type === 'added' || event.type === 'removed';
|
|
3560
|
+
break;
|
|
3561
|
+
default:
|
|
3562
|
+
show = event.type === mode;
|
|
3563
|
+
break;
|
|
3621
3564
|
}
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
}
|
|
3565
|
+
}
|
|
3566
|
+
return show;
|
|
3567
|
+
}), shareReplay(1));
|
|
3625
3568
|
get mode() {
|
|
3626
3569
|
return this._mode.value;
|
|
3627
3570
|
}
|
|
@@ -3632,15 +3575,15 @@ class DbxFirebaseCollectionHasChangeDirective extends AbstractIfDirective {
|
|
|
3632
3575
|
super.ngOnDestroy();
|
|
3633
3576
|
this._mode.complete();
|
|
3634
3577
|
}
|
|
3635
|
-
static
|
|
3636
|
-
static
|
|
3578
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionHasChangeDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3579
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseCollectionHasChangeDirective, selector: "[dbxFirebaseCollectionHasChange]", inputs: { mode: ["dbxFirebaseCollectionHasChange", "mode"] }, usesInheritance: true, ngImport: i0 });
|
|
3637
3580
|
}
|
|
3638
3581
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionHasChangeDirective, decorators: [{
|
|
3639
3582
|
type: Directive,
|
|
3640
3583
|
args: [{
|
|
3641
3584
|
selector: '[dbxFirebaseCollectionHasChange]'
|
|
3642
3585
|
}]
|
|
3643
|
-
}],
|
|
3586
|
+
}], propDecorators: { mode: [{
|
|
3644
3587
|
type: Input,
|
|
3645
3588
|
args: ['dbxFirebaseCollectionHasChange']
|
|
3646
3589
|
}] } });
|
|
@@ -3649,10 +3592,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3649
3592
|
* Directive that connects a host DbxListView to a DbxFirebaseCollectionStoreDirective to pass data for rendering items from a collection and query parameters.
|
|
3650
3593
|
*/
|
|
3651
3594
|
class DbxFirebaseCollectionListDirective extends AbstractSubscriptionDirective {
|
|
3652
|
-
|
|
3595
|
+
dbxFirebaseCollectionStoreDirective = inject((DbxFirebaseCollectionStoreDirective));
|
|
3596
|
+
dbxListViewWrapper = inject((DbxListViewWrapper), { host: true });
|
|
3597
|
+
constructor() {
|
|
3653
3598
|
super();
|
|
3654
|
-
this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
|
|
3655
|
-
this.dbxListViewWrapper = dbxListViewWrapper;
|
|
3656
3599
|
this.dbxListViewWrapper.state$ = this.dbxFirebaseCollectionStoreDirective.pageLoadingState$;
|
|
3657
3600
|
}
|
|
3658
3601
|
ngOnInit() {
|
|
@@ -3660,17 +3603,15 @@ class DbxFirebaseCollectionListDirective extends AbstractSubscriptionDirective {
|
|
|
3660
3603
|
this.dbxFirebaseCollectionStoreDirective.next();
|
|
3661
3604
|
});
|
|
3662
3605
|
}
|
|
3663
|
-
static
|
|
3664
|
-
static
|
|
3606
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3607
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseCollectionListDirective, selector: "[dbxFirebaseCollectionList]", usesInheritance: true, ngImport: i0 });
|
|
3665
3608
|
}
|
|
3666
3609
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionListDirective, decorators: [{
|
|
3667
3610
|
type: Directive,
|
|
3668
3611
|
args: [{
|
|
3669
3612
|
selector: '[dbxFirebaseCollectionList]'
|
|
3670
3613
|
}]
|
|
3671
|
-
}], ctorParameters: function () { return [
|
|
3672
|
-
type: Host
|
|
3673
|
-
}] }]; } });
|
|
3614
|
+
}], ctorParameters: function () { return []; } });
|
|
3674
3615
|
|
|
3675
3616
|
/**
|
|
3676
3617
|
* Utility directive for a host DbxFirebaseDocumentStoreDirective that sets the document's ID to match the ID of the current user.
|
|
@@ -3678,104 +3619,92 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3678
3619
|
* This is useful for cases where each document is keyed by the user (I.E. implements UserRelatedById).
|
|
3679
3620
|
*/
|
|
3680
3621
|
class DbxFirebaseDocumentAuthIdDirective extends AbstractSubscriptionDirective {
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
this.dbxFirebaseAuthService = dbxFirebaseAuthService;
|
|
3684
|
-
this.dbxFirebaseDocumentStoreDirective = dbxFirebaseDocumentStoreDirective;
|
|
3685
|
-
}
|
|
3622
|
+
dbxFirebaseAuthService = inject(DbxFirebaseAuthService);
|
|
3623
|
+
dbxFirebaseDocumentStoreDirective = inject((DbxFirebaseDocumentStoreDirective), { host: true });
|
|
3686
3624
|
ngOnInit() {
|
|
3687
3625
|
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.dbxFirebaseAuthService.userIdentifier$);
|
|
3688
3626
|
}
|
|
3689
|
-
static
|
|
3690
|
-
static
|
|
3627
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDocumentAuthIdDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3628
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDocumentAuthIdDirective, selector: "[dbxFirebaseDocumentAuthId]", usesInheritance: true, ngImport: i0 });
|
|
3691
3629
|
}
|
|
3692
3630
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDocumentAuthIdDirective, decorators: [{
|
|
3693
3631
|
type: Directive,
|
|
3694
3632
|
args: [{
|
|
3695
3633
|
selector: '[dbxFirebaseDocumentAuthId]'
|
|
3696
3634
|
}]
|
|
3697
|
-
}]
|
|
3698
|
-
type: Host
|
|
3699
|
-
}] }]; } });
|
|
3635
|
+
}] });
|
|
3700
3636
|
|
|
3701
3637
|
const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY = 'id';
|
|
3702
3638
|
const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_KEY_PARAM_KEY = 'key';
|
|
3703
3639
|
const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE = '0';
|
|
3704
|
-
/**
|
|
3705
|
-
* DbxFirebaseIdRouteParamRedirect instance
|
|
3706
|
-
*/
|
|
3707
|
-
class DbxFirebaseIdRouteParamRedirectInstance {
|
|
3708
|
-
constructor(dbxRouterService, defaultParamKey = DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY) {
|
|
3709
|
-
this.dbxRouterService = dbxRouterService;
|
|
3710
|
-
this.defaultParamKey = defaultParamKey;
|
|
3711
|
-
this._paramReader = new DbxRouteParamReaderInstance(this.dbxRouterService, this.defaultParamKey);
|
|
3712
|
-
this._paramRedirect = new DbxRouteParamDefaultRedirectInstance(this._paramReader);
|
|
3713
|
-
this._useDefaultParamDecider = new BehaviorSubject(DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE);
|
|
3714
|
-
this._useDefaultParam$ = this._useDefaultParamDecider.pipe(map((x) => {
|
|
3715
|
-
let result;
|
|
3716
|
-
if (typeof x === 'string') {
|
|
3717
|
-
result = (value) => of(value === x);
|
|
3718
|
-
}
|
|
3719
|
-
else {
|
|
3720
|
-
result = x;
|
|
3721
|
-
}
|
|
3722
|
-
return result;
|
|
3723
|
-
}), shareReplay(1));
|
|
3724
|
-
this.paramValue$ = this._paramReader.paramValue$;
|
|
3725
|
-
this.defaultValue$ = this._paramReader.defaultValue$;
|
|
3726
|
-
this.value$ = this._paramReader.value$;
|
|
3727
|
-
this.idFromParams$ = this.paramValue$;
|
|
3728
|
-
this.id$ = this.value$;
|
|
3729
|
-
}
|
|
3730
|
-
init() {
|
|
3731
|
-
this._paramRedirect.setUseDefaultFilter((value) => {
|
|
3732
|
-
return this._useDefaultParam$.pipe(switchMap((x) => x(value)));
|
|
3733
|
-
});
|
|
3734
|
-
this._paramRedirect.init();
|
|
3735
|
-
}
|
|
3736
|
-
destroy() {
|
|
3737
|
-
this._paramReader.destroy();
|
|
3738
|
-
this._paramRedirect.destroy();
|
|
3739
|
-
this._useDefaultParamDecider.complete();
|
|
3740
|
-
}
|
|
3741
|
-
get paramKey() {
|
|
3742
|
-
return this._paramReader.paramKey;
|
|
3743
|
-
}
|
|
3744
|
-
set paramKey(paramKey) {
|
|
3745
|
-
this._paramReader.paramKey = paramKey || this.defaultParamKey;
|
|
3746
|
-
}
|
|
3747
|
-
setDefaultValue(defaultValue) {
|
|
3748
|
-
this._paramReader.setDefaultValue(defaultValue);
|
|
3749
|
-
}
|
|
3750
|
-
setRedirectEnabled(redirect) {
|
|
3751
|
-
this._paramRedirect.enabled = redirect !== false;
|
|
3752
|
-
}
|
|
3753
|
-
setDecider(decider) {
|
|
3754
|
-
this._useDefaultParamDecider.next(decider);
|
|
3755
|
-
}
|
|
3756
|
-
setParamValue(value) {
|
|
3757
|
-
this._paramReader.setParamValue(value);
|
|
3758
|
-
}
|
|
3759
|
-
}
|
|
3760
|
-
function dbxFirebaseIdRouteParamRedirect(dbxRouterService, defaultParamKey) {
|
|
3761
|
-
return new DbxFirebaseIdRouteParamRedirectInstance(dbxRouterService, defaultParamKey);
|
|
3762
|
-
}
|
|
3763
3640
|
function dbxFirebaseKeyRouteParamRedirect(dbxRouterService, defaultParamKey = DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_KEY_PARAM_KEY) {
|
|
3764
|
-
return
|
|
3641
|
+
return dbxFirebaseIdRouteParamRedirect(dbxRouterService, defaultParamKey);
|
|
3642
|
+
}
|
|
3643
|
+
function dbxFirebaseIdRouteParamRedirect(dbxRouterService, defaultParamKey = DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY) {
|
|
3644
|
+
const _paramReader = dbxRouteParamReaderInstance(dbxRouterService, defaultParamKey);
|
|
3645
|
+
const _paramRedirect = new DbxRouteParamDefaultRedirectInstance(_paramReader);
|
|
3646
|
+
const _useDefaultParamDecider = new BehaviorSubject(DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE);
|
|
3647
|
+
const _useDefaultParam$ = _useDefaultParamDecider.pipe(map((x) => {
|
|
3648
|
+
let result;
|
|
3649
|
+
if (typeof x === 'string') {
|
|
3650
|
+
result = (value) => of(value === x);
|
|
3651
|
+
}
|
|
3652
|
+
else {
|
|
3653
|
+
result = x;
|
|
3654
|
+
}
|
|
3655
|
+
return result;
|
|
3656
|
+
}), shareReplay(1));
|
|
3657
|
+
const setParamKey = (paramKey) => {
|
|
3658
|
+
_paramReader.setParamKey(paramKey || defaultParamKey);
|
|
3659
|
+
};
|
|
3660
|
+
const paramValue$ = _paramReader.paramValue$;
|
|
3661
|
+
const value$ = _paramReader.value$;
|
|
3662
|
+
const result = {
|
|
3663
|
+
paramValue$,
|
|
3664
|
+
defaultValue$: _paramReader.defaultValue$,
|
|
3665
|
+
value$,
|
|
3666
|
+
idFromParams$: paramValue$,
|
|
3667
|
+
id$: value$,
|
|
3668
|
+
init() {
|
|
3669
|
+
_paramRedirect.setUseDefaultFilter((value) => {
|
|
3670
|
+
return _useDefaultParam$.pipe(switchMap((x) => x(value)));
|
|
3671
|
+
});
|
|
3672
|
+
_paramRedirect.init();
|
|
3673
|
+
},
|
|
3674
|
+
destroy() {
|
|
3675
|
+
_paramReader.destroy();
|
|
3676
|
+
_paramRedirect.destroy();
|
|
3677
|
+
_useDefaultParamDecider.complete();
|
|
3678
|
+
},
|
|
3679
|
+
getParamKey() {
|
|
3680
|
+
return _paramReader.getParamKey();
|
|
3681
|
+
},
|
|
3682
|
+
setParamKey,
|
|
3683
|
+
setDefaultValue(defaultValue) {
|
|
3684
|
+
_paramReader.setDefaultValue(defaultValue);
|
|
3685
|
+
},
|
|
3686
|
+
setRedirectEnabled(redirect) {
|
|
3687
|
+
_paramRedirect.enabled = redirect !== false;
|
|
3688
|
+
},
|
|
3689
|
+
setDecider(decider) {
|
|
3690
|
+
_useDefaultParamDecider.next(decider);
|
|
3691
|
+
},
|
|
3692
|
+
setParamValue(value) {
|
|
3693
|
+
_paramReader.setParamValue(value);
|
|
3694
|
+
}
|
|
3695
|
+
};
|
|
3696
|
+
return result;
|
|
3765
3697
|
}
|
|
3766
3698
|
|
|
3767
3699
|
/**
|
|
3768
3700
|
* Used for synchronizing the document store id to the param of the route.
|
|
3769
3701
|
*/
|
|
3770
3702
|
class DbxFirebaseDocumentStoreRouteIdDirective extends AbstractSubscriptionDirective {
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
this.idFromParams$ = this._redirectInstance.paramValue$;
|
|
3777
|
-
this.id$ = this._redirectInstance.value$;
|
|
3778
|
-
}
|
|
3703
|
+
dbxFirebaseDocumentStoreDirective = inject((DbxFirebaseDocumentStoreDirective), { host: true });
|
|
3704
|
+
dbxRouterService = inject(DbxRouterService);
|
|
3705
|
+
_redirectInstance = dbxFirebaseIdRouteParamRedirect(this.dbxRouterService);
|
|
3706
|
+
idFromParams$ = this._redirectInstance.paramValue$;
|
|
3707
|
+
id$ = this._redirectInstance.value$;
|
|
3779
3708
|
ngOnInit() {
|
|
3780
3709
|
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.idFromParams$); // use from the params, as the params should get updated eventually to the id$ value
|
|
3781
3710
|
this._redirectInstance.init();
|
|
@@ -3786,10 +3715,10 @@ class DbxFirebaseDocumentStoreRouteIdDirective extends AbstractSubscriptionDirec
|
|
|
3786
3715
|
}
|
|
3787
3716
|
// MARK: Input
|
|
3788
3717
|
get idParam() {
|
|
3789
|
-
return this._redirectInstance.
|
|
3718
|
+
return this._redirectInstance.getParamKey();
|
|
3790
3719
|
}
|
|
3791
3720
|
set idParam(idParam) {
|
|
3792
|
-
this._redirectInstance.
|
|
3721
|
+
this._redirectInstance.setParamKey(idParam);
|
|
3793
3722
|
}
|
|
3794
3723
|
set dbxFirebaseDocumentStoreRouteIdDefault(defaultValue) {
|
|
3795
3724
|
this._redirectInstance.setDefaultValue(defaultValue);
|
|
@@ -3803,17 +3732,15 @@ class DbxFirebaseDocumentStoreRouteIdDirective extends AbstractSubscriptionDirec
|
|
|
3803
3732
|
set dbxFirebaseDocumentStoreRouteIdDefaultDecision(decider) {
|
|
3804
3733
|
this._redirectInstance.setDecider(decider);
|
|
3805
3734
|
}
|
|
3806
|
-
static
|
|
3807
|
-
static
|
|
3735
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDocumentStoreRouteIdDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3736
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDocumentStoreRouteIdDirective, selector: "[dbxFirebaseDocumentStoreRouteId]", inputs: { idParam: ["dbxFirebaseDocumentStoreRouteId", "idParam"], dbxFirebaseDocumentStoreRouteIdDefault: "dbxFirebaseDocumentStoreRouteIdDefault", dbxFirebaseDocumentStoreRouteIdDefaultRedirect: "dbxFirebaseDocumentStoreRouteIdDefaultRedirect", dbxFirebaseDocumentStoreRouteIdDefaultDecision: "dbxFirebaseDocumentStoreRouteIdDefaultDecision" }, usesInheritance: true, ngImport: i0 });
|
|
3808
3737
|
}
|
|
3809
3738
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDocumentStoreRouteIdDirective, decorators: [{
|
|
3810
3739
|
type: Directive,
|
|
3811
3740
|
args: [{
|
|
3812
3741
|
selector: '[dbxFirebaseDocumentStoreRouteId]'
|
|
3813
3742
|
}]
|
|
3814
|
-
}],
|
|
3815
|
-
type: Host
|
|
3816
|
-
}] }, { type: i2$2.DbxRouterService }]; }, propDecorators: { idParam: [{
|
|
3743
|
+
}], propDecorators: { idParam: [{
|
|
3817
3744
|
type: Input,
|
|
3818
3745
|
args: ['dbxFirebaseDocumentStoreRouteId']
|
|
3819
3746
|
}], dbxFirebaseDocumentStoreRouteIdDefault: [{
|
|
@@ -3828,14 +3755,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3828
3755
|
* Used for synchronizing the document store key to the param of the route. The param is interpreted as a TwoWayFlatFirestoreModelKey.
|
|
3829
3756
|
*/
|
|
3830
3757
|
class DbxFirebaseDocumentStoreRouteKeyDirective extends AbstractSubscriptionDirective {
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
this.keyFromParams$ = this._redirectInstance.paramValue$;
|
|
3837
|
-
this.key$ = this._redirectInstance.value$;
|
|
3838
|
-
}
|
|
3758
|
+
dbxFirebaseDocumentStoreDirective = inject((DbxFirebaseDocumentStoreDirective), { host: true });
|
|
3759
|
+
dbxRouterService = inject(DbxRouterService);
|
|
3760
|
+
_redirectInstance = dbxFirebaseKeyRouteParamRedirect(this.dbxRouterService);
|
|
3761
|
+
keyFromParams$ = this._redirectInstance.paramValue$;
|
|
3762
|
+
key$ = this._redirectInstance.value$;
|
|
3839
3763
|
ngOnInit() {
|
|
3840
3764
|
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setFlatKey(this.keyFromParams$); // use from the params, as the params should get updated eventually to the key$ value
|
|
3841
3765
|
this._redirectInstance.init();
|
|
@@ -3846,10 +3770,10 @@ class DbxFirebaseDocumentStoreRouteKeyDirective extends AbstractSubscriptionDire
|
|
|
3846
3770
|
}
|
|
3847
3771
|
// MARK: Input
|
|
3848
3772
|
get keyParam() {
|
|
3849
|
-
return this._redirectInstance.
|
|
3773
|
+
return this._redirectInstance.getParamKey();
|
|
3850
3774
|
}
|
|
3851
|
-
set keyParam(
|
|
3852
|
-
this._redirectInstance.
|
|
3775
|
+
set keyParam(idParam) {
|
|
3776
|
+
this._redirectInstance.setParamKey(idParam);
|
|
3853
3777
|
}
|
|
3854
3778
|
set dbxFirebaseDocumentStoreRouteKeyDefault(defaultValue) {
|
|
3855
3779
|
this._redirectInstance.setDefaultValue(defaultValue);
|
|
@@ -3863,17 +3787,15 @@ class DbxFirebaseDocumentStoreRouteKeyDirective extends AbstractSubscriptionDire
|
|
|
3863
3787
|
set dbxFirebaseDocumentStoreRouteKeyDefaultDecision(decider) {
|
|
3864
3788
|
this._redirectInstance.setDecider(decider);
|
|
3865
3789
|
}
|
|
3866
|
-
static
|
|
3867
|
-
static
|
|
3790
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDocumentStoreRouteKeyDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3791
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseDocumentStoreRouteKeyDirective, selector: "[dbxFirebaseDocumentStoreRouteKey]", inputs: { keyParam: ["dbxFirebaseDocumentStoreRouteKey", "keyParam"], dbxFirebaseDocumentStoreRouteKeyDefault: "dbxFirebaseDocumentStoreRouteKeyDefault", dbxFirebaseDocumentStoreRouteKeyDefaultRedirect: "dbxFirebaseDocumentStoreRouteKeyDefaultRedirect", dbxFirebaseDocumentStoreRouteKeyDefaultDecision: "dbxFirebaseDocumentStoreRouteKeyDefaultDecision" }, usesInheritance: true, ngImport: i0 });
|
|
3868
3792
|
}
|
|
3869
3793
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseDocumentStoreRouteKeyDirective, decorators: [{
|
|
3870
3794
|
type: Directive,
|
|
3871
3795
|
args: [{
|
|
3872
3796
|
selector: '[dbxFirebaseDocumentStoreRouteKey]'
|
|
3873
3797
|
}]
|
|
3874
|
-
}],
|
|
3875
|
-
type: Host
|
|
3876
|
-
}] }, { type: i2$2.DbxRouterService }]; }, propDecorators: { keyParam: [{
|
|
3798
|
+
}], propDecorators: { keyParam: [{
|
|
3877
3799
|
type: Input,
|
|
3878
3800
|
args: ['dbxFirebaseDocumentStoreRouteKey']
|
|
3879
3801
|
}], dbxFirebaseDocumentStoreRouteKeyDefault: [{
|
|
@@ -3886,9 +3808,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3886
3808
|
|
|
3887
3809
|
const declarations$1 = [DbxFirebaseDocumentStoreRouteKeyDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective];
|
|
3888
3810
|
class DbxFirebaseModelStoreModule {
|
|
3889
|
-
static
|
|
3890
|
-
static
|
|
3891
|
-
static
|
|
3811
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3812
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelStoreModule, declarations: [DbxFirebaseDocumentStoreRouteKeyDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective], exports: [DbxFirebaseDocumentStoreRouteKeyDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective] });
|
|
3813
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelStoreModule });
|
|
3892
3814
|
}
|
|
3893
3815
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelStoreModule, decorators: [{
|
|
3894
3816
|
type: NgModule,
|
|
@@ -3900,45 +3822,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3900
3822
|
}] });
|
|
3901
3823
|
|
|
3902
3824
|
class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
this.allDocumentData$ = this.loader$.pipe(switchMap((x) => x.allDocumentData$));
|
|
3940
|
-
this.setFirestoreCollection = this.updater((state, firestoreCollection) => ({ ...state, firestoreCollection }));
|
|
3941
|
-
}
|
|
3825
|
+
// MARK: Effects
|
|
3826
|
+
setMaxPages = this.effect((input) => {
|
|
3827
|
+
return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => (x.maxPages = maxPages)))));
|
|
3828
|
+
});
|
|
3829
|
+
setItemsPerPage = this.effect((input) => {
|
|
3830
|
+
return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => (x.itemsPerPage = itemsPerPage)))));
|
|
3831
|
+
});
|
|
3832
|
+
setConstraints = this.effect((input) => {
|
|
3833
|
+
return input.pipe(switchMap((constraints) => this.loader$.pipe(tap((x) => x.setConstraints(constraints)))));
|
|
3834
|
+
});
|
|
3835
|
+
next = this.effect((input) => {
|
|
3836
|
+
return input.pipe(exhaustMap(() => this.loader$.pipe(first(), tap((x) => x.next()))));
|
|
3837
|
+
});
|
|
3838
|
+
restart = this.effect((input) => {
|
|
3839
|
+
return input.pipe(exhaustMap(() => this.loader$.pipe(first(), tap((x) => x.restart()))));
|
|
3840
|
+
});
|
|
3841
|
+
// MARK: Accessors
|
|
3842
|
+
currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
|
|
3843
|
+
firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
|
|
3844
|
+
loader$ = this.currentFirestoreCollection$.pipe(switchMap((collection) => this.state$.pipe(first(), map((x) => dbxFirebaseCollectionLoaderInstance({
|
|
3845
|
+
collection,
|
|
3846
|
+
maxPages: x.maxPages,
|
|
3847
|
+
itemsPerPage: x.itemsPerPage,
|
|
3848
|
+
constraints: x.constraints
|
|
3849
|
+
})))), cleanupDestroyable(), distinctUntilChanged(), shareReplay(1));
|
|
3850
|
+
constraints$ = this.loader$.pipe(switchMap((x) => x.constraints$));
|
|
3851
|
+
firestoreIteration$ = this.loader$.pipe(switchMap((x) => x.firestoreIteration$));
|
|
3852
|
+
queryChangeWatcher$ = this.loader$.pipe(switchMap((x) => x.queryChangeWatcher$));
|
|
3853
|
+
pageLoadingState$ = this.loader$.pipe(switchMap((x) => x.pageLoadingState$));
|
|
3854
|
+
snapshotAccumulator$ = this.loader$.pipe(switchMap((x) => x.snapshotAccumulator$));
|
|
3855
|
+
accumulator$ = this.loader$.pipe(switchMap((x) => x.accumulator$));
|
|
3856
|
+
hasDocuments$ = this.loader$.pipe(switchMap((x) => x.hasDocuments$));
|
|
3857
|
+
allDocumentRefs$ = this.loader$.pipe(switchMap((x) => x.allDocumentRefs$));
|
|
3858
|
+
allDocuments$ = this.loader$.pipe(switchMap((x) => x.allDocuments$));
|
|
3859
|
+
allDocumentData$ = this.loader$.pipe(switchMap((x) => x.allDocumentData$));
|
|
3860
|
+
setFirestoreCollection = this.updater((state, firestoreCollection) => ({ ...state, firestoreCollection }));
|
|
3942
3861
|
loadToPage(page) {
|
|
3943
3862
|
return this.loader$.pipe(switchMap((x) => x.loadToPage(page)));
|
|
3944
3863
|
}
|
|
@@ -3948,8 +3867,8 @@ class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
|
|
|
3948
3867
|
loadAllResults() {
|
|
3949
3868
|
return this.loader$.pipe(switchMap((x) => x.loadAllResults()));
|
|
3950
3869
|
}
|
|
3951
|
-
static
|
|
3952
|
-
static
|
|
3870
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseCollectionStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
3871
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseCollectionStore });
|
|
3953
3872
|
}
|
|
3954
3873
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseCollectionStore, decorators: [{
|
|
3955
3874
|
type: Injectable
|
|
@@ -3961,101 +3880,98 @@ function modelDoesNotExistError() {
|
|
|
3961
3880
|
}
|
|
3962
3881
|
|
|
3963
3882
|
class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
if (
|
|
4016
|
-
|
|
4017
|
-
if (data) {
|
|
4018
|
-
result = successResult(data);
|
|
4019
|
-
}
|
|
4020
|
-
else {
|
|
4021
|
-
result = errorResult(modelDoesNotExistError());
|
|
4022
|
-
}
|
|
4023
|
-
}
|
|
4024
|
-
else {
|
|
4025
|
-
result = {
|
|
4026
|
-
...x,
|
|
4027
|
-
value: undefined
|
|
4028
|
-
};
|
|
4029
|
-
}
|
|
4030
|
-
return result;
|
|
4031
|
-
}), shareReplay(1));
|
|
4032
|
-
this.isLoadingData$ = this.dataLoadingState$.pipe(map(loadingStateIsLoading), distinctUntilChanged(), shareReplay(1));
|
|
4033
|
-
/**
|
|
4034
|
-
* Returns false while hasRef$ is false, and then returns exists$.
|
|
4035
|
-
*/
|
|
4036
|
-
this.currentExists$ = this.hasRef$.pipe(switchMap((hasRef) => {
|
|
4037
|
-
if (hasRef) {
|
|
4038
|
-
return this.exists$;
|
|
3883
|
+
// MARK: Effects
|
|
3884
|
+
// MARK: Accessors
|
|
3885
|
+
currentFirestoreCollectionLike$ = this.state$.pipe(map((x) => x.firestoreCollection ?? x.firestoreCollectionLike), distinctUntilChanged(), shareReplay(1));
|
|
3886
|
+
currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
|
|
3887
|
+
firestoreCollectionLike$ = this.currentFirestoreCollectionLike$.pipe(filterMaybe());
|
|
3888
|
+
firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
|
|
3889
|
+
currentInputId$ = this.state$.pipe(map((x) => x.id), distinctUntilChanged(), shareReplay(1));
|
|
3890
|
+
inputId$ = this.currentInputId$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
3891
|
+
currentInputKey$ = this.state$.pipe(map((x) => x.key), distinctUntilChanged(), shareReplay(1));
|
|
3892
|
+
inputKey$ = this.currentInputKey$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
3893
|
+
currentInputRef$ = this.state$.pipe(map((x) => x.ref), distinctUntilChanged(), shareReplay(1));
|
|
3894
|
+
inputRef$ = this.currentInputRef$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
3895
|
+
streamMode$ = this.state$.pipe(map((x) => x.streamMode ?? FirestoreAccessorStreamMode.STREAM), distinctUntilChanged(), shareReplay(1));
|
|
3896
|
+
currentDocument$ = combineLatest([this.currentInputId$, this.currentInputKey$, this.currentInputRef$]).pipe(switchMap(([id, key, ref]) => {
|
|
3897
|
+
let document;
|
|
3898
|
+
if (ref) {
|
|
3899
|
+
document = this.firestoreCollectionLike$.pipe(map((x) => x.documentAccessor().loadDocument(ref)));
|
|
3900
|
+
}
|
|
3901
|
+
else if (key) {
|
|
3902
|
+
document = this.firestoreCollectionLike$.pipe(map((x) => x.documentAccessor().loadDocumentForKey(key)));
|
|
3903
|
+
}
|
|
3904
|
+
else if (id) {
|
|
3905
|
+
document = this.firestoreCollection$.pipe(map((x) => x.documentAccessor().loadDocumentForId(id)));
|
|
3906
|
+
}
|
|
3907
|
+
else {
|
|
3908
|
+
document = of(undefined);
|
|
3909
|
+
}
|
|
3910
|
+
return document;
|
|
3911
|
+
}), distinctUntilChanged(), shareReplay(1));
|
|
3912
|
+
/**
|
|
3913
|
+
* Whether or not an id/ref/key has been input and currentDocument is not null.
|
|
3914
|
+
*/
|
|
3915
|
+
hasRef$ = this.currentDocument$.pipe(map((x) => x?.documentRef != null), distinctUntilChanged(), shareReplay(1));
|
|
3916
|
+
document$ = this.currentDocument$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
3917
|
+
documentLoadingState$ = this.currentDocument$.pipe(map((x) => (x ? successResult(x) : beginLoading())), shareReplay(1));
|
|
3918
|
+
id$ = this.document$.pipe(map((x) => x.id), shareReplay(1));
|
|
3919
|
+
key$ = this.document$.pipe(map((x) => x.key), shareReplay(1));
|
|
3920
|
+
keyModelIds$ = this.key$.pipe(map(firestoreModelIdsFromKey), shareReplay(1));
|
|
3921
|
+
keyPairs$ = this.key$.pipe(map(firestoreModelKeyPartPairs), filterMaybe(), shareReplay(1));
|
|
3922
|
+
keyPairObject$ = this.key$.pipe(map(firestoreModelKeyPairObject), filterMaybe(), shareReplay(1));
|
|
3923
|
+
ref$ = this.document$.pipe(map((x) => x.documentRef), shareReplay(1));
|
|
3924
|
+
flatKey$ = this.key$.pipe(map((x) => flatFirestoreModelKey(x)), shareReplay(1));
|
|
3925
|
+
twoWayFlatKey$ = this.key$.pipe(map((x) => twoWayFlatFirestoreModelKey(x)), shareReplay(1));
|
|
3926
|
+
snapshot$ = combineLatest([this.document$, this.streamMode$]).pipe(switchMap(([x, mode]) => x.snapshotStream(mode)), shareReplay(1));
|
|
3927
|
+
snapshotLoadingState$ = this.currentDocument$.pipe(switchMap(() => loadingStateFromObs(this.snapshot$)), shareReplay(1));
|
|
3928
|
+
currentData$ = this.snapshot$.pipe(map((x) => documentDataWithIdAndKey(x)), shareReplay(1));
|
|
3929
|
+
data$ = this.currentDocument$.pipe(switchMap(() => this.currentData$.pipe(filterMaybe())), shareReplay(1));
|
|
3930
|
+
dataLoadingState$ = this.snapshotLoadingState$.pipe(map((x) => {
|
|
3931
|
+
let result;
|
|
3932
|
+
if (x.value) {
|
|
3933
|
+
const data = documentDataWithIdAndKey(x.value);
|
|
3934
|
+
if (data) {
|
|
3935
|
+
result = successResult(data);
|
|
4039
3936
|
}
|
|
4040
3937
|
else {
|
|
4041
|
-
|
|
3938
|
+
result = errorResult(modelDoesNotExistError());
|
|
4042
3939
|
}
|
|
4043
|
-
}
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
3940
|
+
}
|
|
3941
|
+
else {
|
|
3942
|
+
result = {
|
|
3943
|
+
...x,
|
|
3944
|
+
value: undefined
|
|
3945
|
+
};
|
|
3946
|
+
}
|
|
3947
|
+
return result;
|
|
3948
|
+
}), shareReplay(1));
|
|
3949
|
+
isLoadingData$ = this.dataLoadingState$.pipe(map(isLoadingStateLoading), distinctUntilChanged(), shareReplay(1));
|
|
3950
|
+
/**
|
|
3951
|
+
* Returns false while hasRef$ is false, and then returns exists$.
|
|
3952
|
+
*/
|
|
3953
|
+
currentExists$ = this.hasRef$.pipe(switchMap((hasRef) => {
|
|
3954
|
+
if (hasRef) {
|
|
3955
|
+
return this.exists$;
|
|
3956
|
+
}
|
|
3957
|
+
else {
|
|
3958
|
+
return of(false);
|
|
3959
|
+
}
|
|
3960
|
+
}), shareReplay(1));
|
|
3961
|
+
exists$ = this.currentData$.pipe(map((x) => isMaybeSo(x)), shareReplay(1));
|
|
3962
|
+
doesNotExist$ = this.exists$.pipe(map((x) => !x), shareReplay(1));
|
|
3963
|
+
modelIdentity$ = this.document$.pipe(map((x) => x.modelIdentity), shareReplay(1));
|
|
3964
|
+
// MARK: State Changes
|
|
3965
|
+
setId = this.updater((state, id) => (id ? { ...state, id, key: undefined, ref: undefined } : { ...state, id }));
|
|
3966
|
+
setKey = this.updater((state, key) => (key ? { ...state, key, id: undefined, ref: undefined } : { ...state, key }));
|
|
3967
|
+
setFlatKey = this.updater((state, key) => (key ? { ...state, key: inferKeyFromTwoWayFlatFirestoreModelKey(key), id: undefined, ref: undefined } : { ...state, key }));
|
|
3968
|
+
setRef = this.updater((state, ref) => (ref ? { ...state, key: undefined, id: undefined, ref } : { ...state, ref }));
|
|
3969
|
+
setStreamMode = this.updater((state, streamMode) => ({ ...state, streamMode }));
|
|
3970
|
+
clearRefs = this.updater((state) => ({ ...state, id: undefined, key: undefined, ref: undefined }));
|
|
3971
|
+
setFirestoreCollection = this.updater((state, firestoreCollection) => ({ ...state, firestoreCollection }));
|
|
3972
|
+
setFirestoreCollectionLike = this.updater((state, firestoreCollectionLike) => ({ ...state, firestoreCollectionLike }));
|
|
3973
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseDocumentStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
3974
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseDocumentStore });
|
|
4059
3975
|
}
|
|
4060
3976
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseDocumentStore, decorators: [{
|
|
4061
3977
|
type: Injectable
|
|
@@ -4075,43 +3991,43 @@ function injectSingleItemIdIntoState(state) {
|
|
|
4075
3991
|
let AbstractRootSingleItemDbxFirebaseDocument = class AbstractRootSingleItemDbxFirebaseDocument extends AbstractDbxFirebaseDocumentStore {
|
|
4076
3992
|
constructor(initialState) {
|
|
4077
3993
|
super(injectSingleItemIdIntoState(initialState));
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
}
|
|
4087
|
-
else {
|
|
4088
|
-
throw new Error('AbstractRootSingleItemDbxFirebaseDocument only accepts RootSingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');
|
|
4089
|
-
}
|
|
3994
|
+
}
|
|
3995
|
+
/**
|
|
3996
|
+
* Sets the SingleItemFirestoreCollection to use.
|
|
3997
|
+
*/
|
|
3998
|
+
setFirestoreCollection = this.updater((state, firestoreCollection) => {
|
|
3999
|
+
if (firestoreCollection != null) {
|
|
4000
|
+
const id = firestoreCollection.singleItemIdentifier;
|
|
4001
|
+
if (id != null) {
|
|
4002
|
+
return { ...state, firestoreCollection, id };
|
|
4090
4003
|
}
|
|
4091
4004
|
else {
|
|
4092
|
-
|
|
4005
|
+
throw new Error('AbstractRootSingleItemDbxFirebaseDocument only accepts RootSingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');
|
|
4093
4006
|
}
|
|
4094
|
-
}
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4007
|
+
}
|
|
4008
|
+
else {
|
|
4009
|
+
return { ...state, firestoreCollection: null };
|
|
4010
|
+
}
|
|
4011
|
+
});
|
|
4012
|
+
/**
|
|
4013
|
+
* Does nothing on a AbstractRootSingleItemDbxFirebaseDocument.
|
|
4014
|
+
*
|
|
4015
|
+
* Ref is set with the FirestoreCollection
|
|
4016
|
+
*/
|
|
4017
|
+
setId = this.updater((state, id) => state);
|
|
4018
|
+
/**
|
|
4019
|
+
* Does nothing on a AbstractRootSingleItemDbxFirebaseDocument.
|
|
4020
|
+
*
|
|
4021
|
+
* Ref is set with the FirestoreCollection
|
|
4022
|
+
*/
|
|
4023
|
+
setKey = this.updater((state, key) => state);
|
|
4024
|
+
/**
|
|
4025
|
+
* Does nothing on a AbstractRootSingleItemDbxFirebaseDocument.
|
|
4026
|
+
*
|
|
4027
|
+
* Ref is set with the FirestoreCollection
|
|
4028
|
+
*/
|
|
4029
|
+
setRef = this.updater((state, ref) => state);
|
|
4030
|
+
clearRefs = this.updater((state) => state);
|
|
4115
4031
|
};
|
|
4116
4032
|
AbstractRootSingleItemDbxFirebaseDocument = __decorate([
|
|
4117
4033
|
__param(0, Inject(null)),
|
|
@@ -4223,58 +4139,58 @@ function setParentStoreEffect(store) {
|
|
|
4223
4139
|
class AbstractDbxFirebaseCollectionWithParentStore extends AbstractDbxFirebaseCollectionStore {
|
|
4224
4140
|
constructor(state, defaultSourceMode) {
|
|
4225
4141
|
super(state);
|
|
4226
|
-
// MARK: Effects
|
|
4227
|
-
this.setParentStore = setParentStoreEffect(this);
|
|
4228
|
-
this.setSourceMode = this.effect((input) => {
|
|
4229
|
-
return input.pipe(distinctUntilChanged(), switchMap((inputMode) => {
|
|
4230
|
-
const mode = inputMode?.toLowerCase() ?? 'parent'; // default to parent mode
|
|
4231
|
-
if (mode === 'group') {
|
|
4232
|
-
return this.currentCollectionGroup$.pipe(tap((collectionGroup) => {
|
|
4233
|
-
this.setFirestoreCollection(collectionGroup);
|
|
4234
|
-
}));
|
|
4235
|
-
}
|
|
4236
|
-
else {
|
|
4237
|
-
// parent document collection
|
|
4238
|
-
return this.currentParent$.pipe(switchMap((parent) => {
|
|
4239
|
-
if (parent) {
|
|
4240
|
-
return this.collectionFactory$.pipe(tap((collectionFactory) => {
|
|
4241
|
-
const collection = collectionFactory(parent);
|
|
4242
|
-
this.setFirestoreCollection(collection);
|
|
4243
|
-
}));
|
|
4244
|
-
}
|
|
4245
|
-
else {
|
|
4246
|
-
this.setFirestoreCollection(undefined);
|
|
4247
|
-
return NEVER;
|
|
4248
|
-
}
|
|
4249
|
-
}));
|
|
4250
|
-
}
|
|
4251
|
-
}));
|
|
4252
|
-
});
|
|
4253
|
-
// MARK: Accessors
|
|
4254
|
-
this.currentParent$ = this.state$.pipe(map((x) => x.parent), distinctUntilChanged(), shareReplay(1));
|
|
4255
|
-
this.parent$ = this.currentParent$.pipe(filterMaybe());
|
|
4256
|
-
this.currentCollectionFactory$ = this.state$.pipe(map((x) => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
|
|
4257
|
-
this.collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
|
|
4258
|
-
this.currentCollectionGroup$ = this.state$.pipe(map((x) => x.collectionGroup), distinctUntilChanged(), shareReplay(1));
|
|
4259
|
-
this.collectionGroup$ = this.currentCollectionGroup$.pipe(filterMaybe());
|
|
4260
|
-
// MARK: State Changes
|
|
4261
|
-
/**
|
|
4262
|
-
* Sets the collection factory function to use.
|
|
4263
|
-
*/
|
|
4264
|
-
this.setCollectionFactory = this.updater((state, collectionFactory) => ({ ...state, collectionFactory }));
|
|
4265
|
-
/**
|
|
4266
|
-
* Sets the collection group to use.
|
|
4267
|
-
*/
|
|
4268
|
-
this.setCollectionGroup = this.updater((state, collectionGroup) => ({ ...state, collectionGroup }));
|
|
4269
|
-
/**
|
|
4270
|
-
* Sets the parent on the current state.
|
|
4271
|
-
*/
|
|
4272
|
-
this._setParentDocument = this.updater((state, parent) => ({ ...state, parent }));
|
|
4273
|
-
this._setParent = this._setParentDocument;
|
|
4274
4142
|
this.setSourceMode(defaultSourceMode || 'parent');
|
|
4275
4143
|
}
|
|
4276
|
-
|
|
4277
|
-
|
|
4144
|
+
// MARK: Effects
|
|
4145
|
+
setParentStore = setParentStoreEffect(this);
|
|
4146
|
+
setSourceMode = this.effect((input) => {
|
|
4147
|
+
return input.pipe(distinctUntilChanged(), switchMap((inputMode) => {
|
|
4148
|
+
const mode = inputMode?.toLowerCase() ?? 'parent'; // default to parent mode
|
|
4149
|
+
if (mode === 'group') {
|
|
4150
|
+
return this.currentCollectionGroup$.pipe(tap((collectionGroup) => {
|
|
4151
|
+
this.setFirestoreCollection(collectionGroup);
|
|
4152
|
+
}));
|
|
4153
|
+
}
|
|
4154
|
+
else {
|
|
4155
|
+
// parent document collection
|
|
4156
|
+
return this.currentParent$.pipe(switchMap((parent) => {
|
|
4157
|
+
if (parent) {
|
|
4158
|
+
return this.collectionFactory$.pipe(tap((collectionFactory) => {
|
|
4159
|
+
const collection = collectionFactory(parent);
|
|
4160
|
+
this.setFirestoreCollection(collection);
|
|
4161
|
+
}));
|
|
4162
|
+
}
|
|
4163
|
+
else {
|
|
4164
|
+
this.setFirestoreCollection(undefined);
|
|
4165
|
+
return NEVER;
|
|
4166
|
+
}
|
|
4167
|
+
}));
|
|
4168
|
+
}
|
|
4169
|
+
}));
|
|
4170
|
+
});
|
|
4171
|
+
// MARK: Accessors
|
|
4172
|
+
currentParent$ = this.state$.pipe(map((x) => x.parent), distinctUntilChanged(), shareReplay(1));
|
|
4173
|
+
parent$ = this.currentParent$.pipe(filterMaybe());
|
|
4174
|
+
currentCollectionFactory$ = this.state$.pipe(map((x) => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
|
|
4175
|
+
collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
|
|
4176
|
+
currentCollectionGroup$ = this.state$.pipe(map((x) => x.collectionGroup), distinctUntilChanged(), shareReplay(1));
|
|
4177
|
+
collectionGroup$ = this.currentCollectionGroup$.pipe(filterMaybe());
|
|
4178
|
+
// MARK: State Changes
|
|
4179
|
+
/**
|
|
4180
|
+
* Sets the collection factory function to use.
|
|
4181
|
+
*/
|
|
4182
|
+
setCollectionFactory = this.updater((state, collectionFactory) => ({ ...state, collectionFactory }));
|
|
4183
|
+
/**
|
|
4184
|
+
* Sets the collection group to use.
|
|
4185
|
+
*/
|
|
4186
|
+
setCollectionGroup = this.updater((state, collectionGroup) => ({ ...state, collectionGroup }));
|
|
4187
|
+
/**
|
|
4188
|
+
* Sets the parent on the current state.
|
|
4189
|
+
*/
|
|
4190
|
+
_setParentDocument = this.updater((state, parent) => ({ ...state, parent }));
|
|
4191
|
+
_setParent = this._setParentDocument;
|
|
4192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, deps: [{ token: null, optional: true }, { token: null, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4193
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore });
|
|
4278
4194
|
}
|
|
4279
4195
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, decorators: [{
|
|
4280
4196
|
type: Injectable
|
|
@@ -4294,51 +4210,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4294
4210
|
* Abstract DbxFirebaseDocumentStore that has a parent document from which is derives it's FiresbaseCollection from.
|
|
4295
4211
|
*/
|
|
4296
4212
|
class AbstractDbxFirebaseDocumentWithParentStore extends AbstractDbxFirebaseDocumentStore {
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
this.
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
}
|
|
4340
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseDocumentWithParentStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4341
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseDocumentWithParentStore }); }
|
|
4213
|
+
// MARK: Effects
|
|
4214
|
+
setParentStore = setParentStoreEffect(this);
|
|
4215
|
+
setParent = this.effect((input) => {
|
|
4216
|
+
return input.pipe(switchMap((parent) => {
|
|
4217
|
+
this._setParentDocument(parent);
|
|
4218
|
+
if (parent) {
|
|
4219
|
+
return this.collectionFactory$.pipe(tap((collectionFactory) => {
|
|
4220
|
+
const collection = collectionFactory(parent);
|
|
4221
|
+
this.setFirestoreCollection(collection);
|
|
4222
|
+
}));
|
|
4223
|
+
}
|
|
4224
|
+
else {
|
|
4225
|
+
// clear the current collection
|
|
4226
|
+
this.setFirestoreCollection(undefined);
|
|
4227
|
+
// do nothing until a parent is returned.
|
|
4228
|
+
return NEVER;
|
|
4229
|
+
}
|
|
4230
|
+
}));
|
|
4231
|
+
});
|
|
4232
|
+
_setParent = this.setParent;
|
|
4233
|
+
// MARK: Accessors
|
|
4234
|
+
/**
|
|
4235
|
+
* Returns the parent model key given the current key value.
|
|
4236
|
+
*/
|
|
4237
|
+
keyParentKey$ = this.key$.pipe(map((x) => firestoreModelKeyParentKey(x, 1)), distinctUntilChanged(), shareReplay(1));
|
|
4238
|
+
currentParent$ = this.state$.pipe(map((x) => x.parent), distinctUntilChanged(), shareReplay(1));
|
|
4239
|
+
currentParentKey$ = this.state$.pipe(map((x) => x.parent?.key), distinctUntilChanged(), shareReplay(1));
|
|
4240
|
+
parent$ = this.currentParent$.pipe(filterMaybe());
|
|
4241
|
+
parentKey$ = this.currentParentKey$.pipe(filterMaybe());
|
|
4242
|
+
currentCollectionFactory$ = this.state$.pipe(map((x) => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
|
|
4243
|
+
collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
|
|
4244
|
+
// MARK: State Changes
|
|
4245
|
+
/**
|
|
4246
|
+
* Sets the collection factory function to use.
|
|
4247
|
+
*/
|
|
4248
|
+
setCollectionFactory = this.updater((state, collectionFactory) => ({ ...state, collectionFactory }));
|
|
4249
|
+
/**
|
|
4250
|
+
* Sets the parent on the current state.
|
|
4251
|
+
*/
|
|
4252
|
+
_setParentDocument = this.updater((state, parent) => ({ ...state, parent }));
|
|
4253
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseDocumentWithParentStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
4254
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseDocumentWithParentStore });
|
|
4342
4255
|
}
|
|
4343
4256
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractDbxFirebaseDocumentWithParentStore, decorators: [{
|
|
4344
4257
|
type: Injectable
|
|
@@ -4347,45 +4260,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4347
4260
|
* AbstractDbxFirebaseDocumentWithParentStore extension for use with SingleItemFirestoreCollection.
|
|
4348
4261
|
*/
|
|
4349
4262
|
class AbstractSingleItemDbxFirebaseDocument extends AbstractDbxFirebaseDocumentWithParentStore {
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
if (
|
|
4357
|
-
|
|
4358
|
-
if (id != null) {
|
|
4359
|
-
return { ...state, firestoreCollection, id };
|
|
4360
|
-
}
|
|
4361
|
-
else {
|
|
4362
|
-
throw new Error('AbstractSingleItemDbxFirebaseDocument only accepts SingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');
|
|
4363
|
-
}
|
|
4263
|
+
/**
|
|
4264
|
+
* Sets the SingleItemFirestoreCollection to use.
|
|
4265
|
+
*/
|
|
4266
|
+
setFirestoreCollection = this.updater((state, firestoreCollection) => {
|
|
4267
|
+
if (firestoreCollection != null) {
|
|
4268
|
+
const id = firestoreCollection.singleItemIdentifier;
|
|
4269
|
+
if (id != null) {
|
|
4270
|
+
return { ...state, firestoreCollection, id };
|
|
4364
4271
|
}
|
|
4365
4272
|
else {
|
|
4366
|
-
|
|
4273
|
+
throw new Error('AbstractSingleItemDbxFirebaseDocument only accepts SingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');
|
|
4367
4274
|
}
|
|
4368
|
-
}
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4275
|
+
}
|
|
4276
|
+
else {
|
|
4277
|
+
return { ...state, firestoreCollection: null };
|
|
4278
|
+
}
|
|
4279
|
+
});
|
|
4280
|
+
/**
|
|
4281
|
+
* Does nothing on a AbstractSingleItemDbxFirebaseDocument.
|
|
4282
|
+
*
|
|
4283
|
+
* Ref is set with the FirestoreCollection
|
|
4284
|
+
*/
|
|
4285
|
+
setId = this.updater((state, id) => state);
|
|
4286
|
+
/**
|
|
4287
|
+
* Does nothing on a AbstractSingleItemDbxFirebaseDocument.
|
|
4288
|
+
*
|
|
4289
|
+
* Ref is set with the FirestoreCollection
|
|
4290
|
+
*/
|
|
4291
|
+
setKey = this.updater((state, key) => state);
|
|
4292
|
+
/**
|
|
4293
|
+
* Does nothing on a AbstractSingleItemDbxFirebaseDocument.
|
|
4294
|
+
*
|
|
4295
|
+
* Ref is set with the FirestoreCollection
|
|
4296
|
+
*/
|
|
4297
|
+
setRef = this.updater((state, ref) => state);
|
|
4298
|
+
clearRefs = this.updater((state) => state);
|
|
4389
4299
|
}
|
|
4390
4300
|
|
|
4391
4301
|
/**
|
|
@@ -4396,8 +4306,8 @@ class DbxFirebaseCollectionWithParentStoreDirective extends DbxFirebaseCollectio
|
|
|
4396
4306
|
set sourceMode(sourceMode) {
|
|
4397
4307
|
this.store.setSourceMode(sourceMode);
|
|
4398
4308
|
}
|
|
4399
|
-
static
|
|
4400
|
-
static
|
|
4309
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionWithParentStoreDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
4310
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseCollectionWithParentStoreDirective, inputs: { sourceMode: "sourceMode" }, usesInheritance: true, ngImport: i0 });
|
|
4401
4311
|
}
|
|
4402
4312
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseCollectionWithParentStoreDirective, decorators: [{
|
|
4403
4313
|
type: Directive
|
|
@@ -4416,23 +4326,24 @@ function provideDbxFirebaseCollectionWithParentStoreDirective(sourceType, storeT
|
|
|
4416
4326
|
}
|
|
4417
4327
|
|
|
4418
4328
|
class SystemStateCollectionStore extends AbstractDbxFirebaseCollectionStore {
|
|
4329
|
+
collections;
|
|
4419
4330
|
constructor(collections) {
|
|
4420
4331
|
super({ firestoreCollection: collections.systemStateCollection });
|
|
4421
4332
|
this.collections = collections;
|
|
4422
4333
|
}
|
|
4423
|
-
static
|
|
4424
|
-
static
|
|
4334
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SystemStateCollectionStore, deps: [{ token: i1$3.SystemStateFirestoreCollections }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4335
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SystemStateCollectionStore });
|
|
4425
4336
|
}
|
|
4426
4337
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SystemStateCollectionStore, decorators: [{
|
|
4427
4338
|
type: Injectable
|
|
4428
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
4339
|
+
}], ctorParameters: function () { return [{ type: i1$3.SystemStateFirestoreCollections }]; } });
|
|
4429
4340
|
|
|
4430
4341
|
class DbxFirebaseSystemStateCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective {
|
|
4431
4342
|
constructor(store) {
|
|
4432
4343
|
super(store);
|
|
4433
4344
|
}
|
|
4434
|
-
static
|
|
4435
|
-
static
|
|
4345
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseSystemStateCollectionStoreDirective, deps: [{ token: SystemStateCollectionStore }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4346
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseSystemStateCollectionStoreDirective, selector: "[dbxFirebaseSystemStateCollection]", providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseSystemStateCollectionStoreDirective, SystemStateCollectionStore), usesInheritance: true, ngImport: i0 });
|
|
4436
4347
|
}
|
|
4437
4348
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseSystemStateCollectionStoreDirective, decorators: [{
|
|
4438
4349
|
type: Directive,
|
|
@@ -4442,40 +4353,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4442
4353
|
}]
|
|
4443
4354
|
}], ctorParameters: function () { return [{ type: SystemStateCollectionStore }]; } });
|
|
4444
4355
|
|
|
4445
|
-
/**
|
|
4446
|
-
* Abstract class used for accessing a SystemStateDocumentStore's data.
|
|
4447
|
-
*/
|
|
4448
|
-
class AbstractSystemStateDocumentStoreAccessor {
|
|
4449
|
-
constructor(systemStateDocumentStore, type) {
|
|
4450
|
-
this.systemStateDocumentStore = systemStateDocumentStore;
|
|
4451
|
-
this.type = type;
|
|
4452
|
-
this.documentData$ = this.systemStateDocumentStore.data$;
|
|
4453
|
-
this.data$ = this.documentData$.pipe(map((x) => x.data), shareReplay(1));
|
|
4454
|
-
this.dataState$ = this.systemStateDocumentStore.dataLoadingState$.pipe(mapLoadingState({ mapValue: (x) => x.data }), shareReplay(1));
|
|
4455
|
-
this.exists$ = this.systemStateDocumentStore.exists$;
|
|
4456
|
-
this.doesNotExist$ = this.systemStateDocumentStore.doesNotExist$;
|
|
4457
|
-
systemStateDocumentStore.setId(type);
|
|
4458
|
-
}
|
|
4459
|
-
}
|
|
4460
|
-
|
|
4461
4356
|
class SystemStateDocumentStore extends AbstractDbxFirebaseDocumentStore {
|
|
4357
|
+
collections;
|
|
4462
4358
|
constructor(collections) {
|
|
4463
4359
|
super({ firestoreCollection: collections.systemStateCollection });
|
|
4464
4360
|
this.collections = collections;
|
|
4465
4361
|
}
|
|
4466
|
-
static
|
|
4467
|
-
static
|
|
4362
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SystemStateDocumentStore, deps: [{ token: i1$3.SystemStateFirestoreCollections }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4363
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SystemStateDocumentStore });
|
|
4468
4364
|
}
|
|
4469
4365
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SystemStateDocumentStore, decorators: [{
|
|
4470
4366
|
type: Injectable
|
|
4471
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
4367
|
+
}], ctorParameters: function () { return [{ type: i1$3.SystemStateFirestoreCollections }]; } });
|
|
4368
|
+
|
|
4369
|
+
/**
|
|
4370
|
+
* Abstract class used for accessing a SystemStateDocumentStore's data.
|
|
4371
|
+
*/
|
|
4372
|
+
class AbstractSystemStateDocumentStoreAccessor {
|
|
4373
|
+
type;
|
|
4374
|
+
systemStateDocumentStore = inject((SystemStateDocumentStore));
|
|
4375
|
+
documentData$ = this.systemStateDocumentStore.data$;
|
|
4376
|
+
data$ = this.documentData$.pipe(map((x) => x.data), shareReplay(1));
|
|
4377
|
+
dataState$ = this.systemStateDocumentStore.dataLoadingState$.pipe(mapLoadingState({ mapValue: (x) => x.data }), shareReplay(1));
|
|
4378
|
+
exists$ = this.systemStateDocumentStore.exists$;
|
|
4379
|
+
doesNotExist$ = this.systemStateDocumentStore.doesNotExist$;
|
|
4380
|
+
constructor(type) {
|
|
4381
|
+
this.type = type;
|
|
4382
|
+
this.systemStateDocumentStore.setId(type);
|
|
4383
|
+
}
|
|
4384
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractSystemStateDocumentStoreAccessor, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
4385
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractSystemStateDocumentStoreAccessor });
|
|
4386
|
+
}
|
|
4387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AbstractSystemStateDocumentStoreAccessor, decorators: [{
|
|
4388
|
+
type: Injectable
|
|
4389
|
+
}], ctorParameters: function () { return [{ type: undefined }]; } });
|
|
4472
4390
|
|
|
4473
4391
|
class DbxFirebaseSystemStateDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective {
|
|
4474
|
-
constructor(
|
|
4475
|
-
super(
|
|
4392
|
+
constructor() {
|
|
4393
|
+
super(inject((SystemStateDocumentStore)));
|
|
4476
4394
|
}
|
|
4477
|
-
static
|
|
4478
|
-
static
|
|
4395
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseSystemStateDocumentStoreDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4396
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DbxFirebaseSystemStateDocumentStoreDirective, selector: "[dbxFirebaseSystemStateDocument]", providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseSystemStateDocumentStoreDirective, SystemStateDocumentStore), usesInheritance: true, ngImport: i0 });
|
|
4479
4397
|
}
|
|
4480
4398
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseSystemStateDocumentStoreDirective, decorators: [{
|
|
4481
4399
|
type: Directive,
|
|
@@ -4483,12 +4401,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4483
4401
|
selector: '[dbxFirebaseSystemStateDocument]',
|
|
4484
4402
|
providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseSystemStateDocumentStoreDirective, SystemStateDocumentStore)
|
|
4485
4403
|
}]
|
|
4486
|
-
}], ctorParameters: function () { return [
|
|
4404
|
+
}], ctorParameters: function () { return []; } });
|
|
4487
4405
|
|
|
4488
4406
|
class DbxFirebaseModelModule {
|
|
4489
|
-
static
|
|
4490
|
-
static
|
|
4491
|
-
static
|
|
4407
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4408
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelModule, exports: [DbxFirebaseModelStoreModule, DbxFirebaseModelHistoryModule, DbxFirebaseModelTypesModule] });
|
|
4409
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelModule, imports: [DbxFirebaseModelStoreModule, DbxFirebaseModelHistoryModule, DbxFirebaseModelTypesModule] });
|
|
4492
4410
|
}
|
|
4493
4411
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModelModule, decorators: [{
|
|
4494
4412
|
type: NgModule,
|
|
@@ -4506,8 +4424,8 @@ class FlatFirestoreModelKeyPipe {
|
|
|
4506
4424
|
return '';
|
|
4507
4425
|
}
|
|
4508
4426
|
}
|
|
4509
|
-
static
|
|
4510
|
-
static
|
|
4427
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FlatFirestoreModelKeyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4428
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FlatFirestoreModelKeyPipe, name: "flatFirestoreModelKey" });
|
|
4511
4429
|
}
|
|
4512
4430
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FlatFirestoreModelKeyPipe, decorators: [{
|
|
4513
4431
|
type: Pipe,
|
|
@@ -4522,8 +4440,8 @@ class TwoWayFlatFirestoreModelKeyPipe {
|
|
|
4522
4440
|
return '';
|
|
4523
4441
|
}
|
|
4524
4442
|
}
|
|
4525
|
-
static
|
|
4526
|
-
static
|
|
4443
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TwoWayFlatFirestoreModelKeyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4444
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TwoWayFlatFirestoreModelKeyPipe, name: "twoWayFlatFirestoreModelKey" });
|
|
4527
4445
|
}
|
|
4528
4446
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TwoWayFlatFirestoreModelKeyPipe, decorators: [{
|
|
4529
4447
|
type: Pipe,
|
|
@@ -4532,9 +4450,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4532
4450
|
|
|
4533
4451
|
const declarations = [FlatFirestoreModelKeyPipe, TwoWayFlatFirestoreModelKeyPipe];
|
|
4534
4452
|
class DbxFirebasePipeModule {
|
|
4535
|
-
static
|
|
4536
|
-
static
|
|
4537
|
-
static
|
|
4453
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebasePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4454
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebasePipeModule, declarations: [FlatFirestoreModelKeyPipe, TwoWayFlatFirestoreModelKeyPipe], exports: [FlatFirestoreModelKeyPipe, TwoWayFlatFirestoreModelKeyPipe] });
|
|
4455
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebasePipeModule });
|
|
4538
4456
|
}
|
|
4539
4457
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebasePipeModule, decorators: [{
|
|
4540
4458
|
type: NgModule,
|
|
@@ -4557,9 +4475,7 @@ const DBX_FIREBASE_STORAGE_CONTEXT_TOKEN = new InjectionToken('DBX_FIREBASE_STOR
|
|
|
4557
4475
|
* Service that provides access to the app's FirebaseStorageContext.
|
|
4558
4476
|
*/
|
|
4559
4477
|
class DbxFirebaseStorageService {
|
|
4560
|
-
|
|
4561
|
-
this.storageContext = storageContext;
|
|
4562
|
-
}
|
|
4478
|
+
storageContext = inject(DBX_FIREBASE_STORAGE_CONTEXT_TOKEN);
|
|
4563
4479
|
defaultBucket() {
|
|
4564
4480
|
return this.storageContext.defaultBucket();
|
|
4565
4481
|
}
|
|
@@ -4569,18 +4485,15 @@ class DbxFirebaseStorageService {
|
|
|
4569
4485
|
folder(path) {
|
|
4570
4486
|
return this.storageContext.folder(path);
|
|
4571
4487
|
}
|
|
4572
|
-
static
|
|
4573
|
-
static
|
|
4488
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4489
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseStorageService, providedIn: 'root' });
|
|
4574
4490
|
}
|
|
4575
4491
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseStorageService, decorators: [{
|
|
4576
4492
|
type: Injectable,
|
|
4577
4493
|
args: [{
|
|
4578
4494
|
providedIn: 'root'
|
|
4579
4495
|
}]
|
|
4580
|
-
}]
|
|
4581
|
-
type: Inject,
|
|
4582
|
-
args: [DBX_FIREBASE_STORAGE_CONTEXT_TOKEN]
|
|
4583
|
-
}] }]; } });
|
|
4496
|
+
}] });
|
|
4584
4497
|
|
|
4585
4498
|
function dbxFirebaseStorageModuleContextConfigFactory(base) {
|
|
4586
4499
|
return (app, injector) => {
|
|
@@ -4611,9 +4524,9 @@ class DbxFirebaseStorageModule {
|
|
|
4611
4524
|
providers
|
|
4612
4525
|
};
|
|
4613
4526
|
}
|
|
4614
|
-
static
|
|
4615
|
-
static
|
|
4616
|
-
static
|
|
4527
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseStorageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4528
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseStorageModule });
|
|
4529
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseStorageModule });
|
|
4617
4530
|
}
|
|
4618
4531
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseStorageModule, decorators: [{
|
|
4619
4532
|
type: NgModule,
|
|
@@ -4621,9 +4534,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4621
4534
|
}] });
|
|
4622
4535
|
|
|
4623
4536
|
class DbxFirebaseModule {
|
|
4624
|
-
static
|
|
4625
|
-
static
|
|
4626
|
-
static
|
|
4537
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4538
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModule, exports: [DbxFirebaseModelModule] });
|
|
4539
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModule, imports: [DbxFirebaseModelModule] });
|
|
4627
4540
|
}
|
|
4628
4541
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DbxFirebaseModule, decorators: [{
|
|
4629
4542
|
type: NgModule,
|
|
@@ -4636,5 +4549,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4636
4549
|
* Generated bundle index. Do not edit.
|
|
4637
4550
|
*/
|
|
4638
4551
|
|
|
4639
|
-
export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, AbstractRootSingleItemDbxFirebaseDocument, AbstractSingleItemDbxFirebaseDocument, AbstractSystemStateDocumentStoreAccessor, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_KEY_PARAM_KEY, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_OPTIONS_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_TOKEN, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY, 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_COLLECTION_CHANGE_TRIGGER_FUNCTION, DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN, DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY, DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN, DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN, DEFAULT_FIREBASE_HISTORY_COMPONENT_POPOVER_KEY, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY, DbxFirebaseAnalyticsUserEventsListener, DbxFirebaseAnalyticsUserSource, DbxFirebaseAppCheckHttpInterceptor, DbxFirebaseAuthContextInfo, DbxFirebaseAuthLoginService, DbxFirebaseAuthModule, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionChangeTriggerInstance,
|
|
4552
|
+
export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, AbstractRootSingleItemDbxFirebaseDocument, AbstractSingleItemDbxFirebaseDocument, AbstractSystemStateDocumentStoreAccessor, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_KEY_PARAM_KEY, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_OPTIONS_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_TOKEN, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY, 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_COLLECTION_CHANGE_TRIGGER_FUNCTION, DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN, DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY, DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN, DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN, DEFAULT_FIREBASE_HISTORY_COMPONENT_POPOVER_KEY, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY, DbxFirebaseAnalyticsUserEventsListener, DbxFirebaseAnalyticsUserSource, DbxFirebaseAppCheckHttpInterceptor, DbxFirebaseAuthContextInfo, DbxFirebaseAuthLoginService, DbxFirebaseAuthModule, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionChangeTriggerInstance, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionStoreDirective, DbxFirebaseCollectionWithParentStoreDirective, DbxFirebaseDefaultAppCheckProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultFirebaseProvidersModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultFunctionsProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDevelopmentDirective, DbxFirebaseDevelopmentModule, DbxFirebaseDevelopmentModuleRootConfig, DbxFirebaseDevelopmentPopupComponent, DbxFirebaseDevelopmentPopupContentComponent, DbxFirebaseDevelopmentPopupContentFormComponent, DbxFirebaseDevelopmentSchedulerListComponent, DbxFirebaseDevelopmentSchedulerListViewComponent, DbxFirebaseDevelopmentSchedulerListViewItemComponent, DbxFirebaseDevelopmentSchedulerService, DbxFirebaseDevelopmentSchedulerWidgetComponent, DbxFirebaseDevelopmentService, DbxFirebaseDevelopmentWidgetService, DbxFirebaseDocumentAuthIdDirective, DbxFirebaseDocumentLoaderInstance, DbxFirebaseDocumentStoreDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentStoreRouteKeyDirective, DbxFirebaseEmailFormComponent, DbxFirebaseEmailRecoveryFormComponent, DbxFirebaseEmulatorModule, DbxFirebaseEmulatorService, DbxFirebaseFirestoreCollectionModule, DbxFirebaseFunctionsModule, DbxFirebaseInContextFirebaseModelServiceInstance, DbxFirebaseLoginAnonymousComponent, DbxFirebaseLoginAppleComponent, DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent, DbxFirebaseLoginComponent, DbxFirebaseLoginContext, DbxFirebaseLoginContextBackButtonComponent, DbxFirebaseLoginContextDirective, DbxFirebaseLoginEmailComponent, DbxFirebaseLoginEmailContentComponent, DbxFirebaseLoginFacebookComponent, DbxFirebaseLoginGitHubComponent, DbxFirebaseLoginGoogleComponent, DbxFirebaseLoginListComponent, DbxFirebaseLoginMicrosoftComponent, DbxFirebaseLoginModule, DbxFirebaseLoginModuleRootConfig, DbxFirebaseLoginTermsComponent, DbxFirebaseLoginTermsSimpleComponent, DbxFirebaseLoginTwitterComponent, DbxFirebaseModelContextService, DbxFirebaseModelHistoryComponent, DbxFirebaseModelHistoryModule, DbxFirebaseModelHistoryPopoverButtonComponent, DbxFirebaseModelHistoryPopoverComponent, DbxFirebaseModelModule, DbxFirebaseModelStoreModule, DbxFirebaseModelTrackerService, DbxFirebaseModelTypeInstanceComponent, DbxFirebaseModelTypeInstanceViewComponent, DbxFirebaseModelTypeInstanceViewItemComponent, DbxFirebaseModelTypesModule, DbxFirebaseModelTypesService, DbxFirebaseModelTypesServiceConfig, DbxFirebaseModule, DbxFirebaseParsedEmulatorsConfig, DbxFirebasePipeModule, DbxFirebaseRegisterComponent, DbxFirebaseRegisterEmailComponent, DbxFirebaseStorageModule, DbxFirebaseStorageService, DbxFirebaseSystemStateCollectionStoreDirective, DbxFirebaseSystemStateDocumentStoreDirective, DbxFirestoreContextService, DbxLimitedFirebaseDocumentLoaderInstance, DbxfirebaseModelViewedEventDirective, FlatFirestoreModelKeyPipe, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY, SystemStateCollectionStore, SystemStateDocumentStore, TwoWayFlatFirestoreModelKeyPipe, authRolesObsWithClaimsService, authUserInfoFromAuthUser, authUserStateFromFirebaseAuthServiceFunction, dbxFirebaseCollectionChangeTrigger, dbxFirebaseCollectionChangeTriggerForStore, dbxFirebaseCollectionChangeTriggerForWatcher, dbxFirebaseCollectionChangeWatcher, dbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstanceWithCollection, dbxFirebaseDocumentLoaderInstance, dbxFirebaseDocumentLoaderInstanceWithAccessor, dbxFirebaseIdRouteParamRedirect, dbxFirebaseInContextFirebaseModelServiceInstanceFactory, dbxFirebaseKeyRouteParamRedirect, dbxFirebaseModelContextServiceInfoInstanceFactory, dbxFirebaseModelTypesServiceInstance, dbxFirebaseModelTypesServiceInstancePairForKeysFactory, dbxFirebaseSourceSelectLoadSource, dbxFirebaseStorageModuleContextConfigFactory, dbxLimitedFirebaseDocumentLoaderInstance, dbxLimitedFirebaseDocumentLoaderInstanceWithAccessor, defaultDbxFirebaseAuthServiceDelegateWithClaimsService, defaultFirebaseAuthLoginProvidersFactory, developmentFirebaseServerSchedulerWidgetEntry, enableAppCheckDebugTokenGeneration, firebaseAuthTokenFromUser, firebaseContextServiceEntityMap, firebaseDocumentStoreCreateFunction, firebaseDocumentStoreCrudFunction, firebaseDocumentStoreDeleteFunction, firebaseDocumentStoreReadFunction, firebaseDocumentStoreUpdateFunction, modelDoesNotExistError, provideDbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionWithParentStoreDirective, provideDbxFirebaseDocumentStoreDirective, provideSystemStateFirestoreCollections, readDbxAnalyticsUserPropertiesFromAuthUserInfo, readValueFromIdToken, setParentStoreEffect, stateFromTokenForLoggedInUserFunction };
|
|
4640
4553
|
//# sourceMappingURL=dereekb-dbx-firebase.mjs.map
|