@dereekb/dbx-firebase 8.5.3 → 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/index.mjs +2 -1
- package/esm2020/lib/model/loader/collection.change.trigger.mjs +19 -6
- package/esm2020/lib/model/loader/collection.change.watcher.mjs +1 -1
- 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/store/store.collection.change.directive.mjs +3 -3
- 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 +82 -30
- package/fesm2015/dereekb-dbx-firebase.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-firebase.mjs +82 -30
- 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 +30 -19
- package/lib/model/loader/collection.change.watcher.d.ts +6 -6
- package/lib/model/loader/collection.loader.d.ts +12 -9
- package/lib/model/loader/collection.loader.instance.d.ts +2 -6
- package/lib/model/store/store.collection.change.directive.d.ts +1 -1
- 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
|
@@ -1979,23 +1979,36 @@ class DbxFirebaseCollectionChangeTriggerInstance {
|
|
|
1979
1979
|
* @param triggerFunction
|
|
1980
1980
|
* @returns
|
|
1981
1981
|
*/
|
|
1982
|
-
function
|
|
1983
|
-
return
|
|
1982
|
+
function dbxFirebaseCollectionChangeTriggerForStore(store, triggerFunction) {
|
|
1983
|
+
return dbxFirebaseCollectionChangeTrigger({
|
|
1984
1984
|
watcher: dbxFirebaseCollectionChangeWatcher(store, 'auto'),
|
|
1985
1985
|
destroyWatcherOnDestroy: true,
|
|
1986
1986
|
triggerFunction
|
|
1987
1987
|
});
|
|
1988
1988
|
}
|
|
1989
|
-
function
|
|
1990
|
-
return
|
|
1989
|
+
function dbxFirebaseCollectionChangeTriggerForWatcher(watcher, triggerFunction) {
|
|
1990
|
+
return dbxFirebaseCollectionChangeTrigger({
|
|
1991
1991
|
watcher,
|
|
1992
1992
|
destroyWatcherOnDestroy: false,
|
|
1993
1993
|
triggerFunction
|
|
1994
1994
|
});
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1996
|
+
function dbxFirebaseCollectionChangeTrigger(config) {
|
|
1997
1997
|
return new DbxFirebaseCollectionChangeTriggerInstance(config);
|
|
1998
1998
|
}
|
|
1999
|
+
// MARK: Compat
|
|
2000
|
+
/**
|
|
2001
|
+
* @deprecated
|
|
2002
|
+
*/
|
|
2003
|
+
const dbxFirebaseCollectionChangeTriggerInstance = dbxFirebaseCollectionChangeTrigger;
|
|
2004
|
+
/**
|
|
2005
|
+
* @deprecated
|
|
2006
|
+
*/
|
|
2007
|
+
const dbxFirebaseCollectionChangeTriggerInstanceForStore = dbxFirebaseCollectionChangeTriggerForStore;
|
|
2008
|
+
/**
|
|
2009
|
+
* @deprecated
|
|
2010
|
+
*/
|
|
2011
|
+
const dbxFirebaseCollectionChangeTriggerInstanceForWatcher = dbxFirebaseCollectionChangeTriggerForWatcher;
|
|
1999
2012
|
|
|
2000
2013
|
/**
|
|
2001
2014
|
* DbxFirebaseModelLoader implementation within an instance.
|
|
@@ -2218,7 +2231,7 @@ class DbxFirebaseCollectionChangeDirective {
|
|
|
2218
2231
|
constructor(dbxFirebaseCollectionStoreDirective) {
|
|
2219
2232
|
this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
|
|
2220
2233
|
this._watcher = dbxFirebaseCollectionChangeWatcher(this.dbxFirebaseCollectionStoreDirective.store);
|
|
2221
|
-
this._trigger =
|
|
2234
|
+
this._trigger = dbxFirebaseCollectionChangeTriggerForWatcher(this._watcher, () => this.restart());
|
|
2222
2235
|
this.mode$ = this._watcher.mode$;
|
|
2223
2236
|
this.event$ = this._watcher.event$;
|
|
2224
2237
|
this.hasChangeAvailable$ = this._watcher.hasChangeAvailable$;
|
|
@@ -2405,20 +2418,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2405
2418
|
}] }];
|
|
2406
2419
|
} });
|
|
2407
2420
|
|
|
2408
|
-
const
|
|
2409
|
-
const
|
|
2421
|
+
const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY = 'id';
|
|
2422
|
+
const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE = '0';
|
|
2410
2423
|
/**
|
|
2411
|
-
*
|
|
2424
|
+
* DbxFirebaseIdRouteParamRedirect instance
|
|
2412
2425
|
*/
|
|
2413
|
-
class
|
|
2414
|
-
constructor(
|
|
2415
|
-
super();
|
|
2416
|
-
this.dbxFirebaseDocumentStoreDirective = dbxFirebaseDocumentStoreDirective;
|
|
2426
|
+
class DbxFirebaseIdRouteParamRedirectInstance {
|
|
2427
|
+
constructor(dbxRouterService) {
|
|
2417
2428
|
this.dbxRouterService = dbxRouterService;
|
|
2418
|
-
this._paramReader = new DbxRouteParamReaderInstance(this.dbxRouterService,
|
|
2429
|
+
this._paramReader = new DbxRouteParamReaderInstance(this.dbxRouterService, DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY);
|
|
2419
2430
|
this._paramRedirect = new DbxRouteParamDefaultRedirectInstance(this._paramReader);
|
|
2420
|
-
this.
|
|
2421
|
-
this._useDefaultParam$ = this.
|
|
2431
|
+
this._useDefaultParamDecider = new BehaviorSubject(DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE);
|
|
2432
|
+
this._useDefaultParam$ = this._useDefaultParamDecider.pipe(map((x) => {
|
|
2422
2433
|
let result;
|
|
2423
2434
|
if (typeof x === 'string') {
|
|
2424
2435
|
result = (value) => of(value === x);
|
|
@@ -2428,41 +2439,81 @@ class DbxFirebaseDocumentStoreRouteIdDirective extends AbstractSubscriptionDirec
|
|
|
2428
2439
|
}
|
|
2429
2440
|
return result;
|
|
2430
2441
|
}), shareReplay(1));
|
|
2431
|
-
this.
|
|
2432
|
-
this.
|
|
2433
|
-
this.
|
|
2442
|
+
this.paramValue$ = this._paramReader.paramValue$;
|
|
2443
|
+
this.defaultValue$ = this._paramReader.defaultValue$;
|
|
2444
|
+
this.value$ = this._paramReader.value$;
|
|
2445
|
+
this.idFromParams$ = this.paramValue$;
|
|
2446
|
+
this.id$ = this.value$;
|
|
2434
2447
|
}
|
|
2435
|
-
|
|
2436
|
-
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.idFromParams$);
|
|
2448
|
+
init() {
|
|
2437
2449
|
this._paramRedirect.setUseDefaultFilter((value) => {
|
|
2438
2450
|
return this._useDefaultParam$.pipe(switchMap((x) => x(value)));
|
|
2439
2451
|
});
|
|
2440
2452
|
this._paramRedirect.init();
|
|
2441
2453
|
}
|
|
2442
|
-
|
|
2443
|
-
super.ngOnDestroy();
|
|
2454
|
+
destroy() {
|
|
2444
2455
|
this._paramReader.destroy();
|
|
2445
2456
|
this._paramRedirect.destroy();
|
|
2446
|
-
this.
|
|
2457
|
+
this._useDefaultParamDecider.complete();
|
|
2458
|
+
}
|
|
2459
|
+
get paramKey() {
|
|
2460
|
+
return this._paramReader.paramKey;
|
|
2461
|
+
}
|
|
2462
|
+
set paramKey(paramKey) {
|
|
2463
|
+
this._paramReader.paramKey = paramKey;
|
|
2464
|
+
}
|
|
2465
|
+
setDefaultValue(defaultValue) {
|
|
2466
|
+
this._paramReader.setDefaultValue(defaultValue);
|
|
2467
|
+
}
|
|
2468
|
+
setRedirectEnabled(redirect) {
|
|
2469
|
+
this._paramRedirect.enabled = redirect !== false;
|
|
2470
|
+
}
|
|
2471
|
+
setDecider(decider) {
|
|
2472
|
+
this._useDefaultParamDecider.next(decider);
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
function dbxFirebaseIdRouteParamRedirect(dbxRouterService) {
|
|
2476
|
+
return new DbxFirebaseIdRouteParamRedirectInstance(dbxRouterService);
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
/**
|
|
2480
|
+
* Used for synchronizing the document store id to the param of the route.
|
|
2481
|
+
*/
|
|
2482
|
+
class DbxFirebaseDocumentStoreRouteIdDirective extends AbstractSubscriptionDirective {
|
|
2483
|
+
constructor(dbxFirebaseDocumentStoreDirective, dbxRouterService) {
|
|
2484
|
+
super();
|
|
2485
|
+
this.dbxFirebaseDocumentStoreDirective = dbxFirebaseDocumentStoreDirective;
|
|
2486
|
+
this.dbxRouterService = dbxRouterService;
|
|
2487
|
+
this._redirectInstance = dbxFirebaseIdRouteParamRedirect(this.dbxRouterService);
|
|
2488
|
+
this.idFromParams$ = this._redirectInstance.paramValue$;
|
|
2489
|
+
this.id$ = this._redirectInstance.value$;
|
|
2490
|
+
}
|
|
2491
|
+
ngOnInit() {
|
|
2492
|
+
this.sub = this.dbxFirebaseDocumentStoreDirective.store.setId(this.idFromParams$);
|
|
2493
|
+
this._redirectInstance.init();
|
|
2494
|
+
}
|
|
2495
|
+
ngOnDestroy() {
|
|
2496
|
+
super.ngOnDestroy();
|
|
2497
|
+
this._redirectInstance.destroy();
|
|
2447
2498
|
}
|
|
2448
2499
|
// MARK: Input
|
|
2449
2500
|
get idParam() {
|
|
2450
|
-
return this.
|
|
2501
|
+
return this._redirectInstance.paramKey;
|
|
2451
2502
|
}
|
|
2452
2503
|
set idParam(idParam) {
|
|
2453
|
-
this.
|
|
2504
|
+
this._redirectInstance.paramKey = idParam;
|
|
2454
2505
|
}
|
|
2455
2506
|
set dbxFirebaseDocumentStoreRouteIdDefault(defaultValue) {
|
|
2456
|
-
this.
|
|
2507
|
+
this._redirectInstance.setDefaultValue(defaultValue);
|
|
2457
2508
|
}
|
|
2458
2509
|
/**
|
|
2459
2510
|
* Whether or not to enable the redirection. Is enabled by default.
|
|
2460
2511
|
*/
|
|
2461
2512
|
set dbxFirebaseDocumentStoreRouteIdDefaultRedirect(redirect) {
|
|
2462
|
-
this.
|
|
2513
|
+
this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default
|
|
2463
2514
|
}
|
|
2464
2515
|
set dbxFirebaseDocumentStoreRouteIdDefaultDecision(decider) {
|
|
2465
|
-
this.
|
|
2516
|
+
this._redirectInstance.setDecider(decider);
|
|
2466
2517
|
}
|
|
2467
2518
|
}
|
|
2468
2519
|
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 });
|
|
@@ -2532,6 +2583,7 @@ class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
|
|
|
2532
2583
|
itemsPerPage: x.itemsPerPage,
|
|
2533
2584
|
constraints: x.constraints
|
|
2534
2585
|
})))), cleanupDestroyable(), distinctUntilChanged(), shareReplay(1));
|
|
2586
|
+
this.constraints$ = this.loader$.pipe(switchMap((x) => x.constraints$));
|
|
2535
2587
|
this.firestoreIteration$ = this.loader$.pipe(switchMap((x) => x.firestoreIteration$));
|
|
2536
2588
|
this.queryChangeWatcher$ = this.loader$.pipe(switchMap((x) => x.queryChangeWatcher$));
|
|
2537
2589
|
this.accumulator$ = this.loader$.pipe(switchMap((x) => x.accumulator$));
|
|
@@ -2872,5 +2924,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2872
2924
|
* Generated bundle index. Do not edit.
|
|
2873
2925
|
*/
|
|
2874
2926
|
|
|
2875
|
-
export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore,
|
|
2927
|
+
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 };
|
|
2876
2928
|
//# sourceMappingURL=dereekb-dbx-firebase.mjs.map
|