@dereekb/dbx-firebase 8.5.1 → 8.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/auth/service/firebase.auth.service.mjs +1 -1
- package/esm2020/lib/index.mjs +2 -1
- package/esm2020/lib/model/loader/collection.change.trigger.mjs +81 -0
- package/esm2020/lib/model/loader/collection.change.watcher.mjs +37 -0
- package/esm2020/lib/model/loader/collection.loader.instance.mjs +1 -1
- package/esm2020/lib/model/loader/collection.loader.mjs +1 -1
- package/esm2020/lib/model/loader/document.loader.instance.mjs +11 -2
- package/esm2020/lib/model/loader/document.loader.mjs +1 -1
- package/esm2020/lib/model/loader/index.mjs +3 -1
- package/esm2020/lib/model/store/store.collection.change.directive.mjs +20 -24
- package/esm2020/lib/model/store/store.collection.mjs +2 -1
- package/esm2020/lib/model/store/store.document.router.directive.mjs +13 -33
- package/esm2020/lib/router/id.param.redirect.mjs +60 -0
- package/esm2020/lib/router/index.mjs +2 -0
- package/fesm2015/dereekb-dbx-firebase.mjs +208 -49
- package/fesm2015/dereekb-dbx-firebase.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-firebase.mjs +206 -49
- package/fesm2020/dereekb-dbx-firebase.mjs.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/model/loader/collection.change.trigger.d.ts +64 -0
- package/lib/model/loader/collection.change.watcher.d.ts +54 -0
- package/lib/model/loader/collection.loader.d.ts +12 -9
- package/lib/model/loader/collection.loader.instance.d.ts +2 -6
- package/lib/model/loader/document.loader.d.ts +12 -0
- package/lib/model/loader/document.loader.instance.d.ts +9 -0
- package/lib/model/loader/index.d.ts +2 -0
- package/lib/model/store/store.collection.change.directive.d.ts +13 -14
- package/lib/model/store/store.collection.d.ts +3 -1
- package/lib/model/store/store.document.router.directive.d.ts +1 -7
- package/lib/router/id.param.redirect.d.ts +41 -0
- package/lib/router/index.d.ts +1 -0
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@ import { urlWithoutParameters, AUTH_ADMIN_ROLE, cachedGetter, addToSet, removeFr
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { InjectionToken, Injectable, Inject, Optional, Component, Input, Directive, EventEmitter, Output, NgModule, Injector, forwardRef, Host } from '@angular/core';
|
|
4
4
|
import { getToken, initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check';
|
|
5
|
-
import { switchMap, from, first, map, of, shareReplay, distinctUntilChanged, firstValueFrom, BehaviorSubject, combineLatest, tap,
|
|
5
|
+
import { switchMap, from, first, map, of, shareReplay, distinctUntilChanged, firstValueFrom, BehaviorSubject, combineLatest, tap, filter, take, startWith, exhaustMap, EMPTY, Subject, throttleTime, NEVER } from 'rxjs';
|
|
6
6
|
import * as i1 from '@angular/fire/app-check';
|
|
7
7
|
import { provideAppCheck } from '@angular/fire/app-check';
|
|
8
8
|
import * as i4 from '@angular/material/button';
|
|
@@ -11,9 +11,9 @@ import * as i2 from '@angular/material/icon';
|
|
|
11
11
|
import { MatIconModule } from '@angular/material/icon';
|
|
12
12
|
import * as i6 from '@angular/common';
|
|
13
13
|
import { CommonModule } from '@angular/common';
|
|
14
|
-
import { timeoutStartWith, filterMaybe, isNot, SubscriptionObject, cleanupDestroyable, accumulatorFlattenPageListLoadingState, useFirst, pageLoadingStateFromObs,
|
|
14
|
+
import { timeoutStartWith, filterMaybe, isNot, SubscriptionObject, asObservable, cleanupDestroyable, accumulatorFlattenPageListLoadingState, useFirst, pageLoadingStateFromObs, useAsObservable, successResult, beginLoading, loadingStateFromObs, errorResult, lazyFrom, cleanup } from '@dereekb/rxjs';
|
|
15
15
|
import * as i3$1 from '@dereekb/dbx-core';
|
|
16
|
-
import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, AbstractForwardDbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponentModule, DbxAuthService,
|
|
16
|
+
import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, AbstractForwardDbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponentModule, DbxAuthService, AbstractIfDirective, AbstractSubscriptionDirective, DbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance, LockSetComponentStore } from '@dereekb/dbx-core';
|
|
17
17
|
import * as i1$1 from '@angular/fire/auth';
|
|
18
18
|
import { authState, GoogleAuthProvider, FacebookAuthProvider, TwitterAuthProvider, GithubAuthProvider, signInWithPopup, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInAnonymously, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';
|
|
19
19
|
import { sendPasswordResetEmail } from 'firebase/auth';
|
|
@@ -31,7 +31,7 @@ import { provideFunctions, getFunctions, connectFunctionsEmulator, Functions } f
|
|
|
31
31
|
import * as i1$3 from '@angular/fire/firestore';
|
|
32
32
|
import { provideFirestore, getFirestore, connectFirestoreEmulator, enableIndexedDbPersistence, Firestore } from '@angular/fire/firestore';
|
|
33
33
|
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
34
|
-
import { firebaseFirestoreContextFactory, iterationQueryDocChangeWatcher, firebaseQueryItemAccumulator, firestoreModelKeysFromDocuments, firestoreModelIdsFromDocuments, documentReferencesFromDocuments, getDocumentSnapshots, getDataFromDocumentSnapshots, loadDocumentsForKeys, loadDocumentsForDocumentReferences, loadDocumentsForIds, documentDataWithId } from '@dereekb/firebase';
|
|
34
|
+
import { firebaseFirestoreContextFactory, iterationQueryDocChangeWatcher, firebaseQueryItemAccumulator, firestoreModelKeysFromDocuments, firestoreModelIdsFromDocuments, documentReferencesFromDocuments, getDocumentSnapshots, getDataFromDocumentSnapshots, streamDocumentSnapshots, dataFromDocumentSnapshots, loadDocumentsForKeys, loadDocumentsForDocumentReferences, loadDocumentsForIds, documentDataWithId } from '@dereekb/firebase';
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Enables debug token generation for AppCheck by setting FIREBASE_APPCHECK_DEBUG_TOKEN in the browser's self/window.
|
|
@@ -1870,6 +1870,119 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1870
1870
|
type: NgModule
|
|
1871
1871
|
}] });
|
|
1872
1872
|
|
|
1873
|
+
/**
|
|
1874
|
+
* DbxFirebaseCollectionChangeWatcher instance
|
|
1875
|
+
*/
|
|
1876
|
+
class DbxFirebaseCollectionChangeWatcherInstance {
|
|
1877
|
+
constructor(store, _initialMode = 'off') {
|
|
1878
|
+
this.store = store;
|
|
1879
|
+
this._initialMode = _initialMode;
|
|
1880
|
+
this._mode = new BehaviorSubject(this._initialMode);
|
|
1881
|
+
this._sub = new SubscriptionObject();
|
|
1882
|
+
this.mode$ = this._mode.pipe(distinctUntilChanged());
|
|
1883
|
+
this.event$ = this.store.queryChangeWatcher$.pipe(switchMap((x) => x.event$.pipe(filter((x) => x.type !== 'none'), // do not share 'none' events.
|
|
1884
|
+
take(1), // only need one event to mark as change is available.
|
|
1885
|
+
startWith({
|
|
1886
|
+
time: new Date(),
|
|
1887
|
+
type: 'none'
|
|
1888
|
+
}))), shareReplay(1));
|
|
1889
|
+
this.hasChangeAvailable$ = this.event$.pipe(map((x) => x.type !== 'none'), shareReplay(1));
|
|
1890
|
+
this.triggered$ = combineLatest([this.mode$, this.hasChangeAvailable$]).pipe(map(([mode, hasChange]) => mode === 'auto' && hasChange));
|
|
1891
|
+
this.trigger$ = this.triggered$.pipe(filter((triggered) => triggered), map(() => undefined));
|
|
1892
|
+
}
|
|
1893
|
+
destroy() {
|
|
1894
|
+
this._sub.destroy();
|
|
1895
|
+
this._mode.complete();
|
|
1896
|
+
}
|
|
1897
|
+
get mode() {
|
|
1898
|
+
return this._mode.value;
|
|
1899
|
+
}
|
|
1900
|
+
set mode(mode) {
|
|
1901
|
+
this._mode.next(mode);
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
function dbxFirebaseCollectionChangeWatcher(store, mode) {
|
|
1905
|
+
return new DbxFirebaseCollectionChangeWatcherInstance(store, mode);
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
/**
|
|
1909
|
+
* Restarts the store.
|
|
1910
|
+
*
|
|
1911
|
+
* @param instance
|
|
1912
|
+
* @returns
|
|
1913
|
+
*/
|
|
1914
|
+
const DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION = (instance) => instance.watcher.store.restart();
|
|
1915
|
+
class DbxFirebaseCollectionChangeTriggerInstance {
|
|
1916
|
+
constructor(config) {
|
|
1917
|
+
this.config = config;
|
|
1918
|
+
this._triggerFunction = new BehaviorSubject(undefined);
|
|
1919
|
+
this._sub = new SubscriptionObject();
|
|
1920
|
+
this.watcher = config.watcher;
|
|
1921
|
+
this.triggerFunction = config.triggerFunction ?? DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION;
|
|
1922
|
+
}
|
|
1923
|
+
init() {
|
|
1924
|
+
this._sub.subscription = this._triggerFunction
|
|
1925
|
+
.pipe(switchMap((triggerFunction) => {
|
|
1926
|
+
if (triggerFunction) {
|
|
1927
|
+
return this.watcher.triggered$.pipe(filter((triggered) => triggered), exhaustMap(() => asObservable(triggerFunction(this))));
|
|
1928
|
+
}
|
|
1929
|
+
else {
|
|
1930
|
+
return EMPTY;
|
|
1931
|
+
}
|
|
1932
|
+
}))
|
|
1933
|
+
.subscribe();
|
|
1934
|
+
}
|
|
1935
|
+
destroy() {
|
|
1936
|
+
this._triggerFunction.complete();
|
|
1937
|
+
if (this.config.destroyWatcherOnDestroy === true) {
|
|
1938
|
+
this.watcher?.destroy();
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
get triggerFunction() {
|
|
1942
|
+
return this._triggerFunction.value;
|
|
1943
|
+
}
|
|
1944
|
+
set triggerFunction(triggerFunction) {
|
|
1945
|
+
this._triggerFunction.next(triggerFunction);
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Creates a new DbxFirebaseCollectionChangeWatcher, set the modes to "auto", and creates a new DbxFirebaseCollectionChangeTriggerInstance.
|
|
1950
|
+
*
|
|
1951
|
+
* @param store
|
|
1952
|
+
* @param triggerFunction
|
|
1953
|
+
* @returns
|
|
1954
|
+
*/
|
|
1955
|
+
function dbxFirebaseCollectionChangeTriggerForStore(store, triggerFunction) {
|
|
1956
|
+
return dbxFirebaseCollectionChangeTrigger({
|
|
1957
|
+
watcher: dbxFirebaseCollectionChangeWatcher(store, 'auto'),
|
|
1958
|
+
destroyWatcherOnDestroy: true,
|
|
1959
|
+
triggerFunction
|
|
1960
|
+
});
|
|
1961
|
+
}
|
|
1962
|
+
function dbxFirebaseCollectionChangeTriggerForWatcher(watcher, triggerFunction) {
|
|
1963
|
+
return dbxFirebaseCollectionChangeTrigger({
|
|
1964
|
+
watcher,
|
|
1965
|
+
destroyWatcherOnDestroy: false,
|
|
1966
|
+
triggerFunction
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
function dbxFirebaseCollectionChangeTrigger(config) {
|
|
1970
|
+
return new DbxFirebaseCollectionChangeTriggerInstance(config);
|
|
1971
|
+
}
|
|
1972
|
+
// MARK: Compat
|
|
1973
|
+
/**
|
|
1974
|
+
* @deprecated
|
|
1975
|
+
*/
|
|
1976
|
+
const dbxFirebaseCollectionChangeTriggerInstance = dbxFirebaseCollectionChangeTrigger;
|
|
1977
|
+
/**
|
|
1978
|
+
* @deprecated
|
|
1979
|
+
*/
|
|
1980
|
+
const dbxFirebaseCollectionChangeTriggerInstanceForStore = dbxFirebaseCollectionChangeTriggerForStore;
|
|
1981
|
+
/**
|
|
1982
|
+
* @deprecated
|
|
1983
|
+
*/
|
|
1984
|
+
const dbxFirebaseCollectionChangeTriggerInstanceForWatcher = dbxFirebaseCollectionChangeTriggerForWatcher;
|
|
1985
|
+
|
|
1873
1986
|
/**
|
|
1874
1987
|
* DbxFirebaseModelLoader implementation within an instance.
|
|
1875
1988
|
*/
|
|
@@ -1983,7 +2096,16 @@ class DbxLimitedFirebaseDocumentLoaderInstance {
|
|
|
1983
2096
|
this.refs$ = this.documents$.pipe(map(documentReferencesFromDocuments));
|
|
1984
2097
|
this.snapshots$ = this.documents$.pipe(switchMap((docs) => this._restart.pipe(startWith(null), exhaustMap(() => getDocumentSnapshots(docs)))), shareReplay(1));
|
|
1985
2098
|
this.data$ = this.snapshots$.pipe(map((snapshots) => getDataFromDocumentSnapshots(snapshots, true)), shareReplay(1));
|
|
2099
|
+
/**
|
|
2100
|
+
* Snapshot stream of the documents
|
|
2101
|
+
*/
|
|
2102
|
+
this.snapshotsStream$ = this.documents$.pipe(switchMap((docs) => streamDocumentSnapshots(docs)), shareReplay(1));
|
|
2103
|
+
/**
|
|
2104
|
+
* Data streamd of the documents.
|
|
2105
|
+
*/
|
|
2106
|
+
this.dataStream$ = this.snapshotsStream$.pipe(dataFromDocumentSnapshots(), shareReplay(1));
|
|
1986
2107
|
this.pageLoadingState$ = pageLoadingStateFromObs(this.data$, false);
|
|
2108
|
+
this.pageLoadingStateStream$ = pageLoadingStateFromObs(this.dataStream$, false);
|
|
1987
2109
|
}
|
|
1988
2110
|
destroy() {
|
|
1989
2111
|
this._documents.complete();
|
|
@@ -2077,43 +2199,39 @@ function provideDbxFirebaseCollectionStoreDirective(sourceType, storeType) {
|
|
|
2077
2199
|
/**
|
|
2078
2200
|
* Used to watch query doc changes and respond to them accordingly.
|
|
2079
2201
|
*/
|
|
2080
|
-
class DbxFirebaseCollectionChangeDirective
|
|
2202
|
+
class DbxFirebaseCollectionChangeDirective {
|
|
2081
2203
|
constructor(dbxFirebaseCollectionStoreDirective) {
|
|
2082
|
-
super();
|
|
2083
2204
|
this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
|
|
2084
|
-
this.
|
|
2085
|
-
this.
|
|
2086
|
-
this.
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2205
|
+
this._watcher = dbxFirebaseCollectionChangeWatcher(this.dbxFirebaseCollectionStoreDirective.store);
|
|
2206
|
+
this._trigger = dbxFirebaseCollectionChangeTriggerForWatcher(this._watcher, () => this.restart());
|
|
2207
|
+
this.mode$ = this._watcher.mode$;
|
|
2208
|
+
this.event$ = this._watcher.event$;
|
|
2209
|
+
this.hasChangeAvailable$ = this._watcher.hasChangeAvailable$;
|
|
2210
|
+
this.triggered$ = this._watcher.triggered$;
|
|
2211
|
+
this.trigger$ = this._watcher.trigger$;
|
|
2212
|
+
}
|
|
2213
|
+
get store() {
|
|
2214
|
+
return this._watcher.store;
|
|
2093
2215
|
}
|
|
2094
2216
|
ngOnInit() {
|
|
2095
|
-
this.
|
|
2096
|
-
.pipe(filter(([mode, hasChange]) => mode === 'auto' && hasChange))
|
|
2097
|
-
.subscribe(() => {
|
|
2098
|
-
this.restart();
|
|
2099
|
-
});
|
|
2217
|
+
this._trigger.init();
|
|
2100
2218
|
}
|
|
2101
2219
|
ngOnDestroy() {
|
|
2102
|
-
|
|
2103
|
-
this.
|
|
2220
|
+
this._watcher.destroy();
|
|
2221
|
+
this._trigger.destroy();
|
|
2104
2222
|
}
|
|
2105
2223
|
get mode() {
|
|
2106
|
-
return this.
|
|
2224
|
+
return this._watcher.mode;
|
|
2107
2225
|
}
|
|
2108
2226
|
set mode(mode) {
|
|
2109
|
-
this.
|
|
2227
|
+
this._watcher.mode = mode || 'off';
|
|
2110
2228
|
}
|
|
2111
2229
|
restart() {
|
|
2112
2230
|
this.dbxFirebaseCollectionStoreDirective.store.restart();
|
|
2113
2231
|
}
|
|
2114
2232
|
}
|
|
2115
2233
|
DbxFirebaseCollectionChangeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionChangeDirective, deps: [{ token: DbxFirebaseCollectionStoreDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2116
|
-
DbxFirebaseCollectionChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseCollectionChangeDirective, selector: "[dbxFirebaseCollectionChange]", inputs: { mode: ["dbxFirebaseCollectionChange", "mode"] },
|
|
2234
|
+
DbxFirebaseCollectionChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseCollectionChangeDirective, selector: "[dbxFirebaseCollectionChange]", inputs: { mode: ["dbxFirebaseCollectionChange", "mode"] }, ngImport: i0 });
|
|
2117
2235
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionChangeDirective, decorators: [{
|
|
2118
2236
|
type: Directive,
|
|
2119
2237
|
args: [{
|
|
@@ -2268,20 +2386,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2268
2386
|
type: Host
|
|
2269
2387
|
}] }]; } });
|
|
2270
2388
|
|
|
2271
|
-
const
|
|
2272
|
-
const
|
|
2389
|
+
const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY = 'id';
|
|
2390
|
+
const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE = '0';
|
|
2273
2391
|
/**
|
|
2274
|
-
*
|
|
2392
|
+
* DbxFirebaseIdRouteParamRedirect instance
|
|
2275
2393
|
*/
|
|
2276
|
-
class
|
|
2277
|
-
constructor(
|
|
2278
|
-
super();
|
|
2279
|
-
this.dbxFirebaseDocumentStoreDirective = dbxFirebaseDocumentStoreDirective;
|
|
2394
|
+
class DbxFirebaseIdRouteParamRedirectInstance {
|
|
2395
|
+
constructor(dbxRouterService) {
|
|
2280
2396
|
this.dbxRouterService = dbxRouterService;
|
|
2281
|
-
this._paramReader = new DbxRouteParamReaderInstance(this.dbxRouterService,
|
|
2397
|
+
this._paramReader = new DbxRouteParamReaderInstance(this.dbxRouterService, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY);
|
|
2282
2398
|
this._paramRedirect = new DbxRouteParamDefaultRedirectInstance(this._paramReader);
|
|
2283
|
-
this.
|
|
2284
|
-
this._useDefaultParam$ = this.
|
|
2399
|
+
this._useDefaultParamDecider = new BehaviorSubject(DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE);
|
|
2400
|
+
this._useDefaultParam$ = this._useDefaultParamDecider.pipe(map((x) => {
|
|
2285
2401
|
let result;
|
|
2286
2402
|
if (typeof x === 'string') {
|
|
2287
2403
|
result = (value) => of(value === x);
|
|
@@ -2291,41 +2407,81 @@ class DbxFirebaseDocumentStoreRouteIdDirective extends AbstractSubscriptionDirec
|
|
|
2291
2407
|
}
|
|
2292
2408
|
return result;
|
|
2293
2409
|
}), shareReplay(1));
|
|
2294
|
-
this.
|
|
2295
|
-
this.
|
|
2296
|
-
this.
|
|
2410
|
+
this.paramValue$ = this._paramReader.paramValue$;
|
|
2411
|
+
this.defaultValue$ = this._paramReader.defaultValue$;
|
|
2412
|
+
this.value$ = this._paramReader.value$;
|
|
2413
|
+
this.idFromParams$ = this.paramValue$;
|
|
2414
|
+
this.id$ = this.value$;
|
|
2297
2415
|
}
|
|
2298
|
-
|
|
2299
|
-
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.idFromParams$);
|
|
2416
|
+
init() {
|
|
2300
2417
|
this._paramRedirect.setUseDefaultFilter((value) => {
|
|
2301
2418
|
return this._useDefaultParam$.pipe(switchMap((x) => x(value)));
|
|
2302
2419
|
});
|
|
2303
2420
|
this._paramRedirect.init();
|
|
2304
2421
|
}
|
|
2305
|
-
|
|
2306
|
-
super.ngOnDestroy();
|
|
2422
|
+
destroy() {
|
|
2307
2423
|
this._paramReader.destroy();
|
|
2308
2424
|
this._paramRedirect.destroy();
|
|
2309
|
-
this.
|
|
2425
|
+
this._useDefaultParamDecider.complete();
|
|
2426
|
+
}
|
|
2427
|
+
get paramKey() {
|
|
2428
|
+
return this._paramReader.paramKey;
|
|
2429
|
+
}
|
|
2430
|
+
set paramKey(paramKey) {
|
|
2431
|
+
this._paramReader.paramKey = paramKey;
|
|
2432
|
+
}
|
|
2433
|
+
setDefaultValue(defaultValue) {
|
|
2434
|
+
this._paramReader.setDefaultValue(defaultValue);
|
|
2435
|
+
}
|
|
2436
|
+
setRedirectEnabled(redirect) {
|
|
2437
|
+
this._paramRedirect.enabled = redirect !== false;
|
|
2438
|
+
}
|
|
2439
|
+
setDecider(decider) {
|
|
2440
|
+
this._useDefaultParamDecider.next(decider);
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
function dbxFirebaseIdRouteParamRedirect(dbxRouterService) {
|
|
2444
|
+
return new DbxFirebaseIdRouteParamRedirectInstance(dbxRouterService);
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
/**
|
|
2448
|
+
* Used for synchronizing the document store id to the param of the route.
|
|
2449
|
+
*/
|
|
2450
|
+
class DbxFirebaseDocumentStoreRouteIdDirective extends AbstractSubscriptionDirective {
|
|
2451
|
+
constructor(dbxFirebaseDocumentStoreDirective, dbxRouterService) {
|
|
2452
|
+
super();
|
|
2453
|
+
this.dbxFirebaseDocumentStoreDirective = dbxFirebaseDocumentStoreDirective;
|
|
2454
|
+
this.dbxRouterService = dbxRouterService;
|
|
2455
|
+
this._redirectInstance = dbxFirebaseIdRouteParamRedirect(this.dbxRouterService);
|
|
2456
|
+
this.idFromParams$ = this._redirectInstance.paramValue$;
|
|
2457
|
+
this.id$ = this._redirectInstance.value$;
|
|
2458
|
+
}
|
|
2459
|
+
ngOnInit() {
|
|
2460
|
+
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.idFromParams$);
|
|
2461
|
+
this._redirectInstance.init();
|
|
2462
|
+
}
|
|
2463
|
+
ngOnDestroy() {
|
|
2464
|
+
super.ngOnDestroy();
|
|
2465
|
+
this._redirectInstance.destroy();
|
|
2310
2466
|
}
|
|
2311
2467
|
// MARK: Input
|
|
2312
2468
|
get idParam() {
|
|
2313
|
-
return this.
|
|
2469
|
+
return this._redirectInstance.paramKey;
|
|
2314
2470
|
}
|
|
2315
2471
|
set idParam(idParam) {
|
|
2316
|
-
this.
|
|
2472
|
+
this._redirectInstance.paramKey = idParam;
|
|
2317
2473
|
}
|
|
2318
2474
|
set dbxFirebaseDocumentStoreRouteIdDefault(defaultValue) {
|
|
2319
|
-
this.
|
|
2475
|
+
this._redirectInstance.setDefaultValue(defaultValue);
|
|
2320
2476
|
}
|
|
2321
2477
|
/**
|
|
2322
2478
|
* Whether or not to enable the redirection. Is enabled by default.
|
|
2323
2479
|
*/
|
|
2324
2480
|
set dbxFirebaseDocumentStoreRouteIdDefaultRedirect(redirect) {
|
|
2325
|
-
this.
|
|
2481
|
+
this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default
|
|
2326
2482
|
}
|
|
2327
2483
|
set dbxFirebaseDocumentStoreRouteIdDefaultDecision(decider) {
|
|
2328
|
-
this.
|
|
2484
|
+
this._redirectInstance.setDecider(decider);
|
|
2329
2485
|
}
|
|
2330
2486
|
}
|
|
2331
2487
|
DbxFirebaseDocumentStoreRouteIdDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDocumentStoreRouteIdDirective, deps: [{ token: DbxFirebaseDocumentStoreDirective, host: true }, { token: i3$1.DbxRouterService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -2393,6 +2549,7 @@ class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
|
|
|
2393
2549
|
itemsPerPage: x.itemsPerPage,
|
|
2394
2550
|
constraints: x.constraints
|
|
2395
2551
|
})))), cleanupDestroyable(), distinctUntilChanged(), shareReplay(1));
|
|
2552
|
+
this.constraints$ = this.loader$.pipe(switchMap((x) => x.constraints$));
|
|
2396
2553
|
this.firestoreIteration$ = this.loader$.pipe(switchMap((x) => x.firestoreIteration$));
|
|
2397
2554
|
this.queryChangeWatcher$ = this.loader$.pipe(switchMap((x) => x.queryChangeWatcher$));
|
|
2398
2555
|
this.accumulator$ = this.loader$.pipe(switchMap((x) => x.accumulator$));
|
|
@@ -2737,5 +2894,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2737
2894
|
* Generated bundle index. Do not edit.
|
|
2738
2895
|
*/
|
|
2739
2896
|
|
|
2740
|
-
export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore,
|
|
2897
|
+
export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_OPTIONS_TOKEN, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DbxFirebaseAppCheckHttpInterceptor, DbxFirebaseAuthContextInfo, DbxFirebaseAuthLoginService, DbxFirebaseAuthModule, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionChangeTriggerInstance, DbxFirebaseCollectionChangeWatcherInstance, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionStoreDirective, DbxFirebaseCollectionWithParentStoreDirective, DbxFirebaseDefaultAppCheckProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultFirebaseProvidersModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultFunctionsProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDocumentAuthIdDirective, DbxFirebaseDocumentLoaderInstance, DbxFirebaseDocumentStoreDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseEmailFormComponent, DbxFirebaseEmailRecoveryFormComponent, DbxFirebaseEmulatorModule, DbxFirebaseFirestoreCollectionModule, DbxFirebaseFunctionsModule, DbxFirebaseIdRouteParamRedirectInstance, DbxFirebaseLoginAnonymousComponent, DbxFirebaseLoginAppleComponent, DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent, DbxFirebaseLoginComponent, DbxFirebaseLoginContext, DbxFirebaseLoginContextBackButtonComponent, DbxFirebaseLoginContextDirective, DbxFirebaseLoginEmailComponent, DbxFirebaseLoginEmailContentComponent, DbxFirebaseLoginFacebookComponent, DbxFirebaseLoginGitHubComponent, DbxFirebaseLoginGoogleComponent, DbxFirebaseLoginListComponent, DbxFirebaseLoginMicrosoftComponent, DbxFirebaseLoginModule, DbxFirebaseLoginModuleRootConfig, DbxFirebaseLoginTermsComponent, DbxFirebaseLoginTermsSimpleComponent, DbxFirebaseLoginTwitterComponent, DbxFirebaseModelModule, DbxFirebaseModelStoreModule, DbxFirebaseModule, DbxFirebaseParsedEmulatorsConfig, DbxFirebaseRegisterComponent, DbxFirebaseRegisterEmailComponent, DbxFirestoreContextService, DbxLimitedFirebaseDocumentLoaderInstance, FIREBASE_AUTH_NETWORK_REQUEST_ERROR, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY, authRolesObsWithClaimsService, authUserInfoFromAuthUser, authUserStateFromFirebaseAuthService, dbxFirebaseCollectionChangeTrigger, dbxFirebaseCollectionChangeTriggerForStore, dbxFirebaseCollectionChangeTriggerForWatcher, dbxFirebaseCollectionChangeTriggerInstance, dbxFirebaseCollectionChangeTriggerInstanceForStore, dbxFirebaseCollectionChangeTriggerInstanceForWatcher, dbxFirebaseCollectionChangeWatcher, dbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstanceWithCollection, dbxFirebaseDocumentLoaderInstance, dbxFirebaseDocumentLoaderInstanceWithAccessor, dbxFirebaseIdRouteParamRedirect, dbxLimitedFirebaseDocumentLoaderInstance, dbxLimitedFirebaseDocumentLoaderInstanceWithAccessor, defaultDbxFirebaseAuthServiceDelegateWithClaimsService, defaultFirebaseAuthLoginProvidersFactory, enableAppCheckDebugTokenGeneration, firebaseAuthErrorToReadableError, firebaseAuthTokenFromUser, firebaseDocumentStoreCreateFunction, firebaseDocumentStoreDeleteFunction, firebaseDocumentStoreUpdateFunction, modelDoesNotExistError, provideDbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionWithParentStoreDirective, provideDbxFirebaseDocumentStoreDirective, readValueFromIdToken, setParentStoreEffect };
|
|
2741
2898
|
//# sourceMappingURL=dereekb-dbx-firebase.mjs.map
|